refactor: add session entry lifecycle seam#89519
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 14, 2026, 12:48 AM ET / 04:48 UTC. Summary PR surface: Source +1071, Tests +928, Config +6, Generated 0, Other +146. Total +2151 across 30 files. Reproducibility: not applicable. This is an internal refactor/migration slice rather than a bug report with a current-main reproduction path; the relevant evidence is source inspection, focused tests, and real behavior proof before merge. Review metrics: 2 noteworthy metrics.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Keep this in the session/transcript SQLite migration stack, settle the base accessor PR, document the bulk helpers as maintenance-only, refresh conflicts, and add real gateway/TUI or CLI session proof before merge. Do we have a high-confidence way to reproduce the issue? Not applicable. This is an internal refactor/migration slice rather than a bug report with a current-main reproduction path; the relevant evidence is source inspection, focused tests, and real behavior proof before merge. Is this the best way to solve the issue? Unclear as merge-ready. The branch-by-abstraction direction matches #88838, but this draft still needs the maintenance-only helper doc fix, conflict refresh, and real behavior proof before it can be judged the best landable slice. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 231b5a14d5d7. Label changesLabel justifications:
Evidence reviewedPR surface: Source +1071, Tests +928, Config +6, Generated 0, Other +146. Total +2151 across 30 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
f18f99c to
b39023f
Compare
e5d1bab to
ddb5749
Compare
a13e0eb to
890d5e3
Compare
890d5e3 to
b496b4b
Compare
ddb5749 to
703abed
Compare
|
Follow-ups before land (from the post-revert currency review):
|
1e31abd to
094f9b5
Compare
9a55d1b to
58aa59e
Compare
What
Adds storage-neutral session entry lifecycle operations over the current file-backed store and routes representative lifecycle mutation callers through those operations instead of mutable whole-store callbacks.
Why
Path 3 needs delete, replace, scoped patch/delete, deleted-artifact archiving, and TUI/Gateway patch projection to be explicit domain operations before the SQLite storage flip. Arbitrary
updateSessionStore(store => ...)callbacks do not map cleanly to SQLite row operations and would keep the old JSON-store shape as the hidden runtime contract.Refs #88838.
Changes
src/config/sessions/session-entry-lifecycle.tssrc/config/sessions/session-entry-lifecycle.test.tssrc/cron/session-reaper.tssrc/commands/tasks.tssrc/plugins/host-hook-cleanup.tssrc/plugins/host-hook-state.tssrc/agents/command/attempt-execution.shared.tssrc/auto-reply/reply/commands-session-store.tssrc/gateway/sessions-patch.tssrc/tui/embedded-backend.tsTesting
node scripts/run-vitest.mjs src/config/sessions/session-entry-lifecycle.test.ts src/cron/session-reaper.test.ts src/commands/tasks.test.ts src/plugins/contracts/host-hooks.contract.test.ts src/agents/command/attempt-execution.shared.test.tsnode scripts/run-vitest.mjs src/gateway/sessions-patch.test.ts src/tui/embedded-backend.test.tsnode scripts/run-oxlint.mjs <touched files>pnpm tsgo:coregit diff --checkThis is file-backed and behavior-neutral. It does not add SQLite schema/store modules, production storage flip, runtime dual-read/fallback, doctor migration code, or a generic mutable whole-store runtime seam. Public SDK whole-store compatibility remains tracked separately in
clawdbot-d02.1.9.1.18.