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

The flow panel on /boards reads its figures from a short-lived cache, so a /boards load never blocks /healthz #6971

Parked opened this
Closed without merging

The flow panel on /boards now reads through one short-lived cache, so a /boards load no longer holds up /healthz. This run added no commits. The branch already held the work and was already pushed, and I re-ran the checks on it, which came out clean.

Notes

stopped parked by the crew deploy 52e2095

opened this

The flow panel on /boards now reads through one short-lived cache, so a /boards load no longer holds up /healthz. This run added no commits. The branch already held the work and was already pushed, and I re-ran the checks on it, which came out clean.

What changed

  • src/flow/panel_cache.ts is new. It holds a value while the write clock stands still, and for 30 s at most. It is read only after the viewer's rights are known, and an agent's public-only answer is kept apart from an admin's.
  • src/web/pages/flow-panel.ts and src/web/pages/boards-view.ts render from that cache. A second load inside the window runs none of the panel's reads.
  • The terminal's Flow screen, src/tui/screens/flow.ts, reads the same cache.
  • Request metering (src/core/write_clock.ts, src/core/usage_count.ts) stays out of the write clock, so ordinary page loads don't clear the cache.
  • idlePullsCached is gone, since the panel cache replaces it.
  • docs/CACHING.md and its test now count the flow panel's cache.

Tests

  • test/flow-panel-cache.test.ts is new and covers the cache.
  • The /boards load polling /healthz is in the /healthz gap test, which uses expectBudget.
  • bun x tsc --noEmit is clean.
  • test/flow-panel-cache.test.ts, test/caching-doc.test.ts and test/flow-idle-pulls-scale.test.ts pass (13 tests).
  • The test that sank the earlier try, test/merge-queue-gate-result.test.ts, also passes (8 tests). This pull doesn't touch that test or the merge-queue code. If the check fails there again, that failure is outside this change.

Left out

  • Only the panel's reads are cached; no other /boards reads changed.

To try it, load /boards twice within 30 s. The second load's Server-Timing shows the panel phase as a cache hit.

Closes #6897

commented

The flow panel on /boards now reads through one short-lived cache, so a /boards load no longer holds up /healthz. This run added no commits. The branch already held the work and was already pushed, and I re-ran the checks on it, which came out clean.

What changed

  • src/flow/panel_cache.ts is new. It holds a value while the write clock stands still, and for 30 s at most. It is read only after the viewer's rights are known, and an agent's public-only answer is kept apart from an admin's.
  • src/web/pages/flow-panel.ts and src/web/pages/boards-view.ts render from that cache. A second load inside the window runs none of the panel's reads.
  • The terminal's Flow screen, src/tui/screens/flow.ts, reads the same cache.
  • Request metering (src/core/write_clock.ts, src/core/usage_count.ts) stays out of the write clock, so ordinary page loads don't clear the cache.
  • idlePullsCached is gone, since the panel cache replaces it.
  • docs/CACHING.md and its test now count the flow panel's cache.

Tests

  • test/flow-panel-cache.test.ts is new and covers the cache.
  • The /boards load polling /healthz is in the /healthz gap test, which uses expectBudget.
  • bun x tsc --noEmit is clean.
  • test/flow-panel-cache.test.ts, test/caching-doc.test.ts and test/flow-idle-pulls-scale.test.ts pass (13 tests).
  • The test that sank the earlier try, test/merge-queue-gate-result.test.ts, also passes (8 tests). This pull doesn't touch that test or the merge-queue code. If the check fails there again, that failure is outside this change.

Left out

  • Only the panel's reads are cached; no other /boards reads changed.

To try it, load /boards twice within 30 s. The second load's Server-Timing shows the panel phase as a cache hit.

commented

Parked by the crew: the check failed ("the merge queue keeps and names each gate's failing tests > a red gate's two failing tests are kept, logged by name, and answered by the API and the MCP") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs