@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
@@ -47,7 +47,7 @@ export const EVIDENCE_IDENTITY_ENV = "CHANT_RUNNER_IDENTITY";
47
47
  export const EVIDENCE_ID_TOKEN_VAR = "CHANT_ID_TOKEN_SIGSTORE";
48
48
  /** The audience a keyless signing job's token is requested for unless told: sigstore's. */
49
49
  export const EVIDENCE_DEFAULT_AUDIENCE = "sigstore";
50
- export { CHECK_EVIDENCE_FLOOR, CHECK_JOB_FLOOR, GITLAB_OPEN_EVIDENCE_FLOOR, KEYLESS_EVIDENCE_FLOOR, LOCAL_EVIDENCE_FLOOR, PR_LOOP_EVIDENCE_FLOOR, REF_GATE_STATUS_JOB_FLOOR, WAVE_EVIDENCE_JOB_FLOOR } from "./release-floors.js";
50
+ export { CHECK_EVIDENCE_FLOOR, CHECK_JOB_FLOOR, GITLAB_OPEN_EVIDENCE_FLOOR, GITLAB_WAVE_EVIDENCE_RETRY_FLOOR, GITLAB_WAVE_KEY_SCOPE_FLOOR, KEYLESS_EVIDENCE_FLOOR, LOCAL_EVIDENCE_FLOOR, MEMBER_SIGNED_CHECKS_FLOOR, PR_LOOP_EVIDENCE_FLOOR, REF_GATE_STATUS_JOB_FLOOR, TARGET_SIGNED_CHECKS_FLOOR, WAVE_EVIDENCE_JOB_FLOOR } from "./release-floors.js";
51
51
  /**
52
52
  * The GitLab environment every signing job names (#4914), with `action:
53
53
  * access`, so it creates no deployment. Scope the runner key's CI/CD
@@ -71,7 +71,50 @@ export function gitlabOpenEvidenceDir(job) {
71
71
  */
72
72
  export function openEvidenceLines(opts) {
73
73
  const chant = opts.bin ?? "chant";
74
- return [`${chant} ci evidence sign --open --job ${opts.job} --from-report ${opts.dir} --base "$CI_COMMIT_SHA" --output ${opts.out}${opts.noForks ? " --no-forks" : ""}`];
74
+ return [`${chant} ci evidence sign --open --job ${opts.job} --from-report ${opts.dir}${memberFlag(opts.member)} --base "$CI_COMMIT_SHA" --output ${opts.out}${opts.noForks ? " --no-forks" : ""}`];
75
+ }
76
+ /**
77
+ * The check a workspace member's pipeline signs for one of the plan job's
78
+ * two (#4964): `plan:<member>`, `policy:<member>`. A member's plan job plans
79
+ * that member alone, so its pass says nothing of another member's plan; a
80
+ * `refs` rule names each member's checks. The root pipeline's are `plan`
81
+ * and `policy`.
82
+ */
83
+ export function memberEvidenceCheck(check, member) {
84
+ return member ? `${check}:${member}` : check;
85
+ }
86
+ /**
87
+ * The check a product plan target's note job signs for one of its plan
88
+ * job's two (#4978): `plan:<target>`, `policy:<target>`. Each target has a
89
+ * plan job of its own, so its pass says nothing of another target's plan,
90
+ * and a `refs` rule names each target's checks. A product plan without
91
+ * targets signs `plan` and `policy`.
92
+ */
93
+ export function targetEvidenceCheck(check, target) {
94
+ return memberEvidenceCheck(check, target);
95
+ }
96
+ /**
97
+ * The checks a product plan's note jobs sign (#4978), in the order a `refs`
98
+ * rule lists them: `plan` and `policy`, or with `targets` each target's
99
+ * `plan:<target>` and `policy:<target>`.
100
+ */
101
+ export function productPlanEvidenceChecks(targets) {
102
+ if (!targets || targets.length === 0)
103
+ return ["plan", "policy"];
104
+ return targets.flatMap((t) => [targetEvidenceCheck("plan", t), targetEvidenceCheck("policy", t)]);
105
+ }
106
+ /**
107
+ * The name `--member` takes (#4964): a workspace member's or (#4978) a
108
+ * product plan target's, which a check name carries after `plan:`.
109
+ */
110
+ export const EVIDENCE_MEMBER_NAME = /^[A-Za-z0-9][A-Za-z0-9_-]*$/;
111
+ /** ` --member <name>` on a signing line of a member's or a target's plan evidence (#4964, #4978), or nothing. */
112
+ function memberFlag(member) {
113
+ if (member === undefined)
114
+ return "";
115
+ if (!EVIDENCE_MEMBER_NAME.test(member))
116
+ throw new Error(`the name ${JSON.stringify(member)} is not one a check name can carry: letters, digits, - and _`);
117
+ return ` --member ${member}`;
75
118
  }
