Skip to content

fix(gate): unbreak all three of main's red gates in one PR, because one is not enough - #1894

Merged
macanderson merged 2 commits into
mainfrom
fix/unbreak-main-three-gates
Aug 6, 2026
Merged

fix(gate): unbreak all three of main's red gates in one PR, because one is not enough#1894
macanderson merged 2 commits into
mainfrom
fix/unbreak-main-three-gates

Conversation

@macanderson

@macanderson macanderson commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Why this PR exists rather than three

main fails fmt + clippy + test — a required context — on three independent counts, and that one job runs every guard in sequence. So a PR that fixes one of them still fails the other two, cannot go green, and cannot land:

PR fixes status
#1873 clippy + file-size fmt + clippy + test FAILURE
#1891 (mine) gate-parity fmt + clippy + test FAILURE
this all three green

Neither of the others can merge while the other is unmerged. That is a deadlock, not a queue — and it is why every open PR in the repository is currently red through no fault of its own.

1. file-size

crates/stella-protocol/src/event.rs grew to 2964 over its 2962 ceiling (+2); crates/stella-tui/src/deck_render.rs to 1531 over 1528 (+3). Both grandfathered god files, and this is the reviewable-baseline-diff escape hatch the ratchet documents for exactly that case.

Worth a look in the diff: the regenerated baseline also tightens four ceilings that had fallen and nobody had banked —

command_deck.rs  4740 → 4691
fleet_cmd.rs     1507 → 1504
pipeline.rs      3642 → 3580
driver.rs        2705 → 2580

That is the direction the ratchet exists to capture.

2. clippy

Two errors in stella-pipeline/src/pipeline/witness_stage.rs:

  • clone_on_copyparams.clone() on a Copy type → *params
  • field_reassign_with_defaultEngineConfig::default() followed by three field writes → a struct literal with ..default()

Both rewritten to the form clippy asks for. No #[allow].

3. gate-parity

Carries #1891's change — deleting the spelled-out count check rather than updating the number, because updating it is what keeps breaking.

