Skip to content

fix(gate): unbreak main — file-size baseline skew and a stale gate-parity count - #1845

Open
macanderson wants to merge 2 commits into
mainfrom
fix-file-size-skew-1813-1828
Open

fix(gate): unbreak main — file-size baseline skew and a stale gate-parity count#1845
macanderson wants to merge 2 commits into
mainfrom
fix-file-size-skew-1813-1828

Conversation

@macanderson

@macanderson macanderson commented Aug 6, 2026

Copy link
Copy Markdown
Owner

What & why

main fails check-file-size at 5650c889, so every open PR inherits the red:

crates/stella-protocol/src/event.rs  grew to 2964, over its ceiling of 2962 (+2)
crates/stella-tui/src/deck_render.rs grew to 1531, over its ceiling of 1528 (+3)

Parallel merge skew, not a real regression. #1805 retightened the baseline to the then-current counts (retiring #1797's raises), and #1813 and #1828 were already in flight with CI green against the old ceilings.

Why this is make file-size-update and not a split

AGENTS.md allows a ceiling to move only when the growth is genuinely irreducible, and CLAUDE.md is explicit that raising one to dodge a real split is a defect. Both of these are the former:

File +N What grew Why it cannot move
event.rs +2 #1813 expanding the doc comment on StageKind::Witness to say authoring runs after execution A doc comment cannot be moved off its item — and this is a wire-contract type, so the doc is the contract
deck_render.rs +3 #1828's SessionPhase::Stopped => theme::TEXT_TERTIARY arm, plus two lines saying why a deliberate stop is not painted red A match arm cannot live in a sibling module; the match must be exhaustive

Neither is a split someone declined to do. #1828 in fact did split where one was possible — it moved the sessions projection into command_deck/sessions_view.rs precisely because command_deck.rs sat at its exact ceiling.

The baseline gets tighter, not looser

Regenerated rather than hand-edited, so the diff also carries what those same two PRs shrank:

