Skip to content

test(release): pin the release-pr main-ref guard (RIG-3813) - #1271

Open
rigel-mintaka wants to merge 1 commit into
compass-native/rig-3813-release-pr-ref-guardfrom
compass-native/rig-3813-guard-regression-test
Open

rigel-mintaka wants to merge 1 commit into
compass-native/rig-3813-release-pr-ref-guardfrom
compass-native/rig-3813-guard-regression-test

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Stacked on #1263, which adds the guard this pins. Part of RIG-3813.

Closes the one HIGH finding from #1263's review: the guard was a security invariant that nothing
observed
. actionlint validates syntax only, and no test in the repo inspected workflow job gating,
so a future edit deleting if: github.ref == 'refs/heads/main' from release-pr would have stayed
green while re-opening the path for a workflow_dispatch from any ref to cut a release from main.

Where it lives

tools/toolchain, which already holds the repo's precedent for asserting about a workflow file from
a bun test: the Postgres image digest shared by .github/workflows/ci.yml and the local harness. No
new moon project, and no YAML parser dependency - the assertion works on the file text, like the
precedent it follows.

The part that matters

The test isolates the release-pr job block before matching. Four other jobs in the file carry
the identical github.ref == 'refs/heads/main' predicate, so a whole-file substring search would
pass with the guard deleted from the one job that needs it. That is the defect the test exists to
avoid, so it was verified against that exact mutation rather than assumed.

Verification

Three mutation trials, each run by the driver independently of the implementer, each restored after:

Mutation Result
Delete only release-pr's guard; all four siblings keep the identical predicate RED, release-pr must require main because it holds contents: write and mints release tags
Remove target-branch: main RED, the target-branch message
Unmodified tree 2 pass, 0 fail

An unlocatable or implausibly small job block fails rather than passing, so the test cannot turn
"I could not check this" into green.

Gates: moon run toolchain-parity:typecheck rc=0, moon run toolchain-parity:test 88 tests across
5 files with the two new cases named and passing, biome check clean on the new file. jj st
confirms .github/workflows/release.yml is unmodified by this PR.

release.yml joins the test task inputs for the same reason ci.yml is already there: a file a
test asserts about must invalidate the task, or the assertion stays cached and silently stops
running against what it constrains.

Open Questions

None.

The main-ref guard on `release-pr` is a security invariant that nothing
observed. actionlint validates syntax only, and no test inspected release job
gating, so an edit deleting the guard would have stayed green while re-opening
a path for a `workflow_dispatch` from any ref to cut a release from `main`.

Pin it in `tools/toolchain`, which already holds the precedent for asserting
about a workflow file from a bun test (the Postgres image digest shared by
ci.yml and the local harness).

The assertion isolates the `release-pr` job block before matching, because four
other jobs carry the identical `github.ref` predicate and a whole-file
substring search would pass with the guard deleted from the one job that needs
it. Verified against that exact mutation: removing only `release-pr`'s guard
while every sibling keeps its own turns the case red. An unlocatable or
implausibly small job block fails rather than reporting a pass, so the test
cannot turn "I could not check this" into green.

`release.yml` joins the `test` task inputs for the same reason ci.yml is
already there: a file a test asserts about must invalidate the task, or the
assertion stays cached and stops running against what it constrains.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@linear-code

linear-code Bot commented Sep 17, 2026

Copy link
Copy Markdown

RIG-3813

@github-actions

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-native-rig-3813-guar.compass-eng-docs.pages.dev

Deployed from compass-native/rig-3813-guard-regression-test at 81bc24e.

@rigel-mintaka
rigel-mintaka marked this pull request as ready for review September 17, 2026 02:56
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.

1 participant