Skip to content

ci: relax file-size ceilings by surface - #6485

Open
wesbillman wants to merge 2 commits into
mainfrom
carl/relax-file-size-ceilings
Open

ci: relax file-size ceilings by surface#6485
wesbillman wants to merge 2 commits into
mainfrom
carl/relax-file-size-ceilings

Conversation

@wesbillman

Copy link
Copy Markdown
Collaborator

Summary

  • raise Desktop Rust's differential file-size ceiling from 1,000 to 1,500 lines
  • raise Desktop frontend and Mobile ceilings from 1,000 to 1,200 lines
  • keep Web at 1,000 lines and preserve the existing no-growth ratchet above each ceiling

Why

The flat 1,000-line limit is forcing mechanical trimming in Desktop and Mobile even for small cohesive changes. Surface-specific ceilings relieve that pressure without granting Web or every authored component a blanket 2,000-line budget.

Testing

  • just file-size-check
  • cd desktop && pnpm exec biome check scripts/check-file-sizes.mjs
  • node --check mobile/scripts/check-file-sizes.mjs
  • git diff HEAD^ --check

Give Desktop and Mobile enough headroom to avoid mechanical line trimming
while preserving the tighter Web limit and the existing differential ratchet.

Co-authored-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Carl <32a2e2c9d428ee08902cab75d956da2c1d235a22d4766b0dd4138bf6e2e5db1d@buzz.block.builderlab.xyz>
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
@wesbillman
wesbillman requested a review from a team as a code owner August 21, 2026 15:45
wpfleger96
wpfleger96 previously approved these changes Aug 21, 2026
@wesbillman
wesbillman enabled auto-merge (squash) August 21, 2026 15:48

@jedwards27 jedwards27 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.

:bot: Jude’s code review agent

Verdict: REQUEST CHANGES
Reviewed: 4e3c9e619c93dd26677b392ad1f8cf0d12c8f855..e9074a7f22e75219f789091ea152fff5a0fcf226 (exact head e9074a7f22e75219f789091ea152fff5a0fcf226)
Risk: low runtime risk, but this PR changes an always-on CI policy whose numeric surface contract currently has no automated regression coverage.

Behavior/contracts traced: Desktop frontend/CSS → 1,200 lines; Desktop Rust including src-tauri/crates → 1,500; Mobile → 1,200; Web remains 1,000; files already above a configured ceiling retain the no-growth ratchet through max(configured ceiling, base line count).

Blocking finding

  • The changed surface ceilings are not asserted by any checked-in test. The production values live in desktop/scripts/check-file-sizes.mjs:8-59 and mobile/scripts/check-file-sizes.mjs:8-15, while scripts/check-file-sizes-core.test.mjs:56-83,102-118 only exercises the generic core with caller-supplied maxLines: 1000. Mutation proof changed Desktop Rust to 1,200, Desktop frontend to 1,500, and Mobile to 2,000; the complete just file-size-check still exited 0. Consequently, CI cannot detect a wrong ceiling in the policy this PR introduces. Add a checked-in contract/integration test that proves ceiling passes and ceiling+1 fails for Desktop Rust, Desktop frontend, Mobile, and Web, plus inherited over-ceiling growth rejection.

Validation at matching clean HEAD

  • CHECK_FILE_SIZES_BASE=4e3c9e619c93dd26677b392ad1f8cf0d12c8f855 just file-size-check — PASS (6/6 generic tests and all surface scripts).
  • Boundary probes — PASS: Desktop Rust 1500/1501, Desktop frontend 1200/1201, Mobile 1200/1201, governed Web 1000/1001, and inherited over-ceiling Rust growth.
  • cd desktop && pnpm exec biome check scripts/check-file-sizes.mjs — PASS.
  • node --check mobile/scripts/check-file-sizes.mjs and git diff ... --check — PASS.
  • Wrong-ceiling mutation plus full just file-size-check — unexpectedly PASS, establishing the coverage gap; mutations were restored and the review tree was clean.

Manual/native evidence: not warranted; no runtime or user-visible surface changed.

Residual risk: Desktop Core was still pending at the last lane refresh. No completed check was failing, but green completion would not exercise the missing policy assertions above.

@jedwards27 jedwards27 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.

:bot: Jude’s code review agent

Verdict: REQUEST CHANGES
Reviewed: 4e3c9e619c93dd26677b392ad1f8cf0d12c8f855..e9074a7f22e75219f789091ea152fff5a0fcf226 (exact head e9074a7f22e75219f789091ea152fff5a0fcf226)
Risk: low — this changes CI policy only; no runtime, UI, accessibility, persistence, auth, packaging, or release-artifact behavior changes.

Behavior/contracts traced: Desktop frontend/CSS now permits 1,200 lines and Desktop Rust (including src-tauri/crates) 1,500 (desktop/scripts/check-file-sizes.mjs:8-59); Mobile now permits 1,200 (mobile/scripts/check-file-sizes.mjs:8-15); Web remains at 1,000 (web/scripts/check-file-sizes.mjs:8-25). The shared differential rule still uses max(configured ceiling, base line count) and rejects candidate growth above that limit (scripts/check-file-sizes-core.mjs:31-40,147-159), so inherited over-ceiling files remain no-growth ratcheted. Justfile:100-104 runs the core tests plus each surface script, and .github/workflows/ci.yml:76-91 invokes that gate unconditionally.

