Execution capsules¶
An execution capsule is one reusable capability block's executable artifact. It is part of the Xratu package bake produces, and it is what the kernel runs: every cell runs exactly one capsule, inside a resolved runtime closure. A block's package holds its one capsule.
A capsule is a precise description over the package's files. It names every file the block may use by hash, and adds what makes the block runnable: its interface, the entry point calls go through, its dependency intent and the runtime provider it needs.
The three documents¶
Bake writes three documents for each capsule:
acme.billing.manifest.json the capsule manifest
acme.billing.executable_surface_index.json method numbers and their entry point
acme.billing.build_input.json everything the capsule was built from
- The capsule manifest is the capsule's identity and runtime description: its digest, file tree, interface hash, entry point, dependency intent, provider requirement and provenance. See Capsule contents.
- The executable surface index maps each method number to the dispatch module that serves it. A method absent from the index can never be called. See Export ordinals.
- The build input records what bake built the capsule from: the block's interface seed, the digest of every source file and generated file, and the package archive's digest.
The capsule digest¶
The capsule digest,
sha256:40e4f7107cd51aaf3f71dfa261b1db2a8c4f7f2c50f5c92965f4dce90124d537, is the
capsule's identity. It covers the block's files together with its interface
and dependency intent. See Capsule digests.
From capsule to cell¶
A capsule on its own is never run. A project resolves a runtime closure for it, binding the capsule to a foundation, a provider and every dependency, and the kernel runs the closure in a cell. The capsule digest is part of every closure built from it and of every cell's reuse key. See Resolved runtime closures and Cells.