@intentius/chant 0.13.0 → 0.15.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 (453) hide show
  1. package/dist/audit/catalog.d.ts +45 -5
  2. package/dist/audit/catalog.d.ts.map +1 -1
  3. package/dist/audit/fetch.d.ts.map +1 -1
  4. package/dist/audit/proof.d.ts +3 -0
  5. package/dist/audit/proof.d.ts.map +1 -1
  6. package/dist/audit/report-model.d.ts +4 -1
  7. package/dist/audit/report-model.d.ts.map +1 -1
  8. package/dist/audit/report.d.ts +3 -0
  9. package/dist/audit/report.d.ts.map +1 -1
  10. package/dist/audit/rules-doc.d.ts +8 -2
  11. package/dist/audit/rules-doc.d.ts.map +1 -1
  12. package/dist/cli/commands/audit.d.ts.map +1 -1
  13. package/dist/cli/commands/doctor.d.ts.map +1 -1
  14. package/dist/cli/commands/lexicon-rolling-upgrade.d.ts +37 -0
  15. package/dist/cli/commands/lexicon-rolling-upgrade.d.ts.map +1 -0
  16. package/dist/cli/commands/lexicon-surface-diff.d.ts +48 -0
  17. package/dist/cli/commands/lexicon-surface-diff.d.ts.map +1 -0
  18. package/dist/cli/commands/lint.d.ts.map +1 -1
  19. package/dist/cli/commands/pinned-upgrade.d.ts +41 -0
  20. package/dist/cli/commands/pinned-upgrade.d.ts.map +1 -0
  21. package/dist/cli/handlers/build.d.ts.map +1 -1
  22. package/dist/cli/handlers/components.d.ts +39 -0
  23. package/dist/cli/handlers/components.d.ts.map +1 -0
  24. package/dist/cli/handlers/dev.d.ts +3 -0
  25. package/dist/cli/handlers/dev.d.ts.map +1 -1
  26. package/dist/cli/handlers/graph.d.ts +4 -2
  27. package/dist/cli/handlers/graph.d.ts.map +1 -1
  28. package/dist/cli/handlers/misc.d.ts.map +1 -1
  29. package/dist/cli/handlers/run.d.ts +49 -0
  30. package/dist/cli/handlers/run.d.ts.map +1 -1
  31. package/dist/cli/main.d.ts.map +1 -1
  32. package/dist/cli/registry.d.ts +35 -0
  33. package/dist/cli/registry.d.ts.map +1 -1
  34. package/dist/codegen/fetch.d.ts +22 -0
  35. package/dist/codegen/fetch.d.ts.map +1 -1
  36. package/dist/codegen/lexicon-regen.d.ts +110 -0
  37. package/dist/codegen/lexicon-regen.d.ts.map +1 -0
  38. package/dist/codegen/pinned-upgrade.d.ts +153 -0
  39. package/dist/codegen/pinned-upgrade.d.ts.map +1 -0
  40. package/dist/codegen/rolling-upgrade.d.ts +138 -0
  41. package/dist/codegen/rolling-upgrade.d.ts.map +1 -0
  42. package/dist/codegen/surface-snapshot.d.ts +173 -0
  43. package/dist/codegen/surface-snapshot.d.ts.map +1 -0
  44. package/dist/codegen/version-bump.d.ts +21 -0
  45. package/dist/codegen/version-bump.d.ts.map +1 -0
  46. package/dist/components/auto-release.d.ts +93 -0
  47. package/dist/components/auto-release.d.ts.map +1 -0
  48. package/dist/components/builders.d.ts +37 -0
  49. package/dist/components/builders.d.ts.map +1 -0
  50. package/dist/components/capability-plugin-loader.d.ts +111 -0
  51. package/dist/components/capability-plugin-loader.d.ts.map +1 -0
  52. package/dist/components/capability-plugin-schema.d.ts +24 -0
  53. package/dist/components/capability-plugin-schema.d.ts.map +1 -0
  54. package/dist/components/capability-plugin.d.ts +85 -0
  55. package/dist/components/capability-plugin.d.ts.map +1 -0
  56. package/dist/components/capability.d.ts +89 -0
  57. package/dist/components/capability.d.ts.map +1 -0
  58. package/dist/components/cli-support.d.ts +204 -0
  59. package/dist/components/cli-support.d.ts.map +1 -0
  60. package/dist/components/component.d.ts +179 -0
  61. package/dist/components/component.d.ts.map +1 -0
  62. package/dist/components/config-defaults.d.ts +41 -0
  63. package/dist/components/config-defaults.d.ts.map +1 -0
  64. package/dist/components/discover.d.ts +60 -0
  65. package/dist/components/discover.d.ts.map +1 -0
  66. package/dist/components/driver-output.d.ts +20 -0
  67. package/dist/components/driver-output.d.ts.map +1 -0
  68. package/dist/components/driver.d.ts +209 -0
  69. package/dist/components/driver.d.ts.map +1 -0
  70. package/dist/components/index.d.ts +22 -0
  71. package/dist/components/index.d.ts.map +1 -0
  72. package/dist/components/manifest-persistence.d.ts +79 -0
  73. package/dist/components/manifest-persistence.d.ts.map +1 -0
  74. package/dist/components/pilots/alb-ecs.pilot.d.ts +27 -0
  75. package/dist/components/pilots/alb-ecs.pilot.d.ts.map +1 -0
  76. package/dist/components/pilots/dynamodb.pilot.d.ts +22 -0
  77. package/dist/components/pilots/dynamodb.pilot.d.ts.map +1 -0
  78. package/dist/components/pilots/jar-emr.pilot.d.ts +37 -0
  79. package/dist/components/pilots/jar-emr.pilot.d.ts.map +1 -0
  80. package/dist/components/pilots/lambda.pilot.d.ts +35 -0
  81. package/dist/components/pilots/lambda.pilot.d.ts.map +1 -0
  82. package/dist/components/pilots/neo4j-fanout.pilot.d.ts +17 -0
  83. package/dist/components/pilots/neo4j-fanout.pilot.d.ts.map +1 -0
  84. package/dist/components/pilots/project.d.ts +13 -0
  85. package/dist/components/pilots/project.d.ts.map +1 -0
  86. package/dist/components/presets/ecs-fargate.d.ts +59 -0
  87. package/dist/components/presets/ecs-fargate.d.ts.map +1 -0
  88. package/dist/components/presets/index.d.ts +29 -0
  89. package/dist/components/presets/index.d.ts.map +1 -0
  90. package/dist/components/presets/lambda.d.ts +35 -0
  91. package/dist/components/presets/lambda.d.ts.map +1 -0
  92. package/dist/components/presets/single-host-compose.d.ts +43 -0
  93. package/dist/components/presets/single-host-compose.d.ts.map +1 -0
  94. package/dist/components/registry.d.ts +29 -0
  95. package/dist/components/registry.d.ts.map +1 -0
  96. package/dist/components/starter-plugin.d.ts +51 -0
  97. package/dist/components/starter-plugin.d.ts.map +1 -0
  98. package/dist/components/temporal-codegen-loader.d.ts +27 -0
  99. package/dist/components/temporal-codegen-loader.d.ts.map +1 -0
  100. package/dist/components/verbs/__tests__/mock-cloud-executor.d.ts +35 -0
  101. package/dist/components/verbs/__tests__/mock-cloud-executor.d.ts.map +1 -0
  102. package/dist/components/verbs/__tests__/mock-process-runner.d.ts +45 -0
  103. package/dist/components/verbs/__tests__/mock-process-runner.d.ts.map +1 -0
  104. package/dist/components/verbs/__tests__/mock-sbom-generator.d.ts +33 -0
  105. package/dist/components/verbs/__tests__/mock-sbom-generator.d.ts.map +1 -0
  106. package/dist/components/verbs/bom-writer.d.ts +155 -0
  107. package/dist/components/verbs/bom-writer.d.ts.map +1 -0
  108. package/dist/components/verbs/build-archive.d.ts +205 -0
  109. package/dist/components/verbs/build-archive.d.ts.map +1 -0
  110. package/dist/components/verbs/build.d.ts +150 -0
  111. package/dist/components/verbs/build.d.ts.map +1 -0
  112. package/dist/components/verbs/cloud-executor.d.ts +88 -0
  113. package/dist/components/verbs/cloud-executor.d.ts.map +1 -0
  114. package/dist/components/verbs/component-bom.d.ts +103 -0
  115. package/dist/components/verbs/component-bom.d.ts.map +1 -0
  116. package/dist/components/verbs/index.d.ts +49 -0
  117. package/dist/components/verbs/index.d.ts.map +1 -0
  118. package/dist/components/verbs/license-policy.d.ts +56 -0
  119. package/dist/components/verbs/license-policy.d.ts.map +1 -0
  120. package/dist/components/verbs/lockfile-sbom-generator.d.ts +81 -0
  121. package/dist/components/verbs/lockfile-sbom-generator.d.ts.map +1 -0
  122. package/dist/components/verbs/process-runner.d.ts +64 -0
  123. package/dist/components/verbs/process-runner.d.ts.map +1 -0
  124. package/dist/components/verbs/reproducibility.d.ts +80 -0
  125. package/dist/components/verbs/reproducibility.d.ts.map +1 -0
  126. package/dist/components/verbs/sbom-generator.d.ts +157 -0
  127. package/dist/components/verbs/sbom-generator.d.ts.map +1 -0
  128. package/dist/components/verbs/sbom.d.ts +79 -0
  129. package/dist/components/verbs/sbom.d.ts.map +1 -0
  130. package/dist/components/verbs/shell.d.ts +35 -0
  131. package/dist/components/verbs/shell.d.ts.map +1 -0
  132. package/dist/components/verbs/sign.d.ts +222 -0
  133. package/dist/components/verbs/sign.d.ts.map +1 -0
  134. package/dist/components/verbs/stub.d.ts +18 -0
  135. package/dist/components/verbs/stub.d.ts.map +1 -0
  136. package/dist/components/verbs/tool-sbom-generator.d.ts +51 -0
  137. package/dist/components/verbs/tool-sbom-generator.d.ts.map +1 -0
  138. package/dist/components/verbs/verify.d.ts +106 -0
  139. package/dist/components/verbs/verify.d.ts.map +1 -0
  140. package/dist/components/verbs/vex.d.ts +65 -0
  141. package/dist/components/verbs/vex.d.ts.map +1 -0
  142. package/dist/components/verbs/vuln-gate.d.ts +91 -0
  143. package/dist/components/verbs/vuln-gate.d.ts.map +1 -0
  144. package/dist/components/verbs/vuln-scan.d.ts +116 -0
  145. package/dist/components/verbs/vuln-scan.d.ts.map +1 -0
  146. package/dist/components/verbs/wait-verify.d.ts +85 -0
  147. package/dist/components/verbs/wait-verify.d.ts.map +1 -0
  148. package/dist/config.d.ts +205 -0
  149. package/dist/config.d.ts.map +1 -1
  150. package/dist/index.d.ts +4 -0
  151. package/dist/index.d.ts.map +1 -1
  152. package/dist/lexicon.d.ts +78 -0
  153. package/dist/lexicon.d.ts.map +1 -1
  154. package/dist/lifecycle/build-ledger-store.d.ts +121 -0
  155. package/dist/lifecycle/build-ledger-store.d.ts.map +1 -0
  156. package/dist/lifecycle/build-ledger.d.ts +225 -0
  157. package/dist/lifecycle/build-ledger.d.ts.map +1 -0
  158. package/dist/lifecycle/git.d.ts +84 -0
  159. package/dist/lifecycle/git.d.ts.map +1 -1
  160. package/dist/lifecycle/index.d.ts +5 -0
  161. package/dist/lifecycle/index.d.ts.map +1 -1
  162. package/dist/lifecycle/oras-referrer-lookup.d.ts +41 -0
  163. package/dist/lifecycle/oras-referrer-lookup.d.ts.map +1 -0
  164. package/dist/lifecycle/release-ledger.d.ts +122 -0
  165. package/dist/lifecycle/release-ledger.d.ts.map +1 -0
  166. package/dist/lifecycle/status.d.ts +150 -0
  167. package/dist/lifecycle/status.d.ts.map +1 -0
  168. package/dist/lint/component-checks.d.ts +95 -0
  169. package/dist/lint/component-checks.d.ts.map +1 -0
  170. package/dist/lint/engine.d.ts +23 -0
  171. package/dist/lint/engine.d.ts.map +1 -1
  172. package/dist/lint/presets/strict.json +8 -1
  173. package/dist/lint/rules/__fixtures__/comp/comp000-discovery-error/broken-a.component.d.ts +4 -0
  174. package/dist/lint/rules/__fixtures__/comp/comp000-discovery-error/broken-a.component.d.ts.map +1 -0
  175. package/dist/lint/rules/__fixtures__/comp/comp000-discovery-error/broken-b.component.d.ts +4 -0
  176. package/dist/lint/rules/__fixtures__/comp/comp000-discovery-error/broken-b.component.d.ts.map +1 -0
  177. package/dist/lint/rules/__fixtures__/comp/comp001/fail/orphan-lib.component.d.ts +4 -0
  178. package/dist/lint/rules/__fixtures__/comp/comp001/fail/orphan-lib.component.d.ts.map +1 -0
  179. package/dist/lint/rules/__fixtures__/comp/comp001/pass/emr-job.component.d.ts +4 -0
  180. package/dist/lint/rules/__fixtures__/comp/comp001/pass/emr-job.component.d.ts.map +1 -0
  181. package/dist/lint/rules/__fixtures__/comp/comp001/pass/jar-lib.component.d.ts +4 -0
  182. package/dist/lint/rules/__fixtures__/comp/comp001/pass/jar-lib.component.d.ts.map +1 -0
  183. package/dist/lint/rules/__fixtures__/comp/comp002/fail/search-service.component.d.ts +10 -0
  184. package/dist/lint/rules/__fixtures__/comp/comp002/fail/search-service.component.d.ts.map +1 -0
  185. package/dist/lint/rules/__fixtures__/comp/comp002/pass/jar-lib.component.d.ts +3 -0
  186. package/dist/lint/rules/__fixtures__/comp/comp002/pass/jar-lib.component.d.ts.map +1 -0
  187. package/dist/lint/rules/__fixtures__/comp/comp002/pass/search-service.component.d.ts +4 -0
  188. package/dist/lint/rules/__fixtures__/comp/comp002/pass/search-service.component.d.ts.map +1 -0
  189. package/dist/lint/rules/__fixtures__/comp/comp003/fail/migrator.component.d.ts +4 -0
  190. package/dist/lint/rules/__fixtures__/comp/comp003/fail/migrator.component.d.ts.map +1 -0
  191. package/dist/lint/rules/__fixtures__/comp/comp003/pass/migrator.component.d.ts +4 -0
  192. package/dist/lint/rules/__fixtures__/comp/comp003/pass/migrator.component.d.ts.map +1 -0
  193. package/dist/lint/rules/__fixtures__/comp/comp003/pass/orders-table.component.d.ts +4 -0
  194. package/dist/lint/rules/__fixtures__/comp/comp003/pass/orders-table.component.d.ts.map +1 -0
  195. package/dist/lint/rules/__fixtures__/comp/comp004/fail/neo4j-cluster.component.d.ts +4 -0
  196. package/dist/lint/rules/__fixtures__/comp/comp004/fail/neo4j-cluster.component.d.ts.map +1 -0
  197. package/dist/lint/rules/__fixtures__/comp/comp004/pass/neo4j-cluster.component.d.ts +4 -0
  198. package/dist/lint/rules/__fixtures__/comp/comp004/pass/neo4j-cluster.component.d.ts.map +1 -0
  199. package/dist/lint/rules/__fixtures__/comp/comp004/pass/orders-table.component.d.ts +4 -0
  200. package/dist/lint/rules/__fixtures__/comp/comp004/pass/orders-table.component.d.ts.map +1 -0
  201. package/dist/lint/rules/__fixtures__/comp/comp005/fail/search-service.component.d.ts +4 -0
  202. package/dist/lint/rules/__fixtures__/comp/comp005/fail/search-service.component.d.ts.map +1 -0
  203. package/dist/lint/rules/__fixtures__/comp/comp005/pass/search-service.component.d.ts +4 -0
  204. package/dist/lint/rules/__fixtures__/comp/comp005/pass/search-service.component.d.ts.map +1 -0
  205. package/dist/lint/rules/__fixtures__/comp/comp006/fail/legacy-tool.component.d.ts +4 -0
  206. package/dist/lint/rules/__fixtures__/comp/comp006/fail/legacy-tool.component.d.ts.map +1 -0
  207. package/dist/lint/rules/__fixtures__/comp/comp006/pass/legacy-tool.component.d.ts +4 -0
  208. package/dist/lint/rules/__fixtures__/comp/comp006/pass/legacy-tool.component.d.ts.map +1 -0
  209. package/dist/lint/rules/__fixtures__/comp/comp007/fail/inventory-table.component.d.ts +4 -0
  210. package/dist/lint/rules/__fixtures__/comp/comp007/fail/inventory-table.component.d.ts.map +1 -0
  211. package/dist/lint/rules/__fixtures__/comp/comp007/fail/orders-table.component.d.ts +4 -0
  212. package/dist/lint/rules/__fixtures__/comp/comp007/fail/orders-table.component.d.ts.map +1 -0
  213. package/dist/lint/rules/__fixtures__/comp/comp007/pass/orders-table.component.d.ts +3 -0
  214. package/dist/lint/rules/__fixtures__/comp/comp007/pass/orders-table.component.d.ts.map +1 -0
  215. package/dist/lint/rules/__fixtures__/comp/comp007/pass/search-service.component.d.ts +4 -0
  216. package/dist/lint/rules/__fixtures__/comp/comp007/pass/search-service.component.d.ts.map +1 -0
  217. package/dist/lint/rules/comp/comp001-publishes-never-applies.d.ts +20 -0
  218. package/dist/lint/rules/comp/comp001-publishes-never-applies.d.ts.map +1 -0
  219. package/dist/lint/rules/comp/comp002-dangling-wiring-ref.d.ts +28 -0
  220. package/dist/lint/rules/comp/comp002-dangling-wiring-ref.d.ts.map +1 -0
  221. package/dist/lint/rules/comp/comp003-mutating-no-rollback.d.ts +39 -0
  222. package/dist/lint/rules/comp/comp003-mutating-no-rollback.d.ts.map +1 -0
  223. package/dist/lint/rules/comp/comp004-gate-needs-temporal.d.ts +37 -0
  224. package/dist/lint/rules/comp/comp004-gate-needs-temporal.d.ts.map +1 -0
  225. package/dist/lint/rules/comp/comp005-capability-kind-is-noun.d.ts +43 -0
  226. package/dist/lint/rules/comp/comp005-capability-kind-is-noun.d.ts.map +1 -0
  227. package/dist/lint/rules/comp/comp006-shell-needs-reason.d.ts +22 -0
  228. package/dist/lint/rules/comp/comp006-shell-needs-reason.d.ts.map +1 -0
  229. package/dist/lint/rules/comp/comp007-composition-sprawl.d.ts +33 -0
  230. package/dist/lint/rules/comp/comp007-composition-sprawl.d.ts.map +1 -0
  231. package/dist/lint/rules/comp/index.d.ts +18 -0
  232. package/dist/lint/rules/comp/index.d.ts.map +1 -0
  233. package/dist/lint/rules/comp/support.d.ts +71 -0
  234. package/dist/lint/rules/comp/support.d.ts.map +1 -0
  235. package/dist/lsp/lexicon-providers.d.ts.map +1 -1
  236. package/dist/op/activity-registry.d.ts +11 -6
  237. package/dist/op/activity-registry.d.ts.map +1 -1
  238. package/dist/op/activity-runtime.d.ts +24 -0
  239. package/dist/op/activity-runtime.d.ts.map +1 -0
  240. package/dist/op/builders.d.ts +56 -0
  241. package/dist/op/builders.d.ts.map +1 -1
  242. package/dist/op/index.d.ts +2 -1
  243. package/dist/op/index.d.ts.map +1 -1
  244. package/dist/ownership.d.ts +20 -14
  245. package/dist/ownership.d.ts.map +1 -1
  246. package/package.json +14 -1
  247. package/src/audit/catalog.test.ts +74 -22
  248. package/src/audit/catalog.ts +74 -471
  249. package/src/audit/fetch.test.ts +112 -8
  250. package/src/audit/fetch.ts +53 -8
  251. package/src/audit/proof.ts +4 -2
  252. package/src/audit/report-html.test.ts +14 -7
  253. package/src/audit/report-model.ts +20 -9
  254. package/src/audit/report.test.ts +36 -13
  255. package/src/audit/report.ts +2 -0
  256. package/src/audit/rules-doc.test.ts +8 -6
  257. package/src/audit/rules-doc.ts +13 -5
  258. package/src/cli/commands/audit.ts +23 -18
  259. package/src/cli/commands/component-lint.test.ts +158 -0
  260. package/src/cli/commands/doctor.test.ts +116 -2
  261. package/src/cli/commands/doctor.ts +46 -0
  262. package/src/cli/commands/lexicon-rolling-upgrade.ts +198 -0
  263. package/src/cli/commands/lexicon-surface-diff.test.ts +104 -0
  264. package/src/cli/commands/lexicon-surface-diff.ts +185 -0
  265. package/src/cli/commands/lint.ts +142 -1
  266. package/src/cli/commands/pinned-upgrade.ts +204 -0
  267. package/src/cli/handlers/build.ts +58 -1
  268. package/src/cli/handlers/components.test.ts +504 -0
  269. package/src/cli/handlers/components.ts +404 -0
  270. package/src/cli/handlers/dev.ts +60 -1
  271. package/src/cli/handlers/graph.ts +47 -2
  272. package/src/cli/handlers/misc.ts +45 -1
  273. package/src/cli/handlers/run.test.ts +967 -3
  274. package/src/cli/handlers/run.ts +618 -11
  275. package/src/cli/main.test.ts +66 -0
  276. package/src/cli/main.ts +105 -2
  277. package/src/cli/registry.ts +35 -0
  278. package/src/codegen/fetch.test.ts +84 -3
  279. package/src/codegen/fetch.ts +76 -2
  280. package/src/codegen/lexicon-regen.test.ts +298 -0
  281. package/src/codegen/lexicon-regen.ts +545 -0
  282. package/src/codegen/pinned-upgrade.test.ts +399 -0
  283. package/src/codegen/pinned-upgrade.ts +423 -0
  284. package/src/codegen/rolling-upgrade.test.ts +333 -0
  285. package/src/codegen/rolling-upgrade.ts +320 -0
  286. package/src/codegen/surface-snapshot.test.ts +461 -0
  287. package/src/codegen/surface-snapshot.ts +546 -0
  288. package/src/codegen/version-bump.test.ts +47 -0
  289. package/src/codegen/version-bump.ts +39 -0
  290. package/src/components/README.md +130 -0
  291. package/src/components/SPRAWL-VALIDATION.md +181 -0
  292. package/src/components/__fixtures__/alb-ecs-service.json +51 -0
  293. package/src/components/__fixtures__/dynamodb-infra.json +32 -0
  294. package/src/components/__fixtures__/emr-job-consumer.json +26 -0
  295. package/src/components/__fixtures__/jar-lib-producer.json +16 -0
  296. package/src/components/__fixtures__/lambda-image-processor.json +28 -0
  297. package/src/components/__fixtures__/neo4j-fanout.json +34 -0
  298. package/src/components/__fixtures__/single-host-compose.json +29 -0
  299. package/src/components/auto-release.test.ts +217 -0
  300. package/src/components/auto-release.ts +216 -0
  301. package/src/components/builders.test.ts +45 -0
  302. package/src/components/builders.ts +71 -0
  303. package/src/components/capability-plugin-loader.ts +218 -0
  304. package/src/components/capability-plugin-schema.ts +56 -0
  305. package/src/components/capability-plugin.test.ts +235 -0
  306. package/src/components/capability-plugin.ts +108 -0
  307. package/src/components/capability.ts +117 -0
  308. package/src/components/cli-support.test.ts +579 -0
  309. package/src/components/cli-support.ts +481 -0
  310. package/src/components/component-schema.test.ts +265 -0
  311. package/src/components/component.schema.json +235 -0
  312. package/src/components/component.test.ts +251 -0
  313. package/src/components/component.ts +255 -0
  314. package/src/components/config-defaults.test.ts +263 -0
  315. package/src/components/config-defaults.ts +145 -0
  316. package/src/components/discover.test.ts +352 -0
  317. package/src/components/discover.ts +167 -0
  318. package/src/components/driver-output.ts +71 -0
  319. package/src/components/driver.test.ts +638 -0
  320. package/src/components/driver.ts +690 -0
  321. package/src/components/index.ts +113 -0
  322. package/src/components/manifest-persistence.test.ts +152 -0
  323. package/src/components/manifest-persistence.ts +164 -0
  324. package/src/components/pilots/README.md +33 -0
  325. package/src/components/pilots/alb-ecs.pilot.ts +63 -0
  326. package/src/components/pilots/dynamodb.pilot.ts +59 -0
  327. package/src/components/pilots/jar-emr.pilot.ts +69 -0
  328. package/src/components/pilots/lambda.pilot.ts +55 -0
  329. package/src/components/pilots/neo4j-fanout.pilot.ts +92 -0
  330. package/src/components/pilots/pilots-lint-clean.test.ts +78 -0
  331. package/src/components/pilots/pilots.test.ts +126 -0
  332. package/src/components/pilots/project.ts +13 -0
  333. package/src/components/presets/comp007-reduction.test.ts +122 -0
  334. package/src/components/presets/ecs-fargate.test.ts +84 -0
  335. package/src/components/presets/ecs-fargate.ts +103 -0
  336. package/src/components/presets/index.ts +32 -0
  337. package/src/components/presets/lambda.test.ts +35 -0
  338. package/src/components/presets/lambda.ts +53 -0
  339. package/src/components/presets/single-host-compose.test.ts +65 -0
  340. package/src/components/presets/single-host-compose.ts +64 -0
  341. package/src/components/registry.test.ts +112 -0
  342. package/src/components/registry.ts +37 -0
  343. package/src/components/starter-plugin.ts +105 -0
  344. package/src/components/temporal-codegen-loader.ts +41 -0
  345. package/src/components/verbs/__fixtures__/package-lock.json +45 -0
  346. package/src/components/verbs/__fixtures__/pom.xml +37 -0
  347. package/src/components/verbs/__fixtures__/schemas/cyclonedx-1.5.schema.json +3800 -0
  348. package/src/components/verbs/__fixtures__/schemas/cyclonedx-spdx-license.schema.json +621 -0
  349. package/src/components/verbs/__fixtures__/schemas/jsf-0.82.schema.json +240 -0
  350. package/src/components/verbs/__fixtures__/schemas/spdx-2.3.schema.json +740 -0
  351. package/src/components/verbs/__tests__/mock-cloud-executor.ts +102 -0
  352. package/src/components/verbs/__tests__/mock-process-runner.ts +79 -0
  353. package/src/components/verbs/__tests__/mock-sbom-generator.ts +85 -0
  354. package/src/components/verbs/bom-writer.test.ts +331 -0
  355. package/src/components/verbs/bom-writer.ts +386 -0
  356. package/src/components/verbs/build-archive.test.ts +251 -0
  357. package/src/components/verbs/build-archive.ts +296 -0
  358. package/src/components/verbs/build.test.ts +222 -0
  359. package/src/components/verbs/build.ts +252 -0
  360. package/src/components/verbs/cloud-executor.ts +181 -0
  361. package/src/components/verbs/component-bom.test.ts +219 -0
  362. package/src/components/verbs/component-bom.ts +189 -0
  363. package/src/components/verbs/index.ts +49 -0
  364. package/src/components/verbs/license-policy.ts +115 -0
  365. package/src/components/verbs/lockfile-sbom-generator.test.ts +195 -0
  366. package/src/components/verbs/lockfile-sbom-generator.ts +236 -0
  367. package/src/components/verbs/process-runner.test.ts +79 -0
  368. package/src/components/verbs/process-runner.ts +113 -0
  369. package/src/components/verbs/reproducibility.test.ts +24 -0
  370. package/src/components/verbs/reproducibility.ts +100 -0
  371. package/src/components/verbs/sbom-generator.test.ts +96 -0
  372. package/src/components/verbs/sbom-generator.ts +209 -0
  373. package/src/components/verbs/sbom.test.ts +184 -0
  374. package/src/components/verbs/sbom.ts +152 -0
  375. package/src/components/verbs/shell.test.ts +36 -0
  376. package/src/components/verbs/shell.ts +51 -0
  377. package/src/components/verbs/sign.test.ts +210 -0
  378. package/src/components/verbs/sign.ts +350 -0
  379. package/src/components/verbs/stub.ts +34 -0
  380. package/src/components/verbs/tool-sbom-generator.test.ts +194 -0
  381. package/src/components/verbs/tool-sbom-generator.ts +192 -0
  382. package/src/components/verbs/verify.test.ts +159 -0
  383. package/src/components/verbs/verify.ts +179 -0
  384. package/src/components/verbs/vex.ts +182 -0
  385. package/src/components/verbs/vuln-gate.test.ts +201 -0
  386. package/src/components/verbs/vuln-gate.ts +170 -0
  387. package/src/components/verbs/vuln-scan.test.ts +145 -0
  388. package/src/components/verbs/vuln-scan.ts +266 -0
  389. package/src/components/verbs/wait-verify.test.ts +111 -0
  390. package/src/components/verbs/wait-verify.ts +171 -0
  391. package/src/config.test.ts +74 -1
  392. package/src/config.ts +219 -0
  393. package/src/index.ts +32 -0
  394. package/src/lexicon.ts +88 -0
  395. package/src/lifecycle/build-ledger-store.test.ts +217 -0
  396. package/src/lifecycle/build-ledger-store.ts +165 -0
  397. package/src/lifecycle/build-ledger.test.ts +349 -0
  398. package/src/lifecycle/build-ledger.ts +305 -0
  399. package/src/lifecycle/git.test.ts +118 -0
  400. package/src/lifecycle/git.ts +149 -14
  401. package/src/lifecycle/index.ts +5 -0
  402. package/src/lifecycle/oras-referrer-lookup.test.ts +116 -0
  403. package/src/lifecycle/oras-referrer-lookup.ts +110 -0
  404. package/src/lifecycle/release-ledger.test.ts +209 -0
  405. package/src/lifecycle/release-ledger.ts +185 -0
  406. package/src/lifecycle/status.test.ts +330 -0
  407. package/src/lifecycle/status.ts +278 -0
  408. package/src/lint/component-checks.ts +148 -0
  409. package/src/lint/config.test.ts +21 -0
  410. package/src/lint/engine.ts +11 -2
  411. package/src/lint/presets/relaxed.json +8 -1
  412. package/src/lint/presets/strict.json +8 -1
  413. package/src/lint/rules/__fixtures__/comp/comp000-discovery-error/broken-a.component.ts +9 -0
  414. package/src/lint/rules/__fixtures__/comp/comp000-discovery-error/broken-b.component.ts +9 -0
  415. package/src/lint/rules/__fixtures__/comp/comp001/fail/orphan-lib.component.ts +11 -0
  416. package/src/lint/rules/__fixtures__/comp/comp001/pass/emr-job.component.ts +13 -0
  417. package/src/lint/rules/__fixtures__/comp/comp001/pass/jar-lib.component.ts +11 -0
  418. package/src/lint/rules/__fixtures__/comp/comp002/fail/search-service.component.ts +27 -0
  419. package/src/lint/rules/__fixtures__/comp/comp002/pass/jar-lib.component.ts +10 -0
  420. package/src/lint/rules/__fixtures__/comp/comp002/pass/search-service.component.ts +23 -0
  421. package/src/lint/rules/__fixtures__/comp/comp003/fail/migrator.component.ts +10 -0
  422. package/src/lint/rules/__fixtures__/comp/comp003/pass/migrator.component.ts +19 -0
  423. package/src/lint/rules/__fixtures__/comp/comp003/pass/orders-table.component.ts +10 -0
  424. package/src/lint/rules/__fixtures__/comp/comp004/fail/neo4j-cluster.component.ts +20 -0
  425. package/src/lint/rules/__fixtures__/comp/comp004/pass/neo4j-cluster.component.ts +23 -0
  426. package/src/lint/rules/__fixtures__/comp/comp004/pass/orders-table.component.ts +10 -0
  427. package/src/lint/rules/__fixtures__/comp/comp005/fail/search-service.component.ts +14 -0
  428. package/src/lint/rules/__fixtures__/comp/comp005/pass/search-service.component.ts +18 -0
  429. package/src/lint/rules/__fixtures__/comp/comp006/fail/legacy-tool.component.ts +10 -0
  430. package/src/lint/rules/__fixtures__/comp/comp006/pass/legacy-tool.component.ts +14 -0
  431. package/src/lint/rules/__fixtures__/comp/comp007/fail/inventory-table.component.ts +13 -0
  432. package/src/lint/rules/__fixtures__/comp/comp007/fail/orders-table.component.ts +13 -0
  433. package/src/lint/rules/__fixtures__/comp/comp007/pass/orders-table.component.ts +12 -0
  434. package/src/lint/rules/__fixtures__/comp/comp007/pass/search-service.component.ts +18 -0
  435. package/src/lint/rules/comp/comp.test.ts +378 -0
  436. package/src/lint/rules/comp/comp001-publishes-never-applies.ts +78 -0
  437. package/src/lint/rules/comp/comp002-dangling-wiring-ref.ts +94 -0
  438. package/src/lint/rules/comp/comp003-mutating-no-rollback.ts +115 -0
  439. package/src/lint/rules/comp/comp004-gate-needs-temporal.ts +66 -0
  440. package/src/lint/rules/comp/comp005-capability-kind-is-noun.ts +113 -0
  441. package/src/lint/rules/comp/comp006-shell-needs-reason.ts +55 -0
  442. package/src/lint/rules/comp/comp007-composition-sprawl.ts +71 -0
  443. package/src/lint/rules/comp/index.ts +37 -0
  444. package/src/lint/rules/comp/support.ts +173 -0
  445. package/src/lsp/lexicon-providers.test.ts +55 -0
  446. package/src/lsp/lexicon-providers.ts +13 -3
  447. package/src/op/activity-registry.test.ts +38 -0
  448. package/src/op/activity-registry.ts +31 -12
  449. package/src/op/activity-runtime.ts +73 -0
  450. package/src/op/builders.ts +92 -0
  451. package/src/op/index.ts +3 -1
  452. package/src/ownership.test.ts +24 -26
  453. package/src/ownership.ts +26 -38
