Skip to content

lifecycle: the release, cut from a green commit and compiled per environment (#4026) - #4056

Merged
lex00 merged 1 commit into
mainfrom
feat/4026-release-cut
Oct 17, 2026
Merged

lex00 merged 1 commit into
mainfrom
feat/4026-release-cut

Conversation

@lex00

@lex00 lex00 commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Closes #4026

The release object of ws-104: cut once from a green commit, artifacts built once, one compile target per declared environment, and promote under a release deploys the recorded templates.

  • _releases/<releaseDigest>.json on chant/lifecycle holds { version, releaseDigest, member, commit, artifactDigests, targets }, sorted as ws-104 sets. releaseDigest = computePlanDigest("release", …) over member, commit, artifact digests and each target's env, templates and param name and value; a param's source and everything on the cut line stay outside (lifecycle/release-store.ts).
  • A cut appends { version, releaseDigest, label, actor, timestamp, runOrigin, signature: null } to _releases/cuts.jsonl. A label names one digest per member, a digest takes at most one label, cutting the same digest again is a no-op that returns the label, and another label for it is refused.
  • The cut needs HEAD to carry a local ci/green/<sha> and no ci/revoked/<sha> (lifecycle/release-cut.ts). It compiles each environment of the member's promotion order (workspace: declare the promotion order of environments, used by promote, gates and the trunk lane #4030) in a child chant process with CHANT_ENV set, builds artifacts once, and refuses a component whose build steps differ between environments.
  • chant components promote … --release <label|digest> writes the target's stored template bytes to .chant/release-templates/<digest>/, points the deploy step there, and refuses a template whose digest differs from the target's. Promote without --release is unchanged.
  • Read contract: chant release list --json prints releases.schema.json v1 within contract 1, reusing ledger-unreadable and ledger-malformed. ws-104's floor table is copied into workspace-read-contract.mdx with 0.124.28 for the lifecycle: the release is what graduates: cut from a green commit, shared artifact digests, one compile target per environment #4026 rows. The digest description in status.schema.json now lists its three meanings (ws-104 question 3).
  • CLI: chant release cut [<label>] [--build <command>] [--param k=v] [--params-file <file>] [--actor <name>] [--json], chant release list [--json], and an internal chant release compile. There was no top-level release command; components release is unrelated and unchanged. Docs page cli/release.mdx.

Choices ws-104 left open (please review)

  1. Each environment compiles in its own child process, because component modules are cached by import(). --build <command> runs before each environment's templates are read, since chant has no generic way to produce the files a deploy step names.
  2. A template is a literal path in a deploy step's template, manifest or values field (an archive: prefix stripped; directories such as helm charts skipped). A named template missing after the build stops the cut.
  3. Template bytes are stored at _releases/templates/<digest>.txt, so a promote can deploy them from any checkout.
  4. Artifacts: docker-build gives image, zip-package and jvm-build give asset, run once in the first environment each component is enabled in.
  5. "No artifact source changed" means no git change between the previous release's commit and this one in the component's file, the member's chant.config.ts or the build-input paths; the previous release is the one cut from the nearest ancestor.
  6. {env} in --params-file is replaced by each environment's name; --param applies to every environment.
  7. Refused for now: a dirty tracked tree (release-worktree-dirty), a member with no environments (release-no-environments), a project with no components (release-no-components, until releases: implicit releases for projects with no components #4046). The cut is always from HEAD.
  8. A label starts with a letter or digit and may hold . _ + - but no :, so --release never confuses a label with a digest. An unlabelled release can be labelled once by a later cut.
  9. An environment runs a release when a component's latest deploy record there carries its releaseDigest. Until records: join commit, release, gate and deploy through the release digest #4043 makes run --components write that field, the first environment isn't listed.

Known gaps, posted on their issues: promote under a release doesn't yet check the source record's artifact against artifactDigests (#4045), and it leaves .chant/release-templates/ in the checkout.

Level-0 output changes

On the exceptions page and #2525: --help lists release cut, release list and promote's --release; --release, --build and --artifacts are now accepted flags; a deploy record gets releaseDigest and promote's --json gets release only under --release. No golden moved.

Acceptance

  • The release object and schema, with per-environment targets, the hash input and the version label ws-104 question 3 sets (release-cut.test.ts "the release digest", releases.test.ts).
  • Cutting a release refuses a commit that isn't green ("refuses a commit that isn't green, and writes nothing", "refuses a green commit that was revoked", release.e2e.test.ts).
  • Two cuts of one commit give the same releaseDigest ("two cuts of one commit give the same releaseDigest", e2e).
  • A promote refuses a template whose digest differs from the target's (release-promote.test.ts, promote.test.ts "promote --release (lifecycle: the release is what graduates: cut from a green commit, shared artifact digests, one compile target per environment #4026)").

Checks

  • npx tsx scripts/typecheck.ts: no regressions (26 baselined)
  • npx tsx scripts/check-lexicons.ts: no untracked tier-1 failures
  • lifecycle, components, handlers, releases, read-contract, status-contract, boundary roster, level-0 and wave-loop goldens: 2425 passed with GITHUB_SHA, GITHUB_RUN_ID and CI set
  • Full vitest: only the known local op/factory.e2e.test.ts failures and load timeouts that pass alone
  • lint-docs-sentences: no regressions. The baseline gains the two front-matter colon-reveal findings every CLI page carries, for the new cli/release.mdx. lint-prompts, check-docs-diataxis, ./scripts/build-docs.sh: pass

…gests and one compile target per environment (#4026)

A release is one green commit of one member, compiled (ws-104). chant release cut [<label>] refuses a HEAD without a ci/green tag (or with ci/revoked), compiles every environment of the member's promotion order in a child process with CHANT_ENV set, refuses a component whose build steps differ between environments, builds each component's artifacts once (or carries them from the release of the nearest ancestor when their source did not change), and stores _releases/<releaseDigest>.json, the template bytes and a line in _releases/cuts.jsonl on chant/lifecycle. releaseDigest is computePlanDigest("release", ...) over member, commit, artifact digests and each target's env, templates and param names and values, so two cuts of one commit give one digest. A label names one digest and a digest takes one label.

chant components promote --release <label|digest> deploys the target's recorded templates, refuses one whose bytes do not hash to the target's digest, and names the release on the deploy record (releaseDigest). chant release list --json prints the new releases read-contract document at v1 within contract 1, reusing ledger-unreadable and ledger-malformed; floors recorded in the read contract. Level-0 exception recorded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

lifecycle: the release is what graduates: cut from a green commit, shared artifact digests, one compile target per environment

1 participant