Repository navigation
feat(sqlite): run Team Reports storage in owned workers - #144871
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: blocked before merge. Reviewed September 11, 2026, 9:01 AM ET / 13:01 UTC (Revision 3). ClawSweeper reviewWhat this changesMoves Team Reports database operations into bounded, shared SQLite workers, exposes a typed plugin SDK interface, and updates lifecycle tests and test routing. Warning SQLite table change This PR modifies persisted SQLite tables in Merge readiness⛔ Blocked before merge - 1 item remains This PR remains necessary: current main still runs Team Reports SQLite operations on the application thread. No blocking correctness or security defect was found. The previous publication concern is addressed by the documented coordinated release plan and existing compatibility-floor synchronization. Priority: P2 Review scores
Verification
How this fits togetherTeam Reports collects activity and serves stored reports through authenticated Gateway routes. Its storage adapter now sends domain commands to workers that own SQLite connections, transactions, and cleanup. flowchart LR
A[Report scheduler] --> C[Team Reports storage adapter]
B[Authenticated report requests] --> C
C --> D[Bounded worker broker]
D --> E[Database worker]
E --> F[Plugin SQLite database]
E --> G[Results or explicit failures]
G --> C
Before merge
Agent review detailsSecurityNone. PR surfaceSource +988, Tests +986, Docs +60, Config +3, Other +3. Total +2040 across 30 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Retain one worker-owned SQLite backend per database and publish the plugin with its supporting host through the existing release compatibility synchronization. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the mechanism: current main directly executes synchronous SQLite operations inside asynchronous store methods. The supplied lock-contention observations exercise the repaired boundary; this review did not rerun them. Is this the best way to solve the issue? Yes. Complete domain operations move behind one generic worker owner while existing schema and caller contracts remain intact; asynchronous transaction admission alone would not move queries or schema work off-thread. The host/plugin publication dependency is already covered by explicit release context. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 66c7fad06385. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
Dependency GuardThis PR changes dependency-related files. Maintainers should confirm these changes are intentional. Changed files:
Maintainer follow-up:
|
Dependency graph changes notedThis PR includes dependency graph changes. The dependency guard is informational because the PR author is a repository admin, a member of
Security review is still recommended before merge when the dependency graph change is intentional. |
|
Compatibility confirmation: Team Reports uses the same SQLite schema, tables, report encodings, UTF-8 limits and retention policy. The existing SQL implementation moved into its private worker; the frontend preserves the awaited domain API introduced in #144646. This requires no stored-data migration. The final source and both compiled package layouts write synthetic reports, close every store/worker, reopen the same database in a fresh process and verify exact values. The 296-case suite includes existing store behavior and worker failure/drainage controls; all checks and both builds pass. Native instrumentation records zero SQLite calls on the application main thread for those flows. This plugin must publish with a host containing the new worker/runtime-entry capabilities via the existing release-time plugin API floor synchronization. The PR does not publish a plugin separately or guess a future host version. File-backed application-main-thread callers are this first scope; incognito and other application-worker callers remain explicitly outside the supported first slice. |
|
Merged via squash.
|
* commit 'f2ce199238e974b1d4caff8f11112aa51eb00d9e': (310 commits) refactor(copilot): deduplicate transcript user text (#144888) refactor(sessions): await discovery and config readiness (#144854) refactor(e2e): deduplicate release file assertions (#144904) ci: keep growing hosted test plans within the job cap (#144965) fix(macos): avoid stale dashboard command assertions (#144710) refactor(memory): await standing intent operations (#144832) refactor(ui): derive native device settings types from schemas (#144705) refactor(memory): await journal operations and allocate sequences atomically (#144824) refactor(tests): share command field assertions (#144955) refactor(matrix): share bounded context cache insertion (#144939) refactor(i18n): share Apple catalog reader (#144848) fix(doctor): preserve legacy registry files when quarantine fails (#144787) refactor(tests): reuse PixVerse auth fixtures (#144926) fix(bonjour): silence transient ENODEV socket warnings (#144870) fix(matrix): preserve unrelated files when migration fails (#144883) feat(sqlite): run Team Reports storage in owned workers (#144871) fix(update): install explicit same-version artifacts (#144894) refactor(ui): share cached message extraction (#144244) refactor: normalize Claude usage responses at one boundary (#144707) refactor: simplify CLI child listener registration (#144929) ...
Related: #144592
What Problem This Solves
Awaiting Node SQLite calls does not move their work off the application thread. Team Reports can still block timers and requests during database operations or lock contention even though its store methods return promises.
Why This Change Was Made
Move Team Reports opening, schema work, prepared queries, complete transactions, WAL maintenance and close into a long-lived worker owned by a bounded shared broker. The plugin sends typed domain commands to a static private backend and locates it from the loader-selected runtime entry. Its existing service lifetime retains admitted work through shutdown.
The broker allows four lazy workers, 64 opening/live store clients, 128 requests and a bounded input queue. Physical aliases share an owner; admitted pathnames remain protected through client drainage. Queued cancellation removes unstarted work; dispatched operations retain their settlement. Worker loss or an undecodable committed result reports an uncertain outcome without automatically replaying writes. Local overload before dispatch does not retire a healthy shared worker.
This first consumer supports file-backed stores from the application main thread. Incognito, shared canonical databases and callers hosted in other application workers remain separate campaign work. Native synchronous SQLite primitives stay entirely inside the worker; no main-thread blocking RPC bridge is introduced.
User Impact
Team Reports preserves its schema, report formats, UTF-8 limits, retention and HTTP behavior while SQLite work stops blocking its host event loop. Existing connection and prepared-statement ownership stays with the database worker.
Release context: publish this Team Reports change with the first host release containing the worker SDK and selected-runtime-entry capability. The regular release workflow must synchronize its plugin API compatibility floor; this PR does not publish or guess a future version.
Evidence
The exact CI wrapper failure is repaired by including the worker-path module in the canonical extracted dependency closure; all 70 wrapper regressions pass. The scheduler fixture waits for actual collector entry while retaining its immediate concurrent-run rejection and no-overlap assertions; all 31 scheduler cases and the original delayed-read reproduction pass. Full candidate checks and fresh P2 review passed for these two fixes.