Files
openclaw-openclaw/test/scripts/sqlite-session-schema-baseline.test.ts
Josh Lehman f6ac2c1602 refactor: flip sessions and transcripts to sqlite storage
Squash-and-replay of sqlite/sessions-transcripts-storage-flip (361 commits,
old head 77665163bb) onto main @ 21f251220f, per the prep-series plan:
Phase 0/1 accessor-prep PRs (#101178-#101182, #101688, #101699) landed the
seam on main first, so this rebase reduces to the SQLite storage
implementation behind the session accessor.

Beyond the flip branch content, this merge:
- implements findTranscriptEvent (reverse-seq), recordInboundSessionMeta and
  updateSessionLastRoute over SQLite (deriveLastRoutePatch shared with the
  file-era store for doctor paths)
- adds cross-agent fork support (targetStorePath) so worktree/cross-agent
  sessions.create forks land child transcript rows in the target agent DB
- keeps main's newer behavior across the conflict surface (work admission,
  archive-gated deletes, preflight overflow budgeting, model fallback,
  replyOptions dispatch shape, lifecycle-header ordering)
- adopts the storage-neutral ContextEngineSessionTarget while preserving the
  deprecated CompactResult.sessionFile for shipped plugin readers

Known remainder (tracked for follow-up commits on this PR): ~415 test-case
failures across 43 files, dominated by stale vi.mock factories missing
main-side exports; prod typecheck, full build, and boundary ratchet are green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 12:44:08 -07:00

3.8 KiB