Persistence, projections, and queries
Writes preserve the full log; reads use folds, checkpoints, watermarks, and indexes instead of replaying everything
durable log + projection checkpoints + query seamWhy should a session list not load the complete event log for every row?
A bank preserves the ledger but does not recompute every balance from account opening. It reads a trusted checkpoint and replays only the tail.
Mechanism
The session-persistence seam owns durable backends such as JSONL or SQLite and explicit flush. checkpoint-policy establishes durability boundaries at requests, turn ends, and detach points.
session-projection registers domain fold units, while projection-cache stores state and watermarks. Cold reads use cached row plus durable tail replay. session-query provides exact reads, filtering, traces, and full-text search.
Append in memory
Session first commits the authoritative event.
What extensions must preserve
- Durable writes preserve event seq and JSON fidelity
- Caches are reconstructable accelerators, not truth
- List reads should not require full-log loading
The tempting wrong turns
- ×Assuming turn/end implies a completed flush
- ×Treating projection cache as irreplaceable state
- ×Letting search results bypass workspace authorization
Do not trust the conclusion—verify it
These anchors are pinned to official deepseek-harness@47f9438; account for later breaking changes when reading current upstream.
Pause for ten seconds before revealing
Why must a projection checkpoint include a watermark?
A durable system still needs explicit failure semantics. Next we unify cancellation, timeouts, structured errors, and quiescence invariants.