The wire
How the plugin surface is carried: the two services, the registration exchange, the envelope, the payloads, and the error codes. The protocol definitions are authoritative on the bytes; this page names what they carry.
Two services on one socket
Both are reached at YOKE_SOCKET, the instance's plugin channel.
| Service | Shape |
|---|---|
| Register | unary: one request, one answer |
| Session | one bidirectional stream; the stream is the Session |
There is no third service.
The registration exchange
| The request carries | As |
|---|---|
| the plugin and unit identities | strings, exactly as the environment supplied them |
| the bootstrap token | an opaque string, never logged and never stored |
| the protocol version | an integer |
| the artifact's version, language and SDK line | strings |
| the declared surface | five lists: capabilities, streams, commands, queries, occurrences |
| the transports it offers beyond the ordered and the framed, which every library speaks | a list of transport values; the shared object is the one that may be named |
| The answer carries | When |
|---|---|
| the outcome: accepted, accepted with restrictions, or refused | always |
| the stage the request reached | on a refusal (Admission) |
| a code and a message | on a refusal |
| the Session identity | on an acceptance |
| the granted scope, as the five lists | on an acceptance |
| the withheld items, one by one | on a restricted acceptance |
| the heartbeat terms: interval and tolerance | on an acceptance |
The envelope
| Field | Carried as |
|---|---|
| message identity | an opaque string, unique within the Session |
| Session identity | the opaque string admission issued |
| sender's clock | an integer, nanoseconds since the epoch |
| correlation identity | the message identity it answers; absent where the family never correlates |
The payload is one of eight alternatives, and the one that is set is the family. Exactly one is set.
The payloads
| Family | Message | Carries |
|---|---|---|
| session | OPEN | nothing beyond the header |
| session | CLOSE | nothing |
| session | REVOKED | the cause — liveness lost, plugin disabled, scope exceeded, protocol failure — and a line |
| control | a command | the command type and an opaque payload |
| control | a stream's activation | the stream, its transport — ordered, framed or a shared object — and its address |
| control | a stream's stop | the stream |
| ack | — | the outcome — accepted, done or failed — and a line; correlated |
| query | a question | the query type and an opaque payload |
| query | an answer | an opaque payload; correlated |
| data | — | the sequence and an opaque payload |
| health | — | the grade, 0–99, and a line. A grade above 99 is read as 99, with a warning |
| event | — | the occurrence class, the severity 0–99, a line, and an opaque detail. A severity above 99 is read as 99, with a warning, and the report is accepted |
| error | — | the code, a message, and a detail typed by the code; correlated where attributable |
- A data message travels on its stream's ordered transport, never on the Session, and carries no stream identifier: the transport already names the stream.
- An opaque payload is carried and never decoded. The command type and the query type are the parts the Core reads, because capabilities are named against them.
Other transports
| Transport | Carries | Encoded as |
|---|---|---|
| an ordered, lossless stream socket | data messages | not gRPC: one envelope per packet, encoded as on the Session, on a packet socket that keeps message boundaries |
| a framed socket | opaque payloads | not gRPC: a 16-byte header and the payload, one datagram per frame |
| a shared object | opaque payloads | its own convention, created and removed by the Core |
See Streams and transports for the frame.
The version
| Statement | Where | Checked |
|---|---|---|
| the package version of the definitions | the definitions, yoke.plugin.v1 | by the build of every party |
the protocol integer | the Manifest and the registration request | at stage 5 of admission |
A Manifest and a process disagreeing about the protocol are refused at stage 6, as a divergence.
Error codes
An error is a code, a message for a person, and an optional detail.
| Code | Refused when |
|---|---|
admission.structural.malformed | the request does not decode, or a required field is absent |
admission.identity.unknown_plugin | the Registry has no such plugin |
admission.identity.unknown_unit | no document composes this unit |
admission.state.disabled | an operator disabled the plugin |
admission.auth.invalid | the token is not this Core's, or not for this pair |
admission.auth.expired | the startup window has passed |
admission.auth.consumed | the token has already been spent |
admission.compat.unsupported | the protocol version is absent or unsupported |
admission.consistency.divergent | the process describes itself differently from its Manifest; the detail names each difference |
admission.conflict.unit_live | this unit is already live |
admission.session.unavailable | the acceptance could not become an enforceable Session |
session.unknown | a first envelope's identity was never issued, is already used, or belongs to an ended Session |
session.revoked | the Session ended before this message arrived |
session.message.malformed | an envelope carries no payload, or a field exceeds its bound |
session.message.duplicate | a message identity repeated within one Session |
session.direction | a family arrived from the side that may not send it |
session.correlation.missing | a family that must correlate did not |
session.correlation.unknown | a correlation names no message in this Session |
scope.withheld | the operation names something declared but not authorised; the detail names it |
scope.undeclared | it names something the process never declared |
stream.inactive | data arrived for a stream that is not activated |
command.unknown | an acknowledgement names a command never issued |
query.unknown | an answer names a question never asked |
A refusal that cannot be delivered — the Session does not resolve — is recorded on the Core's side and not retried.
Limits
| Limit | Value |
|---|---|
| an opaque payload: a command's, a question's, an answer's, a data message's, an event's detail | 1 MiB |
| a line for a person: in an acknowledgement, a revocation, a health report, an event | 1 KiB, UTF-8 |
A message beyond either is refused at the structural check with session.message.malformed.