Repository navigation
Description
Story
As a maintainer relying on template-drift to keep repo-template faithful to standards/,
I want the guard's expected baseline to use the current major-scoped channel convention,
so that it stops reporting the correct state as DRIFTED and stops silently halting review across the repo.
Problem — the drift guard enforces a pre-#1184 baseline
scripts/seed-repo-template.sh repins every caller stub using a hardcoded table (:66-74):
"agent-shield|caller|petry-projects/.github|agent-shield/stable"
"auto-rebase|caller|petry-projects/.github|auto-rebase/stable"
"dependabot-automerge|caller|petry-projects/.github|dependabot-automerge/stable"
"dependency-audit|caller|petry-projects/.github|dependency-audit/stable"
"dev-lead|caller|petry-projects/.github-private|dev-lead/stable"
…
Those are the pre-#1184 legacy channel names. AGENTS.md (:385) states the convention is major-scoped: "Moving channel tags <name>/v<MAJOR>-<tier> (major-scoped, #1184…)", and canonical standards/ already uses it:
| stub | canonical standards/ |
seed-script repin |
|---|---|---|
agent-shield |
@agent-shield/v2-stable |
@agent-shield/stable |
auto-rebase |
@auto-rebase/v2-stable |
@auto-rebase/stable |
dependabot-automerge |
@dependabot-automerge/v2-stable |
@dependabot-automerge/stable |
dependency-audit |
@dependency-audit/v2-stable |
@dependency-audit/stable |
dev-lead |
@dev-lead/v1-stable |
@dev-lead/stable |
So seed-repo-template.sh takes a correct canonical stub and rewrites its pin to a legacy channel. template-drift then compares the template against that rewritten output — meaning the guard's "expected" content contradicts standards/ for every caller stub.
The correct change was reported as drift
repo-template commit d5a79417 (dev-lead, 10:51Z) repinned dev-lead.yml:
- uses: …/dev-lead-reusable.yml@dev-lead/stable
+ uses: …/dev-lead-reusable.yml@dev-lead/v1-stable
- agent_ref: dev-lead/stable
+ agent_ref: dev-lead/v1-stableThat moved the template toward canonical standards and the #1184 convention — it is right. template-drift immediately reported dev-lead.yml, agent-shield.yml and dependabot-automerge.yml as DRIFTED, because the guard expects the legacy form.
Why it matters beyond a red check
template-drift is not a required check, but a red non-required check makes compute_ci_status return failing, and review-one-pr.sh:141 then silently skips the review (run log only, nothing posted). Zero PRs merged in this repo between 09:55Z and 15:14Z — an epic halted by a guard enforcing an obsolete convention. The reviewer-side half is #1427 AC #7; this issue is one of the causes.
Do not "fix" this by re-seeding the affected files. Re-seeding would revert d5a79417 and pin the template back to legacy channels — regressing it away from standards to satisfy a stale guard. The repin table is what must change.
Acceptance Criteria
seed-repo-template.sh's repin table produces the same channel refs as canonicalstandards/for every caller stub — major-scoped<name>/v<MAJOR>-<tier>, matching AGENTS.md and F2: cut-release.sh learns v<major>-<tier> channels [#657] #1184.- The channel is derived from the canonical stub rather than hardcoded, so a future channel promotion (e.g.
v2-stable→v3-stable) cannot re-introduce this skew. If a hardcoded table is retained for a stated reason, a test asserts each entry equals the canonical stub's pin. template-driftis green onmainwith the corrected table, without revertingrepo-template@d5a79417.- A test covers the exact regression: a canonical stub pinned
@<name>/v<MAJOR>-stablemust emit that same pin, not@<name>/stable. - Any consumer repo already seeded with a legacy
<name>/stablepin is identified and reported (whether to repin them is a separate decision — record the list). - The relationship to the mutable-ref exception in AGENTS.md is checked: the sanctioned-exception guidance lists channel-tag namespaces, and both forms currently exist as live tags (
dev-lead/stableanddev-lead/v1-stable). Record whether the legacy tags are still promoted or are now dead, since a stub pinned to an unpromoted channel silently stops receiving updates.
Tasks / Subtasks
- Derive the repin channel from the canonical stub's own
uses:ref (or correct the table and add the equality test). (AC: test issue from agent #1, Go-live improvements for PR review agent #2) - Add the regression test for the
v<MAJOR>-stable→<name>/stablerewrite. (AC: Optimize review: small-PR and incremental fast paths #4) - Verify
template-driftgoes green withd5a79417intact. (AC: Add @claude delegation, auto-merge, and rebase handling #3) - Enumerate consumer repos carrying legacy pins and report them. (AC: feat: add Copilot engine support via REVIEW_ENGINE toggle #5)
- Determine whether
<name>/stabletags are still promoted; record the finding. (AC: feat: feature ideation framework — adversarial proposer/challenger/synthesizer #6)
Dev Notes
- This changes what the guard considers correct, so land it before any further re-seeding of
repo-template.petry-projects/repo-template#124(the copilot-setup-steps / sonarcloud re-seed) is unaffected — those are inline stubs carrying no reusable ref, which the script ships verbatim, so no repin was applied to them. - AC feat: feature ideation framework — adversarial proposer/challenger/synthesizer #6 matters more than it looks: both
dev-lead/stableanddev-lead/v1-stableexist as tags today. If only the major-scoped ones are advanced bycut-release.sh, then every consumer seeded from the current table is pinned to a frozen channel and is silently not receiving promotions — a much larger blast radius than the template itself. - Related but distinct from [bug] Dependabot bumps in repo-template break template-drift — a byte-identity distribution artifact is being edited directly, silently halting all PR review here #1435: that issue is about automated actors editing the generated artifact (Dependabot, and dev-lead's fleet remediation). This issue is about the guard's baseline being wrong, so even a perfectly-behaved template is reported as drifted. Both must be fixed; neither subsumes the other.
Project Structure Notes
scripts/seed-repo-template.sh (the TEMPLATE_STUBS repin table), scripts/template_stub_drift.sh (consumer of the emission), tests under tests/ (template_stub_drift.bats exists) registered in lint.yml's bats list.
References
scripts/seed-repo-template.sh:62-74(the repin table)scripts/template_stub_drift.sh(compares committed vs emitted)- AGENTS.md
:385(major-scoped channel convention, F2: cut-release.sh learns v<major>-<tier> channels [#657] #1184) and "Release channel tags & the mutable-ref exception" repo-template@d5a79417(the correct repin that was reported as drift)- [bug] Dependabot bumps in repo-template break template-drift — a byte-identity distribution artifact is being edited directly, silently halting all PR review here #1435 (automated actors editing the artifact), [Phase 4] pr-review defers indefinitely on another agent's own check run (dev-lead/dispatch) and on zombie checks — ci-pending has no timeout #1427 AC Workflow should skip no-op PRs in MAX_PRS count #7 (silent skip on a non-required red check)
Likely target surface
scripts/seed-repo-template.sh
Found while repairing the template-drift failure that halted all PR review in this repo from 09:55Z. Re-seeding the reported files would have regressed the template to legacy channel pins — the guard, not the template, is wrong.
Activity
don-petry commentedon Aug 2, 2026
Fix verified locally — 3 of 5 stubs resolve immediately
I applied the corrected repin table to a clean
origin/mainworktree and ran the real guard (bash scripts/template_stub_drift.sh) against liverepo-template.The exact change (
scripts/seed-repo-template.sh:66-74):Note
dependabot-rebaseandpr-review-mentionwere already onv2-stable— so this is a half-finished #1184 migration, not an oversight of the whole table. That is worth stating in the fix's commit message.Result — three flip straight to ALIGNED:
That last line is the proof the guard was wrong, not the template: dev-lead's repin to
@dev-lead/v1-stablebecomes ALIGNED the moment the table is corrected.Two remain genuinely drifted, and each differs by exactly one line — the same legacy pin, plus a missing trailing newline:
Those need a re-seed in
repo-template, tracked separately (see below) because it is a different repo.This PR self-validates — no chicken-and-egg
template-driftrunsbash scripts/template_stub_drift.shfrom the PR's own checkout (lint.yml:225-239, plainactions/checkoutwith noref:). So the fix PR exercises its own corrected script and itstemplate-driftjob passes, even thoughmainis currently red. It can merge normally.Sequencing
auto-rebase.yml+dependency-audit.ymlinrepo-template, generating with the fixed script. Doing that first would write the legacy pins straight back in.Only after both is
template-driftgreen onmainhere — which is what stops pr-review silently skipping every PR (#1427 AC #7) and unblocks the epic.AC #4 — the regression test, concretely
Assert that a canonical stub pinned
@<name>/v<MAJOR>-stableemits that same pin, not@<name>/stable. Today's table would fail that test for the five entries above and pass for the two already migrated, which makes it a genuine guard against the migration being left half-done again.don-petry commentedon Aug 2, 2026
Dev-Lead Implementation Plan
Issue: #1436 — [bug] seed-repo-template.sh repins caller stubs to pre-#1184 legacy channels
Scope
Make
seed-repo-template.shderive each caller stub's repin channel from the canonicalstandards/stub's ownuses:ref (major-scoped<name>/v<MAJOR>-stable, #1184) instead of the hardcoded pre-#1184<name>/stabletable, sotemplate-drift's baseline stops contradicting standards — without revertingrepo-template@d5a79417.Root cause confirmed
standards/workflows/*.ymlall pin@<name>/v<MAJOR>-stable(verified live: agent-shield/v2, auto-rebase/v2, dependabot-automerge/v2, dependency-audit/v2, dev-lead/v1, dependabot-rebase/v2, pr-review-mention/v2).WORKFLOW_MANIFESThardcodes legacy<name>/stablefor 5 of them, so the emitted "expected" baseline rewrites the correct pin to a legacy channel → every caller stub reported DRIFTED.Implementation Checklist
scripts/seed-repo-template.sh: drop the hardcodedchannelfield fromWORKFLOW_MANIFESTrows (name|kind|host)._derive_stable_channel <name>(reads stub on stdin): extract<name>/v<MAJOR>from the<name>-reusable.yml@<ref>pin, emit<name>/v<MAJOR>-stable; fail loud if no major-scoped ref is found._repin_stub_contentto derive the channel from the fetched canonical content (drops thechannelarg); update_emit_workflowand the--repinCLI accordingly.Tests to Write / Update (
tests/test_seed_repo_template.bats)@<name>/v<MAJOR>-stableemits that same pin, not@<name>/stable._derive_stable_channelunit:v2-next→v2-stable,v1-stable→v1-stable; preserves the major.<name>/stableoutput)._manifest_channelhelper (4-field manifest) now that the channel is derived.AC #5 / #6 (investigation — reported, no code)
<name>/stablepins.<name>/stabletags are still promoted. Preliminary finding: legacy tags are FROZEN —agent-shield/stable,auto-rebase/stable,dependency-audit/stablepoint to OLDER commits than theirv<MAJOR>-stablecounterparts, so consumers on legacy pins are silently not receiving promotions.Test Command
bats tests/test_seed_repo_template.bats tests/template_stub_drift.bats+bash .dev-lead/scripts/dev-lead-lint.shdon-petry commentedon Aug 2, 2026
Follow-on filed — the re-seed half
The two genuinely-drifted stubs (
auto-rebase.yml,dependency-audit.yml) are tracked in the template repo as petry-projects/repo-template#125, since the change must be made there.It is deliberately not yet assigned to dev-lead: re-seeding with today's generator would write the legacy
<name>/stablepins straight back in. It should be picked up only once this issue has merged and the generator emits the major-scoped refs. I will label itdev-leadat that point.Sequence: #1436 (here) → repo-template#125 →
template-driftgreen → pr-review stops silently skipping → #1434 and the epic queue drain.don-petry commentedon Aug 2, 2026
Dev-Lead: Implementation Complete
Plan Execution
WORKFLOW_MANIFESTrows reduced toname|kind|host— the hardcoded pre-F2: cut-release.sh learns v<major>-<tier> channels [#657] #1184channelcolumn is gone._derive_stable_channel <name>(reads stub on stdin): extracts<name>/v<MAJOR>from the canonical<name>-reusable.yml@<ref>pin and emits<name>/v<MAJOR>-stable; fails loud on a non-major-scoped ref. (AC test issue from agent #1, Go-live improvements for PR review agent #2)_repin_stub_contentnow derives the channel from the fetched canonical content instead of taking it as an argument;_emit_workflowand the--repinCLI updated to match._derive_stable_channelunit test; updated the existing repin/emit/seeding tests (and the seeding fixtures) to the major-scoped canonical form; removed the stale 4-field_manifest_channelhelper.template-driftbehaviour against the LIVE repos (AC Add @claude delegation, auto-merge, and rebase handling #3).Test Results
Files Changed
scripts/seed-repo-template.sh: derive the repin channel from the canonical stub's own major-scopeduses:ref (<name>/v<MAJOR>-stable, F2: cut-release.sh learns v<major>-<tier> channels [#657] #1184) instead of a hardcoded legacy<name>/stabletable.tests/test_seed_repo_template.bats: AC Optimize review: small-PR and incremental fast paths #4 regression + derivation unit tests; existing repin/emit/seeding tests moved to the major-scoped canonical form.AC #3 —
template-driftresult (live run)The three files the issue flagged are now ALIGNED, without reverting
repo-template@d5a79417:dev-lead.yml@dev-lead/v1-stable@dev-lead/v1-stableagent-shield.yml@agent-shield/v2-stable@agent-shield/v2-stabledependabot-automerge.yml@dependabot-automerge/v2-stable@dependabot-automerge/v2-stabledependabot-rebase.yml/pr-review-mention.ymlv2-stablev2-stableThe corrected guard now surfaces two genuinely-stale pins that the old (equally-wrong) baseline was masking:
auto-rebase.yml@auto-rebase/stable(legacy)@auto-rebase/v2-stabledependency-audit.yml@dependency-audit/stable(legacy)@dependency-audit/v2-stableThis is real drift, not a guard error:
repo-templatestill pins these two to the frozen legacy channel. Turning the guard fully green requires a forward repin of those two files inrepo-templatetov2-stable— the same standards-ward move asd5a79417fordev-lead— not a re-seed back to legacy. That is a separate cross-repo change (this task does not push to other repos); recommend a follow-up PR onpetry-projects/repo-template.AC #5 — consumer repos carrying legacy
<name>/stablepinsSeeded consumer artifact (
petry-projects/repo-template) — live pin audit:auto-rebase.yml→@auto-rebase/stable(legacy)dependency-audit.yml→@dependency-audit/stable(legacy)Live workflow files elsewhere still on a legacy pin (dogfood stubs in this repo, distinct from the seeded artifact — repin decision separate):
petry-projects/.github-private/.github/workflows/agent-shield.yml→@agent-shield/stablepetry-projects/.github-private/.github/workflows/dev-lead.yml→@dev-lead/stable(Remaining code-search hits are tests/docs/fixtures, not live caller stubs.)
AC #6 — are the legacy
<name>/stabletags still promoted?No — they are effectively dead.
scripts/cut-release.shonly cuts immutable<agent>/vX.Y.Ztags and moves the major-scoped<agent>/v<MAJOR>-<tier>channel (cut-release.shheader:5-6,26); the non-major-scoped<name>/stabletag is not in its channel-move model. Live tag SHAs confirm the legacy channels are frozen behind their major-scoped counterparts:<name>/stable<name>/v<MAJOR>-stableb7e6b67837cee91a186e9837cee91a186e9837cee9b7e6b67b7e6b676d362316d36231Blast radius (per the Dev Note): any consumer seeded from the old table onto
<name>/stableis pinned to a frozen channel and silently stops receiving promotions. Bothdev-lead/stableanddev-lead/v1-stablestill exist as live tags (currently the same commit), so the sanctioned mutable-ref exception namespaces in AGENTS.md cover both forms — but only thev<MAJOR>-forms are advanced going forward.Notes
_repin_stub_content(agent-shield,dev-lead,dependabot-automerge) hash byte-identically to the committed template (ALIGNED), so thecontent="$(cat)"refactor did not change emitted bytes — only the channel value.feat: implement issue #1436 — [bug] seed-repo-template.sh repins call…
don-petry commentedon Aug 3, 2026
Scope extension (maintainer decision) — pin the standards fetch, and let compliance accept N-1
Folding the
template-driftnon-determinism into this issue, per the maintainer.Decision:
seed-repo-template.shfetches standards at the latest published stable version, not the live default branch.The defect being fixed
scripts/seed-repo-template.sh:116fetches unpinned:So the "expected" baseline is whatever
petry-projects/.githubhas on its default branch at the moment of execution. The same commit therefore passes or fails depending purely on when the check runs. Demonstrated today: PR #1446'stemplate-driftexpected blob3e2daee1f7f8at 01:58Z; regenerating the identical SHA locally after standards moved at 02:10Z (cff381f6) produced569270be4153. Neither is wrong — the target moved.I checked every candidate ref, and none currently carries the corrected content:
standards/workflows/dev-lead.ymlv2(repo-level, 2026-05-19)standards/workflows/layout entirelyv1(repo-level, 2026-05-13)pr-review-mention/v2-stable@dev-lead/stable← legacyfeature-ideation/v1-stable@dev-lead/stable← legacyinitiative-planner/v1-stable@dev-lead/stable← legacypr-auto-review/v1-stable@dev-lead/v1-stable✅ (the only correct one)Pinning to any published tag today would reintroduce the exact pre-#1184 legacy pins this issue just fixed. The repo-level
v1/v2tags are stale and predate the layout; the per-reusable channel tags version reusables, not thestandards/corpus, and happen to point at commits from before the July channel migration.So there is currently no published version of
standards/as a corpus — that has to be created before the pin can be adopted. Implementing "pin to latest published stable" without it would silently regress the fix.Required sequencing
standards/inpetry-projects/.github— a corpus-level moving channel (e.g.standards/v<MAJOR>-stable) distinct from the per-reusable channels, cut from a commit that contains the corrected major-scoped pins.seed-repo-template.shto fetch at that ref (STANDARDS_REF, defaulting to the published stable channel;STANDARDS_DIRlocal override retained for tests).Steps 2 and 3 are in this repo; step 1 is a cross-repo prerequisite in
petry-projects/.github— the same standards-first ordering as #1435's original constraint and #1425's persona-schema dependency.Updated acceptance criteria
seed-repo-template.shresolves standards content at an explicit ref (STANDARDS_REF), defaulting to the published stable channel — never an unpinned default-branch read. The resolved ref is logged, and recorded in the drift report so a mismatch is explainable rather than mysterious.<name>/v<MAJOR>-<tier>refs, so this issue's fix cannot be undone by a pin.AC #10 matters: it means this work delivers value (explainability) even if the cross-repo publication scheme lands later.
don-petry commentedon Aug 3, 2026
The scope extension above (pin the standards fetch to a published stable version; compliance accepts N-1) is carried in #1448, since this issue had already shipped as #1441. ACs there are numbered 7–10 to continue this issue's sequence.
Flagging the key constraint again because it inverts the obvious implementation: no currently-published ref carries the corrected pins.
v1/v2predate thestandards/workflows/layout (files absent), and every per-reusable channel tag points at a pre-#1184 commit carrying@dev-lead/stable. Pinning to any of them today would undo exactly what this issue fixed. A corpus-level published version ofstandards/has to exist first.feat: implement issue #1436 — [bug] seed-repo-template.sh repins call…
feat: implement issue #1436 — [bug] seed-repo-template.sh repins call…
feat: implement issue #1436 — [bug] seed-repo-template.sh repins call…
feat: implement issue #1436 — [bug] seed-repo-template.sh repins call…
feat: implement issue #1436 — [bug] seed-repo-template.sh repins call…
feat: implement issue #1436 — [bug] seed-repo-template.sh repins call…
feat: implement issue #1436 — [bug] seed-repo-template.sh repins call…
feat: implement issue #1436 — [bug] seed-repo-template.sh repins call…
feat: implement issue #1436 — [bug] seed-repo-template.sh repins call…
feat: implement issue #1436 — [bug] seed-repo-template.sh repins call…
feat: implement issue #1436 — [bug] seed-repo-template.sh repins call…
feat: implement issue #1436 — [bug] seed-repo-template.sh repins call…
feat: implement issue #1436 — [bug] seed-repo-template.sh repins call…
feat: implement issue #1448 — [bug] seed-repo-template fetches standa…