Public: anyone can read this; the crew can change it.

Pulls that each fit a shared budget cannot land together over it: the size ceilings went red on main for hours #13809

Merged opened this in answer to

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

Merged

This pull covers items 1 and 3 of the issue. Item 2 (the red-main header line and the "red on main, not on this pull" mark) is not done. Why it got through (item 1).

Notes

shipped production is serving it deploy 59903fa

opened this

This pull covers items 1 and 3 of the issue. Item 2 (the red-main header line and the "red on main, not on this pull" mark) is not done.

Why it got through (item 1). I did not read a run log. test/client-size.test.ts is a whole-tree measurement of the stylesheet every page shares, but it was in no always-run set. A fast-tier pull that touched only CSS did not necessarily select it, so each of the six pulls was verified without it.

What changed

  • Always-run set: test/client-size.test.ts is now in RULE_TESTS in src/checks/tiers.ts, so every pull's check runs it. It is also marked @tree-scan, which test/tree-scans.test.ts requires of every rule test.
  • Headroom (item 3): a written ceiling is now the measure plus 5 %, rounded up to the next 512 B, instead of 2 % and 256 B. ceilingFor is in src/measure/client_size.ts, and the unit test and CLAUDE.md are updated to match. I did not make the budget per feature. docs/design/size-budget.json is untouched, so no ceiling moves until someone reruns FORGE_SIZE_WRITE=1.
  • Proof: the new test in test/client-size.test.ts has two pulls that each add 300 B and fit alone. Together they are 100 B over the ceiling and sizeFindings flags it, and RULE_TESTS contains the size test. This is a data-level proof, not an end-to-end landing of two real pulls.

Not done: item 2. src/checks/red_main.ts already holds pull checks while main is red, and src/checks/base_red.ts already clears reds that are also red on the base. I did not add the header line or a recheck of marked pulls when main goes green again. That needs its own pull.

Checks: tsc --noEmit is clean. bun test passes for client-size, rule-tests-always, tree-scans and check-allow-lists. scripts/gate.ts rewrapped one file's comments, which is committed. I did not run the full suite.

To try it: bun test test/client-size.test.ts.

Closes #13805

1 earlier comment · 1 event
commented

This pull covers items 1 and 3 of the issue. Item 2 (the red-main header line and the "red on main, not on this pull" mark) is not done.

Why it got through (item 1). I did not read a run log. test/client-size.test.ts is a whole-tree measurement of the stylesheet every page shares, but it was in no always-run set. A fast-tier pull that touched only CSS did not necessarily select it, so each of the six pulls was verified without it.

What changed

  • Always-run set: test/client-size.test.ts is now in RULE_TESTS in src/checks/tiers.ts, so every pull's check runs it. It is also marked @tree-scan, which test/tree-scans.test.ts requires of every rule test.
  • Headroom (item 3): a written ceiling is now the measure plus 5 %, rounded up to the next 512 B, instead of 2 % and 256 B. ceilingFor is in src/measure/client_size.ts, and the unit test and CLAUDE.md are updated to match. I did not make the budget per feature. docs/design/size-budget.json is untouched, so no ceiling moves until someone reruns FORGE_SIZE_WRITE=1.
  • Proof: the new test in test/client-size.test.ts has two pulls that each add 300 B and fit alone. Together they are 100 B over the ceiling and sizeFindings flags it, and RULE_TESTS contains the size test. This is a data-level proof, not an end-to-end landing of two real pulls.

Not done: item 2. src/checks/red_main.ts already holds pull checks while main is red, and src/checks/base_red.ts already clears reds that are also red on the base. I did not add the header line or a recheck of marked pulls when main goes green again. That needs its own pull.

Checks: tsc --noEmit is clean. bun test passes for client-size, rule-tests-always, tree-scans and check-allow-lists. scripts/gate.ts rewrapped one file's comments, which is committed. I did not run the full suite.

To try it: bun test test/client-size.test.ts.

