@intentius/chant 0.124.27 → 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 (450) 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/gate-name.d.ts +11 -2
  155. package/dist/op/gate-name.d.ts.map +1 -1
  156. package/dist/op/gate-name.js +12 -3
  157. package/dist/op/gate-run-locator.d.ts +22 -0
  158. package/dist/op/gate-run-locator.d.ts.map +1 -1
  159. package/dist/op/gate-run-locator.js +31 -0
  160. package/dist/op/gate.d.ts +27 -3
  161. package/dist/op/gate.d.ts.map +1 -1
  162. package/dist/op/gate.js +57 -3
  163. package/dist/op/local-executor.d.ts +36 -1
  164. package/dist/op/local-executor.d.ts.map +1 -1
  165. package/dist/op/local-executor.js +158 -52
  166. package/dist/op/op-waves-run.d.ts.map +1 -1
  167. package/dist/op/op-waves-run.js +4 -0
  168. package/dist/op/run-live.d.ts +2 -0
  169. package/dist/op/run-live.d.ts.map +1 -1
  170. package/dist/op/run-live.js +1 -1
  171. package/dist/op/runtime.d.ts +46 -0
  172. package/dist/op/runtime.d.ts.map +1 -1
  173. package/dist/op/runtimes/local.d.ts.map +1 -1
  174. package/dist/op/runtimes/local.js +8 -0
  175. package/dist/point-decision.d.ts +2 -0
  176. package/dist/point-decision.d.ts.map +1 -1
  177. package/dist/point-decision.js +9 -2
  178. package/dist/run-event-store.d.ts +77 -0
  179. package/dist/run-event-store.d.ts.map +1 -0
  180. package/dist/run-event-store.js +204 -0
  181. package/dist/run-event-stream.d.ts +132 -0
  182. package/dist/run-event-stream.d.ts.map +1 -0
  183. package/dist/run-event-stream.js +238 -0
  184. package/dist/run-event.d.ts +267 -0
  185. package/dist/run-event.d.ts.map +1 -0
  186. package/dist/run-event.js +207 -0
  187. package/dist/wave-runtime.mjs +204 -199
  188. package/dist/workspace/__fixtures__/run-event-check.d.ts +19 -0
  189. package/dist/workspace/__fixtures__/run-event-check.d.ts.map +1 -0
  190. package/dist/workspace/__fixtures__/run-event-check.js +59 -0
  191. package/dist/workspace/change-set-show.d.ts +56 -0
  192. package/dist/workspace/change-set-show.d.ts.map +1 -0
  193. package/dist/workspace/change-set-show.js +54 -0
  194. package/dist/workspace/change-set-show.schema.json +102 -0
  195. package/dist/workspace/change-set.schema.json +28 -1
  196. package/dist/workspace/changes-cli.d.ts.map +1 -1
  197. package/dist/workspace/changes-cli.js +10 -1
  198. package/dist/workspace/changes.d.ts +37 -0
  199. package/dist/workspace/changes.d.ts.map +1 -1
  200. package/dist/workspace/changes.js +49 -2
  201. package/dist/workspace/changes.schema.json +135 -0
  202. package/dist/workspace/ci-green-cli.d.ts +19 -4
  203. package/dist/workspace/ci-green-cli.d.ts.map +1 -1
  204. package/dist/workspace/ci-green-cli.js +75 -12
  205. package/dist/workspace/ci-green-forge.d.ts +20 -3
  206. package/dist/workspace/ci-green-forge.d.ts.map +1 -1
  207. package/dist/workspace/ci-green-forge.js +6 -4
  208. package/dist/workspace/ci-green-workflow.d.ts +11 -0
  209. package/dist/workspace/ci-green-workflow.d.ts.map +1 -1
  210. package/dist/workspace/ci-green-workflow.js +6 -0
  211. package/dist/workspace/ci-green.d.ts +273 -13
  212. package/dist/workspace/ci-green.d.ts.map +1 -1
  213. package/dist/workspace/ci-green.js +449 -38
  214. package/dist/workspace/ci-last-green.schema.json +32 -2
  215. package/dist/workspace/ci-list.schema.json +525 -0
  216. package/dist/workspace/commit-links.d.ts +85 -0
  217. package/dist/workspace/commit-links.d.ts.map +1 -0
  218. package/dist/workspace/commit-links.js +163 -0
  219. package/dist/workspace/declaration.d.ts +19 -0
  220. package/dist/workspace/declaration.d.ts.map +1 -1
  221. package/dist/workspace/declaration.js +1 -1
  222. package/dist/workspace/declaration.schema.json +12 -0
  223. package/dist/workspace/identity-gate-rule.d.ts +37 -0
  224. package/dist/workspace/identity-gate-rule.d.ts.map +1 -1
  225. package/dist/workspace/identity-gate-rule.js +72 -7
  226. package/dist/workspace/identity.d.ts +12 -0
  227. package/dist/workspace/identity.d.ts.map +1 -1
  228. package/dist/workspace/identity.js +13 -1
  229. package/dist/workspace/intent.d.ts +6 -1
  230. package/dist/workspace/intent.d.ts.map +1 -1
  231. package/dist/workspace/intent.js +51 -1
  232. package/dist/workspace/ls.d.ts +4 -0
  233. package/dist/workspace/ls.d.ts.map +1 -1
  234. package/dist/workspace/ls.js +2 -0
  235. package/dist/workspace/ls.schema.json +3 -1
  236. package/dist/workspace/member-pipeline.d.ts +6 -0
  237. package/dist/workspace/member-pipeline.d.ts.map +1 -1
  238. package/dist/workspace/member-pipeline.js +6 -0
  239. package/dist/workspace/promotion-order.d.ts +41 -0
  240. package/dist/workspace/promotion-order.d.ts.map +1 -0
  241. package/dist/workspace/promotion-order.js +95 -0
  242. package/dist/workspace/reason-codes.d.ts +2 -0
  243. package/dist/workspace/reason-codes.d.ts.map +1 -1
  244. package/dist/workspace/reason-codes.js +4 -1
  245. package/dist/workspace/releases.d.ts +72 -0
  246. package/dist/workspace/releases.d.ts.map +1 -0
  247. package/dist/workspace/releases.js +94 -0
  248. package/dist/workspace/releases.schema.json +391 -0
  249. package/dist/workspace/run-event.schema.json +288 -0
  250. package/dist/workspace/status-gates.d.ts +26 -1
  251. package/dist/workspace/status-gates.d.ts.map +1 -1
  252. package/dist/workspace/status-gates.js +31 -2
  253. package/dist/workspace/status-stewards.d.ts +4 -0
  254. package/dist/workspace/status-stewards.d.ts.map +1 -1
  255. package/dist/workspace/status-stewards.js +2 -0
  256. package/dist/workspace/status.d.ts +39 -0
  257. package/dist/workspace/status.d.ts.map +1 -1
  258. package/dist/workspace/status.js +48 -1
  259. package/dist/workspace/status.schema.json +70 -1
  260. package/dist/workspace/trust/ci-tag-statement.d.ts +102 -0
  261. package/dist/workspace/trust/ci-tag-statement.d.ts.map +1 -0
  262. package/dist/workspace/trust/ci-tag-statement.js +123 -0
  263. package/dist/workspace/trust/op-run-statement.d.ts +91 -0
  264. package/dist/workspace/trust/op-run-statement.d.ts.map +1 -0
  265. package/dist/workspace/trust/op-run-statement.js +143 -0
  266. package/dist/workspace/trust/rotation.d.ts +18 -2
  267. package/dist/workspace/trust/rotation.d.ts.map +1 -1
  268. package/dist/workspace/trust/rotation.js +65 -16
  269. package/dist/workspace/trust/seal.d.ts +11 -0
  270. package/dist/workspace/trust/seal.d.ts.map +1 -1
  271. package/dist/workspace/trust/seal.js +9 -0
  272. package/dist/workspace/trust/ssh-commit.d.ts.map +1 -1
  273. package/dist/workspace/trust/ssh-commit.js +10 -10
  274. package/package.json +1 -1
  275. package/src/__golden__/wave-loop/fan-out-gated.json +8 -0
  276. package/src/__golden__/wave-loop/fan-out-no-members.json +4 -0
  277. package/src/__golden__/wave-loop/fan-out-only.json +6 -0
  278. package/src/__golden__/wave-loop/op-by-apply-hold.json +2 -0
  279. package/src/__golden__/wave-loop/op-cost-member.json +3 -0
  280. package/src/__golden__/wave-loop/op-held-on-before-apply.json +1 -0
  281. package/src/__golden__/wave-loop/op-held-on.json +2 -0
  282. package/src/__golden__/wave-loop/op-hooks-held.json +2 -0
  283. package/src/__golden__/wave-loop/op-hooks-hold-before-apply.json +2 -0
  284. package/src/__golden__/wave-loop/op-hooks-refused-at-base.json +3 -0
  285. package/src/__golden__/wave-loop/op-hooks-share.json +3 -0
  286. package/src/__golden__/wave-loop/op-per-run.json +7 -0
  287. package/src/__golden__/wave-loop/op-pr-review.json +7 -0
  288. package/src/__golden__/wave-loop/op-sealed.json +3 -0
  289. package/src/__golden__/wave-loop/op-spend.json +3 -0
  290. package/src/__golden__/wave-loop/op-wave-commands.json +7 -0
  291. package/src/__golden__/wave-loop/op-wide-waiting.json +4 -0
  292. package/src/change-set-graph.test.ts +72 -0
  293. package/src/change-set-graph.ts +133 -0
  294. package/src/change-set.ts +76 -6
  295. package/src/chant-version.ts +16 -0
  296. package/src/cli/commands/build.ts +19 -8
  297. package/src/cli/commands/check-lexicon-docs.test.ts +51 -0
  298. package/src/cli/commands/check-lexicon-docs.ts +39 -2
  299. package/src/cli/commands/check-lexicon.ts +14 -2
  300. package/src/cli/commands/init-lexicon/templates/docs.ts +7 -6
  301. package/src/cli/commands/init-lexicon.test.ts +25 -0
  302. package/src/cli/commands/init-lexicon.ts +18 -8
  303. package/src/cli/handlers/approve-release.test.ts +80 -0
  304. package/src/cli/handlers/approve.ts +18 -2
  305. package/src/cli/handlers/build.test.ts +52 -0
  306. package/src/cli/handlers/build.ts +29 -0
  307. package/src/cli/handlers/change-set.ts +49 -1
  308. package/src/cli/handlers/fan-out.test.ts +48 -0
  309. package/src/cli/handlers/fan-out.ts +15 -3
  310. package/src/cli/handlers/operator.test.ts +37 -0
  311. package/src/cli/handlers/pr.test.ts +194 -0
  312. package/src/cli/handlers/pr.ts +168 -34
  313. package/src/cli/handlers/promote.test.ts +389 -5
  314. package/src/cli/handlers/promote.ts +279 -20
  315. package/src/cli/handlers/release-implicit.e2e.test.ts +153 -0
  316. package/src/cli/handlers/release.e2e.test.ts +85 -0
  317. package/src/cli/handlers/release.ts +206 -0
  318. package/src/cli/handlers/run-auto-release.test.ts +71 -0
  319. package/src/cli/handlers/run-events-cmd.test.ts +92 -0
  320. package/src/cli/handlers/run.test.ts +30 -0
  321. package/src/cli/handlers/run.ts +176 -15
  322. package/src/cli/main.test.ts +7 -0
  323. package/src/cli/main.ts +88 -13
  324. package/src/cli/mcp/never-over-mcp.test.ts +2 -0
  325. package/src/cli/mcp/workspace-tools.ts +1 -1
  326. package/src/cli/parse-args.ts +37 -3
  327. package/src/cli/registry.ts +29 -3
  328. package/src/cli/run-events.ts +54 -0
  329. package/src/cli/version.ts +3 -13
  330. package/src/codegen/docs-in-site.test.ts +166 -0
  331. package/src/codegen/docs-in-site.ts +182 -0
  332. package/src/codegen/docs-site/AgentPrompt.astro +26 -1
  333. package/src/codegen/docs-types.ts +14 -1
  334. package/src/codegen/docs.ts +60 -7
  335. package/src/codegen/rehype-base-url.d.mts +3 -1
  336. package/src/codegen/rehype-base-url.mjs +15 -9
  337. package/src/codegen/rehype-base-url.test.ts +34 -0
  338. package/src/components/auto-release.test.ts +21 -0
  339. package/src/components/auto-release.ts +6 -1
  340. package/src/components/cli-support.test.ts +82 -0
  341. package/src/components/cli-support.ts +16 -9
  342. package/src/components/driver.ts +129 -56
  343. package/src/components/fan-out-run.ts +56 -35
  344. package/src/components/pr-run.ts +30 -1
  345. package/src/components/promote-order.test.ts +90 -0
  346. package/src/components/promote-order.ts +75 -0
  347. package/src/components/promote.test.ts +10 -1
  348. package/src/components/promote.ts +26 -1
  349. package/src/components/release-compile.test.ts +147 -0
  350. package/src/components/release-compile.ts +445 -0
  351. package/src/components/release-gate.test.ts +215 -0
  352. package/src/components/release-gate.ts +341 -0
  353. package/src/components/release-promote.test.ts +159 -0
  354. package/src/components/release-promote.ts +232 -0
  355. package/src/components/run-progress.ts +7 -0
  356. package/src/components/wave-plan.ts +1 -1
  357. package/src/config.ts +7 -1
  358. package/src/index.ts +2 -0
  359. package/src/lifecycle/change-set-store.test.ts +217 -0
  360. package/src/lifecycle/change-set-store.ts +112 -0
  361. package/src/lifecycle/commit-sha.ts +23 -0
  362. package/src/lifecycle/gate-change-set.e2e.test.ts +122 -0
  363. package/src/lifecycle/gate-change-set.ts +133 -0
  364. package/src/lifecycle/gate-ledger.test.ts +33 -0
  365. package/src/lifecycle/gate-ledger.ts +66 -1
  366. package/src/lifecycle/release-cut-signed.test.ts +180 -0
  367. package/src/lifecycle/release-cut.test.ts +411 -0
  368. package/src/lifecycle/release-cut.ts +367 -0
  369. package/src/lifecycle/release-ledger.test.ts +14 -0
  370. package/src/lifecycle/release-ledger.ts +85 -17
  371. package/src/lifecycle/release-store.ts +423 -0
  372. package/src/lifecycle/run-ledger.test.ts +10 -0
  373. package/src/lifecycle/run-ledger.ts +6 -0
  374. package/src/op/activities/change-coverage.ts +4 -1
  375. package/src/op/activities/source-release.ts +8 -3
  376. package/src/op/activities/source-rollback.ts +8 -4
  377. package/src/op/commit-run-gate-deploy-join.test.ts +117 -0
  378. package/src/op/gate-name.ts +13 -3
  379. package/src/op/gate-release.test.ts +126 -0
  380. package/src/op/gate-run-locator.test.ts +110 -0
  381. package/src/op/gate-run-locator.ts +35 -0
  382. package/src/op/gate.ts +88 -6
  383. package/src/op/local-executor.ts +207 -52
  384. package/src/op/op-waves-run.ts +4 -0
  385. package/src/op/run-events.test.ts +166 -0
  386. package/src/op/run-live.ts +1 -1
  387. package/src/op/runtime.ts +39 -0
  388. package/src/op/runtimes/local.test.ts +16 -0
  389. package/src/op/runtimes/local.ts +9 -0
  390. package/src/point-decision.ts +12 -2
  391. package/src/run-event-store.test.ts +144 -0
  392. package/src/run-event-store.ts +213 -0
  393. package/src/run-event-stream.test.ts +175 -0
  394. package/src/run-event-stream.ts +306 -0
  395. package/src/run-event.test.ts +277 -0
  396. package/src/run-event.ts +451 -0
  397. package/src/wave-loop-golden.test.ts +9 -0
  398. package/src/workspace/__fixtures__/run-event-check.ts +58 -0
  399. package/src/workspace/ancestry-index.test.ts +93 -0
  400. package/src/workspace/change-set-show.schema.json +102 -0
  401. package/src/workspace/change-set-show.ts +72 -0
  402. package/src/workspace/change-set.schema.json +28 -1
  403. package/src/workspace/changes-cli.ts +10 -1
  404. package/src/workspace/changes.schema.json +135 -0
  405. package/src/workspace/changes.test.ts +1 -1
  406. package/src/workspace/changes.ts +84 -2
  407. package/src/workspace/ci-green-cli.ts +75 -13
  408. package/src/workspace/ci-green-forge.ts +24 -4
  409. package/src/workspace/ci-green-runs.test.ts +242 -0
  410. package/src/workspace/ci-green-signed.test.ts +302 -0
  411. package/src/workspace/ci-green-workflow.test.ts +16 -0
  412. package/src/workspace/ci-green-workflow.ts +12 -0
  413. package/src/workspace/ci-green.test.ts +131 -2
  414. package/src/workspace/ci-green.ts +624 -42
  415. package/src/workspace/ci-last-green.schema.json +32 -2
  416. package/src/workspace/ci-list.schema.json +525 -0
  417. package/src/workspace/commit-links.test.ts +279 -0
  418. package/src/workspace/commit-links.ts +183 -0
  419. package/src/workspace/declaration.schema.json +12 -0
  420. package/src/workspace/declaration.ts +22 -2
  421. package/src/workspace/identity-gate-rule.ts +91 -7
  422. package/src/workspace/identity.ts +14 -1
  423. package/src/workspace/intent.ts +48 -1
  424. package/src/workspace/ls.schema.json +3 -1
  425. package/src/workspace/ls.ts +6 -0
  426. package/src/workspace/member-pipeline.test.ts +17 -0
  427. package/src/workspace/member-pipeline.ts +9 -0
  428. package/src/workspace/promotion-order.ts +97 -0
  429. package/src/workspace/read-contract.e2e.test.ts +4 -1
  430. package/src/workspace/reason-codes.test.ts +2 -1
  431. package/src/workspace/reason-codes.ts +4 -1
  432. package/src/workspace/releases.schema.json +391 -0
  433. package/src/workspace/releases.test.ts +108 -0
  434. package/src/workspace/releases.ts +122 -0
  435. package/src/workspace/run-event.schema.json +288 -0
  436. package/src/workspace/status-contract.test.ts +52 -1
  437. package/src/workspace/status-gates.ts +56 -1
  438. package/src/workspace/status-stewards.ts +6 -0
  439. package/src/workspace/status.schema.json +70 -1
  440. package/src/workspace/status.ts +80 -1
  441. package/src/workspace/trust/ci-tag-statement.ts +151 -0
  442. package/src/workspace/trust/op-run-statement.ts +148 -0
  443. package/src/workspace/trust/rotation.ts +61 -14
  444. package/src/workspace/trust/seal.ts +10 -0
  445. package/src/workspace/trust/ssh-commit.ts +10 -9
  446. package/src/cli/commands/__fixtures__/init-lexicon-output/docs/astro.config.mjs +0 -14
  447. package/src/cli/commands/__fixtures__/init-lexicon-output/docs/package.json +0 -16
  448. package/src/cli/commands/__fixtures__/init-lexicon-output/docs/src/content/docs/index.mdx +0 -8
  449. package/src/cli/commands/__fixtures__/init-lexicon-output/docs/src/content.config.ts +0 -15
  450. package/src/cli/commands/__fixtures__/init-lexicon-output/docs/tsconfig.json +0 -10
@@ -64,10 +64,10 @@
64
64
  },
65
65
  "ref": {
66
66
  "type": "string",
67
- "description": "The ref whose first-parent commits were walked: refs/remotes/origin/<branch> when the checkout has it, else refs/heads/<branch>."
67
+ "description": "The ref whose first-parent commits were walked: refs/remotes/origin/<branch> when the checkout has it, else refs/heads/<branch>, or the revision --from names (#4031)."
68
68
  },
69
69
  "commit": {
70
- "description": "The newest green commit that is not revoked, or null when there is none.",
70
+ "description": "The newest green commit that is not revoked, or null when there is none. Only tags that count are read: with ci.green.signedSince set, a tag on a commit that is not a strict first-parent ancestor of it counts only with a valid statement signed by a runner key (#4031).",
71
71
  "oneOf": [
72
72
  {
73
73
  "type": "null"
@@ -103,6 +103,36 @@
103
103
  }
104
104
  }
105
105
  ]
106
+ },
107
+ "ignored": {
108
+ "type": "array",
109
+ "description": "Added within contract version 1 by #4031, written by chant 0.124.28 and newer. The tags on the commits walked, newest first and down to the one found, that do not count for want of a valid statement. Empty when ci.green.signedSince is not set.",
110
+ "items": {
111
+ "type": "object",
112
+ "required": [
113
+ "tag",
114
+ "status",
115
+ "reason"
116
+ ],
117
+ "properties": {
118
+ "tag": {
119
+ "type": "string",
120
+ "description": "ci/green/<sha> or ci/revoked/<sha>."
121
+ },
122
+ "status": {
123
+ "enum": [
124
+ "unsigned",
125
+ "invalid",
126
+ "untrusted",
127
+ "mismatch"
128
+ ],
129
+ "description": "unsigned: the annotation carries no statement. invalid: the statement is not a ci-tag statement, or names another signer than the key's. untrusted: no runner key .chant/trust.json lists at base signed it, or its principal holds no runner role. mismatch: it signs another commit, tag kind or branch, the annotation's record is not the one signed, or the tag points at another commit than its name gives."
130
+ },
131
+ "reason": {
132
+ "type": "string"
133
+ }
134
+ }
135
+ }
106
136
  }
