Elixir adapter for RelayMark AST and manifest JSON.
This package intentionally models the portable RelayMark contract. Relay app persistence, authorization, and action execution belong in client projects.
Summary
Functions
Validates a canonical, JSON-keyed RelayMark document map.
Validates and returns a canonical RelayMark document, raising on failure.
Validates one exact transported Agent Answer document/manifest JSON pair.
Functions
@spec decode_document(binary()) :: {:ok, RelayMark.Document.t()} | {:error, term()}
@spec decode_manifest(binary()) :: {:ok, RelayMark.Manifest.t()} | {:error, term()}
@spec validate_document(map(), map()) :: :ok | {:error, [RelayMark.Diagnostic.t()]}
Validates a canonical, JSON-keyed RelayMark document map.
Structural validation is compiled from the canonical JSON Schema 2020-12 document schema. Semantic validation applies the same directive, evidence, lifecycle, comparison, and identity rules as the reference runtime.
Validates and returns a canonical RelayMark document, raising on failure.
@spec validate_transported_agent_answer_pair(binary(), binary(), map()) :: {:ok, RelayMark.AgentAnswer.validated_pair()} | {:error, [RelayMark.Diagnostic.t()]}
Validates one exact transported Agent Answer document/manifest JSON pair.
Success returns decoded value models plus SHA-256 digests of the exact input bytes. Any semantic or canonical projection mismatch is rejected.