@intentius/chant 0.124.55 → 0.124.56

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 (370) hide show
  1. package/dist/ci-agent.d.ts.map +1 -1
  2. package/dist/ci-agent.js +1 -2
  3. package/dist/ci-audit/attribution.d.ts +111 -0
  4. package/dist/ci-audit/attribution.d.ts.map +1 -0
  5. package/dist/ci-audit/attribution.js +194 -0
  6. package/dist/ci-audit/audit-log.d.ts +144 -0
  7. package/dist/ci-audit/audit-log.d.ts.map +1 -0
  8. package/dist/ci-audit/audit-log.js +149 -0
  9. package/dist/ci-audit/index.d.ts +12 -0
  10. package/dist/ci-audit/index.d.ts.map +1 -0
  11. package/dist/ci-audit/index.js +12 -0
  12. package/dist/ci-audit/unrecorded.d.ts +74 -0
  13. package/dist/ci-audit/unrecorded.d.ts.map +1 -0
  14. package/dist/ci-audit/unrecorded.js +95 -0
  15. package/dist/ci-audit.d.ts +3 -0
  16. package/dist/ci-audit.d.ts.map +1 -0
  17. package/dist/ci-audit.js +2 -0
  18. package/dist/ci-control.d.ts.map +1 -1
  19. package/dist/ci-control.js +3 -4
  20. package/dist/ci-estate.d.ts +24 -0
  21. package/dist/ci-estate.d.ts.map +1 -1
  22. package/dist/ci-estate.js +1 -2
  23. package/dist/ci-identity.d.ts.map +1 -1
  24. package/dist/ci-identity.js +2 -3
  25. package/dist/ci-job-guard.d.ts +139 -0
  26. package/dist/ci-job-guard.d.ts.map +1 -0
  27. package/dist/ci-job-guard.js +287 -0
  28. package/dist/ci-jobs.d.ts +7 -0
  29. package/dist/ci-jobs.d.ts.map +1 -1
  30. package/dist/ci-jobs.js +7 -0
  31. package/dist/ci-product-words.d.ts +7 -1
  32. package/dist/ci-product-words.d.ts.map +1 -1
  33. package/dist/ci-product-words.js +38 -4
  34. package/dist/ci-product.d.ts +35 -0
  35. package/dist/ci-product.d.ts.map +1 -1
  36. package/dist/ci-product.js +38 -3
  37. package/dist/ci-respond-run.d.ts +73 -0
  38. package/dist/ci-respond-run.d.ts.map +1 -0
  39. package/dist/ci-respond-run.js +247 -0
  40. package/dist/ci-respond.d.ts +189 -0
  41. package/dist/ci-respond.d.ts.map +1 -0
  42. package/dist/ci-respond.js +285 -0
  43. package/dist/cli/handlers/audit-log.d.ts +12 -0
  44. package/dist/cli/handlers/audit-log.d.ts.map +1 -0
  45. package/dist/cli/handlers/audit-log.js +81 -0
  46. package/dist/cli/handlers/build.d.ts +7 -0
  47. package/dist/cli/handlers/build.d.ts.map +1 -1
  48. package/dist/cli/handlers/build.js +81 -0
  49. package/dist/cli/handlers/ci-check-job.d.ts +11 -0
  50. package/dist/cli/handlers/ci-check-job.d.ts.map +1 -0
  51. package/dist/cli/handlers/ci-check-job.js +27 -0
  52. package/dist/cli/handlers/ci-check.d.ts.map +1 -1
  53. package/dist/cli/handlers/ci-check.js +38 -9
  54. package/dist/cli/handlers/e2e-safe-run.d.ts +12 -0
  55. package/dist/cli/handlers/e2e-safe-run.d.ts.map +1 -0
  56. package/dist/cli/handlers/e2e-safe-run.js +23 -0
  57. package/dist/cli/handlers/pr.d.ts +5 -0
  58. package/dist/cli/handlers/pr.d.ts.map +1 -1
  59. package/dist/cli/handlers/pr.js +259 -4
  60. package/dist/cli/handlers/run-wave.js +89 -1
  61. package/dist/cli/main.d.ts.map +1 -1
  62. package/dist/cli/main.js +56 -2
  63. package/dist/cli/parse-args.d.ts.map +1 -1
  64. package/dist/cli/parse-args.js +107 -0
  65. package/dist/cli/registry.d.ts +38 -0
  66. package/dist/cli/registry.d.ts.map +1 -1
  67. package/dist/components/adoption.d.ts.map +1 -1
  68. package/dist/components/adoption.js +1 -2
  69. package/dist/components/capability.d.ts +37 -0
  70. package/dist/components/capability.d.ts.map +1 -1
  71. package/dist/components/capability.js +25 -0
  72. package/dist/components/check-hooks.d.ts +4 -1
  73. package/dist/components/check-hooks.d.ts.map +1 -1
  74. package/dist/components/check-steps.d.ts +74 -0
  75. package/dist/components/check-steps.d.ts.map +1 -0
  76. package/dist/components/check-steps.js +102 -0
  77. package/dist/components/ci-services.d.ts.map +1 -1
  78. package/dist/components/ci-services.js +1 -2
  79. package/dist/components/driver.d.ts +12 -0
  80. package/dist/components/driver.d.ts.map +1 -1
  81. package/dist/components/driver.js +35 -1
  82. package/dist/components/groups.d.ts.map +1 -1
  83. package/dist/components/groups.js +4 -3
  84. package/dist/components/pr-env-ledger.d.ts.map +1 -1
  85. package/dist/components/pr-env-ledger.js +1 -2
  86. package/dist/components/pr-environment.d.ts +1 -1
  87. package/dist/components/pr-environment.d.ts.map +1 -1
  88. package/dist/components/pr-environment.js +1 -1
  89. package/dist/components/pr-pipeline.d.ts +129 -3
  90. package/dist/components/pr-pipeline.d.ts.map +1 -1
  91. package/dist/components/pr-pipeline.js +153 -17
  92. package/dist/components/pr-run.d.ts +8 -0
  93. package/dist/components/pr-run.d.ts.map +1 -1
  94. package/dist/components/pr-run.js +9 -4
  95. package/dist/components/product-pipeline.d.ts +35 -2
  96. package/dist/components/product-pipeline.d.ts.map +1 -1
  97. package/dist/components/product-pipeline.js +24 -5
  98. package/dist/components/wave-plan.d.ts +8 -0
  99. package/dist/components/wave-plan.d.ts.map +1 -1
  100. package/dist/components/wave-plan.js +18 -2
  101. package/dist/e2e-harness/bucket.d.ts +21 -0
  102. package/dist/e2e-harness/bucket.d.ts.map +1 -0
  103. package/dist/e2e-harness/bucket.js +61 -0
  104. package/dist/e2e-harness/claim.d.ts +70 -0
  105. package/dist/e2e-harness/claim.d.ts.map +1 -0
  106. package/dist/e2e-harness/claim.js +98 -0
  107. package/dist/e2e-harness/driver.d.ts +64 -0
  108. package/dist/e2e-harness/driver.d.ts.map +1 -0
  109. package/dist/e2e-harness/driver.js +243 -0
  110. package/dist/e2e-harness/forgejo.d.ts +77 -0
  111. package/dist/e2e-harness/forgejo.d.ts.map +1 -0
  112. package/dist/e2e-harness/forgejo.js +205 -0
  113. package/dist/e2e-harness/git.d.ts +32 -0
  114. package/dist/e2e-harness/git.d.ts.map +1 -0
  115. package/dist/e2e-harness/git.js +67 -0
  116. package/dist/e2e-harness/index.d.ts +22 -0
  117. package/dist/e2e-harness/index.d.ts.map +1 -0
  118. package/dist/e2e-harness/index.js +48 -0
  119. package/dist/e2e-harness/jobs.d.ts +8 -0
  120. package/dist/e2e-harness/jobs.d.ts.map +1 -0
  121. package/dist/e2e-harness/jobs.js +34 -0
  122. package/dist/e2e-harness/pins.d.ts +45 -0
  123. package/dist/e2e-harness/pins.d.ts.map +1 -0
  124. package/dist/e2e-harness/pins.js +44 -0
  125. package/dist/e2e-harness/ports.d.ts +113 -0
  126. package/dist/e2e-harness/ports.d.ts.map +1 -0
  127. package/dist/e2e-harness/ports.js +4 -0
  128. package/dist/e2e-harness/reports.d.ts +45 -0
  129. package/dist/e2e-harness/reports.d.ts.map +1 -0
  130. package/dist/e2e-harness/reports.js +57 -0
  131. package/dist/e2e-harness/safe-run-cli.d.ts +17 -0
  132. package/dist/e2e-harness/safe-run-cli.d.ts.map +1 -0
  133. package/dist/e2e-harness/safe-run-cli.js +43 -0
  134. package/dist/e2e-harness/safe-run.d.ts +61 -0
  135. package/dist/e2e-harness/safe-run.d.ts.map +1 -0
  136. package/dist/e2e-harness/safe-run.js +172 -0
  137. package/dist/e2e-harness/scenario.d.ts +11 -0
  138. package/dist/e2e-harness/scenario.d.ts.map +1 -0
  139. package/dist/e2e-harness/scenario.js +89 -0
  140. package/dist/e2e-harness/schemas/demo-cycle.schema.json +282 -0
  141. package/dist/e2e-harness/schemas/demo-step.schema.json +245 -0
  142. package/dist/e2e-harness/schemas/e2e-claim-row.schema.json +33 -0
  143. package/dist/e2e-harness/schemas/e2e-claims.schema.json +18 -0
  144. package/dist/e2e-harness/schemas/e2e-scenario.schema.json +150 -0
  145. package/dist/e2e-harness/schemas/index.d.ts +191 -0
  146. package/dist/e2e-harness/schemas/index.d.ts.map +1 -0
  147. package/dist/e2e-harness/schemas/index.js +62 -0
  148. package/dist/e2e-harness/stack.d.ts +124 -0
  149. package/dist/e2e-harness/stack.d.ts.map +1 -0
  150. package/dist/e2e-harness/stack.js +207 -0
  151. package/dist/e2e-harness/steps.d.ts +11 -0
  152. package/dist/e2e-harness/steps.d.ts.map +1 -0
  153. package/dist/e2e-harness/steps.js +22 -0
  154. package/dist/e2e-harness.d.ts +3 -0
  155. package/dist/e2e-harness.d.ts.map +1 -0
  156. package/dist/e2e-harness.js +2 -0
  157. package/dist/exit-codes.d.ts +7 -1
  158. package/dist/exit-codes.d.ts.map +1 -1
  159. package/dist/exit-codes.js +7 -1
  160. package/dist/lexicon.d.ts +46 -0
  161. package/dist/lexicon.d.ts.map +1 -1
  162. package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
  163. package/dist/lifecycle/gate-ledger.js +2 -3
  164. package/dist/lifecycle/gated-request.d.ts.map +1 -1
  165. package/dist/lifecycle/gated-request.js +1 -2
  166. package/dist/lifecycle/query.d.ts.map +1 -1
  167. package/dist/lifecycle/query.js +4 -5
  168. package/dist/lifecycle/release-catalog.d.ts.map +1 -1
  169. package/dist/lifecycle/release-catalog.js +1 -1
  170. package/dist/lifecycle/release-ledger.d.ts.map +1 -1
  171. package/dist/lifecycle/release-ledger.js +1 -2
  172. package/dist/lifecycle/release-status.d.ts +20 -0
  173. package/dist/lifecycle/release-status.d.ts.map +1 -1
  174. package/dist/lifecycle/release-status.js +1 -22
  175. package/dist/lifecycle/wave-plans.d.ts +23 -7
  176. package/dist/lifecycle/wave-plans.d.ts.map +1 -1
  177. package/dist/lifecycle/wave-plans.js +9 -2
  178. package/dist/op/approval-status.d.ts +103 -0
  179. package/dist/op/approval-status.d.ts.map +1 -0
  180. package/dist/op/approval-status.js +197 -0
  181. package/dist/op/index.d.ts +1 -1
  182. package/dist/op/index.d.ts.map +1 -1
  183. package/dist/op/index.js +1 -1
  184. package/dist/op/op-waves-capability-spec.d.ts +8 -0
  185. package/dist/op/op-waves-capability-spec.d.ts.map +1 -1
  186. package/dist/op/op-waves-capability-spec.js +21 -0
  187. package/dist/op/op-waves-release.d.ts.map +1 -1
  188. package/dist/op/op-waves-release.js +1 -2
  189. package/dist/op/op-waves-run.d.ts +7 -2
  190. package/dist/op/op-waves-run.d.ts.map +1 -1
  191. package/dist/op/op-waves-run.js +96 -4
  192. package/dist/op/op-waves-stand-down.d.ts.map +1 -1
  193. package/dist/op/op-waves-stand-down.js +1 -2
  194. package/dist/op/op-waves.d.ts +35 -0
  195. package/dist/op/op-waves.d.ts.map +1 -1
  196. package/dist/op/op-waves.js +46 -6
  197. package/dist/op/runtime.d.ts +4 -0
  198. package/dist/op/runtime.d.ts.map +1 -1
  199. package/dist/op/runtime.js +2 -3
  200. package/dist/otlp.d.ts.map +1 -1
  201. package/dist/otlp.js +1 -2
  202. package/dist/parallelism.d.ts +17 -0
  203. package/dist/parallelism.d.ts.map +1 -0
  204. package/dist/parallelism.js +33 -0
  205. package/dist/policy-source.d.ts.map +1 -1
  206. package/dist/policy-source.js +1 -2
  207. package/dist/pr-forge.d.ts.map +1 -1
  208. package/dist/pr-forge.js +56 -39
  209. package/dist/pr-loop.d.ts +9 -0
  210. package/dist/pr-loop.d.ts.map +1 -1
  211. package/dist/pr-loop.js +22 -3
  212. package/dist/pr-merge.d.ts +64 -0
  213. package/dist/pr-merge.d.ts.map +1 -0
  214. package/dist/pr-merge.js +78 -0
  215. package/dist/pr-post.d.ts +70 -1
  216. package/dist/pr-post.d.ts.map +1 -1
  217. package/dist/pr-post.js +116 -5
  218. package/dist/pr-report-url.d.ts.map +1 -1
  219. package/dist/pr-report-url.js +1 -2
  220. package/dist/release-floors.d.ts +1 -1
  221. package/dist/release-floors.js +1 -1
  222. package/dist/run-event.d.ts.map +1 -1
  223. package/dist/run-event.js +1 -2
  224. package/dist/scheduled-op-cloud.d.ts +32 -0
  225. package/dist/scheduled-op-cloud.d.ts.map +1 -0
  226. package/dist/scheduled-op-cloud.js +69 -0
  227. package/dist/wave-runtime.mjs +340 -327
  228. package/dist/workspace/ci-lock-grain.d.ts +5 -0
  229. package/dist/workspace/ci-lock-grain.d.ts.map +1 -1
  230. package/dist/workspace/ci-lock-grain.js +1 -7
  231. package/dist/workspace/ci-run.d.ts.map +1 -1
  232. package/dist/workspace/ci-run.js +5 -1
  233. package/dist/workspace/pr-report.schema.json +5 -0
  234. package/package.json +1 -1
  235. package/src/ci-agent.ts +1 -2
  236. package/src/ci-audit/__fixtures__/cloudtrail-lookup-bucket.json +37 -0
  237. package/src/ci-audit/__fixtures__/cloudtrail-writes-window.json +59 -0
  238. package/src/ci-audit/attribution.ts +260 -0
  239. package/src/ci-audit/audit-log.ts +220 -0
  240. package/src/ci-audit/ci-audit.test.ts +175 -0
  241. package/src/ci-audit/index.ts +15 -0
  242. package/src/ci-audit/unrecorded.ts +140 -0
  243. package/src/ci-audit.ts +2 -0
  244. package/src/ci-control.ts +3 -4
  245. package/src/ci-estate.ts +1 -2
  246. package/src/ci-identity-database.test.ts +2 -3
  247. package/src/ci-identity-targets.test.ts +1 -3
  248. package/src/ci-identity.ts +2 -3
  249. package/src/ci-job-guard.test.ts +154 -0
  250. package/src/ci-job-guard.ts +319 -0
  251. package/src/ci-jobs.ts +8 -0
  252. package/src/ci-product-comment-targets.test.ts +45 -0
  253. package/src/ci-product-words.ts +35 -6
  254. package/src/ci-product.ts +55 -3
  255. package/src/ci-respond-run.ts +291 -0
  256. package/src/ci-respond.test.ts +264 -0
  257. package/src/ci-respond.ts +412 -0
  258. package/src/cli/handlers/audit-log.ts +74 -0
  259. package/src/cli/handlers/build-pr-loop-flags.test.ts +98 -0
  260. package/src/cli/handlers/build.ts +69 -0
  261. package/src/cli/handlers/ci-check-job.test.ts +114 -0
  262. package/src/cli/handlers/ci-check-job.ts +33 -0
  263. package/src/cli/handlers/ci-check.ts +38 -8
  264. package/src/cli/handlers/e2e-safe-run.ts +27 -0
  265. package/src/cli/handlers/pr-plan-comment-targets.test.ts +166 -0
  266. package/src/cli/handlers/pr-plan-flags.test.ts +161 -0
  267. package/src/cli/handlers/pr.ts +228 -4
  268. package/src/cli/handlers/run-wave.ts +79 -1
  269. package/src/cli/main.test.ts +1 -1
  270. package/src/cli/main.ts +56 -2
  271. package/src/cli/parse-args.ts +77 -0
  272. package/src/cli/registry.ts +38 -0
  273. package/src/components/adoption.ts +1 -2
  274. package/src/components/capability.ts +50 -0
  275. package/src/components/check-hooks.ts +4 -1
  276. package/src/components/check-steps.test.ts +70 -0
  277. package/src/components/check-steps.ts +158 -0
  278. package/src/components/ci-services.ts +1 -2
  279. package/src/components/driver.ts +35 -1
  280. package/src/components/groups.ts +4 -2
  281. package/src/components/plan-flags.test.ts +46 -0
  282. package/src/components/pr-comment-preview-targets.test.ts +34 -0
  283. package/src/components/pr-env-ledger.ts +1 -2
  284. package/src/components/pr-env-run-bundle.test.ts +0 -20
  285. package/src/components/pr-environment.ts +1 -1
  286. package/src/components/pr-pipeline-runners.test.ts +80 -0
  287. package/src/components/pr-pipeline.ts +232 -17
  288. package/src/components/pr-run.ts +17 -6
  289. package/src/components/pr-stale-job.test.ts +34 -0
  290. package/src/components/product-pipeline.ts +50 -8
  291. package/src/components/wave-plan.ts +18 -2
  292. package/src/e2e-harness/__project__/chant.config.ts +4 -0
  293. package/src/e2e-harness/__project__/src/compose.ts +33 -0
  294. package/src/e2e-harness/bucket.ts +69 -0
  295. package/src/e2e-harness/claim.test.ts +150 -0
  296. package/src/e2e-harness/claim.ts +140 -0
  297. package/src/e2e-harness/driver.test.ts +304 -0
  298. package/src/e2e-harness/driver.ts +294 -0
  299. package/src/e2e-harness/forgejo.ts +267 -0
  300. package/src/e2e-harness/git.ts +96 -0
  301. package/src/e2e-harness/index.ts +50 -0
  302. package/src/e2e-harness/jobs.ts +35 -0
  303. package/src/e2e-harness/pins.ts +52 -0
  304. package/src/e2e-harness/ports.ts +130 -0
  305. package/src/e2e-harness/reports.ts +79 -0
  306. package/src/e2e-harness/safe-run-cli.test.ts +102 -0
  307. package/src/e2e-harness/safe-run-cli.ts +54 -0
  308. package/src/e2e-harness/safe-run.ts +198 -0
  309. package/src/e2e-harness/scenario.ts +89 -0
  310. package/src/e2e-harness/schemas/README.md +62 -0
  311. package/src/e2e-harness/schemas/demo-cycle.schema.json +282 -0
  312. package/src/e2e-harness/schemas/demo-step.schema.json +245 -0
  313. package/src/e2e-harness/schemas/e2e-claim-row.schema.json +33 -0
  314. package/src/e2e-harness/schemas/e2e-claims.schema.json +18 -0
  315. package/src/e2e-harness/schemas/e2e-scenario.schema.json +150 -0
  316. package/src/e2e-harness/schemas/index.ts +220 -0
  317. package/src/e2e-harness/schemas.test.ts +145 -0
  318. package/src/e2e-harness/stack.test.ts +124 -0
  319. package/src/e2e-harness/stack.ts +306 -0
  320. package/src/e2e-harness/steps.ts +30 -0
  321. package/src/e2e-harness.ts +2 -0
  322. package/src/exit-codes.test.ts +3 -2
  323. package/src/exit-codes.ts +7 -1
  324. package/src/gate-decision-bundle.test.ts +0 -2
  325. package/src/lexicon.ts +48 -0
  326. package/src/lifecycle/control-entries-ledger.test.ts +2 -3
  327. package/src/lifecycle/gate-ledger.ts +2 -3
  328. package/src/lifecycle/gated-request.ts +1 -2
  329. package/src/lifecycle/query.ts +4 -5
  330. package/src/lifecycle/release-catalog.test.ts +3 -4
  331. package/src/lifecycle/release-catalog.ts +1 -1
  332. package/src/lifecycle/release-ledger.ts +1 -2
  333. package/src/lifecycle/release-status.test.ts +3 -4
  334. package/src/lifecycle/release-status.ts +1 -2
  335. package/src/lifecycle/wave-plans.ts +33 -5
  336. package/src/op/approval-status.test.ts +134 -0
  337. package/src/op/approval-status.ts +235 -0
  338. package/src/op/gate-review.test.ts +2 -1
  339. package/src/op/index.ts +2 -0
  340. package/src/op/op-waves-after-plan.test.ts +12 -0
  341. package/src/op/op-waves-capability-spec.ts +20 -0
  342. package/src/op/op-waves-parallelism.test.ts +89 -0
  343. package/src/op/op-waves-pull-request.test.ts +78 -1
  344. package/src/op/op-waves-release.ts +1 -2
  345. package/src/op/op-waves-run.ts +94 -4
  346. package/src/op/op-waves-stand-down.ts +1 -2
  347. package/src/op/op-waves.ts +63 -6
  348. package/src/op/runtime.ts +6 -3
  349. package/src/otlp.ts +1 -2
  350. package/src/parallelism.test.ts +38 -0
  351. package/src/parallelism.ts +33 -0
  352. package/src/policy-source.ts +1 -2
  353. package/src/pr-forge-bundle.test.ts +1 -1
  354. package/src/pr-forge.ts +54 -35
  355. package/src/pr-loop-bundle.test.ts +1 -1
  356. package/src/pr-loop-narrowed.test.ts +63 -0
  357. package/src/pr-loop.ts +30 -3
  358. package/src/pr-merge.test.ts +100 -0
  359. package/src/pr-merge.ts +105 -0
  360. package/src/pr-post-stale.test.ts +163 -0
  361. package/src/pr-post.ts +159 -5
  362. package/src/pr-report-url.ts +1 -2
  363. package/src/product-subpaths-plain-node.e2e.test.ts +1 -0
  364. package/src/release-floors.ts +1 -1
  365. package/src/run-event.ts +1 -2
  366. package/src/scheduled-op-cloud.ts +68 -0
  367. package/src/stage-hooks-bundle.test.ts +0 -2
  368. package/src/workspace/ci-lock-grain.ts +1 -2
  369. package/src/workspace/ci-run.ts +5 -1
  370. package/src/workspace/pr-report.schema.json +5 -0
