Validates compiled WPL JSON against the canonical schema and semantic invariants.
Two passes:
- JSON Schema validation (Draft 2020-12).
- Semantic invariants (duplicate-id detection, ref resolution, prescription validity, etc.) — only runs if Pass 1 passes.
Usage
{:ok, plan} = Jason.decode(json_string)
result = WPL.Validator.validate(plan)
if result.valid? do
IO.puts("ok")
else
for err <- result.errors, do: IO.inspect(err)
endSee WPL.Validator.Error and WPL.Validator.Result for return shapes.
Summary
Functions
Convenience: pull every actionable repair_hint out of a Result.
Types
Functions
@spec repair_hints(WPL.Validator.Result.t()) :: [ %{code: atom(), path: String.t(), hint: WPL.Validator.RepairHint.t()} ]
Convenience: pull every actionable repair_hint out of a Result.
Designed for agentic completion loops — the orchestrator gets a flat
list of repair actions without having to inspect each error's optional
field. Errors without a hint (e.g. :cyclic_subplan) are skipped.
@spec validate(any(), opts()) :: WPL.Validator.Result.t()