Repository navigation
fix(workboard): index card child records - #129568
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Maintainer decision: accepted for the Workboard same-version rollout. The eight indexes add 13.27 MB in the manual 640k-child-row fixture, while improving per-child lookups by roughly 72x-108x and parent cascades by roughly 103x. Focused planner and existing-database reopen tests pass. I accept the one-time synchronous index-build and storage tradeoff for existing databases. |
|
Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 5:00 PM ET / 21:00 UTC. ClawSweeper reviewWhat this changesThis PR adds Merge readinessKeep open for maintainer review. The index set matches the store’s per-card and batch query shapes and has focused coverage, but it is a material persistent SQLite indexing change that needs explicit owner acceptance of its first-open storage and startup cost. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — step 1 Assertions:
How this fits togetherThe Workboard plugin stores cards and their events, comments, proof, and worker history in SQLite. Card lookup and whole-board reads hydrate these child tables, while card deletion cascades through them. flowchart LR
A[Workboard card activity] --> B[SQLite child tables]
B --> C[Card-child indexes]
C --> D[Single-card reads]
C --> E[Whole-board hydration]
C --> F[Card deletion cascades]
Decision needed
Why: Repository policy treats same-version indexing changes as material persistent-store changes requiring explicit maintainer acceptance. Before merge
Agent review detailsSecurityNone. PR surfaceSource +16, Tests +119. Total +135 across 2 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the indexes in the canonical Workboard schema and land them only after the Workboard owner accepts the measured first-open storage and latency trade-off for existing databases. Do we have a high-confidence way to reproduce the issue? No high-confidence live reproduction was run in this read-only review; source inspection shows the ordered child-table queries that currently lack matching indexes, and the PR supplies focused planner coverage. Is this the best way to solve the issue? Yes, conditionally: placing the indexes in the canonical Workboard schema is the owner-boundary solution and preserves reopen repair behavior, subject to maintainer acceptance of the persistent-store trade-off. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e8b6a04ef5fb. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Audit: https://gist.github.com/vincentkoc/10826f918dde7e23020cf2f390af95d3
What Problem This Solves
Fixes an issue where Workboard reads and card deletion scan eight child tables
because their
card_idforeign keys and ordinal ordering have no supportingindexes.
Why This Change Was Made
Adds
(card_id, ordinal)indexes for events, attempts, comments, links, proof,artifacts, notifications, and worker logs. Existing primary keys/indexes already
cover labels, diagnostics, attachments, and worker protocol, so those tables
are intentionally unchanged.
Workboard remains on schema 3. Its canonical schema runs on every open and
restores missing indexes without changing the migration ledger.
User Impact
Single-card reads, whole-board materialization, rewrites, and card deletion stay
fast as child history grows.
Evidence
pnpm test:extension workboard: 342 passed.preserving the complete migration-ID set.
Overlap note: #113311 contains an equivalent proof index inside a much broader,
currently conflicting Workboard change. That branch should remove its duplicate
index if it rebases after this PR.
AI-assisted: yes. The implementation, benchmarks, and review findings were
independently verified before push.