@intentius/chant 0.124.109 → 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 (338) 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/replan.d.ts +54 -0
  80. package/dist/cli/handlers/replan.js +177 -0
  81. package/dist/cli/handlers/run-generate.d.ts +5 -0
  82. package/dist/cli/handlers/run-generate.js +31 -4
  83. package/dist/cli/handlers/run-wave.js +15 -2
  84. package/dist/cli/handlers/run.js +4 -2
  85. package/dist/cli/handlers/stage.d.ts +35 -0
  86. package/dist/cli/handlers/stage.js +90 -0
  87. package/dist/cli/lsp/server.js +4 -0
  88. package/dist/cli/main.js +88 -8
  89. package/dist/cli/parse-args.js +35 -2
  90. package/dist/cli/registry.d.ts +12 -0
  91. package/dist/components/auto-release.d.ts +2 -0
  92. package/dist/components/auto-release.js +1 -0
  93. package/dist/components/capability.d.ts +40 -0
  94. package/dist/components/cli-support.d.ts +21 -1
  95. package/dist/components/cli-support.js +28 -6
  96. package/dist/components/component.d.ts +23 -4
  97. package/dist/components/component.schema.json +28 -0
  98. package/dist/components/declared-reads.d.ts +44 -4
  99. package/dist/components/declared-reads.js +80 -3
  100. package/dist/components/discover.d.ts +8 -0
  101. package/dist/components/discover.js +1 -1
  102. package/dist/components/driver.d.ts +13 -0
  103. package/dist/components/driver.js +23 -2
  104. package/dist/components/environment-sets.d.ts +229 -0
  105. package/dist/components/environment-sets.js +338 -0
  106. package/dist/components/fan-out-canary.d.ts +47 -0
  107. package/dist/components/fan-out-canary.js +58 -0
  108. package/dist/components/fan-out-run.d.ts +17 -0
  109. package/dist/components/fan-out-run.js +14 -1
  110. package/dist/components/fan-out-support.d.ts +7 -0
  111. package/dist/components/fan-out-support.js +1 -1
  112. package/dist/components/groups.d.ts +8 -1
  113. package/dist/components/groups.js +19 -1
  114. package/dist/components/index.d.ts +5 -2
  115. package/dist/components/index.js +4 -1
  116. package/dist/components/pr-cost.d.ts +28 -0
  117. package/dist/components/pr-cost.js +53 -0
  118. package/dist/components/pr-pipeline.d.ts +33 -0
  119. package/dist/components/pr-pipeline.js +32 -5
  120. package/dist/components/pr-policy.d.ts +33 -2
  121. package/dist/components/pr-policy.js +5 -2
  122. package/dist/components/pr-risk.d.ts +42 -0
  123. package/dist/components/pr-risk.js +74 -0
  124. package/dist/components/product-pipeline.d.ts +43 -0
  125. package/dist/components/product-pipeline.js +67 -1
  126. package/dist/components/promote.d.ts +6 -0
  127. package/dist/components/promote.js +13 -0
  128. package/dist/components/release-compile.js +3 -1
  129. package/dist/components/release-gate.d.ts +6 -1
  130. package/dist/components/release-gate.js +10 -2
  131. package/dist/components/step-environments.d.ts +236 -0
  132. package/dist/components/step-environments.js +392 -0
  133. package/dist/components/upstream-replan.d.ts +201 -0
  134. package/dist/components/upstream-replan.js +249 -0
  135. package/dist/components/verify-step.d.ts +30 -0
  136. package/dist/components/verify-step.js +27 -0
  137. package/dist/components/wave-plan.js +6 -2
  138. package/dist/config-environments.d.ts +4 -2
  139. package/dist/control/dispatch.d.ts +15 -0
  140. package/dist/control/dispatch.js +28 -4
  141. package/dist/cost-estimate.d.ts +188 -0
  142. package/dist/cost-estimate.js +363 -0
  143. package/dist/drift-record.d.ts +36 -0
  144. package/dist/drift-record.js +44 -0
  145. package/dist/engine-facts.d.ts +105 -0
  146. package/dist/engine-facts.js +111 -0
  147. package/dist/exit-codes.d.ts +4 -3
  148. package/dist/exit-codes.js +4 -3
  149. package/dist/flag-params.d.ts +2 -2
  150. package/dist/flag-params.js +9 -4
  151. package/dist/floor-table.data.js +53 -0
  152. package/dist/forge-token-vars.d.ts +12 -0
  153. package/dist/forge-token-vars.js +25 -0
  154. package/dist/gate-decision.d.ts +3 -1
  155. package/dist/gate-decision.js +3 -1
  156. package/dist/gated-waves.d.ts +2 -0
  157. package/dist/gated-waves.js +1 -0
  158. package/dist/graph-ir.d.ts +30 -0
  159. package/dist/graph-ir.js +33 -1
  160. package/dist/graph-refs.d.ts +26 -0
  161. package/dist/graph-refs.js +34 -3
  162. package/dist/graph-schema/graph.schema.json +136 -0
  163. package/dist/health.d.ts +65 -0
  164. package/dist/health.js +62 -0
  165. package/dist/lexicon.d.ts +188 -1
  166. package/dist/lifecycle/disruption.d.ts +14 -1
  167. package/dist/lifecycle/disruption.js +5 -1
  168. package/dist/lifecycle/gate-change-set.d.ts +8 -0
  169. package/dist/lifecycle/gate-change-set.js +2 -1
  170. package/dist/lifecycle/gate-ledger.d.ts +26 -0
  171. package/dist/lifecycle/gate-rejection.d.ts +82 -0
  172. package/dist/lifecycle/gate-rejection.js +93 -0
  173. package/dist/lifecycle/gate-seal.d.ts +3 -3
  174. package/dist/lifecycle/gate-seal.js +5 -5
  175. package/dist/lifecycle/observe.d.ts +17 -0
  176. package/dist/lifecycle/observe.js +10 -1
  177. package/dist/lifecycle/release-cut.js +4 -0
  178. package/dist/lifecycle/release-ledger.d.ts +8 -0
  179. package/dist/lifecycle/release-risk.d.ts +137 -0
  180. package/dist/lifecycle/release-risk.js +214 -0
  181. package/dist/lifecycle/release-store.d.ts +9 -0
  182. package/dist/lifecycle/release-store.js +4 -0
  183. package/dist/lifecycle/stage-log.d.ts +85 -0
  184. package/dist/lifecycle/stage-log.js +141 -0
  185. package/dist/lint/canary-checks.d.ts +31 -0
  186. package/dist/lint/canary-checks.js +45 -0
  187. package/dist/lint/rule.d.ts +1 -0
  188. package/dist/lint/rules/evl012-pipeline-fold.d.ts +14 -0
  189. package/dist/lint/rules/evl012-pipeline-fold.js +30 -0
  190. package/dist/lint/rules/index.d.ts +1 -0
  191. package/dist/lint/rules/index.js +3 -0
  192. package/dist/notify-relay-repo.d.ts +54 -0
  193. package/dist/notify-relay-repo.js +84 -0
  194. package/dist/notify-relay.d.ts +53 -3
  195. package/dist/notify-relay.js +96 -3
  196. package/dist/notify.d.ts +57 -1
  197. package/dist/notify.js +7 -1
  198. package/dist/notify.schema.json +61 -3
  199. package/dist/observation.d.ts +34 -0
  200. package/dist/observation.js +14 -1
  201. package/dist/op/activities/review-agent.d.ts +39 -2
  202. package/dist/op/activities/review-agent.js +88 -5
  203. package/dist/op/agent-permit.d.ts +88 -0
  204. package/dist/op/agent-permit.js +97 -0
  205. package/dist/op/gate-approval-base.d.ts +8 -0
  206. package/dist/op/gate-approval-base.js +9 -0
  207. package/dist/op/gate-approval.d.ts +30 -1
  208. package/dist/op/gate-approval.js +23 -2
  209. package/dist/op/gate-quorum.d.ts +114 -8
  210. package/dist/op/gate-quorum.js +198 -21
  211. package/dist/op/gate-reject.d.ts +79 -0
  212. package/dist/op/gate-reject.js +96 -0
  213. package/dist/op/gate-summary.js +1 -1
  214. package/dist/op/gate.d.ts +28 -3
  215. package/dist/op/gate.js +55 -13
  216. package/dist/op/generate-pipeline.d.ts +15 -1
  217. package/dist/op/generate-pipeline.js +32 -5
  218. package/dist/op/index.d.ts +11 -6
  219. package/dist/op/index.js +10 -5
  220. package/dist/op/local-executor.d.ts +2 -0
  221. package/dist/op/local-executor.js +23 -4
  222. package/dist/op/op-waves-after-plan.d.ts +23 -0
  223. package/dist/op/op-waves-after-plan.js +12 -1
  224. package/dist/op/op-waves-capability-spec.d.ts +14 -0
  225. package/dist/op/op-waves-capability-spec.js +46 -6
  226. package/dist/op/op-waves-capability.d.ts +21 -13
  227. package/dist/op/op-waves-capability.js +22 -59
  228. package/dist/op/op-waves-environment-sets.d.ts +41 -0
  229. package/dist/op/op-waves-environment-sets.js +82 -0
  230. package/dist/op/op-waves-quorum-warnings.d.ts +53 -0
  231. package/dist/op/op-waves-quorum-warnings.js +90 -0
  232. package/dist/op/op-waves-release-port.d.ts +7 -0
  233. package/dist/op/op-waves-release-port.js +15 -3
  234. package/dist/op/op-waves-release.d.ts +15 -0
  235. package/dist/op/op-waves-release.js +15 -0
  236. package/dist/op/op-waves-run.d.ts +37 -3
  237. package/dist/op/op-waves-run.js +141 -18
  238. package/dist/op/op-waves-soak.d.ts +57 -0
  239. package/dist/op/op-waves-soak.js +111 -0
  240. package/dist/op/op-waves-split.d.ts +4 -0
  241. package/dist/op/op-waves-split.js +4 -0
  242. package/dist/op/op-waves.d.ts +67 -4
  243. package/dist/op/op-waves.js +71 -3
  244. package/dist/pipeline/agent-ajv.d.ts +4 -0
  245. package/dist/pipeline/agent-ajv.js +14 -0
  246. package/dist/pipeline/agent-steps.d.ts +329 -0
  247. package/dist/pipeline/agent-steps.js +602 -0
  248. package/dist/pipeline/artifacts.d.ts +264 -0
  249. package/dist/pipeline/artifacts.js +425 -0
  250. package/dist/pipeline/diff.d.ts +45 -0
  251. package/dist/pipeline/diff.js +177 -0
  252. package/dist/pipeline/fold.d.ts +43 -0
  253. package/dist/pipeline/fold.js +140 -0
  254. package/dist/pipeline/generate.d.ts +52 -0
  255. package/dist/pipeline/generate.js +120 -0
  256. package/dist/pipeline/product.d.ts +225 -0
  257. package/dist/pipeline/product.js +257 -0
  258. package/dist/pipeline/promote.d.ts +404 -0
  259. package/dist/pipeline/promote.js +694 -0
  260. package/dist/pipeline/read.d.ts +37 -0
  261. package/dist/pipeline/read.js +58 -0
  262. package/dist/pipeline/rendered.d.ts +25 -0
  263. package/dist/pipeline/rendered.js +53 -0
  264. package/dist/pipeline/soak-checks.d.ts +80 -0
  265. package/dist/pipeline/soak-checks.js +254 -0
  266. package/dist/pipeline/soak-gate.d.ts +97 -0
  267. package/dist/pipeline/soak-gate.js +176 -0
  268. package/dist/pipeline/soak-sources.d.ts +17 -0
  269. package/dist/pipeline/soak-sources.js +42 -0
  270. package/dist/pipeline/soak.d.ts +260 -0
  271. package/dist/pipeline/soak.js +378 -0
  272. package/dist/pipeline/spec.d.ts +724 -0
  273. package/dist/pipeline/spec.js +567 -0
  274. package/dist/pipeline/stage-ledger.d.ts +187 -0
  275. package/dist/pipeline/stage-ledger.js +185 -0
  276. package/dist/pipeline/stage-waves.d.ts +114 -0
  277. package/dist/pipeline/stage-waves.js +161 -0
  278. package/dist/pipeline/stages.d.ts +64 -0
  279. package/dist/pipeline/stages.js +174 -0
  280. package/dist/pipeline/verify-rollback.d.ts +277 -0
  281. package/dist/pipeline/verify-rollback.js +393 -0
  282. package/dist/pipeline.d.ts +142 -0
  283. package/dist/pipeline.js +143 -0
  284. package/dist/pr-loop.d.ts +22 -0
  285. package/dist/pr-loop.js +8 -0
  286. package/dist/pr-plan-note.d.ts +15 -1
  287. package/dist/pr-plan-note.js +8 -0
  288. package/dist/pr-post.d.ts +31 -0
  289. package/dist/pr-post.js +89 -0
  290. package/dist/release-floors.d.ts +1 -1
  291. package/dist/release-floors.js +1 -1
  292. package/dist/report-store/audit.schema.json +50 -0
  293. package/dist/report-store/dora.schema.json +331 -0
  294. package/dist/report-store/estate.schema.json +96 -0
  295. package/dist/report-store/run.schema.json +14 -0
  296. package/dist/report-store.d.ts +151 -0
  297. package/dist/report-store.js +344 -0
  298. package/dist/run-event.d.ts +7 -2
  299. package/dist/wave-runtime.mjs +458 -404
  300. package/dist/workspace/catalog-edges.js +3 -3
  301. package/dist/workspace/change-set.schema.json +4 -0
  302. package/dist/workspace/ci-cloud-identity.d.ts +4 -0
  303. package/dist/workspace/ci-cloud-identity.js +30 -0
  304. package/dist/workspace/ci-run.js +17 -2
  305. package/dist/workspace/ci-secrets.d.ts +3 -1
  306. package/dist/workspace/ci-secrets.js +7 -1
  307. package/dist/workspace/compose-graph.d.ts +1 -1
  308. package/dist/workspace/compose-graph.js +3 -1
  309. package/dist/workspace/declaration.d.ts +27 -0
  310. package/dist/workspace/declaration.js +35 -0
  311. package/dist/workspace/declaration.schema.json +56 -0
  312. package/dist/workspace/graph-cli.js +26 -0
  313. package/dist/workspace/graph.schema.json +5 -1
  314. package/dist/workspace/identity-gate-rule.d.ts +4 -0
  315. package/dist/workspace/identity-gate-rule.js +2 -2
  316. package/dist/workspace/identity-reject-rule.d.ts +14 -0
  317. package/dist/workspace/identity-reject-rule.js +24 -0
  318. package/dist/workspace/identity.d.ts +3 -0
  319. package/dist/workspace/identity.js +2 -1
  320. package/dist/workspace/nested-graph.js +2 -0
  321. package/dist/workspace/pr-report.schema.json +65 -0
  322. package/dist/workspace/promotion-order.d.ts +19 -4
  323. package/dist/workspace/promotion-order.js +26 -4
  324. package/dist/workspace/release-train.d.ts +14 -0
  325. package/dist/workspace/release-train.js +32 -0
  326. package/dist/workspace/run-event.schema.json +2 -2
  327. package/dist/workspace/stack-read-edges.d.ts +19 -0
  328. package/dist/workspace/stack-read-edges.js +54 -0
  329. package/dist/workspace/status-gates.d.ts +51 -1
  330. package/dist/workspace/status-gates.js +60 -0
  331. package/dist/workspace/status-stages.d.ts +223 -0
  332. package/dist/workspace/status-stages.js +279 -0
  333. package/dist/workspace/status.d.ts +45 -1
  334. package/dist/workspace/status.js +109 -5
  335. package/dist/workspace/status.schema.json +283 -2
  336. package/dist/workspace/trust/seal.d.ts +7 -0
  337. package/dist/workspace/trust/seal.js +9 -0
  338. package/package.json +5 -1
