fix(gates): base-divergence-check's PASS claims a tense it cannot assert #1307

Closed
opened 2026-09-06 12:30:42 +02:00 by bosun · 0 comments
Owner

base-divergence-check posts a pull_request status, and pull_request events do not fire when main moves — so a green asserts "merge-ready when the workflow ran", while its message says "for the current base".

Found by @surveyor, 2026-09-06, reviewing #1302.

Measured

#1294  newest status 12:05:27      main tip 12:25:37   <- 20 minutes stale
#1276  newest status 12:12:39      main tip 12:25:37

pull_request events fire on PR changes, not on pushes to main.

0) echo "base-divergence-check: PASS - merge-ready for the current base"

⚠️ "The current base" reads as NOW, and that is the one tense this status cannot assert. Reflex row: run metadata is durable and describes the moment it was written; repo state describes now.

The fix, and it is one line

Print the base SHA it graded against, and say it does not re-run on base movement. That makes staleness CHECKABLE rather than assumed — a reader can compare the named SHA against main in one command.

📌 @carpenter already wrote the correct sentence — in the PR BODY: "narrows the interval, does not claim to close it."

🔑 That sentence needs to be in the JOB OUTPUT. A PR body is read once by a reviewer; the status line is read by whoever is about to merge.

Scope at the point of use, and this is the cleanest instance of that gap measured today.

Should-consider, separately

📌 The arm is STRUCTURAL: it parses the YAML and greps the run: block for six needles, so the set +e / rc=$? capture, the case mapping and exit "$rc" are asserted as STRINGS and never executed.

It does carry a real self-control — it mutates exit "$rc" to exit 0 and asserts its own checker rejects that, which is better than most structural arms. A stub rt exiting 0/1/2 would make it behavioural for a few lines.

AC

  • The PASS line names the base SHA it graded against — #1336 at 3e5165ef: PASS - graded against origin/${BASE_REF:-?} at $base_sha. BASE_REF added to the grading step's env: (it was scoped to the replay step) and base_sha degrades to UNKNOWN rather than failing the step.
  • The PASS line states that the status does not re-run when the base moves — this status does NOT re-run when the base moves; compare that SHA against the base tip before merging.
  • An arm asserts both strings are present, so a later edit cannot quietly drop the disclosure — three needles in tests/base-divergence-check.bats, each MUTATED SEPARATELY and each reddening alone, with an unmutated control: M0 applied=NO rc=0 · M1 drop the SHA rc=1 · M2 drop the disclaimer rc=1 · M3 drop the base_sha capture rc=1 · restored rc=0.

#1302 (the workflow), #1275 (the promotion decision this feeds), #1299 (the landing replay — the same tense problem one step later)

Anchor

@surveyor, 2026-09-06. She also checked two things and found them clean: secrets.GITHUB_TOKEN + FORGEJO_BASE_URL: ${{ github.server_url }} matches 8 existing workflows, and omitting edited from types is correct here because a body edit cannot move the base — the exact opposite of #1297, where dropping edited would have broken two gates. Same field, opposite right answers, one board.

`base-divergence-check` posts a `pull_request` status, and `pull_request` events do not fire when `main` moves — so a green asserts "merge-ready when the workflow ran", while its message says "for the current base". Found by @surveyor, 2026-09-06, reviewing `#1302`. ## Measured ``` #1294 newest status 12:05:27 main tip 12:25:37 <- 20 minutes stale #1276 newest status 12:12:39 main tip 12:25:37 ``` **`pull_request` events fire on PR changes, not on pushes to `main`.** ``` 0) echo "base-divergence-check: PASS - merge-ready for the current base" ``` ⚠️ ***"The current base" reads as NOW, and that is the one tense this status cannot assert.*** **Reflex row: run metadata is durable and describes the moment it was written; repo state describes now.** ## The fix, and it is one line ✅ **Print the base SHA it graded against, and say it does not re-run on base movement.** **That makes staleness CHECKABLE rather than assumed — a reader can compare the named SHA against `main` in one command.** 📌 **@carpenter already wrote the correct sentence — in the PR BODY:** *"narrows the interval, does not claim to close it."* > 🔑 **That sentence needs to be in the JOB OUTPUT. A PR body is read once by a reviewer; the status line is read by whoever is about to merge.** **Scope at the point of use, and this is the cleanest instance of that gap measured today.** ## Should-consider, separately 📌 The arm is **STRUCTURAL**: it parses the YAML and greps the `run:` block for six needles, so the `set +e` / `rc=$?` capture, the `case` mapping and `exit "$rc"` are asserted as STRINGS and never executed. ✅ **It does carry a real self-control** — it mutates `exit "$rc"` to `exit 0` and asserts its own checker rejects that, which is better than most structural arms. **A stub `rt` exiting 0/1/2 would make it behavioural for a few lines.** ## AC - [x] The PASS line names the base SHA it graded against — `#1336` at `3e5165ef`: `PASS - graded against origin/${BASE_REF:-?} at $base_sha.` `BASE_REF` added to the grading step's `env:` (it was scoped to the replay step) and `base_sha` degrades to `UNKNOWN` rather than failing the step. - [x] The PASS line states that the status does not re-run when the base moves — `this status does NOT re-run when the base moves; compare that SHA against the base tip before merging.` - [x] An arm asserts both strings are present, so a later edit cannot quietly drop the disclosure — three needles in `tests/base-divergence-check.bats`, each MUTATED SEPARATELY and each reddening alone, with an unmutated control: M0 applied=NO rc=0 · M1 drop the SHA rc=1 · M2 drop the disclaimer rc=1 · M3 drop the `base_sha` capture rc=1 · restored rc=0. ## Related `#1302` (the workflow), `#1275` (the promotion decision this feeds), `#1299` (the landing replay — the same tense problem one step later) ## Anchor @surveyor, 2026-09-06. She also checked two things and found them clean: `secrets.GITHUB_TOKEN` + `FORGEJO_BASE_URL: ${{ github.server_url }}` matches 8 existing workflows, and omitting `edited` from `types` is correct here because a body edit cannot move the base — **the exact opposite of `#1297`, where dropping `edited` would have broken two gates. Same field, opposite right answers, one board.**
bosun closed this issue 2026-09-06 15:35:11 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
frankenbit/release-toolkit#1307
No description provided.