StatifierPersistence.Run (StatifierPersistence v0.11.0)

Copy Markdown View Source

The host-facing view of a durable run: what state is this run in - never what its bytes are. The position blob stays on the stored record (ADR-0004 decision 1), loaded only through the guarded StatifierPersistence.Storage.load_run_position/3 path; this struct carries the fields a host reads to decide what to do with a run.

Summary

Functions

Builds the host-facing struct from a stored StatifierPersistence.Storage.Adapter.run_record/0, dropping the two blob fields (identity_blob, position_blob) and carrying everything else verbatim.

Types

t()

@type t() :: %StatifierPersistence.Run{
  content_hash: StatifierPersistence.Storage.Adapter.content_hash(),
  donedata: term() | nil,
  failure: String.t() | nil,
  run_id: StatifierPersistence.Storage.Adapter.run_id(),
  status: StatifierPersistence.Storage.Adapter.run_status()
}

Functions

from_record(map)

Builds the host-facing struct from a stored StatifierPersistence.Storage.Adapter.run_record/0, dropping the two blob fields (identity_blob, position_blob) and carrying everything else verbatim.

donedata is always nil here: a stored record carries no donedata (ADR-0008 decision 3) - a position that has reached a final state has no configuration left to carry it, so it exists only on the step that produced it, via StatifierPersistence.Runs' own construction of this struct.