Skip to content

refactor: rename this repo's seed-repo-template.sh to emit-standard-file.sh — the seeder has one home (.github-private#1927) - #1294

Merged
don-petry merged 2 commits into
mainfrom
claude/issue-1927-rename-standards-emitter
Oct 11, 2026
Merged

don-petry merged 2 commits into
mainfrom
claude/issue-1927-rename-standards-emitter

Conversation

@don-petry

@don-petry don-petry commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This repo's scripts/seed-repo-template.sh is renamed to scripts/emit-standard-file.sh. Its behaviour does not change. The name seed-repo-template.sh now has one home: petry-projects/.github-private.

  • The script and its two test suites are renamed. The tests change only the script path they call.
  • A new guard, tests/test_seed_repo_template_single_home.bats, fails if a file named seed-repo-template.sh reappears anywhere in this repo. The Gitignore Baseline Tests workflow runs it, and now also triggers on any path matching **/seed-repo-template.sh.
  • AGENTS.md ("What lives where") documents where the seeder lives. docs/bootstrap/new-repo-validation.md and standards/standards-versioning.md name the right script.

Closes petry-projects/.github-private#1927 ("Two diverged copies of seed-repo-template.sh (.github vs .github-private, 964-line diff) — pick one canonical home").

Problem, and a correction to the issue

The issue describes two diverged copies of one script. They are two different tools that shared a name:

petry-projects/.github petry-projects/.github-private
Size 159 lines about 900 lines
What it does Prints one standard file from a local checkout: the .gitignore baseline, or a workflow stub verbatim Seeds repo-template: fetches standards at a pinned ref, repins stubs, writes files, opens the seed PR
Writes to repo-template Never Yes

So the 964-line diff is not drift, and the .github script cannot reintroduce the bug the issue worried about (the seed wiping files it does not own), because it never writes. The real defect was the shared name: nothing told an operator which one was "the seeder".

Acceptance criteria

  1. One canonical home: petry-projects/.github-private for the seeder and its suite. The maintainer chose to rename this repo's script instead of moving either tool, since each one's consumers live beside it.
  2. Remove the other copy: the name is removed here by the rename. The emitter stays, because this repo's own tests and the gitignore-baseline tooling use it.
  3. CI check against a second copy: the new bats guard, in this repo.
  4. Document the location in both repos: done here in AGENTS.md. The matching sentence for petry-projects/.github-private is in that repo's PR #2256.

Risk

Low. A rename with no behaviour change. A search of the org finds no caller of this repo's script outside this repo. Anything that calls scripts/seed-repo-template.sh in a checkout of this repo by hand will need the new name.

Test plan

  • bats tests/test_emit_standard_file_gitignore.bats tests/test_emit_standard_file_workflows.bats tests/test_seed_repo_template_single_home.bats: 20 pass (17 existing, 3 new).
  • The guard is shown to detect a copy: one of its tests adds seed-repo-template.sh at two depths in a scratch repo and asserts both are found, while not-seed-repo-template.sh is not.
  • shellcheck --severity=warning -x scripts/emit-standard-file.sh: clean. actionlint on the workflow: clean. markdownlint-cli2 on the three docs: 0 errors.
  • gh search code across the org for callers of the old path: none outside this repo.

Rollback

Revert this PR.

Monitoring

n/a — no runtime effect. The Gitignore Baseline Tests workflow on this PR runs the renamed suites and the new guard.

Interaction contract

  • N/A — this PR does not add or change an agentic role.

🤖 Generated with Claude Code

View guided diff Turn on auto-fix

…ile.sh — the seeder has one home (petry-projects/.github-private#1927)

Two scripts in two repos were both called seed-repo-template.sh and were taken
for diverged copies of one tool. They are different tools:

- petry-projects/.github-private/scripts/seed-repo-template.sh is the seeder. It
  writes the baseline scaffold into repo-template and opens the seed PR.
- This repo's script only prints one standard file (the .gitignore baseline, or
  a workflow stub verbatim) from a local checkout. It never writes anywhere.

So the name now has one home. This repo's script becomes
scripts/emit-standard-file.sh, with no behaviour change.

- Rename the script and its two test suites. The tests change only the script
  path they call; every assertion is unchanged.
- Add tests/test_seed_repo_template_single_home.bats, which fails if a file
  named seed-repo-template.sh reappears in this repo, and run it whenever such
  a file is added.
- AGENTS.md documents the home of the seeder. The bootstrap doc and the
  versioning standard name the right script.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@don-petry
don-petry requested a review from a team as a code owner October 11, 2026 03:01
@don-petry don-petry added the dev-lead:hands-off Opt an item out of the dev-lead persona automation entirely label Oct 11, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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 2 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 0d7ccc0d-2b81-45c4-9be1-2e5d8b9cb86d

📥 Commits

Reviewing files that changed from the base of the PR and between 4bb3e7a and c794ad5.


📒 Files selected for processing (8)
  • .github/workflows/gitignore-baseline-tests.yml
  • AGENTS.md
  • docs/bootstrap/new-repo-validation.md
  • scripts/emit-standard-file.sh
  • standards/standards-versioning.md
  • tests/test_emit_standard_file_gitignore.bats
  • tests/test_emit_standard_file_workflows.bats
  • tests/test_seed_repo_template_single_home.bats

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

don-petry pushed a commit to petry-projects/.github-private that referenced this pull request Oct 11, 2026
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>
@codeant-ai

codeant-ai Bot commented Oct 11, 2026

Copy link
Copy Markdown

CodeAnt PR Risk: Low Risk

  • The PR appears safe to merge; it consistently renames the local standard-file emitter and adds a test to prevent the seeder name from reappearing here.
  • The workflow triggers, lint command, tests, and documentation are updated to use the emitter's new name.

Assessed commit: 89cf816b6a8c

@don-petry

Copy link
Copy Markdown
Contributor Author

dev-lead is withholding action on this item.

It is labeled dev-lead:hands-off (deliberately kept off-limits to dev-lead (e.g. changes to the dev-lead automation itself)), so dev-lead will not pick it up while that label is present. This notice is posted once so the withhold is visible rather than looking like a stalled run.

To re-enable automated pickup: remove the dev-lead:hands-off label.

@sonarqubecloud

Copy link
Copy Markdown

@don-petry
don-petry merged commit b1387cb into main Oct 11, 2026
29 checks passed
@don-petry
don-petry deleted the claude/issue-1927-rename-standards-emitter branch October 11, 2026 14:33
don-petry added a commit to petry-projects/.github-private that referenced this pull request Oct 11, 2026
…and refuse downgrades (#1925) (#2256)

* feat: implement issue #2237 — template-drift AHEAD detection: two narrow misclassifications and three untested paths left open by PR 2219

* feat: seed PRs record their standards ref, supersede older seed PRs, 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>

* fix(review): restore a pre-existing dated seed branch, and list every 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>

* docs: seed-repo-template.sh has one home, this repo (#1927)

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>

* fix(review): stop on an unreadable PR list, fetch at the recorded commit, 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>

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev-lead:hands-off Opt an item out of the dev-lead persona automation entirely

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Two diverged copies of seed-repo-template.sh (.github vs .github-private, 964-line diff) — pick one canonical home

1 participant