package/src/cli/main.ts CHANGED
@@ -258,6 +258,13 @@ Commands:
258
258
  (--json) its target, stage (planned/emitted/bridged/
259
259
  applied) and path. Read-only.
260
260
 
261
+ E2E harness:
262
+ e2e safe-run [--scan <dir>]... -- <command...>
263
+ Run <command> with no real cloud in reach (cloud credential
264
+ variables unset, empty CLOUDSDK_CONFIG, file:// Pulumi
265
+ backend), then scan its output and each --scan dir. Prints
266
+ CLEAN, or the rejecting lines and exits 3.
267
+
261
268
  CI:
262
269
  ci check --base <rev> [<target>...] [--output <dir>] [--json]
263
270
  Run the ci.hooks.check hooks the workspace declaration
@@ -265,6 +272,11 @@ CI:
265
272
  perRun, with no forge token or cloud credentials in
266
273
  their environment. Writes check-hooks.json under
267
274
  --output (default .chant/check); exits 1 when one failed.
275
+ ci check-job The apply-job guard: compare the forge environment,
276
+ ref and runner the forge gives this job with the
277
+ expectation in CHANT_JOB_GUARD, which a generated
278
+ op-wave job carries. Exits 1, one line per value
279
+ that differs, before any credential is taken.
268
280
  ci forge-check [--env <env>] [--member <name>] [--forge <forge>] [--repo <owner/name>] [--branch <default>] [--require-clouds] [--json]
