| Internet-Draft | Substrate Wake | November 2026 |
| Morrison | Expires 29 May 2027 | [Page] |
This memo specifies the armed wait, a way for a turn-based agent session to be re-entered by an incoming message without becoming a network-addressable endpoint and without polling any remote party. At the end of a turn a session suspends onto a substrate its own host already maintains: a local projection of the frames delivered to its principal's identity handle. An observer on the same host watches that projection and re-enters the session the moment a frame of a wake class arrives, or when a bounded window closes. The session holds no socket, publishes no address and carries no session identifier on any wire. The memo defines the wake class, the arm and wake procedure, the three outcomes of an arm, the delivery and ordering properties a woken session can rely on, and the failure behaviour. It builds on the agent-channel frame of draft-morrison-agent-channel-fan-out and the coordination posture of draft-morrison-substrate-observation. Under the agent-channel memo's rule for new kinds, it defines the four frame kinds it relies on that the agent-channel memo does not define. Liveness obtained this way is an optimisation over asynchronous delivery and never replaces it.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 29 May 2027.¶
Copyright (c) 2026 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document.¶
Many agent runtimes are turn-based. A session runs while it has input, produces output, and then stops until the next input arrives. In the common case the only source of next input is a human typing. A message sent to such a session by a peer, whether another principal's agent or another session of the same principal, lands somewhere the session can read it, and then waits until the human next types. If the human is away, or the session is mid-way through long work and has stopped to await a decision, the message is read late or never.¶
The usual way to make a component reachable in real time is to make it addressable: give it a listening socket, an inbound route, or an endpoint identifier that a sender can name. [SUBSTRATE] sets out why that is the wrong shape for concurrent agent sessions. An addressable session needs a routing destination, the destination accumulates the state and purpose of every session it routes for, and naming a session on the wire exposes an identifier that identity infrastructure otherwise keeps bounded. [FANOUT] follows the same posture. No sender ever holds an endpoint, because a sender names a recipient scope keyed by identity and the delivery server expands it.¶
This memo closes the remaining gap: how a frame delivered under [FANOUT] re-enters a session that is not running. The answer inverts who acts. The recipient session, at the close of a turn, arms a wait on a local substrate it already has, and its own runtime re-enters it when that substrate changes in a way the arm names. Real-time behaviour comes from the recipient choosing to watch, never from the sender choosing to reach.¶
In scope: the wake class (Section 4), the arm and wake procedure (Section 5), reply waits for unattended sessions (Section 6), delivery and ordering properties (Section 7), failure and timeout behaviour (Section 8), and the four frame kinds this memo defines under the extension rule of [FANOUT] (Section 9). Out of scope are the frame envelope and the delivery server, both specified by [FANOUT]; the means by which a host maintains its connection to the delivery server; and the mechanism by which a particular agent runtime re-invokes a session. That mechanism differs between runtimes and is required here only to exist.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [BCP14] when, and only when, they appear in all capitals, as shown here.¶
Terms defined by [FANOUT] (agent-channel frame, kind, payload,
recipient scope, delivery server, per-handle stream, time-to-live,
~handle) keep their meaning there. The following terms are defined
here.¶
One running instance of a turn-based agent runtime, acting for one
~handle. A host may run several sessions of the same handle at
once.¶
The software that runs a session and re-invokes it with new input. A runtime that conforms to this memo can start a task on the session's behalf, let the session end its turn while the task runs, and re-invoke the session with the task's result when the task ends.¶
A long-lived process on the recipient host that holds the host's subscription to the per-handle stream and appends each delivered frame to the local projection. The projector does its work whether or not any session is armed.¶
An append-only, ordered record on the recipient host of the frames the projector has received, one record per frame, readable by the host's sessions. Section 3 specifies its shape.¶
A session's declaration, made at the end of a turn, that it is to be re-entered if a qualifying record appears in the local projection before a stated window closes.¶
The task, run by the runtime on behalf of an armed session, that evaluates the local projection against the arm and produces exactly one outcome.¶
The position in the local projection at the moment of arming. Only records after the watermark can qualify.¶
The bound, in seconds, on how long an arm stays live.¶
A frame whose kind, and where Section 4 says so its payload, makes it eligible to re-enter an armed session.¶
Any frame that is not wake-class. Ambient frames are read through the asynchronous path and never re-enter a session.¶
A session reading the local projection, or any other store of delivered frames its host keeps, when it next runs. A frame that wakes no session is read this way.¶
An opaque value a session chooses for itself and announces only to
sessions and surfaces of its own ~handle, used to narrow a wake
to one session (Section 4.2). A frame carries it in the
session_token payload member of Section 9.1.¶
The projector subscribes to the per-handle stream of [FANOUT], a Server-Sent Events stream [HTML-SSE], and, for each agent-channel frame delivered on it, appends one record to the local projection. A record is a single JSON object [RFC8259] on its own line, with these members:¶
frame_id (string, REQUIRED)The frame_id of the delivered frame.¶
kind (string, REQUIRED)The frame's kind.¶
sender (string, REQUIRED)The frame's sender_handle, as authenticated by the delivery
server under [FANOUT].¶
created_at (string, REQUIRED)An RFC 3339 [RFC3339] timestamp. It is the sender's created_at.
[FANOUT] requires every frame to carry one.¶
payload (object, or string when truncated, OPTIONAL)The frame's payload.¶
payload_truncated (boolean, OPTIONAL)Present and true when the projector stored a shortened payload
because the frame exceeded a local size bound. When this member is
true, payload holds a string prefix of the serialised payload,
not the object, and a woken session that needs the full payload
MUST obtain it through the asynchronous path.¶
The projector:¶
MUST suppress a second record for a frame_id it has already
projected within a bounded recent window, as a stream replay
after reconnection would otherwise produce duplicate records;¶
MUST append each record whole, because a watcher must never read a partial record, and SHOULD make the append durable before it treats the frame as projected;¶
MUST create the projection readable and writable by the host account that owns the sessions and by no other account; and¶
MAY rotate the projection when it exceeds a size bound, by moving the current file aside and starting a new one. An implementation that rotates SHOULD keep the most recent rotated generation readable until the next rotation. A watcher can then finish reading records it had not yet reached (Section 8.3).¶
The projection is the recipient's own substrate in the sense of [SUBSTRATE]: it is written as a by-product of the host's normal operation, it is never written by a sender, and no party outside the host reads it.¶
A wake-class frame is point-to-point and asks the recipient for a decision or an answer. The following kinds are wake-class by default:¶
agent_query (Section 9.2);¶
agent_response (Section 9.3);¶
agent_binding_moment (Section 9.4); and¶
peer_diagnostic_request (Section 9.5).¶
Every other kind is ambient by default, including the
agent_advisory and agent_broadcast kinds of [FANOUT]. An ambient
frame announces state. Waking a session for it spends the
recipient's compute on news that can wait.¶
The wake class is a recipient-local policy. A sender cannot make a frame wake-class, and no field of the frame carries a hint to that effect. The set of kinds under [FANOUT] is open (Section 10 of [FANOUT]). An implementation MAY remove default kinds from its wake class. It MAY add a kind it implements that is point-to-point and asks the recipient for a decision or an answer. An implementation SHOULD document its wake class so that a peer can predict whether a frame it sends will be answered promptly or read later.¶
Delivery under a scope that names a handle as a whole reaches every session of the handle that subscribes, because the delivery server expands the scope against the handle and not against a session. Two cases therefore need a narrower test than the kind alone.¶
A frame whose payload carries a session_token (Section 9.1)
names one session of the recipient handle. It wakes only an arm
that carries the same token. An arm that carries no token is never
woken by a session-addressed frame. A session-addressed frame
whose token matches no armed session wakes nobody and is read
through the asynchronous path. The kinds [FANOUT] defines carry no
session_token and are never session-addressed. A session token
is chosen by the session it names and is announced only within the
session's own handle. A sender outside the handle therefore cannot
narrow a wake to a particular session. This memo does not use the
single-session scope form ~handle/<instrument>@<session-id> of
[FANOUT], because that form names a session to the delivery server
as an address.¶
An implementation MAY treat an ambient kind as wake-class when its payload names the armed session as the party the frame concerns, for example an advisory reporting that work the session offered was refused. The test is evaluated by the recipient against local state, and when the recipient cannot evaluate it, the frame MUST be treated as ambient.¶
A session arms by asking its runtime to start a watcher with these parameters:¶
A duration. An implementation SHOULD default to 600 seconds and MUST cap the window; this memo RECOMMENDS a cap of 3600 seconds. A requested window above the cap is reduced to the cap, and a malformed or non-positive window is replaced by the default.¶
A ~handle. When present, only records whose sender equals it
qualify.¶
One kind. When present, only records of that kind qualify, and the kind MUST still be in the wake class.¶
The session's own token, required for a session-addressed frame to qualify (Section 4.2).¶
The watcher records the watermark as the current end of the local projection before it evaluates any record. The session then ends its turn. The session does not loop, sleep or poll on its own account; the watcher is the wait.¶
The watcher examines records appended after the watermark, in projection order. A record qualifies when all of the following hold:¶
it parses as a record of Section 3;¶
its kind is in the wake class;¶
it satisfies the sender and kind parameters, where present;¶
if it is session-addressed, its token equals the arm's session token; and¶
if it is a subject-qualified ambient frame, the recipient's local test names this session.¶
The watcher learns of new records either from a change notification the host provides or by re-reading the end of the projection at a bounded local interval. Either way the observation is local to the host. The watcher sends nothing to any remote party, and the delivery server cannot tell an armed session from an unarmed one. An implementation that re-reads SHOULD use an interval of a few seconds or less, because the interval adds directly to wake latency, and SHOULD prefer change notification where the host offers it.¶
An arm ends with exactly one of three outcomes, each a JSON object [RFC8259] returned to the runtime as the watcher's result:¶
wakeThe first qualifying record was found. The outcome carries the
record as frame and the seconds elapsed since arming as
waited_s.¶
window_closedThe window elapsed with no qualifying record. The outcome carries
waited_s and observed, the count of records that arrived after
the watermark and did not qualify.¶
unavailableThe arm could not be evaluated, and the outcome carries a reason.
Section 8.2 lists the cases.¶
The runtime re-invokes the session with the outcome as its next
input. On wake the session reads the frame and acts on it as it
would act on the same content arriving from its principal: it
answers a query, takes a handover, or puts a binding moment to its
principal as a decision. A session that expects a further frame,
such as the reply to its own answer, arms again before ending that
turn.¶
Each arm is a fresh declaration with a fresh watermark. A runtime
MUST NOT re-arm a session indefinitely without the session or its
principal choosing to, because an always-armed session is a standing
consumer of the host's compute that nobody decided to keep. On
window_closed a session SHOULD tell its principal that the window
closed rather than re-arm in silence.¶
An arm ends at its first qualifying record. Qualifying records that arrive between that wake and the session's next arm fall before the next watermark. They do not wake the next arm and are read through the asynchronous path.¶
A record already in the projection at arming never wakes the arm. Frames delivered while no session was armed are read through the asynchronous path when the session next runs.¶
Records qualify in projection order, the order in which they arrived at the recipient host and the projector appended them. This memo gives no ordering guarantee across senders, and none within a sender beyond what the delivery server of [FANOUT] provides.¶
Waking on a frame does not remove it from the local projection or from any asynchronous inbox. A frame that woke one session remains readable by the others.¶
When several sessions of one handle are armed and a frame qualifies for more than one, each of them wakes. This memo elects no session. Where only one session should act, for example on an offer of work, the frame's own protocol resolves it after the fact, typically by accepting the first claim and letting a late claim fail harmlessly, and each woken session disposes for itself. Consistent with [SUBSTRATE], no shared lock decides who wakes.¶
The projector's suppression of repeated frame_id values
(Section 3) means a stream replay does not wake an arm a second
time for the same frame within the suppression window.¶
The sender's experience is the same in every case: it submits a frame and is done. It does not learn, and cannot block on, whether the recipient was armed, idle, closed or offline.¶
The window is the decay floor. An arm never blocks past it. On
window_closed the session resumes under uncertainty: it has no new
input from the peer, and it decides whether to re-arm, proceed or
stop. A peer that did not answer is uncertain, never assumed to have
refused.¶
When the projector rotates the projection during an arm, the watcher sees the current file become shorter than its watermark. The watcher MUST then continue from the start of the new file. It SHOULD first read any records in the rotated generation that lie past its watermark, because a record appended there after the watcher's last read and before the rotation would otherwise be skipped. A skipped record is a missed wake, never a lost frame: it remains readable through the asynchronous path.¶
A restarted projector reconnects to the per-handle stream and may
receive frames again under replay. Because its duplicate
suppression is bounded and may not span a restart, a record for a
frame that was already projected can appear a second time. A woken
session SHOULD discard a frame whose frame_id it has already acted
on.¶
A record that does not parse, or lacks a REQUIRED member, never
qualifies and never ends an arm. The watcher passes over it and
counts it in observed if the arm closes without a wake.¶
[FANOUT] defines three kinds and leaves the set of kinds open. Its
Section 10 lets another document define a kind by its kind string,
its payload shape, its default recipient scope and its error
behaviour. This section defines four kinds that way. Each travels
in the frame of Section 3 of [FANOUT] and adds no envelope field.
The scope and filter grammars of [FANOUT] apply to each.¶
Each payload below is a JSON object [RFC8259]. A member of type string named as a version 4 UUID [RFC9562] holds the UUID in its string form.¶
session_token (string, OPTIONAL, 1 to 128 octets)A member of the payload of each of the four kinds. It is the
session token of the one session of recipient_handle the frame
is addressed to, and makes the frame session-addressed
(Section 4.2). A frame of a kind [FANOUT] defines cannot carry
it.¶
The error behaviour of each kind uses the codes of Section 9 of [FANOUT]:¶
a receiver that does not implement the kind rejects the frame with
kind-unknown;¶
a payload that is not a JSON object is rejected with
payload-kind-mismatch;¶
a payload that lacks a REQUIRED member is rejected with
field-missing, and one whose member breaks a constraint stated
for it is rejected with field-invalid; and¶
a payload that carries a member not listed for its kind is
rejected with field-unknown, as Section 10 of [FANOUT] requires.¶
In the last two cases field names the member. A rejected frame
reaches no subscriber. Each kind below states any further error
behaviour it has.¶
The kind string is agent_query. A session asks a question and
names the scope its answers are to reach.¶
query_text (string, REQUIRED, 1 to 2048 octets)The question.¶
query_id (string, REQUIRED)A version 4 UUID correlating the query with its responses.¶
response_scope (string, REQUIRED, 1 to 512 octets)The recipient scope to which responses are to be delivered. It
takes one of the ~handle forms of the scope grammar of [FANOUT]
(Section 6 of [FANOUT]) other than the single-session form, which
this memo does not use (Section 4.2).¶
timeout_ms (integer, REQUIRED, greater than 0)The window, in milliseconds, over which the asking session collects responses.¶
session_token (string, OPTIONAL)As Section 9.1.¶
The default recipient scope is every session of recipient_handle,
the scope ~handle naming that handle. A response_scope outside
those forms, the single-session form included, is rejected with
field-invalid.¶
The kind string is agent_response. A session answers an
agent_query, an agent_binding_moment or a
peer_diagnostic_request.¶
query_id (string, REQUIRED)The query_id of the frame this frame answers.¶
response_text (string, REQUIRED, 1 to 2048 octets)The answer.¶
option_idx (integer, OPTIONAL, 0 or greater)Where the frame answers an agent_binding_moment, the zero-based
index of the chosen option. It is absent when the answer lies
outside the option set.¶
responder (string, OPTIONAL, 1 to 128 octets)An opaque label the responding session chooses for itself. It need not identify the session to the delivery server.¶
session_token (string, OPTIONAL)As Section 9.1.¶
The default recipient scope is the response_scope of the
agent_query the frame answers. For an answer to an
agent_binding_moment or a peer_diagnostic_request it is every
session of that frame's sender_handle. A negative option_idx is
rejected with field-invalid. The delivery server cannot tell
whether a query_id names a question that was asked and does not
reject on that ground. A receiver holding no question of its own
under the query_id MAY discard the frame. A receiver treats an
option_idx beyond the option set of its question as an answer
outside the set and reads response_text.¶
The kind string is agent_binding_moment. A session puts a
structured decision request to another session or to a surface of
its principal.¶
query_id (string, REQUIRED)A version 4 UUID that an answering agent_response carries.¶
synopsis (string, REQUIRED)One sentence stating the decision.¶
findings (array of strings, REQUIRED)What the sender found.¶
recommendations (array of strings, REQUIRED)What the sender recommends.¶
offer (string, REQUIRED)One line stating what the sender will do on an answer.¶
question (object, REQUIRED)The question, with these members:¶
stem (string, REQUIRED), one sentence;¶
options (array, REQUIRED, 2 to 4 elements), each an object
carrying a short label (string, REQUIRED) and a one-line
reasoning (string, REQUIRED);¶
recommended_idx (integer, REQUIRED), the zero-based index of
exactly one option; and¶
hatches (object, OPTIONAL), carrying two booleans, free_text
and dialogue, each OPTIONAL and defaulting to true.¶
session_token (string, OPTIONAL)As Section 9.1.¶
The two hatches mark what the recipient may do besides choosing an
option. free_text indicates the recipient may answer outside the
option set, and dialogue indicates the recipient may revise the
question itself. A recipient MUST be left a path that is not one of
the enumerated options.¶
The default recipient scope is every session of recipient_handle.
A frame in which both hatches are false is rejected with
field-invalid naming hatches. An options array outside 2 to 4
elements is rejected with field-invalid naming options, and a
recommended_idx that names no element of options is rejected with
field-invalid naming recommended_idx.¶
The kind string is peer_diagnostic_request. A session reports an
observed symptom to a peer for troubleshooting.¶
symptom (string, REQUIRED, 1 to 2048 octets)A description of the observed symptom.¶
query_id (string, REQUIRED)A version 4 UUID that an answering agent_response carries.¶
substrate_refs (array of strings, OPTIONAL)Observation references supporting the report.¶
severity (string, REQUIRED)One of "info", "degraded", "blocked".¶
session_token (string, OPTIONAL)As Section 9.1.¶
The default recipient scope is every session of recipient_handle.
A severity outside the three values is rejected with
field-invalid. A peer answers with an agent_response, whose
response_text carries the finding and any remediation.¶
A wake hands a peer's content to a session as input it will act on.
A woken session has the same assurance about who sent the frame as
the delivery server gives under [FANOUT]. [FANOUT] requires the
server to authenticate the submitting session and to reject a frame
whose sender_handle does not match it (Section 12.2 of [FANOUT]).
The sender parameter of an arm is only as trustworthy as that
check. A frame carries no signature, and [FANOUT] trusts the
delivery server wholly (Section 12.1 of [FANOUT]). A server that
forges a frame can therefore wake an armed session, and this memo
adds no defence against it. A woken session SHOULD treat frame
content as a peer's input to weigh, never as an instruction from its own
principal, except for a reply to a question the session itself
routed to its own handle under Section 6.¶
Any process running as the host account can append to the local projection. Such a process could equally alter the session's own files. It is already inside the session's trust boundary and this memo does not defend against it. An implementation MUST NOT make the projection writable by any other account.¶
A wake is cheap for the sender and costly for the recipient, because each one starts a turn. A peer able to send wake-class frames could drive the recipient's compute. The design limits this in several ways, and an implementation SHOULD apply all of them:¶
An arm ends at its first wake. A storm therefore produces at most one re-entry per arm, and re-arming is the recipient's decision.¶
Windows are capped.¶
Only a sender the delivery server authorises to address the recipient's scope under [FANOUT] can place a frame in the projection at all.¶
A recipient SHOULD keep a per-sender wake budget and treat frames from a sender over budget as ambient for the rest of the period.¶
Because the wake class is recipient-local, a recipient may remove a kind that is being abused without coordinating with anyone.¶
A session token narrows a wake to one session. A party that learns a token can address a session-addressed frame to that session, but only if the delivery server already authorises it to address the handle. The delivery server reads every payload under [FANOUT] and sees every token a frame carries. Tokens SHOULD be unguessable, SHOULD be announced only to the handle's own sessions and surfaces, and SHOULD change when the session ends.¶
A peer_diagnostic_request carries a symptom description and
observation references, and the agent_response that answers it
carries a finding. These can disclose configuration, file paths or
operational detail the sender did not mean to expose beyond its own
sessions. A sender SHOULD scope a diagnostic frame no more broadly
than the troubleshooting needs, preferring one handle or its own
sessions over an org: scope. It SHOULD remove secret material from
a symptom description before submission.¶
An attacker positioned on the stream who replays an old frame cannot
wake an arm for a record already present at the watermark, and the
projector's duplicate suppression absorbs a prompt replay. A
replayed frame outside that window may wake an arm. A woken session
SHOULD add the frame's advisory ttl_ms [FANOUT] to its
created_at and discard a frame past that time. A frame with no
ttl_ms is held to the implementation-default horizon that [FANOUT]
has the recipient apply.¶
An armed session publishes nothing. It holds no socket, has no inbound route and carries no session identifier on any wire. Arming therefore discloses neither the session's existence nor its state to the delivery server or to any sender. A sender can infer that a recipient was armed only from how quickly a reply arrives, and any timely reply allows the same inference.¶
The local projection holds the content of delivered frames at rest on the recipient host. Its retention is a local decision: an implementation SHOULD bound it, as rotation does, and SHOULD treat the projection as holding the principal's correspondence for purposes of access control and deletion.¶
Session tokens are local to the handle (Section 10.3). An implementation MUST NOT place a session token in a recipient scope, because doing so would recreate the session-level addressing this memo exists to avoid. A token travels only in a payload. The delivery server reads it there and expands no scope against it.¶
This document has no IANA actions. The four kind strings of
Section 9 are constants of this specification, as [FANOUT] treats its
own kind strings.¶
draft-morrison-substrate-wake-00 (November 2026):¶