Skip to content

Closure artifact sets and materialization

An admitted closure names the immutable physical artifacts a node needs to run it. That list is the closure's artifact set. The control plane derives it from the admitted closure, and the data plane acquires, verifies and opens each artifact through its role-owned protocol, then signs evidence of exactly what it opened. That step is materialization.

The control plane carries immutable publication metadata, references, digests and approval authority. Registry credentials and artifact bytes stay on the data plane.

The foundation image is selected by the project's runtime.xratu reference and profile. A mutable reference is resolved by the assigned data-plane build resolver, then admitted and pinned by the control plane. The project-release artifact catalog records that admitted foundation reference alongside the published block capsules and the runtime-provider artifact. The foundation image is built and admitted through foundation resolution, and the catalog holds a reference to it. See Foundation resolution and admission.

The resolver's signed observation names both the selected foundation digest and its digest-pinned rootfs reference. Admission compares the rootfs reference with the independently validated foundation manifest, so the admitted selection identifies the image bytes as well as the foundation digest.

From admitted closure to opened artifacts

flowchart TB
  subgraph CP["CONTROL PLANE: METADATA, REFERENCES, DIGESTS"]
    direction TB
    CAT[("Project-release artifact catalog")]
    ADM[("Admitted closure")]
    SET{{"Closure artifact set"}}
    CAT --> SET
    ADM --> SET
  end
  REG[("Your registries<br/>artifact bytes")]
  subgraph NODE["DATA PLANE NODE: CREDENTIALS AND BYTES"]
    direction TB
    OPEN["Fetch, verify, open<br/>one opener per artifact role"]
    CS[("Content store<br/>digest-keyed")]
    EV["Signed materialization evidence"]
    OPEN --> CS --> EV
  end
  SET -->|"assignment"| OPEN
  REG --> OPEN
  EV -.->|"evidence"| CP

What the set contains

The set holds exactly:

  1. one runtime_foundation_rootfs, the foundation's base image;
  2. one execution_capsule;
  3. one runtime_provider;
  4. one dependency_component for each component a binding selected from a source other than the foundation.

Components the foundation supplies travel inside the rootfs and are represented by that entry. The admitted set has exactly this coverage:

runtime_closure_artifact_set must exactly cover the closure's physical artifacts

The set is projected only after the closure is admitted. Before admission, the published runtime artifact catalog in the resolution assignment is candidate metadata. Each entry in the set must equal its catalog entry exactly, and a catalog belonging to another project is refused.

One project-release catalog can publish capsules for several reusable capability blocks. Which block runs is selected by the closure: each closure names one capsule in its admitted manifest, and the control plane checks that capsule's signed publication against the package release selected for that block. The admitted artifact set therefore contains exactly one execution capsule. Before reconciliation, the control plane checks the whole project catalog: it holds exactly one capsule for every project-selected block and only those, and each capsule's immutable archive reference matches its selected published package release.

Two digests per artifact

Field Meaning
artifact_role One of the four artifact roles
blob_digest The digest of the bytes the node fetches
immutable_reference The registry reference, ending in @<blob_digest>
content_digest The digest of the content once the blob is opened
publication_digest The publication record the artifact came from
publication_attestation The signed capsule publication, on the execution_capsule entry only

The node checks both digests: blob_digest after the fetch, and content_digest after opening. One content digest appears under one role only. The capsule's attestation must name the same capsule digest as its content_digest.

How a node materialises a closure

  1. Validate the admitted closure reference against its assignment and the resolution evidence it answers.
  2. For each artifact, reuse a verified entry from the node's content store, or dispatch to the artifact role's physical opener. The foundation opener reads OCI manifest, config and layer endpoints from an approved image registry; capsule, provider and component owners use their admitted publication protocols.
  3. Verify the acquired bytes and their role-specific publication authority.
  4. Open the artifact in a private staging root through its role-specific opener, then verify the opened content independently before atomic content-store promotion. Capsule archives are measured against their signed immutable file tree. Provider archives are measured against their complete payload tree, runtime layout and build provenance. Each role has its own opener.
  5. Charge the entry to the content store quota.
  6. Sign the materialization evidence with the node's workload identity.

