Skip to main content
Version: 0.6.0

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.

ServiceShape
Registerunary: one request, one answer
Sessionone bidirectional stream; the stream is the Session

There is no third service.

The registration exchange​

The request carriesAs
the plugin and unit identitiesstrings, exactly as the environment supplied them
the bootstrap tokenan opaque string, never logged and never stored
the protocol versionan integer
the artifact's version, language and SDK linestrings
the declared surfacefive lists: capabilities, streams, commands, queries, occurrences
the transports it offers beyond the ordered and the framed, which every library speaksa list of transport values; the shared object is the one that may be named
The answer carriesWhen
the outcome: accepted, accepted with restrictions, or refusedalways
the stage the request reachedon a refusal (Admission)
a code and a messageon a refusal
the Session identityon an acceptance
the granted scope, as the five listson an acceptance
the withheld items, one by oneon a restricted acceptance
the heartbeat terms: interval and toleranceon an acceptance

The envelope​

FieldCarried as
message identityan opaque string, unique within the Session
Session identitythe opaque string admission issued
sender's clockan integer, nanoseconds since the epoch
correlation identitythe 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​

FamilyMessageCarries
sessionOPENnothing beyond the header
sessionCLOSEnothing
sessionREVOKEDthe cause — liveness lost, plugin disabled, scope exceeded, protocol failure — and a line
controla commandthe command type and an opaque payload
controla stream's activationthe stream, its transport — ordered, framed or a shared object — and its address
controla stream's stopthe stream
ack—the outcome — accepted, done or failed — and a line; correlated
querya questionthe query type and an opaque payload
queryan answeran 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​

TransportCarriesEncoded as
an ordered, lossless stream socketdata messagesnot gRPC: one envelope per packet, encoded as on the Session, on a packet socket that keeps message boundaries
a framed socketopaque payloadsnot gRPC: a 16-byte header and the payload, one datagram per frame
a shared objectopaque payloadsits own convention, created and removed by the Core

See Streams and transports for the frame.

The version​

StatementWhereChecked
the package version of the definitionsthe definitions, yoke.plugin.v1by the build of every party
the protocol integerthe Manifest and the registration requestat 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.

CodeRefused when
admission.structural.malformedthe request does not decode, or a required field is absent
admission.identity.unknown_pluginthe Registry has no such plugin
admission.identity.unknown_unitno document composes this unit
admission.state.disabledan operator disabled the plugin
admission.auth.invalidthe token is not this Core's, or not for this pair
admission.auth.expiredthe startup window has passed
admission.auth.consumedthe token has already been spent
admission.compat.unsupportedthe protocol version is absent or unsupported
admission.consistency.divergentthe process describes itself differently from its Manifest; the detail names each difference
admission.conflict.unit_livethis unit is already live
admission.session.unavailablethe acceptance could not become an enforceable Session
session.unknowna first envelope's identity was never issued, is already used, or belongs to an ended Session
session.revokedthe Session ended before this message arrived
session.message.malformedan envelope carries no payload, or a field exceeds its bound
session.message.duplicatea message identity repeated within one Session
session.directiona family arrived from the side that may not send it
session.correlation.missinga family that must correlate did not
session.correlation.unknowna correlation names no message in this Session
scope.withheldthe operation names something declared but not authorised; the detail names it
scope.undeclaredit names something the process never declared
stream.inactivedata arrived for a stream that is not activated
command.unknownan acknowledgement names a command never issued
query.unknownan 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​

LimitValue
an opaque payload: a command's, a question's, an answer's, a data message's, an event's detail1 MiB
a line for a person: in an acknowledgement, a revocation, a health report, an event1 KiB, UTF-8

A message beyond either is refused at the structural check with session.message.malformed.