Expand description
Session-store abstraction for the dispatcher.
The session cohort commands (/sessions, /resume, /fork,
/save) need read/write access to the on-disk session store.
We reach it through a trait (rather than a hard dependency on
zero-session) for the same reason dispatch reaches
operator-state through crate::StateSource: keep
zero-commands pluggable, testable without SQLite, and free of
migrations noise.
Data crossing the trait is plain Rust — String ulids, epoch
milliseconds, and the crate-local ReplayKind enum. Callers
translate to / from their durable types (zero_session::EventKind,
chrono::DateTime<Utc>) at the boundary.
Error policy mirrors StateSource: the trait returns Result
so SQLite-backed impls can surface IO failures, but the
dispatcher wraps every call in a function that downgrades the
error to an [OutputLine::Alert]. A DB hiccup must never take
down the TUI — the operator still needs to read the engine.
Structs§
- Replay
Event - One replayed event.
at_msis the original wall-clock timestamp, so “resuming: X prior events, most recent 14m ago” reads from a truthful clock source rather than a rendered approximation. - Session
Summary - One session row surfaced to the dispatcher. Minimal by design:
everything beyond what
/sessionsrenders is looked up on demand throughSessionSource::list_events.
Enums§
- Replay
Kind - Categorisation of a replayed event, stripped of the concrete
EventKindenum inzero-session. The dispatcher hands these to the TUI which renders them through its own [EntryKind-equivalent] palette. - Session
Error - Errors a
SessionSourcecan surface.
Traits§
- Session
Source - The dispatcher’s view of the session store. Implemented by the
TUI (wrapping a
zero_session::Store+ a label index on top of milestones) and by test scaffolding that keeps every call in-memory.