@intentius/chant 0.124.108 → 0.124.110

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (342) hide show
  1. package/dist/__golden__/wave-loop/fan-out-applied.json +12 -6
  2. package/dist/__golden__/wave-loop/fan-out-apply-fails.json +8 -4
  3. package/dist/__golden__/wave-loop/fan-out-gated.json +4 -2
  4. package/dist/__golden__/wave-loop/fan-out-no-members.json +16 -8
  5. package/dist/__golden__/wave-loop/fan-out-plan-fails.json +8 -4
  6. package/dist/__golden__/wave-loop/fan-out-same-root.json +4 -2
  7. package/dist/agent-facts.d.ts +130 -0
  8. package/dist/agent-facts.js +196 -0
  9. package/dist/change-risk.d.ts +216 -0
  10. package/dist/change-risk.js +304 -0
  11. package/dist/change-set.d.ts +8 -0
  12. package/dist/ci-agent-alert.d.ts +139 -0
  13. package/dist/ci-agent-alert.js +342 -0
  14. package/dist/ci-agent-triggers.d.ts +152 -0
  15. package/dist/ci-agent-triggers.js +232 -0
  16. package/dist/ci-agent-verify-failed.d.ts +149 -0
  17. package/dist/ci-agent-verify-failed.js +191 -0
  18. package/dist/ci-agent.d.ts +136 -8
  19. package/dist/ci-agent.js +353 -26
  20. package/dist/ci-comment-commands.d.ts +8 -0
  21. package/dist/ci-comment-commands.js +17 -1
  22. package/dist/ci-comment-reject.d.ts +70 -0
  23. package/dist/ci-comment-reject.js +135 -0
  24. package/dist/ci-comment-replies.d.ts +3 -1
  25. package/dist/ci-comment-replies.js +6 -0
  26. package/dist/ci-estate/delivery.d.ts +25 -3
  27. package/dist/ci-estate/delivery.js +28 -9
  28. package/dist/ci-estate/page.d.ts +7 -3
  29. package/dist/ci-estate/page.js +19 -4
  30. package/dist/ci-estate/rows.d.ts +14 -2
  31. package/dist/ci-estate/rows.js +9 -1
  32. package/dist/ci-estate.d.ts +5 -2
  33. package/dist/ci-estate.js +3 -2
  34. package/dist/ci-handover.d.ts +2 -7
  35. package/dist/ci-handover.js +3 -20
  36. package/dist/ci-jobs.d.ts +6 -0
  37. package/dist/ci-jobs.js +17 -0
  38. package/dist/ci-note-commands.d.ts +2 -0
  39. package/dist/ci-note-commands.js +12 -1
  40. package/dist/ci-product-words.d.ts +151 -1
  41. package/dist/ci-product-words.js +1390 -3
  42. package/dist/ci-product.d.ts +100 -4
  43. package/dist/ci-product.js +99 -3
  44. package/dist/ci-respond-run.d.ts +9 -0
  45. package/dist/ci-respond-run.js +35 -4
  46. package/dist/ci-respond-summary-env.d.ts +56 -0
  47. package/dist/ci-respond-summary-env.js +81 -0
  48. package/dist/ci-respond-summary.d.ts +103 -0
  49. package/dist/ci-respond-summary.js +243 -0
  50. package/dist/ci-respond.d.ts +4 -2
  51. package/dist/ci-respond.js +4 -2
  52. package/dist/cli/command-group.js +1 -1
  53. package/dist/cli/commands/lint.js +21 -3
  54. package/dist/cli/handlers/agent.js +49 -4
  55. package/dist/cli/handlers/approve.js +3 -1
  56. package/dist/cli/handlers/build.d.ts +97 -1
  57. package/dist/cli/handlers/build.js +251 -3
  58. package/dist/cli/handlers/fan-out.js +55 -0
  59. package/dist/cli/handlers/graph.d.ts +14 -0
  60. package/dist/cli/handlers/graph.js +58 -3
  61. package/dist/cli/handlers/lifecycle-health.d.ts +7 -0
  62. package/dist/cli/handlers/lifecycle-health.js +47 -9
  63. package/dist/cli/handlers/lifecycle.js +4 -1
  64. package/dist/cli/handlers/notify-relay.d.ts +2 -2
  65. package/dist/cli/handlers/notify-relay.js +67 -7
  66. package/dist/cli/handlers/pipeline-agent.d.ts +30 -0
  67. package/dist/cli/handlers/pipeline-agent.js +255 -0
  68. package/dist/cli/handlers/pipeline-artifacts.d.ts +39 -0
  69. package/dist/cli/handlers/pipeline-artifacts.js +203 -0
  70. package/dist/cli/handlers/pipeline.d.ts +16 -0
  71. package/dist/cli/handlers/pipeline.js +112 -0
  72. package/dist/cli/handlers/pr-comment.js +4 -0
  73. package/dist/cli/handlers/pr-notes.js +4 -1
  74. package/dist/cli/handlers/pr.d.ts +20 -0
  75. package/dist/cli/handlers/pr.js +114 -11
  76. package/dist/cli/handlers/promote.js +792 -47
  77. package/dist/cli/handlers/reject.d.ts +84 -0
  78. package/dist/cli/handlers/reject.js +216 -0
  79. package/dist/cli/handlers/release.js +4 -2
  80. package/dist/cli/handlers/replan.d.ts +54 -0
  81. package/dist/cli/handlers/replan.js +177 -0
  82. package/dist/cli/handlers/run-generate.d.ts +5 -0
  83. package/dist/cli/handlers/run-generate.js +31 -4
  84. package/dist/cli/handlers/run-wave.js +15 -2
  85. package/dist/cli/handlers/run.js +4 -2
  86. package/dist/cli/handlers/stage.d.ts +35 -0
  87. package/dist/cli/handlers/stage.js +90 -0
  88. package/dist/cli/lsp/server.js +4 -0
  89. package/dist/cli/main.js +88 -8
  90. package/dist/cli/parse-args.js +35 -2
  91. package/dist/cli/registry.d.ts +12 -0
  92. package/dist/components/auto-release.d.ts +2 -0
  93. package/dist/components/auto-release.js +1 -0
  94. package/dist/components/capability.d.ts +40 -0
  95. package/dist/components/cli-support.d.ts +21 -1
  96. package/dist/components/cli-support.js +28 -6
  97. package/dist/components/component.d.ts +23 -4
  98. package/dist/components/component.schema.json +28 -0
  99. package/dist/components/declared-reads.d.ts +44 -4
  100. package/dist/components/declared-reads.js +80 -3
  101. package/dist/components/discover.d.ts +8 -0
  102. package/dist/components/discover.js +1 -1
  103. package/dist/components/driver.d.ts +13 -0
  104. package/dist/components/driver.js +23 -2
  105. package/dist/components/environment-sets.d.ts +229 -0
  106. package/dist/components/environment-sets.js +338 -0
  107. package/dist/components/fan-out-canary.d.ts +47 -0
  108. package/dist/components/fan-out-canary.js +58 -0
  109. package/dist/components/fan-out-run.d.ts +17 -0
  110. package/dist/components/fan-out-run.js +14 -1
  111. package/dist/components/fan-out-support.d.ts +7 -0
  112. package/dist/components/fan-out-support.js +1 -1
  113. package/dist/components/groups.d.ts +8 -1
  114. package/dist/components/groups.js +19 -1
  115. package/dist/components/index.d.ts +5 -2
  116. package/dist/components/index.js +4 -1
  117. package/dist/components/pr-cost.d.ts +28 -0
  118. package/dist/components/pr-cost.js +53 -0
  119. package/dist/components/pr-pipeline.d.ts +33 -0
  120. package/dist/components/pr-pipeline.js +32 -5
  121. package/dist/components/pr-policy.d.ts +33 -2
  122. package/dist/components/pr-policy.js +5 -2
  123. package/dist/components/pr-risk.d.ts +42 -0
  124. package/dist/components/pr-risk.js +74 -0
  125. package/dist/components/product-pipeline.d.ts +43 -0
  126. package/dist/components/product-pipeline.js +67 -1
  127. package/dist/components/promote.d.ts +6 -0
  128. package/dist/components/promote.js +13 -0
  129. package/dist/components/release-compile.js +3 -1
  130. package/dist/components/release-gate.d.ts +6 -1
  131. package/dist/components/release-gate.js +10 -2
  132. package/dist/components/step-environments.d.ts +236 -0
  133. package/dist/components/step-environments.js +392 -0
  134. package/dist/components/upstream-replan.d.ts +201 -0
  135. package/dist/components/upstream-replan.js +249 -0
  136. package/dist/components/verify-step.d.ts +30 -0
  137. package/dist/components/verify-step.js +27 -0
  138. package/dist/components/wave-plan.js +6 -2
  139. package/dist/config-environments.d.ts +4 -2
  140. package/dist/control/dispatch.d.ts +15 -0
  141. package/dist/control/dispatch.js +28 -4
  142. package/dist/cost-estimate.d.ts +188 -0
  143. package/dist/cost-estimate.js +363 -0
  144. package/dist/drift-record.d.ts +36 -0
  145. package/dist/drift-record.js +44 -0
  146. package/dist/engine-facts.d.ts +105 -0
  147. package/dist/engine-facts.js +111 -0
  148. package/dist/exit-codes.d.ts +4 -3
  149. package/dist/exit-codes.js +4 -3
  150. package/dist/flag-params.d.ts +2 -2
  151. package/dist/flag-params.js +9 -4
  152. package/dist/floor-table.data.js +53 -0
  153. package/dist/forge-token-vars.d.ts +12 -0
  154. package/dist/forge-token-vars.js +25 -0
  155. package/dist/gate-decision.d.ts +3 -1
  156. package/dist/gate-decision.js +3 -1
  157. package/dist/gated-waves.d.ts +2 -0
  158. package/dist/gated-waves.js +1 -0
  159. package/dist/graph-ir.d.ts +30 -0
  160. package/dist/graph-ir.js +33 -1
  161. package/dist/graph-refs.d.ts +26 -0
  162. package/dist/graph-refs.js +34 -3
  163. package/dist/graph-schema/graph.schema.json +136 -0
  164. package/dist/health.d.ts +65 -0
  165. package/dist/health.js +62 -0
  166. package/dist/lexicon.d.ts +188 -1
  167. package/dist/lifecycle/disruption.d.ts +14 -1
  168. package/dist/lifecycle/disruption.js +5 -1
  169. package/dist/lifecycle/gate-change-set.d.ts +8 -0
  170. package/dist/lifecycle/gate-change-set.js +2 -1
  171. package/dist/lifecycle/gate-ledger.d.ts +26 -0
  172. package/dist/lifecycle/gate-rejection.d.ts +82 -0
  173. package/dist/lifecycle/gate-rejection.js +93 -0
  174. package/dist/lifecycle/gate-seal.d.ts +3 -3
  175. package/dist/lifecycle/gate-seal.js +5 -5
  176. package/dist/lifecycle/observe.d.ts +17 -0
  177. package/dist/lifecycle/observe.js +10 -1
  178. package/dist/lifecycle/release-cut.js +4 -0
  179. package/dist/lifecycle/release-ledger.d.ts +8 -0
  180. package/dist/lifecycle/release-risk.d.ts +137 -0
  181. package/dist/lifecycle/release-risk.js +214 -0
  182. package/dist/lifecycle/release-store.d.ts +9 -0
  183. package/dist/lifecycle/release-store.js +4 -0
  184. package/dist/lifecycle/stage-log.d.ts +85 -0
  185. package/dist/lifecycle/stage-log.js +141 -0
  186. package/dist/lint/canary-checks.d.ts +31 -0
  187. package/dist/lint/canary-checks.js +45 -0
  188. package/dist/lint/rule.d.ts +1 -0
  189. package/dist/lint/rules/evl012-pipeline-fold.d.ts +14 -0
  190. package/dist/lint/rules/evl012-pipeline-fold.js +30 -0
  191. package/dist/lint/rules/index.d.ts +1 -0
  192. package/dist/lint/rules/index.js +3 -0
  193. package/dist/notify-relay-repo.d.ts +54 -0
  194. package/dist/notify-relay-repo.js +84 -0
  195. package/dist/notify-relay.d.ts +53 -3
  196. package/dist/notify-relay.js +96 -3
  197. package/dist/notify.d.ts +57 -1
  198. package/dist/notify.js +7 -1
  199. package/dist/notify.schema.json +61 -3
  200. package/dist/observation.d.ts +34 -0
  201. package/dist/observation.js +14 -1
  202. package/dist/op/activities/review-agent.d.ts +39 -2
  203. package/dist/op/activities/review-agent.js +88 -5
  204. package/dist/op/agent-permit.d.ts +88 -0
  205. package/dist/op/agent-permit.js +97 -0
  206. package/dist/op/gate-approval-base.d.ts +8 -0
  207. package/dist/op/gate-approval-base.js +9 -0
  208. package/dist/op/gate-approval.d.ts +30 -1
  209. package/dist/op/gate-approval.js +23 -2
  210. package/dist/op/gate-quorum.d.ts +114 -8
  211. package/dist/op/gate-quorum.js +198 -21
  212. package/dist/op/gate-reject.d.ts +79 -0
  213. package/dist/op/gate-reject.js +96 -0
  214. package/dist/op/gate-summary.js +1 -1
  215. package/dist/op/gate.d.ts +28 -3
  216. package/dist/op/gate.js +55 -13
  217. package/dist/op/generate-pipeline.d.ts +15 -1
  218. package/dist/op/generate-pipeline.js +32 -5
  219. package/dist/op/index.d.ts +11 -6
  220. package/dist/op/index.js +10 -5
  221. package/dist/op/local-executor.d.ts +2 -0
  222. package/dist/op/local-executor.js +23 -4
  223. package/dist/op/op-waves-after-plan.d.ts +23 -0
  224. package/dist/op/op-waves-after-plan.js +12 -1
  225. package/dist/op/op-waves-capability-spec.d.ts +14 -0
  226. package/dist/op/op-waves-capability-spec.js +46 -6
  227. package/dist/op/op-waves-capability.d.ts +21 -13
  228. package/dist/op/op-waves-capability.js +22 -59
  229. package/dist/op/op-waves-environment-sets.d.ts +41 -0
  230. package/dist/op/op-waves-environment-sets.js +82 -0
  231. package/dist/op/op-waves-quorum-warnings.d.ts +53 -0
  232. package/dist/op/op-waves-quorum-warnings.js +90 -0
  233. package/dist/op/op-waves-release-port.d.ts +7 -0
  234. package/dist/op/op-waves-release-port.js +15 -3
  235. package/dist/op/op-waves-release.d.ts +15 -0
  236. package/dist/op/op-waves-release.js +15 -0
  237. package/dist/op/op-waves-run.d.ts +37 -3
  238. package/dist/op/op-waves-run.js +141 -18
  239. package/dist/op/op-waves-soak.d.ts +57 -0
  240. package/dist/op/op-waves-soak.js +111 -0
  241. package/dist/op/op-waves-split.d.ts +4 -0
  242. package/dist/op/op-waves-split.js +4 -0
  243. package/dist/op/op-waves.d.ts +67 -4
  244. package/dist/op/op-waves.js +71 -3
  245. package/dist/pipeline/agent-ajv.d.ts +4 -0
  246. package/dist/pipeline/agent-ajv.js +14 -0
  247. package/dist/pipeline/agent-steps.d.ts +329 -0
  248. package/dist/pipeline/agent-steps.js +602 -0
  249. package/dist/pipeline/artifacts.d.ts +264 -0
  250. package/dist/pipeline/artifacts.js +425 -0
  251. package/dist/pipeline/diff.d.ts +45 -0
  252. package/dist/pipeline/diff.js +177 -0
  253. package/dist/pipeline/fold.d.ts +43 -0
  254. package/dist/pipeline/fold.js +140 -0
  255. package/dist/pipeline/generate.d.ts +52 -0
  256. package/dist/pipeline/generate.js +120 -0
  257. package/dist/pipeline/product.d.ts +225 -0
  258. package/dist/pipeline/product.js +257 -0
  259. package/dist/pipeline/promote.d.ts +404 -0
  260. package/dist/pipeline/promote.js +694 -0
  261. package/dist/pipeline/read.d.ts +37 -0
  262. package/dist/pipeline/read.js +58 -0
  263. package/dist/pipeline/rendered.d.ts +25 -0
  264. package/dist/pipeline/rendered.js +53 -0
  265. package/dist/pipeline/soak-checks.d.ts +80 -0
  266. package/dist/pipeline/soak-checks.js +254 -0
  267. package/dist/pipeline/soak-gate.d.ts +97 -0
  268. package/dist/pipeline/soak-gate.js +176 -0
  269. package/dist/pipeline/soak-sources.d.ts +17 -0
  270. package/dist/pipeline/soak-sources.js +42 -0
  271. package/dist/pipeline/soak.d.ts +260 -0
  272. package/dist/pipeline/soak.js +378 -0
  273. package/dist/pipeline/spec.d.ts +724 -0
  274. package/dist/pipeline/spec.js +567 -0
  275. package/dist/pipeline/stage-ledger.d.ts +187 -0
  276. package/dist/pipeline/stage-ledger.js +185 -0
  277. package/dist/pipeline/stage-waves.d.ts +114 -0
  278. package/dist/pipeline/stage-waves.js +161 -0
  279. package/dist/pipeline/stages.d.ts +64 -0
  280. package/dist/pipeline/stages.js +174 -0
  281. package/dist/pipeline/verify-rollback.d.ts +277 -0
  282. package/dist/pipeline/verify-rollback.js +393 -0
  283. package/dist/pipeline.d.ts +142 -0
  284. package/dist/pipeline.js +143 -0
  285. package/dist/pr-loop.d.ts +22 -0
  286. package/dist/pr-loop.js +8 -0
  287. package/dist/pr-plan-note.d.ts +15 -1
  288. package/dist/pr-plan-note.js +8 -0
  289. package/dist/pr-post.d.ts +31 -0
  290. package/dist/pr-post.js +89 -0
  291. package/dist/release-floors.d.ts +1 -1
  292. package/dist/release-floors.js +1 -1
  293. package/dist/report-store/audit.schema.json +50 -0
  294. package/dist/report-store/dora.schema.json +331 -0
  295. package/dist/report-store/estate.schema.json +96 -0
  296. package/dist/report-store/run.schema.json +14 -0
  297. package/dist/report-store.d.ts +151 -0
  298. package/dist/report-store.js +344 -0
  299. package/dist/run-event.d.ts +7 -2
  300. package/dist/wave-runtime.mjs +458 -404
  301. package/dist/workspace/catalog-edges.js +3 -3
  302. package/dist/workspace/change-set.schema.json +4 -0
  303. package/dist/workspace/ci-cloud-identity.d.ts +4 -0
  304. package/dist/workspace/ci-cloud-identity.js +30 -0
  305. package/dist/workspace/ci-run.js +17 -2
  306. package/dist/workspace/ci-secrets.d.ts +3 -1
  307. package/dist/workspace/ci-secrets.js +7 -1
  308. package/dist/workspace/compose-graph.d.ts +1 -1
  309. package/dist/workspace/compose-graph.js +3 -1
  310. package/dist/workspace/declaration.d.ts +27 -0
  311. package/dist/workspace/declaration.js +35 -0
  312. package/dist/workspace/declaration.schema.json +56 -0
  313. package/dist/workspace/graph-cli.js +26 -0
  314. package/dist/workspace/graph.schema.json +5 -1
  315. package/dist/workspace/identity-gate-rule.d.ts +4 -0
  316. package/dist/workspace/identity-gate-rule.js +2 -2
  317. package/dist/workspace/identity-reject-rule.d.ts +14 -0
  318. package/dist/workspace/identity-reject-rule.js +24 -0
  319. package/dist/workspace/identity.d.ts +3 -0
  320. package/dist/workspace/identity.js +2 -1
  321. package/dist/workspace/nested-graph.js +2 -0
  322. package/dist/workspace/pr-report.schema.json +65 -0
  323. package/dist/workspace/promotion-order.d.ts +19 -4
  324. package/dist/workspace/promotion-order.js +26 -4
  325. package/dist/workspace/release-train.d.ts +14 -0
  326. package/dist/workspace/release-train.js +32 -0
  327. package/dist/workspace/run-event.schema.json +2 -2
  328. package/dist/workspace/stack-read-edges.d.ts +19 -0
  329. package/dist/workspace/stack-read-edges.js +54 -0
  330. package/dist/workspace/status-gates.d.ts +51 -1
  331. package/dist/workspace/status-gates.js +60 -0
  332. package/dist/workspace/status-stages.d.ts +223 -0
  333. package/dist/workspace/status-stages.js +279 -0
  334. package/dist/workspace/status.d.ts +45 -1
  335. package/dist/workspace/status.js +109 -5
  336. package/dist/workspace/status.schema.json +283 -2
  337. package/dist/workspace/train-cut.js +5 -2
  338. package/dist/workspace/train-shell.d.ts +18 -0
  339. package/dist/workspace/train-shell.js +43 -0
  340. package/dist/workspace/trust/seal.d.ts +7 -0
  341. package/dist/workspace/trust/seal.js +9 -0
  342. package/package.json +5 -1
