@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
@@ -25,25 +25,77 @@
25
25
  * target's own variables and secrets, and an optional write probe before the
26
26
  * plan. A target is the note's and the status's member: `pr-post --member
27
27
  * <target>`, so each target has its note and its `<product>/plan/<target>`.
28
+ * With `evidence`, a target's note job (GitLab: `<target>-plan-evidence`)
29
+ * signs `plan:<target>` and `policy:<target>` (#4978,
30
+ * `targetEvidenceCheck`): one target's plan says nothing of another's.
28
31
  *
29
32
  * The forge lexicons render these descriptors
30
33
  * (`generateProductPlanPipeline` in each): the products call them in
31
34
  * process, with no component graph.
32
35
  */
33
- import { assertPipelineEvidence, evidenceIdTokens, evidenceKeyEnv, evidenceKeyless, planEvidenceLines } from "../ci-evidence-jobs.js";
34
- import { gitlabPlanJobName, PR_LOOP_REPORT_DIR, PR_PLAN_NOTE_JOB, prLoopPassedEnv, prLoopPostJob, prLoopRunner } from "./pr-pipeline.js";
36
+ import { assertPipelineEvidence, evidenceIdTokens, evidenceKeyEnv, evidenceKeyless, gitlabOpenEvidenceDir, openEvidenceLines, planEvidenceLines } from "../ci-evidence-jobs.js";
37
+ import { gitlabPlanJobName, PR_LOCK_JOB, PR_LOOP_REPORT_DIR, PR_PLAN_NOTE_JOB, prLoopPassedEnv, prLoopPostJob, prLoopRunner, withProductBin } from "./pr-pipeline.js";
38
+ import { LOCK_REACH_ENV } from "../lifecycle/reach-locks.js";
39
+ import { GITHUB_JOB_TOKEN } from "../ci-jobs.js";
40
+ import { cloudLogin } from "../ci-login.js";
41
+ import { controlNoteCheckout } from "../control/dispatch.js";
42
+ import { commentLine, productStatusContext } from "../ci-product-words.js";
43
+ import { PLAN_WATCHES_ENV, scheduledWatchProblem } from "../op/schedule-overdue.js";
44
+ import { PLAN_RUN_OP, PLAN_RUN_RECORD_FILE } from "../pr-plan-record.js";
45
+ import { idTokenVar, tradedClouds } from "../ci-identity.js";
46
+ import { prNoteMarker } from "../pr-loop.js";
47
+ import { PRODUCT_MARKER_NAME } from "../pr-plan-note.js";
35
48
  /** The variable the plan-note job reads the product's note words from (#4799), as JSON. Set from the pipeline, never from the report. */
36
49
  export const PR_PLAN_NOTE_WORDS_ENV = "CHANT_PLAN_NOTE_WORDS";
50
+ /** The variable a comment re-plan's one argument reaches the plan verb in (#4899). Empty on a pull request's own plan. */
51
+ export const PLAN_ARGUMENT_ENV = "CHANT_PLAN_ARGUMENT";
52
+ /** The file the note job's own lines write extra notices to, one a line (#4931): `pr-post` adds them under the note's counts. */
53
+ export const PLAN_NOTE_NOTICES_ENV = "CHANT_PLAN_NOTE_NOTICES";
54
+ /**
55
+ * The reach lock job (#4979), under `locks: "plan"` with `reach`: `chant lock
56
+ * --reach` through the words' bin, with the reach line as
57
+ * {@link LOCK_REACH_ENV}. On GitHub and Forgejo it locks the pull request of
58
+ * the event; on GitLab every open merge request into the branch.
59
+ */
60
+ export function productPlanReachLock(forge, loop, words) {
61
+ const reach = loop.plan.reach;
62
+ if (!reach)
63
+ return undefined;
64
+ if (loop.locks !== "plan")
65
+ throw new Error("the product plan's reach says what the lock job locks, and there is none without locks: \"plan\"; set locks: \"plan\", or drop reach");
66
+ if (!reach.command.trim())
67
+ throw new Error("the product plan's reach.command is empty; give the line that prints the targets a change reaches");
68
+ if (/[\r\n]/.test(reach.command))
69
+ throw new Error("the product plan's reach.command is one shell line");
70
+ if (reach.gate !== undefined) {
71
+ // The lock file's name, as ../lifecycle/target-lock.ts takes it.
72
+ if (!/^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$/.test(reach.gate))
73
+ throw new Error(`the product plan's reach.gate ${JSON.stringify(reach.gate)} is not a lock file name: letters, digits, '.', '_' and '-', starting with a letter or digit`);
74
+ }
75
+ const gate = reach.gate !== undefined ? ["--gate", reach.gate] : [];
76
+ const github = forge !== "gitlab";
77
+ const line = github
78
+ ? ["chant", "lock", "--reach", "--pr", '"$PR_NUMBER"', "--head", '"$HEAD_SHA"', "--base", '"$BASE_SHA"', "--stage", "plan", ...gate, "--forge", forge]
79
+ : ["chant", "lock", "--reach", "--open", "--base", '"$CI_COMMIT_SHA"', "--stage", "plan", ...gate, "--forge", "gitlab"];
80
+ const env = github
81
+ ? { PR_NUMBER: "${{ github.event.pull_request.number }}", HEAD_SHA: "${{ github.event.pull_request.head.sha }}", BASE_SHA: "${{ github.event.pull_request.base.sha }}", GITHUB_TOKEN: GITHUB_JOB_TOKEN, [LOCK_REACH_ENV]: reach.command }
82
+ : { [LOCK_REACH_ENV]: reach.command };
83
+ const runner = prLoopRunner(loop, "default");
84
+ return { jobName: PR_LOCK_JOB, command: withProductBin(line.join(" "), words.bin), env, ...(runner !== undefined ? { runner } : {}) };
85
+ }
86
+ /** The file a product plan job writes its run record to under the hand-off directory, and the Op it is recorded under: `pr-plan`'s (#4899, ../pr-plan-record.ts). */
87
+ export { PLAN_RUN_OP, PLAN_RUN_RECORD_FILE } from "../pr-plan-record.js";
88
+ /** The variable the plan step reads the record's op, environment and labels from (#4899), as JSON. */
89
+ export const PLAN_RUN_RECORD_ENV = "CHANT_PLAN_RECORD";
37
90
  const TARGET_NAME = /^[A-Za-z0-9][A-Za-z0-9_-]*$/;
38
91
  /** The pull request loop's options the product plan's jobs do not carry, and what each needs. Each is refused with `plan` (#4799). */
