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

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:sh74wg48ib is past its budget: trevato/forge: "on production's size > a cold /map answers within a few passes over the runs" failed on 3 pulls in the … #18070

opened this

Merged 7h 58m ago, live in production

The production-size page budgets now count only the page's own statements, so "a cold /map answers within a few passes over the runs" no longer depends on how busy the check machine is. Cause. On an idle machine a cold /map asks for 32 statements, and every one is logged under route GET /map or with no step.

Notes

opened this

The production-size page budgets now count only the page's own statements, so "a cold /map answers within a few passes over the runs" no longer depends on how busy the check machine is.

Cause. On an idle machine a cold /map asks for 32 statements, and every one is logged under route GET /map or with no step. The statement log also picked up background jobs: the timers that flush request counts, route timings, traffic history and read history. On a loaded check machine those timers fired while the page was being served and pushed the count to 57, over the ceiling of 50. The stack trace in the sentinel's log (withoutWaiting → flush → background) is one of those flushes.

Fix. Each background job runs its synchronous part under inStep("duty <name>"). src/kernel/statement_log.ts now writes each line as {"sql", "step"}, with step being what the thread was doing at that moment. readStatementLog in test/observability-budget.test.ts skips lines whose step starts with duty . The four workers already load loop_step, so production gets no new import or allocation, and nothing is logged unless FORGE_STATEMENT_LOG is set.

What to look at:

  • A new test runs a statement inside background(...) next to a plain one and expects only the plain one to be counted. It would fail without the split.
  • I left the ceilings (boards 80, map 50, home 240) unchanged. The remaining headroom only covers a background job's reads after an await, because no step names those.
  • The cannot commit transaction - SQL statements in progress warnings at teardown appear on green runs too. They're unrelated to this failure and I left them alone.

Checks. test/observability-budget.test.ts passes (8 tests), as do module-state, loop-step-server, unused-exports, pages-memory and fixed-texts (19 tests). bun x tsc --noEmit and bun scripts/gate.ts are clean. scripts/fast.ts said this diff was too broad to pick tests for, so I chose these; the full suite is left to the forge's check. The commit says No door: because this changes test instrumentation only, no page, route or tool.

🤖 Generated with Claude Code

Closes #18026

commented

The production-size page budgets now count only the page's own statements, so "a cold /map answers within a few passes over the runs" no longer depends on how busy the check machine is.

Cause. On an idle machine a cold /map asks for 32 statements, and every one is logged under route GET /map or with no step. The statement log also picked up background jobs: the timers that flush request counts, route timings, traffic history and read history. On a loaded check machine those timers fired while the page was being served and pushed the count to 57, over the ceiling of 50. The stack trace in the sentinel's log (withoutWaiting → flush → background) is one of those flushes.

Fix. Each background job runs its synchronous part under inStep("duty <name>"). src/kernel/statement_log.ts now writes each line as {"sql", "step"}, with step being what the thread was doing at that moment. readStatementLog in test/observability-budget.test.ts skips lines whose step starts with duty . The four workers already load loop_step, so production gets no new import or allocation, and nothing is logged unless FORGE_STATEMENT_LOG is set.

What to look at:

  • A new test runs a statement inside background(...) next to a plain one and expects only the plain one to be counted. It would fail without the split.
  • I left the ceilings (boards 80, map 50, home 240) unchanged. The remaining headroom only covers a background job's reads after an await, because no step names those.
  • The cannot commit transaction - SQL statements in progress warnings at teardown appear on green runs too. They're unrelated to this failure and I left them alone.

Checks. test/observability-budget.test.ts passes (8 tests), as do module-state, loop-step-server, unused-exports, pages-memory and fixed-texts (19 tests). bun x tsc --noEmit and bun scripts/gate.ts are clean. scripts/fast.ts said this diff was too broad to pick tests for, so I chose these; the full suite is left to the forge's check. The commit says No door: because this changes test instrumentation only, no page, route or tool.

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs