Docket.RunSummary (docket v0.1.1)

Copy Markdown View Source

Lightweight projection of one durable run for collection reads.

A summary contains the indexed, public run fields needed to identify and filter a run without loading or decoding its complete durable state. The tenant is included so trusted system-scoped callers can distinguish owners; tenant-scoped callers only ever receive their own rows.

Backend-owned scheduling, claim, and poison details remain available through Docket.RunInfo. In particular, summaries never expose claim tokens.

Summary

Functions

Returns the exact saved graph version referenced by the run.

Builds a summary from a map or keyword list and validates its public shape.

Types

t()

@type t() :: %Docket.RunSummary{
  checkpoint_seq: pos_integer(),
  finished_at: DateTime.t() | nil,
  graph_hash: String.t(),
  graph_id: String.t(),
  id: String.t(),
  started_at: DateTime.t(),
  status: Docket.Run.durable_status(),
  step: non_neg_integer(),
  tenant_id: String.t() | nil,
  updated_at: DateTime.t()
}

Functions

graph_ref(run_summary)

@spec graph_ref(t()) :: Docket.GraphRef.t()

Returns the exact saved graph version referenced by the run.

new!(fields)

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

Builds a summary from a map or keyword list and validates its public shape.

All fields must be present, including nullable tenant_id and finished_at. Raises ArgumentError for a missing or malformed field.