39
92
  const NOT_WITH_PLAN = [
40
93
  ["applyBeforeMerge", "the apply before merge runs pr-apply on pr-plan's report"],
41
94
  ["applyOnMerge", "the apply on merge runs on op waves, from the waves spec"],
42
95
  ["waveGate", "the apply on merge runs on op waves, from the waves spec"],
43
- ["locks", "the lock job reads pr-plan's report"],
44
96
  ["previewComment", "the comment preview re-runs pr-plan"],
45
97
  ["staleNotes", "the stale marking names one note per pipeline"],
46
- ["identity", "a target's cloud login is the product's, through its variables"],
98
+ ["identity", "the identity trade runs before pr-plan's checkout; give the product plan's trade or login (or a target's) instead"],
47
99
  ["build", "the plan verb builds what it plans"],
48
100
  ["buildCommand", "the plan verb builds what it plans"],
49
101
  ["refresh", "--refresh is a pr-plan flag"],
@@ -52,7 +104,6 @@ const NOT_WITH_PLAN = [
52
104
  ["events", "--events-json is a pr-plan flag"],
53
105
  ["reportUrl", "--report-url is a pr-plan flag"],
54
106
  ["prEnvironment", "the pull request environment jobs run pr-env"],
55
- ["noteCommands", "the note-commands job starts pr-plan's comment jobs"],
56
107
  ["actionJob", "the action job is in chant build --pr-loop's workflow"],
57
108
  ["control", "the control read is the pr-plan report's cross-stack edges"],
58
109
  ["decide", "the description check reads pr-plan's report"],
@@ -70,6 +121,13 @@ export function productPlanJobs(forge, env, loop, words, evidence) {
70
121
  if (value !== undefined && value !== false)
71
122
  throw new Error(`the product plan (plan) takes no ${key}: ${why}`);
72
123
  }
124
+ // #4946: GitHub's and Forgejo's product plan writes the lock jobs around the plan verb's PrReport.
125
+ // #4979: GitLab's locks what each open merge request reaches, from the plan notes pipeline, so it needs the reach line.
126
+ if (loop.locks && forge === "gitlab" && !plan.reach)
127
+ throw new Error("the product plan (plan) takes locks on GitLab only with reach: a merge request's pipeline is built from its own files, so the lock job runs in the target branch's plan notes pipeline and locks what reach prints for each open merge request");
128
+ // #4899: GitLab's comment commands start the re-plan, so the note-commands job comes with it.
129
+ if (loop.noteCommands && !plan.replan)
130
+ throw new Error("the product plan (plan) takes no noteCommands without replan: the note-commands job starts its comment re-plan");
73
131
  if (!plan.command.trim())
74
132
  throw new Error("the product plan's command is empty; give the product's plan verb");
75
133
  const targets = plan.targets;
@@ -85,12 +143,59 @@ export function productPlanJobs(forge, env, loop, words, evidence) {
85
143
  }
86
144
  const github = forge !== "gitlab";
87
145
  const shared = prLoopPassedEnv(forge, loop);
146
+ const jobEnv = plan.env ? prLoopPassedEnv(forge, { variables: plan.env }) : {};
147
+ for (const key of Object.keys(jobEnv)) {
148
+ if (key in shared)
149
+ throw new Error(`the product plan's env ${key} is the pipeline's too; give it once`);
150
+ }
151
+ for (const s of plan.setup ?? []) {
152
+ if ((s.run === undefined) === (s.uses === undefined))
153
+ throw new Error(`the product plan's setup step ${JSON.stringify(s.name ?? s.run ?? s.uses ?? "")} gives one of run and uses`);
154
+ if (s.run !== undefined && s.with !== undefined)
155
+ throw new Error(`the product plan's setup step ${JSON.stringify(s.name ?? s.run)} runs a line, and only a uses step takes with`);
156
+ }
157
+ if (plan.concurrency?.group !== undefined && !/^[A-Za-z0-9][A-Za-z0-9_.-]*$/.test(plan.concurrency.group))
158
+ throw new Error(`the product plan's concurrency group ${JSON.stringify(plan.concurrency.group)} is not a name of letters, digits, ., - and _`);
159
+ const replanComments = plan.replan ? replanCommentsOf(words) : undefined;
160
+ // #4963: what the re-plan does besides the plan command.
161
+ const replanOpts = typeof plan.replan === "object" ? plan.replan : {};
162
+ const dispatchArg = replanOpts.dispatch ? (typeof replanOpts.dispatch === "object" && replanOpts.dispatch.argument !== undefined ? replanOpts.dispatch.argument : "argument") : undefined;
163
+ if (dispatchArg !== undefined && (dispatchArg === "pr" || !/^[a-z][a-z0-9_-]*$/.test(dispatchArg)))
164
+ throw new Error(`the product plan's replan.dispatch.argument ${JSON.stringify(dispatchArg)} is not an input name of lowercase letters, digits, - and _ other than pr`);
165
+ const others = typeof replanOpts.reply === "object" ? (replanOpts.reply.others ?? []) : [];
166
+ for (const o of others) {
167
+ if (!o.startsWith(`/${words.product} `) && !o.startsWith(`/${words.product}\t`) && o !== `/${words.product}`)
168
+ throw new Error(`the product plan's replan.reply.others ${JSON.stringify(o)} is not a /${words.product} comment`);
169
+ if (/['\r\n]/.test(o))
170
+ throw new Error(`the product plan's replan.reply.others ${JSON.stringify(o)} holds a quote or a line break`);
171
+ }
172
+ if (plan.previousMarker && !github)
173
+ throw new Error("the product plan's previousMarker reads the pull request's note before the checkout, with the job's token, and GitLab's plan job holds no token to read a merge request's notes with; leave previousMarker out on GitLab");
174
+ const productMarker = plan.noteWords?.productMarker;
175
+ if (plan.previousMarker && (productMarker === undefined || !PRODUCT_MARKER_NAME.test(productMarker)))
176
+ throw new Error("the product plan's previousMarker reads the note's product marker, and the note words name none; give noteWords.productMarker");
177
+ if (plan.noteSteps && !github && ((plan.noteSteps.before?.length ?? 0) > 0 || (plan.noteSteps.after?.length ?? 0) > 0)) {
178
+ throw new Error("the product plan's noteSteps run in the note job of one pull request, and GitLab's note job posts every open merge request's note in one run (pr-post --open); leave noteSteps out on GitLab");
179
+ }
88
180
  const planRunner = prLoopRunner(loop, "plan");
89
181
  const noteRunner = prLoopRunner(loop, "default");
90
182
  const base = github
91
183
  ? { BASE_SHA: "${{ github.event.pull_request.base.sha }}", PR_NUMBER: "${{ github.event.pull_request.number }}" }
92
184
  : { BASE_SHA: "$CI_MERGE_REQUEST_DIFF_BASE_SHA", PR_NUMBER: "$CI_MERGE_REQUEST_IID" };
93
- const noteWords = plan.noteWords ? { [PR_PLAN_NOTE_WORDS_ENV]: JSON.stringify(plan.noteWords) } : {};
185
+ for (const w of plan.watches ?? []) {
186
+ const problem = scheduledWatchProblem(w);
187
+ if (problem)
188
+ throw new Error(`the product plan's watches: ${problem}`);
189
+ }
190
+ if (new Set((plan.watches ?? []).map((w) => w.op)).size !== (plan.watches ?? []).length)
191
+ throw new Error("the product plan's watches name an Op twice");
192
+ // The note job's variables from the pipeline: the note words, and the product's watches (#4888).
193
+ const noteWords = {
194
+ ...(plan.noteWords ? { [PR_PLAN_NOTE_WORDS_ENV]: JSON.stringify(plan.noteWords) } : {}),
195
+ ...(plan.watches?.length ? { [PLAN_WATCHES_ENV]: JSON.stringify(plan.watches) } : {}),
196
+ };
197
+ const fill = (line, name) => line.replaceAll("{target}", name ?? env).replaceAll("{output}", PR_LOOP_REPORT_DIR);
198
+ const control = plan.controlRead ? controlNoteCheckout(forge, plan.controlRead, words) : undefined;
94
199
  const one = (target) => {
95
200
  const name = target?.name;
96
201
  const jobName = github ? (name ? `plan-${name}` : "plan") : gitlabPlanJobName(name);
@@ -99,42 +204,348 @@ export function productPlanJobs(forge, env, loop, words, evidence) {
99
204
  for (const key of Object.keys(own)) {
100
205
  if (key in shared)
101
206
  throw new Error(`target ${name}'s ${key} is the pipeline's too; give it on the target or on the pipeline`);
207
+ if (key in jobEnv)
208
+ throw new Error(`target ${name}'s ${key} is the product plan's env too; give it once`);
102
209
  }
103
- const post = prLoopPostJob(forge, env, name, words);
210
+ const post0 = prLoopPostJob(forge, env, name, words);
211
+ // #4899: the note job records the plan job's run, named by that job.
212
+ const post1 = plan.record ? { ...post0, command: `${post0.command} --record-run ${jobName}` } : post0;
213
+ // #4914: on GitLab the signing job of the same pipeline keeps each merge request's evidence, which the note's checks line reads.
214
+ const post = evidence && !github ? { ...post1, command: `${post1.command} --evidence-dir ${gitlabOpenEvidenceDir(jobName)}` } : post1;
104
215
  // The note job reads its own plan job's result, by that job's name.
105
216
  const postEnv = github ? { ...post.env, PLAN_RESULT: `\${{ needs.${jobName}.result }}`, ...noteWords } : { ...post.env, ...noteWords };
217
+ // #4931: the target's login, else the plan's, from the OIDC token file (ci-login, #4788).
218
+ // #4963: a target's own login or trade stands in for both of the plan's.
219
+ const own2 = target?.login !== undefined || target?.trade !== undefined;
220
+ const loginSpec = own2 ? target?.login : plan.login;
221
+ const tradeSpec = own2 ? target?.trade : plan.trade;
222
+ if (loginSpec && tradeSpec)
223
+ throw new Error(`the product plan${name ? `'s target ${name}` : ""} gives both login and trade; the trade leaves no token for a login to read, so give one`);
224
+ if (tradeSpec && tradedClouds(tradeSpec).length === 0)
225
+ throw new Error(`the product plan${name ? `'s target ${name}` : ""} trades for no identity; give the trade a cloud`);
226
+ const login = loginSpec ? cloudLogin(forge, loginSpec) : undefined;
227
+ const tradeTokens = tradeSpec ? Object.fromEntries(tradedClouds(tradeSpec).map((c) => [idTokenVar(c), tradeSpec[c].audience])) : {};
228
+ const ownTokens = target?.idTokens ?? plan.idTokens;
229
+ for (const [v, aud] of Object.entries(ownTokens ?? {})) {
230
+ if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(v))
231
+ throw new Error(`the product plan's id token ${JSON.stringify(v)} is not a variable name`);
232
+ if (!aud.trim() || /\s/.test(aud))
233
+ throw new Error(`the product plan's id token ${v} names no audience`);
234
+ if (login && v in login.idTokens && login.idTokens[v] !== aud)
235
+ throw new Error(`the product plan's id token ${v} is the login's, with another audience`);
236
+ if (v in tradeTokens && tradeTokens[v] !== aud)
237
+ throw new Error(`the product plan's id token ${v} is the trade's, with another audience`);
238
+ }
239
+ const idTokens = { ...(login?.idTokens ?? {}), ...tradeTokens, ...(ownTokens ?? {}) };
240
+ const artifact = plan.artifact ? (name ? `${plan.artifact}-${name}` : plan.artifact) : name ? `chant-pr-plan-${name}` : "chant-pr-plan";
241
+ // #4963: on GitHub and Forgejo the first re-plan job replies to the comments no other job takes.
242
+ const replies = github && Boolean(replanOpts.reply) && (targets === undefined || target === targets[0]);
243
+ const replan0 = replanComments
244
+ ? {
245
+ ...replanJobOf(forge, env, words, name, artifact, noteWords, { notAffected: replanOpts.notAffected === true }),
246
+ ...replanComments,
247
+ ...(github && dispatchArg !== undefined ? { dispatch: { argument: dispatchArg } } : {}),
248
+ ...(replies ? { reply: { prefix: `/${words.product}`, others } } : {}),
249
+ ...(replanOpts.notAffected ? { notAffected: true } : {}),
250
+ }
251
+ : undefined;
252
+ const replan = replan0 && plan.record ? { ...replan0, post: { ...replan0.post, command: `${replan0.post.command} --record-run ${replan0.jobName}` } } : replan0;
253
+ const record = plan.record ? { env: { [PLAN_RUN_RECORD_ENV]: JSON.stringify({ op: PLAN_RUN_OP, env, labels: { Env: env, Pipeline: "pr", Job: "plan", ...(name ? { Target: name } : {}) } }) } } : undefined;
254
+ const noteBefore = plan.noteSteps?.before ?? [];
255
+ const noteAfter = plan.noteSteps?.after ?? [];
106
256
  return {
107
257
  ...(name ? { target: name } : {}),
108
258
  jobName,
109
259
  noteJobName,
110
- command: plan.command.replaceAll("{target}", name ?? env).replaceAll("{output}", PR_LOOP_REPORT_DIR),
260
+ command: fill(plan.command, name),
111
261
  env: { ...base, ...shared, ...own },
112
262
  ...(target?.writeProbe ? { writeProbe: target.writeProbe } : {}),
113
263
  post: { command: post.command, env: postEnv },
114
- artifact: plan.artifact ? (name ? `${plan.artifact}-${name}` : plan.artifact) : name ? `chant-pr-plan-${name}` : "chant-pr-plan",
264
+ artifact,
115
265
  ...(planRunner !== undefined ? { runner: planRunner } : {}),
116
266
  ...(noteRunner !== undefined ? { noteRunner } : {}),
117
- ...(evidence ? { evidence: planEvidenceOf(forge, evidence, words, jobName) } : {}),
267
+ // #4978: a target's plan job plans that target alone, so its checks are `plan:<target>` and `policy:<target>`.
268
+ ...(evidence ? { evidence: planEvidenceOf(forge, evidence, words, jobName, { ...(plan.forks === "skip" ? { noForks: true } : {}), ...(name ? { member: { name, reportPath: PR_LOOP_REPORT_DIR } } : {}) }) } : {}),
269
+ ...(Object.keys(jobEnv).length > 0 ? { jobEnv } : {}),
270
+ ...(login && login.steps.length > 0 ? { login: login.steps } : {}),
271
+ ...(Object.keys(idTokens).length > 0 ? { idTokens } : {}),
272
+ ...(plan.pending && github ? { pending: { context: productStatusContext(words, "plan", name), description: "planning" } } : {}),
273
+ ...(control ? { control } : {}),
274
+ ...(plan.setup?.length ? { setup: plan.setup } : {}),
275
+ ...(plan.report ? { report: fill(plan.report, name) } : {}),
276
+ ...(replan ? { replan } : {}),
277
+ ...(noteBefore.length > 0 || noteAfter.length > 0 ? { noteSteps: { before: noteBefore, after: noteAfter, ...(plan.noteSteps?.pullRequest ? { pullRequest: true } : {}) } } : {}),
278
+ ...(record ? { record } : {}),
279
+ ...(tradeSpec ? { trade: tradeSpec } : {}),
280
+ ...(plan.previousMarker && productMarker ? { previous: { marker: prNoteMarker(env, name), name: productMarker } } : {}),
118
281
  };
119
282
  };
120
283
  return targets ? targets.map(one) : [one()];
121
284
  }
122
- /** The evidence step of one plan job (#4870), as {@link ProductPlanJob.evidence}. */
123
- export function planEvidenceOf(forge, evidence, words, planJob) {
285
+ /** The comments the re-plan answers (#4899): the plan command, then the words' aliases for it. Refused when the words name no plan command. */
286
+ function replanCommentsOf(words) {
287
+ const command = commentLine(words, "plan");
288
+ if (!command)
289
+ throw new Error(`the product plan's replan answers /${words.product} <plan command>, and the words name no plan command; name one in the words' commands, or drop replan`);
290
+ const aliases = words.aliases.filter((a) => a.command === "plan");
291
+ return { comments: [command, ...aliases.filter((a) => a.when === undefined).map((a) => a.from)], gated: aliases.filter((a) => a.when !== undefined).map((a) => ({ comment: a.from, when: a.when })) };
292
+ }
293
+ /** The re-plan's jobs for one target (#4899), its comments filled in by the caller. */
294
+ function replanJobOf(forge, env, words, name, artifact, noteWords0, opts = {}) {
295
+ const github = forge !== "gitlab";
296
+ const jobName = github ? (name ? `${REPLAN_JOB}-${name}` : REPLAN_JOB) : name ? `${name}-${REPLAN_JOB}` : REPLAN_JOB;
297
+ const noteJobName = github ? (name ? `${REPLAN_NOTE_JOB}-${name}` : REPLAN_NOTE_JOB) : name ? `${name}-${REPLAN_NOTE_JOB}` : REPLAN_NOTE_JOB;
298
+ // pr-post reads the pull request and the head from the re-plan job, never the comment. GitLab's is GitHub's line with its own --forge.
299
+ const command0 = github ? prLoopPostJob(forge, env, name, words).command : prLoopPostJob("github", env, name, words).command.replace(" --forge github ", " --forge gitlab ");
300
+ // #4963: the argument the re-plan was narrowed to, which pr-post answers "not affected" for when the change does not reach it.
301
+ const command = opts.notAffected ? `${command0} --not-affected "$${PLAN_ARGUMENT_ENV}"` : command0;
302
+ const noteWords = opts.notAffected && github ? { ...noteWords0, [PLAN_ARGUMENT_ENV]: `\${{ needs.${jobName}.outputs.argument }}` } : noteWords0;
303
+ const post = github
304
+ ? {
305
+ command,
306
+ env: {
307
+ PR_NUMBER: `\${{ needs.${jobName}.outputs.pr }}`,
308
+ HEAD_SHA: `\${{ needs.${jobName}.outputs.head }}`,
309
+ PLAN_RESULT: `\${{ needs.${jobName}.result }}`,
310
+ GITHUB_TOKEN: GITHUB_JOB_TOKEN,
311
+ ...noteWords,
312
+ },
313
+ }
314
+ : {
315
+ // GitLab: the merge request from the pipeline's variable, its head again from the remote, and the re-plan job's result from its artifact.
316
+ command: command.replace(' --result "$PLAN_RESULT"', ""),
317
+ env: { PR_NUMBER: `$${GITLAB_REPLAN_PR_VAR}`, ...noteWords },
318
+ setup: ['HEAD_SHA="$(git ls-remote origin "refs/merge-requests/$PR_NUMBER/head" | cut -f1)" && export HEAD_SHA'],
319
+ };
320
+ return { jobName, noteJobName, post, artifact: `${artifact}-replan` };
321
+ }
322
+ /** The comment re-plan's job and its note job (#4899). */
323
+ export const REPLAN_JOB = "replan";
324
+ export const REPLAN_NOTE_JOB = "replan-note";
325
+ /**
326
+ * The GitLab variables the note-commands job starts a re-plan's pipeline
327
+ * with (#4899): the comment preview's (`CHANT_PREVIEW_PR`,
328
+ * `CHANT_PREVIEW_COMMENT`), so `pr-notes --preview-comment` starts it.
329
+ */
330
+ export const GITLAB_REPLAN_PR_VAR = "CHANT_PREVIEW_PR";
331
+ export const GITLAB_REPLAN_COMMENT_VAR = "CHANT_PREVIEW_COMMENT";
332
+ /** A regular expression's body that matches `text` literally, for a GitLab rule's `/.../`. */
333
+ function literal(text) {
334
+ return text.replace(/[.*+?^${}()|[\]\\\/]/g, "\\$&");
335
+ }
336
+ /**
337
+ * The GitLab rule condition that the re-plan pipeline's comment asks for
338
+ * `target` (#4899): the command alone, or with the target's name. Without
339
+ * a target, the command with at most one word after it.
340
+ */
341
+ export function gitlabReplanCommentIf(replan, target) {
342
+ const arg = target ? `( +${literal(target)})?` : "( +[A-Za-z0-9_.\\/@+=,:-]+)?";
343
+ const one = (c) => `$${GITLAB_REPLAN_COMMENT_VAR} =~ /^${literal(c)}${arg} *$/`;
344
+ return [...replan.comments.map(one), ...replan.gated.map((g) => `($${g.when} && ${one(g.comment)})`)].join(" || ");
345
+ }
346
+ /**
347
+ * The re-plan job's first step on GitHub and Forgejo (#4899), with the job's
348
+ * token in its environment alone, before anything is checked out: it reads
349
+ * the comment from the event file (never as an expression in a script),
350
+ * decides whether it asks this job to plan, asks the forge for the pull
351
+ * request (open; from this repository with `forks: "skip"`) and, with
352
+ * `CHANT_REPLAN_PERMISSION` set (Forgejo, whose payload says nothing of the
353
+ * commenter), whether the commenter can write. It writes `go=1`, `pr`,
354
+ * `head`, `base` and `argument` to the step's outputs.
355
+ */
356
+ export const REPLAN_DECIDE_JS = replanDecideJs();
357
+ /**
358
+ * The re-plan's decision script (#4899) with what `replan`'s options add
359
+ * (#4963). With neither it is {@link REPLAN_DECIDE_JS}, as before.
360
+ *
361
+ * - `dispatch`: on `workflow_dispatch` the pull request is the `pr` input
362
+ * and the argument the input `CHANT_REPLAN_DISPATCH_ARGUMENT` names;
363
+ * a `pr` that is not a number, or an argument that is not one plain
364
+ * word, fails the job. No permission is asked: only a writer dispatches.
365
+ * - `reply`: a comment that starts with `CHANT_REPLAN_PRODUCT` and is not
366
+ * the plan command, nor one of `CHANT_REPLAN_OTHERS`, a target that is
367
+ * none of the plan's, and a fork's pull request with `forks: "skip"`
368
+ * get a reply comment with the reason, once the commenter's permission
369
+ * is known (Forgejo). A dispatch's reason goes to the log alone.
370
+ */
371
+ export function replanDecideJs(opts = {}) {
372
+ const { dispatch = false, reply = false } = opts;
373
+ const replyLine = reply
374
+ ? [
375
+ // The reply, as the product: on a dispatch the log alone.
376
+ `const post=async(t)=>{say(t);${dispatch ? "if(dispatch)return;" : ""}const r=await fetch(api+"/repos/"+repo+"/issues/"+n+"/comments",{method:"POST",headers:{authorization:"token "+process.env.CHANT_REPLAN_TOKEN,accept:"application/json","content-type":"application/json"},body:JSON.stringify({body:product.slice(1)+": "+t})});if(!r.ok)console.error("chant: the reply was not posted: the forge answered "+r.status)};`,
377
+ ]
378
+ : [];
379
+ return [
380
+ 'const fs=require("fs");',
381
+ 'const say=(m)=>console.log("chant: "+m);',
382
+ 'const out=(k,v)=>fs.appendFileSync(process.env.GITHUB_OUTPUT,k+"="+v+"\\n");',
383
+ "let e;try{e=JSON.parse(fs.readFileSync(process.env.GITHUB_EVENT_PATH,\"utf8\"))}catch{say(\"the event file does not read, so nothing is planned again\");process.exit(0)}",
384
+ ...(dispatch ? ['const dispatch=process.env.GITHUB_EVENT_NAME==="workflow_dispatch",inputs=e.inputs&&typeof e.inputs==="object"?e.inputs:{};'] : []),
385
+ 'const body=String((e.comment&&e.comment.body)||"").trim();',
386
+ 'const cmds=JSON.parse(process.env.CHANT_REPLAN_COMMANDS||"[]");',
387
+ 'for(const g of JSON.parse(process.env.CHANT_REPLAN_GATED||"[]")){const v=process.env[g.when]||"";if(v&&v!=="0"&&v!=="false")cmds.push(g.comment)}',
388
+ "let arg;",
389
+ ...(reply ? ['let refusal;const product=process.env.CHANT_REPLAN_PRODUCT||"",others=JSON.parse(process.env.CHANT_REPLAN_OTHERS||"[]");const says=(c)=>body===c||body.startsWith(c+" ")||body.startsWith(c+"\\t");'] : []),
390
+ ...(dispatch
391
+ ? [
392
+ 'if(dispatch){const pv=String(inputs.pr==null?"":inputs.pr).trim();if(!pv){say("the dispatch names no pull request");process.exit(0)}if(!/^[1-9][0-9]{0,9}$/.test(pv)){console.error("chant: the dispatch\\u0027s pr input is a pull request number, like 42");process.exit(1)}',
393
+ 'const k=process.env.CHANT_REPLAN_DISPATCH_ARGUMENT||"argument",a=String(inputs[k]==null?"":inputs[k]).trim();if(a&&!/^[A-Za-z0-9_.\\/@+=,:-]+$/.test(a)){console.error("chant: the dispatch\\u0027s "+k+" input is one word of letters, digits and _./@+=,:-");process.exit(1)}arg=a}else ',
394
+ ]
395
+ : []),
396
+ 'for(const c of cmds){if(body===c){arg="";break}if(body.startsWith(c+" ")){const r=body.slice(c.length).trim();if(/^[A-Za-z0-9_.\\/@+=,:-]+$/.test(r)){arg=r;break}}}',
397
+ reply
398
+ ? 'if(arg===undefined){if(product&&says(product)&&!others.some(says)){refusal="the commands are "+cmds.concat(others).map((c)=>"`"+c+"`").join(", ")}else{say("the comment asks for no plan");process.exit(0)}}'
399
+ : 'if(arg===undefined){say("the comment asks for no plan");process.exit(0)}',
400
+ 'const target=process.env.CHANT_REPLAN_TARGET||"",targets=JSON.parse(process.env.CHANT_REPLAN_TARGETS||"[]");',
401
+ reply
402
+ ? 'if(targets.length&&arg&&!targets.includes(arg)){refusal=arg+" is none of "+targets.join(", ")+", so nothing is planned again";arg=""}'
403
+ : 'if(targets.length&&arg&&!targets.includes(arg)){say(arg+" is none of "+targets.join(", ")+", so nothing is planned again");process.exit(0)}',
404
+ 'if(targets.length&&arg&&arg!==target){say("the comment plans "+arg+" again, not "+target);process.exit(0)}',
405
+ dispatch
406
+ ? 'const n=dispatch?Number(String(inputs.pr).trim()):e.issue&&e.issue.number;if(!dispatch&&(!Number.isInteger(n)||!(e.issue.pull_request||e.is_pull))){say("the comment is not on a pull request");process.exit(0)}'
407
+ : 'const n=e.issue&&e.issue.number;if(!Number.isInteger(n)||!(e.issue.pull_request||e.is_pull)){say("the comment is not on a pull request");process.exit(0)}',
408
+ 'const api=String(process.env.GITHUB_API_URL||"").replace(/\\/+$/,""),repo=process.env.GITHUB_REPOSITORY;',
409
+ 'const get=async(p)=>{const r=await fetch(api+"/repos/"+repo+p,{headers:{authorization:"token "+process.env.CHANT_REPLAN_TOKEN,accept:"application/json"}});if(!r.ok)throw new Error(p+" answered "+r.status);return r.json()};',
410
+ ...replyLine,
411
+ "(async()=>{",
412
+ ...(reply
413
+ ? [
414
+ // Who asked comes first: a commenter who cannot write gets no reply.
415
+ `if(process.env.CHANT_REPLAN_PERMISSION${dispatch ? "&&!dispatch" : ""}){const who=e.comment&&e.comment.user&&e.comment.user.login;const p=who?await get("/collaborators/"+encodeURIComponent(who)+"/permission"):{};`,
416
+ 'if(!["owner","admin","maintain","write"].includes(p.permission)){say((who||"the commenter")+" cannot write to "+repo+", so nothing is planned again");return}}',
417
+ "if(refusal){await post(refusal);return}",
418
+ 'const pr=await get("/pulls/"+n);',
419
+ 'if(pr.state!=="open"){say("pull request "+n+" is not open, so it is not planned again");return}',
420
+ 'const same=Boolean(pr.head&&pr.head.repo&&pr.head.repo.full_name===repo);',
421
+ 'if(!same&&process.env.CHANT_REPLAN_FORKS==="skip"){await post("pull request "+n+" is from a fork, and its code never runs with this repository\\u0027s credentials, so it is not planned again");return}',
422
+ ]
423
+ : [
424
+ 'const pr=await get("/pulls/"+n);',
425
+ 'if(pr.state!=="open"){say("pull request "+n+" is not open, so it is not planned again");return}',
426
+ 'const same=Boolean(pr.head&&pr.head.repo&&pr.head.repo.full_name===repo);',
427
+ 'if(!same&&process.env.CHANT_REPLAN_FORKS==="skip"){say("pull request "+n+" is from a fork, and its code never runs with this repository\\u0027s credentials");return}',
428
+ `if(process.env.CHANT_REPLAN_PERMISSION${dispatch ? "&&!dispatch" : ""}){const who=e.comment&&e.comment.user&&e.comment.user.login;const p=who?await get("/collaborators/"+encodeURIComponent(who)+"/permission"):{};`,
429
+ 'if(!["owner","admin","maintain","write"].includes(p.permission)){say((who||"the commenter")+" cannot write to "+repo+", so nothing is planned again");return}}',
430
+ ]),
431
+ 'const sha=/^[0-9a-f]{40}$/;if(!sha.test(String(pr.head&&pr.head.sha))||!sha.test(String(pr.base&&pr.base.sha)))throw new Error("the pull request names no head or base commit");',
432
+ 'out("go","1");out("pr",String(n));out("head",pr.head.sha);out("base",pr.base.sha);out("argument",arg);',
433
+ 'say("planning pull request "+n+" again at "+pr.head.sha.slice(0,12)+(arg?" for "+arg:""))',
434
+ '})().catch((err)=>{console.error("chant: the re-plan could not decide: "+(err&&err.message?err.message:String(err)));process.exit(1)});',
435
+ ].join("");
436
+ }
437
+ /**
438
+ * The previous note's read step on GitHub and Forgejo (#4963): `node -e`,
439
+ * from `/`, with the job's token in `CHANT_PREVIOUS_TOKEN` alone. It pages
440
+ * through pull request `CHANT_PREVIOUS_PR`'s comments for the one whose
441
+ * first line is `CHANT_PREVIOUS_NOTE` (chant's marker), takes its second
442
+ * line's body when it is `<!-- <CHANT_PREVIOUS_NAME> <body> -->` and the
443
+ * body is plain words, and appends `CHANT_PLAN_PREVIOUS_MARKER=<body>` to
444
+ * `$GITHUB_ENV`, empty when there is none. A forge that refuses is a
445
+ * warning: the plan verb plans without it.
446
+ */
447
+ export const PREVIOUS_MARKER_JS = [
448
+ 'const fs=require("fs");',
449
+ 'const api=String(process.env.GITHUB_API_URL||"").replace(/\\/+$/,""),repo=process.env.GITHUB_REPOSITORY,n=process.env.CHANT_PREVIOUS_PR||"";',
450
+ 'const note=process.env.CHANT_PREVIOUS_NOTE||"",name=process.env.CHANT_PREVIOUS_NAME||"";',
451
+ 'const put=(v)=>fs.appendFileSync(process.env.GITHUB_ENV,"CHANT_PLAN_PREVIOUS_MARKER="+v+"\\n");',
452
+ 'const esc=(s)=>s.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&");',
453
+ 'const own=new RegExp("^<!-- "+esc(name)+"(?: ([A-Za-z0-9_.,\\\\/@+=:-]+(?: [A-Za-z0-9_.,\\\\/@+=:-]+)*))? -->$");',
454
+ 'if(!/^[0-9]+$/.test(n)){console.log("chant: no pull request to read the previous note of");put("");process.exit(0)}',
455
+ "(async()=>{",
456
+ "for(let page=1;page<=50;page++){",
457
+ 'const r=await fetch(api+"/repos/"+repo+"/issues/"+n+"/comments?per_page=100&limit=50&page="+page,{headers:{authorization:"token "+process.env.CHANT_PREVIOUS_TOKEN,accept:"application/json"}});',
458
+ 'if(!r.ok)throw new Error("the forge answered "+r.status);',
459
+ "const list=await r.json();if(!Array.isArray(list)||list.length===0)break;",
460
+ 'for(const c of list){const lines=String(c&&c.body||"").replace(/\\r\\n/g,"\\n").split("\\n");if(lines[0]!==note)continue;const m=own.exec(lines[1]||"");const v=m&&m[1]&&m[1].length<=4096?m[1]:"";put(v);console.log("chant: the previous note"+(v?" carries "+name:" carries no "+name));return}',
461
+ "}",
462
+ 'put("");console.log("chant: the pull request has no note yet")',
463
+ '})().catch((err)=>{put("");console.log("chant: the previous note was not read: "+(err&&err.message?err.message:String(err)))});',
464
+ ].join("");
465
+ /** The GitLab re-plan's lines that set {@link PLAN_ARGUMENT_ENV} from the comment's one word after the command (#4899), which the rule already held to plain characters. */
466
+ export function gitlabReplanArgumentLines(replan) {
467
+ const byLength = [...replan.comments, ...replan.gated.map((g) => g.comment)].sort((a, b) => b.length - a.length);
468
+ return [
469
+ `case "$${GITLAB_REPLAN_COMMENT_VAR}" in ${byLength.map((c) => `"${c}"*) chant_rest="\${${GITLAB_REPLAN_COMMENT_VAR}#"${c}"}" ;;`).join(" ")} *) chant_rest="" ;; esac`,
470
+ `${PLAN_ARGUMENT_ENV}="$(printf '%s' "$chant_rest" | tr -d ' ')" && export ${PLAN_ARGUMENT_ENV}`,
471
+ ];
472
+ }
473
+ /**
474
+ * The pending step's script on GitHub and Forgejo (#4899): `node -e`, from
475
+ * `/`, posting the plan status pending at `CHANT_PENDING_SHA` with the token
476
+ * in `CHANT_PENDING_TOKEN`. A forge that refuses it is a warning: the note
477
+ * job sets the status the plan ends with.
478
+ */
479
+ export const PENDING_JS = [
480
+ 'const api=String(process.env.GITHUB_API_URL||"").replace(/\\/+$/,""),repo=process.env.GITHUB_REPOSITORY,sha=process.env.CHANT_PENDING_SHA||"";',
481
+ 'if(!/^[0-9a-f]{40}$/.test(sha)){console.log("chant: no commit to say the plan started on");process.exit(0)}',
482
+ 'const run=process.env.GITHUB_SERVER_URL&&process.env.GITHUB_RUN_ID?process.env.GITHUB_SERVER_URL+"/"+repo+"/actions/runs/"+process.env.GITHUB_RUN_ID:undefined;',
483
+ 'fetch(api+"/repos/"+repo+"/statuses/"+sha,{method:"POST",headers:{authorization:"token "+process.env.CHANT_PENDING_TOKEN,accept:"application/json","content-type":"application/json"},body:JSON.stringify({state:"pending",context:process.env.CHANT_PENDING_CONTEXT,description:process.env.CHANT_PENDING_DESCRIPTION,...(run?{target_url:run}:{})})})',
484
+ '.then((r)=>console.log(r.ok?"chant: "+process.env.CHANT_PENDING_CONTEXT+" is pending":"chant: the forge answered "+r.status+" to the pending status"),(err)=>console.log("chant: the pending status was not posted: "+err.message));',
485
+ ].join("");
486
+ /**
487
+ * The plan step's lines for the plan verb (#4899): the verb, then the
488
+ * report line whatever the verb's exit, then the step exits with the verb's
489
+ * status. Without a report line, the verb alone.
490
+ */
491
+ export function planVerbLines(p) {
492
+ if (!p.report && !p.record)
493
+ return [p.command];
494
+ return [
495
+ ...(p.record ? ['chant_plan_started="$(date -u +%Y-%m-%dT%H:%M:%SZ)"'] : []),
496
+ "chant_plan_exit=0",
497
+ `${p.command} || chant_plan_exit=$?`,
498
+ ...(p.report ? [`${p.report} || echo "chant: the report line exited $?" >&2`] : []),
499
+ // #4899: the run record goes into the hand-off, for the note job to keep on chant/lifecycle.
500
+ ...(p.record ? [`CHANT_PLAN_EXIT="$chant_plan_exit" CHANT_PLAN_STARTED="$chant_plan_started" node -e '${PLAN_RECORD_JS}' ${PR_LOOP_REPORT_DIR} || echo "chant: the plan's run record was not written" >&2`] : []),
501
+ '[ "$chant_plan_exit" -eq 0 ] || exit "$chant_plan_exit"',
502
+ ];
503
+ }
504
+ /**
505
+ * The plan step's record line (#4899): `node -e`, writing the run record of
506
+ * the plan verb into the directory it is given, {@link PLAN_RUN_RECORD_FILE}.
507
+ * It reads the op, environment and labels from {@link PLAN_RUN_RECORD_ENV},
508
+ * the verb's exit from `CHANT_PLAN_EXIT`, its start from
509
+ * `CHANT_PLAN_STARTED`, and the commit from git. The shape is an
510
+ * `OpRunRecordInput` (../op/runtime.ts) with no run origin, which the note
511
+ * job names.
512
+ */
513
+ export const PLAN_RECORD_JS = [
514
+ 'const fs=require("fs"),path=require("path"),cp=require("child_process"),crypto=require("crypto");',
515
+ "const c=JSON.parse(process.env.CHANT_PLAN_RECORD||\"{}\"),dir=process.argv[1];",
516
+ 'const code=Number(process.env.CHANT_PLAN_EXIT||"1"),ended=new Date().toISOString(),started=new Date(Date.parse(process.env.CHANT_PLAN_STARTED||"")||Date.now()).toISOString();',
517
+ 'let sha="";try{sha=cp.execFileSync("git",["rev-parse","HEAD"],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{}',
518
+ 'const ok=code===0,status=ok?"ok":"fail",ms=Math.max(0,Date.parse(ended)-Date.parse(started));',
519
+ 'const rec={id:crypto.randomUUID(),op:c.op,env:c.env,started,ended,status,labels:c.labels||{},outcomes:{},phases:[{name:"plan",status,steps:[{fn:"shellCmd",status,durationMs:ms,...(ok?{}:{error:"command exited "+code})}]}],...(sha?{gitSha:sha}:{}),...(ok?{}:{failure:{code:"command-failed",reason:"the plan verb exited "+code,phase:"plan",exitCode:code}})};',
520
+ `fs.mkdirSync(dir,{recursive:true});fs.writeFileSync(path.join(dir,"${PLAN_RUN_RECORD_FILE}"),JSON.stringify(rec)+"\\n");`,
521
+ ].join("");
522
+ /**
523
+ * The evidence step of one plan job (#4870), as {@link ProductPlanJob.evidence}.
524
+ * #4964: for a workspace member's pipeline (`member`) the checks are signed
525
+ * as `plan:<member>` and `policy:<member>` (`--member`), and on GitLab the
526
+ * report is read from the plan job's artifact at the member's `reportPath`.
527
+ * #4978: a product plan target's plan job is signed the same way, under the
528
+ * target's name.
529
+ */
530
+ export function planEvidenceOf(forge, evidence, words, planJob, opts = {}) {
124
531
  assertPipelineEvidence(evidence);
125
532
  const key = evidenceKeyEnv(forge, evidence);
126
533
  const bin = words.bin;
534
+ const member = opts.member ? { member: opts.member.name } : {};
127
535
  if (forge === "gitlab") {
128
- // The job runs only once the plan job succeeded, on the merge request's commit.
536
+ // #4914: the job runs in the target branch's plan notes pipeline, before the note job, and signs every open
537
+ // merge request's settled plan job from its artifact; no job of a merge request pipeline holds the key.
538
+ const dir = gitlabOpenEvidenceDir(planJob);
129
539
  return {
130
540
  jobName: `${planJob}-evidence`,
131
- lines: planEvidenceLines({ dir: PR_LOOP_REPORT_DIR, at: '"$CI_COMMIT_SHA"', base: '"$CI_MERGE_REQUEST_DIFF_BASE_SHA"', result: "success", ...(bin ? { bin } : {}) }),
541
+ lines: openEvidenceLines({ job: planJob, dir: opts.member?.reportPath ?? PR_LOOP_REPORT_DIR, out: dir, ...(bin ? { bin } : {}), ...(opts.noForks ? { noForks: true } : {}), ...member }),
132
542
  env: key,
543
+ dir,
133
544
  ...(evidenceKeyless(evidence) ? { idTokens: evidenceIdTokens(evidence) } : {}),
134
545
  };
135
546
  }
136
547
  return {
137
- lines: planEvidenceLines({ dir: PR_LOOP_REPORT_DIR, at: '"$HEAD_SHA"', base: '"$BASE_SHA"', result: '"$PLAN_RESULT"', ...(bin ? { bin } : {}) }),
548
+ lines: planEvidenceLines({ dir: PR_LOOP_REPORT_DIR, at: '"$HEAD_SHA"', base: '"$BASE_SHA"', result: '"$PLAN_RESULT"', ...(bin ? { bin } : {}), ...member }),
138
549
  env: { HEAD_SHA: "${{ github.sha }}", BASE_SHA: "${{ github.event.pull_request.base.sha }}", PLAN_RESULT: `\${{ needs.${planJob}.result }}`, ...key },
139
550
  ...(evidenceKeyless(evidence) ? { idToken: true } : {}),
140
551
  };
package/dist/config.d.ts CHANGED
@@ -155,6 +155,7 @@ export declare const ChantConfigSchema: z.ZodObject<{
155
155
  name: z.ZodString;
156
156
  build: z.ZodString;
157
157
  archive: z.ZodString;
158
+ platforms: z.ZodOptional<z.ZodArray<z.ZodString>>;
158
159
  }, z.core.$strict>, z.ZodObject<{
159
160
  name: z.ZodString;
160
161
  dockerfile: z.ZodString;
@@ -162,6 +163,7 @@ export declare const ChantConfigSchema: z.ZodObject<{
162
163
  platforms: z.ZodOptional<z.ZodArray<z.ZodString>>;
163
164
  archive: z.ZodOptional<z.ZodString>;
164
165
  prepare: z.ZodOptional<z.ZodString>;
166
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
165
167
  }, z.core.$strict>]>>>;
166
168
  lane: z.ZodOptional<z.ZodString>;
167
169
  version: z.ZodOptional<z.ZodObject<{
@@ -518,8 +520,8 @@ export interface ChantConfig {
518
520
  * digest and hands every digest to the build through `CHANT_RELEASE_DIGESTS`,
519
521
  * so a package can pin the images it ships with. An `oci` target pushes
520
522
  * the archive. An entry may name a `dockerfile` (with `context`,
521
- * `platforms`, `archive` and `prepare`) in place of `build`, and chant
522
- * runs the reproducible build itself (#4819). See
523
+ * `platforms`, `archive`, `prepare` and `args`) in place of `build`, and
524
+ * chant runs the reproducible build itself (#4819, #4908). See
523
525
  * ./lifecycle/release-images.ts.
524
526
  */
525
527
  images?: import("./lifecycle/release-images.js").ReleaseImageDeclaration[];
@@ -810,10 +812,12 @@ export declare function resolveSourceDir(projectDir: string, config: {
810
812
  /**
811
813
  * The top-level directories a root build leaves out (#4794): a project with
812
814
  * no `sourceDir`, built from its own root, does not load `scripts/`, where a
813
- * script that runs on load (prints and exits) would take the build's place.
814
- * Matched against the path relative to the project root, so only the
815
- * project's own top-level `scripts/` is skipped. The config's `include`
816
- * brings it back. Test and spec files are left out of every build already
815
+ * script that runs on load (prints and exits) would take the build's place,
816
+ * nor `migrations/` (#4921), whose `.sql` files are `ALTER`s of objects
817
+ * declared elsewhere and whose backfill scripts run on load too. Matched
818
+ * against the path relative to the project root, so only the project's own
819
+ * top-level directories are skipped. The config's `include` brings one back.
820
+ * Test and spec files are left out of every build already
817
821
  * (`isSourceFileName`).
818
822
  */
819
823
  export declare const ROOT_SOURCE_EXCLUDES: readonly string[];
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAuB,KAAK,UAAU,EAAE,MAAM,mCAAmC,CAAC;AACzF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAG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