@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
package/src/config.ts CHANGED
@@ -112,7 +112,8 @@ export const ChantConfigSchema = z.object({
112
112
  images: z
113
113
  .array(
114
114
  z.union([
115
- z.object({ name: z.string().min(1), build: z.string().min(1), archive: z.string().min(1) }).strict(),
115
+ // #4876: `platforms`, what the command builds, for the release workflow's QEMU setup.
116
+ z.object({ name: z.string().min(1), build: z.string().min(1), archive: z.string().min(1), platforms: z.array(z.string().min(1)).min(1).optional() }).strict(),
116
117
  // #4819: chant builds the Dockerfile as the reproducible OCI archive itself.
117
118
  z
118
119
  .object({
@@ -122,6 +123,8 @@ export const ChantConfigSchema = z.object({
122
123
  platforms: z.array(z.string().min(1)).min(1).optional(),
123
124
  archive: z.string().min(1).optional(),
124
125
  prepare: z.string().min(1).optional(),
126
+ // #4908: build arguments beside the two chant passes.
127
+ args: z.record(z.string(), z.string()).optional(),
125
128
  })
126
129
  .strict(),
127
130
  ]),
@@ -422,8 +425,8 @@ export interface ChantConfig {
422
425
  * digest and hands every digest to the build through `CHANT_RELEASE_DIGESTS`,
423
426
  * so a package can pin the images it ships with. An `oci` target pushes
424
427
  * the archive. An entry may name a `dockerfile` (with `context`,
425
- * `platforms`, `archive` and `prepare`) in place of `build`, and chant
426
- * runs the reproducible build itself (#4819). See
428
+ * `platforms`, `archive`, `prepare` and `args`) in place of `build`, and
429
+ * chant runs the reproducible build itself (#4819, #4908). See
427
430
  * ./lifecycle/release-images.ts.
428
431
  */
429
432
  images?: import("./lifecycle/release-images").ReleaseImageDeclaration[];
@@ -758,13 +761,15 @@ export function resolveSourceDir(projectDir: string, config: { sourceDir?: unkno
758
761
  /**
759
762
  * The top-level directories a root build leaves out (#4794): a project with
760
763
  * no `sourceDir`, built from its own root, does not load `scripts/`, where a
761
- * script that runs on load (prints and exits) would take the build's place.
762
- * Matched against the path relative to the project root, so only the
763
- * project's own top-level `scripts/` is skipped. The config's `include`
764
- * brings it back. Test and spec files are left out of every build already
764
+ * script that runs on load (prints and exits) would take the build's place,
765
+ * nor `migrations/` (#4921), whose `.sql` files are `ALTER`s of objects
766
+ * declared elsewhere and whose backfill scripts run on load too. Matched
767
+ * against the path relative to the project root, so only the project's own
768
+ * top-level directories are skipped. The config's `include` brings one back.
769
+ * Test and spec files are left out of every build already
765
770
  * (`isSourceFileName`).
766
771
  */
767
- export const ROOT_SOURCE_EXCLUDES: readonly string[] = ["scripts"];
772
+ export const ROOT_SOURCE_EXCLUDES: readonly string[] = ["scripts", "migrations"];
768
773
 
769
774
  /** A project's discovery globs (#2519) and the directory they are relative to. */
770
775
  export interface DiscoveryGlobs {
@@ -22,6 +22,13 @@
22
22
  import type { CatalogConsumer, CatalogConsumersInput } from "../lifecycle/release-catalog";
23
23
  import type { ControlEntry } from "./records";
24
24
 
25
+ /**
26
+ * The first chant with the consumers join, {@link joinControlConsumers} and
27
+ * {@link readControlConsumers} on `@intentius/chant/ci-control` (#4600).
28
+ * #4916 declared it after the fact, for `chant dev dead-guards`.
29
+ */
30
+ export const CONTROL_CONSUMERS_FLOOR = "0.124.55";
31
+
25
32
  /** The file each project keeps its consumers in. */
26
33
  export const CONSUMERS_FILE = "consumers.json";
27
34
  /** The contract version of {@link ConsumersDocument}. */
@@ -185,19 +185,41 @@ describe("findDeadGuards (#4792)", () => {
185
185
 
186
186
  describe("the floor table (#4792)", () => {
187
187
  it("resolves a floor not yet released to the next release", () => {
188
- expect(floorVersion("FLOOR_TABLE_FLOOR")).toBe(NEXT_RELEASE);
189
- expect(chantMeets("0.124.84", "FLOOR_TABLE_FLOOR")).toBe(compareChantVersions("0.124.84", NEXT_RELEASE) >= 0);
188
+ expect(floorVersion("FLOOR_TABLE_FLOOR")).toBe("0.124.86");
189
+ expect(chantMeets("0.124.84", "FLOOR_TABLE_FLOOR")).toBe(false);
190
+ expect(chantMeets("0.124.86", "FLOOR_TABLE_FLOOR")).toBe(true);
190
191
  });
191
192
 
192
- it("answers a released floor, and the higher version of a name two files declare", () => {
193
+ it("answers a released floor, and each name from its one declaration (#4916)", () => {
193
194
  expect(floorVersion("CI_CHECK_HOOK_FLOOR")).toBe("0.124.55");
194
195
  expect(chantMeets("0.124.84", "CI_CHECK_HOOK_FLOOR")).toBe(true);
195
196
  expect(chantMeets("0.124.54", "CI_CHECK_HOOK_FLOOR")).toBe(false);
196
- expect(FLOOR_TABLE.filter((r) => r.name === "RELEASE_VERSION_FLOOR").map((r) => r.version).sort()).toEqual(["0.124.55", "0.124.79"]);
197
- expect(floorVersion("RELEASE_VERSION_FLOOR")).toBe("0.124.79");
197
+ expect(FLOOR_TABLE.filter((r) => r.name === "RELEASE_VERSION_FLOOR").map((r) => r.version)).toEqual(["0.124.79"]);
198
+ expect(floorVersion("RELEASE_RECORD_VERSION_FLOOR")).toBe("0.124.55");
198
199
  expect(floorVersion("NO_SUCH_FLOOR")).toBeUndefined();
199
200
  });
200
201
 
202
+ // #4916: sql-yodeler's lazy load of chant's terminal confirmation, and a
203
+ // lexicon subpath loaded the same way, are checks on the table's floors.
204
+ it("finds a lazy load of approve-confirm and of a lexicon subpath", () => {
205
+ const src = `export async function chantConfirm() {
206
+ const specifier = "@intentius/chant/cli/handlers/approve-confirm";
207
+ try {
208
+ return await import(specifier);
209
+ } catch {
210
+ return undefined;
211
+ }
212
+ }
213
+ export const catalog = () => import("@intentius/chant-lexicon-terraform/module-catalog").catch(() => undefined);
214
+ export const registry = () => import("@intentius/chant-lexicon-terraform/registry").catch(() => undefined);
215
+ `;
216
+ expect(guardsIn(src).map((g) => `${g.line} ${g.kind} ${g.floor} ${g.version}`)).toEqual([
217
+ "2 module @intentius/chant/cli/handlers/approve-confirm 0.124.55",
218
+ "9 module @intentius/chant-lexicon-terraform/module-catalog 0.124.55",
219
+ "10 module @intentius/chant-lexicon-terraform/registry 0.124.55",
220
+ ]);
221
+ });
222
+
201
223
  it("names the subpaths a product imports a floor from", () => {
202
224
  const stand = FLOOR_TABLE.find((r) => r.name === "OP_WAVE_STAND_DOWN_FLOOR")!;
203
225
  expect(stand.modules).toContain("@intentius/chant/op");
@@ -19,10 +19,13 @@
19
19
  * (`CI_CONTROL_FLOOR: string;`), or destructured from a dynamic import. A
20
20
  * floor the file imports statically is the product using the part, so it
21
21
  * is not a check.
22
- * - `module`: a chant subpath loaded with `import()` where a `catch` is near
23
- * (`try { await import(specifier) } catch { return undefined }`, or
24
- * `.catch(`), the shape of a chant-next.ts loader. Its floor is the lowest
25
- * floor the subpath serves: a chant with that floor has the subpath.
22
+ * - `module`: a chant subpath, or a lexicon's
23
+ * (`@intentius/chant-lexicon-terraform/registry`, #4916), loaded with
24
+ * `import()` where a `catch` is near (`try { await import(specifier) }
25
+ * catch { return undefined }`, or `.catch(`), the shape of a chant-next.ts
26
+ * loader. Its floor is the lowest floor the subpath serves: a chant with
27
+ * that floor has the subpath. Lexicons release with chant at the same
28
+ * version, so a lexicon subpath is checked against the chant pin too.
26
29
  * - `product-floor`: a product's own constant for the chant it needs,
27
30
  * `const CHANT_CI_FLOOR = "0.124.67"`, whose checks the pin meets.
28
31
  *
@@ -361,8 +364,8 @@ export function guardsIn(src: string, table: readonly FloorRow[] = FLOOR_TABLE):
361
364
  push(at, "floor", name, version);
362
365
  }
363
366
 
364
- // module: a chant subpath loaded with import() inside a try, or with .catch( on the load.
365
- for (const m of src.matchAll(/(["'`])(@intentius\/chant(?:\/[A-Za-z0-9_./-]+)?)\1/g)) {
367
+ // module: a chant or lexicon subpath loaded with import() inside a try, or with .catch( on the load.
368
+ for (const m of src.matchAll(/(["'`])(@intentius\/chant(?:-lexicon-[a-z0-9-]+)?(?:\/[A-Za-z0-9_./-]+)?)\1/g)) {
366
369
  const at = m.index!;
367
370
  const spec = m[2];
368
371
  const version = modules.get(spec);
@@ -105,7 +105,7 @@ export function isSourceFileName(name: string): boolean {
105
105
  * discovery walk (`./walk.ts`, #2527): test and spec files, chant-generated
106
106
  * files, skip-marked files and whatever the walk's rules and the project's
107
107
  * globs skip are left out. Walked from the root of a project with no
108
- * `sourceDir`, its top-level `scripts/` is left out too (#4794,
108
+ * `sourceDir`, its top-level `scripts/` and `migrations/` are left out too (#4794, #4921,
109
109
  * `ROOT_SOURCE_EXCLUDES`), unless `include` brings it back.
110
110
  */
111
111
  export async function findInfraFiles(path: string, options?: FindInfraFilesOptions): Promise<string[]> {
@@ -4,7 +4,8 @@
4
4
  */
5
5
 
6
6
  import { describe, expect, test } from "vitest";
7
- import { driftIssueBody, driftIssueFingerprint, driftIssueMarker, keepDriftIssue, type DriftIssueInput, type DriftIssueRecord, type DriftIssueWords } from "./drift-issue";
7
+ import { createHash } from "node:crypto";
8
+ import { driftIssueBody, driftIssueFingerprint, driftIssueMarker, driftRunFingerprint, keepDriftIssue, type DriftIssueInput, type DriftIssueRecord, type DriftIssueWords } from "./drift-issue";
8
9
  import { forgejoForge, githubForge, gitlabForge, type ForgeFetch, type PrForge } from "./pr-forge";
9
10
 
10
11
  interface FakeIssue {
@@ -204,3 +205,30 @@ describe("the drift issue's parts (#4790)", () => {
204
205
  expect(driftIssueMarker("plywood", "a b-->c")).toBe("<!-- plywood:drift a_bc -->");
205
206
  });
206
207
  });
208
+
209
+ describe("driftRunFingerprint (#4896)", () => {
210
+ const other = record("urn:pulumi:staging::infra::aws:s3/bucket:Bucket::logs", "drifted", { member: "infra/staging", attributes: [{ path: "tags.owner", before: "ops", after: "qa" }] });
211
+
212
+ test("is each drifted stack's finding fingerprint, sorted and hashed, as plywood's notices had it", () => {
213
+ const stacks = [
214
+ { stack: "staging", records: [other] },
215
+ { stack: "prod", records: [bucket, queue, role] },
216
+ ];
217
+ // plywood's runFingerprint before #4896, kept so a notice's fingerprint does not move.
218
+ const parts = [`prod\t${driftIssueFingerprint([bucket, queue, role])}`, `staging\t${driftIssueFingerprint([other])}`].sort();
219
+ expect(driftRunFingerprint(stacks)).toBe(createHash("sha256").update(parts.join("\n")).digest("hex").slice(0, 16));
220
+ expect(driftRunFingerprint([...stacks].reverse())).toBe(driftRunFingerprint(stacks));
221
+ });
222
+
223
+ test("a stack with no drift is left out, and a run with none has the empty run's fingerprint", () => {
224
+ const clean = { stack: "dev", records: [role] };
225
+ expect(driftRunFingerprint([{ stack: "prod", records: [bucket] }, clean])).toBe(driftRunFingerprint([{ stack: "prod", records: [bucket] }]));
226
+ expect(driftRunFingerprint([clean])).toBe(driftRunFingerprint([]));
227
+ });
228
+
229
+ test("statuses names what is drift, as for one stack", () => {
230
+ const gone = record("app.events", "pending");
231
+ expect(driftRunFingerprint([{ stack: "prod", records: [gone] }])).toBe(driftRunFingerprint([]));
232
+ expect(driftRunFingerprint([{ stack: "prod", records: [gone] }], ["pending"])).not.toBe(driftRunFingerprint([]));
233
+ });
234
+ });
@@ -108,9 +108,11 @@ export interface DriftIssueInput {
108
108
  match?: MarkerMatch;
109
109
  /**
110
110
  * The statuses that are drift. Default {@link DRIFT_ISSUE_STATUSES}. A
111
- * read with no snapshot, such as the sql lexicon's, gives a declared
112
- * object the server lacks as `pending`, which SQL Yodeler reports as gone:
113
- * it passes `["drifted", "missing", "pending"]`.
111
+ * read with no snapshot gives a declared object the provider lacks as
112
+ * `pending`, not deployed yet, unless its lexicon says such an object is
113
+ * gone: the sql lexicon does since #4896, so its records say `missing`
114
+ * and the default covers them. A caller that passes `pending` here (SQL
115
+ * Yodeler did, for a chant before #4896) still gets the same issue.
114
116
  */
115
117
  statuses?: readonly DriftStatus[];
116
118
  }
@@ -163,6 +165,29 @@ export function driftIssueFingerprint(records: readonly DriftIssueRecord[], stat
163
165
  return createHash("sha256").update(text, "utf8").digest("hex").slice(0, 16);
164
166
  }
165
167
 
168
+ /** One stack's (or environment's) drift records, for {@link driftRunFingerprint}. */
169
+ export interface DriftRunStack {
170
+ stack: string;
171
+ records: readonly DriftIssueRecord[];
172
+ }
173
+
174
+ /**
175
+ * A run's fingerprint over several stacks (#4896), for the drift notice a
176
+ * run sends (`driftNotifyFields`'s `fingerprint` on
177
+ * `@intentius/chant/ci-product`): each stack that has drift, as its name and
178
+ * its {@link driftIssueFingerprint}, sorted and hashed. A stack with no
179
+ * drift record is left out, so a clean stack, or one whose read failed and
180
+ * gave no records, does not move it. 16 hex digits of a SHA-256, the value
181
+ * plywood's notices carried before chant computed it.
182
+ */
183
+ export function driftRunFingerprint(stacks: readonly DriftRunStack[], statuses: readonly DriftStatus[] = DRIFT_ISSUE_STATUSES): string {
184
+ const parts = stacks
185
+ .filter((s) => driftIssueRecords(s.records, statuses).length > 0)
186
+ .map((s) => `${s.stack}\t${driftIssueFingerprint(s.records, statuses)}`)
187
+ .sort();
188
+ return createHash("sha256").update(parts.join("\n")).digest("hex").slice(0, 16);
189
+ }
190
+
166
191
  /** The issue's body: the marker, the product's intro, the table, what could not be read, the notes, the advice, the run, the fingerprint. */
167
192
  export function driftIssueBody(input: DriftIssueInput, fingerprint = driftIssueFingerprint(input.records, input.statuses)): string {
168
193
  const { words } = input;
@@ -26,6 +26,7 @@ import {
26
26
  encodeDriftLine,
27
27
  encodeDriftLines,
28
28
  foldDriftLines,
29
+ lexiconDriftRecords,
29
30
  liveDiffDriftRecords,
30
31
  mapDriftToGraph,
31
32
  mergeDeepDrift,
@@ -594,3 +595,47 @@ describe("component status, constructed shapes", () => {
594
595
  roundTrip(records);
595
596
  });
596
597
  });
598
+
599
+ describe("one lexicon's section of lifecycle diff --live --json (#4896)", () => {
600
+ const resources = { missing: ["app.events"], orphan: [], runtimeChildren: [], disappeared: [], newlyObserved: [], driftedSinceSnapshot: [], unchanged: ["app.users", "app.orders"], unobserved: [{ name: "app.audit", reason: "no-credentials" }] } as LiveDiffResult;
601
+ const deep = { drifted: [{ name: "app.users", type: "Postgres::Table", changes: [{ path: "columns[1].type", kind: "changed", declared: "int", live: "bigint" }] }], unchanged: ["app.orders"], unobserved: [], undeclaredEntities: [] } as unknown as DeepDiffResult;
602
+ const base = { member: "prod", observedAt: AT };
603
+
604
+ test("absent: missing gives a declared object the server lacks as missing", () => {
605
+ expect(statusOf(liveDiffDriftRecords({ ...base, diff: resources, absent: "missing" }))["app.events"]).toBe("missing");
606
+ expect(statusOf(liveDiffDriftRecords({ ...base, diff: resources }))["app.events"]).toBe("pending");
607
+ });
608
+
609
+ test("the section's own absent, types and deep read make the records", () => {
610
+ const records = lexiconDriftRecords({ ...base, section: { resources, deep, absent: "missing", observed: { "app.users": { type: "Postgres::Table" } } } });
611
+ expect(statusOf(records)).toEqual({ "app.audit": "not-observed", "app.events": "missing", "app.orders": "in-sync", "app.users": "drifted" });
612
+ expect(records.find((r) => r.address === "app.users")!.attributes).toEqual([{ path: "columns[1].type", before: "int", after: "bigint" }]);
613
+ expect(records.find((r) => r.address === "app.users")!.resourceType).toBe("Postgres::Table");
614
+ roundTrip(records);
615
+ });
616
+
617
+ test("a section with no absent keeps pending, and one with no resources has no records", () => {
618
+ expect(statusOf(lexiconDriftRecords({ ...base, section: { resources } }))["app.events"]).toBe("pending");
619
+ expect(lexiconDriftRecords({ ...base, section: { deep } })).toEqual([]);
620
+ });
621
+
622
+ test("a deep read's pending changes are drift on the entities behind them (#4944)", () => {
623
+ const withPending = {
624
+ ...deep,
625
+ pending: [
626
+ { subject: "column app.orders.note", change: "drop column note text, which the declaration does not have", entities: ["app.orders"] },
627
+ { subject: "column app.users.legacy", change: "drop column legacy text, which the declaration does not have", entities: ["app.users"] },
628
+ { subject: "grants app", change: "REVOKE INSERT ON `shop`.`events` FROM `app`" },
629
+ ],
630
+ } as DeepDiffResult;
631
+ const records = lexiconDriftRecords({ ...base, section: { resources, deep: withPending, absent: "missing" } });
632
+ expect(statusOf(records)).toEqual({ "app.audit": "not-observed", "app.events": "missing", "app.orders": "drifted", "app.users": "drifted", "grants app": "drifted" });
633
+ expect(records.find((r) => r.address === "app.orders")!.attributes).toEqual([{ path: "column app.orders.note", after: "drop column note text, which the declaration does not have" }]);
634
+ expect(records.find((r) => r.address === "app.users")!.attributes).toEqual([
635
+ { path: "column app.users.legacy", after: "drop column legacy text, which the declaration does not have" },
636
+ { path: "columns[1].type", before: "int", after: "bigint" },
637
+ ]);
638
+ expect(records.find((r) => r.address === "grants app")!.attributes).toEqual([{ path: "grants app", after: "REVOKE INSERT ON `shop`.`events` FROM `app`" }]);
639
+ roundTrip(records);
640
+ });
641
+ });
@@ -43,7 +43,8 @@
43
43
  *
44
44
  * ## Adapters
45
45
  *
46
- * The chant ones are here: `lifecycle diff --live` ({@link liveDiffDriftRecords}),
46
+ * The chant ones are here: `lifecycle diff --live` ({@link liveDiffDriftRecords},
47
+ * and {@link lexiconDriftRecords} for one lexicon's whole section, #4896),
47
48
  * deep observe ({@link deepDiffDriftRecords}, {@link mergeDeepDrift}) and
48
49
  * component status ({@link componentStatusDriftRecords}). The terraform and
49
50
  * choudoufu ones live in the terraform lexicon's `drift-record` subpath,
@@ -1005,20 +1006,32 @@ function chantEvidence(input: DriftAdapterBase, command: string): DriftEvidence
1005
1006
  return { tool: "chant", ...(input.version ? { version: input.version } : {}), command };
1006
1007
  }
1007
1008
 
1009
+ /**
1010
+ * What a declared entity the provider confirmed absent (the live diff's
1011
+ * `missing`) is, when no snapshot says it was deployed (#4896). `pending`,
1012
+ * the default, reads it as not deployed yet. `missing` reads it as gone,
1013
+ * which is what a SQL server lacking a declared table means: the sql
1014
+ * lexicon declares it (`LexiconPlugin.liveAbsentStatus`), and
1015
+ * `chant lifecycle diff --live --json` writes it as the section's `absent`.
1016
+ */
1017
+ export type LiveAbsentStatus = Extract<DriftStatus, "pending" | "missing">;
1018
+
1008
1019
  export interface LiveDiffDriftInput extends DriftAdapterBase {
1009
1020
  /** `chant lifecycle diff --live --json`, parsed. */
1010
1021
  diff: LiveDiffResult;
1011
1022
  /** Entity types by name, for the records whose diff row carries none. */
1012
1023
  types?: Record<string, string>;
1024
+ /** The status of a `missing` entity, default `pending` ({@link LiveAbsentStatus}). */
1025
+ absent?: LiveAbsentStatus;
1013
1026
  }
1014
1027
 
1015
1028
  /**
1016
1029
  * A chant member's records, from `lifecycle diff --live`: `unchanged` and
1017
1030
  * `newlyObserved` are in-sync, `driftedSinceSnapshot` drifted (before is the
1018
- * snapshot, after the read), `missing` pending, `disappeared` missing,
1019
- * `orphan` undeclared, `runtimeChildren` runtime, `unobserved` not-observed.
1020
- * An entity in both `missing` and `disappeared` was deployed and is gone,
1021
- * so it is missing.
1031
+ * snapshot, after the read), `missing` pending (or `input.absent`),
1032
+ * `disappeared` missing, `orphan` undeclared, `runtimeChildren` runtime,
1033
+ * `unobserved` not-observed. An entity in both `missing` and `disappeared`
1034
+ * was deployed and is gone, so it is missing.
1022
1035
  */
1023
1036
  export function liveDiffDriftRecords(input: LiveDiffDriftInput): DriftRecord[] {
1024
1037
  const { diff } = input;
@@ -1042,7 +1055,7 @@ export function liveDiffDriftRecords(input: LiveDiffDriftInput): DriftRecord[] {
1042
1055
  }, d.type);
1043
1056
  }
1044
1057
  for (const name of diff.disappeared ?? []) put(name, { status: "missing" });
1045
- for (const name of diff.missing ?? []) put(name, { status: "pending" });
1058
+ for (const name of diff.missing ?? []) put(name, { status: input.absent ?? "pending" });
1046
1059
  for (const name of diff.orphan ?? []) put(name, { status: "undeclared" });
1047
1060
  for (const r of diff.runtimeChildren ?? []) put(r.name, { status: "runtime", ownership: { verdict: "foreign", ownedBy: r.owner } }, r.type);
1048
1061
  for (const name of [...(diff.unchanged ?? []), ...(diff.newlyObserved ?? [])]) put(name, { status: "in-sync" });
@@ -1068,6 +1081,13 @@ export interface DeepDiffDriftInput extends DriftAdapterBase {
1068
1081
  * `undeclaredEntities` undeclared. Accepted and held paths are not drift and
1069
1082
  * are left out. To lay these over the thin read's records, so a deep hole
1070
1083
  * stays on the attribute surface, use {@link mergeDeepDrift}.
1084
+ *
1085
+ * A pending change (`pending`: a privilege granted by hand, a column the
1086
+ * declaration does not have) is drift too (#4944), as `lifecycle diff
1087
+ * --live` counts it: an attribute on each entity behind it, its path the
1088
+ * change's subject and its after what an apply would do, the entity's record
1089
+ * drifted unless it is not-observed. A pending change that names no entity
1090
+ * is a drifted record of its own, addressed by its subject.
1071
1091
  */
1072
1092
  export function deepDiffDriftRecords(input: DeepDiffDriftInput): DriftRecord[] {
1073
1093
  const { diff } = input;
@@ -1094,6 +1114,15 @@ export function deepDiffDriftRecords(input: DeepDiffDriftInput): DriftRecord[] {
1094
1114
  })),
1095
1115
  });
1096
1116
  }
1117
+ for (const p of diff.pending ?? []) {
1118
+ const attribute: DriftAttribute = { path: p.subject, after: p.change };
1119
+ for (const name of p.entities && p.entities.length > 0 ? p.entities : [p.subject]) {
1120
+ const had = out.get(name);
1121
+ if (had?.status === "not-observed") continue;
1122
+ if (had) out.set(name, driftRecord({ ...had, status: "drifted", attributes: [...(had.attributes ?? []), attribute] }));
1123
+ else put(name, { status: "drifted", attributes: [attribute] });
1124
+ }
1125
+ }
1097
1126
  for (const name of diff.undeclaredEntities ?? []) put(name, { status: "undeclared" });
1098
1127
  for (const name of diff.unchanged ?? []) put(name, { status: "in-sync" });
1099
1128
  return [...out.values()].sort((a, b) => byString(a.address, b.address));
@@ -1126,6 +1155,42 @@ export function mergeDeepDrift(thin: Iterable<DriftRecord>, deep: Iterable<Drift
1126
1155
  return [...out.values()].sort((a, b) => byString(key(a), key(b)));
1127
1156
  }
1128
1157
 
1158
+ /**
1159
+ * One lexicon's section of `chant lifecycle diff --live --json`
1160
+ * (`lexicons.<name>`, or `stacks.<stack>.<name>`), as far as its drift
1161
+ * records read it.
1162
+ */
1163
+ export interface LiveDiffLexiconSection {
1164
+ resources?: LiveDiffResult;
1165
+ /** The live state per entity; its `type` names a record's resource type. */
1166
+ observed?: Record<string, { type?: unknown }>;
1167
+ deep?: DeepDiffResult;
1168
+ /** What a confirmed-absent entity is, when the lexicon says (#4896). Left out, `pending`. */
1169
+ absent?: LiveAbsentStatus;
1170
+ }
1171
+
1172
+ export interface LexiconDriftInput extends DriftAdapterBase {
1173
+ section: LiveDiffLexiconSection;
1174
+ }
1175
+
1176
+ /**
1177
+ * One lexicon's drift records from its section of `lifecycle diff --live
1178
+ * --json` (#4896): {@link liveDiffDriftRecords} over `resources`, with the
1179
+ * types `observed` names and the section's `absent`, and the deep read laid
1180
+ * over it with {@link mergeDeepDrift}. `chant workspace drift` reads a chant
1181
+ * member this way, and a product that runs the diff itself (SQL Yodeler
1182
+ * reads `lexicons.sql`) gets the same records. A section with no
1183
+ * `resources` has none.
1184
+ */
1185
+ export function lexiconDriftRecords(input: LexiconDriftInput): DriftRecord[] {
1186
+ const { section, ...base } = input;
1187
+ if (!section.resources) return [];
1188
+ const types: Record<string, string> = {};
1189
+ for (const [name, meta] of Object.entries(section.observed ?? {})) if (typeof meta?.type === "string") types[name] = meta.type;
1190
+ const thin = liveDiffDriftRecords({ ...base, diff: section.resources, types, ...(section.absent ? { absent: section.absent } : {}) });
1191
+ return section.deep ? mergeDeepDrift(thin, deepDiffDriftRecords({ ...base, diff: section.deep })) : thin;
1192
+ }
1193
+
1129
1194
  export interface ComponentStatusDriftInput extends DriftAdapterBase {
1130
1195
  /** `chant components status [env] --json`'s rows. */
1131
1196
  rows: readonly ComponentStatusRow[];