@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
@@ -0,0 +1,208 @@
1
+ /**
2
+ * `@intentius/chant/ref-gate-init` (#4913): the pieces of the ref gate a
3
+ * product's init writes, so no product writes `.chant/trust.json`, a hook or
4
+ * its own runner key words.
5
+ *
6
+ * {@link refGateInitPlan} plans, and writes nothing, so a product folds the
7
+ * files into its own plan and keeps its dry run:
8
+ *
9
+ * - `.chant/trust.json` with a `refs` rule for the branch (#4867), whose
10
+ * `plan` and `policy` are each target's with `targets` (#4978): created
11
+ * with `"schema": 1` when there is none, the rule added in place when the
12
+ * file has no rule for the branch, left as it is when it has one or does
13
+ * not parse.
14
+ * - The `pre-push` hook `chant workspace ref-gate install` writes, in the
15
+ * checkout's hooks directory, so a push the gate would refuse stops before
16
+ * the network and records the request for an override. It is local: git
17
+ * never commits it. A hook that is not chant's is left as it is.
18
+ * - The runner key hint: with no runner key and no keyless identity in the
19
+ * file, nothing can sign the evidence the rule needs, so the gate would
20
+ * refuse every push; a note gives the commands that list a key and where
21
+ * the pipeline reads it.
22
+ *
23
+ * {@link writeRefGateInit} writes the planned files, the hook executable.
24
+ */
25
+
26
+ import { spawnSync } from "node:child_process";
27
+ import { existsSync, readFileSync } from "node:fs";
28
+ import { isAbsolute, join } from "node:path";
29
+ import { writePlannedFiles } from "./planned-files";
30
+ import { EVIDENCE_MEMBER_NAME, targetEvidenceCheck } from "./ci-evidence-jobs";
31
+ import { appendElement, setProperty } from "./workspace/json-edit";
32
+ import { parseJsonText } from "./workspace/jsonc";
33
+ import { REF_CHECK_NAME, TRUST_CONFIG_PATH, trustConfigSchema, type TrustConfig } from "./workspace/trust/policy";
34
+ import { refPatternRegExp, REF_GATE_STATUS } from "./workspace/trust/ref-gate";
35
+ import { REF_GATE_HOOK_MARK, refGateHook } from "./workspace/trust/ref-gate-cli";
36
+
37
+ export { REF_GATE_PIECES_FLOOR, TARGET_SIGNED_CHECKS_FLOOR } from "./release-floors";
38
+
39
+ /** One check the rule requires evidence for, as `refs[].checks[]` holds it. */
40
+ export interface RefGateInitCheck {
41
+ check: string;
42
+ /** Default `block`. */
43
+ action?: "block" | "warn";
44
+ /** The command that produces the evidence, printed in a refusal. */
45
+ command: string;
46
+ }
47
+
48
+ export interface RefGateInitOptions {
49
+ /** The branch the gate protects. Default `main`. */
50
+ branch?: string;
51
+ /** The checks an update of the branch needs current evidence for. At least one. */
52
+ checks: readonly RefGateInitCheck[];
53
+ /**
54
+ * The product plan's targets (#4978), as `productPlan.targets` names them.
55
+ * A target's note job signs `plan:<target>` and `policy:<target>`, so with
56
+ * targets a check named `plan` or `policy` stands for each target's, with
57
+ * the same action and command, in the order the targets are given.
58
+ */
59
+ targets?: readonly string[];
60
+ /** The commit status the gate's status job sets. Default `chant/ref-gate`, which the rule then leaves out. */
61
+ status?: string;
62
+ /** Write the `pre-push` hook in this checkout. Default true. */
63
+ prePush?: boolean;
64
+ /** The command the hook runs for chant, such as `npx chant`. Default `chant`. */
65
+ chant?: string;
66
+ /** For the hint: the principal the runner key is listed under, such as `ci:acme/infra`. */
67
+ runner?: string;
68
+ /** For the hint: the secret or CI/CD variable the pipeline reads the runner key from (`evidence.runnerKeySecret`, `--evidence-runner-key-secret`). */
69
+ runnerKeySecret?: string;
70
+ }
71
+
72
+ /** A planned file, in the shape a product's init plans its own. */
73
+ export interface RefGateInitFile {
74
+ /** Absolute. */
75
+ path: string;
76
+ status: "created" | "updated" | "unchanged";
77
+ content: string;
78
+ /** The hook's mode, 0o755; a product that writes the file itself sets it. */
79
+ mode?: number;
80
+ /** In the git directory, so never committed. */
81
+ local?: boolean;
82
+ }
83
+
84
+ export interface RefGateInitPlan {
85
+ files: RefGateInitFile[];
86
+ /** What a person still has to do, or what was left as it is and why. */
87
+ notes: string[];
88
+ }
89
+
90
+ export class RefGateInitError extends Error {
91
+ constructor(message: string) {
92
+ super(message);
93
+ this.name = "RefGateInitError";
94
+ }
95
+ }
96
+
97
+ function gitOut(repo: string, args: string[]): string | undefined {
98
+ const r = spawnSync("git", args, { cwd: repo, encoding: "utf-8" });
99
+ return r.status === 0 ? r.stdout.trim() : undefined;
100
+ }
101
+
102
+ function planned(path: string, content: string, extra: Pick<RefGateInitFile, "mode" | "local"> = {}): RefGateInitFile {
103
+ const before = existsSync(path) ? readFileSync(path, "utf-8") : undefined;
104
+ return { path, status: before === undefined ? "created" : before === content ? "unchanged" : "updated", content, ...extra };
105
+ }
106
+
107
+ /**
108
+ * The rule's checks (#4978): with `targets`, `plan` and `policy` become each
109
+ * target's `plan:<target>` and `policy:<target>` (`targetEvidenceCheck`),
110
+ * which is what a product plan with targets signs.
111
+ */
112
+ export function refGateInitChecks(checks: readonly RefGateInitCheck[], targets?: readonly string[]): RefGateInitCheck[] {
113
+ if (!targets || targets.length === 0) return [...checks];
114
+ return checks.flatMap((c) => (c.check === "plan" || c.check === "policy" ? targets.map((t) => ({ ...c, check: targetEvidenceCheck(c.check as "plan" | "policy", t) })) : [c]));
115
+ }
116
+
117
+ /** The `refs` rule for `ref`, with `action` and `status` only where they differ from the defaults. */
118
+ function ruleFor(ref: string, opts: RefGateInitOptions): Record<string, unknown> {
119
+ return {
120
+ ref,
121
+ checks: refGateInitChecks(opts.checks, opts.targets).map((c) => ({ check: c.check, ...(c.action === "warn" ? { action: "warn" } : {}), command: c.command })),
122
+ ...(opts.status && opts.status !== REF_GATE_STATUS ? { status: opts.status } : {}),
123
+ };
124
+ }
125
+
126
+ /**
127
+ * Plan the ref gate's init pieces for the checkout `repo` (#4913). Writes
128
+ * nothing. Throws a {@link RefGateInitError} for options no rule can hold,
129
+ * or a directory that is not in a git repository.
130
+ */
131
+ export function refGateInitPlan(repo: string, opts: RefGateInitOptions): RefGateInitPlan {
132
+ const branch = opts.branch ?? "main";
133
+ const ref = `refs/heads/${branch}`;
134
+ if (!branch || /\s|\*/.test(branch)) throw new RefGateInitError(`the branch is one branch name, such as main, not ${JSON.stringify(branch)}`);
135
+ if (opts.checks.length === 0) throw new RefGateInitError("the ref gate's rule needs at least one check");
136
+ for (const t of opts.targets ?? []) {
137
+ if (!EVIDENCE_MEMBER_NAME.test(t)) throw new RefGateInitError(`${JSON.stringify(t)} is not a product plan target's name: letters, digits, - and _`);
138
+ }
139
+ for (const c of opts.checks) {
140
+ if (!REF_CHECK_NAME.test(c.check)) throw new RefGateInitError(`${JSON.stringify(c.check)} is not a check name: letters, digits, . _ : -`);
141
+ if (!c.command.trim()) throw new RefGateInitError(`check ${c.check} needs the command that produces its evidence`);
142
+ }
143
+ const top = gitOut(repo, ["rev-parse", "--show-toplevel"]);
144
+ if (!top) throw new RefGateInitError(`${repo} is not in a git checkout; the ref gate's pieces go in one`);
145
+
146
+ const files: RefGateInitFile[] = [];
147
+ const notes: string[] = [];
148
+ const trustPath = join(top, TRUST_CONFIG_PATH);
149
+ const rule = ruleFor(ref, opts);
150
+ let config: TrustConfig | undefined;
151
+ if (!existsSync(trustPath)) {
152
+ config = { schema: 1, refs: [rule as NonNullable<TrustConfig["refs"]>[number]] };
153
+ files.push(planned(trustPath, `${JSON.stringify(config, null, 2)}\n`));
154
+ } else {
155
+ const before = readFileSync(trustPath, "utf-8");
156
+ const parsed = parseJsonText(before, { jsonc: false });
157
+ const valid = parsed.ok ? trustConfigSchema.safeParse(parsed.value) : undefined;
158
+ if (!parsed.ok || !valid?.success) {
159
+ notes.push(`${TRUST_CONFIG_PATH} does not read as chant's trust policy, so init left it as it is; add a refs rule for ${ref} by hand once it does (chant workspace ref-gate)`);
160
+ } else {
161
+ config = valid.data;
162
+ const covering = (config.refs ?? []).find((r) => refPatternRegExp(r.ref).test(ref));
163
+ if (covering) {
164
+ notes.push(`${TRUST_CONFIG_PATH} already has a refs rule for ${ref} (${covering.ref}), so init left it as it is`);
165
+ files.push(planned(trustPath, before));
166
+ } else {
167
+ const after = config.refs ? appendElement(before, false, "/refs", rule) : setProperty(before, false, "", "refs", [rule]);
168
+ // The in-place edit is checked against the value it means, as the trust writes check theirs.
169
+ const reread = parseJsonText(after, { jsonc: false });
170
+ const check = reread.ok ? trustConfigSchema.safeParse(reread.value) : undefined;
171
+ if (!check?.success || (check.data.refs ?? []).length !== (config.refs ?? []).length + 1) throw new RefGateInitError(`adding the refs rule to ${TRUST_CONFIG_PATH} did not read back as meant`);
172
+ config = check.data;
173
+ files.push(planned(trustPath, after));
174
+ }
175
+ }
176
+ }
177
+ if (files.some((f) => f.path === trustPath && f.status !== "unchanged")) {
178
+ notes.push(`${TRUST_CONFIG_PATH} is a protected write: merge it in a reviewed pull request; the gate reads it at base, so it holds from the next change on`);
179
+ }
180
+
181
+ if (config && (config.runners ?? []).length === 0 && !config.keyless) {
182
+ const principal = opts.runner ?? "<runner principal>";
183
+ const secret = opts.runnerKeySecret ?? "<secret>";
184
+ notes.push(
185
+ `no runner key or keyless identity is in ${TRUST_CONFIG_PATH}, so no evidence verifies and the gate refuses every push to ${ref}. ` +
186
+ `Make a key with \`openssl genpkey -algorithm ed25519 -out runner.pem\`, list it with \`chant workspace trust runner add ${principal} --key runner.pem\`, ` +
187
+ `and keep runner.pem out of the repository: store it in the ${secret} secret the pipeline signs evidence with. Or list the pipeline's OIDC identity under keyless and sign with no key.`,
188
+ );
189
+ }
190
+
191
+ if (opts.prePush !== false) {
192
+ const hooks = gitOut(top, ["rev-parse", "--git-path", "hooks"]);
193
+ const dir = hooks ? (isAbsolute(hooks) ? hooks : join(top, hooks)) : join(top, ".git", "hooks");
194
+ const path = join(dir, "pre-push");
195
+ if (existsSync(path) && !readFileSync(path, "utf-8").includes(REF_GATE_HOOK_MARK)) {
196
+ notes.push(`${path} is not chant's ref gate hook, so init left it as it is; call ${opts.chant ?? "chant"} workspace ref-gate pre-push from it`);
197
+ } else {
198
+ files.push(planned(path, refGateHook("pre-push", opts.chant), { mode: 0o755, local: true }));
199
+ }
200
+ }
201
+ return { files, notes };
202
+ }
203
+
204
+ /** Write the files of a plan, each directory made and the hook executable. An unchanged file is not touched. */
205
+ export function writeRefGateInit(plan: Pick<RefGateInitPlan, "files">): void {
206
+ // #4966: chant's one planned-file writer.
207
+ writePlannedFiles(plan.files);
208
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * `@intentius/chant/ref-gate-rules` (#4913): the ref gate's rules (#4867)
3
+ * for a product to read, so it needs no code of its own for the policy in
4
+ * `.chant/trust.json`'s `refs`.
5
+ *
6
+ * {@link refGateRulesAt} reads the rules for one ref from the policy at
7
+ * base, as `chant workspace ref-gate` does: whether a rule matches, the
8
+ * checks it needs evidence for, and the status the gate's status job sets.
9
+ * An apply before merge passes that status as `require` to chant's requires
10
+ * checks (`checkPrRequires` in `@intentius/chant/pr-requires`), so `checks`
11
+ * waits for the gate's status rather than passing before the job posted it.
12
+ * A forge check passes it as `refGateStatus` to `pipelineContract`;
13
+ * {@link refGateStatusFor} reads it for the default branch, as
14
+ * `chant ci forge-check --ref-gate-status` does.
15
+ */
16
+
17
+ export {
18
+ REF_GATE_STATUS,
19
+ refGateRulesAt,
20
+ refGateStatusFor,
21
+ refPatternRegExp,
22
+ rulesFor,
23
+ type RefGateRules,
24
+ } from "./workspace/trust/ref-gate";
25
+ export type { RefRule } from "./workspace/trust/policy";
26
+ export { REF_GATE_PIECES_FLOOR } from "./release-floors";
@@ -19,35 +19,44 @@
19
19
  * this constant to the next patch (#4501). The check fails while a floor
20
20
  * still names this constant after its version shipped.
21
21
  */
22
- export const NEXT_RELEASE = "0.124.87";
22
+ export const NEXT_RELEASE = "0.124.89";
23
23
 
24
24
  /** The first chant with `chant dev local` and `chant dev bundle-check`, `@intentius/chant/local-chant` and `@intentius/chant/bundle-check` (`chantRuntimeTarget`, `chantExternalPlugin`, `checkBundle`): a product built against a chant checkout, and its bundle checked, without its own scripts (#4787). */
25
- export const LOCAL_CHANT_FLOOR = NEXT_RELEASE;
25
+ export const LOCAL_CHANT_FLOOR = "0.124.86";
26
26
 
27
27
  /** The first chant with `chant workspace ref-gate` (pre-receive, pre-push, check, status, attach, install) and `refs` in `.chant/trust.json`, the checks a ref update needs evidence for (#4867). */
28
- export const REF_GATE_FLOOR = NEXT_RELEASE;
28
+ export const REF_GATE_FLOOR = "0.124.86";
29
29
 
30
30
  /** The first chant whose overdue check finds a schedule in any pipeline file, and whose `ScheduledWatch` takes a product's `files` and GitLab `schedule` selector (#4789). */
31
- export const OVERDUE_PIPELINE_FILES_FLOOR = NEXT_RELEASE;
31
+ export const OVERDUE_PIPELINE_FILES_FLOOR = "0.124.86";
32
32
 
33
33
  /** The first chant whose `terraformApplyCapabilityWith` takes `onCommand`, a hook around each engine command `terraform-apply` runs for a root, its reads' upstreams included (#4865). */
34
- export const TERRAFORM_APPLY_COMMAND_HOOK_FLOOR = NEXT_RELEASE;
34
+ export const TERRAFORM_APPLY_COMMAND_HOOK_FLOOR = "0.124.86";
35
+
36
+ /** The first chant whose terraform lexicon times each root's engine commands and reads its spans and lock waits (`@intentius/chant-lexicon-terraform/engine-timings`, `engineTimings()` as `terraformApplyCapabilityWith`'s `onCommand`), and runs a composed group's commands through that hook (#4887). */
37
+ export const TERRAFORM_ENGINE_TIMINGS_FLOOR = "0.124.88";
38
+
39
+ /** The first chant whose terraform lexicon finds live roots and estates (`live-roots`), places a Terragrunt unit (`terragruntUnitPlace`), reads a state migration's history and revert from its finished lines (`migration-history`), and runs the binary without the forge's tokens (`tokenlessBinaryExec`, `engineEnv`) (#4910). */
40
+ export const TERRAFORM_ROOT_HELPERS_FLOOR = "0.124.88";
41
+
42
+ /** The first chant whose terraform lexicon has one runner of the engine for a product (`engineRunner` in `engine-runner`: a hooked `exec`, `execSync`, `terragrunt` and the tokenless `script`), traces each engine command (`commandTrace`, `commandTraceEnv`), sends each Terragrunt unit's plan through `planTerragruntWave({ onCommand })`, and resolves a live root's record store (`liveRecordStore`, `writtenRecordStore`, `rootBackendAttrs` in `live-roots`) (#4954). */
43
+ export const TERRAFORM_ENGINE_RUNNER_FLOOR = NEXT_RELEASE;
35
44
 
36
45
  /** The first chant with `@intentius/chant/forge-flags` (`forgeTargetWith`, `forgeTargetFromFlags`, `apiBaseOf`), `@intentius/chant/chant-install` (`bundledChant`, `chantArgv`, `installChantResolveFallback`) and `noteLimit` and `fitNote` in `@intentius/chant/plan-summary` (#4800). */
37
- export const PRODUCT_HELPERS_FLOOR = NEXT_RELEASE;
46
+ export const PRODUCT_HELPERS_FLOOR = "0.124.86";
38
47
 
39
48
  /** The first chant with `@intentius/chant/ci-image`: `productImageStages`, `productImageDockerfile` and `derivedImageDockerfile` for a product's CI image, and `ciToolFetchScript`, `ciToolInstallLine` and `installCiTool`, the digest-checked engine installs, with the terraform lexicon's `choudoufuInstallLine` checked the same way (#4784). */
40
- export const CI_IMAGE_FLOOR = NEXT_RELEASE;
49
+ export const CI_IMAGE_FLOOR = "0.124.86";
41
50
 
42
51
  /** The first chant with `@intentius/chant/drift-issue`, whose `keepDriftIssue` keeps one drift issue per environment from a product's words and the drift records (#4790). */
43
- export const DRIFT_ISSUE_FLOOR = NEXT_RELEASE;
52
+ export const DRIFT_ISSUE_FLOOR = "0.124.86";
44
53
 
45
54
  /** The first chant whose `chant build` with no path builds the config's `sourceDir`, whose root build leaves a top-level `scripts/` out, and whose `@intentius/chant/config` exports `resolveSourceDir`, the one source-dir rule every command shares (#4794). */
46
- export const SOURCE_DIR_RULE_FLOOR = NEXT_RELEASE;
55
+ export const SOURCE_DIR_RULE_FLOOR = "0.124.86";
47
56
  /** The first chant whose pulumi lexicon runs `gatedStackExport`, `gatedStackCancel` and `gatedStackMove` on core's `exportStateVersion`, `releaseStateLock` and `runStateMigration`: export by version, the live-run check before a cancel (`liveRuns`, `forge`), and the check that nothing moved between a move's plan and its write (#4808). */
48
- export const PULUMI_STACK_OPS_ON_CORE_FLOOR = NEXT_RELEASE;
57
+ export const PULUMI_STACK_OPS_ON_CORE_FLOOR = "0.124.86";
49
58
  /** The first chant whose terraform lexicon's state stores read versions (`version`, `hasVersion`, `readVersion`, `isAt`, `listVersions`), with `readStateVersion` and `listStateVersions`, and lock and write a GitLab-managed http backend's state (#4793). */
50
- export const TERRAFORM_STATE_VERSION_READS_FLOOR = NEXT_RELEASE;
59
+ export const TERRAFORM_STATE_VERSION_READS_FLOOR = "0.124.86";
51
60
 
52
61
  /** The first chant whose terraform lexicon's `terraform-apply` reads take `dir` and `workspace`, and read an upstream with `resolveRoot`'s binary and `readEnv` (terragucci issue 1303). */
53
62
  export const TERRAFORM_APPLY_INSTANCE_READS_FLOOR = "0.124.80";
@@ -89,19 +98,132 @@ export const PR_FORGE_READS_FLOOR = "0.124.78";
89
98
  export const SCHEDULED_RUNS_SELECTOR_FLOOR = "0.124.78";
90
99
 
91
100
  /** The first chant whose Op waves pipeline takes `waveJobs` and `recordPlans`, a product's login, report, artifact and plans-job inputs, so it edits nothing chant wrote (#4791). */
92
- export const OP_WAVES_JOB_INPUTS_FLOOR = NEXT_RELEASE;
101
+ export const OP_WAVES_JOB_INPUTS_FLOOR = "0.124.86";
93
102
 
94
103
  /** The first chant with `@intentius/chant/floor-table` (`FLOOR_TABLE`, `floorVersion`, `chantMeets`), every floor as one table, and `chant dev dead-guards` with `@intentius/chant/dead-guards` (`findDeadGuards`), which fails on a feature-detect the product's chant pin meets (#4792). */
95
- export const FLOOR_TABLE_FLOOR = NEXT_RELEASE;
104
+ export const FLOOR_TABLE_FLOOR = "0.124.86";
96
105
 
97
106
  /** The first chant with `@intentius/chant/ci-login`: `githubCloudLogin`, `gitlabCloudLogin` and `forgejoCloudLogin` render a job's AWS, GCP and Azure login from the OIDC token file, per target too (#4788). */
98
- export const CLOUD_LOGIN_FLOOR = NEXT_RELEASE;
107
+ export const CLOUD_LOGIN_FLOOR = "0.124.86";
99
108
 
100
109
  /** The first chant whose generated pipelines sign evidence for each named check they run, with `chant ci evidence`, `ci check` signing each hook, and an Op waves spec's `evidence.requires` (#4870). */
101
- export const CHECK_EVIDENCE_FLOOR = NEXT_RELEASE;
110
+ export const CHECK_EVIDENCE_FLOOR = "0.124.86";
102
111
 
103
112
  /** The first chant that accepts local evidence (#4868): `local` in `.chant/trust.json`, `chant ci evidence sign --local`, and `chant ci check` skipping a hook whose current local evidence the policy at base accepts. */
104
- export const LOCAL_EVIDENCE_FLOOR = NEXT_RELEASE;
113
+ export const LOCAL_EVIDENCE_FLOOR = "0.124.86";
105
114
 
106
115
  /** The first chant that signs runner statements keyless from the CI job's OIDC identity and verifies them against `keyless` in `.chant/trust.json`, with `evidence.identity: "oidc"` in the generators (#4869). */
107
- export const KEYLESS_EVIDENCE_FLOOR = NEXT_RELEASE;
116
+ export const KEYLESS_EVIDENCE_FLOOR = "0.124.87";
117
+
118
+ /** The first chant whose waves generators run each wave's policy as a step of its own (`chant run wave --policy-only`; on GitLab a `<wave job>-policy` job) and sign its checks in a `<wave job>-evidence` job with `chant ci evidence sign --from-job`, from the forge's record of the wave job's steps, so a wave that trades cloud credentials signs keyless with `evidence.identity: "oidc"` instead of being refused (#4926). */
119
+ export const WAVE_EVIDENCE_JOB_FLOOR = "0.124.88";
120
+
121
+ /** The first chant whose cloud login leaves the region to the job unless the spec names one, takes `sameStep` to export into the step that runs it, accepts an AWS spec with no role (the token file alone), and whose trade sets `CHANT_CLOUD_TRADED` so a login's targets file is told from a trade's (#4930). */
122
+ export const CLOUD_LOGIN_SAME_STEP_FLOOR = "0.124.88";
123
+
124
+ /** The first chant whose `chant release workflow` sets up QEMU in the cut and publish jobs for the platforms `release.images` builds that the runner can't (`docker/setup-qemu-action` at its pin on GitHub and Forgejo, a `tonistiigi/binfmt` run line on GitLab), and whose `release.images` command entries take `platforms` (#4876). */
125
+ export const RELEASE_WORKFLOW_QEMU_FLOOR = "0.124.88";
126
+
127
+ /** The first chant whose npm publish target refuses at plan time a package that would carry an image archive the release records (`publish-npm-carries-image`), naming the file and the `files` entry that leaves it out (#4934). */
128
+ export const NPM_CARRIES_IMAGE_FLOOR = "0.124.88";
129
+ /** The first chant with `driftRunFingerprint` in `@intentius/chant/drift-issue` and `lexiconDriftRecords` in `@intentius/chant/drift-record`, whose `chant lifecycle diff --live --json` writes a lexicon's `absent`, and whose sql lexicon reports a declared object the server lacks as `missing` instead of `pending` (#4896). */
130
+ export const LIVE_DRIFT_RECORDS_FLOOR = "0.124.88";
131
+
132
+ /** The first chant whose `chant sql types --path` prints where `sql-types.d.ts` is by the source-dir rule, the path `sqlTypesPath` answers (#4897). */
133
+ export const SQL_TYPES_PATH_FLOOR = "0.124.88";
134
+ /** The first chant whose forge target carries its web `origin` (`forgeTargetWith`) and whose `@intentius/chant/forge-flags` has `jobForgeTarget`, a job's target or undefined where the job cannot reach the forge, so a product keeps no target type of its own (#4888). */
135
+ export const FORGE_TARGET_ORIGIN_FLOOR = "0.124.88";
136
+
137
+ /** The first chant with `actorFromEnv` (`@intentius/chant/actor`), `forgeTargetLiveRuns` and `forgeLiveRunsOf` in `@intentius/chant/state-unlock`, and a pulumi lexicon whose stack ops take the product's `approveCommand`, with `pulumiStackLockToCancel` and `pulumiMoveDestStack`, a move naming its own `--dest` from both sides' `project` (#4911). */
138
+ export const STACK_OPS_PRODUCT_HELPERS_FLOOR = "0.124.88";
139
+
140
+ /** The first chant with `@intentius/chant/forge-remote` (`forgeOfRemote`, `forgeOfCheckout`, `forgeKindOfHost`), the forge and repository a checkout's origin remote names, and a pulumi `gatedStackCancel` that reads the forge's runs from it on a laptop (#4920). */
141
+ export const FORGE_REMOTE_FLOOR = "0.124.88";
142
+ /** The first chant with `chant dev generated-check` (`chantGenerated` in a product's root package.json, `@intentius/chant/generated-check`) and `chant dev local-image` (`localChantImage` in `@intentius/chant/local-chant`): a drift check of a product's committed generated files, and an image build with the product's chant, local or pinned, without the product's own scripts (#4909). */
143
+ export const GENERATED_CHECK_FLOOR = "0.124.88";
144
+
145
+ /** The first chant whose `chant dev local` keeps the product's peer dependencies installed and packs the checkout at its `NEXT_RELEASE`, and whose root build of a project with no `sourceDir` leaves its top-level `migrations/` out, with the sql lexicon opening no `.sql` file under a `migrations` directory (#4921). */
146
+ export const LOCAL_CHANT_NEXT_RELEASE_FLOOR = "0.124.88";
147
+
148
+ /** The first chant whose `chantExternalPlugin` keeps external only the chant packages it is given, by default the ones in the package's `dependencies`, so a product that bundles its lexicons uses it as is (#4922). */
149
+ export const CHANT_EXTERNAL_PACKAGES_FLOOR = "0.124.88";
150
+
151
+ /** The first chant whose `ciToolInstallLine` takes `sudo` and `binDir` and a root under a shell variable, for a job that is not root, whose `CI_TOOL_SHA256` records terraform 1.14.9, terragrunt 1.2.0 and the AWS CLI 2.37.9, and whose Pulumi lexicon's `ciFetchScript` and `PINNED_SHA256` are ci-image's (#4908). */
152
+ export const CI_IMAGE_NON_ROOT_FLOOR = "0.124.88";
153
+
154
+ /** The first chant whose `productImageStages` stages type as the docker lexicon's `DockerfileStage[]` under `exactOptionalPropertyTypes`, so `new Dockerfile({ stages: productImageStages(spec) })` compiles (#4932). */
155
+ export const CI_IMAGE_DOCKER_STAGES_FLOOR = "0.124.88";
156
+
157
+ /** The first chant whose setup steps (`OpSetupStep`: an Op waves spec's wave and job group `setup`, a scheduled Op's `setup`, `release.workflow.setup`) take a `name`, rendered as the step's name on GitHub and Forgejo (#4932). */
158
+ export const OP_SETUP_STEP_NAME_FLOOR = "0.124.88";
159
+
160
+ /** The first chant whose cloud login takes `restart` (log in, then start the step's script again without the token request variables, and empty the token files when the step exits), sets `CHANT_CLOUD_TOKEN_FILES` for `LOGIN_CLEAR_TOKENS`, takes a full token URL as GCP's `stsEndpoint`, and whose GitLab trade evaluates its exports without writing a file (#4912). */
161
+ export const CLOUD_LOGIN_RESTART_FLOOR = "0.124.88";
162
+
163
+ /** The first chant whose `chant build --pr-loop` takes `evidence` (`--evidence-runner-key-secret`, `--evidence-identity oidc`, `--evidence-audience`) and signs the plan job's `plan` and `policy` checks in its note job on GitHub, GitLab and Forgejo (#4935). */
164
+ export const PR_LOOP_EVIDENCE_FLOOR = "0.124.88";
165
+
166
+ /** The first chant whose pull request pipelines take `checkJob` (`--check-job`): a check job that runs `chant ci check` on the pull request's commit with no token or runner identity, and with `evidence` a `check-evidence` job that signs each passed hook from its report with `chant ci evidence sign --from-report .chant/check` (#4935). */
167
+ export const CHECK_JOB_FLOOR = "0.124.88";
168
+
169
+ /** The first chant whose GitLab pipelines sign evidence in the target branch's plan notes pipeline, in jobs that name the `chant-evidence` environment, with `chant ci evidence sign --open`, and whose `pr-post --open --evidence-dir` ends each merge request's note with the checks line; no job of a merge request pipeline holds the runner key (#4914). */
170
+ export const GITLAB_OPEN_EVIDENCE_FLOOR = "0.124.88";
171
+
172
+ /** The first chant whose `chant ci check` takes `--summary <file>` and whose `checkReportSummary` renders the check report's markdown section, so a product's check step runs chant's check stage and keeps the section in its own report (#4914). */
173
+ export const CHECK_SUMMARY_FLOOR = "0.124.88";
174
+
175
+ /** The first chant whose pull request pipelines take `refGateStatus` (`--ref-gate-status`): a `ref-gate` job that runs `chant workspace ref-gate status` for the pull request's commit, and on GitLab `ref-gate status --open` for every open merge request (#4935). */
176
+ export const REF_GATE_STATUS_JOB_FLOOR = "0.124.88";
177
+
178
+ /** The first chant with `@intentius/chant/ref-gate-rules` (`refGateRulesAt`), `require` in `checkPrRequires`, `refGateStatus` in `pipelineContract` and `ci forge-check --ref-gate-status`, `@intentius/chant/ref-gate-init` (`refGateInitPlan`, `writeRefGateInit`), and a pre-receive refusal that prints the command recording the override request (#4913). */
179
+ export const REF_GATE_PIECES_FLOOR = "0.124.88";
180
+
181
+ /** The first chant whose `chant release cut --yes` pushes `chant/lifecycle` again when the remote refuses it, and exits non-zero untagged (`release-record-not-pushed`) when the release record never lands, so the release workflow does not push the tag (#4965). */
182
+ export const RELEASE_CUT_RECORD_FLOOR = NEXT_RELEASE;
183
+
184
+ /** The first chant whose release cut refuses, before it records or tags, a release whose npm publish target would carry an image archive (`publish-npm-carries-image`), and whose GitLab release workflow runs the binfmt image by digest from `IMAGE_PINS` (#4941). */
185
+ export const RELEASE_CUT_CARRIES_IMAGE_FLOOR = NEXT_RELEASE;
186
+ /** The first chant whose `ciToolFetchScript` and `ciToolInstallLine` take `download: "node"`, a fetch and unzip with node for an image with no curl or unzip, whose `CI_TOOL_SHA256` records just 1.36.0 and act 0.2.89 and checks them against their releases' checksums files, and whose overdue check deepens a shallow checkout before it dates a pipeline file (#4952). */
187
+ export const CI_TOOL_NODE_DOWNLOAD_FLOOR = NEXT_RELEASE;
188
+
189
+ /** The first chant whose `chant build -o <dir>/` writes a build's additional files (a docker project's Dockerfiles) into the directory with no primary file, whose `chantGenerated` renders take a `module` and its `export` (a `{ path: text }` object or a function returning one) and `chant dev render <module> <export>` writes them in place, and whose `chant ci workflow` and `chant release workflow` write into `chant dev generated-check`'s render tree with no `--output` (#4950). */
190
+ export const RENDER_KINDS_FLOOR = NEXT_RELEASE;
191
+
192
+ /** The first chant whose sql lexicon's `chant lifecycle diff --live` addresses a table's columns by name (`columns[#country].default.expr`), compares a ClickHouse table's column order as `columnOrder`, and reports a column the server has and the declaration does not as pending, and whose `lexiconDriftRecords` counts a deep read's pending changes (that column, a ClickHouse or Postgres privilege granted by hand) as drift (#4944). */
193
+ export const SQL_LIVE_COLUMNS_FLOOR = NEXT_RELEASE;
194
+
195
+ /** The first chant whose `driftNotifyFields` takes `stacks`, each member's drift records, and from them names the drifted members and computes the run's fingerprint (#4944). */
196
+ export const DRIFT_NOTIFY_STACKS_FLOOR = NEXT_RELEASE;
197
+
198
+ /** The first chant whose workspace member's pull request pipeline takes `evidence`, `checkJob` and `refGateStatus` (`chant build --pr-loop` in a member), signing the member's plan job as `plan:<member>` and `policy:<member>` (`ci evidence sign --member`, `memberEvidenceCheck`) and running the check job in the member's directory (#4964). */
199
+ export const MEMBER_SIGNED_CHECKS_FLOOR = NEXT_RELEASE;
200
+
201
+ /** The first chant whose `checkJob` takes `{ services, env, before, dir, args }` (`PrCheckJobOptions`: service containers, the check step's variables and lines, the report directory, the arguments after `--base`) and whose github, forgejo and gitlab lexicons render the check, check evidence and ref gate jobs for a product's own workflow (`productCheckJobs`, `forgejoProductCheckJobs`, `gitlabProductCheckJobs`) (#4964). */
202
+ export const PRODUCT_CHECK_JOBS_FLOOR = NEXT_RELEASE;
203
+
204
+ /** The first chant whose GitLab Op waves pipeline with a runner key hands it to no wave job: each deciding wave's `<wave job>-evidence` job names the `chant-evidence` environment and signs `plan:<wave>` from the wave job (#4964). */
205
+ export const GITLAB_WAVE_KEY_SCOPE_FLOOR = NEXT_RELEASE;
206
+
207
+ /** The first chant with `actorOf` and `actorOrder` in `@intentius/chant/actor`: the actor fallback with `GITHUB_TRIGGERING_ACTOR` ahead of the forge's actor and git's `user.name` before the login, each place switched on or off by the caller (#4966). */
208
+ export const ACTOR_ORDER_FLOOR = NEXT_RELEASE;
209
+
210
+ /** The first chant with `@intentius/chant/ci-base` (`ciBaseRef`), the base a CI job measures a change from (the pull request's target branch, else the default branch for a push to another branch), and whose `chant ci check` defaults `--base` to it (#4966). */
211
+ export const CI_BASE_REF_FLOOR = NEXT_RELEASE;
212
+
213
+ /** The first chant with `@intentius/chant/planned-files` (`planFile`, `planRemoval`, `writePlannedFiles`, `staleGeneratedFiles`): an init's planned files with their modes, written or removed in one call, and the generated files a product no longer renders, found by their header (#4966). */
214
+ export const PLANNED_FILES_FLOOR = NEXT_RELEASE;
215
+
216
+ /** The first chant whose `pipelineContract` takes `jobs`, the jobs a product builds from its own config, beside or in place of `pipelines`, so a product's forge check gets the required statuses and `refGateStatus` from chant (#4966). */
217
+ export const FORGE_CHECK_OWN_JOBS_FLOOR = NEXT_RELEASE;
218
+
219
+ /** The first chant whose `chant components pr-apply --before-merge` waits for the ref gate's status: the status the policy at base sets for the target branch is passed as `require` to the `checks` require (#4966). */
220
+ export const BEFORE_MERGE_REF_GATE_FLOOR = NEXT_RELEASE;
221
+
222
+ /** The first chant whose product plan with `targets` and `evidence` signs each target's plan job as `plan:<target>` and `policy:<target>` (`ci evidence sign --member <target>`, `targetEvidenceCheck`, `productPlanEvidenceChecks`), and whose `refGateInitPlan` takes `targets` and names those checks in the `refs` rule (#4978). */
223
+ export const TARGET_SIGNED_CHECKS_FLOOR = NEXT_RELEASE;
224
+
225
+ /** The first chant whose Op waves generators take `renderSpec` (the wave jobs run `chant run wave --render-spec`, and `CHANT_WAVES_SPEC_COMMAND` names the product command that prints the spec at the commit in `CHANT_WAVES_SPEC_AT`), so a product whose spec is built from its config at base renders its wave jobs, policy step, evidence job and cloud trade through chant (#4982). */
226
+ export const RUNTIME_WAVES_SPEC_FLOOR = NEXT_RELEASE;
227
+
228
+ /** The first chant whose `chant run resume` (`resumeGateRun`) on GitLab retries a wave job's `<wave job>-evidence` with the wave job when the evidence job already ran, and whose `ci evidence sign --from-job` waits for a job it reads to finish, so a resumed wave's evidence job signs from the new try (#4978). */
229
+ export const GITLAB_WAVE_EVIDENCE_RETRY_FLOOR = NEXT_RELEASE;
@@ -0,0 +1,73 @@
1
+ /**
2
+ * #4950: render a module's file-text export.
3
+ *
4
+ * A product keeps some generated files as the text a TypeScript function
5
+ * returns: plywood's `dockerfiles()` in `src/images.ts` gives each image's
6
+ * Dockerfile by its path from the repository root, and a schema or a set of
7
+ * dashboards can be the same. plywood bundled each such module with esbuild
8
+ * (`build-images.mjs`, `build-schema.mjs`) only to call that export and write
9
+ * the files. Here chant imports the module itself, with the TypeScript loader
10
+ * and chant's own modules served as the running CLI, calls the export, and
11
+ * writes each file below an output root:
12
+ *
13
+ * - `chant dev render <module> <export> [--output <root>]` writes them in
14
+ * place (the root is the working directory unless `--output` names one);
15
+ * under `chant dev generated-check` they go to the render tree.
16
+ * - a `chantGenerated` render of the module kind (`{ "module", "export" }`)
17
+ * renders them into the check's render tree and compares them.
18
+ *
19
+ * The export is a `{ path: text }` object, or a function, async or not, that
20
+ * returns one when called with no arguments. Each path is relative, with `/`
21
+ * between segments and no `..`.
22
+ */
23
+ import { mkdirSync, writeFileSync } from "node:fs";
24
+ import { dirname, join, resolve } from "node:path";
25
+ import { importModule } from "./discovery/import";
26
+
27
+ /** Files by their path below the output root. */
28
+ export type RenderedFiles = Record<string, string>;
29
+
30
+ /** Whether `path` is one an export may name: relative, `/`-separated, with no `.` or `..` segment. */
31
+ function isRenderedPath(path: string): boolean {
32
+ if (!path || path.startsWith("/") || path.includes("\\") || /^[A-Za-z]:/.test(path)) return false;
33
+ return path.split("/").every((s) => s !== "" && s !== "." && s !== "..");
34
+ }
35
+
36
+ /**
37
+ * Import `modulePath` (resolved from `cwd`) and return the files its export
38
+ * `exportName` renders. Throws, naming the module and export, when the export
39
+ * is missing, is not files, or names a path outside the root.
40
+ */
41
+ export async function renderModuleFiles(modulePath: string, exportName: string, cwd = process.cwd()): Promise<RenderedFiles> {
42
+ const at = resolve(cwd, modulePath);
43
+ const where = `${modulePath} export ${exportName}`;
44
+ const mod = await importModule(at);
45
+ if (!(exportName in mod)) throw new Error(`${modulePath} has no export named ${exportName}`);
46
+ const exported = mod[exportName];
47
+ const value = typeof exported === "function" ? await (exported as () => unknown)() : exported;
48
+ if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error(`${where} must be, or return, an object of file paths to their text`);
49
+ const files: RenderedFiles = {};
50
+ for (const [path, text] of Object.entries(value as Record<string, unknown>)) {
51
+ if (!isRenderedPath(path)) throw new Error(`${where} names ${JSON.stringify(path)}, which is not a relative path inside the output root`);
52
+ if (typeof text !== "string") throw new Error(`${where} gives ${path} a ${text === null ? "null" : typeof text}, not its text`);
53
+ files[path] = text;
54
+ }
55
+ if (Object.keys(files).length === 0) throw new Error(`${where} renders no files`);
56
+ return files;
57
+ }
58
+
59
+ /**
60
+ * Write each file below `root`, creating its directories. `place` maps the
61
+ * absolute path before the write (`renderPathOf`, under a check). Returns
62
+ * the paths written, in the export's order.
63
+ */
64
+ export function writeRenderedFiles(root: string, files: RenderedFiles, place: (path: string) => string = (p) => p): string[] {
65
+ const written: string[] = [];
66
+ for (const [path, text] of Object.entries(files)) {
67
+ const target = place(join(root, path));
68
+ mkdirSync(dirname(target), { recursive: true });
69
+ writeFileSync(target, text);
70
+ written.push(target);
71
+ }
72
+ return written;
73
+ }
@@ -0,0 +1,89 @@
1
+ /**
2
+ * #4928: `runStateMigration` takes the product's record of the migration (its
3
+ * moves, retags, stamps), which the request's attachment binds beside the
4
+ * roots as canonical JSON, bounded in size. On the in-memory engine and
5
+ * ledger; nothing reaches a store or git.
6
+ */
7
+ import { describe, expect, test } from "vitest";
8
+ import { fakeLedger } from "./__fixtures__/gated-ledger";
9
+ import type { RequestGateInput } from "./lifecycle/gated-request";
10
+ import {
11
+ runStateMigration,
12
+ STATE_MIGRATION_RECORD_FLOOR,
13
+ STATE_MIGRATION_RECORD_MAX_BYTES,
14
+ StateMigrationRecordError,
15
+ type MigrationRootPlan,
16
+ type StateMigrationEngine,
17
+ } from "./state-migration";
18
+
19
+ const roots: MigrationRootPlan[] = [
20
+ { root: "queues", location: "s3://acme/queues.tfstate", before: { version_id: "q1", digest: "sha256:q-before" }, after: { digest: "sha256:q-after" }, proof: { changes: [], summary: "No changes." } },
21
+ ];
22
+
23
+ const engine: StateMigrationEngine = {
24
+ lock: async () => async () => {},
25
+ current: async () => ({ version_id: "q1", digest: "sha256:q-before" }),
26
+ write: async () => {},
27
+ verify: async () => ({ changes: [], summary: "No changes." }),
28
+ };
29
+
30
+ /** A ledger that keeps each request's attachment. */
31
+ function ledger() {
32
+ const l = fakeLedger();
33
+ const attachments: Array<string | undefined> = [];
34
+ const ask = l.requestGate.bind(l);
35
+ l.requestGate = (input: RequestGateInput) => {
36
+ attachments.push(input.attachment);
37
+ return ask(input);
38
+ };
39
+ return Object.assign(l, { attachments });
40
+ }
41
+
42
+ const run = (l: ReturnType<typeof ledger>, record?: unknown) =>
43
+ runStateMigration({ name: "move-queues", by: "ana", roots, engine, words: { op: "tf-migrate" }, rules: { mode: "ledger" }, ledger: l, now: "2026-11-09T09:00:00Z", ...(record !== undefined ? { record } : {}) });
44
+
45
+ const record = { moves: [{ from: "envs/dev/platform", to: "envs/dev/queues", addresses: ["aws_sqs_queue.jobs"] }], retags: [], stamps: [{ root: "envs/dev/queues", estate: "dev" }] };
46
+
47
+ describe("runStateMigration's record (#4928)", () => {
48
+ test("the attachment carries the record beside the roots, with its keys sorted, so the digest binds it", async () => {
49
+ const l = ledger();
50
+ const r = await run(l, record);
51
+ expect(r.status).toBe("waiting");
52
+ const doc = JSON.parse(l.attachments[0]!) as { name: string; roots: unknown[]; record: Record<string, unknown> };
53
+ expect(doc.name).toBe("move-queues");
54
+ expect(doc.roots).toHaveLength(1);
55
+ expect(doc.record).toEqual(record);
56
+ expect(Object.keys(doc.record)).toEqual(["moves", "retags", "stamps"]);
57
+ expect(Object.keys((doc.record.moves as object[])[0]!)).toEqual(["addresses", "from", "to"]);
58
+ });
59
+
60
+ test("the same record in another key order asks under the same digest; another record, or none, under another", async () => {
61
+ const digest = async (rec?: unknown) => {
62
+ const r = await run(ledger(), rec);
63
+ return r.status === "waiting" ? r.digest : "";
64
+ };
65
+ const reordered = { stamps: record.stamps, retags: [], moves: [{ addresses: ["aws_sqs_queue.jobs"], to: "envs/dev/queues", from: "envs/dev/platform" }] };
66
+ expect(await digest(reordered)).toBe(await digest(record));
67
+ expect(await digest({ ...record, stamps: [] })).not.toBe(await digest(record));
68
+ expect(await digest()).not.toBe(await digest(record));
69
+ });
70
+
71
+ test("with no record the attachment is the roots alone, as before", async () => {
72
+ const l = ledger();
73
+ await run(l);
74
+ expect(Object.keys(JSON.parse(l.attachments[0]!) as object)).toEqual(["name", "roots"]);
75
+ });
76
+
77
+ test("a record over the bound, or one that is not JSON, throws before anything is asked", async () => {
78
+ const l = ledger();
79
+ const big = { stamps: [{ note: "x".repeat(STATE_MIGRATION_RECORD_MAX_BYTES) }] };
80
+ await expect(run(l, big)).rejects.toThrow(StateMigrationRecordError);
81
+ await expect(run(l, { at: 1n })).rejects.toThrow(/not JSON/);
82
+ expect(l.writes).toEqual([]);
83
+ expect(l.attachments).toEqual([]);
84
+ });
85
+
86
+ test("the floor is the release that shipped it", () => {
87
+ expect(STATE_MIGRATION_RECORD_FLOOR).toBe("0.124.88");
88
+ });
89
+ });
@@ -179,6 +179,6 @@ describe("a root's source and an approval the states moved away from (#4806)", (
179
179
  });
180
180
 
181
181
  test("its floor is the next release", () => {
182
- expect(STATE_MIGRATION_SOURCE_FLOOR).toBe(NEXT_RELEASE);
182
+ expect(STATE_MIGRATION_SOURCE_FLOOR).toBe("0.124.86");
183
183
  });
184
184
  });