chore(size): measure the minified allowance against the minified recorded with each cap - #3822
Conversation
…rded with each cap
Each cap records the minified size measured when it was set (capMinified
inline, { cap, minified } in floor-caps.json). Over the brotli cap, a scenario
fails when head minified exceeds the recorded size + 20 B, so growth cannot
creep across PRs; the base comparison stays as the fail-safe for a cap without
one. The warning states the headroom left. The ratchet pairs the recorded
minified with each lowered cap and otherwise only lowers it (--minified-only
records missing ones); check-floor-caps freezes a floor's recorded minified
like its cap.
Co-authored-by: Claude via Cursor <noreply@cursor.com>
Co-authored-by: Claude via Cursor <noreply@cursor.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
Co-authored-by: Claude via Cursor <noreply@cursor.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Size (brotli, eager entry chunk)
|
Coverage Report for CI Build 37443526665Coverage remained the same at 76.058%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
|
The PR description still has |
…3822 format) Size-Exception (approved): hydrating + stores 28.85 KB, CSR observe 14.48 KB, compiled CSR 25.23 KB, compiled hydrating 30.95 KB, base page 44.86 KB, live page 48.56 KB, each CI brotli (Size run 37450070886) + 10 B with the minified from the same run. Co-authored-by: Cursor <cursoragent@cursor.com>
Follow-up to #3821, implementing the maintainer's ruling on its open question.
Problem
#3821 measured the 20 B minified allowance per PR, against each PR's base. A scenario that merged over its brotli cap on noise stays over it, because the ratchet only lowers caps. From then on, every PR was held only to +20 B over its own base, so minified growth could pile up across PRs without limit. The #3821 warning also promised "cap will be re-based at the next ratchet", which the lower-only ratchet can't do for an over-cap scenario.
The rule
Every cap now records the minified size measured when the cap was set:
capMinifiednext to an inlinelimitinscenarios.js, and{ "cap", "minified" }entries infloor-caps.json.MINIFIED_ALLOWANCE(20 B)Size-Exception:stays the override.check-floor-caps.mjsnow freezes each floor's recorded minified the same way as its cap: raising or removing it needs the exception. It accepts the old string entries at the base, so this PR's own format change passes.--minified-onlyleaves every cap alone; this PR seeds with it.Seed
The values come from CI, not macOS: the
size-headartifact of the Size run on the push ofnext@fff1615ee(#3811; run 37443080193). They were written byratchet.mjs --minified-onlywith a datedRatchet (2026-10-06, seed, …)ledger line on each scenario, plus header and README ledger notes. Every cap is unchanged.A first seed from
c54fb10ebwas replaced. #3812, #3814 and #3811 moved minified by +30 to +69 B after it, and keeping it would have failed the 7 over-cap scenarios on arrival.Seven scenarios sit over their brotli cap on
next; they landed with noise warnings under #3821's gate. Each now has 20 B of minified headroom against its recorded size and passes with a warning. It fails only once minified grows more than 20 B past what is recorded now. The lower-only ratchet cannot re-base these 7; they stay over until code shrinks or a PR raises the cap with a reason.Creep dry run
These runs go through
gate.mjson the tip's CI measurement with the seeded values. Each simulated PR adds +15 B minified to every over-cap scenario, with brotli unchanged:next@ fff1615 as isTests
gate.test.mjshas 12 tests, which CI runs incheck. The new ones cover:Public API changes
None. This is tooling only (
scripts/size/), with no changes underpackages/*/src, so there is no changeset. Internal tooling surface touched:capMinifiedscenario field;floor-caps.jsonentry format ({ cap, minified }; the string form is still read);ratchet.mjs --minified-only;decide()verdicts gainagainst,headroomandbaseDelta.🤖 Generated with Claude via Cursor