pub struct EffectReceipt {
pub provider: String,
pub provider_id: String,
pub idempotency_key: String,
pub task_id: Option<String>,
pub effect_id: Option<String>,
}Expand description
The effect’s own confirmation of an Idempotent side effect, journaled
as the output payload of a RunEventKind::EffectReceipt event (R0.6
Durable Work).
A receipt is the proof the provider accepted the effect exactly once: its own confirmation id, under the idempotency key the caller supplied. Two consumers depend on it:
- Operators auditing a run can trace every effect to the provider’s
record of it (
provider+provider_id). - Exact replay serves the journaled receipt instead of re-sending the
effect — the same rule the Flight Recorder applies to journaled model
and tool calls, extended across the crash boundary between a run and
its queue-dispatched tasks. The replay lookup is keyed on
EffectReceipt::idempotency_key(seecrate::journal::JournalSnapshot::find_effect_receipt), not on event sequence: a task completes outside the run’s super-step order.
Serialized inside the event’s output PayloadRef, so the event
envelope stays unchanged and old journals keep deserializing.
Fields§
§provider: StringThe system that confirmed the effect (a provider name — stripe,
sendgrid — or any store with idempotent-put semantics).
provider_id: StringThe provider’s own confirmation id (charge id, message id, version stamp) — the handle an audit uses to find the effect at the provider.
idempotency_key: StringThe idempotency key the effect was performed under — the key the task envelope carried and the recipient passed to the provider. This is the replay lookup key: a re-driven run asks “did this key already land?” and the journal answers with this receipt.
task_id: Option<String>The durable task whose completion produced this receipt, when the
effect was queue-dispatched. None for effects a run performed
in-process.
effect_id: Option<String>The deterministic effect id (R0.7 effect kernel) of the effect this
receipt confirms — crate::effects::derive_effect_id over the
run scope, effect kind, input hash, and idempotency key. Recovery
re-derives the id of the effect it is about to perform and looks the
receipt up by it (see
crate::journal::JournalSnapshot::find_effect_receipt_by_effect_id),
which is how “did this exact effect already commit?” becomes
answerable without re-execution.
Additive like task_id: absent (not null) on the wire when unset, so
pre-R0.7 receipts and consumers see no shape change. None is honest
for receipts journaled by writers that predate the typed kernel; the
EffectReceipt::idempotency_key lookup keeps serving them.
Trait Implementations§
Source§impl Clone for EffectReceipt
impl Clone for EffectReceipt
Source§fn clone(&self) -> EffectReceipt
fn clone(&self) -> EffectReceipt
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more