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

/system lists each first-opened page's warm median beside its budget, one plain line per page #11544

Closed opened this
opened this

Intent: speed is first class; the owner sees which first-opened page is over its budget today on /system, without running a script. Replaces half of #11457 (parked twice: both pulls grew into docs churn across a dozen files and stayed red). Keep this pull to the files below.

Done:

  • [ ] a new src/perf/page_budget_read.ts exports one pure function pageBudgetRows(stats, now) taking the route stats src/perf/record.ts already summarizes (keyed by router pattern) and PAGE_BUDGETS from src/perf/page_budget.ts, returning plain rows { page, pattern, budgetMs, statements, medianMs | null, n, over } in PAGE_BUDGETS order; a page with no samples reads medianMs: null, never 0
  • [ ] /system (src/web/pages/system.ts, one mount) renders a new section from src/web/pages/system-budget.ts: one row per page, its budget and measured median; an over-budget page is one plain line in words ("map answers in 82 ms, budget 50 ms"), no red banner; no samples reads "not opened in the last 15 minutes"
  • [ ] the read stays in memory (the perf record), no new SQL on /system; /system's own statement count does not rise
  • [ ] test/page-budget-read.test.ts: rows follow PAGE_BUDGETS (adding a page there adds a row), over is true only past the budget, null when unsampled; and a render test that the section shows each page name
  • [ ] if scripts/unreached-allow.json lists any module this makes reachable, remove it there; touch no other docs than one short docs/features/page-budget.md paragraph
  • [ ] bun scripts/design-lint.ts, bun x tsc --noEmit and the new and touched tests pass in the sandbox before the push

Files: src/perf/page_budget_read.ts (new), src/web/pages/system-budget.ts (new), src/web/pages/system.ts, test/page-budget-read.test.ts (new), docs/features/page-budget.md. Risks: the earlier pulls (branches torque/11457-… at 536faefe51ad, scout/11457-… at 37af3d9fd66b) may be read for ideas but start fresh from main; do not touch the MCP tool here. Suggested brief: scout.

commented

Parked by the crew: the check stayed red through 2 automatic tries (pull #11550 closed; its branch scout/11544-system-lists-each-first-opened-page-s-wa at d182ac17b100 keeps the work so far). Planner: split this smaller, or rewrite what done looks like; a person can also say what to try.

try 1: docs/features/page-budget.md, scripts/unreached-allow.json, src/perf/page_budget_read.ts, src/web/pages/system-budget.ts, src/web/pages/system.ts, test/… try 2: docs/features/flow-clog.md, scripts/unreached-allow.json, src/crew/hot_files.ts, src/flow/clog_view.ts, src/tui/screens/flow.ts, src/web/pages/flow-clog… try 3: no files changed try 4: src/web/pages/system-budget.ts

commented

Parked by the crew: the check stayed red through 2 automatic tries: check failed: stopped: used 17.0 cores for 31s, over its limit of 16; the busiest process is sh (pid 808602, 462s of CPU) (pull #11567 closed; its branch scout/11544-system-lists-each-first-opened-page-s-wa at 781f1c29686e keeps the work so far).

Parked twice since a person last spoke here, so it is the planner's now. Every reason:

  1. the check stayed red through 2 automatic tries (pull #11550 closed; its branch scout/11544-system-lists-each-first-opened-page-s-wa at d182ac17b100 keeps the work so far)
  2. the check stayed red through 2 automatic tries: check failed: stopped: used 17.0 cores for 31s, over its limit of 16; the busiest process is sh (pid 808602, 462s of CPU) (pull #11567 closed; its branch scout/11544-system-lists-each-first-opened-page-s-wa at 781f1c29686e keeps the work so far)

The planner splits it, replaces it with a fresh issue, or defers it; a person can also say what to try. Nothing starts here until then, and the board lists it.

try 1: docs/features/page-budget.md, scripts/unreached-allow.json, src/perf/page_budget_read.ts, src/web/pages/system-budget.ts, src/web/pages/system.ts, test/… try 2: src/actions/spawn.ts, src/spawn/claim.ts, src/spawn/door.ts, src/web/pages/claim.ts, test/spawn-founder-name.test.ts

commented

Split into #11577 (the pure reader and its test, no page) and #11578 (the /system section, waits for #11577), each one small pull on named files. The second park was the check cell's CPU limit, which #11573 addresses, not this code.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs