Contract for a peer effect that is idempotent and recoverable by operation key.
The first argument to both callbacks is the authoritative committed claim UUID.
An adapter must pass it unchanged to the peer's idempotency and recovery surfaces.
:absent is authoritative proof that no peer operation exists; every uncertain,
exceptional, or malformed outcome is ambiguity and must not permit a new key.
Summary
Types
@type operation_key() :: Ecto.UUID.t()
@type peer_result() :: term()
@type subject() :: Ash.Changeset.t() | Ash.ActionInput.t()
@type trusted_context() :: map()
Callbacks
@callback execute(operation_key(), subject(), trusted_context()) :: {:ok, peer_result()} | {:error, :outcome_unknown}
@callback recover(operation_key(), subject(), trusted_context()) :: {:ok, peer_result()} | :absent | :unknown
Functions
@spec operation_key(subject()) :: {:ok, operation_key()} | :error
@spec result(subject()) :: {:ok, peer_result()} | :error