A versioned learned-value artifact with safe provenance.
Summary
Functions
Decodes and validates a JSON artifact.
Encodes a validated artifact as canonical JSON.
Builds and validates an artifact from data.
Validates an artifact.
Types
@type t() :: %Tune.Artifact{ parameters: map(), provenance: map(), target_fingerprint: String.t(), version: pos_integer() }
Functions
@spec decode(String.t(), keyword()) :: {:ok, t()} | {:error, Exception.t()}
Decodes and validates a JSON artifact.
@spec encode(t()) :: {:ok, String.t()} | {:error, Exception.t()}
Encodes a validated artifact as canonical JSON.
@spec new(map()) :: {:ok, t()} | {:error, Exception.t()}
Builds and validates an artifact from data.
@spec validate(t()) :: :ok | {:error, Exception.t()}
Validates an artifact.