@@ -32,7 +32,7 @@
32
32
  */
33
33
  import { execFileSync } from "node:child_process";
34
34
  import { existsSync, realpathSync } from "node:fs";
35
- import { relative, resolve } from "node:path";
35
+ import { join, relative, resolve } from "node:path";
36
36
  import { formatError } from "../cli/format.js";
37
37
  import { GATES_DIR } from "../lifecycle/gate-ledger.js";
38
38
  import { readPathSha } from "../lifecycle/git.js";
@@ -55,11 +55,12 @@ import { readMemberPromotionOrder } from "./promotion-order.js";
55
55
  import { gateAdmissionFrom, releaseRuleFrom } from "./identity.js";
56
56
  import { checkReleaseSignature } from "./identity-gate-rule.js";
57
57
  import { scopeSource } from "./write-scope.js";
58
- import { GATE_REASON_CODES, readMemberGates } from "./status-gates.js";
58
+ import { GATE_REASON_CODES, readMemberGates, readMemberStageQueues } from "./status-gates.js";
59
59
  import { trustQuorumJudge } from "../op/gate-quorum.js";
60
60
  import { STEWARD_REASON_CODES, readMemberStewards } from "./status-stewards.js";
61
61
  import { memberDecisionsReader } from "./status-decisions.js";
