Expand description
Talos session management — append-only session logging with tree-branching support.
Sessions are stored as append-only files, organized by working directory.
New sessions use the compact text .tlog format by default; existing .jsonl
files are read transparently for backward compatibility. Each line in a session
file represents a SessionEntry with fields for id, parent_id,
timestamp, role, content, and optional metadata.
§Directory Layout
~/.talos/sessions/
<project>/
<uuid>.jsonl§Branching Model
Each session supports multiple branches. A branch is a linear sequence of entries
rooted at a specific entry. The fork method creates a new branch from any existing
entry, enabling tree-structured conversations.
§Crash Safety
JSONL is append-only. If a crash occurs, only the last line may be corrupted, which can be detected and skipped during reads.
§Backward Compatibility
Entries without id or parent_id fields (from older JSONL files) are treated
as part of a single linear branch. They are assigned synthetic IDs on load.
Re-exports§
pub use sqlite::ForkInfo;pub use sqlite::IndexError;pub use sqlite::SearchResult;pub use sqlite::SessionIndex;pub use todo::CreateTodo;pub use todo::TodoAddDependencyTool;pub use todo::TodoCreateBatchInput;pub use todo::TodoCreateBatchTool;pub use todo::TodoCreateInput;pub use todo::TodoCreateTool;pub use todo::TodoDeleteInput;pub use todo::TodoDeleteTool;pub use todo::TodoDependency;pub use todo::TodoDependencyInput;pub use todo::TodoError;pub use todo::TodoItem;pub use todo::TodoPriority;pub use todo::TodoQuery;pub use todo::TodoQueryInput;pub use todo::TodoQueryTool;pub use todo::TodoRemoveDependencyTool;pub use todo::TodoRepository;pub use todo::TodoStatus;pub use todo::TodoUpdate;pub use todo::TodoUpdateBatchInput;pub use todo::TodoUpdateBatchTool;pub use todo::TodoUpdateInput;pub use todo::TodoUpdateStatusInput;pub use todo::TodoUpdateStatusTool;pub use todo::TodoUpdateTool;pub use todo::status_icon;
Modules§
- compaction_
engine - Session compaction engine — freezes segments, applies rules, archives (ADR-037 Mechanism B).
- sqlite
- SQLite-based full-text search index for session messages.
- todo
- Session-scoped todo storage for orchestration state.
Structs§
- Compact
Text Session Store - Compact text session store implementation.
- Durable
Session - A UUID-backed durable session bound to an opaque host external ID.
- Durable
Transcript Entry - One normalized, cursor-addressable durable transcript entry.
- Jsonl
Session Store - JSONL-based session store implementation.
- Orphan
Sidecar Failure - One reconciliation failure retained without aborting the whole bounded pass.
- Orphan
Sidecar Reconciliation Policy - Safety policy for bounded orphan-sidecar reconciliation.
- Orphan
Sidecar Reconciliation Report - Result of scanning Session roots for transcript-less pending SQLite artifacts.
- Pending
Submission Record - Exact durable record returned for Actor recovery.
- Pending
Submission Store - SQLite sidecar that stores accepted but uncompleted Session work.
- Persistence
Policy - Controls what a durable embedded transcript is allowed to retain.
- Provider
Terminal Diagnostic - Session
- A single session, backed by a JSONL file, with support for tree-branching.
- Session
Artifact Cleanup Report - Successful deletion details for one Session-owned artifact operation.
- Session
Branch - A linear branch within a session.
- Session
Capabilities - Format capabilities exposed to embedded hosts.
- Session
Cleanup Candidate - A session selected by a cleanup policy.
- Session
Cleanup Policy - Policy for selecting session cleanup candidates.
- Session
Cleanup Report - Result of applying a session cleanup policy.
- Session
Entry - A single entry in a session branch.
- Session
Info - Information about a session, returned when listing sessions.
- Session
Manager - Manages sessions on disk.
- Session
Metadata - Metadata associated with a session entry.
- Session
Runtime Activation - Immutable logical activation identity.
- Session
Runtime Identity - Exact declarative model identity owned by one durable Session.
- Session
Runtime State - Current durable Session runtime state.
- Tool
Output Compression - Result of applying threshold-based compression to a tool’s output.
- Transcript
Entry - A flattened transcript entry suitable for export.
- Turn
Commit - Result of an idempotent durable turn commit.
- Turn
Transcript Outcome Record
Enums§
- Pending
Submission Error - Failure while reading or mutating pending-submission custody.
- Provider
Terminal Outcome - Provider
Terminal Source - Session
Error - Errors that can occur during session operations.
- Session
Runtime Activation Status - Whether a staged activation has crossed the transcript marker barrier.
- Turn
Transcript Outcome - Durable proof of the terminal transcript outcome for one runtime Turn.
Constants§
- DEFAULT_
MAX_ ORPHAN_ SIDECAR_ ENTRIES - Default maximum number of filesystem directory entries inspected in one pass.
- DEFAULT_
ORPHAN_ SIDECAR_ MINIMUM_ AGE - Default grace period before a transcript-less sidecar can be reconciled.
Traits§
- Session
Store - Trait abstracting session entry persistence.
Functions§
- compress_
tool_ output - Compress tool output based on a byte-length threshold.
- export_
json - Export session entries as a structured JSON array.
- export_
markdown - Export session entries as a human-readable Markdown transcript.
- read_
transcript - Read a session file via the given store and return transcript entries.
- remove_
session_ artifacts_ for_ transcript - Removes the complete Session-owned filesystem set with transcript last.
- remove_
session_ sidecars_ for_ transcript - Removes WAL, SHM and pending SQLite in that order while retaining the transcript.
- remove_
session_ transcript - Removes only the transcript, the final discoverability commit point.
- todo_
tool_ contributions_ for_ sessions_ dir - Builds the complete session-bound todo tool group for an explicit sessions directory.