Skip to main content
Version: 0.17.0

The wire

The interface surface travels as one union of operations over two projections: a gRPC service for local, and HTTP paths and WebSockets for http+ws. This page gives the frame of the typed projection, the browser's paths, ordering, the version and the error codes. The encoding, the framing and the shape of a refusal are the ones every Yoke surface shares. Field numbers and syntax are in the protocol definitions, yoke.interface.v1, which are authoritative on the bytes.

One union, two projections​

One Request and one Response, each a union with one alternative per operation and its answer. An operation is a member of the union and never of a projection.

The browser projection carries the same messages in protocol buffers' canonical JSON mapping, so the two share one schema.

local — the typed projection​

ServiceMethod
InterfaceAttach(stream Frame) returns (stream Frame) — bidirectional

Attaching is opening the stream. The class of the address decides what must be established, cardinality is checked, and the Core's first frame is the opening picture.

DirectionThe frame carries
client → Corethe call identity, chosen by the caller and unique within this attachment; and either a Request or a cancellation naming a call in flight
Core → clientthe call identity, and one of: an answer, an event, a stream delivery, a refusal, or a completion
  • Every call completes explicitly. A call answered by one message completes with it; a subscription or a delivery completes when the caller cancels it or the Core ends it, and the completion says which.
  • A refusal is a frame and does not end the attachment.
  • A stream delivery on the connection is used only where the client cannot reach a path in the instance's tree; it carries the delivery's identity, the sequence and the sender's clock unchanged.

http+ws — the browser projection​

The operation's name is the path.

PathMethodCarries
/v1/<operation>POSTone Request as JSON, one Response as JSON
/v1/eventsGET, upgradedthe live shape: events and channel state, the same frames, in JSON
/v1/streams/<unit>/<stream>/<n>GET, upgradedbinary: the 16-byte header and the payload, exactly as the framed transport carries them
anything elseany404, including a path outside /v1
  • Attaching is opening /v1/events. A control request with no live attachment is refused with channel.not_attached.
  • The credential is a cookie the page cannot read, yoke-session on the path /v1, where the channel's class requires one: HttpOnly, SameSite=Strict, and Secure wherever the transport is encrypted.
  • A refusal carries the structured error in the body, with the HTTP status as a coarse hint: 400 for a malformed request, 403 for a scope refusal, 409 for a channel refusal, 503 while the instance is stopping. The code in the body is authoritative.

Ordering​

PreservedNot promised
the frames of one call, in the order the Core sent themany order between two calls
events about one subject, in the order they happenedany order between an event and an answer
a delivery's sequence, within one streamany order between two streams, or between a stream and the control shape

In the browser projection the control shape is a series of independent requests, so nothing orders two of them beyond what the client itself does.

How the contract states its version​

StatementWhereChecked
the package version of the protocol definitionsin the definitions themselvesby the build of every party
a version integera field of every Request, and of the first frame of an attachmentat every request, and once per attachment

A version is refused rather than negotiated, with compat.unsupported, at the earliest point that can say so.

Error codes​

CodeRefused when
operation.malformedthe request does not decode, or a required field is absent
operation.unknownit names an operation this Core does not implement
compat.unsupportedthe contract version is absent, or this Core does not support it
auth.requiredthe channel's class requires a credential and none was presented
auth.invalidthe credential was not accepted
channel.in_usea single channel is already held; the first client is untouched
channel.not_attacheda control request arrived with no live attachment — the browser projection only
channel.suspendedthe operation is withdrawn by this channel's grade; the detail names the grade and the channel that prevails
channel.not_localreclaim on a channel not bound as a local socket
subject.unknownnothing this channel may address bears that identity; the detail names the kind and the identity
scope.undeclaredthe object was never declared by the unit's Plugin
scope.withheldit is declared and not granted to that plugin; the detail names it
unit.not_runningthe operation needs a running unit and this one is not
unit.no_sessionthe unit holds no Session, so nothing can be issued on one
unit.unansweredthe wait elapsed with no acknowledgement or answer
unit.failedthe unit answered the Core's message with an error; the detail carries the unit's own code
instance.stoppingan orderly stop is in progress and the operation would act

The codes are one namespace across the surfaces: several are the administrative surface's with the same meaning.