Skip to content

Version pinning

A published reusable capability block never changes. Each publish creates a new release, identified by its content, and a project (an agent or a workflow) uses a block by naming the exact release it wants. A block upgrade reaches a project only when the project changes that name and is applied again.

Every release is immutable

Publishing a package creates a release with two names:

  1. The release version, derived from the package's content: sha256-9c8dc1d987eca109, the start of its bundle digest. The same files always give the same release version, and different files always give a different one.
  2. The tag, the version you gave the package, such as 1.2.0.

A release, and every capsule in it, stays exactly as published. Changing the block means publishing again, which creates a new release beside the old one. Projects using the old release keep running it.

A project names the release it uses

A project declares the packages its workflows and agents use, each with a version:

imports:
  - package: acme.billing-manifest
    version: sha256-9c8dc1d987eca109

Both fields are required:

imports[0] requires package and version

The version is matched against the release version first, and then against the tags. When the project is applied, the control plane resolves each import to one release and records that exact release in the project's resolution, so every run of that project version uses the same block code. An import that matches no published release refuses the apply:

unable to resolve imported package references: acme.billing-manifest:1.3.0
(publish package(s) first with `xratu publish <project-folder|xratufile>`)

Tags and release versions

A tag is a readable name that points at one release. Publishing again under the same tag points it at the new release. A release version names one release for good. Import by release version to fix exactly which code a project runs, and use a tag where the readable name matters more than holding the release.

Upgrading a block in a project

  1. Publish the new version of the block. The old release stays available.
  2. Change the project's import to the new release version or tag.
  3. Apply the project. It resolves the new release, builds new closures for the changed block, and runs them in new cells; the previous project version keeps its own resolution.

Applying the project checks its workflows against the release it resolved, including the governance checks on each block's execution contract. See Execution contracts and side-effect classes. See Interface evolution and compatibility for the optional check that compares two versions of an interface directly.

Related: Immutable runtime artifacts and Immutability and version pinning.