Repository navigation
fix(ci): enforce the downward bundle budget ratchet - #1771
domgan-oai merged 10 commits into
Conversation
Benchmark report🟢 No budget breaches, no added work, and no timing changes beyond ±3%. Compares js-framework: 1k/10k row operationsAll 20 timed operations (20 without a verdict)
All 64 work counters are unchanged. Application bundle size (bytes)No changes across 60 measured values. Public-import reachability bundles (bytes)No changes across 105 measured values. |
|
This PR now conflicts with Why it conflicts: today's merges changed the budget values this branch rewrites:
The values in this branch were measured against an older Please:
|
|
Update: the budget queue I mentioned earlier has landed: #1784, #1806 and #1807 are merged. This PR's shard 1 now fails on its own rule, which is working as intended: Please wait for #1792 (bench sizes measured with Vite 8's default minifier), which is about to re-cut every budget. After it merges:
Then the ratchet passes on its own head. It's approved to merge once CI is green. 🤖 Addressed by Claude Code |
Apply the paired CI measurements on the identical integrated source, preserving tighter budgets and the recorded hydration savings.
…main (#1819) - weather framework (raw 132,546 -> 132,761, gzip 42,262 -> 42,381) and total (raw 154,697 -> 154,915, gzip 50,131 -> 50,253): #1818 makes inferred method-call dependencies track the receiver of a shared own method (#1788). `__methodDep` now reads an own function's source text to tell an arrow, which cannot see `this`, from a method; the weather app ships that helper. Measured: framework 132,729 raw / 42,349 gzip, total 154,883 raw / 50,221 gzip. Brotli and app budgets still fit. - deferred-hydration (raw 230,898 -> 230,880, gzip 72,349 -> 72,342): main measures 230,848 raw / 72,310 gzip, so #1771's downward ratchet fails test shard 1/4 on main and on every pull request based on it. Values are measured + 32. Co-authored-by: Claude Opus 5.5 <[email protected]>
Summary
Enforce the documented downward bundle-budget ratchet. A bundle reduction must update its ceiling so the savings cannot be silently spent by subsequent features. Both runners use the existing ratchet calculation in
--budgets --ratchetmode. Absolute caps continue to apply; the exception for an isolated budget-only raise is classified against the CI base, and a source change mixed with a raise does not get it. Only the budget shard fetches the history it needs.Integrates the hydration/Suspense stack and the Vite 8 Oxc minifier from #1792. Vite scenarios and their import ceilings use Oxc; esbuild scenarios retain esbuild. Re-measured against landed main at 087cd77. Of 159 byte metrics, 86 ceilings decrease (minimal: 58, app: 24, jsx: 4), none increase. The ratchet retains any existing tighter cap and otherwise allows 32 bytes raw/gzip and 256 bytes Brotli.
Validation
pnpm syncpassed. Full frozen install uses CI's pinned pnpm; local sync used a cached pnpm fallback.Risk / follow-ups
This enforces the reviewed policy only. Any future feature exceeding its cap still needs an isolated budget prerequisite. No runtime or compiler changes originate in this PR.
Provenance
agent-authored)Codex task · host
com-79386Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Medium Risk
Changes merge-blocking CI for all bundle budgets and new Git-dependent ratchet rules; mis-recorded budgets or missing
BUDGET_BASEcan fail unrelated PRs, but no runtime or security surface.Overview
CI and the bundle-size runners now enforce a downward ratchet on committed byte budgets, not just “measured + 32” growth limits.
Shard 1/4 runs
run-minimal.mjsandrun.mjswith--budgets --ratchet, setsBUDGET_BASEfrom the PR parent or previous push commit, and uses fullfetch-depthonly on that shard so Git can classify budget-only raises. In ratchet mode,verifyByteBudgetalso requires caps to be at or belowratchetBudget(measured, budget)—so a shrink that fits an old ceiling still fails until someone runs--write-budgets.requireBudgetRatchetturns that strict check off only when the diff vsBUDGET_BASEis a budget-only raise; absolute ceilings still apply.The three budget JSON files are lowered to match recorded savings (not raised). Docs,
budget-raises.mjsrefactors, expanded tests (including temp Git repos), andci-workflow.test.mjsassertions track the new workflow.Reviewed by Cursor Bugbot for commit ca03f14. Bugbot is set up for automated code reviews on this repo. Configure here.