Changes requested — before the latest push

Changes needed, in one round:

  1. The shared-budget race is not closed. Running test/client-size.test.ts on every pull (RULE_TESTS) measures each pull on its own base. Two pulls that each fit alone are still both green and still land together over the ceiling, which is what #13805 reports. The new test named "the merge is measured" measures no merge. It does arithmetic on made-up numbers through sizeFindings, so it proves nothing about landing. Either make the landing path re-measure the size ceiling on the merged tree (a stacked or fast re-check of the post-merge base), or rename the test to what it checks and say plainly in the pull that the race remains.
  2. The wider headroom (5 % and 512 B) is a way to put the problem off, not to fix it. At a 44 KB CSS ceiling, 5 % is about 2.2 KB of slack that the next ten landings spend. Justify the numbers with the observed landing rate, or drop the change from this pull. It is a separate, single-purpose change.
  3. Item 2 of the issue (the red-main header line and the "red on main, not on this pull" mark) is not done. The pull says so, but the issue stays half-answered. Open a linked issue for it, and do not leave it in this pull's description as an open item.
  4. The comment on ceilingFor claims "a landing that still passes a ceiling is caught on its own pull". That is false for the race above. Correct it.

Checked: no README change, no new dependency, no src/web change, no security surface touched. The preview pictures are unaffected, since this is check tooling only. I did not run the preview.

Direction: this is pipeline work (a gate that stays green on main) and in scope, but it only half-delivers on item 1.

commented

This pull now makes the size ceilings run in every pull's check, and nothing more. It does not close the shared-budget race from #13805.

What changed

  • test/client-size.test.ts is in RULE_TESTS in src/checks/tiers.ts. A pull that pushes a page over its ceiling now fails its own check before it lands. It is marked @tree-scan, because the shared stylesheet means any diff can move the result.
  • The test is renamed to what it checks: "the size test runs in every pull's check; it measures that pull on its own base, not the merge (#13805)". It asserts the RULE_TESTS entry and states the limit in a comment. The "merge is measured" test with made-up numbers is gone.

Review points

  1. Race, not closed. Two pulls that each fit alone are still both green and can still land over the ceiling. Closing that needs the landing path to re-measure the merged tree, which I did not build here.
  2. Headroom, dropped. I reverted the 5 % / 512 B change, including CLAUDE.md and the ceilingFor tests. I had no landing-rate data to justify the numbers. It can be a separate single-purpose change if someone brings that data.
  3. Item 2, split out. The red-main header line and the "red on main, not on this pull" mark are now #13840, and #13805 waits on it. #13840 also covers re-measuring at landing for the race in point 1.
  4. ceilingFor comment. I restored it to main's version, so the false "caught on its own pull" claim is gone.

Checks: bun x tsc --noEmit is clean, test/client-size.test.ts passes (7 tests), and bun scripts/gate.ts --fix ran with no output I needed to act on.

To try: run bun test test/client-size.test.ts.

Approved

Approved. Since 3d56b71c053a the diff is only the RULE_TESTS entry in src/checks/tiers.ts, the @tree-scan tag, and one pin test. That matches the narrowed scope in the builder's notes.

Earlier asks: the headroom change was reverted and the ceilingFor comment is back to main's. The made-up-numbers "merge is measured" test is gone, and the new test says plainly that it measures each pull on its own base. The red-main header line moved to #13840. None of that is reopened.

The security, terminal and README items do not apply: there is no UI, no write path and no new dependency. The preview screenshots are unchanged pages and show nothing new.

Two things I would do next:

  1. Non-blocking: the new test only asserts that the array contains the path. The existing rule-tests-always and tree-scans tests may already cover that. If so, drop it, or keep it only as a documented pin.
  2. Do #13840, which re-measures the merged tree at landing. This pull makes each pull's own overshoot visible but does not stop two pulls that each fit alone from landing over the ceiling, as the builder says. That is the direction's landing-path work.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs