@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,143 @@
1
+ /**
2
+ * `@intentius/chant/pipeline` (#5324): one TypeScript declaration of a
3
+ * member's delivery pipeline, its stages in promotion order and the waves
4
+ * inside each, folded to a spec before anything runs.
5
+ *
6
+ * A member's `.chant/pipeline.ts` holds the declaration:
7
+ *
8
+ * ```ts
9
+ * import { pipeline } from "@intentius/chant/pipeline";
10
+ *
11
+ * export default pipeline({
12
+ * name: "shop",
13
+ * defaults: { op: "shop", step: { kind: "pulumi-up", stack: "{target}" } },
14
+ * stages: [
15
+ * { name: "dev", waves: [{ name: "dev", runs: [{ target: "dev" }] }], gate: { policy: "never" } },
16
+ * { name: "prod", waves: [{ name: "prod", runs: [{ target: "prod" }] }], gate: { quorum: [{ count: 2 }] } },
17
+ * ],
18
+ * });
19
+ * ```
20
+ *
21
+ * `chant build` folds it (`./pipeline/fold.ts`) and writes the spec to
22
+ * `.chant/pipeline.json`; a file outside the TypeScript-as-data subset is
23
+ * refused with the evaluability rule's id. See the pipeline guide.
24
+ */
25
+ /**
26
+ * The first chant with the pipeline declaration (#5324): `.chant/pipeline.ts`
27
+ * folded by `chant build`, `chant pipeline spec` and `chant pipeline
28
+ * generate`, stage gates, holds and freeze windows on `components promote`,
29
+ * a wave's `failureTolerance`, and the product helpers here. A product
30
+ * feature-detects the pipeline on this name.
31
+ */
32
+ export const PIPELINE_FLOOR = "0.124.110";
33
+ /**
34
+ * The first chant whose pipeline helpers carry a product's job image and
35
+ * install lines and its stage risk and replan keys (#5425): `pipelineFromConfig`
36
+ * maps `environments.<name>.risk` and `replan_dependents`, and the pipeline
37
+ * generator gives the promote, recheck and agent jobs the `image` and
38
+ * `beforeScript` the wave jobs already take, on GitHub, GitLab and Forgejo.
39
+ */
40
+ export const PIPELINE_PRODUCT_JOBS_FLOOR = "0.124.110";
41
+ /**
42
+ * The first chant with stages that follow several stages and stages that
43
+ * take one release at a time (#5353): a stage's `after` and `queue` in
44
+ * `.chant/pipeline.ts`, a cycle among stages refused at build, the stage
45
+ * log `components promote` writes at `_gates/<pipeline>/stages.jsonl`, and
46
+ * `stageQueues` in `chant workspace status --json`. A product
47
+ * feature-detects the keys on this name before it writes them.
48
+ */
49
+ export const STAGE_GRAPH_FLOOR = "0.124.110";
50
+ /**
51
+ * The first chant whose `workspace status --json` lists `stageQueues` for every stage of each member's pipeline in one read (#5419), each queue on the member whose pipeline it belongs to, also when members share a ledger. A product reads every stage's queue from one status call on this name.
52
+ */
53
+ export const STATUS_STAGE_QUEUES_FLOOR = "0.124.110";
54
+ /**
55
+ * The first chant that pauses and resumes a pipeline stage and has its urgent path (#5355): `chant stage pause` and `resume` on the stage's ledger, a paused stage refusing promotion with exit 3, a stage's `pauseAfterRollback`, and a gate's `urgent` rule that `chant components promote --urgent` passes on one proven approval from its role, with the `urgent` notify event.
56
+ */
57
+ export const STAGE_PAUSE_URGENT_FLOOR = "0.124.110";
58
+ /**
59
+ * The first chant whose release carries its change risk (#5387): a wave
60
+ * that scores its change set under `holds.risk` writes the record beside its
61
+ * release records, `chant release cut` binds the commit's records to the
62
+ * release on its cut line, and `components promote --release` reads it at
63
+ * each stage gate whose `holds.risk` is set, adding the risk's approval rules
64
+ * over the threshold. The plan note shows how each later stage reads the
65
+ * plan's score, and `workspace status` each cut's. A product feature-detects
66
+ * a later stage's `holds.risk` on this name.
67
+ */
68
+ export const RELEASE_RISK_FLOOR = "0.124.110";
69
+ /**
70
+ * The first chant with soaks (#5326): a stage's and a wave's `soak` in
71
+ * `.chant/pipeline.ts` (a duration, checks of the kinds `http`,
72
+ * `prometheus`, `cloudwatch-alarm`, `command`, `health`, `drift`, `apply`
73
+ * and `policy`, each `restart` or `hold` on failure, and overrides by member
74
+ * glob), the `<stage>-soak` gate a person ends one early through, the `soak`
75
+ * notify event, the pipeline's `recheck` schedule with `components promote
76
+ * --pending`, and `decideSoak` for a product that decides a soak itself. A
77
+ * product feature-detects soaks on this name before it writes the keys.
78
+ */
79
+ export const SOAK_FLOOR = "0.124.110";
80
+ /**
81
+ * The first chant that enforces the canary (#5327): a stage's `canary` in
82
+ * `.chant/pipeline.ts` holds every stage after it through its soak
83
+ * (`canaryStagesBefore`, `pipelinePromoteSoaks`), and a canary stage takes
84
+ * a soak with checks; an op wave's `canary` marker (`OpWave.canary`, the
85
+ * first wave) holds every later wave's job through its soak, takes its
86
+ * stage's soak when it declares none, and warns with no checks
87
+ * (`opWavesCanaryWarnings`); `components fan-out --canary --wave-gate`
88
+ * holds the waves after the canary through the soak of the pipeline stage
89
+ * it runs in; and lint warns (COR027) on a canary in `environments`. A
90
+ * product feature-detects the marker on this name before it sets it from
91
+ * its `waves.canary`.
92
+ */
93
+ export const CANARY_FLOOR = "0.124.110";
94
+ /**
95
+ * The first chant whose stage can request its rollback when its verify or
96
+ * soak fails (#5328): a stage's `onVerifyFail: "hold" | "rollback"` in
97
+ * `.chant/pipeline.ts`, the build's refusal of `rollback` on a stage with a
98
+ * `sql-migrate` step or a step whose kind answers no `releaseInputs`, the
99
+ * `failed`, `rollback-requested`, `rollback-held` and `rolled-back` lines
100
+ * on the stage's ledger, gate `<stage>-rollback`, the `rollback-requested`
101
+ * notify event, and `chant components rollback <stage> --requested`. A
102
+ * product feature-detects the key on this name before it writes it.
103
+ */
104
+ export const VERIFY_ROLLBACK_FLOOR = "0.124.110";
105
+ /**
106
+ * The first chant whose `workspace status` shows each pipeline stage
107
+ * (#5342): `members[].pipeline` in `--json`, one entry per stage with the
108
+ * release it runs, its gate, the change risk the gate reads, its soak and
109
+ * the time left, the canary soaks that hold it, a pause and a rollback
110
+ * request, and `soak` on a soak gate's entry in `gates`; the text view adds
111
+ * one line per stage. A product or a dashboard feature-detects the fields
112
+ * on this name.
113
+ */
114
+ export const STAGE_STATUS_FLOOR = "0.124.110";
115
+ /**
116
+ * The declaration, typed. It returns its argument: the fold reads the
117
+ * argument's text, and a run that imports the file gets the same object.
118
+ */
119
+ export function pipeline(declaration) {
120
+ return declaration;
121
+ }
122
+ export * from "./pipeline/spec.js";
123
+ export { foldPipelineSource, pipelineFindingLine, PIPELINE_FOLD_RULE, PIPELINE_MODULE } from "./pipeline/fold.js";
124
+ export { artifactsPublishHook, promotionOrderOf, pipelineStage, releaseCutHook, stageHeldAt, stageHeldLine, stageWavesName, stageWavesSpec } from "./pipeline/stages.js";
125
+ export { gitShowPipeline, promoteBase, readMemberPipeline, readPipelineAt } from "./pipeline/read.js";
126
+ export { pipelineStageSpecFile } from "./pipeline/generate.js";
127
+ export { pipelineStageShow, PROMOTE_STAGE_WAVES_FLOOR, runStageWaves, stageReleaseItems, stageRunSpec, stageRunsWaves } from "./pipeline/stage-waves.js";
128
+ export { isReleaseRisk, laterStageRisk, laterStageRiskLines, readReleaseRisk, releaseRiskAt, releaseRiskOf, riskAtThreshold, stageRiskRead, stageRiskSettings, RELEASE_RISK_DIR, } from "./lifecycle/release-risk.js";
129
+ export { lineDiff, pipelineChange, pipelineChangeSection, pipelineSoakSection, pipelineSpecLines } from "./pipeline/diff.js";
130
+ export { decideSoak, soakCheckCount, soakCheckName, soakDurationMs, soakGlobMatch, soakHoldLines, soakOnFail, soakProblems, soakRuleFor, soakSpan, soakSummary, SOAK_CHECK_KINDS, SOAK_MEMBER_KINDS, } from "./pipeline/soak.js";
131
+ export { driftNamedTargets, healthVerdict, runRecordSoakSources, soakCheckReader } from "./pipeline/soak-checks.js";
132
+ export { soakAtGate, stageSoakGate, waveSoakGate, SOAK_FACT_EXPIRY } from "./pipeline/soak-gate.js";
133
+ export { pipelinePromoteSoak, pipelinePromoteSoaks } from "./pipeline/promote.js";
134
+ export { opWavesCanaryWarnings } from "./op/op-waves.js";
135
+ export { gitStageArtifactPort, parseStageArtifactRecords, publishStageArtifacts, readStageArtifacts, releaseCutFrom, resolveStageReads, stageArtifactsNote, stageArtifactsSpecProblems, stageArtifactText, stagePublishProblems, stageReadsProblems, withStageReadVariables, STAGE_ARTIFACT_MAX_BYTES, STAGE_ARTIFACTS_FILE, STAGE_ARTIFACTS_FLOOR, STAGE_ARTIFACTS_KIND, STAGE_ARTIFACTS_RELEASE_ENV, } from "./pipeline/artifacts.js";
136
+ export { pipelinePromoteAgentSteps, pipelinePromoteGates, pipelinePromoteSource, pipelineStageEntry, pipelineStageFinished, promotedDigest, } from "./pipeline/promote.js";
137
+ export { gitStageLogPort, memoryStageLogPort, parseStageLines, replacedIn, stageLogPath, stageQueueOf, stagesInLog, succeededIn, } from "./lifecycle/stage-log.js";
138
+ export { pipelineUrgentGate, pipelineUrgentUpstream, urgentGateName, urgentUpstreamStages, urgentUpstreamStop, } from "./pipeline/promote.js";
139
+ export { gitStageLedgerPort, memoryStageLedgerPort, parseStagePauseLines, pauseLine, releaseMissingIn, resumeLine, stagePaused, stagePausedLine, supersededBy, waitingLine, waitingReleases, STAGE_LEDGER_FILE, STAGE_LINE_KINDS, } from "./pipeline/stage-ledger.js";
140
+ export { agentAnswerProblems, agentStepGateRule, agentStepRiskLevels, agentStepSchemaDigest, agentStepSettings, checkedAgentAnswer, gitStageAgentAnswerPort, parseStageAgentAnswerRecords, readStageAgentAnswers, runStageAgentSteps, stageAgentKeyEnvs, stageAgentPolicyInput, stageAgentSteps, stageAgentStepsHold, stageAgentStepsProblems, stageAgentStepsSpecProblems, AGENT_STEP_KEY_ENV, AGENT_STEP_TIMEOUT_MINUTES, AGENT_STEP_TRIGGER, STAGE_AGENT_ANSWER_KIND, STAGE_AGENT_ANSWERS_FILE, STAGE_AGENT_STEPS_FLOOR, } from "./pipeline/agent-steps.js";
141
+ export { failureDetail, heldReason, memberLines, memberStateOf, memberStatesOf, previousRelease, requestedRollbackCommand, requestedRollbackGate, requestStageRollback, rollbackMembers, soakFailureOf, rolledBackLine, stageFailures, stageOnVerifyFail, stageRollbackGate, standingRollbackRequest, verifyRollbackProblems, MIGRATION_STEP_KIND, ROLLBACK_REQUEST_EXPIRY, } from "./pipeline/verify-rollback.js";
142
+ export { failedVerify, isVerifyStep, VERIFY_STEP_KINDS } from "./components/verify-step.js";
143
+ export { checkPipelineFile, pipelineFromConfig, pipelineSource, STAGE_HOOKS_KEY_FLOOR, writePipelineFile, } from "./pipeline/product.js";
package/dist/pr-loop.d.ts CHANGED
@@ -50,6 +50,8 @@
50
50
  import type { ChangeSetAction, ChangeSetDocument } from "./change-set.js";
