# kcode-k1-chat-persistence 0.3.0
This library binds K1 chat session records to one process-lifetime `k1-chat-persist` KTO subsystem registration. A single durable cursor covers every session, while cloneable session handles independently reserve at most one local commit per session.
`persist` commits one deterministic Store 0.3 `Batch` through K1 Peering. Records use the Records 0.2 codec-v2 generic-box representation: every box preserves its open `type`, opaque `contents`, `hidden_type`, and `hidden_contents`, including unknown kinds. It does not write a session projection directly. There is no codec-v1 reader, migration, reset, or compatibility path in this package.
The synchronous KTO callback decodes and materializes every canonical local or remote batch, synchronizes the affected JSONL file, atomically replaces and synchronizes the global cursor, and only then supplies local callback evidence. The first callback after each startup enables Store reconciliation for interrupted projection appends.
KTO commitment, callback success, and durable materialization are distinct states. A matching committed-error may be resolved by callback evidence; missing or conflicting evidence after a reported commitment faults the driver rather than causing a retry. Callback, projection, or cursor failures also fault the complete driver.
A KTO reorganization discards all derived session files and cursor state and leaves the live driver faulted. Recovery requires a cold restart and replay from genesis. These projections and the cursor are derived from canonical KTO history; they are not independent sources of truth.
Crate publication, downstream adoption, Server integration, deployment, and observed live behavior are separate from KTO commitment and from callback/materialization. This package's managed check establishes only source validation and tests; it does not publish or adopt the crate.