Skip to main content

Module lifecycle

Module lifecycle 

Source
Expand description

Session lifecycle operations: locking, truncation, and UUID chain recovery.

Merges the former session_lock.rs (Goal 151 sentinel lock) with truncate_transcript_to_turn and read_last_message_uuid from session.rs during the Goal 221 module refactor.

Structs§

SessionLock
RAII guard preventing concurrent writes to the same JSONL session.
SessionLockBusy
Error type carried inside [std::io::Error::other] when SessionLock::acquire refuses because another live process holds the lock.
TruncateStats
Stats returned by truncate_transcript_to_turn.

Functions§

truncate_transcript_to_turn
Truncate transcript.jsonl (and the session’s .meta.json message_count) so that only the messages from turns 0..cutoff_turn survive.