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 #12110
Every gate run now times each test as well as each file, and holds both to a budget: 20 s for a file, 2 s for a single test. A breach fails the check only on the fast tier, and only in a test file the pull changed. On the full tier it is reported and does not fail the check; the next step of #1242 turns that on.
-
Reviews
No review yet.
-
Checks
stopped parked by the crew deploy bce697d
-
History
- Merge remote-tracking branch 'origin/main' into scout/12087-every-gate-run-times-each-test-and-names bce697d
- Four run and event reads that scanned far more than they needed now walk the index that answers them: on a copy of production a run list filtered to a rare state goes from 133 ms to 4 ms (the page 152 ms to 14 ms), the agents at work 48 ms to 0.06 ms, the week's production deploys 61 ms to 1.3 ms, whether a person answered a landed issue 175 ms to 0.1 ms; the map's build drops about 100 ms d20ce1b
- The flow page opens on what stands out this week and four figures; the picture keeps its words at their own size d6ca11b
- The map's JSON names each edge's issues from one table of numbers, not two scans of every issue per edge: on a copy of production (4,592 issues, 6,428 edges) the render goes from 360 ms to 24 ms, the whole map build from 1,060 ms to 700 ms, on the one thread that serves every page 2f213e6
- The boards page answers "is work moving, and where is it stuck" in its first screen, and every chart is drawn one way 99a34f7
- A hosted forge reaches outside git hosts by name through its parent's gate: vetHost says pin or gate, outboundFetch and git follow it; a refused connect says why; the connect cap is a minute 731a5d1
- One address may make 100 forges a day, not 3: an office and the release proof's own stranger were being turned away 7627ccc
- Every gate run times each test from Bun's JUnit report and names those over the budget (20 s a file, 2 s a test); a breach is red on the fast tier for a test file the pull changed e83fbcb
- The engine can run on a thread of its own beside the serving thread, one database file between them; off by default, and one thread everywhere that matters 1cfdf1a
- The first /home after a restart never reads anything on the request: the worker starts at boot and a page that comes before it draws "reading…" that fills in place 1a20738
- The new home has a Table view beside the Lanes: every item as one row, with search, sort, filters and multiselect actions 2f6bf7e
- 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
- 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
- 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
2 earlier comments · 1 event
Every gate run now times each test as well as each file, and holds both to a budget: 20 s for a file, 2 s for a single test. A breach fails the check only on the fast tier, and only in a test file the pull changed. On the full tier it is reported and does not fail the check; the next step of #1242 turns that on.
Expect this pull's check to be red because of main, not this change. Main currently fails tests this change doesn't touch. Run on this tree, these three fail:
test/header-width.test.ts: over-wide header comments insrc/web/pages/home_flow.ts,src/flow/lanes*.tsandtest/surfaces-adversarial.test.ts.test/cookie-flags.test.ts: two tests.
Other open pulls (e.g. #12099) also fail different tests from main. Any change under scripts/ puts a pull on the full tier, and the check only clears a red main shares on the fast tier, so these reds will count here. I did not fix them in this pull: they are outside the issue, and the earlier attempt that tried to fix them (#12091) still went red.
What changed
scripts/test-budget.ts(new), plain data in and out:breaches({files, tests}, slow)returns each file over 20 s and each test over 2 s. It sets aside files listed inSLOW, and also returns the five slowest tests with their share of all the tests' time.budgetBinds(tier, changed, file)decides whether a breach fails the run.budgetLineswrites the summary lines.parseJunitreads Bun's JUnit report. Bun escapes the describe-block name twice, so it is decoded twice.
scripts/gate.ts: addsSLOW(file → issue number and reason), empty for now.scripts/test-shards.ts:- Each
bun testit starts also writes--reporter=junit --reporter-outfile=<shard dir>/junit-N.xml. If you pass a--reporterof your own, this is skipped. - A file run on its own is timed by its process; a file sharing a shard is timed by adding up its tests.
- The summary now ends with the five slowest tests, then
over the budget: N, SLOW aside: M, then each breach markedred:,said:orSLOW:. - A green run merges the per-test times into
.forge-cache/test-times-tests.json. - A breach that binds fails the run with a line naming the rule.
- Each
test/test-budget-run.test.tschecks the rules on fixture times, with no real test run:- a run under budget passes;
- a file over 20 s and a test over 2 s are named;
- a
SLOWfile is set aside; - the five slowest are picked with their share;
- a full-tier breach, or one in a file the pull didn't change, does not fail;
SLOWentries are sound;- the JUnit report parses correctly.
Checks run
- I checked the flags against Bun 1.3.14: the console still prints its
(fail)andRan N tests across M fileslines with the JUnit report on, so the output the check already reads is unchanged. bun scripts/gate.tsandbun x tsc --noEmitpass.- The new test passes, along with the 10 suites that run
scripts/test-shards.ts(231 tests: shards, shards-run, shards-keep-going, red-on-main, flake, checks-failure-summary, check-steps, check-list, crew-brief-gate, studio-runs). scripts/fast.tscouldn't pick the tests (the change is underscripts/), so I chose those suites myself. I did not run the whole suite here.
Not done: the breach isn't red on the full tier yet (the next issue), and the committed scripts/test-times.json gets no per-test companion.
Try it: bun scripts/test-shards.ts ./test/test-budget-run.test.ts — the log ends with the slowest tests and the budget line.
🤖 Generated with Claude Code
Every gate run now times each test as well as each file, and checks both against a budget: 20 s for a file, 2 s for a single test. A breach fails the check only on the fast tier, and only in a test file the pull changed. On the full tier, breaches are listed in the log by name and do not fail the check. The next step of #1242 turns that on.
What changed
scripts/test-budget.ts(new) works on plain data in and out:breachesfinds each file over budget and each test over budget, and returns the five slowest tests with their share of total test time.budgetBindsdecides when a breach fails the check.parseJunitreads Bun's JUnit report.formatTestTimeswrites the per-test times.
scripts/test-shards.tsnow runs each shard with--reporter=junitalongside the console output, so the console log is unchanged. It skips this when the caller picks a reporter of their own.- A file run alone is timed by its process; a file sharing a shard is timed by the sum of its tests.
- After a green run, per-test times are saved to the check cache as
test-times-tests.json. Files this run did not test keep their previous times.
scripts/gate.tsgainsSLOW, a list of known-slow files, each tied to the issue that owns making it fast. Their breaches are reported but never fail the check. The list starts empty.test/test-budget-run.test.tscovers the budget rules, the JUnit parsing, and a real sharded run that names a slow test.
The red check is main's, not this change's. The tests behind the 81 failures fail just the same on a clean origin/main (d20ce1b2e). I opened #12129 listing the 13 failing test files:
- header widths
- a cookie in
home_flow.tswith no entry inCOOKIES - an unimported
week_burn.ts - a stale
docs/MCP.md /homemissing from the looks list- several query-count and size-budget tests
SQLiteError: out of memorythroughout shard 82, which looks environmental
Because this pull changes scripts/, it runs on the full tier, and only the fast tier ignores failures main also has (#10304). So it will stay red until main is green. I didn't fix those failures here: they are in other features and outside #12087.
Checked locally: bun scripts/gate.ts and bun x tsc --noEmit pass. The 39 test files that cover scripts/gate.ts and scripts/test-shards.ts pass: 525 pass, 0 fail.
To try it: run bun scripts/test-shards.ts on any set of test files. The log ends with the five slowest tests and every file or test over budget, by name.
🤖 Generated with Claude Code
Every gate run now times each test as well as each file, and holds both to a budget: 20 s for a file, 2 s for a single test. A breach fails the check only on the fast tier, and only in a test file the pull changed. On the full tier it is reported and does not fail the check; the next step of #1242 turns that on.
Expect this pull's check to be red because of main, not this change. Main currently fails tests this change doesn't touch. Run on this tree, these three fail:
test/header-width.test.ts: over-wide header comments insrc/web/pages/home_flow.ts,src/flow/lanes*.tsandtest/surfaces-adversarial.test.ts.test/cookie-flags.test.ts: two tests.Other open pulls (e.g. #12099) also fail different tests from main. Any change under
scripts/puts a pull on the full tier, and the check only clears a red main shares on the fast tier, so these reds will count here. I did not fix them in this pull: they are outside the issue, and the earlier attempt that tried to fix them (#12091) still went red.What changed
scripts/test-budget.ts(new), plain data in and out:breaches({files, tests}, slow)returns each file over 20 s and each test over 2 s. It sets aside files listed inSLOW, and also returns the five slowest tests with their share of all the tests' time.budgetBinds(tier, changed, file)decides whether a breach fails the run.budgetLineswrites the summary lines.parseJunitreads Bun's JUnit report. Bun escapes the describe-block name twice, so it is decoded twice.scripts/gate.ts: addsSLOW(file → issue number and reason), empty for now.scripts/test-shards.ts:bun testit starts also writes--reporter=junit --reporter-outfile=<shard dir>/junit-N.xml. If you pass a--reporterof your own, this is skipped.over the budget: N, SLOW aside: M, then each breach markedred:,said:orSLOW:..forge-cache/test-times-tests.json.test/test-budget-run.test.tschecks the rules on fixture times, with no real test run:SLOWfile is set aside;SLOWentries are sound;Checks run
(fail)andRan N tests across M fileslines with the JUnit report on, so the output the check already reads is unchanged.bun scripts/gate.tsandbun x tsc --noEmitpass.scripts/test-shards.ts(231 tests: shards, shards-run, shards-keep-going, red-on-main, flake, checks-failure-summary, check-steps, check-list, crew-brief-gate, studio-runs).scripts/fast.tscouldn't pick the tests (the change is underscripts/), so I chose those suites myself. I did not run the whole suite here.Not done: the breach isn't red on the full tier yet (the next issue), and the committed
scripts/test-times.jsongets no per-test companion.Try it:
bun scripts/test-shards.ts ./test/test-budget-run.test.ts— the log ends with the slowest tests and the budget line.🤖 Generated with Claude Code
Closes #12087