Skip to content

Cross-plane contracts

A contract is cross-plane when more than one plane produces or validates it. Those definitions live in one place, are owned by one plane, and are generated into every other language that has to read them. This page is where each kind of definition is owned, and how a definition reaches a plane that cannot read the original.

Three kinds of definition

Kind Owned by Example
Cross-plane wire document One plane, consumed by the others The assignment envelope, the kernel return envelope
Shared grammar and taxonomy The protocol it belongs to Flow compilation, policy grammar, XCI compilation
Plane-native semantics The capability that uses it A control-plane service's request shapes

A plane-native definition is never copied into another plane. A field carried across layers keeps the same name at every layer, so a value can be followed from the document that produced it to the record that consumed it without a translation table.

The contract matrix

Seven contracts are declared cross-plane, each with one owner and an explicit producer and consumer set:

Contract Required version Owner Produced by Consumed by
dataplane_protocol_version dataplane.v1 Control plane Control plane Data plane
assignment_schema_version assignment.v1 Control plane Control plane Data plane, kernel
kernel_events_protocol_version kernel.events.v1 Kernel Kernel Data plane, control plane
kernel_result_protocol_version kernel.result.v1 Kernel Kernel Data plane, control plane
kernel_runtime_evidence_contract_version kernel.runtime_evidence.v1 Shared Kernel Data plane, control plane
kernel_stream_lifecycle_contract_version kernel.stream_lifecycle.v1 Shared Kernel Data plane, control plane
kernel_lifecycle_evidence_contract_version kernel.lifecycle_evidence.v1 Shared Kernel Data plane, control plane

The matrix carries its own release policy, and all three values are part of the contract rather than deployment configuration:

mode                          fail_closed
major_version_sync_required   true
allow_unknown_contracts       false

A contract absent from the matrix is not permitted across a plane boundary. An unknown contract id is refused rather than being passed through as opaque.

The events feed has its own ownership record: the control plane owns the schema, and the data plane, the kernel and the control plane all produce into it. Its required keys are fixed for every producer:

run_id, seq, node_id, event_type, payload, created_at

Reaching a plane that cannot read the original

The kernel is Rust and the shared definitions are authored in Python, so a definition reaches it by generation rather than by being declared twice.

One source, three readers

flowchart LR
  subgraph SRC["ONE AUTHORED SOURCE"]
    direction TB
    MX[("Contract matrix")]
    VO[("Control-lane vocabulary")]
    FX[("Golden fixtures")]
  end
  PJ[("Checked-in projection")]
  subgraph RD["READERS"]
    direction TB
    CP["Control plane"]
    DP["xratud"]
    K["Kernel"]
  end
  SRC --> CP
  SRC --> DP
  SRC -->|"generated, contract-tested"| PJ
  PJ -->|"read at build"| K

Every reader resolves to the same box on the left, so a reason code, a version or a command name is one value wherever it is read. The kernel is the only reader with an intermediate, and that intermediate is tested against the source.

A contract test asserts that the checked-in projection still matches what the source produces, and the kernel's build reads that projection to produce its constants.

The consequence for an upgrade is the one worth holding onto: a kernel that has drifted from a contract fails to build rather than running against a stale value. Drift is caught before a release exists, not by a node refusing an envelope in production.

The control-lane vocabulary

The values both planes branch on are published the same way. The kernel control vocabulary projects the control protocol version, the operator command allowlist, the rejection reasons, the ownership failure classifications, the return envelope categories and the diagnostics operations into one document under kernel.control_lane_vocabulary.v1.

Because both sides read one projection, a reason code is behaviour rather than message text: a node branches on stale_fence and the kernel emits the same string from the same source. See The three-plane contract for what each reason means.

Why the cross-plane set stays small

A value is cross-plane only when more than one plane reads it. Everything else stays with the plane that uses it, because a cross-plane value makes every plane a stakeholder in a change only one of them needed.

For an operator that keeps the upgrade surface small: seven contracts move the planes together, and everything outside the matrix can change within a plane without coordinating a release.