Skip to content

Track core session/transcript SQLite migration via accessor seam #88838

Description

@jalehman

Current status (2026-06-28)

Path 3 has consolidated from the historical 3.1b / 3.2 stack into one active SQLite storage flip line.

Active queue

Phase PR / branch Status Next action
SQLite storage flip #96625 refactor: flip sessions and transcripts to sqlite storage Draft, active replacement lane Finish review/CI/proof on the flip PR. Treat it as the source of truth for remaining Path 3 implementation work.

Superseded / closed PRs

Old PR Disposition
#89178 refactor: add SQLite session store foundation Superseded by #96625. The old foundation split is no longer the review target.
#90437 refactor: add SQLite transcript identity adapter Superseded by #96625. The SQLite transcript identity/adapter work should be reviewed through the flip PR.
#90438 refactor: add SQLite embedded run target adapter Superseded by #96625. The embedded run target adapter work should be reviewed through the flip PR.
#88840 + #89120 Replaced by merged #90463.
#89261 + #89262 Replaced by merged #95030.
#89348 + #89360 Replaced by merged #95087.
#91491 Closed as superseded by the seam contract and SQLite flip work.
#89204 Closed unmerged after #90463 landed.
#89519 Closed unmerged after #90463 landed.

Durable plan

Track the core session/transcript runtime-state migration to SQLite through a storage-neutral accessor seam, with runtime state moving to SQLite and legacy JSONL/file reads restricted to doctor/import/archive workflows.

The original plan intentionally decomposed the migration so the accessor seam, caller adoption, SQLite store modules, and runtime flip could be reviewed separately. That decomposition worked for the 3.1b seam-adoption phase. As of #96625, the remaining implementation work is now consolidated into a single flip PR rather than the old 3.2 foundation/adapter PR stack.

Decisions still binding on #96625

  • Database-first runtime: after the flip, active runtime session/transcript reads and writes go through SQLite-backed accessors. There should be no runtime JSONL fallback reader for active sessions.
  • Doctor/import boundary: legacy file reads belong in migration/import/doctor/archive code, not steady-state runtime.
  • Archive-before-delete: migration and lifecycle cleanup must archive imported/deleted transcript artifacts before removing legacy files or rows.
  • One-way flip: no reverse migration or downgrade rescue ships with this flip. The merge bar is forward migration correctness plus clear operator proof.
  • Transcript lifecycle: SQLite is the hot canonical store. Archived JSONL artifacts are derived product artifacts and are not runtime fallback inputs.
  • SDK/file-surface cleanup: deprecated active-session file-shaped SDK surfaces should be removed as part of the flip, while explicit archive/import/export artifact handling remains allowed.

Acceptance criteria for the active flip lane

  • refactor: flip sessions and transcripts to sqlite storage #96625 owns the remaining Path 3 implementation and keeps the tracker current.
  • Active sessions and hot transcripts migrate to SQLite through idempotent startup/doctor paths.
  • Imported active JSONL files are moved out of their old runtime-readable locations after successful import/archive handling.
  • Runtime reads/writes active session and transcript state through the accessor seam only.
  • No active runtime fallback reads from sessions.json or transcript JSONL remain after the flip.
  • Reset/delete/maintenance paths archive before deleting rows or files.
  • Local/fresh-instance proof demonstrates startup migration, live gateway state visibility, full agent turn history, reset/delete/archive behavior, and no stale JSONL dependency.
  • Old 3.2 foundation PRs remain closed unless refactor: flip sessions and transcripts to sqlite storage #96625 is abandoned.

Metadata

Metadata

Assignees

Labels

P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.maintainerMaintainer-authored PRmaturity:stableIssue affects a taxonomy feature currently scored M4/M5.

Type

No type

Fields

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions