@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
package/dist/lexicon.d.ts CHANGED
@@ -55,7 +55,7 @@ export type { IREdge } from "./graph-ir.js";
55
55
  export type { OpAgentSpec } from "./ci-agent.js";
56
56
  export type { OpCommitSpec } from "./ci-commit.js";
57
57
  export type { DescribeResourcesResult, ObservationResult, NormalizedObservation, UnobservedEntity, UnobservedReason, } from "./observation.js";
58
- export type { HealthEntry, HealthReadOptions, HealthReadResult, HealthState, } from "./health.js";
58
+ export type { HealthEntry, HealthReadOptions, HealthReadResult, HealthState, HealthTarget, HealthTargetsResult, } from "./health.js";
59
59
  export type { DescribeIdentityOptions, DescribeIdentityResult, ResolvedIdentity, UnresolvedIdentity, IdentityRow, IdentityStatus, } from "./identity.js";
60
60
  export type { Disruption, DisruptionQuery, DisruptionVerdict, DisruptionClassifier, } from "./lifecycle/disruption.js";
61
61
  export type { DeepObservationResult, DeepResourceObservation, NormalizedDeepObservation, DeepNormalizationHooks, DeepNode, DeepArrayElement, DeepSide, } from "./deep-observation.js";
@@ -465,6 +465,16 @@ export type RunGroupKey = "commit" | "pull-request";
465
465
  export declare const RUN_GROUP_KEYS: readonly RunGroupKey[];
466
466
  /** Generic knobs for generate mode, applied once across every generated job (never per component). */
467
467
  export interface ComponentPipelineOptions {
468
+ /**
469
+ * The project's own CI file (#5329), which `chant run --generate gitlab`
470
+ * reads when a spec sets an alert agent: the relay's trigger pipeline runs
471
+ * every job of it that a trigger pipeline reaches, and the generator warns
472
+ * about each one with no guard. `text` absent: the file could not be read.
473
+ */
474
+ projectCi?: {
475
+ path: string;
476
+ text?: string;
477
+ };
468
478
  /**
469
479
  * A workflow-level run group (#4771), written on Forgejo only. Forgejo
470
480
  * gives a workflow with no workflow-level `concurrency:` a group per ref,
@@ -1007,6 +1017,8 @@ export interface OpPipelineResult {
1007
1017
  files: OpPipelineFile[];
1008
1018
  /** Every generated job, in emit order — one per Op. */
1009
1019
  jobs: OpPipelineJob[];
1020
+ /** What the generator says before the files are written (#5329), such as a job an alert's pipeline would start. */
1021
+ warnings?: string[];
1010
1022
  }
1011
1023
  /**
1012
1024
  * Options for an Op waves pipeline (#3679): the generic knobs of
@@ -1046,6 +1058,18 @@ export interface OpWavesPipelineOptions extends Pick<ComponentPipelineOptions, "
1046
1058
  * waves is refused. Absent: the jobs render as without it.
1047
1059
  */
1048
1060
  waveJobs?: Record<string, OpWaveJobInputs>;
1061
+ /**
1062
+ * The config and secret sets per environment (#5348,
1063
+ * `@intentius/chant/components/environment-sets`): each wave's jobs take
1064
+ * the set of its environment, the spec's `labels.Env` or else the wave's
1065
+ * name (`opWavesWithEnvironmentSets`, ./op/op-waves-environment-sets.ts).
1066
+ * The config, the set's record and the forge secrets join the wave's
1067
+ * `variables`; the store secrets are read in the command's step, after
1068
+ * the wave's trade and `waveJobs` login. An environment the sets do not
1069
+ * name is refused. Before merge a set holding secrets is refused. Absent:
1070
+ * the jobs render as without it.
1071
+ */
1072
+ environmentSets?: import("./components/environment-sets.js").EnvironmentSets;
1049
1073
  /**
1050
1074
  * What a product adds to the plans job, `record-plans` (#4791), which a
1051
1075
  * `pr-review` or `pull-request` wave adds: the steps before it plans
@@ -1053,6 +1077,18 @@ export interface OpWavesPipelineOptions extends Pick<ComponentPipelineOptions, "
1053
1077
  * OIDC tokens. Absent: the job renders as without it.
1054
1078
  */
1055
1079
  recordPlans?: OpWavesRecordPlansInputs;
