From 4f880bf56db97baa9ca9b02ac8027a5768222649 Mon Sep 17 00:00:00 2001 From: don-petry <36422719+don-petry@users.noreply.github.com> Date: Sun, 11 Oct 2026 04:31:15 +0000 Subject: [PATCH 01/14] =?UTF-8?q?feat:=20implement=20issue=20#1297=20?= =?UTF-8?q?=E2=80=94=20Synced=20stubs=20in=20ring=20repos=20carry=20a=20he?= =?UTF-8?q?ader=20naming=20v1-stable=20above=20a=20uses:=20line=20pinned?= =?UTF-8?q?=20to=20their=20ring=20=E2=80=94=20bots=20flag=20it=20and=20age?= =?UTF-8?q?nts=20edit=20the=20stub=20to=20match?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- standards/workflows/add-to-project.yml | 3 +- standards/workflows/auto-rebase.yml | 5 +- standards/workflows/dependabot-rebase.yml | 5 +- standards/workflows/dev-lead.yml | 3 +- standards/workflows/idea-enhancer.yml | 5 +- standards/workflows/idea-triage.yml | 5 +- standards/workflows/initiative-planner.yml | 5 +- standards/workflows/persona-mention.yml | 5 +- standards/workflows/pr-auto-review.yml | 5 +- standards/workflows/pr-review-mention.yml | 5 +- standards/workflows/pr-review.yml | 6 +- .../stub-header-tier-neutral.bats | 106 ++++++++++++++++++ 12 files changed, 137 insertions(+), 21 deletions(-) create mode 100644 test/scripts/deploy-standard-workflows/stub-header-tier-neutral.bats diff --git a/standards/workflows/add-to-project.yml b/standards/workflows/add-to-project.yml index d5b20a58e..41baf5fc7 100644 --- a/standards/workflows/add-to-project.yml +++ b/standards/workflows/add-to-project.yml @@ -7,7 +7,8 @@ # • This file is a THIN CALLER STUB. All noise-gate / reconcile logic lives # in the reusable workflow above. # • You MAY change: nothing in normal use. The `uses:` ref and `agent_ref` -# are pinned to the `add-to-project/v1-stable` channel and move with it — do +# are pinned to this repo's ring channel for `add-to-project`, set by the +# standards sweep, and move with it — do # not change them to `@main` or a SHA (see ci-standards.md → Reusable # workflow versioning). # • You MUST NOT change: trigger events, the concurrency group, or the diff --git a/standards/workflows/auto-rebase.yml b/standards/workflows/auto-rebase.yml index 7f3ffc106..10a9a0f89 100644 --- a/standards/workflows/auto-rebase.yml +++ b/standards/workflows/auto-rebase.yml @@ -6,8 +6,9 @@ # AGENTS — READ BEFORE EDITING: # • This file is a THIN CALLER STUB. All branch-update logic lives in the # reusable workflow above. -# • You MUST NOT change: the `uses:` ref — it is pinned to the -# `auto-rebase/v2-stable` channel, a moving tag advanced centrally. Never +# • You MUST NOT change: the `uses:` ref — it is pinned to this repo's ring +# channel for `auto-rebase`, set by the standards sweep (a moving tag +# advanced centrally). Never # repoint it to `@main`, a SHA, or a frozen `@vX` (see ci-standards.md → # Reusable workflow versioning). Also do not change the trigger event, # the concurrency group name, diff --git a/standards/workflows/dependabot-rebase.yml b/standards/workflows/dependabot-rebase.yml index 53a1f1f2f..2210bc7f3 100644 --- a/standards/workflows/dependabot-rebase.yml +++ b/standards/workflows/dependabot-rebase.yml @@ -6,8 +6,9 @@ # AGENTS — READ BEFORE EDITING: # • This file is a THIN CALLER STUB. All rebase/merge serialization logic # lives in the reusable workflow above. -# • You MUST NOT change: the `uses:` ref — it is pinned to the -# `dependabot-rebase/v2-stable` channel, a moving tag advanced centrally. +# • You MUST NOT change: the `uses:` ref — it is pinned to this repo's ring +# channel for `dependabot-rebase`, set by the standards sweep (a moving +# tag advanced centrally). # Never repoint it to `@main`, a SHA, or a frozen `@vX` (see # ci-standards.md → Reusable workflow versioning). Also do not change the # concurrency group name, the explicit secrets diff --git a/standards/workflows/dev-lead.yml b/standards/workflows/dev-lead.yml index 1cd459bdb..f95f783c9 100644 --- a/standards/workflows/dev-lead.yml +++ b/standards/workflows/dev-lead.yml @@ -56,7 +56,8 @@ permissions: {} jobs: dev-lead: - # Pinned to the moving dev-lead stable channel tag, not @main, so a broken + # Pinned to this repo's moving dev-lead ring channel tag (set by the + # standards sweep), not @main, so a broken # change to dev-lead can no longer gate its own fix (the self-host circular # dependency). Promotion is done by moving that channel tag centrally; this # caller is never edited on release. agent_ref threads the same channel into diff --git a/standards/workflows/idea-enhancer.yml b/standards/workflows/idea-enhancer.yml index 3ea45bc8a..6db803b8b 100644 --- a/standards/workflows/idea-enhancer.yml +++ b/standards/workflows/idea-enhancer.yml @@ -6,8 +6,9 @@ # AGENTS — READ BEFORE EDITING: # • This file is a THIN CALLER STUB. All enhancement-dispatch logic (including # the Ideas-category / non-bot guard) lives in the reusable above. -# • You MUST NOT change: the `uses:` ref — it is pinned to the -# `idea-enhancer/v1-stable` channel, a moving tag advanced centrally. Never +# • You MUST NOT change: the `uses:` ref — it is pinned to this repo's ring +# channel for `idea-enhancer`, set by the standards sweep (a moving tag +# advanced centrally). Never # repoint it to `@main`, a SHA, or a frozen `@vX`. Do not change the trigger # events or the `secrets:` block. # • You MAY change: the cron schedule if the weekly cadence doesn't suit. diff --git a/standards/workflows/idea-triage.yml b/standards/workflows/idea-triage.yml index 7169e171a..81b8af283 100644 --- a/standards/workflows/idea-triage.yml +++ b/standards/workflows/idea-triage.yml @@ -6,8 +6,9 @@ # AGENTS — READ BEFORE EDITING: # • This file is a THIN CALLER STUB. All triage-dispatch logic lives in the # reusable above. -# • You MUST NOT change: the `uses:` ref — it is pinned to the -# `idea-triage/v1-stable` channel, a moving tag advanced centrally. Never +# • You MUST NOT change: the `uses:` ref — it is pinned to this repo's ring +# channel for `idea-triage`, set by the standards sweep (a moving tag +# advanced centrally). Never # repoint it to `@main`, a SHA, or a frozen `@vX`. Do not change the # `secrets:` block. # • You MAY change: the cron schedule if the weekly cadence doesn't suit. diff --git a/standards/workflows/initiative-planner.yml b/standards/workflows/initiative-planner.yml index d4af6cd80..c6f028301 100644 --- a/standards/workflows/initiative-planner.yml +++ b/standards/workflows/initiative-planner.yml @@ -7,8 +7,9 @@ # • This file is a THIN CALLER STUB. All idea→initiative dispatch logic (the # `idea:approved` gate, the trusted-actor check, and the cross-repo dispatch # to the central BMAD Scrum Master planner) lives in the reusable above. -# • You MUST NOT change: the `uses:` ref — it is pinned to the -# `initiative-planner/v1-stable` channel, a moving tag advanced centrally. +# • You MUST NOT change: the `uses:` ref — it is pinned to this repo's ring +# channel for `initiative-planner`, set by the standards sweep (a moving +# tag advanced centrally). # Never repoint it to `@main`, a SHA, or a frozen `@vX` (see # ci-standards.md → Reusable workflow versioning). Also do not change the # trigger events or the `secrets:` block. diff --git a/standards/workflows/persona-mention.yml b/standards/workflows/persona-mention.yml index cd7778729..cc37ae75d 100644 --- a/standards/workflows/persona-mention.yml +++ b/standards/workflows/persona-mention.yml @@ -7,8 +7,9 @@ # • This file is a THIN CALLER STUB. All routing logic lives in the reusable # workflow above, and every per-persona decision lives in that persona's # manifest — not here and not in the reusable. -# • You MUST NOT change: the `uses:` ref — it is pinned to the -# `persona-mention/v1-stable` channel, a moving tag advanced centrally. +# • You MUST NOT change: the `uses:` ref — it is pinned to this repo's ring +# channel for `persona-mention`, set by the standards sweep (a moving tag +# advanced centrally). # Never repoint it to `@main`, a SHA, or a frozen `@vX.Y.Z` (see # ci-standards.md → Reusable workflow versioning). Also do not change the # trigger events or the job-level `permissions:` block — reusable workflows diff --git a/standards/workflows/pr-auto-review.yml b/standards/workflows/pr-auto-review.yml index 73df2cea4..18ff27067 100644 --- a/standards/workflows/pr-auto-review.yml +++ b/standards/workflows/pr-auto-review.yml @@ -8,8 +8,9 @@ # reusable workflow above. # • You MAY change: the workflow name(s) in `workflow_run.workflows` to match # your repository's CI workflow name(s). -# • You MUST NOT change: the `@pr-auto-review/v1-stable` channel in the `uses:` -# line — this reusable is on the org-wide moving-channel model (rollout and +# • You MUST NOT change: the `uses:` ref — it is pinned to this repo's ring +# channel for `pr-auto-review`, set by the standards sweep. This reusable +# is on the org-wide moving-channel model (rollout and # rollback are a single central tag move; a frozen `@vN`/`@` pin is # rejected by the compliance audit). Nor the trigger event types or the # job-level `permissions:` block — reusable workflows can be granted no more diff --git a/standards/workflows/pr-review-mention.yml b/standards/workflows/pr-review-mention.yml index cab045617..91607a85c 100644 --- a/standards/workflows/pr-review-mention.yml +++ b/standards/workflows/pr-review-mention.yml @@ -6,8 +6,9 @@ # AGENTS — READ BEFORE EDITING: # • This file is a THIN CALLER STUB. All review-dispatch logic lives in the # reusable workflow above. -# • You MUST NOT change: the `uses:` ref — it is pinned to the -# `pr-review-mention/v2-stable` channel, a moving tag advanced centrally. +# • You MUST NOT change: the `uses:` ref — it is pinned to this repo's ring +# channel for `pr-review-mention`, set by the standards sweep (a moving +# tag advanced centrally). # Never repoint it to `@main`, a SHA, or a frozen `@vX` (see # ci-standards.md → Reusable workflow versioning). Also do not change the # trigger events or the job-level `permissions:` block — reusable workflows diff --git a/standards/workflows/pr-review.yml b/standards/workflows/pr-review.yml index d40a359af..fa61f51f2 100644 --- a/standards/workflows/pr-review.yml +++ b/standards/workflows/pr-review.yml @@ -9,9 +9,9 @@ # above, including concurrency (per PR + head SHA, never cancelling an # in-flight review), the check_suite-without-a-PR skip, and reading # `client_payload.pr_url` from repository_dispatch. -# • You MUST NOT change: the `@pr-review/v1-stable` channel in the `uses:` -# line or the matching `agent_ref` — both are re-pinned in lockstep to this -# repo's canary-ring tier by the standards sweep. Nor the workflow `name:`, +# • You MUST NOT change: the `pr-review` channel in the `uses:` line or the +# matching `agent_ref` — both are pinned in lockstep to this repo's ring +# channel for `pr-review`, set by the standards sweep. Nor the workflow `name:`, # the job id `review` (check names depend on both), the trigger event types, # the Dependabot skip guard, or the job-level `permissions:` block. Do not # add a stub-level `concurrency:` block. diff --git a/test/scripts/deploy-standard-workflows/stub-header-tier-neutral.bats b/test/scripts/deploy-standard-workflows/stub-header-tier-neutral.bats new file mode 100644 index 000000000..69fc9fe87 --- /dev/null +++ b/test/scripts/deploy-standard-workflows/stub-header-tier-neutral.bats @@ -0,0 +1,106 @@ +#!/usr/bin/env bats +# Issue #1297 — a synced stub's header never contradicts its own `uses:` pin. +# +# The sweep re-pins a ring-managed stub's `uses:` / `agent_ref:` / `checkout_ref:` +# lines to the repo's ring channel (ring_repin_uses) but deploys the comments +# verbatim. A template header naming `/v-stable` therefore sits above a +# `@/v-ring1` pin in every ring repo, review bots flag the mismatch, and +# agent passes "fix" it in the consumer — drifting the stub from the template. +# The headers are tier-neutral instead, so: +# - no ring-managed template, rendered at a ring channel, still names the +# agent's stable channel anywhere; +# - a correctly swept ring-1 stub is still compliant (stub_body_matches_template). + +setup() { + TT_TMP="$(mktemp -d "$BATS_TEST_TMPDIR/hdr.XXXXXX")" + REPO_ROOT="$(cd -- "${BATS_TEST_DIRNAME}/../../.." && pwd)" + SCRIPT="${REPO_ROOT}/scripts/deploy-standard-workflows.sh" +} + +teardown() { rm -rf "$TT_TMP"; } + +# Fake gh: serves v1 channel tags for every agent (matching-refs); nothing else. +install_gh_stub() { + local bin="${TT_TMP}/bin" + mkdir -p "$bin" + cat > "$bin/gh" <<'STUB' +#!/usr/bin/env bash +if [ "${1:-}" = "api" ]; then + case "$2" in + *matching-refs/tags/*) + agent="${2##*matching-refs/tags/}"; agent="${agent%%/*}" + for c in stable next ring0 ring1; do echo "refs/tags/${agent}/v1-${c}"; done + exit 0 ;; + esac +fi +exit 0 +STUB + chmod +x "$bin/gh" + PATH="${bin}:${PATH}"; export PATH +} + +# ring_rendered_templates — for every ring-managed channel-pinned template, print +# "