Skip to content

[Phase 2] SC2 regression guard: assert self-review duty stays pinned to a stable channel #1624

Closed

Description

@don-petry

Story

As a release manager,
I want an automated assertion that this repo's own agentic review/merge duty runs a stable-tier channel pin,
so that SC2 (a broken in-dev version cannot block its own fix PR) is enforced continuously rather than proven once in a drill and left to erode.

Why this is the automatable half of #503

#503 is the SC2 game-day: ship a deliberately broken next and prove the fix PR still merges. Its "Done when" has two halves — demonstrated (a human drill, which stays on #503) and a regression test asserts the circular dependency stays broken (this issue).

The structural property already holds today. The pinned-version-report run 33409266607 (2026-08-31) shows this repo — which sits in ring next — pinning its own duty agents to stable-tier channels:

.github-private | dev-lead     | next | v1-stable | v139.2.0 | (flagged: ring expects next)
.github-private | agent-shield | next | v2-stable | v2.1.2   | (flagged: ring expects next)

The report flags these as ring mismatches, but for the self-hosted review/merge path that is exactly the SC2 property: production duty in the development repo runs stable, so a broken next cannot block its own fix. It is currently undocumented and untested, so nothing stops a well-meaning "fix the drift" PR from repinning dev-lead to v1-next and silently restoring the circular dependency.

Acceptance Criteria

  1. A bats test asserts that this repo's self-review-duty caller stubs (at minimum dev-lead.yml; include pr-review's stub if it pins a first-party reusable) resolve to a stable-tier channel — never next, ring0, @main, or a bare SHA.
  2. The assertion is written against the stub's uses: pin (parse the @<agent>/<channel> ref), not against a hardcoded version, so cutting a new release does not break it.
  3. The test fails with a message that names SC2 and explains why a next pin here is a regression — so a future contributor "fixing the ring drift" is told the constraint rather than deleting the test.
  4. The intentional-exception is documented: docs/initiatives/agentic-release-strategy.md (or the versioning doc) records that .github-private's stable pin for self-review duty is a deliberate SC2 requirement, and cross-references the pinned-version-report ring-mismatch flag so the two surfaces do not contradict each other.
  5. The test is registered in the existing bats job; shellcheck --severity=warning -x stays clean.

Tasks / Subtasks

Dev Notes

  • Follow the repo's sourceable-helper + fixture bats convention (see tests/template_stub_drift.bats): parse the pin from a fixture stub, assert over it, no network.
  • Do not repin anything. This issue asserts the current state is preserved; it does not change any pin.
  • Treat "stable-tier" as the channel tier, not a literal string — v1-stable and stable both qualify; v1-next and next do not. The tier vocabulary is in standards/ci-standards.md (Reusable workflow versioning) and scripts/lib/ring-pins.sh.
  • The pinned-version-report flags these pins as ⚠️ ring mismatches. That flag is correct from the ring-rollout perspective and this test is correct from the SC2 perspective; AC4 exists so the contradiction is written down rather than rediscovered.

References

  • docs/initiatives/agentic-release-strategy.md (SC2)
  • scripts/pinned-version-report.sh (petry-projects/.github)
  • tests/template_stub_drift.bats

