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

Merged opened this in answer to

Check · Review · Land · Live done — Landed and live in production.

Merged

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.

Notes

shipped production is serving it deploy bbac9a7

opened this

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_TESTS list naming the three tests.
  • New movesPageBudgets(file), which is true for src/web/layout.ts, src/http/server.ts, src/web/style/ and src/web/pages/.
  • When any changed file matches, fastSet adds all three tests, with the reason page budget: <file> changed in the log.
  • client-size already ran on every pull because it is in RULE_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-size already 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 run docs-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

Closes #14318

commented

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_TESTS list naming the three tests.
  • New movesPageBudgets(file), which is true for src/web/layout.ts, src/http/server.ts, src/web/style/ and src/web/pages/.
  • When any changed file matches, fastSet adds all three tests, with the reason page budget: <file> changed in the log.
  • client-size already ran on every pull because it is in RULE_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-size already 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 run docs-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

Approved

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.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs