@intentius/chant 0.124.87 → 0.124.89

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (483) hide show
  1. package/dist/action-pins.d.ts +1 -0
  2. package/dist/action-pins.d.ts.map +1 -1
  3. package/dist/action-pins.js +2 -0
  4. package/dist/actor.d.ts +47 -0
  5. package/dist/actor.d.ts.map +1 -0
  6. package/dist/actor.js +56 -0
  7. package/dist/bundle-check.d.ts +20 -5
  8. package/dist/bundle-check.d.ts.map +1 -1
  9. package/dist/bundle-check.js +20 -5
  10. package/dist/chant-install.d.ts +98 -0
  11. package/dist/chant-install.d.ts.map +1 -1
  12. package/dist/chant-install.js +203 -2
  13. package/dist/ci-base.d.ts +30 -0
  14. package/dist/ci-base.d.ts.map +1 -0
  15. package/dist/ci-base.js +33 -0
  16. package/dist/ci-comment-commands.d.ts +177 -0
  17. package/dist/ci-comment-commands.d.ts.map +1 -0
  18. package/dist/ci-comment-commands.js +325 -0
  19. package/dist/ci-comment-replies.d.ts +40 -0
  20. package/dist/ci-comment-replies.d.ts.map +1 -0
  21. package/dist/ci-comment-replies.js +59 -0
  22. package/dist/ci-commit.d.ts +1 -1
  23. package/dist/ci-commit.d.ts.map +1 -1
  24. package/dist/ci-commit.js +1 -2
  25. package/dist/ci-control.d.ts +1 -1
  26. package/dist/ci-control.d.ts.map +1 -1
  27. package/dist/ci-control.js +1 -1
  28. package/dist/ci-evidence-claims.d.ts +59 -0
  29. package/dist/ci-evidence-claims.d.ts.map +1 -0
  30. package/dist/ci-evidence-claims.js +87 -0
  31. package/dist/ci-evidence-from-job.d.ts +128 -0
  32. package/dist/ci-evidence-from-job.d.ts.map +1 -0
  33. package/dist/ci-evidence-from-job.js +203 -0
  34. package/dist/ci-evidence-jobs.d.ts +68 -4
  35. package/dist/ci-evidence-jobs.d.ts.map +1 -1
  36. package/dist/ci-evidence-jobs.js +82 -5
  37. package/dist/ci-handover.d.ts +12 -0
  38. package/dist/ci-handover.d.ts.map +1 -1
  39. package/dist/ci-handover.js +15 -3
  40. package/dist/ci-identity.d.ts +32 -6
  41. package/dist/ci-identity.d.ts.map +1 -1
  42. package/dist/ci-identity.js +40 -8
  43. package/dist/ci-image.d.ts +65 -10
  44. package/dist/ci-image.d.ts.map +1 -1
  45. package/dist/ci-image.js +101 -22
  46. package/dist/ci-jobs.d.ts +1 -1
  47. package/dist/ci-jobs.d.ts.map +1 -1
  48. package/dist/ci-jobs.js +7 -2
  49. package/dist/ci-login.d.ts +75 -13
  50. package/dist/ci-login.d.ts.map +1 -1
  51. package/dist/ci-login.js +89 -37
  52. package/dist/ci-note-commands.d.ts +63 -3
  53. package/dist/ci-note-commands.d.ts.map +1 -1
  54. package/dist/ci-note-commands.js +69 -35
  55. package/dist/ci-product-words.d.ts +62 -1
  56. package/dist/ci-product-words.d.ts.map +1 -1
  57. package/dist/ci-product-words.js +52 -1
  58. package/dist/ci-product.d.ts +52 -2
  59. package/dist/ci-product.d.ts.map +1 -1
  60. package/dist/ci-product.js +51 -2
  61. package/dist/cli/commands/build.d.ts.map +1 -1
  62. package/dist/cli/commands/build.js +29 -2
  63. package/dist/cli/handlers/approve-confirm.d.ts +14 -0
  64. package/dist/cli/handlers/approve-confirm.d.ts.map +1 -1
  65. package/dist/cli/handlers/approve-confirm.js +46 -0
  66. package/dist/cli/handlers/approve.d.ts.map +1 -1
  67. package/dist/cli/handlers/approve.js +2 -1
  68. package/dist/cli/handlers/build.d.ts +1 -1
  69. package/dist/cli/handlers/build.d.ts.map +1 -1
  70. package/dist/cli/handlers/build.js +22 -1
  71. package/dist/cli/handlers/ci-check.d.ts +1 -1
  72. package/dist/cli/handlers/ci-check.d.ts.map +1 -1
  73. package/dist/cli/handlers/ci-check.js +37 -7
  74. package/dist/cli/handlers/ci-evidence.d.ts.map +1 -1
  75. package/dist/cli/handlers/ci-evidence.js +255 -20
  76. package/dist/cli/handlers/ci-forge-check.d.ts.map +1 -1
  77. package/dist/cli/handlers/ci-forge-check.js +34 -17
  78. package/dist/cli/handlers/components.d.ts.map +1 -1
  79. package/dist/cli/handlers/components.js +3 -1
  80. package/dist/cli/handlers/generated-check.d.ts +11 -0
  81. package/dist/cli/handlers/generated-check.d.ts.map +1 -0
  82. package/dist/cli/handlers/generated-check.js +71 -0
  83. package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
  84. package/dist/cli/handlers/lifecycle.js +3 -0
  85. package/dist/cli/handlers/local-chant.d.ts +13 -0
  86. package/dist/cli/handlers/local-chant.d.ts.map +1 -1
  87. package/dist/cli/handlers/local-chant.js +42 -1
  88. package/dist/cli/handlers/lock.d.ts.map +1 -1
  89. package/dist/cli/handlers/lock.js +121 -4
  90. package/dist/cli/handlers/pr-comment.d.ts +21 -0
  91. package/dist/cli/handlers/pr-comment.d.ts.map +1 -0
  92. package/dist/cli/handlers/pr-comment.js +112 -0
  93. package/dist/cli/handlers/pr-env.d.ts.map +1 -1
  94. package/dist/cli/handlers/pr-env.js +6 -3
  95. package/dist/cli/handlers/pr.d.ts +23 -1
  96. package/dist/cli/handlers/pr.d.ts.map +1 -1
  97. package/dist/cli/handlers/pr.js +97 -14
  98. package/dist/cli/handlers/promote.d.ts.map +1 -1
  99. package/dist/cli/handlers/promote.js +2 -1
  100. package/dist/cli/handlers/release.d.ts.map +1 -1
  101. package/dist/cli/handlers/release.js +11 -2
  102. package/dist/cli/handlers/run-wave.d.ts.map +1 -1
  103. package/dist/cli/handlers/run-wave.js +36 -2
  104. package/dist/cli/handlers/run.d.ts.map +1 -1
  105. package/dist/cli/handlers/run.js +2 -1
  106. package/dist/cli/main.d.ts.map +1 -1
  107. package/dist/cli/main.js +60 -4
  108. package/dist/cli/parse-args.d.ts.map +1 -1
  109. package/dist/cli/parse-args.js +82 -0
  110. package/dist/cli/registry.d.ts +35 -0
  111. package/dist/cli/registry.d.ts.map +1 -1
  112. package/dist/components/auto-release.d.ts.map +1 -1
  113. package/dist/components/auto-release.js +2 -1
  114. package/dist/components/check-hooks.d.ts +10 -0
  115. package/dist/components/check-hooks.d.ts.map +1 -1
  116. package/dist/components/check-hooks.js +18 -0
  117. package/dist/components/pr-checks.d.ts +169 -0
  118. package/dist/components/pr-checks.d.ts.map +1 -0
  119. package/dist/components/pr-checks.js +180 -0
  120. package/dist/components/pr-pipeline.d.ts +38 -0
  121. package/dist/components/pr-pipeline.d.ts.map +1 -1
  122. package/dist/components/pr-pipeline.js +6 -1
  123. package/dist/components/product-pipeline.d.ts +58 -2
  124. package/dist/components/product-pipeline.d.ts.map +1 -1
  125. package/dist/components/product-pipeline.js +76 -9
  126. package/dist/components/product-plan.d.ts +445 -7
  127. package/dist/components/product-plan.d.ts.map +1 -1
  128. package/dist/components/product-plan.js +426 -15
  129. package/dist/config.d.ts +10 -6
  130. package/dist/config.d.ts.map +1 -1
  131. package/dist/config.js +11 -6
  132. package/dist/control/consumers.d.ts +6 -0
  133. package/dist/control/consumers.d.ts.map +1 -1
  134. package/dist/control/consumers.js +6 -0
  135. package/dist/dead-guards.d.ts.map +1 -1
  136. package/dist/dead-guards.js +9 -6
  137. package/dist/discovery/files.d.ts +1 -1
  138. package/dist/discovery/files.js +1 -1
  139. package/dist/drift-issue.d.ts +20 -3
  140. package/dist/drift-issue.d.ts.map +1 -1
  141. package/dist/drift-issue.js +16 -0
  142. package/dist/drift-record.d.ts +52 -5
  143. package/dist/drift-record.d.ts.map +1 -1
  144. package/dist/drift-record.js +46 -6
  145. package/dist/floor-table.d.ts +6 -6
  146. package/dist/floor-table.d.ts.map +1 -1
  147. package/dist/floor-table.data.d.ts.map +1 -1
  148. package/dist/floor-table.data.js +81 -21
  149. package/dist/floor-table.js +10 -7
  150. package/dist/forge-check/contract.d.ts +19 -1
  151. package/dist/forge-check/contract.d.ts.map +1 -1
  152. package/dist/forge-check/contract.js +8 -2
  153. package/dist/forge-check/index.d.ts +4 -0
  154. package/dist/forge-check/index.d.ts.map +1 -1
  155. package/dist/forge-check/index.js +4 -0
  156. package/dist/forge-flags.d.ts +10 -0
  157. package/dist/forge-flags.d.ts.map +1 -1
  158. package/dist/forge-flags.js +31 -0
  159. package/dist/forge-remote.d.ts +47 -0
  160. package/dist/forge-remote.d.ts.map +1 -0
  161. package/dist/forge-remote.js +69 -0
  162. package/dist/gate-resume-run.d.ts +9 -1
  163. package/dist/gate-resume-run.d.ts.map +1 -1
  164. package/dist/gate-resume-run.js +26 -3
  165. package/dist/generated-check.d.ts +88 -0
  166. package/dist/generated-check.d.ts.map +1 -0
  167. package/dist/generated-check.js +248 -0
  168. package/dist/image-pins.d.ts +26 -0
  169. package/dist/image-pins.d.ts.map +1 -0
  170. package/dist/image-pins.js +19 -0
  171. package/dist/lexicon.d.ts +27 -0
  172. package/dist/lexicon.d.ts.map +1 -1
  173. package/dist/lifecycle/git.d.ts +11 -0
  174. package/dist/lifecycle/git.d.ts.map +1 -1
  175. package/dist/lifecycle/git.js +30 -3
  176. package/dist/lifecycle/publish-npm.d.ts +26 -0
  177. package/dist/lifecycle/publish-npm.d.ts.map +1 -1
  178. package/dist/lifecycle/publish-npm.js +76 -4
  179. package/dist/lifecycle/reach-locks.d.ts +131 -0
  180. package/dist/lifecycle/reach-locks.d.ts.map +1 -0
  181. package/dist/lifecycle/reach-locks.js +118 -0
  182. package/dist/lifecycle/release-cut.d.ts +3 -1
  183. package/dist/lifecycle/release-cut.d.ts.map +1 -1
  184. package/dist/lifecycle/release-cut.js +15 -0
  185. package/dist/lifecycle/release-images.d.ts +22 -1
  186. package/dist/lifecycle/release-images.d.ts.map +1 -1
  187. package/dist/lifecycle/release-images.js +26 -3
  188. package/dist/lifecycle/release-ledger.d.ts +4 -3
  189. package/dist/lifecycle/release-ledger.d.ts.map +1 -1
  190. package/dist/lifecycle/release-ledger.js +3 -2
  191. package/dist/local-chant.d.ts +57 -3
  192. package/dist/local-chant.d.ts.map +1 -1
  193. package/dist/local-chant.js +122 -13
  194. package/dist/notify-product.d.ts +12 -3
  195. package/dist/notify-product.d.ts.map +1 -1
  196. package/dist/notify-product.js +10 -6
  197. package/dist/op/activities/source-release.d.ts.map +1 -1
  198. package/dist/op/activities/source-release.js +2 -1
  199. package/dist/op/activities/source-rollback.d.ts.map +1 -1
  200. package/dist/op/activities/source-rollback.js +2 -1
  201. package/dist/op/index.d.ts +2 -0
  202. package/dist/op/index.d.ts.map +1 -1
  203. package/dist/op/index.js +1 -0
  204. package/dist/op/op-waves-evidence-jobs.d.ts +97 -0
  205. package/dist/op/op-waves-evidence-jobs.d.ts.map +1 -0
  206. package/dist/op/op-waves-evidence-jobs.js +118 -0
  207. package/dist/op/op-waves-evidence.d.ts +12 -1
  208. package/dist/op/op-waves-evidence.d.ts.map +1 -1
  209. package/dist/op/op-waves-evidence.js +23 -2
  210. package/dist/op/op-waves-render-spec.d.ts +100 -0
  211. package/dist/op/op-waves-render-spec.d.ts.map +1 -0
  212. package/dist/op/op-waves-render-spec.js +162 -0
  213. package/dist/op/op-waves-run.d.ts +14 -1
  214. package/dist/op/op-waves-run.d.ts.map +1 -1
  215. package/dist/op/op-waves-run.js +56 -4
  216. package/dist/op/op-waves.d.ts +12 -0
  217. package/dist/op/op-waves.d.ts.map +1 -1
  218. package/dist/op/op-waves.js +14 -1
  219. package/dist/op/schedule-overdue.d.ts +39 -2
  220. package/dist/op/schedule-overdue.d.ts.map +1 -1
  221. package/dist/op/schedule-overdue.js +148 -10
  222. package/dist/op/wave-stop.d.ts +64 -0
  223. package/dist/op/wave-stop.d.ts.map +1 -0
  224. package/dist/op/wave-stop.js +127 -0
  225. package/dist/planned-files.d.ts +76 -0
  226. package/dist/planned-files.d.ts.map +1 -0
  227. package/dist/planned-files.js +108 -0
  228. package/dist/pr-forge-job.d.ts +22 -0
  229. package/dist/pr-forge-job.d.ts.map +1 -0
  230. package/dist/pr-forge-job.js +46 -0
  231. package/dist/pr-forge-reads.d.ts +21 -1
  232. package/dist/pr-forge-reads.d.ts.map +1 -1
  233. package/dist/pr-forge-reads.js +19 -1
  234. package/dist/pr-forge.d.ts +7 -1
  235. package/dist/pr-forge.d.ts.map +1 -1
  236. package/dist/pr-forge.js +7 -2
  237. package/dist/pr-loop.d.ts +3 -6
  238. package/dist/pr-loop.d.ts.map +1 -1
  239. package/dist/pr-loop.js +4 -81
  240. package/dist/pr-plan-note.d.ts +121 -0
  241. package/dist/pr-plan-note.d.ts.map +1 -1
  242. package/dist/pr-plan-note.js +104 -1
  243. package/dist/pr-plan-record.d.ts +47 -0
  244. package/dist/pr-plan-record.d.ts.map +1 -0
  245. package/dist/pr-plan-record.js +89 -0
  246. package/dist/pr-post.d.ts +68 -3
  247. package/dist/pr-post.d.ts.map +1 -1
  248. package/dist/pr-post.js +218 -13
  249. package/dist/pr-requires.d.ts +8 -0
  250. package/dist/pr-requires.d.ts.map +1 -1
  251. package/dist/pr-requires.js +3 -1
  252. package/dist/pr-status.d.ts +16 -0
  253. package/dist/pr-status.d.ts.map +1 -0
  254. package/dist/pr-status.js +90 -0
  255. package/dist/ref-gate-init.d.ts +90 -0
  256. package/dist/ref-gate-init.d.ts.map +1 -0
  257. package/dist/ref-gate-init.js +155 -0
  258. package/dist/ref-gate-rules.d.ts +19 -0
  259. package/dist/ref-gate-rules.d.ts.map +1 -0
  260. package/dist/ref-gate-rules.js +17 -0
  261. package/dist/release-floors.d.ts +100 -16
  262. package/dist/release-floors.d.ts.map +1 -1
  263. package/dist/release-floors.js +101 -17
  264. package/dist/render-module.d.ts +15 -0
  265. package/dist/render-module.d.ts.map +1 -0
  266. package/dist/render-module.js +73 -0
  267. package/dist/state-migration.d.ts +24 -1
  268. package/dist/state-migration.d.ts.map +1 -1
  269. package/dist/state-migration.js +39 -4
  270. package/dist/state-unlock.d.ts +32 -1
  271. package/dist/state-unlock.d.ts.map +1 -1
  272. package/dist/state-unlock.js +31 -0
  273. package/dist/wave-runtime.mjs +307 -297
  274. package/dist/workspace/ci-green-cli.d.ts.map +1 -1
  275. package/dist/workspace/ci-green-cli.js +15 -8
  276. package/dist/workspace/drift-cli.d.ts +1 -1
  277. package/dist/workspace/drift-cli.d.ts.map +1 -1
  278. package/dist/workspace/drift-cli.js +5 -12
  279. package/dist/workspace/forge-work.d.ts +3 -2
  280. package/dist/workspace/forge-work.d.ts.map +1 -1
  281. package/dist/workspace/forge-work.js +7 -17
  282. package/dist/workspace/lexicon-outputs.js +2 -2
  283. package/dist/workspace/release-train.d.ts.map +1 -1
  284. package/dist/workspace/release-train.js +2 -1
  285. package/dist/workspace/release-workflow.d.ts +27 -3
  286. package/dist/workspace/release-workflow.d.ts.map +1 -1
  287. package/dist/workspace/release-workflow.js +52 -7
  288. package/dist/workspace/trust/check-evidence-report.d.ts +25 -2
  289. package/dist/workspace/trust/check-evidence-report.d.ts.map +1 -1
  290. package/dist/workspace/trust/check-evidence-report.js +28 -8
  291. package/dist/workspace/trust/check-evidence.d.ts +13 -1
  292. package/dist/workspace/trust/check-evidence.d.ts.map +1 -1
  293. package/dist/workspace/trust/check-evidence.js +8 -3
  294. package/dist/workspace/trust/evidence.d.ts +5 -0
  295. package/dist/workspace/trust/evidence.d.ts.map +1 -1
  296. package/dist/workspace/trust/evidence.js +5 -0
  297. package/dist/workspace/trust/open-evidence.d.ts +67 -0
  298. package/dist/workspace/trust/open-evidence.d.ts.map +1 -0
  299. package/dist/workspace/trust/open-evidence.js +92 -0
  300. package/dist/workspace/trust/ref-gate-cli.d.ts +10 -1
  301. package/dist/workspace/trust/ref-gate-cli.d.ts.map +1 -1
  302. package/dist/workspace/trust/ref-gate-cli.js +93 -11
  303. package/dist/workspace/trust/ref-gate.d.ts +61 -2
  304. package/dist/workspace/trust/ref-gate.d.ts.map +1 -1
  305. package/dist/workspace/trust/ref-gate.js +72 -7
  306. package/dist/workspace/workspace-run.d.ts.map +1 -1
  307. package/dist/workspace/workspace-run.js +2 -1
  308. package/package.json +1 -1
  309. package/src/action-pins.ts +2 -0
  310. package/src/actor.test.ts +78 -0
  311. package/src/actor.ts +79 -0
  312. package/src/bundle-check.test.ts +22 -0
  313. package/src/bundle-check.ts +33 -5
  314. package/src/chant-install.test.ts +108 -1
  315. package/src/chant-install.ts +242 -2
  316. package/src/ci-base.test.ts +41 -0
  317. package/src/ci-base.ts +43 -0
  318. package/src/ci-comment-commands.test.ts +376 -0
  319. package/src/ci-comment-commands.ts +389 -0
  320. package/src/ci-comment-replies.ts +78 -0
  321. package/src/ci-commit.test.ts +51 -6
  322. package/src/ci-commit.ts +1 -2
  323. package/src/ci-control.ts +1 -0
  324. package/src/ci-evidence-claims.ts +102 -0
  325. package/src/ci-evidence-from-job.test.ts +165 -0
  326. package/src/ci-evidence-from-job.ts +251 -0
  327. package/src/ci-evidence-jobs.ts +88 -6
  328. package/src/ci-handover.ts +16 -3
  329. package/src/ci-identity.test.ts +3 -3
  330. package/src/ci-identity.ts +51 -11
  331. package/src/ci-image.test.ts +187 -16
  332. package/src/ci-image.ts +157 -25
  333. package/src/ci-jobs.ts +7 -2
  334. package/src/ci-login.test.ts +131 -3
  335. package/src/ci-login.token-drop.test.ts +204 -0
  336. package/src/ci-login.ts +137 -39
  337. package/src/ci-note-commands.ts +104 -41
  338. package/src/ci-product-words.ts +89 -0
  339. package/src/ci-product.ts +62 -1
  340. package/src/cli/commands/__fixtures__/source-dir-root/migrations/0001-init/backfill.ts +3 -0
  341. package/src/cli/commands/build.test.ts +41 -0
  342. package/src/cli/commands/build.ts +27 -2
  343. package/src/cli/handlers/approve-confirm.test.ts +35 -0
  344. package/src/cli/handlers/approve-confirm.ts +44 -0
  345. package/src/cli/handlers/approve.ts +2 -1
  346. package/src/cli/handlers/build-source-dir.test.ts +4 -0
  347. package/src/cli/handlers/build.ts +20 -2
  348. package/src/cli/handlers/ci-check.ts +37 -7
  349. package/src/cli/handlers/ci-evidence-open.test.ts +164 -0
  350. package/src/cli/handlers/ci-evidence.ts +233 -18
  351. package/src/cli/handlers/ci-forge-check.ts +22 -9
  352. package/src/cli/handlers/components.ts +3 -1
  353. package/src/cli/handlers/generated-check.ts +69 -0
  354. package/src/cli/handlers/lifecycle.test.ts +20 -0
  355. package/src/cli/handlers/lifecycle.ts +4 -0
  356. package/src/cli/handlers/local-chant.ts +39 -1
  357. package/src/cli/handlers/lock-reach.test.ts +103 -0
  358. package/src/cli/handlers/lock.ts +100 -4
  359. package/src/cli/handlers/pr-comment.ts +104 -0
  360. package/src/cli/handlers/pr-env.ts +6 -3
  361. package/src/cli/handlers/pr-record.test.ts +1 -1
  362. package/src/cli/handlers/pr.ts +93 -15
  363. package/src/cli/handlers/promote.ts +2 -1
  364. package/src/cli/handlers/release.e2e.test.ts +35 -0
  365. package/src/cli/handlers/release.ts +14 -2
  366. package/src/cli/handlers/run-wave.ts +35 -2
  367. package/src/cli/handlers/run.ts +2 -1
  368. package/src/cli/main.ts +60 -4
  369. package/src/cli/parse-args.ts +58 -0
  370. package/src/cli/registry.ts +35 -0
  371. package/src/components/auto-release.ts +2 -1
  372. package/src/components/check-hooks.ts +22 -0
  373. package/src/components/check-report-summary.test.ts +78 -0
  374. package/src/components/pr-checks.ts +254 -0
  375. package/src/components/pr-pipeline.ts +43 -1
  376. package/src/components/product-pipeline.ts +113 -9
  377. package/src/components/product-plan.test.ts +140 -1
  378. package/src/components/product-plan.ts +707 -20
  379. package/src/config.ts +13 -8
  380. package/src/control/consumers.ts +7 -0
  381. package/src/dead-guards.test.ts +27 -5
  382. package/src/dead-guards.ts +9 -6
  383. package/src/discovery/files.ts +1 -1
  384. package/src/drift-issue.test.ts +29 -1
  385. package/src/drift-issue.ts +28 -3
  386. package/src/drift-record.test.ts +45 -0
  387. package/src/drift-record.ts +71 -6
  388. package/src/floor-table.data.ts +81 -21
  389. package/src/floor-table.ts +12 -9
  390. package/src/forge-check/contract.ts +23 -2
  391. package/src/forge-check/forge-check.test.ts +25 -0
  392. package/src/forge-check/index.ts +4 -0
  393. package/src/forge-flags.test.ts +25 -1
  394. package/src/forge-flags.ts +34 -0
  395. package/src/forge-remote.test.ts +37 -0
  396. package/src/forge-remote.ts +79 -0
  397. package/src/gate-resume-run.ts +27 -3
  398. package/src/generated-check.e2e.test.ts +118 -0
  399. package/src/generated-check.test.ts +170 -0
  400. package/src/generated-check.ts +310 -0
  401. package/src/image-pins.ts +31 -0
  402. package/src/lexicon.ts +28 -0
  403. package/src/lifecycle/git.test.ts +48 -0
  404. package/src/lifecycle/git.ts +27 -4
  405. package/src/lifecycle/publish-npm.ts +87 -4
  406. package/src/lifecycle/reach-locks.test.ts +87 -0
  407. package/src/lifecycle/reach-locks.ts +169 -0
  408. package/src/lifecycle/release-catalog.test.ts +2 -2
  409. package/src/lifecycle/release-cut.ts +17 -1
  410. package/src/lifecycle/release-images-dockerfile.test.ts +20 -0
  411. package/src/lifecycle/release-images.test.ts +100 -0
  412. package/src/lifecycle/release-images.ts +38 -3
  413. package/src/lifecycle/release-ledger.ts +4 -3
  414. package/src/local-chant.e2e.test.ts +81 -6
  415. package/src/local-chant.test.ts +22 -3
  416. package/src/local-chant.ts +130 -13
  417. package/src/notify-product.ts +19 -8
  418. package/src/op/activities/source-release.ts +2 -1
  419. package/src/op/activities/source-rollback.ts +2 -1
  420. package/src/op/gate-resume.test.ts +27 -0
  421. package/src/op/index.ts +10 -0
  422. package/src/op/op-waves-evidence-jobs.ts +140 -0
  423. package/src/op/op-waves-evidence.test.ts +36 -3
  424. package/src/op/op-waves-evidence.ts +23 -3
  425. package/src/op/op-waves-notify-words.test.ts +18 -0
  426. package/src/op/op-waves-render-spec.test.ts +160 -0
  427. package/src/op/op-waves-render-spec.ts +171 -0
  428. package/src/op/op-waves-run.ts +59 -3
  429. package/src/op/op-waves.ts +16 -2
  430. package/src/op/schedule-overdue.test.ts +126 -1
  431. package/src/op/schedule-overdue.ts +164 -12
  432. package/src/op/wave-stop.test.ts +72 -0
  433. package/src/op/wave-stop.ts +137 -0
  434. package/src/planned-files.test.ts +80 -0
  435. package/src/planned-files.ts +134 -0
  436. package/src/pr-forge-job.test.ts +53 -0
  437. package/src/pr-forge-job.ts +46 -0
  438. package/src/pr-forge-reads-compare.test.ts +2 -1
  439. package/src/pr-forge-reads.ts +37 -1
  440. package/src/pr-forge.ts +14 -3
  441. package/src/pr-loop-narrowed.test.ts +2 -1
  442. package/src/pr-loop-words.test.ts +2 -1
  443. package/src/pr-loop.test.ts +1 -2
  444. package/src/pr-loop.ts +4 -80
  445. package/src/pr-plan-note.ts +184 -3
  446. package/src/pr-plan-record.test.ts +75 -0
  447. package/src/pr-plan-record.ts +101 -0
  448. package/src/pr-post-plan-note.test.ts +60 -0
  449. package/src/pr-post-replan.test.ts +144 -0
  450. package/src/pr-post-subject.test.ts +230 -0
  451. package/src/pr-post.test.ts +32 -1
  452. package/src/pr-post.ts +254 -15
  453. package/src/pr-requires.test.ts +20 -0
  454. package/src/pr-requires.ts +10 -1
  455. package/src/pr-status.ts +91 -0
  456. package/src/ref-gate-init.ts +208 -0
  457. package/src/ref-gate-rules.ts +26 -0
  458. package/src/release-floors.ts +139 -17
  459. package/src/render-module.ts +73 -0
  460. package/src/state-migration-record.test.ts +89 -0
  461. package/src/state-migration.test.ts +1 -1
  462. package/src/state-migration.ts +52 -4
  463. package/src/state-unlock.test.ts +33 -1
  464. package/src/state-unlock.ts +49 -1
  465. package/src/workspace/ci-green-cli.ts +14 -7
  466. package/src/workspace/ci-green-workflow.test.ts +32 -1
  467. package/src/workspace/drift-cli.ts +6 -18
  468. package/src/workspace/forge-work.ts +7 -14
  469. package/src/workspace/lexicon-outputs.ts +2 -2
  470. package/src/workspace/release-train.ts +2 -1
  471. package/src/workspace/release-workflow.test.ts +104 -3
  472. package/src/workspace/release-workflow.ts +60 -9
  473. package/src/workspace/trust/check-evidence-report.ts +39 -8
  474. package/src/workspace/trust/check-evidence.test.ts +5 -0
  475. package/src/workspace/trust/check-evidence.ts +17 -5
  476. package/src/workspace/trust/evidence.ts +5 -0
  477. package/src/workspace/trust/open-evidence.ts +129 -0
  478. package/src/workspace/trust/ref-gate-cli.ts +88 -10
  479. package/src/workspace/trust/ref-gate-pieces.test.ts +220 -0
  480. package/src/workspace/trust/ref-gate.e2e.test.ts +17 -0
  481. package/src/workspace/trust/ref-gate.test.ts +10 -0
  482. package/src/workspace/trust/ref-gate.ts +87 -6
  483. package/src/workspace/workspace-run.ts +2 -1
