fix(release): close the blind-run 16-18 gaps -- back-fill floor, run-pre-tag diagnosis, apply-bump - #601
Merged
Merged
Conversation
…pre-tag diagnosis, apply-bump - _tree_state()'s internal probe now carries the same audit-scratch exemption (:/ + ,top exclusions for gate-events.log and .markers/) the release skill already requires everywhere else, so a mid-window log append is no longer read as a mutating pre-tag command (#584 MEDIUM-1). - run-pre-tag now distinguishes four outcomes instead of two: exit 5 (a command RAN and reported drift), exit 6 (a command MUTATED the tree), new exit 7 (a command's interpreter/program could not be located at all -- not drift, no discard needed), and new exit 8 (the tree-state probe itself failed -- no verdict about any command exists) (#585 MEDIUM-2, #584 MEDIUM-1/MEDIUM-3). - Every declared pre-tag command now runs with PY set to this process's own resolved interpreter, so a row may portably spell "$PY" instead of a hardcoded interpreter (#583 MEDIUM-2, #584 MEDIUM-3). - New apply-bump <base> <word> subcommand mechanizes the version-bump arithmetic that was the release lane's last by-eye step; refuses "none" and any non-major/minor/patch word (#585 MEDIUM-3). - Pinned first_release_baseline's existing oldest-of-several behavior with an additional CLI-level two-file test. - SKILL.md: floors the first-release footer check on the earliest addition of CONTEXT.md OR release-targets.md, so a Back-fill consumer's own first release can clear Phase 1 step 3 (#585 HIGH); checks the $REBUILD subshell's own exit code before trusting any freshness assertion (#585 MEDIUM); documents exit 7/8 in the 6d and Phase-1-gate exit-code prose (#585 MEDIUM-2, #584 MEDIUM-3); states the declared-command PY portability contract in Targets (#583 MEDIUM-2, #584 MEDIUM-3); rekeys the CONTEXT.md default-branch fallback on the fact being unresolvable rather than the file being absent (#584 MEDIUM-2); hardens the python3 App Execution Alias probe to actually run it, not just resolve it (#584 LOW); adds git fetch --tags before LAST_TAG resolution (#585 LOW); spells the one sanctioned multi-valued-field split (#585 LOW); fixes a stale $REBUILD cross-reference and two LOW wording items (#585 LOW, #583 LOW). - Version bumps for the payload changes above: ca 2.11.2, ca-codex 0.4.1, ca-pi 0.2.1 (root package.json regenerated via ca-pi's declared generate command). README badge and ca-codex-version line, ca and ca-pi CHANGELOG top sections updated to match. Part 3 (rewriting .codearbiter/release-targets.md's hardcoded python3 to "$PY") is deliberately NOT included -- see PR body for the measured reason. Closes #585, closes #584, closes #583. CHANGELOG: release lane: back-fill first releases clear the footer check, run-pre-tag distinguishes could-not-run from drift, and the version bump is mechanized via apply-bump Claude-Session: https://claude.ai/code/session_01QjJeSbcwPHwMmd6CEZeagB
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
The exit-7 remedy text and the SKILL.md interpreter-convention prose told every consumer to spell a declared row's interpreter as "$PY" -- including on Windows, where run-pre-tag's subprocess.run(shell=True) always dispatches via cmd.exe, which performs no $VAR expansion. A row spelled "$PY" there is passed through as the literal token "$PY", fails outside the documented could-not-run set, and reads as exit 5 drift -- the exact misdiagnosis this issue cluster exists to close. Measured end-to-end on Windows before writing this fix. Both the CLI's exit-7 stderr and the SKILL.md prose (the "Targets" section's row-interpreter paragraph, and 6d's exit-7 remedy) now name the platform split explicitly: "$PY" is safe on a POSIX-hosted row, a Windows-hosted row keeps a concrete interpreter until run-pre-tag resolves a POSIX-compatible shell there. No behavioral change -- prose and diagnostic-message wording only, so the existing 357-test suite (280 subtests) still passes unchanged. CHANGELOG: Fixed run-pre-tag's exit-7 remedy and the release skill's interpreter-convention prose recommending "$PY" for a declared row on Windows, where it silently fails and is misread as exit-5 drift. Claude-Session: https://claude.ai/code/session_01QjJeSbcwPHwMmd6CEZeagB
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
Closes the open findings from blind agent-judgment runs 16-18 against the release skill (issues #585, #584, #583).
_tree_state()'s internal probe now carries the same audit-scratch exemption (:/+,topexclusions forgate-events.logand.markers/) the release skill already requires everywhere an agent runs the check by hand, so a mid-window log append is no longer read as a mutating pre-tag command (release lane: four portability/diagnosis gaps below HIGH from blind exercise run 17 #584 MEDIUM-1).run-pre-tagnow distinguishes four outcomes instead of two: exit 5 (a command RAN and reported drift), exit 6 (a command MUTATED the tree), new exit 7 (a command's interpreter/program could not be located at all -- NOT drift, no discard needed), and new exit 8 (the tree-state probe itself failed -- no verdict about any command exists) (release lane: Back-fill's first release cannot clear step 3, plus six lesser gaps (blind run 18) #585 MEDIUM-2, release lane: four portability/diagnosis gaps below HIGH from blind exercise run 17 #584 MEDIUM-1/MEDIUM-3).PYset to this process's own resolved interpreter, so a row may portably spell"$PY"instead of a hardcoded interpreter (release skill: three portability gaps below HIGH from blind exercise run 16 #583 MEDIUM-2, release lane: four portability/diagnosis gaps below HIGH from blind exercise run 17 #584 MEDIUM-3).apply-bump <base> <word>subcommand mechanizes the version-bump arithmetic that was the release lane's last by-eye step; refusesnoneand any non-major/minor/patch word (release lane: Back-fill's first release cannot clear step 3, plus six lesser gaps (blind run 18) #585 MEDIUM-3).first_release_baselinealready took the oldest of several additions (git logprints newest-first, the function takes the last line) -- pinned with an additional CLI-level two-file test.CONTEXT.mdORrelease-targets.md, so a Back-fill consumer's own first release can clear Phase 1 step 3 (release lane: Back-fill's first release cannot clear step 3, plus six lesser gaps (blind run 18) #585 HIGH).$REBUILDsubshell's own exit code before trusting any freshness assertion (release lane: Back-fill's first release cannot clear step 3, plus six lesser gaps (blind run 18) #585 MEDIUM).PYportability contract in "Targets" (release skill: three portability gaps below HIGH from blind exercise run 16 #583 MEDIUM-2, release lane: four portability/diagnosis gaps below HIGH from blind exercise run 17 #584 MEDIUM-3).CONTEXT.mddefault-branch fallback on the FACT being unresolvable rather than the FILE being absent (release lane: four portability/diagnosis gaps below HIGH from blind exercise run 17 #584 MEDIUM-2).python3App Execution Alias probe to actually run it, not just resolve it (release lane: four portability/diagnosis gaps below HIGH from blind exercise run 17 #584 LOW).git fetch --tagsbeforeLAST_TAGresolution (release lane: Back-fill's first release cannot clear step 3, plus six lesser gaps (blind run 18) #585 LOW).$REBUILDcross-reference and two LOW wording items (release lane: Back-fill's first release cannot clear step 3, plus six lesser gaps (blind run 18) #585 LOW, release skill: three portability gaps below HIGH from blind exercise run 16 #583 LOW).ca2.11.2,ca-codex0.4.1,ca-pi0.2.1 (rootpackage.jsonregenerated via ca-pi's declaredgeneratecommand, never hand-edited). README badge, README's "currently shipsca-codex X.Y.Z" line, andca/ca-piCHANGELOG top sections updated to match and verified againstcheck_badge_consistency.py,site/test/content/readme-professional.test.ts, andtest_release_trace.py.Deliberately NOT included: Part 3 (rewriting
.codearbiter/release-targets.md's hardcodedpython3)The spec asked for this repo's own declared rows (
ca's threepre-tagentries,ca-pi'sgenerateandpre-tag) to be rewritten from hardcodedpython3to"$PY". Measured before making that edit:run-pre-tagexecutes declared commands viasubprocess.run(command, shell=True, cwd=project_root). On Windows,shell=Truealways dispatches throughcmd.exe(viaCOMSPEC), regardless of what shell launched the outer Python process (git-bash, PowerShell, or otherwise) -- this is a CPythonsubprocessmodule behavior, not a host configuration.cmd.exedoes not perform$VAR-style expansion, so a declared row spelled"$PY"is passed tocmd.exeas the literal string"$PY", which is not a recognized command.Verified end-to-end on this Windows 11 host: a declared pre-tag command
"$PY" --version(withPYcorrectly exported into the child's environment) returns'"$PY"' is not recognized as an internal or external commandand exit code 1 -- not one of the new exit-7 codes (126/127/9009), so it would be misdiagnosed as exit 5 ("ran and disagreed"), exactly the anti-pattern this whole issue cluster exists to close. Meanwhile this repo's currently-hardcodedpython3actually resolves and runs correctly viacmd.exeon this host (a realpython3.exe, not just an App-Execution-Alias stub). Making the row-rewrite change as specified would therefore regress this repo's own release lane on the exact host used to develop and maintain it, while doing nothing to fix the Windows-cmd.exe case Part 3 also doesn't address (a hardcoded-python3-only host with no bash and nopython3still fails, just under a different, now-correctly-diagnosed exit code).This is a structural gap in the
"$PY"-for-declared-commands design itself (1d/2g), not a row-authoring mistake:run-pre-tag'ssubprocess.run(shell=True)needs to dispatch declared commands through a POSIX-compatible shell on Windows (e.g.executable=<path-to-bash>) before row authors can safely follow the"$PY"convention Part 3 asked for. I've left this repo'srelease-targets.mduntouched and recommend filing this as a follow-up issue before Part 3 is attempted again. Everything else in the spec (1a-1g, all of Part 2's prose, Parts 4/5/6) is otherwise complete and independent of this gap.Follow-up commit on this branch: the first commit shipped the
"$PY"recommendation inrun-pre-tag's exit-7 remedy text and in SKILL.md's interpreter-convention prose without this Windows caveat -- i.e. it told every consumer to do the thing just measured as broken here, on the exact platform the surrounding prose names as its intended beneficiary. A second commit (fix(release): stop recommending "$PY" on the platform it breaks) corrects both: the exit-7 stderr and SKILL.md's "Targets"/6d prose now state explicitly that"$PY"is safe on a POSIX-hosted row and NOT yet safe on a Windows-hosted one, with the same measured explanation as above. Prose/message-only change; the 357-test suite is unaffected.Mutation-proof table
Every new test was shown to FAIL against the unfixed code (temporarily reverted the specific change, ran the test, observed failure, restored):
test_run_pre_tag_exempts_a_mid_window_gate_events_log_append_tree_state()'s probe to baregit status --porcelain(no exemption)6 != 0, BLOCK on the gate-events.log appendtest_run_pre_tag_exports_PY_to_declared_commandsenv={**os.environ, "PY": sys.executable}from the declared-commandsubprocess.run5 != 0, the check command exited 1 (noPYin env)test_could_not_run_recognizes_only_the_documented_codes_could_not_runhardcoded toreturn Falsetest_run_pre_tag_exits_7_when_a_declared_command_could_not_run_could_not_runmutant5 != 7, missing "COULD NOT RUN"/"NOT drift" in stderrtest_run_pre_tag_exits_8_when_the_tree_state_probe_failsreturn 8toreturn 66 != 8test_apply_bump_patch_minor_major/test_apply_bump_cli_prints_exactly_the_versionmajorarithmetic (f"{major}.0.0"instead off"{major + 1}.0.0")'2.0.0' != '3.0.0'test_apply_bump_refuses_none_and_nonsense_words/test_apply_bump_cli_exits_2_on_none_nonsense_or_bad_baseword not in _BUMP_WORDSchecknone/nonsensesilently bumped to'2.3.5'instead of refusing -- confirms the word-check is load-bearing, not vacuously covered by the CLI's generic bad-invocation armtest_apply_bump_refuses_a_non_semver_base/ same CLI testor _PLAIN_SEMVER_RE.fullmatch("0.0.0")fallbacknot-a-versionsilently resolved to'0.0.1'instead of refusingtest_adoption_commit_cli_two_file_pathspec_prints_the_oldest_additionfirst_release_baseline'sshas[-1]toshas[0]'bbbbbbb' != 'aaaaaaa'Test plan
.github/scripts/test_release_lib.py: 346 -> 357 tests, all passing (346 before any new tests; +11 new tests).github/scripts/test_release_trace.py+.github/scripts/test_build_surface.py: 69 passingplugins/ca/hooks/tests(NO_COLOR unset): 1580 passing (excludes two files with a known, pre-existing, unrelated worktree-environment artifact -- same failures reproduce on unmodifiedorigin/mainin this worktree)tools/sync-core.py --checkandtools/build-surface.py --check: both passpayload_version_gate.pyforcaandca-codex,build-host-packages.py --check --release-guard-base origin/mainforca-pi: all pass against the committed HEADcheck_badge_consistency.py,check_command_catalog.py: passsite/test/content/readme-professional.test.ts+ fullsitesuite (512 tests): passgit diff --check: clean, no CRLFCloses #585
Closes #584
Closes #583
https://claude.ai/code/session_01QjJeSbcwPHwMmd6CEZeagB