Skip to content

Changing shared dependencies

Three places declare dependencies, and each has a different blast radius. This page is the decision: given what you need to change, which one to edit and what that re-runs.

Choosing where to change it

You need Edit Foundation digest Reaches
A system library available to every block in one project runtime.xratu apt Unchanged Every closure in that project, used or not
Shared Python bytes without granting imports runtime.xratu requirements Unchanged The candidate catalogue for that project
A Python distribution one block imports That block's @xratu Unchanged That block's closure
A system library only one block needs That block's @xratu(apt=[...]) Unchanged That block's closure
A library every project on this substrate receives A new foundation, exporting it in the baseline New Every project that selects the new foundation
A different OS, libc, or Python ABI A new foundation New Every project that selects it

The first four leave foundation_digest untouched. They change the project's dependency intent or a block's declaration, and resolution produces new closures against the same substrate.

That is the reason to reach for runtime.xratu before reaching for a new foundation. Adding a library to the exported baseline gives it to every project on the substrate, and costs a foundation build, fresh inventory, SBOM, provenance and signature, a policy entry for the new digest, and a re-resolution of every project's reference. Adding it to one project's apt costs a new project intent and new closures.

Adding a shared system library

document:
  dependencies:
    apt:
      - libmagic1
      - sqlite3
      - libgomp1
flowchart LR
  E["Edit runtime.xratu"]
  E --> S["New sealed intent<br/>new authoring_document_digest"]
  S --> A["Admitted result<br/>new project_system_binding_set_digest"]
  A --> C["New closure per block"]
  C --> N["New cell reuse key"]

The foundation is the same bytes throughout. What changed is the project-wide system binding set, which every closure carries, so every closure digest moves and cells are replaced rather than mutated.

Sharing Python bytes without granting imports

Preparing a component and declaring it in a block are both required, and they answer different questions:

document:
  dependencies:
    requirements:
      - "torch>=2.4,<3"
@xratu(["torch>=2.4,<3"])
def embed(text: str) -> list:
    ...

Leave out the project entry and the block still works: it resolves Torch into its own closure, and every other block that declares Torch resolves it independently. Leave out the block declaration and the block gets UndeclaredDependency while the prepared bytes sit unselected.

Preparing is an authoring convenience over the resolver, and the block's declaration is what carries import authority.

Changing one block only

A requirement on one block changes that block's closure and leaves its siblings alone. Two blocks in the same project may hold incompatible versions of the same distribution. See Version coexistence.

Changing the substrate

Exporting a new library from the baseline, or moving to a new OS or Python ABI, is a new foundation. A foundation is immutable and addressed by digest, so the change arrives as a new digest selected through policy:

Step Owner
Build the new foundation, with its inventory, SBOM and provenance The foundation builder
Add its digest to the allowed set under a profile Control-plane foundation policy
Resolve the project's reference again Data plane resolver, under a fenced assignment
Seal the new selection Control plane
Resolve and admit new closures Resolution and admission

A registry tag moving on its own changes nothing: the sealed intent holds the digest resolved when the selection was made. See Foundation resolution and admission.

What each change re-runs

Change Re-runs
A block's @xratu That block's capsule, then its closure
runtime.xratu apt The project intent seal, admission, and every closure
runtime.xratu requirements The project intent seal, admission, and the closures that select the prepared component
The foundation selection Foundation resolution, then every closure

In every case the running system reaches the new state by reconciliation: closures are resolved and admitted, artifact sets materialise, and cells whose reuse key changed are replaced. See Closure reconciliation and upgrade.

Verifying the change landed

xratu api call --endpoint project_specs.runtime.get \
  --path-param runtime_spec_id=runtime.my-project \
  --path-param version=1.0.1

Read document.dependencies back in canonical form, then confirm the closure carries it. The closure digest moving is the observable signal that the change reached the runtime. See Resolved runtime closures.