Pure, named mutations of an already-committed Docket.Run.
Each successful state change returns exactly one uncommitted
Docket.Runtime.Moment. Callers supply the proposal timestamp explicitly,
so calculation is deterministic and performs no storage, process,
checkpoint-handler, telemetry, or scheduling work.
An already-cancelled run is an idempotent success and is returned unchanged; there is no new moment to commit.
Summary
Functions
Cancels a durable active run and proposes a terminal park.
Resolves an open interrupt and proposes the run's next wake.
Types
@type cancellation_result() :: mutation_result() | {:unchanged, Docket.Run.t()}
@type mutation_result() :: {:ok, Docket.Runtime.Moment.t()} | {:error, Docket.Error.t()}
Functions
@spec cancel_run(Docket.Run.t(), DateTime.t()) :: cancellation_result()
Cancels a durable active run and proposes a terminal park.
Cancellation absorbs any parked superstep. Calling this again for the resulting run returns that exact run without consuming sequences.
@spec resolve_interrupt( Docket.Runtime.Graph.t(), Docket.Run.t(), String.t(), term(), DateTime.t() ) :: mutation_result()
Resolves an open interrupt and proposes the run's next wake.
Terminal status is checked before interrupt lookup. A resolved interrupt is distinguished from an unknown interrupt, and the stored schema plus graph field contract both validate the resolution value.
Resolution proposes an immediate wake unless every active attempt is parked behind a future retry deadline; then it parks at the earliest deadline, so the committed wake never precedes the first dispatchable attempt.