62
62
  import { gitTop, workingTree } from "./tree.js";
63
+ import { readStageViews, stageRows } from "./status-stages.js";
63
64
  import { handToRootChant } from "./which-chant.js";
64
65
  /** The version of the `status` output this chant writes. */
65
66
  export const STATUS_CONTRACT_VERSION = 1;
@@ -105,6 +106,29 @@ export const STATUS_ERROR_CODES = [
105
106
  export const ENV_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$/;
106
107
  /** The most paths `ship.pending.paths` lists; `files` still counts them all. */
107
108
  export const SHIP_PENDING_PATHS_MAX = 200;
109
+ /** The member's folded pipeline, or undefined when it has none or it does not fold (#5342). */
110
+ async function memberPipeline(memberDir) {
111
+ if (!existsSync(join(memberDir, ".chant", "pipeline.ts")))
112
+ return undefined;
113
+ try {
114
+ const { readMemberPipeline } = await import("../pipeline/read.js");
115
+ const read = readMemberPipeline(memberDir);
116
+ return read.status === "folded" ? read.spec : undefined;
117
+ }
118
+ catch {
119
+ return undefined;
120
+ }
121
+ }
122
+ /** The member's release cuts as their ledger line has them, or null when they can't be read. */
123
+ async function memberCuts(memberDir) {
124
+ try {
125
+ const { readCuts } = await import("../lifecycle/release-store.js");
126
+ return (await readCuts({ cwd: memberDir })).cuts;
127
+ }
128
+ catch {
129
+ return null;
130
+ }
131
+ }
108
132
  /** A factory view with the declaration's x- keys on it and on its check, publish and tiers (#3595). */
109
133
  function factoryWithX(view, pointer, x) {
110
134
  if (view === null)
@@ -265,6 +289,7 @@ async function readEnvironment(member, env, cwd, read, revokedOf = async () => n
265
289
  actor: r.actor,
266
290
  approver: r.approver ?? null,
267
291
  admission: r.admission ? { op: r.admission.op, gate: r.admission.gate, resolvedAt: r.admission.resolvedAt } : null,
292
+ ...(r.gatesSkipped?.length ? { gatesSkipped: [...r.gatesSkipped] } : {}),
268
293
  releaseDigest: r.releaseDigest ?? null,
269
294
  releaseLabel: (r.releaseDigest !== undefined ? labels.get(r.releaseDigest) : undefined) ?? null,
270
295
  flags: [...(r.flags ?? [])],
@@ -377,7 +402,34 @@ export async function workspaceStatus(query) {
377
402
  for (const env of envs)
378
403
  environments.push(await readEnvironment(m, env, found.dir, read, revokedOf, query.readOutcomes));
379
404
  const own = await hasMemberLedger(m, found.dir);
380
- const gates = await readMemberGates(own ? `${MEMBERS_DIR}/${m.name}/${GATES_DIR}` : GATES_DIR, own ? "members" : "flat", commit, envs, found.dir, now, query.readGates, rules, undefined, judge);
405
+ const gatesDir = own ? `${MEMBERS_DIR}/${m.name}/${GATES_DIR}` : GATES_DIR;
406
+ // #5342: a pipeline's gates are read for every stage, and `gates` keeps the environments asked for.
407
+ const spec = await memberPipeline(resolve(found.dir, m.dir));
408
+ const gateEnvs = [...envs, ...(spec?.stages.map((s) => s.name) ?? []).filter((n) => !envs.includes(n))];
409
+ const everyGate = await readMemberGates(gatesDir, own ? "members" : "flat", commit, gateEnvs, found.dir, now, query.readGates, rules, undefined, judge);
410
+ const gates = { ledger: everyGate.ledger, gates: everyGate.gates.filter((g) => g.env === null || envs.includes(g.env)) };
411
+ const pipeline = spec
412
+ ? {
413
+ name: spec.name,
414
+ stages: await readStageViews({
415
+ spec,
416
+ prefix: own ? `${MEMBERS_DIR}/${m.name}/` : "",
417
+ commit,
418
+ cwd: found.dir,
419
+ now,
420
+ gates: everyGate.gates,
421
+ cuts: await memberCuts(resolve(found.dir, m.dir)),
422
+ readReleases: async (path) => (await read(path, found.dir)).records,
423
+ ...(query.readStageLedger ? { readStageLedger: query.readStageLedger } : {}),
424
+ }),
425
+ }
426
+ : undefined;
427
+ // #5419: a pipeline's queues cover every stage and only its own log, also on a ledger members share. A member with no pipeline keeps the environments asked for, on a ledger of its own.
428
+ const stageQueues = spec
429
+ ? await readMemberStageQueues(gatesDir, commit, found.dir, query.readStageLogs, { name: spec.name, stages: spec.stages.map((s) => s.name) })
430
+ : own
431
+ ? (await readMemberStageQueues(gatesDir, commit, found.dir, query.readStageLogs)).filter((q) => envs.includes(q.stage))
432
+ : [];
381
433
  const stewards = await (query.readStewards ?? readMemberStewards)(resolve(found.dir, m.dir), query.env, now, m.kind, m.box);
382
434
  // The declaration's x- keys go back on the objects that hold them (#3595).
383
435
  const x = (pointer) => extensionsAt(declaration, pointer);
@@ -421,6 +473,8 @@ export async function workspaceStatus(query) {
421
473
  promotionOrder: await (query.readPromotionOrder ?? readMemberPromotionOrder)(resolve(found.dir, m.dir)),
422
474
  releaseCuts: await readReleaseCuts(resolve(found.dir, m.dir), releaseRule),
423
475
  featureFlags: flags === null ? null : flags.filter((f) => f.member === m.name).map(({ member: _member, ...f }) => f),
476
+ ...(stageQueues.length > 0 ? { stageQueues } : {}),
477
+ ...(pipeline ? { pipeline } : {}),
424
478
  ...x(m.pointer),
425
479
  });
426
480
  }
@@ -491,6 +545,11 @@ async function readReleaseCuts(memberDir, rule) {
491
545
  const { cuts } = await readCuts(loc);
492
546
  const commits = new Map();
493
547
  const out = [];
548
+ // #5387: how each later stage of the member's pipeline reads a cut's risk.
549
+ const { laterStageRisk } = await import("../lifecycle/release-risk.js");
550
+ const { readMemberPipeline } = await import("../pipeline/read.js");
551
+ const read = cuts.some((c) => c.risk) ? readMemberPipeline(memberDir) : undefined;
552
+ const pipeline = read?.status === "folded" ? read.spec : undefined;
494
553
  for (const c of cuts) {
495
554
  if (!commits.has(c.releaseDigest))
496
555
  commits.set(c.releaseDigest, (await readRelease(c.releaseDigest, loc))?.commit ?? null);
@@ -502,6 +561,15 @@ async function readReleaseCuts(memberDir, rule) {
502
561
  timestamp: c.timestamp,
503
562
  signature: c.signature,
504
563
  signatureCheck: checkReleaseSignature(rule, c),
564
+ ...(c.risk
565
+ ? {
566
+ risk: {
567
+ score: c.risk.score,
568
+ level: c.risk.level,
569
+ stages: pipeline ? laterStageRisk(pipeline, { score: c.risk.score, reasons: c.risk.waves.flatMap((w) => w.risk.reasons ?? []) }).map(({ stage, approveAbove, over }) => ({ stage, approveAbove, over })) : [],
570
+ },
571
+ }
572
+ : {}),
505
573
  });
506
574
  }
507
575
  return out;
@@ -666,6 +734,15 @@ export function formatStatus(doc) {
666
734
  memberNotes.push(` roll back: ${e.mixed.rollback}`);
667
735
  }
668
736
  }
737
+ // #5354: a held stage, until when, and what the person who lifts the hold reads first.
738
+ for (const step of m.promotionOrder ?? []) {
739
+ if (!step.held)
740
+ continue;
741
+ const until = step.held.until ? ` until ${step.held.until}` : " until a change to the pipeline lifts it";
742
+ memberNotes.push(` stage ${step.name} is ${step.held.kind === "hold" ? "held" : "in a freeze window"}${until}${step.held.reason ? ` (${step.held.reason})` : ""}`);
743
+ if (step.held.description)
744
+ memberNotes.push(` before it goes on: ${step.held.description}`);
745
+ }
669
746
  if (memberNotes.length > 0)
670
747
  notes.set(rows.length - 1, memberNotes);
671
748
  }
