Expand description
Append-only session semantics, deterministic replay, and replaceable storage
contracts for tea-rs.
Canonical tea_protocol::RecordEnvelope values are the source
of truth. SessionReducer derives rebuildable materialized state without
reading clocks, executing tools, contacting providers, or depending on an
async runtime.
§Replay
use tea_protocol::RecordEnvelope;
use tea_session::SessionReducer;
let state = SessionReducer::replay(records)?;
assert_eq!(state.tail_sequence().get() + 1, state.tail_sequence().get() + 1);Structs§
- Append
Outcome - Successful append details and rebuilt current projection.
- Append
Transaction - Atomic append request guarded by the caller’s expected session tail.
- Artifact
State - Derived authorization state rebuilt from approval and grant journals.
- Branch
Summary - Summary of one durable branch.
- InMemory
Session Store - In-memory semantic reference implementation of
SessionStore. - Materialized
Session State - Deterministic session projection derived only from the append-only record log.
- Pending
Approval - Durable pending approval reconstructed from canonical records.
- Session
Archive - Validated interchange/diagnostic representation of one complete session.
- Session
Catalog Entry - Immutable host-facing catalog entry derived from durable session state.
- Session
Compaction - Latest durable compaction summary and its source provenance.
- Session
Configuration - Active model and product-profile configuration derived from durable records.
- Session
Name - Validated optional human-facing session name.
- Session
Reducer - Pure deterministic reducer for canonical durable session records.
- Session
Snapshot - Complete immutable read view of one stored session.
- Session
Store Error - Stable session repository failure with an English technical diagnostic.
- Stored
Session - Immutable view of one stored session’s durable facts.
- Tool
Call State - Materialized lifecycle of one requested tool call.
- Turn
Checkpoint - Durable turn boundary reconstructed during replay.
Enums§
- Approval
Artifact Entry - Rich policy approval value linked to a canonical durable approval transition.
- Artifact
Validation Error - Typed approval/grant persistence invariant failure.
- Grant
Journal Entry - Append-only authorization-grant journal fact.
- RunRecovery
State - Provider-run state required for restart diagnostics.
- Session
Archive Error - Error decoding or validating a session interchange archive.
- Session
Name Error - Session-name validation failure.
- Session
Replay Error - Deterministic failure while reducing durable records.
- Session
Store Error Code - Stable storage failure classification shared by session-store adapters.
- Tool
Execution State - Durable execution/recovery state for a tool call.
Constants§
- CURRENT_
ARCHIVE_ FORMAT_ VERSION - Current independent JSON archive format version.
- MAX_
ARCHIVE_ BYTES - Maximum accepted encoded archive size.
- MAX_
ARCHIVE_ ENTRIES - Maximum records or side-journal entries in one archive collection.
- MAX_
SESSION_ NAME_ BYTES - Maximum UTF-8 bytes accepted for a session display name.
Traits§
- Session
Catalog - Read/list and display-metadata port kept separate from append semantics.
- Session
Store - Replaceable append-only session repository contract.
Functions§
- active_
grants_ for_ actor - Returns the active grants for one actor across a collection of stored views.
- apply_
transaction - Validates a transaction and applies it to an existing stored view.
- apply_
transaction_ in_ place - Validates and applies one transaction to an owned stored-session cache entry.
Type Aliases§
- Session
Store Future - Runtime-neutral boxed future returned by session storage ports.