Skip to content

Protocol handshake and compatibility gating

A node and a control plane agree on four contract versions, and both sides check the agreement on the calls that establish and hold the link. The rule is a window of one minor version either side, within the same version family. This page is where the check happens, the rule it applies, and what each side does with a mismatch, so an upgrade can be planned by the window rather than discovered by a refusal.

Where the versions are checked

flowchart TB
  subgraph R1["AT START, once"]
    direction LR
    A1["xratud sends<br/>its pinned versions"]
    A2{{"Discovery answers<br/>served versions and window"}}
    A3{{"xratud compares<br/>answer with its pin"}}
    A1 --> A2 --> A3
  end
  subgraph R2["EVERY REGISTER AND WATCH"]
    direction LR
    B1["xratud sends<br/>all four versions"]
    B2{{"Control plane checks<br/>each within the window"}}
    B3{{"xratud checks the answer<br/>four versions and window"}}
    B1 --> B2 --> B3
  end
  subgraph R3["EVERY PULL"]
    direction LR
    C1["xratud sends<br/>the schema version"]
    C2{{"Control plane checks<br/>the schema version"}}
    C3{{"xratud checks the answer<br/>protocol and schema"}}
    C1 --> C2 --> C3
  end
  R1 ~~~ R2 ~~~ R3

Each row is one moment, in order: what the node sends, what the control plane answers or checks, and what the node checks in the answer. A mismatch in either direction is caught in the row where it first appears, and every check refuses with a named reason.

The four versions

Version Current Reason on mismatch
Transport protocol dataplane.v1 PROTOCOL_VERSION_INCOMPATIBLE
Assignment schema assignment.v1 ASSIGNMENT_SCHEMA_INCOMPATIBLE
Trust contract bootstrap.trust.xratu/v1 TRUST_CONTRACT_INCOMPATIBLE
Credential issuer system.runtime_identity_issuer.contract.v1 CREDENTIAL_ISSUER_INCOMPATIBLE

Registration and watch carry all four. A pull carries the assignment schema version, and its answer carries the protocol and schema versions.

The window rule

A version is read as a family and a minor number, split at its last /v or .v:

dataplane.v1                                   family dataplane, minor 1
bootstrap.trust.xratu/v1                       family bootstrap.trust.xratu, minor 1
system.runtime_identity_issuer.contract.v1     family system.runtime_identity_issuer.contract, minor 1

Two versions are compatible when their families are equal and their minors differ by at most one. A control plane at dataplane.v2 accepts nodes at dataplane.v1, v2 and v3, and refuses v4. A version that does not parse into a family and a minor is compatible only with an identical string.

The window is published as part of every registration and watch answer, and the node requires it to be exactly this:

compatibility_window.supported_minor_window   N-1, N, N+1

An answer with any other window is refused by the node, so a control plane cannot widen or narrow the window without both sides changing together.

What the control plane answers

A call outside the window is answered 409 with the reason, both values, and a hint naming what to change:

{
  "detail": {
    "code": "PROTOCOL_VERSION_INCOMPATIBLE",
    "message": "dataplane protocol version is incompatible",
    "expected": "dataplane.v2",
    "received": "dataplane.v4",
    "hint": "upgrade/downgrade xratud within supported N-1/N/N+1 minor window"
  }
}

The hints for the trust contract and the credential issuer name the node's bootstrap trust contract and its runtime identity issuer version, and the hints for the protocol and the schema name the xratud build.

What the node does

On a watch, an incompatible answer suppresses intake for that cycle. The watch returns no items and the node's revision stays where it was:

suppressed: true
reason: incompatible_protocol
reason_code: PROTOCOL_VERSION_INCOMPATIBLE

The transport is marked degraded with the error, so the node keeps reporting and takes no new work until the versions agree.

On a registration, an incompatible answer is raised rather than retried, because retrying cannot change either side's version.

Planning an upgrade by the window

The window lets a control plane and its nodes be one minor version apart, which is the room an upgrade has. Moving the control plane one minor ahead keeps every node inside the window; moving it two ahead leaves every node that has not moved outside it, where each one stops taking work at its next watch. A version in a different family is outside the window at any number. See Contract versioning and hardcut rules.