@@ -692,13 +769,40 @@ export function formatStatus(doc) {
692
769
  const cut = doc.members.filter((m) => (m.releaseCuts ?? []).length > 0);
693
770
  if (cut.length > 0) {
694
771
  lines.push("");
695
- const rows = [["MEMBER", "RELEASE", "COMMIT", "CUT BY", "SIGNATURE"]];
772
+ // #5387: a cut's change risk, and each later stage it is over at.
773
+ const risked = cut.some((m) => m.releaseCuts.some((c) => c.risk));
774
+ const rows = [["MEMBER", "RELEASE", "COMMIT", "CUT BY", "SIGNATURE", ...(risked ? ["RISK"] : [])]];
775
+ const riskCell = (r) => !r ? "-" : `${r.score.toFixed(2)} ${r.level}${r.stages.length > 0 ? ` (${r.stages.map((s) => `${s.stage} ${s.over ? "over" : "within"}${s.approveAbove !== null ? ` ${s.approveAbove}` : ""}`).join(", ")})` : ""}`;
696
776
  for (const m of cut) {
697
777
  for (const c of m.releaseCuts)
698
- rows.push([m.name, c.label ?? c.releaseDigest.slice(0, 24), c.commit?.slice(0, 12) ?? "-", c.actor, c.signatureCheck.status]);
778
+ rows.push([m.name, c.label ?? c.releaseDigest.slice(0, 24), c.commit?.slice(0, 12) ?? "-", c.actor, c.signatureCheck.status, ...(risked ? [riskCell(c.risk)] : [])]);
779
+ }
780
+ lines.push(...table(rows));
781
+ }
782
+ // #5353: each queued stage's release, the ones waiting, and the ones a newer release replaced.
783
+ const queued = doc.members.filter((m) => (m.stageQueues ?? []).length > 0);
784
+ if (queued.length > 0) {
785
+ lines.push("");
786
+ const name = (r) => r.label ?? r.digest.slice(0, 24);
787
+ const rows = [["MEMBER", "STAGE", "IN STAGE", "WAITING", "REPLACED"]];
788
+ for (const m of queued) {
789
+ for (const q of m.stageQueues) {
790
+ rows.push([
791
+ m.name,
792
+ `${q.pipeline}/${q.stage}`,
793
+ q.inStage ? name(q.inStage) : "-",
794
+ q.waiting.length > 0 ? q.waiting.map(name).join(", ") : "-",
795
+ q.replaced.length > 0 ? q.replaced.map((r) => `${name(r)} by ${r.byLabel ?? r.by.slice(0, 24)}`).join(", ") : "-",
796
+ ]);
797
+ }
699
798
  }
700
799
  lines.push(...table(rows));
701
800
  }
801
+ // #5342: one line per stage of each member's pipeline.
802
+ if (doc.members.some((m) => m.pipeline && m.pipeline.stages.length > 0)) {
803
+ lines.push("");
804
+ lines.push(...table(stageRows(doc.members)));
805
+ }
702
806
  const flagged = doc.members.filter((m) => (m.featureFlags ?? []).length > 0);
703
807
  if (flagged.length > 0) {
704
808
  lines.push("");
@@ -235,14 +235,25 @@
235
235
  }
236
236
  },
237
237
  "promotionOrder": {
238
- "description": "The member's promotion order (#4030): the literal entries of the environments array in its chant.config.ts, in order, with a pattern entry such as pr-* left out. A release moves from each step to the next, and components promote --to defaults --from to the step before. Empty when the config declares no environments, and null when it could not be read. canary is declared and shown only; no chant command acts on it yet. Optional: written from chant 0.124.28, absent from older output.",
238
+ "description": "The member's promotion order (#4030): the literal entries of the environments array in its chant.config.ts, in order, with a pattern entry such as pr-* left out. A release moves from each step to the next, and components promote --to defaults --from to the step before. Empty when the config declares no environments, and null when it could not be read. canary marks the canary step: in a pipeline its soak holds every stage after it, and an environments entry has no soak, so chant lint warns on one. Optional: written from chant 0.124.28, absent from older output.",
239
239
  "type": ["array", "null"],
240
240
  "items": {
241
241
  "type": "object",
242
242
  "required": ["name", "canary"],
243
243
  "properties": {
244
244
  "name": { "type": "string" },
245
- "canary": { "type": "boolean", "description": "True when the entry sets canary: true." }
245
+ "canary": { "type": "boolean", "description": "True when the entry sets canary: true." },
246
+ "held": {
247
+ "type": "object",
248
+ "description": "Added in contract 1 by #5354. A pipeline stage's hold or freeze window now: until when (null when only a change to the pipeline lifts it), why, and what the person who lifts it reads first. Absent when the stage is open.",
249
+ "required": ["kind", "until"],
250
+ "properties": {
251
+ "kind": { "enum": ["hold", "freeze"] },
252
+ "until": { "type": ["string", "null"] },
253
+ "reason": { "type": "string" },
254
+ "description": { "type": "string" }
255
+ }
256
+ }
246
257
  }
247
258
  }
248
259
  },
@@ -268,6 +279,27 @@
268
279
  "key": { "type": ["string", "null"], "description": "The fingerprint of the key in the signature. Reported, never trusted." },
269
280
  "reason": { "type": "string" }
270
281
  }
282
+ },
283
+ "risk": {
284
+ "type": "object",
285
+ "description": "Added in contract 1 by #5387. The change risk the cut carries: the score the waves that applied its commit recorded under holds.risk, combined, and how each stage after the first whose gate sets holds.risk in the member's pipeline reads it. Absent when the cut carries none.",
286
+ "required": ["score", "level", "stages"],
287
+ "properties": {
288
+ "score": { "type": "number", "minimum": 0, "maximum": 1 },
289
+ "level": { "enum": ["low", "medium", "high"] },
290
+ "stages": {
291
+ "type": "array",
292
+ "items": {
293
+ "type": "object",
294
+ "required": ["stage", "approveAbove", "over"],
295
+ "properties": {
296
+ "stage": { "type": "string" },
297
+ "approveAbove": { "type": ["number", "null"], "description": "The stage's threshold, or null when its holds.risk sets none." },
298
+ "over": { "type": "boolean", "description": "True when the stage's gate takes more approvals for this release." }
299
+ }
300
+ }
301
+ }
302
+ }
271
303
  }
272
304
  }
273
305
  }
@@ -276,6 +308,15 @@
276
308
  "description": "The member's feature flags (#4024): each record of a declared flag kind whose member field names this member, sorted by id. A flag is a workspace record the member's build reads as one build-time parameter, with chant build --env <env>; its value in an environment is recorded on the build, and on a release's target, as a param whose source is flag:<id>. Named featureFlags because a release record's flags already holds legacy-digest. Empty when no flag names the member, and null when the flag records could not be read. Optional: written from chant 0.124.29, absent from older output.",
277
309
  "type": ["array", "null"],
278
310
  "items": { "$ref": "#/$defs/featureFlag" }
311
+ },
312
+ "stageQueues": {
313
+ "description": "Added in contract 1 by #5353. The stage queues of the member's pipeline (_gates/<pipeline>/stages.jsonl on chant/lifecycle): the release in each stage, the releases waiting for it, and the waiting releases a newer one replaced. From the chant that exports STATUS_STAGE_QUEUES_FLOOR (#5419) one entry per stage of the pipeline, in pipeline order, whatever environment was asked for, and only from the member's own pipeline's log, also when several members share one ledger. A member with no pipeline lists the stages of its own ledger's logs for the environments asked for. A pipeline keeps the log when a stage declares after or queue. Absent when no stage log applies.",
314
+ "type": "array",
315
+ "items": { "$ref": "#/$defs/stageQueue" }
316
+ },
317
+ "pipeline": {
318
+ "description": "Added in contract 1 by #5342. The member's pipeline (.chant/pipeline.ts, read from the working tree), one entry per stage in pipeline order, whatever environment was asked for: the release each stage runs, its gate, the change risk the gate reads, its soak and the time left, the canary soaks that hold it, a pause, and a rollback request. Read from chant/lifecycle at lifecycle.commit; nothing is written, and no soak check is run. Absent when the member has no pipeline, or it does not fold.",
319
+ "$ref": "#/$defs/pipeline"
279
320
  }
280
321
  }
281
322
  },
@@ -967,6 +1008,228 @@
967
1008
  }
968
1009
  }
969
1010
  },
