Skip to content

ci(gate): add sea-ref-gate to forbid regrown SEA-NNN issue refs (RIG-2804) - #717

Merged
mattwilkinsonn merged 3 commits into
mainfrom
compass-repo/rig-2804-sea-ref-gate
Aug 30, 2026
Merged

ci(gate): add sea-ref-gate to forbid regrown SEA-NNN issue refs (RIG-2804)#717
mattwilkinsonn merged 3 commits into
mainfrom
compass-repo/rig-2804-sea-ref-gate

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

This PR is part of a stack containing 2 PRs:

  1. main
  2. refactor(rebrand): flip SEA-NNN issue refs to RIG-NNN across the tree (RIG-2804) #716
  3. "ci(gate): add sea-ref-gate to forbid regrown SEA-NNN issue refs (RIG-2804)" (this PR)

A fail-closed CI check that the compass tree carries no retired SEA-NNN issue
reference, keeping the RIG-2804 P1 flip from silently re-rotting — the same
pattern as orion-ref-gate and design-ledger-gate.

A sibling to orion-ref-gate, not an extension of it: that gate is deliberately
single-token ("SCOPE: orion ONLY... does not double as a general brand-token
gate"), so the SEA boundary gets its own gate rather than bloating it.

The gate matches the UPPERCASE-NUMERIC SEA-<digits> whole-word token —
exactly what the P1 codemod flipped, so the two are symmetric: the gate goes
green precisely when the flip is complete. It does NOT match lowercase
sea-<n> branch slugs or SEA-nnn placeholders, mirroring the codemod.

Carve-outs mirror orion-ref-gate: forks/** vendored subtrees (but not
first-party forks/README.md), the gate's own source, generated eng-docs copies,
and bun.lock. Wired into moon run :ci via the ci aggregate; never cached
(the subject is the live tracked tree).

Verified: 22 unit tests over the pure core (token match, carve-outs, grep-hit
parsing, runner exit codes); the gate runs clean on the flipped tree and trips
red (exit 1) on an injected SEA-9999.

Refs RIG-2804.

Co-authored-by: Matt Wilkinson matt@rigel.build

@linear-code

linear-code Bot commented Aug 28, 2026

Copy link
Copy Markdown

RIG-2804

@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-repo-rig-2804-sea-re.compass-eng-docs.pages.dev

Deployed from compass-repo/rig-2804-sea-ref-gate at 4254594.

rigel-mintaka and others added 3 commits August 30, 2026 00:25
… (RIG-2804)

Number-preserving `SEA-<n>` → `RIG-<n>` sweep over the tracked compass tree,
matching the settled orion #1829 (RIG-2569) pattern. The Linear team-key rename
preserved issue numbers 1:1 (SEA-1512 == RIG-1512), so this is a pure token flip
to match the live team name — no renumbering, no behavior change.

Mechanical guarantee. Applied by a one-shot codemod matching `\bSEA-(\d+)\b`,
then verified per file: for 344 of the 345 changed files, re-deriving the flip
from the `main` version yields byte-identical output — i.e. the only change is
`SEA-<n>→RIG-<n>`. 1515 refs across 345 files.

The one exception is `docs/designs/DECISIONS.md`, which additionally flips 4
lowercase anchor-link slugs (`#...sea-1721...` → `#...rig-1721...`, likewise
1722/1723/1364). Those links target design-record headings whose text this flip
renamed (`### A1 — SEA-1721:` → `### A1 — RIG-1721:`), so the heading's derived
GitHub anchor moved to `rig-`; the link has to follow or it dangles. The
design-ledger gate validates exactly these ledger→record anchors and is what
surfaced it. Verified: DECISIONS.md deviates from the pure token flip on exactly
those 4 lines and nothing else.

Deliberately left untouched (the codemod does not match them):

- lowercase `sea-<n>` branch-slug artifacts (e.g. `compass-sea-1243-...`) —
  historical git branch names quoted in design records; the team rename does not
  rewrite the past.
- `SEA-nnn` / `SEA-NNN` / `SEA-N` prose placeholders — the digit class rejects
  letters, so these stay as generic "some issue number" prose.

No carve-outs needed. orion #1829's three (issue-owner dual-spell matcher,
linear-auto-done TEAM_KEY, pr-title negative fixture) do not exist in compass
(verified: zero TEAM_KEY consts, zero `(SEA|RIG)` dual-spell matchers, no
SEA-detection negative fixture). The sole `forks/` file carrying a SEA ref is
forks/README.md, first-party compass prose that flips like any authored file;
vendored forks/** subtrees carry zero SEA issue refs.

A follow-up commit adds tools/sea-ref-gate to keep the boundary from
re-rotting.

Spec-impact: none (issue-ref token flip; number-preserving; no externally-visible behavior change).

Refs RIG-2804.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
…2804)

A fail-closed CI check that the compass tree carries no retired `SEA-NNN` issue
reference, keeping the RIG-2804 P1 flip from silently re-rotting — the same
pattern as orion-ref-gate and design-ledger-gate.

A sibling to orion-ref-gate, not an extension of it: that gate is deliberately
single-token ("SCOPE: orion ONLY... does not double as a general brand-token
gate"), so the SEA boundary gets its own gate rather than bloating it.

The gate matches the UPPERCASE-NUMERIC `SEA-<digits>` whole-word token —
exactly what the P1 codemod flipped, so the two are symmetric: the gate goes
green precisely when the flip is complete. It does NOT match lowercase
`sea-<n>` branch slugs or `SEA-nnn` placeholders, mirroring the codemod.

Carve-outs mirror orion-ref-gate: forks/** vendored subtrees (but not
first-party forks/README.md), the gate's own source, generated eng-docs copies,
and bun.lock. Wired into `moon run :ci` via the `ci` aggregate; never cached
(the subject is the live tracked tree).

Verified: 22 unit tests over the pure core (token match, carve-outs, grep-hit
parsing, runner exit codes); the gate runs clean on the flipped tree and trips
red (exit 1) on an injected `SEA-9999`.

Refs RIG-2804.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
… (RIG-2804)

Both sea-ref-gate and orion-ref-gate scanned via `git grep ….nothrow()`, which
swallowed every non-zero git exit and returned empty output — so a genuine scan
malfunction (e.g. not a git work tree, git exit 128) was reported as clean/exit
0. That is fail-OPEN: the exact false-green a fail-closed gate exists to stop,
and it contradicted each gate's own docstring/package.json claim of "exit 2 on
scan error" (whose exit-2 branch was previously reachable only from the
injected-throw unit test, never from the real scanner).

Fix: inspect the git exit code. `git grep` exits 0 with matches, 1 on no match
(a legitimately clean empty result), and >=2 on a real error; exit >=2 now
throws, so runOnce's existing catch returns exit 2. Exit 1 stays clean.

Applied identically to both sibling gates so they do not diverge (the review of
the sea-ref-gate PR surfaced this as an inherited pattern from the merged
orion-ref-gate; Matt ruled fix both together). Verified: both gates stay
clean/exit 0 on the valid tree; run outside a git tree now exits 2 with the
"cannot scan the tree" diagnosis (was exit 0 before). Both test suites green
(sea 22, orion 23).

Refs RIG-2804.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@rigel-mintaka
rigel-mintaka force-pushed the compass-repo/rig-2804-sea-rig-flip branch from 083f60a to 32ef418 Compare August 30, 2026 04:35
@rigel-mintaka
rigel-mintaka force-pushed the compass-repo/rig-2804-sea-ref-gate branch from 0616f77 to 4254594 Compare August 30, 2026 04:48
Base automatically changed from compass-repo/rig-2804-sea-rig-flip to main August 30, 2026 05:04
@mattwilkinsonn
mattwilkinsonn merged commit 8d4d188 into main Aug 30, 2026
15 of 16 checks passed
@mattwilkinsonn
mattwilkinsonn deleted the compass-repo/rig-2804-sea-ref-gate branch August 30, 2026 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants