Serializable semantic snapshot for hibernate/resume.
Durable snapshot strings are authenticated with an HMAC signing secret from
:jidoka, :snapshot_signing_secret or JIDOKA_SNAPSHOT_SIGNING_SECRET.
Summary
Functions
Restores a snapshot produced by serialize/1.
Copies a hibernation snapshot for a new session fork.
Returns the phase boundaries that support safe session forks.
Normalizes a snapshot struct or authenticated serialized snapshot.
Builds a phase-boundary snapshot from the current turn state.
Builds a phase-boundary snapshot and raises on invalid data.
Builds a durable agent snapshot from keyword or map attributes.
Builds an agent snapshot and raises if the attributes are invalid.
Returns the Zoi schema for a durable agent snapshot.
Returns the current snapshot schema version.
Serializes a snapshot into an opaque durable string.
Serializes and signs a snapshot, or raises if serialization fails.
Types
Functions
Restores a snapshot produced by serialize/1.
Copies a hibernation snapshot for a new session fork.
The copied snapshot keeps the exact turn state and effect journal. It gets a new snapshot id and records the source in metadata. Only resumable phase boundaries can be forked.
@spec forkable_phases() :: [atom()]
Returns the phase boundaries that support safe session forks.
Normalizes a snapshot struct or authenticated serialized snapshot.
@spec from_turn_state(Jidoka.Turn.State.t(), Jidoka.Turn.Cursor.t(), keyword()) :: {:ok, t()} | {:error, term()}
Builds a phase-boundary snapshot from the current turn state.
@spec from_turn_state!(Jidoka.Turn.State.t(), Jidoka.Turn.Cursor.t(), keyword()) :: t()
Builds a phase-boundary snapshot and raises on invalid data.
Builds a durable agent snapshot from keyword or map attributes.
Builds an agent snapshot and raises if the attributes are invalid.
@spec schema() :: Zoi.schema()
Returns the Zoi schema for a durable agent snapshot.
@spec schema_version() :: pos_integer()
Returns the current snapshot schema version.
Serializes a snapshot into an opaque durable string.
The format is intentionally internal to Jidoka. It preserves Elixir data fidelity across hibernate/resume while the schema version remains the public compatibility boundary.
Serializes and signs a snapshot, or raises if serialization fails.