@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
@@ -28,21 +28,25 @@ import { controlNoteCheckout, type ControlNoteCheckout } from "../control/dispat
28
28
  import {
29
29
  assertProductWords,
30
30
  CHANT_WORDS,
31
+ CI_PRODUCT_COMMANDS,
31
32
  commentLine,
32
33
  type CiProductApplyMode,
33
34
  type CiProductCommand,
34
35
  type CiProductWords,
35
36
  type CiProductWordsInput,
36
37
  } from "../ci-product-words";
37
- import { prActionJob, prCommentLockJobs, prCommentPreviewJob, prLoopJobs, prLoopPostJob, prLoopRunner, prNoteCommandsJob, prStaleJob, withProductBin, type PrActionJob, type PrCommentLockJob, type PrCommentPreviewJob, type PrLoopJob, type PrLoopPipelineOptions } from "./pr-pipeline";
38
+ import { checkJobOptions, PR_LOOP_REPORT_DIR, prActionJob, prCommentLockJobs, prCommentPreviewJob, prLoopJobs, prLoopPostJob, prLoopRunner, prNoteCommandsJob, prStaleJob, withProductBin, type PrActionJob, type PrCommentLockJob, type PrCommentPreviewJob, type PrLoopJob, type PrLoopPipelineOptions } from "./pr-pipeline";
38
39
  import type { DriverComponent } from "./driver";
39
40
  import type { ScheduledOpSpec } from "../lexicon";
40
41
  import type { CiRunner } from "../ci-jobs";
41
42
  import { resolveAgentSpec, type OpAgentSpec } from "../ci-agent";
42
43
  import { resolveCommitSpec, type OpCommitSpec } from "../ci-commit";
43
44
  import type { CiResponses } from "../ci-respond";
44
- import { planEvidenceOf, productPlanJobs, type ProductPlanJob, type ProductPlanOptions } from "./product-plan";
45
- import type { PipelineEvidence } from "../ci-evidence-jobs";
45
+ import { planEvidenceOf, productPlanJobs, productPlanReachLock, type ProductPlanJob, type ProductPlanOptions, type ProductPlanReachLock } from "./product-plan";
46
+ import { gitlabOpenEvidenceDir, type PipelineEvidence } from "../ci-evidence-jobs";
47
+ import { prCheckJob, prRefGateJob, type PrCheckJob, type PrRefGateJob } from "./pr-checks";
48
+ import { COMMENT_JOBS_ENV, PR_COMMENT_JOB, type CommentJobs } from "../ci-comment-commands";
49
+ import { GITHUB_JOB_TOKEN } from "../ci-jobs";
46
50
 
47
51
  /** Where the generator writes a product's waves spec, which chant reads at base (#4550). */
48
52
  export const PRODUCT_WAVES_SPEC_DIR = ".chant/op-waves";
@@ -132,6 +136,31 @@ export interface ProductPipelineOptions extends Omit<PrLoopPipelineOptions, "wor
132
136
  * Absent: nothing is signed, and the jobs are as before.
133
137
  */
134
138
  evidence?: PipelineEvidence;
139
+ /**
140
+ * The comment job (#4946), GitHub and Forgejo: one job on every
141
+ * `/<product>` comment (and every alias's) that answers what no other job
142
+ * of the pipeline takes, with `chant components pr-comment`: a refusal,
143
+ * a command the pipeline has no job for (the words' `replies`, else
144
+ * chant's), and with waves on merge the re-run of a merged pull request's
145
+ * apply. The jobs it leaves comments to are the ones these options write.
146
+ * On GitLab the note-commands job answers every note already; refused
147
+ * there.
148
+ */
149
+ commentJob?: boolean;
150
+ }
151
+
152
+ /** The comment job (#4946): its command, the values it reads, and the comment prefixes that start it. */
153
+ export interface ProductCommentJob {
154
+ jobName: typeof PR_COMMENT_JOB;
155
+ /** `<bin> components pr-comment --forge <forge>`. */
156
+ command: string;
157
+ /** `GITHUB_TOKEN` and {@link COMMENT_JOBS_ENV}. */
158
+ env: Record<string, string>;
159
+ /** What a comment starts with for the job to start: `/<product>`, then each alias. */
160
+ prefixes: string[];
161
+ /** The jobs it leaves comments to. */
162
+ jobs: CommentJobs;
163
+ runner?: CiRunner;
135
164
  }
