@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
@@ -0,0 +1,223 @@
1
+ /**
2
+ * The release view per stage for `chant workspace status` (#5342): for each
3
+ * stage of a member's pipeline, the release it runs, its gate, the change
4
+ * risk the gate reads, its soak and the time left, the canary soaks that
5
+ * hold it, a pause, and a rollback request.
6
+ *
7
+ * Everything is read from what the runs recorded on `chant/lifecycle`, at
8
+ * the branch tip `status` names, and nothing is written:
9
+ *
10
+ * - the stage's release ledger, `<stage>/releases.jsonl` under the member's
11
+ * prefix, for the release it runs;
12
+ * - the pipeline's gate ledger, `_gates/<pipeline>.jsonl`, for gate
13
+ * `<stage>`, the soak's gate `<stage>-soak` (#5326, the soak's state is on
14
+ * its pending fact) and the rollback's gate `<stage>-rollback` (#5328);
15
+ * - the release cuts, for labels and each release's change risk (#5387);
16
+ * - the stage's own ledger, `<stage>/stage.jsonl` (#5355, #5328), for a
17
+ * pause and a rollback request.
18
+ *
19
+ * Status never reads a soak check: a soak's state is the one the last run
20
+ * that read it recorded, and the time left is counted from its `due` to now.
21
+ * The pipeline itself is read from the member's working tree, as
22
+ * `promotionOrder` reads it.
23
+ */
24
+ import { type ReleaseRecord } from "../lifecycle/release-ledger.js";
25
+ import type { ReleaseCut } from "../lifecycle/release-store.js";
26
+ import type { PipelineSpec } from "../pipeline/spec.js";
27
+ import { type GateState, type StatusGate } from "./status-gates.js";
28
+ import type { OpWaveGatePolicy } from "../op/op-waves.js";
29
+ /** A release a stage line names: its digest and label. */
30
+ export interface StatusStageReleaseRef {
31
+ digest: string;
32
+ label: string | null;
33
+ }
34
+ /** The release a stage runs, from its release ledger. */
35
+ export interface StatusStageRunning {
36
+ /** The release the newest deploy in the stage was made from, or null when that deploy named none. */
37
+ releaseDigest: string | null;
38
+ label: string | null;
39
+ /** The commit of the newest deploy. */
40
+ gitSha: string;
41
+ /** When the newest deploy was recorded. */
42
+ at: string;
43
+ /** The components whose newest deploy is of that same release (or commit, when it named none), sorted. */
44
+ components: string[];
45
+ /** True when the stage's components run more than one release. */
46
+ mixed: boolean;
47
+ }
48
+ /** The stage's gate, `<stage>` under the pipeline's op. */
49
+ export interface StatusStageGate {
50
+ /** The gate's name: the stage's. */
51
+ name: string;
52
+ /** The stage's gate policy, `always` when it declares none. */
53
+ policy: OpWaveGatePolicy;
54
+ /** The state of the newest pending fact for the gate, or null when no promote has reached it. */
55
+ state: GateState | null;
56
+ /** The release that fact binds, or null when it names none or there is no fact. */
57
+ releaseDigest: string | null;
58
+ label: string | null;
59
+ /** The digest the fact binds: the release's, or the promoted digests'. */
60
+ planDigest: string | null;
61
+ recordedAt: string | null;
62
+ approvals: number;
63
+ needed: number;
64
+ /** The `chant approve` line for the fact, or null when there is none. */
65
+ approve: string | null;
66
+ }
67
+ /** The change risk the stage's gate reads, for one release (#5387). */
68
+ export interface StatusStageRisk {
69
+ /** The release read: the one at the stage's gate while its fact is pending, else the one the stage runs. */
70
+ releaseDigest: string;
71
+ label: string | null;
72
+ score: number;
73
+ level: "low" | "medium" | "high";
74
+ /** True when the stage sets `holds.risk`, so its gate reads the score. */
75
+ reads: boolean;
76
+ approveAbove: number | null;
77
+ /** True when the gate takes more approvals for this release. False when `reads` is false. */
78
+ over: boolean;
79
+ overBy: string[];
80
+ }
81
+ /**
82
+ * A soak's state, as the last run that read it recorded it:
83
+ *
84
+ * - `unread`: no standing fact for the stage's release; no promote out of the stage has read the soak since it ran that release;
85
+ * - `soaking`: the last run held it, and time is left;
86
+ * - `due`: the last run held it for time only, and the time is up; the next promote reads the checks;
87
+ * - `failing`: the last run held it on a check that failed or could not be read;
88
+ * - `clock-unknown`: the last run found no apply time, so no clock could be counted;
89
+ * - `ended`: a person ended it early through its gate.
90
+ */
91
+ export type StatusSoakState = "unread" | "soaking" | "due" | "failing" | "clock-unknown" | "ended";
92
+ /** A stage's soak (#5326). */
93
+ export interface StatusStageSoak {
94
+ /** The gate a person ends it early through: `<stage>-soak` under the pipeline's op. */
95
+ gate: string;
96
+ /** As declared. */
97
+ duration: string;
98
+ /** How many checks it reads, its own and its overrides'. */
99
+ checks: number;
100
+ state: StatusSoakState;
101
+ /** The release the standing fact binds, or null. */
102
+ releaseDigest: string | null;
103
+ /** The stage the promotion it held waits to go into, or null. */
104
+ to: string | null;
105
+ clockStart: string | null;
106
+ due: string | null;
107
+ /** Milliseconds from now to `due`, at least 0; null without a due time. */
108
+ leftMs: number | null;
109
+ /** Why the last run held it, one line each. */
110
+ holds: string[];
111
+ /** The checks that failed on the last run, as `<check>` or `<check>@<member>`. */
112
+ failing: string[];
113
+ recordedAt: string | null;
114
+ /** On `ended`: who ended it. */
115
+ endedBy: string | null;
116
+ }
117
+ /** A canary stage upstream whose soak holds a promote into this stage (#5327). */
118
+ export interface StatusCanaryHold {
119
+ stage: string;
120
+ state: StatusSoakState;
121
+ due: string | null;
122
+ leftMs: number | null;
123
+ /** True when the canary's soak holds the stage now: `soaking`, `failing` or `clock-unknown`. */
124
+ holding: boolean;
125
+ }
126
+ /** A pause on the stage (#5355). */
127
+ export interface StatusStagePause {
128
+ by: string;
129
+ at: string;
130
+ reason: string | null;
131
+ /** `rollback` when a rollback of a stage with `pauseAfterRollback` paused it. */
132
+ cause: "rollback" | null;
133
+ /** The releases that waited while it is paused, oldest first. The newest enters on resume. */
134
+ waiting: StatusStageReleaseRef[];
135
+ }
136
+ /** A rollback request that no rollback has carried out yet (#5328). */
137
+ export interface StatusStageRollback {
138
+ id: string;
139
+ requestedAt: string;
140
+ by: string;
141
+ failure: "verify" | "soak" | null;
142
+ /** The release that failed in the stage. */
143
+ failed: StatusStageReleaseRef | null;
144
+ /** The release the rollback goes back to. */
145
+ to: StatusStageReleaseRef;
146
+ /** Each member, its state after the failure, and whether the rollback restores it. */
147
+ members: {
148
+ member: string;
149
+ state: string;
150
+ rollback?: string;
151
+ }[];
152
+ /** The gate it waits at, `<stage>-rollback` under the pipeline's op. */
153
+ gate: string;
154
+ /** The gate's state, or null when its pending fact is not on the ledger. */
155
+ state: GateState | null;
156
+ approve: string;
157
+ /** The command that carries it out once the gate passes. */
158
+ command: string;
159
+ }
160
+ /** A failure for which no rollback could be requested (#5328). */
161
+ export interface StatusStageRollbackHeld {
162
+ failureId: string;
163
+ at: string;
164
+ reason: string;
165
+ failure: "verify" | "soak" | null;
166
+ failed: StatusStageReleaseRef | null;
167
+ }
168
+ /** One stage of a member's pipeline, as `workspace status` shows it (#5342). */
169
+ export interface StatusStage {
170
+ name: string;
171
+ canary: boolean;
172
+ /** The stages a release succeeds in before this one opens: its `after`, else the stage before it. */
173
+ after: string[];
174
+ /** The release it runs, or null when its ledger records no deploy or can't be read. */
175
+ release: StatusStageRunning | null;
176
+ gate: StatusStageGate;
177
+ /** The change risk the gate reads, or null when the release read carries none. */
178
+ risk: StatusStageRisk | null;
179
+ /** The stage's soak, or null when it declares none. */
180
+ soak: StatusStageSoak | null;
181
+ /** Each canary stage upstream, in pipeline order. Empty when there is none. */
182
+ canaryHolds: StatusCanaryHold[];
183
+ /** The standing pause, or null. */
184
+ paused: StatusStagePause | null;
185
+ onVerifyFail: "hold" | "rollback";
186
+ /** The standing rollback request, or null. */
187
+ rollback: StatusStageRollback | null;
188
+ /** The newest failure, when no rollback could be requested for it and none has run since; else null. */
189
+ rollbackHeld: StatusStageRollbackHeld | null;
190
+ }
191
+ /** A member's pipeline as `workspace status` shows it (#5342). */
192
+ export interface StatusPipeline {
193
+ /** The pipeline's name, the op its stage gates are recorded under. */
194
+ name: string;
195
+ /** Every stage, in pipeline order. */
196
+ stages: StatusStage[];
197
+ }
198
+ /** Reads one file on the branch at `commit`: its text, or null when it isn't there. */
199
+ export type StageLedgerReader = (path: string, commit: string, cwd: string) => Promise<string | null>;
200
+ export declare const defaultStageLedgerReader: StageLedgerReader;
201
+ export interface StageViewInput {
202
+ spec: PipelineSpec;
203
+ /** The member's ledger prefix: `_members/<member>/`, or "" for the flat layout. */
204
+ prefix: string;
205
+ /** The branch tip read, or null when the checkout has no ledger branch. */
206
+ commit: string | null;
207
+ cwd: string;
208
+ now: string;
209
+ /** The member's gates read for every stage, before any filtering. */
210
+ gates: readonly StatusGate[];
211
+ /** The member's release cuts, or null when they can't be read. */
212
+ cuts: readonly ReleaseCut[] | null;
213
+ /** Reads one stage's release ledger, by its path on the branch. */
214
+ readReleases: (path: string) => Promise<ReleaseRecord[] | null>;
215
+ readStageLedger?: StageLedgerReader;
216
+ }
217
+ /** Every stage of `spec`, read from the ledgers. Never throws on a ledger: what can't be read is null. */
218
+ export declare function readStageViews(input: StageViewInput): Promise<StatusStage[]>;
219
+ /** The text view's table: one line per stage of each member's pipeline. */
220
+ export declare function stageRows(members: readonly {
221
+ name: string;
222
+ pipeline?: StatusPipeline;
223
+ }[]): string[][];
@@ -0,0 +1,279 @@
1
+ /**
2
+ * The release view per stage for `chant workspace status` (#5342): for each
3
+ * stage of a member's pipeline, the release it runs, its gate, the change
4
+ * risk the gate reads, its soak and the time left, the canary soaks that
5
+ * hold it, a pause, and a rollback request.
6
+ *
7
+ * Everything is read from what the runs recorded on `chant/lifecycle`, at
8
+ * the branch tip `status` names, and nothing is written:
9
+ *
10
+ * - the stage's release ledger, `<stage>/releases.jsonl` under the member's
11
+ * prefix, for the release it runs;
12
+ * - the pipeline's gate ledger, `_gates/<pipeline>.jsonl`, for gate
13
+ * `<stage>`, the soak's gate `<stage>-soak` (#5326, the soak's state is on
14
+ * its pending fact) and the rollback's gate `<stage>-rollback` (#5328);
15
+ * - the release cuts, for labels and each release's change risk (#5387);
16
+ * - the stage's own ledger, `<stage>/stage.jsonl` (#5355, #5328), for a
17
+ * pause and a rollback request.
18
+ *
19
+ * Status never reads a soak check: a soak's state is the one the last run
20
+ * that read it recorded, and the time left is counted from its `due` to now.
21
+ * The pipeline itself is read from the member's working tree, as
22
+ * `promotionOrder` reads it.
23
+ */
24
+ import { execFileSync } from "node:child_process";
25
+ import { latestPerComponent } from "../lifecycle/release-ledger.js";
26
+ import { releaseRiskAt, stageRiskSettings } from "../lifecycle/release-risk.js";
27
+ import { canaryStagesBefore, stageUpstreams } from "../pipeline/spec.js";
28
+ import { soakCheckCount, soakSpan } from "../pipeline/soak.js";
29
+ import { stageSoakGate } from "../pipeline/soak-gate.js";
30
+ import { parseStagePauseLines, stagePaused, STAGE_LEDGER_FILE, waitingReleases } from "../pipeline/stage-ledger.js";
31
+ import { requestedRollbackCommand, stageOnVerifyFail, stageRollbackGate, standingRollbackRequest } from "../pipeline/verify-rollback.js";
32
+ import { approveCommand } from "./status-gates.js";
33
+ export const defaultStageLedgerReader = async (path, commit, cwd) => {
34
+ try {
35
+ return execFileSync("git", ["cat-file", "blob", `${commit}:${path}`], { cwd, encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"], maxBuffer: 64 * 1024 * 1024 });
36
+ }
37
+ catch {
38
+ return null;
39
+ }
40
+ };
41
+ const ms = (iso) => {
42
+ if (!iso)
43
+ return undefined;
44
+ const t = Date.parse(iso);
45
+ return Number.isNaN(t) ? undefined : t;
46
+ };
47
+ function running(records, labels) {
48
+ const latest = [...latestPerComponent(records).values()];
49
+ if (latest.length === 0)
50
+ return null;
51
+ const newest = latest.reduce((a, b) => (b.timestamp > a.timestamp ? b : a));
52
+ const key = (r) => r.releaseDigest ?? `git:${r.gitSha}`;
53
+ return {
54
+ releaseDigest: newest.releaseDigest ?? null,
55
+ label: newest.releaseDigest !== undefined ? (labels.get(newest.releaseDigest) ?? null) : null,
56
+ gitSha: newest.gitSha,
57
+ at: newest.timestamp,
58
+ components: latest.filter((r) => key(r) === key(newest)).map((r) => r.component).sort(),
59
+ mixed: new Set(latest.map(key)).size > 1,
60
+ };
61
+ }
62
+ /** The soak of `stage` as its gate's newest fact records it. */
63
+ function soakView(stage, gate, runs, now) {
64
+ if (!stage.soak)
65
+ return null;
66
+ const base = {
67
+ gate: stageSoakGate(stage.name),
68
+ duration: stage.soak.duration,
69
+ checks: soakCheckCount(stage.soak),
70
+ state: "unread",
71
+ releaseDigest: null,
72
+ to: null,
73
+ clockStart: null,
74
+ due: null,
75
+ leftMs: null,
76
+ holds: [],
77
+ failing: [],
78
+ recordedAt: null,
79
+ endedBy: null,
80
+ };
81
+ if (!gate || gate.state === "expired" || gate.state === "superseded")
82
+ return base;
83
+ // A fact for another release than the one the stage runs says nothing about this one's soak.
84
+ if (gate.releaseDigest !== undefined && runs?.releaseDigest && gate.releaseDigest !== runs.releaseDigest)
85
+ return base;
86
+ const fact = gate.soak;
87
+ const due = fact?.due ?? null;
88
+ const dueAt = ms(due);
89
+ const view = {
90
+ ...base,
91
+ releaseDigest: gate.releaseDigest ?? null,
92
+ to: fact?.to ?? null,
93
+ clockStart: fact?.clockStart ?? null,
94
+ due,
95
+ leftMs: dueAt === undefined ? null : Math.max(0, dueAt - now),
96
+ holds: [...(fact?.holds ?? [])],
97
+ failing: [...(fact?.failing ?? [])],
98
+ recordedAt: gate.recordedAt,
99
+ };
100
+ if (gate.state === "approved")
101
+ return { ...view, state: "ended", endedBy: gate.approvals.at(-1)?.principal ?? null };
102
+ if (!fact)
103
+ return base;
104
+ if (dueAt === undefined)
105
+ return { ...view, state: "clock-unknown" };
106
+ if (view.failing.length > 0)
107
+ return { ...view, state: "failing" };
108
+ return { ...view, state: view.leftMs > 0 ? "soaking" : "due" };
109
+ }
110
+ const HOLDING = ["soaking", "failing", "clock-unknown"];
111
+ /** Every stage of `spec`, read from the ledgers. Never throws on a ledger: what can't be read is null. */
112
+ export async function readStageViews(input) {
113
+ const { spec, prefix, commit, cwd } = input;
114
+ const now = Date.parse(input.now);
115
+ const cuts = input.cuts ?? [];
116
+ const labels = new Map();
117
+ for (const c of cuts)
118
+ if (c.label !== null && !labels.has(c.releaseDigest))
119
+ labels.set(c.releaseDigest, c.label);
120
+ const riskOf = new Map(cuts.filter((c) => c.risk).map((c) => [c.releaseDigest, c.risk]));
121
+ const ref = (r) => (r ? { digest: r.digest, label: r.label ?? labels.get(r.digest) ?? null } : null);
122
+ const gateOf = (name, env) => input.gates.find((g) => g.component === spec.name && g.name === name && g.env === env);
123
+ const readLedger = input.readStageLedger ?? defaultStageLedgerReader;
124
+ const stages = [];
125
+ for (const stage of spec.stages) {
126
+ const records = await input.readReleases(`${prefix}${stage.name}/releases.jsonl`).catch(() => null);
127
+ const release = records ? running(records, labels) : null;
128
+ const g = gateOf(stage.name, stage.name);
129
+ const gate = {
130
+ name: stage.name,
131
+ policy: stage.gate?.policy ?? "always",
132
+ state: g?.state ?? null,
133
+ releaseDigest: g?.releaseDigest ?? null,
134
+ label: g?.releaseDigest !== undefined ? (labels.get(g.releaseDigest) ?? null) : null,
135
+ planDigest: g?.planDigest ?? null,
136
+ recordedAt: g?.recordedAt ?? null,
137
+ approvals: g?.approvals.length ?? 0,
138
+ needed: g?.needed ?? 1,
139
+ approve: g?.approve ?? null,
140
+ };
141
+ // The release the gate decides on while it waits, else the one the stage runs.
142
+ const riskRelease = gate.releaseDigest !== null && gate.state === "pending" ? gate.releaseDigest : release?.releaseDigest ?? null;
143
+ const record = riskRelease ? riskOf.get(riskRelease) : undefined;
144
+ let risk = null;
145
+ if (riskRelease && record) {
146
+ const settings = stageRiskSettings(spec, stage.name);
147
+ const read = settings ? releaseRiskAt(record, settings) : undefined;
148
+ risk = {
149
+ releaseDigest: riskRelease,
150
+ label: labels.get(riskRelease) ?? null,
151
+ score: record.score,
152
+ level: record.level,
153
+ reads: settings !== undefined,
154
+ approveAbove: read?.approveAbove ?? null,
155
+ over: read?.over ?? false,
156
+ overBy: read?.overBy ? [...read.overBy] : [],
157
+ };
158
+ }
159
+ const text = commit === null ? null : await readLedger(`${prefix}${stage.name}/${STAGE_LEDGER_FILE}`, commit, cwd).catch(() => null);
160
+ const lines = parseStagePauseLines(text).lines.filter((l) => l.pipeline === spec.name && l.stage === stage.name);
161
+ const pause = stagePaused(lines);
162
+ const paused = pause
163
+ ? { by: pause.by, at: pause.timestamp, reason: pause.reason ?? null, cause: pause.cause ?? null, waiting: waitingReleases(lines).map((r) => ref(r)) }
164
+ : null;
165
+ const failureOf = (id) => (id === undefined ? undefined : lines.find((l) => l.kind === "failed" && l.id === id));
166
+ const request = standingRollbackRequest(lines);
167
+ let rollback = null;
168
+ if (request?.id && request.release) {
169
+ const rgate = request.gate ?? stageRollbackGate(stage.name);
170
+ const fact = gateOf(rgate, stage.name);
171
+ const bound = fact && fact.planDigest === request.release.digest ? fact : undefined;
172
+ rollback = {
173
+ id: request.id,
174
+ requestedAt: request.timestamp,
175
+ by: request.by,
176
+ failure: failureOf(request.failureId)?.failure ?? null,
177
+ failed: ref(request.failed),
178
+ to: ref(request.release),
179
+ members: (request.members ?? []).map((m) => ({ member: m.member, state: m.state, ...(m.rollback !== undefined ? { rollback: m.rollback } : {}) })),
180
+ gate: rgate,
181
+ state: bound?.state ?? null,
182
+ approve: bound?.approve ?? approveCommand(spec.name, rgate, stage.name, request.release.digest, stage.gate?.approval === "sealed"),
183
+ command: requestedRollbackCommand(stage.name),
184
+ };
185
+ }
186
+ let rollbackHeld = null;
187
+ const lastFailure = [...lines].reverse().find((l) => l.kind === "failed");
188
+ if (lastFailure?.id) {
189
+ const at = lines.indexOf(lastFailure);
190
+ const held = lines.slice(at + 1).find((l) => l.kind === "rollback-held" && l.failureId === lastFailure.id);
191
+ const since = lines.slice(at + 1).some((l) => l.kind === "rolled-back" || l.kind === "rollback-requested");
192
+ if (held && !since) {
193
+ rollbackHeld = { failureId: lastFailure.id, at: held.timestamp, reason: held.held ?? "", failure: lastFailure.failure ?? null, failed: ref(lastFailure.failed) };
194
+ }
195
+ }
196
+ stages.push({
197
+ name: stage.name,
198
+ canary: stage.canary === true,
199
+ after: stageUpstreams(spec, stage.name),
200
+ release,
201
+ gate,
202
+ risk,
203
+ soak: null,
204
+ canaryHolds: [],
205
+ paused,
206
+ onVerifyFail: stageOnVerifyFail(stage),
207
+ rollback,
208
+ rollbackHeld,
209
+ });
210
+ }
211
+ // Soaks next, since a canary's is read against the release the canary runs.
212
+ for (const [i, stage] of spec.stages.entries()) {
213
+ stages[i].soak = soakView(stage, gateOf(stageSoakGate(stage.name), stage.name), stages[i].release, now);
214
+ }
215
+ for (const [i, stage] of spec.stages.entries()) {
216
+ stages[i].canaryHolds = canaryStagesBefore(spec, stage.name).map((c) => {
217
+ const soak = stages.find((s) => s.name === c.name).soak;
218
+ const state = soak?.state ?? "unread";
219
+ return { stage: c.name, state, due: soak?.due ?? null, leftMs: soak?.leftMs ?? null, holding: HOLDING.includes(state) };
220
+ });
221
+ }
222
+ return stages;
223
+ }
224
+ const releaseName = (r) => {
225
+ if (!r)
226
+ return "-";
227
+ const digest = r.digest ?? r.releaseDigest ?? null;
228
+ return r.label ?? (digest ? digest.slice(0, 24) : "-");
229
+ };
230
+ function soakCell(s) {
231
+ if (!s)
232
+ return "-";
233
+ switch (s.state) {
234
+ case "unread":
235
+ return `${s.duration}, not read yet`;
236
+ case "soaking":
237
+ return `${soakSpan(s.leftMs ?? 0)} left`;
238
+ case "due":
239
+ return "time up, checks read on the next promote";
240
+ case "failing":
241
+ return `failing: ${s.failing.join(", ")}`;
242
+ case "clock-unknown":
243
+ return "no apply time, clock not started";
244
+ case "ended":
245
+ return `ended early by ${s.endedBy ?? "an approval"}`;
246
+ }
247
+ }
248
+ /** The text view's table: one line per stage of each member's pipeline. */
249
+ export function stageRows(members) {
250
+ const rows = [["MEMBER", "STAGE", "RUNS", "GATE", "RISK", "SOAK", "CANARY", "ROLLBACK"]];
251
+ for (const m of members) {
252
+ if (!m.pipeline)
253
+ continue;
254
+ for (const s of m.pipeline.stages) {
255
+ const runs = s.release ? `${s.release.label ?? s.release.releaseDigest?.slice(0, 24) ?? s.release.gitSha.slice(0, 8)}${s.release.mixed ? " (mixed)" : ""}` : "-";
256
+ const gate = s.paused
257
+ ? `paused by ${s.paused.by}${s.paused.waiting.length > 0 ? `, ${s.paused.waiting.length} waiting` : ""}`
258
+ : s.gate.state
259
+ ? `${s.gate.state} ${s.gate.approvals}/${s.gate.needed}${s.gate.releaseDigest ? ` ${releaseName({ label: s.gate.label, releaseDigest: s.gate.releaseDigest })}` : ""}`
260
+ : s.gate.policy === "never"
261
+ ? "open"
262
+ : "-";
263
+ const risk = s.risk ? `${s.risk.score.toFixed(2)} ${s.risk.level}${s.risk.reads && s.risk.approveAbove !== null ? ` ${s.risk.over ? "over" : "within"} ${s.risk.approveAbove}` : s.risk.over ? " over" : ""}` : "-";
264
+ const holding = s.canaryHolds.filter((c) => c.holding);
265
+ const canary = s.canary
266
+ ? "canary"
267
+ : holding.length > 0
268
+ ? `held by ${holding.map((c) => `${c.stage}${c.leftMs !== null && c.state === "soaking" ? ` (${soakSpan(c.leftMs)} left)` : ` (${c.state})`}`).join(", ")}`
269
+ : "-";
270
+ const rollback = s.rollback
271
+ ? `to ${releaseName(s.rollback.to)}, ${s.rollback.state ?? "pending"}`
272
+ : s.rollbackHeld
273
+ ? "held, none requested"
274
+ : "-";
275
+ rows.push([m.name, s.name, runs, gate, risk, soakCell(s.soak), canary, rollback]);
276
+ }
277
+ }
278
+ return rows;
279
+ }
@@ -49,9 +49,10 @@ import type { OverlapReport } from "./overlap.js";
49
49
  import type { WorkLink } from "./work.js";
50
50
  import { type PromotionStep } from "./promotion-order.js";
51
51
  import { type ReleaseSignatureCheck } from "./identity-gate-rule.js";
52
- import { type GateLedgerReader, type StatusGate, type StatusGateLedger } from "./status-gates.js";
52
+ import { type GateLedgerReader, type StageLogReader, type StatusGate, type StatusGateLedger, type StatusStageQueue } from "./status-gates.js";
53
53
  import { readMemberStewards, type StatusSteward, type StewardReasonCode } from "./status-stewards.js";
54
54
  import { type DecisionKindReader } from "./status-decisions.js";
55
+ import { type StageLedgerReader, type StatusPipeline } from "./status-stages.js";
55
56
  /** The version of the `status` output this chant writes. */
56
57
  export declare const STATUS_CONTRACT_VERSION = 1;
57
58
  /** `$id` of the JSON Schema for the `--json` output, shipped beside this file. */
@@ -95,6 +96,8 @@ export interface StatusRelease {
95
96
  gate: string;
96
97
  resolvedAt: string;
97
98
  } | null;
99
+ /** The component's gates that did not apply in this environment, since they name others (#5401). Absent when every gate applied and on records written before chant `GATE_ENVIRONMENTS_FLOOR`. */
100
+ gatesSkipped?: string[];
98
101
  /** The release this deploy was made from (#4043): the `releaseDigest` of `_releases/<releaseDigest>.json`. Null for a deploy that named no release and for one recorded before chant 0.124.29. */
99
102
  releaseDigest: string | null;
100
103
  /** The label that release was cut with (#4043), or null when it has none, when no release is named, or when the cut can't be read. Chant 0.124.29 and newer write it. */
@@ -223,6 +226,26 @@ export interface StatusMember {
223
226
  * chant 0.124.29.
224
227
  */
225
228
  featureFlags: StatusFeatureFlag[] | null;
229
+ /**
230
+ * The stage queues of the member's pipeline (#5353): the release in each
231
+ * stage, the releases waiting for it, and the waiting releases a newer one
232
+ * replaced. One entry per stage of the pipeline, in pipeline order,
233
+ * whatever environment was asked for, and only from the log of the
234
+ * member's own pipeline, also when members share a ledger (#5419). A
235
+ * member with no pipeline lists the logs of its own ledger for the
236
+ * environments asked for. Absent when no stage log applies. Added in
237
+ * contract 1.
238
+ */
239
+ stageQueues?: StatusStageQueue[];
240
+ /**
241
+ * The member's pipeline, one entry per stage in pipeline order (#5342):
242
+ * the release each runs, its gate, the change risk the gate reads, its
243
+ * soak and the time left, the canary soaks that hold it, a pause, and a
244
+ * rollback request. Every stage is listed, whatever environment was asked
245
+ * for. Absent when the member has no `.chant/pipeline.ts`, or it does not
246
+ * fold. Added in contract 1.
247
+ */
248
+ pipeline?: StatusPipeline;
226
249
  }
227
250
  /** One feature flag of a member (#4024), as `status --json` lists it. */
228
251
  export interface StatusFeatureFlag {
@@ -253,6 +276,23 @@ export interface StatusReleaseCut {
253
276
  timestamp: string;
254
277
  signature: string | null;
255
278
  signatureCheck: ReleaseSignatureCheck;
279
+ /**
280
+ * The change risk the cut carries (#5387): its score and level, and how
281
+ * each stage after the first whose gate sets `holds.risk` in the member's
282
+ * pipeline reads it. Absent when the cut carries none.
283
+ */
284
+ risk?: StatusReleaseRisk;
285
+ }
286
+ /** A cut's change risk as `workspace status` shows it (#5387). */
287
+ export interface StatusReleaseRisk {
288
+ score: number;
289
+ level: "low" | "medium" | "high";
290
+ /** Each later stage that reads it, in the pipeline's order. Empty when the member has no pipeline, or no later stage sets `holds.risk`. */
291
+ stages: {
292
+ stage: string;
293
+ approveAbove: number | null;
294
+ over: boolean;
295
+ }[];
256
296
  }
257
297
  /** The most paths `ship.pending.paths` lists; `files` still counts them all. */
258
298
  export declare const SHIP_PENDING_PATHS_MAX = 200;
@@ -419,6 +459,8 @@ export interface StatusQuery {
419
459
  readOutcomes?: OutcomeReader;
420
460
  /** Reads one member's gate ledger directory; git unless a test swaps it. */
421
461
  readGates?: GateLedgerReader;
462
+ /** Reads each pipeline's stage log under a gate ledger directory (#5353); git unless a test swaps it. */
463
+ readStageLogs?: StageLogReader;
422
464
  /** The instant a gate's expiry is measured against; now by default. */
423
465
  now?: string;
424
466
  /** Reads one member's stewards; the declaration and ledger reader unless a test swaps it. */
@@ -427,6 +469,8 @@ export interface StatusQuery {
427
469
  readPromotionOrder?: (dir: string) => Promise<PromotionStep[] | null>;
428
470
  /** Reads one record kind for the decisions covering each gate's member (#3616); the working tree unless a test swaps it. */
429
471
  readDecisionKind?: DecisionKindReader;
472
+ /** Reads one stage's own ledger, `<stage>/stage.jsonl` (#5342); git unless a test swaps it. */
473
+ readStageLedger?: StageLedgerReader;
430
474
  }
431
475
  /** Reads the deploy outcomes (#4035) in the directory of the ledger at `path`. */
432
476
  type OutcomeReader = (path: string, cwd: string) => Promise<DeployOutcome[]>;