fix(skills): rebuild stale repo preflight binary#2810
Conversation
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 require-ready-label-and-ciWonderful, this rule succeeded.
|
Greptile SummaryThis PR fixes a correctness gap in repo-mode preflight: instead of blindly trusting
Confidence Score: 5/5Safe to merge; the stale-binary check is limited to repo-mode setup and short-circuits immediately for any non-repo or binary-absent case. The change is well-scoped: it only runs in repo mode when both No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "test(cli): harden setup contract go log ..." | Re-trigger Greptile |
Merge Queue Status
This pull request spent 32 minutes 12 seconds in the queue, including 31 minutes 55 seconds running CI. Required conditions to merge
|
Summary
Repo-mode
/printing-presssetup no longer trusts an existing./cli-printing-pressblindly. If the local repo binary is older than the checked-out source version, the preflight rebuilds it before emittingPRINTING_PRESS_BIN; if that rebuild cannot happen, setup stops instead of continuing with a known-stale binary.Closes #2497
Approach
The setup contract now parses the checked-out source version from
internal/version/version.go, compares it with the repo-local binary'sversion --json, and rebuilds./cli-printing-pressonly when the local binary is strictly older. The setup-checks reference documents the new stale/rebuilt markers, and contract tests cover both stale rebuild and fresh no-op paths with an isolated fake repo.Risk
The changed behavior is limited to repo-mode setup for the main
/printing-pressskill. Standalone installs and the other setup contracts keep the existing no-rebuild behavior.Verification
go test ./internal/cli -run '^TestPrintingPressSkill'awk '/<!-- PRESS_SETUP_CONTRACT_START -->/{in_contract=1; next} /<!-- PRESS_SETUP_CONTRACT_END -->/{in_contract=0} in_contract && $0 !~ /^```/{print}' skills/printing-press/SKILL.md | bash -ngo test ./internal/pipeline -run '^Test(PrintingPressSetupContract|SkillSetupBlocksMatchWorkspaceContract)'go test ./...go fmt ./...go build -o ./cli-printing-press ./cmd/cli-printing-pressgit diff --check