Expand description
The durable step primitive and its typestate.
A step is the unit of durable progress: DurableContext::step
runs an operation closure, journals its result, and on a later resume returns the journaled
result instead of re-running the closure. This module defines the types that describe and carry a
step:
StepDescriptor— the what of a step: its name,EffectClass, ambiguity policy, and an opaque operation fingerprint. Its constructors enforce the construction-time ambiguity rule (FR-DE-09): a destructive, security-relevant, money-moving, or custom guarded step that omits anOnAmbiguouspolicy is rejected withDurableError::AmbiguityPolicyRequired.StepHandle— handed to the operation closure so it can forward the step’sIdempotencyKeyto an external service as anIdempotency-Keyheader for boundary dedup.StepError— the closure’s failure channel: any error type the closure produces is wrapped here without coupling the Layer-0 crate to a consumer’s error enum (INV-1).StepOutcome— theLive/Replayedtypestate that lets a consumer suppress already-emitted side effects (e.g. re-printing assistant output) on replay.DurableStep— the recorded result of a step: its id, idempotency key, and outcome.
The payload codec is JSON: a step value is serialized to bytes, length-checked, then handed to the journal where the backend AEAD-seals it. The bytes are opaque to the journal — the durable layer never inspects a domain type (INV-1).
Structs§
- Durable
Step - The recorded result of a
DurableContext::stepcall. - Step
Descriptor - The description of a step: its identity, effect contract, and ambiguity policy.
- Step
Error - The error channel for a step’s operation closure.
- Step
Handle - A handle passed to a step’s operation closure.
Enums§
- Step
Outcome - Whether a step’s value came from a live run or from the journal.