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

The space page has a page budget, so a slow space view fails the check as a slow map does #12779

Merged opened this

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

Merged

The space page and its space.json read now each have a row in PAGEBUDGETS, so a slow or chatty space view fails the check the way a slow map does. The page-budget, space-budget, client-size, tsc and gate runs are green on the final tree, and I pushed it.

Notes

shipped production is serving it deploy 5a4f606

opened this

The space page and its space.json read now each have a row in PAGE_BUDGETS, so a slow or chatty space view fails the check the way a slow map does. The page-budget, space-budget, client-size, tsc and gate runs are green on the final tree, and I pushed it.

What changed

  • New rows: /:owner/:name/space allows 17 statements and /:owner/:name/space.json allows 8, both with a 50 ms median like the map row.
  • How I set them: I measured 15 and 6 statements warm on the page-budget fixture, the one the map row is measured on. The margin is two statements, so a single added query fails the row. The medians measured about 4.4 ms and 1.1 ms of CPU, far under 50 ms. Judge by the statement count; the clock is a loose bound.
  • test/space-budget.test.ts (new): it measures both requests on the seedFixture data from test/space-page.test.ts and checks each stays inside its row. It then adds three statements per request and checks the count rises by exactly three and countFinding names the page and its budget. This is the "raise the count, see it fail" proof.
  • test/page-budget.test.ts: the expected list of budgeted patterns now has eleven entries, including the two space rows.
  • docs/design/size-budget.json: the client-size test needs a ceiling for every budgeted page, so I added one for the space page (28672 B JS, 44800 B CSS) and one for space.json (0, since it is data). Regenerating that file raised the CSS ceilings on the other pages too; I put those back and kept only the two new entries.

Not done: I did not add a signed-out row, because the owner is the one who uses this page. I did not lower any existing budgets.

Try it: files="test/space-budget.test.ts test/page-budget.test.ts test/client-size.test.ts"; bun test $files

Closes #12770

commented

The space page and its space.json read now each have a row in PAGE_BUDGETS, so a slow or chatty space view fails the check the way a slow map does. The page-budget, space-budget, client-size, tsc and gate runs are green on the final tree, and I pushed it.

What changed

  • New rows: /:owner/:name/space allows 17 statements and /:owner/:name/space.json allows 8, both with a 50 ms median like the map row.
  • How I set them: I measured 15 and 6 statements warm on the page-budget fixture, the one the map row is measured on. The margin is two statements, so a single added query fails the row. The medians measured about 4.4 ms and 1.1 ms of CPU, far under 50 ms. Judge by the statement count; the clock is a loose bound.
  • test/space-budget.test.ts (new): it measures both requests on the seedFixture data from test/space-page.test.ts and checks each stays inside its row. It then adds three statements per request and checks the count rises by exactly three and countFinding names the page and its budget. This is the "raise the count, see it fail" proof.
  • test/page-budget.test.ts: the expected list of budgeted patterns now has eleven entries, including the two space rows.
  • docs/design/size-budget.json: the client-size test needs a ceiling for every budgeted page, so I added one for the space page (28672 B JS, 44800 B CSS) and one for space.json (0, since it is data). Regenerating that file raised the CSS ceilings on the other pages too; I put those back and kept only the two new entries.

Not done: I did not add a signed-out row, because the owner is the one who uses this page. I did not lower any existing budgets.

Try it: files="test/space-budget.test.ts test/page-budget.test.ts test/client-size.test.ts"; bun test $files

commented

The space page now has a page budget, and so does its space.json read: both are rows in docs/design/size-budget.json, backed by new tests in test/space-budget.test.ts.

The preview deploy didn't actually fail: the app was up (/healthz and / both returned 200), and "no tests declared" just means the deploy runs none. The real red was bun scripts/gate.ts, which rejected a 111-column comment at test/space-budget.test.ts:44. I rewrapped it. The gate now passes, tsc --noEmit is clean, and test/space-budget.test.ts and test/page-budget.test.ts pass (10 tests).

The fast-tier run (95 files) had 6 failures that don't touch my change:

  • Boot tests: five boot tests that start main.ts with production's variables.
  • Module-state test: the baseline in test/module-state.test.ts names src/crew/ceiling_stagger.ts:memo, which no longer exists as process-wide state. I didn't touch src/crew/.
  • Not confirmed on main: I didn't re-run these against main, so that is an inference. Treat the boot tests as unconfirmed and likely tied to this sandbox, where I can't bind a unix socket or run main.ts the way production does. The forge's full check will settle both.

To try it, open the preview at https://lab--12779--forge-trevato-apps.open-platform.sh, or run bun test test/space-budget.test.ts.

Approved

Both space requests now have a budget row, and the new test shows a raised statement count failing the row. Judged from the diff and tests; the preview's /trevato/forge/space answered 404 for me (that repo likely isn't on the preview), so I did not see the page render there. No feature is added, so no TUI screen or docs/features page is owed, and README is untouched.

Two things I would do next:

  1. Add a signed-out or non-owner row, or state that the space page is owner-only, so a change that makes it public is also measured.
  2. Lower the two limits (17 and 8) as the space page gets cheaper; the pull states a margin of two over today's measured 15 and 6.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs