@intentius/chant 0.124.26 → 0.124.28

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 (459) hide show
  1. package/README.md +1 -1
  2. package/dist/__golden__/wave-loop/fan-out-gated.json +8 -0
  3. package/dist/__golden__/wave-loop/fan-out-no-members.json +4 -0
  4. package/dist/__golden__/wave-loop/fan-out-only.json +6 -0
  5. package/dist/__golden__/wave-loop/op-by-apply-hold.json +2 -0
  6. package/dist/__golden__/wave-loop/op-cost-member.json +3 -0
  7. package/dist/__golden__/wave-loop/op-held-on-before-apply.json +1 -0
  8. package/dist/__golden__/wave-loop/op-held-on.json +2 -0
  9. package/dist/__golden__/wave-loop/op-hooks-held.json +2 -0
  10. package/dist/__golden__/wave-loop/op-hooks-hold-before-apply.json +2 -0
  11. package/dist/__golden__/wave-loop/op-hooks-refused-at-base.json +3 -0
  12. package/dist/__golden__/wave-loop/op-hooks-share.json +3 -0
  13. package/dist/__golden__/wave-loop/op-per-run.json +7 -0
  14. package/dist/__golden__/wave-loop/op-pr-review.json +7 -0
  15. package/dist/__golden__/wave-loop/op-sealed.json +3 -0
  16. package/dist/__golden__/wave-loop/op-spend.json +3 -0
  17. package/dist/__golden__/wave-loop/op-wave-commands.json +7 -0
  18. package/dist/__golden__/wave-loop/op-wide-waiting.json +4 -0
  19. package/dist/change-set-graph.d.ts +56 -0
  20. package/dist/change-set-graph.d.ts.map +1 -0
  21. package/dist/change-set-graph.js +128 -0
  22. package/dist/change-set.d.ts +52 -3
  23. package/dist/change-set.d.ts.map +1 -1
  24. package/dist/change-set.js +35 -4
  25. package/dist/chant-version.d.ts +9 -0
  26. package/dist/chant-version.d.ts.map +1 -0
  27. package/dist/chant-version.js +16 -0
  28. package/dist/cli/commands/build.d.ts +8 -0
  29. package/dist/cli/commands/build.d.ts.map +1 -1
  30. package/dist/cli/commands/build.js +9 -8
  31. package/dist/cli/commands/check-lexicon-docs.d.ts.map +1 -1
  32. package/dist/cli/commands/check-lexicon-docs.js +30 -2
  33. package/dist/cli/commands/check-lexicon.d.ts.map +1 -1
  34. package/dist/cli/commands/check-lexicon.js +13 -2
  35. package/dist/cli/commands/init-lexicon/templates/docs.d.ts +4 -1
  36. package/dist/cli/commands/init-lexicon/templates/docs.d.ts.map +1 -1
  37. package/dist/cli/commands/init-lexicon/templates/docs.js +6 -6
  38. package/dist/cli/commands/init-lexicon.d.ts.map +1 -1
  39. package/dist/cli/commands/init-lexicon.js +17 -8
  40. package/dist/cli/handlers/approve.d.ts.map +1 -1
  41. package/dist/cli/handlers/approve.js +19 -4
  42. package/dist/cli/handlers/build.d.ts.map +1 -1
  43. package/dist/cli/handlers/build.js +28 -0
  44. package/dist/cli/handlers/change-set.d.ts +10 -0
  45. package/dist/cli/handlers/change-set.d.ts.map +1 -1
  46. package/dist/cli/handlers/change-set.js +51 -1
  47. package/dist/cli/handlers/fan-out.d.ts +1 -1
  48. package/dist/cli/handlers/fan-out.d.ts.map +1 -1
  49. package/dist/cli/handlers/fan-out.js +14 -3
  50. package/dist/cli/handlers/pr.d.ts +8 -2
  51. package/dist/cli/handlers/pr.d.ts.map +1 -1
  52. package/dist/cli/handlers/pr.js +148 -24
  53. package/dist/cli/handlers/promote.d.ts.map +1 -1
  54. package/dist/cli/handlers/promote.js +256 -21
  55. package/dist/cli/handlers/release.d.ts +34 -0
  56. package/dist/cli/handlers/release.d.ts.map +1 -0
  57. package/dist/cli/handlers/release.js +203 -0
  58. package/dist/cli/handlers/run.d.ts +28 -2
  59. package/dist/cli/handlers/run.d.ts.map +1 -1
  60. package/dist/cli/handlers/run.js +170 -13
  61. package/dist/cli/main.d.ts.map +1 -1
  62. package/dist/cli/main.js +88 -13
  63. package/dist/cli/mcp/workspace-tools.js +1 -1
  64. package/dist/cli/parse-args.d.ts.map +1 -1
  65. package/dist/cli/parse-args.js +49 -3
  66. package/dist/cli/registry.d.ts +29 -3
  67. package/dist/cli/registry.d.ts.map +1 -1
  68. package/dist/cli/run-events.d.ts +29 -0
  69. package/dist/cli/run-events.d.ts.map +1 -0
  70. package/dist/cli/run-events.js +47 -0
  71. package/dist/cli/version.d.ts +3 -5
  72. package/dist/cli/version.d.ts.map +1 -1
  73. package/dist/cli/version.js +3 -13
  74. package/dist/codegen/docs-in-site.d.ts +71 -0
  75. package/dist/codegen/docs-in-site.d.ts.map +1 -0
  76. package/dist/codegen/docs-in-site.js +177 -0
  77. package/dist/codegen/docs-types.d.ts +14 -1
  78. package/dist/codegen/docs-types.d.ts.map +1 -1
  79. package/dist/codegen/docs.d.ts +18 -1
  80. package/dist/codegen/docs.d.ts.map +1 -1
  81. package/dist/codegen/docs.js +40 -7
  82. package/dist/codegen/rehype-base-url.mjs +15 -9
  83. package/dist/components/auto-release.d.ts +4 -1
  84. package/dist/components/auto-release.d.ts.map +1 -1
  85. package/dist/components/auto-release.js +2 -0
  86. package/dist/components/cli-support.d.ts +6 -0
  87. package/dist/components/cli-support.d.ts.map +1 -1
  88. package/dist/components/cli-support.js +10 -9
  89. package/dist/components/driver.d.ts +42 -9
  90. package/dist/components/driver.d.ts.map +1 -1
  91. package/dist/components/driver.js +81 -54
  92. package/dist/components/fan-out-run.d.ts +7 -0
  93. package/dist/components/fan-out-run.d.ts.map +1 -1
  94. package/dist/components/fan-out-run.js +35 -26
  95. package/dist/components/pr-run.d.ts +11 -0
  96. package/dist/components/pr-run.d.ts.map +1 -1
  97. package/dist/components/pr-run.js +20 -1
  98. package/dist/components/promote-order.d.ts +38 -0
  99. package/dist/components/promote-order.d.ts.map +1 -0
  100. package/dist/components/promote-order.js +62 -0
  101. package/dist/components/promote.d.ts +15 -2
  102. package/dist/components/promote.d.ts.map +1 -1
  103. package/dist/components/promote.js +17 -0
  104. package/dist/components/release-compile.d.ts +133 -0
  105. package/dist/components/release-compile.d.ts.map +1 -0
  106. package/dist/components/release-compile.js +376 -0
  107. package/dist/components/release-gate.d.ts +125 -0
  108. package/dist/components/release-gate.d.ts.map +1 -0
  109. package/dist/components/release-gate.js +282 -0
  110. package/dist/components/release-promote.d.ts +96 -0
  111. package/dist/components/release-promote.d.ts.map +1 -0
  112. package/dist/components/release-promote.js +204 -0
  113. package/dist/components/run-progress.d.ts +7 -0
  114. package/dist/components/run-progress.d.ts.map +1 -1
  115. package/dist/components/wave-plan.d.ts +3 -1
  116. package/dist/components/wave-plan.d.ts.map +1 -1
  117. package/dist/components/wave-plan.js +1 -1
  118. package/dist/config.d.ts +7 -0
  119. package/dist/config.d.ts.map +1 -1
  120. package/dist/config.js +1 -0
  121. package/dist/index.d.ts +1 -0
  122. package/dist/index.d.ts.map +1 -1
  123. package/dist/index.js +2 -0
  124. package/dist/lifecycle/change-set-store.d.ts +67 -0
  125. package/dist/lifecycle/change-set-store.d.ts.map +1 -0
  126. package/dist/lifecycle/change-set-store.js +96 -0
  127. package/dist/lifecycle/commit-sha.d.ts +13 -0
  128. package/dist/lifecycle/commit-sha.d.ts.map +1 -0
  129. package/dist/lifecycle/commit-sha.js +21 -0
  130. package/dist/lifecycle/gate-change-set.d.ts +69 -0
  131. package/dist/lifecycle/gate-change-set.d.ts.map +1 -0
  132. package/dist/lifecycle/gate-change-set.js +106 -0
  133. package/dist/lifecycle/gate-ledger.d.ts +49 -1
  134. package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
  135. package/dist/lifecycle/gate-ledger.js +18 -0
  136. package/dist/lifecycle/release-cut.d.ts +107 -0
  137. package/dist/lifecycle/release-cut.d.ts.map +1 -0
  138. package/dist/lifecycle/release-cut.js +273 -0
  139. package/dist/lifecycle/release-ledger.d.ts +54 -0
  140. package/dist/lifecycle/release-ledger.d.ts.map +1 -1
  141. package/dist/lifecycle/release-ledger.js +53 -20
  142. package/dist/lifecycle/release-store.d.ts +190 -0
  143. package/dist/lifecycle/release-store.d.ts.map +1 -0
  144. package/dist/lifecycle/release-store.js +318 -0
  145. package/dist/lifecycle/run-ledger.d.ts +4 -0
  146. package/dist/lifecycle/run-ledger.d.ts.map +1 -1
  147. package/dist/lifecycle/run-ledger.js +2 -0
  148. package/dist/op/activities/change-coverage.d.ts.map +1 -1
  149. package/dist/op/activities/change-coverage.js +4 -2
  150. package/dist/op/activities/source-release.d.ts.map +1 -1
  151. package/dist/op/activities/source-release.js +7 -3
  152. package/dist/op/activities/source-rollback.d.ts.map +1 -1
  153. package/dist/op/activities/source-rollback.js +7 -3
  154. package/dist/op/activity-registry.d.ts +6 -3
  155. package/dist/op/activity-registry.d.ts.map +1 -1
  156. package/dist/op/activity-registry.js +7 -5
  157. package/dist/op/discover.d.ts.map +1 -1
  158. package/dist/op/discover.js +14 -7
  159. package/dist/op/gate-name.d.ts +11 -2
  160. package/dist/op/gate-name.d.ts.map +1 -1
  161. package/dist/op/gate-name.js +12 -3
  162. package/dist/op/gate-run-locator.d.ts +22 -0
  163. package/dist/op/gate-run-locator.d.ts.map +1 -1
  164. package/dist/op/gate-run-locator.js +31 -0
  165. package/dist/op/gate.d.ts +27 -3
  166. package/dist/op/gate.d.ts.map +1 -1
  167. package/dist/op/gate.js +57 -3
  168. package/dist/op/local-executor.d.ts +36 -1
  169. package/dist/op/local-executor.d.ts.map +1 -1
  170. package/dist/op/local-executor.js +158 -52
  171. package/dist/op/op-waves-run.d.ts.map +1 -1
  172. package/dist/op/op-waves-run.js +4 -0
  173. package/dist/op/run-live.d.ts +2 -0
  174. package/dist/op/run-live.d.ts.map +1 -1
  175. package/dist/op/run-live.js +1 -1
  176. package/dist/op/runtime.d.ts +46 -0
  177. package/dist/op/runtime.d.ts.map +1 -1
  178. package/dist/op/runtimes/local.d.ts.map +1 -1
  179. package/dist/op/runtimes/local.js +12 -2
  180. package/dist/point-decision.d.ts +2 -0
  181. package/dist/point-decision.d.ts.map +1 -1
  182. package/dist/point-decision.js +9 -2
  183. package/dist/run-event-store.d.ts +77 -0
  184. package/dist/run-event-store.d.ts.map +1 -0
  185. package/dist/run-event-store.js +204 -0
  186. package/dist/run-event-stream.d.ts +132 -0
  187. package/dist/run-event-stream.d.ts.map +1 -0
  188. package/dist/run-event-stream.js +238 -0
  189. package/dist/run-event.d.ts +267 -0
  190. package/dist/run-event.d.ts.map +1 -0
  191. package/dist/run-event.js +207 -0
  192. package/dist/wave-runtime.mjs +225 -242
  193. package/dist/workspace/__fixtures__/run-event-check.d.ts +19 -0
  194. package/dist/workspace/__fixtures__/run-event-check.d.ts.map +1 -0
  195. package/dist/workspace/__fixtures__/run-event-check.js +59 -0
  196. package/dist/workspace/change-set-show.d.ts +56 -0
  197. package/dist/workspace/change-set-show.d.ts.map +1 -0
  198. package/dist/workspace/change-set-show.js +54 -0
  199. package/dist/workspace/change-set-show.schema.json +102 -0
  200. package/dist/workspace/change-set.schema.json +28 -1
  201. package/dist/workspace/changes-cli.d.ts.map +1 -1
  202. package/dist/workspace/changes-cli.js +10 -1
  203. package/dist/workspace/changes.d.ts +37 -0
  204. package/dist/workspace/changes.d.ts.map +1 -1
  205. package/dist/workspace/changes.js +49 -2
  206. package/dist/workspace/changes.schema.json +135 -0
  207. package/dist/workspace/ci-green-cli.d.ts +19 -4
  208. package/dist/workspace/ci-green-cli.d.ts.map +1 -1
  209. package/dist/workspace/ci-green-cli.js +75 -12
  210. package/dist/workspace/ci-green-forge.d.ts +20 -3
  211. package/dist/workspace/ci-green-forge.d.ts.map +1 -1
  212. package/dist/workspace/ci-green-forge.js +6 -4
  213. package/dist/workspace/ci-green-workflow.d.ts +11 -0
  214. package/dist/workspace/ci-green-workflow.d.ts.map +1 -1
  215. package/dist/workspace/ci-green-workflow.js +6 -0
  216. package/dist/workspace/ci-green.d.ts +273 -13
  217. package/dist/workspace/ci-green.d.ts.map +1 -1
  218. package/dist/workspace/ci-green.js +449 -38
  219. package/dist/workspace/ci-last-green.schema.json +32 -2
  220. package/dist/workspace/ci-list.schema.json +525 -0
  221. package/dist/workspace/commit-links.d.ts +85 -0
  222. package/dist/workspace/commit-links.d.ts.map +1 -0
  223. package/dist/workspace/commit-links.js +163 -0
  224. package/dist/workspace/declaration.d.ts +19 -0
  225. package/dist/workspace/declaration.d.ts.map +1 -1
  226. package/dist/workspace/declaration.js +1 -1
  227. package/dist/workspace/declaration.schema.json +12 -0
  228. package/dist/workspace/identity-gate-rule.d.ts +37 -0
  229. package/dist/workspace/identity-gate-rule.d.ts.map +1 -1
  230. package/dist/workspace/identity-gate-rule.js +72 -7
  231. package/dist/workspace/identity.d.ts +12 -0
  232. package/dist/workspace/identity.d.ts.map +1 -1
  233. package/dist/workspace/identity.js +13 -1
  234. package/dist/workspace/intent.d.ts +6 -1
  235. package/dist/workspace/intent.d.ts.map +1 -1
  236. package/dist/workspace/intent.js +51 -1
  237. package/dist/workspace/ls.d.ts +4 -0
  238. package/dist/workspace/ls.d.ts.map +1 -1
  239. package/dist/workspace/ls.js +2 -0
  240. package/dist/workspace/ls.schema.json +3 -1
  241. package/dist/workspace/member-pipeline.d.ts +6 -0
  242. package/dist/workspace/member-pipeline.d.ts.map +1 -1
  243. package/dist/workspace/member-pipeline.js +6 -0
  244. package/dist/workspace/promotion-order.d.ts +41 -0
  245. package/dist/workspace/promotion-order.d.ts.map +1 -0
  246. package/dist/workspace/promotion-order.js +95 -0
  247. package/dist/workspace/reason-codes.d.ts +2 -0
  248. package/dist/workspace/reason-codes.d.ts.map +1 -1
  249. package/dist/workspace/reason-codes.js +4 -1
  250. package/dist/workspace/releases.d.ts +72 -0
  251. package/dist/workspace/releases.d.ts.map +1 -0
  252. package/dist/workspace/releases.js +94 -0
  253. package/dist/workspace/releases.schema.json +391 -0
  254. package/dist/workspace/run-event.schema.json +288 -0
  255. package/dist/workspace/status-gates.d.ts +26 -1
  256. package/dist/workspace/status-gates.d.ts.map +1 -1
  257. package/dist/workspace/status-gates.js +31 -2
  258. package/dist/workspace/status-stewards.d.ts +4 -0
  259. package/dist/workspace/status-stewards.d.ts.map +1 -1
  260. package/dist/workspace/status-stewards.js +2 -0
  261. package/dist/workspace/status.d.ts +39 -0
  262. package/dist/workspace/status.d.ts.map +1 -1
  263. package/dist/workspace/status.js +48 -1
  264. package/dist/workspace/status.schema.json +70 -1
  265. package/dist/workspace/trust/ci-tag-statement.d.ts +102 -0
  266. package/dist/workspace/trust/ci-tag-statement.d.ts.map +1 -0
  267. package/dist/workspace/trust/ci-tag-statement.js +123 -0
  268. package/dist/workspace/trust/op-run-statement.d.ts +91 -0
  269. package/dist/workspace/trust/op-run-statement.d.ts.map +1 -0
  270. package/dist/workspace/trust/op-run-statement.js +143 -0
  271. package/dist/workspace/trust/rotation.d.ts +18 -2
  272. package/dist/workspace/trust/rotation.d.ts.map +1 -1
  273. package/dist/workspace/trust/rotation.js +65 -16
  274. package/dist/workspace/trust/seal.d.ts +11 -0
  275. package/dist/workspace/trust/seal.d.ts.map +1 -1
  276. package/dist/workspace/trust/seal.js +9 -0
  277. package/dist/workspace/trust/ssh-commit.d.ts.map +1 -1
  278. package/dist/workspace/trust/ssh-commit.js +10 -10
  279. package/package.json +1 -1
  280. package/src/__golden__/wave-loop/fan-out-gated.json +8 -0
  281. package/src/__golden__/wave-loop/fan-out-no-members.json +4 -0
  282. package/src/__golden__/wave-loop/fan-out-only.json +6 -0
  283. package/src/__golden__/wave-loop/op-by-apply-hold.json +2 -0
  284. package/src/__golden__/wave-loop/op-cost-member.json +3 -0
  285. package/src/__golden__/wave-loop/op-held-on-before-apply.json +1 -0
  286. package/src/__golden__/wave-loop/op-held-on.json +2 -0
  287. package/src/__golden__/wave-loop/op-hooks-held.json +2 -0
  288. package/src/__golden__/wave-loop/op-hooks-hold-before-apply.json +2 -0
  289. package/src/__golden__/wave-loop/op-hooks-refused-at-base.json +3 -0
  290. package/src/__golden__/wave-loop/op-hooks-share.json +3 -0
  291. package/src/__golden__/wave-loop/op-per-run.json +7 -0
  292. package/src/__golden__/wave-loop/op-pr-review.json +7 -0
  293. package/src/__golden__/wave-loop/op-sealed.json +3 -0
  294. package/src/__golden__/wave-loop/op-spend.json +3 -0
  295. package/src/__golden__/wave-loop/op-wave-commands.json +7 -0
  296. package/src/__golden__/wave-loop/op-wide-waiting.json +4 -0
  297. package/src/change-set-graph.test.ts +72 -0
  298. package/src/change-set-graph.ts +133 -0
  299. package/src/change-set.ts +76 -6
  300. package/src/chant-version.ts +16 -0
  301. package/src/cli/commands/build.ts +19 -8
  302. package/src/cli/commands/check-lexicon-docs.test.ts +51 -0
  303. package/src/cli/commands/check-lexicon-docs.ts +39 -2
  304. package/src/cli/commands/check-lexicon.ts +14 -2
  305. package/src/cli/commands/init-lexicon/templates/docs.ts +7 -6
  306. package/src/cli/commands/init-lexicon.test.ts +25 -0
  307. package/src/cli/commands/init-lexicon.ts +18 -8
  308. package/src/cli/compiled-cli.e2e.test.ts +31 -6
  309. package/src/cli/handlers/approve-release.test.ts +80 -0
  310. package/src/cli/handlers/approve.ts +18 -2
  311. package/src/cli/handlers/build.test.ts +52 -0
  312. package/src/cli/handlers/build.ts +29 -0
  313. package/src/cli/handlers/change-set.ts +49 -1
  314. package/src/cli/handlers/fan-out.test.ts +48 -0
  315. package/src/cli/handlers/fan-out.ts +15 -3
  316. package/src/cli/handlers/operator.test.ts +37 -0
  317. package/src/cli/handlers/pr.test.ts +194 -0
  318. package/src/cli/handlers/pr.ts +168 -34
  319. package/src/cli/handlers/promote.test.ts +389 -5
  320. package/src/cli/handlers/promote.ts +279 -20
  321. package/src/cli/handlers/release-implicit.e2e.test.ts +153 -0
  322. package/src/cli/handlers/release.e2e.test.ts +85 -0
  323. package/src/cli/handlers/release.ts +206 -0
  324. package/src/cli/handlers/run-auto-release.test.ts +71 -0
  325. package/src/cli/handlers/run-events-cmd.test.ts +92 -0
  326. package/src/cli/handlers/run.test.ts +30 -0
  327. package/src/cli/handlers/run.ts +176 -15
  328. package/src/cli/main.test.ts +7 -0
  329. package/src/cli/main.ts +88 -13
  330. package/src/cli/mcp/never-over-mcp.test.ts +2 -0
  331. package/src/cli/mcp/workspace-tools.ts +1 -1
  332. package/src/cli/parse-args.ts +37 -3
  333. package/src/cli/registry.ts +29 -3
  334. package/src/cli/run-events.ts +54 -0
  335. package/src/cli/version.ts +3 -13
  336. package/src/codegen/docs-in-site.test.ts +166 -0
  337. package/src/codegen/docs-in-site.ts +182 -0
  338. package/src/codegen/docs-site/AgentPrompt.astro +26 -1
  339. package/src/codegen/docs-types.ts +14 -1
  340. package/src/codegen/docs.ts +60 -7
  341. package/src/codegen/rehype-base-url.d.mts +3 -1
  342. package/src/codegen/rehype-base-url.mjs +15 -9
  343. package/src/codegen/rehype-base-url.test.ts +34 -0
  344. package/src/components/auto-release.test.ts +21 -0
  345. package/src/components/auto-release.ts +6 -1
  346. package/src/components/cli-support.test.ts +82 -0
  347. package/src/components/cli-support.ts +16 -9
  348. package/src/components/driver.ts +129 -56
  349. package/src/components/fan-out-run.ts +56 -35
  350. package/src/components/pr-run.ts +30 -1
  351. package/src/components/promote-order.test.ts +90 -0
  352. package/src/components/promote-order.ts +75 -0
  353. package/src/components/promote.test.ts +10 -1
  354. package/src/components/promote.ts +26 -1
  355. package/src/components/release-compile.test.ts +147 -0
  356. package/src/components/release-compile.ts +445 -0
  357. package/src/components/release-gate.test.ts +215 -0
  358. package/src/components/release-gate.ts +341 -0
  359. package/src/components/release-promote.test.ts +159 -0
  360. package/src/components/release-promote.ts +232 -0
  361. package/src/components/run-progress.ts +7 -0
  362. package/src/components/wave-plan.ts +1 -1
  363. package/src/config.ts +7 -1
  364. package/src/index.ts +2 -0
  365. package/src/lifecycle/change-set-store.test.ts +217 -0
  366. package/src/lifecycle/change-set-store.ts +112 -0
  367. package/src/lifecycle/commit-sha.ts +23 -0
  368. package/src/lifecycle/gate-change-set.e2e.test.ts +122 -0
  369. package/src/lifecycle/gate-change-set.ts +133 -0
  370. package/src/lifecycle/gate-ledger.test.ts +33 -0
  371. package/src/lifecycle/gate-ledger.ts +66 -1
  372. package/src/lifecycle/release-cut-signed.test.ts +180 -0
  373. package/src/lifecycle/release-cut.test.ts +411 -0
  374. package/src/lifecycle/release-cut.ts +367 -0
  375. package/src/lifecycle/release-ledger.test.ts +14 -0
  376. package/src/lifecycle/release-ledger.ts +85 -17
  377. package/src/lifecycle/release-store.ts +423 -0
  378. package/src/lifecycle/run-ledger.test.ts +10 -0
  379. package/src/lifecycle/run-ledger.ts +6 -0
  380. package/src/op/activities/change-coverage.ts +4 -1
  381. package/src/op/activities/source-release.ts +8 -3
  382. package/src/op/activities/source-rollback.ts +8 -4
  383. package/src/op/activity-registry.ts +7 -5
  384. package/src/op/commit-run-gate-deploy-join.test.ts +117 -0
  385. package/src/op/discover-root.test.ts +39 -0
  386. package/src/op/discover.ts +15 -8
  387. package/src/op/gate-name.ts +13 -3
  388. package/src/op/gate-release.test.ts +126 -0
  389. package/src/op/gate-run-locator.test.ts +110 -0
  390. package/src/op/gate-run-locator.ts +35 -0
  391. package/src/op/gate.ts +88 -6
  392. package/src/op/local-executor.ts +207 -52
  393. package/src/op/op-waves-run.ts +4 -0
  394. package/src/op/run-events.test.ts +166 -0
  395. package/src/op/run-live.ts +1 -1
  396. package/src/op/runtime.ts +39 -0
  397. package/src/op/runtimes/local.test.ts +16 -0
  398. package/src/op/runtimes/local.ts +13 -2
  399. package/src/point-decision.ts +12 -2
  400. package/src/run-event-store.test.ts +144 -0
  401. package/src/run-event-store.ts +213 -0
  402. package/src/run-event-stream.test.ts +175 -0
  403. package/src/run-event-stream.ts +306 -0
  404. package/src/run-event.test.ts +277 -0
  405. package/src/run-event.ts +451 -0
  406. package/src/wave-loop-golden.test.ts +9 -0
  407. package/src/workspace/__fixtures__/run-event-check.ts +58 -0
  408. package/src/workspace/ancestry-index.test.ts +93 -0
  409. package/src/workspace/change-set-show.schema.json +102 -0
  410. package/src/workspace/change-set-show.ts +72 -0
  411. package/src/workspace/change-set.schema.json +28 -1
  412. package/src/workspace/changes-cli.ts +10 -1
  413. package/src/workspace/changes.schema.json +135 -0
  414. package/src/workspace/changes.test.ts +1 -1
  415. package/src/workspace/changes.ts +84 -2
  416. package/src/workspace/ci-green-cli.ts +75 -13
  417. package/src/workspace/ci-green-forge.ts +24 -4
  418. package/src/workspace/ci-green-runs.test.ts +242 -0
  419. package/src/workspace/ci-green-signed.test.ts +302 -0
  420. package/src/workspace/ci-green-workflow.test.ts +16 -0
  421. package/src/workspace/ci-green-workflow.ts +12 -0
  422. package/src/workspace/ci-green.test.ts +131 -2
  423. package/src/workspace/ci-green.ts +624 -42
  424. package/src/workspace/ci-last-green.schema.json +32 -2
  425. package/src/workspace/ci-list.schema.json +525 -0
  426. package/src/workspace/commit-links.test.ts +279 -0
  427. package/src/workspace/commit-links.ts +183 -0
  428. package/src/workspace/declaration.schema.json +12 -0
  429. package/src/workspace/declaration.ts +22 -2
  430. package/src/workspace/identity-gate-rule.ts +91 -7
  431. package/src/workspace/identity.ts +14 -1
  432. package/src/workspace/intent.ts +48 -1
  433. package/src/workspace/ls.schema.json +3 -1
  434. package/src/workspace/ls.ts +6 -0
  435. package/src/workspace/member-pipeline.test.ts +17 -0
  436. package/src/workspace/member-pipeline.ts +9 -0
  437. package/src/workspace/promotion-order.ts +97 -0
  438. package/src/workspace/read-contract.e2e.test.ts +4 -1
  439. package/src/workspace/reason-codes.test.ts +2 -1
  440. package/src/workspace/reason-codes.ts +4 -1
  441. package/src/workspace/releases.schema.json +391 -0
  442. package/src/workspace/releases.test.ts +108 -0
  443. package/src/workspace/releases.ts +122 -0
  444. package/src/workspace/run-event.schema.json +288 -0
  445. package/src/workspace/status-contract.test.ts +52 -1
  446. package/src/workspace/status-gates.ts +56 -1
  447. package/src/workspace/status-stewards.ts +6 -0
  448. package/src/workspace/status.schema.json +70 -1
  449. package/src/workspace/status.ts +80 -1
  450. package/src/workspace/trust/ci-tag-statement.ts +151 -0
  451. package/src/workspace/trust/op-run-statement.ts +148 -0
  452. package/src/workspace/trust/rotation.ts +61 -14
  453. package/src/workspace/trust/seal.ts +10 -0
  454. package/src/workspace/trust/ssh-commit.ts +10 -9
  455. package/src/cli/commands/__fixtures__/init-lexicon-output/docs/astro.config.mjs +0 -14
  456. package/src/cli/commands/__fixtures__/init-lexicon-output/docs/package.json +0 -16
  457. package/src/cli/commands/__fixtures__/init-lexicon-output/docs/src/content/docs/index.mdx +0 -8
  458. package/src/cli/commands/__fixtures__/init-lexicon-output/docs/src/content.config.ts +0 -15
  459. package/src/cli/commands/__fixtures__/init-lexicon-output/docs/tsconfig.json +0 -10