1080
+ /**
1081
+ * The failed-apply agent's facts (#5357): each wave job's command step of
1082
+ * a pipeline that is not split gets `CHANT_AGENT_FACTS=apply-failed` and
1083
+ * the relay key from `relayKeyEnv`'s secret (GitHub, Forgejo) or
1084
+ * variable (GitLab), default `CHANT_RELAY_KEY`, so a failed wave records
1085
+ * its facts for the agent beside its triage
1086
+ * (`opWavesAgentFactsEnv`, ./ci-agent-triggers.ts). Absent: no fact is
1087
+ * recorded. `triggers` (#5339) names the facts, `["apply-failed"]` by
1088
+ * default; `verify-failed` adds the wave jobs' failing soak checks, and a
1089
+ * pipeline's promote jobs record their failed verifies and soaks with it.
1090
+ */
1091
+ agentFacts?: import("./ci-agent-triggers.js").AgentFactsOption;
1056
1092
  /**
1057
1093
  * The pipeline's runner identity (#4870): the secret (GitHub, Forgejo) or
1058
1094
  * CI/CD variable (GitLab) holding the runner key `.chant/trust.json`
@@ -1302,6 +1338,87 @@ export interface OpWavesRecordPlansInputs {
1302
1338
  idTokens?: Record<string, string>;
1303
1339
  }
1304
1340
  /** An Op waves pipeline: one file, and its jobs in order. */
