- The control channel carries JSON-RPC 2.0 objects. Requests originate from either side; notifications (no
id) are used for status and event pushes.[AWP-CTL-001] - Method names are namespaced:
initialize,ping,world.*,session.*,task.*,obs.*,action.*,safety.*. Unknown methods MUST return JSON-RPC-32601.[AWP-CTL-002] - Per-direction ordering on the control channel MUST be preserved by the binding; recipients MUST NOT assume cross-direction ordering, nor ordering relative to any other channel (AWP-TRN-007).
[AWP-CTL-003] - Heartbeats.
pingis a JSON-RPC request either side may send, carrying{ origin_ns }; its result is the pong,{ origin_ns, receive_ns, transmit_ns }, and every exchange is a clock-synchronization sample (timestamps and clocks, AWP-CLK-007/008). Interval, response bound, and loss detection are normative in Liveness and safe state (AWP-SAF-001/002).[AWP-CTL-004] - Reconnection. A lost control connection moves the session to
Suspendedand does not terminate it forreconnect_window_ms, declared insession.ready. The agent reconnects, completesinitialize, and callssession.resumewith its session token andlast_status_seq; the world replays per status delivery and re-issuesstream_endpoints, from which the agent re-establishes its stream connections (AWP-TRN-008). Embodiment behavior during the gap is governed by the world-side watchdog, not by the reconnect window (AWP-SAF-003..008): motion stops atwatchdog_ms, and resumption never restarts it.[AWP-CTL-005] - Batch requests MUST NOT be used.
[AWP-CTL-006] - One session per connection. A control connection carries exactly one control channel and at most one session. A second
session.openon a connection that already holds a session MUST fail withAWP_SESSION_EXISTS; to run several sessions against one world, open several connections. Multiplexing is deferred to a future RFD.[AWP-CTL-007]
Status delivery and replay
- Every
action.status,world.event, andsession.statenotification carriesstatus_seq, a per-session integer that starts at 1 and increases by exactly 1 with each notification of the three kinds and with each transition first reported in anaction.submitoraction.cancelresult, which carries that transition’sstatus_seq.session.resumecarrieslast_status_seq, the higheststatus_seqthe agent has processed (0 if none); the world MUST replay, in order, everystatus_seq > last_status_seq, then continue live. A transition first reported in anaction.submitoraction.cancelresult is replayed as anaction.statusnotification carrying the samestatus_seq, since the agent may never have received the result. Thesession.resumeresult carriesreplay_to_status_seq, the higheststatus_seqassigned before resumption; the replay is complete when the agent has processed it. Delivery is therefore at-least-once;status_seqis unique within a session and receivers deduplicate on it (AWP-LIF-009). All notifications are replayed, not only terminal statuses, so a suspension is reported to the agent when it returns.[AWP-CTL-008] - Acknowledgement and retention. An agent acknowledges delivery by carrying
last_status_seqinsession.resumeand, optionally, in its ownpingparams. Worlds MUST retain everystatus_seqabove the highest acknowledged value for as long as the session exists, and MAY discard acknowledged ones. An agent that never acknowledges onpingis replayed from itssession.resumevalue, so worlds serving such agents retain the whole session’s notifications.[AWP-CTL-010] - 64-bit integers.
ts_mono_ns,ts_sim_ns,ts_send_ns,received_ts_mono_ns,basis_ts_mono_ns,valid_until_ns,origin_ns,receive_ns,transmit_ns,seq,tick,status_seq,expires_at_ns, and every other 64-bit field are encoded as JSON integers and, in JSON and in binary frames alike, MUST NOT exceed 2^53 − 1. A receiver that observes a larger value MUST answer the request that carried it, if any, withAWP_INTEGER_RANGE, and MUST end the session: a world closes the session as onsession.closewithsession.statereasonprotocol_errorand closes the connection; an agent sendssession.closeand closes the connection without awaiting the result. Either side closes it with WebSocket close code 1002 and reasonAWP_INTEGER_RANGE. Senders MUST NOT encode these fields as strings or floats.[AWP-CTL-009]