@@ -0,0 +1,62 @@
1
+ /**
2
+ * The environment `chant components promote` reads from, given the member's
3
+ * promotion order (#4030, see `../workspace/promotion-order.ts`). These
4
+ * refusals are promote's own and are not codes of the workspace read contract.
5
+ */
6
+ /** The refusals `components promote` gives for the declared order. Stable: scripts may match on them. */
7
+ export const PROMOTE_ORDER_CODES = [
8
+ /** `--from` is more than one step behind `--to` in the declared order, and `--allow-skip` was not given. */
9
+ "promote-skips-environment",
10
+ /** `--to` is the first step of the declared order, so no environment comes before it to default `--from` to. */
11
+ "promote-no-previous-environment",
12
+ /** `--from` was left out and `--to` is not a step of the declared order, so there is nothing to default it from. */
13
+ "promote-to-not-in-order",
14
+ ];
15
+ /**
16
+ * The environment a promote reads from. With an order declared, `--from`
17
+ * defaults to the step before `to`, and a `--from` that skips a step is
18
+ * refused unless `allowSkip`. Without an order, or when `to` or `from` is not
19
+ * a step of it, the order has nothing to say and `from` is returned as given
20
+ * (`undefined` is the caller's to refuse, as before).
21
+ */
22
+ export function resolvePromotionSource(opts) {
23
+ const { order, to, from, allowSkip } = opts;
24
+ const names = order.map((s) => s.name);
25
+ const list = names.join(", ");
26
+ const toAt = names.indexOf(to);
27
+ if (from === undefined) {
28
+ if (order.length === 0)
29
+ return { from: undefined };
30
+ if (toAt < 0) {
31
+ return {
32
+ error: {
33
+ code: "promote-to-not-in-order",
34
+ message: `--from was not given, and "${to}" is not a step of the declared promotion order (${list})`,
35
+ fix: `Pass --from <env>, or add "${to}" to the environments array of this member's chant.config.ts.`,
36
+ },
37
+ };
38
+ }
39
+ if (toAt === 0) {
40
+ return {
41
+ error: {
42
+ code: "promote-no-previous-environment",
43
+ message: `"${to}" is the first step of the declared promotion order (${list}), so there is no environment to promote from`,
44
+ fix: `Deploy "${to}" with chant run --env ${to}, or pass --from <env> to promote from an environment outside the order.`,
45
+ },
46
+ };
47
+ }
48
+ return { from: names[toAt - 1] };
49
+ }
50
+ const fromAt = names.indexOf(from);
51
+ if (toAt >= 0 && fromAt >= 0 && fromAt < toAt - 1 && !allowSkip) {
52
+ const skipped = names.slice(fromAt + 1, toAt);
53
+ return {
54
+ error: {
55
+ code: "promote-skips-environment",
56
+ message: `promoting ${from} to ${to} skips ${skipped.join(", ")} in the declared promotion order (${list})`,
57
+ fix: `Promote to ${skipped[0]} first, or pass --allow-skip to promote ${from} to ${to} anyway.`,
58
+ },
59
+ };
60
+ }
61
+ return { from };
62
+ }
@@ -37,11 +37,12 @@
37
37
  * The driver stays capability-agnostic. The two kind lists below are data, in
