pub struct SessionEventLog { /* private fields */ }Expand description
Canonical append-only event log for a single session.
All session history is reconstructable from this log. Live conversation state is never read back into context from here; the log is only consumed for revert, compaction, analytics, and long-term-learning queries.
Implementations§
Source§impl SessionEventLog
impl SessionEventLog
Sourcepub fn open_with_eviction_summary(
workspace: &Path,
session_id: &str,
max_events: usize,
eviction_summary_hook: EvictionSummaryHook,
) -> Result<Self, SessionStoreError>
pub fn open_with_eviction_summary( workspace: &Path, session_id: &str, max_events: usize, eviction_summary_hook: EvictionSummaryHook, ) -> Result<Self, SessionStoreError>
Open a log with an explicit eviction-summary callback.
This is useful for hosts that keep derived memory in another store and
for deterministic failure-path tests. The callback must persist its
summary before returning Ok(()).
Sourcepub fn append(&self, event: &ThreadEvent) -> Result<(), SessionStoreError>
pub fn append(&self, event: &ThreadEvent) -> Result<(), SessionStoreError>
Append an event to the log and update the in-memory index/manifest.
Sourcepub fn event_count(&self) -> u64
pub fn event_count(&self) -> u64
Number of events recorded.
Sourcepub fn visit_snapshot<F>(
&self,
visitor: F,
) -> Result<SessionManifest, SessionStoreError>
pub fn visit_snapshot<F>( &self, visitor: F, ) -> Result<SessionManifest, SessionStoreError>
Flush pending event bytes and metadata to the session store. Visit one consistent retained range, including records outside turns. Reads are streamed while cap rewrites and appends are excluded.
Sourcepub fn flush(&self) -> Result<(), SessionStoreError>
pub fn flush(&self) -> Result<(), SessionStoreError>
Flush pending event bytes and metadata to the session store.
Sourcepub fn manifest(&self) -> SessionManifest
pub fn manifest(&self) -> SessionManifest
Snapshot of the session manifest.
Sourcepub fn turn_index(&self) -> TurnIndex
pub fn turn_index(&self) -> TurnIndex
Snapshot of the turn index.