Materialization works only from the admitted reference. It opens the views the closure already names, and the dependency bindings, foundation and provider stay as admitted.

The content store

Each node keeps a digest-keyed content store. Writes happen under one mutation lease and land atomically, and every entry carries a cache_generation that only increases.

Entries share physical blobs. Two entries backed by one blob are charged to the quota once, and releasing one entry leaves the blob in place while the other still references it. Garbage collection removes entries whose reference count is zero, and a blob goes when no entry references it.

A corrupt or inconsistent entry is evicted and fetched again under a new generation. Each recovery is counted in the evidence as corruption_recovery_count.

Before the data plane sends an assignment to the kernel, it retains every opened artifact at the generation named by the materialization evidence. The retention is all-or-nothing for the artifact set. An assignment that has already reached terminal state cannot retain the artifacts again.

Teardown reverses that assignment reference only after the kernel returns a terminal receipt for the same fence and runtime closure. Each content-store entry keeps a terminal reference tombstone, which makes teardown retries idempotent and distinguishes a completed release from an assignment that never held the artifact. Garbage collection cannot remove an artifact while an active assignment reference remains.

Scheduling may prefer a node whose store already holds a closure's artifacts. The closure that runs is the same on any node.

The materialization evidence

The evidence, RuntimeClosureMaterializationEvidenceV1, repeats the admitted closure identity: the assignment, fence, admission digest, closure digest, and the foundation, capsule, provider, view and compatibility digests. Each must equal the admitted reference, or the evidence is refused.

It adds what the node observed. Each entry in opened_artifacts records the artifact's identity and digests, its cache_entry_id and cache_generation, the opened_content_digest, blob_size_bytes, and blob_digest_verified and signature_verified, both of which must be true. The opened artifacts must cover the admitted set exactly.

content_store_accounting reports the store at that moment: store_entry_count, materialized_entry_count, resident_bytes, quota_bytes and corruption_recovery_count. materialized_entry_count equals the number of opened artifacts, store_entry_count is at least that, and resident_bytes stays within quota_bytes.

The evidence is signed with Ed25519 by the node's SPIFFE workload identity.

The project build creates this chain from authority the control plane has persisted. Replaying a completed build reuses the same project-release catalog and the same reconciliation identities, so one build has one artifact selection.

When materialization fails

Code Condition Where to look
RUNTIME_CLOSURE_ADMISSION_REFUSED The admitted reference does not validate against its assignment and resolution evidence The admission and assignment the node received
RUNTIME_CLOSURE_ARTIFACT_AUTHORITY_INVALID An artifact does not match its catalog entry or the authority for its role The published runtime artifact catalog and the admitted closure
RUNTIME_CLOSURE_ARTIFACT_FETCH_FAILED The node could not fetch a blob Registry reachability and the node's registry credentials
RUNTIME_CLOSURE_ARTIFACT_DIGEST_MISMATCH The fetched blob or the opened content has a different digest The artifact published under that reference
RUNTIME_CLOSURE_ARTIFACT_SIGNATURE_INVALID An artifact signature or the capsule publication attestation failed The capsule publication signer and attestation
RUNTIME_CLOSURE_ARTIFACT_OPEN_FAILED The blob could not be opened, or opened to no content The artifact's format for its role
RUNTIME_CLOSURE_CONTENT_STORE_QUOTA_EXCEEDED Materializing would take resident bytes past the quota The node's assigned content store quota
RUNTIME_CLOSURE_CONTENT_STORE_STATE_INVALID Store metadata disagrees with the admitted artifact, or accounting is outside quota The node's content store
RUNTIME_CLOSURE_MATERIALIZATION_EVIDENCE_REFUSED The constructed evidence failed its contract The admitted closure fields the evidence repeats

Related: Resolved runtime closures and Verified closure view, where the kernel opens the same artifacts again.