1341
+ /** What a lexicon renders a pipeline's promote jobs from (#5324, {@link LexiconPlugin.generatePipelinePromote}). */
1342
+ export interface PipelinePromoteInput {
1343
+ /** The pipeline's name: the workflow is `<name>-promote`. */
1344
+ pipeline: string;
1345
+ /** The stages a promote reaches, in order: every stage after the first. */
1346
+ stages: Array<{
1347
+ name: string;
1348
+ environment?: OpEnvironment;
1349
+ } & PipelinePromoteStageInputs>;
1350
+ /** The command each job runs in place of `chant`, such as `npx --no-install plywood`. Absent: `chant`. */
1351
+ bin?: string;
1352
+ /** Where the jobs run. Default the forge's default runner. */
1353
+ runner?: import("./ci-jobs.js").CiRunner;
1354
+ /** Each job's timeout in minutes. Default `OP_WAVE_JOB_TIMEOUT_MINUTES` (180). */
1355
+ jobTimeoutMinutes?: number;
1356
+ /**
1357
+ * The scheduled re-run of pending promotions (#5326): with it, each stage
1358
+ * gets a `recheck-<stage>` job that runs on the schedule (on GitLab, on a
1359
+ * pipeline schedule) and runs `<bin> components promote --to <stage>
1360
+ * --pending`. Absent: no scheduled job, and the file is as before.
1361
+ */
1362
+ recheck?: {
1363
+ schedule: string;
1364
+ };
1365
+ /**
1366
+ * The verify-failed agent's facts (#5339): each promote and recheck job's
1367
+ * command step gets `CHANT_AGENT_FACTS=verify-failed` and the relay key
1368
+ * from `relayKeyEnv`'s secret (GitHub, Forgejo) or variable (GitLab),
1369
+ * default `CHANT_RELAY_KEY`, so a failed verify step or a soak check that
1370
+ * starts failing records a fact for the agent. Absent: the file is as
1371
+ * before.
1372
+ */
1373
+ agentFacts?: {
1374
+ relayKeyEnv?: string;
1375
+ };
1376
+ /**
1377
+ * The container image every promote, recheck and agent job runs in, as
1378
+ * {@link OpWavesPipelineOptions.image} gives it to the wave jobs (#5425).
1379
+ * Absent: the forge's default image, and the file is as before.
1380
+ */
1381
+ image?: string;
1382
+ /**
1383
+ * Install lines every job runs before its command, as
1384
+ * {@link OpWavesPipelineOptions.beforeScript} gives them to the wave jobs
1385
+ * (#5425). Absent: none, and the file is as before.
1386
+ */
1387
+ beforeScript?: string[];
1388
+ }
1389
+ /**
1390
+ * What one stage's promote job adds (#5348), as the pipeline's generator
1391
+ * gives it from the stage's config and secret set and its cloud identity.
1392
+ */
1393
+ export interface PipelinePromoteStageInputs {
1394
+ /** The job's variables, as the forge reads them: the set's config, its record and its forge secrets. */
1395
+ variables?: Record<string, string>;
1396
+ /** Shell lines run in the promote's step before the command, after the trade: the read of the set's store secrets. */
1397
+ setup?: string[];
1398
+ /** The stage's cloud identity, traded for before the checkout (`ci.identity`'s apply identity for the stage). */
1399
+ cloud?: import("./ci-identity.js").CloudTradeSpec;
1400
+ /**
1401
+ * The OIDC tokens the promote's command requests itself (#5427), as `{
1402
+ * <variable>: <audience> }`, an op wave's `idTokens`: a step that mints a
1403
+ * database password from the job's identity with no `cloud` trade (the
1404
+ * sql lexicon's `rds-iam`, `cloud-sql-iam`, `entra`). GitLab declares
1405
+ * them as the job's `id_tokens:`. GitHub gives the job `id-token: write`
1406
+ * and the promote's step the audience as `<variable>_AUDIENCE`, with the
1407
+ * token request variables kept; Forgejo renders the same job, and its
1408
+ * runner ignores `permissions:`. Absent: the job asks for no token unless
1409
+ * `cloud` trades one.
1410
+ */
1411
+ idTokens?: Record<string, string>;
1412
+ /**
1413
+ * The stage's agent steps (#5358): the variables holding their model keys.
1414
+ * Given, the promote gets a job before it that holds a read token only and
1415
+ * runs `pipeline agent run`, and the promote job records the answers with
1416
+ * `pipeline agent record` before it promotes.
1417
+ */
1418
+ agentSteps?: {
1419
+ keyEnvs: string[];
1420
+ };
1421
+ }
1305
1422
  export interface OpWavesPipelineResult {
1306
1423
  files: OpPipelineFile[];
1307
1424
  jobs: OpWaveJob[];
@@ -1463,6 +1580,29 @@ export interface CompositeEntry {
1463
1580
  * lexicon re-exports it as `PULUMI_CI_SETUP_FLOOR`.
1464
1581
  */
1465
1582
  export declare const CI_SETUP_UNLINKED_FLOOR = "0.124.78";
1583
+ /** A stack of a workspace member that reads take part in (#5331): its node is `<member>/<id>`. */
1584
+ export interface LexiconStackNode {
1585
+ member: string;
1586
+ id: string;
1587
+ kind: string;
1588
+ attrs: Record<string, unknown>;
1589
+ }
1590
+ /** What `workspaceStackReads` answers (#5331). */
1591
+ export interface LexiconStackReads {
1592
+ /** The lexicon the nodes belong to. */
1593
+ lexicon: string;
1594
+ stacks: LexiconStackNode[];
1595
+ reads: {
1596
+ /** The member that reads. */
1597
+ reader: string;
1598
+ /** The member that applies the stack read. Absent with `external`. */
1599
+ upstream?: string;
1600
+ /** The stack read when no member applies it, as the engine names it. */
1601
+ external?: string;
1602
+ /** The output read, where the files show it. */
1603
+ output?: string;
1604
+ }[];
1605
+ }
1466
1606
  export interface LexiconPlugin {
1467
1607
  /** Human-readable name (e.g. "aws", "gcp") */
1468
1608
  readonly name: string;
@@ -1745,6 +1885,15 @@ export interface LexiconPlugin {
1745
1885
  * lexicons implement this.
1746
1886
  */
1747
1887
  generateOpWavesPipeline?(spec: OpWavesSpec, options: OpWavesPipelineOptions): OpWavesPipelineResult;
1888
+ /**
1889
+ * Render a pipeline's promote jobs (#5324, `./pipeline.ts`): one manual
1890
+ * job per stage after the first, each running `components promote --to
1891
+ * <stage> --release <release>` behind that stage's gate, started by a
1892
+ * person with the stage and the release as inputs. The first stage's
1893
+ * waves render through {@link generateOpWavesPipeline}. Only CI-provider
1894
+ * lexicons implement this.
1895
+ */
1896
+ generatePipelinePromote?(input: PipelinePromoteInput): OpPipelineFile[];
1748
1897
  /**
1749
1898
  * The shell lines that install this lexicon's engine into the default CI
1750
1899
  * image (#4550): OpenTofu, and choudoufu where a member uses it, for
@@ -1935,6 +2084,25 @@ export interface LexiconPlugin {
1935
2084
  * a workspace asks for them (#5219).
1936
2085
  */
1937
2086
  workspaceLinks?(entities: ReadonlyMap<string, Declarable>, unread?: readonly LexiconUnreadSource[]): LexiconWorkspaceLinks | undefined | Promise<LexiconWorkspaceLinks | undefined>;
2087
+ /**
2088
+ * Reads between workspace members that sit in the members' files (#5331),
2089
+ * such as a Pulumi program's `StackReference` to the stack another member
2090
+ * applies. `chant workspace graph` asks once per lexicon that supplies a
2091
+ * member kind, with every declared member (`dir` relative to the workspace
2092
+ * root, `root` absolute) and the run's `--env`, and draws each read as an
2093
+ * edge from the reader's stack node to the upstream member's, or to a node
2094
+ * marked external when no member applies the stack. The answer must come
2095
+ * from the files alone and a throw counts as no reads.
2096
+ */
2097
+ workspaceStackReads?(ctx: {
2098
+ root: string;
2099
+ env?: string;
2100
+ members: readonly {
2101
+ name: string;
2102
+ dir: string;
2103
+ kind: string;
2104
+ }[];
2105
+ }): Promise<LexiconStackReads | undefined> | LexiconStackReads | undefined;
1938
2106
  /** Provide completions for LSP */
1939
2107
  completionProvider?(ctx: CompletionContext): CompletionItem[];
1940
2108
  /** Provide hover information for LSP */
@@ -2307,6 +2475,17 @@ export interface LexiconPlugin {
2307
2475
  * Endpoint overrides apply as on the other reads, so an emulator answers.
2308
2476
  */
2309
2477
  observeHealth?(options: import("./health.js").HealthReadOptions): Promise<import("./health.js").HealthReadResult>;
2478
+ /**
2479
+ * For an engine lexicon (terraform, pulumi): each declared resource whose
2480
+ * engine type a provider lexicon reads health for, with that provider's
2481
+ * health type and the id the engine recorded (a root's state, a stack's
2482
+ * export) (#5338). `chant lifecycle health` hands each target to the
2483
+ * provider's {@link observeHealth} with `physicalIds`. Every other
2484
+ * resource goes in `uncovered` with its engine type, and core reports it
2485
+ * `unknown`. An id that could not be read is `unobserved` with a reason; a
2486
+ * resource the records do not hold is `absent`.
2487
+ */
2488
+ healthTargets?(options: import("./health.js").HealthReadOptions): Promise<import("./health.js").HealthTargetsResult>;
2310
2489
  /**
2311
2490
  * This lexicon's noise rules for deep observation (#1014): which fields are
2312
2491
  * read-only / server-populated / controller-managed / provider-defaulted, and
@@ -2908,6 +3087,14 @@ export interface ResourceMetadata {
2908
3087
  * or Op imports `EngineFacts`. Absent unless an engine supplied it.
2909
3088
  */
2910
3089
  facts?: EngineFacts;
3090
+ /**
3091
+ * The key of the resource that registered this one as its child (#5403),
3092
+ * in the same key space as the observation's resources: a Pulumi
3093
+ * component for its children. `buildLiveGraphIr` copies it onto the node as
3094
+ * `IRNode.component`. Set only when the observation also holds that
3095
+ * resource. Absent otherwise.
3096
+ */
3097
+ component?: string;
2911
3098
  /**
2912
3099
  * The stack/env identity read off the resource's own ownership marker
2913
3100
  * (#1222) — the tags/labels/metadata chant stamped at synthesis, read back
@@ -49,6 +49,14 @@ export interface DisruptionQuery {
49
49
  type?: string;
50
50
  /** The attribute-level changes the entry carries. */
51
51
  deltas: AttributeChange[];
52
+ /**
53
+ * The entry's observed attributes now, in the lexicon's own observation
54
+ * shape, when the caller has them (#5338). A lexicon whose read carries
55
+ * the engine's own plan (terraform's plan depth puts `planActions` and
56
+ * `planReplacePaths` on each block) answers from these, since a delta
57
+ * lists only what moved since the last snapshot.
58
+ */
59
+ attributes?: Record<string, unknown>;
52
60
  }
53
61
  /** A lexicon's answer for one query. */
54
62
  export interface DisruptionVerdict {
@@ -78,9 +86,14 @@ export declare function unknownDisruption(detail: string): DisruptionVerdict;
78
86
  * entries — the only party that can map its own observation's attribute paths
79
87
  * back onto spec properties.
80
88
  *
89
+ * `observed` is the same lexicon's read, keyed by entry name; each query
90
+ * then carries that entry's attributes (#5338).
91
+ *
81
92
  * Returns a new change set; the input is not mutated.
82
93
  */
83
- export declare function annotateDisruption(cs: ChangeSet, environment: string, classify?: DisruptionClassifier): Promise<ChangeSet>;
94
+ export declare function annotateDisruption(cs: ChangeSet, environment: string, classify?: DisruptionClassifier, observed?: Readonly<Record<string, {
95
+ attributes?: Record<string, unknown>;
96
+ }>>): Promise<ChangeSet>;
84
97
  /** Count `update` entries per level. Entries with no verdict at all are not counted. */
85
98
  export declare function summarizeDisruption(cs: ChangeSet): Record<Disruption, number>;
86
99
  /** The most disruptive verdict in the set, or undefined when nothing was classified. */
@@ -27,9 +27,12 @@ export function unknownDisruption(detail) {
27
27
  * entries — the only party that can map its own observation's attribute paths
28
28
  * back onto spec properties.
29
29
  *
30
+ * `observed` is the same lexicon's read, keyed by entry name; each query
31
+ * then carries that entry's attributes (#5338).
32
+ *
30
33
  * Returns a new change set; the input is not mutated.
31
34
  */
32
- export async function annotateDisruption(cs, environment, classify) {
35
+ export async function annotateDisruption(cs, environment, classify, observed) {
33
36
  const updates = cs.entries.filter((e) => e.action === "update");
34
37
  if (updates.length === 0)
35
38
  return cs;
@@ -47,6 +50,7 @@ export async function annotateDisruption(cs, environment, classify) {
47
50
  name: e.name,
48
51
  ...(e.type ? { type: e.type } : {}),
49
52
  deltas: e.deltas ?? [],
53
+ ...(observed?.[e.name]?.attributes ? { attributes: observed[e.name].attributes } : {}),
50
54
  })),
51
55
  })) ?? {};
52
56
  }
@@ -26,6 +26,10 @@ import type { ChangeSetDocument, ChangeSetGraph } from "../change-set.js";
26
26
  export type GraphIdReader = (projectDir: string) => Promise<{
27
27
  ids: string[];
28
28
  sources?: Record<string, string>;
29
+ edges?: Array<{
30
+ from: string;
31
+ to: string;
32
+ }>;
29
33
  } | {
30
34
  error: string;
31
35
  }>;
@@ -38,6 +42,10 @@ export type GraphIdReader = (projectDir: string) => Promise<{
38
42
  export declare function readGraphIds(projectDir: string, args?: readonly string[]): Promise<{
39
43
  ids: string[];
40
44
  sources: Record<string, string>;
45
+ edges: Array<{
46
+ from: string;
47
+ to: string;
48
+ }>;
41
49
  } | {
42
50
  error: string;
43
51
  }>;
@@ -64,7 +64,8 @@ export async function readGraphIds(projectDir, args = []) {
64
64
  for (const n of read.ir.nodes)
65
65
  if (n.sourceLoc?.file)
66
66
  sources[n.id] = n.sourceLoc.file;
67
- return { ids: read.ir.nodes.map((n) => n.id), sources };
67
+ // #5325: the edges too, from the reader to what it reads, for the change risk's dependents.
68
+ return { ids: read.ir.nodes.map((n) => n.id), sources, edges: (read.ir.edges ?? []).map((e) => ({ from: e.from, to: e.to })) };
68
69
  }
69
70
  let graphReaderOverride;
70
71
  /**
@@ -417,6 +417,32 @@ export interface PendingGateRecord {
417
417
  * {@link GATED_REQUEST_FLOOR}.
418
418
  */
419
419
  request?: GatedRequest;
420
+ /**
421
+ * The soak this gate holds a promotion or a wave on (#5326), on gate
422
+ * `<stage>-soak` or `<gate>-wave-<k>-soak`: where the clock stands and
423
+ * why it holds. A person ends the soak early by approving this gate.
424
+ * Absent on every other fact.
425
+ */
426
+ soak?: PendingGateSoak;
427
+ }
428
+ /** A soak's state on its pending fact (#5326). */
429
+ export interface PendingGateSoak {
430
+ /** The stage that soaks, or the environment of the wave that soaks. */
431
+ stage: string;
432
+ /** On a wave's soak: the wave that soaks, 1-based. */
433
+ wave?: number;
434
+ /** On a stage's soak: the stage a promotion waits to go into. */
435
+ to?: string;
436
+ /** When the clock started (the last apply, or a restart), and when it is up. Null when no apply time could be read. */
437
+ clockStart: string | null;
438
+ due: string | null;
439
+ /** The time left when this run recorded the fact, in milliseconds. */
440
+ leftMs?: number;
441
+ /** Why it holds, one line each. */
442
+ holds: string[];
443
+ /** A `restart` check's restart, and the checks that failed on this run, for the next run. */
444
+ restartedAt?: string;
445
+ failing?: string[];
420
446
  }
421
447
  export type PendingGateInput = Omit<PendingGateRecord, "version" | "kind">;
422
448
  /** Either kind of line in `_gates/<op>.jsonl`. */
@@ -0,0 +1,82 @@
1
+ /**
2
+ * A rejection of a release at a gate (#5354): `chant reject <op> <gate>`
3
+ * writes one line to `_gates/<op>/rejected.jsonl` on `chant/lifecycle`,
4
+ * bound to the digest the gate waits on (a release's digest at a stage's
5
+ * gate) and to the release, with who rejected it and why.
6
+ *
7
+ * The file sits in a directory under `_gates/`, beside `applied.jsonl`, so
8
+ * a reader of `_gates/<op>.jsonl` that predates rejections never reads one
9
+ * as an approval.
10
+ *
11
+ * A rejection takes the proof rules an approval takes. Its seal signs
12
+ * {@link gateRejectionPayload} in the {@link GATE_REJECTION_NAMESPACE}
13
+ * namespace, so an approval's seal can never stand in for a rejection's or
14
+ * the other way round. Whether a rejection counts at a gate is decided by
15
+ * `../op/gate-reject.ts`.
16
+ *
17
+ * Pure: no git, no clock, no file.
18
+ */
19
+ import type { GateApprover } from "../op/gate-approval.js";
20
+ import type { GateOrigin } from "./gate-origin.js";
21
+ import type { GateApprovalSeal } from "./gate-ledger.js";
22
+ import { type GateSignerKeys } from "./gate-seal.js";
23
+ /** The ssh signature namespace of a rejection's seal (#5354), apart from an approval's `chant-gate`. */
24
+ export declare const GATE_REJECTION_NAMESPACE = "chant-gate-reject";
25
+ /** One rejection of the digest a gate waits on. */
26
+ export interface GateRejectionRecord {
27
+ version: 1;
28
+ kind: "rejection";
29
+ op: string;
30
+ gate: string;
31
+ /** Who rejected it: an actor name, as `chant approve` records `resolvedBy`. */
32
+ rejectedBy: string;
33
+ /** Why, on one line. Required: the run that stops on it says why. */
34
+ reason: string;
35
+ timestamp: string;
36
+ /** The digest rejected: at a stage's gate, the release's digest. */
37
+ planDigest?: string;
38
+ /** The environment the gate is for, copied off the pending fact it answers. */
39
+ environment?: string;
40
+ /** The release rejected, copied off the pending fact it answers, or named with `--release`. */
41
+ releaseDigest?: string;
42
+ /** The address the rejection was made at, such as a pull request or a review thread. */
43
+ url?: string;
44
+ /** A person or an agent. Only a person's rejection counts, as only a person's approval counts toward a quorum. */
45
+ approver?: GateApprover;
46
+ /** The channel it was recorded on. */
47
+ origin?: GateOrigin;
48
+ /** The commit the gate was waiting on, off the pending fact. */
49
+ gitSha?: string;
50
+ /** An ssh signature or a passkey's assertion over {@link gateRejectionPayload} by `rejectedBy`. */
51
+ seal?: GateApprovalSeal;
52
+ }
53
+ /** Where a gate's rejections are kept: `_gates/<op>/rejected.jsonl`. */
54
+ export declare function gateRejectionPath(op: string): {
55
+ dir: string;
56
+ file: string;
57
+ };
58
+ /** The rejection lines of a `rejected.jsonl` file, oldest first. A line that is not one is skipped. */
59
+ export declare function parseGateRejections(text: string): GateRejectionRecord[];
60
+ /** What is wrong with a rejection's reason, or null: it is one line of printable text. */
61
+ export declare function rejectionReasonProblem(reason: string | undefined): string | null;
62
+ /** The fields a rejection's seal covers. */
63
+ export type SealedGateRejection = Pick<GateRejectionRecord, "op" | "gate" | "environment" | "planDigest" | "releaseDigest" | "rejectedBy" | "timestamp" | "reason">;
64
+ /**
65
+ * The bytes a rejection's seal signs (#5354): a first line `chant-reject`,
66
+ * then the op, the gate, the environment, the digest, the release, who
67
+ * rejected it, the time and the reason, joined by LF with no final newline.
68
+ * An absent field signs an empty line. Its first line and its namespace
69
+ * keep it apart from an approval's payload (`gateSealPayload`).
70
+ */
71
+ export declare function gateRejectionPayload(r: SealedGateRejection): Buffer;
72
+ /**
73
+ * Why a rejection's seal does not prove who rejected, or null when it does
74
+ * (#5354): it verifies for `rejectedBy` over {@link gateRejectionPayload}
75
+ * in the rejection namespace, against a key the signers file at base lists
76
+ * for them or a passkey `.chant/trust.json` lists. The check an approval's
77
+ * seal takes (`gateSealRefusal`), over the rejection's own bytes.
78
+ */
79
+ export declare function rejectionSealRefusal(signers: GateSignerKeys & {
80
+ signersPath: string;
81
+ active: boolean;
82
+ }, r: GateRejectionRecord): string | null;
@@ -0,0 +1,93 @@
1
+ /**
2
+ * A rejection of a release at a gate (#5354): `chant reject <op> <gate>`
3
+ * writes one line to `_gates/<op>/rejected.jsonl` on `chant/lifecycle`,
4
+ * bound to the digest the gate waits on (a release's digest at a stage's
5
+ * gate) and to the release, with who rejected it and why.
6
+ *
7
+ * The file sits in a directory under `_gates/`, beside `applied.jsonl`, so
8
+ * a reader of `_gates/<op>.jsonl` that predates rejections never reads one
9
+ * as an approval.
10
+ *
11
+ * A rejection takes the proof rules an approval takes. Its seal signs
12
+ * {@link gateRejectionPayload} in the {@link GATE_REJECTION_NAMESPACE}
13
+ * namespace, so an approval's seal can never stand in for a rejection's or
14
+ * the other way round. Whether a rejection counts at a gate is decided by
15
+ * `../op/gate-reject.ts`.
16
+ *
17
+ * Pure: no git, no clock, no file.
18
+ */
19
+ import { checkGateSignature, unlistedWhat, unlistedWhere } from "./gate-seal.js";
20
+ /** The ssh signature namespace of a rejection's seal (#5354), apart from an approval's `chant-gate`. */
21
+ export const GATE_REJECTION_NAMESPACE = "chant-gate-reject";
22
+ /** Where a gate's rejections are kept: `_gates/<op>/rejected.jsonl`. */
23
+ export function gateRejectionPath(op) {
24
+ return { dir: `_gates/${op}`, file: "rejected.jsonl" };
25
+ }
26
+ const isText = (v) => typeof v === "string" && v !== "";
27
+ /** The rejection lines of a `rejected.jsonl` file, oldest first. A line that is not one is skipped. */
28
+ export function parseGateRejections(text) {
29
+ const out = [];
30
+ for (const line of text.split("\n")) {
31
+ if (!line.trim())
32
+ continue;
33
+ try {
34
+ const r = JSON.parse(line);
35
+ if (r.version !== 1 || r.kind !== "rejection" || !isText(r.op) || !isText(r.gate) || !isText(r.rejectedBy) || !isText(r.reason) || !isText(r.timestamp))
36
+ continue;
37
+ if (Number.isNaN(Date.parse(r.timestamp)))
38
+ continue;
39
+ if ([r.planDigest, r.environment, r.releaseDigest].some((v) => v !== undefined && typeof v !== "string"))
40
+ continue;
41
+ out.push(r);
42
+ }
43
+ catch {
44
+ // Not a line this reads.
45
+ }
46
+ }
47
+ return out;
48
+ }
49
+ /** What is wrong with a rejection's reason, or null: it is one line of printable text. */
50
+ export function rejectionReasonProblem(reason) {
51
+ if (reason === undefined || reason.trim() === "")
52
+ return "a rejection says why: --reason <text>";
53
+ if (/[\r\n\u2028\u2029]/.test(reason))
54
+ return "--reason is one line";
55
+ if (/[\u0000-\u001f\u007f]/.test(reason))
56
+ return "--reason is printable text";
57
+ return null;
58
+ }
59
+ /**
60
+ * The bytes a rejection's seal signs (#5354): a first line `chant-reject`,
61
+ * then the op, the gate, the environment, the digest, the release, who
62
+ * rejected it, the time and the reason, joined by LF with no final newline.
63
+ * An absent field signs an empty line. Its first line and its namespace
64
+ * keep it apart from an approval's payload (`gateSealPayload`).
65
+ */
66
+ export function gateRejectionPayload(r) {
67
+ return Buffer.from(["chant-reject", r.op, r.gate, r.environment ?? "", r.planDigest ?? "", r.releaseDigest ?? "", r.rejectedBy, r.timestamp, r.reason].join("\n"), "utf-8");
68
+ }
69
+ const normalise = (name) => name.normalize("NFKC").trim().toLowerCase();
70
+ /**
71
+ * Why a rejection's seal does not prove who rejected, or null when it does
72
+ * (#5354): it verifies for `rejectedBy` over {@link gateRejectionPayload}
73
+ * in the rejection namespace, against a key the signers file at base lists
74
+ * for them or a passkey `.chant/trust.json` lists. The check an approval's
75
+ * seal takes (`gateSealRefusal`), over the rejection's own bytes.
76
+ */
77
+ export function rejectionSealRefusal(signers, r) {
78
+ const what = `the rejection at gate ${r.gate} by ${r.rejectedBy}`;
79
+ if (!signers.active)
80
+ return `there is no signers file (${signers.signersPath}) at base, so no seal proves ${r.rejectedBy}`;
81
+ if (r.seal === undefined || r.seal === null)
82
+ return `${what} is not signed`;
83
+ const seal = r.seal;
84
+ if (typeof seal !== "object" || Array.isArray(seal) || typeof seal.signer !== "string" || typeof seal.signature !== "string")
85
+ return `the seal on ${what} is malformed: it needs signer and signature`;
86
+ if (normalise(seal.signer) !== normalise(r.rejectedBy))
87
+ return `the seal on ${what} is by ${seal.signer}`;
88
+ const check = checkGateSignature(signers, r.rejectedBy, seal, gateRejectionPayload(r), GATE_REJECTION_NAMESPACE);
89
+ if (check.ok)
90
+ return null;
91
+ const where = `${signers.signersPath} at base`;
92
+ return check.unlisted ? `${r.rejectedBy} has no ${unlistedWhat(seal)} in ${unlistedWhere(seal, where)}, so the seal can't count` : `the seal does not verify for ${r.rejectedBy} against ${where}: ${check.reason}`;
93
+ }
@@ -155,14 +155,14 @@ export type GateSignatureCheck = {
155
155
  /**
156
156
  * Whether `seal`'s signature over `payload` verifies for `principal` with a
157
157
  * key listed for them at base (#4646): an ssh signature in the `chant-gate`
158
- * namespace against the signers file's keys, or, for a seal of kind
159
- * `webauthn`, an assertion against the passkeys `.chant/trust.json` lists.
158
+ * namespace (or `namespace`, such as a rejection's, #5354) against the
159
+ * signers file's keys, or, for a seal of kind `webauthn`, an assertion against the passkeys `.chant/trust.json` lists.
160
160
  * The one check `chant approve`, the `identity.gates` rule, a sealed gate and
161
161
  * `checkGateSeal` all make. Never throws.
162
162
  */
163
163
  export declare function checkGateSignature(keys: GateSignerKeys, principal: string, seal: {
164
164
  signature: string;
165
- } & Record<string, unknown>, payload: Buffer): GateSignatureCheck;
165
+ } & Record<string, unknown>, payload: Buffer, namespace?: string): GateSignatureCheck;
166
166
  /**
167
167
  * Why this approval does not count toward a sealed gate, or null when it
168
168
  * does: its seal verifies, for the approver it names, against a key `signers`
@@ -253,12 +253,12 @@ export const WEBAUTHN_SEAL_KIND = "webauthn";
253
253
  /**
254
254
  * Whether `seal`'s signature over `payload` verifies for `principal` with a
255
255
  * key listed for them at base (#4646): an ssh signature in the `chant-gate`
256
- * namespace against the signers file's keys, or, for a seal of kind
257
- * `webauthn`, an assertion against the passkeys `.chant/trust.json` lists.
256
+ * namespace (or `namespace`, such as a rejection's, #5354) against the
257
+ * signers file's keys, or, for a seal of kind `webauthn`, an assertion against the passkeys `.chant/trust.json` lists.
258
258
  * The one check `chant approve`, the `identity.gates` rule, a sealed gate and
259
259
  * `checkGateSeal` all make. Never throws.
260
260
  */
261
- export function checkGateSignature(keys, principal, seal, payload) {
261
+ export function checkGateSignature(keys, principal, seal, payload, namespace = GATE_SEAL_NAMESPACE) {
262
262
  const name = normalise(principal);
263
263
  if (seal.kind === WEBAUTHN_SEAL_KIND) {
264
264
  const passkeys = (keys.passkeys ?? []).filter((p) => normalise(p.principal) === name);
@@ -276,8 +276,8 @@ export function checkGateSignature(keys, principal, seal, payload) {
276
276
  const listed = keys.signers.filter((s) => normalise(s.principal) === name);
277
277
  if (listed.length === 0)
278
278
  return { ok: false, unlisted: true, reason: `${principal} has no key in the signers file at base` };
279
- const blobs = listed.filter((s) => namespaceAllowed(s.namespaces, GATE_SEAL_NAMESPACE)).map((s) => Buffer.from(s.key.split(" ")[1] ?? "", "base64"));
280
- const r = verifySshSignatureWith(seal.signature, payload, GATE_SEAL_NAMESPACE, blobs);
279
+ const blobs = listed.filter((s) => namespaceAllowed(s.namespaces, namespace)).map((s) => Buffer.from(s.key.split(" ")[1] ?? "", "base64"));
280
+ const r = verifySshSignatureWith(seal.signature, payload, namespace, blobs);
281
281
  return r.ok ? r : { ok: false, unlisted: false, reason: r.reason };
282
282
  }
283
283
  /**
@@ -12,6 +12,7 @@
12
12
  import type { ObservationLexicon } from "../lexicon.js";
13
13
  import type { BuildResult } from "../build.js";
14
14
  import type { LiveObservation, IREdge } from "../graph-ir.js";
15
+ import type { EngineFacts } from "../engine-facts.js";
15
16
  import type { ResourceMetadata } from "../lexicon.js";
16
17
  import { type RootRead } from "../observation.js";
17
18
  export interface ObserveResult {
@@ -34,6 +35,22 @@ export interface ObserveResult {
34
35
  * {@link carryAnnotations} puts it on the declared nodes of an overlay.
35
36
  */
36
37
  annotations?: Record<string, Record<string, unknown>>;
38
+ /**
39
+ * An ownership engine's facts about declared entities the read does not
40
+ * return as present (#5333), keyed like {@link annotations}: a pending
41
+ * create, or an object `owned` filtered out. Never part of `observations`;
42
+ * `carryEngineFacts` in ../graph-ir.ts puts them on the declared nodes of an
43
+ * overlay. Carried only: nothing here reads a fact's value.
44
+ */
45
+ engineFacts?: Record<string, EngineFacts>;
46
+ /**
47
+ * Live objects a read found that no declared entity names (#5429), one
48
+ * entry per lexicon that reported any (`ObservationResult.undeclared`).
49
+ * Never part of `observations`, so the diff and the change set read what
50
+ * they read before; `chant graph --live` adds them to the live graph's
51
+ * nodes with `buildLiveGraphIr`.
52
+ */
53
+ undeclared?: LiveObservation[];
37
54
  /**
38
55
  * Which read answered each declared entity (#2267), keyed like the
39
56
  * observations' resources: `"state"`, `"live"`, `"plan"` or `"live+plan"`