Versioned, provider-neutral execution envelope shared by all optimizers.
The original evaluation fields remain directly available. project/3 adds a
runtime identity and typed events for GEPA, MIPROv2, SIMBA, RLM, ReAct, and
generic evaluation adapters. dump/1 is the canonical cross-runtime wire
representation: it is JSON-safe, deterministic, and redacts secrets in
structured fields. Opaque attachment bytes are preserved unchanged. load/1
validates the complete envelope and fails closed.
Summary
Functions
Dumps every trajectory field into a deterministic JSON-safe versioned map.
True when this trajectory's failure came from a killed evaluation task (timeout or deadline exhaustion), not from model or metric behavior.
Loads and strictly validates a canonical trajectory wire map.
Loads a trajectory or raises DecodeError for any malformed field.
Projects an existing trajectory or runtime prediction into the canonical contract.
Returns a secret-redacted trajectory while preserving all typed structs.
Returns the current trajectory wire schema version.
Validates ordering, tool alignment, accounting, cache, and named parameter invariants.
Validates a batch as index-aligned, ordered canonical trajectories.
Types
@type runtime() ::
:evaluation
| :gepa
| :mipro_v2
| :simba
| :rlm
| :agent
| :react
| :optimize_anything
@type t() :: %Imp.Optimizer.Trajectory{ cache: struct() | nil, error: term(), events: list(), example: term(), feedback: term(), index: integer(), metadata: map(), metric_metadata: map() | nil, named_parameters: list(), prediction: term(), program_id: term(), rollout_id: term(), runtime: runtime(), schema_version: pos_integer(), score: number(), timing: struct(), trace: list() | nil, usage: struct() }
Functions
Dumps every trajectory field into a deterministic JSON-safe versioned map.
True when this trajectory's failure came from a killed evaluation task (timeout or deadline exhaustion), not from model or metric behavior.
Loads and strictly validates a canonical trajectory wire map.
Loads a trajectory or raises DecodeError for any malformed field.
Projects an existing trajectory or runtime prediction into the canonical contract.
Returns a secret-redacted trajectory while preserving all typed structs.
Returns the current trajectory wire schema version.
Validates ordering, tool alignment, accounting, cache, and named parameter invariants.
Validates a batch as index-aligned, ordered canonical trajectories.