A checkpoint-safe mutation strategy for native structured Optimize Anything artifacts.
A strategy receives the complete native artifact, reflective evaluation data, and the top-level components selected for this proposal. It returns a complete replacement artifact. Imp validates the exact seed-derived shape and value types and rejects changes outside the selected components before the shared GEPA engine sees an internal representation.
Strategies are configured with a stable, consumer-owned version identifier:
strategy =
Imp.Optimize.Anything.StructuredStrategy.new(MyArtifactStrategy,
id: "routing-policy/v1",
config: %{"max_retries" => 3}
)
config =
Imp.Optimize.Anything.Config.new(
engine: [max_candidate_proposals: 4],
reflection: [structured_strategy: strategy]
)The strategy module must implement propose/4. Configuration is restricted
to JSON-native data so checkpoints never serialize executable code or create
atoms dynamically.
Summary
Functions
Restores a strategy binding without creating module atoms dynamically.
Returns the stable module/id/config identity bound into checkpoints.
Creates a native structured-artifact strategy with stable resume identity.
Returns a versioned JSON-safe representation of the strategy binding.
Types
Callbacks
@callback propose(artifact(), reflective_dataset(), [component()], term()) :: proposal()
Functions
Restores a strategy binding without creating module atoms dynamically.
Returns the stable module/id/config identity bound into checkpoints.
Creates a native structured-artifact strategy with stable resume identity.
Returns a versioned JSON-safe representation of the strategy binding.