@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,264 @@
1
+ /**
2
+ * Release artifacts (#5356): named values a stage publishes for the release
3
+ * it applied, which later stages and other repositories read.
4
+ *
5
+ * A stage often produces a value a later stage or another repository needs:
6
+ * a cluster endpoint, an image tag, a database host. A stage declares what
7
+ * it publishes under `publish`, each artifact by name:
8
+ *
9
+ * {
10
+ * name: "dev",
11
+ * waves: [...],
12
+ * publish: {
13
+ * endpoint: { member: "cluster", output: "endpoint" },
14
+ * db_password: { secret: { awsSecretsManager: "arn:aws:secretsmanager:...:secret:dev/db" } },
15
+ * },
16
+ * }
17
+ *
18
+ * - `{ member, output }` publishes the member's output as the stage left it
19
+ * once it applied: a string, or any JSON value. An output the engine marks
20
+ * sensitive or secret (a Terraform output with `sensitive = true`, a Pulumi
21
+ * secret) is refused, and nothing of that publish is recorded.
22
+ * - `{ secret }` publishes where a secret is kept, in the words of #5348's
23
+ * config and secret sets (a forge secret's name, an AWS Secrets Manager
24
+ * secret, a Google Secret Manager version or an Azure Key Vault secret).
25
+ * The reference is recorded and the secret itself is never read.
26
+ *
27
+ * Artifacts are values, never files: a value's JSON text is at most
28
+ * {@link STAGE_ARTIFACT_MAX_BYTES}.
29
+ *
30
+ * Each publish is one line of `<stage>/artifacts.jsonl` on `chant/lifecycle`
31
+ * ({@link STAGE_ARTIFACTS_FILE}), beside the stage's `releases.jsonl`: the
32
+ * pipeline, the stage, the release digest, its label, the commit, and every
33
+ * artifact the stage declares. The first stage publishes once its last wave
34
+ * applied and the merge cut its release (an after-apply hook after the cut,
35
+ * `./stages.ts`). A later stage publishes once `chant components promote
36
+ * --to <stage> --release <ref>` deployed.
37
+ *
38
+ * A later stage reads an upstream stage's artifact of the same release under
39
+ * `reads`, keyed by the variable name its deploy gets the value in:
40
+ *
41
+ * { name: "staging", waves: [...], reads: { TF_VAR_dev_endpoint: { stage: "dev", artifact: "endpoint" } } }
42
+ *
43
+ * `chant build` refuses a read of a stage that is not upstream of the reading
44
+ * stage (#5385): earlier in the list when no stage declares `after`, else an
45
+ * ancestor through `after`, so a sibling is refused. It also refuses a read of an artifact that stage does not publish
46
+ * ({@link stageArtifactsSpecProblems}). The promote refuses before anything
47
+ * deploys when the upstream has not published the artifact for the release
48
+ * being promoted ({@link resolveStageReads}). A string reaches the variable
49
+ * as it is, any other JSON value as its JSON text, and a secret as its
50
+ * reference's JSON.
51
+ *
52
+ * Another repository reads with {@link readStageArtifacts} (`chant pipeline
53
+ * artifacts read --stage <stage> --from <dir>`): the artifacts of the release
54
+ * the stage last published for, or of a named release. The `<product>-applied`
55
+ * dispatch carries the release digest when `control.release` is set
56
+ * (../control/dispatch.ts), and the read takes it from `CHANT_CONTROL_RELEASE`,
57
+ * so a downstream run pins to the release the member applied.
58
+ *
59
+ * Off by default: a stage with no `publish` publishes nothing, and its jobs
60
+ * render as before.
61
+ *
62
+ * This module imports types alone at load, and the ledger at call time.
63
+ */
64
+ import { type EnvironmentSecretRef, type EnvironmentSecretSource } from "../components/environment-sets.js";
65
+ import type { PipelineSpec, PipelineStage } from "./spec.js";
66
+ /**
67
+ * The first chant with release artifacts (#5356): a stage's `publish` and
68
+ * `reads` in `.chant/pipeline.ts`, the build's refusal of a read no upstream
69
+ * publishes, the publish after the first stage's release cut and after a
70
+ * promote under a release, `chant pipeline artifacts publish|read`, `chant
71
+ * pipeline release-of`, and `control.release` on the `<product>-applied`
72
+ * dispatch. A product feature-detects release artifacts on this name.
73
+ */
74
+ export declare const STAGE_ARTIFACTS_FLOOR = "0.124.110";
75
+ /** The ledger file a stage's publishes are kept in, beside its `releases.jsonl`. */
76
+ export declare const STAGE_ARTIFACTS_FILE = "artifacts.jsonl";
77
+ /** The record kind a line of {@link STAGE_ARTIFACTS_FILE} carries. A reader skips any other. */
78
+ export declare const STAGE_ARTIFACTS_KIND = "stage-artifacts";
79
+ /** The largest JSON text one artifact's value may have, in bytes. An artifact is a value, never a file. */
80
+ export declare const STAGE_ARTIFACT_MAX_BYTES = 65536;
81
+ /** The variable a read takes its release from when none is named: the one the `<product>-applied` dispatch carries. */
82
+ export declare const STAGE_ARTIFACTS_RELEASE_ENV = "CHANT_CONTROL_RELEASE";
83
+ /** What a stage publishes under one name. */
84
+ export type StageArtifactSource =
85
+ /** A member's output, as the stage left it once it applied. Refused when the engine marks it sensitive. */
86
+ {
87
+ member: string;
88
+ output: string;
89
+ }
90
+ /** Where a secret is kept (#5348's words). The reference is published, never the secret. */
91
+ | {
92
+ secret: EnvironmentSecretRef;
93
+ };
94
+ /** One artifact of an upstream stage that a stage reads. */
95
+ export interface StageArtifactRead {
96
+ /** The upstream stage: one before the reading stage in promotion order. */
97
+ stage: string;
98
+ /** The artifact's name in that stage's `publish`. */
99
+ artifact: string;
100
+ }
101
+ /** A JSON value. */
102
+ export type StageArtifactValue = string | number | boolean | null | StageArtifactValue[] | {
103
+ [key: string]: StageArtifactValue;
104
+ };
105
+ /** One published artifact, as the ledger holds it. */
106
+ export type StageArtifactEntry = {
107
+ kind: "value";
108
+ value: StageArtifactValue;
109
+ member: string;
110
+ output: string;
111
+ } | {
112
+ kind: "secret";
113
+ source: EnvironmentSecretSource;
114
+ };
115
+ /** One line of `<stage>/artifacts.jsonl`: every artifact a stage published for one release. */
116
+ export interface StageArtifactRecord {
117
+ version: 1;
118
+ kind: typeof STAGE_ARTIFACTS_KIND;
119
+ pipeline: string;
120
+ stage: string;
121
+ /** The release digest the stage applied. */
122
+ release: string;
123
+ /** The release's label, when its cut named one. */
124
+ label?: string;
125
+ /** The commit the release was cut from. */
126
+ gitSha?: string;
127
+ at: string;
128
+ /** By artifact name. */
129
+ artifacts: Record<string, StageArtifactEntry>;
130
+ }
131
+ /** Where a stage's artifact records are read and written. */
132
+ export interface StageArtifactPort {
133
+ read(stage: string): Promise<StageArtifactRecord[]>;
134
+ append(stage: string, record: StageArtifactRecord): Promise<void>;
135
+ }
136
+ /** What is wrong with a stage's `publish`, one line each. */
137
+ export declare function stagePublishProblems(publish: unknown, at: string): string[];
138
+ /** What is wrong with a stage's `reads` on its own, one line each. Whether an upstream publishes each is {@link stageArtifactsSpecProblems}'s. */
139
+ export declare function stageReadsProblems(reads: unknown, at: string): string[];
140
+ /**
141
+ * The indexes of every stage upstream of stage `index`, through `after`
142
+ * (#5353): a stage follows its `after`, else the stage before it. Mirrors
143
+ * `stageUpstreams` in ./spec, which this module cannot import at load. A
144
+ * cycle or an unknown name ends that path.
145
+ */
146
+ export declare function ancestorsOf(stages: Array<Partial<PipelineStage>>, index: number): Set<number>;
147
+ /**
148
+ * The reads no upstream publishes (#5356), one line each: a read of a stage
149
+ * that is not before the reading stage in promotion order, or of an
150
+ * artifact that stage's `publish` does not name, and a first stage that
151
+ * publishes while the merge cuts no release. `chant build` refuses each.
152
+ */
153
+ export declare function stageArtifactsSpecProblems(spec: {
154
+ stages?: unknown;
155
+ release?: unknown;
156
+ }): string[];
157
+ /** The records in a ledger file's text, oldest first, malformed lines left out. */
158
+ export declare function parseStageArtifactRecords(text: string): StageArtifactRecord[];
159
+ /**
160
+ * {@link StageArtifactPort} on `chant/lifecycle`, at `<stage>/artifacts.jsonl`.
161
+ * `cwd` may be a checkout of another repository, or a directory holding its
162
+ * `chant/lifecycle` alone; `member` or `ledgerPrefix` names a workspace
163
+ * member's records there.
164
+ */
165
+ export declare function gitStageArtifactPort(opts?: {
166
+ cwd?: string;
167
+ member?: string;
168
+ ledgerPrefix?: string;
169
+ }): StageArtifactPort;
170
+ /** A member's outputs after the stage applied, and the names its engine marks sensitive or secret. */
171
+ export interface MemberOutputs {
172
+ outputs: Record<string, unknown>;
173
+ sensitive: readonly string[];
174
+ }
175
+ /** What {@link publishStageArtifacts} takes. */
176
+ export interface PublishStageArtifactsInput {
177
+ spec: Pick<PipelineSpec, "name" | "stages">;
178
+ stage: string;
179
+ release: {
180
+ digest: string;
181
+ label?: string | null;
182
+ gitSha?: string;
183
+ };
184
+ /** A member's outputs as its steps read them now, or undefined when its steps say none. */
185
+ outputsOf: (member: string) => Promise<MemberOutputs | undefined>;
186
+ port: StageArtifactPort;
187
+ /** Check and answer the record; write nothing. */
188
+ dryRun?: boolean;
189
+ now?: () => string;
190
+ }
191
+ /** What a publish did. `refused` lists why nothing was recorded; a refusal never quotes an output's value. */
192
+ export type PublishStageArtifactsResult = {
193
+ status: "none";
194
+ stage: string;
195
+ } | {
196
+ status: "published";
197
+ record: StageArtifactRecord;
198
+ dryRun?: true;
199
+ } | {
200
+ status: "refused";
201
+ stage: string;
202
+ problems: string[];
203
+ };
204
+ /**
205
+ * Publish the artifacts `stage` declares for `release` (#5356): every one or
206
+ * none. A member output the engine marks sensitive is refused, by name; a
207
+ * secret is recorded as where it is kept. The record holds no value the
208
+ * engine marks sensitive and no secret, and neither does a refusal.
209
+ */
210
+ export declare function publishStageArtifacts(input: PublishStageArtifactsInput): Promise<PublishStageArtifactsResult>;
211
+ /**
212
+ * The artifacts `stage` published (#5356): for `release` when named (a
213
+ * digest), else for the release it last published for. The latest record
214
+ * wins when a release was published twice. Undefined when there is none.
215
+ */
216
+ export declare function readStageArtifacts(port: StageArtifactPort, query: {
217
+ stage: string;
218
+ release?: string;
219
+ }): Promise<StageArtifactRecord | undefined>;
220
+ /** The text a variable holds for an artifact: a string as it is, any other value as JSON, a secret as its reference's JSON. */
221
+ export declare function stageArtifactText(entry: StageArtifactEntry): string;
222
+ /** One read a stage's deploy gets. */
223
+ export interface ResolvedStageRead extends StageArtifactRead {
224
+ /** The variable it is in. */
225
+ variable: string;
226
+ kind: StageArtifactEntry["kind"];
227
+ }
228
+ /** What {@link resolveStageReads} found. */
229
+ export type StageReadsResult = {
230
+ status: "resolved";
231
+ variables: Record<string, string>;
232
+ reads: ResolvedStageRead[];
233
+ } | {
234
+ status: "refused";
235
+ problems: string[];
236
+ };
237
+ /**
238
+ * The variables `stage`'s reads hold for `release` (#5356), each from the
239
+ * upstream stage's record of that same release. Refused, naming each, when
240
+ * an upstream has not published the artifact for this release, or when the
241
+ * stage reads and no release is named. Empty when the stage reads nothing.
242
+ */
243
+ export declare function resolveStageReads(spec: Pick<PipelineSpec, "stages">, stage: string, release: string | undefined, port: StageArtifactPort): Promise<StageReadsResult>;
244
+ /**
245
+ * The note a publish or a read prints (Markdown): each artifact, a value as
246
+ * JSON, a secret as where it is kept. Holds no secret: a secret artifact's
247
+ * record never holds one.
248
+ */
249
+ export declare function stageArtifactsNote(record: StageArtifactRecord): string;
250
+ /**
251
+ * The release cut from `commit` (#5356): the newest cut whose release names
252
+ * that commit, with its label. Undefined when none was cut from it.
253
+ */
254
+ export declare function releaseCutFrom(commit: string, opts?: {
255
+ cwd?: string;
256
+ member?: string;
257
+ ledgerPrefix?: string;
258
+ }): Promise<{
259
+ digest: string;
260
+ label: string | null;
261
+ commit: string;
262
+ } | undefined>;
263
+ /** The variables of {@link resolveStageReads} set in `env` for the length of `run`, then put back as they were. */
264
+ export declare function withStageReadVariables<T>(variables: Record<string, string>, run: () => Promise<T>, env?: NodeJS.ProcessEnv): Promise<T>;