Repository navigation
Description
A delivery pipeline in chant lives in three places today: the op-waves spec (.chant/op-waves/*.spec.json, committed JSON or a product's renderSpec command), environments in chant.config.ts (promotion order and canary), and the phases of an *.op.ts. Nothing declares the whole path from merge to the last environment in one place, with a gate per stage. "Stage" here means an environment in promotion order, not a CI step; the docs define the word once.
Add one declaration: stages in promotion order, the members or targets each stage reaches, the waves inside a stage, its gate (approval rules, policy, and the risk and soak inputs from #5325 and #5326 once they land), its hooks, and its holds (a manual hold and freeze windows).
The declaration is written inside the TypeScript-as-data subset, so chant build folds it to a spec without running it. A pipeline file outside the subset is refused at build with the rule it breaks; it does not fall back to a run. The pipeline is what a reviewer and the gates must be able to read before anything executes, so it is synthesis, and ops stay the part that runs: chant run wave, chant components promote, chant workspace train promote and the generated jobs read the folded spec.
Decision before building: how products get the declaration
Products do not fold TypeScript today: renderSpec is a command run at job time, and plywood commits JSON. Pick one and record it here:
- (a) Each product ships a
pipeline.tstemplate built from its config, committed in the user's repo, andchant buildfolds it. - (b) Products keep writing JSON, and chant validates that JSON against the same schema the fold produces.
Either way the folded spec is the one contract. Related: #5059.
Under (a), the product writes pipeline.ts from its config, the way it renders workflows today, since a committed TypeScript file cannot read terragucci.yml or plywood.yml itself. The file is generated output: hand edits are overwritten, and a stale file fails the product's check. renderSpec keeps working for products that have not moved, and its output is validated against the fold's schema.
The merge path
promote is a command a person runs, and nothing cuts a release on merge today. In the folded pipeline, a merge applies the first stage as products do now and cuts a release from what it applied; each later stage takes that release through promote behind its gate, run by a person, the scheduled re-run (#5326), or a generated job.
Acceptance criteria
- The decision above, recorded on this issue: (a), see the decision comment.
- A typed
pipelinedeclaration: stages in promotion order, waves inside a stage, a gate per stage, stage hooks, a manual hold, freeze windows, and afailureTolerancefor waves of many targets. - chant exports the helpers a product uses to write
pipeline.tsfrom its config and to check that the committed file matches (for<product> ci --check), with tests on each product's config shape. - Gates read the folded pipeline at the base commit, as they read the op-waves spec at base today, so a pull request cannot loosen the gate it is judged by.
- A merge applies the first stage and cuts a release; later stages promote that release. The guide page names this path.
-
chant buildfolds it to a JSON spec; a file outside the subset is refused with the evaluability rule's id, andchant lintand the LSP show the same finding. - The folded spec carries everything today's op-waves spec and
environmentscarry;chant run wave,chant components promoteandchant workspace train promote(workspace: releases across several members, reconciled with the release train (#2554) #4037, workspace: a release train across repositories, promoted through the control repo #5119) read it, and existing specs andenvironmentskeep working unchanged. - The
<product>-applieddispatch (CI core: the control repo (cross-repo dispatch, project records, reconcile) for terragucci and plywood #4568, Op waves: control-repo dispatch after the last wave, and cross-stack edge marks in the note #4617) fires from the folded spec's stage order. - Skipping a stage is refused at build, as
promoterefuses it now;--allow-skippasses only through the skipped stage's gate, and the ledger records it. - A held or frozen stage refuses promotion with exit 3 and says until when.
- The GitHub, GitLab and Forgejo generators render the pipeline's jobs from the folded spec, with golden files for each.
- A pull request that changes the pipeline shows the folded spec's diff in its plan note.
- Tests use terragucci's, plywood's and sql-yodeler's config shapes, and the keys follow ci-product: one key vocabulary for product config #5343.
- Docs: a guide page and a reference page for the declaration, and the TypeScript-as-data page names it among what folds.
- The capability is exported with a
*_FLOORconstant naming the chant release that carries it, so products can check or pin to it.
Activity
lex00 commentedon Nov 19, 2026
Decision, 2026-11-19: (a). Each product ships a
pipeline.tstemplate built from its config, committed in the user's repo, andchant buildfolds it.Why: the epic says the declaration folds under TypeScript as data, so a reviewer and the gates read it before anything runs. Under (b) the products would keep writing JSON, and nothing would fold. The adoption issues (INTENTIUS/terragucci#1493, INTENTIUS/plywood#156, INTENTIUS/sql-yodeler#384) already ask for the folded spec. Each ships its template there.
test(pipeline): each product's waves spec today passes the render che…
feat(pipeline): one TypeScript declaration of stages and waves, folde…
test(pipeline): each product's waves spec today passes the render che…