@intentius/chant 0.124.88 → 0.124.90

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 (377) hide show
  1. package/dist/actor.d.ts +36 -1
  2. package/dist/actor.d.ts.map +1 -1
  3. package/dist/actor.js +39 -1
  4. package/dist/chant-install.d.ts.map +1 -1
  5. package/dist/chant-install.js +1 -2
  6. package/dist/ci-base.d.ts +30 -0
  7. package/dist/ci-base.d.ts.map +1 -0
  8. package/dist/ci-base.js +33 -0
  9. package/dist/ci-comment-commands.d.ts +193 -0
  10. package/dist/ci-comment-commands.d.ts.map +1 -0
  11. package/dist/ci-comment-commands.js +353 -0
  12. package/dist/ci-comment-replies.d.ts +40 -0
  13. package/dist/ci-comment-replies.d.ts.map +1 -0
  14. package/dist/ci-comment-replies.js +59 -0
  15. package/dist/ci-evidence-from-job.d.ts +25 -0
  16. package/dist/ci-evidence-from-job.d.ts.map +1 -1
  17. package/dist/ci-evidence-from-job.js +43 -2
  18. package/dist/ci-evidence-jobs.d.ts +30 -1
  19. package/dist/ci-evidence-jobs.d.ts.map +1 -1
  20. package/dist/ci-evidence-jobs.js +46 -3
  21. package/dist/ci-image.d.ts +21 -4
  22. package/dist/ci-image.d.ts.map +1 -1
  23. package/dist/ci-image.js +62 -10
  24. package/dist/ci-job-guard.d.ts +42 -45
  25. package/dist/ci-job-guard.d.ts.map +1 -1
  26. package/dist/ci-job-guard.js +206 -3
  27. package/dist/ci-note-commands.d.ts +104 -4
  28. package/dist/ci-note-commands.d.ts.map +1 -1
  29. package/dist/ci-note-commands.js +131 -38
  30. package/dist/ci-product-words.d.ts +42 -0
  31. package/dist/ci-product-words.d.ts.map +1 -1
  32. package/dist/ci-product-words.js +25 -0
  33. package/dist/ci-product.d.ts +72 -1
  34. package/dist/ci-product.d.ts.map +1 -1
  35. package/dist/ci-product.js +73 -6
  36. package/dist/cli/commands/build.d.ts.map +1 -1
  37. package/dist/cli/commands/build.js +29 -2
  38. package/dist/cli/handlers/approve.d.ts.map +1 -1
  39. package/dist/cli/handlers/approve.js +2 -1
  40. package/dist/cli/handlers/ci-check.d.ts +1 -1
  41. package/dist/cli/handlers/ci-check.d.ts.map +1 -1
  42. package/dist/cli/handlers/ci-check.js +17 -7
  43. package/dist/cli/handlers/ci-evidence.d.ts.map +1 -1
  44. package/dist/cli/handlers/ci-evidence.js +33 -7
  45. package/dist/cli/handlers/components.d.ts.map +1 -1
  46. package/dist/cli/handlers/components.js +3 -1
  47. package/dist/cli/handlers/generated-check.d.ts +8 -0
  48. package/dist/cli/handlers/generated-check.d.ts.map +1 -1
  49. package/dist/cli/handlers/generated-check.js +31 -1
  50. package/dist/cli/handlers/lock.d.ts.map +1 -1
  51. package/dist/cli/handlers/lock.js +121 -4
  52. package/dist/cli/handlers/pr-comment.d.ts +33 -0
  53. package/dist/cli/handlers/pr-comment.d.ts.map +1 -0
  54. package/dist/cli/handlers/pr-comment.js +201 -0
  55. package/dist/cli/handlers/pr-env.d.ts.map +1 -1
  56. package/dist/cli/handlers/pr-env.js +6 -3
  57. package/dist/cli/handlers/pr-notes.d.ts.map +1 -1
  58. package/dist/cli/handlers/pr-notes.js +23 -1
  59. package/dist/cli/handlers/pr.d.ts +23 -1
  60. package/dist/cli/handlers/pr.d.ts.map +1 -1
  61. package/dist/cli/handlers/pr.js +71 -23
  62. package/dist/cli/handlers/promote.d.ts.map +1 -1
  63. package/dist/cli/handlers/promote.js +2 -1
  64. package/dist/cli/handlers/release.d.ts.map +1 -1
  65. package/dist/cli/handlers/release.js +11 -2
  66. package/dist/cli/handlers/run-wave.d.ts.map +1 -1
  67. package/dist/cli/handlers/run-wave.js +180 -4
  68. package/dist/cli/handlers/run.d.ts.map +1 -1
  69. package/dist/cli/handlers/run.js +2 -1
  70. package/dist/cli/main.d.ts.map +1 -1
  71. package/dist/cli/main.js +41 -2
  72. package/dist/cli/parse-args.d.ts.map +1 -1
  73. package/dist/cli/parse-args.js +31 -0
  74. package/dist/cli/registry.d.ts +19 -1
  75. package/dist/cli/registry.d.ts.map +1 -1
  76. package/dist/components/auto-release.d.ts.map +1 -1
  77. package/dist/components/auto-release.js +2 -1
  78. package/dist/components/pr-checks.d.ts +97 -6
  79. package/dist/components/pr-checks.d.ts.map +1 -1
  80. package/dist/components/pr-checks.js +107 -13
  81. package/dist/components/pr-pipeline.d.ts +19 -14
  82. package/dist/components/pr-pipeline.d.ts.map +1 -1
  83. package/dist/components/pr-pipeline.js +7 -13
  84. package/dist/components/product-pipeline.d.ts +96 -3
  85. package/dist/components/product-pipeline.d.ts.map +1 -1
  86. package/dist/components/product-pipeline.js +120 -14
  87. package/dist/components/product-plan.d.ts +203 -6
  88. package/dist/components/product-plan.d.ts.map +1 -1
  89. package/dist/components/product-plan.js +250 -43
  90. package/dist/drift-record.d.ts +7 -0
  91. package/dist/drift-record.d.ts.map +1 -1
  92. package/dist/drift-record.js +19 -0
  93. package/dist/floor-table.data.d.ts.map +1 -1
  94. package/dist/floor-table.data.js +63 -31
  95. package/dist/forge-check/contract.d.ts +11 -1
  96. package/dist/forge-check/contract.d.ts.map +1 -1
  97. package/dist/forge-check/contract.js +4 -1
  98. package/dist/forge-check/index.d.ts +2 -0
  99. package/dist/forge-check/index.d.ts.map +1 -1
  100. package/dist/forge-check/index.js +2 -0
  101. package/dist/gate-resume-run.d.ts +9 -1
  102. package/dist/gate-resume-run.d.ts.map +1 -1
  103. package/dist/gate-resume-run.js +26 -3
  104. package/dist/generated-check.d.ts +18 -4
  105. package/dist/generated-check.d.ts.map +1 -1
  106. package/dist/generated-check.js +37 -5
  107. package/dist/image-pins.d.ts +26 -0
  108. package/dist/image-pins.d.ts.map +1 -0
  109. package/dist/image-pins.js +19 -0
  110. package/dist/lexicon.d.ts +93 -4
  111. package/dist/lexicon.d.ts.map +1 -1
  112. package/dist/lifecycle/gate-applied.d.ts +9 -0
  113. package/dist/lifecycle/gate-applied.d.ts.map +1 -1
  114. package/dist/lifecycle/git.d.ts +11 -0
  115. package/dist/lifecycle/git.d.ts.map +1 -1
  116. package/dist/lifecycle/git.js +30 -3
  117. package/dist/lifecycle/publish-npm.d.ts +11 -0
  118. package/dist/lifecycle/publish-npm.d.ts.map +1 -1
  119. package/dist/lifecycle/publish-npm.js +27 -1
  120. package/dist/lifecycle/reach-locks.d.ts +131 -0
  121. package/dist/lifecycle/reach-locks.d.ts.map +1 -0
  122. package/dist/lifecycle/reach-locks.js +118 -0
  123. package/dist/lifecycle/release-cut.d.ts +3 -1
  124. package/dist/lifecycle/release-cut.d.ts.map +1 -1
  125. package/dist/lifecycle/release-cut.js +15 -0
  126. package/dist/lifecycle/release-images.d.ts.map +1 -1
  127. package/dist/lifecycle/release-images.js +1 -2
  128. package/dist/notify-product.d.ts +12 -3
  129. package/dist/notify-product.d.ts.map +1 -1
  130. package/dist/notify-product.js +10 -6
  131. package/dist/op/activities/source-release.d.ts.map +1 -1
  132. package/dist/op/activities/source-release.js +2 -1
  133. package/dist/op/activities/source-rollback.d.ts.map +1 -1
  134. package/dist/op/activities/source-rollback.js +2 -1
  135. package/dist/op/apply-status.d.ts +84 -0
  136. package/dist/op/apply-status.d.ts.map +1 -0
  137. package/dist/op/apply-status.js +106 -0
  138. package/dist/op/before-merge-decide.d.ts +102 -0
  139. package/dist/op/before-merge-decide.d.ts.map +1 -0
  140. package/dist/op/before-merge-decide.js +142 -0
  141. package/dist/op/before-merge-done.d.ts +56 -0
  142. package/dist/op/before-merge-done.d.ts.map +1 -0
  143. package/dist/op/before-merge-done.js +69 -0
  144. package/dist/op/before-merge-store.d.ts +20 -0
  145. package/dist/op/before-merge-store.d.ts.map +1 -0
  146. package/dist/op/before-merge-store.js +48 -0
  147. package/dist/op/before-merge.d.ts +150 -0
  148. package/dist/op/before-merge.d.ts.map +1 -0
  149. package/dist/op/before-merge.js +207 -0
  150. package/dist/op/follow-on-run.d.ts +117 -0
  151. package/dist/op/follow-on-run.d.ts.map +1 -0
  152. package/dist/op/follow-on-run.js +154 -0
  153. package/dist/op/follow-on-store.d.ts +17 -0
  154. package/dist/op/follow-on-store.d.ts.map +1 -0
  155. package/dist/op/follow-on-store.js +54 -0
  156. package/dist/op/gate.d.ts +6 -0
  157. package/dist/op/gate.d.ts.map +1 -1
  158. package/dist/op/gate.js +10 -1
  159. package/dist/op/index.d.ts +5 -1
  160. package/dist/op/index.d.ts.map +1 -1
  161. package/dist/op/index.js +2 -0
  162. package/dist/op/op-waves-after-plan.d.ts +13 -0
  163. package/dist/op/op-waves-after-plan.d.ts.map +1 -1
  164. package/dist/op/op-waves-evidence-jobs.d.ts +10 -2
  165. package/dist/op/op-waves-evidence-jobs.d.ts.map +1 -1
  166. package/dist/op/op-waves-evidence-jobs.js +19 -5
  167. package/dist/op/op-waves-follow-on.d.ts +162 -0
  168. package/dist/op/op-waves-follow-on.d.ts.map +1 -0
  169. package/dist/op/op-waves-follow-on.js +355 -0
  170. package/dist/op/op-waves-render-spec.d.ts +100 -0
  171. package/dist/op/op-waves-render-spec.d.ts.map +1 -0
  172. package/dist/op/op-waves-render-spec.js +162 -0
  173. package/dist/op/op-waves-run.d.ts +148 -6
  174. package/dist/op/op-waves-run.d.ts.map +1 -1
  175. package/dist/op/op-waves-run.js +873 -100
  176. package/dist/op/op-waves-split.d.ts +122 -0
  177. package/dist/op/op-waves-split.d.ts.map +1 -0
  178. package/dist/op/op-waves-split.js +166 -0
  179. package/dist/op/op-waves.d.ts +24 -0
  180. package/dist/op/op-waves.d.ts.map +1 -1
  181. package/dist/op/op-waves.js +18 -1
  182. package/dist/op/schedule-overdue.d.ts +15 -1
  183. package/dist/op/schedule-overdue.d.ts.map +1 -1
  184. package/dist/op/schedule-overdue.js +77 -5
  185. package/dist/op/stage-hooks.d.ts +36 -1
  186. package/dist/op/stage-hooks.d.ts.map +1 -1
  187. package/dist/op/stage-hooks.js +17 -3
  188. package/dist/op/wave-stop.d.ts +67 -0
  189. package/dist/op/wave-stop.d.ts.map +1 -0
  190. package/dist/op/wave-stop.js +129 -0
  191. package/dist/planned-files.d.ts +76 -0
  192. package/dist/planned-files.d.ts.map +1 -0
  193. package/dist/planned-files.js +108 -0
  194. package/dist/pr-forge-job.d.ts +22 -0
  195. package/dist/pr-forge-job.d.ts.map +1 -0
  196. package/dist/pr-forge-job.js +46 -0
  197. package/dist/pr-loop.d.ts +3 -6
  198. package/dist/pr-loop.d.ts.map +1 -1
  199. package/dist/pr-loop.js +4 -81
  200. package/dist/pr-plan-note.d.ts +97 -0
  201. package/dist/pr-plan-note.d.ts.map +1 -1
  202. package/dist/pr-plan-note.js +94 -1
  203. package/dist/pr-post.d.ts +28 -3
  204. package/dist/pr-post.d.ts.map +1 -1
  205. package/dist/pr-post.js +146 -13
  206. package/dist/pr-status.d.ts +16 -0
  207. package/dist/pr-status.d.ts.map +1 -0
  208. package/dist/pr-status.js +90 -0
  209. package/dist/ref-gate-init.d.ts +16 -2
  210. package/dist/ref-gate-init.d.ts.map +1 -1
  211. package/dist/ref-gate-init.js +24 -13
  212. package/dist/release-floors.d.ts +39 -1
  213. package/dist/release-floors.d.ts.map +1 -1
  214. package/dist/release-floors.js +63 -25
  215. package/dist/render-module.d.ts +15 -0
  216. package/dist/render-module.d.ts.map +1 -0
  217. package/dist/render-module.js +73 -0
  218. package/dist/state-migration.d.ts.map +1 -1
  219. package/dist/state-migration.js +1 -2
  220. package/dist/wave-blocked.d.ts +7 -1
  221. package/dist/wave-blocked.d.ts.map +1 -1
  222. package/dist/wave-blocked.js +7 -2
  223. package/dist/wave-runtime.mjs +366 -350
  224. package/dist/workspace/ci-green-cli.d.ts.map +1 -1
  225. package/dist/workspace/ci-green-cli.js +3 -2
  226. package/dist/workspace/release-train.d.ts.map +1 -1
  227. package/dist/workspace/release-train.js +2 -1
  228. package/dist/workspace/release-workflow.d.ts +4 -3
  229. package/dist/workspace/release-workflow.d.ts.map +1 -1
  230. package/dist/workspace/release-workflow.js +10 -7
  231. package/dist/workspace/trust/check-evidence-report.d.ts +7 -2
  232. package/dist/workspace/trust/check-evidence-report.d.ts.map +1 -1
  233. package/dist/workspace/trust/check-evidence-report.js +15 -8
  234. package/dist/workspace/trust/ref-gate-cli.d.ts +10 -1
  235. package/dist/workspace/trust/ref-gate-cli.d.ts.map +1 -1
  236. package/dist/workspace/trust/ref-gate-cli.js +30 -10
  237. package/dist/workspace/workspace-run.d.ts.map +1 -1
  238. package/dist/workspace/workspace-run.js +2 -1
  239. package/package.json +1 -1
  240. package/src/actor.test.ts +68 -2
  241. package/src/actor.ts +61 -1
  242. package/src/chant-install.test.ts +2 -3
  243. package/src/chant-install.ts +1 -2
  244. package/src/ci-base.test.ts +41 -0
  245. package/src/ci-base.ts +43 -0
  246. package/src/ci-comment-commands.test.ts +439 -0
  247. package/src/ci-comment-commands.ts +428 -0
  248. package/src/ci-comment-replies.ts +78 -0
  249. package/src/ci-commit.test.ts +2 -3
  250. package/src/ci-evidence-from-job.test.ts +18 -0
  251. package/src/ci-evidence-from-job.ts +58 -2
  252. package/src/ci-evidence-jobs.ts +50 -5
  253. package/src/ci-image.test.ts +130 -10
  254. package/src/ci-image.ts +85 -12
  255. package/src/ci-job-guard.before-merge.test.ts +148 -0
  256. package/src/ci-job-guard.follow-on-record.test.ts +137 -0
  257. package/src/ci-job-guard.follow-on.test.ts +144 -0
  258. package/src/ci-job-guard.ts +221 -3
  259. package/src/ci-note-commands.test.ts +76 -1
  260. package/src/ci-note-commands.ts +198 -46
  261. package/src/ci-product-words.ts +59 -0
  262. package/src/ci-product.ts +90 -6
  263. package/src/cli/commands/build.test.ts +41 -0
  264. package/src/cli/commands/build.ts +27 -2
  265. package/src/cli/handlers/approve.ts +2 -1
  266. package/src/cli/handlers/ci-check.ts +19 -7
  267. package/src/cli/handlers/ci-evidence.ts +29 -8
  268. package/src/cli/handlers/components.ts +3 -1
  269. package/src/cli/handlers/generated-check.ts +31 -1
  270. package/src/cli/handlers/lock-reach.test.ts +103 -0
  271. package/src/cli/handlers/lock.ts +100 -4
  272. package/src/cli/handlers/pr-comment.ts +187 -0
  273. package/src/cli/handlers/pr-env.ts +6 -3
  274. package/src/cli/handlers/pr-notes.ts +30 -6
  275. package/src/cli/handlers/pr-record.test.ts +1 -1
  276. package/src/cli/handlers/pr.ts +64 -21
  277. package/src/cli/handlers/promote.ts +2 -1
  278. package/src/cli/handlers/release.e2e.test.ts +35 -0
  279. package/src/cli/handlers/release.ts +14 -2
  280. package/src/cli/handlers/run-wave.ts +170 -4
  281. package/src/cli/handlers/run.ts +2 -1
  282. package/src/cli/main.ts +41 -2
  283. package/src/cli/parse-args.ts +23 -0
  284. package/src/cli/registry.ts +19 -1
  285. package/src/components/auto-release.ts +2 -1
  286. package/src/components/pr-checks.ts +165 -17
  287. package/src/components/pr-pipeline.ts +22 -18
  288. package/src/components/product-pipeline.apply-status.test.ts +50 -0
  289. package/src/components/product-pipeline.ts +204 -17
  290. package/src/components/product-plan.test.ts +60 -4
  291. package/src/components/product-plan.ts +367 -50
  292. package/src/drift-record.test.ts +20 -0
  293. package/src/drift-record.ts +16 -0
  294. package/src/floor-table.data.ts +63 -31
  295. package/src/forge-check/contract.ts +12 -1
  296. package/src/forge-check/forge-check.test.ts +17 -0
  297. package/src/forge-check/index.ts +2 -0
  298. package/src/gate-resume-run.ts +27 -3
  299. package/src/generated-check.e2e.test.ts +21 -1
  300. package/src/generated-check.test.ts +66 -0
  301. package/src/generated-check.ts +51 -10
  302. package/src/image-pins.ts +31 -0
  303. package/src/lexicon.ts +89 -1
  304. package/src/lifecycle/gate-applied.ts +7 -0
  305. package/src/lifecycle/git.test.ts +48 -0
  306. package/src/lifecycle/git.ts +27 -4
  307. package/src/lifecycle/publish-npm.ts +31 -1
  308. package/src/lifecycle/reach-locks.test.ts +87 -0
  309. package/src/lifecycle/reach-locks.ts +169 -0
  310. package/src/lifecycle/release-cut.ts +17 -1
  311. package/src/lifecycle/release-images.test.ts +56 -0
  312. package/src/lifecycle/release-images.ts +1 -2
  313. package/src/notify-product.ts +19 -8
  314. package/src/op/activities/source-release.ts +2 -1
  315. package/src/op/activities/source-rollback.ts +2 -1
  316. package/src/op/apply-status.test.ts +83 -0
  317. package/src/op/apply-status.ts +132 -0
  318. package/src/op/before-merge-decide.ts +190 -0
  319. package/src/op/before-merge-done.ts +99 -0
  320. package/src/op/before-merge-store.ts +44 -0
  321. package/src/op/before-merge.test.ts +201 -0
  322. package/src/op/before-merge.ts +266 -0
  323. package/src/op/follow-on-run.ts +206 -0
  324. package/src/op/follow-on-store.ts +54 -0
  325. package/src/op/gate-resume.test.ts +27 -0
  326. package/src/op/gate.ts +16 -1
  327. package/src/op/index.ts +15 -0
  328. package/src/op/op-waves-after-plan.ts +13 -0
  329. package/src/op/op-waves-evidence-jobs.ts +21 -7
  330. package/src/op/op-waves-follow-on-record.test.ts +152 -0
  331. package/src/op/op-waves-follow-on.test.ts +247 -0
  332. package/src/op/op-waves-follow-on.ts +385 -0
  333. package/src/op/op-waves-notify-words.test.ts +18 -0
  334. package/src/op/op-waves-render-spec.test.ts +159 -0
  335. package/src/op/op-waves-render-spec.ts +171 -0
  336. package/src/op/op-waves-run.ts +973 -94
  337. package/src/op/op-waves-split-product.test.ts +288 -0
  338. package/src/op/op-waves-split-step.test.ts +298 -0
  339. package/src/op/op-waves-split.test.ts +196 -0
  340. package/src/op/op-waves-split.ts +189 -0
  341. package/src/op/op-waves.ts +31 -3
  342. package/src/op/schedule-overdue.test.ts +72 -1
  343. package/src/op/schedule-overdue.ts +84 -6
  344. package/src/op/stage-hooks.ts +52 -4
  345. package/src/op/wave-stop.test.ts +72 -0
  346. package/src/op/wave-stop.ts +139 -0
  347. package/src/planned-files.test.ts +80 -0
  348. package/src/planned-files.ts +134 -0
  349. package/src/pr-forge-job.test.ts +53 -0
  350. package/src/pr-forge-job.ts +46 -0
  351. package/src/pr-loop-narrowed.test.ts +2 -1
  352. package/src/pr-loop-words.test.ts +2 -1
  353. package/src/pr-loop.test.ts +1 -2
  354. package/src/pr-loop.ts +4 -80
  355. package/src/pr-plan-note.ts +155 -3
  356. package/src/pr-post-replan.test.ts +144 -0
  357. package/src/pr-post-subject.test.ts +230 -0
  358. package/src/pr-post.test.ts +2 -1
  359. package/src/pr-post.ts +151 -15
  360. package/src/pr-status.ts +91 -0
  361. package/src/ref-gate-init.ts +30 -11
  362. package/src/release-floors.ts +81 -25
  363. package/src/render-module.ts +73 -0
  364. package/src/state-migration-record.test.ts +2 -3
  365. package/src/state-migration.ts +1 -2
  366. package/src/wave-blocked.ts +9 -4
  367. package/src/workspace/ci-green-cli.ts +3 -2
  368. package/src/workspace/ci-green-workflow.test.ts +32 -1
  369. package/src/workspace/release-train.ts +2 -1
  370. package/src/workspace/release-workflow.test.ts +36 -5
  371. package/src/workspace/release-workflow.ts +10 -7
  372. package/src/workspace/trust/check-evidence-report.ts +15 -8
  373. package/src/workspace/trust/check-evidence.test.ts +5 -0
  374. package/src/workspace/trust/ref-gate-cli.ts +30 -8
  375. package/src/workspace/trust/ref-gate-pieces.test.ts +46 -1
  376. package/src/workspace/trust/ref-gate.test.ts +10 -0
  377. package/src/workspace/workspace-run.ts +2 -1
