Commit b43b264
* fix: Restore missing should_proceed check and add empty copy detection in UVX mode (Issue #1940)
Two critical bugs in UVX file copying were identified through investigation:
Bug #1 (CRITICAL): Missing should_proceed check
- Root Cause: Accidentally removed in commit 03ff38c during RustyClawd refactor
- Impact: User consent ('n' response) ignored, files overwritten anyway
- Fix: Restore check after line 491, exit gracefully with code 0 on cancellation
Bug #2 (HIGH): Silent failure on empty copy
- Root Cause: No validation of copytree_manifest return value
- Impact: Claude launches with broken hooks when no files copied
- Fix: Add empty copy detection after line 521, exit with error code 1
Implementation:
- 17 lines total (Bug #1: 7 lines, Bug #2: 9 lines, import: 1 line)
- 4 unit tests, all passing
- Test ratio: 3.2:1 (within target for critical paths)
- Philosophy compliant: Zero-BS, Ruthless Simplicity, Fail-Fast
Investigation:
- 6-phase investigation workflow
- 6 agents deployed across 2 parallel waves
- Root cause verified in code and git history
- Complete findings in DISCOVERIES.md
Fixes Issue #1940
Co-Authored-By: Claude Sonnet 4.5 (1M context) <[email protected]>
* fix: Include .claude/ directory in package data for UVX deployment
The .claude/ directory contains essential framework files (agents, commands,
workflows, tools) that must be available when amplihack is installed via
uvx --from git syntax.
Previous behavior: Comment indicated custom build command handled .claude/
but that command was not running, causing empty copy failures in UVX mode.
New behavior: Explicitly include .claude/ in package-data so setuptools
bundles it in the wheel/sdist.
This fix addresses the root cause discovered during Bug #2 investigation:
when copytree_manifest() returns empty list because .claude/ is missing
from the installed package.
Related to Issue #1940
Co-Authored-By: Claude Sonnet 4.5 (1M context) <[email protected]>
* fix: Include .claude/ directory in wheel builds for UVX deployment (Issue #1940)
**Problem**:
- MANIFEST.in only controls sdist, not wheel distributions
- .claude/ directory at repo root (outside src/amplihack/)
- Wheels only include files inside Python packages
- Result: UVX installations failed with ".claude not found" error
- Wheel contained only 197 files (missing 817 framework files)
**Solution**:
Implemented custom build backend (build_hooks.py) that:
1. Copies .claude/ from repo root → src/amplihack/.claude/ before build
2. Setuptools includes .claude/ as package data in wheel
3. Cleans up src/amplihack/.claude/ after build (always, even on failure)
**Changes**:
- NEW: build_hooks.py - Custom build backend wrapping setuptools.build_meta
- MODIFIED: pyproject.toml - Use build_hooks backend, add .claude/**/.*
- MODIFIED: MANIFEST.in - Clarify sdist vs wheel behavior
- MODIFIED: .pre-commit-config.yaml - Exclude build_hooks.py from import check
- NEW: tests/test_wheel_packaging.py - Automated packaging verification
- NEW: docs/packaging/WHEEL_PACKAGING.md - Complete packaging documentation
- NEW: IMPLEMENTATION_SUMMARY.md - Implementation details and decisions
- NEW: .github/PACKAGING_VERIFICATION.md - CI/CD verification checklist
**Results**:
- Wheel now contains 1,014 files (817 from .claude/)
- UVX deployment works: "✅ Copied agents/amplihack" etc.
- Build cleanup verified (no leftover .claude/ in src/)
- All required subdirectories present (agents/, commands/, context/, skills/)
- Runtime directory properly excluded
**Testing**:
- Build test: python -m build --wheel
- UVX test: uvx --from ./dist/*.whl amplihack --help
- Automated tests: tests/test_wheel_packaging.py
- File verification: 817 .claude/ files in wheel
**Design Decisions**:
- ✅ Custom build backend (maintains repo structure, standard tools)
- ❌ Move .claude/ into src/ (breaks structure, requires path changes)
- ❌ Use data_files (installs outside package)
- ❌ MANIFEST.in only (doesn't affect wheels)
**Philosophy Alignment**:
- Ruthless Simplicity: Minimal code (~100 lines), standard tools
- Zero-BS Implementation: Working solution, no stubs or workarounds
- Modular Design: Self-contained build backend module
Co-Authored-By: Claude Sonnet 4.5 (1M context) <[email protected]>
---------
Co-authored-by: Ubuntu <azureuser@seldon-dev.ftnmxvem3frujn3lepas045p5c.xx.internal.cloudapp.net>
Co-authored-by: Claude Sonnet 4.5 (1M context) <[email protected]>
1 parent 0bcce39 commit b43b264
File tree
11 files changed
+1099
-9
lines changed- .claude/context
- .github
- docs/packaging
- src/amplihack
- tests
11 files changed
+1099
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
36 | 114 | | |
37 | 115 | | |
38 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
| 172 | + | |
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| |||
0 commit comments