Skip to main content

Crate tea_session

Crate tea_session 

Source
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§

AppendOutcome
Successful append details and rebuilt current projection.
AppendTransaction
Atomic append request guarded by the caller’s expected session tail.
ArtifactState
Derived authorization state rebuilt from approval and grant journals.
BranchSummary
Summary of one durable branch.
InMemorySessionStore
In-memory semantic reference implementation of SessionStore.
MaterializedSessionState
Deterministic session projection derived only from the append-only record log.
PendingApproval
Durable pending approval reconstructed from canonical records.
SessionArchive
Validated interchange/diagnostic representation of one complete session.
SessionCatalogEntry
Immutable host-facing catalog entry derived from durable session state.
SessionCompaction
Latest durable compaction summary and its source provenance.
SessionConfiguration
Active model and product-profile configuration derived from durable records.
SessionName
Validated optional human-facing session name.
SessionReducer
Pure deterministic reducer for canonical durable session records.
SessionSnapshot
Complete immutable read view of one stored session.
SessionStoreError
Stable session repository failure with an English technical diagnostic.
StoredSession
Immutable view of one stored session’s durable facts.
ToolCallState
Materialized lifecycle of one requested tool call.
TurnCheckpoint
Durable turn boundary reconstructed during replay.

Enums§

ApprovalArtifactEntry
Rich policy approval value linked to a canonical durable approval transition.
ArtifactValidationError
Typed approval/grant persistence invariant failure.
GrantJournalEntry
Append-only authorization-grant journal fact.
RunRecoveryState
Provider-run state required for restart diagnostics.
SessionArchiveError
Error decoding or validating a session interchange archive.
SessionNameError
Session-name validation failure.
SessionReplayError
Deterministic failure while reducing durable records.
SessionStoreErrorCode
Stable storage failure classification shared by session-store adapters.
ToolExecutionState
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§

SessionCatalog
Read/list and display-metadata port kept separate from append semantics.
SessionStore
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§

SessionStoreFuture
Runtime-neutral boxed future returned by session storage ports.