1011
+ "pipeline": {
1012
+ "type": "object",
1013
+ "required": ["name", "stages"],
1014
+ "properties": {
1015
+ "name": { "type": "string", "description": "The pipeline's name, the op its stage gates are recorded under." },
1016
+ "stages": { "type": "array", "description": "Every stage, in pipeline order.", "items": { "$ref": "#/$defs/stage" } }
1017
+ }
1018
+ },
1019
+ "stageRef": {
1020
+ "type": "object",
1021
+ "required": ["digest", "label"],
1022
+ "properties": {
1023
+ "digest": { "type": "string" },
1024
+ "label": { "type": ["string", "null"], "description": "The release's label, or null when it has none." }
1025
+ }
1026
+ },
1027
+ "soakState": {
1028
+ "enum": ["unread", "soaking", "due", "failing", "clock-unknown", "ended"],
1029
+ "description": "A soak's state as the last run that read it recorded it. unread: no standing fact on the soak's gate for the release the stage runs. soaking: the last run held it and time is left. due: the last run held it for time only and the time is up; the next promote reads the checks. failing: the last run held it on a check that failed or could not be read. clock-unknown: the last run found no apply time. ended: a person ended it early through its gate."
1030
+ },
1031
+ "stage": {
1032
+ "type": "object",
1033
+ "required": ["name", "canary", "after", "release", "gate", "risk", "soak", "canaryHolds", "paused", "onVerifyFail", "rollback", "rollbackHeld"],
1034
+ "properties": {
1035
+ "name": { "type": "string", "description": "The stage, which is its environment's name." },
1036
+ "canary": { "type": "boolean", "description": "True for the canary stage, whose soak holds every stage after it (#5327)." },
1037
+ "after": { "type": "array", "items": { "type": "string" }, "description": "The stages a release succeeds in before this one opens: its after, else the stage before it. Empty for the first stage." },
1038
+ "release": {
1039
+ "description": "The release the stage runs, from <stage>/releases.jsonl under the member's prefix. Null when the ledger records no deploy or can't be read.",
1040
+ "oneOf": [
1041
+ { "type": "null" },
1042
+ {
1043
+ "type": "object",
1044
+ "required": ["releaseDigest", "label", "gitSha", "at", "components", "mixed"],
1045
+ "properties": {
1046
+ "releaseDigest": { "type": ["string", "null"], "description": "The release the newest deploy was made from, or null when it named none." },
1047
+ "label": { "type": ["string", "null"] },
1048
+ "gitSha": { "type": "string", "description": "The newest deploy's commit." },
1049
+ "at": { "type": "string", "description": "When the newest deploy was recorded." },
1050
+ "components": { "type": "array", "items": { "type": "string" }, "description": "The components whose newest deploy is of that release (or commit, when it named none), sorted." },
1051
+ "mixed": { "type": "boolean", "description": "True when the stage's components run more than one release." }
1052
+ }
1053
+ }
1054
+ ]
1055
+ },
1056
+ "gate": {
1057
+ "type": "object",
1058
+ "description": "The stage's gate: <stage> under the pipeline's op, read from its newest pending fact as gates are.",
1059
+ "required": ["name", "policy", "state", "releaseDigest", "label", "planDigest", "recordedAt", "approvals", "needed", "approve"],
1060
+ "properties": {
1061
+ "name": { "type": "string" },
1062
+ "policy": { "enum": ["always", "never", "on-destructive"], "description": "The stage's gate policy, always when it declares none." },
1063
+ "state": { "description": "The state of the newest pending fact, or null when no promote has reached the gate.", "oneOf": [{ "type": "null" }, { "enum": ["pending", "approved", "expired", "superseded"] }] },
1064
+ "releaseDigest": { "type": ["string", "null"], "description": "The release the fact binds." },
1065
+ "label": { "type": ["string", "null"] },
1066
+ "planDigest": { "type": ["string", "null"], "description": "The digest the fact binds: the release's, or the promoted digests'." },
1067
+ "recordedAt": { "type": ["string", "null"] },
1068
+ "approvals": { "type": "integer", "minimum": 0, "description": "The approvals that count toward the fact." },
1069
+ "needed": { "type": "integer", "minimum": 1 },
1070
+ "approve": { "type": ["string", "null"], "description": "The chant approve line for the fact, or null when there is none." }
1071
+ }
1072
+ },
1073
+ "risk": {
1074
+ "description": "The change risk the stage's gate reads (#5387), for the release at its gate while its fact is pending, else for the release the stage runs. Null when that release carries no risk record.",
1075
+ "oneOf": [
1076
+ { "type": "null" },
1077
+ {
1078
+ "type": "object",
1079
+ "required": ["releaseDigest", "label", "score", "level", "reads", "approveAbove", "over", "overBy"],
1080
+ "properties": {
1081
+ "releaseDigest": { "type": "string" },
1082
+ "label": { "type": ["string", "null"] },
1083
+ "score": { "type": "number", "minimum": 0, "maximum": 1 },
1084
+ "level": { "enum": ["low", "medium", "high"] },
1085
+ "reads": { "type": "boolean", "description": "True when the stage sets holds.risk, so its gate reads the score." },
1086
+ "approveAbove": { "type": ["number", "null"] },
1087
+ "over": { "type": "boolean", "description": "True when the gate takes more approvals for this release. Risk only ever adds approvals." },
1088
+ "overBy": { "type": "array", "items": { "type": "string" }, "description": "Why it is over, one line each." }
1089
+ }
1090
+ }
1091
+ ]
1092
+ },
1093
+ "soak": {
1094
+ "description": "The stage's soak (#5326), with its state from the newest pending fact on its gate. Null when the stage declares no soak.",
1095
+ "oneOf": [
1096
+ { "type": "null" },
1097
+ {
1098
+ "type": "object",
1099
+ "required": ["gate", "duration", "checks", "state", "releaseDigest", "to", "clockStart", "due", "leftMs", "holds", "failing", "recordedAt", "endedBy"],
1100
+ "properties": {
1101
+ "gate": { "type": "string", "description": "<stage>-soak under the pipeline's op; approving it ends the soak early." },
1102
+ "duration": { "type": "string" },
1103
+ "checks": { "type": "integer", "minimum": 0, "description": "How many checks the soak reads, its own and its overrides'." },
1104
+ "state": { "$ref": "#/$defs/soakState" },
1105
+ "releaseDigest": { "type": ["string", "null"] },
1106
+ "to": { "type": ["string", "null"], "description": "The stage the promotion the soak held waits to go into." },
1107
+ "clockStart": { "type": ["string", "null"] },
1108
+ "due": { "type": ["string", "null"] },
1109
+ "leftMs": { "type": ["integer", "null"], "minimum": 0, "description": "Milliseconds from the read to due, at least 0; null without a due time." },
1110
+ "holds": { "type": "array", "items": { "type": "string" }, "description": "Why the last run held it, one line each." },
1111
+ "failing": { "type": "array", "items": { "type": "string" }, "description": "The checks that failed on the last run, as <check> or <check>@<member>." },
1112
+ "recordedAt": { "type": ["string", "null"] },
1113
+ "endedBy": { "type": ["string", "null"], "description": "On ended: who ended it." }
1114
+ }
1115
+ }
1116
+ ]
1117
+ },
1118
+ "canaryHolds": {
1119
+ "type": "array",
1120
+ "description": "Each canary stage upstream of this one, in pipeline order (#5327), with its soak's state. Empty when there is none.",
1121
+ "items": {
1122
+ "type": "object",
1123
+ "required": ["stage", "state", "due", "leftMs", "holding"],
1124
+ "properties": {
1125
+ "stage": { "type": "string" },
1126
+ "state": { "$ref": "#/$defs/soakState" },
1127
+ "due": { "type": ["string", "null"] },
1128
+ "leftMs": { "type": ["integer", "null"], "minimum": 0 },
1129
+ "holding": { "type": "boolean", "description": "True when the canary's soak holds a promote into this stage now: soaking, failing or clock-unknown." }
1130
+ }
1131
+ }
1132
+ },
1133
+ "paused": {
1134
+ "description": "The standing pause from the stage's ledger, <stage>/stage.jsonl (#5355), or null.",
1135
+ "oneOf": [
1136
+ { "type": "null" },
1137
+ {
1138
+ "type": "object",
1139
+ "required": ["by", "at", "reason", "cause", "waiting"],
1140
+ "properties": {
1141
+ "by": { "type": "string" },
1142
+ "at": { "type": "string" },
1143
+ "reason": { "type": ["string", "null"] },
1144
+ "cause": { "oneOf": [{ "type": "null" }, { "const": "rollback" }], "description": "rollback when a rollback of a stage with pauseAfterRollback paused it." },
1145
+ "waiting": { "type": "array", "items": { "$ref": "#/$defs/stageRef" }, "description": "The releases that waited while it is paused, oldest first; the newest enters on resume." }
1146
+ }
1147
+ }
1148
+ ]
1149
+ },
1150
+ "onVerifyFail": { "enum": ["hold", "rollback"], "description": "What a failed verify or soak check does in the stage (#5328)." },
1151
+ "rollback": {
1152
+ "description": "The rollback request on the stage's ledger that no rollback has carried out (#5328), or null.",
1153
+ "oneOf": [
1154
+ { "type": "null" },
1155
+ {
1156
+ "type": "object",
1157
+ "required": ["id", "requestedAt", "by", "failure", "failed", "to", "members", "gate", "state", "approve", "command"],
1158
+ "properties": {
1159
+ "id": { "type": "string" },
1160
+ "requestedAt": { "type": "string" },
1161
+ "by": { "type": "string" },
1162
+ "failure": { "oneOf": [{ "type": "null" }, { "enum": ["verify", "soak"] }] },
1163
+ "failed": { "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/stageRef" }], "description": "The release that failed in the stage." },
1164
+ "to": { "$ref": "#/$defs/stageRef", "description": "The release the rollback goes back to." },
1165
+ "members": {
1166
+ "type": "array",
1167
+ "items": {
1168
+ "type": "object",
1169
+ "required": ["member", "state"],
1170
+ "properties": {
1171
+ "member": { "type": "string" },
1172
+ "state": { "type": "string", "description": "applied, left-applied, rolled-back or not-applied." },
1173
+ "rollback": { "type": "string", "description": "requested when the rollback restores it, else why not." }
1174
+ }
1175
+ }
1176
+ },
1177
+ "gate": { "type": "string", "description": "<stage>-rollback under the pipeline's op." },
1178
+ "state": { "description": "The gate's state, or null when its pending fact is not on the ledger.", "oneOf": [{ "type": "null" }, { "enum": ["pending", "approved", "expired", "superseded"] }] },
1179
+ "approve": { "type": "string", "description": "The chant approve line for the gate." },
1180
+ "command": { "type": "string", "description": "chant components rollback <stage> --requested, which carries it out once the gate passes." }
1181
+ }
1182
+ }
1183
+ ]
1184
+ },
1185
+ "rollbackHeld": {
1186
+ "description": "The newest failure on the stage's ledger when no rollback could be requested for it and none has been requested or run since (#5328), or null.",
1187
+ "oneOf": [
1188
+ { "type": "null" },
1189
+ {
1190
+ "type": "object",
1191
+ "required": ["failureId", "at", "reason", "failure", "failed"],
1192
+ "properties": {
1193
+ "failureId": { "type": "string" },
1194
+ "at": { "type": "string" },
1195
+ "reason": { "type": "string" },
1196
+ "failure": { "oneOf": [{ "type": "null" }, { "enum": ["verify", "soak"] }] },
1197
+ "failed": { "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/stageRef" }] }
1198
+ }
1199
+ }
1200
+ ]
1201
+ }
1202
+ }
1203
+ },
1204
+ "stageRelease": {
1205
+ "type": "object",
1206
+ "required": ["digest", "label", "at"],
1207
+ "properties": {
1208
+ "digest": { "type": "string", "description": "The digest the stage gate binds: the release's, or the promoted digests'." },
1209
+ "label": { "type": ["string", "null"], "description": "The release's label, or null when it has none." },
1210
+ "at": { "type": "string", "description": "When the line was written: the release reached, entered, or was replaced at the stage." }
1211
+ }
1212
+ },
1213
+ "stageQueue": {
1214
+ "type": "object",
1215
+ "required": ["pipeline", "stage", "inStage", "waiting", "replaced"],
1216
+ "properties": {
1217
+ "pipeline": { "type": "string", "description": "The pipeline, the op its stage gates are recorded under." },
1218
+ "stage": { "type": "string", "description": "The stage, which is its environment's name." },
1219
+ "inStage": { "description": "The release whose deploy into the stage started and has not finished, or null.", "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/stageRelease" }] },
1220
+ "waiting": { "type": "array", "description": "The releases waiting for the stage, oldest first.", "items": { "$ref": "#/$defs/stageRelease" } },
1221
+ "replaced": {
1222
+ "type": "array",
1223
+ "description": "The waiting releases a newer one replaced, oldest first. A replaced release never enters the stage.",
1224
+ "items": {
1225
+ "allOf": [
1226
+ { "$ref": "#/$defs/stageRelease" },
1227
+ { "type": "object", "required": ["by", "byLabel"], "properties": { "by": { "type": "string", "description": "The digest of the release that replaced it." }, "byLabel": { "type": ["string", "null"] } } }
1228
+ ]
1229
+ }
1230
+ }
1231
+ }
1232
+ },
970
1233
  "gate": {
971
1234
  "type": "object",
972
1235
  "required": ["component", "name", "env", "planDigest", "state", "recordedAt", "expiresAt", "approvals", "needed", "signed", "approve"],
@@ -1009,6 +1272,7 @@
1009
1272
  }
