SquidMesh.Runtime.WorkflowAgent.Projection (squid_mesh v0.1.0-beta.3)

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(),
  optional(:step) => String.t()
}

manual_state()

@type manual_state() :: %{
  step: String.t(),
  kind: String.t(),
  paused_at: DateTime.t(),
  metadata: map()
}

string_set()

@type string_set() :: MapSet.t(String.t()) | %MapSet{map: term()}

t()

@type t() :: %SquidMesh.Runtime.WorkflowAgent.Projection{
  anomalies: [anomaly()],
  applied_at: %{optional(String.t()) => DateTime.t()},
  applied_execution_opts: %{optional(String.t()) => keyword()},
  applied_results: %{optional(String.t()) => map() | nil},
  applied_runnable_keys: string_set(),
  context: map(),
  definition_fingerprint: String.t() | nil,
  input: map() | nil,
  manual_state: manual_state() | nil,
  planned_runnables: %{optional(String.t()) => map()},
  replayed_from_run_id: String.t() | nil,
  run_id: String.t() | nil,
  status: atom(),
  terminal_status: atom() | nil,
  trigger: String.t() | nil,
  workflow: String.t() | nil
}