107
137
  }
108
138
  },
@@ -0,0 +1,525 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://intentius.io/chant/schemas/workspace/ci-list/v1/ci-list.schema.json",
4
+ "title": "chant ci list output",
5
+ "description": "What `chant ci list --json` prints (#4021, ws-103): the first-parent commits of the branch ci.green names, newest first, within ci.green.window or after --since, each with its state from the ci/green/<sha> and ci/revoked/<sha> tags and the result of each required phase. It reads local refs and tags and never fetches; with --forge it also reads check runs for the commits that have no ci tag. With the source chant runs (ci.green.source or --source runs, #4044) it reads the signed Op runs on the local chant/lifecycle for those commits instead, and refuses --forge. Version 1 of the read contract. Readers ignore fields they do not know; a field is only ever added within a version, so a later release may add more fields to each commit. `work` says whether the commit names its work item; it was added by #4029. The codes are a closed list, each in the one closed list of `reason-codes.ts`. Contract version 1 of this document is written by chant 0.124.28 and newer; the read contract as a whole by chant 0.81.0 and newer.",
6
+ "oneOf": [
7
+ {
8
+ "$ref": "#/$defs/result"
9
+ },
10
+ {
11
+ "$ref": "#/$defs/failure"
12
+ }
13
+ ],
14
+ "$defs": {
15
+ "result": {
16
+ "type": "object",
17
+ "description": "Exit code 0, with or without commits.",
18
+ "required": [
19
+ "$schema",
20
+ "contract",
21
+ "chant",
22
+ "workspace",
23
+ "branch",
24
+ "ref",
25
+ "window",
26
+ "since",
27
+ "require",
28
+ "commits"
29
+ ],
30
+ "properties": {
31
+ "$schema": {
32
+ "const": "https://intentius.io/chant/schemas/workspace/ci-list/v1/ci-list.schema.json"
33
+ },
34
+ "contract": {
35
+ "const": 1
36
+ },
37
+ "chant": {
38
+ "type": "string"
39
+ },
40
+ "error": false,
41
+ "workspace": {
42
+ "type": "object",
43
+ "required": [
44
+ "name",
45
+ "root",
46
+ "file"
47
+ ],
48
+ "properties": {
49
+ "name": {
50
+ "type": "string"
51
+ },
52
+ "root": {
53
+ "type": "string",
54
+ "description": "The workspace root relative to the git root, with / separators, \".\" for the git root itself."
55
+ },
56
+ "file": {
57
+ "enum": [
58
+ "chant.workspace.json",
59
+ "chant.workspace.jsonc"
60
+ ]
61
+ }
62
+ }
63
+ },
64
+ "branch": {
65
+ "type": "string",
66
+ "description": "ci.green.branch."
67
+ },
68
+ "ref": {
69
+ "type": "string",
70
+ "description": "The ref whose first-parent commits were walked: refs/remotes/origin/<branch> when the checkout has it, else refs/heads/<branch>."
71
+ },
72
+ "window": {
73
+ "type": [
74
+ "string",
75
+ "null"
76
+ ],
77
+ "description": "ci.green.window, or null when --since replaced it."
78
+ },
79
+ "since": {
80
+ "type": [
81
+ "string",
82
+ "null"
83
+ ],
84
+ "description": "The revision --since named; the commits listed come after it. Null when it was not given."
85
+ },
86
+ "require": {
87
+ "type": "array",
88
+ "items": {
89
+ "type": "string"
90
+ },
91
+ "description": "ci.green.require: the phases a commit must pass, in order. Each commit's phases list them in the same order."
92
+ },
93
+ "commits": {
94
+ "type": "array",
95
+ "description": "Newest first.",
96
+ "items": {
97
+ "type": "object",
98
+ "required": [
99
+ "sha",
100
+ "committed",
101
+ "state",
102
+ "green",
103
+ "revoked",
104
+ "phases"
105
+ ],
106
+ "properties": {
107
+ "sha": {
108
+ "type": "string",
109
+ "pattern": "^[0-9a-f]{40,64}$"
110
+ },
111
+ "committed": {
112
+ "type": "string",
113
+ "description": "The commit's committer time, ISO 8601, UTC."
114
+ },
115
+ "state": {
116
+ "enum": [
117
+ "green",
118
+ "revoked",
119
+ "undecided"
120
+ ],
121
+ "description": "revoked when the commit has a revoked tag, else green when it has a green tag, else undecided."
122
+ },
123
+ "green": {
124
+ "description": "The commit's green tag, or null.",
125
+ "oneOf": [
126
+ {
127
+ "type": "null"
128
+ },
129
+ {
130
+ "type": "object",
131
+ "required": [
132
+ "tag",
133
+ "tagged"
134
+ ],
135
+ "properties": {
136
+ "tag": {
137
+ "type": "string",
138
+ "description": "ci/green/<sha>."
139
+ },
140
+ "tagged": {
141
+ "type": [
142
+ "string",
143
+ "null"
144
+ ],
145
+ "description": "When the tag was made, ISO 8601, or null for a lightweight tag."
146
+ },
147
+ "signer": {
148
+ "type": [
149
+ "string",
150
+ "null"
151
+ ],
152
+ "description": "Added within contract version 1 by #4031, written by chant 0.124.28 and newer. The runner principal whose statement the tag carries, or null when it counts unsigned: ci.green.signedSince is not set, or the commit is a strict first-parent ancestor of it."
153
+ }
154
+ }
155
+ }
156
+ ]
157
+ },
158
+ "revoked": {
159
+ "description": "The commit's revoked tag, or null.",
160
+ "oneOf": [
161
+ {
162
+ "type": "null"
163
+ },
164
+ {
165
+ "type": "object",
166
+ "required": [
167
+ "tag",
168
+ "tagged",
169
+ "phase",
170
+ "run"
171
+ ],
172
+ "properties": {
173
+ "tag": {
174
+ "type": "string",
175
+ "description": "ci/revoked/<sha>."
176
+ },
177
+ "tagged": {
178
+ "type": [
179
+ "string",
180
+ "null"
181
+ ],
182
+ "description": "When the tag was made, ISO 8601, or null for a lightweight tag."
183
+ },
184
+ "phase": {
185
+ "type": [
186
+ "string",
187
+ "null"
188
+ ],
189
+ "description": "The phase the annotation names as failed, or null when the annotation can't be read."
190
+ },
191
+ "run": {
192
+ "oneOf": [
193
+ {
194
+ "type": "null"
195
+ },
196
+ {
197
+ "type": "object",
198
+ "required": [
199
+ "name",
200
+ "id",
201
+ "conclusion",
202
+ "url"
203
+ ],
204
+ "properties": {
205
+ "name": {
206
+ "type": "string"
207
+ },
208
+ "id": {
209
+ "type": [
210
+ "integer",
211
+ "null"
212
+ ]
213
+ },
214
+ "conclusion": {
215
+ "type": [
216
+ "string",
217
+ "null"
218
+ ]
219
+ },
220
+ "url": {
221
+ "type": [
222
+ "string",
223
+ "null"
224
+ ]
225
+ },
226
+ "opRun": {
227
+ "type": "object",
228
+ "required": [
229
+ "id",
230
+ "env",
231
+ "signer"
232
+ ],
233
+ "properties": {
234
+ "id": {
235
+ "type": "string",
236
+ "description": "The Op run's id."
237
+ },
238
+ "env": {
239
+ "type": "string",
240
+ "description": "The env the run is recorded under."
241
+ },
242
+ "signer": {
243
+ "type": "string",
244
+ "description": "The runner principal whose statement the run carries."
245
+ }
246
+ },
247
+ "description": "Added within contract version 1 by #4044, written by chant 0.124.28 and newer. Present only when the run is a chant Op run (ci.green.source runs): name is then the Op's name and id is null. Absent for a check run."
248
+ }
249
+ }
250
+ }
251
+ ],
252
+ "description": "The run the annotation names as failed."
253
+ },
254
+ "signer": {
255
+ "type": [
256
+ "string",
257
+ "null"
258
+ ],
259
+ "description": "Added within contract version 1 by #4031, written by chant 0.124.28 and newer. The runner principal whose statement the tag carries, or null when it counts unsigned: ci.green.signedSince is not set, or the commit is a strict first-parent ancestor of it."
260
+ }
261
+ }
262
+ }
263
+ ]
264
+ },
265
+ "phases": {
266
+ "type": "array",
267
+ "description": "Each required phase, in `require` order.",
268
+ "items": {
269
+ "type": "object",
270
+ "required": [
271
+ "phase",
272
+ "result",
273
+ "runs"
274
+ ],
275
+ "properties": {
276
+ "phase": {
277
+ "type": "string"
278
+ },
279
+ "result": {
280
+ "enum": [
281
+ "pass",
282
+ "fail",
283
+ "pending",
284
+ "unrecorded"
285
+ ],
286
+ "description": "pass and fail come from the tags (a green tag records the phases that passed, a revoked tag the one that failed) or, for an undecided commit, from the forge under --forge, or from the signed Op runs on the local chant/lifecycle when the source is chant runs (#4044). pending is such a read with runs still going or not yet reported. unrecorded means no tag holds the result and nothing was read."
287
+ },
288
+ "runs": {
289
+ "type": "array",
290
+ "items": {
291
+ "type": "object",
292
+ "required": [
293
+ "name",
294
+ "id",
295
+ "conclusion",
296
+ "url"
297
+ ],
298
+ "properties": {
299
+ "name": {
300
+ "type": "string"
301
+ },
302
+ "id": {
303
+ "type": [
304
+ "integer",
305
+ "null"
306
+ ]
307
+ },
308
+ "conclusion": {
309
+ "type": [
310
+ "string",
311
+ "null"
312
+ ]
313
+ },
314
+ "url": {
315
+ "type": [
316
+ "string",
317
+ "null"
318
+ ]
319
+ },
320
+ "opRun": {
321
+ "type": "object",
322
+ "required": [
323
+ "id",
324
+ "env",
325
+ "signer"
326
+ ],
327
+ "properties": {
328
+ "id": {
329
+ "type": "string",
330
+ "description": "The Op run's id."
331
+ },
332
+ "env": {
333
+ "type": "string",
334
+ "description": "The env the run is recorded under."
335
+ },
336
+ "signer": {
337
+ "type": "string",
338
+ "description": "The runner principal whose statement the run carries."
339
+ }
340
+ },
341
+ "description": "Added within contract version 1 by #4044, written by chant 0.124.28 and newer. Present only when the run is a chant Op run (ci.green.source runs): name is then the Op's name and id is null. Absent for a check run."
342
+ }
343
+ }
344
+ },
345
+ "description": "The check runs behind the result: those the green tag recorded, the failed run a revoked tag names, or those the forge returned. Empty when unrecorded."
346
+ }
347
+ }
348
+ }
349
+ },
350
+ "work": {
351
+ "description": "Whether the commit names the work item it belongs to (#4029), by the definition `workspace check --changes` uses: a Chant-Record trailer of a work kind the declaration names whose record exists, or a Chant-Lease trailer that resolves to a work item. The records are read at `ref`. A window match does not count. Null when the checkout is not in a workspace that declares a work kind, or the kinds can't be read. Added within contract version 1, and written by chant 0.124.28 and newer; a reader that finds no `work` is reading an older chant, and one that finds null has been told nothing. A commit that is unlinked or wrong is why its work item is unknown.",
352
+ "oneOf": [
353
+ {
354
+ "type": "null"
355
+ },
356
+ {
357
+ "type": "object",
358
+ "required": [
359
+ "state",
360
+ "ids",
361
+ "problems"
362
+ ],
363
+ "properties": {
364
+ "state": {
365
+ "enum": [
366
+ "linked",
367
+ "unlinked",
368
+ "wrong",
369
+ "merge"
370
+ ],
371
+ "description": "linked: a trailer names a work record that exists, or a lease that resolves to one (a lease is taken as linked when this checkout has no chant/lifecycle branch to read). unlinked: no Chant-Record or Chant-Lease trailer names anything. wrong: trailers name a work item but none of them is one that exists. merge: a merge commit, whose work is the commits it brings."
372
+ },
373
+ "ids": {
374
+ "type": "array",
375
+ "items": {
376
+ "type": "string"
377
+ },
378
+ "description": "The work records the trailers name, as <kind>:<id>. Empty unless state is linked."
379
+ },
380
+ "problems": {
381
+ "type": "array",
382
+ "description": "The trailers that do not link the commit. Empty unless state is wrong.",
383
+ "items": {
384
+ "type": "object",
385
+ "required": [
386
+ "trailer",
387
+ "message"
388
+ ],
389
+ "properties": {
390
+ "trailer": {
391
+ "type": "string"
392
+ },
393
+ "message": {
394
+ "type": "string"
395
+ }
396
+ }
397
+ }
398
+ }
399
+ }
400
+ }
401
+ ]
402
+ },
403
+ "ignored": {
404
+ "type": "array",
405
+ "description": "Added within contract version 1 by #4031, written by chant 0.124.28 and newer. The commit's ci tags that do not count for want of a valid statement signed by a runner key. A tag on any commit that is not a strict first-parent ancestor of ci.green.signedSince needs one; empty when signedSince is not set. state, green and revoked count only the tags that are not ignored.",
406
+ "items": {
407
+ "type": "object",
408
+ "required": [
409
+ "tag",
410
+ "status",
411
+ "reason"
412
+ ],
413
+ "properties": {
414
+ "tag": {
415
+ "type": "string",
416
+ "description": "ci/green/<sha> or ci/revoked/<sha>."
417
+ },
418
+ "status": {
419
+ "enum": [
420
+ "unsigned",
421
+ "invalid",
422
+ "untrusted",
423
+ "mismatch"
424
+ ],
425
+ "description": "unsigned: the annotation carries no statement. invalid: the statement is not a ci-tag statement, or names another signer than the key's. untrusted: no runner key .chant/trust.json lists at base signed it, or its principal holds no runner role. mismatch: it signs another commit, tag kind or branch, the annotation's record is not the one signed, or the tag points at another commit than its name gives."
426
+ },
427
+ "reason": {
428
+ "type": "string"
429
+ }
430
+ }
431
+ }
432
+ },
433
+ "ignoredRuns": {
434
+ "type": "array",
435
+ "description": "Added within contract version 1 by #4044, written by chant 0.124.28 and newer. Present only when the source is chant runs (ci.green.source or --source runs): the Op runs on the commit that do not count for want of a valid statement signed by a runner key whose principal holds the runner role. They neither green nor revoke the commit.",
436
+ "items": {
437
+ "type": "object",
438
+ "required": [
439
+ "run",
440
+ "op",
441
+ "env",
442
+ "status",
443
+ "reason"
444
+ ],
445
+ "properties": {
446
+ "run": {
447
+ "type": "string",
448
+ "description": "The Op run's id."
449
+ },
450
+ "op": {
451
+ "type": "string"
452
+ },
453
+ "env": {
454
+ "type": "string"
455
+ },
456
+ "status": {
457
+ "enum": [
458
+ "unsigned",
459
+ "invalid",
460
+ "untrusted",
461
+ "mismatch"
462
+ ],
463
+ "description": "unsigned: the record carries no statement. invalid: the statement is not an op-run statement, or names another signer than the key's. untrusted: no runner key .chant/trust.json lists at base signed it, or its principal holds no runner role. mismatch: it signs another run, commit or record than the ledger holds."
464
+ },
465
+ "reason": {
466
+ "type": "string"
467
+ }
468
+ }
469
+ }
470
+ }
471
+ }
472
+ }
473
+ }
474
+ }
475
+ },
476
+ "failure": {
477
+ "type": "object",
478
+ "description": "Nothing was read. Exit code 1.",
479
+ "required": [
480
+ "$schema",
481
+ "contract",
482
+ "chant",
483
+ "error"
484
+ ],
485
+ "properties": {
486
+ "$schema": {
487
+ "const": "https://intentius.io/chant/schemas/workspace/ci-list/v1/ci-list.schema.json"
488
+ },
489
+ "contract": {
490
+ "const": 1
491
+ },
492
+ "chant": {
493
+ "type": "string"
494
+ },
495
+ "error": {
496
+ "type": "object",
497
+ "required": [
498
+ "code",
499
+ "message"
500
+ ],
501
+ "properties": {
502
+ "code": {
503
+ "enum": [
504
+ "declaration-missing",
505
+ "declaration-ambiguous",
506
+ "declaration-unparseable",
507
+ "declaration-invalid",
508
+ "placement-invalid",
509
+ "reader-too-old",
510
+ "root-chant-required",
511
+ "not-a-git-repository",
512
+ "revision-unknown",
513
+ "ci-green-undeclared",
514
+ "ci-branch-unknown"
515
+ ]
516
+ },
517
+ "message": {
518
+ "type": "string"
519
+ }
520
+ }
521
+ }
522
+ }
523
+ }
524
+ }
525
+ }
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Which work item a commit belongs to (#4029).
3
+ *
4
+ * A work item implements a decision, and a trunk commit says which work item
5
+ * it carries out in one of two ways:
6
+ *
7
+ * - a `Chant-Record: <kind>:<id>` trailer, where `<kind>` is a work kind the
8
+ * declaration names (conventionally `work`) and the kind has a record `<id>`;
9
+ * - a `Chant-Lease` trailer whose token a lease history on `chant/lifecycle`
10
+ * names a work item for, and that item is a record of a work kind.
11
+ *
12
+ * A window match (the intent graph's `worked` bucket) does not link a commit:
13
+ * the commit never said so itself. A commit is wrongly linked when it names a
14
+ * work record that does not exist, a record of a kind that is not a work
15
+ * kind, a lease that resolves to nothing, or a `Chant-Record` value that is
16
+ * not `<kind>:<id>`, and no trailer of it links to a work item.
17
+ *
18
+ * This is the one place that judgement is made. `workspace check --changes`
19
+ * reports it, `ci list` and `ci tick` show it, and later readers share
20
+ * {@link judgeCommitLink}. It reads trailers through `readTrailerJoins`,
21
+ * which `graph --intent` joins commits with, so both resolve a Chant-Record
22
+ * and a Chant-Lease the same way. Everything here reads local git.
23
+ */
24
+ /** `linked`, `unlinked` (no trailer names a work item), `wrong` (trailers name one that is not there), or `merge` (a merge commit carries no work of its own). */
25
+ export type CommitLinkState = "linked" | "unlinked" | "wrong" | "merge";
26
+ /** One trailer that does not link the commit, with why. */
27
+ export interface CommitLinkProblem {
28
+ /** The trailer as written, such as `Chant-Record: decision:ws-075`. */
29
+ trailer: string;
30
+ message: string;
31
+ }
32
+ /** What {@link judgeCommitLink} says about one commit. */
33
+ export interface CommitLink {
34
+ state: CommitLinkState;
35
+ /** The work records the commit's trailers name, as `<kind>:<id>`. Empty unless `linked`; also empty for a lease that could not be checked. */
36
+ ids: string[];
37
+ /** The trailers that do not link. Empty unless `wrong`. */
38
+ problems: CommitLinkProblem[];
39
+ }
40
+ /** The work records a revision has, by work kind. */
41
+ export interface WorkIndex {
42
+ /** Each work kind's name, with the ids of its records. */
43
+ kinds: Map<string, Set<string>>;
44
+ /** Whether lease histories can be read: the local `chant/lifecycle` branch exists. Without it a lease is not judged. */
45
+ ledger: boolean;
46
+ }
47
+ /** The fix line for each state a check reports. */
48
+ export declare const COMMIT_UNLINKED_FIX = "add a `Chant-Record: work:<id>` trailer when the commit is made (git commit --trailer \"Chant-Record: work:<id>\"), naming the work item the commit carries out";
49
+ /**
50
+ * Judge one commit from its trailers.
51
+ *
52
+ * `trailers` are the commit's parsed trailers, `joins` what
53
+ * `readTrailerJoins` made of them, and `index` the work records of the
54
+ * revision judged against. A commit is `linked` when any trailer names a
55
+ * work record; another trailer that names a decision or a typo beside it
56
+ * does not make it wrong.
57
+ */
58
+ export declare function judgeCommitLink(trailers: Record<string, string[]>, joins: {
59
+ records: {
60
+ kind: string;
61
+ id: string;
62
+ }[];
63
+ lease: {
64
+ token: string;
65
+ item: string | null;
66
+ } | null;
67
+ }, index: WorkIndex): CommitLink;
68
+ /**
69
+ * Judge each commit by its own trailers. A commit in `merges` is `merge`:
70
+ * its work is the commits it brings. Reads the lease histories on the local
71
+ * `chant/lifecycle` branch once, and never fetches.
72
+ */
73
+ export declare function judgeCommits(top: string, shas: string[], index: WorkIndex, merges?: ReadonlySet<string>): Map<string, CommitLink>;
74
+ /** Whether the lease histories can be read from this repository: the local `chant/lifecycle` branch exists. */
75
+ export declare function hasLeaseLedger(top: string): boolean;
76
+ /** Which of `shas` are merge commits. */
77
+ export declare function mergeCommits(top: string, shas: string[]): Set<string>;
78
+ /**
79
+ * The work records the declaration's work kinds hold at `at` (a revision, or
80
+ * the working tree without one). Null when `cwd` is in no workspace, the
81
+ * declaration names no work kind, or a kind can't be read: the question
82
+ * "which work item" has no answer there.
83
+ */
84
+ export declare function readWorkIndex(cwd: string, top: string, at?: string): Promise<WorkIndex | null>;
85
+ //# sourceMappingURL=commit-links.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commit-links.d.ts","sourceRoot":"","sources":["../../src/workspace/commit-links.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAaH,kKAAkK;AAClK,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,GAAG,OAAO,CAAC;AAExE,2DAA2D;AAC3D,MAAM,WAAW,iBAAiB;IAChC,uEAAuE;IACvE,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,0DAA0D;AAC1D,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,eAAe,CAAC;IACvB,8IAA8I;IAC9I,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,2DAA2D;IAC3D,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B;AAED,qDAAqD;AACrD,MAAM,WAAW,SAAS;IACxB,0DAA0D;IAC1D,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;IAChC,wHAAwH;IACxH,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,mDAAmD;AACnD,eAAO,MAAM,mBAAmB,oKAAoK,CAAC;AAMrM;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE;IAAE,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,IAAI,CAAA;CAAE,EAAE,KAAK,EAAE,SAAS,GAAG,UAAU,CAiC1M;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,GAAE,WAAW,CAAC,MAAM,CAAa,GAAG,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAe5I;AAED,+GAA+G;AAC/G,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAOnD;AAED,yCAAyC;AACzC,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CASrE;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAmBpG"}