Packages and capsules¶
Each reusable capability block is generated, baked and published on its own. Bake turns the block into one Xratu package, and the package carries the block's one execution capsule. The package is what you publish and distribute; the capsule is what a cell runs. Blocks are combined later, by a project's workflows and agents, never by baking them together.
flowchart LR
B["Reusable capability block<br/>billing.py and its helper files"]
B --> P["Xratu package<br/>the block's files, archived"]
P --> C["Execution capsule<br/>the block's executable artifact"]
A block may span several files¶
A block's main module can import helper modules, data files and other code kept beside it in the block folder. Bake archives the whole folder, so all of those files are in the package, and the capsule lists every one of them by hash. The block, its package and its capsule stay one of each, however many files the block has.
What each one is for¶
- The package is the distribution unit. It holds the archive of the block's
files and the build record, and it is what
xratu publishuploads once, by digest. See Xratu package. - The capsule is the execution unit. It names the files the block may use, and adds the block's interface, entry point, dependency intent and provider requirement. A project resolves a closure for it and the kernel runs it in a cell. See Execution capsules.
At publish, the capsule becomes an immutable runtime artifact that points at the stored package archive. See Immutable runtime artifacts.
Combining blocks¶
A project uses several blocks by importing each one's published package in its YAML, at a pinned version, and calling them from its workflows and agents. Each block keeps its own package, capsule, closure and cells, so two blocks in one workflow can depend on incompatible versions of a library. See Version pinning and Version coexistence.