No expiry is a sentinel, and an expiry ends the run whichever path finds it
An interrupt with no expiry waits indefinitely, and survives every sweep. When one does expire, it does not matter whether a sweep or a late answer found it: the run it held open can no longer be resumed, so it ends the same way either way.
The rule
- An interrupt MUST wait indefinitely unless it carries a positive expiry.
- An absent or zero expiry is the no-expiry sentinel: it MUST NOT be treated as overdue, and any sweep MUST exclude it, so an open-ended question to a human is never reaped.
- A pending outward interrupt past its expiry is expired by whichever path reaches it first: a sweep, or a caller's answer or cancel (INT-24) that arrives after the expiry.
- Every path MUST set it
expired(INT-24), record it, and announce the expiry. - An answer or cancel that finds an outward interrupt past its expiry MUST expire it and MUST be refused with
409and the codeINTERRUPT_NOT_PENDING(INT-24), as if the sweep had come first. - An inward signal is settled as INT-5, INT-16, INT-24 and INT-25 say, whatever its expiry.
- The path MUST make no difference to what follows: an expired outward interrupt ends the run it holds open (INT-18), whether a sweep or a late answer found it.
What it means
Two different shapes both mean "wait indefinitely" — a missing expiry and one set to zero — and a sweep has to exclude both, or an open-ended question to a human would be reaped the first time the sweep runs. Treating only one of the two as the sentinel is the mistake this rule rules out.
Several paths can find an outward interrupt past its expiry: a sweep that looks
for overdue rows, and a caller whose answer or cancel arrives too late. Whichever gets there first sets
the interrupt expired, records it and announces it; the late answer or cancel
is refused with 409 INTERRUPT_NOT_PENDING either way. What follows does not depend on the path. A run waiting on an
outward interrupt that has expired can never be resumed by it, so the run ends
(INT-18). An inward signal is different: a paused run's pause signal is its resume key,
so it is settled only by the signal rules, whatever its expiry. Letting a late answer expire the question but leave the run paused
would only strand the run until the next sweep, or forever if the sweep no
longer sees the row as pending.
Example
{"expires": null}{"expires": 0}Both stay pending through every sweep, and both are still answerable long after they were created.