Repository navigation
Conversation
…he cap `check:file-size --update` could only ever delete an entry from inside the improvement branch (`loc < frozen[file]`). An entry sitting at EXACTLY its frozen value while already within the 800-line new-file cap therefore never qualified for removal, however far under the cap it was — it stayed in the baseline permanently. Three real cases on release/v3.8.49 @ 4053e23 survived a full `--update` run for this reason: src/app/(dashboard)/dashboard/providers/[id]/ProviderDetailPageClient.tsx 798 src/app/(dashboard)/dashboard/providers/[id]/hooks/useProviderModels.ts 155 src/app/(dashboard)/dashboard/providers/[id]/hooks/useProviderSettings.ts 264 `evaluateFileSizes` now reports a third bucket, `redundant` — in `frozen`, not a violation, not an improvement, and `loc <= cap` — and the `--update` path deletes those entries alongside the shrinks. Same treatment for the testFrozen/testCap half, which had the identical gap. The non-update gate path is untouched: `redundant` entries were already passing and still pass, so no PR's result changes. Only `--update` behaves differently. TDD: 7 new failing tests first (16 total in tests/unit/check-file-size.test.ts, 9 pre-existing all still passing), then the fix, then 16/16 green. End-to-end on the real baseline, `--update` now reports "74 arquivo(s) encolheram, 3 entrada(s) redundante(s) removida(s)" and removes 17 entries instead of 14, with 0 caps raised. That baseline diff is deliberately NOT in this commit — banking the data belongs to diegosouzapw#8585. Refs diegosouzapw#8584
e781fd0 to
4198fdd
Compare
…e at-cap removal
Same tip fix as diegosouzapw#8657 so Merge integrity is green without waiting for that PR to land. Regenerated via generate-agent-skills --apply.
|
Superseded by #8657 (same SKILL regeneration). |
|
@MumuTW — Desculpas, fechei este PR por engano durante uma rodada de Você prefere:
Por favor responda se quiser prosseguir. O fechamento foi meu erro de orquestração — o PR em si continua válido. |
|
@MumuTW — re: my earlier comment apologizing for mistakenly closing this PR (the orchestration round read stale metadata and conflated #8589 with #8657). On re-reading the diff, this is a clean, focused fix:
|
|
@diegosouzapw Reopen was blocked for this account after the head branch was temporarily missing (API: Please treat #8741 as the continue-from for the ★3 merge-ready verdict on this PR. Closing this one as superseded by #8741 is fine. |
Fixes the
--updategap reported in #8584. Two files: the gate script and its unit tests. No baseline data change.The bug
check:file-size --updatedeletes a baseline entry only from inside the improvement branch:improvementsrequiresloc < frozen[file]. So an entry sitting at exactly its frozen value, while already within the 800-line new-file cap, never reaches the delete — it is not a violation, not an improvement, and there is no third branch. It stays in the baseline permanently no matter how far under the cap it is.Three real cases on
release/v3.8.49@4053e2314survived a full--updaterun for exactly this reason:…/providers/[id]/ProviderDetailPageClient.tsx…/providers/[id]/hooks/useProviderModels.ts…/providers/[id]/hooks/useProviderSettings.tsA 155-line file cannot leave a baseline whose purpose is to track files over 800 lines.
The fix
evaluateFileSizesnow returns a third bucket,redundant— entries that are infrozen, are neither a violation nor an improvement, and satisfyloc <= cap:The
--updatepath deletes those alongside the shrinks, and the same treatment is applied to thetestFrozen/testCaphalf, which had the identical gap.The non-update gate path is untouched.
redundantentries were already passing and still pass — no PR's pass/fail result changes anywhere. Only--updatebehaves differently, and only by removing entries that had become meaningless.TDD
7 new tests written first and confirmed failing, then the fix:
The 9 pre-existing tests pass unchanged throughout. The new cases pin the boundaries rather than just the happy path:
loc > capfor new files)#8584entries above, asserted by pathtestFrozen/testCap) tooEnd-to-end verification
Running
--updateagainst the real baseline with the fix applied:17 entries removed instead of 14, 0 caps raised, and all three residual entries confirmed gone by diffing the pre/post JSON key-by-key.
That baseline diff is deliberately not in this commit — banking the data is #8585's job, and mixing a logic change with 145 lines of JSON churn would make both harder to review.
Interaction with #8585
Independent, different files, no conflict, either merge order works:
--updaterun once this lands.Neither is blocking the other. Both are green-before-green-after — no base-red is being repaired here.
Scope note
I did not touch
check-complexity-ratchets.mjs. It has nofrozenmap and no per-file removal concept — it ratchets two scalar counts — so this class of bug doesn't exist there.Refs #8584