The kernel bridge¶
The bridge is where a node stops orchestrating and starts supervising. It holds the dialled operator lane into each kernel the node owns, and the return lane those kernels push evidence on.
For the link's establishment, states and recovery, see Data plane to kernel. This page is what the bridge owns on the node.
What it holds per runtime¶
flowchart LR
subgraph BR["KERNEL BRIDGE, in xratud"]
direction TB
subgraph H1["RUNTIME HANDLE, per owned runtime"]
direction TB
EP["Resolved endpoint<br/>Service, EndpointSlice"]
OL["Operator lane<br/>opened per command"]
RC[("Return lane cursor<br/>last acknowledged seq")]
end
end
subgraph PR["PROJECT RUNTIME"]
direction TB
K["Kernel"]
end
OL -->|"runtime.* commands"| K
K -->|"return envelopes"| RC
Each owned runtime has one handle, and everything the bridge knows about that runtime is inside it. The two lanes are two edges with opposite directions, and a reconnect resumes from the cursor on the return edge.
A handle is per runtime instance rather than per assignment, because a node supervises a runtime across the assignments that target it.
The command surface is an allowlist¶
The bridge sends ten runtime.* operator commands and nothing else. A request
in the run. namespace is refused with its own reason, because execution
syscalls are kernel-native and application-facing.
That boundary is the reason a node's credentials on this lane grant supervision of a runtime and nothing about what it executes.
It owns the cursor, not the evidence¶
The kernel produces evidence and keeps it in its own append-only store, together
with the position the node has acknowledged. The bridge consumes, acknowledges
cumulatively, and resumes from that acknowledged position after any break,
including a restart of xratud.
Two consequences follow for diagnosis. Distance between what the kernel has written and what the bridge has acknowledged is delivery lag, not loss. And a gap in the chain holds the cursor rather than being stepped over, so the gap's position is nameable. See Evidence continuity across both links.
Refusals are classified before they are retried¶
The bridge separates a refusal from a failure. A failure is retried with backoff and the connection re-established; a terminal refusal stops the call and the reconnect.
The reason codes are published so that both sides read one definition, which is
why a node branching on stale_fence and a kernel emitting it agree. See
Detecting a kernel link break.
When a kernel, a process or a node goes away¶
A project runtime outlives any one connection to it. The bridge's job in every failure is to reach the same runtime again, or to let a different node reach it, without two nodes ever commanding it at once.
flowchart LR
subgraph CP["CONTROL PLANE"]
direction TB
OWN[("Runtime ownership<br/>runtime_instance_id, owner node,<br/>lease_id, fence_epoch")]
end
subgraph NA["NODE A, previous owner"]
direction TB
BA["Kernel bridge<br/>holds fence N"]
end
subgraph NB["NODE B, new owner"]
direction TB
BB["Kernel bridge<br/>new handle, fence N+1"]
end
subgraph PR["PROJECT RUNTIME, keeps running"]
direction TB
K["Kernel<br/>accepts fence N+1 only"]
CS[("Continuity store<br/>last_acked_seq")]
K --- CS
end
OWN -->|"reassigned, fence N+1"| BB
BB ==>|"re-handshake, resume from last_acked_seq"| K
BA -.->|"stale_fence, stops"| K
The runtime and its evidence stay where they are. What moves is the ownership record in the control plane, and the fence it carries decides which node's bridge the kernel answers.
| What went away | What the bridge does | Guaranteed |
|---|---|---|
| The kernel restarted or was rescheduled | Re-resolves the endpoint from the Service and EndpointSlice, re-handshakes, and resumes the return lane from last_acked_seq, retrying under backoff from 0.1 to 30 seconds |
No evidence is skipped; anything redelivered is recognised by its sequence |
| The node lost the control plane | Nothing changes on this lane; running work continues and evidence keeps accumulating in the kernel | The kernel link is independent of the control-plane link |
xratud restarted on the same node |
The new process rebuilds a handle for each runtime it owns, re-handshakes, and resumes from the kernel's acknowledged position | The runtime was never stopped; its runs continue across the restart |
| The node was lost, overloaded or made ineligible | The control plane reassigns ownership to another node with the fence epoch raised; that node's bridge opens a handle for the same runtime and resumes from the acknowledged cursor | The previous owner is refused with stale_fence at the kernel and on the fence at the control plane, and the kernel closes the held return channel that belonged to it |
A lost node is noticed through its lease: renewals stop, the lease lapses after 30 seconds, and the work is requeued for another node to claim. A planned move follows a fixed sequence: new runs are frozen on the runtime, ownership is handed over with a new fence epoch, and continuity resumes on the new owner.
stale_fence is terminal, so a displaced node stops rather than reconnecting,
and the only bridge a runtime answers is the one holding its current fence. See
Ownership handover across a break,
Recovering the kernel link
and
Assignments and leases during a break.
Readiness before commands¶
Before sending operator commands the bridge resolves a ready replica and handshakes. A kernel still starting answers with a retryable reason rather than a refusal, so the bridge waits instead of concluding the link is broken.
What it also resolves¶
The bridge is where the node resolves what a kernel needs to exist at all: the kernel image, by profile, version or digest, and the runtime resolution facts the assignment's resolver snapshot admits.
Resolving the image on the node rather than in the control plane is the same split as every other artifact operation: the control plane names it, the node fetches it. See The tenant byte rule.