51
51
  import type { PrRequireOutcome } from "./pr-requires.js";
52
52
  import { type PrMigrationFile } from "./pr-migrations.js";
53
+ import { type CostEstimate } from "./cost-estimate.js";
54
+ import { type ChangeRisk } from "./change-risk.js";
53
55
  import { type CiProductWords } from "./ci-product-words.js";
54
56
  import type { CrossStackEdge } from "./control/edges.js";
55
57
  /** The schema a pull-request report names in `$schema`. */
@@ -599,6 +601,26 @@ export interface PrReport {
599
601
  * within contract 1 by chant {@link PR_REPORT_POLICY_FLOOR}.
600
602
  */
601
603
  policy?: PrPolicyReport;
604
+ /**
605
+ * The plan's cost estimate (#5334), with `ci.cost` at base: each
606
+ * member's monthly change from the command run over its plan document,
607
+ * the sum, and with `approveAbove` whether the plan needs an approval of
608
+ * its own digest. The same record the policy reads as `input.cost`.
609
+ * Absent when the base sets no `ci.cost`, or the stage reached no plan to
610
+ * price. Added within contract 1 by the chant that carries
611
+ * `COST_ESTIMATE_FLOOR` (`@intentius/chant/ci-product`).
612
+ */
613
+ cost?: CostEstimate;
614
+ /**
615
+ * The change risk (#5325), with `ci.risk` at base: the score from 0 to 1,
616
+ * its level, each reason with its weight, and whether a threshold is
617
+ * crossed, so the plan needs an approval of its own digest. The same
618
+ * record the policy reads as `input.risk` and the stored change set
619
+ * keeps. Absent when the base sets no `ci.risk`, or the stage reached no
620
+ * plan to score. Added within contract 1 by the chant that carries
621
+ * `CHANGE_RISK_FLOOR` (`@intentius/chant/ci-product`).
622
+ */
623
+ risk?: ChangeRisk;
602
624
  /**
603
625
  * `pr-apply --before-merge` (#4301): the requires checks. Absent on every
604
626
  * other stage. Added within contract 1 by chant
package/dist/pr-loop.js CHANGED
@@ -49,6 +49,8 @@
49
49
  */
50
50
  import { parsePulumiUrn, pulumiMayAppearParent } from "./pulumi-urn.js";
51
51
  import { renderMigrationLines } from "./pr-migrations.js";
52
+ import { costEstimateLines } from "./cost-estimate.js";
53
+ import { changeRiskLines } from "./change-risk.js";
52
54
  import { GITHUB_COMMENT_LIMIT, groupChangeSet, renderPlanSummaryMarkdown } from "./plan-summary.js";
53
55
  import { activeProductWords, approveLine, commentLine, isChantWords, overrideLine, productStatusContext } from "./ci-product-words.js";
54
56
  /** The schema a pull-request report names in `$schema`. */
@@ -579,6 +581,12 @@ export function renderPrNote(report, options = {}) {
579
581
  out.push("", `Hooks: ${passed} passed${other.length > 0 ? `; ${other.join("; ")}` : ""}.`);
580
582
  }
581
583
  out.push(...policyLines(report));
584
+ // #5334: the cost estimate, member by member.
585
+ if (report.cost)
586
+ out.push(...costEstimateLines(report.cost, noun));
587
+ // #5325: the change risk, reason by reason.
588
+ if (report.risk)
589
+ out.push(...changeRiskLines(report.risk));
582
590
  out.push(...capabilityPolicyLines(report, words));
583
591
  out.push(...renderMigrationLines(report.migrations));
584
592
  if (report.selection.unclaimed.length > 0) {
@@ -23,6 +23,8 @@
23
23
  * so a plywood or sql-yodeler note is byte for byte what it was.
24
24
  */
25
25
  import { renderPrNote as renderPrLoopNote, type PrReport } from "./pr-loop.js";
26
+ import { type CostEstimate } from "./cost-estimate.js";
27
+ import { type ChangeRisk } from "./change-risk.js";
26
28
  import { type CiProductWords } from "./ci-product-words.js";
27
29
  /** The first chant with the product plan note (#4810). */
28
30
  export declare const PR_PLAN_NOTE_FLOOR = "0.124.78";
@@ -276,8 +278,20 @@ export interface PrPlanNote {
276
278
  nothing?: boolean;
277
279
  /** Lines about the pipeline itself, such as overdue drift checks. */
278
280
  notices?: string[];
279
- /** The product's lines under them: tips, binaries, cost, the slowest resources. */
281
+ /** The product's lines under them: tips, binaries, the slowest resources. */
280
282
  facts?: PrPlanNoteFact[];
283
+ /**
284
+ * The plan's cost estimate (#5334), as `estimateCosts` from
285
+ * `@intentius/chant/ci-product` gives it: chant renders it under the
286
+ * facts, a row per unit, in the same words as the pr loop's note.
287
+ */
288
+ cost?: CostEstimate;
289
+ /**
290
+ * The change risk (#5325), as `scoreChangeRisk` from
291
+ * `@intentius/chant/ci-product` gives it: chant renders it under the
292
+ * cost, in the same words as the pr loop's note.
293
+ */
294
+ risk?: ChangeRisk;
281
295
  named: PrPlanNoteNamed[];
282
296
  overrides?: PrPlanNoteOverride[];
283
297
  warnings?: {
@@ -24,6 +24,8 @@
24
24
  */
25
25
  import { renderPrNote as renderPrLoopNote } from "./pr-loop.js";
26
26
  import { GITHUB_COMMENT_LIMIT } from "./plan-summary.js";
27
+ import { costEstimateLines } from "./cost-estimate.js";
28
+ import { changeRiskLines } from "./change-risk.js";
27
29
  import { activeProductWords, approveLine, overrideLine } from "./ci-product-words.js";
28
30
  /** The first chant with the product plan note (#4810). */
29
31
  export const PR_PLAN_NOTE_FLOOR = "0.124.78";
@@ -249,6 +251,12 @@ export function renderPlanNote(report, options = {}) {
249
251
  const link = f.link ? (linkable ? `[${f.link.text}](${url}#${f.link.anchor})` : (f.link.plain ?? f.link.text)) : "";
250
252
  head.push(`${f.text}${link}${f.after ?? ""}`, "");
251
253
  }
254
+ // #5334: the cost estimate, unit by unit, as the pr loop's note shows it.
255
+ if (report.cost)
256
+ head.push(...costEstimateLines(report.cost, unitWord).slice(1), "");
257
+ // #5325: the change risk, as the pr loop's note shows it.
258
+ if (report.risk)
259
+ head.push(...changeRiskLines(report.risk).slice(1), "");
252
260
  const blocks = [];
253
261
  const line = (text) => void blocks.push({ kind: "line", units: 0, text });
254
262
  const sections = (at) => {
package/dist/pr-post.d.ts CHANGED
@@ -28,6 +28,7 @@
28
28
  * open pull request's note stale with a line naming the comment that
29
29
  * previews again, and sets its plan status back to pending.
30
30
  */
31
+ import type { ChangeRisk } from "./change-risk.js";
31
32
  import { type PrOverdue, type PrReport } from "./pr-loop.js";
32
33
  import { type PrForge } from "./pr-forge.js";
33
34
  import { type CiProductWords } from "./ci-product-words.js";
@@ -35,6 +36,21 @@ import { type ControlEdgeFacts } from "./control/edges.js";
35
36
  import type { OpRunRecordInput } from "./op/runtime.js";
36
37
  import type { RunOrigin } from "./lifecycle/release-ledger.js";
37
38
  import { type PrPlanBodyHandoff, type PrPlanNoteHandoff, type PrPlanNoteWords, type PrPlanSubject } from "./pr-plan-note.js";
39
+ /**
40
+ * The section for a change to the pipeline between `base` and `head` in
41
+ * `cwd` (#5324), or undefined when it did not change or either commit is not
42
+ * in the checkout (a shallow job), since a missing commit would read as a
43
+ * removed pipeline.
44
+ */
45
+ export declare function pipelineNoteSection(base: string, head: string, cwd?: string): string | undefined;
46
+ /**
47
+ * The note's section for how each later stage reads the plan's change risk
48
+ * (#5387): the pipeline at `base` in `cwd`, each stage after the first whose
49
+ * gate sets `holds.risk`, and what the score asks for there once a release
50
+ * carries it. Undefined when the base has no pipeline or no later stage
51
+ * sets `holds.risk`.
52
+ */
53
+ export declare function stageRiskNoteSection(base: string, risk: Pick<ChangeRisk, "score" | "reasons">, cwd?: string): string | undefined;
38
54
  /** The plan report's file under the report directory. */
39
55
  export declare const PR_PLAN_REPORT_FILE = "pr-plan.json";
40
56
  /** What {@link postPlanReport} posts for. */
@@ -114,6 +130,21 @@ export interface PlanPostInput {
114
130
  * empty or not one plain word.
115
131
  */
116
132
  notAffected?: string;
133
+ /**
134
+ * The note's section for a change to the member's pipeline (#5324): the
135
+ * folded spec's diff between `base` and `head`, or undefined when the
136
+ * pipeline did not change. Default: {@link pipelineNoteSection} in the
137
+ * job's checkout, which folds both commits' `.chant/pipeline.ts` and runs
138
+ * nothing.
139
+ */
140
+ pipelineSection?: (base: string, head: string) => string | undefined;
141
+ /**
142
+ * The note's section for how each later stage reads the plan's change
143
+ * risk (#5387), or undefined when no later stage sets `holds.risk`.
144
+ * Default: {@link stageRiskNoteSection} in the job's checkout, which folds
145
+ * the pipeline at `base` and runs nothing.
146
+ */
147
+ stageRiskSection?: (base: string, risk: ChangeRisk) => string | undefined;
117
148
  }
118
149
  /** How the note job keeps the plan job's run record (#4899). */
119
150
  export interface PlanRunRecorder {
package/dist/pr-post.js CHANGED
@@ -31,6 +31,10 @@
31
31
  import { appendFileSync, existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
32
32
  import { tmpdir } from "node:os";
33
33
  import { join } from "node:path";
34
+ import { spawnSync } from "node:child_process";
35
+ import { pipelineChange, pipelineChangeSection, pipelineSoakSection } from "./pipeline/diff.js";
36
+ import { readPipelineAt } from "./pipeline/read.js";
37
+ import { laterStageRisk, laterStageRiskLines } from "./lifecycle/release-risk.js";
34
38
  import { prNoteMarker, prStatusContext, renderPrNote } from "./pr-loop.js";
35
39
  import { prStatusDescription, prStatusState } from "./pr-status.js";
36
40
  import { forgePrincipalOf } from "./pr-forge.js";
@@ -40,6 +44,84 @@ import { controlEdgeFactsFromEnv, remarkCrossStackEdges } from "./control/edges.
40
44
  import { CHECK_EVIDENCE_FILE, checkEvidenceNoteLine, openEvidenceFor } from "./workspace/trust/check-evidence-report.js";
41
45
  import { PLAN_RUN_RECORD_FILE, readPlanRunRecord } from "./pr-plan-record.js";
42
46
  import { isPlanNote, PLAN_BODY_LIMIT, PLAN_SUBJECT_LIMIT, planNoteMarker, planSubjectProblem, PR_PLAN_NOTE_CONTRACT, PR_PLAN_NOTE_FILE, PRODUCT_MARKER_BODY, PRODUCT_MARKER_LIMIT, PRODUCT_MARKER_NAME, productMarkerLine, renderPlanNote, sinceLastLine } from "./pr-plan-note.js";
47
+ /**
48
+ * The section for a change to the pipeline between `base` and `head` in
49
+ * `cwd` (#5324), or undefined when it did not change or either commit is not
50
+ * in the checkout (a shallow job), since a missing commit would read as a
51
+ * removed pipeline.
52
+ */
53
+ export function pipelineNoteSection(base, head, cwd = process.cwd()) {
54
+ const known = (sha) => spawnSync("git", ["cat-file", "-e", `${sha}^{commit}`], { cwd, stdio: "ignore" }).status === 0;
55
+ if (!SHA.test(base) || !SHA.test(head) || !known(base) || !known(head))
56
+ return undefined;
57
+ // #5326: the soaks the change passes through, from the pipeline at base.
58
+ const atBase = readPipelineAt(base, cwd);
59
+ const soak = pipelineSoakSection(atBase.status === "folded" ? atBase.spec : undefined);
60
+ const change = pipelineChange(base, head, cwd);
61
+ if (!change)
62
+ return soak;
63
+ // A long diff is cut, so the section never takes over the note.
64
+ const lines = change.diff.length > PIPELINE_NOTE_LINES ? [...change.diff.slice(0, PIPELINE_NOTE_LINES), ` ... ${change.diff.length - PIPELINE_NOTE_LINES} more lines; \`chant pipeline spec\` prints the whole spec`] : change.diff;
65
+ const section = pipelineChangeSection({ ...change, diff: lines });
66
+ return soak ? `${section}\n\n${soak}` : section;
67
+ }
68
+ /**
69
+ * The note's section for how each later stage reads the plan's change risk
70
+ * (#5387): the pipeline at `base` in `cwd`, each stage after the first whose
71
+ * gate sets `holds.risk`, and what the score asks for there once a release
72
+ * carries it. Undefined when the base has no pipeline or no later stage
73
+ * sets `holds.risk`.
74
+ */
75
+ export function stageRiskNoteSection(base, risk, cwd = process.cwd()) {
76
+ if (!SHA.test(base))
77
+ return undefined;
78
+ const read = readPipelineAt(base, cwd);
79
+ if (read.status !== "folded")
80
+ return undefined;
81
+ const lines = laterStageRiskLines(laterStageRisk(read.spec, { score: risk.score, reasons: Array.isArray(risk.reasons) ? risk.reasons : [] }), risk.score);
82
+ return lines.length > 0 ? lines.slice(1).join("\n") : undefined;
83
+ }
84
+ /** The most diff lines the note's pipeline section shows (#5324). */
85
+ const PIPELINE_NOTE_LINES = 120;
86
+ function mergeBaseOf(a, b) {
87
+ const out = spawnSync("git", ["merge-base", a, b], { encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] });
88
+ const sha = out.status === 0 ? out.stdout.trim() : "";
89
+ return SHA.test(sha) ? sha : undefined;
90
+ }
91
+ /** `note` with the pipeline section added before its hidden lines, when there is one and the note stays within the forge's limit. */
92
+ function withPipelineSection(note, input, base, head, risk) {
93
+ const sections = [];
94
+ try {
95
+ const own = (input.pipelineSection ?? ((b, h) => pipelineNoteSection(b, h)))(base, head);
96
+ if (own)
97
+ sections.push(own);
98
+ }
99
+ catch {
100
+ // A pipeline that cannot be read shows no diff.
101
+ }
102
+ // #5387: how each later stage reads the plan's change risk.
103
+ if (risk) {
104
+ try {
105
+ const own = (input.stageRiskSection ?? ((b, r) => stageRiskNoteSection(b, r)))(base, risk);
106
+ if (own)
107
+ sections.push(own);
108
+ }
109
+ catch {
110
+ // A pipeline that cannot be read shows no stage's reading.
111
+ }
112
+ }
113
+ if (sections.length === 0)
114
+ return note;
115
+ const section = sections.join("\n\n");
116
+ const limit = input.forge.kind === "gitlab" ? GITLAB_NOTE_LIMIT : GITHUB_COMMENT_LIMIT;
117
+ // The hidden lines a note ends with stay last: they are read back by line.
118
+ const lines = note.replace(/\n*$/, "").split("\n");
119
+ let at = lines.length;
120
+ while (at > 1 && /^<!-- chant-pr-(tip|subject):/.test(lines[at - 1]))
121
+ at--;
122
+ const out = [...lines.slice(0, at), "", section, ...lines.slice(at)].join("\n") + "\n";
123
+ return out.length <= limit ? out : note;
124
+ }
43
125
  /** The plan report's file under the report directory. */
44
126
  export const PR_PLAN_REPORT_FILE = "pr-plan.json";
45
127
  const SHA = /^[0-9a-f]{40}$/;
@@ -245,6 +327,9 @@ export async function postPlanReport(input) {
245
327
  const own = productLineOf((input.noteWords ?? noteWordsFromEnv())?.productMarker, read.report.marker);
246
328
  if (!(input.member && report.status === "nothing" && !report.overdue?.length && !report.migrations?.length))
247
329
  note = planNoteFor(report, input.forge, prNoteMarker(input.env, input.member), input.baseTip, own);
330
+ // #5324: a change to the pipeline shows its folded spec's diff.
331
+ if (note !== undefined)
332
+ note = withPipelineSection(note, input, report.base, input.head, report.risk);
248
333
  }
249
334
  catch (err) {
250
335
  refused = `the plan report does not render: ${err instanceof Error ? err.message : String(err)}`;
@@ -492,6 +577,10 @@ async function postPlanNoteHandoff(input) {
492
577
  note = "note" in h
493
578
  ? planNoteHandoffNote(added.length > 0 ? { ...h, note: { ...h.note, notices: [...given, ...added] } } : h, input.forge, prNoteMarker(input.env, input.member), noteWords, input.baseTip)
494
579
  : planBodyHandoffNote(h, input.forge, prNoteMarker(input.env, input.member), noteWords, input.baseTip, added);
580
+ // #5324: a change to the pipeline shows its folded spec's diff, measured from where the pull request left the target branch.
581
+ const base = input.baseTip && SHA.test(input.baseTip) ? mergeBaseOf(input.baseTip, input.head) : undefined;
582
+ if (note !== undefined && base)
583
+ note = withPipelineSection(note, input, base, input.head, "note" in h ? h.note.risk : undefined);
495
584
  }
496
585
  catch (err) {
497
586
  refused = `the plan note does not render: ${err instanceof Error ? err.message : String(err)}`;
@@ -30,7 +30,7 @@
30
30
  * files rather than to the end of this one. The floors below were declared
31
31
  * here before that and keep the subpath they shipped under.
32
32
  */
33
- export declare const NEXT_RELEASE = "0.124.109";
33
+ export declare const NEXT_RELEASE = "0.124.110";
34
34
  /** The first chant with `chant dev local` and `chant dev bundle-check`, `@intentius/chant/local-chant` and `@intentius/chant/bundle-check` (`chantRuntimeTarget`, `chantExternalPlugin`, `checkBundle`): a product built against a chant checkout, and its bundle checked, without its own scripts (#4787). */
35
35
  export declare const LOCAL_CHANT_FLOOR = "0.124.86";
36
36
  /** The first chant with `chant workspace ref-gate` (pre-receive, pre-push, check, status, attach, install) and `refs` in `.chant/trust.json`, the checks a ref update needs evidence for (#4867). */
@@ -30,7 +30,7 @@
30
30
  * files rather than to the end of this one. The floors below were declared
31
31
  * here before that and keep the subpath they shipped under.
32
32
  */
33
- export const NEXT_RELEASE = "0.124.109";
33
+ export const NEXT_RELEASE = "0.124.110";
34
34
  /** The first chant with `chant dev local` and `chant dev bundle-check`, `@intentius/chant/local-chant` and `@intentius/chant/bundle-check` (`chantRuntimeTarget`, `chantExternalPlugin`, `checkBundle`): a product built against a chant checkout, and its bundle checked, without its own scripts (#4787). */
35
35
  export const LOCAL_CHANT_FLOOR = "0.124.86";
36
36
  /** The first chant with `chant workspace ref-gate` (pre-receive, pre-push, check, status, attach, install) and `refs` in `.chant/trust.json`, the checks a ref update needs evidence for (#4867). */
@@ -0,0 +1,50 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://intentius.io/chant/schemas/report-store/v1/audit.schema.json",
4
+ "title": "chant.audit/v1",
5
+ "description": "One line of audit.jsonl in a CI product's report store: an event on the gate ledger, or one a product records from its own records. A product's own line (terragucci.audit/v1, sql-yodeler's audit.jsonl) maps onto it with readAuditLine in @intentius/chant/report-store. Within v1 fields are only added, and an existing field never changes meaning.",
6
+ "type": "object",
7
+ "required": ["schema", "product", "id", "kind", "project", "at", "who", "what", "digest", "result", "evidence"],
8
+ "properties": {
9
+ "schema": { "const": "chant.audit/v1" },
10
+ "product": { "type": "string", "description": "The product that recorded it." },
11
+ "id": { "type": "string", "description": "Over where the line came from; the same records give the same id." },
12
+ "kind": {
13
+ "enum": ["approval-requested", "approved", "revoked", "override-requested", "override-recorded", "override-spent", "applied", "refused", "hook", "recorded"],
14
+ "description": "The event, from the vocabulary's PRODUCT_AUDIT_KINDS."
15
+ },
16
+ "product_kind": { "type": "string", "description": "The product's own word for the kind, when it is not kind: approval, apply, migration, silenced, ..." },
17
+ "project": { "type": "string", "description": "The repository or member." },
18
+ "environment": { "type": "string", "description": "The environment, when the product records one per line." },
19
+ "at": { "type": "string", "description": "When it happened, ISO 8601." },
20
+ "who": { "type": ["string", "null"], "description": "The approver, the overrider, whoever removed the line, or whoever ran it. Null when nobody did." },
21
+ "what": { "type": "string", "description": "The gate, the root, or the migration." },
22
+ "digest": { "type": ["string", "null"], "description": "The plan digest it binds. Null when it has none." },
23
+ "result": { "type": "string", "description": "How it came out: waiting, applied, failed, denied, the seal of an approval, ..." },
24
+ "evidence": {
25
+ "type": "object",
26
+ "required": ["source"],
27
+ "properties": {
28
+ "source": { "enum": ["ledger", "report", "state", "history", "run"] },
29
+ "branch": { "type": "string" },
30
+ "path": { "type": "string" },
31
+ "op": { "type": "string" },
32
+ "gate": { "type": "string" },
33
+ "line": { "type": "integer" },
34
+ "commit": { "type": "string" },
35
+ "bucket": { "type": "string" },
36
+ "key": { "type": "string" },
37
+ "url": { "type": "string" },
38
+ "job_url": { "type": "string" },
39
+ "deleted": { "type": "boolean" },
40
+ "location": { "type": "string" },
41
+ "version_id": { "type": "string" },
42
+ "table": { "type": "string", "description": "History: the table the row is in." },
43
+ "seq": { "type": "integer" },
44
+ "run": { "type": "string" }
45
+ }
46
+ },
47
+ "detail": { "type": "object", "description": "What else the source says, by kind." },
48
+ "product_fields": { "type": "object", "description": "Fields of a product's line that this schema does not name." }
49
+ }
50
+ }