38
38
  * the same spirit as `DEPLOY_UNIT_RULES` (./deploy-units.ts).
39
39
  */
40
- import { type ReleaseRecord, type ReleaseRecordInput, type RunOrigin } from "../lifecycle/release-ledger.js";
40
+ import { type ReleaseRecord, type ReleaseRecordInput, type ReleaseAdmission, type RunOrigin } from "../lifecycle/release-ledger.js";
41
41
  import { CapabilityRegistry, type Capability } from "./capability.js";
42
- import { type DriverComponent, type DriverComponentResult, type DriverRunResult } from "./driver.js";
42
+ import { type DriverComponent, type DriverComponentResult, type ReleaseGateBinding, type DriverRunResult } from "./driver.js";
43
43
  import type { GateLedgerPort } from "../op/gate.js";
44
44
  import type { RunProgressEvent } from "./run-progress.js";
45
+ import type { RunEventSink } from "../run-event-stream.js";
45
46
  /**
46
47
  * Step kinds that produce an artifact at build time: the build family, and the
47
48
  * SBOM steps that read the freshly built archive. A promote removes them.
@@ -220,8 +221,12 @@ export interface RunPromotionOptions {
220
221
  registry: CapabilityRegistry;
221
222
  componentOutputs?: Record<string, Record<string, unknown>>;
222
223
  gates?: GateLedgerPort;
224
+ /** A promote under a release (#4045): what every gate it reaches binds. */
225
+ releaseGate?: ReleaseGateBinding;
223
226
  now?: string;
