Runtime closure materialization and reconciliation¶
A project's closure reaches a node in three stages, each delivered as its own assignment, and the node must treat every stage the same way: check that it is the node the stage was issued to, run exactly that stage, and report the outcome in a form the control plane can admit. This page covers the stage task every reconciliation assignment carries, what the node checks before running it, the materialization stage that ends reconciliation, and how each stage reports.
For the order of the stages and the control plane's side of each, see Closure reconciliation and upgrade.
One task, three stages¶
flowchart TB
subgraph TASK["STAGE TASK, xck.runtime_closure_reconciliation_task.v1"]
direction LR
HDR["kind, stage,<br/>task_assignment_id, reconciliation_id"]
SI[("stage_input<br/>this stage's documents")]
CO[("continuation<br/>unchanged across stages")]
end
subgraph NODE["NODE"]
direction TB
WI{{"Workload identity equals<br/>expected_workload_identity"}}
subgraph ST["THE STAGE THE TASK NAMES"]
direction LR
F["foundation_resolution"]
C["closure_resolution"]
M["materialization"]
end
WI --> ST
end
subgraph RES["COMPLETE REPORT, result"]
direction LR
RF[("foundation_resolution_evidence")]
RC[("runtime_closure_resolution_result,<br/>runtime_closure_resolution_evidence")]
RM[("runtime_closure_materialization_evidence,<br/>xck_assignment_handoff")]
end
TASK --> WI
F --> RF
C --> RC
M --> RM
The task names its stage, and its kind must be the one that stage owns, so a
node runs exactly the stage the control plane issued. The continuation
travels unchanged from the first stage to the last, so the materialization
stage works under the same sealed authority the foundation stage started with.
The stage task¶
Every reconciliation assignment carries a task with exactly these fields:
| Field | Holds |
|---|---|
contract_version |
xck.runtime_closure_reconciliation_task.v1 |
kind |
The assignment kind of the stage |
stage |
foundation_resolution, closure_resolution or materialization |
task_assignment_id, reconciliation_id, assignment_ref |
The assignment and the reconciliation it belongs to |
stage_input |
The documents this stage works from |
continuation |
The sealed inputs every stage shares |
The stage and kind pair are fixed:
foundation_resolution xck.foundation_reference_resolution.v1
closure_resolution xck.runtime_closure_resolution.v1
materialization xck.runtime_closure_materialization.v1
The first two stages carry one resolution_assignment as their input. The
materialization stage carries the admitted closure reference together with the
resolution assignment, evidence and result it was admitted from.
The continuation holds the foundation policy and manifest, every closure
input, the resolver, the closure fence, the closure admission id and revision,
content_store_quota_bytes, lease_seconds, and the handoff_inputs: the
sealed policy and trust input, executable dispatch selection and other
non-secret closure authority. Secrets reach the handoff from the
assignment's own grants: the node resolves them through XSRP and projects the
admitted results into the handoff's resolved delivery.
A node takes these assignments only when it advertises the
xck_runtime_closure_reconciliation capability at registration. See
Registration and heartbeat emit.
Before a stage runs¶
- The task is validated against its contract, including that its
kindmatches itsstageand that itsstage_inputhas exactly the documents that stage takes. - The node's identity is checked. The resolution assignment names
expected_workload_identity, and the node's SPIFFE identity must equal it. Evidence the node signs is signed under that identity, so a node other than the one the stage was issued to cannot produce admissible evidence. - The node's facilities for the stage are present. Each stage needs its
own: foundation metadata lookup for the first; source observation, artifact
acquisition, component publication and attestation for the second; the
content store, blob fetch, opening, verification and secret delivery for the
third; evidence signing for all three. A node missing any refuses with
RUNTIME_CLOSURE_RECONCILIATION_DEPENDENCY_MISSING, naming what is missing.
The materialization stage¶
The last stage turns the admitted closure into bytes on the node and one document for the kernel:
- Materialize the artifact set into the node's content store, under the
quota in
content_store_quota_bytes, and sign the materialization evidence. See Digest and signature verification and The cache manager. - Add the credentials the work needs, fetched through the installation-local XSRP gateway, each addressed to the block that declared it; none when the project declares no keys. See XSRP resolution.
- Assemble the assignment handoff from the admitted closure, the materialization evidence and the handoff inputs. See The DP bundle.
The stage's result carries both the materialization evidence and the handoff.
How a stage reports¶
Every stage reports through the assignment's status channel:
ack status acked
progress status running, progress.stage = <stage>
complete status succeeded, result = the stage's documents
or
status failed, error.code = the stage's refusal code
execution_report.stage names the stage in every report. A failed stage
carries the refusal code of the step that refused it, such as
FOUNDATION_REFERENCE_LOOKUP_REFUSED or closure_dependency_unresolved, with
that step's detail as the message. The codes for each stage are on its page.
The control plane then admits or refuses the result. Its refusals, including a result under a superseded fence, are listed on Closure reconciliation and upgrade.
Release¶
A closure the node no longer runs is released: each of its artifacts gives up the content store reference its materialization took, and garbage collection later removes entries no closure references. See The cache manager.