@@ -36,19 +36,38 @@
36
36
  * earlier request of the same migration stands, made since that request was
37
37
  * asked, answers `approval-moved` and names the roots whose state moved
38
38
  * between the two (#4806).
39
+ *
40
+ * A product's own record of the migration (its moves, retags and stamps)
41
+ * goes in the attachment beside the roots as `record` (#4928): canonical
42
+ * JSON, at most {@link STATE_MIGRATION_RECORD_MAX_BYTES}, so the digest binds
43
+ * it and `chant approve` shows it with the roots.
39
44
  */
45
+ import { canonicalJson } from "./effect-receipt";
40
46
  import { CHANT_EXIT } from "./exit-codes";
41
47
  import { chantGatedLedger, gatedOp, type GatedRequestLedger } from "./lifecycle/gated-op";
42
48
  import type { GatedRequestRules } from "./lifecycle/gated-request";
43
49
  import { gatedRequestAttachmentPath } from "./lifecycle/gated-request-digest";
44
50
  import { samePlanDigest } from "./lifecycle/plan-digest";
45
- import { NEXT_RELEASE } from "./release-floors";
46
51
 
47
52
  /** The first chant with the engine-neutral state migration (#4762). */
48
53
  export const STATE_MIGRATION_FLOOR = "0.124.77";
49
54
 
50
55
  /** The first chant whose migration binds a root's `source` (an engine's `source` read under the locks) and answers `approval-moved`, and whose terraform lexicon plans backend moves (`planTerraformMigration`'s `backends`) and choudoufu estate migrations (`planEstateMigration`) onto it (#4806). */
51
- export const STATE_MIGRATION_SOURCE_FLOOR = NEXT_RELEASE;
56
+ export const STATE_MIGRATION_SOURCE_FLOOR = "0.124.86";
57
+
58
+ /** The first chant whose `runStateMigration` takes a product's `record`, which the request's attachment binds beside the roots and `chant approve` shows (#4928). */
59
+ export const STATE_MIGRATION_RECORD_FLOOR = "0.124.88";
60
+
61
+ /** The most a product's migration `record` may take, as canonical JSON in UTF-8 (#4928): a record names moves, retags and stamps, never a state's contents. */
62
+ export const STATE_MIGRATION_RECORD_MAX_BYTES = 64 * 1024;
63
+
64
+ /** A product's migration `record` that cannot be bound: not JSON, or over {@link STATE_MIGRATION_RECORD_MAX_BYTES}. Thrown before anything is asked. */
65
+ export class StateMigrationRecordError extends Error {
66
+ constructor(message: string) {
67
+ super(message);
68
+ this.name = "StateMigrationRecordError";
69
+ }
70
+ }
52
71
 
53
72
  /** A state as a migration binds it: its version id, when the store keeps versions, and its digest, null for no state. */
54
73
  export interface MigrationStateAt {
@@ -120,6 +139,16 @@ export interface StateMigrationInput {
120
139
  words: StateMigrationWords;
121
140
  /** The product's facts the request binds, such as the migration file's path and digest. */
122
141
  fields?: Record<string, string>;
142
+ /**
143
+ * The product's own record of the migration, such as its moves, retags and
144
+ * stamps (#4928). It goes in the request's attachment beside the roots as
145
+ * canonical JSON (keys sorted), so the request's digest binds it and
146
+ * `chant approve` shows it. At most {@link STATE_MIGRATION_RECORD_MAX_BYTES};
147
+ * a record that is larger or is not JSON throws {@link StateMigrationRecordError}
148
+ * before anything is asked. Never a state's contents. Unset, the attachment
149
+ * is the roots alone, as before.
150
+ */
151
+ record?: unknown;
123
152
  /** The product's facts the finished line adds, given how it ended. */
124
153
  detail?: (result: StateMigrationResult) => Record<string, string | number | boolean>;
125
154
  rules: GatedRequestRules;
@@ -170,6 +199,24 @@ const boundRoot = (r: MigrationRootPlan) => ({
170
199
  ...(r.source ? { source: { location: r.source.location ?? null, version_id: r.source.version_id ?? null, digest: r.source.digest } } : {}),
171
200
  });
172
201
 
202
+ /**
203
+ * A product's record as the attachment binds it (#4928): its canonical JSON
204
+ * read back, so its keys are in sorted order, once it is known to fit.
205
+ */
206
+ export function boundRecord(record: unknown): unknown {
207
+ let text: string;
208
+ try {
209
+ text = canonicalJson(record);
210
+ } catch (e) {
211
+ throw new StateMigrationRecordError(`the migration's record is not JSON: ${(e as Error).message}`);
212
+ }
213
+ const bytes = Buffer.byteLength(text, "utf8");
214
+ if (bytes > STATE_MIGRATION_RECORD_MAX_BYTES) {
215
+ throw new StateMigrationRecordError(`the migration's record is ${bytes} bytes as canonical JSON, over the ${STATE_MIGRATION_RECORD_MAX_BYTES} a request binds; keep the moves, retags and stamps, and leave the rest in the product's report`);
216
+ }
217
+ return JSON.parse(text) as unknown;
218
+ }
219
+
173
220
  /** The finished line's flat facts: how it ended, and each root's location, versions and digests. */
174
221
  export function migrationFacts(result: StateMigrationResult): Record<string, string | number | boolean> {
175
222
  const out: Record<string, string | number | boolean> = {
@@ -235,8 +282,9 @@ export async function runStateMigration(input: StateMigrationInput): Promise<Sta
235
282
  const failing = input.roots.filter((r) => r.proof.changes.length > 0).map((r) => r.root);
236
283
  if (failing.length > 0) return { status: "proof-failed", exit: CHANT_EXIT.failed, roots: input.roots, failing };
237
284
  const roots = [...input.roots].sort((a, b) => (a.root < b.root ? -1 : a.root > b.root ? 1 : 0));
238
- // The attachment binds each root's state before and after; the proof's wording is the engine's, not the migration.
239
- const attachment = `${JSON.stringify({ name: input.name, roots: roots.map(boundRoot) }, null, 2)}\n`;
285
+ // The attachment binds each root's state before and after, and the product's record when it gives one (#4928); the proof's wording is the engine's, not the migration.
286
+ const record = input.record === undefined ? undefined : boundRecord(input.record);
287
+ const attachment = `${JSON.stringify({ name: input.name, roots: roots.map(boundRoot), ...(record !== undefined ? { record } : {}) }, null, 2)}\n`;
240
288
  const now = input.now ?? new Date().toISOString();
241
289
  const result = await gatedOp(
242
290
  {
@@ -6,7 +6,7 @@
6
6
  import { describe, expect, test } from "vitest";
7
7
  import { fakeLedger } from "./__fixtures__/gated-ledger";
8
8
  import type { ForgeFetch } from "./pr-forge";
9
- import { CLOCK_SKEW_MS, forgeLiveRuns, parseLockInfo, possibleHolders, releaseStateLock, STATE_UNLOCK_FLOOR, StateUnlockError, type LiveRun, type LockInfo, type StateLockSource } from "./state-unlock";
9
+ import { CLOCK_SKEW_MS, forgeLiveRuns, forgeLiveRunsOf, forgeTargetLiveRuns, parseLockInfo, possibleHolders, releaseStateLock, STATE_UNLOCK_FLOOR, StateUnlockError, type LiveRun, type LockInfo, type StateLockSource } from "./state-unlock";
10
10
 
11
11
  const LOCK: LockInfo = { ID: "a1b2", Operation: "OperationTypeApply", Who: "runner@ci", Created: "2026-11-08T08:00:00Z" };
12
12
 
@@ -163,3 +163,35 @@ describe("forgeLiveRuns", () => {
163
163
  expect(headers[0]!["PRIVATE-TOKEN"]).toBe("glpat");
164
164
  });
165
165
  });
166
+
167
+ // #4911: one helper from a forge target to its live runs; #4920: the origin remote names the forge on a laptop.
168
+ describe("forgeTargetLiveRuns and forgeLiveRunsOf", () => {
169
+ test("a target's runs, its GitLab token header kept", async () => {
170
+ const { fetch, urls, headers } = forgeFetch({});
171
+ await forgeTargetLiveRuns({ kind: "gitlab", apiBase: "https://gl.example/api/v4", repo: "g/p", token: "ci", tokenHeader: "JOB-TOKEN" }, fetch);
172
+ expect(urls[0]).toBe("https://gl.example/api/v4/projects/g%2Fp/pipelines?status=running&per_page=100");
173
+ expect(headers[0]!["JOB-TOKEN"]).toBe("ci");
174
+ });
175
+
176
+ test("in a job, the job's repository; the remote is not read", async () => {
177
+ const { fetch, urls } = forgeFetch({});
178
+ const read: string[] = [];
179
+ const env = { GITHUB_ACTIONS: "true", GITHUB_REPOSITORY: "acme/infra", GITHUB_SERVER_URL: "https://github.com", GITHUB_TOKEN: "t" };
180
+ await forgeLiveRunsOf(env, {}, { cwd: "/repo", fetch, remoteUrl: (cwd) => (read.push(cwd), "git@github.com:other/repo.git") })();
181
+ expect(read).toEqual([]);
182
+ expect(urls[0]).toContain("/repos/acme/infra/actions/runs");
183
+ });
184
+
185
+ test("on a laptop, the origin remote's forge and repository, the product's kind and url over it", async () => {
186
+ const { fetch, urls } = forgeFetch({});
187
+ await forgeLiveRunsOf({ GITHUB_TOKEN: "t" }, {}, { cwd: "/repo", fetch, remoteUrl: () => "git@github.com:acme/infra.git" })();
188
+ expect(urls[0]).toBe("https://api.github.com/repos/acme/infra/actions/runs?status=in_progress&per_page=100");
189
+ const fj = forgeFetch({});
190
+ await forgeLiveRunsOf({ FORGEJO_TOKEN: "f" }, { kind: "forgejo", url: "http://git.lan:3000" }, { cwd: "/repo", fetch: fj.fetch, remoteUrl: () => "ssh://git@git.lan:2222/acme/infra.git" })();
191
+ expect(fj.urls[0]).toBe("http://git.lan:3000/api/v1/repos/acme/infra/actions/runs?status=running&limit=50");
192
+ });
193
+
194
+ test("on a laptop with no remote and no repository, the read throws, so the release is refused", async () => {
195
+ await expect(forgeLiveRunsOf({ GITHUB_TOKEN: "t" }, { kind: "github" }, { cwd: "/repo", remoteUrl: () => undefined })()).rejects.toThrow(/GITHUB_REPOSITORY/);
196
+ });
197
+ });
@@ -26,7 +26,8 @@
26
26
  import { CHANT_EXIT } from "./exit-codes";
27
27
  import { gatedOp, type GatedRequestLedger } from "./lifecycle/gated-op";
28
28
  import type { GatedRequestRules } from "./lifecycle/gated-request";
29
- import type { ForgeFetch, ForgeKind } from "./pr-forge";
29
+ import type { ForgeOverrides } from "./forge-flags";
30
+ import type { ForgeFetch, ForgeKind, ForgeTarget, ForgeTargetOptions } from "./pr-forge";
30
31
 
31
32
  /** The first chant with the engine-neutral lock release and {@link forgeLiveRuns} (#4762). */
32
33
  export const STATE_UNLOCK_FLOOR = "0.124.77";
@@ -108,6 +109,53 @@ export async function forgeLiveRuns(t: LiveRunsTarget): Promise<LiveRun[]> {
108
109
  return [...out.values()];
109
110
  }
110
111
 
112
+ /**
113
+ * The live runs of a {@link ForgeTarget} (#4911), from `forgeTargetFromEnv`,
114
+ * `forgeTargetWith` or `forgeTargetFromFlags`: {@link forgeLiveRuns} with
115
+ * the target's forge, REST base, repository, token and GitLab token header.
116
+ */
117
+ export function forgeTargetLiveRuns(target: Pick<ForgeTarget, "kind" | "apiBase" | "repo" | "token" | "tokenHeader">, fetch?: ForgeFetch): Promise<LiveRun[]> {
118
+ return forgeLiveRuns({ kind: target.kind, apiBase: target.apiBase, repo: target.repo, token: target.token, ...(target.tokenHeader ? { tokenHeader: target.tokenHeader } : {}), ...(fetch ? { fetch } : {}) });
119
+ }
120
+
121
+ /** What {@link forgeLiveRunsOf} reads the forge from besides the environment. */
122
+ export interface ForgeLiveRunsOptions {
123
+ /**
124
+ * A checkout whose origin remote names the forge (#4920) when the
125
+ * environment names no CI forge and `forge` no repository: its kind, web
126
+ * origin and repository, each under what `forge` gives.
127
+ */
128
+ cwd?: string;
129
+ /** The remote in `cwd`. Default `origin`. */
130
+ remote?: string;
131
+ fetch?: ForgeFetch;
132
+ /** Reads a remote's URL. Default `git remote get-url`. For tests. */
133
+ remoteUrl?: (cwd: string, remote: string) => string | undefined;
134
+ }
135
+
136
+ /**
137
+ * The `liveRuns` reader of the forge `forge` names over `env` (#4911),
138
+ * read each time it is called: `forgeTargetWith`'s target (a product's
139
+ * `--forge`, `--repo` and `--url` over the job's environment), and its runs.
140
+ * On a laptop, with no CI variables and no repository given, the origin
141
+ * remote of `opts.cwd` names the forge and the repository (#4920), so a
142
+ * release run there needs only a token. A forge that cannot be named, or a
143
+ * missing token, throws, and the release it guards is refused.
144
+ */
145
+ export function forgeLiveRunsOf(env: Record<string, string | undefined>, forge: ForgeTargetOptions & ForgeOverrides = {}, opts: ForgeLiveRunsOptions = {}): () => Promise<LiveRun[]> {
146
+ return async () => {
147
+ const [{ forgeTargetWith }, { detectForge }] = await Promise.all([import("./forge-flags"), import("./pr-forge")]);
148
+ let given = forge;
149
+ if (opts.cwd && !detectForge(env) && !forge.repo?.trim()) {
150
+ const { forgeOfCheckout } = await import("./forge-remote");
151
+ const at = forgeOfCheckout(opts.cwd, { ...(opts.remote ? { remote: opts.remote } : {}), ...(forge.kind ? { kind: forge.kind } : {}), ...(opts.remoteUrl ? { remoteUrl: opts.remoteUrl } : {}) });
152
+ const set = Object.fromEntries(Object.entries(forge).filter(([, v]) => v !== undefined && v !== "")) as typeof forge;
153
+ if (at) given = { kind: at.kind, repo: at.repo, url: at.url, ...set };
154
+ }
155
+ return forgeTargetLiveRuns(forgeTargetWith(env, given), opts.fetch);
156
+ };
157
+ }
158
+
111
159
  /** How far a run's start may be after the lock's and still count as a run that could hold it: the clocks of the job and the forge differ. */
112
160
  export const CLOCK_SKEW_MS = 2 * 60 * 1000;
113
161
 
@@ -232,8 +232,14 @@ export async function runCiWorkflow(ctx: CommandContext): Promise<number> {
232
232
  const root = realpathSync(found.dir);
233
233
  const repoRoot = gitTop(root) ?? root;
234
234
  const member = resolveMemberContext(cwd, found);
235
- const target = ctx.args.output ? resolve(realpathSync(cwd), ctx.args.output) : join(repoRoot, CI_GREEN_WORKFLOW_FILE);
236
- const fromRepo = relative(repoRoot, target).split(sep).join("/");
235
+ // #4909: under `chant dev generated-check` the file goes to the render
236
+ // tree; it is read and named as the committed file it stands for. #4950:
237
+ // with no --output too, so a render needs no `--output {out}/...`.
238
+ const { committedPathOf, isRenderPath, renderPathOf } = await import("../generated-check");
239
+ const target = ctx.args.output ? resolve(realpathSync(cwd), ctx.args.output) : renderPathOf(join(repoRoot, CI_GREEN_WORKFLOW_FILE));
240
+ const rendering = isRenderPath(target);
241
+ const asCommitted = committedPathOf(target);
242
+ const fromRepo = relative(repoRoot, asCommitted).split(sep).join("/");
237
243
 
238
244
  // The merge queue's verdict (#4644) is ours too, and holds no phase.
239
245
  const sources = readWorkflowSources(repoRoot, fromRepo).filter((s) => s.path !== MERGE_QUEUE_WORKFLOW_FILE);
@@ -252,7 +258,7 @@ export async function runCiWorkflow(ctx: CommandContext): Promise<number> {
252
258
 
253
259
  const base = member ? member.memberRoot : root;
254
260
  const parts = ["chant", "ci", "workflow", ...extra.flatMap((w) => ["--workflow", w])];
255
- if (ctx.args.output) parts.push("--output", relative(base, target).split(sep).join("/"));
261
+ if (ctx.args.output && !(rendering && asCommitted === join(repoRoot, CI_GREEN_WORKFLOW_FILE))) parts.push("--output", relative(base, asCommitted).split(sep).join("/"));
256
262
  if (ctx.args.ciChant) parts.push("--chant", ctx.args.ciChant);
257
263
  if (ctx.args.ciInstall) parts.push("--install", ctx.args.ciInstall);
258
264
  if (push && "secret" in push) parts.push("--token-secret", push.secret);
@@ -269,19 +275,20 @@ export async function runCiWorkflow(ctx: CommandContext): Promise<number> {
269
275
  const npmLock = ctx.args.ciInstall && existsSync(join(root, "package-lock.json")) ? (workspaceRoot === "." ? "package-lock.json" : `${workspaceRoot}/package-lock.json`) : undefined;
270
276
  const yaml = renderCiGreenWorkflow({ green, workflows, chantVersion: readerVersion(), workspaceRoot, chant: ctx.args.ciChant, install: ctx.args.ciInstall, npmLock, push, ...(runnerKeySecret ? { runnerKeySecret } : {}), ...(compose ? { compose } : {}) });
271
277
  const written = writeWorkflowFile(target, ciGreenHeader(command, member ? "member" : "root") + yaml);
272
- if (member) recordGeneratedFiles(member.memberRoot, [{ path: fromRepo, command }]);
278
+ if (member && !rendering) recordGeneratedFiles(member.memberRoot, [{ path: fromRepo, command }]);
273
279
  console.log(`Wrote ${written}: ticks when ${workflows.join(", ")} complete${workflows.length === 1 ? "s" : ""} on ${greenBranches(green).join(", ")}${compose ? " or a chant/compose/ branch" : ""}, and every 15 minutes.`);
274
280
  // #4644: the merge queue's verdict, beside the tick and from the same command.
275
281
  if (green.mergeQueue && !member) {
276
282
  const queue = renderMergeQueueWorkflow({ green, chantVersion: readerVersion(), workspaceRoot, chant: ctx.args.ciChant, install: ctx.args.ciInstall, npmLock });
277
- const at = writeWorkflowFile(join(repoRoot, MERGE_QUEUE_WORKFLOW_FILE), ciGreenHeader(command, "root") + queue);
283
+ const at = writeWorkflowFile(rendering ? renderPathOf(join(repoRoot, MERGE_QUEUE_WORKFLOW_FILE)) : join(repoRoot, MERGE_QUEUE_WORKFLOW_FILE), ciGreenHeader(command, "root") + queue);
278
284
  const retries = green.mergeQueue.retries;
279
285
  const again = retries > 0 ? `, re-running a failed job's workflow run up to ${retries} time${retries === 1 ? "" : "s"} first` : "";
280
286
  console.log(`Wrote ${at}: on each merge group, ${MERGE_QUEUE_VERDICT_JOB} passes when every required phase passed on the group's commit${again}. Require ${MERGE_QUEUE_VERDICT_JOB} in the branch's ruleset.`);
281
287
  }
282
288
  for (const e of edits) {
283
- if (!e.changed) continue;
284
- const path = writeWorkflowFile(join(repoRoot, e.path), e.text);
289
+ // A check renders every edited workflow, changed or not, so each has its twin in the render tree.
290
+ if (!e.changed && !rendering) continue;
291
+ const path = writeWorkflowFile(rendering ? renderPathOf(join(repoRoot, e.path)) : join(repoRoot, e.path), e.text);
285
292
  console.log(
286
293
  e.build === "newest"
287
294
  ? `Wrote ${path}'s triggers and concurrency: ${e.phases.join(", ")} build${e.phases.length === 1 ? "s" : ""} the newest commit on ${greenBranches(green).join(", ")} when a run ends, and a ci/build/<sha> tag by hand.`
@@ -4,10 +4,11 @@
4
4
  * the generated-file rules (ws-042, #2524 D14).
5
5
  */
6
6
 
7
- import { existsSync, readFileSync } from "node:fs";
7
+ import { existsSync, readFileSync, realpathSync } from "node:fs";
8
8
  import { join } from "node:path";
9
9
  import { afterAll, describe, expect, test, vi } from "vitest";
10
10
  import { GENERATED_MARKER } from "../discovery/files";
11
+ import { GENERATED_OUT_ENV, GENERATED_ROOT_ENV } from "../generated-check";
11
12
  import type { CommandContext } from "../cli/registry";
12
13
  import { parseYAMLDocument } from "../yaml";
13
14
  import { runCiWorkflow } from "./ci-green-cli";
@@ -187,6 +188,36 @@ describe("chant ci workflow (#3573)", () => {
187
188
  }
188
189
  });
189
190
 
191
+ test("under chant dev generated-check, writes into the render tree with no --output and leaves the committed file (#4950)", async () => {
192
+ const root = realpathSync(scratchDir("chant-ci-workflow-"));
193
+ const out = realpathSync(scratchDir("chant-ci-workflow-out-"));
194
+ git(root, "init", "-q");
195
+ writeFiles(root, {
196
+ "chant.workspace.json": declaration([], { ci: { green: GREEN } }),
197
+ ".github/workflows/ci.yml": CI,
198
+ ".github/workflows/macos.yml": MACOS,
199
+ [CI_GREEN_WORKFLOW_FILE]: "committed\n",
200
+ });
201
+ const cwd = vi.spyOn(process, "cwd").mockReturnValue(root);
202
+ const log = vi.spyOn(console, "log").mockImplementation(() => {});
203
+ const error = vi.spyOn(console, "error").mockImplementation(() => {});
204
+ process.env[GENERATED_OUT_ENV] = out;
205
+ process.env[GENERATED_ROOT_ENV] = root;
206
+ try {
207
+ expect(await runCiWorkflow({ args: {} } as unknown as CommandContext)).toBe(0);
208
+ expect(readFileSync(join(root, CI_GREEN_WORKFLOW_FILE), "utf-8")).toBe("committed\n");
209
+ const rendered = readFileSync(join(out, CI_GREEN_WORKFLOW_FILE), "utf-8");
210
+ expect(rendered.split("\n")[0]).toBe(`# ${GENERATED_MARKER}. Regenerate with: chant ci workflow (in the workspace root)`);
211
+ expect(existsSync(join(root, ".chant", "generated.json"))).toBe(false);
212
+ } finally {
213
+ delete process.env[GENERATED_OUT_ENV];
214
+ delete process.env[GENERATED_ROOT_ENV];
215
+ cwd.mockRestore();
216
+ log.mockRestore();
217
+ error.mockRestore();
218
+ }
219
+ });
220
+
190
221
  test("--chant and --install go into the file and its header, and regenerate byte-identically", async () => {
191
222
  const root = scratchDir("chant-ci-workflow-");
192
223
  git(root, "init", "-q");
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * | kind | default read | how |
10
10
  * |---|---|---|
11
- * | `chant` | `live-read` | the member's `chant lifecycle diff <env> --live --json`, through `liveDiffDriftRecords` and, when a lexicon has a deep reader, `mergeDeepDrift`. `--components` adds `chant components status <env> --live --json` through `componentStatusDriftRecords`. Needs `--env` |
11
+ * | `chant` | `live-read` | the member's `chant lifecycle diff <env> --live --json`, each lexicon's section through `lexiconDriftRecords` (`liveDiffDriftRecords`, with `mergeDeepDrift` when a lexicon has a deep reader, and the section's `absent`, #4896). `--components` adds `chant components status <env> --live --json` through `componentStatusDriftRecords`. Needs `--env` |
12
12
  * | `terraform` | `state` | `chant lifecycle drift` in the member's reader project: the terraform lexicon's `readDrift`, `terraform show -json` over state, or `--read plan` for a saved plan's `show -json` |
13
13
  * | `choudoufu` | `ownership` | the same, through `choudoufu live-plan -json` (and `live-ls`), or `--read plan` for live-plan with a plan beside it; `--resource <addr>` passes `choudoufu live-plan -resource=<addr>`'s stream through |
14
14
  * | `pulumi` | `refresh` | `chant lifecycle drift` in the member's reader project: the pulumi lexicon's `readDrift`, `pulumi refresh --preview-only --json --target <urn>` per resource in the checked-in export, or `plunge drift --resource <urn> --stream` for a member on plunge; `--resource <urn>` reads that URN alone (#4455) |
@@ -50,7 +50,6 @@ import {
50
50
  componentStatusDriftRecords,
51
51
  countDriftStatuses,
52
52
  decodeDriftLines,
53
- deepDiffDriftRecords,
54
53
  DRIFT_READS,
55
54
  DRIFT_SCHEMA_ID,
56
55
  DRIFT_VERSION,
@@ -61,15 +60,13 @@ import {
61
60
  driftStart,
62
61
  encodeDriftLines,
63
62
  foldDriftLines,
64
- liveDiffDriftRecords,
65
- mergeDeepDrift,
63
+ lexiconDriftRecords,
66
64
  type DriftDocument,
67
65
  type DriftLine,
68
66
  type DriftRead,
69
67
  type DriftRecord,
68
+ type LiveDiffLexiconSection,
70
69
  } from "../drift-record";
71
- import type { DeepDiffResult } from "../lifecycle/deep-diff";
72
- import type { LiveDiffResult } from "../lifecycle/live-diff";
73
70
  import type { ComponentStatusRow } from "../lifecycle/status";
74
71
  import { readDeclaration, readerVersion, WORKSPACE_ERROR_CODES, WorkspaceReadError } from "./declaration";
75
72
  import { prepareKindReaders } from "./kind-readers";
@@ -214,13 +211,8 @@ function chantRecords(member: string, diffOut: string, componentsOut: string | u
214
211
  const lexicons: LexiconDiff[] = [...Object.values(doc.lexicons ?? {}), ...Object.values(doc.stacks ?? {}).flatMap((s) => Object.values(s))];
215
212
  const base = { member, observedAt, ...(version ? { version } : {}) };
216
213
  const out: DriftRecord[] = [];
217
- for (const lex of lexicons) {
218
- if (!lex.resources) continue;
219
- const types: Record<string, string> = {};
220
- for (const [name, meta] of Object.entries(lex.observed ?? {})) if (typeof meta?.type === "string") types[name] = meta.type;
221
- const thin = liveDiffDriftRecords({ ...base, diff: lex.resources, types });
222
- out.push(...(lex.deep ? mergeDeepDrift(thin, deepDiffDriftRecords({ ...base, diff: lex.deep })) : thin));
223
- }
214
+ // The section's own `absent` (#4896): the sql lexicon's confirmed-absent objects are missing, not pending.
215
+ for (const section of lexicons) out.push(...lexiconDriftRecords({ ...base, section }));
224
216
  if (componentsOut !== undefined) {
225
217
  let rows: ComponentStatusRow[];
226
218
  try {
@@ -233,11 +225,7 @@ function chantRecords(member: string, diffOut: string, componentsOut: string | u
233
225
  return out;
234
226
  }
235
227
 
236
- interface LexiconDiff {
237
- resources?: LiveDiffResult;
238
- observed?: Record<string, { type?: unknown }>;
239
- deep?: DeepDiffResult;
240
- }
228
+ type LexiconDiff = LiveDiffLexiconSection;
241
229
 
242
230
  /** The command line the member runs. */
243
231
  function memberArgv(kind: string, query: DriftQuery, read: DriftRead): string[] {
@@ -23,8 +23,7 @@
23
23
  */
24
24
 
25
25
  import { execFileSync } from "node:child_process";
26
- import { remoteRepoPath } from "../op/activities/forge-pull-request";
27
- import { remoteHost } from "../op/activities/gh-host";
26
+ import { forgeKindOfHost, forgeOfRemote } from "../forge-remote";
28
27
  import { detectForge, FORGE_TOKEN_ORDER, ForgeApiError, forgeClient, forgeTargetFromEnv, type ForgeFetch, type ForgeKind, type ForgeTarget, type PrForge } from "../pr-forge";
29
28
 
30
29
  /** What the forge says one pull request closes. */
@@ -85,14 +84,8 @@ function ghAuthToken(host: string): string | undefined {
85
84
  }
86
85
  }
87
86
 
88
- /** The forge kind a remote host is: github.com and hosts named for GitHub, GitLab, or Forgejo and Gitea (codeberg.org too). Null for any other. */
89
- export function forgeKindOfHost(host: string): ForgeKind | null {
90
- const h = host.toLowerCase().replace(/:\d+$/, "");
91
- if (h === "github.com" || /(^|[.-])github([.-]|$)/.test(h)) return "github";
92
- if (h === "gitlab.com" || /(^|[.-])gitlab([.-]|$)/.test(h)) return "gitlab";
93
- if (h === "codeberg.org" || /(^|[.-])(forgejo|gitea)([.-]|$)/.test(h)) return "forgejo";
94
- return null;
95
- }
87
+ /** The forge kind a remote host is, as `@intentius/chant/forge-remote` reads it (#4920). */
88
+ export { forgeKindOfHost };
96
89
 
97
90
  /** The REST base of a forge at `host`, as the clients take it. */
98
91
  export function forgeApiBase(kind: ForgeKind, host: string): string {
@@ -113,10 +106,10 @@ function locate(top: string, opts: ForgeWorkOptions): { target: ForgeTarget } |
113
106
  }
114
107
  const url = opts.remoteUrl !== undefined ? opts.remoteUrl : gitRemote(top);
115
108
  if (!url) return { source: null, reason: "there is no origin remote to name the forge" };
116
- const host = remoteHost(url);
117
- const repo = remoteRepoPath(url);
118
- const kind = host ? forgeKindOfHost(host) : null;
119
- if (!host || !repo || !kind) return { source: null, reason: `origin (${url}) is not on a forge chant reads issues from: GitHub, GitLab or Forgejo` };
109
+ // #4920: the origin remote's forge, as `@intentius/chant/forge-remote` reads it.
110
+ const at = forgeOfRemote(url);
111
+ if (!at) return { source: null, reason: `origin (${url}) is not on a forge chant reads issues from: GitHub, GitLab or Forgejo` };
112
+ const { kind, host, repo } = at;
120
113
  const source = { kind, host, repo };
121
114
  const names = ["CHANT_FORGE_TOKEN", ...FORGE_TOKEN_ORDER[kind]];
122
115
  const tokenSource = names.find((n) => env[n]?.trim());
@@ -95,8 +95,8 @@ function staticInclude(read: StaticFieldsRead): string[] {
95
95
  /**
96
96
  * Only the files under the member's `sourceDir`, when its config sets one, as
97
97
  * a build reads them (#3941). Without one, every source file of the member
98
- * but its top-level `scripts/`, which a root build leaves out (#4794,
99
- * `ROOT_SOURCE_EXCLUDES`) unless `include` brings it back.
98
+ * but its top-level `scripts/` and `migrations/`, which a root build leaves
99
+ * out (#4794, #4921, `ROOT_SOURCE_EXCLUDES`) unless `include` brings one back.
100
100
  */
101
101
  function withinSourceDir(files: string[], member: string, sourceDir: string | undefined, include: string[] = []): string[] {
102
102
  if (!sourceDir) {
@@ -18,6 +18,7 @@ import { readAllReleases, readCuts } from "../lifecycle/release-store";
18
18
  import { readDeclaration, WorkspaceReadError } from "./declaration";
19
19
  import { locateWorkspace } from "./which-chant";
20
20
  import { appendWorkspaceLine, readWorkspaceLines } from "./workspace-ledger";
21
+ import { actorFromEnv } from "../actor";
21
22
 
22
23
  export interface TrainMember {
23
24
  member: string;
@@ -140,7 +141,7 @@ export async function runWorkspaceTrain(ctx: CommandContext): Promise<number> {
140
141
  for (const p of picked.problems) console.error(` ${p}`);
141
142
  return 1;
142
143
  }
143
- const actor = ctx.args.actor ?? process.env.GITHUB_ACTOR ?? process.env.GITLAB_USER_LOGIN ?? process.env.USER ?? "unknown";
144
+ const actor = ctx.args.actor ?? actorFromEnv();
144
145
  const record: ReleaseTrainRecord = { version: 1, id: `train-${randomUUID()}`, env, timestamp: new Date().toISOString(), actor, members: picked.members };
145
146
  if (!ctx.args.dryRun) await appendReleaseTrain(root, record);
146
147
  if (ctx.args.json) console.log(JSON.stringify({ ...record, written: !ctx.args.dryRun }, null, 2));
@@ -1,12 +1,15 @@
1
1
  /** #4656: `chant release workflow` renders the release pipeline from the `release` block. */
2
- import { describe, expect, test } from "vitest";
2
+ import { describe, expect, test, vi } from "vitest";
3
3
  import { spawnSync } from "node:child_process";
4
- import { mkdtempSync, readFileSync } from "node:fs";
4
+ import { mkdirSync, mkdtempSync, readFileSync, realpathSync, writeFileSync } from "node:fs";
5
5
  import { tmpdir } from "node:os";
6
6
  import { join } from "node:path";
7
7
  import { parseYAML } from "../yaml";
8
8
  import { ACTION_PINS } from "../action-pins";
9
- import { NPM_TRUSTED_PUBLISHING_SETUP, renderReleaseWorkflow, RELEASE_DIGESTS_PATHS, type ReleaseWorkflowInput, type ReleaseWorkflowTarget } from "./release-workflow";
9
+ import { IMAGE_PINS } from "../image-pins";
10
+ import type { CommandContext } from "../cli/registry";
11
+ import { GENERATED_OUT_ENV, GENERATED_ROOT_ENV } from "../generated-check";
12
+ import { NPM_TRUSTED_PUBLISHING_SETUP, releaseWorkflowHeader, renderReleaseWorkflow, runReleaseWorkflow, RELEASE_DIGESTS_PATHS, RELEASE_WORKFLOW_FILES, type ReleaseWorkflowInput, type ReleaseWorkflowTarget } from "./release-workflow";
10
13
  import type { SecurityGroup } from "./security";
11
14
 
12
15
  const FIXTURES = join(__dirname, "__fixtures__", "release-workflow");
@@ -213,6 +216,17 @@ describe("the release workflow's permissions, env and setup (#4751)", () => {
213
216
  expect(() => renderReleaseWorkflow({ forge: "gitlab", groups: new Set(), pipeline: { ...pipeline, permissions: undefined } })).toThrow(/give it as \{ run \}/);
214
217
  });
215
218
 
219
+ test("a named setup step renders with its name on GitHub, and as its line on GitLab (#4932)", () => {
220
+ const named = { trigger: "dispatch" as const, setup: [{ name: "QEMU for arm64", uses: "docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392", with: { platforms: "arm64" } }, { name: "npm 11", run: "npm install -g npm@11.19.0" }] };
221
+ const doc = parseYAML(renderReleaseWorkflow({ forge: "github", groups: new Set(), images: true, pipeline: named })) as GhDoc;
222
+ const i = doc.jobs.cut!.steps.findIndex((s) => s.run === "npm ci");
223
+ expect(doc.jobs.cut!.steps[i + 1]).toEqual({ name: "QEMU for arm64", uses: "docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392", with: { platforms: "arm64" } });
224
+ expect(doc.jobs.cut!.steps[i + 2]).toEqual({ name: "npm 11", run: "npm install -g npm@11.19.0" });
225
+ const gl = parseYAML(renderReleaseWorkflow({ forge: "gitlab", groups: new Set(), pipeline: { trigger: "dispatch", setup: [{ name: "npm 11", run: "npm install -g npm@11.19.0" }] } })) as Record<string, { script: string[] }>;
226
+ expect(gl["chant-release-cut"]!.script).toContain("npm install -g npm@11.19.0");
227
+ expect(() => renderReleaseWorkflow({ forge: "github", groups: new Set(), pipeline: { setup: [{ name: "", run: "x" }] } })).toThrow(/name is blank/);
228
+ });
229
+
216
230
  test("a scope already granted and a bad variable name are refused", () => {
217
231
  expect(() => renderReleaseWorkflow({ forge: "github", groups: new Set(), pipeline: { permissions: { contents: "read" } } })).toThrow(/already granted/);
218
232
  expect(() => renderReleaseWorkflow({ forge: "github", groups: new Set(), pipeline: { env: { "BAD-NAME": "x" } } })).toThrow(/not a variable name/);
@@ -465,3 +479,90 @@ describe("GHCR credentials and npm trusted publishing from the targets (#4786)",
465
479
  expect(runs(tagged.jobs.publish!)).toContain(NPM_TRUSTED_PUBLISHING_SETUP);
466
480
  });
467
481
  });
482
+
483
+ describe("QEMU for the platforms release.images builds (#4876)", () => {
484
+ type Step = { uses?: string; run?: string; with?: Record<string, unknown> };
485
+ const TWO = ["linux/amd64", "linux/arm64"];
486
+ const render = (forge: (typeof FORGES)[number], imagePlatforms: string[], pipeline: ReleaseWorkflowInput["pipeline"] = {}, trigger: "dispatch" | "tag" = "dispatch") =>
487
+ renderReleaseWorkflow({ forge, groups: new Set(), images: true, imageArchives: ["dist/images/app.tar"], imagePlatforms, pipeline: { ...(trigger === "dispatch" ? { trigger } : {}), ...pipeline } });
488
+ const ghSteps = (yaml: string, job: string): Step[] => (parseYAML(yaml) as { jobs: Record<string, { steps: Step[] }> }).jobs[job]!.steps;
489
+
490
+ test("a two-platform release.images: the cut and the publish set up QEMU for arm64 after the install, before the config's setup, on GitHub and Forgejo", () => {
491
+ for (const forge of ["github", "forgejo"] as const) {
492
+ const yaml = render(forge, TWO, { setup: [{ run: "echo own" }] });
493
+ for (const job of ["cut", "publish"]) {
494
+ const steps = ghSteps(yaml, job);
495
+ const at = steps.findIndex((s) => s.uses?.startsWith("docker/setup-qemu-action@"));
496
+ expect(steps[at], `${forge} ${job}`).toEqual({ uses: `docker/setup-qemu-action@${ACTION_PINS.dockerSetupQemu4.sha}`, with: { platforms: "arm64" } });
497
+ expect(steps[at - 1]!.run, `${forge} ${job}`).toBe("npm ci");
498
+ expect(steps[at + 1]!.run, `${forge} ${job}`).toBe("echo own");
499
+ }
500
+ expect(yaml).toContain(`docker/setup-qemu-action@${ACTION_PINS.dockerSetupQemu4.sha} # v4.4.0`);
501
+ // The tag-triggered publish job builds the images too.
502
+ expect(ghSteps(render(forge, TWO, {}, "tag"), "publish").some((s) => s.uses?.startsWith("docker/setup-qemu-action@")), forge).toBe(true);
503
+ }
504
+ });
505
+
506
+ test("on GitLab, a binfmt run line in the cut and the publish, the image pinned by digest (#4941)", () => {
507
+ const doc = parseYAML(render("gitlab", TWO)) as Record<string, { script: string[] }>;
508
+ for (const job of ["chant-release-cut", "chant-release-publish"]) {
509
+ const script = doc[job]!.script;
510
+ expect(script[script.indexOf("npm ci") + 1], job).toBe(`docker run --privileged --rm tonistiigi/binfmt:${IMAGE_PINS.binfmt.tag}@${IMAGE_PINS.binfmt.digest} --install arm64`);
511
+ expect(IMAGE_PINS.binfmt.digest).toMatch(/^sha256:[0-9a-f]{64}$/);
512
+ }
513
+ });
514
+
515
+ test("a one-platform release.images, or none, renders no QEMU on any forge", () => {
516
+ for (const forge of FORGES) {
517
+ for (const platforms of [["linux/amd64"], []]) {
518
+ const yaml = render(forge, platforms);
519
+ expect(yaml, forge).not.toContain("setup-qemu-action");
520
+ expect(yaml, forge).not.toContain("binfmt");
521
+ }
522
+ }
523
+ // A config with no release.images builds nothing, whatever the platforms.
524
+ expect(renderReleaseWorkflow({ forge: "github", groups: new Set(), imagePlatforms: TWO, pipeline: { trigger: "dispatch" } })).not.toContain("setup-qemu-action");
525
+ });
526
+
527
+ test("a config that names the step itself renders as today, and drops it to the same file", () => {
528
+ const qemu = { uses: `docker/setup-qemu-action@${ACTION_PINS.dockerSetupQemu4.sha} # v4.4.0`, with: { platforms: "arm64" } };
529
+ const own = { run: 'echo "npm"' };
530
+ const byHand = render("github", TWO, { setup: [qemu, own] });
531
+ expect(byHand).toBe(render("github", [], { setup: [qemu, own] }));
532
+ expect(render("github", TWO, { setup: [own] })).toBe(byHand);
533
+ const binfmt = { run: "docker run --privileged --rm tonistiigi/binfmt --install arm64" };
534
+ expect(render("gitlab", TWO, { setup: [binfmt] })).toBe(render("gitlab", [], { setup: [binfmt] }));
535
+ });
536
+
537
+ test("other architectures go in as QEMU names them", () => {
538
+ const steps = ghSteps(render("github", ["linux/amd64", "linux/arm/v7", "linux/riscv64", "linux/arm64"]), "cut");
539
+ expect(steps.find((s) => s.uses?.startsWith("docker/setup-qemu-action@"))!.with).toEqual({ platforms: "arm,arm64,riscv64" });
540
+ });
541
+ });
542
+
543
+ describe("chant release workflow under chant dev generated-check (#4950)", () => {
544
+ test("writes into the render tree with no --output, names no --output in the header, and leaves the committed file", async () => {
545
+ const root = realpathSync(mkdtempSync(join(tmpdir(), "chant-4950-release-")));
546
+ const out = realpathSync(mkdtempSync(join(tmpdir(), "chant-4950-release-out-")));
547
+ writeFileSync(join(root, "chant.workspace.json"), JSON.stringify({ name: "product", schema: 1, members: [] }));
548
+ writeFileSync(join(root, "chant.config.json"), JSON.stringify({ lexicons: [] }));
549
+ mkdirSync(join(root, ".github/workflows"), { recursive: true });
550
+ writeFileSync(join(root, RELEASE_WORKFLOW_FILES.github), "committed\n");
551
+ expect(spawnSync("git", ["init", "-q"], { cwd: root }).status).toBe(0);
552
+ const cwd = vi.spyOn(process, "cwd").mockReturnValue(root);
553
+ const log = vi.spyOn(console, "log").mockImplementation(() => {});
554
+ process.env[GENERATED_OUT_ENV] = out;
555
+ process.env[GENERATED_ROOT_ENV] = root;
556
+ try {
557
+ expect(await runReleaseWorkflow({ args: { forge: "github" } } as unknown as CommandContext)).toBe(0);
558
+ expect(readFileSync(join(root, RELEASE_WORKFLOW_FILES.github), "utf-8")).toBe("committed\n");
559
+ const rendered = readFileSync(join(out, RELEASE_WORKFLOW_FILES.github), "utf-8");
560
+ expect(rendered.split("\n")[0]).toBe(releaseWorkflowHeader("chant release workflow --forge github").trimEnd());
561
+ } finally {
562
+ delete process.env[GENERATED_OUT_ENV];
563
+ delete process.env[GENERATED_ROOT_ENV];
564
+ cwd.mockRestore();
565
+ log.mockRestore();
566
+ }
567
+ });
568
+ });