@@ -0,0 +1,121 @@
1
+ /**
2
+ * Build-archive manifest store (#609, epic #551 follow-up to #564/#568/#606/
3
+ * #613/#614): persists a `BuildArchiveManifest`
4
+ * (../components/verbs/build-archive.ts) to a durable, content-addressed
5
+ * location so it survives past the in-process build/run that assembled it.
6
+ *
7
+ * **The gap this closes.** `docker-build` (../components/verbs/build.ts) and
8
+ * friends assemble a real `BuildArchiveManifest` in memory — complete with
9
+ * `sbom`/config-BOM entries (#606/#613) and per-artifact
10
+ * `reproducibility`/`provenance` (#614) — but nothing ever wrote it anywhere
11
+ * durable. `build-ledger.ts`'s `buildLedgerEntries`/`componentBomSummary` are
12
+ * unit-tested against a manifest handed to them directly, but
13
+ * `chant components status` (../cli/handlers/components.ts) had no manifest
14
+ * to hand them at all: `componentBom` and `build.reproducibility` were always
15
+ * `null` in that CLI path. This module is the missing durable layer — write
16
+ * once at build time, read back by digest at status time.
17
+ *
18
+ * **Storage choice: the `chant/lifecycle` orphan branch, a sibling namespace
19
+ * to the release ledger.** Reuses the exact git-plumbing
20
+ * `writeBlobToPath`/`readBlobFromPath`/`listFilesInDir` (./git.ts) that
21
+ * `writeSnapshot`/`appendReleaseRecordLine` already use — same hash-object →
22
+ * mktree → commit-tree → update-ref pipeline, same `--force-with-lease` push
23
+ * discipline (`pushLifecycle`), same "no checkout, no working tree changes"
24
+ * property. Rejected alternatives:
25
+ * - **A new on-disk directory in the working tree** — would need its own
26
+ * persistence/sync story (commit it? gitignore it? sync across CI
27
+ * runners?) that the orphan branch already solves for the release ledger;
28
+ * introducing a second mechanism for a manifest that is conceptually the
29
+ * same kind of durable, git-native record would be needless divergence.
30
+ * - **A path under `<env>/`** — a build archive is *not* env-scoped. The
31
+ * whole point of promote-by-digest (epic #551 "4. Build archive +
32
+ * deferred publish") is that one build's manifest is referenced from
33
+ * every environment it gets promoted to; writing it under a single env
34
+ * directory would either duplicate it per env (defeating "byte-identical
35
+ * across envs") or arbitrarily pick one env as "the" owner. Manifests
36
+ * instead live under a fixed top-level `_builds/` directory on the same
37
+ * orphan branch, keyed by `manifestDigest` — a peer of the per-env
38
+ * directories `writeSnapshot`/the release ledger already create there,
39
+ * never nested inside one.
40
+ *
41
+ * **Content-addressed, keyed by `manifestDigest`.** One file per manifest,
42
+ * `_builds/<manifestDigest-with-":"->"_">.json`, so a rebuild of
43
+ * byte-identical inputs (same `manifestDigest`, per
44
+ * ../components/verbs/build-archive.ts's module doc) overwrites its own
45
+ * entry with identical content rather than accumulating duplicates —
46
+ * `writeBlobToPath` already replaces-by-path, so this falls out for free.
47
+ * `findBuildManifestByArtifactDigest` additionally resolves "the manifest
48
+ * that produced artifact digest X" (the join key `chant components status`
49
+ * actually has on hand — a `ReleaseRecord.digest` is an *artifact* digest,
50
+ * not a manifest digest) by scanning every stored manifest's `contents` for
51
+ * a matching entry. This is a linear scan over however many manifests have
52
+ * been persisted; fine for the ledger's expected scale (one manifest per
53
+ * build), and avoids maintaining a second reverse-index file that could get
54
+ * out of sync with the manifests themselves.
55
+ */
56
+ import type { BuildArchiveManifest } from "../components/verbs/build-archive.js";
57
+ /**
58
+ * Persist a `BuildArchiveManifest` to the orphan branch, keyed by its own
59
+ * `manifestDigest`. Does not push to the remote — call `pushLifecycle`
60
+ * (./git.ts) afterward, the same two-step (`write` then `push`) shape
61
+ * `appendReleaseRecord`/`takeSnapshot` use, so a caller persisting several
62
+ * manifests (or a manifest plus a release record) in one run can batch the
63
+ * push into one network round-trip.
64
+ *
65
+ * Idempotent: persisting the same manifest twice (identical `manifestDigest`)
66
+ * overwrites the same path with identical bytes — safe to call more than
67
+ * once for the same build.
68
+ */
69
+ export declare function persistBuildManifest(manifest: BuildArchiveManifest, opts?: {
70
+ cwd?: string;
71
+ }): Promise<{
72
+ commit: string;
73
+ }>;
74
+ /**
75
+ * Read a persisted `BuildArchiveManifest` back by its own `manifestDigest`.
76
+ * Returns `null` when no manifest was ever persisted under that digest
77
+ * (never throws — a status query for a digest with no recorded build is a
78
+ * normal, expected state, matching `readSnapshot`'s null-on-missing
79
+ * convention).
80
+ */
81
+ export declare function readBuildManifest(manifestDigest: string, opts?: {
82
+ cwd?: string;
83
+ }): Promise<BuildArchiveManifest | null>;
84
+ /** List the `manifestDigest` of every build manifest persisted on the orphan branch. */
85
+ export declare function listBuildManifestDigests(opts?: {
86
+ cwd?: string;
87
+ }): Promise<string[]>;
88
+ /**
89
+ * Read every persisted build manifest. Best-effort: a manifest file that
90
+ * fails to parse is skipped rather than failing the whole read (mirrors
91
+ * `readReleaseLedger`'s "skip malformed lines" degrade-gracefully
92
+ * convention) — the caller only gets the count implicitly via array length,
93
+ * since a corrupted manifest blob is a much rarer/more surprising event than
94
+ * a hand-edited ledger line and not expected to need the same "surfaced
95
+ * count" treatment.
96
+ */
97
+ export declare function readAllBuildManifests(opts?: {
98
+ cwd?: string;
99
+ }): Promise<BuildArchiveManifest[]>;
100
+ /**
101
+ * Find the persisted manifest that carries an entry (any kind — image,
102
+ * template, asset, or sbom) whose `digest` equals `artifactDigest`. This is
103
+ * the lookup `chant components status` actually needs: a `ReleaseRecord`
104
+ * (../lifecycle/release-ledger.ts) records the *artifact* digest that was
105
+ * promoted/deployed, not the manifest's own aggregate `manifestDigest` — so
106
+ * resolving "the build behind this deployed digest" means searching
107
+ * manifest contents, not a direct keyed lookup. Returns `undefined` when no
108
+ * persisted manifest contains a matching entry (no build was ever persisted
109
+ * for that artifact digest — e.g. it predates #609, or was recorded via the
110
+ * standalone `chant components release` command with no corresponding
111
+ * `chant build`/`run` in this checkout).
112
+ *
113
+ * A `ReleaseRecord.manifestDigest`, when present (an optional field a caller
114
+ * may have supplied at record time), lets a caller skip this scan entirely
115
+ * via `readBuildManifest` directly — this function is the fallback for the
116
+ * common case where only the artifact digest is known.
117
+ */
118
+ export declare function findBuildManifestByArtifactDigest(artifactDigest: string, opts?: {
119
+ cwd?: string;
120
+ }): Promise<BuildArchiveManifest | undefined>;
121
+ //# sourceMappingURL=build-ledger-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-ledger-store.d.ts","sourceRoot":"","sources":["../../src/lifecycle/build-ledger-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAIH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAc9E;;;;;;;;;;;GAWG;AACH,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,oBAAoB,EAC9B,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GACtB,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAI7B;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,cAAc,EAAE,MAAM,EACtB,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GACtB,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAQtC;AAED,wFAAwF;AACxF,wBAAsB,wBAAwB,CAAC,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAKzF;AAED;;;;;;;;GAQG;AACH,wBAAsB,qBAAqB,CAAC,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAQpG;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,iCAAiC,CACrD,cAAc,EAAE,MAAM,EACtB,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GACtB,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC,CAG3C"}
@@ -0,0 +1,225 @@
1
+ /**
2
+ * Build ledger — the "what's been built" half of build & deploy observability
3
+ * (#568, epic #551 "Build & deploy observability" / "4. Build archive +
4
+ * deferred publish"; SBOM consume/surface added in #606).
5
+ *
6
+ * The `BuildArchive` manifest (../components/verbs/build-archive.ts) is
7
+ * itself the build ledger: it is content-addressed by digest and enumerates
8
+ * every image/template/asset/sbom a build produced. What #568 adds on top is
9
+ * discovery of an image's **referrers** — the SBOM, SLSA provenance, and
10
+ * signature attached to the same digest by tooling like `oras discover
11
+ * <digest>` / `cosign tree` (epic #551's phrasing).
12
+ *
13
+ * This module only *surfaces and consumes* SBOM/provenance/signature
14
+ * evidence — generation is ../components/verbs/sbom.ts's `generate-sbom`
15
+ * capability (#606; SLSA provenance + signing remain out of scope, noted as
16
+ * fast-follow siblings). Two sources feed the same `sbom` summary below, and
17
+ * a caller gets *both* without special-casing which one exists:
18
+ *
19
+ * - **archive-carried** — an `sbom`-kind entry in the same
20
+ * `BuildArchiveManifest`, written directly by `generate-sbom`. This is
21
+ * the **universal home**: it works for every artifact type (image, jar,
22
+ * zip) and every publish backend, including the registry-less
23
+ * `load-image-on-host` path, with no registry/network access required to
24
+ * read it back.
25
+ * - **referrer-projected** — an OCI referrer of `kind: "sbom"` discovered
26
+ * via `ReferrerLookup`, the registry-side convenience for image
27
+ * artifacts (`oras discover <digest>`/`cosign tree`) that #568 already
28
+ * modeled. Not every artifact type has this projection (only images
29
+ * published to a registry do), and not every environment can query it
30
+ * (`ReferrerLookup` defaults to `noopReferrerLookup`, no network).
31
+ *
32
+ * `buildLedgerEntries` prefers the archive-carried copy when both exist
33
+ * (same digest either way, since both trace back to the same
34
+ * `generate-sbom` run — the archive is the source of truth; the referrer is
35
+ * a projection of it) and falls back to the referrer when only that is
36
+ * available (e.g. a manifest read that predates #606, or a third-party tool
37
+ * attached an SBOM directly to the registry outside chant's own build). The
38
+ * `ReferrerLookup` interface remains injectable for exactly the reason
39
+ * `CloudExecutor` is injectable elsewhere in ../components/verbs: no test and
40
+ * no default implementation shells out to a real `oras`/`cosign`/registry
41
+ * call.
42
+ *
43
+ * **#614 additions.** Two more things get surfaced per manifest, both
44
+ * derived from data the manifest already carries (no new generation, no
45
+ * re-parsing of BOM bytes):
46
+ *
47
+ * - Each `BuildLedgerEntry` (still one per image, matching this module's
48
+ * existing scope) now carries that image's own `reproducibility` — read
49
+ * straight off its `BuildArchiveEntry`, never inferred from a sibling
50
+ * artifact (see ../components/verbs/reproducibility.ts's module doc for
51
+ * why a blanket flag would misrepresent a multi-artifact component).
52
+ * `artifactReproducibilitySummary` below reports the same per-artifact
53
+ * honesty for *every* artifact entry in a manifest (image, template,
54
+ * asset alike) — the full per-artifact picture #614 asks for, not just
55
+ * the image-scoped slice `buildLedgerEntries` has always covered.
56
+ * - `componentBomSummary` reports the component-level BOM aggregation
57
+ * picture (../components/verbs/component-bom.ts): how many leaf BOMs
58
+ * (software SBOM + IaC config-BOM) the manifest carries, each one's
59
+ * `bomKind`/format/package count, and whether they'd compose into a
60
+ * single-artifact (1:1) or real multi-artifact assembly. This is a
61
+ * summary read off the manifest's existing `sbom`-kind entries — it does
62
+ * not regenerate or re-validate the aggregate document (that stays
63
+ * `aggregateComponentBom`'s job, given each leaf's `BomPackage[]`, which
64
+ * the manifest alone does not carry).
65
+ */
66
+ import type { BuildArchiveManifest, BuildArchiveEntry } from "../components/verbs/build-archive.js";
67
+ import type { ArtifactReproducibility } from "../components/verbs/reproducibility.js";
68
+ /** The kind of referrer artifact attached to an image digest (mirrors the OCI referrers API / `oras discover` output). */
69
+ export type ReferrerKind = "sbom" | "provenance" | "signature";
70
+ /** One referrer attached to an image digest. */
71
+ export interface Referrer {
72
+ kind: ReferrerKind;
73
+ /** Media type of the referrer artifact itself (e.g. `application/vnd.cyclonedx+json`, `application/vnd.in-toto+json`). */
74
+ mediaType: string;
75
+ /** Content-addressed digest of the referrer artifact (`sha256:...`) — distinct from the subject digest it refers to. */
76
+ digest: string;
77
+ /** Where to fetch the referrer's content, when known (a registry blob ref, a file path, ...). Opaque to this module. */
78
+ location?: string;
79
+ }
80
+ /**
81
+ * Injectable lookup for an image digest's referrers — the seam a real
82
+ * `oras`/`cosign`/registry-API implementation plugs into. Defaults to
83
+ * `NoopReferrerLookup` (below) so build ledger queries degrade to "no
84
+ * referrers known" rather than requiring network/registry access, matching
85
+ * how ../components/verbs/cloud-executor.ts's real implementations are
86
+ * optional and mockable.
87
+ */
88
+ export interface ReferrerLookup {
89
+ /** List every referrer attached to `digest`, or `[]` if none / lookup unsupported. */
90
+ discover(digest: string): Promise<Referrer[]>;
91
+ }
92
+ /** Default `ReferrerLookup`: reports no referrers. A real registry/`oras`-backed implementation is out of scope here (belongs with #564's signing follow-up) — this keeps build-ledger queries safe to run with no cloud/network access. */
93
+ export declare const noopReferrerLookup: ReferrerLookup;
94
+ /**
95
+ * Where a build-ledger entry's `sbom` summary was read from — surfaced so
96
+ * `chant components status` can report SBOM *source*, not just presence
97
+ * (#606). "avoid drift": whichever source answers, it traces back to the
98
+ * same `generate-sbom` run for a given digest, since promote-by-digest never
99
+ * rebuilds — see docs/components/build-archive.mdx.
100
+ */
101
+ export type SbomSource = "archive" | "referrer";
102
+ /**
103
+ * The SBOM summary `chant components status` surfaces for one build-ledger
104
+ * entry (#606): format, package count, and where it was read from — never
105
+ * the raw SBOM bytes (chant's job is to generate/store/surface, not to
106
+ * interpret SBOM content; that is the scan-result/VEX policy-gate
107
+ * fast-follow, out of scope here).
108
+ */
109
+ export interface SbomSummary {
110
+ /** Media type of the SBOM document (`application/spdx+json` or `application/vnd.cyclonedx+json`) — the format-agnostic key, never a hardcoded format. */
111
+ mediaType: string;
112
+ /** Number of packages/components enumerated, when known. */
113
+ packageCount?: number;
114
+ /** Which tool produced it (e.g. "syft", "buildkit"), when known. */
115
+ generator?: string;
116
+ /** Whether this summary was read from the archive-carried entry or a registry-discovered OCI referrer. */
117
+ source: SbomSource;
118
+ }
119
+ /** One build-ledger entry: an archive's image entry plus whatever referrers are attached to its digest. */
120
+ export interface BuildLedgerEntry {
121
+ /** Component the archive was built for. */
122
+ component: string;
123
+ /** Archive-relative path of the image entry (see `BuildArchiveEntry.path`). */
124
+ path: string;
125
+ /** Content-addressed digest of the image (`sha256:...`) — the join key with the release ledger. */
126
+ digest: string;
127
+ /** When the archive manifest was assembled. */
128
+ createdAt: string;
129
+ /** The manifest's own aggregate digest — traces a promoted image digest back to the exact manifest that produced it. */
130
+ manifestDigest: string;
131
+ /** SBOM/provenance/signature referrers attached to this image's digest, if any were discoverable. */
132
+ referrers: Referrer[];
133
+ /**
134
+ * SBOM summary for this digest, read from whichever source is available —
135
+ * the archive-carried `sbom`-kind manifest entry (preferred; works for
136
+ * every artifact type and every publish backend, registry or not) or a
137
+ * registry-discovered `sbom`-kind referrer (image artifacts only, when
138
+ * `lookup` can reach a registry). `undefined` when neither source has one
139
+ * — including when the component opted out of `generate-sbom` entirely.
140
+ */
141
+ sbom?: SbomSummary;
142
+ /**
143
+ * This image's own honest, per-artifact reproducibility record (#614) —
144
+ * read from its `BuildArchiveEntry.reproducibility`. An `image` entry
145
+ * defaults to `{ basis: "best-effort" }` (see
146
+ * ../components/verbs/reproducibility.ts's `defaultReproducibility`)
147
+ * absent a real reproducible-build attestation; never inferred from a
148
+ * sibling `template`/`asset` entry's basis.
149
+ */
150
+ reproducibility?: ArtifactReproducibility;
151
+ }
152
+ /**
153
+ * Build the ledger view for one archive manifest: every `image`-kind entry,
154
+ * each paired with its OCI referrers via `lookup` and its SBOM summary (read
155
+ * from the archive-carried entry first, the referrer projection otherwise —
156
+ * see this module's doc comment). "What's built" becomes "what's built, from
157
+ * which commit, by what, when" once a release record (./release-ledger.ts)
158
+ * is joined onto this by `digest` — this function only produces the build
159
+ * side of that join.
160
+ */
161
+ export declare function buildLedgerEntries(manifest: BuildArchiveManifest, lookup?: ReferrerLookup): Promise<BuildLedgerEntry[]>;
162
+ /** Find the referrer of a given kind for a digest, if any (a convenience for "does this build have a signature/SBOM/provenance"). */
163
+ export declare function findReferrer(referrers: Referrer[], kind: ReferrerKind): Referrer | undefined;
164
+ /** One artifact's reproducibility, named for display (`chant components status`) rather than just keyed by digest. */
165
+ export interface ArtifactReproducibilitySummary {
166
+ /** Archive-relative path of the artifact (`BuildArchiveEntry.path`). */
167
+ path: string;
168
+ /** Which kind of artifact this is. */
169
+ kind: BuildArchiveEntry["kind"];
170
+ /** Content-addressed digest of the artifact. */
171
+ digest: string;
172
+ /** The artifact's own reproducibility record, when one is recorded (absent only for `sbom`-kind entries, which describe another artifact rather than being one). */
173
+ reproducibility?: ArtifactReproducibility;
174
+ /** Source ref/commit that produced this artifact, when recorded (#614's provenance link). */
175
+ sourceRef?: string;
176
+ }
177
+ /**
178
+ * Report every artifact entry's (`image`/`template`/`asset`) own
179
+ * reproducibility + provenance, honestly per-artifact — the full picture
180
+ * #614 asks for, wider than `buildLedgerEntries`'s image-only scope. Order
181
+ * matches `artifactEntries`' manifest insertion order; sort by `path`
182
+ * yourself for a stable display order (mirroring
183
+ * `computeManifestDigest`'s own path-sort convention).
184
+ */
185
+ export declare function artifactReproducibilitySummary(manifest: BuildArchiveManifest): ArtifactReproducibilitySummary[];
186
+ /** One leaf BOM in a component's aggregation picture — the summary form `componentBomSummary` reports, without regenerating or re-validating the aggregate document itself. */
187
+ export interface ComponentBomLeafSummary {
188
+ /** Archive-relative path of the leaf BOM document. */
189
+ path: string;
190
+ /** Software SBOM or IaC config-BOM (#613's `bomKind`, defaulting to `"software"` the same way `BuildArchiveEntry.bomKind` does). */
191
+ bomKind: "software" | "config";
192
+ /** Digest of the artifact this leaf describes (`subjectDigest`), when recorded. */
193
+ subjectDigest?: string;
194
+ /** Media type of the leaf document (format-agnostic key, per #613's convention). */
195
+ mediaType: string;
196
+ /** Package/component count this leaf enumerates, when known. */
197
+ packageCount?: number;
198
+ /** Which tool produced this leaf, when known. */
199
+ generator?: string;
200
+ }
201
+ /**
202
+ * Summary of a component's BOM aggregation picture (#614,
203
+ * ../components/verbs/component-bom.ts): every leaf BOM the manifest
204
+ * carries, whether they compose 1:1 (a single-artifact component — the leaf
205
+ * BOM *is* the component BOM, structurally) or as a real multi-artifact
206
+ * assembly (2+ leaves), and the combined package count across every leaf.
207
+ */
208
+ export interface ComponentBomSummary {
209
+ /** Every leaf BOM (software SBOM + IaC config-BOM) the manifest carries. */
210
+ leaves: ComponentBomLeafSummary[];
211
+ /** Sum of every leaf's `packageCount` (0 for a leaf with an unknown count). */
212
+ totalPackageCount: number;
213
+ /** `false` when there are 0 or 1 leaves (nothing to assemble, or a 1:1 component BOM); `true` when there are 2+ leaves (a real multi-artifact assembly, per #614's "single-artifact = 1:1, multi-artifact = a real assembly"). */
214
+ isAssembly: boolean;
215
+ }
216
+ /**
217
+ * Build the component BOM summary for one manifest, straight from its
218
+ * existing `sbom`-kind entries — no regeneration, no re-parsing of BOM
219
+ * bytes. `undefined` when the manifest carries no BOM at all (a component
220
+ * that composed neither `generate-sbom` nor `extract-config-bom` — skipping
221
+ * is structural, matching every other BOM consumer's convention in this
222
+ * codebase).
223
+ */
224
+ export declare function componentBomSummary(manifest: BuildArchiveManifest): ComponentBomSummary | undefined;
225
+ //# sourceMappingURL=build-ledger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-ledger.d.ts","sourceRoot":"","sources":["../../src/lifecycle/build-ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEjG,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAEnF,0HAA0H;AAC1H,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,YAAY,GAAG,WAAW,CAAC;AAE/D,gDAAgD;AAChD,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,YAAY,CAAC;IACnB,0HAA0H;IAC1H,SAAS,EAAE,MAAM,CAAC;IAClB,wHAAwH;IACxH,MAAM,EAAE,MAAM,CAAC;IACf,wHAAwH;IACxH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;GAOG;AACH,MAAM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IAC7C,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,IAAI,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAChC,gDAAgD;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,oKAAoK;IACpK,eAAe,CAAC,EAAE,uBAAuB,CAAC;IAC1C,6FAA6F;IAC7F,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,oBAAoB,GAAG,8BAA8B,EAAE,CAQ/G;AAED,+KAA+K;AAC/K,MAAM,WAAW,uBAAuB;IACtC,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,oIAAoI;IACpI,OAAO,EAAE,UAAU,GAAG,QAAQ,CAAC;IAC/B,mFAAmF;IACnF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oFAAoF;IACpF,SAAS,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC,4EAA4E;IAC5E,MAAM,EAAE,uBAAuB,EAAE,CAAC;IAClC,+EAA+E;IAC/E,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kOAAkO;IAClO,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,oBAAoB,GAAG,mBAAmB,GAAG,SAAS,CAenG"}
@@ -1,3 +1,37 @@
1
+ /**
2
+ * Write a blob to an arbitrary `<environment>/<filename>` path on the orphan
3
+ * branch, preserving every other env/file entry already on the branch.
4
+ *
5
+ * Pipeline: hash-object → mktree → commit-tree → update-ref. Factored out of
6
+ * `writeSnapshot` so the release ledger (#568, epic #551 "Build & deploy
7
+ * observability") can reuse the identical git-plumbing path for a different
8
+ * filename (`releases.jsonl`) under the same env directory, rather than a
9
+ * parallel storage mechanism.
10
+ *
11
+ * Exported (not just used internally) so ./build-ledger-store.ts (#609) can
12
+ * reuse this exact plumbing for a top-level directory that isn't really an
13
+ * "environment" (`_builds`, keyed by manifest digest rather than env name) —
14
+ * a build archive is promoted by digest across environments, never owned by
15
+ * one, so it belongs in its own digest-keyed namespace on the same orphan
16
+ * branch rather than duplicated per env. The parameter is still named
17
+ * `environment` because it is literally the first path segment / root-tree
18
+ * entry name this function's tree-building logic groups by; callers outside
19
+ * this module that pass a non-env value (like `_builds`) are relying on that
20
+ * generic behavior, not on any env-specific semantics.
21
+ */
22
+ export declare function writeBlobToPath(environment: string, filename: string, content: string, commitMessage: string, opts?: {
23
+ cwd?: string;
24
+ }): Promise<string>;
25
+ /**
26
+ * Read a blob from an arbitrary `<environment>/<filename>` path on the orphan
27
+ * branch. Returns null when the path doesn't exist (missing branch, env, or
28
+ * file). Sibling of `writeBlobToPath`. Exported for the same reason
29
+ * `writeBlobToPath` is — ./build-ledger-store.ts (#609) reads manifests back
30
+ * from the `_builds` namespace through this identical helper.
31
+ */
32
+ export declare function readBlobFromPath(environment: string, filename: string, opts?: {
33
+ cwd?: string;
34
+ }): Promise<string | null>;
1
35
  /**
2
36
  * Write a state snapshot JSON to the orphan branch.
3
37
  *
@@ -12,6 +46,56 @@ export declare function writeSnapshot(environment: string, lexicon: string, json
12
46
  export declare function readSnapshot(environment: string, lexicon: string, opts?: {
13
47
  cwd?: string;
14
48
  }): Promise<string | null>;
49
+ /**
50
+ * Append one immutable release record line to `<environment>/releases.jsonl`
51
+ * on the orphan branch (#568, epic #551 "Build & deploy observability"). Same
52
+ * git-plumbing path `writeSnapshot` uses, just a different filename under the
53
+ * env directory and append-only (JSON Lines) instead of replace-whole-file:
54
+ * each deploy adds one line, never rewrites a previous one, so the ledger
55
+ * stays a durable, append-only history rather than a point-in-time snapshot.
56
+ *
57
+ * Low-level plumbing over an already-serialized line; ../release-ledger.ts's
58
+ * `appendReleaseRecord` is the typed, validated public API most callers want
59
+ * — named distinctly here (`ReleaseRecordLine`) to avoid re-export ambiguity
60
+ * between the two modules.
61
+ *
62
+ * Returns the new orphan-branch commit SHA — the caller still owns pushing
63
+ * via `pushLifecycle` under the same concurrent-write lease `writeSnapshot`
64
+ * uses.
65
+ */
66
+ export declare function appendReleaseRecordLine(environment: string, recordJson: string, opts?: {
67
+ cwd?: string;
68
+ }): Promise<string>;
69
+ /**
70
+ * Read every release record line for `environment` from the orphan branch,
71
+ * oldest first, as raw JSON strings. Returns `[]` when no ledger exists yet
72
+ * for that env (never throws — a component that has never recorded a deploy
73
+ * is a normal, expected state). ../release-ledger.ts's `readReleaseLedger`
74
+ * parses/validates these lines into typed `ReleaseRecord`s.
75
+ */
76
+ export declare function readReleaseLedgerLines(environment: string, opts?: {
77
+ cwd?: string;
78
+ }): Promise<string[]>;
79
+ /**
80
+ * List every environment that has a release ledger on the orphan branch —
81
+ * the root-level directories under `chant/lifecycle` that carry a
82
+ * `releases.jsonl` entry. Used by `chant components status` (no env arg) to
83
+ * discover which environments to report on.
84
+ */
85
+ export declare function listLedgerEnvironments(opts?: {
86
+ cwd?: string;
87
+ }): Promise<string[]>;
88
+ /**
89
+ * List every filename directly under `<dir>/` on the orphan branch (no
90
+ * recursion), or `[]` when the branch/directory doesn't exist yet. Generic
91
+ * sibling of `readEnvironmentSnapshots`'s inline file listing, factored out
92
+ * so ./build-ledger-store.ts (#609) can enumerate every persisted build
93
+ * manifest (`_builds/<digest>.json`) without duplicating this `git ls-tree
94
+ * --name-only` call.
95
+ */
96
+ export declare function listFilesInDir(dir: string, opts?: {
97
+ cwd?: string;
98
+ }): Promise<string[]>;
15
99
  /**
16
100
  * Read all snapshots for an environment (all lexicons).
17
101
  */
