Repository navigation
test(nightly): pin Step 7's staging pathspecs to what init writes - #1117
Conversation
tend-agent
left a comment
There was a problem hiding this comment.
The guard closes the git add -A half of the contract but leaves the other three pathspec lists in Step 7 unpinned. git status --porcelain .github .config, git diff --cached --no-color .github .config, and the second git add -A all name the same set today, and the test only asserts the two git add -A lines agree — assert "git diff --cached" in skill matches the substring anywhere in the file, not the pathspecs on it.
That leaves the exact drift this test exists to catch still reachable, one step later: a future release adds an output path, this test fails, someone widens both git add -A lines to .github .config .foo and stops there. The test goes green, the file is staged — and the stamp-only check still diffs only .github .config, so NON_STAMP_DIFF is 0 when the new path is the only change and Step 7 skips the regeneration PR as a no-op. Same permanent gap, different line.
Inline suggestion reuses the already-parsed staged to pin the companions. Verified: the assertions hold against Step 7 as written, and both fail if either git add -A line is widened alone.
The nightly Step 7 gap #1116 reports was already closed on
main— #1095 widened the recipe's pathspecs to.github .configand moved the stamp-only check togit diff --cachedin the same commit that taught the generator to write.github/actionlint.yaml. What #1095 did not add is anything that keeps the pair in sync, so this adds the missing contract test.The adopter still saw the bug because the two halves ship on different clocks: the nightly skill comes from the action ref pinned in the adopter's workflow files (the previous release), while
uv tool run tend@latest initis always the newest generator. A release that adds an output path is therefore run by the prior release's recipe for exactly one night. That skew is structural and this PR does not change it; what it does prevent is the recipe and the generator disagreeing within a release, which is what turns a one-night gap into a permanent one.test_nightly_regen_stages_every_path_init_writesrunstend initinto a temp repo and asserts every file it writes is covered by thegit add -Apathspecs parsed out of the nightly skill, that bothgit add -Alines in Step 7 name the same set, and that the stamp-only skip readsgit diff --cachedrather than the worktree.Verification that the guard catches the reported bug
Run against the recipe as it stood at
0.1.22, the version the reporter's adopter was on:Both assertions fail there and pass on
main. Local run:uv run pytest generator/tests/test_cross_file_contracts.py— 14 passed;pre-commit run --files generator/tests/test_cross_file_contracts.pyclean.Closes #1116 — automated triage