Repository navigation
perf(workboard): reuse card list payloads per store revision - #164301
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: needs maintainer review before merge. Reviewed October 3, 2026, 8:43 AM ET / 12:43 UTC. ClawSweeper reviewWhat this changesWorkboard reuses immutable, redacted card-list responses until store changes invalidate them, avoiding repeated SQLite reads and response reconstruction. Merge readiness✅ Ready for maintainer review This remains a useful optimization absent from current main. No actionable introduced defect was found, and the supplied production-boundary benchmark supports payload reuse without changing the RPC contract. Priority: P2 Review scores
Verification
How this fits togetherWorkboard is an optional plugin that presents local work cards in the Control UI. Its Gateway handler reads cards and board summaries from a SQLite worker and returns them to authorized operator clients. flowchart TD
A[Operator card-list request] --> B[Normalize board filter]
B --> C[Store-owned response cache]
C --> D[SQLite worker reads on cache miss]
D --> E[Redact claims and freeze response]
E --> F[Shared card-list response]
C --> F
G[Committed writes and foreign-change events] --> C
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +61, Tests +148, Docs +8. Total +217 across 9 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one store-owned response cache with revision-wide invalidation, preserving raw internal reads and the existing operator scopes and RPC shape. Do we have a high-confidence way to reproduce the issue? Yes: current-main source rebuilds the card-list payload on every request, and the supplied registered-handler benchmark reports repeated SQLite reads before the patch. This reviewer did not execute target code. Is this the best way to solve the issue? Yes: caching at the existing store owner centralizes invalidation and removes the superseded Gateway builder while preserving internal unredacted reads. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3bfa7cd91059. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
* origin/main: fix(test): restore fixture state and await async completion (#164222) refactor(sessions): stage and settle pending inputs in workers (#164284) fix: speech-only replies fail when models include reasoning (#164285) fix(nextcloud-talk): avoid webhook migration for unconfigured channels fix: guide background skill reviews through Workshop proposals (#164292) test(build): reject AI dependencies in retained config repairs refactor(channels): require canonical private-network settings (#163535) fix(memory): migrate embedding cache in bounded batches and record oversized rows (#164303) feat(state): incognito actor memory and Codex history routing (P5c, inactive) (#164224) refactor(synology-chat): remove unused route account ID (#164280) test(ui): await web push preference publications (#164295) perf(scripts): avoid compiler projects for runtime import parsing (#164243) fix(worktrees): create workspaces from nested Windows repositories (#164249) test(agents,channels,cli): remove low-value tests (batch d173) (#164302) perf(workboard): serve cards per board revision and push changes instead of polling (#164301) refactor(sqlite): deslop sqlite stores (#164271) chore(ui): refresh control ui locales (#164299) refactor(events): deslop listener and disposal plumbing (#164221) fix: canonicalize fresh worker reasoning signatures (#164287)
What Problem This Solves
Every
workboard.cards.listcaller rebuilt the full SQLite-backed card tree, sorted it, redacted claims, and recomputed board summaries even when no Workboard state had changed. Repeated and concurrent clients paid that cost independently.User Impact
Repeated board reads share an immutable response until Workboard state changes. The RPC shape, operator scopes, card contents, and claim-token redaction stay unchanged. No configuration or migration is required.
Why This Change Was Made
The store owns one in-flight/cached payload for each normalized board filter. Local committed writes, external SQLite reconciliation, epoch publication, and shutdown retire it. A read invalidated while building joins the replacement; failed reads are evicted. Because every response includes all board summaries, all filters depend on the store-wide revision. Unknown board ids are not retained.
The old per-call Gateway response builder is removed. Raw internal card reads remain necessary for mutation and worker operations that require unredacted claims. Production LOC is +78/−17 (net +61), excluding tests/docs. This growth enforces the requested shared immutable RPC contract, failure recovery, and owner-bound invalidation; there is no alternate cached/uncached RPC path.
The staged gate reproduced an inherited environment-name budget mismatch on untouched base
c81d86e82f60. A temporary exact shrink allowed full validation. Main then landed the same fix in5f52ff0f863c; this branch was rebased through Git, retaining the upstream comment and dropping the duplicate budget change. The final PR contains only Workboard changes.Attachment deletion also removes card metadata. Its committed deletion now advances the existing revision even if the subsequent card update fails, preventing a permanently stale cached attachment.
Current main already uses
plugin.workboard.changedsubscriptions and has no routine card-list polling. This change preserves the existing publication owner. Sessions-board session changes use the same revision stream with a five-second coalescer, so event fanout can trigger card-catalog reads without a polling timer. The client audit found no native-appcards.listcaller in this repository. The session accessory requires the catalog's full-card hydration, so replacing that request withboards.listwould break linked-card display.Evidence
Linux rig, Node 26.8.1, 2,000 synthetic cards, two equal 900-second runs. Ten callers use a synthetic 1.875-second cadence to reproduce 320 reads/min; ten actual browser load/live-refresh controllers are measured separately, with real card mutations at 5 and 10 minutes.
Six reconstructions are exactly two distinct filters (one board and all boards) × three revisions. Current main already has zero routine polling: the real controllers made ten initial reads and ten reads per mutation in both runs, with zero reads between events. No request-rate reduction is claimed.
Commands on the authorized Linux rig used
TMPDIRunder the task worktree,nice -n 10 ionice -c3, and the source loader:node --import ./scripts/tsx.mjs .rig/bench.ts baseline 900000, then the same command withcandidate. The controlled comparison pins baseline02dad3a3eacd7ef5776e6ad5590ea98e3bff171eand applies only this Workboard patch (SHA-256d97e765df3df8b64d4c5a325744be80755a964655c71ab75a16f93099abaed33); the staged gate validated that Workboard source onc81d86e82f60. Final head1008620e7d86rebases the unchanged Workboard bytes onto1a5eb7fdfee7; exact-head CI passed.The harness invokes the registered Gateway handler and real SQLite worker. Handler timing ends at response-callback entry, before JSON serialization, and is not directly comparable to production RPC metrics. Wire bytes are measured separately. Allocation uses Node inspector sampling over 100 warm calls, including serialization but excluding the worker heap. Warmup/sampling are excluded from timed counts. The shared rig had other concurrent work; operation counts and payload reuse provide deterministic evidence alongside wall timings. No full Gateway WebSocket/auth framing or rendered browser was exercised.
Provider:
blacksmith-testboxfor focused tests; authorized Linux rig fallback for the staged gate after the replacement Testbox lease queued for more than 20 minutes.tbx_01m40r9nh9sv0jpj5z428ys8smnode scripts/run-vitest.mjs extensions/workboard/src/gateway.test.ts --maxWorkers=1node scripts/run-vitest.mjs ... --maxWorkers=1node scripts/check-changed.mjs --stagednode scripts/check-changed.mjstbx_01m40w3jbhh4z7qhmdkh9ssjgrgateway.cards-list.test.ts,--maxWorkers=1, verified final HEAD and source hashes/srv/rig/wt-379-checkbash /srv/rig/rig-staged-check.sh 379-check c81d86e82f6022b5bcacf2b7ebe5bd0e7f3fcf20→node scripts/check-changed.mjs --stagedexit=0, 12:05–12:30Z.The rig gate passed line-cap/ratchet checks, extension and extension-test typechecks, dead-export scans, extension/script lint (zero warnings/errors), database/storage guards, and import cycles (zero runtime cycles). Its wrapper did not emit a timing summary table; the retained terminal result is
== exit=0 (12:30Z). Extension lint reported 36.1s; script lint 56.0s.Standalone changed-test costs on final-head Testbox (
--maxWorkers=1):gateway.cards-list.test.tspassed four tests in 0.625s test time / 10.27s wrapper wall time;browser/index.test.tspassed two tests in 0.171s test time / 1.78s wrapper wall time. The final lease is stopped. CI shared-job wall times: changed-extension bundles 146s and 126s; UI shards 340s, 285s, and 374s. These are whole-job costs, not incremental per-test costs.Independent final review: scoped-clean at P0–P2, no actionable findings. Both old Testbox leases were stopped when their base/head changed; the second,
tbx_01m40s0bqvrbep3wwwm9p20n46, remained queued. Final head1008620e7d86passed the seven focused files ontbx_01m40w3jbhh4z7qhmdkh9ssjgr: both Vitest shards passed in 47.54s wrapper wall time (cold worker compilation included); the four server files passed 29 tests. Exact-head CI passed.Browser proof extends the activation/accessory test with a fake 15-minute quiet interval and exactly one event-triggered reread. Server regressions cover payload reuse, normalized scopes, immutable/redacted cards, mutation/board/foreign-commit invalidation, stale in-flight replacement, failure retry, shutdown, and partial attachment deletion.
Gaps: clients maintained outside this repository were not audited. Catalog/page/widget consumers may still issue separate event-triggered reads; the server coalesces their work at the same revision. No visual behavior changed.
Final verification: CI run 37123481325 passed for
1008620e7d86e669c486607266d5aeb37566c2bb;openclaw/ci-gate, dependency review, and security-sensitive review are successful. The PR merged at 12:46:11Z asc28042dade02951be3648174b7b23066ae0c4ff5.