76
119
  const SECRET_NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;
77
120
  /** Refuse a secret name the forge could not hold, and an evidence block that names both identities or neither. */
@@ -114,6 +157,6 @@ export function planEvidenceLines(opts) {
114
157
  const chant = opts.bin ?? "chant";
115
158
  return [
116
159
  `git fetch --quiet --no-tags --depth=1 origin ${opts.at} || true`,
117
- `${chant} ci evidence sign --from-report ${opts.dir} --result ${opts.result} --at ${opts.at} --base ${opts.base}`,
160
+ `${chant} ci evidence sign --from-report ${opts.dir}${memberFlag(opts.member)} --result ${opts.result} --at ${opts.at} --base ${opts.base}`,
118
161
  ];
119
162
  }
@@ -18,7 +18,8 @@
18
18
  * checks it, for an image's fetch stage; {@link ciToolInstallLine} is the
19
19
  * job line that runs it unless the binary is there (with `sudo`, or under
20
20
  * a root such as `$RUNNER_TEMP/chant-tools`, for a job that is not root,
21
- * #4908); {@link installCiTool} does the same from Node, for a product
21
+ * #4908). With `download: "node"` both fetch and unpack with node, for
22
+ * an image with no curl or unzip (#4952). {@link installCiTool} does the same from Node, for a product
22
23
  * that installs a pinned release at run time.
23
24
  * - {@link productImageStages} is a product's image as stages a Dockerfile
24
25
  * takes (the docker lexicon's `new Dockerfile({ stages })`), and
@@ -31,7 +32,7 @@
31
32
  * project publishes a checksums file is checked against that file's line
32
33
  * for the archive, and against the recorded sha256 when there is one, so a
33
34
  * tampered checksums file fails as a tampered archive does. A release with
34
- * no checksums file (the AWS CLI, just, act) needs a recorded sha256. An
35
+ * no checksums file (the AWS CLI, just before 1.35.0) needs a recorded sha256. An
35
36
  * image always needs a recorded sha256 for both architectures, and a caller
36
37
  * passes `requirePin` to ask the same of a job line or a run-time install.
37
38
  *
@@ -39,8 +40,8 @@
39
40
  * chant's release floors, so a product can bundle it or import it from a
40
41
  * plain Node script.
41
42
  */
42
- import { CI_IMAGE_DOCKER_STAGES_FLOOR, CI_IMAGE_FLOOR, CI_IMAGE_NON_ROOT_FLOOR } from "./release-floors.js";
43
- export { CI_IMAGE_DOCKER_STAGES_FLOOR, CI_IMAGE_FLOOR, CI_IMAGE_NON_ROOT_FLOOR };
43
+ import { CI_IMAGE_DOCKER_STAGES_FLOOR, CI_IMAGE_FLOOR, CI_IMAGE_NON_ROOT_FLOOR, CI_TOOL_NODE_DOWNLOAD_FLOOR } from "./release-floors.js";
44
+ export { CI_IMAGE_DOCKER_STAGES_FLOOR, CI_IMAGE_FLOOR, CI_IMAGE_NON_ROOT_FLOOR, CI_TOOL_NODE_DOWNLOAD_FLOOR };
44
45
  export type CiTool = "tofu" | "terraform" | "terragrunt" | "choudoufu" | "infracost" | "cosign" | "atmos" | "terramate" | "pulumi" | "plunge" | "aws-cli" | "just" | "act";
45
46
  /** The architectures chant fetches, as Docker's `TARGETARCH` names them. */
46
47
  export type CiToolArch = "amd64" | "arm64";
@@ -100,6 +101,14 @@ export interface CiToolCheckOptions {
100
101
  /** Refuse a release with no recorded sha256 for an architecture, rather than trust its checksums file alone. Default false. */
101
102
  requirePin?: boolean;
102
103
  }
104
+ /**
105
+ * How a fetch line downloads and unpacks a release (#4952): `curl` (the
106
+ * default) with `unzip` for a zip, or `node`, which downloads with node's
107
+ * `fetch` and unpacks a zip with node, for a job whose image carries node
108
+ * but neither curl nor unzip. The check is the same either way; tar,
109
+ * sha256sum and sed are still the image's.
110
+ */
111
+ export type CiToolDownload = "curl" | "node";
103
112
  export interface CiToolFetchOptions extends CiToolCheckOptions {
104
113
  /** The directory the tool installs into, an absolute path: {@link ciToolDir} under the image's tool root. */
105
114
  dir: string;
@@ -113,6 +122,8 @@ export interface CiToolFetchOptions extends CiToolCheckOptions {
113
122
  * /opt. The download and the check run as the job's user. Default false.
114
123
  */
115
124
  sudo?: boolean;
125
+ /** Download with curl (the default) or with node, for an image with no curl or unzip (#4952). */
126
+ download?: CiToolDownload;
116
127
  }
117
128
  /**
118
129
  * Shell that downloads one release into `dir` and checks it (#4784). Run it
@@ -144,6 +155,12 @@ export interface CiToolInstallOptions extends CiToolCheckOptions {
144
155
  sudo?: boolean;
145
156
  /** Skip the install when any `<bin>` is on PATH, whatever its version. Default false: only the versioned directory counts. */
146
157
  onPath?: boolean;
158
+ /**
159
+ * Download with curl (the default) or with node (#4952), for a job whose
160
+ * image carries node but neither curl nor unzip, such as terragucci's
161
+ * images installing the AWS CLI for drift attribution.
162
+ */
163
+ download?: CiToolDownload;
147
164
  }
148
165
  /** Where a job line installs each release by default. */
149
166
  export declare const CI_TOOL_ROOT = "/opt/chant";
@@ -1 +1 @@
1
- {"version":3,"file":"ci-image.d.ts","sourceRoot":"","sources":["../src/ci-image.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AASH,OAAO,EAAE,4BAA4B,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAEzG,OAAO,EAAE,4BAA4B,EAAE,cAAc,EAAE,uBAAuB,EAAE,CAAC;AAKjF,MAAM,MAAM,MAAM,GACd,MAAM,GACN,WAAW,GACX,YAAY,GACZ,WAAW,GACX,WAAW,GACX,QAAQ,GACR,OAAO,GACP,WAAW,GACX,QAAQ,GACR,QAAQ,GACR,SA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 +18,8 @@
18
18
  * checks it, for an image's fetch stage; {@link ciToolInstallLine} is the
19
19
  * job line that runs it unless the binary is there (with `sudo`, or under
20
20
  * a root such as `$RUNNER_TEMP/chant-tools`, for a job that is not root,
21
- * #4908); {@link installCiTool} does the same from Node, for a product
21
+ * #4908). With `download: "node"` both fetch and unpack with node, for
22
+ * an image with no curl or unzip (#4952). {@link installCiTool} does the same from Node, for a product
22
23
  * that installs a pinned release at run time.
23
24
  * - {@link productImageStages} is a product's image as stages a Dockerfile
24
25
  * takes (the docker lexicon's `new Dockerfile({ stages })`), and
@@ -31,7 +32,7 @@
31
32
  * project publishes a checksums file is checked against that file's line
32
33
  * for the archive, and against the recorded sha256 when there is one, so a
33
34
  * tampered checksums file fails as a tampered archive does. A release with
34
- * no checksums file (the AWS CLI, just, act) needs a recorded sha256. An
35
+ * no checksums file (the AWS CLI, just before 1.35.0) needs a recorded sha256. An
35
36
  * image always needs a recorded sha256 for both architectures, and a caller
36
37
  * passes `requirePin` to ask the same of a job line or a run-time install.
37
38
  *
@@ -46,9 +47,14 @@ import { tmpdir } from "node:os";
46
47
  import { join } from "node:path";
47
48
  import { gunzipSync, inflateRawSync } from "node:zlib";
48
49
  import { tarEntry } from "./policy-engine.js";
49
- import { CI_IMAGE_DOCKER_STAGES_FLOOR, CI_IMAGE_FLOOR, CI_IMAGE_NON_ROOT_FLOOR } from "./release-floors.js";
50
- export { CI_IMAGE_DOCKER_STAGES_FLOOR, CI_IMAGE_FLOOR, CI_IMAGE_NON_ROOT_FLOOR };
50
+ import { CI_IMAGE_DOCKER_STAGES_FLOOR, CI_IMAGE_FLOOR, CI_IMAGE_NON_ROOT_FLOOR, CI_TOOL_NODE_DOWNLOAD_FLOOR } from "./release-floors.js";
51
+ export { CI_IMAGE_DOCKER_STAGES_FLOOR, CI_IMAGE_FLOOR, CI_IMAGE_NON_ROOT_FLOOR, CI_TOOL_NODE_DOWNLOAD_FLOOR };
51
52
  export const CI_TOOL_ARCHES = ["amd64", "arm64"];
53
+ /** Whether a release version is at least `major.minor`. */
54
+ function atLeast(version, major, minor) {
55
+ const [a = 0, b = 0] = version.split(".").map((n) => Number.parseInt(n, 10));
56
+ return a > major || (a === major && b >= minor);
57
+ }
52
58
  const STD = { amd64: "amd64", arm64: "arm64" };
53
59
  const GNU = { amd64: "x86_64", arm64: "aarch64" };
54
60
  const NODE_WORDS = { amd64: "x64", arm64: "arm64" };
@@ -148,6 +154,8 @@ const TOOLS = {
148
154
  words: GNU,
149
155
  base: (v) => `https://github.com/casey/just/releases/download/${v}`,
150
156
  asset: (v, w) => `just-${v}-${w}-unknown-linux-musl.tar.gz`,
157
+ // #4952: just publishes `SHA256SUMS` from 1.37.0, one `<file>.sha256sum` per file in 1.35.0 and 1.36.0, and none before.
158
+ checksums: (v, asset) => (atLeast(v, 1, 37) ? "SHA256SUMS" : atLeast(v, 1, 35) ? `${asset}.sha256sum` : undefined),
151
159
  layout: "tar.gz",
152
160
  },
153
161
  act: {
@@ -155,6 +163,7 @@ const TOOLS = {
155
163
  words: { amd64: "x86_64", arm64: "arm64" },
156
164
  base: (v) => `https://github.com/nektos/act/releases/download/v${v}`,
157
165
  asset: (_v, w) => `act_Linux_${w}.tar.gz`,
166
+ checksums: () => "checksums.txt",
158
167
  layout: "tar.gz",
159
168
  },
160
169
  };
@@ -188,6 +197,14 @@ export const CI_TOOL_SHA256 = {
188
197
  "terragrunt-1.2.0-linux-arm64": "b069ce4310572bc46ee6f057057acc4bc6a9077ef8687e157a64b0551290a371",
189
198
  "aws-cli-2.37.9-linux-amd64": "6b3a6a3d7bb3997928f0bdf7b866914224abf242c2e54e1dcebbe84bee64f356",
190
199
  "aws-cli-2.37.9-linux-arm64": "e7d2cca3622af4765871fe9ce7eeed03acd09dca10a99ebc46e92f79d78765c0",
200
+ // #4952: terragucci's just and act pins (its workflows/shared.ts), read on 2026-11-10 from
201
+ // https://github.com/casey/just/releases/download/1.36.0/just-1.36.0-{x86_64,aarch64}-unknown-linux-musl.tar.gz.sha256sum
202
+ // and https://github.com/nektos/act/releases/download/v0.2.89/checksums.txt.
203
+ // squawk is not here: its releases publish no checksums file, only bare binaries, and no product pins a release.
204
+ "just-1.36.0-linux-amd64": "bc7c9f377944f8de9cd0418b11d2955adebfa25a488c0b5e3dd2d2c0e9d732da",
205
+ "just-1.36.0-linux-arm64": "bb3886b15e2cbcb9c0eb19956297d36de4eaef45b89d3f5fa5d1fc4ed3b5b51d",
206
+ "act-0.2.89-linux-amd64": "0191d6f1f3b716b5c55820032605d05fc3c1cdbf581ebeff655019e5dd1524c0",
207
+ "act-0.2.89-linux-arm64": "daa8679ba9615a74d2d0cec321dc593f21948a2a11bb65862b063d8b930f4bcb",
191
208
  };
192
209
  const VERSION = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.]+)?$/;
193
210
  const SHA256 = /^[0-9a-f]{64}$/;
@@ -265,8 +282,39 @@ export function ciToolBin(tool, version, root) {
265
282
  export const CI_TOOL_JOB_ARCH = `"$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')"`;
266
283
  /** A Docker build's target architecture (`ARG TARGETARCH`), amd64 or arm64. */
267
284
  export const CI_TOOL_DOCKER_ARCH = `"$TARGETARCH"`;
285
+ /** The download line's script for `download: "node"`: `node -e <it> <url> <file>`. A failed answer exits 1 naming the URL and the status. */
286
+ const NODE_FETCH_JS = 'const [u,o]=process.argv.slice(1);fetch(u).then(async(r)=>{if(!r.ok)throw new Error(u+": HTTP "+r.status);require("fs").writeFileSync(o,Buffer.from(await r.arrayBuffer()))}).catch((e)=>{console.error(e.message);process.exit(1)})';
287
+ /**
288
+ * The unpack line's script for `download: "node"`: `node -e <it> <zip>
289
+ * <dir> [member]`, every entry (or the one member) written under `dir`
290
+ * with its executable bit and symbolic links kept, as the AWS CLI's
291
+ * installer needs. Stored and deflated entries only, as {@link unzipEntry}
292
+ * reads them; an entry whose path leaves `dir` fails the line. Written with
293
+ * no single quote or `$`, so it goes inside the shell's single quotes as it is.
294
+ */
295
+ const NODE_UNZIP_JS = [
296
+ 'const fs=require("fs"),p=require("path"),z=require("zlib");const [f,d,m]=process.argv.slice(1);const b=fs.readFileSync(f);',
297
+ 'let e=b.length-22;while(e>=0&&b.readUInt32LE(e)!==0x06054b50)e--;if(e<0)throw new Error(f+" is not a zip archive");',
298
+ "const top=p.resolve(d);let o=b.readUInt32LE(e+16),hit=false;",
299
+ "for(let i=b.readUInt16LE(e+10);i>0;i--){",
300
+ 'const meth=b.readUInt16LE(o+10),size=b.readUInt32LE(o+20),nl=b.readUInt16LE(o+28),xl=b.readUInt16LE(o+30),cl=b.readUInt16LE(o+32),mode=b.readUInt32LE(o+38)>>>16,l=b.readUInt32LE(o+42),n=b.toString("utf8",o+46,o+46+nl);',
301
+ "o+=46+nl+xl+cl;if(m&&n!==m)continue;hit=true;",
302
+ 'const t=p.resolve(top,n);if(t!==top&&!t.startsWith(top+p.sep))throw new Error(n+" is outside "+d);',
303
+ 'if(n.endsWith("/")){fs.mkdirSync(t,{recursive:true});continue}',
304
+ "const s=l+30+b.readUInt16LE(l+26)+b.readUInt16LE(l+28),raw=b.subarray(s,s+size),data=meth===0?raw:meth===8?z.inflateRawSync(raw):null;",
305
+ 'if(!data)throw new Error(n+" uses compression method "+meth);fs.mkdirSync(p.dirname(t),{recursive:true});',
306
+ "if((mode&0o170000)===0o120000)fs.symlinkSync(data.toString(),t);else fs.writeFileSync(t,data,{mode:mode&0o111?0o755:0o644})}",
307
+ 'if(m&&!hit)throw new Error(m+" is not in "+f)',
308
+ ].join("");
309
+ function checkDownload(download) {
310
+ if (download === undefined || download === "curl")
311
+ return "curl";
312
+ if (download === "node")
313
+ return "node";
314
+ throw new Error(`download is curl or node, not ${JSON.stringify(download)}`);
315
+ }
268
316
  function needPins(tool, version, sums, requirePin) {
269
- const hasSums = spec(tool).checksums !== undefined;
317
+ const hasSums = spec(tool).checksums?.(version, "") !== undefined;
270
318
  const missing = CI_TOOL_ARCHES.filter((a) => !sums[a]);
271
319
  if (missing.length && (requirePin || !hasSums)) {
272
320
  const why = hasSums ? "" : `; ${tool}'s release publishes no checksums file, so chant needs one`;
@@ -286,6 +334,10 @@ export function ciToolFetchScript(tool, version, options) {
286
334
  const s = spec(tool);
287
335
  const sums = ciToolSha256(tool, version, options.sha256);
288
336
  needPins(tool, version, sums, options.requirePin === true);
337
+ const node = checkDownload(options.download) === "node";
338
+ // #4952: `get <url word> <file>` and `unzipTo <zip> <dir> [member]`, with curl and unzip or with node.
339
+ const get = (url, out) => (node ? `node -e '${NODE_FETCH_JS}' ${url} "${out}"` : `curl -fsSLo "${out}" ${url}`);
340
+ const unzipTo = (zipFile, into, member) => node ? `node -e '${NODE_UNZIP_JS}' "${zipFile}" "${into}"${member ? ` "${member}"` : ""}` : `unzip -q${member ? " -o" : ""} "${zipFile}"${member ? ` "${member}"` : ""} -d "${into}"`;
289
341
  const name = `${tool} ${version}`;
290
342
  const base = s.base(version);
291
343
  const file = s.asset(version, "$w");
@@ -295,12 +347,12 @@ export function ciToolFetchScript(tool, version, options) {
295
347
  `case "$a" in ${CI_TOOL_ARCHES.map((a) => `(${a}) w=${s.words[a]} ;;`).join(" ")} (*) echo "${name}: chant fetches it for ${CI_TOOL_ARCHES.join(" and ")}, not $a" >&2; exit 1 ;; esac`,
296
348
  `f="${file}"`,
297
349
  `t="$(mktemp -d)"`,
298
- `curl -fsSLo "$t/$f" "${base}/$f"`,
350
+ get(`"${base}/$f"`, "$t/$f"),
299
351
  `case "$a" in ${CI_TOOL_ARCHES.filter((a) => sums[a]).map((a) => `(${a}) want=${sums[a]} ;;`).join(" ")} (*) want= ;; esac`,
300
352
  ];
301
353
  const checksums = s.checksums?.(version, file);
302
354
  if (checksums) {
303
- lines.push(`curl -fsSLo "$t/sums" ${options.checksumsUrl ?? `"${base}/${checksums}"`}`,
355
+ lines.push(get(options.checksumsUrl ?? `"${base}/${checksums}"`, "$t/sums"),
304
356
  // The archive's line, with any ./ or * before the name taken off.
305
357
  `line="$(sed -n "s#^\\([0-9a-f]\\{64\\}\\) *[*.]*/*$f\\$#\\1#p" "$t/sums")"`, `{ [ -n "$line" ] || { echo "${name}: $f is not in ${checksums}" >&2; exit 1; }; }`, `{ [ -z "$want" ] || [ "$line" = "$want" ] || { echo "${name}: ${checksums} lists $line for $f; chant records $want" >&2; exit 1; }; }`, `want="$line"`);
306
358
  }
@@ -317,13 +369,13 @@ export function ciToolFetchScript(tool, version, options) {
317
369
  lines.push(`tar -xzf "$t/$f" -C "$t" "${member}"`, `${su}install -m 0755 "$t/${member}" "${dir}/${s.bin}"`);
318
370
  break;
319
371
  case "zip":
320
- lines.push(`unzip -q -o "$t/$f" "${member}" -d "$t"`, `${su}install -m 0755 "$t/${member}" "${dir}/${s.bin}"`);
372
+ lines.push(unzipTo("$t/$f", "$t", member), `${su}install -m 0755 "$t/${member}" "${dir}/${s.bin}"`);
321
373
  break;
322
374
  case "tree":
323
375
  lines.push(`${su}tar -xzf "$t/$f" -C "${dir}" --strip-components=1`);
324
376
  break;
325
377
  case "aws-cli":
326
- lines.push(`unzip -q "$t/$f" -d "$t"`, `${su}"$t/aws/install" -i "${dir}" -b "${dir}/bin"`);
378
+ lines.push(unzipTo("$t/$f", "$t"), `${su}"$t/aws/install" -i "${dir}" -b "${dir}/bin"`);
327
379
  break;
328
380
  }
329
381
  return lines.join(" && ");
@@ -346,7 +398,7 @@ export function ciToolInstallLine(tool, version, options = {}) {
346
398
  if (!SHELL_DIR.test(binDir))
347
399
  throw new Error(`binDir is an absolute path of letters, digits and ._/-, or one under a variable such as $HOME, not ${JSON.stringify(options.binDir)}`);
348
400
  const su = options.sudo ? "sudo " : "";
349
- const install = `(set -e; ${ciToolFetchScript(tool, version, { dir, sha256: options.sha256, requirePin: options.requirePin, sudo: options.sudo })})`;
401
+ const install = `(set -e; ${ciToolFetchScript(tool, version, { dir, sha256: options.sha256, requirePin: options.requirePin, sudo: options.sudo, download: options.download })})`;
350
402
  const inDir = `[ -x "${bin}" ]`;
351
403
  // A plain path is written as it always was; one under a variable is quoted, so the shell expands it as one word.
352
404
  const target = DIR.test(binDir) ? `${binDir}/${s.bin}` : `"${binDir}/${s.bin}"`;
@@ -1,48 +1,6 @@
1
- /**
2
- * The apply-job guard (#4624): the first step of each op-wave job checks
3
- * that the job runs where the spec set it to run, and stops it otherwise,
4
- * before any token is traded and before the checkout.
5
- *
6
- * What the job is expected to see is written into the job when the pipeline
7
- * is rendered, as JSON in {@link JOB_GUARD_ENV}: the guard reads no file of
8
- * the commit it runs on. What it sees comes from the forge:
9
- *
10
- * forge environment GitHub: the `environment` claim of an OIDC token the
11
- * guard requests for its own audience
12
- * ({@link JOB_GUARD_AUDIENCE}), decodes and drops. GitHub
13
- * sets no variable with the job's environment, so a job
14
- * that may request no token is not checked for it.
15
- * GitLab: CI_ENVIRONMENT_NAME. Forgejo has no
16
- * environments: not checked.
17
- * ref GitHub and Forgejo: GITHUB_REF is refs/heads/<branch>
18
- * for one of the branches the waves apply from. GitLab:
19
- * CI_COMMIT_REF_NAME is one of them, and
20
- * CI_COMMIT_REF_PROTECTED is "true".
21
- * runner GitLab: CI_RUNNER_TAGS holds each of the job's tags.
22
- * GitHub and Forgejo expose no labels, only whether the
23
- * runner is self-hosted: when the job's labels include
24
- * `self-hosted`, the token's runner_environment claim,
25
- * else RUNNER_ENVIRONMENT, is `self-hosted`. Neither
26
- * set: not checked.
27
- *
28
- * The generated step runs {@link jobGuardLine}: `node -e` from `/`, as the
29
- * cloud trade does, so no file of the checkout is in reach and the guard
30
- * needs nothing installed. `chant ci check-job` (and so a product's bin,
31
- * `plywood ci check-job`, `terragucci ci check-job`) runs the same check
32
- * from the same variable, through {@link checkJob}, for a product that
33
- * renders its own jobs. The lines name the product from its words.
34
- *
35
- * A refusal exits chant's `misplaced` (9), as does a variable the guard
36
- * cannot read. GitLab's op-wave jobs allow exit 1 as a failure the next wave
37
- * runs after, and 9 is outside that set, so a refused job fails and the
38
- * waves after it stop.
39
- *
40
- * The guard catches a hand edit, a dropped `environment:` or a mistyped
41
- * label. Someone who can edit the workflow can delete it too: the forge's
42
- * environment and runner settings and the cloud role's trust are what keep
43
- * a job out.
44
- */
45
1
  import { type CiRunner } from "./ci-jobs.js";
2
+ import { type BeforeMergeRecord, type BeforeMergeRun } from "./op/before-merge.js";
3
+ import { type FollowOnRecord, type FollowOnRun } from "./op/follow-on-run.js";
46
4
  /** The variable the generated step carries its expectation in. */
47
5
  export declare const JOB_GUARD_ENV = "CHANT_JOB_GUARD";
48
6
  /** The audience of the token the guard requests on GitHub, which no cloud role should trust. */
@@ -63,6 +21,12 @@ export interface JobGuardSpec {
63
21
  runnerTags?: string[];
64
22
  /** GitHub and Forgejo: the runner must be self-hosted. */
65
23
  selfHosted?: boolean;
24
+ /** The waves have a before-merge mode (#4984): a run that names a head runs only as op `op`'s recorded decision. */
25
+ beforeMerge?: {
26
+ op: string;
27
+ };
28
+ /** The job is one of the `rest` wave's (#4992), rendered as this wave: a follow-on run may name a later one. */
29
+ rest?: number;
66
30
  }
67
31
  /** What the job sees. Undefined: the forge did not say. */
68
32
  export interface JobSeen {
@@ -74,6 +38,18 @@ export interface JobSeen {
74
38
  refProtected?: string;
75
39
  runnerTags?: string[];
76
40
  runnerEnvironment?: string;
41
+ /** The decision the run names (#4984), from its variables. */
42
+ beforeMerge?: BeforeMergeRun;
43
+ /** The recorded decision for that head; null when there is none. Read only when the spec has a before-merge mode. */
44
+ beforeMergeRecord?: BeforeMergeRecord | null;
45
+ /** Why the decisions could not be read, when they could not. */
46
+ beforeMergeError?: string;
47
+ /** The follow-on variables the run names (#4992). */
48
+ followOn?: FollowOnRun;
49
+ /** The follow-on record of the run's chain (#4998); null when there is none. Read only for a follow-on the rest wave's job would admit. */
50
+ followOnRecord?: FollowOnRecord | null;
51
+ /** Why the follow-on records could not be read, when they could not. */
52
+ followOnError?: string;
77
53
  }
78
54
  export interface JobGuardResult {
79
55
  /** One line per value that does not match, naming the expected and found values. */
@@ -96,6 +72,12 @@ export interface JobGuardInput {
96
72
  runner?: CiRunner;
97
73
  /** GitHub: the job may request an OIDC token (`id-token: write`), so the guard can read its environment. */
98
74
  idToken?: boolean;
75
+ /** The waves' before-merge mode (#4984), with the op its decisions are recorded under. */
76
+ beforeMerge?: {
77
+ op: string;
78
+ };
79
+ /** The job is one of the `rest` wave's (#4992), whose number this is. */
80
+ rest?: number;
99
81
  }
100
82
  /**
101
83
  * The expectation a generator writes into a job. GitHub checks the forge
@@ -111,7 +93,22 @@ export declare function tokenClaims(token: string): Record<string, unknown>;
111
93
  /** Compare what the job sees with what the spec expects. */
112
94
  export declare function checkJob(expect: JobGuardSpec, seen: JobSeen): JobGuardResult;
113
95
  /** What the job sees, from the forge's variables, and on GitHub from its token's claims when the forge environment is to be checked. */
114
- export declare function jobSeen(expect: JobGuardSpec, env?: NodeJS.ProcessEnv, fetchFn?: typeof fetch): Promise<JobSeen>;
96
+ export declare function jobSeen(expect: JobGuardSpec, env?: NodeJS.ProcessEnv, fetchFn?: typeof fetch, readLifecycle?: LifecycleFileReader): Promise<JobSeen>;
97
+ /** Reads one file of `chant/lifecycle` as the remote has it; null when the branch has no such file (#4984). */
98
+ export type LifecycleFileReader = (forge: JobGuardForge, env: NodeJS.ProcessEnv, path: string) => string | null;
99
+ /** The repository's git URL and the job token's basic credentials, as the guard fetches with them (#4984). */
100
+ export declare function guardRemote(forge: JobGuardForge, env: NodeJS.ProcessEnv): {
101
+ url: string;
102
+ user: string;
103
+ token: string;
104
+ };
105
+ /**
106
+ * {@link LifecycleFileReader} through git: `chant/lifecycle` fetched at depth
107
+ * one into a directory of the guard's own, outside the checkout, with the
108
+ * token as a basic credential header, and the file shown from it. The
109
+ * `node -e` program does the same.
110
+ */
111
+ export declare const lifecycleFileByGit: LifecycleFileReader;
115
112
  /** The lines the guard prints, and whether the job may go on. */
116
113
  export declare function describeJobGuard(expect: JobGuardSpec, result: JobGuardResult): {
117
114
  ok: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"ci-job-guard.d.ts","sourceRoot":"","sources":["../src/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