Skip to content

test(nightly): pin Step 7's staging pathspecs to what init writes - #1117

Merged
max-sixty merged 2 commits into
mainfrom
fix/issue-1116
Aug 31, 2026
Merged

max-sixty merged 2 commits into
mainfrom
fix/issue-1116

Conversation

@tend-agent

Copy link
Copy Markdown
Collaborator

The nightly Step 7 gap #1116 reports was already closed on main — #1095 widened the recipe's pathspecs to .github .config and moved the stamp-only check to git diff --cached in 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 init is 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_writes runs tend init into a temp repo and asserts every file it writes is covered by the git add -A pathspecs parsed out of the nightly skill, that both git add -A lines in Step 7 name the same set, and that the stamp-only skip reads git diff --cached rather 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:

0.1.22 pathspecs: ['.github/workflows .config']
has --cached: False
uncovered under 0.1.22 recipe: ['.github/actionlint.yaml']

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.py clean.


Closes #1116 — automated triage

@tend-agent tend-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@max-sixty
max-sixty merged commit 8b51a93 into main Aug 31, 2026
10 checks passed
@max-sixty
max-sixty deleted the fix/issue-1116 branch August 31, 2026 20:30
This was referenced Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nightly: Step 7 never commits the generated .github/actionlint.yaml, and regenerates it untracked every run

2 participants