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

Each first-opened page's warm median reads beside its budget as plain rows, in one pure function with its test #11577

shipped production is serving it opened this has it
opened this

Intent: speed is first class; give /system the numbers it will show, as plain data, in one small pull. First half of #11544 (parked twice: both pulls grew past their files and stayed red). Start fresh from main; touch only the files below.

Done:

  • [ ] new src/perf/page_budget_read.ts exports one pure function pageBudgetRows(stats) taking route stats keyed by router pattern (the RouteStat shape src/perf/record.ts already returns from summarize) and returning { page, pattern, budgetMs, statements, medianMs: number | null, n, over } for each entry of PAGE_BUDGETS (src/perf/page_budget.ts), in that order
  • [x] a page with no samples reads medianMs: null, n: 0, over: false — never 0
  • [x] over is true only when the median is strictly past the budget
  • [x] new test/page-budget-read.test.ts: rows follow PAGE_BUDGETS one for one; over only past the budget; null when unsampled; each test would fail without the code
  • [x] add src/perf/page_budget_read.ts to scripts/unreached-allow.json (the next issue wires it to /system and removes it)
  • [x] bun x tsc --noEmit and bun test test/page-budget-read.test.ts test/page-budget.test.ts pass in the sandbox before the push

Files: src/perf/page_budget_read.ts (new), test/page-budget-read.test.ts (new), scripts/unreached-allow.json. Risks: none past scope creep — no page, no docs, no MCP in this pull. Suggested brief: scout.

commented

Reviewed pull #11579 at its head: ticked a page with no samples reads medianMs: null, n: 0, over: false — never 0; over is true only when the median is strictly past the budget; new test/page-budget-read.test.ts: rows follow PAGE_BUDGETS one for one; over only past the budget; null when unsampled; each test would fail without the code; add src/perf/page_budget_read.ts to scripts/unreached-allow.json (the next issue wires it to /system and removes it); bun x tsc --noEmit and bun test test/page-budget-read.test.ts test/page-budget.test.ts pass in the sandbox before the push.

commented

Left open after pull #11579 landed: 1 unticked item remains (new src/perf/page_budget_read.ts exports one pure function pageBudgetRows(stats) taking route stats keyed by router pattern (the RouteStat shape src/perf/record.ts already returns from summarize) and returning { page, pattern, budgetMs, statements, medianMs: number | null, n, over } for each entry of PAGE_BUDGETS (src/perf/page_budget.ts), in that order). The planner files each as its own issue and closes this one; a person may close it, tick what is done, or say what is left. Until then the crew does not pick it again.

commented

Already done on main in 489e70a87: src/perf/page_budget_read.ts exports pageBudgetRows(stats) returning the PageBudgetRow for each PAGE_BUDGETS entry in order; the unticked box describes what landed. Closing, nothing left.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs