Expand description
Durable Harn session-store primitive.
One source of truth for persisted agent/session events (Message,
ToolCall, ToolResult, Plan, Compaction, SystemReminder,
Hypothesis, Receipt, Reminder, PermissionDecision, plus
arbitrary Custom shapes), snapshots, replay, fork/truncate, signed
receipts (Ed25519 over canonical JSON), and retention. Server and host
adapters can layer transport, auth, and product policy on top without
reimplementing transcript storage semantics.
§Layout
event- event taxonomy and canonical JSON encodersigning- Ed25519 chain hashes and receipt signaturesstore- publicSessionStoretrait and shared typesmemory- in-memory backend for tests and headless devsqlite- persistent SQLite backend for local/self-hosted useretention- declarative per-tenant retention policy
Re-exports§
pub use event::canonical_event_bytes;pub use event::canonical_json_bytes;pub use event::AppendEvent;pub use event::EventId;pub use event::EventSignature;pub use event::SessionEventKind;pub use event::StoredEvent;pub use memory::MemorySessionStore;pub use retention::ArchiveSink;pub use retention::RetentionPolicy;pub use retention::Tombstone;pub use signing::chain_root_fold;pub use signing::chain_root_hash;pub use signing::chain_root_init;pub use signing::compute_record_hash;pub use signing::re_anchor_events;pub use signing::verify_event;pub use signing::verify_event_chain;pub use signing::verify_receipt_root;pub use signing::SessionSigner;pub use signing::VerifyError;pub use signing::ALGORITHM as SIGNATURE_ALGORITHM;pub use sqlite::SqliteSessionStore;pub use store::CreateSession;pub use store::EventPage;pub use store::ForkResult;pub use store::ListFilter;pub use store::ReadRange;pub use store::SessionId;pub use store::SessionMeta;pub use store::SessionStatus;pub use store::SessionStore;pub use store::Snapshot;pub use store::SnapshotId;pub use store::StoreError;pub use store::StoreHooks;pub use store::StoreResult;pub use store::SweepReport;pub use store::TruncateResult;pub use store::VerifyFailure;pub use store::VerifyReport;pub use store::MAX_READ_BATCH;
Modules§
- event
- Session event taxonomy and canonical serialization.
- memory
- In-memory backend. Single-process, no persistence — but matches
the public
SessionStorecontract exactly so the rest of the primitive can be exercised end-to-end in tests without touching disk. - retention
- Per-tenant retention policy: lifecycle windows + archive sink hooks.
- signing
- Ed25519 signing for session event chains.
- sqlite
- SQLite-backed
SessionStore. - store
SessionStoretrait + the shared types every backend speaks.