Activity

  1. don-petry commented on Sep 1, 2026

    @don-petry
    CollaboratorAuthor

    Dev-Lead Implementation Plan

    Issue: #1624 — [Phase 2] SC2 regression guard: assert self-review duty stays pinned to a stable channel

    Scope

    Add a bats regression guard that parses the uses: channel pin of this repo's self-review/dev-duty caller stub (dev-lead.yml) and asserts it resolves to a stable-tier channel (never next/ring*/@main/bare SHA), with an SC2-naming failure message, plus documenting the deliberate stable-pin exception and reconciling it with the pinned-version-report ring-mismatch flag.

    Key design decision (pr-review scope)

    AC1 says "include pr-review's stub if it pins a first-party reusable." pr-review-trigger.yml does pin a first-party reusable — but to @pr-review/v1-next, the deliberate ring-0 canary (per its header + versioning.md). Its SC2 safety net is the break-glass (sc2-game-day.md mechanism 2), not channel decoupling. Asserting it "stable" would fail current state and violate the "do not repin / preserve current state" Dev Note. So the stable assertion targets dev-lead.yml (the SC2-via-channel-decoupling duty); pr-review-trigger.yml is documented as the intentional next exclusion (a guard records that it parses to next, not that it must be stable).

    Implementation Checklist

    Tests to Write

    • tier classification: v1-stable/stable pass; v1-next/next/v2-ring0/@main/bare-SHA fail
    • stub_uses_ref parses the pin from a fixture stub
    • failure message names SC2 and explains why a next pin is a regression (AC Add @claude delegation, auto-merge, and rebase handling #3)
    • live: .github/workflows/dev-lead.yml resolves to stable-tier (the real regression guard)
    • live: pr-review-trigger.yml parses to next (records the deliberate ring-0 exclusion)

    Test Command

    scripts/run-bats.sh tests/test_sc2_self_review_channel.bats (full: the bats job list) + bash .dev-lead/scripts/dev-lead-lint.sh

    Note

    Per the guardrail: this issue adds no with: forwards and repins nothing — it only asserts and documents the current state.

  2. don-petry commented on Sep 1, 2026

    @don-petry
    CollaboratorAuthor

    Dev-Lead: Progress (in progress — not yet durable)

    Provisional. Nothing is pushed yet; the automation posts the authoritative
    completion record (with PR number + head SHA) after the push. Treat the notes
    below as intent, not delivered results.

    Plan execution (intended)

    • Added a pure sourceable helper that parses a stub's uses: @<agent>/<channel> pin and classifies its tier (stable/next/ring*), plus a stable-tier assertion whose failure message names SC2.
    • Added a bats test: pure unit tests over fixtures + a live guard asserting .github/workflows/dev-lead.yml resolves to a stable tier (the actual regression guard), parsing the pin rather than a hardcoded version.
    • Documented the deliberate SC2 exception and reconciled it with the pinned-version-report ring-mismatch flag; also corrected a stale line in sc2-game-day.md that claimed dev-lead.yml pins next (it pins @dev-lead/v1-stable).
    • Registered the test in the lint.yml bats job.

    Design decision worth a reviewer's eye (pr-review scope)

    AC1 says "include pr-review's stub if it pins a first-party reusable." pr-review-trigger.yml does pin a first-party reusable, but to @pr-review/v1-next — the deliberate ring-0 canary (per its header + versioning.md; its SC2 net is the break-glass, mechanism 2). Asserting it "stable" would fail current state and violate the "do not repin / preserve current state" Dev Note. So the stable assertion targets dev-lead.yml; a separate guard records that pr-review-trigger.yml intentionally parses to next (documenting the exclusion rather than silently dropping it). If the intent was to also force pr-review to stable, that would require a repin, which this issue forbids.

    Files touched (this workspace, not yet pushed)

    • scripts/lib/self-review-channel.sh (new): pure channel-tier parse/assert helpers.
    • tests/test_sc2_self_review_channel.bats (new) + tests/fixtures/self-review-channel/*.yml (new): unit + live guards.
    • docs/release/versioning.md, docs/initiatives/agentic-release-strategy.md, docs/release/sc2-game-day.md: AC4 documentation + stale-line fix.
    • .github/workflows/lint.yml: registered the test in the bats job.

    Local checks (provisional — not the pushed run)

    • New test file: 20/20 pass locally; full listed bats suite green locally; .dev-lead/scripts/dev-lead-lint.sh (shellcheck --severity=warning -x + agent frontmatter) clean; markdownlint clean on the changed docs. These are local, pre-push signals only.

    Notes

    • No pin changed and no with: forward added (per the channel-skew guardrail). The change only asserts + documents the current state.
  3. don-petry commented on Sep 1, 2026

    @don-petry
    CollaboratorAuthor

    Dev-Lead: Implementation Complete — PR #1626

    The implementation for issue #1624 is durable: commits are pushed and a pull request is open. This record is backed by verifiable artifacts you can confirm in one click.

    Review happens on the PR. Acceptance criteria and test results are evidenced by the PR's diff and CI checks — not asserted here. If a later stage fails, this claim is retracted in place.

  4. added a commit that references this issue on Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dev-leadFor dev-lead agent pickupenhancementFeature requestsinitiativeEpic / initiative tracking issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions