Kernel evidence projection¶
The kernel records what happened in a run as envelopes on its return lane, and the control plane receives events and logs. Kernel evidence projection is the step between: every envelope the node reads is validated against the contract for its kind and recorded as an event or a log record, and an envelope of a kind the node has no handler for is kept as metadata rather than dropped. This page covers the handler set, what each kind becomes, and how invalid and unknown envelopes are treated.
From envelope to record¶
flowchart TB
RLN["Return lane<br/>kernel.return_envelope.v1"]
V{{"Envelope valid<br/>and digest-chained?"}}
H{{"Handler for kind<br/>and payload contract?"}}
PV{{"Payload valid for<br/>its contract?"}}
EV[("Event record<br/>kernel.return.<kind>")]
LG[("Log record")]
RT[("kernel.return.typed_metadata<br/>payload retained")]
X1["invalid_return_envelope"]
X2["invalid_return_payload"]
RLN --> V
V -.-> X1
V --> H
H -->|"none"| RT
H --> PV
PV -.-> X2
PV -->|"event kinds"| EV
PV -->|"log kinds"| LG
Each envelope is looked up by its kind and the contract_version of its
payload, so a kind whose payload contract changes is handled by the handler
for that version. A kind the node has no handler for is kept as
kernel.return.typed_metadata with its payload, digest and terminal flag, so a
newer kernel's evidence reaches the control plane even through an older node.
The handlers¶
xratud registers these handlers at start, and refuses to start without all of
them:
| Kind | Payload contract | Recorded as |
|---|---|---|
runtime.status |
kernel.return_envelope.v1 |
Event kernel.return.runtime.status |
runtime.log |
kernel.return_envelope.v1 |
Log record |
runtime.trace |
kernel.return_envelope.v1 |
Log record |
runtime.audit |
kernel.return_envelope.v1 |
Event kernel.return.runtime.audit |
runtime.fault |
kernel.fault_evidence.v1 |
Event kernel.return.runtime.fault |
runtime.evidence |
kernel.lifecycle_evidence.v1 |
Event kernel.return.runtime.evidence |
runtime.lifecycle |
kernel.lifecycle_evidence.v1 |
Event kernel.return.runtime.lifecycle |
runtime.stream.lifecycle |
kernel.stream_lifecycle.v1 |
Event kernel.return.runtime.stream.lifecycle |
runtime.policy.pre_invoke |
kernel.policy_trust_pre_invoke.v1 |
Event kernel.return.runtime.policy.pre_invoke |
runtime.policy.post_invoke |
kernel.policy_trust_post_invoke.v1 |
Event kernel.return.runtime.policy.post_invoke |
Each record carries the envelope's digest in its metadata, and the result
names the kind, category, sequence, payload contract version and envelope
contract version.
Decisions, scores and telemetry¶
Three further kinds of kernel evidence take the same path:
- Policy decisions. Every
PolicyDecisionrecord, one per hook firing, is projected unchanged as an event, carrying the run fingerprint, the rule, the bundle, the attachment level, the effect and any exemption applied. See The policy enforcement adapter. - Score reports. The kernel's score reports and score evidence are projected through the same metadata-only path, so the control plane holds each score's reference and digest.
- Sealed telemetry collections. The kernel's telemetry for a run is sealed as a collection; the node writes the body to your bucket and projects the collection's metadata.
In every case the body stays in your bucket and the control plane receives metadata, a payload reference and a digest. The node records what the kernel decided and measured; the decisions themselves are made in the kernel.
Lifecycle evidence also moves the run's runtime handle. See Kernel lifecycle bridge.
Invalid envelopes¶
| Code | Condition |
|---|---|
invalid_return_envelope |
The envelope's contract_version is other than kernel.return_envelope.v1, or it fails that contract |
invalid_return_payload |
The payload fails its kind's contract, or a kind whose handlers are versioned arrives without a payload contract_version |
The message names the kind and the failure:
invalid_return_payload:runtime.fault:<validation error>
invalid_return_payload:runtime.lifecycle:contract_version is required
An invalid envelope stops the read before it is acknowledged, so the lane
stays at the last acknowledged sequence and the next read resumes from there. A lane that stops advancing while the node logs
invalid_return_payload points at a kernel emitting a payload outside its
contract; compare the kernel image's version with the node's. See
Recovering the kernel link.
What the control plane receives¶
Every event and log record is serialized as an envelope, written to your bucket, and reported to the control plane as metadata with a payload reference and digest. See Event log envelopes.