SquidMesh.Runtime.WorkflowAgent.Projection (squid_mesh v0.1.0-alpha.7)

Copy Markdown View Source

Rebuildable workflow-agent projection over one run-thread journal.

Dispatch completion is not treated as workflow progress here. A runnable is applied only after the run thread records :runnable_applied, preserving the durable ordering between dispatch results and workflow state transitions.

Summary

Types

anomaly()

@type anomaly() :: %{
  :reason => atom(),
  :entry_type => atom(),
  optional(:runnable_key) => String.t(),
  optional(:run_id) => String.t()
}

t()

@type t() :: %SquidMesh.Runtime.WorkflowAgent.Projection{
  anomalies: [anomaly()],
  applied_runnable_keys: MapSet.t(String.t()),
  planned_runnables: %{optional(String.t()) => map()},
  run_id: String.t() | nil,
  status: atom(),
  terminal_status: atom() | nil,
  workflow: String.t() | nil
}

Functions

anomalies(projection)

@spec anomalies(t()) :: [anomaly()]

applied_runnable_keys(projection)

@spec applied_runnable_keys(t()) :: MapSet.t(String.t())

planned_runnable_key?(projection, runnable_key)

@spec planned_runnable_key?(t(), String.t()) :: boolean()

planned_runnable_keys(projection)

@spec planned_runnable_keys(t()) :: [String.t()]

rebuild(entries)

replay(projection, entries)

@spec replay(t(), [SquidMesh.Runtime.DispatchProtocol.Entry.t()]) :: t()

status(projection)

@spec status(t()) :: atom()

terminal?(projection)

@spec terminal?(t()) :: boolean()