Skip to content

The three-plane contract

Four wire paths join the planes. Each carries one versioned document shape, each is checked before the receiving side acts, and each answers a named reason when the check fails. Knowing which path a failure came from is usually enough to locate it.

flowchart TB
  CP["Control plane"]
  DP["Data plane, xratud"]
  K["Kernel, one per project runtime"]
  CP -- "assignment_envelope.v1<br/>pulled by the node" --> DP
  DP -- "kernel.grpc_control.v1<br/>runtime.* commands, dialled" --> K
  K -- "kernel.return_envelope.v1<br/>sequenced, pushed" --> DP
  DP -- "ack, progress, complete, telemetry<br/>posted by the node" --> CP

Control plane to data plane

The assignment envelope is the only runtime dispatch contract between the two planes. A node acts on nothing else, so what a node is doing is answerable from the envelope the control plane recorded.

assignment_id, assignment_key, run_id, node_id, attempt, session_id
assignment              correlation, generation, claim and fence tokens, lease expiry
invocation              interface_id, export_ordinal, session_id, entrypoint, engine
resolver_snapshot       manifest identity, selected export, resolver profile,
                        distribution_artifacts with package, version, ref and digest
effective_policy_snapshot and effective_policy_digest
policy_decision_proof   snapshot_digest, required_stages
trust_chain, workload_identity, secret_resolution_grants
determinism_contract, idempotency, llm_runtime_pinning, generation_controls

The envelope is self-checking. Validation recomputes what it can and refuses on disagreement rather than preferring one field over another:

  • policy_decision_proof.snapshot_digest must equal effective_policy_digest, and that digest must equal the digest of effective_policy_snapshot.
  • required_stages must be exactly pre and post.
  • invocation.interface_id and export_ordinal must match the resolver snapshot's block and selected export.
  • resolver_profile.resolver_fingerprint must equal the fingerprint recomputed from the manifest identity, the interface, the export ordinal, the entrypoint, the resolver mode and the capsule digest.
  • Top-level session_id, invocation.session_id and assignment.run_id must be the same value, because session_id_policy is run_id.

A field that was renamed is refused by name rather than ignored. resolver_snapshot.execution_artifacts raises an error naming its replacement, distribution_artifacts, so an old producer fails loudly at the boundary.

Data plane to kernel

The operator lane is private gRPC over HTTP/2 with mandatory mutual TLS, generated from one checked-in protocol definition. It carries ten non-execution commands and nothing else:

runtime.ping                    runtime.health
runtime.status.snapshot         runtime.flush_evidence
runtime.drain_prepare           runtime.drain_commit
runtime.rotate_identity         runtime.diagnostics.set
runtime.diagnostics.snapshot    runtime.diagnostics.clear

Acceptance is re-evaluated per request rather than once per session: peer identity, protocol compatibility, trust bundle agreement, and ownership lease with its fence. A command outside the allowlist is refused, and the run. namespace has its own refusal because it belongs to the execution lane.

The channel is opened per command. A discrete authenticated act does not hold a channel between calls, so a session cannot survive an ownership handover.

Kernel to data plane

The return lane is a long-lived bidirectional stream the kernel pushes. Every envelope carries the full correlation tuple and links to the one before it:

contract_version    kernel.return_envelope.v1
seq                 monotonic within the lane
kind, category      category is status, event, log, evidence or fault
workspace_uuid, assignment_id, run_id, node_id, trace_id
emitted_at, terminal
payload
prev_digest, digest

Resumption is from last_acked_seq. Acknowledgement is cumulative and stops at the last contiguous sequence, so a gap holds the cursor rather than being acknowledged past. The cursor advances only as far as the kernel reports available, checked against max_seq and the terminal sequence.

Data plane to control plane

The node posts acknowledgement, progress and completion, and reports telemetry metadata with object references. Every report is idempotent and replay-safe, and carries the fence it was produced under:

run_id, node_id, attempt, assignment_key
fence_token         the fence the node held
observed_generation the assignment generation it acted on
trust_verification  digest and provenance verification result

Payload bodies are written to the bucket by the node; what reaches the control plane is metadata plus the object reference. See The tenant byte rule.

What a refusal means

The control lane's reason codes are a closed set both planes branch on, so they are behaviour rather than message text.

Reason Meaning
accepted The command was admitted
malformed_request The request did not parse against the contract
peer_identity_rejected The verified certificate is not the expected identity
protocol_mismatch The two sides disagree on the control protocol version
ownership_rejected The caller is not the current owner, classified as non_owner or stale_fence
unsupported_operator_command The command is outside the allowlist
unsupported_on_operator_lane The command is in the run. namespace
startup_not_ready The kernel has not finished starting
startup_evidence_incomplete Startup evidence is not yet complete

A refusal is an answer and a failure is the absence of one, so they are handled differently. Seven answers are terminal, and the node stops immediately whatever retry budget remains:

stale_fence                     runtime_session_non_owner
runtime_session_not_found       peer_identity_rejected
unsupported_on_operator_lane    unsupported_operator_command
trust_bundle_digest mismatch

A terminal refusal also stops the reconnect, because re-establishing a fenced session is how two nodes come to believe they both own one runtime. Everything else is retried with a delay that starts at 0.1 seconds, doubles per consecutive attempt, and is capped at 30 seconds, and the connection is re-established: a kernel that vanished is usually rescheduled, restarted or drained onto another node.