@intentius/chant 0.124.87 → 0.124.89

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 (483) hide show
  1. package/dist/action-pins.d.ts +1 -0
  2. package/dist/action-pins.d.ts.map +1 -1
  3. package/dist/action-pins.js +2 -0
  4. package/dist/actor.d.ts +47 -0
  5. package/dist/actor.d.ts.map +1 -0
  6. package/dist/actor.js +56 -0
  7. package/dist/bundle-check.d.ts +20 -5
  8. package/dist/bundle-check.d.ts.map +1 -1
  9. package/dist/bundle-check.js +20 -5
  10. package/dist/chant-install.d.ts +98 -0
  11. package/dist/chant-install.d.ts.map +1 -1
  12. package/dist/chant-install.js +203 -2
  13. package/dist/ci-base.d.ts +30 -0
  14. package/dist/ci-base.d.ts.map +1 -0
  15. package/dist/ci-base.js +33 -0
  16. package/dist/ci-comment-commands.d.ts +177 -0
  17. package/dist/ci-comment-commands.d.ts.map +1 -0
  18. package/dist/ci-comment-commands.js +325 -0
  19. package/dist/ci-comment-replies.d.ts +40 -0
  20. package/dist/ci-comment-replies.d.ts.map +1 -0
  21. package/dist/ci-comment-replies.js +59 -0
  22. package/dist/ci-commit.d.ts +1 -1
  23. package/dist/ci-commit.d.ts.map +1 -1
  24. package/dist/ci-commit.js +1 -2
  25. package/dist/ci-control.d.ts +1 -1
  26. package/dist/ci-control.d.ts.map +1 -1
  27. package/dist/ci-control.js +1 -1
  28. package/dist/ci-evidence-claims.d.ts +59 -0
  29. package/dist/ci-evidence-claims.d.ts.map +1 -0
  30. package/dist/ci-evidence-claims.js +87 -0
  31. package/dist/ci-evidence-from-job.d.ts +128 -0
  32. package/dist/ci-evidence-from-job.d.ts.map +1 -0
  33. package/dist/ci-evidence-from-job.js +203 -0
  34. package/dist/ci-evidence-jobs.d.ts +68 -4
  35. package/dist/ci-evidence-jobs.d.ts.map +1 -1
  36. package/dist/ci-evidence-jobs.js +82 -5
  37. package/dist/ci-handover.d.ts +12 -0
  38. package/dist/ci-handover.d.ts.map +1 -1
  39. package/dist/ci-handover.js +15 -3
  40. package/dist/ci-identity.d.ts +32 -6
  41. package/dist/ci-identity.d.ts.map +1 -1
  42. package/dist/ci-identity.js +40 -8
  43. package/dist/ci-image.d.ts +65 -10
  44. package/dist/ci-image.d.ts.map +1 -1
  45. package/dist/ci-image.js +101 -22
  46. package/dist/ci-jobs.d.ts +1 -1
  47. package/dist/ci-jobs.d.ts.map +1 -1
  48. package/dist/ci-jobs.js +7 -2
  49. package/dist/ci-login.d.ts +75 -13
  50. package/dist/ci-login.d.ts.map +1 -1
  51. package/dist/ci-login.js +89 -37
  52. package/dist/ci-note-commands.d.ts +63 -3
  53. package/dist/ci-note-commands.d.ts.map +1 -1
  54. package/dist/ci-note-commands.js +69 -35
  55. package/dist/ci-product-words.d.ts +62 -1
  56. package/dist/ci-product-words.d.ts.map +1 -1
  57. package/dist/ci-product-words.js +52 -1
  58. package/dist/ci-product.d.ts +52 -2
  59. package/dist/ci-product.d.ts.map +1 -1
  60. package/dist/ci-product.js +51 -2
  61. package/dist/cli/commands/build.d.ts.map +1 -1
  62. package/dist/cli/commands/build.js +29 -2
  63. package/dist/cli/handlers/approve-confirm.d.ts +14 -0
  64. package/dist/cli/handlers/approve-confirm.d.ts.map +1 -1
  65. package/dist/cli/handlers/approve-confirm.js +46 -0
  66. package/dist/cli/handlers/approve.d.ts.map +1 -1
  67. package/dist/cli/handlers/approve.js +2 -1
  68. package/dist/cli/handlers/build.d.ts +1 -1
  69. package/dist/cli/handlers/build.d.ts.map +1 -1
  70. package/dist/cli/handlers/build.js +22 -1
  71. package/dist/cli/handlers/ci-check.d.ts +1 -1
  72. package/dist/cli/handlers/ci-check.d.ts.map +1 -1
  73. package/dist/cli/handlers/ci-check.js +37 -7
  74. package/dist/cli/handlers/ci-evidence.d.ts.map +1 -1
  75. package/dist/cli/handlers/ci-evidence.js +255 -20
  76. package/dist/cli/handlers/ci-forge-check.d.ts.map +1 -1
  77. package/dist/cli/handlers/ci-forge-check.js +34 -17
  78. package/dist/cli/handlers/components.d.ts.map +1 -1
  79. package/dist/cli/handlers/components.js +3 -1
  80. package/dist/cli/handlers/generated-check.d.ts +11 -0
  81. package/dist/cli/handlers/generated-check.d.ts.map +1 -0
  82. package/dist/cli/handlers/generated-check.js +71 -0
  83. package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
  84. package/dist/cli/handlers/lifecycle.js +3 -0
  85. package/dist/cli/handlers/local-chant.d.ts +13 -0
  86. package/dist/cli/handlers/local-chant.d.ts.map +1 -1
  87. package/dist/cli/handlers/local-chant.js +42 -1
  88. package/dist/cli/handlers/lock.d.ts.map +1 -1
  89. package/dist/cli/handlers/lock.js +121 -4
  90. package/dist/cli/handlers/pr-comment.d.ts +21 -0
  91. package/dist/cli/handlers/pr-comment.d.ts.map +1 -0
  92. package/dist/cli/handlers/pr-comment.js +112 -0
  93. package/dist/cli/handlers/pr-env.d.ts.map +1 -1
  94. package/dist/cli/handlers/pr-env.js +6 -3
  95. package/dist/cli/handlers/pr.d.ts +23 -1
  96. package/dist/cli/handlers/pr.d.ts.map +1 -1
  97. package/dist/cli/handlers/pr.js +97 -14
  98. package/dist/cli/handlers/promote.d.ts.map +1 -1
  99. package/dist/cli/handlers/promote.js +2 -1
  100. package/dist/cli/handlers/release.d.ts.map +1 -1
  101. package/dist/cli/handlers/release.js +11 -2
  102. package/dist/cli/handlers/run-wave.d.ts.map +1 -1
  103. package/dist/cli/handlers/run-wave.js +36 -2
  104. package/dist/cli/handlers/run.d.ts.map +1 -1
  105. package/dist/cli/handlers/run.js +2 -1
  106. package/dist/cli/main.d.ts.map +1 -1
  107. package/dist/cli/main.js +60 -4
  108. package/dist/cli/parse-args.d.ts.map +1 -1
  109. package/dist/cli/parse-args.js +82 -0
  110. package/dist/cli/registry.d.ts +35 -0
  111. package/dist/cli/registry.d.ts.map +1 -1
  112. package/dist/components/auto-release.d.ts.map +1 -1
  113. package/dist/components/auto-release.js +2 -1
  114. package/dist/components/check-hooks.d.ts +10 -0
  115. package/dist/components/check-hooks.d.ts.map +1 -1
  116. package/dist/components/check-hooks.js +18 -0
  117. package/dist/components/pr-checks.d.ts +169 -0
  118. package/dist/components/pr-checks.d.ts.map +1 -0
  119. package/dist/components/pr-checks.js +180 -0
  120. package/dist/components/pr-pipeline.d.ts +38 -0
  121. package/dist/components/pr-pipeline.d.ts.map +1 -1
  122. package/dist/components/pr-pipeline.js +6 -1
  123. package/dist/components/product-pipeline.d.ts +58 -2
  124. package/dist/components/product-pipeline.d.ts.map +1 -1
  125. package/dist/components/product-pipeline.js +76 -9
  126. package/dist/components/product-plan.d.ts +445 -7
  127. package/dist/components/product-plan.d.ts.map +1 -1
  128. package/dist/components/product-plan.js +426 -15
  129. package/dist/config.d.ts +10 -6
  130. package/dist/config.d.ts.map +1 -1
  131. package/dist/config.js +11 -6
  132. package/dist/control/consumers.d.ts +6 -0
  133. package/dist/control/consumers.d.ts.map +1 -1
  134. package/dist/control/consumers.js +6 -0
  135. package/dist/dead-guards.d.ts.map +1 -1
  136. package/dist/dead-guards.js +9 -6
  137. package/dist/discovery/files.d.ts +1 -1
  138. package/dist/discovery/files.js +1 -1
  139. package/dist/drift-issue.d.ts +20 -3
  140. package/dist/drift-issue.d.ts.map +1 -1
  141. package/dist/drift-issue.js +16 -0
  142. package/dist/drift-record.d.ts +52 -5
  143. package/dist/drift-record.d.ts.map +1 -1
  144. package/dist/drift-record.js +46 -6
  145. package/dist/floor-table.d.ts +6 -6
  146. package/dist/floor-table.d.ts.map +1 -1
  147. package/dist/floor-table.data.d.ts.map +1 -1
  148. package/dist/floor-table.data.js +81 -21
  149. package/dist/floor-table.js +10 -7
  150. package/dist/forge-check/contract.d.ts +19 -1
  151. package/dist/forge-check/contract.d.ts.map +1 -1
  152. package/dist/forge-check/contract.js +8 -2
  153. package/dist/forge-check/index.d.ts +4 -0
  154. package/dist/forge-check/index.d.ts.map +1 -1
  155. package/dist/forge-check/index.js +4 -0
  156. package/dist/forge-flags.d.ts +10 -0
  157. package/dist/forge-flags.d.ts.map +1 -1
  158. package/dist/forge-flags.js +31 -0
  159. package/dist/forge-remote.d.ts +47 -0
  160. package/dist/forge-remote.d.ts.map +1 -0
  161. package/dist/forge-remote.js +69 -0
  162. package/dist/gate-resume-run.d.ts +9 -1
  163. package/dist/gate-resume-run.d.ts.map +1 -1
  164. package/dist/gate-resume-run.js +26 -3
  165. package/dist/generated-check.d.ts +88 -0
  166. package/dist/generated-check.d.ts.map +1 -0
  167. package/dist/generated-check.js +248 -0
  168. package/dist/image-pins.d.ts +26 -0
  169. package/dist/image-pins.d.ts.map +1 -0
  170. package/dist/image-pins.js +19 -0
  171. package/dist/lexicon.d.ts +27 -0
  172. package/dist/lexicon.d.ts.map +1 -1
  173. package/dist/lifecycle/git.d.ts +11 -0
  174. package/dist/lifecycle/git.d.ts.map +1 -1
  175. package/dist/lifecycle/git.js +30 -3
  176. package/dist/lifecycle/publish-npm.d.ts +26 -0
  177. package/dist/lifecycle/publish-npm.d.ts.map +1 -1
  178. package/dist/lifecycle/publish-npm.js +76 -4
  179. package/dist/lifecycle/reach-locks.d.ts +131 -0
  180. package/dist/lifecycle/reach-locks.d.ts.map +1 -0
  181. package/dist/lifecycle/reach-locks.js +118 -0
  182. package/dist/lifecycle/release-cut.d.ts +3 -1
  183. package/dist/lifecycle/release-cut.d.ts.map +1 -1
  184. package/dist/lifecycle/release-cut.js +15 -0
  185. package/dist/lifecycle/release-images.d.ts +22 -1
  186. package/dist/lifecycle/release-images.d.ts.map +1 -1
  187. package/dist/lifecycle/release-images.js +26 -3
  188. package/dist/lifecycle/release-ledger.d.ts +4 -3
  189. package/dist/lifecycle/release-ledger.d.ts.map +1 -1
  190. package/dist/lifecycle/release-ledger.js +3 -2
  191. package/dist/local-chant.d.ts +57 -3
  192. package/dist/local-chant.d.ts.map +1 -1
  193. package/dist/local-chant.js +122 -13
  194. package/dist/notify-product.d.ts +12 -3
  195. package/dist/notify-product.d.ts.map +1 -1
  196. package/dist/notify-product.js +10 -6
  197. package/dist/op/activities/source-release.d.ts.map +1 -1
  198. package/dist/op/activities/source-release.js +2 -1
  199. package/dist/op/activities/source-rollback.d.ts.map +1 -1
  200. package/dist/op/activities/source-rollback.js +2 -1
  201. package/dist/op/index.d.ts +2 -0
  202. package/dist/op/index.d.ts.map +1 -1
  203. package/dist/op/index.js +1 -0
  204. package/dist/op/op-waves-evidence-jobs.d.ts +97 -0
  205. package/dist/op/op-waves-evidence-jobs.d.ts.map +1 -0
  206. package/dist/op/op-waves-evidence-jobs.js +118 -0
  207. package/dist/op/op-waves-evidence.d.ts +12 -1
  208. package/dist/op/op-waves-evidence.d.ts.map +1 -1
  209. package/dist/op/op-waves-evidence.js +23 -2
  210. package/dist/op/op-waves-render-spec.d.ts +100 -0
  211. package/dist/op/op-waves-render-spec.d.ts.map +1 -0
  212. package/dist/op/op-waves-render-spec.js +162 -0
  213. package/dist/op/op-waves-run.d.ts +14 -1
  214. package/dist/op/op-waves-run.d.ts.map +1 -1
  215. package/dist/op/op-waves-run.js +56 -4
  216. package/dist/op/op-waves.d.ts +12 -0
  217. package/dist/op/op-waves.d.ts.map +1 -1
  218. package/dist/op/op-waves.js +14 -1
  219. package/dist/op/schedule-overdue.d.ts +39 -2
  220. package/dist/op/schedule-overdue.d.ts.map +1 -1
  221. package/dist/op/schedule-overdue.js +148 -10
  222. package/dist/op/wave-stop.d.ts +64 -0
  223. package/dist/op/wave-stop.d.ts.map +1 -0
  224. package/dist/op/wave-stop.js +127 -0
  225. package/dist/planned-files.d.ts +76 -0
  226. package/dist/planned-files.d.ts.map +1 -0
  227. package/dist/planned-files.js +108 -0
  228. package/dist/pr-forge-job.d.ts +22 -0
  229. package/dist/pr-forge-job.d.ts.map +1 -0
  230. package/dist/pr-forge-job.js +46 -0
  231. package/dist/pr-forge-reads.d.ts +21 -1
  232. package/dist/pr-forge-reads.d.ts.map +1 -1
  233. package/dist/pr-forge-reads.js +19 -1
  234. package/dist/pr-forge.d.ts +7 -1
  235. package/dist/pr-forge.d.ts.map +1 -1
  236. package/dist/pr-forge.js +7 -2
  237. package/dist/pr-loop.d.ts +3 -6
  238. package/dist/pr-loop.d.ts.map +1 -1
  239. package/dist/pr-loop.js +4 -81
  240. package/dist/pr-plan-note.d.ts +121 -0
  241. package/dist/pr-plan-note.d.ts.map +1 -1
  242. package/dist/pr-plan-note.js +104 -1
  243. package/dist/pr-plan-record.d.ts +47 -0
  244. package/dist/pr-plan-record.d.ts.map +1 -0
  245. package/dist/pr-plan-record.js +89 -0
  246. package/dist/pr-post.d.ts +68 -3
  247. package/dist/pr-post.d.ts.map +1 -1
  248. package/dist/pr-post.js +218 -13
  249. package/dist/pr-requires.d.ts +8 -0
  250. package/dist/pr-requires.d.ts.map +1 -1
  251. package/dist/pr-requires.js +3 -1
  252. package/dist/pr-status.d.ts +16 -0
  253. package/dist/pr-status.d.ts.map +1 -0
  254. package/dist/pr-status.js +90 -0
  255. package/dist/ref-gate-init.d.ts +90 -0
  256. package/dist/ref-gate-init.d.ts.map +1 -0
  257. package/dist/ref-gate-init.js +155 -0
  258. package/dist/ref-gate-rules.d.ts +19 -0
  259. package/dist/ref-gate-rules.d.ts.map +1 -0
  260. package/dist/ref-gate-rules.js +17 -0
  261. package/dist/release-floors.d.ts +100 -16
  262. package/dist/release-floors.d.ts.map +1 -1
  263. package/dist/release-floors.js +101 -17
  264. package/dist/render-module.d.ts +15 -0
  265. package/dist/render-module.d.ts.map +1 -0
  266. package/dist/render-module.js +73 -0
  267. package/dist/state-migration.d.ts +24 -1
  268. package/dist/state-migration.d.ts.map +1 -1
  269. package/dist/state-migration.js +39 -4
  270. package/dist/state-unlock.d.ts +32 -1
  271. package/dist/state-unlock.d.ts.map +1 -1
  272. package/dist/state-unlock.js +31 -0
  273. package/dist/wave-runtime.mjs +307 -297
  274. package/dist/workspace/ci-green-cli.d.ts.map +1 -1
  275. package/dist/workspace/ci-green-cli.js +15 -8
  276. package/dist/workspace/drift-cli.d.ts +1 -1
  277. package/dist/workspace/drift-cli.d.ts.map +1 -1
  278. package/dist/workspace/drift-cli.js +5 -12
  279. package/dist/workspace/forge-work.d.ts +3 -2
  280. package/dist/workspace/forge-work.d.ts.map +1 -1
  281. package/dist/workspace/forge-work.js +7 -17
  282. package/dist/workspace/lexicon-outputs.js +2 -2
  283. package/dist/workspace/release-train.d.ts.map +1 -1
  284. package/dist/workspace/release-train.js +2 -1
  285. package/dist/workspace/release-workflow.d.ts +27 -3
  286. package/dist/workspace/release-workflow.d.ts.map +1 -1
  287. package/dist/workspace/release-workflow.js +52 -7
  288. package/dist/workspace/trust/check-evidence-report.d.ts +25 -2
  289. package/dist/workspace/trust/check-evidence-report.d.ts.map +1 -1
  290. package/dist/workspace/trust/check-evidence-report.js +28 -8
  291. package/dist/workspace/trust/check-evidence.d.ts +13 -1
  292. package/dist/workspace/trust/check-evidence.d.ts.map +1 -1
  293. package/dist/workspace/trust/check-evidence.js +8 -3
  294. package/dist/workspace/trust/evidence.d.ts +5 -0
  295. package/dist/workspace/trust/evidence.d.ts.map +1 -1
  296. package/dist/workspace/trust/evidence.js +5 -0
  297. package/dist/workspace/trust/open-evidence.d.ts +67 -0
  298. package/dist/workspace/trust/open-evidence.d.ts.map +1 -0
  299. package/dist/workspace/trust/open-evidence.js +92 -0
  300. package/dist/workspace/trust/ref-gate-cli.d.ts +10 -1
  301. package/dist/workspace/trust/ref-gate-cli.d.ts.map +1 -1
  302. package/dist/workspace/trust/ref-gate-cli.js +93 -11
  303. package/dist/workspace/trust/ref-gate.d.ts +61 -2
  304. package/dist/workspace/trust/ref-gate.d.ts.map +1 -1
  305. package/dist/workspace/trust/ref-gate.js +72 -7
  306. package/dist/workspace/workspace-run.d.ts.map +1 -1
  307. package/dist/workspace/workspace-run.js +2 -1
  308. package/package.json +1 -1
  309. package/src/action-pins.ts +2 -0
  310. package/src/actor.test.ts +78 -0
  311. package/src/actor.ts +79 -0
  312. package/src/bundle-check.test.ts +22 -0
  313. package/src/bundle-check.ts +33 -5
  314. package/src/chant-install.test.ts +108 -1
  315. package/src/chant-install.ts +242 -2
  316. package/src/ci-base.test.ts +41 -0
  317. package/src/ci-base.ts +43 -0
  318. package/src/ci-comment-commands.test.ts +376 -0
  319. package/src/ci-comment-commands.ts +389 -0
  320. package/src/ci-comment-replies.ts +78 -0
  321. package/src/ci-commit.test.ts +51 -6
  322. package/src/ci-commit.ts +1 -2
  323. package/src/ci-control.ts +1 -0
  324. package/src/ci-evidence-claims.ts +102 -0
  325. package/src/ci-evidence-from-job.test.ts +165 -0
  326. package/src/ci-evidence-from-job.ts +251 -0
  327. package/src/ci-evidence-jobs.ts +88 -6
  328. package/src/ci-handover.ts +16 -3
  329. package/src/ci-identity.test.ts +3 -3
  330. package/src/ci-identity.ts +51 -11
  331. package/src/ci-image.test.ts +187 -16
  332. package/src/ci-image.ts +157 -25
  333. package/src/ci-jobs.ts +7 -2
  334. package/src/ci-login.test.ts +131 -3
  335. package/src/ci-login.token-drop.test.ts +204 -0
  336. package/src/ci-login.ts +137 -39
  337. package/src/ci-note-commands.ts +104 -41
  338. package/src/ci-product-words.ts +89 -0
  339. package/src/ci-product.ts +62 -1
  340. package/src/cli/commands/__fixtures__/source-dir-root/migrations/0001-init/backfill.ts +3 -0
  341. package/src/cli/commands/build.test.ts +41 -0
  342. package/src/cli/commands/build.ts +27 -2
  343. package/src/cli/handlers/approve-confirm.test.ts +35 -0
  344. package/src/cli/handlers/approve-confirm.ts +44 -0
  345. package/src/cli/handlers/approve.ts +2 -1
  346. package/src/cli/handlers/build-source-dir.test.ts +4 -0
  347. package/src/cli/handlers/build.ts +20 -2
  348. package/src/cli/handlers/ci-check.ts +37 -7
  349. package/src/cli/handlers/ci-evidence-open.test.ts +164 -0
  350. package/src/cli/handlers/ci-evidence.ts +233 -18
  351. package/src/cli/handlers/ci-forge-check.ts +22 -9
  352. package/src/cli/handlers/components.ts +3 -1
  353. package/src/cli/handlers/generated-check.ts +69 -0
  354. package/src/cli/handlers/lifecycle.test.ts +20 -0
  355. package/src/cli/handlers/lifecycle.ts +4 -0
  356. package/src/cli/handlers/local-chant.ts +39 -1
  357. package/src/cli/handlers/lock-reach.test.ts +103 -0
  358. package/src/cli/handlers/lock.ts +100 -4
  359. package/src/cli/handlers/pr-comment.ts +104 -0
  360. package/src/cli/handlers/pr-env.ts +6 -3
  361. package/src/cli/handlers/pr-record.test.ts +1 -1
  362. package/src/cli/handlers/pr.ts +93 -15
  363. package/src/cli/handlers/promote.ts +2 -1
  364. package/src/cli/handlers/release.e2e.test.ts +35 -0
  365. package/src/cli/handlers/release.ts +14 -2
  366. package/src/cli/handlers/run-wave.ts +35 -2
  367. package/src/cli/handlers/run.ts +2 -1
  368. package/src/cli/main.ts +60 -4
  369. package/src/cli/parse-args.ts +58 -0
  370. package/src/cli/registry.ts +35 -0
  371. package/src/components/auto-release.ts +2 -1
  372. package/src/components/check-hooks.ts +22 -0
  373. package/src/components/check-report-summary.test.ts +78 -0
  374. package/src/components/pr-checks.ts +254 -0
  375. package/src/components/pr-pipeline.ts +43 -1
  376. package/src/components/product-pipeline.ts +113 -9
  377. package/src/components/product-plan.test.ts +140 -1
  378. package/src/components/product-plan.ts +707 -20
  379. package/src/config.ts +13 -8
  380. package/src/control/consumers.ts +7 -0
  381. package/src/dead-guards.test.ts +27 -5
  382. package/src/dead-guards.ts +9 -6
  383. package/src/discovery/files.ts +1 -1
  384. package/src/drift-issue.test.ts +29 -1
  385. package/src/drift-issue.ts +28 -3
  386. package/src/drift-record.test.ts +45 -0
  387. package/src/drift-record.ts +71 -6
  388. package/src/floor-table.data.ts +81 -21
  389. package/src/floor-table.ts +12 -9
  390. package/src/forge-check/contract.ts +23 -2
  391. package/src/forge-check/forge-check.test.ts +25 -0
  392. package/src/forge-check/index.ts +4 -0
  393. package/src/forge-flags.test.ts +25 -1
  394. package/src/forge-flags.ts +34 -0
  395. package/src/forge-remote.test.ts +37 -0
  396. package/src/forge-remote.ts +79 -0
  397. package/src/gate-resume-run.ts +27 -3
  398. package/src/generated-check.e2e.test.ts +118 -0
  399. package/src/generated-check.test.ts +170 -0
  400. package/src/generated-check.ts +310 -0
  401. package/src/image-pins.ts +31 -0
  402. package/src/lexicon.ts +28 -0
  403. package/src/lifecycle/git.test.ts +48 -0
  404. package/src/lifecycle/git.ts +27 -4
  405. package/src/lifecycle/publish-npm.ts +87 -4
  406. package/src/lifecycle/reach-locks.test.ts +87 -0
  407. package/src/lifecycle/reach-locks.ts +169 -0
  408. package/src/lifecycle/release-catalog.test.ts +2 -2
  409. package/src/lifecycle/release-cut.ts +17 -1
  410. package/src/lifecycle/release-images-dockerfile.test.ts +20 -0
  411. package/src/lifecycle/release-images.test.ts +100 -0
  412. package/src/lifecycle/release-images.ts +38 -3
  413. package/src/lifecycle/release-ledger.ts +4 -3
  414. package/src/local-chant.e2e.test.ts +81 -6
  415. package/src/local-chant.test.ts +22 -3
  416. package/src/local-chant.ts +130 -13
  417. package/src/notify-product.ts +19 -8
  418. package/src/op/activities/source-release.ts +2 -1
  419. package/src/op/activities/source-rollback.ts +2 -1
  420. package/src/op/gate-resume.test.ts +27 -0
  421. package/src/op/index.ts +10 -0
  422. package/src/op/op-waves-evidence-jobs.ts +140 -0
  423. package/src/op/op-waves-evidence.test.ts +36 -3
  424. package/src/op/op-waves-evidence.ts +23 -3
  425. package/src/op/op-waves-notify-words.test.ts +18 -0
  426. package/src/op/op-waves-render-spec.test.ts +160 -0
  427. package/src/op/op-waves-render-spec.ts +171 -0
  428. package/src/op/op-waves-run.ts +59 -3
  429. package/src/op/op-waves.ts +16 -2
  430. package/src/op/schedule-overdue.test.ts +126 -1
  431. package/src/op/schedule-overdue.ts +164 -12
  432. package/src/op/wave-stop.test.ts +72 -0
  433. package/src/op/wave-stop.ts +137 -0
  434. package/src/planned-files.test.ts +80 -0
  435. package/src/planned-files.ts +134 -0
  436. package/src/pr-forge-job.test.ts +53 -0
  437. package/src/pr-forge-job.ts +46 -0
  438. package/src/pr-forge-reads-compare.test.ts +2 -1
  439. package/src/pr-forge-reads.ts +37 -1
  440. package/src/pr-forge.ts +14 -3
  441. package/src/pr-loop-narrowed.test.ts +2 -1
  442. package/src/pr-loop-words.test.ts +2 -1
  443. package/src/pr-loop.test.ts +1 -2
  444. package/src/pr-loop.ts +4 -80
  445. package/src/pr-plan-note.ts +184 -3
  446. package/src/pr-plan-record.test.ts +75 -0
  447. package/src/pr-plan-record.ts +101 -0
  448. package/src/pr-post-plan-note.test.ts +60 -0
  449. package/src/pr-post-replan.test.ts +144 -0
  450. package/src/pr-post-subject.test.ts +230 -0
  451. package/src/pr-post.test.ts +32 -1
  452. package/src/pr-post.ts +254 -15
  453. package/src/pr-requires.test.ts +20 -0
  454. package/src/pr-requires.ts +10 -1
  455. package/src/pr-status.ts +91 -0
  456. package/src/ref-gate-init.ts +208 -0
  457. package/src/ref-gate-rules.ts +26 -0
  458. package/src/release-floors.ts +139 -17
  459. package/src/render-module.ts +73 -0
  460. package/src/state-migration-record.test.ts +89 -0
  461. package/src/state-migration.test.ts +1 -1
  462. package/src/state-migration.ts +52 -4
  463. package/src/state-unlock.test.ts +33 -1
  464. package/src/state-unlock.ts +49 -1
  465. package/src/workspace/ci-green-cli.ts +14 -7
  466. package/src/workspace/ci-green-workflow.test.ts +32 -1
  467. package/src/workspace/drift-cli.ts +6 -18
  468. package/src/workspace/forge-work.ts +7 -14
  469. package/src/workspace/lexicon-outputs.ts +2 -2
  470. package/src/workspace/release-train.ts +2 -1
  471. package/src/workspace/release-workflow.test.ts +104 -3
  472. package/src/workspace/release-workflow.ts +60 -9
  473. package/src/workspace/trust/check-evidence-report.ts +39 -8
  474. package/src/workspace/trust/check-evidence.test.ts +5 -0
  475. package/src/workspace/trust/check-evidence.ts +17 -5
  476. package/src/workspace/trust/evidence.ts +5 -0
  477. package/src/workspace/trust/open-evidence.ts +129 -0
  478. package/src/workspace/trust/ref-gate-cli.ts +88 -10
  479. package/src/workspace/trust/ref-gate-pieces.test.ts +220 -0
  480. package/src/workspace/trust/ref-gate.e2e.test.ts +17 -0
  481. package/src/workspace/trust/ref-gate.test.ts +10 -0
  482. package/src/workspace/trust/ref-gate.ts +87 -6
  483. package/src/workspace/workspace-run.ts +2 -1