1010
1273
  },
1011
1274
  "needed": { "type": "integer", "minimum": 1, "description": "The human approvals the gate needs: its quorum's count, 1 without one." },
1275
+ "rules": { "type": "array", "items": { "type": "string" }, "description": "Added in contract 1 by #5354. Where each approval rule of the gate stands, one line each: named rules by their name, then each all/any group's line. Present when the gate's rules are named or grouped." },
1012
1276
  "signed": {
1013
1277
  "description": "Added in contract 1 by #3163. The declaration's rule for the gate, read at base (identity.gates, ws-080): only an approval sealed with chant approve --sign by a key the signers file at base lists for its approver counts, and when class is not null, only one whose approver the role grants at base put in that class. Approvals that don't meet it are left out of approvals and state. Null when any approval counts.",
1014
1278
  "oneOf": [
@@ -1023,6 +1287,22 @@
1023
1287
  ]
1024
1288
  },
1025
1289
  "approve": { "type": "string", "description": "The chant approve line for the gate, run in the member's directory: chant approve <component> <gate>, with --env <env> when env is not null and --plan <planDigest> when planDigest is not null (#2832), so the line approves the plan this read showed, and --sign when signed is not null (#3163). The caller adds --actor <principal>. For a gate that asks a decision point (#3170), the chant workspace points answer line for the question in answer." },