The step names are checked one at a time, so two PRs adding different guards merge cleanly. The total is a single shared cell every concurrent guard-adding PR must write. module-reachability and self-driving-test landed an hour apart today, each having dutifully written "twenty-four" against its own base, and left main red for everyone. Twice in one day, with two agents then opening competing two-line fixes (#1863, #1882).

Dropping it loses nothing: if every step is named, the number of them is not independently knowable-wrong. It was a derived value maintained by hand — the same defect the guard exists to prevent one level up.

Verified it still guards the half that works:

$ perl -pi -e 's/ \+ module-reachability//' AGENTS.md
check-gate-parity: FAIL — AGENTS.md never mentions the gate step 'module-reachability'
$ # restored
check-gate-parity: OK — all 25 gate steps are named in AGENTS.md and CONTRIBUTING.md.

Verification

check-file-size:   OK — 1078 files, none over 1500 except 32 grandfathered (none grew)
check-gate-parity: OK — all 25 gate steps are named in AGENTS.md and CONTRIBUTING.md
check-god-files:   OK — 24 god files across 8 crates, named identically everywhere
cargo clippy --workspace --all-targets -- -D warnings   clean
cargo fmt --check                                       clean
cargo test -p stella-pipeline                           556 passed, 0 failed

No witness test: three gates are the check. Each fails on main and passes here.

Note on #1873

Its two fixes are real and I have kept them in substance (the clippy rewrite, the baseline bump). Merging this supersedes it; close #1873 and #1891 once this lands, or merge #1873 first and I will rebase — either order works, but one PR has to carry all three or fmt + clippy + test stays red.

Closes #1883
Refs #1873, #1891, #1750, #1645

Summary by Sourcery

Fix CI gate failures by aligning gate documentation and checks, updating clippy-violating code, and refreshing file size baselines for oversized files.

Bug Fixes:

  • Remove brittle gate step count enforcement while keeping per-step parity checks between GATE_STEPS and documentation.
  • Adjust witness pipeline configuration code and tests to satisfy clippy’s clone and struct initialization lints without changing behavior.
  • Update file size baseline to account for existing oversized grandfathered files and capture reduced sizes where applicable.

Stella Test added 2 commits August 6, 2026 04:29
…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
…ne is not enough

main fails `fmt + clippy + test` — a REQUIRED context — on three independent
counts, and that job runs every guard in sequence. A PR that fixes one of them
still fails the other two, so it cannot go green and cannot land. #1873 fixes
two and is red; #1891 (mine) fixes the third and is red. Neither can merge
while the other is unmerged. This is the PR that breaks the deadlock: all
three, or none.

## 1. file-size

`crates/stella-protocol/src/event.rs` grew to 2964 over its 2962 ceiling (+2)
and `crates/stella-tui/src/deck_render.rs` to 1531 over 1528 (+3). Both are
grandfathered god files, and this is the reviewable-baseline-diff escape hatch
the ratchet documents for exactly that.

The regenerated baseline also TIGHTENS four ceilings that had fallen —
command_deck.rs 4740→4691, fleet_cmd.rs 1507→1504, pipeline.rs 3642→3580,
driver.rs 2705→2580 — which is the direction the ratchet exists to capture and
which nobody had banked.

## 2. clippy

Two errors in `stella-pipeline`, both in `witness_stage.rs`:

  clone_on_copy            `params.clone()` on a `Copy` type -> `*params`
  field_reassign_with_default  `EngineConfig::default()` then three field
                               writes -> a struct literal with `..default()`

Both are rewrites to the form clippy asks for, not `#[allow]`s.

## 3. gate-parity

The spelled-out step count. This carries #1891's change rather than restating
the number, because restating it is what keeps breaking: the step NAMES are
checked one at a time and merge cleanly, while the TOTAL is a single shared
cell every concurrent guard-adding PR must write. `module-reachability` and
`self-driving-test` landed an hour apart today, each having dutifully written
"twenty-four" against its own base, and left main red for everyone — twice.

Dropping the check loses nothing: if every step is named, the number of them
is not independently knowable-wrong. Verified it still guards the half that
works — with `module-reachability` deleted from AGENTS.md the guard fails
naming it, and restored it passes.

## Verification

  check-file-size:   OK — 1078 files, none over 1500 except 32 grandfathered (none grew)
  check-gate-parity: OK — all 25 gate steps are named in AGENTS.md and CONTRIBUTING.md
  check-god-files:   OK — 24 god files across 8 crates, named identically everywhere
  cargo clippy --workspace --all-targets -- -D warnings   clean
  cargo fmt --check                                       clean
  cargo test -p stella-pipeline                           556 passed, 0 failed

No witness test: three gates are the check. Each fails on main and passes here.

Closes #1883
Refs #1873, #1891, #1750, #1645

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @macanderson, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
stella-cli-docs Ignored Ignored Aug 6, 2026 11:38am

@sourcery-ai

sourcery-ai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

This PR unblocks the main branch by fixing all three failing gates in one shot: updating the file-size baseline for god files, resolving clippy violations in the pipeline witness stage, and simplifying the gate-parity check so it no longer enforces a fragile spelled-out step count while still verifying that all gate steps are named in documentation.

Flow diagram for updated gate-parity check behavior

graph TD
  MakeGate[make gate] --> GateParityScript[scripts/check-gate-parity.sh]

  GateParityScript --> ReadGateSteps[Read GATE_STEPS from Makefile]
  ReadGateSteps --> CountSteps[Compute count of gate steps]

  CountSteps --> LoopDocs[For each doc in AGENTS.md and CONTRIBUTING.md]
  LoopDocs --> LoopSteps[For each gate step name]
  LoopSteps --> CheckName[Check step name is present in doc]

  CheckName -->|missing| Fail[Exit 1: gate step name not documented]
  CheckName -->|all present| Success[Print: check-gate-parity OK — all gate steps are named]
Loading

File-Level Changes

Change Details Files
Relax and regenerate the file-size baseline to accommodate growth in grandfathered god files while tightening ceilings for some previously shrunk files.
  • Increase recorded size ceilings for event.rs and deck_render.rs to match current file sizes within the grandfathered god-file mechanism.
  • Regenerate file-size-baseline.txt so that several files with decreased sizes now have lower enforced ceilings, keeping the ratchet direction intact.
  • Confirm that overall file-size checks pass with no non-grandfathered files exceeding limits.
scripts/file-size-baseline.txt
crates/stella-protocol/src/event.rs
crates/stella-tui/src/deck_render.rs
Fix clippy warnings in the witness stage by using idiomatic handling for Copy types and struct initialization.
  • Replace a clone_on_copy pattern by assigning a dereferenced Copy value to config.params instead of cloning.
  • Refactor EngineConfig initialization in a test from default-plus-field-mutation to a struct literal with a trailing ..EngineConfig::default(), satisfying field_reassign_with_default.
  • Ensure cargo clippy --workspace --all-targets -D warnings runs clean for stella-pipeline.
crates/stella-pipeline/src/pipeline/witness_stage.rs
Simplify the gate-parity check to rely solely on named steps rather than enforcing a manually maintained spelled-out total, avoiding merge conflicts between concurrent gate additions.
  • Remove the number_word() helper and all logic that derives and verifies a spelled-out gate-step count in check-gate-parity.sh.
  • Drop per-document checks that the prose spells the gate-step count, and update the success message to refer to “all gate steps are named” instead of including the spelled-out word.
  • Update AGENTS.md and CONTRIBUTING.md to eliminate prose that hardcodes the total number of gate steps while retaining the named list and explanation of the guard.
  • Document in comments why the count check was removed, including the recent merge-collision failure scenario and the rationale that the list of names is the authoritative source.
scripts/check-gate-parity.sh
AGENTS.md
CONTRIBUTING.md

Assessment against linked issues

Issue Objective Addressed Explanation
#1883 Modify check-gate-parity.sh so it no longer checks or depends on a spelled-out total gate-step count, while preserving the per-step name checks.
#1883 Update AGENTS.md and CONTRIBUTING.md to remove the hard-coded/spelled-out total gate-step count from the prose so concurrent guard-adding PRs no longer collide on it.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@macanderson
macanderson merged commit 8e2de12 into main Aug 6, 2026
12 checks passed
@macanderson
macanderson deleted the fix/unbreak-main-three-gates branch August 6, 2026 18:27
macanderson pushed a commit that referenced this pull request Aug 6, 2026
macanderson pushed a commit that referenced this pull request Aug 6, 2026
macanderson pushed a commit that referenced this pull request Aug 6, 2026
…advertised it

#1894 (via #1891) deleted check-gate-parity.sh's spelled-out step-count
check — the one shared cell two concurrent guard-adding PRs collided on
twice on 2026-08-06 (#1883) — but left the header's 'What it checks' list
naming the deleted check as item 3. Stale comments are bugs: drop the ghost
item, renumber, and record the total under 'deliberately does NOT check',
pointing at the rationale block #1894 added in the body.

Refs #1883
Refs #1437
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.

gate: the spelled-out gate-step count is a shared cell two concurrent PRs always collide on

1 participant