Skip to main content

Module wire

Module wire 

Source
Expand description

Wire format for the §Fase 41.d session-typed WebSocket dialogue.

Every frame is one text WebSocket message carrying a JSON envelope whose kind discriminator names one of the five operational actions of the §41.a algebra: send, recv (reserved — see note), select, branch, end, plus an out-of-band error carrier for protocol-error close-frame reasons. The format is closed — anything else is a MalformedFrame (no silent toleration; the type checker has already ruled out the schema, so any new shape on the wire is by definition out-of-spec).

§Why a single direction word

send and recv are peer-relative: the sender always tags its frame kind: "send". From the receiver’s perspective the frame is a recv step in its type, but the wire tag is symmetric — both peers agree on the sender’s view. This matches RFC 6455 message direction and removes ambiguity when both peers share log infrastructure.

select is senderly (the chooser); branch is receiverly (the offerer). At the wire level the chooser emits kind: "select"; the offerer never emits a label-bearing frame (its arms are silent).

All frames are validated by the receiver against the session-type cursor; the wire format is intentionally minimal — it carries just enough to advance the state machine, not the full schema (which lives statically in axon-frontend::session).

Enums§

Frame
One frame on the wire — exactly one operational step.

Constants§

AXON_WIRE_VERSION
Stable protocol-version tag — bumped if and only if the envelope shape changes incompatibly. Senders MUST emit, receivers MUST validate.