@@ -142,14 +142,16 @@ async function runOpWaveJobCommand(ctx) {
142
142
  const command = at.opWavesSpecCommandFromEnv();
143
143
  // #5046: with CHANT_WAVES_SPEC_RUNS=head the runs come from the applied commit; the gate and record jobs take them from the saved plan.
144
144
  const runsAtHead = at.opWavesSpecRunsAtHead() && phase !== "gate" && phase !== "record";
145
+ // #5324: every render is checked against the pipeline's schema, and a folded pipeline document becomes its stage's spec.
146
+ const { checkedRender } = await import("../../pipeline/rendered.js");
145
147
  const rendered = at.renderOpWavesJobSpec({
146
148
  specFile: file,
147
149
  base: args.base ?? "HEAD^1",
148
150
  cwd: process.cwd(),
149
- render: at.commandSpecRender(command, file, process.cwd()),
151
+ render: checkedRender(at.commandSpecRender(command, file, process.cwd()), parseOpWavesSpec),
150
152
  fallback: gitShowAtBase,
151
153
  parse: parseOpWavesSpec,
152
- ...(runsAtHead ? { runsAtHead, headRender: (baseSha) => at.commandSpecRender(command, file, process.cwd(), { [at.OP_WAVES_SPEC_BASE_ENV]: baseSha }) } : {}),
154
+ ...(runsAtHead ? { runsAtHead, headRender: (baseSha) => checkedRender(at.commandSpecRender(command, file, process.cwd(), { [at.OP_WAVES_SPEC_BASE_ENV]: baseSha }), parseOpWavesSpec) } : {}),
153
155
  });
154
156
  show = rendered.show;
155
157
  spec = rendered.spec;
@@ -348,6 +350,17 @@ async function respondWave(spec, k, outcome) {
348
350
  try {
349
351
  const { respondOpWave, triageOfOpWave } = await import("../../ci-respond-run.js");
350
352
  const { resolveResponses } = await import("../../ci-respond.js");
353
+ // #5357: with CHANT_AGENT_FACTS=apply-failed, a failed wave records its facts for the failed-apply agent, beside its triage.
354
+ const { agentFactsOn, recordApplyFailed } = await import("../../ci-agent-triggers.js");
355
+ if (agentFactsOn(process.env, "apply-failed")) {
356
+ const failed = triageOfOpWave(spec, k, outcome);
357
+ if (failed) {
358
+ const { activeProductWords } = await import("../../ci-product-words.js");
359
+ const line = await recordApplyFailed(failed, { op: spec.name, product: activeProductWords().product });
360
+ if (line)
361
+ console.error(line);
362
+ }
363
+ }
351
364
  const responses = resolveResponses(spec.respond);
352
365
  if (responses["wave-refused"] === "off" && responses["apply-failed"] === "off")
353
366
  return;
@@ -34,7 +34,7 @@ import { isComponentList } from "../../components/cli-support.js";
34
34
  import { parseComponentTargets } from "../../components/capability.js";
35
35
  import { adoptionReview, loadDeployAdoption } from "../../components/adoption.js";
36
36
  import { isApplyRecord, resolveCiRun } from "../../lifecycle/release-ledger.js";
37
- import { gateAdmission, gateApprover } from "../../components/promote.js";
37
+ import { gateAdmission, gateApprover, gatesSkipped } from "../../components/promote.js";
38
38
  import { runOpGenerate } from "./run-generate.js";
39
39
  import { actorFromEnv } from "../../actor.js";
40
40
  /**
@@ -856,6 +856,8 @@ appliedDigestOf) {
856
856
  // #1035, #4020: who approved at the gate and which resolution admitted the deploy.
857
857
  ...(gateApprover(componentResult) ? { approver: gateApprover(componentResult) } : {}),
858
858
  ...(gateAdmission(componentResult) ? { admission: gateAdmission(componentResult) } : {}),
859
+ // #5401: the gates that apply in other environments, skipped here.
860
+ ...(gatesSkipped(componentResult) ? { gatesSkipped: gatesSkipped(componentResult) } : {}),
859
861
  // #4043: the release the deploy was made under, when `--release` named one.
860
862
  ...(releaseDigest !== undefined ? { releaseDigest } : {}),
861
863
  ...(releaseDigest !== undefined && templatesDigestOf?.(componentResult.component) ? { templatesDigest: templatesDigestOf(componentResult.component) } : {}),
@@ -1291,7 +1293,7 @@ async function runComponentSelection(ctx) {
1291
1293
  if (result.gated.mismatch) {
1292
1294
  console.error(formatWarning({ message: describeGateMismatch(gate.op, gate.gate, result.gated.mismatch, sealed) }));
1293
1295
  }
1294
- console.error(formatInfo(`approve : ${approveCommand(gate.op, gate.gate, gate.environment, undefined, sealed)}`));
1296
+ console.error(formatInfo(`approve : ${approveCommand(gate.op, gate.gate, gate.environment, gate.planDigest, sealed)}`));
1295
1297
  if (gate.url)
1296
1298
  console.error(formatInfo(`approve at: ${gate.url}`));
1297
1299
  console.error(formatInfo(`expires : ${gate.expiresAt}`));
@@ -0,0 +1,35 @@
1
+ /**
2
+ * `chant stage pause <stage>` and `chant stage resume <stage>` (#5355).
3
+ *
4
+ * The stage is one of the member's pipeline, read at the default branch's
5
+ * tip as `components promote` reads it. Each writes a line on the stage's
6
+ * ledger (`../../pipeline/stage-ledger.ts`) naming who (`--actor`, else the
7
+ * CI or shell user) and why (`--reason`), and pushes it. While a stage is
8
+ * paused, `components promote` into it exits 3 and records the release that
9
+ * waited. A resume names the newest of those, which is the one that enters;
10
+ * the older ones are refused from then on.
11
+ */
12
+ import type { PipelineSpec } from "../../pipeline/spec.js";
13
+ import { type StageLedgerPort } from "../../pipeline/stage-ledger.js";
14
+ import type { CommandContext } from "../registry.js";
15
+ /** What a pause or resume did: the exit code and the lines it prints. */
16
+ export interface StageCommandResult {
17
+ exitCode: number;
18
+ lines: {
19
+ level: "info" | "success" | "warning" | "error";
20
+ text: string;
21
+ }[];
22
+ }
23
+ /** Pause or resume `stage` of `spec` on `port`. The handler's work, without the reads of git and the environment. */
24
+ export declare function stageCommand(input: {
25
+ verb: "pause" | "resume";
26
+ spec: PipelineSpec;
27
+ stage: string;
28
+ by: string;
29
+ reason?: string;
30
+ port: StageLedgerPort;
31
+ now: Date;
32
+ }): Promise<StageCommandResult>;
33
+ export declare const runStagePause: (ctx: CommandContext) => Promise<number>;
34
+ export declare const runStageResume: (ctx: CommandContext) => Promise<number>;
35
+ export declare function runStageUnknown(): Promise<number>;
@@ -0,0 +1,90 @@
1
+ /**
2
+ * `chant stage pause <stage>` and `chant stage resume <stage>` (#5355).
3
+ *
4
+ * The stage is one of the member's pipeline, read at the default branch's
5
+ * tip as `components promote` reads it. Each writes a line on the stage's
6
+ * ledger (`../../pipeline/stage-ledger.ts`) naming who (`--actor`, else the
7
+ * CI or shell user) and why (`--reason`), and pushes it. While a stage is
8
+ * paused, `components promote` into it exits 3 and records the release that
9
+ * waited. A resume names the newest of those, which is the one that enters;
10
+ * the older ones are refused from then on.
11
+ */
12
+ import { actorFromEnv } from "../../actor.js";
13
+ import { promoteBase, readPipelineAt } from "../../pipeline/read.js";
14
+ import { gitStageLedgerPort, pauseLine, resumeLine } from "../../pipeline/stage-ledger.js";
15
+ import { formatError, formatInfo, formatSuccess, formatWarning } from "../format.js";
16
+ const USAGE = "chant stage pause <stage> [--reason <text>] [--actor <name>] | chant stage resume <stage> [--reason <text>] [--actor <name>]";
17
+ /** Pause or resume `stage` of `spec` on `port`. The handler's work, without the reads of git and the environment. */
18
+ export async function stageCommand(input) {
19
+ const { spec, stage, verb } = input;
20
+ if (!spec.stages.some((s) => s.name === stage)) {
21
+ return { exitCode: 1, lines: [{ level: "error", text: `the pipeline "${spec.name}" has no stage "${stage}"; its stages are ${spec.stages.map((s) => s.name).join(", ")}` }] };
22
+ }
23
+ const lines = await input.port.read(spec.name, stage);
24
+ const args = { pipeline: spec.name, stage, by: input.by, ...(input.reason ? { reason: input.reason } : {}), lines, now: input.now };
25
+ const line = verb === "pause" ? pauseLine(args) : resumeLine(args);
26
+ if ("refused" in line)
27
+ return { exitCode: 1, lines: [{ level: "error", text: line.refused }] };
28
+ const pushed = await input.port.append(line);
29
+ const out = [];
30
+ if (verb === "pause") {
31
+ out.push({ level: "success", text: `paused stage ${stage} of ${spec.name}${input.reason ? ` (${input.reason})` : ""}: a promote into it exits 3 until \`chant stage resume ${stage}\`; one applying now finishes` });
32
+ }
33
+ else {
34
+ out.push({ level: "success", text: `resumed stage ${stage} of ${spec.name}${input.reason ? ` (${input.reason})` : ""}` });
35
+ if (line.admits) {
36
+ const name = line.admits.label ?? line.admits.digest;
37
+ out.push({ level: "info", text: `release ${name} is the newest that waited, and it enters: chant components promote --to ${stage} --release ${name}` });
38
+ if (line.superseded?.length)
39
+ out.push({ level: "info", text: `the older releases that waited are refused from now on: ${line.superseded.join(", ")}` });
40
+ }
41
+ else
42
+ out.push({ level: "info", text: "no release waited while it was paused" });
43
+ }
44
+ if (!pushed.pushed)
45
+ out.push({ level: "warning", text: `the ${verb} is recorded locally and did not reach the remote${pushed.pushWarning ? `: ${pushed.pushWarning}` : ""}` });
46
+ return { exitCode: 0, lines: out };
47
+ }
48
+ async function runStage(ctx, verb) {
49
+ const stage = ctx.args.extraPositional;
50
+ if (!stage) {
51
+ console.error(formatError({ message: `chant stage ${verb} needs a stage`, hint: USAGE }));
52
+ return 1;
53
+ }
54
+ const by = ctx.args.actor ?? (actorFromEnv(process.env, "") || undefined);
55
+ if (!by) {
56
+ console.error(formatError({ message: "Could not resolve --actor from the environment", hint: "Pass --actor explicitly, or set GITHUB_ACTOR / GITLAB_USER_LOGIN / USER." }));
57
+ return 1;
58
+ }
59
+ const cwd = process.cwd();
60
+ const base = promoteBase(cwd);
61
+ const read = base ? readPipelineAt(base, cwd) : undefined;
62
+ if (!read || read.status === "absent") {
63
+ console.error(formatError({ message: "this member has no .chant/pipeline.ts on its default branch, so it has no stages to pause or resume", hint: USAGE }));
64
+ return 1;
65
+ }
66
+ if (read.status === "refused") {
67
+ console.error(formatError({ message: `the pipeline at ${base.slice(0, 12)} does not fold: ${read.line}` }));
68
+ return 1;
69
+ }
70
+ const { fetchLifecycle } = await import("../../lifecycle/git.js");
71
+ await fetchLifecycle().catch(() => false);
72
+ const result = await stageCommand({ verb, spec: read.spec, stage, by, ...(ctx.args.reason ? { reason: ctx.args.reason } : {}), port: gitStageLedgerPort(), now: new Date() });
73
+ for (const l of result.lines) {
74
+ if (l.level === "error")
75
+ console.error(formatError({ message: l.text, hint: USAGE }));
76
+ else if (l.level === "warning")
77
+ console.error(formatWarning({ message: l.text }));
78
+ else if (l.level === "success")
79
+ console.error(formatSuccess(l.text));
80
+ else
81
+ console.error(formatInfo(l.text));
82
+ }
83
+ return result.exitCode;
84
+ }
85
+ export const runStagePause = (ctx) => runStage(ctx, "pause");
86
+ export const runStageResume = (ctx) => runStage(ctx, "resume");
87
+ export async function runStageUnknown() {
88
+ console.error(formatError({ message: "chant stage takes pause or resume", hint: USAGE }));
89
+ return 1;
90
+ }
@@ -297,6 +297,10 @@ export class LspServer {
297
297
  rules.push(...(plugin.lintRules?.() ?? []));
298
298
  intrinsics.push(...(plugin.intrinsics?.() ?? []));
299
299
  }
300
+ // #5324: a pipeline declaration folds as `chant build` folds it, whatever lexicons load.
301
+ const { evl012PipelineFoldRule, isPipelineFile } = await import("../../lint/rules/evl012-pipeline-fold.js");
302
+ if (isPipelineFile(filePath) && !rules.some((r) => r.id === evl012PipelineFoldRule.id))
303
+ rules.push(evl012PipelineFoldRule);
300
304
  if (rules.length === 0)
301
305
  return [];
302
306
  const { diagnostics } = await runLint([filePath], rules, undefined, intrinsics);
package/dist/cli/main.js CHANGED
@@ -476,6 +476,38 @@ CI:
476
476
  hand, one run at a time, and every gives each commit
477
477
  a run of its own.
478
478
 
479
+ Pipeline:
480
+ pipeline spec [--stage <stage>] [--at <commit>]
481
+ Print the folded .chant/pipeline.ts, or one stage's
482
+ op-waves spec; --at folds it as it stood at a commit
483
+ pipeline generate <github|gitlab|forgejo> [--output <dir>] [--format json]
484
+ Write the merge's waves workflow and the promote
485
+ workflow for each stage after the first
486
+ pipeline artifacts publish --stage <stage> [--release <label|digest>]
487
+ Publish the release artifacts the stage declares,
488
+ for the release named or the one cut from HEAD
489
+ pipeline artifacts read --stage <stage> [--release <label|digest>]
490
+ [--name <artifact>] [--from <dir>] [--json]
491
+ Print the artifacts a stage published for a release
492
+ (default $CHANT_CONTROL_RELEASE, else its latest);
493
+ --from reads another repository's chant/lifecycle
494
+ pipeline agent run --stage <stage> --release <label|digest> [--output <dir>]
495
+ Run the stage's agent steps for a release and write
496
+ each answer to a file; reads the ledger, writes none
497
+ pipeline agent record --stage <stage> --release <label|digest> [--from <dir>]
498
+ Check each answer against the schema at base and
499
+ record it with the release, its prompt digest and cost
500
+ pipeline agent answer --stage <stage> --release <label|digest> [--name <step>]
501
+ Print the stage's agent answers for a release
502
+ pipeline release-of <commit>
503
+ Print the digest of the release cut from a commit
504
+ stage pause <stage> [--reason <text>]
505
+ Pause a stage: a promote into it exits 3 and its
506
+ release waits; one applying now finishes
507
+ stage resume <stage> [--reason <text>]
508
+ Resume a paused stage; the newest release that
509
+ waited is the one that enters
510
+
479
511
  Releases:
480
512
  ${releaseHelp()}
481
513
 
@@ -677,6 +709,16 @@ Ops:
677
709
  plan that moved while you were asked exits 4.
678
710
  --yes, --json, CI and no terminal record as before
679
711
  (#4575)
712
+ reject <op> <gate> Reject the digest a gate waits on, with --reason
713
+ <text>: at a pipeline stage's gate (reject <pipeline>
714
+ <stage>) the release does not enter the stage, and
715
+ components promote exits 8 naming who rejected it and
716
+ why. The digest, environment and release come off the
717
+ gate's pending fact, or --plan, --env and --release.
718
+ It takes the proof rules an approval takes: --sign
719
+ [<key file>], or --statement then --signature <file|->
720
+ --at <time>; a sealed gate counts only a signed one.
721
+ More approvals never clear it; a new release does
680
722
  On op policy-override the gate is the subject a
681
723
  policy denied: --rule <id> names each rule that
682
724
  denied it and --reason <text> says why the plan goes
@@ -1360,6 +1402,10 @@ Component release ledger + status:
1360
1402
  runs the model command with no forge token, land
1361
1403
  pushes the change, opens or updates the pull
1362
1404
  request and records the run (--forge <kind>)
1405
+ agent apply-failed A product's apply job records a failed apply for
1406
+ the failed-apply agent (#5357), with
1407
+ CHANT_AGENT_FACTS=apply-failed and the relay key
1408
+ (--op <name> --from <log> [--member <m>])
1363
1409
  commit prepare|run|land The commit jobs (#4722) the Op generator writes for
1364
1410
  a spec's commit: prepare decides from the comment or
1365
1411
  the failed check, the ledger's run count and the
@@ -1408,8 +1454,9 @@ Component release ledger + status:
1408
1454
  the applied head checked again (#4636);
1409
1455
  --respond <list> turns the failed apply's
1410
1456
  triage and the refused apply's diff on or off
1411
- (wave-refused=diff|off,apply-failed=triage|off,
1412
- #4629);
1457
+ (wave-refused=diff|summary|off,
1458
+ apply-failed=triage|off, #4629; summary adds
1459
+ a model's summary above the diff, #5335);
1413
1460
  --events-json, both commands: the run-event
1414
1461
  stream on stdout; --report-url <s3 or file URL>,
1415
1462
  both commands: copy the report, the change set
@@ -1439,6 +1486,7 @@ Component release ledger + status:
1439
1486
  components promote Deploy the digests one environment's release
1440
1487
  ledger records to another, without a build
1441
1488
  (--to <env> [--from <env>] [--allow-skip]
1489
+ [--pending]
1442
1490
  [--release <label|digest> [--plan-only]]
1443
1491
  [--component <name> [--digest <sha256:...>]];
1444
1492
  --from defaults to the environment before --to
@@ -1449,17 +1497,31 @@ Component release ledger + status:
1449
1497
  it applies; --wave-gate <gate> checks each wave
1450
1498
  at <gate>-wave-<k>; a stop writes --resume <file>;
1451
1499
  --plan-only plans and stores the release's change
1452
- set and deploys nothing, #4037)
1500
+ set and deploys nothing, #4037; --urgent
1501
+ --release <label> --reason <text> passes a
1502
+ pipeline stage's gate on its urgent rule, #5355)
1453
1503
  components rollback <env> Redeploy an earlier release of an environment
1454
1504
  from its recorded digest (--component <name>
1455
1505
  [--digest <sha256:...>]; defaults to the release
1456
1506
  before the current one; --dry-run prints the plan).
1457
1507
  --release <label|digest> restores every component
1458
- of that release through the release gate (#4035)
1508
+ of that release through the release gate (#4035);
1509
+ a pipeline stage with pauseAfterRollback is
1510
+ paused once it finishes (#5355); --requested
1511
+ carries out the rollback a stage with
1512
+ onVerifyFail: "rollback" requested, once its
1513
+ <stage>-rollback gate is approved (#5328)
1459
1514
  components redeploy <env> Redeploy the release an environment's ledger
1460
1515
  records as current, after a deploy that failed
1461
1516
  partway (--component <name> [--digest <sha256:...>];
1462
1517
  --dry-run prints the plan; gates still apply)
1518
+ components replan After --component <a,b> applied in --env <env>,
1519
+ compare their outputs with the last recorded ones,
1520
+ list the dependents that read a changed output,
1521
+ and plan the dependents of the members the stage's
1522
+ replanDependents names; the plan waits at
1523
+ <gate>-replan and nothing applies (--gate, --op,
1524
+ --dry-run, --json)
1463
1525
 
1464
1526
  Lexicon development:
1465
1527
  dev generate Generate lexicon artifacts (+ validate + coverage)
@@ -1660,8 +1722,8 @@ Options:
1660
1722
  chant.config.ts's build.sandbox: true; #1045)
1661
1723
  --param <name=value> (build, graph, run --components, components fan-out,
1662
1724
  components promote, components rollback,
1663
- components redeploy, components pr-env up,
1664
- release cut) Bind a
1725
+ components redeploy, components replan,
1726
+ components pr-env up, release cut) Bind a
1665
1727
  declared build-time parameter (chant.config.ts's buildParams)
1666
1728
  to a value, for source to read as params.<name>
1667
1729
  (#1064) instead of process.env — repeatable.
@@ -1673,8 +1735,8 @@ Options:
1673
1735
  chant.template.json declares instead (#2627).
1674
1736
  --params-file <path> (build, graph, run --components, components fan-out,
1675
1737
  components promote, components rollback,
1676
- components redeploy, components pr-env up,
1677
- release cut) JSON file
1738
+ components redeploy, components replan,
1739
+ components pr-env up, release cut) JSON file
1678
1740
  of { "name": value } build-time parameter values
1679
1741
  (#1064). Second precedence, after --param.
1680
1742
  init --from refuses it: pass --param instead.
@@ -2048,6 +2110,8 @@ export const commandRegistry = [
2048
2110
  { name: "operator log", handler: runOperatorLog },
2049
2111
  { name: "operator", handler: runOperator },
2050
2112
  { name: "approve", handler: runApprove },
2113
+ // #5354 — reject the digest a gate waits on. Imported on first use.
2114
+ { name: "reject", handler: async (ctx) => (await import("./handlers/reject.js")).runReject(ctx) },
2051
2115
  // #4293 — target locks a pull request holds on chant/lifecycle. Imported on first use.
2052
2116
  // #4611 — approve a waiting gate from a chat click. Imported on first use.
2053
2117
  { name: "audit-log attribute", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/audit-log.js")).runAuditLogAttribute(ctx) },
@@ -2166,6 +2230,8 @@ export const commandRegistry = [
2166
2230
  { name: "agent prepare", handler: async (ctx) => (await import("./handlers/agent.js")).runAgentCommandLine(ctx) },
2167
2231
  { name: "agent run", handler: async (ctx) => (await import("./handlers/agent.js")).runAgentCommandLine(ctx) },
2168
2232
  { name: "agent land", handler: async (ctx) => (await import("./handlers/agent.js")).runAgentCommandLine(ctx) },
2233
+ // #5357: a product's own apply job records a failed apply for the failed-apply agent.
2234
+ { name: "agent apply-failed", handler: async (ctx) => (await import("./handlers/agent.js")).runAgentCommandLine(ctx) },
2169
2235
  { name: "commit prepare", handler: async (ctx) => (await import("./handlers/commit.js")).runCommitCommandLine(ctx) },
2170
2236
  { name: "commit run", handler: async (ctx) => (await import("./handlers/commit.js")).runCommitCommandLine(ctx) },
2171
2237
  { name: "commit land", handler: async (ctx) => (await import("./handlers/commit.js")).runCommitCommandLine(ctx) },
@@ -2176,6 +2242,8 @@ export const commandRegistry = [
2176
2242
  { name: "components promote", handler: runComponentsPromote },
2177
2243
  { name: "components rollback", handler: runComponentsRollback },
2178
2244
  { name: "components redeploy", handler: runComponentsRedeploy },
2245
+ // #5345: list the dependents of changed outputs after an apply, and plan them for the members a stage opts in.
2246
+ { name: "components replan", requiresPlugins: true, handler: async (ctx) => (await import("./handlers/replan.js")).runComponentsReplan(ctx) },
2179
2247
  // Local emulators of configured lexicons (#920). Compound so the action word
2180
2248
  // lands in args.path (not consumed as a project dir) and projectPath is forced ".".
2181
2249
  { name: "emulator up", requiresPlugins: true, handler: runEmulator },
@@ -2193,6 +2261,18 @@ export const commandRegistry = [
2193
2261
  { name: "serve", handler: runServeUnknown },
2194
2262
  { name: "components", handler: runComponentsUnknown },
2195
2263
  { name: "release", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/release.js")).runReleaseUnknown(ctx) },
2264
+ // #5324: the member's folded pipeline.
2265
+ { name: "pipeline spec", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/pipeline.js")).runPipelineSpec(ctx) },
2266
+ { name: "pipeline generate", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/pipeline.js")).runPipelineGenerate(ctx) },
2267
+ // #5356: release artifacts a stage publishes, and the release cut from a commit.
2268
+ { name: "pipeline artifacts", handler: async (ctx) => (await import("./handlers/pipeline-artifacts.js")).runPipelineArtifacts(ctx) },
2269
+ { name: "pipeline agent", handler: async (ctx) => (await import("./handlers/pipeline-agent.js")).runPipelineAgent(ctx) },
2270
+ { name: "pipeline release-of", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/pipeline-artifacts.js")).runPipelineReleaseOf(ctx) },
2271
+ { name: "pipeline", runsNoConfig: true, handler: async () => (await import("./handlers/pipeline.js")).runPipelineUnknown() },
2272
+ // #5355: pause and resume a stage of the member's pipeline.
2273
+ { name: "stage pause", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/stage.js")).runStagePause(ctx) },
2274
+ { name: "stage resume", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/stage.js")).runStageResume(ctx) },
2275
+ { name: "stage", runsNoConfig: true, handler: async () => (await import("./handlers/stage.js")).runStageUnknown() },
2196
2276
  { name: "workspace", handler: async (ctx) => (await import("../workspace/records-cli.js")).runWorkspaceUnknown(ctx) },
2197
2277
  ];
2198
2278
  // #5263: every release command but init, which writes the config, refuses a chant.config it can't load
@@ -102,6 +102,9 @@ const BOOLEAN_FLAGS = new Set([
102
102
  "--uncommitted",
103
103
  "--allow-code",
104
104
  "--allow-skip",
105
+ "--urgent",
106
+ "--pending",
107
+ "--requested",
105
108
  "--allow-unsigned",
106
109
  "--override-green",
107
110
  "--require-provenance",
@@ -755,10 +758,10 @@ export function parseArgs(args) {
755
758
  result.list = true;
756
759
  }
757
760
  else if (arg === "--stage") {
758
- // `chant lock --stage plan|apply|lock` (#4293): how the lock was taken.
761
+ // `chant lock --stage plan|apply|lock` (#4293): how the lock was taken. `chant pipeline spec --stage <stage>` (#5324): the stage.
759
762
  result.lockStage = args[++i];
760
763
  if (!result.lockStage || result.lockStage.startsWith("-"))
761
- throw new Error("--stage needs plan, apply or lock: --stage <stage>");
764
+ throw new Error("--stage needs a value: --stage <stage> (plan, apply or lock for chant lock; a stage's name for chant pipeline spec)");
762
765
  }
763
766
  else if (arg === "--alive") {
764
767
  // `chant lock --alive <run>` (#4552): print whether a run holding rows or the repo lock tag still runs.
@@ -901,6 +904,24 @@ export function parseArgs(args) {
901
904
  throw new Error("--decide-model needs a model id");
902
905
  result.decideModel = value;
903
906
  }
907
+ else if (arg === "--wave-summary") {
908
+ // `chant build --pr-loop --wave-summary <field>=<value>` (#5399): a setting of the refused-wave summary.
909
+ const raw = args[++i] ?? "";
910
+ const at = raw.indexOf("=");
911
+ if (at < 1)
912
+ throw new Error(`--wave-summary needs <field>=<value>, such as keyEnv=MODEL_KEY: got "${raw}"`);
913
+ (result.waveSummary ?? (result.waveSummary = {}))[raw.slice(0, at)] = raw.slice(at + 1);
914
+ }
915
+ else if (arg === "--agent-facts" || arg === "--agent-facts-key-env") {
916
+ // `chant build --pr-loop --agent-facts <trigger>[,<trigger>]` and `--agent-facts-key-env <NAME>` (#5399).
917
+ const value = args[++i];
918
+ if (value === undefined || value.startsWith("-") || value === "")
919
+ throw new Error(`${arg} needs ${arg === "--agent-facts" ? "a trigger list: --agent-facts apply-failed[,verify-failed]" : "a variable name: --agent-facts-key-env <NAME>"}`);
920
+ if (arg === "--agent-facts")
921
+ result.agentFactsTriggers = value.split(",").map((t) => t.trim()).filter(Boolean);
922
+ else
923
+ result.agentFactsKeyEnv = value;
924
+ }
904
925
  else if (arg === "--merge" || arg === "--merge-token-env" || arg === "--merge-method") {
905
926
  // `chant components pr-apply --before-merge --merge auto --merge-token-env <VAR>` (#4636).
906
927
  const value = args[++i];
@@ -1829,11 +1850,23 @@ export function parseArgs(args) {
1829
1850
  // only when asked to.
1830
1851
  result.allowCode = true;
1831
1852
  }
1853
+ else if (arg === "--urgent") {
1854
+ // #5355 — `chant components promote --urgent` passes the stage's gate on its urgent rule.
1855
+ result.urgent = true;
1856
+ }
1832
1857
  else if (arg === "--allow-skip") {
1833
1858
  // #4030 — `chant components promote` skips a step of the member's
1834
1859
  // declared promotion order only when asked to.
1835
1860
  result.allowSkip = true;
1836
1861
  }
1862
+ else if (arg === "--pending") {
1863
+ // #5326 — `chant components promote --to <stage> --pending` runs again the promotion a soak holds.
1864
+ result.pendingPromotion = true;
1865
+ }
1866
+ else if (arg === "--requested") {
1867
+ // #5328 — `chant components rollback <stage> --requested` carries out the rollback the stage requested.
1868
+ result.rollbackRequested = true;
1869
+ }
1837
1870
  else if (arg === "--source") {
1838
1871
  // #2551 — `chant workspace upgrade --source <repo>[#<member>]`.
1839
1872
  result.source = args[++i];
@@ -178,6 +178,12 @@ export interface ParsedArgs {
178
178
  allowCode?: boolean;
179
179
  /** `chant components promote --allow-skip` (#4030): promote past a step of the member's declared promotion order. */
180
180
  allowSkip?: boolean;
181
+ /** `chant components promote --urgent` (#5355): pass the stage's gate on its urgent rule, one proven approval from its role. */
182
+ urgent?: boolean;
183
+ /** `chant components promote --to <stage> --pending` (#5326): run again the promotion into the stage that a soak holds, as its pending fact names it. */
184
+ pendingPromotion?: boolean;
185
+ /** `chant components rollback <stage> --requested` (#5328): carry out the rollback the stage requested when its verify or soak failed, once its gate passes. */
186
+ rollbackRequested?: boolean;
181
187
  /** `chant release publish --allow-unsigned` (#4049): publish a release with no signature that verifies, with a warning. Never overrides identity.gates.release. */
182
188
  allowUnsigned?: boolean;
183
189
  /** `chant release publish --require-provenance` (#4049): refuse a run with no OIDC token, where it warns. */
@@ -480,6 +486,12 @@ export interface ParsedArgs {
480
486
  decideBackend?: string;
481
487
  /** `pr-post --decide-model <id>` (#4629): the pinned model the description check asks. */
482
488
  decideModel?: string;
489
+ /** `chant build --pr-loop --wave-summary <field>=<value>` (#5399), repeatable: a setting of the refused-wave summary the apply job carries with `--respond wave-refused=summary`. The fields are those of `WaveSummarySpec`. */
490
+ waveSummary?: Record<string, string>;
491
+ /** `chant build --pr-loop --agent-facts <trigger>[,<trigger>]` (#5399): the facts the apply job records for an agent, as a waves pipeline's `agentFacts.triggers`. */
492
+ agentFactsTriggers?: string[];
493
+ /** `chant build --pr-loop --agent-facts-key-env <NAME>` (#5399): the secret or variable holding the relay key; default `CHANT_RELAY_KEY`. */
494
+ agentFactsKeyEnv?: string;
483
495
  /**
484
496
  * `chant build --pr-loop --apply-before-merge` and `chant ci run apply
485
497
  * --apply-before-merge` (#4301): the pipeline's apply job applies an open
@@ -81,6 +81,8 @@ export interface AutoReleaseRunInfo {
81
81
  /** Who approved the deploy at its gate (#1035) and the gate resolution that admitted it (#4020), when it passed one. `recordAutoReleasesForRun` reads both off the component's gate step records. */
82
82
  approver?: string;
83
83
  admission?: ReleaseAdmission;
84
+ /** The gates the run skipped because they apply in other environments (#5401). */
85
+ gatesSkipped?: string[];
84
86
  /** The bypassed capability-profile divergences, when the caller deliberately overrode a deploy-time profile assertion (chant #1244) — recorded verbatim as the release record's `profileOverride`. */
85
87
  profileOverride?: string;
86
88
  /** The deploy's input-side digest, when `digest` is a rendered-content identity (a pinned helm deploy, chant #1242) — recorded as the release record's `inputDigest` so ledger queries can still join on inputs across clusters whose bytes legitimately differ. */
@@ -160,6 +160,7 @@ export async function maybeRecordAutoRelease(run, options = {}) {
160
160
  actor,
161
161
  ...(run.approver ? { approver: run.approver } : {}),
162
162
  ...(run.admission ? { admission: run.admission } : {}),
163
+ ...(run.gatesSkipped ? { gatesSkipped: run.gatesSkipped } : {}),
163
164
  ...(run.profileOverride ? { profileOverride: run.profileOverride } : {}),
164
165
  ...(run.inputDigest ? { inputDigest: run.inputDigest } : {}),
165
166
  ...(run.releaseDigest ? { releaseDigest: run.releaseDigest } : {}),
@@ -327,6 +327,14 @@ export interface Capability<In = unknown, Out = unknown> {
327
327
  * `outputs` field.
328
328
  */
329
329
  outputs?(ctx: DeployContext, input: In): Promise<Record<string, unknown>>;
330
+ /**
331
+ * Optional (#5345): {@link outputs} with the names of the outputs the
332
+ * engine marks sensitive or secret, read in one call. A Terraform output
333
+ * with `sensitive = true`, a Pulumi secret. `chant components replan`
334
+ * keeps no digest of those and counts each as changed whenever its member
335
+ * applied. Absent, `outputs` is read and none is marked.
336
+ */
337
+ markedOutputs?(ctx: DeployContext, input: In): Promise<MarkedOutputs>;
330
338
  /**
331
339
  * How this verb relates to rollback, for the COMP003 composition check.
332
340
  * Usually derivable and left unset: a capability with a `rollback` method is
@@ -388,6 +396,17 @@ export interface Capability<In = unknown, Out = unknown> {
388
396
  * throw counts as no reads.
389
397
  */
390
398
  declaredReads?(ctx: DeclaredReadsContext, members: readonly DeclaredReadMember[]): Promise<DeclaredRead[]> | DeclaredRead[];
399
+ /**
400
+ * Optional (#5331): the reads between this capability's steps for the
401
+ * component graph, beside {@link declaredReads}. It is asked the same way
402
+ * and answers from the same reader, and it also reports the reads whose
403
+ * upstream no component of the project deploys, which `declaredReads`
404
+ * leaves out because there is nothing to order. `chant graph --components`
405
+ * draws an edge for each: to the upstream component, or to a node marked
406
+ * external. The answer must come from the declaration and the files
407
+ * alone; a throw counts as no reads.
408
+ */
409
+ graphReads?(ctx: DeclaredReadsContext, members: readonly DeclaredReadMember[]): Promise<GraphRead[]> | GraphRead[];
391
410
  /**
392
411
  * Optional (#4542): the local files a step deploys from when its input
393
412
  * names them indirectly, as `terraform-apply` names a root by key. A
@@ -547,6 +566,27 @@ export interface DeclaredRead {
547
566
  /** Where in the reader's step the reference goes, as a JSON Pointer. */
548
567
  at: string;
549
568
  }
569
+ /**
570
+ * A read `graphReads` found (#5331): `reader`'s step `index` reads the output
571
+ * `output` of a stack, named by `upstream` when a component of the project
572
+ * deploys it, else by `external`.
573
+ */
574
+ export interface GraphRead {
575
+ reader: string;
576
+ /** The reader's step, as {@link DeclaredReadMember.index}. Default 0. */
577
+ index?: number;
578
+ /** The component that deploys the stack read. Absent with {@link external}. */
579
+ upstream?: string;
580
+ /** The stack read when no component of the project deploys it, as the engine names it (`org/project/stack`). */
581
+ external?: string;
582
+ /** The output read, where the program shows it. Absent when it names none. */
583
+ output?: string;
584
+ }
585
+ /** What `markedOutputs` answers (#5345): the outputs, and the names the engine marks sensitive or secret. */
586
+ export interface MarkedOutputs {
587
+ outputs: Record<string, unknown>;
588
+ sensitive: string[];
589
+ }
550
590
  /** One component of a group, as core hands it to the capability (ws-107). */
551
591
  export interface GroupMember<In = unknown> {
552
592
  component: string;
@@ -34,6 +34,7 @@ import type { DeployAdoption } from "./adoption.js";
34
34
  import type { LockGrain } from "../lifecycle/lock-rows.js";
35
35
  import type { RowLeasePort } from "./row-lease.js";
36
36
  import type { FanOutPlan } from "./fan-out.js";
37
+ import { type PlacedGraphRead } from "./declared-reads.js";
37
38
  import { type ChantConfig } from "../config.js";
38
39
  /** One component in `chant list --components` output. */
39
40
  export interface ListedComponent {
@@ -97,10 +98,29 @@ export interface ComponentGraphResult {
97
98
  archetypes?: Record<string, Archetype>;
98
99
  /** Component name → the environments it declares (#3153), present only for components that declared them. */
99
100
  environments?: Record<string, ComponentEnvironmentDeclaration[]>;
101
+ /**
102
+ * The reads the components' capabilities find in the files their steps
103
+ * name (#5331), such as a Pulumi program's `StackReference`s, read for the
104
+ * run's environment. Present only when `computeComponentGraph` was asked to
105
+ * read them and found some.
106
+ */
107
+ reads?: PlacedGraphRead[];
100
108
  error?: string;
101
109
  }
110
+ /** What `computeComponentGraph` reads besides the declarations. */
111
+ export interface ComponentGraphOptions {
112
+ /**
113
+ * Also read the capabilities' graph reads (#5331), with each step resolved
114
+ * for `env` when one is given (#5360). The registry is the project's own
115
+ * unless `registry` is passed.
116
+ */
117
+ reads?: {
118
+ env?: string;
119
+ registry?: CapabilityRegistry;
120
+ };
121
+ }
102
122
  /** Compute the components' dependency graph under `path`, for `chant graph --components`. */
103
- export declare function computeComponentGraph(path: string, sandbox?: boolean, buildParams?: BuildParamProvenance[]): Promise<ComponentGraphResult>;
123
+ export declare function computeComponentGraph(path: string, sandbox?: boolean, buildParams?: BuildParamProvenance[], options?: ComponentGraphOptions): Promise<ComponentGraphResult>;
104
124
  /** A generate-mode target lexicon name — any lexicon whose plugin implements `generateComponentPipeline` (gitlab, github, forgejo and prow today). */
105
125
  export type GenerateLexicon = string;
106
126
  /**