Requirements are declared per block¶
Every reusable capability block states its own requirements, with @xratu on
the block's class:
from sdk import xratu
@xratu(["pydantic>=2.6", "requests>=2.31.0"], apt=["libmagic1"])
class Ingest:
...
The decorator is the only thing you write. xratu capability generate reads it
and records it in the block's manifest as the dependency intent document below,
and the resolver later binds each requirement to one exact component in that
block's closure. See
Dependency and environment declaration
for every @xratu parameter, with examples.
The dependency intent generation writes for the block above:
{
"python": {
"backend": "uv",
"requirements": ["pydantic>=2.6", "requests>=2.31.0"]
},
"apt": ["libmagic1"],
"image": ""
}
The recorded fields¶
| Field | Values | Constraint |
|---|---|---|
python.backend |
none, uv, pip |
none carries no requirements; uv and pip carry at least one |
python.requirements |
List of requirement strings | Sorted, distinct, no blanks |
apt |
List of package names | Sorted, distinct, no blanks |
image |
<repository>@sha256:<64 hex> |
Digest-pinned, and exclusive with requirements and apt |
dependency_intent declares an image and package requirements; one block-specific
dependency source cannot be both image-backed and package-resolved
Each block resolves into its own closure¶
flowchart TB
B1["Block: ingest<br/>pydantic>=2.6"]
B2["Block: score<br/>pydantic==1.10.14"]
B1 --> C1["Closure for ingest"]
B2 --> C2["Closure for score"]
C1 --> W["One workflow calls both"]
C2 --> W
Two blocks called by one workflow resolve separately. A requirement declared on one block reaches that block. See Version coexistence.
Compatible component bytes are deduplicated underneath the closure boundary. Physical presence of a component grants no import authority on its own, which is why a block declares a requirement even when the selected runtime foundation already exports something compatible. See Presence versus import authority.
Requirements are not runtime lanes¶
An intent names what the block needs. Four field names are refused by name, because each would assign a runtime lane:
| Refused field | The decision it would make |
|---|---|
env_group |
Which environment group the block joins |
dependency_domain |
Which dependency lane it shares |
system_domain |
Which system lane it shares |
env |
Environment values, which belong to the environment declaration |
A block may name requirements and a digest-pinned block-specific dependency source. Foundation, environment group, mount and fallback are resolved later. See Generation boundaries.
Where the intent goes next¶
| Stage | What it does with the intent |
|---|---|
| Bake | Builds the closure inputs from it |
| Control-plane admission | Resolves and seals runtime-closure authority |
| Data plane | Materialises the admitted artifact set |
| Kernel | Consumes the verified resolved-runtime-closure view |
Related: Dependency and environment declaration
covers the @xratu surface that produces this document.