Skip to content

Resolved dependency binding

A binding is the record of how one declared requirement was satisfied. It is the unit a closure is assembled from: everything downstream, from the artifact set to the cell's import view, is built by reading bindings.

A binding is answerable on its own. From one of them you can tell which version was chosen, which exact bytes, which transitive bundle came with them, where they came from, how they were produced, and what else was considered and passed over.

{
  "requirement_id": "torch",
  "requirement_kind": "python_distribution",
  "requirement_scope": "reusable_block",
  "requirement_specs": ["torch>=2.4,<3"],
  "selected_version": "2.4.1",
  "source": "foundation",
  "selected_component_digest": "sha256:1f4c...",
  "selected_bundle_component_digests": ["sha256:1f4c...", "sha256:9a02..."],
  "selected_provenance_digest": "sha256:c771...",
  "selected_component_inventory_digest": "sha256:0e38...",
  "considered_candidates": [],
  "excluded_foundation_component_digests": []
}

selected_component_digest is the component that satisfies the requirement, and selected_bundle_component_digests is its complete transitive bundle, which always contains the selected digest. The provenance and inventory digests say how those bytes were produced and what surfaces they carry, so a closure can be checked before anything is mounted.

requirement_kind is one of python_distribution, operating_system_dependency_bundle, or image_dependency_bundle.

One source, and no fallback

A binding carries exactly one source. Four field names are refused so a second one cannot appear:

a resolved dependency binding has one source and no fallback or lane

fallback, fallback_source, env_group and domain would each give the binding a second answer.

This is the invariant the rest of the section depends on. A runtime that could fall back would behave differently depending on which attempt succeeded, and the closure would stop describing what ran. With one source per binding, reading a closure tells you the execution, not a range of possible executions.

A requirement that cannot be satisfied fails the build. Nothing resolves to an approximation.

The accounting cannot drift from the selection

considered_candidates is non-empty and holds exactly one entry whose disposition is selected:

considered_candidates must contain exactly one selected candidate

That entry has to agree with the binding on version, source, component digest and bundle:

the selected candidate must equal the binding selection

Without that check a binding could name one component while its own audit trail named another, and both would look authoritative. What the candidates were and why each lost is covered in Candidate dispositions and conflict.

Foundation components that lost

When a foundation candidate is considered and not selected, its bundle components are recorded as excluded, derived from the candidate accounting rather than asserted beside it:

excluded foundation components must be present in complete candidate accounting

A component cannot be both selected into the bundle and excluded:

selected bundle components cannot also be excluded foundation components:
['sha256:...']

A cell may run against a foundation that physically contains version 2.4 of a distribution while its closure selected 2.6. Naming the losing component is how the closure states which bytes were reachable and which were not.

Bindings are made once, before the cell starts

Resolution and component construction happen in the build and release transaction. At runtime nothing searches sources until one works, installs a missing package, or mutates a live cell.

A closure therefore describes what ran, rather than a starting point a runtime worked from. See Resolved runtime closures.

Next: Six dependency sources covers where selected bytes can come from, and in what order they are preferred.