Public: anyone can read this; the crew can change it.
Budget tests run only after merge: a pull's fast check should run them #14331
Check · Review · Land · Live done — Landed and live in production.
A pull that changes shared page code now runs the three page budget tests in its own fast check. These are test/pages-budget.test.ts, test/client-size.test.ts and test/docs-link.test.ts. A budget breach now fails the pull instead of main.
shipped production is serving it deploy bbac9a7
A pull that changes shared page code now runs the three page budget tests in its own fast check. These are test/pages-budget.test.ts, test/client-size.test.ts and test/docs-link.test.ts. A budget breach now fails the pull instead of main.
Why they were missed. The fast tier picks tests by coverage and imports. Neither one reliably connected the layout, the stylesheet, the router or a page module to these three tests. Two of the pulls that turned main red on 2026-11-17 show this: #14305 changed src/web/layout.ts and src/http/server.ts, and #14310 changed layout.ts plus several pages. Both passed their fast check and then broke a budget after merging.
The change is in src/checks/tiers.ts:
- New
PAGE_BUDGET_TESTSlist naming the three tests. - New
movesPageBudgets(file), which is true forsrc/web/layout.ts,src/http/server.ts,src/web/style/andsrc/web/pages/. - When any changed file matches,
fastSetadds all three tests, with the reasonpage budget: <file> changedin the log. client-sizealready ran on every pull because it is inRULE_TESTS(#13805), so it keeps that reason.
Tests:
test/check-tiers.test.ts: each kind of shared file brings in all three budget tests, and an unrelated source file does not.test/rule-tests-always.test.ts: against the real gate list, each budget test is a gate file, and a change to the layout, a style file, the router or a page runs all three.
What this doesn't cover:
- Two pulls together. It does not stop two pulls that each fit a budget alone from landing over it together. #14314 was that case:
client-sizealready ran on that pull and was green on its own base. Catching this would need the check to run against the merge, which is a separate change. - Docs-only diffs.
docs/stays out of the trigger list because the issue didn't ask for it, so a diff that only changes docs still doesn't rundocs-link.
Checks run here: bun scripts/gate.ts --fix changed nothing, bun x tsc --noEmit is clean, and bun test test/check-tiers.test.ts test/rule-tests-always.test.ts test/tree-scans.test.ts gave 73 passed, 0 failed. scripts/fast.ts names 2213 test files for a change to tiers.ts (about 3 hours expected), so I didn't run that set here; the forge's check on this push runs it.
The keep_plan and estimate tools the issue mentions weren't available in this run, so no plan was kept on the issue and no time estimate was recorded.
🤖 Generated with Claude Code
Clean. Shared page code (layout, server, style/, pages/) now pulls in the three page-budget tests with a stated reason, and the tests cover both the positive and negative cases against the real gate list. This is pipeline work, no security surface, no new dependency, and no README or TUI change was needed. Non-blocking: other shared web modules under src/web/ (components, nav) can also move budgets and are not in movesPageBudgets; widen it if one breaks main again.
A pull that changes shared page code now runs the three page budget tests in its own fast check. These are
test/pages-budget.test.ts,test/client-size.test.tsandtest/docs-link.test.ts. A budget breach now fails the pull instead of main.Why they were missed. The fast tier picks tests by coverage and imports. Neither one reliably connected the layout, the stylesheet, the router or a page module to these three tests. Two of the pulls that turned main red on 2026-11-17 show this: #14305 changed
src/web/layout.tsandsrc/http/server.ts, and #14310 changedlayout.tsplus several pages. Both passed their fast check and then broke a budget after merging.The change is in
src/checks/tiers.ts:PAGE_BUDGET_TESTSlist naming the three tests.movesPageBudgets(file), which is true forsrc/web/layout.ts,src/http/server.ts,src/web/style/andsrc/web/pages/.fastSetadds all three tests, with the reasonpage budget: <file> changedin the log.client-sizealready ran on every pull because it is inRULE_TESTS(#13805), so it keeps that reason.Tests:
test/check-tiers.test.ts: each kind of shared file brings in all three budget tests, and an unrelated source file does not.test/rule-tests-always.test.ts: against the real gate list, each budget test is a gate file, and a change to the layout, a style file, the router or a page runs all three.What this doesn't cover:
client-sizealready ran on that pull and was green on its own base. Catching this would need the check to run against the merge, which is a separate change.docs/stays out of the trigger list because the issue didn't ask for it, so a diff that only changes docs still doesn't rundocs-link.Checks run here:
bun scripts/gate.ts --fixchanged nothing,bun x tsc --noEmitis clean, andbun test test/check-tiers.test.ts test/rule-tests-always.test.ts test/tree-scans.test.tsgave 73 passed, 0 failed.scripts/fast.tsnames 2213 test files for a change totiers.ts(about 3 hours expected), so I didn't run that set here; the forge's check on this push runs it.The
keep_planandestimatetools the issue mentions weren't available in this run, so no plan was kept on the issue and no time estimate was recorded.🤖 Generated with Claude Code
Closes #14318