1290
+ "soak": {
1291
+ "type": "object",
1292
+ "description": "Added in contract 1 by #5342. On a soak's gate (<stage>-soak, <gate>-wave-<k>-soak), the soak's state as the pending fact records it (#5326). Absent on every other gate.",
1293
+ "required": ["stage", "clockStart", "due", "holds"],
1294
+ "properties": {
1295
+ "stage": { "type": "string" },
1296
+ "wave": { "type": "integer", "minimum": 1 },
1297
+ "to": { "type": "string" },
1298
+ "clockStart": { "type": ["string", "null"] },
1299
+ "due": { "type": ["string", "null"] },
1300
+ "leftMs": { "type": "number", "description": "The time left when the run recorded the fact." },
1301
+ "holds": { "type": "array", "items": { "type": "string" } },
1302
+ "restartedAt": { "type": "string" },
1303
+ "failing": { "type": "array", "items": { "type": "string" } }
1304
+ }
1305
+ },
1026
1306
  "answer": {
1027
1307
  "type": "object",
1028
1308
  "description": "The open question the gate waits on, when it asks a decision point (#3170): absent on a gate chant approve passes. Answered with chant workspace points answer <id>; the run that passes the gate then cites the answer record on the ledger.",
@@ -1152,6 +1432,7 @@
1152
1432
  }
1153
1433
  ]
1154
1434
  },
1435
+ "gatesSkipped": { "type": "array", "items": { "type": "string" }, "description": "Added in contract 1 by #5401, written by chant 0.124.110 and newer. The component's gate steps that did not apply in this environment, since their environments name others, sorted. Absent when every gate applied." },
1155
1436
  "releaseDigest": { "type": ["string", "null"], "pattern": "^(?:jcs1-)?sha256:[0-9a-f]{64}$", "description": "Added in contract 1 by #4043, written by chant 0.124.29 and newer. The release this deploy was made from: the releaseDigest of _releases/<releaseDigest>.json. A promote with --release writes it, a run --components with --release writes it, and a rollback or redeploy copies it from the record it restores. Null for a deploy that named no release. With the item's environment it names the release target." },
1156
1437
  "releaseLabel": { "type": ["string", "null"], "description": "Added in contract 1 by #4043, written by chant 0.124.29 and newer. The label that release was cut with, from _releases/cuts.jsonl. Null when releaseDigest is null, when the release has no label, and when the cuts can't be read." },
1157
1438
  "flags": { "type": "array", "items": { "enum": ["legacy-digest"] } },
@@ -23,6 +23,7 @@
23
23
  */
24
24
  import type { SealCode } from "../records.js";
25
25
  import { type TrustPolicy } from "./policy.js";
26
+ import { type SealedGateRejection } from "../../lifecycle/gate-rejection.js";
26
27
  import { type SealedGateApproval } from "../../lifecycle/gate-seal.js";
27
28
  import { type SignedReleaseCut } from "../identity-gate-rule.js";
28
29
  export { GATE_SEAL_NAMESPACE, gateSealPayload, gateSealVersion, sealedFieldsOf, type SealedGateApproval } from "../../lifecycle/gate-seal.js";
@@ -138,6 +139,12 @@ export declare function sealRecord(keyFile: string, r: {
138
139
  * {@link gateSealPayload}. Throws a {@link SealError}.
139
140
  */
140
141
  export declare function sealGateApproval(keyFile: string, a: SealedGateApproval): VerdictSeal;
142
+ /**
143
+ * Seal a rejection (#5354) with the key in `keyFile`, over
144
+ * `gateRejectionPayload` in the `chant-gate-reject` namespace, so it can
145
+ * never stand in for an approval's seal. Throws a {@link SealError}.
146
+ */
147
+ export declare function sealGateRejection(keyFile: string, r: SealedGateRejection): VerdictSeal;
141
148
  /**
142
149
  * Sign a release cut (#4031) with the key in `keyFile`, over
143
150
  * `releaseGateSealPayload` in the `chant-release` namespace: the release
@@ -26,6 +26,7 @@ import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
26
26
  import { homedir, tmpdir } from "node:os";
27
27
  import { join, resolve } from "node:path";
28
28
  import { sshKeygen, verifySshSignature } from "./ssh-commit.js";
29
+ import { GATE_REJECTION_NAMESPACE, gateRejectionPayload } from "../../lifecycle/gate-rejection.js";
29
30
  import { checkGateSignature, GATE_SEAL_NAMESPACE, gateSealPayload, sshSignatureKey, verifySshSignatureWith, WEBAUTHN_SEAL_KIND } from "../../lifecycle/gate-seal.js";
30
31
  import { RELEASE_SEAL_NAMESPACE, releaseGateSealPayload, releaseStatusSealPayload } from "../identity-gate-rule.js";
31
32
  export { GATE_SEAL_NAMESPACE, gateSealPayload, gateSealVersion, sealedFieldsOf } from "../../lifecycle/gate-seal.js";
@@ -280,6 +281,14 @@ export function sealRecord(keyFile, r) {
280
281
  export function sealGateApproval(keyFile, a) {
281
282
  return sign(keyFile, gateSealPayload(a), GATE_SEAL_NAMESPACE, a.resolvedBy);
282
283
  }
284
+ /**
285
+ * Seal a rejection (#5354) with the key in `keyFile`, over
286
+ * `gateRejectionPayload` in the `chant-gate-reject` namespace, so it can
287
+ * never stand in for an approval's seal. Throws a {@link SealError}.
288
+ */
289
+ export function sealGateRejection(keyFile, r) {
290
+ return sign(keyFile, gateRejectionPayload(r), GATE_REJECTION_NAMESPACE, r.rejectedBy);
291
+ }
283
292
  /**
284
293
  * Sign a release cut (#4031) with the key in `keyFile`, over
285
294
  * `releaseGateSealPayload` in the `chant-release` namespace: the release
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentius/chant",
3
- "version": "0.124.109",
3
+ "version": "0.124.110",
4
4
  "description": "Declarative infrastructure-as-code toolkit — TypeScript on Node.js",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://intentius.io/chant",
@@ -115,6 +115,10 @@
115
115
  "import": "./dist/template-request/index.js",
116
116
  "default": "./dist/template-request/index.js"
117
117
  },
118
+ "./report-store/*.schema.json": {
119
+ "@intentius/chant-source": "./src/report-store/*.schema.json",
120
+ "default": "./dist/report-store/*.schema.json"
121
+ },
118
122
  "./template-request/*.schema.json": {
119
123
  "@intentius/chant-source": "./src/template-request/*.schema.json",
120
124
  "default": "./dist/template-request/*.schema.json"