Skip to content

chore(tooling): prune 7 stale file-size exceptions that were hiding real warnings - #438

Merged
runyourempire merged 1 commit into
mainfrom
chore/prune-stale-file-size-exceptions
Aug 15, 2026
Merged

chore(tooling): prune 7 stale file-size exceptions that were hiding real warnings#438
runyourempire merged 1 commit into
mainfrom
chore/prune-stale-file-size-exceptions

Conversation

@runyourempire

Copy link
Copy Markdown
Collaborator

Why

EXCEPTIONS in scripts/check-file-sizes.cjs is consulted before any size comparison:

if (EXCEPTIONS[normalized]) continue;

So an entry suppresses the warn tier as well as the error tier. An entry for a file that is no longer over the error threshold is not a harmless leftover — it silently hides a legitimate warning, and it disarms the hard limit on a file that may keep growing.

Seven entries were in that state. All line counts below were measured with the gate's own countLines(), not wc.

Removed

Entry Lines Warn Error Why it's stale
src-tauri/src/analysis_rerank.rs 866 700 1000 Entry was self-described TEMPORARY, owed a split back to #423. #430 (02c105d9) did the split (1032 → 866) but only touched the two .rs files — it never removed the exception it was owed.
src/components/preemption/PreemptionCard.tsx 388 350 500 Justification claimed "9 lines over". It is 38 over warn and 112 under error — the stated reason was false.
src/components/enterprise/SsoConfigPanel.tsx 355 350 500 Justification claimed "5 lines over". 5 over warn, 145 under error.
src-tauri/src/scoring/pipeline_tests.rs deleted 700 1000 File was deleted in #421. Same class as the five dead entries #421 already swept — it missed this one.
src-tauri/src/settings/types.rs 908 700 1000 Under error; was hiding a warning.
src/store/slice-types.ts 446 300 500 Under error; was hiding a warning.
src-tauri/src/sources/adapter_resilience_tests.rs 1802 n/a 2000 Test file, so warn-exempt — removing it changes no output today, but it left the 2000-line hard limit silently unenforceable on a file that is actively grown.

Kept

Every other entry is genuinely over its error threshold and is doing its job — those were left alone.

One deliberate keep that looks like a miss: src/types/i18n-resources.d.ts does not resolve on disk, but it is gitignored and generated by pnpm run i18n:types, which validate:all runs before this gate. That is already documented inline; the entry stays.

src-tauri/src/briefing_pipeline_tests.rs is a different file from the deleted scoring/pipeline_tests.rs and was never in the map.

Verification

before:  42 file(s) approaching size limits (warnings only).   exit 0
after:   47 file(s) approaching size limits (warnings only).   exit 0

The 5 new warnings are exactly the suppressed files now reporting honestly (settings/types.rs 908, analysis_rerank.rs 866, slice-types.ts 446, PreemptionCard.tsx 388, SsoConfigPanel.tsx 355).

No file crosses an ERROR threshold, so the pre-commit gate cannot block the fleet — the failure mode that took every developer offline on 2026-08-14 (#423#430). Every consumer of this script (.husky/pre-commit, the repo-guards CI job, build-guardian.cjs, compound-quality-check.cjs, sentinel-scan.cjs) keys on exit code or ERROR lines only, so warnings are safe everywhere.

Also verified: after this change every remaining entry passes the "file exists and is over its error threshold" test, except the documented generated-file case above.

Scope

scripts/check-file-sizes.cjs only — 12 deletions, no source file touched, nothing split.

4 of the 7 (pipeline_tests.rs, settings/types.rs, slice-types.ts, adapter_resilience_tests.rs) were found by auditing all 38 entries rather than being named up front. Each is an independent line and can be dropped in review without affecting the others.

Hook note

This worktree has no node_modules, so .husky/_ does not exist and core.hooksPath resolves to nothing — git silently ran no hooks. --no-verify was not used. The gates were run manually instead, all green:

check-file-sizes · check-doc-location · check-llm-gate-honesty · check-vanity-metrics · check-release-channel · i18n-guard · validate-boundary-calls · compound-quality-check · push-range scan-secrets --diff-added · private-asset-guard

Not runnable here (no node_modules): tsc, ESLint, and the frontend suite. This change is a Node tooling script with no TypeScript or frontend surface; CI's required gates cover them.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AUeKTKwNmdow8yUk3q8RB2

…eal warnings

`EXCEPTIONS` is consulted BEFORE any size comparison:

    if (EXCEPTIONS[normalized]) continue;

so an entry suppresses the WARN tier as well as the ERROR tier. An entry for a
file that is no longer over the *error* threshold is therefore not a no-op — it
silently hides a legitimate warning. Seven entries were in that state. Line
counts verified with the gate's own countLines(), not wc.

Removed (all verified UNDER their error threshold, so the gate still exits 0):

  src-tauri/src/analysis_rerank.rs                   866 / 1000  (warn 700)
      Entry was self-described TEMPORARY, owed a split back to #423. #430
      (02c105d) DID the split (1032 -> 866) but only touched the two .rs
      files — it never removed the exception it was owed.
  src/components/preemption/PreemptionCard.tsx       388 /  500  (warn 350)
      Justification claimed "9 lines over". It is 38 over WARN and 112 UNDER
      ERROR — the stated reason was false.
  src/components/enterprise/SsoConfigPanel.tsx       355 /  500  (warn 350)
      Justification claimed "5 lines over". 5 over WARN, 145 under ERROR.
  src-tauri/src/scoring/pipeline_tests.rs            FILE DELETED in #421
      Same class as the five dead entries #421 already swept; it missed this
      one. (src-tauri/src/briefing_pipeline_tests.rs is a different file and
      was never in the map.)
  src-tauri/src/settings/types.rs                    908 / 1000  (warn 700)
  src/store/slice-types.ts                           446 /  500  (warn 300)
  src-tauri/src/sources/adapter_resilience_tests.rs 1802 / 2000  (test file)
      Test file, so warn-exempt — removing it changes no output today, but it
      left the 2000-line hard limit silently unenforceable on a file that is
      actively grown.

Kept: every other entry is genuinely over its ERROR threshold and is doing its
job. src/types/i18n-resources.d.ts is kept despite not resolving on disk — it is
gitignored and generated by `pnpm run i18n:types`, which `validate:all` runs
before this gate (already documented inline).

Gate: 42 warnings / exit 0 before, 47 warnings / exit 0 after. The 5 new
warnings are exactly the suppressed files now reporting honestly. No file
crosses an ERROR threshold, so the pre-commit gate cannot block the fleet — the
failure mode that took every developer offline on 2026-08-14.

Note: 4 of the 7 (pipeline_tests.rs, settings/types.rs, slice-types.ts,
adapter_resilience_tests.rs) were found by auditing all 38 entries rather than
being named up front; each is an independent line and can be dropped in review
without affecting the others.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUeKTKwNmdow8yUk3q8RB2
@runyourempire
runyourempire enabled auto-merge (squash) August 15, 2026 14:00
@runyourempire
runyourempire merged commit 8c60321 into main Aug 15, 2026
10 checks passed
@runyourempire
runyourempire deleted the chore/prune-stale-file-size-exceptions branch August 15, 2026 14:28
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