An interrupt settles once, and only someone who could cancel its run may cancel it
An interrupt waits in one status and settles into one of three others, exactly once. Cancelling one is an act on the run it belongs to, so it takes the authority to cancel that run, and a remote answering a call can never use its route to do it.
The rule
- An interrupt is either an outward interrupt, raised by a node of a run to ask a person or a remote system, or an inward signal, a cancel or pause addressed to a run (INT-16).
- Its status MUST be one of four values, the interrupt status vocabulary STORE-11 closes:
pending(raised and not yet settled),resolved(answered, or for an inward signal, acted on),cancelled(settled without an answer) andexpired(its expiry passed before it was answered, INT-23). - An interrupt MUST leave
pendingat most once. - It MUST NOT leave
resolved,cancelledorexpired. - The change from
pendingMUST be atomic, so that of an answer, a cancel and an expiry racing for one interrupt, exactly one takes effect. - On every route, an answer or a cancel that the caller is authorised to make, but that finds the interrupt no longer
pending, having lost that race or arrived after it, MUST be refused with409and the codeINTERRUPT_NOT_PENDING. - An implementation MAY let a caller cancel a pending interrupt, on the route API-9 names
interrupt_cancel. - Where it does, the request MUST be authorised before anything about the interrupt's state is checked, so a caller without authority learns nothing about it.
- Cancelling an interrupt that belongs to a run, raised by it or addressed to it, requires the authority to cancel that run, because cancelling an outward interrupt ends the run it holds open (INT-18).
- A caller who lacks it MUST be refused with
403and the codeACCESS_DENIED. - A cancel naming an interrupt that does not exist MUST be answered
404with the codeNOT_FOUNDfor a caller holding blanket authority over runs, since existence is no secret from them. - For every other identified caller it MUST be answered with the same
403as a caller without authority, indistinguishable from it, so the route cannot be used to enumerate interrupts (INT-16 answers unknown runs alike). - A pending pause signal of a paused run MUST NOT be cancelled by a caller: it is that run's resume key (INT-5), and only a resume (INT-16) or a cancel of the run (INT-25) settles it.
- A cancel of one MUST be refused with
409and the codePAUSE_SIGNAL_NOT_CANCELLABLE. - A pending cancel signal MUST NOT be cancelled by a caller either: withdrawing it would undo a cancellation already accepted for the run (INT-16), which a run that is not paused observes at its next job boundary (INT-5).
- A cancel of one MUST be refused with
409and the codeCANCEL_SIGNAL_NOT_CANCELLABLE. - A pending pause signal of a run that is not paused MAY be cancelled: it withdraws a request the run has not yet observed.
- A cancel that takes effect MUST set the interrupt
cancelledand MUST answer200with the interrupt's new status,cancelled, asdata.statusin the standard{success: true, data}envelope. - The callback route (INT-19) MUST NOT cancel an interrupt: whatever a remote posts there is an answer, a refusal included.
- A declined confirmation gate is an answer too (RT-GATE-4), and leaves its interrupt
resolved. - A node that withdraws its own interrupt where a rule tells it to (INT-20, RT-GATE-3) MUST set it
cancelled. - That withdrawal is not a caller's cancel.
- When a run reaches a terminal outcome, its outward interrupts still pending MUST be set
cancelled, so no question stays answerable for a run that can no longer use the answer. - Settling them MUST NOT end or announce the run a second time.
What it means
An interrupt has one way in and three ways out. It is raised pending, and it
leaves pending once: answered (resolved), withdrawn without an answer
(cancelled), or left until its expiry passed (expired). Nothing brings it
back, so a client that sees anything but pending knows the question can no
longer be answered.
Leaving pending is a single atomic change, because three things can reach for
it at once: a person or a remote answering, someone cancelling, and a sweep
expiring it. Exactly one wins. Whoever arrives second, whether by a millisecond
or by a week, is told 409, and nothing they asked for happens.
Cancelling is the one exit a caller chooses, and it is not a small act. An outward interrupt is the only thing that can resume the run that raised it, so cancelling it ends that run (INT-18). That is why it takes the authority to cancel the run itself, and why a remote system answering through its callback route can never cancel anything: what it posts there is an answer, even when the answer is "no". The same holds for an operator declining a confirmation gate. A decline is a verdict the workflow handles, not a withdrawn question.
Two kinds of withdrawal are not a caller's cancel, though they leave the same status behind. A node withdraws its own question when the call it was waiting on never went out, or when the arguments it asked about have changed, and a run that ends some other way withdraws every question it left open. None of these ends a run a second time.
Inward signals are mostly off limits to this cancel. A paused run's pause signal is its resume key, and a pending cancel signal is a cancellation already accepted: withdrawing either would strand the run or quietly undo a cancel, so both are refused with codes of their own. Only a pause request that a running run has not yet acted on can be withdrawn.
The cancel route checks who is asking before it looks at anything else. A
caller who may not cancel the run gets the same 403 whether the interrupt is
settled, pending, or does not exist at all, so the route says nothing about
interrupts to someone who could not act on them. Only a caller with authority
over every run is told 404 for an identifier that does not exist.
Example
An approval prompt, answered and cancelled at the same moment.
{ "success": true, "data": { "id": "…", "status": "cancelled" } }The cancel is sent to the route API-9 names interrupt_cancel.
{"value": true}Had the answer won, the interrupt would be resolved, the run would resume, and
the cancel would have been the request refused with 409 and
INTERRUPT_NOT_PENDING.