kibi-cli 2.32.0 → 2.36.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 (164) hide show
  1. package/dist/cli.d.ts.map +1 -1
  2. package/dist/cli.js +5 -1
  3. package/dist/commands/check-generated.d.ts +5 -1
  4. package/dist/commands/check-generated.d.ts.map +1 -1
  5. package/dist/commands/check-generated.js +24 -35
  6. package/dist/commands/init-helpers.d.ts.map +1 -1
  7. package/dist/commands/init-helpers.js +8 -5
  8. package/dist/commands/migrate.d.ts.map +1 -1
  9. package/dist/commands/migrate.js +23 -5
  10. package/dist/commands/sync/manifest.d.ts +10 -1
  11. package/dist/commands/sync/manifest.d.ts.map +1 -1
  12. package/dist/commands/sync/manifest.js +87 -14
  13. package/dist/commands/sync.d.ts.map +1 -1
  14. package/dist/commands/sync.js +19 -0
  15. package/dist/extractors/markdown.d.ts +1 -1
  16. package/dist/extractors/markdown.d.ts.map +1 -1
  17. package/dist/extractors/symbol-coordinates.js +2 -2
  18. package/dist/extractors/symbols-coordinator.d.ts +2 -4
  19. package/dist/extractors/symbols-coordinator.d.ts.map +1 -1
  20. package/dist/extractors/symbols-coordinator.js +1 -2
  21. package/dist/operations/migration/proof-contract-claims.d.ts +23 -10
  22. package/dist/operations/migration/proof-contract-claims.d.ts.map +1 -1
  23. package/dist/operations/migration/proof-contract-claims.js +35 -2
  24. package/dist/operations/migration/schema6.d.ts.map +1 -1
  25. package/dist/operations/migration/schema6.js +2 -4
  26. package/dist/operations/migration/symbol-coordinates-refresh.d.ts +3 -2
  27. package/dist/operations/migration/symbol-coordinates-refresh.d.ts.map +1 -1
  28. package/dist/operations/migration/symbol-coordinates-refresh.js +4 -3
  29. package/dist/operations/migration/untrack-symbol-coordinates.d.ts +23 -0
  30. package/dist/operations/migration/untrack-symbol-coordinates.d.ts.map +1 -0
  31. package/dist/operations/migration/untrack-symbol-coordinates.js +67 -0
  32. package/dist/operations/modeling/requirement-modeler.d.ts.map +1 -1
  33. package/dist/operations/modeling/requirement-modeler.js +48 -1
  34. package/dist/operations/modeling/requirement-types.d.ts +2 -1
  35. package/dist/operations/modeling/requirement-types.d.ts.map +1 -1
  36. package/dist/operations/modeling/requirement-utils.d.ts +1 -1
  37. package/dist/operations/modeling/requirement-utils.d.ts.map +1 -1
  38. package/dist/operations/modeling/requirement-utils.js +8 -1
  39. package/dist/operations/mutation/source-authoring.d.ts.map +1 -1
  40. package/dist/operations/mutation/source-authoring.js +39 -20
  41. package/dist/operations/proof/claim-bindings.d.ts +18 -0
  42. package/dist/operations/proof/claim-bindings.d.ts.map +1 -1
  43. package/dist/operations/proof/claim-bindings.js +157 -4
  44. package/dist/operations/proof/code-certificates.d.ts +34 -14
  45. package/dist/operations/proof/code-certificates.d.ts.map +1 -1
  46. package/dist/operations/proof/code-certificates.js +266 -157
  47. package/dist/operations/proof/code-models.d.ts +96 -0
  48. package/dist/operations/proof/code-models.d.ts.map +1 -0
  49. package/dist/operations/proof/code-models.js +601 -0
  50. package/dist/operations/proof/code-runner.d.ts +40 -0
  51. package/dist/operations/proof/code-runner.d.ts.map +1 -0
  52. package/dist/operations/proof/code-runner.js +164 -0
  53. package/dist/operations/proof/code-scope.d.ts +3 -0
  54. package/dist/operations/proof/code-scope.d.ts.map +1 -1
  55. package/dist/operations/proof/code-scope.js +26 -2
  56. package/dist/operations/proof/ingest-proof.d.ts.map +1 -1
  57. package/dist/operations/proof/ingest-proof.js +2 -1
  58. package/dist/operations/proof/regular-language.d.ts +89 -0
  59. package/dist/operations/proof/regular-language.d.ts.map +1 -0
  60. package/dist/operations/proof/regular-language.js +943 -0
  61. package/dist/operations/proof/source-code-readers.d.ts +12 -0
  62. package/dist/operations/proof/source-code-readers.d.ts.map +1 -0
  63. package/dist/operations/proof/source-code-readers.js +699 -0
  64. package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -1
  65. package/dist/operations/semantic-advisor/analyze-prose.js +2 -1
  66. package/dist/operations/semantic-advisor/strict-count-rules.d.ts.map +1 -1
  67. package/dist/operations/semantic-advisor/strict-count-rules.js +8 -2
  68. package/dist/operations/semantic-advisor/strict-rules.d.ts +8 -0
  69. package/dist/operations/semantic-advisor/strict-rules.d.ts.map +1 -1
  70. package/dist/operations/semantic-advisor/strict-rules.js +231 -1
  71. package/dist/operations/semantic-advisor/types.d.ts +1 -1
  72. package/dist/operations/semantic-advisor/types.d.ts.map +1 -1
  73. package/dist/prolog.d.ts.map +1 -1
  74. package/dist/prolog.js +13 -3
  75. package/dist/public/operations/catalog.d.ts +156 -13
  76. package/dist/public/operations/catalog.d.ts.map +1 -1
  77. package/dist/public/operations/evidence-floor.js +1 -1
  78. package/dist/public/operations/proof-contract-claims.js +1 -1
  79. package/dist/public/operations/specs/composite.d.ts +16 -3
  80. package/dist/public/operations/specs/composite.d.ts.map +1 -1
  81. package/dist/public/operations/specs/modeling.d.ts +16 -3
  82. package/dist/public/operations/specs/modeling.d.ts.map +1 -1
  83. package/dist/public/operations/specs/modeling.js +22 -3
  84. package/dist/public/operations/specs/mutation-schemas.d.ts +140 -10
  85. package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
  86. package/dist/public/operations/specs/mutation-schemas.js +14 -3
  87. package/dist/public/operations/specs/upsert.d.ts +140 -10
  88. package/dist/public/operations/specs/upsert.d.ts.map +1 -1
  89. package/dist/public/proof-certificates.d.ts +75 -1
  90. package/dist/public/proof-certificates.d.ts.map +1 -1
  91. package/dist/public/proof-certificates.js +212 -0
  92. package/dist/public/proof-protocol.d.ts +143 -10
  93. package/dist/public/proof-protocol.d.ts.map +1 -1
  94. package/dist/public/proof-protocol.js +301 -16
  95. package/dist/public/proof-receipt.d.ts +4 -3
  96. package/dist/public/proof-receipt.d.ts.map +1 -1
  97. package/dist/public/proof-receipt.js +6 -1
  98. package/dist/public/proof-sources.d.ts +102 -0
  99. package/dist/public/proof-sources.d.ts.map +1 -0
  100. package/dist/public/proof-sources.js +1292 -0
  101. package/dist/public/schemas/entity.d.ts.map +1 -1
  102. package/dist/public/schemas/entity.js +21 -1
  103. package/dist/public/skills/kibi-commit-review/SKILL.md +8 -8
  104. package/dist/public/skills/kibi-commit-review/resources/staged-gate.md +6 -6
  105. package/dist/public/skills/kibi-decisions/SKILL.md +5 -2
  106. package/dist/public/skills/kibi-decisions/resources/decision-records.md +4 -1
  107. package/dist/public/skills/kibi-freshness/SKILL.md +2 -2
  108. package/dist/public/skills/kibi-traceability/SKILL.md +3 -2
  109. package/dist/public/skills/kibi-usage/SKILL.md +5 -3
  110. package/dist/public/skills/kibi-usage/resources/proof.md +105 -9
  111. package/dist/report/html-report.css +45 -10
  112. package/dist/report/html-report.d.ts.map +1 -1
  113. package/dist/report/html-report.js +74 -17
  114. package/dist/report/report-view.d.ts +1 -1
  115. package/dist/report/report-view.d.ts.map +1 -1
  116. package/dist/report/report-view.js +1 -0
  117. package/dist/schemas/entity.schema.json +199 -8
  118. package/dist/traceability/evidence-model.d.ts +13 -12
  119. package/dist/traceability/evidence-model.d.ts.map +1 -1
  120. package/dist/traceability/evidence-model.js +1 -1
  121. package/dist/traceability/staged-diagnostics.d.ts.map +1 -1
  122. package/dist/traceability/staged-diagnostics.js +24 -20
  123. package/dist/traceability/staged-impact-contract.d.ts +4 -4
  124. package/dist/traceability/staged-impact-contract.js +9 -9
  125. package/dist/traceability/staged-symbols-manifest.d.ts +11 -3
  126. package/dist/traceability/staged-symbols-manifest.d.ts.map +1 -1
  127. package/dist/traceability/staged-symbols-manifest.js +47 -140
  128. package/dist/types/entities.d.ts +1 -1
  129. package/dist/types/entities.d.ts.map +1 -1
  130. package/dist/utils/rule-registry.generated.d.ts +1 -1
  131. package/dist/utils/rule-registry.generated.js +1 -1
  132. package/dist/utils/schema-version.d.ts +1 -1
  133. package/dist/utils/schema-version.d.ts.map +1 -1
  134. package/dist/utils/schema-version.js +3 -1
  135. package/dist/utils/strict-modeling.d.ts +3 -2
  136. package/dist/utils/strict-modeling.d.ts.map +1 -1
  137. package/dist/utils/strict-modeling.js +37 -4
  138. package/dist/workspace-cwd.d.ts +15 -0
  139. package/dist/workspace-cwd.d.ts.map +1 -0
  140. package/dist/workspace-cwd.js +86 -0
  141. package/package.json +2 -2
  142. package/schema/validation.pl +3 -1
  143. package/src/public/operations/evidence-floor.ts +1 -1
  144. package/src/public/operations/proof-contract-claims.ts +1 -1
  145. package/src/public/operations/specs/modeling.ts +24 -5
  146. package/src/public/operations/specs/mutation-schemas.ts +14 -3
  147. package/src/public/proof-certificates.ts +296 -1
  148. package/src/public/proof-protocol-types.d.ts +54 -2
  149. package/src/public/proof-protocol.ts +396 -20
  150. package/src/public/proof-receipt.ts +8 -2
  151. package/src/public/proof-sources.ts +1656 -0
  152. package/src/public/schemas/entity.ts +32 -2
  153. package/src/public/skills/kibi-commit-review/SKILL.md +8 -8
  154. package/src/public/skills/kibi-commit-review/resources/staged-gate.md +6 -6
  155. package/src/public/skills/kibi-decisions/SKILL.md +5 -2
  156. package/src/public/skills/kibi-decisions/resources/decision-records.md +4 -1
  157. package/src/public/skills/kibi-freshness/SKILL.md +2 -2
  158. package/src/public/skills/kibi-traceability/SKILL.md +3 -2
  159. package/src/public/skills/kibi-usage/SKILL.md +5 -3
  160. package/src/public/skills/kibi-usage/resources/proof.md +105 -9
  161. package/src/schemas/entity.schema.json +199 -8
  162. package/dist/traceability/reviewed-coordinate-refresh.d.ts +0 -10
  163. package/dist/traceability/reviewed-coordinate-refresh.d.ts.map +0 -1
  164. package/dist/traceability/reviewed-coordinate-refresh.js +0 -49
