kcode-k1-chat-persistence 0.6.1

KTO-backed durable persistence for K1 chat sessions
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
# kcode-k1-chat-persistence 0.6.1

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.6 `Batch` through K1 Peering. Persistence owns KTO submission and callback correlation, cursor durability, first-callback reconciliation, poisoning, and reorganization cleanup. Compatible Store 0.6 owns the per-session JSONL projection, while Records 0.5 owns codec-v2 record encoding and canonical session validation.

Version 0.6.1 changes only compatible internal dependency selection: it adopts Store 0.6.1 and Chatend 0.8.2 in tests without exact patch pins. Persistence behavior, codec-v2 bytes, callbacks, cursor format, filesystem layout, public APIs, and failure semantics are unchanged.

Ordinary open-format boxes, including empty Agent Responses and preflight System Messages, Tool Calls, and Results, use the unchanged generic codec-v2/KTO/JSONL path. There is no special record, migration, legacy reader, retry path, or compatibility branch.

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. KTO commitment, callback success, and durable materialization remain distinct states. A reorganization discards all derived session files and cursor state and leaves the live driver faulted.

Crate publication, downstream adoption, Server integration, deployment, and observed live behavior remain separate from KTO commitment and callback/materialization.