package/src/pr-post.ts CHANGED
@@ -32,16 +32,17 @@
32
32
  import { appendFileSync, existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
33
33
  import { tmpdir } from "node:os";
34
34
  import { join } from "node:path";
35
- import { prNoteMarker, prStatusContext, prStatusDescription, prStatusState, renderPrNote, type PrOverdue, type PrReport } from "./pr-loop";
35
+ import { prNoteMarker, prStatusContext, renderPrNote, type PrOverdue, type PrReport } from "./pr-loop";
36
+ import { prStatusDescription, prStatusState } from "./pr-status";
36
37
  import { forgePrincipalOf, type PrForge } from "./pr-forge";
37
- import { GITHUB_COMMENT_LIMIT, GITLAB_NOTE_LIMIT } from "./plan-summary";
38
+ import { fitNote, GITHUB_COMMENT_LIMIT, GITLAB_NOTE_LIMIT } from "./plan-summary";
38
39
  import { activeProductWords, commentLine, type CiProductWords } from "./ci-product-words";
39
40
  import { controlEdgeFactsFromEnv, remarkCrossStackEdges, type ControlEdgeFacts } from "./control/edges";
40
41
  import { CHECK_EVIDENCE_FILE, checkEvidenceNoteLine, openEvidenceFor } from "./workspace/trust/check-evidence-report";
41
42
  import { PLAN_RUN_RECORD_FILE, readPlanRunRecord } from "./pr-plan-record";
42
43
  import type { OpRunRecordInput } from "./op/runtime";
43
44
  import type { RunOrigin } from "./lifecycle/release-ledger";
44
- import { isPlanNote, planNoteMarker, PR_PLAN_NOTE_CONTRACT, PR_PLAN_NOTE_FILE, PRODUCT_MARKER_BODY, PRODUCT_MARKER_LIMIT, PRODUCT_MARKER_NAME, productMarkerLine, renderPlanNote, type PrPlanNoteHandoff, type PrPlanNoteWords } from "./pr-plan-note";
45
+ import { isPlanNote, PLAN_BODY_LIMIT, PLAN_SUBJECT_LIMIT, planNoteMarker, planSubjectProblem, PR_PLAN_NOTE_CONTRACT, PR_PLAN_NOTE_FILE, PRODUCT_MARKER_BODY, PRODUCT_MARKER_LIMIT, PRODUCT_MARKER_NAME, productMarkerLine, renderPlanNote, sinceLastLine, type PrPlanBodyHandoff, type PrPlanNoteHandoff, type PrPlanNoteWords, type PrPlanSubject } from "./pr-plan-note";
45
46
 
46
47
  /** The plan report's file under the report directory. */
47
48
  export const PR_PLAN_REPORT_FILE = "pr-plan.json";
@@ -107,6 +108,14 @@ export interface PlanPostInput {
107
108
  * pushes. `keep` returns a warning to say, when there is one.
108
109
  */
109
110
  recordRun?: PlanRunRecorder;
111
+ /**
112
+ * The one argument a re-plan was narrowed to (#4963), such as a
113
+ * terragucci root: when the report or the hand-off says the change
114
+ * reaches nothing, the pull request gets a reply that the argument is not
115
+ * affected, and the note and the status stay as they were. Ignored when
116
+ * empty or not one plain word.
117
+ */
118
+ notAffected?: string;
110
119
  }
111
120
 
112
121
  /** How the note job keeps the plan job's run record (#4899). */
@@ -162,7 +171,7 @@ export function readPlanReport(input: Pick<PlanPostInput, "dir" | "pr" | "head"
162
171
  * The note for `report`, rendered here, with every `<!--` after the marker
163
172
  * line written as `&lt;!--`, so the note carries no hidden marker but its own.
164
173
  */
165
- export function planNoteFor(report: PrReport, forge: Pick<PrForge, "kind" | "host">, marker: string, baseTip?: string): string {
174
+ export function planNoteFor(report: PrReport, forge: Pick<PrForge, "kind" | "host">, marker: string, baseTip?: string, own?: string): string {
166
175
  const note = renderPrNote(report, {
167
176
  limit: forge.kind === "gitlab" ? GITLAB_NOTE_LIMIT : GITHUB_COMMENT_LIMIT,
168
177
  approver: forgePrincipalOf(forge.kind, forge.host, "<your-login>"),
@@ -171,7 +180,43 @@ export function planNoteFor(report: PrReport, forge: Pick<PrForge, "kind" | "hos
171
180
  const rest = (at < 0 ? "" : note.slice(at + 1)).split("<!--").join("&lt;!--");
172
181
  // #4628: the tip line is written after the defusing, from the caller's sha, never the report's.
173
182
  const tip = baseTip && SHA.test(baseTip) ? `${rest.endsWith("\n") ? "" : "\n"}${prNoteTipMarker(baseTip)}\n` : "";
174
- return `${marker}\n${rest}${tip}`;
183
+ // #4963: the product's own line, already checked, under chant's marker.
184
+ return `${marker}\n${own ? `${own}\n` : ""}${rest}${tip}`;
185
+ }
186
+
187
+ /**
188
+ * The product's hidden line for a report or a hand-off (#4931, #4963): from
189
+ * the pipeline's `productMarker` and the file's `marker`, checked against
190
+ * {@link PRODUCT_MARKER_BODY}. Undefined when either is missing or the
191
+ * marker is not plain words.
192
+ */
193
+ function productLineOf(name: string | undefined, marker: unknown): string | undefined {
194
+ if (name === undefined || !PRODUCT_MARKER_NAME.test(name) || typeof marker !== "string" || marker.length > PRODUCT_MARKER_LIMIT) return undefined;
195
+ if (marker !== "" && !PRODUCT_MARKER_BODY.test(marker)) return undefined;
196
+ return productMarkerLine(name, marker);
197
+ }
198
+
199
+ /** The one plain word a re-plan was narrowed to (#4963), or undefined. */
200
+ function narrowedTo(input: Pick<PlanPostInput, "notAffected">): string | undefined {
201
+ const a = input.notAffected?.trim();
202
+ // #4984: a word that starts with `-` is a flag, never the argument a re-plan was narrowed to.
203
+ return a && /^[A-Za-z0-9_.\/@+=,:][A-Za-z0-9_.\/@+=,:-]*$/.test(a) ? a : undefined;
204
+ }
205
+
206
+ /**
207
+ * The reply for a re-plan narrowed to an argument the change does not
208
+ * reach (#4963), in place of the note and the status, as terragucci's
209
+ * plan-note job replied (plan-note.ts).
210
+ */
211
+ async function replyNotAffected(input: PlanPostInput, argument: string, state: PlanPostResult["state"], warnings: string[]): Promise<PlanPostResult> {
212
+ const description = `${argument} is not affected by this pull request, so nothing was planned.`;
213
+ try {
214
+ await input.forge.addComment(input.pr, `${activeProductWords().product}: ${description}`);
215
+ } catch (err) {
216
+ warnings.push(`could not reply on #${input.pr}: ${err instanceof Error ? err.message : String(err)}`);
217
+ }
218
+ const recorded = await keepRunRecord(input, warnings);
219
+ return { state, description: cut(description), noted: false, ...(recorded ? { recorded } : {}), warnings };
175
220
  }
176
221
 
177
222
  /** The hidden line a note carries with the target branch's commit it was posted against (#4628). */
@@ -184,6 +229,55 @@ export function prNoteStaleMarker(sha: string): string {
184
229
  return `<!-- chant-pr-stale:${sha} -->`;
185
230
  }
186
231
 
232
+ /**
233
+ * The hidden line a note keeps its plan's subject in (#4972): base64url of
234
+ * the subject's JSON, `{ id }` alone when its parts would make the line
235
+ * longer than {@link PLAN_SUBJECT_LIMIT}. Undefined when even that is.
236
+ */
237
+ export function prNoteSubjectMarker(subject: PrPlanSubject): string | undefined {
238
+ const line = (s: PrPlanSubject) => `<!-- chant-pr-subject:${Buffer.from(JSON.stringify(s), "utf8").toString("base64url")} -->`;
239
+ const full = line(subject);
240
+ if (full.length <= PLAN_SUBJECT_LIMIT) return full;
241
+ const bare = line({ id: subject.id });
242
+ return bare.length <= PLAN_SUBJECT_LIMIT ? bare : undefined;
243
+ }
244
+
245
+ const SUBJECT_LINE = /^<!-- chant-pr-subject:([A-Za-z0-9_-]+) -->$/m;
246
+
247
+ /**
248
+ * The subject a note kept (#4972), checked again: the line was chant's, but
249
+ * what it holds came from an earlier plan job. Undefined when there is none.
250
+ */
251
+ export function subjectInNote(body: string): PrPlanSubject | undefined {
252
+ const m = SUBJECT_LINE.exec(body.replace(/\r\n/g, "\n"));
253
+ if (!m?.[1] || m[1].length > PLAN_SUBJECT_LIMIT) return undefined;
254
+ try {
255
+ const s = JSON.parse(Buffer.from(m[1], "base64url").toString("utf8")) as unknown;
256
+ return planSubjectProblem(s) === undefined ? (s as PrPlanSubject) : undefined;
257
+ } catch {
258
+ return undefined;
259
+ }
260
+ }
261
+
262
+ /**
263
+ * The line saying what changed since the previous note (#4972): the
264
+ * previous note of the same environment and member is read with the job's
265
+ * token, and its kept subject compared with the hand-off's. Undefined when
266
+ * there is no previous note, it kept no subject, or the id is the same. A
267
+ * forge that refuses the read is a warning.
268
+ */
269
+ async function sinceLastOf(input: PlanPostInput, subject: PrPlanSubject, words: PrPlanNoteWords | undefined, warnings: string[]): Promise<string | undefined> {
270
+ let found: { body: string } | undefined;
271
+ try {
272
+ found = await input.forge.findComment(input.pr, prNoteMarker(input.env, input.member));
273
+ } catch (err) {
274
+ warnings.push(`could not read the previous note on #${input.pr}, so the note does not say what changed since it: ${err instanceof Error ? err.message : String(err)}`);
275
+ return undefined;
276
+ }
277
+ const previous = found ? subjectInNote(found.body) : undefined;
278
+ return previous ? sinceLastLine(previous, subject, words ?? {}) : undefined;
279
+ }
280
+
187
281
  const TIP_LINE = /<!-- chant-pr-tip:([0-9a-f]{40}) -->/;
188
282
  const STALE_LINE = /<!-- chant-pr-stale:([0-9a-f]{40}) -->/;
189
283
  const STALE_PREFIX = "> Stale: ";
@@ -221,6 +315,9 @@ export async function postPlanReport(input: PlanPostInput): Promise<PlanPostResu
221
315
  description = cut(read.refused);
222
316
  } else {
223
317
  let report = read.report;
318
+ // #4963: a re-plan narrowed to an argument the change does not reach.
319
+ const narrowed = narrowedTo(input);
320
+ if (narrowed && report.status === "nothing" && !failedJob) return replyNotAffected(input, narrowed, "success", warnings);
224
321
  if (input.overdue) {
225
322
  const { overdue: _forged, ...rest } = report;
226
323
  const found = await input.overdue().catch(() => [] as PrOverdue[]);
@@ -235,7 +332,9 @@ export async function postPlanReport(input: PlanPostInput): Promise<PlanPostResu
235
332
  state = prStatusState(report);
236
333
  description = prStatusDescription(report);
237
334
  // A member the change does not reach has nothing to say on the pull request (as pr-plan's own publish).
238
- if (!(input.member && report.status === "nothing" && !report.overdue?.length && !report.migrations?.length)) note = planNoteFor(report, input.forge, prNoteMarker(input.env, input.member), input.baseTip);
335
+ // #4963: the report's own `marker`, under the pipeline's productMarker, as a hand-off's.
336
+ const own = productLineOf((input.noteWords ?? noteWordsFromEnv())?.productMarker, (read.report as { marker?: unknown }).marker);
337
+ if (!(input.member && report.status === "nothing" && !report.overdue?.length && !report.migrations?.length)) note = planNoteFor(report, input.forge, prNoteMarker(input.env, input.member), input.baseTip, own);
239
338
  } catch (err) {
240
339
  refused = `the plan report does not render: ${err instanceof Error ? err.message : String(err)}`;
241
340
  state = "failure";
@@ -336,7 +435,7 @@ async function postOutcome(
336
435
  * Read a product's plan note hand-off under `dir` (#4799) and check it is the
337
436
  * one the caller ran, as {@link readPlanReport} checks a report.
338
437
  */
339
- export function readPlanNoteHandoff(input: Pick<PlanPostInput, "dir" | "pr" | "head" | "env" | "member">): { handoff: PrPlanNoteHandoff } | { refused: string } {
438
+ export function readPlanNoteHandoff(input: Pick<PlanPostInput, "dir" | "pr" | "head" | "env" | "member">): { handoff: PrPlanNoteHandoff | PrPlanBodyHandoff } | { refused: string } {
340
439
  let doc: unknown;
341
440
  try {
342
441
  doc = JSON.parse(readFileSync(join(input.dir, PR_PLAN_NOTE_FILE), "utf-8"));
@@ -353,14 +452,39 @@ export function readPlanNoteHandoff(input: Pick<PlanPostInput, "dir" | "pr" | "h
353
452
  if ((r.member ?? undefined) !== input.member) return { refused: `the plan note is for ${JSON.stringify(r.member ?? null)}, not ${JSON.stringify(input.member ?? null)}` };
354
453
  if (r.state !== "success" && r.state !== "failure" && r.state !== "pending") return { refused: `the plan note's state ${JSON.stringify(r.state)} is not success, failure or pending` };
355
454
  if (typeof r.description !== "string") return { refused: "the plan note has no description" };
356
- if (!isPlanNote(r.note) || r.note.head !== r.head || !Array.isArray(r.note.waves) || !Array.isArray(r.note.groups) || !Array.isArray(r.note.named)) {
455
+ // #4963: the product's own text in place of a plan note.
456
+ if (r.body !== undefined) {
457
+ if (r.note !== undefined) return { refused: "the plan note gives both a note and a body; give one" };
458
+ if (typeof r.body !== "string" || r.body.length > PLAN_BODY_LIMIT) return { refused: `the plan note's body is not text of at most ${PLAN_BODY_LIMIT} characters` };
459
+ } else if (!isPlanNote(r.note) || r.note.head !== r.head || !Array.isArray(r.note.waves) || !Array.isArray(r.note.groups) || !Array.isArray(r.note.named)) {
357
460
  return { refused: "the plan note's note is not a plan note for its head" };
358
461
  }
359
462
  // #4931: the product's hidden line is the change's too, so it holds only plain words.
360
463
  if (r.marker !== undefined && (typeof r.marker !== "string" || r.marker.length > PRODUCT_MARKER_LIMIT || (r.marker !== "" && !PRODUCT_MARKER_BODY.test(r.marker)))) {
361
464
  return { refused: `the plan note's marker is not words of letters, digits and _.,/@+=:- of at most ${PRODUCT_MARKER_LIMIT} characters` };
362
465
  }
363
- return { handoff: doc as PrPlanNoteHandoff };
466
+ // #4972: the subject is kept in the note and said back in a later one, so it holds only plain words too.
467
+ const subjectProblem = r.subject !== undefined ? planSubjectProblem(r.subject) : undefined;
468
+ if (subjectProblem) return { refused: `the plan note's subject ${subjectProblem}` };
469
+ return { handoff: doc as PrPlanNoteHandoff | PrPlanBodyHandoff };
470
+ }
471
+
472
+ /**
473
+ * The note for a hand-off of the product's own text (#4963): chant's
474
+ * marker, the product's line, the body with every `<!--` defused, the
475
+ * notices as quoted lines under it, the tip line, cut to the forge's limit.
476
+ */
477
+ export function planBodyHandoffNote(handoff: PrPlanBodyHandoff, forge: Pick<PrForge, "kind">, marker: string, noteWords?: PrPlanNoteWords, baseTip?: string, notices: readonly string[] = []): string {
478
+ const limit = forge.kind === "gitlab" ? GITLAB_NOTE_LIMIT : GITHUB_COMMENT_LIMIT;
479
+ const line = productLineOf(noteWords?.productMarker, handoff.marker);
480
+ const head = `${marker}\n${line ? `${line}\n` : ""}`;
481
+ const said = notices.length > 0 ? `\n${notices.map((n) => `> ${n.split("<!--").join("&lt;!--")}`).join("\n")}\n` : "";
482
+ const tip = baseTip && SHA.test(baseTip) ? `${prNoteTipMarker(baseTip)}\n` : "";
483
+ // #4972: the subject, kept for the next note to compare with.
484
+ const kept = handoff.subject ? prNoteSubjectMarker(handoff.subject) : undefined;
485
+ const subject = kept ? `${kept}\n` : "";
486
+ const body = handoff.body.split("<!--").join("&lt;!--").replace(/\n*$/, "\n");
487
+ return `${head}${fitNote(body, { limit: Math.max(0, limit - head.length - said.length - tip.length - subject.length) })}${said}${tip}${subject}`;
364
488
  }
365
489
 
366
490
  /** The notices in the file `CHANT_PLAN_NOTE_NOTICES` names (#4931), one a line, or none when unset or unreadable. */
@@ -394,7 +518,10 @@ function noteWordsFromEnv(): PrPlanNoteWords | undefined {
394
518
  */
395
519
  export function planNoteHandoffNote(handoff: PrPlanNoteHandoff, forge: Pick<PrForge, "kind">, marker: string, noteWords?: PrPlanNoteWords, baseTip?: string): string {
396
520
  const words = activeProductWords();
397
- const rendered = renderPlanNote(handoff.note, { limit: forge.kind === "gitlab" ? GITLAB_NOTE_LIMIT : GITHUB_COMMENT_LIMIT, words, ...(noteWords ? { note: noteWords } : {}) });
521
+ // #4972: the subject, kept for the next note to compare with, within the forge's limit.
522
+ const kept = handoff.subject ? prNoteSubjectMarker(handoff.subject) : undefined;
523
+ const limit = (forge.kind === "gitlab" ? GITLAB_NOTE_LIMIT : GITHUB_COMMENT_LIMIT) - (kept ? kept.length + 1 : 0);
524
+ const rendered = renderPlanNote(handoff.note, { limit, words, ...(noteWords ? { note: noteWords } : {}) });
398
525
  let body = rendered.split("<!--").join("&lt;!--");
399
526
  const n = handoff.note;
400
527
  const previews = n.previews ?? [];
@@ -404,7 +531,8 @@ export function planNoteHandoffNote(handoff: PrPlanNoteHandoff, forge: Pick<PrFo
404
531
  // #4931: the product's own line, from the pipeline's name and the hand-off's checked body, under chant's marker.
405
532
  const name = noteWords?.productMarker;
406
533
  const own = name !== undefined && PRODUCT_MARKER_NAME.test(name) && handoff.marker !== undefined ? `${productMarkerLine(name, handoff.marker)}\n` : "";
407
- return `${marker}\n${own}${body}${tip}`;
534
+ const subject = kept ? `${body.endsWith("\n") || tip ? "" : "\n"}${kept}\n` : "";
535
+ return `${marker}\n${own}${body}${tip}${subject}`;
408
536
  }
409
537
 
410
538
  /** {@link postPlanReport} for a product's plan note hand-off (#4799). */
@@ -424,14 +552,22 @@ async function postPlanNoteHandoff(input: PlanPostInput): Promise<PlanPostResult
424
552
  } else {
425
553
  state = read.handoff.state;
426
554
  description = read.handoff.description;
555
+ const h = read.handoff;
556
+ // #4963: a re-plan narrowed to an argument the change does not reach.
557
+ const narrowed = narrowedTo(input);
558
+ if (narrowed && "note" in h && h.note.nothing === true && !failedJob) return replyNotAffected(input, narrowed, state, warnings);
427
559
  // #4931: the overdue Ops (#4289), asked here with the job's token, and the note job's own notices, under the counts.
428
- const given = read.handoff.note.notices ?? [];
560
+ const given = "note" in h ? (h.note.notices ?? []) : [];
429
561
  // An Op the product's own notices already call overdue is not said twice.
430
562
  const overdue = input.overdue ? (await input.overdue().catch(() => [] as PrOverdue[])).filter((o) => !given.some((g) => g.includes(`\`${o.op}\``) && g.includes("overdue"))).map((o) => o.message) : [];
431
- const added = [...overdue, ...(input.notices ?? noticesFromEnv())].filter((n, i, all) => !given.includes(n) && all.indexOf(n) === i);
432
- const handoff = added.length > 0 ? { ...read.handoff, note: { ...read.handoff.note, notices: [...given, ...added] } } : read.handoff;
563
+ const noteWords = input.noteWords ?? noteWordsFromEnv();
564
+ // #4972: what changed since the previous note, from the subject it kept, read here with the job's token.
565
+ const since = h.subject ? await sinceLastOf(input, h.subject, noteWords, warnings) : undefined;
566
+ const added = [...(since ? [since] : []), ...overdue, ...(input.notices ?? noticesFromEnv())].filter((n, i, all) => !given.includes(n) && all.indexOf(n) === i);
433
567
  try {
434
- note = planNoteHandoffNote(handoff, input.forge, prNoteMarker(input.env, input.member), input.noteWords ?? noteWordsFromEnv(), input.baseTip);
568
+ note = "note" in h
569
+ ? planNoteHandoffNote(added.length > 0 ? { ...h, note: { ...h.note, notices: [...given, ...added] } } : h, input.forge, prNoteMarker(input.env, input.member), noteWords, input.baseTip)
570
+ : planBodyHandoffNote(h, input.forge, prNoteMarker(input.env, input.member), noteWords, input.baseTip, added);
435
571
  } catch (err) {
436
572
  refused = `the plan note does not render: ${err instanceof Error ? err.message : String(err)}`;
437
573
  state = "failure";
@@ -0,0 +1,91 @@
1
+ /**
2
+ * The pull-request loop's commit status (#3183): its description and its
3
+ * state, from the report `chant components pr-plan` and `pr-apply` write.
4
+ *
5
+ * They lived in `./pr-loop.ts` until #4966 moved them here, so the bundle
6
+ * a product builds from `pr-loop.ts` and `pr-forge.ts` (the report, the note
7
+ * and the forge clients, `pr-loop-bundle.test.ts`) keeps room under its
8
+ * ceiling. chant's own handlers post the status; no product reads these.
9
+ */
10
+
11
+ import { activeProductWords, type CiProductWords } from "./ci-product-words";
12
+ import { memberHoleReasons, type PrReport } from "./pr-loop";
13
+
14
+ /** A commit status's description, at most 140 characters (GitHub's limit). */
15
+ export function prStatusDescription(report: PrReport, words: CiProductWords = activeProductWords()): string {
16
+ const n = report.members.length;
17
+ const many = (k: number): string => `${k} ${words.noun[k === 1 ? 0 : 1]}`;
18
+ const sum = report.members.reduce(
19
+ (acc, m) => ({ change: acc.change + m.counts.create + m.counts.update + m.counts.replace, destroy: acc.destroy + m.counts.delete + m.counts.replace }),
20
+ { change: 0, destroy: 0 },
21
+ );
22
+ const digest = report.digest ? `; plan ${report.digest.replace(/^(?:jcs1-)?sha256:/, "").slice(0, 12)}` : "";
23
+ let text: string;
24
+ switch (report.status) {
25
+ case "nothing":
26
+ text = "nothing to plan";
27
+ break;
28
+ case "planned": {
29
+ const unknown = report.members.filter((m) => memberHoleReasons(report, m.member).length > 0).length;
30
+ // #4626: a narrowed plan says so in its status.
31
+ const narrowed = Object.values(report.narrowed ?? {}).filter((a) => a.length > 0).length;
32
+ text = `${many(n)}${narrowed > 0 ? ` (${narrowed} narrowed with --target)` : ""}: ${sum.change} to change, ${sum.destroy} to destroy or replace${unknown > 0 ? `, ${unknown} with holes` : ""}${digest}`;
33
+ break;
34
+ }
35
+ case "plan-failed":
36
+ text = `a ${words.noun[0]} failed to ${words.verbs.plan[0]}${digest}`;
37
+ break;
38
+ case "recorded":
39
+ text = `recorded ${many(n)}: ${report.approval.status === "approved" ? "the approved plan" : report.approval.status === "changed" ? "the plan differs from the approved one" : "no approval for this plan"}${digest}`;
40
+ break;
41
+ case "applied":
42
+ text = `${words.verbs.apply[1]} ${many(n)}${digest}`;
43
+ break;
44
+ case "wave-applied": {
45
+ const last = (report.waves ?? []).filter((w) => w.status === "applied").at(-1);
46
+ text = `applied wave ${last?.wave ?? "?"} of ${report.selection.waves.length}${last ? ` under ${last.approval === "pull-request" ? "the pull request's approval" : `${last.gate}`}` : ""}`;
47
+ break;
48
+ }
49
+ case "failed":
50
+ text = `apply failed for ${report.members.filter((m) => m.status === "failed").map((m) => m.member).join(", ")}`;
51
+ break;
52
+ case "waiting":
53
+ text = `waiting: ${report.members.filter((m) => m.status === "waiting").map((m) => m.member).join(", ")} planned again after an upstream applied, not approved yet`;
54
+ break;
55
+ case "refused": {
56
+ const waiting = report.waves?.find((w) => w.status === "waiting");
57
+ if (waiting && (report.refusal === "wave-not-approved" || report.refusal === "wave-plan-changed")) {
58
+ text = `wave ${waiting.wave} waits at ${waiting.gate}: ${report.refusal === "wave-plan-changed" ? "its plan changed after its approval" : "its plan moved, approve it"}`;
59
+ break;
60
+ }
61
+ if (report.refusal === "earlier-wave") {
62
+ text = "refused: an earlier wave has not applied";
63
+ break;
64
+ }
65
+ if (report.refusal === "requires-unmet" || report.refusal === "before-merge-off") {
66
+ const unmet = (report.beforeMerge?.requires ?? []).filter((r) => !r.passed).map((r) => r.name);
67
+ text = report.refusal === "before-merge-off" ? "refused: this workspace does not apply before merge" : `refused: ${unmet.join(", ") || "a require"} unmet for an apply before merge`;
68
+ break;
69
+ }
70
+ if (report.refusal === "policy-denied" || report.refusal === "policy-error") {
71
+ text = report.refusal === "policy-denied" ? `refused: the policy denied the plan (${(report.policy?.rules ?? []).join(", ")})` : "refused: the policy could not be checked";
72
+ break;
73
+ }
74
+ text = `refused: ${report.refusal === "plan-changed" ? "the plan changed after review" : report.refusal === "not-a-reviewer" ? "the approver has not approved the pull request" : report.refusal === "author-approved" ? "the approver wrote the change" : report.refusal === "no-pull-request" ? "no pull request merged this commit" : report.refusal === "locked" ? "another pull request holds a target lock" : "the plan is not approved"}`;
75
+ break;
76
+ }
77
+ }
78
+ return text.length > 140 ? text.slice(0, 137) + "..." : text;
79
+ }
80
+
81
+ /** The commit status state for a report: success, failure, or pending while it waits on approval. */
82
+ export function prStatusState(report: PrReport): "success" | "failure" | "pending" {
83
+ // #4168 decision 1: a merge whose plan differs from the approved one is recorded, and its status fails.
84
+ if (report.status === "recorded") return report.approval.status === "changed" ? "failure" : "success";
85
+ // #4294: a plan the policy denied, with no override, or one it could not check, fails at the plan stage as it would at the apply.
86
+ if (report.status === "planned" && report.policy && (report.policy.result === "error" || (report.policy.result === "denied" && !report.policy.override))) return "failure";
87
+ if (report.status === "planned" || report.status === "applied" || report.status === "wave-applied" || report.status === "nothing") return "success";
88
+ if (report.status === "refused" && (report.refusal === "not-approved" || report.refusal === "wave-not-approved")) return "pending";
89
+ if (report.status === "waiting") return "pending";
90
+ return "failure";
91
+ }
@@ -6,7 +6,8 @@
6
6
  * {@link refGateInitPlan} plans, and writes nothing, so a product folds the
7
7
  * files into its own plan and keeps its dry run:
8
8
  *
9
- * - `.chant/trust.json` with a `refs` rule for the branch (#4867): created
9
+ * - `.chant/trust.json` with a `refs` rule for the branch (#4867), whose
10
+ * `plan` and `policy` are each target's with `targets` (#4978): created
10
11
  * with `"schema": 1` when there is none, the rule added in place when the
11
12
  * file has no rule for the branch, left as it is when it has one or does
12
13
  * not parse.
@@ -23,15 +24,17 @@
23
24
  */
24
25
 
25
26
  import { spawnSync } from "node:child_process";
26
- import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
27
- import { dirname, isAbsolute, join } from "node:path";
27
+ import { existsSync, readFileSync } from "node:fs";
28
+ import { isAbsolute, join } from "node:path";
29
+ import { writePlannedFiles } from "./planned-files";
30
+ import { EVIDENCE_MEMBER_NAME, targetEvidenceCheck } from "./ci-evidence-jobs";
28
31
  import { appendElement, setProperty } from "./workspace/json-edit";
29
32
  import { parseJsonText } from "./workspace/jsonc";
30
33
  import { REF_CHECK_NAME, TRUST_CONFIG_PATH, trustConfigSchema, type TrustConfig } from "./workspace/trust/policy";
31
34
  import { refPatternRegExp, REF_GATE_STATUS } from "./workspace/trust/ref-gate";
32
35
  import { REF_GATE_HOOK_MARK, refGateHook } from "./workspace/trust/ref-gate-cli";
33
36
 
34
- export { REF_GATE_PIECES_FLOOR } from "./release-floors";
37
+ export { REF_GATE_PIECES_FLOOR, TARGET_SIGNED_CHECKS_FLOOR } from "./release-floors";
35
38
 
36
39
  /** One check the rule requires evidence for, as `refs[].checks[]` holds it. */
37
40
  export interface RefGateInitCheck {
@@ -47,6 +50,13 @@ export interface RefGateInitOptions {
47
50
  branch?: string;
48
51
  /** The checks an update of the branch needs current evidence for. At least one. */
49
52
  checks: readonly RefGateInitCheck[];
53
+ /**
54
+ * The product plan's targets (#4978), as `productPlan.targets` names them.
55
+ * A target's note job signs `plan:<target>` and `policy:<target>`, so with
56
+ * targets a check named `plan` or `policy` stands for each target's, with
57
+ * the same action and command, in the order the targets are given.
58
+ */
59
+ targets?: readonly string[];
50
60
  /** The commit status the gate's status job sets. Default `chant/ref-gate`, which the rule then leaves out. */
51
61
  status?: string;
52
62
  /** Write the `pre-push` hook in this checkout. Default true. */
@@ -94,11 +104,21 @@ function planned(path: string, content: string, extra: Pick<RefGateInitFile, "mo
94
104
  return { path, status: before === undefined ? "created" : before === content ? "unchanged" : "updated", content, ...extra };
95
105
  }
96
106
 
107
+ /**
108
+ * The rule's checks (#4978): with `targets`, `plan` and `policy` become each
109
+ * target's `plan:<target>` and `policy:<target>` (`targetEvidenceCheck`),
110
+ * which is what a product plan with targets signs.
111
+ */
112
+ export function refGateInitChecks(checks: readonly RefGateInitCheck[], targets?: readonly string[]): RefGateInitCheck[] {
113
+ if (!targets || targets.length === 0) return [...checks];
114
+ return checks.flatMap((c) => (c.check === "plan" || c.check === "policy" ? targets.map((t) => ({ ...c, check: targetEvidenceCheck(c.check as "plan" | "policy", t) })) : [c]));
115
+ }
116
+
97
117
  /** The `refs` rule for `ref`, with `action` and `status` only where they differ from the defaults. */
98
118
  function ruleFor(ref: string, opts: RefGateInitOptions): Record<string, unknown> {
99
119
  return {
100
120
  ref,
101
- checks: opts.checks.map((c) => ({ check: c.check, ...(c.action === "warn" ? { action: "warn" } : {}), command: c.command })),
121
+ checks: refGateInitChecks(opts.checks, opts.targets).map((c) => ({ check: c.check, ...(c.action === "warn" ? { action: "warn" } : {}), command: c.command })),
102
122
  ...(opts.status && opts.status !== REF_GATE_STATUS ? { status: opts.status } : {}),
103
123
  };
104
124
  }
@@ -113,6 +133,9 @@ export function refGateInitPlan(repo: string, opts: RefGateInitOptions): RefGate
113
133
  const ref = `refs/heads/${branch}`;
114
134
  if (!branch || /\s|\*/.test(branch)) throw new RefGateInitError(`the branch is one branch name, such as main, not ${JSON.stringify(branch)}`);
115
135
  if (opts.checks.length === 0) throw new RefGateInitError("the ref gate's rule needs at least one check");
136
+ for (const t of opts.targets ?? []) {
137
+ if (!EVIDENCE_MEMBER_NAME.test(t)) throw new RefGateInitError(`${JSON.stringify(t)} is not a product plan target's name: letters, digits, - and _`);
138
+ }
116
139
  for (const c of opts.checks) {
117
140
  if (!REF_CHECK_NAME.test(c.check)) throw new RefGateInitError(`${JSON.stringify(c.check)} is not a check name: letters, digits, . _ : -`);
118
141
  if (!c.command.trim()) throw new RefGateInitError(`check ${c.check} needs the command that produces its evidence`);
@@ -180,10 +203,6 @@ export function refGateInitPlan(repo: string, opts: RefGateInitOptions): RefGate
180
203
 
181
204
  /** Write the files of a plan, each directory made and the hook executable. An unchanged file is not touched. */
182
205
  export function writeRefGateInit(plan: Pick<RefGateInitPlan, "files">): void {
183
- for (const f of plan.files) {
184
- if (f.status === "unchanged") continue;
185
- mkdirSync(dirname(f.path), { recursive: true });
186
- writeFileSync(f.path, f.content);
187
- if (f.mode !== undefined) chmodSync(f.path, f.mode);
188
- }
206
+ // #4966: chant's one planned-file writer.
207
+ writePlannedFiles(plan.files);
189
208
  }
@@ -19,7 +19,7 @@
19
19
  * this constant to the next patch (#4501). The check fails while a floor
20
20
  * still names this constant after its version shipped.
21
21
  */
22
- export const NEXT_RELEASE = "0.124.88";
22
+ export const NEXT_RELEASE = "0.124.90";
23
23
 
24
24
  /** The first chant with `chant dev local` and `chant dev bundle-check`, `@intentius/chant/local-chant` and `@intentius/chant/bundle-check` (`chantRuntimeTarget`, `chantExternalPlugin`, `checkBundle`): a product built against a chant checkout, and its bundle checked, without its own scripts (#4787). */
25
25
  export const LOCAL_CHANT_FLOOR = "0.124.86";
@@ -34,10 +34,13 @@ export const OVERDUE_PIPELINE_FILES_FLOOR = "0.124.86";
34
34
  export const TERRAFORM_APPLY_COMMAND_HOOK_FLOOR = "0.124.86";
35
35
 
36
36
  /** The first chant whose terraform lexicon times each root's engine commands and reads its spans and lock waits (`@intentius/chant-lexicon-terraform/engine-timings`, `engineTimings()` as `terraformApplyCapabilityWith`'s `onCommand`), and runs a composed group's commands through that hook (#4887). */
37
- export const TERRAFORM_ENGINE_TIMINGS_FLOOR = NEXT_RELEASE;
37
+ export const TERRAFORM_ENGINE_TIMINGS_FLOOR = "0.124.88";
38
38
 
39
39
  /** The first chant whose terraform lexicon finds live roots and estates (`live-roots`), places a Terragrunt unit (`terragruntUnitPlace`), reads a state migration's history and revert from its finished lines (`migration-history`), and runs the binary without the forge's tokens (`tokenlessBinaryExec`, `engineEnv`) (#4910). */
40
- export const TERRAFORM_ROOT_HELPERS_FLOOR = NEXT_RELEASE;
40
+ export const TERRAFORM_ROOT_HELPERS_FLOOR = "0.124.88";
41
+
42
+ /** The first chant whose terraform lexicon has one runner of the engine for a product (`engineRunner` in `engine-runner`: a hooked `exec`, `execSync`, `terragrunt` and the tokenless `script`), traces each engine command (`commandTrace`, `commandTraceEnv`), sends each Terragrunt unit's plan through `planTerragruntWave({ onCommand })`, and resolves a live root's record store (`liveRecordStore`, `writtenRecordStore`, `rootBackendAttrs` in `live-roots`) (#4954). */
43
+ export const TERRAFORM_ENGINE_RUNNER_FLOOR = "0.124.89";
41
44
 
42
45
  /** The first chant with `@intentius/chant/forge-flags` (`forgeTargetWith`, `forgeTargetFromFlags`, `apiBaseOf`), `@intentius/chant/chant-install` (`bundledChant`, `chantArgv`, `installChantResolveFallback`) and `noteLimit` and `fitNote` in `@intentius/chant/plan-summary` (#4800). */
43
46
  export const PRODUCT_HELPERS_FLOOR = "0.124.86";
@@ -113,64 +116,117 @@ export const LOCAL_EVIDENCE_FLOOR = "0.124.86";
113
116
  export const KEYLESS_EVIDENCE_FLOOR = "0.124.87";
114
117
 
115
118
  /** The first chant whose waves generators run each wave's policy as a step of its own (`chant run wave --policy-only`; on GitLab a `<wave job>-policy` job) and sign its checks in a `<wave job>-evidence` job with `chant ci evidence sign --from-job`, from the forge's record of the wave job's steps, so a wave that trades cloud credentials signs keyless with `evidence.identity: "oidc"` instead of being refused (#4926). */
116
- export const WAVE_EVIDENCE_JOB_FLOOR = NEXT_RELEASE;
119
+ export const WAVE_EVIDENCE_JOB_FLOOR = "0.124.88";
117
120
 
118
121
  /** The first chant whose cloud login leaves the region to the job unless the spec names one, takes `sameStep` to export into the step that runs it, accepts an AWS spec with no role (the token file alone), and whose trade sets `CHANT_CLOUD_TRADED` so a login's targets file is told from a trade's (#4930). */
119
- export const CLOUD_LOGIN_SAME_STEP_FLOOR = NEXT_RELEASE;
122
+ export const CLOUD_LOGIN_SAME_STEP_FLOOR = "0.124.88";
120
123
 
121
124
  /** The first chant whose `chant release workflow` sets up QEMU in the cut and publish jobs for the platforms `release.images` builds that the runner can't (`docker/setup-qemu-action` at its pin on GitHub and Forgejo, a `tonistiigi/binfmt` run line on GitLab), and whose `release.images` command entries take `platforms` (#4876). */
122
- export const RELEASE_WORKFLOW_QEMU_FLOOR = NEXT_RELEASE;
125
+ export const RELEASE_WORKFLOW_QEMU_FLOOR = "0.124.88";
123
126
 
124
127
  /** The first chant whose npm publish target refuses at plan time a package that would carry an image archive the release records (`publish-npm-carries-image`), naming the file and the `files` entry that leaves it out (#4934). */
125
- export const NPM_CARRIES_IMAGE_FLOOR = NEXT_RELEASE;
128
+ export const NPM_CARRIES_IMAGE_FLOOR = "0.124.88";
126
129
  /** The first chant with `driftRunFingerprint` in `@intentius/chant/drift-issue` and `lexiconDriftRecords` in `@intentius/chant/drift-record`, whose `chant lifecycle diff --live --json` writes a lexicon's `absent`, and whose sql lexicon reports a declared object the server lacks as `missing` instead of `pending` (#4896). */
127
- export const LIVE_DRIFT_RECORDS_FLOOR = NEXT_RELEASE;
130
+ export const LIVE_DRIFT_RECORDS_FLOOR = "0.124.88";
128
131
 
129
132
  /** The first chant whose `chant sql types --path` prints where `sql-types.d.ts` is by the source-dir rule, the path `sqlTypesPath` answers (#4897). */
130
- export const SQL_TYPES_PATH_FLOOR = NEXT_RELEASE;
133
+ export const SQL_TYPES_PATH_FLOOR = "0.124.88";
131
134
  /** The first chant whose forge target carries its web `origin` (`forgeTargetWith`) and whose `@intentius/chant/forge-flags` has `jobForgeTarget`, a job's target or undefined where the job cannot reach the forge, so a product keeps no target type of its own (#4888). */
132
- export const FORGE_TARGET_ORIGIN_FLOOR = NEXT_RELEASE;
135
+ export const FORGE_TARGET_ORIGIN_FLOOR = "0.124.88";
133
136
 
134
137
  /** The first chant with `actorFromEnv` (`@intentius/chant/actor`), `forgeTargetLiveRuns` and `forgeLiveRunsOf` in `@intentius/chant/state-unlock`, and a pulumi lexicon whose stack ops take the product's `approveCommand`, with `pulumiStackLockToCancel` and `pulumiMoveDestStack`, a move naming its own `--dest` from both sides' `project` (#4911). */
135
- export const STACK_OPS_PRODUCT_HELPERS_FLOOR = NEXT_RELEASE;
138
+ export const STACK_OPS_PRODUCT_HELPERS_FLOOR = "0.124.88";
136
139
 
137
140
  /** The first chant with `@intentius/chant/forge-remote` (`forgeOfRemote`, `forgeOfCheckout`, `forgeKindOfHost`), the forge and repository a checkout's origin remote names, and a pulumi `gatedStackCancel` that reads the forge's runs from it on a laptop (#4920). */
138
- export const FORGE_REMOTE_FLOOR = NEXT_RELEASE;
141
+ export const FORGE_REMOTE_FLOOR = "0.124.88";
139
142
  /** The first chant with `chant dev generated-check` (`chantGenerated` in a product's root package.json, `@intentius/chant/generated-check`) and `chant dev local-image` (`localChantImage` in `@intentius/chant/local-chant`): a drift check of a product's committed generated files, and an image build with the product's chant, local or pinned, without the product's own scripts (#4909). */
140
- export const GENERATED_CHECK_FLOOR = NEXT_RELEASE;
143
+ export const GENERATED_CHECK_FLOOR = "0.124.88";
141
144
 
142
145
  /** The first chant whose `chant dev local` keeps the product's peer dependencies installed and packs the checkout at its `NEXT_RELEASE`, and whose root build of a project with no `sourceDir` leaves its top-level `migrations/` out, with the sql lexicon opening no `.sql` file under a `migrations` directory (#4921). */
143
- export const LOCAL_CHANT_NEXT_RELEASE_FLOOR = NEXT_RELEASE;
146
+ export const LOCAL_CHANT_NEXT_RELEASE_FLOOR = "0.124.88";
144
147
 
145
148
  /** The first chant whose `chantExternalPlugin` keeps external only the chant packages it is given, by default the ones in the package's `dependencies`, so a product that bundles its lexicons uses it as is (#4922). */
146
- export const CHANT_EXTERNAL_PACKAGES_FLOOR = NEXT_RELEASE;
149
+ export const CHANT_EXTERNAL_PACKAGES_FLOOR = "0.124.88";
147
150
 
148
151
  /** The first chant whose `ciToolInstallLine` takes `sudo` and `binDir` and a root under a shell variable, for a job that is not root, whose `CI_TOOL_SHA256` records terraform 1.14.9, terragrunt 1.2.0 and the AWS CLI 2.37.9, and whose Pulumi lexicon's `ciFetchScript` and `PINNED_SHA256` are ci-image's (#4908). */
149
- export const CI_IMAGE_NON_ROOT_FLOOR = NEXT_RELEASE;
152
+ export const CI_IMAGE_NON_ROOT_FLOOR = "0.124.88";
150
153
 
151
154
  /** The first chant whose `productImageStages` stages type as the docker lexicon's `DockerfileStage[]` under `exactOptionalPropertyTypes`, so `new Dockerfile({ stages: productImageStages(spec) })` compiles (#4932). */
152
- export const CI_IMAGE_DOCKER_STAGES_FLOOR = NEXT_RELEASE;
155
+ export const CI_IMAGE_DOCKER_STAGES_FLOOR = "0.124.88";
153
156
 
154
157
  /** The first chant whose setup steps (`OpSetupStep`: an Op waves spec's wave and job group `setup`, a scheduled Op's `setup`, `release.workflow.setup`) take a `name`, rendered as the step's name on GitHub and Forgejo (#4932). */
155
- export const OP_SETUP_STEP_NAME_FLOOR = NEXT_RELEASE;
158
+ export const OP_SETUP_STEP_NAME_FLOOR = "0.124.88";
156
159
 
157
160
  /** The first chant whose cloud login takes `restart` (log in, then start the step's script again without the token request variables, and empty the token files when the step exits), sets `CHANT_CLOUD_TOKEN_FILES` for `LOGIN_CLEAR_TOKENS`, takes a full token URL as GCP's `stsEndpoint`, and whose GitLab trade evaluates its exports without writing a file (#4912). */
158
- export const CLOUD_LOGIN_RESTART_FLOOR = NEXT_RELEASE;
161
+ export const CLOUD_LOGIN_RESTART_FLOOR = "0.124.88";
159
162
 
160
163
  /** The first chant whose `chant build --pr-loop` takes `evidence` (`--evidence-runner-key-secret`, `--evidence-identity oidc`, `--evidence-audience`) and signs the plan job's `plan` and `policy` checks in its note job on GitHub, GitLab and Forgejo (#4935). */
161
- export const PR_LOOP_EVIDENCE_FLOOR = NEXT_RELEASE;
164
+ export const PR_LOOP_EVIDENCE_FLOOR = "0.124.88";
162
165
 
163
166
  /** The first chant whose pull request pipelines take `checkJob` (`--check-job`): a check job that runs `chant ci check` on the pull request's commit with no token or runner identity, and with `evidence` a `check-evidence` job that signs each passed hook from its report with `chant ci evidence sign --from-report .chant/check` (#4935). */
164
- export const CHECK_JOB_FLOOR = NEXT_RELEASE;
167
+ export const CHECK_JOB_FLOOR = "0.124.88";
165
168
 
166
169
  /** The first chant whose GitLab pipelines sign evidence in the target branch's plan notes pipeline, in jobs that name the `chant-evidence` environment, with `chant ci evidence sign --open`, and whose `pr-post --open --evidence-dir` ends each merge request's note with the checks line; no job of a merge request pipeline holds the runner key (#4914). */
167
- export const GITLAB_OPEN_EVIDENCE_FLOOR = NEXT_RELEASE;
170
+ export const GITLAB_OPEN_EVIDENCE_FLOOR = "0.124.88";
168
171
 
169
172
  /** The first chant whose `chant ci check` takes `--summary <file>` and whose `checkReportSummary` renders the check report's markdown section, so a product's check step runs chant's check stage and keeps the section in its own report (#4914). */
170
- export const CHECK_SUMMARY_FLOOR = NEXT_RELEASE;
173
+ export const CHECK_SUMMARY_FLOOR = "0.124.88";
171
174
 
172
175
  /** The first chant whose pull request pipelines take `refGateStatus` (`--ref-gate-status`): a `ref-gate` job that runs `chant workspace ref-gate status` for the pull request's commit, and on GitLab `ref-gate status --open` for every open merge request (#4935). */
173
- export const REF_GATE_STATUS_JOB_FLOOR = NEXT_RELEASE;
176
+ export const REF_GATE_STATUS_JOB_FLOOR = "0.124.88";
174
177
 
175
178
  /** The first chant with `@intentius/chant/ref-gate-rules` (`refGateRulesAt`), `require` in `checkPrRequires`, `refGateStatus` in `pipelineContract` and `ci forge-check --ref-gate-status`, `@intentius/chant/ref-gate-init` (`refGateInitPlan`, `writeRefGateInit`), and a pre-receive refusal that prints the command recording the override request (#4913). */
176
- export const REF_GATE_PIECES_FLOOR = NEXT_RELEASE;
179
+ export const REF_GATE_PIECES_FLOOR = "0.124.88";
180
+
181
+ /** The first chant whose `chant release cut --yes` pushes `chant/lifecycle` again when the remote refuses it, and exits non-zero untagged (`release-record-not-pushed`) when the release record never lands, so the release workflow does not push the tag (#4965). */
182
+ export const RELEASE_CUT_RECORD_FLOOR = "0.124.89";
183
+
184
+ /** The first chant whose release cut refuses, before it records or tags, a release whose npm publish target would carry an image archive (`publish-npm-carries-image`), and whose GitLab release workflow runs the binfmt image by digest from `IMAGE_PINS` (#4941). */
185
+ export const RELEASE_CUT_CARRIES_IMAGE_FLOOR = "0.124.89";
186
+ /** The first chant whose `ciToolFetchScript` and `ciToolInstallLine` take `download: "node"`, a fetch and unzip with node for an image with no curl or unzip, whose `CI_TOOL_SHA256` records just 1.36.0 and act 0.2.89 and checks them against their releases' checksums files, and whose overdue check deepens a shallow checkout before it dates a pipeline file (#4952). */
187
+ export const CI_TOOL_NODE_DOWNLOAD_FLOOR = "0.124.89";
188
+
189
+ /** The first chant whose `chant build -o <dir>/` writes a build's additional files (a docker project's Dockerfiles) into the directory with no primary file, whose `chantGenerated` renders take a `module` and its `export` (a `{ path: text }` object or a function returning one) and `chant dev render <module> <export>` writes them in place, and whose `chant ci workflow` and `chant release workflow` write into `chant dev generated-check`'s render tree with no `--output` (#4950). */
190
+ export const RENDER_KINDS_FLOOR = "0.124.89";
191
+
192
+ /** The first chant whose sql lexicon's `chant lifecycle diff --live` addresses a table's columns by name (`columns[#country].default.expr`), compares a ClickHouse table's column order as `columnOrder`, and reports a column the server has and the declaration does not as pending, and whose `lexiconDriftRecords` counts a deep read's pending changes (that column, a ClickHouse or Postgres privilege granted by hand) as drift (#4944). */
193
+ export const SQL_LIVE_COLUMNS_FLOOR = "0.124.89";
194
+
195
+ /** The first chant whose `driftNotifyFields` takes `stacks`, each member's drift records, and from them names the drifted members and computes the run's fingerprint (#4944). */
196
+ export const DRIFT_NOTIFY_STACKS_FLOOR = "0.124.89";
197
+
198
+ /** The first chant whose workspace member's pull request pipeline takes `evidence`, `checkJob` and `refGateStatus` (`chant build --pr-loop` in a member), signing the member's plan job as `plan:<member>` and `policy:<member>` (`ci evidence sign --member`, `memberEvidenceCheck`) and running the check job in the member's directory (#4964). */
199
+ export const MEMBER_SIGNED_CHECKS_FLOOR = "0.124.89";
200
+
201
+ /** The first chant whose `checkJob` takes `{ services, env, before, dir, args }` (`PrCheckJobOptions`: service containers, the check step's variables and lines, the report directory, the arguments after `--base`) and whose github, forgejo and gitlab lexicons render the check, check evidence and ref gate jobs for a product's own workflow (`productCheckJobs`, `forgejoProductCheckJobs`, `gitlabProductCheckJobs`) (#4964). */
202
+ export const PRODUCT_CHECK_JOBS_FLOOR = "0.124.89";
203
+
204
+ /** The first chant whose `checkJob` takes `artifacts: { paths, reports }` (`PrCheckArtifacts`), which GitLab's check job keeps beside its report as `artifacts:paths` and `artifacts:reports`, such as a lint hook's `codequality` report (#4988). */
205
+ export const CHECK_JOB_ARTIFACTS_FLOOR = NEXT_RELEASE;
206
+
207
+ /** The first chant whose GitLab Op waves pipeline with a runner key hands it to no wave job: each deciding wave's `<wave job>-evidence` job names the `chant-evidence` environment and signs `plan:<wave>` from the wave job (#4964). */
208
+ export const GITLAB_WAVE_KEY_SCOPE_FLOOR = "0.124.89";
209
+
210
+ /** The first chant with `actorOf` and `actorOrder` in `@intentius/chant/actor`: the actor fallback with `GITHUB_TRIGGERING_ACTOR` ahead of the forge's actor and git's `user.name` before the login, each place switched on or off by the caller (#4966). */
211
+ export const ACTOR_ORDER_FLOOR = "0.124.89";
212
+
213
+ /** The first chant with `@intentius/chant/ci-base` (`ciBaseRef`), the base a CI job measures a change from (the pull request's target branch, else the default branch for a push to another branch), and whose `chant ci check` defaults `--base` to it (#4966). */
214
+ export const CI_BASE_REF_FLOOR = "0.124.89";
215
+
216
+ /** The first chant with `@intentius/chant/planned-files` (`planFile`, `planRemoval`, `writePlannedFiles`, `staleGeneratedFiles`): an init's planned files with their modes, written or removed in one call, and the generated files a product no longer renders, found by their header (#4966). */
217
+ export const PLANNED_FILES_FLOOR = "0.124.89";
218
+
219
+ /** The first chant whose `pipelineContract` takes `jobs`, the jobs a product builds from its own config, beside or in place of `pipelines`, so a product's forge check gets the required statuses and `refGateStatus` from chant (#4966). */
220
+ export const FORGE_CHECK_OWN_JOBS_FLOOR = "0.124.89";
221
+
222
+ /** The first chant whose `chant components pr-apply --before-merge` waits for the ref gate's status: the status the policy at base sets for the target branch is passed as `require` to the `checks` require (#4966). */
223
+ export const BEFORE_MERGE_REF_GATE_FLOOR = "0.124.89";
224
+
225
+ /** The first chant whose product plan with `targets` and `evidence` signs each target's plan job as `plan:<target>` and `policy:<target>` (`ci evidence sign --member <target>`, `targetEvidenceCheck`, `productPlanEvidenceChecks`), and whose `refGateInitPlan` takes `targets` and names those checks in the `refs` rule (#4978). */
226
+ export const TARGET_SIGNED_CHECKS_FLOOR = "0.124.89";
227
+
228
+ /** The first chant whose Op waves generators take `renderSpec` (the wave jobs run `chant run wave --render-spec`, and `CHANT_WAVES_SPEC_COMMAND` names the product command that prints the spec at the commit in `CHANT_WAVES_SPEC_AT`), so a product whose spec is built from its config at base renders its wave jobs, policy step, evidence job and cloud trade through chant (#4982). */
229
+ export const RUNTIME_WAVES_SPEC_FLOOR = "0.124.89";
230
+
231
+ /** The first chant whose `chant run resume` (`resumeGateRun`) on GitLab retries a wave job's `<wave job>-evidence` with the wave job when the evidence job already ran, and whose `ci evidence sign --from-job` waits for a job it reads to finish, so a resumed wave's evidence job signs from the new try (#4978). */
232
+ export const GITLAB_WAVE_EVIDENCE_RETRY_FLOOR = "0.124.89";