Repository navigation
perf(workboard): share dashboard board summaries - #179090
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
b4386e1 to
8bcb1b9
Compare
|
Codex review: needs maintainer review before merge. What this changesThis PR shares Workboard board summaries across board-list and card-list requests until the existing store revision changes. Example: Twelve dashboard clients read 24 boards containing 1,200 cards.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it provides a useful, narrowly scoped performance improvement that current main lacks, with no actionable correctness or security findings. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Workboard store sits between Gateway RPCs and worker-backed persistence, returning board metadata and card-count summaries while existing writer receipts track changes. flowchart LR
A[Dashboard clients] --> B[Gateway list methods]
B --> C[Workboard store]
C --> D[Shared board summaries]
D --> E[Persistence worker]
E --> F[Workboard database]
F --> G[Writer receipts]
G --> C
Technical reviewBest possible solution: Retain the single store-owned summary result and its existing receipt-driven invalidation without introducing another cache manager or persistence format. Do we have a high-confidence way to reproduce the issue? Current-main source unconditionally rebuilds summaries for each listBoards call; the supplied measurements report that redundant work through real Gateway requests, while this review executed no target code. Is this the best way to solve the issue? The patch uses the existing store lifetime and write receipts, retains count-only aggregation, and adds no competing owner, making it a small complete solution to repeated summary construction. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e501abf29b6a. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +22, Tests +58, Docs +36, Other +387. Total +503 across 6 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 21, 2026, 2:24 AM ET / 06:24 UTC. |
* perf(workboard): share dashboard board summaries * fix(perf): type workboard benchmark samples explicitly
What Problem This Solves
Concurrent dashboard tabs repeatedly rebuild unchanged Workboard board summaries, making board-list polling and card-list refreshes do redundant SQLite reads and aggregation.
User Impact
Dashboard board and card lists share the current summaries across tabs. Card and board edits still appear on the next read. No configuration, schema, permission, response-shape, or visual changes.
Why This Change Was Made
Keep one pending/completed board-summary result in the existing Workboard store. Its writer receipts invalidate that result alongside card-list pages after local or sibling-worker commits, uncertain writes, and disposal. Unsettled receipts remain uncached; rejected reads remain retryable. Viewer-specific board widget tickets and GitHub authorization retain their existing owners.
The simplification pass retained 22 net runtime lines for the requested revision-based sharing: one result slot, rejection cleanup, and existing invalidation/disposal hooks. The aggregation still runs after changes. The overall non-test/non-doc code delta is +409 lines: +22 runtime and +387 standalone benchmark; regression coverage adds 58 lines. No new cache owner, timer, or runtime dependency was introduced.
Evidence
Two concurrent baseline/candidate pairs replayed real isolated Gateway/WebSocket/SQLite paths with 24 boards, 1,200 synthetic cards, and 12 clients. Each phase made 960 calls per method over approximately 20 seconds. An exclusive lock covered each pair; separate 16-core CPU halves were swapped for pair 2, with common phase starts (at most 1 ms skew). Outside load was recorded. Baseline:
07f950e4e01b337353a410444bd6c35013aa57c2.Handler seconds below are extrapolated to 15 minutes at the replay's request rate, not a production forecast. Each arrow compares concurrent A → B; paired differences drive the result.
Warm board-list handler work drops 89–91%. Combined post-edit handler work drops 27–30%. Warm card-list latency is effectively neutral in pair 1 and improves in pair 2. Gateway process CPU drops 41–44% warm, 28–30% after edits. Both pairs perform 960 → 0 metadata and aggregate reads when warm, and 1920 → 80 after 80 writes (one summary per write). All responses preserve matching byte totals; every response verifies board aggregates/card status. Zero errors or stale results.
The acceptance rule recorded before measurement required two swapped pairs, fresh mutation results, matching payloads, zero warm aggregate reads, and investigation of any RPC p99 regression over 20%. Both pairs satisfy it. The benchmark does not measure external GitHub latency, browser rendering, or a full session-heavy workload. Small handler-tail variation remains on already-cached card reads (pair 1: 2.32 → 3.20 ms); end-to-end p99 is neutral there.
Validation:
gateway.cards-list.test.tsandstore-lifecycle.test.ts, covering concurrent list shapes, sibling commits, unsettled receipts, rejected reads, and closed-store admission.pnpm tsgo:extensionspasses with the native checker. No Testbox/Crabbox allocation; PR CI owns broad proof.8bcb1b911b011659b92d92378d5f9034d1115e6d: CI run 39553349362 and requiredopenclaw/ci-gatepassed. CI confirms the new regression in 225 ms, all 33 tests in its extension shard, 134 changed-boundary tests, 19 eager-import closure tests, and 3 PR-wrapper closure tests. All three PostgreSQL conformance shards passed. The initial benchmark type assertion was fixed; no failed-CI exception or rerun was used.