269
281
  Read the forge, each cloud's trust policy and Pulumi
270
282
  Cloud's OIDC policies against the pipelines
@@ -520,6 +532,13 @@ Ops:
520
532
  --record-plans (no --wave), in a pull request's
521
533
  pipeline: plan every wave at its head and record the
522
534
  digests a pr-review approval mode compares.
535
+ --approval-status (no --wave) --forge <kind>
536
+ --pr <n> --head <sha> --base <sha>, or --open
537
+ [--branch <b>]: post <product>/approval on an open
538
+ pull request's head, pending while a wave its gate
539
+ will hold has no approval: an approving review for
540
+ pr-review, the pull request's own approval covering
541
+ its change set for pull-request (#4630).
523
542
  --waves-outcome (no --wave), after the last wave:
524
543
  print how the wave jobs' outcome files add up
525
544
  (applied, partial, unchanged, waiting, failed), the
@@ -629,6 +648,14 @@ Ops:
629
648
  applies it once, if .chant/overriders at base lists
630
649
  --actor
631
650
 
651
+ audit-log attribute --input <drift.json> [--audit-log aws[:<region>]]
652
+ Name who changed each drifted attribute of a drift
653
+ document: a known write by design, else the cloud
654
+ audit log's last writer (#4632)
655
+ audit-log unrecorded --audit-log aws[:<region>] --op <op>[,...] --since <time>
656
+ Report the audit log's writes no recorded apply on
657
+ the run ledger made; exits 2 when there are some
658
+ (#4632)
632
659
  notify relay Serve the relay that approves a waiting gate from a
633
660
  Slack button or a Teams reply (#4611): verifies the
634
661
  chat signature and the button's notify reference,
@@ -1180,14 +1207,26 @@ Component release ledger + status:
1180
1207
  [--forge github|gitlab|forgejo] posts them);
1181
1208
  --target <address> narrows every member's plan
1182
1209
  to the address, --target <member>:<address>
1183
- one member's (#4620); applies nothing
1210
+ one member's (#4620); --comment-targets adds the
1211
+ --target addresses of the preview comment in
1212
+ CHANT_PREVIEW_COMMENT (#4626); --refresh refreshes
1213
+ each step's state first and --target-dependents
1214
+ plans what depends on each target too, refused
1215
+ by name for a step that cannot (#4627);
1216
+ --parallelism <n> plans at
1217
+ most n members of a wave at once (#4625);
1218
+ applies nothing
1184
1219
  components pr-post Post the plan note and the chant/plan status
1185
1220
  from the report pr-plan --no-status wrote
1186
1221
  (--pr <n> --head <sha> --env <env> --forge
1187
1222
  <kind>), in a job that runs none of the
1188
1223
  change's code (#4295); --open posts every
1189
1224
  open merge request's from a GitLab pipeline
1190
- of the target branch (#4328)
1225
+ of the target branch (#4328); --respond
1226
+ description=check --decide-backend <name>
1227
+ --decide-model <id> asks whether the
1228
+ description leaves out a destroy or a
1229
+ replacement and posts the finding (#4629)
1191
1230
  components pr-record On merge (#4168): plan the same members again,
1192
1231
  store the change set and write the merge record
1193
1232
  _merges/<commit>.json; applies and refuses
@@ -1234,6 +1273,14 @@ Component release ledger + status:
1234
1273
  approved, mergeable, undiverged and green;
1235
1274
  --requires <list> asks only the checks it
1236
1275
  names (approved,mergeable,undiverged,checks);
1276
+ --merge auto --merge-token-env <VAR> merges the
1277
+ pull request once every member applied and the
1278
+ records are pushed, with that token alone and
1279
+ the applied head checked again (#4636);
1280
+ --respond <list> turns the failed apply's
1281
+ triage and the refused apply's diff on or off
1282
+ (wave-refused=diff|off,apply-failed=triage|off,
1283
+ #4629);
1237
1284
  --events-json, both commands: the run-event
1238
1285
  stream on stdout; --report-url <s3 or file URL>,
1239
1286
  both commands: copy the report, the change set
@@ -1722,6 +1769,9 @@ export const commandRegistry: CommandDef[] = [
1722
1769
  // renderer replaces its own walk-and-guess discovery with. Read-only.
1723
1770
  { name: "carve status", handler: runCarveStatus },
1724
1771
  // #3573 — which commits passed CI, kept as ci/green and ci/revoked tags (ws-103). Imported on first use.
1772
+ // chant#4587 (C1) — the e2e harness's no-real-cloud wrapper as a command, for bash drivers. Imported on first use.
1773
+ { name: "e2e safe-run", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/e2e-safe-run")).runE2eSafeRun(ctx) },
1774
+ { name: "e2e", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/e2e-safe-run")).runE2eUnknown(ctx) },
1725
1775
  { name: "ci last-green", runsNoConfig: true, handler: async (ctx) => (await import("../workspace/ci-green-cli")).runCiLastGreen(ctx) },
1726
1776
  { name: "ci list", runsNoConfig: true, handler: async (ctx) => (await import("../workspace/ci-green-cli")).runCiList(ctx) },
1727
1777
  { name: "ci tick", runsNoConfig: true, handler: async (ctx) => (await import("../workspace/ci-green-cli")).runCiTick(ctx) },
@@ -1730,6 +1780,8 @@ export const commandRegistry: CommandDef[] = [
1730
1780
  // #4556: the ci.hooks.check hooks at base, for a product's check job.
1731
1781
  { name: "ci check", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/ci-check")).runCiCheck(ctx) },
1732
1782
  // #4608: the live forge, cloud trust policies and Pulumi Cloud's OIDC policies against ci.identity.cloud. Read-only.
1783
+ // #4624: the apply-job guard, from the expectation the job carries.
1784
+ { name: "ci check-job", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/ci-check-job")).runCiCheckJob(ctx) },
1733
1785
  { name: "ci forge-check", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/ci-forge-check")).runCiForgeCheck(ctx) },
1734
1786
  // #4094: one pull-request job as a pipeline Op in a fresh checkout, the chant runner's first slice.
1735
1787
  { name: "ci run", runsNoConfig: true, handler: async (ctx) => (await import("../workspace/ci-run")).runCiRun(ctx) },
@@ -1790,6 +1842,8 @@ export const commandRegistry: CommandDef[] = [
1790
1842
  { name: "approve", handler: runApprove },
1791
1843
  // #4293 — target locks a pull request holds on chant/lifecycle. Imported on first use.
1792
1844
  // #4611 — approve a waiting gate from a chat click. Imported on first use.
1845
+ { name: "audit-log attribute", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/audit-log")).runAuditLogAttribute(ctx) },
1846
+ { name: "audit-log unrecorded", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/audit-log")).runAuditLogUnrecorded(ctx) },
1793
1847
  { name: "notify relay", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/notify-relay")).runNotifyRelay(ctx) },
1794
1848
  { name: "lock", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/lock")).runLock(ctx) },
1795
1849
  { name: "unlock", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/lock")).runUnlock(ctx) },
@@ -97,6 +97,7 @@ const BOOLEAN_FLAGS = new Set([
97
97
  "--generated",
98
98
  "--decide",
99
99
  "--record-plans",
100
+ "--approval-status",
100
101
  "--waves-outcome",
101
102
  "--loopback",
102
103
  "--artifacts",
@@ -239,6 +240,11 @@ export function parseArgs(args: string[]): ParsedArgs {
239
240
  const v = args[++i];
240
241
  if (v !== "source" && v !== "live") throw new Error(`--overlay-anchor must be 'source' or 'live', got '${v}'`);
241
242
  result.overlayAnchor = v;
243
+ } else if (arg === "--scan") {
244
+ // `chant e2e safe-run --scan <dir> -- <command...>` (chant#4587), repeatable.
245
+ const v = args[++i];
246
+ if (v === undefined || v === "--" || v.startsWith("--")) throw new Error("--scan needs a directory: --scan <dir>");
247
+ (result.scanDirs ??= []).push(v);
242
248
  } else if (arg === "--from") {
243
249
  // Shared by `migrate --from <lexicon>`, `import --from <env>`,
244
250
  // `components promote --from <env>`, `init --from <repo>@<ref>` and
@@ -452,6 +458,9 @@ export function parseArgs(args: string[]): ParsedArgs {
452
458
  result.decide = true;
453
459
  } else if (arg === "--record-plans") {
454
460
  result.recordPlans = true;
461
+ } else if (arg === "--approval-status") {
462
+ // `chant run wave --spec <file> --approval-status` (#4630): post <product>/approval on an open pull request's head.
463
+ result.approvalStatus = true;
455
464
  } else if (arg === "--waves-outcome") {
456
465
  result.wavesOutcome = true;
457
466
  } else if (arg === "--group") {
@@ -469,6 +478,21 @@ export function parseArgs(args: string[]): ParsedArgs {
469
478
  const raw = args[++i];
470
479
  if (!raw || raw.startsWith("-")) throw new Error("--target needs an address: --target <component>:<address>, or on pr-plan --target <address>");
471
480
  (result.targets ??= []).push(raw);
481
+ } else if (arg === "--refresh") {
482
+ // `chant components pr-plan --refresh` (#4627).
483
+ result.refresh = true;
484
+ } else if (arg === "--target-dependents") {
485
+ // `chant components pr-plan --target-dependents` (#4627).
486
+ result.targetDependents = true;
487
+ } else if (arg === "--comment-targets") {
488
+ // `chant components pr-plan --comment-targets` (#4626): the preview comment's --target addresses.
489
+ result.commentTargets = true;
490
+ } else if (arg === "--parallelism") {
491
+ // `chant components pr-plan --parallelism <n>` (#4625): members of a wave planned at once.
492
+ const raw = args[++i];
493
+ const n = Number(raw);
494
+ if (!Number.isInteger(n) || n < 1) throw new Error(`--parallelism needs a whole number of 1 or more: got "${raw ?? ""}"`);
495
+ result.parallelism = n;
472
496
  } else if (arg === "--canary") {
473
497
  const raw = args[++i];
474
498
  if (!raw || raw.startsWith("-")) throw new Error("--canary needs a component name: --canary <name>[,<name>...]");
@@ -542,6 +566,28 @@ export function parseArgs(args: string[]): ParsedArgs {
542
566
  const value = args[++i];
543
567
  if (value === undefined || value.startsWith("-")) throw new Error("--requires needs a list of checks: --requires approved,mergeable,undiverged,checks");
544
568
  result.requires = value.split(",").map((v) => v.trim()).filter(Boolean);
569
+ } else if (arg === "--respond") {
570
+ // `chant components pr-apply|pr-post --respond wave-refused=off,description=check` (#4629).
571
+ const value = args[++i];
572
+ if (value === undefined || value.startsWith("-")) throw new Error("--respond needs a list of responses: --respond wave-refused=diff,apply-failed=off,description=check");
573
+ result.respond = [...(result.respond ?? []), value];
574
+ } else if (arg === "--decide-backend") {
575
+ // `chant components pr-post --decide-backend <name>` (#4629): the description check's backend.
576
+ const value = args[++i];
577
+ if (value === undefined || value.startsWith("-")) throw new Error("--decide-backend needs the name of a decide.backends entry");
578
+ result.decideBackend = value;
579
+ } else if (arg === "--decide-model") {
580
+ // `chant components pr-post --decide-model <id>` (#4629): the description check's pinned model.
581
+ const value = args[++i];
582
+ if (value === undefined || value.startsWith("-")) throw new Error("--decide-model needs a model id");
583
+ result.decideModel = value;
584
+ } else if (arg === "--merge" || arg === "--merge-token-env" || arg === "--merge-method") {
585
+ // `chant components pr-apply --before-merge --merge auto --merge-token-env <VAR>` (#4636).
586
+ const value = args[++i];
587
+ if (value === undefined || value.startsWith("-")) throw new Error(`${arg} needs a value: --merge manual|auto, --merge-token-env <VAR>, --merge-method merge|squash|rebase`);
588
+ if (arg === "--merge") result.merge = value;
589
+ else if (arg === "--merge-token-env") result.mergeTokenEnv = value;
590
+ else result.mergeMethod = value;
545
591
  } else if (arg === "--apply-before-merge") {
546
592
  // `chant build --pr-loop --apply-before-merge` and `chant ci run apply --apply-before-merge` (#4301): the job that applies before merge.
547
593
  result.applyBeforeMerge = true;
@@ -554,6 +600,21 @@ export function parseArgs(args: string[]): ParsedArgs {
554
600
  } else if (arg === "--pr-env") {
555
601
  // `chant build --pr-loop --pr-env` (#4298): add the pull request environment's jobs.
556
602
  result.prEnv = true;
603
+ } else if (arg === "--pr-runner") {
604
+ // `chant build --pr-loop --pr-runner <stage>=<label>[,<label>...]` (#4625).
605
+ const raw = args[++i] ?? "";
606
+ const m = /^(plan|apply|default)=(.+)$/.exec(raw);
607
+ if (!m) throw new Error(`--pr-runner needs <stage>=<label>[,<label>...], the stage plan, apply or default: got "${raw}"`);
608
+ const labels = m[2]!.split(",").map((l) => l.trim()).filter(Boolean);
609
+ if (labels.length === 0) throw new Error(`--pr-runner ${m[1]} names no label`);
610
+ (result.prRunners ??= {})[m[1] as "plan" | "apply" | "default"] = labels;
611
+ } else if (arg === "--pr-variable" || arg === "--pr-secret") {
612
+ // `chant build --pr-loop --pr-variable <NAME>=<value>` and `--pr-secret <NAME>=<secret>` (#4625).
613
+ const raw = args[++i] ?? "";
614
+ const at = raw.indexOf("=");
615
+ if (at < 1) throw new Error(`${arg} needs <NAME>=<${arg === "--pr-secret" ? "secret" : "value"}>: got "${raw}"`);
616
+ const into = arg === "--pr-secret" ? (result.prSecrets ??= {}) : (result.prVariables ??= {});
617
+ into[raw.slice(0, at)] = raw.slice(at + 1);
557
618
  } else if (arg === "--pr-build") {
558
619
  // `chant build --pr-loop --pr-build` (#4088), and `chant ci run --pr-build` (#4094).
559
620
  result.prBuild = true;
@@ -776,6 +837,17 @@ export function parseArgs(args: string[]): ParsedArgs {
776
837
  if (!result.by || result.by.startsWith("-")) throw new Error("--by needs the reviewer: --by <principal>");
777
838
  // Repeatable for `workspace points answer` (#2739): each person who answered.
778
839
  (result.bys ??= []).push(result.by);
840
+ } else if (arg === "--stale-notes") {
841
+ // `chant build --pr-loop --stale-notes` (#4628).
842
+ result.staleNotes = true;
843
+ } else if (arg === "--stale") {
844
+ // `chant components pr-post --stale` (#4628).
845
+ result.stale = true;
846
+ } else if (arg === "--tip") {
847
+ // `chant components pr-post --tip <sha>` (#4628).
848
+ const raw = args[++i];
849
+ if (!raw || !/^[0-9a-f]{40}$/.test(raw)) throw new Error(`--tip needs the target branch's full commit sha: got "${raw ?? ""}"`);
850
+ result.tip = raw;
779
851
  } else if (arg === "--open") {
780
852
  // `chant workspace points --open` (#2739): only the questions still open.
781
853
  result.open = true;
@@ -1104,6 +1176,11 @@ export function parseArgs(args: string[]): ParsedArgs {
1104
1176
  result.resource = value;
1105
1177
  } else if (arg === "--since") {
1106
1178
  result.since = args[++i];
1179
+ } else if (arg === "--audit-log") {
1180
+ // `chant audit-log attribute|unrecorded --audit-log aws[:<region>]` (#4632).
1181
+ const value = args[++i];
1182
+ if (!value || value.startsWith("-")) throw new Error("--audit-log needs the log: --audit-log aws[:<region>]");
1183
+ result.auditLog = value;
1107
1184
  } else if (arg === "--limit") {
1108
1185
  // Parsed here, validated by the handler — `parseArgs` reports shape, not
1109
1186
  // policy, the same split every other value flag here uses.
@@ -89,6 +89,8 @@ export interface ParsedArgs {
89
89
  kustomize?: string;
90
90
  /** `chant import --parser-option key[=value]`, repeatable (#2994): options for the lexicon's template parser */
91
91
  parserOption?: string[];
92
+ /** `chant e2e safe-run --scan <dir>`, repeatable (chant#4587): a directory to scan for a real cloud answering, beside the command's output */
93
+ scanDirs?: string[];
92
94
  /** `chant carve advise --state <path>` — opt-in .tfstate for accurate instance counts */
93
95
  statePath?: string;
94
96
  /** Every `--state` value in order (#4461): `chant workspace promote --all --state <member>=<path>`, repeatable. */
@@ -318,6 +320,8 @@ export interface ParsedArgs {
318
320
  decide?: boolean;
319
321
  /** `chant run wave --record-plans` (#3684) — plan every wave at a pull request's head and record the digests for a `pr-review` gate. */
320
322
  recordPlans?: boolean;
323
+ /** `chant run wave --approval-status` (#4630) — post `<product>/approval` on an open pull request's head under `pr-review` or `pull-request`. */
324
+ approvalStatus?: boolean;
321
325
  /** `chant run wave --waves-outcome` (#4617) — print how every wave job's outcome file adds up: the outcome a control dispatch carries. */
322
326
  wavesOutcome?: boolean;
323
327
  /** `chant run wave --share <i>` (#3679) — apply share `i` of a decided wide wave. */
@@ -333,6 +337,14 @@ export interface ParsedArgs {
333
337
  * (`prPlanTargets`).
334
338
  */
335
339
  targets?: string[];
340
+ /** `chant components pr-plan --comment-targets` (#4626): narrow to the `--target` addresses of the preview comment in CHANT_PREVIEW_COMMENT. */
341
+ commentTargets?: boolean;
342
+ /** `chant components pr-plan --refresh` (#4627): refresh each step's state before it plans. */
343
+ refresh?: boolean;
344
+ /** `chant components pr-plan --target-dependents` (#4627): plan what depends on each --target too. */
345
+ targetDependents?: boolean;
346
+ /** `chant components pr-plan --parallelism <n>` (#4625): how many members of a wave plan at once. */
347
+ parallelism?: number;
336
348
  /** `chant components fan-out --canary <component>` (#3049), repeatable — components that form wave 1. */
337
349
  canary?: string[];
338
350
  /**
@@ -409,6 +421,18 @@ export interface ParsedArgs {
409
421
  * and checks. Absent: all four. A check left out passes as "not required".
410
422
  */
411
423
  requires?: string[];
424
+ /** `pr-apply --before-merge --merge manual|auto` (#4636): who merges once the update applied. `chant build --pr-loop --apply-before-merge --merge auto` puts it on the generated apply job. */
425
+ merge?: string;
426
+ /** `pr-apply --merge auto --merge-token-env <VAR>` (#4636): the variable holding the only token the merge uses. */
427
+ mergeTokenEnv?: string;
428
+ /** `pr-apply --merge auto --merge-method merge|squash|rebase` (#4636). */
429
+ mergeMethod?: string;
430
+ /** `--respond wave-refused=off,description=check` (#4629): the responses pr-apply, pr-post and the wave jobs post. `chant build --pr-loop --respond` sets them on the generated apply and note jobs as CHANT_RESPOND. */
431
+ respond?: string[];
432
+ /** `pr-post --decide-backend <name>` (#4629): the `decide.backends` entry the description check asks. `chant build --pr-loop` passes it to the note job. */
433
+ decideBackend?: string;
434
+ /** `pr-post --decide-model <id>` (#4629): the pinned model the description check asks. */
435
+ decideModel?: string;
412
436
  /**
413
437
  * `chant build --pr-loop --apply-before-merge` and `chant ci run apply
414
438
  * --apply-before-merge` (#4301): the pipeline's apply job applies an open
@@ -419,6 +443,12 @@ export interface ParsedArgs {
419
443
  previewComment?: boolean;
420
444
  /** `chant build --pr-loop --pr-build` (#4088) — build and lint before pr-plan and pr-apply. */
421
445
  prBuild?: boolean;
446
+ /** `chant build --pr-loop --pr-runner <stage>=<label>[,<label>...]` (#4625), repeatable: a stage's runner, plan, apply or default. */
447
+ prRunners?: Partial<Record<"plan" | "apply" | "default", string[]>>;
448
+ /** `chant build --pr-loop --pr-variable <NAME>=<value>` (#4625), repeatable: a variable of the jobs that plan or apply. */
449
+ prVariables?: Record<string, string>;
450
+ /** `chant build --pr-loop --pr-secret <NAME>=<secret>` (#4625), repeatable: a secret passed to the jobs that plan or apply. */
451
+ prSecrets?: Record<string, string>;
422
452
  /** `chant ci serve --build-command <line>` (#4169) — the line that builds a commit a `ci/build/<sha>` tag asks for, in a worktree of it. */
423
453
  ciBuildCommand?: string;
424
454
  /** `chant ci serve --land` (#4168 4.4) — fast-forward the target branch to each pushed `chant/land/<name>` branch whose `ci.green.preMerge` phases pass on it. */
@@ -519,6 +549,12 @@ export interface ParsedArgs {
519
549
  bys?: string[];
520
550
  /** `chant workspace points --open` (#2739): only the questions still open. */
521
551
  open?: boolean;
552
+ /** `chant build --pr-loop --stale-notes` (#4628): the note carries its target commit, and a push to the target branch marks open notes stale. */
553
+ staleNotes?: boolean;
554
+ /** `chant components pr-post --stale` (#4628): mark the open pull requests' notes stale after the target branch moved. */
555
+ stale?: boolean;
556
+ /** `chant components pr-post --tip <sha>` (#4628): the target branch's commit, which the note carries, or with --stale its commit now. */
557
+ tip?: string;
522
558
  /** `chant workspace points ask <point> --inputs <file|-|json>` (#2739): the inputs, as a JSON object. */
523
559
  inputs?: string;
524
560
  /** `chant workspace points ask <point> --candidates <file|-|json>` (#3403): an ad-hoc point's question and candidates. */
@@ -867,6 +903,8 @@ export interface ParsedArgs {
867
903
  op?: string;
868
904
  /** `chant operator log --since <iso>` (#2029) — only entries at or after this ISO-8601 instant. `chant workspace records --since <rev>` (#2673) — the revision to compare the records with. `chant workspace metrics --since <date>` (#4039) — the start of the window the metrics count. */
869
905
  since?: string;
906
+ /** `chant audit-log attribute|unrecorded --audit-log aws[:<region>]` (#4632): the cloud audit log to read. */
907
+ auditLog?: string;
870
908
  /** `chant ledger`, `chant workspace records` and `chant workspace runs --where <field><op><value>` (#4363): typed filters, repeatable, all of which have to hold. */
871
909
  where?: string[];
872
910
  /** `chant operator log --limit <n>` (#2029) — keep only the newest n entries (still printed oldest-first). */
@@ -17,13 +17,12 @@
17
17
  */
18
18
  import { existsSync, readFileSync } from "node:fs";
19
19
  import { resolve } from "node:path";
20
- import { NEXT_RELEASE } from "../release-floors";
21
20
  import type { ChangeSetEntry } from "../change-set";
22
21
  import { adoptionFileProblems, adoptionFileProblemsAgainst, type AdoptionFile } from "../lifecycle/adoption-file";
23
22
  import type { IndexDocument } from "../lifecycle/index-document";
24
23
 
25
24
  /** The first chant whose `run --components` takes `--adopt`. */
26
- export const DEPLOY_ADOPT_FLOOR = NEXT_RELEASE;
25
+ export const DEPLOY_ADOPT_FLOOR = "0.124.55";
27
26
 
28
27
  /** One change set the adoption asks to execute. */
29
28
  export interface AdoptionReviewRequest {
@@ -86,6 +86,20 @@ export interface DeployContext {
86
86
  * component refuses before anything plans or runs. Absent: the whole step.
87
87
  */
88
88
  targets?: string[];
89
+ /**
90
+ * `pr-plan --refresh` (#4627): refresh the step's state from the live
91
+ * system before it plans, as `pulumi preview --refresh` does. A step's
92
+ * capability must accept it ({@link Capability.planFlags}), or the
93
+ * component refuses before anything plans. Bound into the member's digest.
94
+ */
95
+ refresh?: boolean;
96
+ /**
97
+ * `pr-plan --target-dependents` (#4627): with `targets`, plan the
98
+ * resources that depend on them too, as `pulumi preview
99
+ * --target-dependents` does. Accepted or refused as `refresh` is. Bound
100
+ * into the member's digest.
101
+ */
102
+ targetDependents?: boolean;
89
103
  /**
90
104
  * `--adopt <adoption-file>` (#4537): the resources to adopt into this
91
105
  * component's stack, the index version they come from, and the review
@@ -281,6 +295,12 @@ export interface Capability<In = unknown, Out = unknown> {
281
295
  * why. Unset refuses too, with a reason that names the verb.
282
296
  */
283
297
  readonly targets?: TargetSupport;
298
+ /**
299
+ * Whether this verb's plan takes `DeployContext.refresh` and
300
+ * `DeployContext.targetDependents` (#4627), each `"accept"` or `{ refuse
301
+ * }` with why, as {@link targets} is. Unset refuses, naming the verb.
302
+ */
303
+ readonly planFlags?: Partial<Record<PlanFlag, TargetSupport>>;
284
304
  /**
285
305
  * Optional (#4435, ws-107): why this capability will not plan and apply
286
306
  * `members` as one group, or `undefined` when it will. Core asks before
@@ -561,6 +581,36 @@ export type RollbackPolicy = "native" | "none-by-design" | "needs-opt-out";
561
581
  /** Whether a capability accepts `DeployContext.targets` (#4300). See `Capability.targets`. */
562
582
  export type TargetSupport = "accept" | { refuse: string };
563
583
 
584
+ /** A plan flag a capability accepts or refuses (#4627): `refresh` and `targetDependents`. */
585
+ export type PlanFlag = "refresh" | "targetDependents";
586
+
587
+ /** Each plan flag as `pr-plan` spells it (#4627). */
588
+ export const PLAN_FLAG_ARGS: Record<PlanFlag, string> = { refresh: "--refresh", targetDependents: "--target-dependents" };
589
+
590
+ /**
591
+ * A component was asked to plan with a flag (#4627) one of its steps'
592
+ * capabilities refuses. Nothing in the component plans.
593
+ */
594
+ export class PlanFlagRefusedError extends Error {
595
+ constructor(
596
+ readonly component: string,
597
+ readonly kind: string,
598
+ readonly flag: PlanFlag,
599
+ readonly reason: string,
600
+ ) {
601
+ super(`component "${component}": ${kind} refuses ${PLAN_FLAG_ARGS[flag]}: ${reason}`);
602
+ this.name = "PlanFlagRefusedError";
603
+ }
604
+ }
605
+
606
+ /** Why `capability` refuses `flag`, or `undefined` when it accepts it (#4627). */
607
+ export function planFlagRefusal(capability: Pick<Capability<never, unknown>, "kind" | "planFlags">, flag: PlanFlag): string | undefined {
608
+ const t = capability.planFlags?.[flag];
609
+ if (t === "accept") return undefined;
610
+ if (t && typeof t === "object" && typeof t.refuse === "string") return t.refuse;
611
+ return `${capability.kind} does not say it can plan with ${PLAN_FLAG_ARGS[flag]}`;
612
+ }
613
+
564
614
  /**
565
615
  * A component was asked to narrow to targets (#4300) and one of its steps'
566
616
  * capabilities refuses them. Nothing in the component plans or runs.
@@ -30,6 +30,7 @@ import { setProperty, valueAt } from "../workspace/json-edit";
30
30
  import { parseJsonText } from "../workspace/jsonc";
31
31
  import { memberAtCwd } from "../workspace/security";
32
32
  import { locateWorkspace } from "../workspace/which-chant";
33
+ import type { CheckStepOutcome } from "./check-steps";
33
34
 
34
35
  export { CI_CHECK_HOOK_FLOOR } from "../op/op-waves";
35
36
 
@@ -134,7 +135,9 @@ export interface CheckHooksReport {
134
135
  /** `none`: no check hook is declared at base. */
135
136
  status: "passed" | "failed" | "none";
136
137
  hooks: CheckHookOutcome[];
137
- /** The first hook that failed, and why; the hooks after it did not run. */
138
+ /** The lexicons' check steps (#4633, `./check-steps.ts`), when any ran. */
139
+ steps?: CheckStepOutcome[];
140
+ /** The first hook that failed, and why; the hooks after it did not run. Or the check steps that failed. */
138
141
  failed?: string;
139
142
  note?: string;
140
143
  }
@@ -0,0 +1,70 @@
1
+ import { mkdtempSync, readFileSync } from "node:fs";
2
+ import { tmpdir } from "node:os";
3
+ import { join } from "node:path";
4
+ import { describe, expect, test } from "vitest";
5
+ import { runCheckStage, runCheckSteps, type CheckStepsAdapter } from "./check-steps";
6
+
7
+ const members = [
8
+ { name: "web", dir: "/w/web", kind: "pulumi", fields: null },
9
+ { name: "net", dir: "/w/net", kind: "choudoufu", fields: null },
10
+ ];
11
+
12
+ function adapter(outcome: "passed" | "failed", seen: string[] = []): CheckStepsAdapter {
13
+ return {
14
+ lexicon: "fake",
15
+ kinds: ["pulumi"],
16
+ async run(ctx) {
17
+ seen.push(...ctx.members.map((m) => m.name), `env:${Object.keys(ctx.env).sort().join(",")}`);
18
+ return ctx.members.map((m) => ({ lexicon: "fake", step: "install", member: m.name, stack: "dev", exit: outcome === "passed" ? 0 : 2, outcome, ...(outcome === "failed" ? { reason: `install failed for member ${m.name}, stack dev` } : {}) }));
19
+ },
20
+ };
21
+ }
22
+
23
+ describe("lexicon check steps (#4633)", () => {
24
+ test("an adapter runs for the members of its kinds only", async () => {
25
+ const seen: string[] = [];
26
+ const out = await runCheckSteps({ adapters: [adapter("passed", seen)], members, env: { PATH: "/bin" }, log: () => {} });
27
+ expect(seen).toEqual(["web", "env:PATH"]);
28
+ expect(out).toEqual([expect.objectContaining({ member: "web", outcome: "passed" })]);
29
+ });
30
+
31
+ test("an adapter that throws fails each of its members, naming the lexicon", async () => {
32
+ const broken: CheckStepsAdapter = { lexicon: "fake", kinds: ["pulumi"], run: async () => { throw new Error("boom"); } };
33
+ const out = await runCheckSteps({ adapters: [broken], members, env: {}, log: () => {} });
34
+ expect(out).toEqual([expect.objectContaining({ member: "web", outcome: "failed", reason: "the fake check steps for web could not run: boom" })]);
35
+ });
36
+
37
+ test("the stage runs the steps after passing hooks, and the report carries both", async () => {
38
+ const cwd = mkdtempSync(join(tmpdir(), "chant-check-steps-"));
39
+ const report = await runCheckStage({
40
+ base: "abc123",
41
+ cwd,
42
+ read: { base: "abc123", hooks: [{ name: "fmt", command: ["fmt"] }] },
43
+ exec: () => 0,
44
+ adapters: [adapter("failed")],
45
+ members,
46
+ env: { GITHUB_TOKEN: "t" },
47
+ log: () => {},
48
+ });
49
+ expect(report.status).toBe("failed");
50
+ expect(report.hooks.map((h) => h.outcome)).toEqual(["passed"]);
51
+ expect(report.failed).toBe("a check step failed: install failed for member web, stack dev");
52
+ const written = JSON.parse(readFileSync(join(cwd, ".chant/check/check-hooks.json"), "utf8"));
53
+ expect(written.steps).toHaveLength(1);
54
+ });
55
+
56
+ test("a failed hook stops the stage before the steps", async () => {
57
+ const seen: string[] = [];
58
+ const cwd = mkdtempSync(join(tmpdir(), "chant-check-steps-"));
59
+ const report = await runCheckStage({ base: "abc", cwd, read: { base: "abc", hooks: [{ name: "lint", command: ["lint"] }] }, exec: () => 1, adapters: [adapter("passed", seen)], members, log: () => {} });
60
+ expect(report.status).toBe("failed");
61
+ expect(report.steps).toBeUndefined();
62
+ expect(seen).toEqual([]);
63
+ });
64
+
65
+ test("with no hooks and no members of the adapter's kinds, nothing ran", async () => {
66
+ const cwd = mkdtempSync(join(tmpdir(), "chant-check-steps-"));
67
+ const report = await runCheckStage({ base: "abc", cwd, read: { base: "abc", hooks: [] }, adapters: [adapter("passed")], members: [members[1]!], log: () => {} });
68
+ expect(report.status).toBe("none");
69
+ });
70
+ });