Files
deepseek-harness/packages/session-persistence
Hypatia May 828c3f85c9 fix review findings: skip collided SCHEMA_VERSION 3; reject marker-less surface events
P1: both merge parents shipped SCHEMA_VERSION=3 for different layouts (surface
columns vs seed_length), so an on-disk 3 was ambiguous and wrongly accepted.
Bump to 4 (merged layout) so the version check rejects both sibling v3s.

P2: a surface-eligible event with no surfaceOp lands in the log but vanishes
from deriveMessages() (surface is the sole derivation path). The typed append
overload enforces the marker only when the type arg is a literal; it collapses
to optional when widened to the union (a caller iterating raw events). Guard at
runtime in both append() and the seed constructor — no backward-compat for
surface-less logs. Shared seed fixtures carry surfaceOp explicitly and the
appendLog helper forwards it verbatim (no synthesized default). Exports
isSurfaceEligibleType. Regression tests for all three, each verified to fail
on the unfixed code.

Gates: typecheck, test (1115), snapshot (14), doc-sync, lint, build, hygiene green.
2026-06-24 17:45:48 +08:00
..

session-persistence/ — persistence capability family

The durable session-persistence seam and its storage backends. The interface package owns the abstract SessionPersistence service and the shared write coordinator; the backends are concrete implementations that register on ctx.sessionPersistence. All product packages.

Package Role ctx key
session-persistence/ Persistence seam + shared write coordinator ctx.sessionPersistence
session-persistence-jsonl/ JSONL-sidecar persistence backend (registers ctx.sessionPersistence)
session-persistence-sqlite/ SQLite persistence backend (registers ctx.sessionPersistence)

The interface lives at session-persistence/session-persistence/; backends are flat siblings. A new storage backend joins here and registers on ctx.sessionPersistence. See session persistence.