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

Pages that answer under a measured budget: /system, /feed, /board, /fleet, /talk and a pull page join the page-budget roster #15269

Merged opened this

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

Merged

Six more pages now have a budget: /system, /feed, /board, /fleet, /talk and a pull page (/:owner/:name/pulls/:number). Each has its own file in src/perf/pagebudgets/ and a row in src/perf/pagebudget.ts.

Notes

shipped production is serving it deploy 0adf720

opened this

Six more pages now have a budget: /system, /feed, /board, /fleet, /talk and a pull page (/:owner/:name/pulls/:number). Each has its own file in src/perf/page_budgets/ and a row in src/perf/page_budget.ts. test/page-budget.test.ts walks them signed in, and each file's comment records what was measured and how the limit was set from it.

Measured on the page-budget fixture, three runs:

pageSQL warm (same all three runs)CPU medianstatement limitmedian budget
/system2610.2–10.9 ms2925 ms
/feed455.7–6.0 ms5015 ms
/board706.3–7.2 ms7715 ms
/fleet122.5–2.9 ms1410 ms
/talk313.7–3.9 ms3510 ms
pull #110910.3–11.6 ms12025 ms
  • How the limits were set: each median budget is twice the slowest run, rounded up to the next 5 ms. I did not give statements the 2x headroom the issue suggests. The count did not move between runs, and a doubled count is an N+1 the limit is there to catch, so each limit is the count plus a tenth, in line with the existing "measured plus a little" rows.
  • Pull page: the row uses the router pattern, so the production reader (page_budget_read.ts) matches it against route stats. pagePath now fills :number (default 1). The fixtures in test/page-budget.test.ts and test/client-size.test.ts open pull #1 before anything else on alice/notes.
  • Roster: test/page-budget-roster.test.ts lists the six pages and fails when one loses its file, its pattern or its roster row.
  • Client-size suite: test/client-size.test.ts walks the same roster, so it needed a size ceiling for each new page. I added only those six to docs/design/size-budget.json. Rewriting the file would have raised every existing ceiling a little, so those are unchanged.
  • Docs: docs/web.md "Not done" now names only pages that are still unmeasured (issue and pull lists, a single issue, code and file views, settings, /runs and a run's log, search, profiles, the API). A new short section there says how page budgets work.

Checks: bun x tsc --noEmit and bun scripts/gate.ts --fix are clean. I ran the covering tests myself because scripts/fast.ts named 3232 files (page_budget.ts is imported widely). The page-budget, roster, path, read, client-size, space-budget and check-tiers suites pass, 90 tests. With talk.ts removed, the roster test fails as it should.

I left out the other unmeasured pages listed in "Not done", the review steps and the before/after looks. No page markup or src/web/ code changed, only budgets, fixtures and docs, so there is nothing new on a page to look at.

To try it: bun test test/page-budget.test.ts prints the count and median table for all nineteen pages.

🤖 Generated with Claude Code

Closes #15251

2 earlier comments · 1 event
commented

Six more pages now have a budget: /system, /feed, /board, /fleet, /talk and a pull page (/:owner/:name/pulls/:number). Each has its own file in src/perf/page_budgets/ and a row in src/perf/page_budget.ts. test/page-budget.test.ts walks them signed in, and each file's comment records what was measured and how the limit was set from it.

Measured on the page-budget fixture, three runs:

pageSQL warm (same all three runs)CPU medianstatement limitmedian budget
/system2610.2–10.9 ms2925 ms
/feed455.7–6.0 ms5015 ms
/board706.3–7.2 ms7715 ms
/fleet122.5–2.9 ms1410 ms
/talk313.7–3.9 ms3510 ms
pull #110910.3–11.6 ms12025 ms
  • How the limits were set: each median budget is twice the slowest run, rounded up to the next 5 ms. I did not give statements the 2x headroom the issue suggests. The count did not move between runs, and a doubled count is an N+1 the limit is there to catch, so each limit is the count plus a tenth, in line with the existing "measured plus a little" rows.
  • Pull page: the row uses the router pattern, so the production reader (page_budget_read.ts) matches it against route stats. pagePath now fills :number (default 1). The fixtures in test/page-budget.test.ts and test/client-size.test.ts open pull #1 before anything else on alice/notes.
  • Roster: test/page-budget-roster.test.ts lists the six pages and fails when one loses its file, its pattern or its roster row.
  • Client-size suite: test/client-size.test.ts walks the same roster, so it needed a size ceiling for each new page. I added only those six to docs/design/size-budget.json. Rewriting the file would have raised every existing ceiling a little, so those are unchanged.
  • Docs: docs/web.md "Not done" now names only pages that are still unmeasured (issue and pull lists, a single issue, code and file views, settings, /runs and a run's log, search, profiles, the API). A new short section there says how page budgets work.

Checks: bun x tsc --noEmit and bun scripts/gate.ts --fix are clean. I ran the covering tests myself because scripts/fast.ts named 3232 files (page_budget.ts is imported widely). The page-budget, roster, path, read, client-size, space-budget and check-tiers suites pass, 90 tests. With talk.ts removed, the roster test fails as it should.

I left out the other unmeasured pages listed in "Not done", the review steps and the before/after looks. No page markup or src/web/ code changed, only budgets, fixtures and docs, so there is nothing new on a page to look at.

To try it: bun test test/page-budget.test.ts prints the count and median table for all nineteen pages.

🤖 Generated with Claude Code

commented

Six more pages now have a budget: /system, /feed, /board, /fleet, /talk and a pull page (/:owner/:name/pulls/:number). Each has its own file in src/perf/page_budgets/ and a row in src/perf/page_budget.ts. test/page-budget.test.ts walks them signed in, and each file's comment records what was measured and how the limit was set from it.

Measured on the page-budget fixture, three runs:

pageSQL warm (same all three runs)CPU medianstatement limitmedian budget
/system2610.2–10.9 ms2925 ms
/feed455.7–6.0 ms5015 ms
/board706.3–7.2 ms7715 ms
/fleet122.5–2.9 ms1410 ms
/talk313.7–3.9 ms3510 ms
pull #110910.3–11.6 ms12025 ms
  • How the limits were set: each median budget is twice the slowest run, rounded up to the next 5 ms. I did not give statements the 2x headroom the issue suggests. The count did not move between runs, and a doubled count is an N+1 the limit is there to catch, so each limit is the count plus a tenth, in line with the existing "measured plus a little" rows.
  • Pull page: the row uses the router pattern, so the production reader (src/perf/page_budget_read.ts) matches it against route stats. pagePath now fills :number (default 1). The fixtures in test/page-budget.test.ts and test/client-size.test.ts open pull #1 before anything else on alice/notes.
  • Roster: test/page-budget-roster.test.ts lists the six pages and fails when one loses its file, its pattern or its roster row.
  • Client-size suite: test/client-size.test.ts walks the same roster, so it needed a size ceiling for each new page. I added only those six to docs/design/size-budget.json. Rewriting the file would have raised every existing ceiling a little, so those are unchanged.
  • Pipeline (src/checks/tiers.ts): movesPageBudgets said a changed limit in page_budgets/ is judged, but the tests it names (pages-budget, client-size, docs-link) are not the ones that hold a page to its limit. A new budget file is in no coverage map yet, so nothing tied it to the test that judges it. The fast tier now runs test/page-budget.test.ts and test/page-budget-roster.test.ts whenever page_budget.ts or a file under page_budgets/ changes. test/check-tiers.test.ts covers this and fails against the old tiers.ts. This is also the pipeline change the "pipeline first" rule asks for: with six new files, a Direction: line would not have cleared it, because that waiver allows at most two.
  • Docs: docs/web.md "Not done" now names only pages that are still unmeasured (issue and pull lists, a single issue, code and file views, settings, /runs and a run's log, search, profiles, the API). A new short section there says how page budgets work.

Checks: bun scripts/gate.ts passes on the committed head and bun x tsc --noEmit is clean. I ran the covering tests myself because scripts/fast.ts named 3232 files (page_budget.ts is imported widely). Across the two rounds, the page-budget, roster, path, read, client-size, space-budget and check-tiers suites all pass. With talk.ts removed, the roster test fails as it should.

I left out the other unmeasured pages listed in "Not done", the review steps and the before/after looks. No page markup or src/web/ code changed, only budgets, fixtures, the tier rule and docs, so there is nothing new on a page to look at.

To try it: bun test test/page-budget.test.ts prints the count and median table for all nineteen pages.

🤖 Generated with Claude Code

Changes requested — before the latest push

The six budgets are measured, recorded beside each file and walked by the test, and the roster test is real. One thing to fix first: isPageTable in src/checks/tiers.ts duplicates movesPageBudgets exactly, so delete it and reuse the existing predicate. Second, the 10 ms median budgets on /fleet and /talk (measured 2.5 to 3.9 ms) sit close to CI noise. The direction asks for fast tests that never flake, so give them a floor, say 15 ms, or take the median over more samples. This pull changes no page markup, so it has no review steps and no before/after looks, and none are owed.

commented

Six more pages now have a measured page budget: /system, /feed, /board, /fleet, /talk and a pull page. Each page has its own file under src/perf/page_budgets/, with the measurement and how the limit was derived written beside it. test/page-budget.test.ts walks every page in the table signed in and holds it to its limit. test/page-budget-roster.test.ts checks that the files and the list match.

src/checks/tiers.ts now picks the tests a change has to run with one predicate, movesPageBudgets. The second predicate, isPageTable, is removed. When a change touches shared page code or the budget table, both groups run: PAGE_BUDGET_TESTS and PAGE_TABLE_TESTS.

  • The two predicates were not identical. isPageTable matched only the table files. movesPageBudgets also matches src/web/layout.ts, src/http/server.ts, src/web/style/ and src/web/pages/. So a layout change now also runs the walk and the roster test. That is what we want: shared page code changes every page's time and statement count, and the walk is the test that measures them. The roster test is cheap.
  • Test change: in test/check-tiers.test.ts, the case for a layout change used to expect the roster test not to run. It now expects both table tests to run. A new case checks that a file with nothing to do with pages (src/snapshot/store.ts) runs neither.
  • /fleet and /talk: their median budgets go from 10 ms to 15 ms, the same as /feed and /board. Measured medians are 2.5–2.9 ms and 3.7–3.9 ms, so a loaded runner has room before the test fails. Their statement budgets stay at 14 and 35.

Before pushing I ran bun scripts/gate.ts --fix and bun x tsc --noEmit, and bun test on test/check-tiers.test.ts, test/page-budget.test.ts and test/page-budget-roster.test.ts. All passed (73 tests). No page markup changes, so there are no review steps.

To try it: bun test test/page-budget.test.ts walks the pages against their budgets, and bun test test/check-tiers.test.ts covers which tests a changed file pulls in.

🤖 Generated with Claude Code

Approved

Approved. Six budget files, roster rows, a roster test that names them, fixtures that open pull #1, and size ceilings for the new pages. Limits are set from measurements written beside each. The tiers.ts change ties the budget table to the tests that judge it, and has a test. No page markup changed, so there are no review steps to ask for. Next, non-blocking: (1) measure the remaining pages listed under Not done, starting with issue and pull lists. (2) Derive the statement limits and median budgets from the measurement by a small helper, so the arithmetic in each comment is not hand-copied.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs