Repository navigation
fix(sessions): reuse committed row facts during refresh - #169853
Conversation
Preserve Board and summary-watermark facts during entry enrichment, and trust ordered writer receipts when refreshing session rows. Remove duplicate global notification checks that discarded current facts and caused repeated SQLite reads.
|
🦞👀 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. What this changesThis PR reuses committed session-row facts across transcript notifications, snapshot enrichment, and pending actor commands. Example: A session with a current activity summary receives a transcript notification without a message ID.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it provides a useful performance fix absent from current main, with no actionable source defect found. Current-head CI failures remain unclassified. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherSQLite writers publish committed session facts into the bounded actor replica and Gateway row projection, which supply session-list presentation and fall back to worker reads when coverage is incomplete. flowchart LR
A[Session writes] --> B[SQLite writer]
B --> C[Committed receipts]
C --> D[Actor replica]
C --> E[Gateway row projection]
D --> E
F[Transcript notifications] --> E
E --> G[Session list]
Technical reviewBest possible solution: Use existing committed receipts and write-token invalidation to reuse complete row facts, retaining worker reads for missing coverage. Do we have a high-confidence way to reproduce the issue? Base source shows that message-less notifications reject retained summary facts and that entry enrichment drops projection coverage; the supplied workload records repeated reads through the affected refresh owner. Is this the best way to solve the issue? The change addresses redundant invalidation at existing owners, removes parallel bookkeeping, and preserves physical binding, scoped write-token checks, supersession, and unknown-outcome invalidation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b8d5b4b029a4. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -56, Tests -1, Docs +17. Total -40 across 10 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes: No label 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 HistoryReview history (5 earlier review cycles)
Reviewed October 12, 2026, 10:22 AM ET / 14:22 UTC (Revision 6). |
Keep the previous committed actor snapshot while a new command waits to execute. Evict stale facts without cancelling the pending receipt, so its complete postimage can install after commit.
Update the indexed timestamp and its entry JSON together while exercising committed-write invalidation. The previous fixture violated the stored-row invariant before replacement could publish its receipt.
) Reuse the session actor's committed entry, participant, Board, and summary-watermark facts when refreshing session rows. Preserve projection fields during entry snapshot enrichment and keep the preceding committed snapshot until the next actor write commits. Remove the process-wide transcript notification rechecks and duplicate row notification authority that discarded current facts. Keep scoped write-receipt invalidation and the existing authority checks at real effects; stale snapshot eviction must not cancel a pending committed receipt. Add regression coverage for combined publication, unrelated notifications, snapshot enrichment, and commit-to-receipt settlement. Document remaining shared transcript readers and measured scope in PR openclaw#169853.
What Problem This Solves
Session-list refreshes reread entry, participant, and summary-watermark facts that the Gateway already received from the same committed write.
User Impact
Session rows reuse committed facts during transcript updates and entry snapshot enrichment, reducing repeated worker reads without changing stored data, permissions, schema, or update behavior.
Why This Change Was Made
The entry publisher compared a process-wide transcript notification counter before exposing a receipt. Installing a combined entry/transcript receipt advances that counter itself, so the publisher could discard its own current watermark. The row projection separately correlated display notifications with another retained transcript-authority object. Message-less or delayed notifications therefore discarded usable facts.
Use the existing receipt owner: remove both global-counter comparisons and the duplicate notification authority, and retain the actor's Board/summary projection when entry reads add snapshot fields. Starting a new actor command also keeps the previous committed snapshot until a write changes its token; a stale reader evicts that snapshot without canceling the pending command's fresh receipt. Entry, participant display, and watermark facts remain covered by the same committed-write token. Physical source binding, keyed receipt supersession, membership revocation, and current authority at real effects remain enforced. No new cache, SQL, fencing, or worker handshake is introduced.
Removed checks and accepted edges:
Row.transcriptAuthority: a delayed or message-less notification may schedule an unnecessary refresh of the current row. Notifications never supply the stored watermark.Writer coverage remains with existing receipts/tokens: entry create/update/snapshots, aliases/reset/delete; owner/member/participant changes including count-only participant writes; Board changes; native session deletion; append/bulk/rewrite/import/suffix/compaction; cold archive/restore and projection rebuild; window/cascade deletion; raw fixture clears. Scoped writes invalidate the affected key/session; unscoped DML advances the token shared by every scope. Unknown outcomes revoke facts. The change preserves only previously current projection facts; it does not carry an old watermark across a new metadata-write token.
Related: #169748. Reuses the projection-watermark idiom from #169753 without changing its reply-tail implementation.
Evidence
Landing integration
Current head
8b6a8830f16b67fad3bb0cb5cc06f964d4c7b0cfmerges mainacc5395d48360aedc1dd7353085e1d9d315b3efcwithout conflicts or optimization changes. Current-head PR CI tests merge6535906e035a7fbb118c28f38683a7de616aaf7cagainst main157216b8e37486575e3217b297a49bcb12ffad6f. The run completed with 50 successful jobs, 24 skipped, and no failures, including its aggregate CI gate. Production/test types, type-aware lint, source contracts/export collisions, architecture/Madge, and T1/dialect ratchets passed. All three changed test files were included in the successful PR shard jobs: the preflight lists them, and changed runnable tests are mandatory in both aggressive selection and runtime filtering (including the PR-exempt accepted-facts test). No per-file integrated-run counts or timings are claimed. Earlier live measurements and review evidence below are retained as measured-head evidence, not relabeled as a new live run.The current-head Knip production scan reports only unused exported type
src/infra/directory-durability.ts: DurableDirectoryReceipt, identically reported by scheduled main at12d02f7a3eae579ab151b3c4c44e08a31bbd2f76. The offending file is byte-identical on the integrated base and head and is untouched by this PR. This inherited failure is recorded in the red-main repair inbox. The production scan covers all six changed production files and reports no lane findings. Its failure prevents the chained full-tree/unused-file/script scans, which are not claimed green; this lane changes no script/config/SDK export surface, adds/removes no files, and its three changed tests export nothing. The remaining optional manual workflow was canceled and confirmed stopped after preserving this result.Measured-head evidence
Measured head
d006ccf0a7b47496b15f96f0c7444cfa31ff74c2: all changed tests, required static checks, both Codex review rounds, and the final isolated Gateway workload passed. Production is byte-identical to build head0f0de4ce48c7ad4656778847909bd3fcefbc1a67; all 19 recorded source hashes matched after the run. The fullqaRuntimebuild passed in 2095.8 seconds. ClawSweeper's final-head review reported no findings.One baseline/final-candidate comparison uses the shared harness's same ten warmed turns, pinned baseline
242ef62b2645e24416f5d654c9af1176aec242f9and final head above. Counts include all Gateway threads and background work. The final run passed all 13 turns, control RPCs, child run, cron, compaction, and graceful shutdown in 190.2 seconds. Baseline completed all turns and lifecycle but its final all-RPC assertion failed becausementions.dismissreturnedUNAVAILABLE; its warmed measurements reconcile with native counters. No unloaded-host timing claim is made.readSessionRowDatabaseFactscalls/turn, meanThe targeted
session-row-factsoperation drops from 26 to 5.5 SQL statements/turn: 20.5 fewer statements and 4.1 fewer requests per warmed turn. Row-fact calls are one in nine warmed turns and two in one turn; the strict ≤1 target is therefore narrowly missed. Watermark reads include one remaining patch-commit predicate per turn, so its ≤1 total target is not reached.sessionRows.sharedFactsadditionally falls by 2.4 statements and 3.9 requests/turn. Whole-turn mean savings are 34.4 statements and 12.5 requests; these include scheduling-dependent background differences, not solely this owner change.All row-fact calls originate from
src/gateway/session-row-projection-refresh.ts:refreshBatch→readRows→session-row-database-facts.ts:withSessionRowDatabaseFacts, consuming the entry/participants/summary-watermark triple. Each costs five statements including its consistent-read transaction. Watermark reads are these row-fact reads plussession-entry-patch-guard.ts:readSessionEntryPatchPredicate. Remaining projection reads are hydration (2/turn), row backfill (1.8), anchor lookup (1), patch predicate (1), and activity-summary source (1); no request duplicates its projection read. Reuse across these requests requires cold/reset/index facts not carried by current receipts, so those consistent snapshots remain.Actor hydration rises by six SELECTs across the ten warmed turns (6.0 → 6.6/turn). Standalone
session.actor.readrequests/hydrations rise 40 → 44. With command counts unchanged,deliverySettledhydrations rise 6 → 9 andadoptRun0 → 1, whileappendTranscriptEventfalls 14 → 12. The complete +0.6 is retained in the net savings above; it is not dismissed as noise.Every standalone hydration in both runs follows canonical native mutation statements since the preceding actor completion. Final delivery hydrations generally follow
completeTurn→ usage release → entry patch; the adoption hydration follows a memory-cache write.src/config/sessions/session-actor.worker.ts:readrehydrates when the resident's scoped write token differs.src/infra/sqlite-database-write-receipts.ts:scopedWriteTokenincludes the unscoped revision, so usage/memory writes can invalidate the resident;session-actor.worker.ts:prepareEntryPatchcannot preserve an already stale resident. These owners andsrc/config/sessions/session-actor-sqlite.ts:readare unchanged by this PR. However, removing awaited reads can change execution order, and the trace records executed mutations rather than affected-row counts or token values. This establishes a plausible mechanism, not independence from this change.Known tradeoff: actor hydration +0.6 reads/turn, owned by the exactentry lane's actor-hydration investigation.
The coordinator explicitly approved landing with this disclosed cost on 2026-10-12; it is included in the measured net reduction above.
The final fixture required a documented startup adaptation. Two attempts timed out during first-time pairing at the unchanged 15-second handshake deadline, before any turn. A task-local harness copy now calls the existing
requestDevicePairingandapproveDevicePairingAPIs before Gateway startup, closes that isolated state owner, and then uses the original nonce/signature/role/scope handshake. The shared harness, production code, runtime deadlines, and measured workload are unchanged. The first pre-paired attempt exceeded the unchanged 300-second readiness deadline under heavy host load; waiting for load ≤80 and entering the canonical five-slot gate produced a successful run (Gateway ready in 63.64 seconds).Pre-pair setup is separately instrumented and included in the raw whole-workload totals: 1,637 SQL statements and 2,324 sends, of which 2,320 are the TypeScript loader's compiler traffic and four are owner open/request/approve/close operations. This explains the raw whole-request increase; none occurs in a warmed turn. Pre-initializing shared state also moves startup work out of Gateway MAIN, so its whole-workload decrease is not claimed as a production improvement. The warmed MAIN count is unchanged; its two statements across ten turns are unrelated GitHub OAuth maintenance. All fixture processes exited, the harness directory was removed, and the proof slot was released.
T1: changed row-fact/receipt owners 0 → 0. Shared transcript readers retain 8 → 8 flagged call sites: active-context 6, projection-read 1, watermark wrapper 1. These still serve released synchronous
SessionManagerAPIs, process-held incognito paths, the CLI history effect guard, and the legacy SDK reply-start adapter. Moving those calls requires their API/owner cutover; they remain explicitly flagged under the requested escape hatch, not reclassified as worker-only. Baseline global inventory: 537 T1 calls in 200 files.Regression coverage extends existing tests for combined entry+transcript receipts, unrelated/message-less notifications, and actor snapshot enrichment followed by an in-process append. Existing tests retain native owner/replacement/delete, participant count-only, raw write, rollback, archive, and membership-revocation coverage. The old synthetic callback-interleaving matrix was removed with its duplicate check.
Diff: 10 files, +163/−203 lines (production −56 net).
Basic scoped oxfmt/oxlint and
git diff --checkpassed. Both Codex autoreview rounds completed clean, with no actionable P0–P2 findings. The final two-line test-fixture correction keepsupdated_atandentry_json.updatedAtconsistent in the native transaction; it changes no production code and passed the final actor test run.Measured-head PR CI passed all production/test type stripes, lint, source contracts/export collisions, Madge, T1/dialect ratchets, guards, boundaries, docs, and build. It tested merge
6f20a979into main8f164a15f2d6ffaf06ba48e6932a5dc3f8b7768f. Exact-head Knip passed all three export scans with zero entries (about 158 seconds). The remaining duplicate manual workflow was canceled and confirmed stopped after this evidence was saved.session-actor-replica.test.tssession-accessor.sqlite-replacement-receipts.test.tssession-row-projection.accepted-facts.test.tspnpm test src/gateway/session-row-projection.accepted-facts.test.ts --maxWorkers=1: 24 passed, exit 0The local single-file run supplied the one missing final-head result. The manual CI job containing it stopped in an earlier, unrelated
server.agent-artifact-apis.test.ts:515config during agent deletion/resource drainage; its stop-on-failure setting never invoked the accepted-facts config. This is an observed optional-manual failure, not a claimed matching main failure. The focused run's unusually long wall time includes 535.026 seconds of cold worker preparation and heavy-host module transforms; it is not the cost of the added assertions alone. No broad local suite or remote lease was used. There is no SDK surface change or update/Doctor/migration/plugin-loading/service-lifecycle change, so no SDK diff or published-driver update cell is required.The earlier measured-head aggregate PR gate was red for seven Bun installer HTTP 504 failures before test execution and one inherited assertion:
session-utils.metadata-perf.test.ts, “rebuilds resident thinking facts on config and catalog publication,” expectshighand receivesmediumat line 168. Scheduled main, SHA70885c1bbbdaa930ab085d28af40c55dde87fffa, fails the same assertion. It is recorded in the campaign's red-main repair inbox. This PR does not modify that file.The earlier measured-head Security High / network-ssrf-boundary also stopped before analysis because both CodeQL CLI download paths returned HTTP 504. It produced no security finding.
security-fast, all other Security High categories, andopenclaw/security-sensitive-reviewpassed. The documented infrastructure/inherited failures qualify for the authorized relaxed landing policy; the failed jobs are not represented as green. The coordinator approved the disclosed hydration tradeoff described above; the final live workload passed.Writer coverage audit (source and existing regression contracts)
S/meanssrc/config/sessions/;G/meanssrc/gateway/. These tests were source-inspected; execution evidence is reported above.Receipt and invalidation contract
src/infra/sqlite-database-admission.ts:beginSqliteDatabaseWriteandfinishSqliteDatabaseWritesettle the shared in-process write receipt. Scoped writes advance the affected logical-key/session-ID tokens; unclassified writes invalidate all scopes. Failed or rolled-back writes may conservatively invalidate facts.S/session-actor-replica.tscomparesreadSqliteDatabaseScopedWriteTokenForPathfor the logical key and dependent physical session IDs before reusing retained facts. This is an in-memory receipt lookup, not a SQLite freshness query.The direct infrastructure regression is
src/infra/sqlite-database-admission.worker.test.ts— "shares exact session receipts with existing writer isolates and fences unclassified writes". It checks targeted invalidation, dependency registration visible to an existing worker, and unclassified raw-write invalidation of both cached scopes.Complete row facts must come from one database snapshot or one complete accepted receipt. A partial entry, owner, membership, participant, or transcript publication does not certify that the other members of the triple are unchanged. A transcript-content receipt marked unchanged also does not certify unchanged hot/cold/index state.
Entry, sharing, Board, and deletion writers
file:functionroutesS/session-accessor.sqlite-entry-store.ts:writeSessionEntry;S/session-accessor.sqlite-entry-worker-publication.ts:retainSessionEntryWorkerPublicationand its returnedsettle/settleMetadataoperationstrackSessionEntryCacheWriteandpublishSessionEntryCacheInvalidation; complete worker publication can install committed postimages.S/session-actor-replica.test.ts— "retains a new session's committed entry before its first reader and invalidates later writes"; "invalidates for native owner, replacement, transcript and deletion writers". Publication:S/session-accessor.sqlite-replacement-receipts.test.ts— "seals native metadata before observers for %s"; "publishes %s category changes to retained authority before observers"; "preserves a replacement receipt across another session's transcript notification".S/session-accessor.sqlite-entry-store.ts:deleteLegacySessionEntryRows,rehomeSessionWindows,deleteSessionEntryRows;S/session-accessor.sqlite-node-artifacts.ts:copySessionNodeArtifactsForRepair,clearSessionCollaborationForKey,deleteSessionMembersForRepair,deleteSessionNodeArtifactsS/session-actor-replica.test.ts— "retains unrelated session postimages but invalidates a shared physical session window". Publication:S/session-accessor.sqlite-replacement-alias-publication.test.ts— "publishes rehomed membership while preserving newer native metadata (%s)"; "retires a removed alias before observers without replacing a newer alias (%s)"; "preserves shared-window exclusion provenance across canonical replacements".S/session-accessor.sqlite-owner.ts:replaceSessionOwnerInTransaction,assignSessionOwnerS/session-actor-replica.test.ts— "invalidates for native owner, replacement, transcript and deletion writers"; "shares committed facts across released handles and retires them for writes and worker loss". Publication:S/session-sharing-store.worker.test.ts— "publishes a committed owner assignment through an unrelated %s invalidation".S/session-sharing-store.native.ts:addSessionMember,removeSessionMember,publishCommittedSessionMembershippublishSessionSharingMemberChange; live sharing authority checks remain at the disclosure/effect boundary.S/session-actor-replica.test.ts— "invalidates partial native publications before disclosure and count-only participant writes through the shared receipt". Publication:S/session-sharing-store.worker.test.ts— "commits aliased worker membership and participant facts before publishing, and rejects stale authority";S/session-accessor.sqlite-replacement-receipts.test.ts— "publishes revocation before observers with a member write %s".S/session-accessor.sqlite-participants.native.ts:recordSessionParticipant,recordSessionParticipantFromWorker, privaterecordSessionParticipantWithAliasReadtrackSessionEntryCacheWrite;publishSessionEntryCacheParticipantUpdatemay reportprojectionChanged: false, but the committed-write token still advances. Count/timestamp changes therefore retire a cached triple even without a display delta.S/session-actor-replica.test.ts— "invalidates partial native publications before disclosure and count-only participant writes through the shared receipt" checks contribution count 1, second-write invalidation, then count 2 and its new timestamp. Publication:S/session-accessor.sqlite-participants.test.ts— "reuses current participant facts when publishing repeated entry patches"; "keeps a reentrant observer's newer cached state after an outer %s write"; "publishes fresh participants after an untracked %s write during patch preparation".src/boards/sqlite-board-store.kernel.ts:applyBoardOpsToDatabase,putBoardWidgetInDatabase,grantBoardWidgetInDatabase; worker ownersrc/boards/sqlite-board-store.worker.ts:bindSqliteWorkerBackend/ returnedexecutesrc/boards/sqlite-board-store.tsemits them after worker settlement. Entryfacts: {kind: "unchanged"}does not mean Board state is unchanged.src/boards/sqlite-board-store.worker.test.ts— "executes Board mutations off the host and publishes each committed change once". Accepted-facts contract:G/session-row-projection.accepted-facts.test.ts— "keeps Board and shared facts while transcript receipts advance summary freshness"; "replaces accepted entry, board, and watermark facts through a worker receipt".S/session-native-binding.ts:deleteSessionWithNativeBindingsInWorker;S/session-native-binding.worker.ts:deleteSessionWithNativeBindingsrunSessionNativeBindingTransactionowns deletion/reclamation; collected changed/removed keys feedprepareSessionEntryReplacementPublication, including membership invalidation and transferred committed candidate.S/session-native-binding.test.ts— "deletes only the requested Codex binding owner through the host worker"; "deletes the session without leaving a %s Codex binding row"; "uses each installed plugin owner's packaged codec during real binding deletion"; "settles a shipped Agents API binding in the worker (rollback: %s)".S/session-native-binding.reclamation.test.ts— "settles typed reset and native reclamation without replacing a successor (%s)"; "reclaims lifecycle artifacts with the native veto off the caller thread".S/session-accessor.sqlite-entry-store.ts:deleteSessionEntryRows,deleteLifecycleTargetRows;S/session-accessor.sqlite-entry-clear.ts:clearSqliteSessionEntryPreservingWindowsS/session-actor-replica.test.ts— "invalidates for native owner, replacement, transcript and deletion writers". Cross-handle/publication:S/session-accessor.sqlite-lifecycle-publication.test.ts— "publishes removal invalidations before identity and row observers without archive intent" warms writer/reader caches and checks invalidation before observers.S/session-accessor.sqlite-lifecycle-state.ts:deleteMaterializedSessionStatePlans, privatedeleteSqliteSessionStateRows,deletePlannedLifecycleArtifactEntriessession_windows; canonical transcript rows cascade. Logical-key/session-ID dependency receipts cover retained facts.S/session-accessor.sqlite-lifecycle-publication.test.ts— "publishes history changes only after deletion while fresh reads observe sibling protection"; "publishes removal invalidations before identity and row observers without archive intent".S/session-accessor.sqlite-maintenance-store.ts:applySessionEntryMaintenanceInDatabase(publicapplySessionEntryMaintenancewrapper)writeSessionEntryand its existing scoped invalidation/publication.S/session-actor-replica.test.ts— "retires a resident session when native maintenance archives it".Transcript, projection, and cold-storage writers
file:functionroutesS/session-accessor.sqlite-transcript-store.ts:appendTranscriptEventInTransaction,appendTranscriptEventsInTransaction,replaceSqliteTranscriptEventsInTransaction,rewriteSqliteTranscriptEventRowsInTransaction,updateSqliteTranscriptEventJsonInTransaction,insertTranscriptRowsWithoutProjectionInTransactionSessionTranscriptAuthority.S/session-actor-replica.test.ts— "invalidates for native owner, replacement, transcript and deletion writers"; "reuses list facts and invalidates summary watermarks after transcript writes". Real persistence/publication:S/session-transcript-authority.test.ts— "publishes the committed context through SessionManager %s persistence before completion" exercises append, anchored append, custom/info/message/label entries, compaction, reset boundary, leaf/branch, trailing removal, persist, static append, and prepared rewrite/commit in native and worker modes. Also "installs final transcript facts before entry observers and discards nested rollback contributions" and "publishes worker initialization and branched entry metadata with the transcript before observers".S/session-accessor.sqlite-transcript-state.ts:ensureTranscriptGenerationInTransaction,rotateTranscriptGenerationInTransaction,ensureTranscriptSessionRoot,advanceTranscriptMutationAtInTransaction,touchTranscriptMutationInTransaction,deleteTranscriptEventsInTransactionS/session-accessor.sqlite-transcript-watermark.test.ts— "shares projection facts until a native write changes their snapshot" changes generation and observes the new value; also adds a cold row and checks hot-read refusal. "binds each session again after appends, rewrites, and missing-session reads" covers subsequent binding reads.S/session-accessor.sqlite-transcript-suffix.ts:replaceSqliteTranscriptSuffixInTransactionS/session-accessor.sqlite-transcript-store.test.ts— "preserves an intervening append before replacing prefix %i"; "reparents a retained compressed opaque suffix while preserving payload and rollback"; "preserves the established idempotency owner across retained suffix rows".S/session-manual-compact.kernel.ts:applyManualCompactInTransactionwriteSessionEntryoccur in one owner transaction; accounting/bindings are cleared in the same operation.S/session-manual-compact.worker.test.ts— "trims through the worker and clears accounting without host data SQL"; "rolls back transcript and accounting when host authority closes at commit"; "rolls back the native manual trim when accounting cannot be cleared". Compaction authority publication is additionally exercised by the SessionManager test above.S/session-accessor.sqlite-import.ts:importSqliteSessionRowsBatch,importSqliteSessionRowsInTransactionS/session-accessor.sqlite-import.test.ts— "deduplicates existing and incoming bytes and identities, preserves aliases, and reruns idempotently"; "preserves a current session introduced after staging while importing unrelated rows".S/session-cold-storage-worker.ts:mutateSessionColdTranscriptInWorkercold-batchwrites cold archive and deletes hot events/index; externalization changes storage/blob; restore inserts event/identity/active/index/FTS rows then deletes cold row. All are session-ID scoped. Unchanged transcript-content authority preserves content identity but does not preserve cached hot/cold/index state; shared write token invalidates it.S/session-cold-storage.test.ts— "archives several inactive sessions in one maintenance pass and restores both exactly"; "preserves cold metadata, refuses synchronous history and retention deletion, and restores on async read"; "externalizes a backup-embedded archive without restoring or rewriting its history"; "archives an inactive current transcript and restores its original bytes before appending". Publication:S/session-cold-storage.publication.test.ts— "publishes the committed key exactly once after the worker settles, without host SQLite".S/session-transcript-index.ts:createTranscriptIndexAppenderInTransaction,markSessionTranscriptIndexDirtyInTransaction,deleteSessionTranscriptIndexInTransaction,replaceSessionTranscriptIndexSuffixInTransaction,reconcileSessionTranscriptIndexInTransaction,deleteOrphanedTranscriptIndexRowsInTransactionS/session-accessor.sqlite-transcript-store.test.ts— "applies exact bindings across both storage arms"; "rolls back payload-arm changes and mutation state on later conflict"; "rebuilds changed $name facts without duplicate FTS invalidation"; "avoids duplicate FTS invalidation for maintenance text repair and preserves recency". Reconciliation publication is covered below.S/session-transcript-projection-rebuild.ts:claimPreparedSessionTranscriptProjectionInTransaction,deletePreparedSessionTranscriptProjectionChunkInTransaction,appendPreparedSessionTranscriptProjectionChunkInTransaction,finalizePreparedSessionTranscriptProjectionInTransaction;S/session-transcript-projection-publication.worker.ts:bindSqliteWorkerBackend/ returnedexecuteS/session-transcript-reconcile.publication.test.ts— "publishes the session change only after finalization commits" forces failure with a trigger, verifies no publication, then verifies successful committedneeds_rebuild: 0. Projection contract:S/session-transcript-projection-rebuild.test.ts— "projects one deterministic active branch for both rebuild owners".Raw fixture clear and coverage limit
src/agents/command/attempt-execution.cli.test-support.ts:resetCliAttemptFixtureDatabasescallsrunOpenClawAgentWriteTransactionwith operationtest.attempt-execution.reset, then uses rawdb.execto deletesession_transcript_fts,session_transcript_fts_rows,session_nodes,conversations,auth_profile_store,auth_profile_state, andcache_entries.src/agents/command/attempt-execution.cli.test.ts:afterEachfirst clears the session-store cache and then invokes this helper. The raw/unclassified write receipt invalidates every scoped actor token, including node-cascade transcript dependencies.No dedicated stale-row-cache regression directly invoking this fixture reset helper was found. The infrastructure regression "shares exact session receipts with existing writer isolates and fences unclassified writes" proves the underlying raw-write invalidation mechanism; suite cleanup invoking the helper is not itself a stale-cache regression.
Coverage labels above are intentional: direct cache regressions assert reuse followed by invalidation/reload; persistence/publication tests exercise real writers and committed facts but do not all assert the new actor-held triple. This inventory does not claim one direct actor-cache regression for every individual writer class.