fix(gate): stop checking the gate-step count, which caused reds instead of catching them (#1883) - #1891
Open
macanderson wants to merge 1 commit into
Open
fix(gate): stop checking the gate-step count, which caused reds instead of catching them (#1883)#1891macanderson wants to merge 1 commit into
macanderson wants to merge 1 commit into
Conversation
…ad of catching them `main` is red on `gate-parity`, so `docs guards` fails on every open PR. This unbreaks it and removes the reason it will happen again. `check-gate-parity.sh` checked two things about AGENTS.md and CONTRIBUTING.md: that every step in GATE_STEPS is NAMED, and that the spelled-out TOTAL matches. The first is the one that earns its keep — #1437 records two real drifts it caught, both under-reporting a newly added guard. The second is a single shared cell that any two concurrent guard-adding PRs must both write, and each writes its own correct answer. That happened twice on 2026-08-06. `module-reachability` (#1750) and `self-driving-test` landed within an hour, each having dutifully updated both documents to "twenty-four". The second merge left GATE_STEPS at 25 with the prose saying 24, and every open PR inherited the failure. Two separate agents then opened competing two-line fixes for it (#1863, #1882). Nothing is lost by dropping it. The count told a reader no fact the checked list does not already carry: if every step is named, the number of them is not independently knowable-wrong. It was a derived value maintained by hand — which is the same defect this guard exists to prevent one level up. Option 1 of the three in #1883, and the only one that leaves nothing to go stale. Deriving the word (option 2) keeps a number nobody reads; a --fix flag (option 3) still leaves `main` red until somebody runs it. Removes `number_word()` and the count comparison. The name checks, the ghost check (a CONTRIBUTING command that is no longer a gate step) and the fence parsing are untouched. Verified both directions: with `module-reachability` deleted from AGENTS.md the guard still fails naming it, and restored it passes — so this narrows the guard to the half that works rather than weakening it. ## Why this PR and not #1863 #1863 is the same two-line count fix, opened first, and I closed my own duplicate (#1882) in its favour. It cannot merge: it is docs-only, `ci.yml` carries `paths-ignore` for `*.md`, and all three required contexts therefore never report — GitHub leaves it BLOCKED forever. `ci.yml`'s own comment says that filter is safe because `merge_group` ignores `paths-ignore`, which is true only with a merge queue enabled, and it is not (#1645). This PR touches `scripts/`, so it gets its checks and can actually land. Filed separately as the general defect, because every docs-only PR in this repository has the same problem. Closes #1883 Refs #1750, #1863, #1645
Contributor
There was a problem hiding this comment.
Sorry @macanderson, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
Reviewer's GuideStops check-gate-parity from enforcing a spelled-out total gate-step count and updates docs accordingly, so the guard only verifies per-step parity by name and no longer causes merge conflicts when multiple PRs add steps concurrently. Flow diagram for updated gate-parity guard behaviorflowchart TD
Start([Run check-gate-parity.sh]) --> A[Read GATE_STEPS from Makefile]
A --> B[Compute count of gate steps]
B --> C{count == 0?}
C -->|yes| F1[Print check-gate-parity: FAIL — no gate steps] --> EndFail1((Exit 1))
C -->|no| D[For each doc: AGENTS.md, CONTRIBUTING.md]
D --> E[Verify every GATE_STEPS entry is named in doc]
E --> G[Check for ghosts: commands in CONTRIBUTING.md not in GATE_STEPS]
G --> H{Any failures?}
H -->|yes| EndFail2((Exit 1))
H -->|no| I[Print check-gate-parity: OK — all count gate steps are named in AGENTS.md and CONTRIBUTING.md]
I --> EndOK((Exit 0))
subgraph Removed_total_count_check
B --> R1[Derive spelled-out number word from count]
R1 --> R2[grep for number word in AGENTS.md and CONTRIBUTING.md]
R2 --> R3{Mismatch?}
R3 -->|yes| RFail[Previously: FAIL because prose count was stale]
R3 -->|no| RPass[Previously: continue]
end
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This unbreaks
mainmainis red ongate-parity, sodocs guardsfails on every open PR. This fixes it and removes the reason it will happen again.The defect
check-gate-parity.shchecked two things about AGENTS.md and CONTRIBUTING.md:GATE_STEPSis namedThe names are checked one at a time, so two PRs adding different guards produce diffs that merge cleanly. The total does not have that property, and it broke twice on 2026-08-06:
module-reachability(#1750) andself-driving-testlanded within an hour, each having dutifully updated both documents to "twenty-four". The second merge leftGATE_STEPSat 25 with the prose saying 24. Two separate agents then opened competing two-line fixes for it (#1863, #1882 — I closed the latter, which was mine).A guard that causes reds instead of catching them is not a guard.
Why deleting it loses nothing
The count told a reader no fact the checked list does not already carry: if every step is named, the number of them is not independently knowable-wrong. It was a derived value maintained by hand — precisely the defect this guard exists to prevent one level up.
Option 1 of the three in #1883, and the only one that leaves nothing to go stale. Deriving the word (option 2) keeps a number nobody reads; a
--fixflag (option 3) still leavesmainred until somebody runs it.number_word()and the count comparison go. The name checks, the ghost check (a CONTRIBUTING command that is no longer a gate step) and the fence parsing are untouched.Verification, both directions
Narrowing a guard needs proof it still guards:
make shellcheckclean.Why this PR and not #1863
#1863 is the same two-line count fix, opened first, and I closed my duplicate in its favour. It cannot merge.
It is docs-only;
ci.ymlcarriespaths-ignorefor*.md; so all three required contexts (fmt + clippy + test,cargo deny + cargo audit,harbor_adapter + analyzer pytest) never report, and GitHub leaves itBLOCKEDforever:ci.yml's own comment says that filter is safe becausemerge_groupignorespaths-ignore— which is true only with a merge queue enabled, and it is not (#1645). So the path filter is currently a trap for every docs-only PR in this repository. Filed separately; it is a bigger problem than this one.This PR touches
scripts/, so it gets its checks and can actually land.Closes #1883
Refs #1750, #1863, #1645
Summary by Sourcery
Stop enforcing a spelled-out gate-step count in documentation guards to prevent false failures while preserving per-step parity checks between scripts and docs.
Bug Fixes:
Enhancements: