ExAgent.Session.Snapshot (ExAgent v2.0.1)

View Source

JSON checkpoint of coordination data. Version 3 adds bounded continuation references; unbound sessions still write v2, and valid v1/v2 data remains readable.

Decoding never loads modules or constructs structs chosen by stored bytes. restore/3 uses only the policy explicitly supplied by the host app. Custom policies opt in with TurnPolicy.snapshot/1 and restore_snapshot/3. Participant refs and live processes are not stored. JSON does not redact secret strings.

Summary

Types

t()

@type t() :: %ExAgent.Session.Snapshot{
  continuations: term(),
  current: term(),
  metadata: term(),
  participants: term(),
  policy_mod: term(),
  policy_state: term(),
  policy_version: term(),
  revision: term(),
  saved_at: term(),
  seq: term(),
  session_id: term(),
  shared_state: term(),
  status: term(),
  version: term()
}

Functions

deserialize(binary)

new(state)

restore(snapshot, trusted_mod, context)

serialize(snapshot)

validate(snapshot, expected_id)