Skip to content

Artifact pull and resolution

A reference such as an image tag can name different bytes tomorrow than it names today, so a node settles every reference to a digest before the bytes behind it are used. A build carries a pull contract that lists each input image and the policy for resolving it; a runtime closure carries immutable references that already end in a digest. This page covers how each kind is resolved, the requests the node makes to your registry, and the evidence and refusals each produces.

Two kinds of reference

flowchart TB
  subgraph BA["BUILD ASSIGNMENT"]
    direction TB
    PC[("Pull contract<br/>build.artifact_pull_contract.v1")]
  end
  subgraph CA["CLOSURE ASSIGNMENT"]
    direction TB
    IR[("Immutable reference<br/>oci://endpoint/repository@sha256:...")]
  end
  subgraph NODE["NODE"]
    direction TB
    RA{{"Registry adapter<br/>tag or digest, host policy"}}
    EV[("Pull evidence<br/>resolved digests")]
    RF{{"Scope check<br/>endpoint and repository_root"}}
    RA --> EV
  end
  REG[("Your registry")]
  PC --> RA
  IR --> RF
  RF ==>|"GET /v2/repository/blobs/digest"| REG

A build's references are resolved under a policy, because an image the build starts from can be named by a tag. A closure's references are immutable already, so the node checks only that each one points inside your registry, and fetches the blob by its digest.

Build pulls

The control plane compiles the pull contract when it creates a build assignment and places it in the executor contract. Each target is an image the build reads, with a purpose from a closed set:

Purpose Taken from
build_tool_image The build executor's image, always present
base_image The composition's base image, when it names one
engine_image The composition's engine image, when it names one
runtime_image The project runtime kernel image, when it names one
auxiliary_image An additional image the contract lists

A target the control plane knows a digest for arrives with a resolved_digest_ref beside its reference. For the policy's settings and defaults, see Publish and pull contracts.

How one target resolves

The node checks the contract as a whole, then resolves each target in order:

flowchart TB
  T["Pull target<br/>reference, resolved_digest_ref"]
  P{{"reference parses as<br/>an OCI image reference?"}}
  R{{"resolved_digest_ref given?"}}
  M{{"same registry host<br/>and repository?"}}
  D{{"digest known, from<br/>resolved_digest_ref or reference"}}
  H{{"registry host allowed?"}}
  U{{"resolution policy<br/>admits a tag?"}}
  OKD["resolution_mode<br/>resolved_digest"]
  OKT["resolution_mode<br/>tag_input"]
  E1["pull_target_invalid"]
  E2["pull_target_resolution_mismatch"]
  E3["pull_registry_forbidden"]
  E4["pull_digest_required or<br/>pull_tag_input_forbidden"]
  T --> P
  P -->|"yes"| R
  P -.->|"no"| E1
  R -->|"yes"| M
  R -->|"no"| D
  M -->|"yes"| D
  M -.->|"no"| E2
  D --> H
  H -.->|"denied, or outside<br/>a non-empty allow list"| E3
  H -->|"digest known"| OKD
  H -->|"tag only"| U
  U -->|"yes"| OKT
  U -.->|"no"| E4

A tag without a digest reaches the build only when the policy allows it: resolve_tags_to_digest and fail_on_unresolved_tags together refuse it with pull_digest_required, and allow_tag_inputs set to false refuses it with pull_tag_input_forbidden. Under the default policy every target must arrive with a digest.

A resolved reference is written in canonical form, with the scheme, the tag when there is one, and the digest:

oci://<registry_host>/<repository>:<tag>@sha256:<64 hex>

The pull evidence

The node records what it resolved as build.artifact_pull_runtime_evidence.v1, carried in the build's result as artifact_pull_evidence:

{
  "contract_version": "build.artifact_pull_runtime_evidence.v1",
  "pull_contract_version": "build.artifact_pull_contract.v1",
  "policy_version": "build.artifact_pull_contract.v1",
  "status": "succeeded",
  "pulled_targets": [
    {
      "purpose": "base_image",
      "reference": "oci://registry.example.com/base/python:3.12",
      "resolved_ref": "oci://registry.example.com/base/python:3.12@sha256:5b1f...",
      "resolved_digest": "sha256:5b1f...",
      "resolution_mode": "resolved_digest",
      "source": "composition_contract.base_image_ref"
    }
  ],
  "resolved_digests": [
    "oci://registry.example.com/base/python:3.12@sha256:5b1f..."
  ],
  "attempts": 1,
  "latency_ms": 0,
  "failure_reason_code": "",
  "reason_codes": []
}

Compare resolved_digests with the images your build log shows were pulled. A target with resolution_mode tag_input has no entry in resolved_digests, and its build consumed whatever the tag named at the time.

When a build pull is refused

Every refusal carries code INVALID_ARGUMENT and a message that starts with the reason:

Reason Condition
invalid_pull_contract The contract is missing, its contract_version or policy_version is other than build.artifact_pull_contract.v1, or pull_targets is empty
tenant_artifact_runtime_invalid The contract's tenant artifact runtime lacks endpoint or repository_root
pull_target_purpose_unsupported A target's purpose is outside the five above
invalid_pull_target A target has no reference
pull_target_invalid A reference does not parse as an OCI image reference with a tag or digest
pull_target_resolution_mismatch resolved_digest_ref names a different registry host or repository from reference
pull_registry_forbidden The registry host is on the denied list, or missing from a non-empty allowed list
pull_digest_required The target has no digest and the policy requires one
pull_tag_input_forbidden The target has no digest and the policy refuses tag inputs

Closure fetches

Each artifact in an admitted runtime closure carries an immutable_reference that ends in its blob_digest. Before the fetch, the node checks that the reference is inside your registry:

  1. The scheme is oci and the host equals the tenant artifact runtime's endpoint.
  2. The repository equals repository_root or sits below it.

The node then requests the blob by digest, with authorization headers issued for its build workload by your cloud provider:

GET https://<endpoint>/v2/<repository>/blobs/<blob_digest>

A response other than 200, or a request still incomplete after 20 seconds, fails the fetch. The bytes returned are hashed, and a digest other than blob_digest fails the fetch as well. Materialization reports every fetch failure as RUNTIME_CLOSURE_ARTIFACT_FETCH_FAILED, with the registry's reason in the detail:

artifact fetch failed for sha256:40e4f710...: immutable artifact reference is outside the tenant repository root
artifact fetch failed for sha256:40e4f710...: registry blob fetch failed with status 404
artifact fetch failed for sha256:40e4f710...: registry authorization failed: ...

A fetch happens only when the node's content store has no verified entry for the artifact. See The cache manager and Digest and signature verification for what is checked before and after the bytes arrive.

Run route artifacts

A run's resolver snapshot lists its distribution artifacts, each with an artifact_ref and an artifact_digest. The integrity gate on the run route fetches and checks them before dispatch. See Artifact integrity gate.