@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
@@ -1,5 +1,5 @@
1
- import { spawnSync } from "node:child_process";
2
- import { mkdirSync, mkdtempSync, readFileSync, writeFileSync } from "node:fs";
1
+ import { spawn, spawnSync } from "node:child_process";
2
+ import { existsSync, mkdirSync, mkdtempSync, readFileSync, writeFileSync } from "node:fs";
3
3
  import { tmpdir } from "node:os";
4
4
  import { dirname, join, resolve } from "node:path";
5
5
  import { fileURLToPath, pathToFileURL } from "node:url";
@@ -26,14 +26,15 @@ const write = (file: string, body: string | object) => {
26
26
  writeFileSync(file, typeof body === "string" ? body : JSON.stringify(body, null, 2) + "\n");
27
27
  };
28
28
 
29
- /** A chant checkout whose core and k8s lexicon are already built (dist/ in place, no prepack). */
30
- function checkout(): string {
29
+ /** A chant checkout whose core and k8s lexicon are already built (dist/ in place, no prepack); `next` writes a NEXT_RELEASE into its release-floors.ts. */
30
+ function checkout(next?: string): string {
31
31
  const dir = mkdtempSync(join(tmpdir(), "chant-4787-e2e-checkout-"));
32
32
  write(join(dir, "package.json"), { name: "chant-monorepo", private: true, workspaces: ["packages/*", "lexicons/*"] });
33
33
  write(join(dir, "packages/core/package.json"), { name: "@intentius/chant", version: "2.0.0", type: "module", files: ["dist/"], exports: { ".": { import: "./dist/index.js" } } });
34
34
  write(join(dir, "packages/core/dist/index.js"), "export const local = true;\n");
35
35
  write(join(dir, "lexicons/k8s/package.json"), { name: "@intentius/chant-lexicon-k8s", version: "2.0.0", type: "module", files: ["dist/"], exports: { ".": { default: "./dist/index.js" } }, peerDependencies: { "@intentius/chant": "2.0.0" } });
36
36
  write(join(dir, "lexicons/k8s/dist/index.js"), "export {};\n");
37
+ if (next) write(join(dir, "packages/core/src/release-floors.ts"), `export const NEXT_RELEASE = "${next}";\n`);
37
38
  // A lock for the checkout's npm ci: workspaces only, so npm writes it offline.
38
39
  const lock = spawnSync("npm", ["install", "--package-lock-only", "--offline", "--no-audit", "--no-fund"], { cwd: dir, encoding: "utf8" });
39
40
  if (lock.status !== 0) throw new Error(`npm install --package-lock-only: ${lock.stderr}`);
@@ -55,8 +56,11 @@ function product(): string {
55
56
  return dir;
56
57
  }
57
58
 
58
- const chant = (cwd: string, ...args: string[]) =>
59
- spawnSync(process.execPath, ["--import", tsxLoader, mainTs, ...args], { cwd, encoding: "utf8", env: { ...process.env, NO_COLOR: "1", npm_config_offline: "true" }, timeout: 110_000 });
59
+ const chant = (cwd: string, ...args: (string | { env: Record<string, string> })[]) => {
60
+ const extra = args.find((a): a is { env: Record<string, string> } => typeof a !== "string");
61
+ const argv = args.filter((a): a is string => typeof a === "string");
62
+ return spawnSync(process.execPath, ["--import", tsxLoader, mainTs, ...argv], { cwd, encoding: "utf8", env: { ...process.env, NO_COLOR: "1", npm_config_offline: "true", ...extra?.env }, timeout: 110_000 });
63
+ };
60
64
 
61
65
  describe("chant dev local (#4787)", () => {
62
66
  it("packs a checkout into a product, keeps its manifests and lock, builds, and checks the bundle", () => {
@@ -91,4 +95,75 @@ describe("chant dev local (#4787)", () => {
91
95
  expect(r.status).toBe(2);
92
96
  expect(r.stderr).toContain("chant dev local needs a chant checkout");
93
97
  }, 60_000);
98
+
99
+ it("keeps a dev dependency's peers and installs the checkout at its next release (#4921)", async () => {
100
+ const repo = checkout("2.1.0");
101
+ const dir = product();
102
+ // A test runner whose peer (vitest's vite, say) npm installs from the registry.
103
+ const vendor = join(dir, "vendor/tester");
104
+ write(join(vendor, "package.json"), { name: "tester", version: "1.0.0", peerDependencies: { helper: "^1.0.0" } });
105
+ const packed = spawnSync("npm", ["pack", "--silent", "--pack-destination", join(dir, "vendor")], { cwd: vendor, encoding: "utf8" });
106
+ expect(packed.status).toBe(0);
107
+ const root = JSON.parse(readFileSync(join(dir, "package.json"), "utf8"));
108
+ root.devDependencies.tester = "file:vendor/tester-1.0.0.tgz";
109
+ write(join(dir, "package.json"), root);
110
+ const registry = await startRegistry(dir);
111
+ try {
112
+ const env = { npm_config_registry: registry.url, npm_config_offline: "false" };
113
+ const build = "mkdir -p packages/app/dist && printf 'import { local } from \"@intentius/chant\";\\n' > packages/app/dist/app.mjs";
114
+ const r = chant(dir, "dev", "local", repo, "--build", build, "--json", { env });
115
+ expect(r.stderr).not.toContain("ERESOLVE");
116
+ expect(r.status).toBe(0);
117
+ expect(existsSync(join(dir, "node_modules/helper/package.json"))).toBe(true);
118
+
119
+ const core = JSON.parse(readFileSync(join(dir, "node_modules/@intentius/chant/package.json"), "utf8"));
120
+ expect(core.version).toBe("2.1.0");
121
+ const lexicon = JSON.parse(readFileSync(join(dir, "node_modules/@intentius/chant-lexicon-k8s/package.json"), "utf8"));
122
+ expect(lexicon.version).toBe("2.1.0");
123
+ expect(lexicon.peerDependencies["@intentius/chant"]).toBe("2.1.0");
124
+ const out = JSON.parse(r.stdout);
125
+ expect(out.local.packed).toEqual([
126
+ { name: "@intentius/chant", version: "2.1.0" },
127
+ { name: "@intentius/chant-lexicon-k8s", version: "2.1.0" },
128
+ ]);
129
+ } finally {
130
+ registry.stop();
131
+ }
132
+ }, 120_000);
94
133
  });
134
+
135
+ /** A registry on localhost, in its own process, that serves `helper` 1.0.0. */
136
+ async function startRegistry(dir: string): Promise<{ url: string; stop: () => void }> {
137
+ const helper = join(dir, "vendor/helper");
138
+ write(join(helper, "package.json"), { name: "helper", version: "1.0.0" });
139
+ const packed = spawnSync("npm", ["pack", "--silent", "--pack-destination", join(dir, "vendor")], { cwd: helper, encoding: "utf8" });
140
+ if (packed.status !== 0) throw new Error(`npm pack helper: ${packed.stderr}`);
141
+ const server = join(dir, "vendor/registry.mjs");
142
+ write(
143
+ server,
144
+ `import { createServer } from "node:http";
145
+ import { readFileSync } from "node:fs";
146
+ import { createHash } from "node:crypto";
147
+ const tgz = readFileSync(${JSON.stringify(join(dir, "vendor/helper-1.0.0.tgz"))});
148
+ const s = createServer((req, res) => {
149
+ const base = "http://127.0.0.1:" + s.address().port;
150
+ if (req.url === "/helper") {
151
+ res.setHeader("content-type", "application/json");
152
+ res.end(JSON.stringify({ name: "helper", "dist-tags": { latest: "1.0.0" }, versions: { "1.0.0": { name: "helper", version: "1.0.0", dist: { tarball: base + "/helper-1.0.0.tgz", shasum: createHash("sha1").update(tgz).digest("hex") } } } }));
153
+ } else if (req.url === "/helper-1.0.0.tgz") {
154
+ res.end(tgz);
155
+ } else {
156
+ res.statusCode = 404;
157
+ res.end("{}");
158
+ }
159
+ });
160
+ s.listen(0, "127.0.0.1", () => console.log(s.address().port));
161
+ `,
162
+ );
163
+ const child = spawn(process.execPath, [server], { stdio: ["ignore", "pipe", "inherit"] });
164
+ const port = await new Promise<string>((ok, fail) => {
165
+ child.stdout.once("data", (b: Buffer) => ok(b.toString().trim()));
166
+ child.once("exit", (code) => fail(new Error(`the registry exited ${code}`)));
167
+ });
168
+ return { url: `http://127.0.0.1:${port}/`, stop: () => child.kill() };
169
+ }
@@ -2,7 +2,7 @@ import { existsSync, mkdirSync, mkdtempSync, readFileSync, writeFileSync } from
2
2
  import { tmpdir } from "node:os";
3
3
  import { basename, dirname, join } from "node:path";
4
4
  import { describe, expect, it } from "vitest";
5
- import { chantPackages, installLocalChant, LocalChantError, lockMismatches, packOrder, pointAtTarballs, productChantNames, productManifests, type Runner } from "./local-chant";
5
+ import { chantPackages, installLocalChant, LocalChantError, localChantVersion, lockMismatches, packOrder, pointAtTarballs, productChantNames, productManifests, type Runner } from "./local-chant";
6
6
 
7
7
  /** #4787: what terragucci's and plywood's scripts/chant-local.sh did, as chant's `chant dev local`. */
8
8
 
@@ -60,10 +60,26 @@ describe("the packages to pack (#4787)", () => {
60
60
  const root = pointAtTarballs({ dependencies: { "@intentius/chant": "1.0.0" } }, local, true);
61
61
  expect(root).toEqual({ dependencies: { "@intentius/chant": "file:/t/a.tgz" }, devDependencies: { "@intentius/chant-lexicon-k8s": "file:/t/b.tgz" } });
62
62
  });
63
+
64
+ it("gives a peer on a packed package its packed version (#4921)", () => {
65
+ const local = new Map([["@intentius/chant", "file:/t/a.tgz"]]);
66
+ const app = pointAtTarballs({ peerDependencies: { "@intentius/chant": "1.0.0", vitest: ">=2" } }, local, false, new Map([["@intentius/chant", "2.1.0"]]));
67
+ expect(app.peerDependencies).toEqual({ "@intentius/chant": "2.1.0", vitest: ">=2" });
68
+ });
69
+ });
70
+
71
+ describe("localChantVersion (#4921)", () => {
72
+ it("is the checkout's NEXT_RELEASE when it is newer than core's package.json version", () => {
73
+ const chant = checkout();
74
+ expect(localChantVersion(chant, "2.0.0")).toBe("2.0.0");
75
+ write(join(chant, "packages/core/src/release-floors.ts"), 'export const NEXT_RELEASE = "2.1.0";\n');
76
+ expect(localChantVersion(chant, "2.0.0")).toBe("2.1.0");
77
+ expect(localChantVersion(chant, "2.2.0")).toBe("2.2.0");
78
+ });
63
79
  });
64
80
 
65
81
  /** A runner standing in for npm: pack writes a versioned tarball; install copies each `file:` dependency the manifests name into node_modules. */
66
- function fakeNpm(seen: { manifests?: string[]; calls: string[] }, opts: { installVersion?: string } = {}): Runner {
82
+ function fakeNpm(seen: { manifests?: string[]; calls: string[]; installArgs?: string[] }, opts: { installVersion?: string } = {}): Runner {
67
83
  return (command, args, cwd) => {
68
84
  seen.calls.push(`${command} ${args[0]} ${basename(cwd)}`);
69
85
  if (args[0] === "pack") {
@@ -73,6 +89,7 @@ function fakeNpm(seen: { manifests?: string[]; calls: string[] }, opts: { instal
73
89
  return `${file}\n`;
74
90
  }
75
91
  if (args[0] === "install") {
92
+ seen.installArgs = args;
76
93
  seen.manifests = productManifests(cwd).map((f) => readFileSync(join(cwd, f), "utf8"));
77
94
  for (const f of productManifests(cwd)) {
78
95
  const p = JSON.parse(readFileSync(join(cwd, f), "utf8"));
@@ -95,11 +112,13 @@ describe("installLocalChant (#4787)", () => {
95
112
  const chant = checkout();
96
113
  const dir = product();
97
114
  const before = ["package.json", "packages/app/package.json", "package-lock.json"].map((f) => readFileSync(join(dir, f), "utf8"));
98
- const seen: { manifests?: string[]; calls: string[] } = { calls: [] };
115
+ const seen: { manifests?: string[]; calls: string[]; installArgs?: string[] } = { calls: [] };
99
116
  const r = installLocalChant({ productDir: dir, chantDir: chant, install: false, run: fakeNpm(seen), log: () => {} });
100
117
 
101
118
  expect(r.packed.map((p) => p.dir)).toEqual(["packages/core", "lexicons/k8s"]);
102
119
  expect(seen.calls).toEqual(["npm pack core", "npm pack k8s", `npm install ${basename(dir)}`]);
120
+ // #4921: peers stay installed.
121
+ expect(seen.installArgs).not.toContain("--legacy-peer-deps");
103
122
  expect(existsSync(join(dir, ".chant-local/intentius-chant.tgz"))).toBe(true);
104
123
  expect(existsSync(join(dir, ".chant-local/intentius-chant-2.0.0.tgz"))).toBe(false);
105
124
  // During the install every manifest named the tarballs.
@@ -11,11 +11,13 @@
11
11
  * follows the packages it builds against ({@link packOrder});
12
12
  * 2. `npm ci` in the checkout when its lock changed since the last run, then
13
13
  * `npm pack` each package (its prepack builds it) into `.chant-local/` in
14
- * the product, under a fixed name per package;
14
+ * the product, under a fixed name per package, at the checkout's next
15
+ * release ({@link localChantVersion}, #4921);
15
16
  * 3. point every package.json of the product at the tarballs, run
16
17
  * `npm install --no-save`, and put the manifests and package-lock.json
17
18
  * back byte for byte, so the workspace gets the local build everywhere and
18
- * git sees no change;
19
+ * git sees no change. The install keeps peer dependencies (#4921), so a
20
+ * test runner's peers stay installed;
19
21
  * 4. mark each installed copy's package.json with `chantLocal` (the commit and
20
22
  * the checkout), which `checkBundle` and a reader use to tell the local
21
23
  * build from the pin, and fail when a copy is not the local build.
@@ -25,7 +27,8 @@
25
27
  */
26
28
  import { spawnSync } from "node:child_process";
27
29
  import { createHash } from "node:crypto";
28
- import { existsSync, lstatSync, mkdirSync, readdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
30
+ import { existsSync, lstatSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
31
+ import { tmpdir } from "node:os";
29
32
  import { join, relative, resolve } from "node:path";
30
33
 
31
34
  /** A chant workspace package that can be packed: not private. */
@@ -140,6 +143,54 @@ export function packOrder(pkgs: Map<string, ChantPackage>, want: Iterable<string
140
143
  return out;
141
144
  }
142
145
 
146
+ /** `a` against `b` as `x.y.z` versions, prerelease ignored: negative when `a` is older. */
147
+ function compareCore(a: string, b: string): number {
148
+ const pa = a.split(/[-+]/)[0]!.split(".").map(Number);
149
+ const pb = b.split(/[-+]/)[0]!.split(".").map(Number);
150
+ for (let i = 0; i < 3; i++) if ((pa[i] ?? 0) !== (pb[i] ?? 0)) return (pa[i] ?? 0) - (pb[i] ?? 0);
151
+ return 0;
152
+ }
153
+
154
+ /**
155
+ * The version `chant dev local` packs a checkout at (#4921): the checkout's
156
+ * `NEXT_RELEASE` (packages/core/src/release-floors.ts), the release its
157
+ * floors name, when that is newer than core's package.json version. A
158
+ * checkout's package.json keeps the version of the last time it was bumped by
159
+ * hand (0.124.34 while 0.124.87 was out), which failed a product's floor and
160
+ * `minReader` checks that pass on a published chant. Every floor the checkout
161
+ * declares is at or below `NEXT_RELEASE`, so the local build passes each one.
162
+ * The build is marked local by the `chantLocal` field on each installed copy,
163
+ * not in the version, because a prerelease of `NEXT_RELEASE` sorts below it.
164
+ */
165
+ export function localChantVersion(chantDir: string, coreVersion: string): string {
166
+ const f = join(chantDir, "packages/core/src/release-floors.ts");
167
+ const next = existsSync(f) ? /export const NEXT_RELEASE = "(\d+\.\d+\.\d+)"/.exec(readFileSync(f, "utf8"))?.[1] : undefined;
168
+ return next !== undefined && compareCore(next, coreVersion) > 0 ? next : coreVersion;
169
+ }
170
+
171
+ /**
172
+ * Set the version of one packed tarball's package.json, and every chant
173
+ * dependency, peer and optional dependency it names among `versions` to that
174
+ * package's packed version, so the packages npm installs agree with each
175
+ * other (#4921). The tarball is unpacked under the OS temp directory, which is
176
+ * left for the OS to clear, and packed again in place. Nothing is run when
177
+ * the manifest already says all of it.
178
+ */
179
+ export function restampTarball(tarball: string, versions: Map<string, string>, run: Runner): void {
180
+ const stage = mkdtempSync(join(tmpdir(), "chant-dev-local-"));
181
+ run("tar", ["-xzf", tarball, "-C", stage], stage);
182
+ const f = join(stage, "package", "package.json");
183
+ const p = readManifest(f);
184
+ const before = JSON.stringify(p);
185
+ if (p.name && versions.has(p.name)) p.version = versions.get(p.name)!;
186
+ for (const k of ["dependencies", "peerDependencies", "optionalDependencies"] as const) {
187
+ for (const n of Object.keys(p[k] ?? {})) if (versions.has(n)) p[k]![n] = versions.get(n)!;
188
+ }
189
+ if (JSON.stringify(p) === before) return;
190
+ writeFileSync(f, `${JSON.stringify(p, null, 2)}\n`);
191
+ run("tar", ["-czf", tarball, "-C", stage, "package"], stage);
192
+ }
193
+
143
194
  /** The fixed tarball name for a package, so a later run replaces it: `@intentius/chant-lexicon-k8s` is `intentius-chant-lexicon-k8s.tgz`. */
144
195
  export const tarballName = (name: string) => `${name.replace(/^@/, "").replace(/\//g, "-")}.tgz`;
145
196
 
@@ -148,15 +199,18 @@ export const tarballName = (name: string) => `${name.replace(/^@/, "").replace(/
148
199
  * and optionalDependency `local` names takes its `file:` spec. The root also
149
200
  * gets every tarball as a devDependency, so npm replaces a copy only a lexicon
150
201
  * reaches (a lexicon's own chant dependencies) instead of keeping a registry
151
- * release of it.
202
+ * release of it. A peerDependency on a packed package takes its packed
203
+ * version from `versions` (#4921), so the install needs no
204
+ * `--legacy-peer-deps`.
152
205
  */
153
- export function pointAtTarballs(manifest: Manifest, local: Map<string, string>, isRoot: boolean): Manifest {
206
+ export function pointAtTarballs(manifest: Manifest, local: Map<string, string>, isRoot: boolean, versions: Map<string, string> = new Map()): Manifest {
154
207
  const p: Manifest = structuredClone(manifest);
155
208
  for (const k of ["dependencies", "devDependencies", "optionalDependencies"] as const) {
156
209
  const deps = p[k];
157
210
  if (!deps) continue;
158
211
  for (const n of Object.keys(deps)) if (local.has(n)) deps[n] = local.get(n)!;
159
212
  }
213
+ for (const n of Object.keys(p.peerDependencies ?? {})) if (versions.has(n)) p.peerDependencies![n] = versions.get(n)!;
160
214
  if (isRoot) {
161
215
  const extra = Object.fromEntries([...local].filter(([n]) => !(n in (p.dependencies ?? {})) && !(n in (p.optionalDependencies ?? {}))));
162
216
  p.devDependencies = { ...p.devDependencies, ...extra };
@@ -186,9 +240,10 @@ export function installedChantCopies(productDir: string): { at: string; name: st
186
240
  /** How a command runs: throws {@link LocalChantError} when it exits non-zero. */
187
241
  export type Runner = (command: string, args: string[], cwd: string) => string;
188
242
 
189
- /** Run a command with its stderr on ours and its stdout returned. */
243
+ /** Run a command with its stderr on ours and its stdout returned. macOS tar is told not to add `._` metadata files. */
190
244
  export const defaultRunner: Runner = (command, args, cwd) => {
191
- const r = spawnSync(command, args, { cwd, stdio: ["ignore", "pipe", "inherit"], encoding: "utf8", maxBuffer: 64 * 1024 * 1024 });
245
+ const env = command === "tar" ? { ...process.env, COPYFILE_DISABLE: "1" } : process.env;
246
+ const r = spawnSync(command, args, { cwd, env, stdio: ["ignore", "pipe", "inherit"], encoding: "utf8", maxBuffer: 64 * 1024 * 1024 });
192
247
  if (r.error) throw new LocalChantError(`${command} ${args.join(" ")} in ${cwd}: ${r.error.message}`);
193
248
  if (r.status !== 0) throw new LocalChantError(`${command} ${args.join(" ")} in ${cwd} exited ${r.status ?? r.signal}`);
194
249
  return r.stdout;
@@ -255,6 +310,10 @@ export function installLocalChant(opts: LocalChantOptions): LocalChantResult {
255
310
 
256
311
  const outDir = join(productDir, ".chant-local");
257
312
  mkdirSync(join(outDir, "manifests"), { recursive: true });
313
+ // #4921: every package at the checkout's next release, which a product's floor checks accept.
314
+ const version = localChantVersion(chantDir, pkgs.get("@intentius/chant")?.version ?? order[0]!.version);
315
+ const stamped = new Map(order.map((p) => [p.name, version]));
316
+ const restamp = order.some((p) => p.version !== version);
258
317
  const packed: LocalChantResult["packed"] = [];
259
318
  for (const p of order) {
260
319
  log(`packing ${p.dir}`);
@@ -263,29 +322,34 @@ export function installLocalChant(opts: LocalChantOptions): LocalChantResult {
263
322
  if (!file || !existsSync(join(outDir, file))) throw new LocalChantError(`npm pack in ${p.dir} wrote no tarball`);
264
323
  const fixed = tarballName(p.name);
265
324
  if (file !== fixed) renameSync(join(outDir, file), join(outDir, fixed));
266
- packed.push({ ...p, tarball: join(outDir, fixed) });
325
+ if (restamp) restampTarball(join(outDir, fixed), stamped, run);
326
+ packed.push({ ...p, version, tarball: join(outDir, fixed) });
267
327
  }
328
+ if (restamp) log(`packed at ${version}, the checkout's next release; each installed copy is marked chantLocal`);
268
329
  writeFileSync(join(outDir, "commit"), `${mark.commit}\n`);
269
330
  writeFileSync(join(outDir, "packages.json"), `${JSON.stringify(packed.map((p) => ({ name: p.name, version: p.version, tarball: relative(productDir, p.tarball) })), null, 2)}\n`);
270
331
 
271
332
  // The workspace packages pin chant too, so installing at the root alone
272
333
  // would leave the pinned copies nested under packages/*/node_modules. Point
273
334
  // every package.json at the tarballs for one install and put each file
274
- // back afterwards, the lock with them. --legacy-peer-deps because the pinned
275
- // lexicons still in the tree want the pinned core as a peer until npm
276
- // replaces them.
335
+ // back afterwards, the lock with them. Peers are installed as npm always
336
+ // does (#4921): --legacy-peer-deps dropped a test runner's peers (vitest's
337
+ // vite, rolldown, lightningcss). The packed versions are the next release,
338
+ // which the pinned lexicons' `^` peers on core accept, and each manifest's
339
+ // peers on chant name the packed version.
277
340
  const local = new Map(packed.map((p) => [p.name, `file:${p.tarball}`]));
341
+ const packedVersions = new Map(packed.map((p) => [p.name, p.version]));
278
342
  const files = [...productManifests(productDir), ...(existsSync(join(productDir, "package-lock.json")) ? ["package-lock.json"] : [])];
279
343
  const saved = new Map(files.map((f) => [f, readFileSync(join(productDir, f))]));
280
344
  for (const [f, body] of saved) writeFileSync(join(outDir, "manifests", f.replace(/\//g, "_")), body);
281
345
  try {
282
346
  for (const f of files) {
283
347
  if (!f.endsWith("package.json")) continue;
284
- const p = pointAtTarballs(JSON.parse(saved.get(f)!.toString("utf8")) as Manifest, local, f === "package.json");
348
+ const p = pointAtTarballs(JSON.parse(saved.get(f)!.toString("utf8")) as Manifest, local, f === "package.json", packedVersions);
285
349
  writeFileSync(join(productDir, f), `${JSON.stringify(p, null, 2)}\n`);
286
350
  }
287
351
  log(`installing ${packed.length} tarballs with npm install --no-save`);
288
- run("npm", ["install", "--no-save", "--no-audit", "--no-fund", "--legacy-peer-deps"], productDir);
352
+ run("npm", ["install", "--no-save", "--no-audit", "--no-fund"], productDir);
289
353
  } finally {
290
354
  for (const [f, body] of saved) writeFileSync(join(productDir, f), body);
291
355
  }
@@ -339,3 +403,56 @@ export function resetLocalChant(opts: { productDir: string; log?: (line: string)
339
403
  const bad = lockMismatches(dir);
340
404
  if (bad.length) throw new LocalChantError(`node_modules does not match package-lock.json after npm ci:\n ${bad.join("\n ")}`);
341
405
  }
406
+
407
+ /** What a product's image build needs to install the chant the product has (#4909). */
408
+ export interface LocalChantImage {
409
+ /** The chant the image installs: the root's pin, or `local-<commit>` for a `chant dev local` build. */
410
+ version: string;
411
+ /** The mark, when the installed chant is a local build. */
412
+ local?: LocalChantMark;
413
+ /** The tarball directory the image installs from, when local: `<product>/.chant-local`. */
414
+ context?: string;
415
+ /**
416
+ * `docker build` arguments: `--build-arg CHANT_VERSION=<version>`, and for a
417
+ * local build `--build-context chant-local=<product>/.chant-local`, which
418
+ * the Dockerfile's `chant-local` stage (`FROM scratch AS chant-local`)
419
+ * stands in for when the chant is the pin.
420
+ */
421
+ args: string[];
422
+ }
423
+
424
+ /**
425
+ * The chant a product's image should install (#4909): the local build when
426
+ * `chant dev local` marked the installed `@intentius/chant`, else the root's
427
+ * pin. terragucci's stack/bootstrap.sh read the `chantLocal` mark with jq,
428
+ * checked `.chant-local/` for its tarballs and built the
429
+ * `--build-context` itself. For a local build every package in `with` (core
430
+ * is always one) must have its tarball, of the commit the mark names; a
431
+ * missing one is a {@link LocalChantError} that says to run `chant dev local`
432
+ * again with `--with`.
433
+ */
434
+ export function localChantImage(productDir: string, opts: { with?: string[]; buildArg?: string; contextName?: string } = {}): LocalChantImage {
435
+ const dir = resolve(productDir);
436
+ const buildArg = opts.buildArg ?? "CHANT_VERSION";
437
+ const contextName = opts.contextName ?? "chant-local";
438
+ const coreFile = join(dir, "node_modules/@intentius/chant/package.json");
439
+ if (!existsSync(coreFile)) throw new LocalChantError(`@intentius/chant is not installed in ${dir}; run npm ci`);
440
+ const core = readManifest(coreFile);
441
+ if (core.chantLocal) {
442
+ const outDir = join(dir, ".chant-local");
443
+ const commitFile = join(outDir, "commit");
444
+ const commit = existsSync(commitFile) ? readFileSync(commitFile, "utf8").trim() : undefined;
445
+ if (commit !== core.chantLocal.commit) {
446
+ throw new LocalChantError(`node_modules has the local chant ${core.chantLocal.commit}, but .chant-local/ holds ${commit ? `the tarballs of ${commit}` : "no tarballs"}; run chant dev local again`);
447
+ }
448
+ const names = ["@intentius/chant", ...(opts.with ?? [])];
449
+ const missing = names.filter((n) => !existsSync(join(outDir, tarballName(n))));
450
+ if (missing.length) throw new LocalChantError(`.chant-local/ has no tarball for ${missing.join(", ")}; run chant dev local again with ${missing.map((n) => `--with ${n}`).join(" ")}`);
451
+ const version = `local-${core.chantLocal.commit}`;
452
+ return { version, local: core.chantLocal, context: outDir, args: ["--build-context", `${contextName}=${outDir}`, "--build-arg", `${buildArg}=${version}`] };
453
+ }
454
+ const root = readManifest(join(dir, "package.json"));
455
+ const version = root.dependencies?.["@intentius/chant"] ?? root.devDependencies?.["@intentius/chant"] ?? core.version;
456
+ if (!version) throw new LocalChantError(`${coreFile} has no version`);
457
+ return { version, args: ["--build-arg", `${buildArg}=${version}`] };
458
+ }
@@ -14,6 +14,7 @@
14
14
 
15
15
  import { CHANT_WORDS, isChantWords, type CiProductNotifyWords, type CiProductWords } from "./ci-product-words";
16
16
  import type { NotifyFields, SendNotifyOptions } from "./notify";
17
+ import { driftIssueRecords, driftRunFingerprint, type DriftRunStack } from "./drift-issue";
17
18
 
18
19
  /**
19
20
  * The first chant whose Slack and Teams messages take a product's words, a
@@ -48,12 +49,19 @@ export function productSendOptions(words: CiProductWords, options: SendNotifyOpt
48
49
 
49
50
  /** What a drift notice concerns. */
50
51
  export interface DriftNotifyInput {
51
- /** The members whose refresh found drift. */
52
- changed: string[];
52
+ /** The members whose refresh found drift. Left out, the {@link stacks} with drift records, in their order. */
53
+ changed?: string[];
53
54
  missing?: string[];
54
55
  /** The members whose refresh failed, so drift there is unknown. */
55
56
  failed?: string[];
57
+ /** The run's fingerprint. Left out, `driftRunFingerprint` of the {@link stacks}. */
56
58
  fingerprint?: string;
59
+ /**
60
+ * Each member's drift records, as the run read them (#4944). The notice
61
+ * then names the members with drift and carries the run's fingerprint, so
62
+ * a product passes what it read instead of computing either.
63
+ */
64
+ stacks?: readonly DriftRunStack[];
57
65
  project?: string;
58
66
  environment?: string;
59
67
  reportUrl?: string;
@@ -62,24 +70,27 @@ export interface DriftNotifyInput {
62
70
  /**
63
71
  * A `drift` event under `words`: `2 stacks drifted: shop-dev, shop-prod` for
64
72
  * plywood, `1 member drifted: net` for chant, with the failed refreshes
65
- * named after them.
73
+ * named after them. Given `stacks`, the drifted members and the
74
+ * fingerprint come from their records (#4944).
66
75
  */
67
76
  export function driftNotifyFields(words: CiProductWords, input: DriftNotifyInput): NotifyFields {
68
77
  const [one, many] = words.noun;
69
- const n = input.changed.length;
78
+ const changed = input.changed ?? (input.stacks ?? []).filter((s) => driftIssueRecords(s.records).length > 0).map((s) => s.stack);
79
+ const fingerprint = input.fingerprint ?? (input.stacks ? driftRunFingerprint(input.stacks) : undefined);
80
+ const n = changed.length;
70
81
  const failed = input.failed ?? [];
71
- const what = n > 0 ? `${n} ${n === 1 ? one : many} drifted: ${input.changed.join(", ")}` : `no ${many} drifted`;
82
+ const what = n > 0 ? `${n} ${n === 1 ? one : many} drifted: ${changed.join(", ")}` : `no ${many} drifted`;
72
83
  const summary = failed.length > 0 ? `${what}; ${failed.length} ${failed.length === 1 ? one : many} could not be refreshed: ${failed.join(", ")}` : what;
73
84
  return {
74
85
  source: productNotifySource(words),
75
86
  event: "drift",
76
87
  summary,
77
- targets: input.changed,
88
+ targets: changed,
78
89
  drift: {
79
- changed: input.changed,
90
+ changed,
80
91
  ...(input.missing?.length ? { missing: input.missing } : {}),
81
92
  ...(failed.length > 0 ? { failed } : {}),
82
- ...(input.fingerprint ? { fingerprint: input.fingerprint } : {}),
93
+ ...(fingerprint ? { fingerprint } : {}),
83
94
  },
84
95
  ...(input.project !== undefined ? { project: input.project } : {}),
85
96
  ...(input.environment !== undefined ? { environment: input.environment } : {}),
@@ -23,6 +23,7 @@ import { join, resolve } from "node:path";
23
23
  import type { ReleaseAdmission } from "../../lifecycle/release-ledger";
24
24
  import { sortedJsonReplacer } from "../../utils";
25
25
  import { archiveSourceTree, sha256Digest, type SourceArchive } from "../source-archive";
26
+ import { actorFromEnv } from "../../actor";
26
27
 
27
28
  // ── sourceArchive ─────────────────────────────────────────────────────────────
28
29
 
@@ -149,7 +150,7 @@ export async function releaseRecord(args: ReleaseRecordArgs): Promise<ReleaseRec
149
150
  return { recorded: false, digest: plan.digest, env, component, approver };
150
151
  }
151
152
 
152
- const actor = args.actor || process.env.GITHUB_ACTOR || process.env.GITLAB_USER_LOGIN || process.env.USER;
153
+ const actor = args.actor || actorFromEnv(process.env, "");
153
154
  if (!actor) throw new Error("releaseRecord: no actor: pass one, or set GITHUB_ACTOR, GITLAB_USER_LOGIN or USER");
154
155
  const { runId, runOrigin } = resolveRunId(args.runId);
155
156
  await persistReleasePlan(plan, opts);
@@ -26,6 +26,7 @@ import { realpathSync } from "node:fs";
26
26
  import { join, resolve } from "node:path";
27
27
  import type { ReleaseAdmission, ReleaseRecord, ReleaseRef } from "../../lifecycle/release-ledger";
28
28
  import { archiveSourceTree } from "../source-archive";
29
+ import { actorFromEnv } from "../../actor";
29
30
  import { readReleasePlan, releasePlan, releasePlanDigest } from "./source-release";
30
31
 
31
32
  // ── releaseRollbackPlan ───────────────────────────────────────────────────────
@@ -219,7 +220,7 @@ export async function releaseRollbackRecord(args: ReleaseRollbackRecordArgs): Pr
219
220
  return { recorded: false, digest: rollback.to, env, component, approver };
220
221
  }
221
222
 
222
- const actor = args.actor || process.env.GITHUB_ACTOR || process.env.GITLAB_USER_LOGIN || process.env.USER;
223
+ const actor = args.actor || actorFromEnv(process.env, "");
223
224
  if (!actor) throw new Error("releaseRollbackRecord: no actor: pass one, or set GITHUB_ACTOR, GITLAB_USER_LOGIN or USER");
224
225
  const { runId, runOrigin } = resolveRunId(args.runId);
225
226
  await appendReleaseRecord(
@@ -119,6 +119,33 @@ describe("resumeGateRun", () => {
119
119
  expect(await resumeGateRun(gitlab, { token: "t", fetch: retried.fetch })).toMatchObject({ status: "skipped", reason: expect.stringContaining("job 556") });
120
120
  });
121
121
 
122
+ test("GitLab (#4978): a wave job's evidence job that already ran is retried with it, and one GitLab skipped is left to GitLab", async () => {
123
+ const gitlab: GateRunLocator = { forge: "gitlab", api: "https://gl/api/v4", repo: "7", run: "100", job: "555", jobName: "wave-2-staging" };
124
+ const ran = fakeForge({
125
+ "GET /api/v4/projects/7/jobs/555": { status: "failed", name: "wave-2-staging" },
126
+ "GET /api/v4/projects/7/pipelines/100/jobs": [{ id: 555, name: "wave-2-staging", status: "failed" }, { id: 560, name: "wave-2-staging-evidence", status: "success" }],
127
+ "POST /api/v4/projects/7/jobs/555/retry": { id: 556 },
128
+ "POST /api/v4/projects/7/jobs/560/retry": { id: 561 },
129
+ });
130
+ expect(await resumeGateRun(gitlab, { token: "t", fetch: ran.fetch })).toMatchObject({ status: "resumed", how: "retried job 555 as job 556, and its evidence job 560 as job 561" });
131
+ // The wave job first, so the evidence job's need is the new try.
132
+ expect(ran.calls.filter((c) => c.method === "POST").map((c) => c.url)).toEqual(["https://gl/api/v4/projects/7/jobs/555/retry", "https://gl/api/v4/projects/7/jobs/560/retry"]);
133
+
134
+ const skipped = fakeForge({
135
+ "GET /api/v4/projects/7/jobs/555": { status: "failed", name: "wave-2-staging" },
136
+ "GET /api/v4/projects/7/pipelines/100/jobs": [{ id: 555, name: "wave-2-staging", status: "failed" }, { id: 560, name: "wave-2-staging-evidence", status: "skipped" }],
137
+ "POST /api/v4/projects/7/jobs/555/retry": { id: 556 },
138
+ });
139
+ expect(await resumeGateRun(gitlab, { token: "t", fetch: skipped.fetch })).toMatchObject({ status: "resumed", how: "retried job 555 as job 556" });
140
+ expect(skipped.calls.filter((c) => c.method === "POST")).toHaveLength(1);
141
+
142
+ const dry = fakeForge({
143
+ "GET /api/v4/projects/7/jobs/555": { status: "failed", name: "wave-2-staging" },
144
+ "GET /api/v4/projects/7/pipelines/100/jobs": [{ id: 555, name: "wave-2-staging", status: "failed" }, { id: 560, name: "wave-2-staging-evidence", status: "failed" }],
145
+ });
146
+ expect(await resumeGateRun(gitlab, { token: "t", fetch: dry.fetch, dryRun: true })).toMatchObject({ status: "would-resume", how: "would retry job 555 and its evidence job 560" });
147
+ });
148
+
122
149
  test("Forgejo: dispatches the workflow on its branch, unless a run of it started after the approval", async () => {
123
150
  const forgejo: GateRunLocator = { forge: "forgejo", api: "https://fj/api/v1", repo: "acme/db", run: "9", workflow: "migrations.yml", ref: "main" };
124
151
  const forge = fakeForge({
package/src/op/index.ts CHANGED
@@ -137,6 +137,16 @@ export {
137
137
  } from "./op-waves-capability";
138
138
  export type { OpWaveCostFormat, OpWaveCostHold, OpWaveCostVerdict, OpWaveHolds, OpWaveRunCost, OpWaveStep, OpWaveStepApply, OpWaveStepGroup, OpWaveStepPlan } from "./op-waves-capability";
139
139
  export { notifyOpWave, opWaveNotifyFields } from "./op-waves-notify";
140
+ export {
141
+ OP_WAVES_RENDER_SPEC_FLAG,
142
+ OP_WAVES_SPEC_AT_ENV,
143
+ OP_WAVES_SPEC_COMMAND_ENV,
144
+ OP_WAVES_SPEC_FILE_ENV,
145
+ RUNTIME_WAVES_SPEC_FLOOR,
146
+ opWavesRenderSpecEnv,
147
+ opWavesRenderSpecProblems,
148
+ } from "./op-waves-render-spec";
149
+ export type { OpWavesRenderSpec } from "./op-waves-render-spec";
140
150
  export { OP_WAVE_STAND_DOWN_FLOOR, gitOpWaveNewerCommit, newerCommitOnBranch, opWaveRunBranch, opWaveStandDownReason, tipAppliesTargets } from "./op-waves-stand-down";
141
151
  export type { OpWaveNewerCommit, OpWaveNewerCommitPort } from "./op-waves-stand-down";
142
152
  export { OP_WAVE_RELEASE_RECORD_FLOOR, opWaveReleaseNames, opWaveReleaseProblems, releaseOfCommit } from "./op-waves-release";