Blocking finding: The changed surface policy has no automated contract test capable of detecting an incorrect surface ceiling. The existing shared tests exercise only generic caller-supplied maxLines: 1000 (scripts/check-file-sizes-core.test.mjs:56-83,102-118); they never assert Desktop Rust=1,500, Desktop frontend=1,200, Mobile=1,200, or Web=1,000. Mutation proof changed Desktop Rust to 1,200, Desktop frontend to 1,500, and Mobile to 2,000, yet the full just file-size-check still exited 0. Because policy is the entire behavior introduced here, add a surface-level contract test proving ceiling passes and ceiling+1 fails for each surface, Web stays at 1,000, and growth of an inherited over-ceiling file fails.

Validation at matching clean HEAD:

  • CHECK_FILE_SIZES_BASE=4e3c9e619c93dd26677b392ad1f8cf0d12c8f855 just file-size-check — PASS (6/6 generic tests plus Desktop/Web/Mobile scripts).
  • Temporary governed-file boundary probes — expected pass/fail at Desktop frontend 1,200/1,201, Desktop Rust 1,500/1,501, Mobile 1,200/1,201, and Web 1,000/1,001; inherited over-ceiling Rust file plus one line rejected.
  • cd desktop && pnpm exec biome check scripts/check-file-sizes.mjs — PASS.
  • node --check mobile/scripts/check-file-sizes.mjs and git diff 4e3c9e619c93dd26677b392ad1f8cf0d12c8f855..HEAD --check — PASS.
  • Wrong-ceiling mutation plus full just file-size-check — unexpected PASS, establishing the coverage gap; mutations were restored and the tree was clean.

Manual/native evidence: Not warranted for a CI-policy-only change.

Residual risk: Desktop Core remained in progress at final review refresh; no checks were failed. The missing policy regression test is independently blocking.

Keep the chosen Desktop, Mobile, and Web limits explicit in the lightweight
policy suite without duplicating the ratchet boundary matrix.

Co-authored-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Carl <32a2e2c9d428ee08902cab75d956da2c1d235a22d4766b0dd4138bf6e2e5db1d@buzz.block.builderlab.xyz>
Signed-off-by: Wes <wesbillman@users.noreply.github.com>

@jedwards27 jedwards27 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.

:bot: Jude’s code review agent

Verdict: REQUEST CHANGES
Reviewed: 4e3c9e619c93dd26677b392ad1f8cf0d12c8f855..07624ace3fea4c6dc5d6f189634c2fdb71f02c7a (delta from prior reviewed head e9074a7f22e75219f789091ea152fff5a0fcf226)
Risk: low runtime risk, but the new test still does not guard the effective always-on CI policy it claims to lock.

Blocking finding

  • scripts/check-file-sizes-core.test.mjs:56-75 reads each entrypoint as text and matches only the ceiling constant declarations. Production enforcement consumes the separately wired rules[*].maxLines values (desktop/scripts/check-file-sizes.mjs:11-59, mobile/scripts/check-file-sizes.mjs:10-16, web/scripts/check-file-sizes.mjs:10-26; consumed by scripts/check-file-sizes-core.mjs:138-151). Two independent mutations proved the gap: (1) leaving all declarations unchanged while rewiring every production maxLines to incorrect numeric values still left the new test green, and (2) rewiring both Desktop Rust roots from the 1,500 constant to the 1,200 frontend constant left the complete just file-size-check green. Thus the effective surface ceiling can regress while CI reports that the intended ceilings are locked.

Use behavior-level coverage through the actual production policy: an import-safe exported rule/policy module asserted against evaluateFileSize, or fixture-repository entrypoint tests proving ceiling passes and ceiling+1 fails for Desktop Rust, Desktop frontend, Mobile, and unchanged Web. The inherited over-ceiling hold/shrink/growth test at scripts/check-file-sizes-core.test.mjs:123-140 is effective at the shared-policy layer; mutation of allowedLineCount made it fail, so that portion need not be duplicated gratuitously unless using an end-to-end fixture approach.

Validation at matching clean HEAD

  • CHECK_FILE_SIZES_BASE=4e3c9e619c93dd26677b392ad1f8cf0d12c8f855 just file-size-check — PASS (7/7 tests and all surface entrypoints).
  • node --check scripts/check-file-sizes-core.test.mjs — PASS.
  • git diff e9074a7f22e75219f789091ea152fff5a0fcf226..HEAD --check — PASS.
  • Wrong production-wiring mutations with declarations unchanged — unexpectedly PASS, preserving the original blind spot; mutations restored and trees clean.
  • Live PR head remained 07624ace3fea4c6dc5d6f189634c2fdb71f02c7a; all reported GitHub checks were complete and green/skipped as expected.

Manual/native evidence: not warranted; this delta changes CI tests only and no shipped runtime/UI/native behavior.

Residual risk: no runtime surface was exercised. The unresolved risk is specifically that future production rule wiring can diverge from the declarations while this source-regex test remains green.

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.

3 participants