kibi-cli 2.31.1 → 2.35.1

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 (302) hide show
  1. package/dist/cli-register-proof.d.ts.map +1 -1
  2. package/dist/cli-register-proof.js +19 -7
  3. package/dist/cli-register-reporting.d.ts.map +1 -1
  4. package/dist/cli-register-reporting.js +2 -0
  5. package/dist/cli.d.ts.map +1 -1
  6. package/dist/cli.js +5 -1
  7. package/dist/commands/check-generated.d.ts +5 -1
  8. package/dist/commands/check-generated.d.ts.map +1 -1
  9. package/dist/commands/check-generated.js +24 -35
  10. package/dist/commands/check.d.ts +1 -0
  11. package/dist/commands/check.d.ts.map +1 -1
  12. package/dist/commands/check.js +14 -5
  13. package/dist/commands/discovery-table.d.ts.map +1 -1
  14. package/dist/commands/discovery-table.js +51 -4
  15. package/dist/commands/doctor.js +19 -4
  16. package/dist/commands/init-helpers.d.ts.map +1 -1
  17. package/dist/commands/init-helpers.js +8 -5
  18. package/dist/commands/migrate.d.ts.map +1 -1
  19. package/dist/commands/migrate.js +109 -5
  20. package/dist/commands/prove.d.ts +48 -1
  21. package/dist/commands/prove.d.ts.map +1 -1
  22. package/dist/commands/prove.js +293 -8
  23. package/dist/commands/report.d.ts +1 -0
  24. package/dist/commands/report.d.ts.map +1 -1
  25. package/dist/commands/report.js +70 -5
  26. package/dist/commands/signoff.d.ts.map +1 -1
  27. package/dist/commands/signoff.js +20 -1
  28. package/dist/commands/sync/manifest.d.ts +10 -1
  29. package/dist/commands/sync/manifest.d.ts.map +1 -1
  30. package/dist/commands/sync/manifest.js +106 -17
  31. package/dist/commands/sync/persistence.d.ts.map +1 -1
  32. package/dist/commands/sync/persistence.js +16 -5
  33. package/dist/commands/sync.d.ts.map +1 -1
  34. package/dist/commands/sync.js +19 -0
  35. package/dist/diagnostics.js +1 -1
  36. package/dist/engine.js +1 -1
  37. package/dist/extractors/markdown.d.ts +4 -2
  38. package/dist/extractors/markdown.d.ts.map +1 -1
  39. package/dist/extractors/markdown.js +17 -0
  40. package/dist/extractors/symbol-coordinates.js +2 -2
  41. package/dist/extractors/symbols-coordinator.d.ts +2 -4
  42. package/dist/extractors/symbols-coordinator.d.ts.map +1 -1
  43. package/dist/extractors/symbols-coordinator.js +1 -2
  44. package/dist/operations/bootstrap/candidate-helpers.d.ts +3 -0
  45. package/dist/operations/bootstrap/candidate-helpers.d.ts.map +1 -1
  46. package/dist/operations/bootstrap/candidate-helpers.js +4 -0
  47. package/dist/operations/migration/evidence-floor.d.ts +41 -0
  48. package/dist/operations/migration/evidence-floor.d.ts.map +1 -0
  49. package/dist/operations/migration/evidence-floor.js +230 -0
  50. package/dist/operations/migration/proof-contract-claims.d.ts +72 -0
  51. package/dist/operations/migration/proof-contract-claims.d.ts.map +1 -0
  52. package/dist/operations/migration/proof-contract-claims.js +215 -0
  53. package/dist/operations/migration/schema6.d.ts +6 -0
  54. package/dist/operations/migration/schema6.d.ts.map +1 -1
  55. package/dist/operations/migration/schema6.js +92 -0
  56. package/dist/operations/migration/symbol-coordinates-refresh.d.ts +3 -2
  57. package/dist/operations/migration/symbol-coordinates-refresh.d.ts.map +1 -1
  58. package/dist/operations/migration/symbol-coordinates-refresh.js +4 -3
  59. package/dist/operations/migration/untrack-symbol-coordinates.d.ts +23 -0
  60. package/dist/operations/migration/untrack-symbol-coordinates.d.ts.map +1 -0
  61. package/dist/operations/migration/untrack-symbol-coordinates.js +67 -0
  62. package/dist/operations/modeling/requirement-modeler.d.ts.map +1 -1
  63. package/dist/operations/modeling/requirement-modeler.js +48 -1
  64. package/dist/operations/modeling/requirement-types.d.ts +2 -1
  65. package/dist/operations/modeling/requirement-types.d.ts.map +1 -1
  66. package/dist/operations/modeling/requirement-utils.d.ts +1 -1
  67. package/dist/operations/modeling/requirement-utils.d.ts.map +1 -1
  68. package/dist/operations/modeling/requirement-utils.js +8 -1
  69. package/dist/operations/mutation/omitted-properties.d.ts +11 -0
  70. package/dist/operations/mutation/omitted-properties.d.ts.map +1 -0
  71. package/dist/operations/mutation/omitted-properties.js +76 -0
  72. package/dist/operations/mutation/serialization.d.ts.map +1 -1
  73. package/dist/operations/mutation/serialization.js +1 -0
  74. package/dist/operations/mutation/source-authoring.d.ts.map +1 -1
  75. package/dist/operations/mutation/source-authoring.js +39 -20
  76. package/dist/operations/mutation/strict-fact.d.ts.map +1 -1
  77. package/dist/operations/mutation/strict-fact.js +6 -2
  78. package/dist/operations/mutation/symbol-granularity.d.ts.map +1 -1
  79. package/dist/operations/mutation/symbol-granularity.js +5 -3
  80. package/dist/operations/mutation/upsert.d.ts.map +1 -1
  81. package/dist/operations/mutation/upsert.js +7 -1
  82. package/dist/operations/mutation/validation.d.ts +2 -0
  83. package/dist/operations/mutation/validation.d.ts.map +1 -1
  84. package/dist/operations/mutation/validation.js +4 -0
  85. package/dist/operations/proof/claim-bindings.d.ts +41 -0
  86. package/dist/operations/proof/claim-bindings.d.ts.map +1 -0
  87. package/dist/operations/proof/claim-bindings.js +364 -0
  88. package/dist/operations/proof/code-certificates.d.ts +155 -0
  89. package/dist/operations/proof/code-certificates.d.ts.map +1 -0
  90. package/dist/operations/proof/code-certificates.js +894 -0
  91. package/dist/operations/proof/code-models.d.ts +96 -0
  92. package/dist/operations/proof/code-models.d.ts.map +1 -0
  93. package/dist/operations/proof/code-models.js +601 -0
  94. package/dist/operations/proof/code-runner.d.ts +40 -0
  95. package/dist/operations/proof/code-runner.d.ts.map +1 -0
  96. package/dist/operations/proof/code-runner.js +164 -0
  97. package/dist/operations/proof/code-scope.d.ts +14 -1
  98. package/dist/operations/proof/code-scope.d.ts.map +1 -1
  99. package/dist/operations/proof/code-scope.js +44 -2
  100. package/dist/operations/proof/compact-receipts.d.ts.map +1 -1
  101. package/dist/operations/proof/compact-receipts.js +4 -3
  102. package/dist/operations/proof/explain.d.ts +32 -0
  103. package/dist/operations/proof/explain.d.ts.map +1 -1
  104. package/dist/operations/proof/explain.js +91 -0
  105. package/dist/operations/proof/ingest-proof.d.ts +9 -1
  106. package/dist/operations/proof/ingest-proof.d.ts.map +1 -1
  107. package/dist/operations/proof/ingest-proof.js +42 -2
  108. package/dist/operations/proof/receipt-compaction.d.ts +2 -0
  109. package/dist/operations/proof/receipt-compaction.d.ts.map +1 -1
  110. package/dist/operations/proof/receipt-compaction.js +6 -2
  111. package/dist/operations/proof/regular-language.d.ts +89 -0
  112. package/dist/operations/proof/regular-language.d.ts.map +1 -0
  113. package/dist/operations/proof/regular-language.js +943 -0
  114. package/dist/operations/proof/source-code-readers.d.ts +12 -0
  115. package/dist/operations/proof/source-code-readers.d.ts.map +1 -0
  116. package/dist/operations/proof/source-code-readers.js +699 -0
  117. package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -1
  118. package/dist/operations/semantic-advisor/analyze-prose.js +2 -1
  119. package/dist/operations/semantic-advisor/shared.d.ts.map +1 -1
  120. package/dist/operations/semantic-advisor/shared.js +4 -0
  121. package/dist/operations/semantic-advisor/strict-count-rules.d.ts.map +1 -1
  122. package/dist/operations/semantic-advisor/strict-count-rules.js +8 -2
  123. package/dist/operations/semantic-advisor/strict-rules.d.ts +8 -0
  124. package/dist/operations/semantic-advisor/strict-rules.d.ts.map +1 -1
  125. package/dist/operations/semantic-advisor/strict-rules.js +234 -4
  126. package/dist/operations/semantic-advisor/types.d.ts +3 -2
  127. package/dist/operations/semantic-advisor/types.d.ts.map +1 -1
  128. package/dist/plugins/approved-source-analyzers.generated.d.ts +6 -6
  129. package/dist/plugins/approved-source-analyzers.generated.js +6 -6
  130. package/dist/prolog.d.ts.map +1 -1
  131. package/dist/prolog.js +13 -3
  132. package/dist/proof/command-test-report.d.ts +4 -3
  133. package/dist/proof/command-test-report.d.ts.map +1 -1
  134. package/dist/proof/command-test-report.js +4 -10
  135. package/dist/proof/evaluate.d.ts.map +1 -1
  136. package/dist/proof/evaluate.js +18 -2
  137. package/dist/proof/inspect.d.ts.map +1 -1
  138. package/dist/proof/inspect.js +58 -0
  139. package/dist/proof/producers/playwright-reporter.d.ts +3 -0
  140. package/dist/proof/producers/playwright-reporter.d.ts.map +1 -1
  141. package/dist/proof/producers/playwright-reporter.js +25 -2
  142. package/dist/proof/step-runner.d.ts +36 -0
  143. package/dist/proof/step-runner.d.ts.map +1 -0
  144. package/dist/proof/step-runner.js +234 -0
  145. package/dist/public/evidence-levels.d.ts +12 -0
  146. package/dist/public/evidence-levels.d.ts.map +1 -0
  147. package/dist/public/evidence-levels.js +19 -0
  148. package/dist/public/impact/coverage-depth-quality.d.ts +7 -0
  149. package/dist/public/impact/coverage-depth-quality.d.ts.map +1 -1
  150. package/dist/public/impact/coverage-depth-quality.js +59 -0
  151. package/dist/public/impact/full-kb-quality.d.ts.map +1 -1
  152. package/dist/public/impact/full-kb-quality.js +3 -1
  153. package/dist/public/operations/catalog.d.ts +315 -11
  154. package/dist/public/operations/catalog.d.ts.map +1 -1
  155. package/dist/public/operations/check-executor.d.ts +2 -0
  156. package/dist/public/operations/check-executor.d.ts.map +1 -1
  157. package/dist/public/operations/check-executor.js +6 -0
  158. package/dist/public/operations/evidence-floor.d.ts +48 -0
  159. package/dist/public/operations/evidence-floor.d.ts.map +1 -0
  160. package/dist/public/operations/evidence-floor.js +143 -0
  161. package/dist/public/operations/migration-plan.d.ts +19 -5
  162. package/dist/public/operations/migration-plan.d.ts.map +1 -1
  163. package/dist/public/operations/migration-plan.js +22 -5
  164. package/dist/public/operations/node-ports.d.ts.map +1 -1
  165. package/dist/public/operations/node-ports.js +4 -1
  166. package/dist/public/operations/proof-contract-claims.d.ts +26 -0
  167. package/dist/public/operations/proof-contract-claims.d.ts.map +1 -0
  168. package/dist/public/operations/proof-contract-claims.js +71 -0
  169. package/dist/public/operations/specs/check-rules.generated.d.ts +1 -1
  170. package/dist/public/operations/specs/check-rules.generated.d.ts.map +1 -1
  171. package/dist/public/operations/specs/check-rules.generated.js +3 -1
  172. package/dist/public/operations/specs/check.d.ts +1 -1
  173. package/dist/public/operations/specs/composite.d.ts +16 -3
  174. package/dist/public/operations/specs/composite.d.ts.map +1 -1
  175. package/dist/public/operations/specs/modeling.d.ts +16 -3
  176. package/dist/public/operations/specs/modeling.d.ts.map +1 -1
  177. package/dist/public/operations/specs/modeling.js +22 -3
  178. package/dist/public/operations/specs/mutation-schemas.d.ts +289 -7
  179. package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
  180. package/dist/public/operations/specs/mutation-schemas.js +28 -4
  181. package/dist/public/operations/specs/proof.d.ts +9 -0
  182. package/dist/public/operations/specs/proof.d.ts.map +1 -1
  183. package/dist/public/operations/specs/reporting.d.ts.map +1 -1
  184. package/dist/public/operations/specs/reporting.js +19 -10
  185. package/dist/public/operations/specs/upsert.d.ts +289 -7
  186. package/dist/public/operations/specs/upsert.d.ts.map +1 -1
  187. package/dist/public/proof-certificates.d.ts +163 -0
  188. package/dist/public/proof-certificates.d.ts.map +1 -0
  189. package/dist/public/proof-certificates.js +419 -0
  190. package/dist/public/proof-protocol.d.ts +259 -3
  191. package/dist/public/proof-protocol.d.ts.map +1 -1
  192. package/dist/public/proof-protocol.js +524 -3
  193. package/dist/public/proof-receipt.d.ts +90 -6
  194. package/dist/public/proof-receipt.d.ts.map +1 -1
  195. package/dist/public/proof-receipt.js +88 -7
  196. package/dist/public/proof-sources.d.ts +102 -0
  197. package/dist/public/proof-sources.d.ts.map +1 -0
  198. package/dist/public/proof-sources.js +1292 -0
  199. package/dist/public/schemas/entity.d.ts.map +1 -1
  200. package/dist/public/schemas/entity.js +39 -2
  201. package/dist/public/skills/kibi-bootstrap/SKILL.md +2 -2
  202. package/dist/public/skills/kibi-commit-review/SKILL.md +8 -8
  203. package/dist/public/skills/kibi-commit-review/resources/staged-gate.md +12 -7
  204. package/dist/public/skills/kibi-decisions/SKILL.md +13 -2
  205. package/dist/public/skills/kibi-decisions/resources/decision-records.md +9 -1
  206. package/dist/public/skills/kibi-freshness/SKILL.md +5 -1
  207. package/dist/public/skills/kibi-traceability/SKILL.md +12 -1
  208. package/dist/public/skills/kibi-usage/SKILL.md +8 -4
  209. package/dist/public/skills/kibi-usage/resources/proof.md +221 -20
  210. package/dist/public/skills/kibi-usage/resources/workflows.md +4 -4
  211. package/dist/report/html-report.css +83 -11
  212. package/dist/report/html-report.d.ts +8 -0
  213. package/dist/report/html-report.d.ts.map +1 -1
  214. package/dist/report/html-report.js +214 -22
  215. package/dist/report/report-view.d.ts +2 -2
  216. package/dist/report/report-view.d.ts.map +1 -1
  217. package/dist/report/report-view.js +8 -0
  218. package/dist/schemas/entity.schema.json +404 -5
  219. package/dist/search-answer.d.ts.map +1 -1
  220. package/dist/search-answer.js +1 -0
  221. package/dist/signoff/html.d.ts.map +1 -1
  222. package/dist/signoff/html.js +3 -0
  223. package/dist/signoff/markdown.d.ts.map +1 -1
  224. package/dist/signoff/markdown.js +3 -0
  225. package/dist/signoff/model.d.ts +20 -0
  226. package/dist/signoff/model.d.ts.map +1 -1
  227. package/dist/signoff/model.js +20 -1
  228. package/dist/traceability/evidence-model.d.ts +13 -12
  229. package/dist/traceability/evidence-model.d.ts.map +1 -1
  230. package/dist/traceability/evidence-model.js +1 -1
  231. package/dist/traceability/impact-knowledge.d.ts.map +1 -1
  232. package/dist/traceability/impact-knowledge.js +1 -0
  233. package/dist/traceability/staged-diagnostics.d.ts.map +1 -1
  234. package/dist/traceability/staged-diagnostics.js +24 -20
  235. package/dist/traceability/staged-impact-contract.d.ts +4 -4
  236. package/dist/traceability/staged-impact-contract.js +9 -9
  237. package/dist/traceability/staged-symbols-manifest.d.ts +11 -3
  238. package/dist/traceability/staged-symbols-manifest.d.ts.map +1 -1
  239. package/dist/traceability/staged-symbols-manifest.js +47 -140
  240. package/dist/traceability/temp-kb.d.ts.map +1 -1
  241. package/dist/traceability/temp-kb.js +1 -0
  242. package/dist/types/entities.d.ts +5 -2
  243. package/dist/types/entities.d.ts.map +1 -1
  244. package/dist/utils/merge-driver-setup.d.ts +8 -1
  245. package/dist/utils/merge-driver-setup.d.ts.map +1 -1
  246. package/dist/utils/merge-driver-setup.js +23 -2
  247. package/dist/utils/rule-registry.generated.d.ts +10 -0
  248. package/dist/utils/rule-registry.generated.d.ts.map +1 -1
  249. package/dist/utils/rule-registry.generated.js +12 -0
  250. package/dist/utils/schema-version.d.ts +1 -1
  251. package/dist/utils/schema-version.d.ts.map +1 -1
  252. package/dist/utils/schema-version.js +7 -1
  253. package/dist/utils/strict-modeling.d.ts +3 -2
  254. package/dist/utils/strict-modeling.d.ts.map +1 -1
  255. package/dist/utils/strict-modeling.js +37 -4
  256. package/dist/workspace-cwd.d.ts +15 -0
  257. package/dist/workspace-cwd.d.ts.map +1 -0
  258. package/dist/workspace-cwd.js +86 -0
  259. package/package.json +6 -2
  260. package/schema/entities.pl +6 -0
  261. package/schema/validation.pl +7 -2
  262. package/src/public/evidence-levels.ts +23 -0
  263. package/src/public/impact/coverage-depth-quality.ts +73 -0
  264. package/src/public/impact/full-kb-quality.ts +6 -1
  265. package/src/public/operations/check-executor.ts +13 -0
  266. package/src/public/operations/evidence-floor.ts +203 -0
  267. package/src/public/operations/migration-plan.ts +39 -6
  268. package/src/public/operations/node-ports.ts +3 -1
  269. package/src/public/operations/proof-contract-claims.ts +103 -0
  270. package/src/public/operations/specs/check-rules.generated.ts +3 -1
  271. package/src/public/operations/specs/modeling.ts +24 -5
  272. package/src/public/operations/specs/mutation-schemas.ts +30 -4
  273. package/src/public/operations/specs/reporting.ts +20 -10
  274. package/src/public/proof-certificates.ts +566 -0
  275. package/src/public/proof-protocol-types.d.ts +69 -1
  276. package/src/public/proof-protocol.ts +694 -3
  277. package/src/public/proof-receipt.ts +133 -7
  278. package/src/public/proof-sources.ts +1656 -0
  279. package/src/public/schemas/entity.ts +51 -3
  280. package/src/public/skills/kibi-bootstrap/SKILL.md +2 -2
  281. package/src/public/skills/kibi-commit-review/SKILL.md +8 -8
  282. package/src/public/skills/kibi-commit-review/resources/staged-gate.md +12 -7
  283. package/src/public/skills/kibi-decisions/SKILL.md +13 -2
  284. package/src/public/skills/kibi-decisions/resources/decision-records.md +9 -1
  285. package/src/public/skills/kibi-freshness/SKILL.md +5 -1
  286. package/src/public/skills/kibi-traceability/SKILL.md +12 -1
  287. package/src/public/skills/kibi-usage/SKILL.md +8 -4
  288. package/src/public/skills/kibi-usage/resources/proof.md +221 -20
  289. package/src/public/skills/kibi-usage/resources/workflows.md +4 -4
  290. package/src/schemas/entity.schema.json +404 -5
  291. package/dist/commands/proof-impact.d.ts +0 -7
  292. package/dist/commands/proof-impact.d.ts.map +0 -1
  293. package/dist/commands/proof-impact.js +0 -39
  294. package/dist/operations/proof/baseline-diff.d.ts +0 -41
  295. package/dist/operations/proof/baseline-diff.d.ts.map +0 -1
  296. package/dist/operations/proof/baseline-diff.js +0 -153
  297. package/dist/operations/proof/impact.d.ts +0 -51
  298. package/dist/operations/proof/impact.d.ts.map +0 -1
  299. package/dist/operations/proof/impact.js +0 -138
  300. package/dist/traceability/reviewed-coordinate-refresh.d.ts +0 -10
  301. package/dist/traceability/reviewed-coordinate-refresh.d.ts.map +0 -1
  302. package/dist/traceability/reviewed-coordinate-refresh.js +0 -49
@@ -140,6 +140,11 @@ export declare const upsertSpec: {
140
140
  readonly enum: readonly ["firm", "default", "exploratory"];
141
141
  readonly description: "req/adr only. firm = a human stated it as a rule (needs origin.ref to their words); its title, meaning or firmness changes only with new human words (a new origin.ref) or by supersede. default = delegated or agent choice; exploratory = flagged guess. Absent = default if an agent wrote it, else firm.";
142
142
  };
143
+ readonly required_evidence: {
144
+ readonly type: "string";
145
+ readonly enum: readonly ["proved", "tested", "asserted", "unverified"];
146
+ readonly description: "Requirement-only. Weakest evidence level it accepts; the evidence-floor rule fails below it. Absent = tested if firm, else unverified.";
147
+ };
143
148
  readonly rationale: {
144
149
  readonly type: "string";
145
150
  readonly minLength: 1;
@@ -219,7 +224,217 @@ export declare const upsertSpec: {
219
224
  };
220
225
  readonly success_policy: {
221
226
  readonly type: "string";
222
- readonly enum: readonly ["all_required_first_attempt"];
227
+ readonly enum: readonly ["all_required_first_attempt", "own_results_first_attempt"];
228
+ };
229
+ readonly kind: {
230
+ readonly type: "string";
231
+ readonly enum: readonly ["e2e", "example", "property", "exhaustive", "typecheck", "arithmetic", "smt", "rule", "state_machine", "regex", "source"];
232
+ readonly description: "What the checker establishes; absent means e2e. exhaustive, typecheck, arithmetic, smt, rule, state_machine and regex must leave a kibi.code-certificate.v1 that Kibi re-checks before the receipt counts as proved. source reads the contract's source itself: the run may leave {version, kind: source, test_id, source} or nothing, and Kibi stores its own read as the certificate.";
233
+ };
234
+ readonly source: {
235
+ readonly description: "source: the project source a source proof reads. A project source Kibi reads by itself. reader json or yaml: {file, path?, select?: keys|values|items}. glob: {pattern, capture?, ignore?} (capture true reads what each * matched). openapi: {file, select?: operations|unsecured_operations|security_schemes|responses}. references: {files, extract: env|imports|calls|string_args|thrown|property, callee?, key?, ignore?}. schema: {format: drizzle|prisma|sql, file (drizzle, prisma) or files (sql migrations), exports?, table?, select?: tables|columns|required_columns|nullable_columns|foreign_keys}. routes: {file, export, framework?: hono|express, path_prefix?, names_from?, select?: routes|middleware}. validator: {file, export, select?: fields|required_fields|optional_fields}. Paths are repository-relative. A member Kibi cannot read statically fails the read with its location.";
236
+ readonly type: "object";
237
+ readonly required: readonly ["reader"];
238
+ readonly properties: {
239
+ readonly reader: {
240
+ readonly type: "string";
241
+ readonly enum: readonly ["json", "yaml", "glob", "openapi", "references", "schema", "routes", "validator"];
242
+ };
243
+ };
244
+ readonly additionalProperties: true;
245
+ };
246
+ readonly domain_source: {
247
+ readonly type: "object";
248
+ readonly description: "exhaustive and typecheck: the symbol that defines the finite domain (typecheck: also the type whose fields a required_fields fact names). state_machine: the transition table or next-state function. The proof must import it from its source file; a hand-listed domain downgrades the receipt to example. Kibi reads the export named `export`, or the symbol's title when `export` is absent.";
249
+ readonly required: readonly ["symbol_id"];
250
+ readonly properties: {
251
+ readonly symbol_id: {
252
+ readonly type: "string";
253
+ readonly minLength: 1;
254
+ };
255
+ readonly export: {
256
+ readonly type: "string";
257
+ readonly minLength: 1;
258
+ readonly description: "The name the domain is exported under in the symbol's source file, when the symbol's title is not that name.";
259
+ };
260
+ };
261
+ readonly additionalProperties: false;
262
+ };
263
+ readonly witness: {
264
+ readonly type: "object";
265
+ readonly description: "typecheck: the repository-relative witness file Kibi compiles (an exhaustive switch ending in never, or a mapped type over the domain).";
266
+ readonly required: readonly ["path"];
267
+ readonly properties: {
268
+ readonly path: {
269
+ readonly type: "string";
270
+ readonly minLength: 1;
271
+ };
272
+ };
273
+ readonly additionalProperties: false;
274
+ };
275
+ readonly proves: {
276
+ readonly type: "array";
277
+ readonly description: "Certificate kinds: the requirement claim keys (CLAIM-...) this certificate proves. Each must be a modeled claim of a current requirement the test reaches through its scenarios. Kibi derives what the certificate must establish from the claim's grounding fact (a set fact for exhaustive or typecheck, a numeric fact for arithmetic or smt, a rule, predicate or set fact for rule and state_machine, a string fact for regex); a claim with no such derivation is only attested and never counts as proved.";
278
+ readonly minItems: 1;
279
+ readonly items: {
280
+ readonly type: "string";
281
+ readonly pattern: "^CLAIM-";
282
+ };
283
+ readonly uniqueItems: true;
284
+ };
285
+ readonly value_source: {
286
+ readonly type: "array";
287
+ readonly description: "arithmetic and smt: code constants the assumptions read. Kibi evaluates each export at ingest and requires the certificate to assume the variable equals that value, so the proof is about the code and not only the knowledge base. With measure count the value is the size of a list, set, map or object export, so a count claim reads the collection itself. An entry {source, measure: count} counts the members Kibi reads from a project source (routes, tables, environment variables).";
288
+ readonly minItems: 1;
289
+ readonly items: {
290
+ readonly type: "object";
291
+ readonly properties: {
292
+ readonly symbol_id: {
293
+ readonly type: "string";
294
+ readonly minLength: 1;
295
+ };
296
+ readonly export: {
297
+ readonly type: "string";
298
+ readonly minLength: 1;
299
+ };
300
+ readonly source: {
301
+ readonly type: "object";
302
+ readonly description: "A project source Kibi reads by itself. reader json or yaml: {file, path?, select?: keys|values|items}. glob: {pattern, capture?, ignore?} (capture true reads what each * matched). openapi: {file, select?: operations|unsecured_operations|security_schemes|responses}. references: {files, extract: env|imports|calls|string_args|thrown|property, callee?, key?, ignore?}. schema: {format: drizzle|prisma|sql, file (drizzle, prisma) or files (sql migrations), exports?, table?, select?: tables|columns|required_columns|nullable_columns|foreign_keys}. routes: {file, export, framework?: hono|express, path_prefix?, names_from?, select?: routes|middleware}. validator: {file, export, select?: fields|required_fields|optional_fields}. Paths are repository-relative. A member Kibi cannot read statically fails the read with its location.";
303
+ readonly required: readonly ["reader"];
304
+ readonly properties: {
305
+ readonly reader: {
306
+ readonly type: "string";
307
+ readonly enum: readonly ["json", "yaml", "glob", "openapi", "references", "schema", "routes", "validator"];
308
+ };
309
+ };
310
+ readonly additionalProperties: true;
311
+ };
312
+ readonly measure: {
313
+ readonly type: "string";
314
+ readonly enum: readonly ["value", "count"];
315
+ readonly description: "value (default for an export): the export is a number. count (the only measure of a source): the number of members of a list, set, map or object export, or of a source.";
316
+ };
317
+ };
318
+ readonly additionalProperties: false;
319
+ };
320
+ };
321
+ readonly predicate_source: {
322
+ readonly type: "object";
323
+ readonly description: "rule: the code function behind each predicate a claim's rule, predicate or set fact names, keyed by predicate name. Each export takes the predicate's arguments in order and returns a boolean; Kibi calls it on every combination of its argument domains.";
324
+ readonly minProperties: 1;
325
+ readonly additionalProperties: {
326
+ readonly type: "object";
327
+ readonly required: readonly ["symbol_id"];
328
+ readonly properties: {
329
+ readonly symbol_id: {
330
+ readonly type: "string";
331
+ readonly minLength: 1;
332
+ };
333
+ readonly export: {
334
+ readonly type: "string";
335
+ readonly minLength: 1;
336
+ readonly description: "The exported function's name in the symbol's source file. Without it Kibi reads the export named by the symbol's title.";
337
+ };
338
+ readonly harness_for: {
339
+ readonly type: "array";
340
+ readonly minItems: 1;
341
+ readonly items: {
342
+ readonly type: "string";
343
+ readonly minLength: 1;
344
+ };
345
+ readonly description: "The predicate is a test harness that decides the predicate by driving these code symbols (for example by calling the handler with each role). The symbols must be covered_by the test; a claim the harness proves is bound with scope harness.";
346
+ };
347
+ };
348
+ readonly additionalProperties: false;
349
+ };
350
+ };
351
+ readonly domains: {
352
+ readonly type: "object";
353
+ readonly description: "rule: the finite domain of each argument type, keyed by type name (an array, Set, Map or object export, or a Python list, set, dict or Enum), or {source} for the members Kibi reads from a project source (every route, every table, every environment variable). state_machine with a next-state function: the `state` and `event` domains it is called on.";
354
+ readonly minProperties: 1;
355
+ readonly additionalProperties: {
356
+ readonly anyOf: readonly [{
357
+ readonly type: "object";
358
+ readonly required: readonly ["symbol_id"];
359
+ readonly properties: {
360
+ readonly symbol_id: {
361
+ readonly type: "string";
362
+ readonly minLength: 1;
363
+ };
364
+ readonly export: {
365
+ readonly type: "string";
366
+ readonly minLength: 1;
367
+ };
368
+ };
369
+ readonly additionalProperties: false;
370
+ }, {
371
+ readonly type: "object";
372
+ readonly required: readonly ["source"];
373
+ readonly properties: {
374
+ readonly source: {
375
+ readonly type: "object";
376
+ readonly description: "A project source Kibi reads by itself. reader json or yaml: {file, path?, select?: keys|values|items}. glob: {pattern, capture?, ignore?} (capture true reads what each * matched). openapi: {file, select?: operations|unsecured_operations|security_schemes|responses}. references: {files, extract: env|imports|calls|string_args|thrown|property, callee?, key?, ignore?}. schema: {format: drizzle|prisma|sql, file (drizzle, prisma) or files (sql migrations), exports?, table?, select?: tables|columns|required_columns|nullable_columns|foreign_keys}. routes: {file, export, framework?: hono|express, path_prefix?, names_from?, select?: routes|middleware}. validator: {file, export, select?: fields|required_fields|optional_fields}. Paths are repository-relative. A member Kibi cannot read statically fails the read with its location.";
377
+ readonly required: readonly ["reader"];
378
+ readonly properties: {
379
+ readonly reader: {
380
+ readonly type: "string";
381
+ readonly enum: readonly ["json", "yaml", "glob", "openapi", "references", "schema", "routes", "validator"];
382
+ };
383
+ };
384
+ readonly additionalProperties: true;
385
+ };
386
+ };
387
+ readonly additionalProperties: false;
388
+ }];
389
+ };
390
+ };
391
+ readonly initial_source: {
392
+ readonly description: "state_machine: the export holding the initial state (or states), needed for initial_states and reachable_states facts.";
393
+ readonly type: "object";
394
+ readonly required: readonly ["symbol_id"];
395
+ readonly properties: {
396
+ readonly symbol_id: {
397
+ readonly type: "string";
398
+ readonly minLength: 1;
399
+ };
400
+ readonly export: {
401
+ readonly type: "string";
402
+ readonly minLength: 1;
403
+ };
404
+ };
405
+ readonly additionalProperties: false;
406
+ };
407
+ readonly pattern_source: {
408
+ readonly description: "regex: the export holding the code's pattern (a RegExp, or a Python re.Pattern) or string constant that a string fact is about.";
409
+ readonly type: "object";
410
+ readonly required: readonly ["symbol_id"];
411
+ readonly properties: {
412
+ readonly symbol_id: {
413
+ readonly type: "string";
414
+ readonly minLength: 1;
415
+ };
416
+ readonly export: {
417
+ readonly type: "string";
418
+ readonly minLength: 1;
419
+ };
420
+ };
421
+ readonly additionalProperties: false;
422
+ };
423
+ readonly constraint_source: {
424
+ readonly type: "object";
425
+ readonly description: "arithmetic and smt: the typed numeric property_value facts the certificate's assumptions come from. Kibi checks the assumptions (or the query's assertions) are exactly these facts' constraints, so the proof is about the knowledge base, not numbers the test chose.";
426
+ readonly required: readonly ["fact_ids"];
427
+ readonly properties: {
428
+ readonly fact_ids: {
429
+ readonly type: "array";
430
+ readonly minItems: 1;
431
+ readonly items: {
432
+ readonly type: "string";
433
+ readonly minLength: 1;
434
+ };
435
+ };
436
+ };
437
+ readonly additionalProperties: false;
223
438
  };
224
439
  };
225
440
  readonly additionalProperties: false;
@@ -267,12 +482,12 @@ export declare const upsertSpec: {
267
482
  readonly maxItems: 50;
268
483
  readonly items: {
269
484
  readonly type: "object";
270
- readonly description: "Kibi-derived kibi.proof-receipt.v1. Receipts are never caller-authored; kb_ingest_proof derives them from kibi.proof-run.v1 artifacts.";
485
+ readonly description: "Kibi-derived kibi.proof-receipt.v2 (kibi.proof-receipt.v1 entries are still read). Receipts are never caller-authored; kb_ingest_proof derives them from kibi.proof-run.v1 artifacts.";
271
486
  readonly required: readonly ["version", "receipt_id", "test_id", "scope", "outcome", "code_snapshot", "environment_hash", "started_at", "finished_at", "artifact_digest", "contract_hash", "fingerprint", "fingerprint_components", "integration_id", "producer", "command_argv", "run_outcome", "proof_results"];
272
487
  readonly properties: {
273
488
  readonly version: {
274
489
  readonly type: "string";
275
- readonly const: "kibi.proof-receipt.v1";
490
+ readonly enum: readonly ["kibi.proof-receipt.v1", "kibi.proof-receipt.v2"];
276
491
  };
277
492
  readonly receipt_id: {
278
493
  readonly type: "string";
@@ -454,6 +669,63 @@ export declare const upsertSpec: {
454
669
  readonly additionalProperties: false;
455
670
  };
456
671
  };
672
+ readonly kind: {
673
+ readonly type: "string";
674
+ readonly enum: readonly ["e2e", "example", "property", "exhaustive", "typecheck", "arithmetic", "smt", "rule", "state_machine", "regex", "source"];
675
+ };
676
+ readonly evidence_level: {
677
+ readonly type: "string";
678
+ readonly enum: readonly ["proved", "tested"];
679
+ };
680
+ readonly certificate: {
681
+ readonly type: "object";
682
+ };
683
+ readonly certificate_digest: {
684
+ readonly type: "string";
685
+ readonly pattern: "^[a-f0-9]{64}$";
686
+ };
687
+ readonly certificate_rejection: {
688
+ readonly type: "string";
689
+ readonly minLength: 1;
690
+ };
691
+ readonly claim_bindings: {
692
+ readonly type: "array";
693
+ readonly description: "Certificate kinds: how the certificate binds to each claim its contract names in proves, judged at ingest. derived means Kibi derived the certificate's obligation from the claim's grounding fact and the certificate satisfies it; attested means no derivation exists and the author vouches for it (never proved); rejected names why.";
694
+ readonly items: {
695
+ readonly type: "object";
696
+ readonly required: readonly ["claim_key", "binding"];
697
+ readonly properties: {
698
+ readonly claim_key: {
699
+ readonly type: "string";
700
+ readonly minLength: 1;
701
+ };
702
+ readonly requirement_id: {
703
+ readonly type: "string";
704
+ readonly minLength: 1;
705
+ };
706
+ readonly fact_id: {
707
+ readonly type: "string";
708
+ readonly minLength: 1;
709
+ };
710
+ readonly binding: {
711
+ readonly type: "string";
712
+ readonly enum: readonly ["derived", "attested", "rejected"];
713
+ };
714
+ readonly scope: {
715
+ readonly type: "string";
716
+ readonly enum: readonly ["code", "source", "harness", "intent"];
717
+ };
718
+ readonly obligation: {
719
+ readonly type: "object";
720
+ };
721
+ readonly reason: {
722
+ readonly type: "string";
723
+ readonly minLength: 1;
724
+ };
725
+ };
726
+ readonly additionalProperties: false;
727
+ };
728
+ };
457
729
  readonly gaps: {
458
730
  readonly type: "array";
459
731
  readonly items: {
@@ -496,13 +768,13 @@ export declare const upsertSpec: {
496
768
  };
497
769
  readonly operator: {
498
770
  readonly type: "string";
499
- readonly enum: readonly ["eq", "neq", "lt", "lte", "gt", "gte"];
500
- readonly description: "Optional comparison operator for property_value facts. Example: 'eq'.";
771
+ readonly enum: readonly ["eq", "neq", "lt", "lte", "gt", "gte", "matches", "includes", "subset_of", "excludes"];
772
+ readonly description: "Optional comparison operator for property_value facts. Example: 'eq'. 'matches' (string facts only): value_string is a JavaScript regular expression (u flag) every value must match as a whole. Set facts only: 'includes' means every member of value_set has the property and other members may have it too; 'subset_of' means every member that has the property is in value_set ('every env var the server reads is one of ...'); 'excludes' means no member of value_set has it ('never imports md5'); 'eq' on a set means exactly those members.";
501
773
  };
502
774
  readonly value_type: {
503
775
  readonly type: "string";
504
- readonly enum: readonly ["string", "int", "number", "bool"];
505
- readonly description: "Optional typed value discriminator for property_value facts. Pair with exactly one value_string, value_int, value_number, or value_bool; do not use generic value.";
776
+ readonly enum: readonly ["string", "int", "number", "bool", "set"];
777
+ readonly description: "Optional typed value discriminator for property_value facts. Pair with exactly one value_string, value_int, value_number, value_bool, or value_set (set: a list of members, with operator eq, includes, subset_of or excludes); do not use generic value.";
506
778
  };
507
779
  readonly value_string: {
508
780
  readonly type: "string";
@@ -520,6 +792,16 @@ export declare const upsertSpec: {
520
792
  readonly type: "boolean";
521
793
  readonly description: "Optional boolean value for property_value facts.";
522
794
  };
795
+ readonly value_set: {
796
+ readonly type: "array";
797
+ readonly items: {
798
+ readonly type: "string";
799
+ readonly minLength: 1;
800
+ };
801
+ readonly minItems: 1;
802
+ readonly uniqueItems: true;
803
+ readonly description: "Optional exact set of values for property_value facts with value_type set, such as the members a domain must have.";
804
+ };
523
805
  readonly unit: {
524
806
  readonly type: "string";
525
807
  readonly description: "Optional unit for numeric property_value facts.";
@@ -1 +1 @@
1
- {"version":3,"file":"upsert.d.ts","sourceRoot":"","sources":["../../../../src/public/operations/specs/upsert.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAQvE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DuC,CAAC"}
1
+ {"version":3,"file":"upsert.d.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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DuC,CAAC"}
@@ -0,0 +1,163 @@
1
+ import { CODE_CERTIFICATE_VERSION } from "./proof-protocol.js";
2
+ import { type SourceModel, type SourceSpec } from "./proof-sources.js";
3
+ export type { SourceModel, SourceSpec } from "./proof-sources.js";
4
+ /** Where `kibi prove` asks a run to leave its certificates. */
5
+ export declare const PROOF_CERTIFICATES_ENV = "KIBI_PROOF_CERTIFICATES";
6
+ export type CodeCertificate = Readonly<Record<string, unknown>> & Readonly<{
7
+ version: typeof CODE_CERTIFICATE_VERSION;
8
+ kind: "exhaustive" | "typecheck" | "arithmetic" | "smt" | "rule" | "state_machine" | "regex" | "source";
9
+ test_id: string;
10
+ }>;
11
+ /**
12
+ * The canonical JSON of a certificate, byte for byte what
13
+ * code_certificates.pl hashes: keys sorted by code point, no whitespace,
14
+ * non-ASCII and control characters as \u escapes of UTF-16 code units.
15
+ */
16
+ export declare function canonicalCertificateJson(value: unknown): string;
17
+ /** The sha256 a receipt records for its certificate. */
18
+ export declare function certificateDigest(certificate: unknown): string;
19
+ export type ExhaustiveResult = Readonly<{
20
+ member: string;
21
+ outcome: "passed" | "failed";
22
+ message?: string;
23
+ }>;
24
+ /**
25
+ * Run `check` on every member of a finite domain and record each outcome.
26
+ * `members` must be the domain as the code defines it (import it from its
27
+ * source, never restate it): Kibi rejects the certificate unless the proof
28
+ * file imports the contract's domain_source symbol.
29
+ */
30
+ export declare function exhaustiveCertificate<T>(input: {
31
+ testId: string;
32
+ domain: Readonly<{
33
+ symbolId: string;
34
+ members: Iterable<T>;
35
+ }>;
36
+ key?: (member: T) => string;
37
+ check: (member: T) => void | Promise<void>;
38
+ }): Promise<CodeCertificate>;
39
+ /** The members an exhaustive certificate records as failed. */
40
+ export declare function failedMembers(certificate: CodeCertificate): string[];
41
+ /**
42
+ * A type checker accepted `witnessPath`, a file that fails to compile when a
43
+ * member of the domain goes unhandled (an exhaustive switch ending in a
44
+ * `never` assignment, or a mapped type over the domain).
45
+ */
46
+ export declare function typecheckCertificate(input: {
47
+ testId: string;
48
+ domainSymbolId: string;
49
+ witnessPath: string;
50
+ workspaceRoot?: string;
51
+ compiler: Readonly<{
52
+ name: string;
53
+ version: string;
54
+ }>;
55
+ accepted: boolean;
56
+ }): CodeCertificate;
57
+ export type ArithmeticConstraint = Readonly<{
58
+ operator: "eq" | "neq" | "lt" | "lte" | "gt" | "gte";
59
+ value: number;
60
+ }>;
61
+ /**
62
+ * A claim about one numeric variable that Kibi decides exactly: the
63
+ * assumptions must be satisfiable and must entail the claim for every value
64
+ * of the variable, not only the values a test happened to try.
65
+ */
66
+ export declare function arithmeticCertificate(input: {
67
+ testId: string;
68
+ variable: string;
69
+ valueType: "int" | "real";
70
+ assumptions: readonly ArithmeticConstraint[];
71
+ claim: ArithmeticConstraint;
72
+ }): CodeCertificate;
73
+ /**
74
+ * An SMT-LIB query whose unsat answer proves the claim (the query asserts
75
+ * the claim's negation). Kibi re-runs the named solver on the query.
76
+ */
77
+ export declare function smtCertificate(input: {
78
+ testId: string;
79
+ solver: Readonly<{
80
+ name: "z3" | "cvc5";
81
+ version: string;
82
+ }>;
83
+ query: string;
84
+ result: string;
85
+ }): CodeCertificate;
86
+ /** A finite domain a rule certificate ranges over. */
87
+ export type RuleDomain = Readonly<{
88
+ /** The domain's symbol; omit it for a domain the contract reads from a source. */
89
+ symbolId?: string;
90
+ members: Iterable<unknown>;
91
+ }>;
92
+ /** A predicate the code decides, and the argument types it takes. */
93
+ export type RulePredicate = Readonly<{
94
+ symbolId: string;
95
+ argTypes: readonly string[];
96
+ decide: (...args: never[]) => boolean | Promise<boolean>;
97
+ }>;
98
+ /**
99
+ * Call every predicate on every combination of its argument domains and
100
+ * record what the code decides. Import the domains and functions from their
101
+ * source (never restate them): Kibi evaluates the same exports at ingest and
102
+ * rejects a certificate whose tables differ, then model checks each claim's
103
+ * rule, predicate or set fact against the tables.
104
+ */
105
+ export declare function ruleCertificate(input: {
106
+ testId: string;
107
+ domains: Readonly<Record<string, RuleDomain>>;
108
+ predicates: Readonly<Record<string, RulePredicate>>;
109
+ }): Promise<CodeCertificate>;
110
+ /** The calls of a rule certificate that threw or returned a non-boolean. */
111
+ export declare function failedCalls(certificate: CodeCertificate): string[];
112
+ type Transitions = ReadonlyMap<unknown, unknown> | Readonly<Record<string, unknown>> | readonly unknown[] | ((state: never, event: never) => unknown);
113
+ /**
114
+ * Record a state machine as the code defines it: a transition table (an
115
+ * object or Map from each state to its next state, states, or event map; or
116
+ * a list of [from, to] pairs) or a next-state function called on every state
117
+ * and event (a throw, null or undefined means no transition). Kibi reads the
118
+ * same exports at ingest and checks each claim's transitions, reachability,
119
+ * initial and terminal states against the machine.
120
+ */
121
+ export declare function stateMachineCertificate(input: {
122
+ testId: string;
123
+ symbolId: string;
124
+ transitions: Transitions;
125
+ /** For a next-state function: the states and events it is called on. */
126
+ states?: Iterable<unknown>;
127
+ events?: Iterable<unknown>;
128
+ initial?: unknown;
129
+ }): Promise<CodeCertificate>;
130
+ /**
131
+ * Record the pattern (a RegExp) or string constant a string claim is about.
132
+ * Kibi reads the same export at ingest and decides the claim exactly: a
133
+ * pattern's language against the fact's, or the string against the fact.
134
+ */
135
+ export declare function regexCertificate(input: {
136
+ testId: string;
137
+ symbolId: string;
138
+ value: RegExp | string;
139
+ }): CodeCertificate;
140
+ /**
141
+ * The certificate of a source proof. Kibi reads the contract's source
142
+ * itself at ingest and stores its own read, so the run only names the test
143
+ * and, optionally, the source (which must be the contract's). A run may also
144
+ * leave nothing: a passed source proof needs no certificate from the test.
145
+ */
146
+ export declare function sourceCertificate(input: {
147
+ testId: string;
148
+ source?: SourceSpec;
149
+ }): CodeCertificate;
150
+ /**
151
+ * Read a project source the way Kibi does at ingest: the members (and the
152
+ * tables, objects or routes) of a JSON or YAML file, a glob, an OpenAPI
153
+ * document, the references the code makes, a data schema, a route table or
154
+ * a validator. A rule proof whose contract reads a domain from a source
155
+ * uses this to range its predicates over the same members.
156
+ */
157
+ export declare function readProjectSource(source: SourceSpec, workspaceRoot?: string): Promise<SourceModel>;
158
+ /**
159
+ * Leave the certificate where `kibi prove` reads it. Returns the file written,
160
+ * or null outside a `kibi prove` run.
161
+ */
162
+ export declare function writeCodeCertificate(certificate: CodeCertificate, env?: NodeJS.ProcessEnv): string | null;
163
+ //# sourceMappingURL=proof-certificates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proof-certificates.d.ts","sourceRoot":"","sources":["../../src/public/proof-certificates.ts"],"names":[],"mappings":"AA+BA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,UAAU,EAGhB,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAElE,+DAA+D;AAE/D,eAAO,MAAM,sBAAsB,4BAA4B,CAAC;AAGhE,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAC7D,QAAQ,CAAC;IACP,OAAO,EAAE,OAAO,wBAAwB,CAAC;IACzC,IAAI,EACA,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,KAAK,GACL,MAAM,GACN,eAAe,GACf,OAAO,GACP,QAAQ,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC,CAAC;AAmCL;;;;GAIG;AAEH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAc/D;AAED,wDAAwD;AAExD,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,OAAO,GAAG,MAAM,CAI9D;AAGD,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IACtC,MAAM,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