command_deck.rs   4740 -> 4691   (-49, #1828's sessions_view.rs split)
pipeline.rs       3642 -> 3580   (-62, #1813 moving WITNESS_SYSTEM_PROMPT to witness.rs)
fleet_cmd.rs      1507 -> 1504   (-3)
event.rs          2962 -> 2964   (+2)
deck_render.rs    1528 -> 1531   (+3)

Four ceilings down by 114 lines, two up by 5. Net the ratchet is stricter than before this PR.

The witness

  • No witness test needed (gate/baseline reconciliation) — verified directly:
$ ./scripts/check-file-size.sh
check-file-size: OK — 1078 Rust/Python/shell files, none over 1500 lines except 32 grandfathered (none grew).
$ ./scripts/check-god-files.sh
check-god-files: OK — 24 god file(s) across 8 crate(s), named identically in AGENTS.md and every crate README.

The god-file set is unchanged — only counts moved — so AGENTS.md's table and the crate READMEs need no edit, and check-god-files confirms that rather than my asserting it.

Note on recurrence

This is the fourth distinct god-file ceiling break on main today (#1761 deck.rs, then driver.rs/registry.rs in #1800, now these two). The first three were "PR merged with a red gate"; this one is different — both PRs were green when they ran, and the baseline moved underneath them. enforce_admins is now true, which closes the first mechanism but not this one: a retighten and an in-flight PR can still cross. Worth knowing before concluding the class is closed.

Summary by Sourcery

Update file-size baseline to reconcile ceilings with recent god-file splits and documentation additions so the size gate reflects current main.

Bug Fixes:

  • Fix failing file-size gate on main by aligning baseline ceilings with current file lengths.

Enhancements:

  • Tighten overall file-size ceilings by capturing recent net line reductions while permitting small, irreducible increases in a few files.

Chores:

  • Regenerate file-size-baseline.txt to reflect the latest distribution of lines across tracked files.

…retighten

`main` fails `check-file-size` at 5650c88:

  crates/stella-protocol/src/event.rs  2964 over 2962 (+2)
  crates/stella-tui/src/deck_render.rs 1531 over 1528 (+3)

Parallel merge skew, not a real regression. #1805 retightened the baseline to
the then-current counts (retiring #1797's raises), and #1813 and #1828 were
already in flight with CI green against the OLD ceilings. Every open PR now
inherits the red.

Both growths are genuinely irreducible, which is the case AGENTS.md's escape
hatch names rather than the expedient it forbids:

- `event.rs` +2 is #1813 expanding the doc comment on `StageKind::Witness` to
  say authoring runs AFTER execution. A doc comment cannot be moved off its
  item, and it is a wire-contract type — the doc IS the contract.
- `deck_render.rs` +3 is #1828's `SessionPhase::Stopped => TEXT_TERTIARY` arm
  plus the two lines saying why a deliberate stop is not painted red. A match
  arm cannot live in a sibling module; the match must be exhaustive.

Neither is a split someone declined to do. #1828 in fact did the split where
one was possible, moving the sessions projection into `sessions_view.rs`.

Regenerated rather than hand-edited, so the diff also carries what the same two
PRs SHRANK, and the net effect is a tighter ratchet, not a looser one:

  command_deck.rs   4740 -> 4691   (-49, #1828's sessions_view.rs split)
  pipeline.rs       3642 -> 3580   (-62, #1813 moving WITNESS_SYSTEM_PROMPT)
  fleet_cmd.rs      1507 -> 1504   (-3)

Four ceilings down, two up by five lines total. The god-file SET is unchanged,
so AGENTS.md's table and the crate READMEs need no edit — `check-god-files`
confirms.

@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 Preview Aug 6, 2026 10:57am

@sourcery-ai

sourcery-ai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates the file-size gate baseline to reconcile main with recent merged changes, tightening several ceilings and slightly raising two to account for legitimate, irreducible line growth, so that check-file-size/check-god-files pass again on current main.

File-Level Changes

Change Details Files
Regenerate file-size baseline to reflect actual current line counts after recent refactors and doc/comment changes, keeping the ratchet net-stricter while clearing false-positive gate failures.
  • Updated recorded line counts for several existing god/large files, lowering ceilings where files shrank due to recent splits/refactors.
  • Raised ceilings minimally for two files whose sizes grew for irreducible reasons: a wire-contract doc comment expansion and an additional match arm plus explanatory comments.
  • Ensured that no new files are added to or removed from the grandfathered god-file set; only counts changed so check-god-files remains consistent with AGENTS.md and crate READMEs.
  • Re-synced the baseline so that check-file-size passes on current main and no longer flags the two legitimately grown files as regressions.
scripts/file-size-baseline.txt

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

…aid 24

`module-reachability` (#1750) joined `GATE_STEPS`, and `self-driving-test`
(#1753) joined it in the same window. Both documents name the new steps
correctly in their lists — only the spelled-out totals were left behind, which
is the exact half `check-gate-parity.sh` exists to catch and the direction that
misleads: a reader runs the list, sees green, and believes the gate is green.

  check-gate-parity: OK — 25 (twenty-five) gate steps, named in AGENTS.md and CONTRIBUTING.md.
@macanderson macanderson changed the title fix(gate): unbreak file-size — reconcile the baseline after the #1805 retighten fix(gate): unbreak main — file-size baseline skew and a stale gate-parity count Aug 6, 2026
@macanderson

Copy link
Copy Markdown
Owner Author

Second fix added: gate-parity

main was red on a second gate step, found while verifying the first:

check-gate-parity: FAIL — AGENTS.md does not spell the gate's step count as 'twenty-five'.
check-gate-parity: FAIL — CONTRIBUTING.md does not spell the gate's step count as 'twenty-five'.

module-reachability (#1750) and self-driving-test (#1753) both joined GATE_STEPS in the same window. Both documents name the new steps correctly in their lists — only the spelled-out totals were left behind, which is precisely the half check-gate-parity.sh exists to catch, and the direction that misleads: a reader runs the list, sees green, and believes the gate is green.

check-gate-parity: OK — 25 (twenty-five) gate steps, named in AGENTS.md and CONTRIBUTING.md.

Both fixes are in this PR because they are one thing from a reviewer's point of view: make gate does not pass on main, and after this it does.

Verified on this branch

Step Result
check-file-size OK — 32 grandfathered, none grew
check-god-files OK — 24 god files, set unchanged
check-gate-parity OK — 25 (twenty-five) steps
make guards-fast clean
make self-driving-test 60 / 60

@macanderson

Copy link
Copy Markdown
Owner Author

Overlap note: #1863 carries the same two-line gate-parity count fix as this PR's second commit, byte-identical. Whichever lands first wins; the other should drop cleanly.

The file-size baseline reconciliation in this PR's first commit is not duplicated anywhere, so this PR is still needed either way.

@macanderson

Copy link
Copy Markdown
Owner Author

Expect fmt + clippy + test to go red here, on something this PR does not touch. main currently fails clippy:

error: using `clone` on type `GenerationParams` which implements the `Copy` trait
  --> crates/stella-pipeline/src/pipeline/witness_stage.rs:55:30

Pre-existing at 5650c889 and already covered by #1873 and #1859. Every branch off main inherits it, this one included — the classic "red main makes every PR red".

So this PR's own two fixes are verified locally rather than by that job:

Check Result
check-file-size OK — 32 grandfathered, none grew
check-god-files OK — 24 god files, set unchanged
check-gate-parity OK — 25 (twenty-five) steps
make guards-fast clean
make self-driving-test 60 / 60

Once #1873 or #1859 lands, gh pr update-branch here should turn the job green.

macanderson pushed a commit that referenced this pull request Aug 6, 2026
…el step additions

Two gate steps landed on main in parallel — module-reachability (#1833)
and self-driving-test in GATE_STEPS (#1821) — and each PR bumped the
spelled-out count from twenty-three to twenty-four, so their merge left
both AGENTS.md and CONTRIBUTING.md claiming twenty-four steps while
GATE_STEPS holds twenty-five. check-gate-parity.sh catches exactly this,
which is why docs-guards went red on every PR based on current main.

The step lists themselves already name every step; only the two counts
were stale. Same fix as the parallel unbreak PRs #1845/#1863 — the edits
are identical, so whichever lands first the others still merge clean.

Refs #1815
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