A terminal run refuses re-entry; re-running makes a new run
This is what makes cancellation durable: no requeue or rerun can resurrect a dead run and fire its side-effecting nodes again.
The rule
- A run in a terminal status (completed, failed or cancelled) MUST refuse re-entry, on every path that could re-enter it.
- A run that refuses re-entry MUST execute no work and MUST be left untouched.
- Re-running MUST always create a new run.
- The new run MUST be seeded with the source run's input and MUST record which run it is a re-run of.
- Every path that ends a run MUST claim the run's terminal status by one atomic change from a status that is not terminal, so that of two paths racing to end one run, exactly one wins: a run cancel (INT-5, INT-25), the expiry or cancel of an outward interrupt (INT-18), and the run's own ending (ORC-11) alike.
- The winner MUST record the terminal status and its
terminalReason(PIPE-1), and MUST announce the outcome (ORC-15). - A path that loses MUST leave the run untouched, its
terminalReasonincluded, and MUST NOT announce anything about the run.
What it means
Re-running is not resuming. A run that already reached completed, failed or cancelled is dead, and re-entering it — by whatever way in — does nothing: no work executes and the run's own record is left exactly as it was. What looks like "starting it again" always means a second, independent run, seeded with the first one's input.
That second run starts from scratch, not from wherever the first one left off. It carries the same input the dead run carried, but its own status begins at the beginning — nothing about a terminal run's outcome, progress or identity survives into the run created from it, beyond the input and a record of which run it was re-run from.
Two things can try to end the same run at the same moment: an operator cancelling it while a sweep expires the question it waits on, say. Ending a run is one atomic claim, so only one of them gets it. The winner records the outcome and its reason and announces it; the other leaves the run exactly as the winner left it, and says nothing. A run is announced as finished once, with one reason.
Example
A cancelled run carrying one input value, and the run created by re-running it.
{ "answer": 42 }{ "input": { "answer": 42 } }The new run also records which run it was re-run from; the cancelled run keeps its status untouched.