136
165
 
137
166
  /** The jobs of one product pipeline. */
@@ -201,6 +230,23 @@ export interface ProductPipelineJobs {
201
230
  action?: PrActionJob & { runner?: CiRunner };
202
231
  /** The product plan's jobs (#4799), with `productPlan`: a plan job and a plan-note job per target. */
203
232
  productPlan?: ProductPlanJob[];
233
+ /**
234
+ * The check job (#4935), with `checkJob`: `chant ci check` on the pull
235
+ * request's commit through the words' bin, and with `evidence` the
236
+ * `check-evidence` job's lines that sign each passed hook from its report
237
+ * (./pr-checks.ts). The forge lexicons render the same jobs.
238
+ */
239
+ check?: PrCheckJob & { runner?: CiRunner; evidenceRunner?: CiRunner };
240
+ /** The ref gate's status job (#4935), with `refGateStatus` (./pr-checks.ts). */
241
+ refGate?: PrRefGateJob & { runner?: CiRunner };
242
+ /** The comment job (#4946), with `commentJob`. */
243
+ comment?: ProductCommentJob;
244
+ /**
245
+ * The reach lock job (#4979), with `locks: "plan"` and the product plan's
246
+ * `reach`: `chant lock --reach`, in place of the lock jobs that read a
247
+ * `PrReport`. The forge lexicons render it.
248
+ */
249
+ reachLock?: ProductPlanReachLock;
204
250
  }
205
251
 
206
252
  /** An agent's settings as a product passes them (#4616): {@link OpAgentSpec} without the trigger, which the pipeline names. */
