Skip to content

Project dependency document

runtime.xratu is where a project declares dependency intent once. It holds two lists with two different meanings, and the difference decides what every block in the project can reach.

kind: RuntimeSpec

metadata:
  id: runtime.my-project
  version: "1.0.0"

document:
  strategy: "standard"
  build:
    build_instance: "standard"
    kernel_version: "stable"
  foundation:
    reference: "registry.example/xratu/foundation:stable"
    profile: "standard"
  identity_mode: "onprem_mtls"
  dependencies:
    requirements:
      - "torch>=2.4,<3"
    apt:
      - libmagic1
      - sqlite3

The two lists

requirements declares Python components to prepare for project reuse. They become resolver candidates, and every importing block still declares its own requirement through @xratu.

apt declares system libraries and executables. Their admitted bindings are carried by every block's closure in the project.

Both are optional. An omitted list is an empty one, which is a statement rather than a gap: a project that declared nothing still gets an intent, so a later reader can tell "declared none" from "nobody asked".

Why the two behave differently

The two halves carry separate digests because only one of them becomes availability authority.

apt puts a system library into every closure in the project without a foundation rebuild. Its admitted bindings are injected into each block's closure whether or not the block names them, so a block declares a system package only when that package is its alone.

requirements makes one solve serve the project, so blocks converge on one version instead of each solving independently. It keeps the declaration: the block still declares what it imports, and a prepared component it did not declare is never selected.

A native library is ABI-level, so a project agreeing on one version couples no block to another. A Python distribution version is program semantics, so a block that inherited one from a project file would change behaviour when a sibling edited that file. See Where shared dependencies live.

Each list is a deterministic set. Entries are trimmed, sorted, and distinct:

document.dependencies.apt must not carry duplicates
document.dependencies.requirements must not carry blank entries
document.dependencies must be an object with requirements and/or apt

Requirement grammar

A requirements entry is a distribution name with optional extras and optional version constraints: torch, torch>=2.4,<3, pydantic[email]==2.6.4.

An apt entry is a package name, optionally pinned with =: libmagic1, sqlite3=3.45.1-1.

A requirement carrying a source, path, URL or installer flag is refused. Where bytes come from is control-plane policy. See Approved dependency sources.

Keys the document refuses

Key Reason given
system there is no system dependency syntax; the foundation exports a signed baseline
allow_system_site_fallback absence is refused rather than fallen back on
index_url an approved source set is CP policy, not an authoring decision
extra_index_url an approved source set is CP policy, not an authoring decision
document.dependencies.index_url is not accepted: an approved source set is CP
policy, not an authoring decision

Any other key is refused by name:

document.dependencies has unknown keys ['pip']; expected ['requirements', 'apt']

Admitted before it is stored

Creating a runtime spec admits the dependency block and the foundation block before anything is persisted. Admission runs the authored lists through the cross-plane contract that will later carry them, so a document that could not be sealed is refused at create rather than at build:

400 document.dependencies is not admissible: operating_system_requirements[0]
does not match the accepted form

The stored spec is the canonical form: sorted, deduplicated, with both lists present.

What the control plane seals

The authored document is compiled once into a sealed intent.

ProjectRuntimeDependencyIntentV1
  project_name, project_version
  python_distribution_requirements[]
  operating_system_requirements[]
  authoring_document_digest
  policy_revision
  python_component_preparation_digest
  project_system_dependency_intent_digest
  intent_digest
Field Meaning
authoring_document_digest The exact runtime.xratu document this was compiled from
policy_revision The policy the project was asked under
python_component_preparation_digest The Python half, digested alone
project_system_dependency_intent_digest The system half, digested alone
intent_digest The complete sealed intent

The two halves carry separate digests because only the system half becomes project-wide availability authority. Every closure binds project_system_dependency_intent_digest; the Python catalogue is bound separately. See Project-wide system availability and Preparing a shared Python component.

authoring_document_digest binds the exact document, so editing runtime.xratu afterwards produces a new intent rather than altering the sealed one.

Reading back what a project declared

xratu get runtime-spec lists the spec's identity:

xratu get runtime-spec runtime.my-project 1.0.0
{
  "status_code": 200,
  "body": {
    "workspace_uuid": "b91d4f07-2c65-4e13-8a77-05ce9d2b6f38",
    "runtime_spec_id": "runtime.my-project",
    "version": "1.0.0",
    "created_by_actor": "user:alice@acme.example",
    "created_at": "2026-09-19T08:41:12Z"
  }
}

The stored document itself comes back from the endpoint, which returns the canonical lists the seal was computed from:

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

workspace_uuid is taken from the active profile. Compare document.dependencies against what you authored: sorted, deduplicated, and with both lists present.