@@ -105,9 +105,7 @@ import {
105
105
  prApproveCommands,
106
106
  prNoteMarker,
107
107
  prOp,
108
- prStatusDescription,
109
108
  prStatusContext,
110
- prStatusState,
111
109
  renderPrNote,
112
110
  type PrApproval,
113
111
  type PrBeforeMerge,
@@ -119,7 +117,10 @@ import {
119
117
  type PrRound,
120
118
  type PrOverdue,
121
119
  } from "../../pr-loop";
120
+ import { prStatusDescription, prStatusState } from "../../pr-status";
122
121
  import { FORGE_KINDS, forgeFromEnv, forgePrincipalOf, type ForgeKind, type PrForge } from "../../pr-forge";
122
+ // #4964: a status for a pull_request run's merge preview goes on the pull request's head.
123
+ import { forgeFromJobEnv } from "../../pr-forge-job";
123
124
  import { GITHUB_COMMENT_LIMIT, GITLAB_NOTE_LIMIT } from "../../plan-summary";
124
125
  import { upsertPlanNote } from "../../pr-post";
125
126
  import { activeProductWords, commandWord, parseProductComment, productContext } from "../../ci-product-words";
@@ -146,6 +147,7 @@ import type { OpWaveHookMoment } from "../../op/op-waves";
146
147
  import type { PrHookOutcome } from "../../pr-loop";
147
148
  import type { PrMigrationFile } from "../../pr-migrations";
148
149
  import { lexiconNames } from "../../lexicon-module";
150
+ import { actorFromEnv } from "../../actor";
149
151
 
150
152
 
151
153
  /** Where the reports land unless `--output` says. */
@@ -247,7 +249,7 @@ export async function prepare(ctx: CommandContext, stage: "plan" | "apply" | "re
247
249
  let forge: PrForge | undefined;
248
250
  if (args.forge && !(stage === "plan" && args.noStatus)) {
249
251
  try {
250
- forge = forgeFromEnv(args.forge as ForgeKind);
252
+ forge = forgeFromJobEnv(args.forge as ForgeKind);
251
253
  } catch (err) {
252
254
  return fail(err instanceof Error ? err.message : String(err));
253
255
  }
@@ -1033,10 +1035,14 @@ async function newMigrations(p: Prepared): Promise<PrMigrationFile[]> {
1033
1035
  * the Ops cannot be read, nothing is checked and the plan goes on. The
1034
1036
  * generated plan holds no forge token (#4295), so there the plan-note job's
1035
1037
  * `pr-post` asks instead, reading the Ops at the target branch's commit.
1038
+ * A product plan's own watches (#4888) come from `CHANT_PLAN_WATCHES`, which
1039
+ * the generated note job sets from the pipeline.
1036
1040
  */
1037
1041
  async function overdueOps(forge: PrForge | undefined, member: string | undefined): Promise<PrOverdue[]> {
1038
- const { overdueOpsAt } = await import("../../op/schedule-overdue");
1039
- return overdueOpsAt({ forge, cwd: resolve("."), ...(member ? { member } : {}), log: (line) => console.error(formatWarning({ message: line })) });
1042
+ const { overdueOpsAt, plannedWatchesFromEnv } = await import("../../op/schedule-overdue");
1043
+ const log = (line: string): void => console.error(formatWarning({ message: line }));
1044
+ const watches = plannedWatchesFromEnv(process.env, log);
1045
+ return overdueOpsAt({ forge, cwd: resolve("."), ...(member ? { member } : {}), ...(watches.length > 0 ? { watches } : {}), log });
1040
1046
  }
1041
1047
 
1042
1048
  /** chant components pr-apply --base <ref> [--pr <n>] [--env <env>] [--gate <name>] [--forge <kind>] [--require-review] [--before-merge [--requires <list>]] [--output <dir>] [--json] [--events-json] [--report-url <url>] */
@@ -1400,7 +1406,7 @@ async function mergeAfterUpdate(ctx: CommandContext, p: Prepared, pr: number): P
1400
1406
  }
1401
1407
  let forge: PrForge;
1402
1408
  try {
1403
- forge = forgeFromEnv(kind, env);
1409
+ forge = forgeFromJobEnv(kind, env);
1404
1410
  } catch (err) {
1405
1411
  console.error(formatWarning({ message: `the pull request was not merged: ${err instanceof Error ? err.message : String(err)}` }));
1406
1412
  return CHANT_EXIT.waiting;
@@ -1477,7 +1483,7 @@ async function beforeMergeChecks(ctx: CommandContext): Promise<PrBeforeMerge | n
1477
1483
  let head: string;
1478
1484
  let base: string;
1479
1485
  try {
1480
- forge = forgeFromEnv(args.forge as ForgeKind);
1486
+ forge = forgeFromJobEnv(args.forge as ForgeKind);
1481
1487
  head = await resolveCommit(cwd, args.head ?? "HEAD");
1482
1488
  base = await resolveMergeBase(cwd, args.base, head);
1483
1489
  } catch (err) {
@@ -1503,8 +1509,12 @@ async function beforeMergeChecks(ctx: CommandContext): Promise<PrBeforeMerge | n
1503
1509
  // plywood#66: the forge also reports the pull-request pipeline's plan job, `chant-pr.<member>.<env> / plan (<event>)`, which a denial fails too.
1504
1510
  const planJob = [`chant-pr.${member ?? "*"}.${ctx.args.env ?? "*"} / plan*`];
1505
1511
  const ignore = [...new Set([productContext(activeProductWords(), gate), productContext(activeProductWords(), PR_APPLY_GATE), `chant/${gate}`, `chant/${PR_APPLY_GATE}`, prStatusContext("apply", member), prStatusContext("plan"), `${prStatusContext("plan")}/`, ...planJob])];
1512
+ // #4966: the `checks` require waits for the ref gate's status too, when the policy at base has a rule for the target branch.
1513
+ const refGate = await beforeMergeRefGate(cwd, args.base, args.branch);
1514
+ if ("problem" in refGate) return fail(refGate.problem);
1515
+ if (refGate.note) console.error(formatInfo(refGate.note));
1506
1516
  // ws-106 gives the declaration no way to leave a check out, so with no --requires all four are asked (#4336, #4607).
1507
- const requires = await checkPrRequires(forge, args.pr, head, { ignore, ...(only ? { only: only.checks } : {}) });
1517
+ const requires = await checkPrRequires(forge, args.pr, head, { ignore, ...(only ? { only: only.checks } : {}), ...(refGate.require.length > 0 ? { require: refGate.require } : {}) });
1508
1518
  for (const r of requires) console.error(formatInfo(`${r.name}: ${r.passed ? "passed" : r.pending ? "pending" : "unmet"}, ${r.reason}`));
1509
1519
  const unmet = unmetRequires(requires);
1510
1520
  if (unmet) {
@@ -1513,6 +1523,38 @@ async function beforeMergeChecks(ctx: CommandContext): Promise<PrBeforeMerge | n
1513
1523
  return { requires };
1514
1524
  }
1515
1525
 
1526
+ /**
1527
+ * The branch an apply before merge lands on (#4966): `--branch`, else the
1528
+ * pull request's target as its job names it, else the branch the job runs
1529
+ * on, which for the generated apply job is the target branch (an
1530
+ * `issue_comment` run on GitHub and Forgejo, a target-branch pipeline on
1531
+ * GitLab).
1532
+ */
1533
+ export function beforeMergeBranch(explicit: string | undefined, env: Record<string, string | undefined> = process.env): string | undefined {
1534
+ for (const v of [explicit, env.GITHUB_BASE_REF, env.CI_MERGE_REQUEST_TARGET_BRANCH_NAME, env.CI_COMMIT_BRANCH, env.GITHUB_REF_NAME]) {
1535
+ if (v && v.trim()) return v.trim();
1536
+ }
1537
+ return undefined;
1538
+ }
1539
+
1540
+ /**
1541
+ * The statuses an apply before merge waits for beside the forge's own
1542
+ * (#4966): the ref gate's status for the target branch, as the policy at
1543
+ * `base` sets it (`refGateRulesAt`), passed as `require` to the `checks`
1544
+ * require, so `checks` does not pass before the `ref-gate` job posted it.
1545
+ * No rule for the branch requires nothing; a policy that can't be read is
1546
+ * a problem, and the apply stops.
1547
+ */
1548
+ export async function beforeMergeRefGate(cwd: string, base: string, branch: string | undefined, env: Record<string, string | undefined> = process.env): Promise<{ require: string[]; note?: string } | { problem: string }> {
1549
+ const target = beforeMergeBranch(branch, env);
1550
+ if (!target) return { require: [], note: "the job names no target branch (--branch), so the ref gate's status is not waited for" };
1551
+ const { refGateRulesAt } = await import("../../ref-gate-rules");
1552
+ const rules = refGateRulesAt(cwd, { ref: `refs/heads/${target}`, base });
1553
+ if (rules.problems.length > 0) return { problem: `the trust policy at base can't be read, so the apply before merge can't tell which ref gate status to wait for: ${rules.problems.join("; ")}. Nothing was applied.` };
1554
+ if (!rules.matched || !rules.status) return { require: [] };
1555
+ return { require: [rules.status], note: `the checks require waits for ${rules.status}, the ref gate's status for refs/heads/${target}` };
1556
+ }
1557
+
1516
1558
  /** The refusal report of an apply before merge stopped before it planned (#4301): nothing selected, nothing planned. */
1517
1559
  function earlyStop(ctx: CommandContext, forge: PrForge, at: { pr: number; base: string; head: string; gate: string; member?: string }) {
1518
1560
  return async (beforeMerge: PrBeforeMerge, refusal: "requires-unmet" | "before-merge-off", message: string, code: number): Promise<number> => {
@@ -1534,7 +1576,7 @@ function earlyStop(ctx: CommandContext, forge: PrForge, at: { pr: number; base:
1534
1576
  async function takeApplyLocks(p: Prepared, pr: number, targets: readonly string[] = p.plan.order): Promise<string | null | number> {
1535
1577
  const { takeTargetLocks, describeHeldTargetLocks } = await import("../../lifecycle/target-lock");
1536
1578
  const isOpen = p.forge?.pullRequestOpen?.bind(p.forge);
1537
- const by = process.env.GITHUB_ACTOR ?? process.env.GITLAB_USER_LOGIN ?? process.env.USER ?? "unknown";
1579
+ const by = actorFromEnv();
1538
1580
  let result;
1539
1581
  try {
1540
1582
  result = await takeTargetLocks(p.gate, targets, { pr, by, at: new Date().toISOString(), stage: "apply", head: p.head }, { ...(isOpen ? { isOpen } : {}) });
@@ -2774,7 +2816,7 @@ function writeWaveChangeSet(ctx: CommandContext, wave: number, doc: PrPlanSet["d
2774
2816
  }
2775
2817
 
2776
2818
  /**
2777
- * chant components pr-post --pr <n> --head <sha> --env <env> --forge <kind> [--member <name>] [--output <dir>] [--result <result>] (#4295)
2819
+ * chant components pr-post --pr <n> --head <sha> --env <env> --forge <kind> [--member <name>] [--output <dir>] [--result <result>] [--not-affected <argument>] (#4295, #4963)
2778
2820
  * chant components pr-post --open --env <env> --forge gitlab [--branch <branch>] [--member <name>] [--output <dir>] (#4328)
2779
2821
  *
2780
2822
  * Post the plan note and the `chant/plan` status from the report a plan job
@@ -2795,7 +2837,7 @@ export async function runComponentsPrPost(ctx: CommandContext): Promise<number>
2795
2837
  if (args.members && args.members.length > 1) return fail(`pr-post takes one --member, not ${args.members.join(", ")}`);
2796
2838
  let forge: PrForge;
2797
2839
  try {
2798
- forge = forgeFromEnv(args.forge as ForgeKind);
2840
+ forge = forgeFromJobEnv(args.forge as ForgeKind);
2799
2841
  } catch (err) {
2800
2842
  return fail(err instanceof Error ? err.message : String(err));
2801
2843
  }
@@ -2817,13 +2859,43 @@ export async function runComponentsPrPost(ctx: CommandContext): Promise<number>
2817
2859
  // #4628: the target branch's commit for the note's tip line, and the job summary where the forge keeps one.
2818
2860
  ...(args.tip ? { baseTip: args.tip } : {}),
2819
2861
  ...(args.forge !== "gitlab" && process.env.GITHUB_STEP_SUMMARY ? { summaryFile: process.env.GITHUB_STEP_SUMMARY } : {}),
2862
+ // #4899: the product plan job's run record, kept on chant/lifecycle with the note.
2863
+ ...(args.recordRun ? { recordRun: await planRunRecorder(args.forge as ForgeKind, args.recordRun) } : {}),
2864
+ // #4963: a re-plan narrowed to an argument the change does not reach gets a reply in place of the note.
2865
+ ...(args.notAffected ? { notAffected: args.notAffected } : {}),
2820
2866
  });
2821
2867
  for (const message of posted.warnings) console.error(formatWarning({ message }));
2822
2868
  if (posted.refused) console.error(formatWarning({ message: `the plan report was not used: ${posted.refused}` }));
2823
- console.error(formatInfo(`pr-post: ${prStatusContext("plan", member)} ${posted.state}: ${posted.description}${posted.noted ? "; note posted" : ""}`));
2869
+ console.error(formatInfo(`pr-post: ${prStatusContext("plan", member)} ${posted.state}: ${posted.description}${posted.noted ? "; note posted" : ""}${posted.recorded ? `; run ${posted.recorded} recorded` : ""}`));
2824
2870
  return 0;
2825
2871
  }
2826
2872
 
2873
+ /**
2874
+ * How `pr-post --record-run <plan job>` keeps a product plan job's run
2875
+ * record (#4899): its run is this run on GitHub and Forgejo, named by the
2876
+ * plan job's key, and this pipeline on GitLab, where a re-plan's note job
2877
+ * runs in the re-plan's own pipeline. The record is appended to the run
2878
+ * ledger once, by its id, and `chant/lifecycle` is pushed.
2879
+ */
2880
+ async function planRunRecorder(forge: ForgeKind, job: string): Promise<import("../../pr-post").PlanRunRecorder> {
2881
+ const { resolveCiJob, resolveCiRun } = await import("../../lifecycle/release-ledger");
2882
+ const ci = forge === "gitlab" ? resolveCiRun(process.env) : resolveCiJob(process.env);
2883
+ const origin = ci ? (forge === "gitlab" ? ci.runOrigin : { ...ci.runOrigin, jobId: job }) : undefined;
2884
+ return { ...(origin ? { origin } : {}), keep: keepPlanRunRecord };
2885
+ }
2886
+
2887
+ /** Append `record` to the run ledger unless a record with its id is there, and push `chant/lifecycle` (#4899). Returns a warning when the push did not land. */
2888
+ async function keepPlanRunRecord(record: import("../../op/runtime").OpRunRecordInput): Promise<string | undefined> {
2889
+ const { fetchLifecycleStatus, pushLifecycleReport } = await import("../../lifecycle/git");
2890
+ const { appendRunRecord, readRunLedger } = await import("../../lifecycle/run-ledger");
2891
+ await fetchLifecycleStatus().catch(() => undefined);
2892
+ const { records } = await readRunLedger(record.env, record.op);
2893
+ if (records.some((r) => r.id === record.id)) return undefined;
2894
+ await appendRunRecord(record);
2895
+ const pushed = await pushLifecycleReport();
2896
+ return pushed.pushed ? undefined : `the plan job's run record is on this job's chant/lifecycle only: ${pushed.pushWarning ?? "the push did not land"}`;
2897
+ }
2898
+
2827
2899
  /**
2828
2900
  * The description check pr-post runs after the note (#4629), when the
2829
2901
  * responses turn it on (`--respond description=check`, or `CHANT_RESPOND`):
@@ -2876,7 +2948,7 @@ async function runComponentsPrPostStale(ctx: CommandContext): Promise<number> {
2876
2948
  if (!branch) return fail("pr-post --stale marks the notes of the pull requests into a branch: run it in a job of a push, or pass --branch <branch>");
2877
2949
  let forge: PrForge;
2878
2950
  try {
2879
- forge = forgeFromEnv(args.forge as ForgeKind);
2951
+ forge = forgeFromJobEnv(args.forge as ForgeKind);
2880
2952
  } catch (err) {
2881
2953
  return fail(err instanceof Error ? err.message : String(err));
2882
2954
  }
@@ -2901,7 +2973,9 @@ async function runComponentsPrPostStale(ctx: CommandContext): Promise<number> {
2901
2973
  * (`postOpenPlanReports`, ../../pr-post.ts). The branch is `--branch`, else
2902
2974
  * the pipeline's own (`CI_COMMIT_BRANCH`). The plan job is `plan`, or
2903
2975
  * `<member>-plan` with `--member`, as the gitlab lexicon names it, and the
2904
- * artifact path is `--output` from the repository root. It exits 0 once it
2976
+ * artifact path is `--output` from the repository root. With
2977
+ * `--evidence-dir <dir>` (#4914) each note ends with the checks the
2978
+ * pipeline's signing job signed for that head. It exits 0 once it
2905
2979
  * has posted, as `pr-post` does.
2906
2980
  */
2907
2981
  async function runComponentsPrPostOpen(ctx: CommandContext): Promise<number> {
@@ -2940,6 +3014,10 @@ async function runComponentsPrPostOpen(ctx: CommandContext): Promise<number> {
2940
3014
  ...(description ? { description } : {}),
2941
3015
  // #4628: the target branch's commit this pipeline runs at, which each note's tip line names.
2942
3016
  ...(args.tip ? { baseTip: args.tip } : {}),
3017
+ // #4899: each product plan job's run record, from its artifacts.
3018
+ ...(args.recordRun ? { recordRun: { ...(process.env.CI_PROJECT_PATH ? { repo: process.env.CI_PROJECT_PATH } : {}), keep: keepPlanRunRecord } } : {}),
3019
+ // #4914: each merge request's evidence.json from this pipeline's signing job, for the note's checks line.
3020
+ ...(args.evidenceDir ? { evidenceDir: resolve(args.evidenceDir) } : {}),
2943
3021
  });
2944
3022
  } catch (err) {
2945
3023
  return fail(err instanceof Error ? err.message : String(err));
@@ -2953,7 +3031,7 @@ async function runComponentsPrPostOpen(ctx: CommandContext): Promise<number> {
2953
3031
  const posted = p.posted!;
2954
3032
  for (const message of posted.warnings) console.error(formatWarning({ message: `!${p.pr}: ${message}` }));
2955
3033
  if (posted.refused) console.error(formatWarning({ message: `!${p.pr}: the plan report was not used: ${posted.refused}` }));
2956
- console.error(formatInfo(`pr-post: !${p.pr} ${prStatusContext("plan", member)} ${posted.state}: ${posted.description}${posted.noted ? "; note posted" : ""}`));
3034
+ console.error(formatInfo(`pr-post: !${p.pr} ${prStatusContext("plan", member)} ${posted.state}: ${posted.description}${posted.noted ? "; note posted" : ""}${posted.recorded ? `; run ${posted.recorded} recorded` : ""}`));
2957
3035
  }
2958
3036
  if (done.posts.length === 0) console.error(formatInfo(`pr-post: no open merge request into ${branch} has a ${gitlabPlanJobName(member)} job`));
2959
3037
  return 0;
@@ -72,6 +72,7 @@ import { GATED_EXIT_CODE } from "./run";
72
72
  import type { CommandContext } from "../registry";
73
73
  import { withComponentEndpoint } from "../component-endpoint";
74
74
  import { redeployLine, releaseRollbackLine, rollbackTarget, unsettledComponents } from "../../lifecycle/mixed-environment";
75
+ import { actorFromEnv } from "../../actor";
75
76
 
76
77
  const PROMOTE_USAGE =
77
78
  "chant components promote --to <env> [--from <env>] [--allow-skip] [--release <label|digest>] [--component <name> [--digest <sha256:...>] | --digest <component>=<sha256:...> ...] [--wave-gate <gate>] [--resume <file>] [--dry-run] [--json]";
@@ -117,7 +118,7 @@ function planJson(plan: PromotionPlan, removed: Map<string, string[]>) {
117
118
  }
118
119
 
119
120
  function resolveActor(ctx: CommandContext): string | undefined {
120
- return ctx.args.actor ?? process.env.GITHUB_ACTOR ?? process.env.GITLAB_USER_LOGIN ?? process.env.USER;
121
+ return ctx.args.actor ?? (actorFromEnv(process.env, "") || undefined);
121
122
  }
122
123
 
123
124
  /**
@@ -187,4 +187,39 @@ describe("chant release cut, publish and list", () => {
187
187
  },
188
188
  240_000,
189
189
  );
190
+
191
+ // #4965: plywood's 0.3.9 cut warned that the chant/lifecycle push was refused, tagged, and the publish found no release.
192
+ test(
193
+ "a chant/lifecycle push the remote refuses once is pushed again; one it always refuses stops the cut, untagged and non-zero",
194
+ () => {
195
+ const root = mkdtempSync(join(tmpdir(), "chant-release-cut-refused-"));
196
+ try {
197
+ const { dir, sha, remote } = project(root);
198
+ git(dir, "tag", `ci/green/${sha}`);
199
+ const hook = join(remote, "hooks", "update");
200
+ const cut = (label: string) => chant(dir, ["release", "cut", label, "--build", BUILD, "--yes", "--json"]);
201
+
202
+ // Always refused: no tag, exit 1, and the record stays in this checkout only.
203
+ writeFileSync(hook, `#!/bin/sh\necho 'fatal error in commit_refs_rules' >&2\nexit 1\n`, { mode: 0o755 });
204
+ const refused = cut("v1");
205
+ expect(refused.code, refused.stderr).toBe(1);
206
+ expect(refused.stderr).toContain("[release-record-not-pushed]");
207
+ expect(refused.stderr).toContain("chant/lifecycle was not pushed to \"origin\" after 3 tries: the remote refused each try");
208
+ expect(refused.stdout).toBe("");
209
+ expect(hasRef(dir, "refs/tags/release/v1")).toBe(false);
210
+ expect(hasRef(remote, "refs/heads/chant/lifecycle")).toBe(false);
211
+
212
+ // Refused once: the second push lands, and the cut tags as it always has.
213
+ writeFileSync(hook, `#!/bin/sh\nif [ ! -f '${remote}/refused' ]; then touch '${remote}/refused'; echo 'fatal error in commit_refs_rules' >&2; exit 1; fi\nexit 0\n`, { mode: 0o755 });
214
+ const landed = cut("v1");
215
+ expect(landed.code, landed.stderr).toBe(0);
216
+ expect(JSON.parse(landed.stdout)).toMatchObject({ label: "v1", tag: { name: "release/v1" } });
217
+ expect(git(dir, "rev-parse", "release/v1^{commit}")).toBe(sha);
218
+ expect(git(remote, "rev-parse", "refs/heads/chant/lifecycle")).toBe(git(dir, "rev-parse", "refs/heads/chant/lifecycle"));
219
+ } finally {
220
+ rmSync(root, { recursive: true, force: true });
221
+ }
222
+ },
223
+ 240_000,
224
+ );
190
225
  });
@@ -286,7 +286,7 @@ export async function runReleaseCut(ctx: CommandContext): Promise<number> {
286
286
  const { spawnTargetCompiler, ReleaseCompileError } = await import("../../components/release-compile");
287
287
  const { cutRelease, planRelease, ReleaseCutError } = await import("../../lifecycle/release-cut");
288
288
  const { ReleaseLabelError } = await import("../../lifecycle/release-store");
289
- const { pushLifecycleReport, getHeadCommit } = await import("../../lifecycle/git");
289
+ const { pushLifecycleRebasing, getHeadCommit } = await import("../../lifecycle/git");
290
290
  const { resolveCiRun } = await import("../../lifecycle/release-ledger");
291
291
  const ws = await import("../../lifecycle/release-workstation");
292
292
  const { detectProvenance, releasePublishTargets } = await import("../../lifecycle/release-publish");
@@ -526,7 +526,19 @@ export async function runReleaseCut(ctx: CommandContext): Promise<number> {
526
526
  // release records are put where release.images names them here, so the job's next step (the hand-off to the
527
527
  // publish job) finds them.
528
528
  if (checkout && declaredImages.length > 0) copyImageArchives((await import("../../lifecycle/release-images")).resolveReleaseImages(declaredImages), cutCwd, cwd);
529
- const push = await pushLifecycleReport({ cwd }).catch(() => ({ pushed: false, pushWarning: undefined }));
529
+ // #4965: the record must be on the remote before the release is tagged. The release workflow pushes the tag
530
+ // right after the cut, and a tag whose record never landed spends the label: the publish job finds no release.
531
+ // A refused push is tried again; one that never lands stops the cut here, untagged and non-zero.
532
+ let push: { pushed: boolean; pushWarning?: string };
533
+ try {
534
+ push = await pushLifecycleRebasing({ cwd, requireLanded: true });
535
+ } catch (err) {
536
+ return fail(
537
+ "release-record-not-pushed",
538
+ `the release was cut and its record did not reach the remote, so the commit was not tagged: ${err instanceof Error ? err.message : String(err)}`,
539
+ "Nothing was tagged, so the label is not spent. Run the cut again (in CI, run the release workflow again) once the remote takes pushes to chant/lifecycle.",
540
+ );
541
+ }
530
542
  // The tag names the release's label, which a re-cut with no label reads from the earlier cut.
531
543
  let tagged: { name: string; created: boolean } | null = null;
532
544
  let tagWarning: string | undefined;
@@ -6,12 +6,15 @@
6
6
  import { readFileSync } from "node:fs";
7
7
  import { relative, resolve } from "node:path";
8
8
  import { notifyOpWave } from "../../op/op-waves-notify";
9
- import { parseOpWavesSpec, recordOpWaveHeadPlans, runOpWave } from "../../op/op-waves-run";
9
+ import { gitShowAtBase, parseOpWavesSpec, recordOpWaveHeadPlans, runOpWave } from "../../op/op-waves-run";
10
10
  import { activeProductWaveHook } from "../../op/op-waves-after-plan";
11
11
  import type { OpWavesSpec } from "../../op/op-waves";
12
+ import type { OpWaveShowAtBase } from "../../op/op-waves-run";
12
13
  import { formatError, formatWarning } from "../format";
13
14
  import { ledgerRecordingOff, NO_RECORD_ENV, noRecordEndNote, noRecordStartNote, resetNoRecordLedger } from "../../lifecycle/no-record";
14
15
  import type { CommandContext } from "../registry";
16
+ import { waveStopLine } from "../../op/wave-stop";
17
+ import { CHANT_EXIT } from "../../exit-codes";
15
18
 
16
19
  /**
17
20
  * `chant run wave`, with recording off under `--no-record` or
@@ -88,6 +91,10 @@ async function runOpWaveJobCommand(ctx: CommandContext): Promise<number> {
88
91
  console.error(formatError({ message: `--decide and --${args.share !== undefined ? "share" : "group"} are two different jobs; pass one` }));
89
92
  return 1;
90
93
  }
94
+ if (args.policyOnly && (args.share !== undefined || args.group !== undefined)) {
95
+ console.error(formatError({ message: `--policy-only runs a wave's policy in its own or its deciding job; a --${args.share !== undefined ? "share" : "group"} job has none of its own` }));
96
+ return 1;
97
+ }
91
98
  let spec: OpWavesSpec | undefined;
92
99
  const job = { ...(args.share !== undefined ? { share: args.share } : {}), ...(args.group !== undefined ? { group: args.group } : {}) };
93
100
  if (args.eventsJson && args.json) {
@@ -96,7 +103,29 @@ async function runOpWaveJobCommand(ctx: CommandContext): Promise<number> {
96
103
  }
97
104
  try {
98
105
  const path = resolve(specFile);
99
- spec = parseOpWavesSpec(readFileSync(path, "utf-8"), `--spec ${specFile}`);
106
+ // #4982: --render-spec has the product's command print the spec at base, and reads the rules from it there too.
107
+ let show: OpWaveShowAtBase | undefined;
108
+ if (args.renderSpec) {
109
+ const at = await import("../../op/op-waves-render-spec");
110
+ const file = relative(process.cwd(), path);
111
+ show = at.renderedSpecShow(file, at.commandSpecRender(at.opWavesSpecCommandFromEnv(), file, process.cwd()), gitShowAtBase);
112
+ spec = at.renderOpWavesSpecFile({ specFile: file, base: args.base ?? "HEAD^1", cwd: process.cwd(), show, parse: parseOpWavesSpec }).spec;
113
+ const missing = at.renderedJobMissing(spec, args.wave, job);
114
+ if (missing) {
115
+ console.error(`${missing}, so this job has nothing to apply`);
116
+ return 0;
117
+ }
118
+ } else {
119
+ spec = parseOpWavesSpec(readFileSync(path, "utf-8"), `--spec ${specFile}`);
120
+ }
121
+ // #4979: a comment that ran the apply again through wave n leaves the waves after it waiting, as a gate does.
122
+ if (!args.policyOnly) {
123
+ const stopped = await waveStopLine(spec.name, args.wave);
124
+ if (stopped) {
125
+ console.error(stopped);
126
+ return CHANT_EXIT.waiting;
127
+ }
128
+ }
100
129
  // #4555: --events-json streams the job's run events, a phase per wave and a step per run target.
101
130
  const stream = args.eventsJson
102
131
  ? await (await import("../run-events")).openCliRunEvents(args, { kind: "op", name: spec.name, cwd: process.cwd() })
@@ -113,11 +142,15 @@ async function runOpWaveJobCommand(ctx: CommandContext): Promise<number> {
113
142
  specFile: relative(process.cwd(), path),
114
143
  wave: args.wave,
115
144
  ...(args.decide ? { decide: true } : {}),
145
+ ...(args.policyOnly ? { policyOnly: true } : {}),
116
146
  ...(args.share !== undefined ? { share: args.share } : {}),
117
147
  ...(args.group !== undefined ? { group: args.group } : {}),
118
148
  ...(args.base ? { base: args.base } : {}),
149
+ ...(show ? { show } : {}),
119
150
  });
120
151
  if (args.json) console.log(JSON.stringify(result, null, 2));
152
+ // #4926: the policy step applied nothing; the wave's own step tells people how it went.
153
+ if (args.policyOnly) return result.exitCode;
121
154
  // #3761: tell people, when the spec says where. Delivery never changes the exit code.
122
155
  await notifyOpWave(spec, args.wave, { result }, job);
123
156
  // #4629: a refused wave's diff and a failed apply's triage, on the pull request or a tracking issue.
@@ -40,6 +40,7 @@ import { adoptionReview, loadDeployAdoption, type DeployAdoption } from "../../c
40
40
  import { isApplyRecord, resolveCiRun, type ReleaseRecord, type RunOrigin } from "../../lifecycle/release-ledger";
41
41
  import { gateAdmission, gateApprover } from "../../components/promote";
42
42
  import { runOpGenerate } from "./run-generate";
43
+ import { actorFromEnv } from "../../actor";
43
44
 
44
45
  /**
45
46
  * The exit code a run that stopped at an unapproved gate uses (#2119).
@@ -1132,7 +1133,7 @@ export async function recordSkips(
1132
1133
  ): Promise<ReleaseRecord[]> {
1133
1134
  const fresh = [...skipped.values()].filter((v) => !v.recorded);
1134
1135
  if (fresh.length === 0) return [];
1135
- const actor = process.env.GITHUB_ACTOR ?? process.env.GITLAB_USER_LOGIN ?? process.env.USER;
1136
+ const actor = actorFromEnv(process.env, "");
1136
1137
  if (!actor) {
1137
1138
  console.error(formatWarning({ message: `the skips of ${fresh.map((v) => v.since.component).join(", ")} were not recorded: no actor (GITHUB_ACTOR, GITLAB_USER_LOGIN or USER)` }));
1138
1139
  return [];
package/src/cli/main.ts CHANGED
@@ -267,18 +267,30 @@ E2E harness:
267
267
  CLEAN, or the rejecting lines and exits 3.
268
268
 
269
269
  CI:
270
- ci check --base <rev> [<target>...] [--output <dir>] [--json]
270
+ ci check [--base <rev>] [<target>...] [--output <dir>] [--summary <file>] [--json]
271
271
  Run the ci.hooks.check hooks the workspace declaration
272
272
  at --base names, once each, or once per target with
273
273
  perRun, with no forge token or cloud credentials in
274
274
  their environment. Writes check-hooks.json under
275
- --output (default .chant/check); exits 1 when one failed.
275
+ --output (default .chant/check), and with --summary
276
+ appends the report's markdown section to the file;
277
+ exits 1 when one failed. With no --base, a pull
278
+ request's target branch, else origin/<default> for a
279
+ push to another branch (--branch names the default
280
+ branch where the job does not).
276
281
  ci evidence sign --check-id <id>[,<id>...] [--at <rev>] [--base <rev>] [--no-push]
277
282
  Sign that each named check passed at --at, with the
278
283
  runner key in CHANT_RUNNER_KEY or --key, and keep it on
279
284
  chant/lifecycle by the commit's tree. With --from-report
280
285
  <dir> --result <result>, sign plan and policy from the
281
286
  plan job's report, as a generated plan note job does.
287
+ With --open --job <job> --from-report <dir> -o <out>,
288
+ in a GitLab pipeline of the target branch, sign each
289
+ open merge request's settled <job> from its artifact.
290
+ With --from-job <job> [--claims <dir>], sign each
291
+ named check whose step in that job of this run and
292
+ commit the forge reports as passed, as a wave's
293
+ evidence job does (#4926).
282
294
  ci evidence verify --check-id <id>[,<id>...] [--at <rev>] [--base <rev>] [--json]
283
295
  Verify the kept evidence for --at's tree against the
284
296
  runner keys at --base; exits 1 when one is not current.
@@ -287,12 +299,13 @@ CI:
287
299
  expectation in CHANT_JOB_GUARD, which a generated
288
300
  op-wave job carries. Exits 1, one line per value
289
301
  that differs, before any credential is taken.
290
- ci forge-check [--env <env>] [--member <name>] [--forge <forge>] [--repo <owner/name>] [--branch <default>] [--require-clouds] [--json]
302
+ ci forge-check [--env <env>] [--member <name>] [--forge <forge>] [--repo <owner/name>] [--branch <default>] [--require-clouds] [--ref-gate-status] [--json]
291
303
  Read the forge, each cloud's trust policy and Pulumi
292
304
  Cloud's OIDC policies against the pipelines
293
305
  ci.identity.cloud gives --env (default production):
294
306
  apply environments, branch protection, required
295
307
  statuses, and each identity trusted to its own jobs.
308
+ --ref-gate-status requires the ref gate's status too.
296
309
  Read-only; exits 1 on a mismatch, and with
297
310
  --require-clouds on a cloud it had no credentials for.
298
311
  ci last-green [--json] [--lane <name>] [--from <rev>] The newest first-parent commit of
@@ -598,6 +611,14 @@ Ops:
598
611
  pipeline runs. --decide plans and decides only;
599
612
  --share <i> applies one share of a decided wave;
600
613
  --group <name> applies one job group's runs.
614
+ --policy-only plans the wave and runs its policy
615
+ hold, applying nothing, and exits 0 only when the
616
+ policy ran and denied nothing: the wave job's
617
+ policy step, whose result its evidence job reads (#4926).
618
+ --render-spec runs the command CHANT_WAVES_SPEC_COMMAND
619
+ names (a JSON argv) with CHANT_WAVES_SPEC_AT set to
620
+ the base, writes the spec it prints over --spec, and
621
+ reads the rules at base from it (#4982).
601
622
  --record-plans (no --wave), in a pull request's
602
623
  pipeline: plan every wave at its head and record the
603
624
  digests a pr-review approval mode compares.
@@ -762,6 +783,8 @@ Ops:
762
783
  (--pr <n>, --stage plan|apply|lock, --head <sha>,
763
784
  --by <who>, --gate <name>, --json). --from-report
764
785
  <pr-plan.json> locks the components a plan selected.
786
+ --reach locks what the line in CHANT_LOCK_REACH prints
787
+ for --base..--head (--open: every open merge request).
765
788
  --forge <kind> reads which holders are still open and
766
789
  posts chant/lock on --head. Exits 3 when another open
767
790
  pull request holds a target. --list prints the locks
@@ -1057,7 +1080,8 @@ Workspace (level 1, #2524):
1057
1080
  workspace ref-gate check|status --ref <ref> [--at <rev>] [--base <rev>] [--json]
1058
1081
  Decide a ref update against the checks .chant/trust.json
1059
1082
  at base requires for the ref; status sets the commit
1060
- status a forge requires
1083
+ status a forge requires; status --open sets it on
1084
+ every open pull request into the branch (#4935)
1061
1085
  workspace ref-gate install --hook pre-receive|pre-push [--git-dir <dir>]
1062
1086
  Write the git hook that refuses an update whose commit
1063
1087
  lacks current evidence for a blocking check
@@ -1335,6 +1359,12 @@ Component release ledger + status:
1335
1359
  [--preview-comment] [--apply-before-merge]
1336
1360
  [--apply-on-merge] [--locks]); each answered
1337
1361
  note is recorded on chant/lifecycle
1362
+ components pr-comment GitHub and Forgejo (#4946): answer a comment
1363
+ command no other job of the pipeline takes:
1364
+ a refusal, a command the pipeline runs no job
1365
+ for, or a merged pull request's apply run
1366
+ again (--forge github|forgejo [--branch <b>];
1367
+ the jobs from CHANT_COMMENT_JOBS)
1338
1368
  components pr-record On merge (#4168): plan the same members again,
1339
1369
  store the change set and write the merge record
1340
1370
  _merges/<commit>.json; applies and refuses
@@ -1476,6 +1506,17 @@ Lexicon development:
1476
1506
  Check a bundle against its package.json chantBundleCheck: imports
1477
1507
  only Node, its dependencies and chant served as compiled JS, the
1478
1508
  dependencies on the root's chant pin, size ceilings, denied inputs
1509
+ dev local-image [--with <package>]... [-- <docker build args>]
1510
+ Print the chant an image installs (the pin, or local-<commit>
1511
+ after dev local), or run docker build with CHANT_VERSION and,
1512
+ for a local build, the chant-local build context
1513
+ dev generated-check [<render>...]
1514
+ Render the files package.json's chantGenerated declares into a
1515
+ directory under the OS temp dir, compare each with the committed
1516
+ file, and fail naming the ones that drifted
1517
+ dev render <module> <export> [--output <root>]
1518
+ Import the module and write the { path: text } files its export
1519
+ returns below the root (the working directory by default)
1479
1520
  dev dead-guards [<product-dir>]
1480
1521
  Fail naming each feature-detect on a chant floor (a floor read off
1481
1522
  a lazily loaded module, a subpath loaded behind a catch, the
@@ -1581,6 +1622,15 @@ Options:
1581
1622
  apply on merge tells it. With --control-setting
1582
1623
  <key>=<value> (repeatable) for op, member,
1583
1624
  readTokenSecret and the other control settings
1625
+ --evidence-runner-key-secret <NAME>, --evidence-identity oidc [--evidence-audience <aud>]
1626
+ (build --pr-loop) The runner identity the note job
1627
+ signs plan and policy with (#4935)
1628
+ --check-job (build --pr-loop) A check job that runs ci check on
1629
+ the pull request's commit, and with evidence a job
1630
+ that signs each passed hook (#4935)
1631
+ --ref-gate-status (build --pr-loop) A job that sets the ref gate's
1632
+ status on the pull request's commit (#4935); (ci
1633
+ forge-check) the default branch requires it (#4913)
1584
1634
  --no-release-record Skip auto-emitting a release-ledger record after a
1585
1635
  successful \`run --components\` deploy (default: on;
1586
1636
  also settable via chant.config.ts's
@@ -1984,6 +2034,10 @@ export const commandRegistry: CommandDef[] = [
1984
2034
  // #4787: build a product against a chant checkout, and check its bundle. Imported on first use.
1985
2035
  { name: "dev local", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/local-chant")).runDevLocal(ctx) },
1986
2036
  { name: "dev bundle-check", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/local-chant")).runDevBundleCheck(ctx) },
2037
+ { name: "dev local-image", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/local-chant")).runDevLocalImage(ctx) },
2038
+ { name: "dev generated-check", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/generated-check")).runDevGeneratedCheck(ctx) },
2039
+ // #4950: a module's { path: text } export, written in place.
2040
+ { name: "dev render", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/generated-check")).runDevRender(ctx) },
1987
2041
  // #4792: the feature-detects on a chant floor the product's pin already meets.
1988
2042
  { name: "dev dead-guards", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/dead-guards")).runDevDeadGuards(ctx) },
1989
2043
 
@@ -2122,6 +2176,8 @@ export const commandRegistry: CommandDef[] = [
2122
2176
  { name: "components pr-post", handler: async (ctx) => (await import("./handlers/pr")).runComponentsPrPost(ctx) },
2123
2177
  // #4785: GitLab's comment commands, polled from the notes in a job that runs none of the change's code, so it loads no plugins.
2124
2178
  { name: "components pr-notes", handler: async (ctx) => (await import("./handlers/pr-notes")).runComponentsPrNotes(ctx) },
2179
+ // #4946: GitHub's and Forgejo's comment job, at the target branch's commit, so it loads no plugins.
2180
+ { name: "components pr-comment", handler: async (ctx) => (await import("./handlers/pr-comment")).runComponentsPrComment(ctx) },
2125
2181
  { name: "components pr-record", requiresPlugins: true, handler: async (ctx) => (await import("./handlers/pr")).runComponentsPrRecord(ctx) },
2126
2182
  // #4616: the agent jobs' three steps. Imported on first use; none loads plugins.
2127
2183
  { name: "agent prepare", handler: async (ctx) => (await import("./handlers/agent")).runAgentCommandLine(ctx) },