@@ -302,8 +348,10 @@ export function productPipelineJobs(forge: ForgeKind, env: string, options: Prod
302
348
  // Words that ask for before-merge keep it when the pipeline has that job beside its waves.
303
349
  const built: CiProductApplyMode = options.waves || options.componentWaves ? "on-merge" : options.applyBeforeMerge ? "before-merge" : "release";
304
350
  const applyMode: CiProductApplyMode = options.words.applyMode === "before-merge" && options.applyBeforeMerge ? "before-merge" : built;
305
- const words = assertProductWords({ ...options.words, applyMode }, { jobs });
306
- const { waves: given, wavesSpecFile, member, agent: _agent, commits: _commits, actions: _actions, componentWaves, productPlan, evidence, ...loop } = options;
351
+ // #4946: the comment job answers every command but a commit word (the commit job's) with a reply, so the words may name any.
352
+ const answered: CiProductCommand[] = options.commentJob ? [...new Set<CiProductCommand>([...jobs, ...CI_PRODUCT_COMMANDS.filter((c) => c !== "commit")])] : jobs;
353
+ const words = assertProductWords({ ...options.words, applyMode }, { jobs: answered });
354
+ const { waves: given, wavesSpecFile, member, agent: _agent, commits: _commits, actions: _actions, componentWaves, productPlan, evidence, commentJob: _commentJob, ...loop } = options;
307
355
  const { respond } = options;
308
356
  // #4629: the pull request loop puts the responses on the apply and note jobs, as `chant build --pr-loop --respond` does.
309
357
  const prLoop: PrLoopPipelineOptions = { ...loop, words, gate: options.gate ?? words.prGate };
@@ -318,25 +366,39 @@ export function productPipelineJobs(forge: ForgeKind, env: string, options: Prod
318
366
  }
319
367
  // #4619: the loop's control target, else the waves spec's.
320
368
  const controlTarget = options.control?.target ?? (given?.control ? opWavesControlTarget(given.control) : undefined);
321
- const post = prLoopPostJob(forge, env, member, words, { ...(options.staleNotes ? { staleNotes: true } : {}), ...(respond ? { respond } : {}), ...(options.decide ? { decide: options.decide } : {}) });
369
+ const post0 = prLoopPostJob(forge, env, member, words, { ...(options.staleNotes ? { staleNotes: true } : {}), ...(respond ? { respond } : {}), ...(options.decide ? { decide: options.decide } : {}) });
370
+ // #4914: on GitLab the signing job of the plan notes pipeline keeps each merge request's evidence, which the note reads.
371
+ const post = evidence && forge === "gitlab" ? { ...post0, command: `${post0.command} --evidence-dir ${gitlabOpenEvidenceDir(plan!.jobName)}` } : post0;
322
372
  const out: ProductPipelineJobs = {
323
373
  words,
324
374
  plan: plan!,
325
- // #4870: the note job signs the plan job's plan and policy checks before it posts.
326
- post: { ...post, ...(controlTarget ? { control: controlNoteCheckout(forge, controlTarget, words) } : {}), ...defaultRunner, ...(evidence ? { evidence: planEvidenceOf(forge, evidence, words, plan!.jobName) } : {}) },
375
+ // #4870: the note job signs the plan job's plan and policy checks before it posts; #4964: a member's under its name.
376
+ post: { ...post, ...(controlTarget ? { control: controlNoteCheckout(forge, controlTarget, words) } : {}), ...defaultRunner, ...(evidence ? { evidence: planEvidenceOf(forge, evidence, words, plan!.jobName, member ? { member: { name: member, reportPath: PR_LOOP_REPORT_DIR } } : {}) } : {}) },
327
377
  comments,
328
378
  ...(options.applyBeforeMerge ? { applyBeforeMerge: apply! } : {}),
329
379
  // #4799: the product's plan verb, a plan job and a note job per target.
330
380
  ...(productPlan ? { productPlan: productPlanJobs(forge, env, { ...prLoop, plan: productPlan }, words, evidence) } : {}),
331
381
  };
382
+ // #4935: the check job runs the change's code on the plan runner; the signing and the status run on the default one.
383
+ // #4964: with the product's own services, variables, lines and report directory.
384
+ const checkOptions = checkJobOptions(options.checkJob);
385
+ if (checkOptions) {
386
+ const planRunner = prLoopRunner(options, "plan");
387
+ out.check = { ...prCheckJob(forge, { ...checkOptions, ...(words.bin ? { bin: words.bin } : {}), ...(evidence ? { evidence } : {}), ...(productPlan?.forks === "skip" ? { noForks: true } : {}) }), ...(planRunner !== undefined ? { runner: planRunner } : {}), ...(runnerOfDefault !== undefined ? { evidenceRunner: runnerOfDefault } : {}) };
388
+ }
389
+ if (options.refGateStatus) out.refGate = { ...prRefGateJob(forge, { ...(words.bin ? { bin: words.bin } : {}), ...(options.branch ? { branch: options.branch } : {}) }), ...defaultRunner };
332
390
  const locks = prCommentLockJobs(forge, { locks: options.locks, words });
333
391
  if (locks.length > 0) out.locks = locks.map((job) => ({ ...job, ...defaultRunner }));
392
+ // #4979: the product plan's reach says what the lock job locks.
393
+ const reachLock = productPlan ? productPlanReachLock(forge, { ...prLoop, plan: productPlan }, words) : undefined;
394
+ if (reachLock) out.reachLock = reachLock;
334
395
  const action = prActionJob(forge, prLoop);
335
396
  if (action) out.action = { ...action, ...(prLoopRunner(options, "apply") !== undefined ? { runner: prLoopRunner(options, "apply")! } : {}) };
336
397
  const stale = prStaleJob(forge, env, prLoop, member);
337
398
  if (stale) out.stale = { ...stale, ...defaultRunner };
338
399
  // #4785: GitLab's comment commands, polled from the notes; waves on merge are retried by an apply on a merged merge request.
339
- const notes = prNoteCommandsJob(forge, { ...prLoop, ...(options.waves || options.componentWaves ? { applyOnMerge: true } : {}) });
400
+ // #4899: the product plan's comment re-plan runs in the preview's pipeline, so the poll starts it as it starts a preview.
401
+ const notes = prNoteCommandsJob(forge, { ...prLoop, ...(options.waves || options.componentWaves ? { applyOnMerge: true } : {}), ...(productPlan?.replan ? { previewComment: true } : {}) });
340
402
  if (notes) out.noteCommands = { ...notes, ...defaultRunner };
341
403
  const preview = prCommentPreviewJob(forge, env, prLoop, member);
342
404
  if (preview) out.preview = { ...preview, ...(defaultRunner.runner !== undefined ? { noteRunner: defaultRunner.runner } : {}) };
@@ -358,6 +420,29 @@ export function productPipelineJobs(forge: ForgeKind, env: string, options: Prod
358
420
  const spec = given ?? (componentWaves
359
421
  ? componentWavesSpec(componentWaves.components, words, componentWaveSteps({ ...(words.bin ? { bin: words.bin } : {}), env, base: componentWaves.base ?? "HEAD^1", ...(member ? { member } : {}), op, gate: prLoop.gate }), { ...(componentWaves.waveGate ? { gate: componentWaves.waveGate } : {}) })
360
422
  : undefined);
423
+ // #4946: the comment job answers what no other job of the pipeline takes, so it is told which jobs there are.
424
+ if (options.commentJob) {
425
+ // #4963's re-plan reply answers the same stray comments, so one of the two answers them.
426
+ if (typeof productPlan?.replan === "object" && productPlan.replan.reply) throw new Error("commentJob answers every /<product> comment no other job takes, and so does the product plan's replan.reply; drop replan.reply, since the comment job answers the re-plan's refusals too");
427
+ // The product plan's re-plan skips a target that is none of its own and, with forks: "skip", a fork's pull request without a word; the comment job says why.
428
+ const planTargets = productPlan?.replan ? productPlan.targets?.map((t) => t.name) : undefined;
429
+ const commentJobs: CommentJobs = {
430
+ ...(productPlan?.replan || options.previewComment ? { preview: true } : {}),
431
+ ...(planTargets?.length ? { targets: planTargets } : {}),
432
+ ...(productPlan?.replan && productPlan.forks === "skip" ? { skipForks: true } : {}),
433
+ ...(options.applyBeforeMerge ? { applyBeforeMerge: true } : {}),
434
+ ...(given || componentWaves ? { applyOnMerge: true } : {}),
435
+ // #4979: the waves' op (the name productWavesSpec gives them) and count, so a wave-<n> stops a re-run after wave n.
436
+ ...(spec ? { waves: { op: words.op ?? spec.name, count: spec.waves.length } } : {}),
437
+ // #4979: the product plan's re-plan takes no flags, so the comment job answers a plan comment that carries them.
438
+ ...(productPlan?.replan ? { noPlanFlags: true } : {}),
439
+ ...(locks.length > 0 ? { locks: true } : {}),
440
+ ...(out.agent ? { agent: true } : {}),
441
+ ...(out.commits ? { commits: true } : {}),
442
+ ...(options.actions || options.actionJob ? { actions: true } : {}),
443
+ };
444
+ out.comment = { ...productCommentJob(forge, words, commentJobs), ...defaultRunner };
445
+ }
361
446
  if (!spec) return { ...out, record: record! };
362
447
  const wavesRespond = respond ? Object.fromEntries(Object.entries(respond).filter(([e]) => e !== "description")) : {};
363
448
  // #4625: the waves run on the apply runner and with the plan's parallelism, unless the spec names its own.
@@ -486,6 +571,25 @@ export function componentWavesSpec(
486
571
  };
487
572
  }
488
573
 
574
+ /**
575
+ * The comment job's descriptor (#4946): `chant components pr-comment
576
+ * --forge <forge>` through the words' bin, the jobs it leaves comments to as
577
+ * {@link COMMENT_JOBS_ENV}, and the comment prefixes the forge's `if:`
578
+ * starts it on. Throws on GitLab, whose note-commands job answers every
579
+ * note.
580
+ */
581
+ export function productCommentJob(forge: ForgeKind, words: CiProductWords, jobs: CommentJobs): ProductCommentJob {
582
+ if (forge === "gitlab") throw new Error("the comment job answers a GitHub or Forgejo comment; on GitLab the note-commands job (noteCommands) answers every note, so drop commentJob");
583
+ for (const a of words.aliases) if (/['\\]/.test(a.from)) throw new Error(`the alias ${JSON.stringify(a.from)} holds a quote, which the comment job's condition cannot carry`);
584
+ return {
585
+ jobName: PR_COMMENT_JOB,
586
+ command: withProductBin(`chant components pr-comment --forge ${forge}`, words.bin),
587
+ env: { GITHUB_TOKEN: GITHUB_JOB_TOKEN, [COMMENT_JOBS_ENV]: JSON.stringify(jobs) },
588
+ prefixes: [`/${words.product}`, ...words.aliases.map((a) => a.from)],
589
+ jobs,
590
+ };
591
+ }
592
+
489
593
  /** A shell line with the product's bin in place of `chant`, for a product's own jobs beside these. */
490
594
  export function productCommand(words: CiProductWords, line: string): string {
491
595
  return withProductBin(line, words.bin);
@@ -6,6 +6,7 @@
6
6
  import { describe, expect, test } from "vitest";
7
7
  import { productPipelineJobs } from "./product-pipeline";
8
8
  import { PR_PLAN_NOTE_WORDS_ENV } from "./product-plan";
9
+ import { PLAN_WATCHES_ENV } from "../op/schedule-overdue";
9
10
  import { TERRAGUCCI, TERRAGUCCI_NOTE, YODEL } from "../__fixtures__/product-words";
10
11
  import type { CiProductCommand } from "../ci-product-words";
11
12
 
@@ -53,6 +54,17 @@ describe("the product plan (#4799)", () => {
53
54
  expect(JSON.parse(plan!.post.env[PR_PLAN_NOTE_WORDS_ENV]!)).toEqual(TERRAGUCCI_NOTE);
54
55
  });
55
56
 
57
+ // #4888: the product's own scheduled jobs reach the note job's pr-post from the pipeline, as terragucci's drift-schedule.json did from the plan job.
58
+ test.each(["github", "forgejo", "gitlab"] as const)("on %s, the product's watches reach the note job, and a watch that is not one is refused", (forge) => {
59
+ const drift = { op: "tf-drift", cron: "0 6 * * *", files: [".github/workflows/terragucci-drift.yml"], ...(forge === "gitlab" ? { schedule: { variable: "TERRAGUCCI_SCHEDULE", not: ["comments"] } } : {}) };
60
+ const [plan] = productPipelineJobs(forge, "default", { words: terragucci, productPlan: { command: "terragucci plan --pr-note {output}", watches: [drift] } }).productPlan!;
61
+ expect(JSON.parse(plan!.post.env[PLAN_WATCHES_ENV]!)).toEqual([drift]);
62
+ const [none] = productPipelineJobs(forge, "default", { words: terragucci, productPlan: { command: "terragucci plan --pr-note {output}" } }).productPlan!;
63
+ expect(none!.post.env).not.toHaveProperty(PLAN_WATCHES_ENV);
64
+ expect(() => productPipelineJobs(forge, "default", { words: terragucci, productPlan: { command: "terragucci plan", watches: [{ op: "tf-drift", cron: "daily" }] } })).toThrow(/the product plan's watches: watch tf-drift's cron "daily" is not five fields/);
65
+ expect(() => productPipelineJobs(forge, "default", { words: terragucci, productPlan: { command: "terragucci plan", watches: [drift, drift] } })).toThrow(/name an Op twice/);
66
+ });
67
+
56
68
  test("the pipeline's passed values reach every target, and a name both give is refused", () => {
57
69
  const [staging] = productPipelineJobs("github", "default", { words: yodel, variables: { YODEL_LOG: "info" }, productPlan: environments }).productPlan!;
58
70
  expect(staging!.env.YODEL_LOG).toBe("info");
@@ -82,6 +94,133 @@ describe("the product plan (#4799)", () => {
82
94
  test("PRODUCT_PLAN_FLOOR marks the product plan in the ci-product entry", async () => {
83
95
  const { NEXT_RELEASE } = await import("../release-floors");
84
96
  const ciProduct = (await import("../ci-product")) as Record<string, unknown>;
85
- expect(ciProduct.PRODUCT_PLAN_FLOOR).toBe(NEXT_RELEASE);
97
+ expect(ciProduct.PRODUCT_PLAN_FLOOR).toBe("0.124.86");
86
98
  expect(typeof ciProduct.planNoteHandoff).toBe("function");
87
99
  });
100
+
101
+ describe("the product plan's steps beside the plan verb (#4899, #4931)", () => {
102
+ const login = { aws: { role: "arn:aws:iam::123456789012:role/yodel-reader", region: "eu-west-1" } };
103
+
104
+ test("a config without the new options gives jobs without their fields", () => {
105
+ const [staging] = productPipelineJobs("github", "default", { words: yodel, productPlan: environments }).productPlan!;
106
+ for (const key of ["jobEnv", "login", "idTokens", "pending", "control", "setup", "report", "replan", "noteSteps"]) expect(staging).not.toHaveProperty(key);
107
+ });
108
+
109
+ test.each(["github", "forgejo", "gitlab"] as const)("on %s, a target's login is chant's ci-login, and the job asks for its tokens", (forge) => {
110
+ const [staging, prod] = productPipelineJobs(forge, "default", { words: yodel, productPlan: { ...environments, login, targets: [{ ...environments.targets[0]!, login: { gcp: { provider: "projects/1/locations/global/workloadIdentityPools/p/providers/q", serviceAccount: "r@p.iam.gserviceaccount.com" } } }, environments.targets[1]!] } }).productPlan!;
111
+ expect(staging!.login![0]!.name).toBe("Cloud login (chant ci-login: gcp)");
112
+ expect(prod!.login![0]!.name).toBe("Cloud login (chant ci-login: aws)");
113
+ expect(prod!.idTokens).toEqual({ CHANT_ID_TOKEN_AWS: "sts.amazonaws.com" });
114
+ expect(staging!.idTokens).toEqual({ CHANT_ID_TOKEN_GCP: "https://iam.googleapis.com/projects/1/locations/global/workloadIdentityPools/p/providers/q" });
115
+ });
116
+
117
+ test("the product's own id tokens, the job's env, the pending status, the setup steps and the report line", () => {
118
+ const [plan] = productPipelineJobs("github", "default", {
119
+ words: terragucci,
120
+ productPlan: {
121
+ command: "terragucci plan --pr-note {output}",
122
+ idTokens: { TERRAGUCCI_OIDC: "sts.amazonaws.com" },
123
+ env: { TG_LOG: "info" },
124
+ pending: true,
125
+ setup: [{ name: "Restore the cache", uses: "actions/cache/restore@v4", with: { path: "~/.cache" } }],
126
+ report: "terragucci report --out {output}/report",
127
+ },
128
+ }).productPlan!;
129
+ expect(plan).toMatchObject({ idTokens: { TERRAGUCCI_OIDC: "sts.amazonaws.com" }, jobEnv: { TG_LOG: "info" }, pending: { context: "terragucci/plan", description: "planning" }, report: "terragucci report --out .chant/pr/report" });
130
+ // GitLab's plan job holds no token, so it posts no pending status.
131
+ expect(productPipelineJobs("gitlab", "default", { words: terragucci, productPlan: { command: "x", pending: true } }).productPlan![0]).not.toHaveProperty("pending");
132
+ });
133
+
134
+ test("the comment re-plan answers the plan command and the words' aliases for it, per target", () => {
135
+ const [staging] = productPipelineJobs("github", "default", { words: { ...yodel, commands: { plan: "plan" as const } }, productPlan: { ...environments, replan: true } }).productPlan!;
136
+ expect(staging!.replan).toMatchObject({ jobName: "replan-staging", noteJobName: "replan-note-staging", comments: ["/yodel plan"], gated: [], artifact: "chant-pr-plan-staging-replan" });
137
+ expect(staging!.replan!.post.env.HEAD_SHA).toBe("${{ needs.replan-staging.outputs.head }}");
138
+ const [tg] = productPipelineJobs("gitlab", "default", { words: { ...TERRAGUCCI, commands: { plan: "plan" as const }, aliases: [TERRAGUCCI.aliases[0]!] }, noteCommands: true, productPlan: { command: "terragucci plan", replan: true } }).productPlan!;
139
+ expect(tg!.replan).toMatchObject({ jobName: "replan", comments: ["/terragucci plan"], gated: [{ comment: "atlantis plan", when: "TG_ATLANTIS_COMMENTS" }] });
140
+ expect(tg!.replan!.post.command).toContain("components pr-post --pr \"$PR_NUMBER\" --head \"$HEAD_SHA\" --env default --output .chant/pr --forge gitlab");
141
+ expect(tg!.replan!.post.command).not.toContain("--result");
142
+ });
143
+
144
+ test.each([
145
+ ["replan without a plan command", { replan: true }, /words name no plan command/],
146
+ ["a setup step with both run and uses", { setup: [{ run: "x", uses: "y" }] }, /gives one of run and uses/],
147
+ ["a forge token in the job's env", { env: { GITHUB_TOKEN: "x" } }, /GITHUB_TOKEN is one the jobs set or drop/],
148
+ ["a concurrency group that is not a name", { concurrency: { group: "a b" } }, /concurrency group/],
149
+ ["an id token with no audience", { idTokens: { T: "" } }, /names no audience/],
150
+ ])("refuses %s", (_what, extra, error) => {
151
+ expect(() => productPipelineJobs("github", "default", { words: yodel, productPlan: { command: "yodel plan {target}", ...extra } })).toThrow(error);
152
+ });
153
+
154
+ test("noteSteps are refused on GitLab, and noteCommands without replan", () => {
155
+ expect(() => productPipelineJobs("gitlab", "default", { words: yodel, productPlan: { command: "x", noteSteps: { before: ["y"] } } })).toThrow(/GitLab's note job posts every open merge request's note/);
156
+ expect(() => productPipelineJobs("gitlab", "default", { words: yodel, noteCommands: true, productPlan: { command: "x" } })).toThrow(/noteCommands without replan/);
157
+ });
158
+
159
+ test("with replan, GitLab's note-commands job starts the preview's pipeline", () => {
160
+ const jobs = productPipelineJobs("gitlab", "default", { words: { ...yodel, commands: { plan: "plan" as const } }, noteCommands: true, productPlan: { command: "x", replan: true } });
161
+ expect(jobs.noteCommands!.command).toContain("--preview-comment");
162
+ });
163
+ });
164
+
165
+ describe("the re-plan decision and the pending status scripts (#4899)", () => {
166
+ test("hold no single quote, so they go in a node -e '...' line", async () => {
167
+ const { REPLAN_DECIDE_JS, PENDING_JS } = await import("./product-plan");
168
+ expect(REPLAN_DECIDE_JS).not.toContain("'");
169
+ expect(PENDING_JS).not.toContain("'");
170
+ expect(() => new Function(REPLAN_DECIDE_JS)).not.toThrow();
171
+ expect(() => new Function(PENDING_JS)).not.toThrow();
172
+ });
173
+
174
+ test("the GitLab rule matches the command alone or with this target, and the aliases behind their variable", async () => {
175
+ const { gitlabReplanCommentIf } = await import("./product-plan");
176
+ expect(gitlabReplanCommentIf({ comments: ["/yodel plan"], gated: [] }, "prod")).toBe("$CHANT_PREVIEW_COMMENT =~ /^\\/yodel plan( +prod)? *$/");
177
+ expect(gitlabReplanCommentIf({ comments: ["/terragucci plan"], gated: [{ comment: "atlantis plan", when: "TG_ATLANTIS_COMMENTS" }] })).toBe(
178
+ "$CHANT_PREVIEW_COMMENT =~ /^\\/terragucci plan( +[A-Za-z0-9_.\\/@+=,:-]+)? *$/ || ($TG_ATLANTIS_COMMENTS && $CHANT_PREVIEW_COMMENT =~ /^atlantis plan( +[A-Za-z0-9_.\\/@+=,:-]+)? *$/)",
179
+ );
180
+ });
181
+ });
182
+
183
+ test("PRODUCT_PLAN_STEPS_FLOOR marks the plan-job steps in the ci-product entry", async () => {
184
+ const ciProduct = (await import("../ci-product")) as Record<string, unknown>;
185
+ expect(ciProduct.PRODUCT_PLAN_STEPS_FLOOR).toBe("0.124.88");
186
+ expect(ciProduct.PLAN_NOTE_NOTICES_ENV).toBe("CHANT_PLAN_NOTE_NOTICES");
187
+ });
188
+
189
+ describe("what terragucci's and sql-yodeler's plan jobs need (#4963)", () => {
190
+ const trade = { aws: { region: "us-east-1", audience: "sts.amazonaws.com", role: "arn:aws:iam::123456789012:role/plan" } };
191
+
192
+ test("PRODUCT_PLAN_REPLAN_FLOOR is the next release, in the ci-product entry", async () => {
193
+ const ciProduct = (await import("../ci-product")) as Record<string, unknown>;
194
+ const { NEXT_RELEASE } = await import("../release-floors");
195
+ expect(ciProduct.PRODUCT_PLAN_REPLAN_FLOOR).toBe(NEXT_RELEASE);
196
+ expect(typeof ciProduct.planBodyHandoff).toBe("function");
197
+ });
198
+
199
+ test("a trade's OIDC token is the job's, beside its own; a target's login or trade stands in for the plan's", () => {
200
+ const [one] = productPipelineJobs("gitlab", "default", { words: terragucci, productPlan: { command: "x", trade, idTokens: { TG_OIDC: "tg" } } }).productPlan!;
201
+ expect(one!.trade).toEqual(trade);
202
+ expect(one!.idTokens).toEqual({ CHANT_ID_TOKEN_AWS: "sts.amazonaws.com", TG_OIDC: "tg" });
203
+ const [a, b] = productPipelineJobs("github", "default", { words: yodel, productPlan: { ...environments, trade, targets: [{ name: "a", login: { aws: { role: "arn:aws:iam::1:role/r" } } }, { name: "b" }] } }).productPlan!;
204
+ expect(a!.trade).toBeUndefined();
205
+ expect(a!.login).toBeDefined();
206
+ expect(b!.trade).toEqual(trade);
207
+ expect(() => productPipelineJobs("github", "default", { words: terragucci, productPlan: { command: "x", trade, idTokens: { CHANT_ID_TOKEN_AWS: "other" } } })).toThrow(/the trade's, with another audience/);
208
+ });
209
+
210
+ test("the re-plan's options are checked", () => {
211
+ const plan = (replan: unknown) => () => productPipelineJobs("github", "default", { words: terragucci, productPlan: { command: "x", replan: replan as never } });
212
+ expect(plan({ dispatch: { argument: "pr" } })).toThrow(/input name/);
213
+ expect(plan({ dispatch: { argument: "Root Dir" } })).toThrow(/input name/);
214
+ expect(plan({ reply: { others: ["/plywood up"] } })).toThrow(/not a \/terragucci comment/);
215
+ expect(plan({ reply: { others: ["/terragucci it's"] } })).toThrow(/quote/);
216
+ const [p] = productPipelineJobs("github", "default", { words: terragucci, productPlan: { command: "x", replan: { dispatch: true, reply: true, notAffected: true } } }).productPlan!;
217
+ expect(p!.replan).toMatchObject({ dispatch: { argument: "argument" }, reply: { prefix: "/terragucci", others: [] }, notAffected: true });
218
+ expect(p!.replan!.post.command).toMatch(/ --not-affected "\$CHANT_PLAN_ARGUMENT"$/);
219
+ expect(p!.post.command).not.toContain("--not-affected");
220
+ });
221
+
222
+ test("previousMarker names chant's marker for the target and the product's marker", () => {
223
+ const [, prod] = productPipelineJobs("forgejo", "default", { words: yodel, productPlan: { ...environments, previousMarker: true, noteWords: { productMarker: "yodel:plan" } } }).productPlan!;
224
+ expect(prod!.previous).toEqual({ marker: "<!-- chant-pr:default:prod -->", name: "yodel:plan" });
225
+ });
226
+ });