Skip to main content

Crate entelix_session

Crate entelix_session 

Source
Expand description

§entelix-session

Session-as-event-SSoT (invariant 1). Defines SessionGraph with events: Vec<GraphEvent> as the only durable audit truth, plus fork semantics and archival watermarks. The persistent companion is the SessionLog trait — concrete impls live in entelix-persistence.

Per F1 mitigation, this module is distinct from the runtime entelix_core::events::EventBus: the bus is fire-and-forget ephemeral pub-sub, this module is the durable replay source.

Structs§

CompactedHistory
Compacted view over a SessionGraph’s event log.
HeadDropCompactor
Reference compactor: drop oldest turns until the rendered character count fits under budget_chars. Tool round-trips stay paired by construction; the strategy never partially includes a turn.
InMemorySessionLog
In-process SessionLog for single-binary deployments and tests.
SessionAuditSink
Adapter that fans AuditSink::record_* calls into a durable SessionLog.
SessionGraph
Append-only event log for a single conversation thread.
ToolPair
One matched ToolCall / ToolResult pair. Sealed: the only path to construction is Compactor::compact internal grouping, so a pair without both halves cannot exist.

Enums§

GraphEvent
One audit-log entry.
Turn
One turn in a compacted conversation. Sealed so a Turn::Assistant can only carry ToolPairs constructed via the compactor’s internal grouping code (paired calls + results).

Traits§

Compactor
Operator-supplied compaction strategy.
SessionLog
Persistent durable session-event log.

Functions§

messages_char_size
Character-length proxy for the token cost of a message slice. Same metric HeadDropCompactor uses to compare against budget_chars, so threshold-driven auto-compaction can use the same yardstick.
messages_to_events
Render an in-flight Vec<Message> (the shape an agent’s working state carries) into a Vec<GraphEvent> that Compactor::compact can consume. Inverse of CompactedHistory::to_messages.