fix: stale cli.py / _bin/ references break tests + action_surface#10
Merged
Conversation
…oses #9) Followup cleanup to #7 (drop Python CLI shim, ship raw wheel script). The package-side refactor worked at the wheel-build level but left stale source-tree references in two artifact-walking tools — same failure shape as fbuild#748 (a packaging refactor that worked at the wheel level but broke a tool walking the source tree a different way). Stale references found by `git grep '_bin\|template_python_rust_cmd\.cli'`: 1. `tests/test_cli.py` — imported `template_python_rust_cmd.cli. packaged_binary_path` (module deleted in #7). Whole file failed to collect with ImportError; the suite was silently 1 file short. 2. `ci/gates/action_surface.py::_binary_path()` — listed `src/template_python_rust_cmd/_bin/template-cli[.exe]` as its FIRST lookup candidate. That directory was removed in #7. Fallback to target/release worked locally but the gate doesn't honor CARGO_TARGET_DIR (pinned to ~/.template-python-rust-cmd/cargo-target/ wheel-build in #5), so it silently misses the binary on a wheel-build-driven runner. 3. `tests/README.md` — described `test_cli.py` as covering "the Python CLI shim's binary-discovery logic" (module gone). Fix: - `tests/test_cli.py` rewritten as a runtime contract check: probe PATH for `template-cli`, skip if absent (dev venv without install), otherwise assert it's invokable and produces non-empty --version output. Matches the new shipping mechanism (raw wheel script) which doesn't leave a source-tree probe target. - `ci/gates/action_surface.py::_binary_path()` now searches, in order: 1. $CARGO_TARGET_DIR/{release,debug}/ if set 2. ROOT/target/{release,debug}/ for the local ./test flow 3. PATH via shutil.which for pip/uv-installed binaries Updated the "no binary found" warning to match. - `tests/README.md` describes what test_cli.py actually does now. Verified: - `uv run pytest tests/test_cli.py tests/test_version.py tests/test_bindings.py -v` → 2 pass, 2 skip (test_cli skips because dev venv has no installed template-cli — expected behavior). - `./ci.sh test` → 34 pass, 2 skip, [test] ok. - `./ci.sh action_surface` → finds the binary, gate passes. Closes #9. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
5 tasks
zackees
added a commit
that referenced
this pull request
Jun 22, 2026
Followup to #7 (raw wheel script) and #9/#10 (test + gate cleanup). #9 fixed the tools that broke at runtime; this PR fixes the docs that broke at the human-reader level. Same failure shape as fbuild#748: a packaging refactor was correct at the wheel-build path but downstream readers walking artifacts a different way still saw the dead shape. Files touched (doc-only; no behavioral change): - README.md: tree diagram no longer shows cli.py/_bin/. Packaging section describes the actual raw-wheel-script mechanism. - CLAUDE.md: agent-routing doc now describes the post-#7 wheel layout + the pinned CARGO_TARGET_DIR build pipeline. No more cli.py shim invariants. - ENHANCE.md: invariants updated — "no Python shim, raw wheel script, re-adding [project.scripts] would re-introduce the Windows os.execv race" replaces the old shim invariants. - crates/template-cli/README.md: describes the inject_cli_into_wheel step instead of the deleted _bin/ staging step. - docs/ARCHITECTURE.md: package contents accurately reflect what's actually in src/template_python_rust_cmd/ today (no cli.py listed). - docs/RELEASE.md: build_wheel.py described as cargo → maturin → inject into .data/scripts/, not stage into _bin/. Verified: - `grep -rn '_bin\|template_python_rust_cmd\.cli\|cli\.py' README.md CLAUDE.md ENHANCE.md docs/ crates/template-cli/README.md` returns only historical-context references explicitly explaining the migration (acceptance-criterion-allowed). - `./ci.sh test` → 34 pass, 2 skip. - `./ci.sh action_yaml` → ok. - `./ci.sh action_surface` → ok. Closes #11. Refs #7, #9, fbuild#748. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Same failure shape as fbuild#748: PR #7 refactored the wheel-build path (ship
template-clias raw wheel script, drop the Python launcher) but left stale source-tree references in two artifact-walking tools.tests/test_cli.pyimportedtemplate_python_rust_cmd.cli.packaged_binary_path— module deleted in fix(install): ship template-cli as raw wheel script; drop Python shim #7. Whole file failed to collect.ci/gates/action_surface.pyhadsrc/template_python_rust_cmd/_bin/as the FIRST lookup candidate. Dead path. Also didn't honorCARGO_TARGET_DIR(pinned by perf(install): pin CARGO_TARGET_DIR + disable PEP 517 isolation #5).tests/README.mddescribedtest_cli.pyas covering the deleted shim.Fixes:
template-cli, skips when absent (dev venv), otherwise asserts--versionreturns code 0 with non-empty output.$CARGO_TARGET_DIR→ROOT/target→ PATH. Matches the new shipping topology.Test plan
./ci.sh test→ 34 pass, 2 skip (intentional)../ci.sh action_surface→ ok.grep -rn '_bin\|template_python_rust_cmd\.cli' tests/ ci/ src/returns no live-code hits.Closes #9. Refs #7, fbuild#748.
🤖 Generated with Claude Code