MimirWorkflows.Compiler (mimir_workflows v0.7.0)

Copy Markdown View Source

Compiles a string-keyed workflow spec map into a validated %Spec{}.

Built-in passes — :schema (shape, via Spec.parse/1), :dag (dependencies exist, graph is acyclic), :refs (every {{ref}} resolves to a declared param or a declared dependency) — run first; host passes (MimirWorkflows.Compiler.Pass) append after them. All passes run even after failures and diagnostics accumulate, so a caller (or an agent repairing its own plan) sees every problem in one round trip. The result is {:error, diagnostics} iff any diagnostic is severity: :error; otherwise {:ok, spec, warnings}.

Summary

Functions

Compiles spec_map with the built-in passes plus opts[:passes], a list of {module, ctx} implementing MimirWorkflows.Compiler.Pass.

Functions

compile(spec_map, opts \\ [])

@spec compile(
  map(),
  keyword()
) ::
  {:ok, MimirWorkflows.Spec.t(), [MimirWorkflows.Diagnostic.t()]}
  | {:error, [MimirWorkflows.Diagnostic.t()]}

Compiles spec_map with the built-in passes plus opts[:passes], a list of {module, ctx} implementing MimirWorkflows.Compiler.Pass.