Requirement scope and binding source¶
Every binding carries two facts that answer different questions, and neither can be inferred from the other.
source says where the selected bytes came from: the foundation, a component
prepared at project scope, or one built for this closure alone.
requirement_scope says whose declaration authorised it. A project_wide
binding is carried by every closure in the project. A reusable_block binding
appears only in the closure of the block that declared it.
The rule that keeps them apart¶
A Python binding is always reusable_block scoped, even when its source is
project_prepared:
a Python binding is always reusable_block scoped; preparing a component at
project scope deduplicates bytes and never grants an import to a block that did
not declare it
Preparing a component at project scope gives declaring blocks one version to converge on. It never grants an import. A block that did not declare a distribution receives no import root for it however many siblings prepared it, so the two fields answer different questions and one cannot be derived from the other.
Collapsing them would turn preparation into an import grant: the moment a project prepared a component, every block would silently gain the right to import it, and a block's import surface would depend on what its siblings happened to optimise.
Which combinations occur¶
A Python distribution resolves with scope reusable_block and any of the
sources foundation, project_prepared or closure_local, depending on which
candidate won.
A system dependency bundle declared in runtime.xratu apt resolves with scope
project_wide and source project_system. Declared on a block through
@xratu(apt=[...]), the same kind of requirement resolves with scope
reusable_block.
So the same bytes can reach a cell under either scope, and the scope is what decides how far they travel.
What each scope reaches¶
A project_wide binding is part of every closure the project produces, so
adding one changes every closure digest and replaces every cell. A
reusable_block binding changes one closure, and its siblings are untouched.
That asymmetry is why a system library can be declared for the project and a Python version cannot: one is a set every cell shares, and the other is a choice each block makes. See Where shared dependencies live.
Mount and root scopes follow it¶
The scope travels into the cell's views under matching names. Component mounts
carry project_wide or reusable_block, and native loader roots carry
system_baseline, project_wide or reusable_block, where the baseline scope
is the one every cell receives without declaring anything.