Public: anyone can read this; the crew can change it.
Every gate run times each test and names those over the budget (20 s a file, 2 s a test); a breach is red on the fast tier for files the pull changed #12091
Every gate run now times each test from Bun's JUnit report and checks it against a budget: 20 s per file, 2 s per test. The run's log ends with the five slowest tests, then over the budget: N, SLOW aside: M, then each breach by file and test.
-
Reviews
No review yet.
-
Checks
stopped parked by the crew deploy 800270f
-
History
- Main's red after its new home: budgets follow homeFlowCss and the home link, /home is not pictured, comments wrapped at 100 800270f
- Merge origin/main 1e76531
- Main's red: header comments over 160 columns are wrapped, and week_read.ts leaves the header-width allow list it no longer needs 621e19b
- A hosted forge reaches the public git hosts and the forges beside it, so a person can connect an origin and send a change back 5f634aa
- Main's red: four tests follow intended changes on main 243b038
- Main's red: week_burn.ts is deleted (unreached since 9589ec61d), the kpi fixtures make the index readKpis names, docs/MCP.md is regenerated 53e2ba7
- Merge remote-tracking branch 'origin/main' into mason/12087-every-gate-run-times-each-test-and-names e63bc08
- The new home's lanes are read by a worker, never on a request: 2.5 s on production's database is now 14 to 23 ms in the worker and a memory read on the thread b70fabd
- Every gate run times each test from Bun's JUnit report and names what is over the budget (#12087) 4eed368
- A new home at /home shows what the forge is doing now as six live lanes; each lane redraws from its own events and its tiles move between lanes as the work does 8379e4d
- The pipeline is readable as six lanes of items: what is asked, building, checking, in review, landing and live, with each lane's health in words, read once per write and filtered per viewer e71a478
- The public home page no longer offers ssh to a stranger: nobody can get a forge from the terminal yet b3c2780
- The repository head page's 390x844 Chromium measurement is reported from the forge's check, and anything it finds overflowing is fixed (#12083) 94e4d44
- A trusted source's big first fold opens one pull, not a flood, and lands by true merge after the crew reviews it (#12079) f6efda4
- A card is styled and complete before any host speaks: designed inline styles, ChatGPT globals read on load, openai/outputTemplate alias, resource _meta (no network) dade9c3
- A Chromium-measured case proves a repository's head page does not scroll sideways at 390x844, and names what overflows when it does (#12067) 9fe332f
- A trusted source's pull lands by true merge when its checks pass, with no review, credited in the changelog and the live stream (#12066) f512a02
- Fast test/apps-token.test.ts: chop and rewrite under the budget (1 s a test, 10 s a file) (#12065) 51fb249
- Fast test/surfaces-adversarial.test.ts: chop and rewrite under the budget (1 s a test, 10 s a file) (#12064) 73c7b92
- A run's log lines are written by a worker (18 stalls of 300 to 650 ms in 20 minutes), and a sleeping child's crew check reads only its live runs dbb3eaa
2 earlier comments · 2 events
Every gate run now times each test from Bun's JUnit report and checks it against a budget: 20 s per file, 2 s per test. The run's log ends with the five slowest tests, then over the budget: N, SLOW aside: M, then each breach by file and test. A breach fails the run only on the fast tier, and only in a test file the pull changed. On the full tier it is reported and the run stays green.
What changed
scripts/test-budget.ts(new): plain data in and out.breaches({files, tests}, slow)returns what is over the budget, what is set aside, and the five slowest tests with their share of the run.budgetBinds(tier, changed, file)decides whether a breach fails the run.budgetLineswrites the summary block, andparseJunitreads Bun's report.- Three more functions read, merge and write the per-test table.
scripts/test-shards.ts:- Each verdict run adds
--reporter=junit --reporter-outfile=<shard home>/junit.xml; that covers the first run, the crash re-run and the keep-going re-run. - A file alone in its shard is timed from start to exit. A file sharing a shard is timed as the sum of its tests.
- After the base-red check, the run prints the budget block. If a breach counts against the pull, a last line names it, so the check's summary names it too.
- A green run of the gate's files writes
.forge-cache/test-times-tests.json. Hand-picked runs don't write it, so the end-to-end tests' fixture runs stay out of the forge's cache.
- Each verdict run adds
scripts/gate.ts:SLOWuses the same shape asEXCLUDED(file, reason, issue). It starts with the three filesscripts/test-times.jsonalready puts over 20 s:fork-flow(48 s),studio(35 s) andcrew-wrapup(24 s), all under #1242. Without them, any pull that touched one of those files would fail on its first fast run.test/test-budget-run.test.ts: covers the rules from fixture times with no real test run:- a run under the budget passes;
- a file over 20 s and a test over 2 s are named;
- a
SLOWfile is set aside; - the five slowest tests and their share;
- a full-tier breach doesn't count against the pull;
- JUnit parsing, including nested describe blocks, escaped names and testcases with no time;
- the per-test table merge;
- every
SLOWentry exists.
Checked against the forge's Bun: the Dockerfile pins oven/bun:1.3.14, the same version as here. With the JUnit flags, Bun's console output is byte-identical apart from the timing figures, (fail) lines included, so the output the check already parses is unchanged. JUnit and --coverage-reporter=lcov also work together, which the measuring run needs.
Not done here:
- Making a breach fail the full tier; that is the next issue in this plan.
- Checking
SLOWinsidegateRefusal; only the new test checks it. - I couldn't call the
keep_plantool from this session, so the issue has no plan posted.
Verified: bun scripts/gate.ts, bun x tsc --noEmit, the new test, and the runner and gate suites all pass: shards-run, shards-keep-going, shards, check-list, check-tiers, checks-failure-summary, gate-summary, tree-scans, review-rules, rule-tests-always, red-on-main, flake, check-steps. scripts/fast.ts exited 2 because scripts/gate.ts changed, so I picked those suites myself.
To try it: bun scripts/test-shards.ts --timeout 60000 test/test-budget-run.test.ts test/shards.test.ts and read the last lines. A fast-tier run (--tier fast --diff main..HEAD) whose changed test has a test over 2 s exits 1 and names it on its last line.
🤖 Generated with Claude Code
Every gate run now times each test from Bun's JUnit report and checks it against a budget: 20 s per test file, 2 s per test. The log ends with the five slowest tests, then over the budget: N, SLOW aside: M, then each breach by file and test. A breach fails the run only on the fast tier, and only in a test file this pull changed. On the full tier it is only reported.
What changed
scripts/test-budget.ts(new), plain data in and out:breachesfinds what is over the budget, what is set aside as SLOW, and the five slowest tests with their share of the run.budgetBindsdecides whether a breach fails the run.budgetLineswrites the summary block, andparseJunitreads Bun's report.- Three helpers read, merge and write the per-test timing table.
scripts/test-shards.ts: every verdict run, including the two re-runs, writes a JUnit report to its shard's home.- A file alone in its shard is timed from start to exit; a file sharing a shard is timed as the sum of its tests.
- The budget block is printed after the base-red check.
scripts/gate.ts: wires the budget into the gate.test/test-budget-run.test.ts: covers the above.
Main's reds fixed here. These were failing on main itself, mostly from its new /home (8379e4d6f, b70fabdfe), and this pull's check would not pass without them:
- Deleted
src/crew/week_burn.tsand its test: nothing has imported it since 9589ec61d. - Regenerated
docs/MCP.md. - Kpi fixtures: they now create the index that
readKpisnames. - Test expectations that follow intended changes on main: the stall-scans index, batched
VALUESplaceholders, deploy-pull retention, and the ssh fingerprint. docs/design/size-budget.json: every first page's CSS ceiling rises by 1280 B gzip. The shared stylesheet now carrieshomeFlowCss, about 389 B gzip on every page.docs/design/attention-budget.json: the home page's word budget goes from 95 to 100 words, for main's "Try the new home" link.test/forge-looks.test.ts:/homeis listed as not pictured, because the 24-look cap is spent;test/home-flow.test.tscovers the page.- Card heading: 16px instead of 17px, so it is on the type scale.
- Comment wrapping: comments this pull touches are rewrapped to 100 columns, and
week_read.tsleaves the header-width allow list.
Chosen not to do: I raised only the home page's attention budget. Rewriting the whole file in this sandbox would also have tightened unrelated pages; /search dropped from 42 words to 2, which looks like the sandbox rendering differently, not a real change. I also left homeFlowCss in the shared bundle rather than loading it only on /home. Moving it is a separate change.
Checks run before pushing: bun scripts/gate.ts, bun x tsc --noEmit and bun scripts/design-lint.ts pass. The 18 test files covering the failures and these changes pass, 227 tests. The full suite was not run here; the forge's check runs it.
Try it: the check log of this pull ends with the budget block. To check main's fixes, open / and /home on the preview as the owner.
🤖 Generated with Claude Code
Every gate run now times each test from Bun's JUnit report and checks it against a budget: 20 s per file, 2 s per test. The run's log ends with the five slowest tests, then
over the budget: N, SLOW aside: M, then each breach by file and test. A breach fails the run only on the fast tier, and only in a test file the pull changed. On the full tier it is reported and the run stays green.What changed
scripts/test-budget.ts(new): plain data in and out.breaches({files, tests}, slow)returns what is over the budget, what is set aside, and the five slowest tests with their share of the run.budgetBinds(tier, changed, file)decides whether a breach fails the run.budgetLineswrites the summary block, andparseJunitreads Bun's report.scripts/test-shards.ts:--reporter=junit --reporter-outfile=<shard home>/junit.xml; that covers the first run, the crash re-run and the keep-going re-run..forge-cache/test-times-tests.json. Hand-picked runs don't write it, so the end-to-end tests' fixture runs stay out of the forge's cache.scripts/gate.ts:SLOWuses the same shape asEXCLUDED(file, reason, issue). It starts with the three filesscripts/test-times.jsonalready puts over 20 s:fork-flow(48 s),studio(35 s) andcrew-wrapup(24 s), all under #1242. Without them, any pull that touched one of those files would fail on its first fast run.test/test-budget-run.test.ts: covers the rules from fixture times with no real test run:SLOWfile is set aside;SLOWentry exists.Checked against the forge's Bun: the Dockerfile pins
oven/bun:1.3.14, the same version as here. With the JUnit flags, Bun's console output is byte-identical apart from the timing figures,(fail)lines included, so the output the check already parses is unchanged. JUnit and--coverage-reporter=lcovalso work together, which the measuring run needs.Not done here:
SLOWinsidegateRefusal; only the new test checks it.keep_plantool from this session, so the issue has no plan posted.Verified:
bun scripts/gate.ts,bun x tsc --noEmit, the new test, and the runner and gate suites all pass:shards-run,shards-keep-going,shards,check-list,check-tiers,checks-failure-summary,gate-summary,tree-scans,review-rules,rule-tests-always,red-on-main,flake,check-steps.scripts/fast.tsexited 2 becausescripts/gate.tschanged, so I picked those suites myself.To try it:
bun scripts/test-shards.ts --timeout 60000 test/test-budget-run.test.ts test/shards.test.tsand read the last lines. A fast-tier run (--tier fast --diff main..HEAD) whose changed test has a test over 2 s exits 1 and names it on its last line.🤖 Generated with Claude Code
Closes #12087