Repository navigation
feat: seed PRs record their standards ref, supersede older seed PRs, and refuse downgrades (#1925) - #2256
Conversation
…row misclassifications and three untested paths left open by PR 2219
…3' into claude/issue-1925-seed-provenance-supersede
…and refuse downgrades (#1925) seed-repo-template.sh opened seed PRs that did not say which standards ref they came from, left older seed PRs open, and could overwrite a template file with an older version of itself. - Provenance: the seed PR body states the resolved standards ref, how it was chosen and the commit. A reused PR's body is rewritten on each run. - Supersede: #2233 already updates an open seed PR in place. When several are open the newest is kept and each older one is now closed with a comment linking it. A PR that cannot be closed fails the run. - No downgrades: a file that differs from the run's emission but matches the emission at standards HEAD is refused, with "standards channel is behind the template — promote standards". If nothing else needs writing, no PR is opened and the empty branch is removed. - A newer-commit check that cannot be made aborts the seed. It is never read as "not ahead". - docs/release/seeding-repo-template.md is the operator procedure. The no-downgrade check reuses the drift guard's HEAD and ancestry reads, so this branch includes the unmerged #2244 (issue #2237) that adds the ancestry read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 27 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
CodeAnt Nitpicks4 code suggestions1.
|
CodeAnt PR Risk: Low Risk
Assessed commit: |
|
dev-lead is withholding action on this item. It is labeled To re-enable automated pickup: remove the |
… open PR - If today's seed branch already exists it may carry an earlier run's edits. It is now handled like an open seed PR's branch: every file is made to match what this run wants. Before, a file this run skipped, preserved or refused kept the earlier run's content, so a refused downgrade could still ship. - The open-PR listing limit is applied before the seed-branch filter, so it is raised from 100 to 1000. A seed PR cut off by the limit would be missed and a second one opened. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
QA Lead — test-risk advisoryRisk tier: MEDIUM. The script can now edit and close PRs and delete branches on What I'd shore up (highest leverage first):
Escalate? No. The first live (non-dry) seed is the real integration test, so watch it as the PR's Monitoring section says. Advisory only — I comment, I do not change code. Ground: BMAD Test Architecture |
The standards repo's same-named script is a different tool and is being renamed to emit-standard-file.sh in petry-projects/.github#1294. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-10-11T04:14:10Z. |
|
Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-10-11T04:14:12Z. |
…d-provenance-supersede # Conflicts: # AGENTS.md
…mit, and test the real ancestry path - If the open pull requests cannot be listed, the seed stops before it writes anything. Before, a failed listing read as "no seed PR open", which opens a duplicate and leaves the older ones open. - A seed run now fetches every standards file at the commit it records in the PR body, not through the ref name. A channel that moved mid-run could otherwise leave the PR naming a commit its content did not come from. - A dated branch left by an earlier run, with nothing written and nothing the base lacks, opens no PR. - Docs: a channel that cannot be resolved falls back to HEAD and the operator stops; a local STANDARDS_DIR has no commit and no downgrade check, so it is not for a real seed. - Tests: three run the real HEAD read, the real ancestry read and the real child emission with only gh replaced. Others cover the unreadable PR list, a seed PR beyond the first 100 open PRs, the commit pin, a failed provenance update, and a PR number that cannot be read back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-10-11T15:43:51Z. |



Summary
scripts/seed-repo-template.shnow says where a seed came from, keeps one seed PR open, and refuses to downgrade a template file.STANDARDS_REF, HEAD fallback or local) and the commit. A hidden marker carries the same three values. A reused PR's body is rewritten on each run.seed-scaffold/*PRs are open, the newest is kept and each older one is closed with a comment linking it.docs/release/seeding-repo-template.mddocuments how and when to seed.Closes #1925 ("seed-repo-template.sh: seed PRs record no standards ref, never supersede each other, and can regress repo-template").
Also in this PR
One sentence in
AGENTS.mdfor issue #1927:seed-repo-template.shhas one home, this repo. The rename that removes the other same-named script is petry-projects/.github#1294, which closes #1927.Builds on PR #2244
The no-downgrade check reuses the ancestry read,
_template_drift_compare, that PR #2244 (issue #2237) added. That PR is merged, and this branch is up to date withmain, so the diff here is this PR's four files only.Problem
On 2026-09-23 a seed PR generated from
standards/v1-stable(then v1.0.0) would have removed themerge_grouptrigger a previous seed had shipped. Five seed PRs were open at once, and none said which ref it used.Acceptance criteria
Failure handling
STANDARDS_DIRthere is no ref, so the check is skipped.Risk
Medium. This changes a script that writes to
petry-projects/repo-template.gh pr editon the kept seed PR,gh pr closeon olderseed-scaffold/*PRs, and a refDELETEof a branch this run created and left empty.gh pr closeonly ever targets a PR whose head branch starts withseed-scaffold/.gh pr create. It now exits 0 with "no PR opened".Test plan
bats tests/test_seed_repo_template.bats: 99 pass, 1 fails. The failure is test 59 (issue seed-repo-template.sh strips the commercial-support sections from repo-template on every run — its README and BOOTSTRAP baseline predates the commercial-support standard, and stale seed PRs pile up #2233'ssed -itest), which fails on macOSsedonmaintoo. 34 tests are new. Three of them run the real HEAD read, the real ancestry read and the real child emission with onlyghreplaced.main, 18 of the new tests fail.bats tests/template_stub_drift.bats tests/agent_ingress_reference.bats tests/test_lint_main_push_trigger.bats: all pass.find scripts -name "*.sh" -exec shellcheck --severity=warning -x {} +: clean.markdownlint-cli2on the new doc: 0 errors.ghon 2026-10-11,DRY_RUN=true(read-only):README.md(UPDATE). Re-run after the commit pin was added: same result.STANDARDS_REF=standards/v1.0.0:agent-shield.yml,dependency-audit.yml,copilot-setup-steps.yml,dependabot-rebase.ymlanddev-lead.ymlare reportedwould REFUSE … the template is ahead, with the channel-behind warning. That is the September regression, now refused.ghonly.Rollback
Revert this PR. A seed PR opened by this version stays valid; its extra body text is harmless.
Monitoring
The next real seed of
repo-template: its PR body should show the "Standards provenance" block, and only oneseed-scaffold/*PR should be open afterwards.Interaction contract
Checklist
shellcheck scripts/*.shpasses for any changed shell scripts.🤖 Generated with Claude Code