224
227
  onProgress?: (event: RunProgressEvent) => void;
228
+ /** Where the run's events go (#4041, `--events-json`). */
229
+ onRunEvent?: RunEventSink;
225
230
  }
226
231
  /**
227
232
  * Deploy the plan's components to `plan.to`, in dependency order. A
@@ -233,6 +238,12 @@ export interface RunPromotionOptions {
233
238
  export declare function runPromotion(options: RunPromotionOptions): Promise<DriverRunResult>;
234
239
  /** Who approved the last gate a component passed in this run, if any. */
235
240
  export declare function gateApprover(result: DriverComponentResult | undefined): string | undefined;
241
+ /**
242
+ * The gate resolution that admitted a component's last gate in this run (#4020):
243
+ * which gate, in the component's gate ledger, and when the resolution was
244
+ * recorded. Undefined for a component that passed no gate.
245
+ */
246
+ export declare function gateAdmission(result: DriverComponentResult | undefined): ReleaseAdmission | undefined;
236
247
  /** What a promote, rollback or redeploy knows about its own run, for the records it writes. */
237
248
  export interface DeployRunInfo {
238
249
  runId: string;
@@ -240,6 +251,8 @@ export interface DeployRunInfo {
240
251
  actor: string;
241
252
  timestamp: string;
242
253
  approver?: string;
254
+ /** The gate resolution that admitted the deploy (#4020), from {@link gateAdmission}. */
255
+ admission?: ReleaseAdmission;
243
256
  }
244
257
  /**
245
258
  * The release record a successful promotion appends to the target ledger.
@@ -1 +1 @@
1
- {"version":3,"file":"promote.d.ts","sourceRoot":"","sources":["../../src/components/promote.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAGH,OAAO,EAAsB,KAAK,aAAa,EAAE,KAAK,kBAAkB,EAAE,KAAK,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC9H,OAAO,EAAE,kBAAkB,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAG1B,KAAK,eAAe,EAErB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,g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M,CAAC;IACd,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wFAAwF;IACxF,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAC9B;AA0BD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,GAAG,kBAAkB,CAEvG;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,GAAG,kBAAkB,CAEvG;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,GAAG,kBAAkB,CAEvG"}
@@ -481,7 +481,9 @@ export async function runPromotion(options) {
481
481
  return item ? { version: item.digest, revision: item.source.gitSha } : undefined;
482
482
  },
483
483
  ...(options.onProgress ? { onProgress: options.onProgress } : {}),
484
+ ...(options.onRunEvent ? { onRunEvent: options.onRunEvent } : {}),
484
485
  ...(options.gates ? { gates: options.gates } : {}),
486
+ ...(options.releaseGate ? { releaseGate: options.releaseGate } : {}),
485
487
  ...(options.now ? { now: options.now } : {}),
486
488
  });
487
489
  }
@@ -500,6 +502,20 @@ export function gateApprover(result) {
500
502
  }
501
503
  return approver;
502
504
  }
505
+ /**
506
+ * The gate resolution that admitted a component's last gate in this run (#4020):
507
+ * which gate, in the component's gate ledger, and when the resolution was
508
+ * recorded. Undefined for a component that passed no gate.
509
+ */
510
+ export function gateAdmission(result) {
511
+ let admission;
512
+ for (const record of result?.records ?? []) {
513
+ // #4045: a release gate's resolution is in the release gate's ledger, not the component's.
514
+ if (record.approval)
515
+ admission = { op: record.approval.op ?? result.component, gate: record.approval.gate, resolvedAt: record.approval.timestamp };
516
+ }
517
+ return admission;
518
+ }
503
519
  /** The fields a promote, a rollback and a redeploy record share: the artifact is the earlier release's own. */
504
520
  function sharedRecord(item, env, run) {
505
521
  const { source } = item;
@@ -513,6 +529,7 @@ function sharedRecord(item, env, run) {
513
529
  timestamp: run.timestamp,
514
530
  actor: run.actor,
515
531
  ...(run.approver ? { approver: run.approver } : {}),
532
+ ...(run.admission ? { admission: run.admission } : {}),
516
533
  ...(source.manifestDigest ? { manifestDigest: source.manifestDigest } : {}),
517
534
  ...(source.inputDigest ? { inputDigest: source.inputDigest } : {}),
518
535
  };
@@ -0,0 +1,133 @@
1
+ /**
2
+ * Compiling a release (#4026, ws-104 question 5): what one environment
3
+ * compiles to, and the artifacts built once.
4
+ *
5
+ * A template is synthesized for one environment per invocation: `--env` sets
6
+ * `CHANT_ENV` before the project is imported, and `*.component.ts` files are
7
+ * imported with a plain `import()`, which caches the module. So each
8
+ * environment is compiled in a child process of its own
9
+ * ({@link spawnTargetCompiler}), running `chant release compile --env <env>`,
10
+ * which calls {@link compileEnvironment} in that process and prints the
11
+ * result as JSON. The artifacts are built in one more child, for the first
12
+ * environment in which each component is enabled ({@link buildReleaseArtifacts}).
13
+ *
14
+ * What counts as a template is data, as the build and publish kinds are in
15
+ * ./promote.ts: a literal path in a deploy step's `template`, `manifest` or
16
+ * `values` field ({@link TEMPLATE_FIELDS}), read after the environment's build
17
+ * command has run. A path with the `archive:` prefix names the file after it.
18
+ * A path that names a directory, such as a chart, is not a template.
19
+ *
20
+ * A project with no components (#4046) is compiled the way `chant build --env
21
+ * <env> -o <output>` builds it ({@link compileBuildOutput}): every file that
22
+ * build writes is a template with `component: null`, and the target's params
23
+ * are the build's `buildParams`. The files are kept in memory rather than read
24
+ * back from disk, so a file an earlier build left behind is never recorded.
25
+ */
26
+ import { type ChantConfig } from "../config.js";
27
+ import { type DriverComponent, type DriverStep } from "./driver.js";
28
+ import type { CapabilityRegistry } from "./capability.js";
29
+ import type { ReleaseArtifact, ReleaseParam } from "../lifecycle/release-store.js";
30
+ /** The deploy step fields whose literal file paths are a component's templates. */
31
+ export declare const TEMPLATE_FIELDS: readonly string[];
32
+ /** One template a component's deploy reads, as the step names it. */
33
+ export interface TemplateRef {
34
+ component: string;
35
+ phase: string;
36
+ kind: string;
37
+ field: string;
38
+ /** The value as written in the step. */
39
+ value: string;
40
+ /** The file it names, relative to the member's directory as written (the `archive:` prefix removed). */
41
+ path: string;
42
+ }
43
+ /** A compiled template: its path and its bytes. */
44
+ export interface CompiledTemplate {
45
+ component: string | null;
46
+ path: string;
47
+ content: string;
48
+ }
49
+ /** What one environment compiles to. */
50
+ export interface CompiledTarget {
51
+ env: string;
52
+ params: ReleaseParam[];
53
+ /** The components enabled in this environment, by name. */
54
+ components: string[];
55
+ /** Each component's build-time steps, as declared for this environment, in composition order. */
56
+ buildSteps: Record<string, unknown[]>;
57
+ /** For each component, the files its build steps read, relative to the member's directory. Used to tell whether an artifact's source changed. */
58
+ buildInputs: Record<string, string[]>;
59
+ /** For each component, the file that declares it, relative to the member's directory. */
60
+ componentFiles: Record<string, string>;
61
+ templates: CompiledTemplate[];
62
+ }
63
+ /** Compiles a member for one environment, and builds its artifacts. The cut talks to a compiler only, so a test can hand it fixtures. */
64
+ export interface TargetCompiler {
65
+ compile(env: string): Promise<CompiledTarget>;
66
+ buildArtifacts(env: string, components: readonly string[]): Promise<ReleaseArtifact[]>;
67
+ }
68
+ /** The templates a component's deploy reads: literal paths in {@link TEMPLATE_FIELDS} of its steps other than build and publish steps. */
69
+ export declare function templateRefs(component: DriverComponent): TemplateRef[];
70
+ /** A component's build-time steps ({@link BUILD_STEP_KINDS}), each as declared, in composition order. */
71
+ export declare function buildStepsOf(component: DriverComponent): DriverStep[];
72
+ /** The literal paths a component's archive steps read: `docker-build`'s `context` and `dockerfile`, `zip-package`'s `source`, `jvm-build`'s `path`. */
73
+ export declare function buildInputPaths(component: DriverComponent): string[];
74
+ /** A component's composition with only its archive steps ({@link ARCHIVE_STEP_KINDS}) left, gates and every other step taken out. */
75
+ export declare function withOnlyArchiveSteps(component: DriverComponent): DriverComponent | undefined;
76
+ /** How one environment is compiled: the build command, and the parameter inputs `chant build` takes. */
77
+ export interface CompileInputs {
78
+ /** The member's directory. */
79
+ projectDir: string;
80
+ /** A shell command run in the member's directory before the templates are read, with `CHANT_ENV` set to the environment. */
81
+ buildCommand?: string;
82
+ /** `--param name=value` values, the same for every environment. */
83
+ params?: Record<string, string>;
84
+ /** `--params-file`, with `{env}` replaced by the environment's name. */
85
+ paramsFile?: string;
86
+ /** For a project with no components: the build root, relative to the member's directory. Defaults to `chant.config.ts` `sourceDir`, then the member's directory, as `chant lifecycle` resolves it. */
87
+ src?: string;
88
+ /** For a project with no components: the build's output file, relative to the member's directory, as `chant build -o` takes it. Defaults to {@link DEFAULT_BUILD_OUTPUT}. */
89
+ output?: string;
90
+ /** For a project with no components: build only this lexicon, as `chant build --lexicon` does. */
91
+ lexicon?: string;
92
+ }
93
+ /**
94
+ * Where a project with no components writes its build output when the cut
95
+ * names no `-o`. YAML, since the k8s and helm serializers write YAML whatever
96
+ * the extension, and a JSON output converts to it.
97
+ */
98
+ export declare const DEFAULT_BUILD_OUTPUT = "dist/build.yaml";
99
+ /** Thrown when an environment can't be compiled. */
100
+ export declare class ReleaseCompileError extends Error {
101
+ constructor(message: string);
102
+ }
103
+ /**
104
+ * Compile the member for `env` in this process: run the build command, resolve
105
+ * the build parameters, discover the components enabled under them, and read
106
+ * the templates their deploys name. Call it once per process, with
107
+ * `CHANT_ENV` already set to `env`, since component modules are cached.
108
+ */
109
+ export declare function compileEnvironment(inputs: CompileInputs, env: string): Promise<CompiledTarget>;
110
+ /**
111
+ * Compile a project with no components for `env` (#4046, ws-104 question 5):
112
+ * build it as `chant build <src> --env <env> -o <output>` would, and record
113
+ * each file that build writes as a template with `component: null`, by its
114
+ * path relative to the member's directory. The params are the build's own
115
+ * `buildParams`. Nothing is written to disk.
116
+ */
117
+ export declare function compileBuildOutput(inputs: CompileInputs, env: string, config: ChantConfig): Promise<CompiledTarget>;
118
+ /**
119
+ * Build the artifacts of `names` once, for `env`: run each component's archive
120
+ * steps, and nothing else, through the driver. `docker-build` gives an `image`
121
+ * entry, `zip-package` and `jvm-build` an `asset` entry, each with the path it
122
+ * wrote and its digest.
123
+ */
124
+ export declare function buildReleaseArtifacts(inputs: CompileInputs, env: string, names: readonly string[], registry?: CapabilityRegistry): Promise<ReleaseArtifact[]>;
125
+ /** How {@link spawnTargetCompiler} starts this chant. */
126
+ export declare function ownChantCommand(): string[];
127
+ /**
128
+ * The compiler the CLI uses: each environment in a child process of this same
129
+ * chant (`chant release compile --env <env> --json`), with `CHANT_ENV` set to
130
+ * that environment before anything imports the project.
131
+ */
132
+ export declare function spawnTargetCompiler(inputs: CompileInputs, command?: readonly string[]): TargetCompiler;
133
+ //# sourceMappingURL=release-compile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"release-compile.d.ts","sourceRoot":"","sources":["../../src/components/release-compile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAKH,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAO9D,OAAO,EAAwC,KAAK,eAAe,EAAqC,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAC1I,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAEhF,mFAAmF;AACnF,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EAAuC,CAAC;AAKrF,qEAAqE;AACrE,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,wGAAwG;IACxG,IAAI,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