Repository navigation
chore: classify worker-owned transcript SQLite calls - #174572
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. |
|
Codex review: needs maintainer review before merge. What this changesThis PR classifies four transcript SQLite calls as worker-only and one as worker/maintenance, then refreshes the generated inventory. Example: A maintainer consults the SQLite migration inventory.
Review scores
ProductKind: Maintenance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR corrects five inventory classifications while preserving mixed native paths; no actionable defects were found. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe developer inventory scans SQL call expressions and combines lexical operations with reviewed caller evidence to generate migration documentation and support the main-thread SQLite ratchet. flowchart LR
A[Repository source] --> B[SQL call scanner]
C[Reviewed caller classifications] --> B
B --> D[Worker access inventory]
B --> E[SQLite growth ratchet]
Technical reviewBest possible solution: Merge the focused inventory correction through the normal repository gates. Do we have a high-confidence way to reproduce the issue? Current-main classification rules leave the five audited sites in T1; source traces establish their worker or maintenance execution paths without running target code. Is this the best way to solve the issue? The existing operation, guard, and worker-module classifiers provide a narrow correction that keeps shared native queries and SDK callback paths visible. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 18c174469d64. Provenance checked
TestingProof path: none. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceDocs +2, Other +31. Total +33 across 2 files. Added test files: 0. View PR surface stats
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 16, 2026, 3:28 PM ET / 19:28 UTC. |
Record caller evidence for four worker-only transcript SQL calls and one worker/maintenance call. Reduce the assigned static T1 count from 67 to 62 and global T1 from 224 to 219. Preserve native delivery/compaction authority paths and released synchronous SDK contracts. No production runtime, schema, SQL, or public API changes.
What Problem This Solves
The main-thread SQLite inventory counts five transcript SQL calls whose execution is confined to workers or explicit maintenance. Correct those classifications without hiding the shared native paths.
User Impact
No runtime behavior, public API, schema, stored data, or SQL changes. This is a source-reachability audit, not a runtime performance improvement. Transcript main-thread debt is reduced in the inventory, not eliminated.
Why This Change Was Made
Use the inventory's existing operation/guard classifiers for mixed modules and its worker-module list for the single-operation incremental reader. Keep the shared header, append, replacement, index, and SDK paths visible. No new owner, worker protocol, fallback, or compatibility API is introduced.
Four assigned calls are worker-only: incremental event reads; message presence reads; the actor-window timestamp UPDATE; and the native lock's replacement transaction. The public SDK lock projectors do not expose the replacement method. One active-entry identity query serves workers and explicit maintenance; its apparent Gateway native caller is incognito-only and the database opener rejects that sentinel before SQL.
No paranoid checks were removed in this classification-only change, so there are no newly accepted runtime edge cases. Existing delivery authority and destructive compaction authority checks protect real effects and are retained.
Evidence
Base:
f90f26f638091ef505ebd7b96201b8c32a0d5cc0. Counts below are static SQL call expressions, not statements per turn.All 67 assigned calls were traced. Class (a): four reclassified worker calls. Class (e): one worker/maintenance call. Classes (b)/(c): no runtime cutover or deletion in this PR. The remaining 62 retain released compatibility and/or the real-effect authority paths described below; they are not declared worker-only. No schema, SDK, update, Doctor, plugin loading, or service lifecycle changes, so SDK API diff and update-cell proof do not apply.
Validation: changed-file oxfmt and oxlint,
git diff --check; independent Codex source review (no findings); complete base census and regenerated inventory. Independent generated-document review also passed (no P0/P1 findings). Final-head CI 38953368492 passed (31 successful jobs): changed-file format/type-aware lint, production/test types, source/export-collision contracts, Madge (zero cycles), T1/dialect ratchets, docs, and selected tests including all eight worker-ratchet cases. CI omitted Knip, so the exact-head local export scan ran through the campaign proof slot. It reported 11 production, five full-tree, and two script findings, all reproduced by scheduled main dependency job 117157269800 atd401ad3409e4d0f19a7740568cd7a5536fd9d30d; all 13 finding-source, scan-rule/config, and lockfile blobs match. No changed-file finding. The authorized inherited-static exception is used and the evidence is routed to the campaign's red-main owner. LOC: 31 source lines added for evidence; zero production/test lines changed; generated document +143/-141 (mostly table padding and stale baseline line metadata). The generator also refreshes four already-moved boot calls: the actual base has T2=392/W=1325, while the old committed document still said T2=396/W=1321. This PR itself moves four calls to W and one to T3.Complete assigned-file trace and retained boundaries
All paths below are under
src/config/sessions/.sqlite-*denotes thesession-accessor.sqlite-*family. These are call-site totals; shared kernels can have both worker and native callers.SessionManager.removeTrailingEntriesruns the native suffix generator; async removal uses the maintenance worker.runNativeunder!isMainThread.appendMessageWithMessageSequenceremains exposed by the released Codex mirror lock callback. Pure in-memory sequence accessors do not make this query worker-only.SessionManager.persistwith caller-checked idempotency.onAgentRunStartcallback can omit prepared transcript facts and select native watermark fallback; other native entry/replacement bookkeeping shares it.SessionManager.persistandappendMessageToTranscriptretain native snapshot persistence.Worker anchor-kernel entry points are session-entry-read.worker, session-entry-cohort.worker, session-transcript-hydration-read.worker, session-history-read-operation.worker, and openclaw-agent-execution-operations registered in openclaw-agent-execution.worker.
Real-effect authority follow-ups
src/infra/outbound/message-action-runner.tswraps persistence withwithSessionTranscriptWriteAssertion(..., () => assertMessageDeliveryCurrent(input), ...).captureExternalSessionCommitGuardmarks that plain callback native/opaque. Replay and fresh append insrc/gateway/internal-source-reply-persistence.tsretain it, soappendPreparedSessionTranscriptTurndeliberately rejects its worker route. The delivery owner must supply equivalent worker-compatible prepared authority before this native family can be removed. Stripping the callback or its native marker would weaken a real effect boundary.sessions.compactretains native request authority for supported in-process dispatch. The compaction adapter selects native commit for opaque authority and reaches full transcript replacement, event deletion, reaction pruning, and index rebuild. This public dispatch API is not deprecated. Its request-authority owner must provide equivalent prepared authority before deleting the native adapter; compaction modifies retained user data.chat-send-active-leaf.tsattempts a native relation read for incognito. Admission rejects the sentinel before SQLite. Its behavior is a separate cleanup; this PR only records that it does not execute the counted SQL.Released compatibility verification
Verified from stable tag
v2026.10.4in the full repository:agent-sessionsexportsSessionManager, including synchronouspersist,appendMessageToTranscript,removeTrailingEntries,appendMessageWithTranscriptAnchor, andresolveCurrentTurnEntryId;agent-harness-runtimeexportsrunAgentEndSideEffects;session-transcript-runtimeexports the lock and append APIs with synchronous preparation callbacks;codex-session-transcript-runtimeexports the mirror lock with sequenced append; channel runtime exposes synchronousresolveEntryResetFreshness; andreply-runtimeexports the olderGetReplyOptions.onAgentRunStartsignature without transcript facts. Their removal belongs to the separate SDK compatibility work. Retained shared kernels are not automatically relabeled T1-compat because callback escapes and native authority consumers remain.