GEPA.Strategies.Acceptance behaviour (GEPA v0.3.0)

Copy Markdown View Source

Acceptance criteria for proposed GEPA candidates.

Reflective mutations use a pluggable acceptance criterion. Merge proposals are intentionally accepted with the official merge rule: the merged program's subsample score sum must be at least the better parent sum. That rule is not user-overridable in the Python engine and is kept separate here as well.

Summary

Types

criterion()

@type criterion() ::
  :strict_improvement
  | :improvement_or_equal
  | module()
  | struct()
  | (GEPA.CandidateProposal.t(), GEPA.State.t() | nil -> boolean())

Callbacks

should_accept(t, arg2)

@callback should_accept(GEPA.CandidateProposal.t(), GEPA.State.t() | nil) :: boolean()

Functions

normalize(criterion)

@spec normalize(criterion() | nil) :: criterion()

should_accept?(proposal, criterion, state)

@spec should_accept?(
  GEPA.CandidateProposal.t(),
  criterion() | nil,
  GEPA.State.t() | nil
) :: boolean()