Skip to content

Xratu package

The Xratu package is the immutable artifact bake produces from one reusable capability block. It is the unit you publish and distribute, and it carries the block's execution capsule. Each baked version of the block gives one package.

flowchart LR
  P["Xratu package<br/>acme.billing-manifest 1.2.0"]
  P --> A["Package archive<br/>every file in the block folder"]
  P --> X["xratufile<br/>the build record"]
  P --> C1["Execution capsule<br/>the block's capsule"]

The three parts

  1. The package archive. A .xratu.tgz holding every file in the block folder: your source, each block's XCI source, the generated bindings and dispatch modules, and the manifests. Its name carries the start of its SHA-256, as in acme.billing-manifest-1.2.0-1de656841841.xratu.tgz.
  2. The build record. The xratufile, written into the block folder. It records the archive's name, SHA-256, size and file hashes, the build's execution plan and environment intent, and the complete documents of every capsule.
  3. The capsule. The block's execution capsule, described by a capsule manifest, an executable surface index and a build input. See Execution capsules.

How the package is identified

The package archive's identity in the build record:

"artifact": {
  "archive_name": "acme.billing-manifest-1.2.0-1de656841841.xratu.tgz",
  "archive_sha256": "1de65684184144e27daf1a61d746321a15d2037ccd384fb346090fd950de754c",
  "bundle_digest": "9c8dc1d987eca10970c86629ca215315885382ed61e52576385caaff63a20cda",
  "file_count": 10,
  "file_hashes": {"billing.py": "…", "billing.xci.json": "…"}
}

The bundle digest is taken over the file hashes, so it identifies exactly which files, with which contents, the package holds. The archive SHA-256 identifies the archive bytes that are uploaded. The capsule is checked against the same file hashes.

Publishing the package

xratu publish uploads the archive to your artifact registry, where it is stored once, by digest, and sends the control plane the release metadata: the archive's digests and the capsule's documents. The control plane records the release from that metadata. The capsule becomes an immutable runtime artifact that points at the stored archive. A package without a capsule is refused at publish. See Publishing a release and Immutable runtime artifacts.

Related: Packages and capsules covers how the package and the capsule relate, and xratufile covers the build record.