Explicit keyed-effect semantics for Ash actions.
ash_onetime separates replay-safe idempotency from collision-rejecting one-time
nonces. Protected actions must declare a strategy and an explicit scope.
Summary
Functions
Reports whether a protected-action result was a stored replay or a fresh execution.
Functions
Reports whether a protected-action result was a stored replay or a fresh execution.
Returns:
true— the result was a tracked replay: a stored response was returned without re-executing the effect (map to HTTP200with anIdempotent-Replayedheader, or suppress a duplicate side effect).false— the result was a tracked fresh execution: the effect ran and its response was stored (map to HTTP201).nil— the carrier is absent. This covers three cases the caller cannot distinguish by this signal alone: an untracked execution (which intentionally carries noash_onetimemetadata, per ADR 0001's untracked-transparency goal), a primitive-return action whose result is not a record (e.g. a generic action returning an integer), or a result that was never protected byash_onetime.
For record-returning actions (create/update, generic actions returning a struct, destroy
with return_destroyed?), the signal is true/false. For primitive returns and
untracked executions it is nil — use a record-returning action, or observe replay inside
the action via an after_action hook reading the admission state, if you need replay
observability on a primitive return. See documentation/replay.md.