Jidoka.Session.Replay (Jidoka v0.9.0)

Copy Markdown View Source

Inspection-friendly replay projection for stored session data.

Replay is data-only. It reconstructs what is already known from sessions, snapshots, journals, and events; it never calls runtime capabilities.

Summary

Functions

Builds replay data from a durable session.

Builds replay data from a hibernation snapshot.

Builds replay data from keyword or map attributes.

Builds replay data and raises if the attributes are invalid.

Returns the Zoi schema for replay data.

Types

t()

@type t() :: %Jidoka.Session.Replay{
  agent_id: binary(),
  journal: map(),
  lineage: nil | nil | map(),
  metadata: map(),
  pending_reviews: [map()],
  result: nil | nil | map(),
  session_id: nil | nil | binary(),
  session_revision: nil | nil | integer(),
  snapshots: [map()],
  status:
    (((((:new | :running) | :hibernated) | :waiting) | :finished) | :cancelled)
    | :error,
  timeline: [map()]
}

Functions

from_session(session)

@spec from_session(Jidoka.Session.Data.t()) :: {:ok, t()} | {:error, term()}

Builds replay data from a durable session.

from_snapshot(snapshot)

@spec from_snapshot(Jidoka.Snapshot.t()) :: {:ok, t()} | {:error, term()}

Builds replay data from a hibernation snapshot.

new(attrs)

@spec new(keyword() | map()) :: {:ok, t()} | {:error, term()}

Builds replay data from keyword or map attributes.

new!(attrs)

@spec new!(keyword() | map()) :: t()

Builds replay data and raises if the attributes are invalid.

schema()

@spec schema() :: Zoi.schema()

Returns the Zoi schema for replay data.