@@ -211,12 +211,24 @@ export declare const ENTITY_PROPERTIES_SCHEMA: {
211
211
  };
212
212
  readonly kind: {
213
213
  readonly type: "string";
214
- readonly enum: readonly ["e2e", "example", "property", "exhaustive", "typecheck", "arithmetic", "smt"];
215
- readonly description: "What the checker establishes; absent means e2e. exhaustive, typecheck, arithmetic and smt must leave a kibi.code-certificate.v1 that Kibi re-checks before the receipt counts as proved.";
214
+ readonly enum: readonly ["e2e", "example", "property", "exhaustive", "typecheck", "arithmetic", "smt", "rule", "state_machine", "regex", "source"];
215
+ 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.";
216
+ };
217
+ readonly source: {
218
+ 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.";
219
+ readonly type: "object";
220
+ readonly required: readonly ["reader"];
221
+ readonly properties: {
222
+ readonly reader: {
223
+ readonly type: "string";
224
+ readonly enum: readonly ["json", "yaml", "glob", "openapi", "references", "schema", "routes", "validator"];
225
+ };
226
+ };
227
+ readonly additionalProperties: true;
216
228
  };
217
229
  readonly domain_source: {
218
230
  readonly type: "object";
219
- readonly description: "exhaustive and typecheck: the symbol that defines the finite domain. 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.";
231
+ 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.";
220
232
  readonly required: readonly ["symbol_id"];
221
233
  readonly properties: {
222
234
  readonly symbol_id: {
@@ -245,7 +257,7 @@ export declare const ENTITY_PROPERTIES_SCHEMA: {
245
257
  };
246
258
  readonly proves: {
247
259
  readonly type: "array";
248
- 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 claim with no such derivation is only attested and never counts as proved.";
260
+ 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.";
249
261
  readonly minItems: 1;
250
262
  readonly items: {
251
263
  readonly type: "string";
@@ -255,9 +267,45 @@ export declare const ENTITY_PROPERTIES_SCHEMA: {
255
267
  };
256
268
  readonly value_source: {
257
269
  readonly type: "array";
258
- 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.";
270
+ 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).";
259
271
  readonly minItems: 1;
260
272
  readonly items: {
273
+ readonly type: "object";
274
+ readonly properties: {
275
+ readonly symbol_id: {
276
+ readonly type: "string";
277
+ readonly minLength: 1;
278
+ };
279
+ readonly export: {
280
+ readonly type: "string";
281
+ readonly minLength: 1;
282
+ };
283
+ readonly source: {
284
+ readonly type: "object";
285
+ 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.";
286
+ readonly required: readonly ["reader"];
287
+ readonly properties: {
288
+ readonly reader: {
289
+ readonly type: "string";
290
+ readonly enum: readonly ["json", "yaml", "glob", "openapi", "references", "schema", "routes", "validator"];
291
+ };
292
+ };
293
+ readonly additionalProperties: true;
294
+ };
295
+ readonly measure: {
296
+ readonly type: "string";
297
+ readonly enum: readonly ["value", "count"];
298
+ 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.";
299
+ };
300
+ };
301
+ readonly additionalProperties: false;
302
+ };
303
+ };
304
+ readonly predicate_source: {
305
+ readonly type: "object";
306
+ 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.";
307
+ readonly minProperties: 1;
308
+ readonly additionalProperties: {
261
309
  readonly type: "object";
262
310
  readonly required: readonly ["symbol_id"];
263
311
  readonly properties: {
@@ -268,11 +316,93 @@ export declare const ENTITY_PROPERTIES_SCHEMA: {
268
316
  readonly export: {
269
317
  readonly type: "string";
270
318
  readonly minLength: 1;
319
+ 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.";
320
+ };
321
+ readonly harness_for: {
322
+ readonly type: "array";
323
+ readonly minItems: 1;
324
+ readonly items: {
325
+ readonly type: "string";
326
+ readonly minLength: 1;
327
+ };
328
+ 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.";
271
329
  };
272
330
  };
273
331
  readonly additionalProperties: false;
274
332
  };
275
333
  };
334
+ readonly domains: {
335
+ readonly type: "object";
336
+ 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.";
337
+ readonly minProperties: 1;
338
+ readonly additionalProperties: {
339
+ readonly anyOf: readonly [{
340
+ readonly type: "object";
341
+ readonly required: readonly ["symbol_id"];
342
+ readonly properties: {
343
+ readonly symbol_id: {
344
+ readonly type: "string";
345
+ readonly minLength: 1;
346
+ };
347
+ readonly export: {
348
+ readonly type: "string";
349
+ readonly minLength: 1;
350
+ };
351
+ };
352
+ readonly additionalProperties: false;
353
+ }, {
354
+ readonly type: "object";
355
+ readonly required: readonly ["source"];
356
+ readonly properties: {
357
+ readonly source: {
358
+ readonly type: "object";
359
+ 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.";
360
+ readonly required: readonly ["reader"];
361
+ readonly properties: {
362
+ readonly reader: {
363
+ readonly type: "string";
364
+ readonly enum: readonly ["json", "yaml", "glob", "openapi", "references", "schema", "routes", "validator"];
365
+ };
366
+ };
367
+ readonly additionalProperties: true;
368
+ };
369
+ };
370
+ readonly additionalProperties: false;
371
+ }];
372
+ };
373
+ };
374
+ readonly initial_source: {
375
+ readonly description: "state_machine: the export holding the initial state (or states), needed for initial_states and reachable_states facts.";
376
+ readonly type: "object";
377
+ readonly required: readonly ["symbol_id"];
378
+ readonly properties: {
379
+ readonly symbol_id: {
380
+ readonly type: "string";
381
+ readonly minLength: 1;
382
+ };
383
+ readonly export: {
384
+ readonly type: "string";
385
+ readonly minLength: 1;
386
+ };
387
+ };
388
+ readonly additionalProperties: false;
389
+ };
390
+ readonly pattern_source: {
391
+ 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.";
392
+ readonly type: "object";
393
+ readonly required: readonly ["symbol_id"];
394
+ readonly properties: {
395
+ readonly symbol_id: {
396
+ readonly type: "string";
397
+ readonly minLength: 1;
398
+ };
399
+ readonly export: {
400
+ readonly type: "string";
401
+ readonly minLength: 1;
402
+ };
403
+ };
404
+ readonly additionalProperties: false;
405
+ };
276
406
  readonly constraint_source: {
277
407
  readonly type: "object";
278
408
  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.";
@@ -524,7 +654,7 @@ export declare const ENTITY_PROPERTIES_SCHEMA: {
524
654
  };
525
655
  readonly kind: {
526
656
  readonly type: "string";
527
- readonly enum: readonly ["e2e", "example", "property", "exhaustive", "typecheck", "arithmetic", "smt"];
657
+ readonly enum: readonly ["e2e", "example", "property", "exhaustive", "typecheck", "arithmetic", "smt", "rule", "state_machine", "regex", "source"];
528
658
  };
529
659
  readonly evidence_level: {
530
660
  readonly type: "string";
@@ -566,7 +696,7 @@ export declare const ENTITY_PROPERTIES_SCHEMA: {
566
696
  };
567
697
  readonly scope: {
568
698
  readonly type: "string";
569
- readonly enum: readonly ["code", "intent"];
699
+ readonly enum: readonly ["code", "source", "harness", "intent"];
570
700
  };
571
701
  readonly obligation: {
572
702
  readonly type: "object";
@@ -621,13 +751,13 @@ export declare const ENTITY_PROPERTIES_SCHEMA: {
621
751
  };
622
752
  readonly operator: {
623
753
  readonly type: "string";
624
- readonly enum: readonly ["eq", "neq", "lt", "lte", "gt", "gte"];
625
- readonly description: "Optional comparison operator for property_value facts. Example: 'eq'.";
754
+ readonly enum: readonly ["eq", "neq", "lt", "lte", "gt", "gte", "matches", "includes", "subset_of", "excludes"];
755
+ 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.";
626
756
  };
627
757
  readonly value_type: {
628
758
  readonly type: "string";
629
759
  readonly enum: readonly ["string", "int", "number", "bool", "set"];
630
- 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: an exact list of allowed values, operator eq or neq); do not use generic value.";
760
+ 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.";
631
761
  };
632
762
  readonly value_string: {
633
763
  readonly type: "string";
@@ -1 +1 @@
1
- {"version":3,"file":"mutation-schemas.d.ts","sourceRoot":"","sources":["../../../../src/public/operations/specs/mutation-schemas.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,YAAY,gFASf,CAAC;AAWX,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmZ3B,CAAC;AAEX,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;CA8CvB,CAAC"}
@@ -205,13 +205,24 @@ export const ENTITY_PROPERTIES_SCHEMA = {
205
205
  },
206
206
  operator: {
207
207
  type: "string",
208
- enum: ["eq", "neq", "lt", "lte", "gt", "gte"],
209
- description: "Optional comparison operator for property_value facts. Example: 'eq'.",
208
+ enum: [
209
+ "eq",
210
+ "neq",
211
+ "lt",
212
+ "lte",
213
+ "gt",
214
+ "gte",
215
+ "matches",
216
+ "includes",
217
+ "subset_of",
218
+ "excludes",
219
+ ],
220
+ 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.",
210
221
  },
211
222
  value_type: {
212
223
  type: "string",
213
224
  enum: ["string", "int", "number", "bool", "set"],
214
- 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: an exact list of allowed values, operator eq or neq); do not use generic value.",
225
+ 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.",
215
226
  },
216
227
  value_string: {
217
228
  type: "string",
@@ -228,12 +228,24 @@ export declare const upsertSpec: {
228
228
  };
229
229
  readonly kind: {
230
230
  readonly type: "string";
231
- readonly enum: readonly ["e2e", "example", "property", "exhaustive", "typecheck", "arithmetic", "smt"];
232
- readonly description: "What the checker establishes; absent means e2e. exhaustive, typecheck, arithmetic and smt must leave a kibi.code-certificate.v1 that Kibi re-checks before the receipt counts as proved.";
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;
233
245
  };
234
246
  readonly domain_source: {
235
247
  readonly type: "object";
236
- readonly description: "exhaustive and typecheck: the symbol that defines the finite domain. 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.";
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.";
237
249
  readonly required: readonly ["symbol_id"];
238
250
  readonly properties: {
239
251
  readonly symbol_id: {
@@ -262,7 +274,7 @@ export declare const upsertSpec: {
262
274
  };
263
275
  readonly proves: {
264
276
  readonly type: "array";
265
- 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 claim with no such derivation is only attested and never counts as proved.";
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.";
266
278
  readonly minItems: 1;
267
279
  readonly items: {
268
280
  readonly type: "string";
@@ -272,9 +284,45 @@ export declare const upsertSpec: {
272
284
  };
273
285
  readonly value_source: {
274
286
  readonly type: "array";
275
- 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.";
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).";
276
288
  readonly minItems: 1;
277
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: {
278
326
  readonly type: "object";
279
327
  readonly required: readonly ["symbol_id"];
280
328
  readonly properties: {
@@ -285,11 +333,93 @@ export declare const upsertSpec: {
285
333
  readonly export: {
286
334
  readonly type: "string";
287
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.";
288
346
  };
289
347
  };
290
348
  readonly additionalProperties: false;
291
349
  };
292
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
+ };
293
423
  readonly constraint_source: {
294
424
  readonly type: "object";
295
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.";
@@ -541,7 +671,7 @@ export declare const upsertSpec: {
541
671
  };
542
672
  readonly kind: {
543
673
  readonly type: "string";
544
- readonly enum: readonly ["e2e", "example", "property", "exhaustive", "typecheck", "arithmetic", "smt"];
674
+ readonly enum: readonly ["e2e", "example", "property", "exhaustive", "typecheck", "arithmetic", "smt", "rule", "state_machine", "regex", "source"];
545
675
  };
546
676
  readonly evidence_level: {
547
677
  readonly type: "string";
@@ -583,7 +713,7 @@ export declare const upsertSpec: {
583
713
  };
584
714
  readonly scope: {
585
715
  readonly type: "string";
586
- readonly enum: readonly ["code", "intent"];
716
+ readonly enum: readonly ["code", "source", "harness", "intent"];
587
717
  };
588
718
  readonly obligation: {
589
719
  readonly type: "object";
@@ -638,13 +768,13 @@ export declare const upsertSpec: {
638
768
  };
639
769
  readonly operator: {
640
770
  readonly type: "string";
641
- readonly enum: readonly ["eq", "neq", "lt", "lte", "gt", "gte"];
642
- 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.";
643
773
  };
644
774
  readonly value_type: {
645
775
  readonly type: "string";
646
776
  readonly enum: readonly ["string", "int", "number", "bool", "set"];
647
- 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: an exact list of allowed values, operator eq or neq); do not use generic value.";
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.";
648
778
  };
649
779
  readonly value_string: {
650
780
  readonly type: "string";
@@ -1 +1 @@
1
- {"version":3,"file":"upsert.d.ts","sourceRoot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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DuC,CAAC"}
@@ -1,9 +1,11 @@
1
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";
2
4
  /** Where `kibi prove` asks a run to leave its certificates. */
3
5
  export declare const PROOF_CERTIFICATES_ENV = "KIBI_PROOF_CERTIFICATES";
4
6
  export type CodeCertificate = Readonly<Record<string, unknown>> & Readonly<{
5
7
  version: typeof CODE_CERTIFICATE_VERSION;
6
- kind: "exhaustive" | "typecheck" | "arithmetic" | "smt";
8
+ kind: "exhaustive" | "typecheck" | "arithmetic" | "smt" | "rule" | "state_machine" | "regex" | "source";
7
9
  test_id: string;
8
10
  }>;
9
11
  /**
@@ -81,6 +83,78 @@ export declare function smtCertificate(input: {
81
83
  query: string;
82
84
  result: string;
83
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>;
84
158
  /**
85
159
  * Leave the certificate where `kibi prove` reads it. Returns the file written,
86
160
  * or null outside a `kibi prove` run.
@@ -1 +1 @@
1
- {"version":3,"file":"proof-certificates.d.ts","sourceRoot":"","sources":["../../src/public/proof-certificates.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,+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,EAAE,YAAY,GAAG,WAAW,GAAG,YAAY,GAAG,KAAK,CAAC;IACxD,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,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC,CAAC;AAEH;;;;;GAKG;AAEH,wBAAsB,qBAAqB,CAAC,CAAC,EAAE,KAAK,EAAE;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,QAAQ,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAA;KAAE,CAAC,CAAC;IAC7D,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KA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