@@ -1 +1 @@
1
- {"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/lifecycle/git.ts"],"names":[],"mappings":"AAUA;;;;GAIG;AACH,wBAAsB,aAAa,CACjC,WA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AgBnE;AAED;;;;GAIG;AACH,qBAAa,yBAA0B,SAAQ,KAAK;IAClD,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;gBACrB,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM;CASpD;AAED;;;GAGG;AACH,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GACtB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAMxB;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CAAC,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CA8B7E;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAW9E;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAO5E"}
@@ -5,4 +5,9 @@ export * from "./snapshot.js";
5
5
  export * from "./live-diff.js";
6
6
  export * from "./change-set.js";
7
7
  export * from "./affected.js";
8
+ export * from "./release-ledger.js";
9
+ export * from "./build-ledger.js";
10
+ export * from "./build-ledger-store.js";
11
+ export * from "./oras-referrer-lookup.js";
12
+ export * from "./status.js";
8
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lifecycle/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lifecycle/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,UAAU,CAAC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Real `ReferrerLookup` backend (#610, epic #551 follow-up to #568's
3
+ * `ReferrerLookup` interface). Shells out to `oras discover --format json
4
+ * <digest>` — the OCI distribution spec's referrers API, as exposed by the
5
+ * `oras` CLI — through the same injectable `ProcessRunner`
6
+ * (../components/verbs/process-runner.ts) the deep-scan `SbomGenerator`
7
+ * backend (../components/verbs/tool-sbom-generator.ts) and `publish-image`'s
8
+ * referrer-attach step share, mirroring ../components/verbs/cloud-executor.ts's
9
+ * `CloudExecutor` pattern once more: production code shells out, tests inject
10
+ * a `MockProcessRunner` and never touch a real registry/`oras` binary.
11
+ *
12
+ * Not the process-wide default: ./build-ledger.ts's `noopReferrerLookup`
13
+ * remains that (reports no referrers, no network, no registry credentials
14
+ * required) for exactly the reason `notImplementedSbomGenerator` and
15
+ * `SbomGenerator`'s hermetic backend aren't `sbom-generator.ts`'s default
16
+ * either — a project opts into the real registry-backed lookup explicitly
17
+ * (`buildLedgerEntries(manifest, createOrasReferrerLookup())`) rather than
18
+ * every previously-network-free build-ledger query silently starting to hit
19
+ * a registry.
20
+ */
21
+ import { type ProcessRunner } from "../components/verbs/process-runner.js";
22
+ import type { ReferrerLookup } from "./build-ledger.js";
23
+ export interface OrasReferrerLookupOptions {
24
+ /** Injected process boundary. Defaults to the real, `child_process`-backed runner. */
25
+ runner?: ProcessRunner;
26
+ /** Registry/repo prefix `digest` is resolved against (e.g. `123.dkr.ecr.us-east-1.amazonaws.com/search`) — `oras discover` needs a full `repo@digest` reference, not a bare digest. Required; a `ReferrerLookup.discover(digest)` call with no repo context has nothing to query. */
27
+ repo: string;
28
+ }
29
+ /**
30
+ * Build a real `ReferrerLookup` backed by `oras discover`. `discover(digest)`
31
+ * runs `oras discover --format json <repo>@<digest>` and maps every returned
32
+ * manifest into a `Referrer`, classified by `classify` above. Returns `[]`
33
+ * (never throws) when `oras` reports no referrers for a digest — an image
34
+ * with no attached SBOM/provenance/signature is a normal outcome, not an
35
+ * error. Throws `ToolNotAvailableError`
36
+ * (../components/verbs/process-runner.ts) if `oras` itself is not installed,
37
+ * so a misconfigured environment fails loudly rather than silently reporting
38
+ * "no referrers" for every digest.
39
+ */
40
+ export declare function createOrasReferrerLookup(options: OrasReferrerLookupOptions): ReferrerLookup;
41
+ //# sourceMappingURL=oras-referrer-lookup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oras-referrer-lookup.d.ts","sourceRoot":"","sources":["../../src/lifecycle/oras-referrer-lookup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EAA0B,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAkC7E,MAAM,WAAW,yBAAyB;IACxC,sFAAsF;IACtF,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,qRAAqR;IACrR,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,yBAAyB,GAAG,cAAc,CA8B3F"}
@@ -0,0 +1,122 @@
1
+ /**
2
+ * Release ledger — the recorded half of build & deploy observability (#568,
3
+ * epic #551 "Build & deploy observability").
4
+ *
5
+ * chant already has the *live-truth* half: ownership markers stamp stack/env
6
+ * identity on live resources, `lifecycle diff --live` / `lifecycle plan`
7
+ * compare declared vs live, and snapshots on `chant/lifecycle` give a
8
+ * forensic timeline (see ./snapshot.ts, ./live-diff.ts, ./change-set.ts).
9
+ * What was missing is the *record* half: "what we recorded deploying",
10
+ * independent of whether the thing is still running.
11
+ *
12
+ * A release record is immutable and append-only: each deploy appends one line
13
+ * to `<env>/releases.jsonl` on the `chant/lifecycle` orphan branch (see
14
+ * ./git.ts's `appendReleaseRecord`/`readReleaseLedger`) — never rewritten,
15
+ * never replaced in place, mirroring how the snapshot branch itself is
16
+ * treated as observational evidence rather than a mutable state file. The
17
+ * append-only property is what makes "which build was in staging on
18
+ * Tuesday" answerable months later even after staging has moved on to a
19
+ * dozen newer digests.
20
+ *
21
+ * The binding key is the artifact **digest** (`sha256:...`), the same
22
+ * identity `BuildArchive` manifests and `publish-image`/`load-image-on-host`
23
+ * promote by (see ../components/verbs/build-archive.ts,
24
+ * ../components/verbs/publish.ts). Because publish promotes by digest never
25
+ * rebuilding, the same identity threads build → dev → staging → prod, so
26
+ * "which build is in prod, and is it the one tested in staging" is a
27
+ * straightforward digest comparison over this ledger — never a guess through
28
+ * CI logs.
29
+ */
30
+ /**
31
+ * One immutable deploy record: `(component, env, artifact digest, git sha,
32
+ * run id, timestamp, actor)`, referencing the build archive by digest — the
33
+ * exact shape epic #551 "Build & deploy observability" asks for.
34
+ */
35
+ export interface ReleaseRecord {
36
+ /** Schema version, so an incompatible future shape can be detected before being misread. */
37
+ version: 1;
38
+ /** Component this deploy released (matches `Component.name`, ../components/component.ts). */
39
+ component: string;
40
+ /** Environment this deploy targeted. */
41
+ env: string;
42
+ /**
43
+ * Content-addressed digest of the promoted artifact (`sha256:...`) — the
44
+ * same digest `publish-image`/`load-image-on-host` return
45
+ * (`PublishImageOutput.digest`, ../components/verbs/publish.ts) and the
46
+ * one `BuildArchiveManifest` entries carry
47
+ * (../components/verbs/build-archive.ts). The join key for every query
48
+ * this ledger answers.
49
+ */
50
+ digest: string;
51
+ /** Git commit SHA the deploy was built from. */
52
+ gitSha: string;
53
+ /** Orchestrator run identifier (a `DriverRunResult`/Op run id, or a CI run id in generate mode) — the pointer back into the deploy event log. */
54
+ runId: string;
55
+ /**
56
+ * When this record was written. The caller supplies this — the session
57
+ * cannot call `Date.now()` reliably in every context, so the CLI resolves
58
+ * a real `new Date()` at record time and passes it in as an ISO-8601
59
+ * string; library code never defaults this internally.
60
+ */
61
+ timestamp: string;
62
+ /** Who/what triggered the deploy (a username, a CI actor, a service account). */
63
+ actor: string;
64
+ /** Optional: the archive's own manifest digest (../components/verbs/build-archive.ts's `manifestDigest`), when the caller has it — lets a reader recover full build contents/provenance, not just the promoted image digest. */
65
+ manifestDigest?: string;
66
+ }
67
+ /** Thrown by `appendReleaseRecord` when the record is missing a required field — a release record can never be recorded partially, since it is never editable afterward. */
68
+ export declare class InvalidReleaseRecordError extends Error {
69
+ readonly missing: string[];
70
+ constructor(missing: string[]);
71
+ }
72
+ /** Validate that a release record carries every required field as a non-empty string. */
73
+ export declare function validateReleaseRecord(record: Partial<ReleaseRecord>): string[];
74
+ /** Input a caller supplies to record one deploy — `version` is filled in, everything else is required (see `ReleaseRecord`). */
75
+ export type ReleaseRecordInput = Omit<ReleaseRecord, "version">;
76
+ /**
77
+ * Append one immutable release record to the `<env>` ledger on the
78
+ * `chant/lifecycle` orphan branch. Throws `InvalidReleaseRecordError` before
79
+ * any git operation runs if a required field is missing — never partially
80
+ * records, since nothing about a release record is editable after the fact.
81
+ *
82
+ * Does not push to the remote; call `pushLifecycle` (./git.ts) afterward, the
83
+ * same two-step (`write` then `push`) shape `takeSnapshot` (./snapshot.ts)
84
+ * uses, so a caller recording several releases in one run can batch the push.
85
+ */
86
+ export declare function appendReleaseRecord(input: ReleaseRecordInput, opts?: {
87
+ cwd?: string;
88
+ }): Promise<{
89
+ commit: string;
90
+ record: ReleaseRecord;
91
+ }>;
92
+ /**
93
+ * Read every release record for `environment`, oldest first. Malformed lines
94
+ * (a hand-edited or corrupted ledger) are skipped rather than throwing, since
95
+ * a status query should degrade gracefully rather than fail outright on one
96
+ * bad line — but each skip is reported so callers/tests can surface it.
97
+ */
98
+ export declare function readReleaseLedger(environment: string, opts?: {
99
+ cwd?: string;
100
+ }): Promise<{
101
+ records: ReleaseRecord[];
102
+ malformed: number;
103
+ }>;
104
+ /** List every environment that has release records on the orphan branch. */
105
+ export declare function listReleaseEnvironments(opts?: {
106
+ cwd?: string;
107
+ }): Promise<string[]>;
108
+ /**
109
+ * The latest release record per component in `records` — "what we recorded
110
+ * deploying" reduces to one row per component by taking the most recent
111
+ * `timestamp` (ties broken by ledger order, i.e. later append wins), since
112
+ * a component may have many historical records in one environment's ledger.
113
+ */
114
+ export declare function latestPerComponent(records: ReleaseRecord[]): Map<string, ReleaseRecord>;
115
+ /**
116
+ * Find every release record across `records` that references `digest` — the
117
+ * cross-environment query "is the build in prod the one tested in staging"
118
+ * reduces to: read both envs' ledgers, then check whether the same digest
119
+ * appears in each. Sorted oldest first, matching ledger order.
120
+ */
121
+ export declare function recordsForDigest(records: ReleaseRecord[], digest: string): ReleaseRecord[];
122
+ //# sourceMappingURL=release-ledger.d.ts.map