@intentius/chant 0.80.0 → 0.81.0

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 (414) hide show
  1. package/dist/audit/discover.d.ts +8 -16
  2. package/dist/audit/discover.d.ts.map +1 -1
  3. package/dist/audit/report-html.d.ts +5 -0
  4. package/dist/audit/report-html.d.ts.map +1 -1
  5. package/dist/audit/report-model.d.ts +13 -0
  6. package/dist/audit/report-model.d.ts.map +1 -1
  7. package/dist/audit/terraform-state.d.ts +4 -5
  8. package/dist/audit/terraform-state.d.ts.map +1 -1
  9. package/dist/cli/commands/audit.d.ts +25 -9
  10. package/dist/cli/commands/audit.d.ts.map +1 -1
  11. package/dist/cli/commands/check-lexicon.d.ts +8 -0
  12. package/dist/cli/commands/check-lexicon.d.ts.map +1 -1
  13. package/dist/cli/commands/doctor.d.ts.map +1 -1
  14. package/dist/cli/commands/import-agents.d.ts.map +1 -1
  15. package/dist/cli/commands/init.d.ts.map +1 -1
  16. package/dist/cli/commands/lint.d.ts.map +1 -1
  17. package/dist/cli/commands/update.d.ts +6 -0
  18. package/dist/cli/commands/update.d.ts.map +1 -1
  19. package/dist/cli/commands/vendor.d.ts +5 -0
  20. package/dist/cli/commands/vendor.d.ts.map +1 -1
  21. package/dist/cli/handlers/build.d.ts.map +1 -1
  22. package/dist/cli/handlers/components.d.ts.map +1 -1
  23. package/dist/cli/handlers/dev.d.ts.map +1 -1
  24. package/dist/cli/handlers/fan-out.d.ts.map +1 -1
  25. package/dist/cli/handlers/init.d.ts.map +1 -1
  26. package/dist/cli/handlers/operator.d.ts +7 -0
  27. package/dist/cli/handlers/operator.d.ts.map +1 -1
  28. package/dist/cli/handlers/promote.d.ts +7 -4
  29. package/dist/cli/handlers/promote.d.ts.map +1 -1
  30. package/dist/cli/handlers/run-generate.d.ts.map +1 -1
  31. package/dist/cli/handlers/run.d.ts +4 -1
  32. package/dist/cli/handlers/run.d.ts.map +1 -1
  33. package/dist/cli/handlers/vendor.d.ts +8 -3
  34. package/dist/cli/handlers/vendor.d.ts.map +1 -1
  35. package/dist/cli/main.d.ts +12 -0
  36. package/dist/cli/main.d.ts.map +1 -1
  37. package/dist/cli/plugins.d.ts +12 -7
  38. package/dist/cli/plugins.d.ts.map +1 -1
  39. package/dist/cli/registry.d.ts +32 -0
  40. package/dist/cli/registry.d.ts.map +1 -1
  41. package/dist/codegen/fetch.d.ts +10 -0
  42. package/dist/codegen/fetch.d.ts.map +1 -1
  43. package/dist/components/cli-support.d.ts +3 -1
  44. package/dist/components/cli-support.d.ts.map +1 -1
  45. package/dist/components/discover.d.ts.map +1 -1
  46. package/dist/components/driver.d.ts +16 -2
  47. package/dist/components/driver.d.ts.map +1 -1
  48. package/dist/components/gate-plan.d.ts +40 -0
  49. package/dist/components/gate-plan.d.ts.map +1 -0
  50. package/dist/components/promote.d.ts +60 -7
  51. package/dist/components/promote.d.ts.map +1 -1
  52. package/dist/components/sandbox/driver.d.ts.map +1 -1
  53. package/dist/components/sandbox/run.d.ts.map +1 -1
  54. package/dist/components/verbs/build-archive.d.ts +22 -11
  55. package/dist/components/verbs/build-archive.d.ts.map +1 -1
  56. package/dist/components/verbs/run-agent.d.ts.map +1 -1
  57. package/dist/config-static.d.ts +59 -0
  58. package/dist/config-static.d.ts.map +1 -0
  59. package/dist/config.d.ts +32 -10
  60. package/dist/config.d.ts.map +1 -1
  61. package/dist/content-digest.d.ts +17 -0
  62. package/dist/content-digest.d.ts.map +1 -0
  63. package/dist/discovery/files.d.ts +10 -5
  64. package/dist/discovery/files.d.ts.map +1 -1
  65. package/dist/discovery/fold-import.d.ts +20 -4
  66. package/dist/discovery/fold-import.d.ts.map +1 -1
  67. package/dist/discovery/index.d.ts.map +1 -1
  68. package/dist/discovery/sandbox/driver.d.ts +20 -0
  69. package/dist/discovery/sandbox/driver.d.ts.map +1 -1
  70. package/dist/discovery/sandbox/fork.d.ts +20 -0
  71. package/dist/discovery/sandbox/fork.d.ts.map +1 -1
  72. package/dist/discovery/walk.d.ts +119 -0
  73. package/dist/discovery/walk.d.ts.map +1 -0
  74. package/dist/graph-ir.d.ts +4 -1
  75. package/dist/graph-ir.d.ts.map +1 -1
  76. package/dist/join-key.d.ts +31 -0
  77. package/dist/join-key.d.ts.map +1 -0
  78. package/dist/lexicon-module.d.ts +51 -6
  79. package/dist/lexicon-module.d.ts.map +1 -1
  80. package/dist/lexicon.d.ts +58 -1
  81. package/dist/lexicon.d.ts.map +1 -1
  82. package/dist/lifecycle/build-ledger-store.d.ts.map +1 -1
  83. package/dist/lifecycle/digest.d.ts +5 -1
  84. package/dist/lifecycle/digest.d.ts.map +1 -1
  85. package/dist/lifecycle/gate-ledger.d.ts +20 -5
  86. package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
  87. package/dist/lifecycle/git.d.ts +64 -0
  88. package/dist/lifecycle/git.d.ts.map +1 -1
  89. package/dist/lifecycle/lease.d.ts +8 -1
  90. package/dist/lifecycle/lease.d.ts.map +1 -1
  91. package/dist/lifecycle/legacy-digest.d.ts +41 -8
  92. package/dist/lifecycle/legacy-digest.d.ts.map +1 -1
  93. package/dist/lifecycle/member-ledger.d.ts +67 -0
  94. package/dist/lifecycle/member-ledger.d.ts.map +1 -0
  95. package/dist/lifecycle/plan-digest.d.ts +4 -3
  96. package/dist/lifecycle/plan-digest.d.ts.map +1 -1
  97. package/dist/lifecycle/release-ledger.d.ts +18 -2
  98. package/dist/lifecycle/release-ledger.d.ts.map +1 -1
  99. package/dist/lifecycle/status.d.ts +90 -5
  100. package/dist/lifecycle/status.d.ts.map +1 -1
  101. package/dist/op/activities/activity-contracts.d.ts +32 -0
  102. package/dist/op/activities/activity-contracts.d.ts.map +1 -1
  103. package/dist/op/activities/index.d.ts +2 -0
  104. package/dist/op/activities/index.d.ts.map +1 -1
  105. package/dist/op/activities/propose-upgrade.d.ts +75 -0
  106. package/dist/op/activities/propose-upgrade.d.ts.map +1 -0
  107. package/dist/op/discover.d.ts.map +1 -1
  108. package/dist/op/gate-name.d.ts +7 -0
  109. package/dist/op/gate-name.d.ts.map +1 -1
  110. package/dist/op/gate-summary.d.ts +16 -0
  111. package/dist/op/gate-summary.d.ts.map +1 -1
  112. package/dist/op/gate.d.ts +16 -2
  113. package/dist/op/gate.d.ts.map +1 -1
  114. package/dist/project-root.d.ts +26 -0
  115. package/dist/project-root.d.ts.map +1 -1
  116. package/dist/workspace/__fixtures__/contract-repo.d.ts +37 -0
  117. package/dist/workspace/__fixtures__/contract-repo.d.ts.map +1 -0
  118. package/dist/workspace/__fixtures__/two-member-workspace.d.ts +11 -0
  119. package/dist/workspace/__fixtures__/two-member-workspace.d.ts.map +1 -0
  120. package/dist/workspace/checks/generated.d.ts +156 -0
  121. package/dist/workspace/checks/generated.d.ts.map +1 -0
  122. package/dist/workspace/checks/ledgers.d.ts +78 -0
  123. package/dist/workspace/checks/ledgers.d.ts.map +1 -0
  124. package/dist/workspace/checks/links.d.ts +25 -0
  125. package/dist/workspace/checks/links.d.ts.map +1 -0
  126. package/dist/workspace/checks/pipelines.d.ts +76 -0
  127. package/dist/workspace/checks/pipelines.d.ts.map +1 -0
  128. package/dist/workspace/checks.d.ts +161 -0
  129. package/dist/workspace/checks.d.ts.map +1 -0
  130. package/dist/workspace/compose-graph.d.ts +115 -0
  131. package/dist/workspace/compose-graph.d.ts.map +1 -0
  132. package/dist/workspace/compose-reports.d.ts +68 -0
  133. package/dist/workspace/compose-reports.d.ts.map +1 -0
  134. package/dist/workspace/declaration.d.ts +220 -0
  135. package/dist/workspace/declaration.d.ts.map +1 -0
  136. package/dist/workspace/declaration.schema.json +434 -0
  137. package/dist/workspace/generated-files.d.ts +65 -0
  138. package/dist/workspace/generated-files.d.ts.map +1 -0
  139. package/dist/workspace/glob.d.ts +13 -0
  140. package/dist/workspace/glob.d.ts.map +1 -0
  141. package/dist/workspace/graph-cli.d.ts +75 -0
  142. package/dist/workspace/graph-cli.d.ts.map +1 -0
  143. package/dist/workspace/init.d.ts +96 -0
  144. package/dist/workspace/init.d.ts.map +1 -0
  145. package/dist/workspace/jsonc.d.ts +38 -0
  146. package/dist/workspace/jsonc.d.ts.map +1 -0
  147. package/dist/workspace/kinds.d.ts +192 -0
  148. package/dist/workspace/kinds.d.ts.map +1 -0
  149. package/dist/workspace/lineage-check.d.ts +84 -0
  150. package/dist/workspace/lineage-check.d.ts.map +1 -0
  151. package/dist/workspace/lineage-cli.d.ts +31 -0
  152. package/dist/workspace/lineage-cli.d.ts.map +1 -0
  153. package/dist/workspace/lineage-init.d.ts +101 -0
  154. package/dist/workspace/lineage-init.d.ts.map +1 -0
  155. package/dist/workspace/lineage-lock.d.ts +258 -0
  156. package/dist/workspace/lineage-lock.d.ts.map +1 -0
  157. package/dist/workspace/lineage-merge.d.ts +14 -0
  158. package/dist/workspace/lineage-merge.d.ts.map +1 -0
  159. package/dist/workspace/lineage-migrations.d.ts +178 -0
  160. package/dist/workspace/lineage-migrations.d.ts.map +1 -0
  161. package/dist/workspace/lineage-update.d.ts +59 -0
  162. package/dist/workspace/lineage-update.d.ts.map +1 -0
  163. package/dist/workspace/lineage-upgrade-cli.d.ts +40 -0
  164. package/dist/workspace/lineage-upgrade-cli.d.ts.map +1 -0
  165. package/dist/workspace/lineage-upgrade.d.ts +146 -0
  166. package/dist/workspace/lineage-upgrade.d.ts.map +1 -0
  167. package/dist/workspace/lineage-vendor.d.ts +63 -0
  168. package/dist/workspace/lineage-vendor.d.ts.map +1 -0
  169. package/dist/workspace/lineage-version.d.ts +32 -0
  170. package/dist/workspace/lineage-version.d.ts.map +1 -0
  171. package/dist/workspace/links.d.ts +150 -0
  172. package/dist/workspace/links.d.ts.map +1 -0
  173. package/dist/workspace/ls.d.ts +99 -0
  174. package/dist/workspace/ls.d.ts.map +1 -0
  175. package/dist/workspace/member-commands.d.ts +139 -0
  176. package/dist/workspace/member-commands.d.ts.map +1 -0
  177. package/dist/workspace/member-handles.d.ts +54 -0
  178. package/dist/workspace/member-handles.d.ts.map +1 -0
  179. package/dist/workspace/member-pipeline.d.ts +143 -0
  180. package/dist/workspace/member-pipeline.d.ts.map +1 -0
  181. package/dist/workspace/member-run.d.ts +67 -0
  182. package/dist/workspace/member-run.d.ts.map +1 -0
  183. package/dist/workspace/reason-codes.d.ts +65 -0
  184. package/dist/workspace/reason-codes.d.ts.map +1 -0
  185. package/dist/workspace/records-cli.d.ts +28 -4
  186. package/dist/workspace/records-cli.d.ts.map +1 -1
  187. package/dist/workspace/records.d.ts.map +1 -1
  188. package/dist/workspace/root-refusal.d.ts +53 -0
  189. package/dist/workspace/root-refusal.d.ts.map +1 -0
  190. package/dist/workspace/status.d.ts +150 -0
  191. package/dist/workspace/status.d.ts.map +1 -0
  192. package/dist/workspace/template-manifest.d.ts +90 -0
  193. package/dist/workspace/template-manifest.d.ts.map +1 -0
  194. package/dist/workspace/tree.d.ts +36 -0
  195. package/dist/workspace/tree.d.ts.map +1 -0
  196. package/dist/workspace/trust/attestor.d.ts +67 -0
  197. package/dist/workspace/trust/attestor.d.ts.map +1 -0
  198. package/dist/workspace/trust/policy.d.ts +111 -0
  199. package/dist/workspace/trust/policy.d.ts.map +1 -0
  200. package/dist/workspace/trust/provenance.d.ts +67 -0
  201. package/dist/workspace/trust/provenance.d.ts.map +1 -0
  202. package/dist/workspace/trust/ssh-commit.d.ts +43 -0
  203. package/dist/workspace/trust/ssh-commit.d.ts.map +1 -0
  204. package/dist/workspace/trust/test-repo.d.ts +42 -0
  205. package/dist/workspace/trust/test-repo.d.ts.map +1 -0
  206. package/dist/workspace/trust/verify-cli.d.ts +9 -0
  207. package/dist/workspace/trust/verify-cli.d.ts.map +1 -0
  208. package/dist/workspace/trust/verify.d.ts +66 -0
  209. package/dist/workspace/trust/verify.d.ts.map +1 -0
  210. package/dist/workspace/which-chant.d.ts +58 -0
  211. package/dist/workspace/which-chant.d.ts.map +1 -0
  212. package/dist/workspace/workspace-kinds.schema.json +133 -0
  213. package/package.json +2 -1
  214. package/src/audit/discover.ts +66 -78
  215. package/src/audit/report-html.ts +3 -1
  216. package/src/audit/report-model.ts +14 -1
  217. package/src/audit/terraform-state.test.ts +4 -9
  218. package/src/audit/terraform-state.ts +4 -5
  219. package/src/cli/commands/audit-truncation.test.ts +167 -0
  220. package/src/cli/commands/audit.ts +89 -60
  221. package/src/cli/commands/check-lexicon.ts +24 -0
  222. package/src/cli/commands/doctor.test.ts +30 -0
  223. package/src/cli/commands/doctor.ts +18 -0
  224. package/src/cli/commands/import-agents.ts +6 -2
  225. package/src/cli/commands/init.ts +22 -3
  226. package/src/cli/commands/lint.test.ts +17 -23
  227. package/src/cli/commands/lint.ts +24 -84
  228. package/src/cli/commands/update.ts +13 -4
  229. package/src/cli/commands/vendor.ts +11 -6
  230. package/src/cli/handlers/__snapshots__/build-member.test.ts.snap +38 -0
  231. package/src/cli/handlers/build-member.test.ts +127 -0
  232. package/src/cli/handlers/build.ts +35 -1
  233. package/src/cli/handlers/components.test.ts +127 -0
  234. package/src/cli/handlers/components.ts +70 -8
  235. package/src/cli/handlers/dev.ts +5 -3
  236. package/src/cli/handlers/fan-out.ts +9 -2
  237. package/src/cli/handlers/init.ts +54 -1
  238. package/src/cli/handlers/operator.test.ts +68 -0
  239. package/src/cli/handlers/operator.ts +37 -9
  240. package/src/cli/handlers/promote.test.ts +118 -2
  241. package/src/cli/handlers/promote.ts +82 -16
  242. package/src/cli/handlers/run-generate-member.test.ts +83 -0
  243. package/src/cli/handlers/run-generate.test.ts +6 -8
  244. package/src/cli/handlers/run-generate.ts +36 -1
  245. package/src/cli/handlers/run.test.ts +47 -0
  246. package/src/cli/handlers/run.ts +28 -5
  247. package/src/cli/handlers/vendor.ts +147 -43
  248. package/src/cli/main.test.ts +105 -1
  249. package/src/cli/main.ts +230 -17
  250. package/src/cli/plugins.ts +17 -17
  251. package/src/cli/registry.ts +32 -0
  252. package/src/cli/static-config-read.test.ts +208 -0
  253. package/src/codegen/fetch.test.ts +63 -1
  254. package/src/codegen/fetch.ts +30 -1
  255. package/src/components/cli-support.ts +6 -1
  256. package/src/components/discover.test.ts +27 -57
  257. package/src/components/discover.ts +13 -68
  258. package/src/components/driver.test.ts +78 -1
  259. package/src/components/driver.ts +43 -7
  260. package/src/components/gate-plan.ts +53 -0
  261. package/src/components/promote.test.ts +276 -2
  262. package/src/components/promote.ts +119 -15
  263. package/src/components/sandbox/driver.ts +8 -8
  264. package/src/components/sandbox/run.ts +4 -1
  265. package/src/components/verbs/build-archive.ts +27 -21
  266. package/src/components/verbs/run-agent.ts +3 -5
  267. package/src/config-static.test.ts +136 -0
  268. package/src/config-static.ts +232 -0
  269. package/src/config.test.ts +2 -2
  270. package/src/config.ts +48 -15
  271. package/src/content-digest.test.ts +120 -0
  272. package/src/content-digest.ts +21 -0
  273. package/src/discovery/files.test.ts +10 -10
  274. package/src/discovery/files.ts +25 -81
  275. package/src/discovery/fold-import.ts +49 -5
  276. package/src/discovery/index.ts +1 -0
  277. package/src/discovery/sandbox/driver.ts +73 -35
  278. package/src/discovery/sandbox/fork-diagnostic.test.ts +136 -13
  279. package/src/discovery/sandbox/fork.ts +83 -43
  280. package/src/discovery/sandbox/path-lexicon-multifile.test.ts +285 -0
  281. package/src/discovery/walk.test.ts +263 -0
  282. package/src/discovery/walk.ts +334 -0
  283. package/src/effect-receipt.ts +2 -2
  284. package/src/graph-ir.ts +4 -1
  285. package/src/join-key.test.ts +25 -0
  286. package/src/join-key.ts +39 -0
  287. package/src/lexicon-module.ts +108 -10
  288. package/src/lexicon.ts +79 -1
  289. package/src/lifecycle/build-ledger-store.ts +11 -10
  290. package/src/lifecycle/digest.ts +9 -5
  291. package/src/lifecycle/gate-ledger.test.ts +20 -0
  292. package/src/lifecycle/gate-ledger.ts +28 -6
  293. package/src/lifecycle/git.test.ts +13 -1
  294. package/src/lifecycle/git.ts +221 -176
  295. package/src/lifecycle/lease.ts +25 -10
  296. package/src/lifecycle/legacy-digest.test.ts +115 -23
  297. package/src/lifecycle/legacy-digest.ts +60 -19
  298. package/src/lifecycle/member-ledger.test.ts +319 -0
  299. package/src/lifecycle/member-ledger.ts +145 -0
  300. package/src/lifecycle/plan-digest.ts +7 -7
  301. package/src/lifecycle/release-ledger.test.ts +20 -0
  302. package/src/lifecycle/release-ledger.ts +23 -7
  303. package/src/lifecycle/status.test.ts +151 -1
  304. package/src/lifecycle/status.ts +228 -7
  305. package/src/op/activities/activity-contracts.ts +37 -0
  306. package/src/op/activities/index.ts +10 -0
  307. package/src/op/activities/propose-upgrade.ts +206 -0
  308. package/src/op/discover.test.ts +14 -4
  309. package/src/op/discover.ts +19 -27
  310. package/src/op/gate-name.ts +8 -0
  311. package/src/op/gate-summary.test.ts +14 -0
  312. package/src/op/gate-summary.ts +25 -2
  313. package/src/op/gate.ts +36 -7
  314. package/src/op/generate-pipeline.test.ts +14 -5
  315. package/src/project-root.test.ts +66 -1
  316. package/src/project-root.ts +48 -0
  317. package/src/workspace/__fixtures__/contract-repo.ts +100 -0
  318. package/src/workspace/__fixtures__/two-member-workspace.ts +35 -0
  319. package/src/workspace/behold-kinds.test.ts +162 -0
  320. package/src/workspace/check-contract.test.ts +127 -0
  321. package/src/workspace/check.schema.json +347 -0
  322. package/src/workspace/checks/generated.test.ts +287 -0
  323. package/src/workspace/checks/generated.ts +475 -0
  324. package/src/workspace/checks/ledgers.test.ts +139 -0
  325. package/src/workspace/checks/ledgers.ts +246 -0
  326. package/src/workspace/checks/links.ts +183 -0
  327. package/src/workspace/checks/pipelines.test.ts +133 -0
  328. package/src/workspace/checks/pipelines.ts +225 -0
  329. package/src/workspace/checks-repo.test.ts +71 -0
  330. package/src/workspace/checks.test.ts +450 -0
  331. package/src/workspace/checks.ts +461 -0
  332. package/src/workspace/compose-graph.test.ts +146 -0
  333. package/src/workspace/compose-graph.ts +228 -0
  334. package/src/workspace/compose-reports.test.ts +109 -0
  335. package/src/workspace/compose-reports.ts +186 -0
  336. package/src/workspace/declaration.schema.json +434 -0
  337. package/src/workspace/declaration.test.ts +347 -0
  338. package/src/workspace/declaration.ts +623 -0
  339. package/src/workspace/generated-files.test.ts +114 -0
  340. package/src/workspace/generated-files.ts +94 -0
  341. package/src/workspace/glob.ts +49 -0
  342. package/src/workspace/graph-cli.ts +220 -0
  343. package/src/workspace/graph-contract.test.ts +204 -0
  344. package/src/workspace/graph.schema.json +662 -0
  345. package/src/workspace/init.test.ts +223 -0
  346. package/src/workspace/init.ts +585 -0
  347. package/src/workspace/jsonc.test.ts +65 -0
  348. package/src/workspace/jsonc.ts +231 -0
  349. package/src/workspace/kinds.test.ts +288 -0
  350. package/src/workspace/kinds.ts +506 -0
  351. package/src/workspace/lineage-check.ts +264 -0
  352. package/src/workspace/lineage-cli.ts +114 -0
  353. package/src/workspace/lineage-init.test.ts +231 -0
  354. package/src/workspace/lineage-init.ts +365 -0
  355. package/src/workspace/lineage-lock.test.ts +224 -0
  356. package/src/workspace/lineage-lock.ts +357 -0
  357. package/src/workspace/lineage-merge.ts +44 -0
  358. package/src/workspace/lineage-migrations.test.ts +178 -0
  359. package/src/workspace/lineage-migrations.ts +343 -0
  360. package/src/workspace/lineage-update.ts +160 -0
  361. package/src/workspace/lineage-upgrade-cli.ts +151 -0
  362. package/src/workspace/lineage-upgrade.test.ts +474 -0
  363. package/src/workspace/lineage-upgrade.ts +624 -0
  364. package/src/workspace/lineage-vendor.test.ts +126 -0
  365. package/src/workspace/lineage-vendor.ts +215 -0
  366. package/src/workspace/lineage-version.ts +127 -0
  367. package/src/workspace/links.test.ts +344 -0
  368. package/src/workspace/links.ts +331 -0
  369. package/src/workspace/ls-contract.test.ts +200 -0
  370. package/src/workspace/ls.schema.json +190 -0
  371. package/src/workspace/ls.ts +254 -0
  372. package/src/workspace/member-commands.e2e.test.ts +244 -0
  373. package/src/workspace/member-commands.test.ts +217 -0
  374. package/src/workspace/member-commands.ts +540 -0
  375. package/src/workspace/member-handles.test.ts +76 -0
  376. package/src/workspace/member-handles.ts +228 -0
  377. package/src/workspace/member-pipeline.test.ts +135 -0
  378. package/src/workspace/member-pipeline.ts +317 -0
  379. package/src/workspace/member-run.ts +146 -0
  380. package/src/workspace/read-contract.test.ts +129 -0
  381. package/src/workspace/reason-codes.test.ts +113 -0
  382. package/src/workspace/reason-codes.ts +81 -0
  383. package/src/workspace/records-cli.ts +86 -14
  384. package/src/workspace/records-contract.test.ts +5 -0
  385. package/src/workspace/records.schema.json +32 -2
  386. package/src/workspace/records.ts +3 -2
  387. package/src/workspace/root-refusal.ts +97 -0
  388. package/src/workspace/status-contract.test.ts +308 -0
  389. package/src/workspace/status.schema.json +210 -0
  390. package/src/workspace/status.ts +412 -0
  391. package/src/workspace/template-manifest.test.ts +79 -0
  392. package/src/workspace/template-manifest.ts +221 -0
  393. package/src/workspace/tree.ts +132 -0
  394. package/src/workspace/trust/attestor.ts +93 -0
  395. package/src/workspace/trust/policy.ts +306 -0
  396. package/src/workspace/trust/provenance.ts +181 -0
  397. package/src/workspace/trust/ssh-commit.ts +138 -0
  398. package/src/workspace/trust/test-repo.ts +138 -0
  399. package/src/workspace/trust/trust.test.ts +397 -0
  400. package/src/workspace/trust/verify-cli.ts +56 -0
  401. package/src/workspace/trust/verify.ts +194 -0
  402. package/src/workspace/which-chant.test.ts +117 -0
  403. package/src/workspace/which-chant.ts +151 -0
  404. package/src/workspace/workspace-kinds.schema.json +133 -0
  405. package/dist/components/unbound-gate-approval.d.ts +0 -24
  406. package/dist/components/unbound-gate-approval.d.ts.map +0 -1
  407. package/dist/discovery/convergence.d.ts +0 -97
  408. package/dist/discovery/convergence.d.ts.map +0 -1
  409. package/src/cli/commands/audit-walk-warnings.test.ts +0 -156
  410. package/src/components/unbound-gate-approval.test.ts +0 -82
  411. package/src/components/unbound-gate-approval.ts +0 -51
  412. package/src/discovery/convergence.test.ts +0 -231
  413. package/src/discovery/convergence.ts +0 -399
  414. package/src/op/discover-convergence.test.ts +0 -70
@@ -0,0 +1 @@
1
+ {"version":3,"file":"member-commands.d.ts","sourceRoot":"","sources":["../../src/workspace/member-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;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AAC,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CA+EnG"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * A chant member's outputs and parameters, read from its source without
3
+ * running it (#2539, #2524 D6).
4
+ *
5
+ * `chant workspace check` resolves member links in source and never runs
6
+ * member code, so it can't build a member to learn its outputs. This reader
7
+ * parses the member's TypeScript files and picks out the two handles a join
8
+ * uses, the way the graph IR names them (`exports` and `imports`):
9
+ *
10
+ * - an output is the name passed to `output(ref, "Name")`, or the binding of
11
+ * `export const name = stackOutput(ref)`;
12
+ * - a parameter is the binding of `export const name = new Parameter(...)`.
13
+ *
14
+ * Only calls whose function is imported from `@intentius/chant` or a chant
15
+ * lexicon count. An output name must be a string literal, or a `const` in the
16
+ * same file that is one. Any other name can't be read without running the
17
+ * code, so it is a gap: the member's list of outputs is then incomplete, and a
18
+ * link to a name the reader didn't find is unresolved rather than missing.
19
+ *
20
+ * The reader loads the TypeScript parser and nothing else from the project.
21
+ */
22
+ import { type Declaration, type ResolvedGroup } from "./declaration.js";
23
+ import type { KindRegistry } from "./kinds.js";
24
+ import { type MemberHandles } from "./links.js";
25
+ import { type WorkspaceTree } from "./tree.js";
26
+ /** One output or parameter found in source. */
27
+ export interface SourceHandle {
28
+ name: string;
29
+ /** Tree-relative file and 1-based line, for messages. */
30
+ file: string;
31
+ line: number;
32
+ }
33
+ export interface SourceHandles {
34
+ outputs: SourceHandle[];
35
+ /** Parameters: the names a consumer reads from outside. */
36
+ inputs: SourceHandle[];
37
+ /** Why the list of outputs may be incomplete, one line each. Empty when it is complete. */
38
+ gaps: string[];
39
+ }
40
+ /**
41
+ * Read a chant member's outputs and parameters from the source under `dir`
42
+ * (tree-relative, `""` for the root), leaving out the `exclude`d directories.
43
+ * Runs no member code.
44
+ */
45
+ export declare function readSourceHandles(tree: WorkspaceTree, dir: string, exclude?: ReadonlySet<string>): SourceHandles;
46
+ /**
47
+ * Every member's handles, read in source for `chant workspace check`. A
48
+ * `chant` member's outputs and parameters are parsed from its TypeScript
49
+ * without running it; other kinds expose what the kind and the entry list.
50
+ * A member whose directory is missing or whose kind is unknown is left out,
51
+ * so links to it are unresolved.
52
+ */
53
+ export declare function sourceMemberHandles(declaration: Declaration, tree: WorkspaceTree, groups: readonly ResolvedGroup[], kinds: KindRegistry): Map<string, MemberHandles>;
54
+ //# sourceMappingURL=member-handles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"member-handles.d.ts","sourceRoot":"","sources":["../../src/workspace/member-handles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,EAAY,KAAK,WAAW,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAe,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAwB,KAAK,aAAa,EAAE,MAAM,QAAQ,CAAC;AAIlE,+CAA+C;AAC/C,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,2DAA2D;IAC3D,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,2FAA2F;IAC3F,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AA8HD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,WAAW,CAAC,MAAM,CAAa,GAAG,aAAa,CAa3H;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,aAAa,EACnB,MAAM,EAAE,SAAS,aAAa,EAAE,EAChC,KAAK,EAAE,YAAY,GAClB,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAyB5B"}
@@ -0,0 +1,143 @@
1
+ /**
2
+ * Per-member CI pipelines (#2542; #2524 D19, ws-041 and ws-042).
3
+ *
4
+ * When `chant build --components --generate` or `chant run --generate` runs
5
+ * for a project inside a workspace member, the generator is told which
6
+ * member it is generating for ({@link PipelineMember}). The generated
7
+ * pipeline is then filtered to the member's paths, its jobs run in the
8
+ * member's directory, and its file is named after the member so two members
9
+ * never write the same file.
10
+ *
11
+ * Forges read CI files from fixed paths at the repository root, outside any
12
+ * member's directory. The member whose command generates such a file owns
13
+ * it (ws-042), and records it in its list of generated files. That list
14
+ * belongs in the member's `generated` entry in `chant.workspace.json` once
15
+ * #2541 lands. Until then it is `.chant/generated.json` in the member's
16
+ * directory ({@link GENERATED_RECORD_FILE}), which `WSP081` reads to allow
17
+ * one declarer per file (./checks/pipelines.ts).
18
+ *
19
+ * The command handlers import this module only after `findWorkspaceRoot`
20
+ * has found a declaration, so a project outside any workspace never loads it.
21
+ */
22
+ import type { PipelineMember } from "../lexicon.js";
23
+ import type { WorkspaceRootSearch } from "../project-root.js";
24
+ import { type Declaration, type Member } from "./declaration.js";
25
+ /**
26
+ * TODO(#2541): the interim home of a member's generated-file list, relative
27
+ * to the member's directory. #2541 moves the list into the member's entry in
28
+ * the declaration, and this file goes away.
29
+ */
30
+ export declare const GENERATED_RECORD_FILE = ".chant/generated.json";
31
+ /** One generated file a member owns. */
32
+ export interface GeneratedFileEntry {
33
+ /** The file, relative to the repository root, with `/` separators. */
34
+ path: string;
35
+ /** The command that regenerates it, run in the member's directory. */
36
+ command: string;
37
+ /** The environment the pipeline deploys, for a component pipeline. */
38
+ env?: string;
39
+ }
40
+ export interface GeneratedRecord {
41
+ schema: 1;
42
+ files: GeneratedFileEntry[];
43
+ }
44
+ /** The member a project belongs to, and where it sits. */
45
+ export interface MemberContext {
46
+ declaration: Declaration;
47
+ member: Member;
48
+ /** Absolute path of the workspace root. */
49
+ workspaceRoot: string;
50
+ /** Absolute path of the repository root: the git top, or the workspace root outside git. */
51
+ repoRoot: string;
52
+ /** Absolute path of the member's directory. */
53
+ memberRoot: string;
54
+ /** What the generators read: name, repository-relative directory and exclusions. */
55
+ pipeline: PipelineMember;
56
+ }
57
+ /**
58
+ * The member that owns `projectDir`, given the declaration `findWorkspaceRoot`
59
+ * found. Undefined when no member owns it: the directory sits in an example
60
+ * group's match, or outside every member of a workspace with no root member.
61
+ * Throws `WorkspaceReadError` when the declaration can't be read.
62
+ */
63
+ export declare function resolveMemberContext(projectDir: string, found: WorkspaceRootSearch): MemberContext | undefined;
64
+ /** The directory a forge's generated files go in for a member, relative to the repository root, or undefined for a forge chant doesn't know. */
65
+ export declare function memberPipelineDir(provider: string): string | undefined;
66
+ /**
67
+ * The default path of a member's component pipeline for one environment,
68
+ * relative to the repository root: `chant-<member>-<env>.yml` in the forge's
69
+ * workflow directory, or `.gitlab/ci/chant-<member>-<env>.gitlab-ci.yml`.
70
+ */
71
+ export declare function memberPipelineFile(provider: string, member: string, env: string): string | undefined;
72
+ /** A repository-relative path for an absolute one. */
73
+ export declare function repoRelative(ctx: MemberContext, absolute: string): string;
74
+ /** Read a member's generated-file record, or an empty one. */
75
+ export declare function readGeneratedRecord(memberRoot: string): GeneratedRecord;
76
+ /**
77
+ * Add or replace entries in a member's generated-file record, keyed by path,
78
+ * and write it back sorted, so regenerating the same files leaves it
79
+ * byte-identical.
80
+ */
81
+ export declare function recordGeneratedFiles(memberRoot: string, entries: GeneratedFileEntry[]): string;
82
+ /** Quote one argument for a recorded command line when it needs it. */
83
+ export declare function shellArg(arg: string): string;
84
+ /** The first line of a member's generated pipeline, naming the command that regenerates it. */
85
+ export declare function generatedHeader(command: string): string;
86
+ /** What `chant build --components --generate` needs to write a member's pipeline. */
87
+ export interface MemberComponentPlan {
88
+ ctx: MemberContext;
89
+ /** Passed to the generator as `options.member`. */
90
+ member: PipelineMember;
91
+ /** The pipeline file, relative to the repository root. */
92
+ file: string;
93
+ /** The pipeline file's absolute path. */
94
+ target: string;
95
+ /** The command that regenerates it, run in the member's directory. */
96
+ command: string;
97
+ env: string;
98
+ }
99
+ export interface ComponentPlanInput {
100
+ projectDir: string;
101
+ found: WorkspaceRootSearch;
102
+ lexicon: string;
103
+ /** `--env`, or undefined for the generator's default. */
104
+ env?: string;
105
+ promoteTo?: string;
106
+ /** `--output`, relative to the current directory. */
107
+ output?: string;
108
+ params?: string[];
109
+ paramsFile?: string;
110
+ }
111
+ /**
112
+ * Plan a member's component pipeline: which member, which file and which
113
+ * command. Undefined when the project belongs to no member. Throws with a
114
+ * readable message when there is no default file for the forge and no
115
+ * `--output`.
116
+ */
117
+ export declare function planMemberComponentPipeline(input: ComponentPlanInput): MemberComponentPlan | undefined;
118
+ /** Write a member's pipeline with its header and record it as the member's generated file. */
119
+ export declare function writeMemberComponentPipeline(plan: MemberComponentPlan, yaml: string): void;
120
+ /** What `chant run --generate` needs to write a member's Op pipelines. */
121
+ export interface MemberOpPlan {
122
+ ctx: MemberContext;
123
+ member: PipelineMember;
124
+ /** Absolute directory the files are written to. */
125
+ outDir: string;
126
+ command: string;
127
+ }
128
+ /** Plan a member's Op pipelines. Undefined when the directory belongs to no member. */
129
+ export declare function planMemberOpPipelines(input: {
130
+ projectDir: string;
131
+ found: WorkspaceRootSearch;
132
+ provider: string;
133
+ output?: string;
134
+ specFile?: string;
135
+ }): MemberOpPlan | undefined;
136
+ /** Write a member's Op pipeline files with their header and record them. Returns the paths written, relative to the current directory. */
137
+ export declare function writeMemberOpPipelines(plan: MemberOpPlan, files: {
138
+ name: string;
139
+ yaml: string;
140
+ }[]): string[];
141
+ /** A message for an error from planning: a declaration error with its file and line, or the error's own message. */
142
+ export declare function describeError(err: unknown): string;
143
+ //# sourceMappingURL=member-pipeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"member-pipeline.d.ts","sourceRoot":"","sources":["../../src/workspace/member-pipeline.ts"],"names":[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IAAI,EAAE,MAAM,GAAG,IAAI,CAI1F;AAED,0EAA0E;AAC1E,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,aAAa,CAAC;IACnB,MAAM,EAAE,cAAc,CAAC;IACvB,mDAAmD;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,uFAAuF;AACvF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,mBAAmB,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,YAAY,GAAG,SAAS,CAsB3B;AAED,0IAA0I;AAC1I,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,GAAG,MAAM,EAAE,CAY5G;AAED,oHAAoH;AACpH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAGlD"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * `chant workspace member-run` (#2537): the one process a toolchain runs for
3
+ * `chant workspace build|lint|audit|graph`.
4
+ *
5
+ * `member-commands.ts` groups the members by the chant each one resolves
6
+ * (#2524 D3, "one process per toolchain identity") and spawns that chant's
7
+ * `workspace member-run` once per group. The request arrives as JSON on
8
+ * stdin: the level-0 command line for each member, and the member's
9
+ * directory. This process runs them one after another, in-process, from
10
+ * inside each directory, so every member gets what `chant <verb> .` would
11
+ * print there. It answers on stdout with one {@link PROTOCOL_PREFIX} line per
12
+ * member, after a header line naming the protocol and this chant's version.
13
+ *
14
+ * A chant older than this command has no header to print. The caller sees
15
+ * that and falls back to one level-0 process per member.
16
+ *
17
+ * Internal: not listed in `chant --help`, and the protocol may change with
18
+ * the caller, which is always a chant of the same or a newer release.
19
+ */
20
+ import type { CommandContext } from "../cli/registry.js";
21
+ /** Marks the lines of this protocol on stdout; anything else there is stray output. */
22
+ export declare const PROTOCOL_PREFIX = "@@chant-member-run@@ ";
23
+ export declare const MEMBER_RUN_PROTOCOL = 1;
24
+ export interface MemberRunRequest {
25
+ protocol: number;
26
+ units: MemberRunUnit[];
27
+ }
28
+ export interface MemberRunUnit {
29
+ /** Echoed back on the answer line. */
30
+ id: string;
31
+ /** The member's directory, absolute. The command runs from inside it. */
32
+ dir: string;
33
+ /** The level-0 command line, such as `["lint", ".", "--format", "sarif"]`. */
34
+ argv: string[];
35
+ /**
36
+ * Directories (relative to `dir`) to leave out of discovery. Set for member
37
+ * `.`, whose project is the root minus every other member. Kept in the
38
+ * protocol for a member-run from before #2527, which applied it itself;
39
+ * from #2527 on, discovery reads the same set from the declaration.
40
+ */
41
+ exclude?: string[];
42
+ }
43
+ export type MemberRunLine = {
44
+ type: "header";
45
+ protocol: number;
46
+ chant: string;
47
+ } | {
48
+ type: "result";
49
+ id: string;
50
+ exitCode: number;
51
+ stdout: string;
52
+ stderr: string;
53
+ };
54
+ /**
55
+ * Run `fn` with stdout, stderr and `process.exit` captured. Commands print
56
+ * through `console`, which writes through the stream's `write` at call time,
57
+ * so replacing `write` catches everything they print.
58
+ */
59
+ export declare function captureRun(fn: () => Promise<number>): Promise<{
60
+ exitCode: number;
61
+ stdout: string;
62
+ stderr: string;
63
+ }>;
64
+ /** Run each unit of `request` in turn, answering on stdout. */
65
+ export declare function runMemberUnits(request: MemberRunRequest, run: (argv: string[]) => Promise<number>): Promise<number>;
66
+ export declare function runWorkspaceMemberRun(_ctx: CommandContext, run: (argv: string[]) => Promise<number>): Promise<number>;
67
+ //# sourceMappingURL=member-run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"member-run.d.ts","sourceRoot":"","sources":["../../src/workspace/member-run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OA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AI,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAa3H"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * The workspace read contract's closed list of reason codes (#2536, #2524
3
+ * D15, ws-017, ws-020).
4
+ *
5
+ * Every code a `chant workspace` read prints is here: the error that stops a
6
+ * read, the reason an unreadable member, group, ledger or record is listed
7
+ * with, and the lineage lock findings of `check`. Each command's own list
8
+ * (`WORKSPACE_ERROR_CODES`, `MEMBER_REASON_CODES`, `STATUS_REASON_CODES`,
9
+ * `RECORD_REASON_CODES` and the rest) is a subset of this one, which the
10
+ * compiler checks through `satisfies`. `reason-codes.test.ts` checks that the
11
+ * output schemas and the source emit nothing outside it.
12
+ *
13
+ * The list is closed: a reader may switch on a code, and a new code is a
14
+ * contract change. Within contract version 1, before the floor release, codes
15
+ * may still be added; after it, a new code means a new contract version.
16
+ *
17
+ * `chant workspace check` also reports `WSP` ids. Those are the declaration
18
+ * check catalog (`checks.ts`), a separate closed list, and a finding whose
19
+ * cause is one of the codes here carries that code too.
20
+ */
21
+ /** The version of the read contract this chant writes: the declaration format, the output schemas and these codes. */
22
+ export declare const READ_CONTRACT_VERSION = 1;
23
+ /** The first chant release that writes contract version 1. A reader that needs the contract refuses an older chant. */
24
+ export declare const READ_CONTRACT_FLOOR = "0.81.0";
25
+ /** Each code and what it means. The key order is the order the docs list them in. */
26
+ export declare const REASONS: {
27
+ readonly "declaration-missing": "No chant.workspace.json or .jsonc between the directory and the git root.";
28
+ readonly "declaration-ambiguous": "Both chant.workspace.json and chant.workspace.jsonc exist.";
29
+ readonly "declaration-unparseable": "The declaration is not valid JSON, or not valid JSONC for .jsonc.";
30
+ readonly "declaration-invalid": "The declaration does not match its schema, repeats a name, or --member names no entry.";
31
+ readonly "placement-invalid": "A member or group match breaks a placement rule.";
32
+ readonly "reader-too-old": "The declaration's minReader is newer than the chant reading it.";
33
+ readonly "root-chant-required": "The declaration pins a chant version other than the reader's, and that chant is not installed at the workspace root.";
34
+ readonly "not-a-git-repository": "--at, or a ledger read, needs a git repository and there is none.";
35
+ readonly "revision-unknown": "--at names no commit.";
36
+ readonly "environment-invalid": "An environment name that can't name a ledger directory.";
37
+ readonly "dir-missing": "The member's directory does not exist.";
38
+ readonly "unknown-kind": "No built-in kind or pinned package supplies the member's kind.";
39
+ readonly "kind-probe-failed": "The member's directory is not what its kind reads.";
40
+ readonly "no-matches": "An example group matches no directory holding a chant project.";
41
+ readonly "kind-not-run": "The member's kind is one the per-member commands don't run, such as other.";
42
+ readonly "command-failed": "The member's own command exited with a failure.";
43
+ readonly "output-unreadable": "The member's command printed something that isn't the document asked for.";
44
+ readonly "ir-version-unsupported": "The member's IR has a version this chant can't read.";
45
+ readonly "ledger-unreadable": "Reading the ledger failed, so nothing from it is listed.";
46
+ readonly "ledger-malformed": "Some lines of the ledger aren't release records; the rest are listed.";
47
+ readonly "record-unparseable": "No front matter, a YAML error, or a value outside the JSON subset of YAML.";
48
+ readonly "record-schema-invalid": "The front matter does not match the kind's schema.";
49
+ readonly "record-id-duplicate": "Another record earlier in path order has the same id.";
50
+ readonly "record-supersedes-unknown": "A supersedes link names an id no record has.";
51
+ readonly "record-supersedes-conflict": "A second closed record supersedes a record another one already superseded.";
52
+ readonly "kind-unreadable": "The record kind file is missing or could not be imported.";
53
+ readonly "kind-invalid": "The record kind file exports no recordKind, or its shape is wrong.";
54
+ readonly "schema-unreadable": "The schema file the record kind names is missing or is not JSON.";
55
+ readonly "schema-id-mismatch": "The schema's $id differs from the id the record kind names.";
56
+ readonly "schema-invalid": "The record schema itself does not compile.";
57
+ readonly "location-missing": "The records directory does not exist, in the tree or at the revision.";
58
+ readonly "lock-invalid": "The lineage lock can't be read.";
59
+ readonly "manual-step-open": "A scope in the lineage lock has an open manual step.";
60
+ };
61
+ export type ReasonCode = keyof typeof REASONS;
62
+ /** Every code, in the order of {@link REASONS}. */
63
+ export declare const REASON_CODES: ReasonCode[];
64
+ export declare function isReasonCode(value: unknown): value is ReasonCode;
65
+ //# sourceMappingURL=reason-codes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reason-codes.d.ts","sourceRoot":"","sources":["../../src/workspace/reason-codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,sHAAsH;AACtH,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC,uHAAuH;AACvH,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAE5C,qFAAqF;AACrF,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CV,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,OAAO,CAAC;AAE9C,mDAAmD;AACnD,eAAO,MAAM,YAAY,EAA2B,UAAU,EAAE,CAAC;AAEjE,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAEhE"}
@@ -1,6 +1,7 @@
1
1
  /**
2
- * `chant workspace records --kind <path> [--current] [--at <rev>] [--json]`,
3
- * the first-test slice of the records query (#2546, #2536).
2
+ * `chant workspace records --kind <path> [--current] [--at <rev>] [--base <rev>]
3
+ * [--require attested] [--json]`, the first-test slice of the records query
4
+ * (#2546, #2536), with each record's provenance level (#2547).
4
5
  *
5
6
  * It reads every record the kind file locates and prints them, with reason
6
7
  * codes for any that are invalid. An invalid record never fails the command:
@@ -12,17 +13,37 @@
12
13
  */
13
14
  import type { CommandContext } from "../cli/registry.js";
14
15
  import { type ReadErrorCode, type RecordEntry } from "./records.js";
16
+ import { type ProvenanceLevel } from "./trust/attestor.js";
17
+ import { type BaseSource, type RecordProvenance } from "./trust/provenance.js";
15
18
  /** The version of the `records` output this chant writes. */
16
19
  export declare const RECORDS_CONTRACT_VERSION = 1;
17
20
  /** `$id` of the JSON Schema for the `--json` output, shipped beside this file. */
18
21
  export declare const RECORDS_OUTPUT_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/records/v1/records.schema.json";
22
+ /** Exit code when the read worked and a record falls below `--require`. */
23
+ export declare const EXIT_BELOW_REQUIRED = 2;
19
24
  export interface RecordsQuery {
20
25
  kind: string;
21
26
  current?: boolean;
22
27
  at?: string;
28
+ /** The revision the trust policy is read at (#2547). Defaults to the target branch tip. */
29
+ base?: string;
23
30
  /** Where `kind` is resolved from and the repository is found. */
24
31
  cwd: string;
25
32
  }
33
+ /** A record as the output carries it: the entry plus its provenance (#2547). */
34
+ export type RecordView = RecordEntry & {
35
+ provenance: RecordProvenance;
36
+ };
37
+ /** Where provenance was judged from (#2547). */
38
+ export interface TrustView {
39
+ /** The full commit id the policy was read at, or null when there is no base. */
40
+ base: string | null;
41
+ baseFrom: BaseSource | null;
42
+ /** Whether a signers file exists at base. False means every record is `unattested`. */
43
+ active: boolean;
44
+ signersPath: string;
45
+ problems: string[];
46
+ }
26
47
  /** The `records` output: a result, or a failure with one error code. */
27
48
  export type RecordsDocument = {
28
49
  $schema: string;
@@ -34,7 +55,8 @@ export type RecordsDocument = {
34
55
  };
35
56
  at: string | null;
36
57
  current: boolean;
37
- records: RecordEntry[];
58
+ trust: TrustView;
59
+ records: RecordView[];
38
60
  summary: {
39
61
  total: number;
40
62
  valid: number;
@@ -52,6 +74,8 @@ export type RecordsDocument = {
52
74
  /** Run the query and build the document `--json` prints. Never throws a {@link RecordReadError}. */
53
75
  export declare function queryRecords(query: RecordsQuery): Promise<RecordsDocument>;
54
76
  export declare function runWorkspaceRecords(ctx: CommandContext): Promise<number>;
55
- /** `chant workspace <anything else>`: only `records` exists so far. */
77
+ /** Records whose provenance falls below `required`. Only `attested` can be required. */
78
+ export declare function belowRequired(records: RecordView[], required: ProvenanceLevel): RecordView[];
79
+ /** `chant workspace <anything else>`. */
56
80
  export declare function runWorkspaceUnknown(ctx: CommandContext): Promise<number>;
57
81
  //# sourceMappingURL=records-cli.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"records-cli.d.ts","sourceRoot":"","sources":["../../src/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H,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAgB1D;AA0BD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,0DAA0D;IAC1D,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,iGAAiG;IACjG,IAAI,EAAE,MAAM,CAAC;IACb,wEAAwE;IACxE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,sFAAsF;IACtF,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CACtC;AAED,MAAM,WAAW,kBAAkB;IACjC,iFAAiF;IACjF,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,YAAY,CAAC;IACrB,oDAAoD;IACpD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;CAChF;AAsBD,oEAAoE;AACpE,wBAAsB,WAAW,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAgFnH"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * `chant build` and `chant lint` at the root of a declared workspace (#2537,
3
+ * #2524 D0 and D12, ws-023).
4
+ *
5
+ * Once `chant.workspace.json` declares members, their directories leave the
6
+ * root project. A top-level `chant build` there would quietly build less than
7
+ * it did before the file existed, so both commands refuse with `WSP000` and
8
+ * point to `chant workspace build` and `chant workspace lint`. `--root-only`,
9
+ * or `rootOnly: true` in the root's `chant.config`, lets them run on the root
10
+ * project alone, with the member directories and example-group matches left
11
+ * out of discovery.
12
+ *
13
+ * `main.ts` decides with `findWorkspaceRoot` and `findProjectRoot`, which only
14
+ * test whether files exist, and imports this module only when the command's
15
+ * project is a declared root. A project with no declaration never loads it.
16
+ */
17
+ /** The code a refusal carries. `WSP` ids name workspace findings (#2524 D16); `000` is the refusal itself. */
18
+ export declare const ROOT_REFUSAL_CODE = "WSP000";
19
+ export interface RootGuardInput {
20
+ verb: "build" | "lint";
21
+ /** The command's target, absolute. */
22
+ target: string;
23
+ /** The directory holding the declaration, absolute. */
24
+ workspaceDir: string;
25
+ /** `--root-only` on the command line, or `rootOnly: true` in the root's chant.config. */
26
+ rootOnly: boolean;
27
+ }
28
+ export type RootGuardResult =
29
+ /** The target belongs to a member or an example group, so it is not the root project; nothing changes. */
30
+ {
31
+ action: "not-root";
32
+ }
33
+ /** The command runs on the root project with these directories (relative to the root) left out. */
34
+ | {
35
+ action: "root-only";
36
+ excluded: string[];
37
+ }
38
+ /** The command stops; `message` says why and what to run instead. */
39
+ | {
40
+ action: "refuse";
41
+ message: string;
42
+ };
43
+ /** Decide what a root `build` or `lint` does. Pure apart from reading the declaration. */
44
+ export declare function decideRootCommand(input: RootGuardInput): RootGuardResult;
45
+ /**
46
+ * Apply {@link decideRootCommand}: print the refusal and return 1, or return
47
+ * undefined so the command goes on. A root-only run needs nothing set up:
48
+ * every discovery walk under a declaration already leaves the member
49
+ * directories and group matches out (#2527, `workspaceMemberDirs` in
50
+ * `../discovery/walk.ts`), and `excluded` names the same directories.
51
+ */
52
+ export declare function guardRootCommand(input: RootGuardInput): number | undefined;
53
+ //# sourceMappingURL=root-refusal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root-refusal.d.ts","sourceRoot":"","sources":["../../src/workspace/root-refusal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAOH,8GAA8G;AAC9G,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAE1C,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IACvB,sCAAsC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,YAAY,EAAE,MAAM,CAAC;IACrB,yFAAyF;IACzF,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,MAAM,eAAe;AACzB,0GAA0G;AACxG;IAAE,MAAM,EAAE,UAAU,CAAA;CAAE;AACxB,mGAAmG;GACjG;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE;AAC7C,qEAAqE;GACnE;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1C,0FAA0F;AAC1F,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,GAAG,eAAe,CAoCxE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS,CAO1E"}