Repository navigation
Rod the kit-pin re-anchor step by behaviour; heal the mirror-check calendar time bomb - #29
Merged
Merged
Conversation
The step that re-anchors the kit checkout to the consumer's committed SHA pin was guarded only by a string check on the checkout's ref, so a refactor could delete or reorder it and stay green. Eight tests now run the step's own script against a real git world: re-anchor, already on pin, two pins refused, repeated pin counted once, no pin refused, and the job_workflow_sha fallback both ways, plus its place between the kit checkout and the kit install. Nine mutants of the step, nine killed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ill bites The main()-level clean tests wrote a fixed 2026-06-01 pin while main() judges staleness against the real date, so they went red 90 days later with no code change and kit main has been red since. Clean CLI tests now pin relative to today. Two new controls run main() on the real clock: a pin 91 days old is refused as MIRROR_PIN_STALE, and the 90-day boundary passes. Denominators are asserted on the clean paths. Co-Authored-By: Claude Opus 5.5 <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.
Why
The brief I was given said the shared workflow checks out the kit "with no ref". That is not true of kit main.
quality-gate.ymlpassesref: ${{ github.job_workflow_sha }}, and since e842029 a step named "Honor the consumer's declared kit pin" re-anchors the kit checkout to the SHA the consumer committed, refusing to run when there is no pin or more than one.What a CI log actually showed (a consumer run today, 22:16Z): the
refrendered empty and the kit was fetched atmain. That consumer pins the shared workflow at a commit older than e842029, so it runs a workflow that has no re-anchor step. A consumer pinned after e842029 logs "kit checkout already rides the declared pin". The fix for that consumer is a pin bump in the consumer repo, which is outside this PR.That left two real gaps here, and this PR closes both:
refguarded it, so deleting or reordering the step stayed green.tests/test_kit_pin_reanchor.pyruns the step's own script from the parsed YAML against a real git world. It covers: re-anchor to the pin, already on the pin, two pins refused, a repeated pin counted once, no pin and an emptyjob_workflow_sharefused, and thejob_workflow_shafallback both ways. It also checks the step sits between the kit checkout and the kit install.tests/test_mirror_check.py, themain()"clean" tests wrote a fixed2026-06-01pin whilemain()judges staleness against the real clock, so they failed once the pin passed 90 days old (it is 124 days old now). Those tests now pin relative to today. Two real-clock controls were added: a pin 91 days old is refused, and a pin exactly 90 days old passes.Evidence (all run by the conductor)
pytestgives 2 failed (test_main_clean_exits_zero,test_clean_emits_passing_verdict_json:MIRROR_PIN_STALE ... 124 days old (max 90)).[dev]pins, PATH scrubbed, no API key):cf-gatepasses 10/11 gauges. pytest gives 584 passed, 3 errors. The 3 errors aretest_packagingwheel tests, and they are a local-instrument artefact: the uv-built interpreter has noensurepip, while CI usessetup-python. Read CI on this PR for those three.checkout --detach, dropsort -u, let multi-pin through, change the message, twoelifedits, remove the final refusal). The workflow's sha256 was verified restored.src/): 3/3 killed (max age 90→200, boundary>→>=, real clock frozen).Operator's hand (not done here)
mainis absent (GET .../branches/main/protectionreturns 404). A draft command is in the closeout and has not been applied.🤖 Generated with Claude Code