Public: anyone can read this; the crew can change it.
Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:3hv73alvgf is past its budget: trevato/forge: "GET /apps/open names its phases and answers within its budget" failed on 3 pulls in the last hour — the… #7515
Check · Review · Land · Live done — Landed and live in production.
`GET /apps/open`, `GET /organizations/new` and `GET /settings/cloud/audit` now name all of their own Server-Timing, so the test's accounting no longer depends on how busy the check machine is.
shipped production is serving it deploy ad44386
GET /apps/open, GET /organizations/new and GET /settings/cloud/audit now name all of their own Server-Timing, so the test's accounting no longer depends on how busy the check machine is.
Cause: It was the accounting check that failed, not the speed budget: app minus the named phases ≤ 1.5 ms (Received: 1.6999999999999997). These three pages named only session and render. The server's own work around the handler was not counted in either phase: routing and the awaited app-host check before it, and compression and the security floor after it. That gap is small on a quiet machine and grows past 1.5 ms when the machine is loaded.
Fix: Each of the three handlers now calls nameFrame(ctx.request) first (src/web/pages/apps.ts, cloud.ts, org.ts). The settings pages already do this. It names route (work before the handler) and compress (work after it), so the phases add up to app whatever the load. test/cloud-org-apps-timing.test.ts now expects route and compress in both its budget test and its signed-out test. That is a change in what the test covers, not a correction of a wrong test.
Evidence:
- Before the change, the test failed about 1 run in 9 on its own.
- With four copies running in parallel, 12 rounds: 0 failures with the fix. With the source change reverted, all 12 fail, so the test fails without the fix.
bun x tsc --noEmitis clean.- The 15 test files that cover these pages (apps open, private app, cloud, org, route timing) pass: 96 tests.
scripts/fast.tsnamed 944 files, so I chose these by hand.
Not done: I didn't loosen the 1.5 ms bound, or the speed budget in test/helpers/budget.ts. Other pages that name phases without nameFrame may have the same weakness; they are not part of this pull.
To try it: bun test test/cloud-org-apps-timing.test.ts. Or request /apps/open and look at the server-timing header: it now lists route, session, render and compress, and they add up to app.
🤖 Generated with Claude Code
The three handlers now call nameFrame as the settings pages do. The preview shows it: /apps/open and /organizations/new both return server-timing with route, session, render and compress, and app is 2.6 ms and 1.8 ms. The change is small, adds no dependency, touches no markup, and the tests cover route and compress. Two things I would do next: (1) apply nameFrame to the other pages that name phases without it, since they have the same weakness; (2) put the nameFrame call inside notePhase or the router wrapper, so a new page cannot forget it.
GET /apps/open, GET /organizations/new and GET /settings/cloud/audit now name all of their own Server-Timing phases, so the test's accounting no longer depends on how busy the check machine is.
The fix is commit 8feb3c03, and its check on this pull passed (22:04, 316 s). The sentinel's update at 22:03:34, reporting failures on 5 pulls, came before that check finished. Those pulls are still running against main, which does not have this fix yet. For this run I re-checked the branch against today's main without pushing anything new: it merges cleanly, bun test test/cloud-org-apps-timing.test.ts passes on the merged tree (5 pass), and bun x tsc --noEmit is clean.
Cause: The failing assertion was the accounting check, not the speed budget: app minus the named phases must be at most 1.5 ms (Received: 1.6999999999999997). These three pages named only session and render. The server's own work around the handler was not counted in either phase:
- before the handler: routing and the awaited app-host check;
- after it: compression and the security floor.
On a quiet machine that gap is small. On a loaded one it grows past 1.5 ms.
Fix:
- Each of the three handlers now calls
nameFrame(ctx.request)first (src/web/pages/apps.ts,cloud.ts,org.ts), as the settings pages already do. This namesroute(the work before the handler) andcompress(the work after it), so the phases add up toappwhatever the load. test/cloud-org-apps-timing.test.tsnow expectsrouteandcompressin both its budget test and its signed-out test. This changes what the test covers; the old test was not wrong.
Evidence:
- Before the change, the test failed about 1 run in 9 on its own.
- With four copies running in parallel for 12 rounds: 0 failures with the fix, and all 12 rounds fail with the source change reverted. So the test fails without the fix.
- The 15 test files that cover these pages (apps open, private app, cloud, org, route timing) pass: 96 tests.
scripts/fast.tsnamed 944 files, too many to run, so I picked these by hand.
Not done:
- I didn't loosen the 1.5 ms bound or the speed budget in
test/helpers/budget.ts. - Other pages that name phases without
nameFramemay have the same weakness; this pull doesn't touch them.
To try it: run bun test test/cloud-org-apps-timing.test.ts. Or request /apps/open and read the server-timing header: it lists route, session, render and compress, and they add up to app.
🤖 Generated with Claude Code
Closes #7490
GET /apps/open,GET /organizations/newandGET /settings/cloud/auditnow name all of their own Server-Timing, so the test's accounting no longer depends on how busy the check machine is.Cause: It was the accounting check that failed, not the speed budget:
appminus the named phases ≤ 1.5 ms (Received: 1.6999999999999997). These three pages named onlysessionandrender. The server's own work around the handler was not counted in either phase: routing and the awaited app-host check before it, and compression and the security floor after it. That gap is small on a quiet machine and grows past 1.5 ms when the machine is loaded.Fix: Each of the three handlers now calls
nameFrame(ctx.request)first (src/web/pages/apps.ts,cloud.ts,org.ts). The settings pages already do this. It namesroute(work before the handler) andcompress(work after it), so the phases add up toappwhatever the load.test/cloud-org-apps-timing.test.tsnow expectsrouteandcompressin both its budget test and its signed-out test. That is a change in what the test covers, not a correction of a wrong test.Evidence:
bun x tsc --noEmitis clean.scripts/fast.tsnamed 944 files, so I chose these by hand.Not done: I didn't loosen the 1.5 ms bound, or the speed budget in
test/helpers/budget.ts. Other pages that name phases withoutnameFramemay have the same weakness; they are not part of this pull.To try it:
bun test test/cloud-org-apps-timing.test.ts. Or request/apps/openand look at theserver-timingheader: it now listsroute,session,renderandcompress, and they add up toapp.🤖 Generated with Claude Code
Closes #7490