kibi-cli 2.38.0 → 2.40.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 (222) hide show
  1. package/dist/cli-json-command.d.ts.map +1 -1
  2. package/dist/cli-json-command.js +4 -0
  3. package/dist/cli-register-foundation.js +2 -2
  4. package/dist/cli-register-reporting.d.ts.map +1 -1
  5. package/dist/cli-register-reporting.js +1 -0
  6. package/dist/cli.d.ts.map +1 -1
  7. package/dist/cli.js +3 -0
  8. package/dist/commands/check.d.ts.map +1 -1
  9. package/dist/commands/check.js +33 -9
  10. package/dist/commands/coverage.d.ts +1 -0
  11. package/dist/commands/coverage.d.ts.map +1 -1
  12. package/dist/commands/coverage.js +40 -0
  13. package/dist/commands/doctor.d.ts +5 -0
  14. package/dist/commands/doctor.d.ts.map +1 -1
  15. package/dist/commands/doctor.js +29 -0
  16. package/dist/commands/init.d.ts.map +1 -1
  17. package/dist/commands/init.js +4 -0
  18. package/dist/commands/migrate-plan-record.d.ts +18 -0
  19. package/dist/commands/migrate-plan-record.d.ts.map +1 -0
  20. package/dist/commands/migrate-plan-record.js +112 -0
  21. package/dist/commands/migrate.d.ts +11 -2
  22. package/dist/commands/migrate.d.ts.map +1 -1
  23. package/dist/commands/migrate.js +60 -8
  24. package/dist/commands/prove.d.ts.map +1 -1
  25. package/dist/commands/prove.js +18 -3
  26. package/dist/commands/sync/manifest.d.ts.map +1 -1
  27. package/dist/commands/sync/manifest.js +17 -4
  28. package/dist/commands/sync/persistence.d.ts.map +1 -1
  29. package/dist/commands/sync/persistence.js +6 -0
  30. package/dist/commands/sync.d.ts.map +1 -1
  31. package/dist/commands/sync.js +8 -0
  32. package/dist/commands/telemetry.d.ts.map +1 -1
  33. package/dist/commands/telemetry.js +12 -2
  34. package/dist/extractors/markdown.d.ts +6 -0
  35. package/dist/extractors/markdown.d.ts.map +1 -1
  36. package/dist/extractors/markdown.js +21 -0
  37. package/dist/extractors/symbol-title-match.d.ts +31 -0
  38. package/dist/extractors/symbol-title-match.d.ts.map +1 -0
  39. package/dist/extractors/symbol-title-match.js +133 -0
  40. package/dist/extractors/symbols-coordinator.d.ts.map +1 -1
  41. package/dist/extractors/symbols-coordinator.js +81 -12
  42. package/dist/operations/bootstrap/discovery-evidence.d.ts.map +1 -1
  43. package/dist/operations/bootstrap/discovery-evidence.js +44 -2
  44. package/dist/operations/bootstrap/discovery.d.ts.map +1 -1
  45. package/dist/operations/bootstrap/discovery.js +1 -0
  46. package/dist/operations/bootstrap/guidance-actions.d.ts.map +1 -1
  47. package/dist/operations/bootstrap/guidance-actions.js +12 -1
  48. package/dist/operations/bootstrap/plugin-offers.d.ts +7 -1
  49. package/dist/operations/bootstrap/plugin-offers.d.ts.map +1 -1
  50. package/dist/operations/bootstrap/plugin-offers.js +73 -3
  51. package/dist/operations/modeling/logic-modeling.d.ts.map +1 -1
  52. package/dist/operations/modeling/logic-modeling.js +2 -1
  53. package/dist/operations/modeling/model-requirement.d.ts.map +1 -1
  54. package/dist/operations/modeling/model-requirement.js +2 -1
  55. package/dist/operations/mutation/symbol-refresh.d.ts +2 -0
  56. package/dist/operations/mutation/symbol-refresh.d.ts.map +1 -1
  57. package/dist/operations/mutation/symbol-refresh.js +6 -1
  58. package/dist/operations/mutation/upsert.d.ts.map +1 -1
  59. package/dist/operations/mutation/upsert.js +7 -0
  60. package/dist/operations/planning/compile-intent.d.ts.map +1 -1
  61. package/dist/operations/planning/compile-intent.js +2 -1
  62. package/dist/operations/proof/claim-bindings.d.ts +11 -0
  63. package/dist/operations/proof/claim-bindings.d.ts.map +1 -1
  64. package/dist/operations/proof/claim-bindings.js +144 -1
  65. package/dist/operations/proof/code-certificates.d.ts +10 -3
  66. package/dist/operations/proof/code-certificates.d.ts.map +1 -1
  67. package/dist/operations/proof/code-certificates.js +65 -13
  68. package/dist/operations/proof/code-languages.d.ts +104 -0
  69. package/dist/operations/proof/code-languages.d.ts.map +1 -0
  70. package/dist/operations/proof/code-languages.js +119 -0
  71. package/dist/operations/proof/code-models.d.ts +2 -0
  72. package/dist/operations/proof/code-models.d.ts.map +1 -1
  73. package/dist/operations/proof/code-models.js +11 -5
  74. package/dist/operations/proof/code-runner.d.ts +12 -9
  75. package/dist/operations/proof/code-runner.d.ts.map +1 -1
  76. package/dist/operations/proof/code-runner.js +81 -38
  77. package/dist/operations/proof/code-scope.d.ts +8 -0
  78. package/dist/operations/proof/code-scope.d.ts.map +1 -1
  79. package/dist/operations/proof/code-scope.js +30 -1
  80. package/dist/operations/proof/explain.d.ts +76 -0
  81. package/dist/operations/proof/explain.d.ts.map +1 -1
  82. package/dist/operations/proof/explain.js +228 -0
  83. package/dist/operations/proof/ingest-proof.d.ts +2 -0
  84. package/dist/operations/proof/ingest-proof.d.ts.map +1 -1
  85. package/dist/operations/proof/ingest-proof.js +1 -0
  86. package/dist/operations/proof/java-package-shadow.d.ts +14 -0
  87. package/dist/operations/proof/java-package-shadow.d.ts.map +1 -0
  88. package/dist/operations/proof/java-package-shadow.js +389 -0
  89. package/dist/operations/proof/prolog-evaluator.d.ts +14 -0
  90. package/dist/operations/proof/prolog-evaluator.d.ts.map +1 -0
  91. package/dist/operations/proof/prolog-evaluator.js +247 -0
  92. package/dist/operations/proof/prolog-source-reader.d.ts +20 -0
  93. package/dist/operations/proof/prolog-source-reader.d.ts.map +1 -0
  94. package/dist/operations/proof/prolog-source-reader.js +1123 -0
  95. package/dist/operations/proof/source-code-readers.d.ts +6 -0
  96. package/dist/operations/proof/source-code-readers.d.ts.map +1 -1
  97. package/dist/operations/proof/source-code-readers.js +879 -75
  98. package/dist/operations/semantic-advisor/analyze-prose.d.ts +9 -1
  99. package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -1
  100. package/dist/operations/semantic-advisor/analyze-prose.js +21 -0
  101. package/dist/operations/semantic-advisor/case-preview.d.ts +24 -0
  102. package/dist/operations/semantic-advisor/case-preview.d.ts.map +1 -0
  103. package/dist/operations/semantic-advisor/case-preview.js +216 -0
  104. package/dist/operations/semantic-advisor/shared.d.ts.map +1 -1
  105. package/dist/operations/semantic-advisor/shared.js +3 -0
  106. package/dist/operations/semantic-advisor/types.d.ts +23 -0
  107. package/dist/operations/semantic-advisor/types.d.ts.map +1 -1
  108. package/dist/plugins/approved-source-analyzers.generated.d.ts +15 -34
  109. package/dist/plugins/approved-source-analyzers.generated.d.ts.map +1 -1
  110. package/dist/plugins/approved-source-analyzers.generated.js +15 -34
  111. package/dist/plugins/plugin-install-check.d.ts +21 -0
  112. package/dist/plugins/plugin-install-check.d.ts.map +1 -0
  113. package/dist/plugins/plugin-install-check.js +62 -0
  114. package/dist/plugins/proof-reference-extractors.d.ts +20 -0
  115. package/dist/plugins/proof-reference-extractors.d.ts.map +1 -0
  116. package/dist/plugins/proof-reference-extractors.js +104 -0
  117. package/dist/plugins/reference-language-suggestion.d.ts +51 -0
  118. package/dist/plugins/reference-language-suggestion.d.ts.map +1 -0
  119. package/dist/plugins/reference-language-suggestion.js +277 -0
  120. package/dist/plugins/registry.d.ts.map +1 -1
  121. package/dist/plugins/registry.js +3 -1
  122. package/dist/plugins/source-analysis-service.d.ts.map +1 -1
  123. package/dist/plugins/source-analysis-service.js +4 -0
  124. package/dist/plugins/source-change-analysis.d.ts +26 -1
  125. package/dist/plugins/source-change-analysis.d.ts.map +1 -1
  126. package/dist/plugins/source-change-analysis.js +77 -5
  127. package/dist/plugins/source-classification.d.ts +2 -2
  128. package/dist/plugins/source-classification.d.ts.map +1 -1
  129. package/dist/plugins/source-classification.js +45 -1
  130. package/dist/public/operations/catalog.d.ts +62 -7
  131. package/dist/public/operations/catalog.d.ts.map +1 -1
  132. package/dist/public/operations/check-executor.d.ts.map +1 -1
  133. package/dist/public/operations/check-executor.js +3 -0
  134. package/dist/public/operations/evidence-floor.d.ts +8 -0
  135. package/dist/public/operations/evidence-floor.d.ts.map +1 -1
  136. package/dist/public/operations/evidence-floor.js +19 -1
  137. package/dist/public/operations/repair-plan.d.ts +46 -0
  138. package/dist/public/operations/repair-plan.d.ts.map +1 -1
  139. package/dist/public/operations/repair-plan.js +110 -1
  140. package/dist/public/operations/schema6-check-actions.js +1 -1
  141. package/dist/public/operations/specs/check-rules.generated.d.ts +1 -1
  142. package/dist/public/operations/specs/check-rules.generated.d.ts.map +1 -1
  143. package/dist/public/operations/specs/check-rules.generated.js +3 -1
  144. package/dist/public/operations/specs/check.d.ts +1 -1
  145. package/dist/public/operations/specs/mutation-schemas.d.ts +61 -6
  146. package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
  147. package/dist/public/operations/specs/mutation-schemas.js +30 -0
  148. package/dist/public/operations/specs/reporting.d.ts +8 -0
  149. package/dist/public/operations/specs/reporting.d.ts.map +1 -1
  150. package/dist/public/operations/specs/reporting.js +26 -3
  151. package/dist/public/operations/specs/semantic.d.ts.map +1 -1
  152. package/dist/public/operations/specs/semantic.js +2 -1
  153. package/dist/public/operations/specs/upsert.d.ts +61 -6
  154. package/dist/public/operations/specs/upsert.d.ts.map +1 -1
  155. package/dist/public/operations/symbol-coordinates-check.d.ts +11 -0
  156. package/dist/public/operations/symbol-coordinates-check.d.ts.map +1 -0
  157. package/dist/public/operations/symbol-coordinates-check.js +66 -0
  158. package/dist/public/proof-protocol.d.ts +31 -6
  159. package/dist/public/proof-protocol.d.ts.map +1 -1
  160. package/dist/public/proof-protocol.js +45 -15
  161. package/dist/public/proof-sources.d.ts +4 -2
  162. package/dist/public/proof-sources.d.ts.map +1 -1
  163. package/dist/public/proof-sources.js +43 -4
  164. package/dist/public/schemas/entity.d.ts.map +1 -1
  165. package/dist/public/schemas/entity.js +59 -0
  166. package/dist/public/skills/kibi-commit-review/SKILL.md +6 -2
  167. package/dist/public/skills/kibi-decisions/SKILL.md +7 -2
  168. package/dist/public/skills/kibi-decisions/resources/signoff-views.md +3 -1
  169. package/dist/public/skills/kibi-usage/SKILL.md +14 -3
  170. package/dist/public/skills/kibi-usage/resources/prolog-proofs.md +207 -0
  171. package/dist/public/skills/kibi-usage/resources/proof.md +44 -3
  172. package/dist/schemas/entity.schema.json +126 -6
  173. package/dist/search-answer.d.ts +3 -2
  174. package/dist/search-answer.d.ts.map +1 -1
  175. package/dist/search-answer.js +56 -3
  176. package/dist/traceability/analysis-gate.d.ts +3 -1
  177. package/dist/traceability/analysis-gate.d.ts.map +1 -1
  178. package/dist/traceability/analysis-gate.js +9 -1
  179. package/dist/traceability/impact-knowledge.d.ts.map +1 -1
  180. package/dist/traceability/impact-knowledge.js +2 -0
  181. package/dist/traceability/staged-file-coverage.d.ts.map +1 -1
  182. package/dist/traceability/staged-file-coverage.js +7 -2
  183. package/dist/traceability/symbol-extract.d.ts +17 -0
  184. package/dist/traceability/symbol-extract.d.ts.map +1 -1
  185. package/dist/traceability/symbol-extract.js +69 -15
  186. package/dist/traceability/temp-kb.d.ts.map +1 -1
  187. package/dist/traceability/temp-kb.js +11 -1
  188. package/dist/traceability/validate.d.ts.map +1 -1
  189. package/dist/traceability/validate.js +5 -7
  190. package/dist/types/entities.d.ts +12 -0
  191. package/dist/types/entities.d.ts.map +1 -1
  192. package/dist/usage-telemetry.d.ts +9 -0
  193. package/dist/usage-telemetry.d.ts.map +1 -1
  194. package/dist/usage-telemetry.js +50 -4
  195. package/dist/utils/first-sentence.d.ts +9 -0
  196. package/dist/utils/first-sentence.d.ts.map +1 -0
  197. package/dist/utils/first-sentence.js +52 -0
  198. package/dist/utils/rule-registry.generated.d.ts +11 -0
  199. package/dist/utils/rule-registry.generated.d.ts.map +1 -1
  200. package/dist/utils/rule-registry.generated.js +13 -0
  201. package/package.json +5 -5
  202. package/schema/entities.pl +12 -0
  203. package/src/public/operations/check-executor.ts +8 -0
  204. package/src/public/operations/evidence-floor.ts +29 -1
  205. package/src/public/operations/repair-plan.ts +152 -1
  206. package/src/public/operations/schema6-check-actions.ts +1 -1
  207. package/src/public/operations/specs/check-rules.generated.ts +3 -1
  208. package/src/public/operations/specs/mutation-schemas.ts +34 -0
  209. package/src/public/operations/specs/reporting.ts +38 -3
  210. package/src/public/operations/specs/semantic.ts +2 -1
  211. package/src/public/operations/symbol-coordinates-check.ts +79 -0
  212. package/src/public/proof-protocol-types.d.ts +22 -5
  213. package/src/public/proof-protocol.ts +78 -19
  214. package/src/public/proof-sources.ts +51 -3
  215. package/src/public/schemas/entity.ts +65 -0
  216. package/src/public/skills/kibi-commit-review/SKILL.md +6 -2
  217. package/src/public/skills/kibi-decisions/SKILL.md +7 -2
  218. package/src/public/skills/kibi-decisions/resources/signoff-views.md +3 -1
  219. package/src/public/skills/kibi-usage/SKILL.md +14 -3
  220. package/src/public/skills/kibi-usage/resources/prolog-proofs.md +207 -0
  221. package/src/public/skills/kibi-usage/resources/proof.md +44 -3
  222. package/src/schemas/entity.schema.json +126 -6
@@ -27,6 +27,8 @@ import { languageAccepts, languagesDisjoint, languagesEqual, UnsupportedPattern,
27
27
  import { loadSymbol } from "./code-certificates.js";
28
28
  import { describeSource, readSource } from "../../public/proof-sources.js";
29
29
  import { runCodeEvaluator, TS_RESOLVE_HOOKS } from "./code-runner.js";
30
+ import { CODE_LANGUAGE_NAMES, codeLanguage, languageName, } from "./code-languages.js";
31
+ import { PROLOG_EVALUATOR } from "./prolog-evaluator.js";
30
32
  import { evaluateSourceCode } from "./source-code-readers.js";
31
33
  /** The most predicate calls one rule certificate may need. */
32
34
  export const MAX_TABLE_ROWS = 100_000;
@@ -317,9 +319,13 @@ async function resolveReference(context, reference, label) {
317
319
  const symbol = await loadSymbol(context, reference.symbol_id);
318
320
  if (!symbol || symbol.sourceFile === "")
319
321
  return `the ${label} symbol ${reference.symbol_id} has no source file`;
322
+ const file = path.resolve(context.workspaceRoot, symbol.sourceFile);
323
+ if (reference.arg !== undefined && codeLanguage(file) !== "prolog")
324
+ return `${label}.arg applies only to a SWI-Prolog predicate, not to ${languageName(file)} in ${symbol.sourceFile}`;
320
325
  return {
321
- file: path.resolve(context.workspaceRoot, symbol.sourceFile),
326
+ file,
322
327
  export: reference.export ?? symbol.title,
328
+ ...(reference.arg === undefined ? {} : { arg: reference.arg }),
323
329
  };
324
330
  }
325
331
  /**
@@ -328,16 +334,16 @@ async function resolveReference(context, reference, label) {
328
334
  */
329
335
  // implements REQ-kibi-non-numeric-proof-kinds
330
336
  export function evaluateCodeModel(workspaceRoot, files, plan) {
331
- const python = files.map((file) => /\.py$/i.test(file.file));
332
- if (python.some((value) => value !== python[0]))
337
+ const languages = [...new Set(files.map((file) => codeLanguage(file.file)))];
338
+ if (languages.length > 1)
333
339
  return {
334
340
  ok: false,
335
- reason: "the contract's sources mix Python and JavaScript files; one certificate reads one language",
341
+ reason: `the contract's sources mix ${languages.map((language) => (language === null ? "unsupported" : CODE_LANGUAGE_NAMES[language])).join(" and ")} files; one certificate reads one language`,
336
342
  };
337
343
  const first = files[0];
338
344
  if (first === undefined)
339
345
  return { ok: false, reason: "the contract names no source" };
340
- const run = runCodeEvaluator(workspaceRoot, path.relative(workspaceRoot, first.file), { js: jsModelEvaluator(), python: PYTHON_MODEL_EVALUATOR }, [JSON.stringify(plan)], (parsed) => parsed !== null && typeof parsed === "object" && "ok" in parsed);
346
+ const run = runCodeEvaluator(workspaceRoot, path.relative(workspaceRoot, first.file), { js: jsModelEvaluator(), python: PYTHON_MODEL_EVALUATOR, prolog: PROLOG_EVALUATOR }, [JSON.stringify(plan)], (parsed) => parsed !== null && typeof parsed === "object" && "ok" in parsed);
341
347
  if (!run.ok)
342
348
  return {
343
349
  ok: false,
@@ -1,7 +1,9 @@
1
+ import { type CodeLanguage } from "./code-languages.js";
1
2
  /**
2
3
  * How Kibi runs a small evaluator script against the workspace's own code:
3
4
  * the TypeScript and JavaScript runners (bun, the workspace's tsx, node with
4
- * type stripping) and the Python interpreters a project uses. The proof kinds
5
+ * type stripping), the Python interpreters a project uses and the SWI-Prolog
6
+ * Kibi's engine runs on. The proof kinds
5
7
  * that read a model from the code (exhaustive domains, rule tables, state
6
8
  * machines, patterns, data schemas, route tables) all load code this way.
7
9
  */
@@ -25,6 +27,7 @@ export declare function spawnSyncThroughFiles(command: string, args: readonly st
25
27
  cwd?: string;
26
28
  input?: string;
27
29
  timeout: number;
30
+ env?: NodeJS.ProcessEnv;
28
31
  }>): {
29
32
  error: Error | undefined;
30
33
  status: number | null;
@@ -36,21 +39,21 @@ export declare function spawnSyncThroughFiles(command: string, args: readonly st
36
39
  * prints last. A TypeScript or JavaScript file runs with bun when it is on
37
40
  * PATH, else the workspace's tsx, else node's type stripping (which retries
38
41
  * extensionless relative imports as TypeScript files); a Python file (`.py`)
39
- * runs with the first interpreter pythonDomainInterpreters finds. A runner
40
- * whose output `accept` rejects (or that fails to start) yields to the next.
42
+ * runs with the first interpreter pythonDomainInterpreters finds; a
43
+ * SWI-Prolog file (`.pl`, `.plt`) runs with the SWI-Prolog Kibi resolves for
44
+ * its engine. A runner whose output `accept` rejects (or that fails to
45
+ * start) yields to the next. A file in a language the caller has no script
46
+ * for refuses.
41
47
  */
42
- export declare function runCodeEvaluator(workspaceRoot: string, sourceFile: string, scripts: Readonly<{
43
- js: string;
44
- python: string;
45
- }>, args: readonly string[], accept?: (parsed: unknown) => boolean, options?: Readonly<{
48
+ export declare function runCodeEvaluator(workspaceRoot: string, sourceFile: string, scripts: Readonly<Partial<Record<CodeLanguage, string>>>, args: readonly string[], accept?: (parsed: unknown) => boolean, options?: Readonly<{
46
49
  runners?: readonly ("bun" | "tsx" | "node")[];
47
50
  }>): {
48
51
  ok: true;
49
52
  value: unknown;
50
- python: boolean;
53
+ language: CodeLanguage;
51
54
  } | {
52
55
  ok: false;
53
56
  failure: string;
54
- python: boolean;
57
+ language: CodeLanguage | null;
55
58
  };
56
59
  //# sourceMappingURL=code-runner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"code-runner.d.ts","sourceRoot":"","sources":["../../../src/operations/proof/code-runner.ts"],"names":[],"mappings":"AA+BA;;;;;;GAMG;AAKH,eAAO,MAAM,gBAAgB,8jBAgB5B,CAAC;AAEF,wBAAgB,YAAY,CAAC,aAAa,EAAE,MAAM,EAA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AAO,CAAC,EAAE,SAAS,CAAC,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC;CAC/C,CAAM,GAEL;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,YAAY,CAAA;CAAE,GACpD;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,YAAY,GAAG,IAAI,CAAA;CAAE,CAoFhE"}
@@ -19,10 +19,13 @@ import { spawnSync } from "node:child_process";
19
19
  import { closeSync, existsSync, mkdtempSync, openSync, readFileSync, rmSync, writeFileSync, } from "node:fs";
20
20
  import os from "node:os";
21
21
  import path from "node:path";
22
+ import { resolveSwipl, swiplChildEnv } from "../../prolog/swipl-resolver.js";
23
+ import { codeLanguage, unsupportedLanguageReason, } from "./code-languages.js";
22
24
  /**
23
25
  * How Kibi runs a small evaluator script against the workspace's own code:
24
26
  * the TypeScript and JavaScript runners (bun, the workspace's tsx, node with
25
- * type stripping) and the Python interpreters a project uses. The proof kinds
27
+ * type stripping), the Python interpreters a project uses and the SWI-Prolog
28
+ * Kibi's engine runs on. The proof kinds
26
29
  * that read a model from the code (exhaustive domains, rule tables, state
27
30
  * machines, patterns, data schemas, route tables) all load code this way.
28
31
  */
@@ -111,6 +114,7 @@ export function spawnSyncThroughFiles(command, args, options) {
111
114
  try {
112
115
  run = spawnSync(command, [...args], {
113
116
  cwd: options.cwd,
117
+ ...(options.env === undefined ? {} : { env: options.env }),
114
118
  stdio: fds,
115
119
  timeout: options.timeout,
116
120
  });
@@ -131,70 +135,109 @@ export function spawnSyncThroughFiles(command, args, options) {
131
135
  }
132
136
  }
133
137
  /** The line of a runner's stderr that names the failure. */
134
- function failureLine(stderr, python) {
138
+ function failureLine(stderr, language) {
135
139
  const lines = stderr
136
140
  .trim()
137
141
  .split("\n")
138
142
  .map((line) => line.trim())
139
143
  .filter((line) => line !== "");
140
144
  // A Python traceback names the exception on its last line.
141
- return (python ? lines.at(-1) : lines[0]) ?? "";
145
+ return (language === "python" ? lines.at(-1) : lines[0]) ?? "";
142
146
  }
143
147
  /**
144
148
  * Run an evaluator script against the workspace code and return the JSON it
145
149
  * prints last. A TypeScript or JavaScript file runs with bun when it is on
146
150
  * PATH, else the workspace's tsx, else node's type stripping (which retries
147
151
  * extensionless relative imports as TypeScript files); a Python file (`.py`)
148
- * runs with the first interpreter pythonDomainInterpreters finds. A runner
149
- * whose output `accept` rejects (or that fails to start) yields to the next.
152
+ * runs with the first interpreter pythonDomainInterpreters finds; a
153
+ * SWI-Prolog file (`.pl`, `.plt`) runs with the SWI-Prolog Kibi resolves for
154
+ * its engine. A runner whose output `accept` rejects (or that fails to
155
+ * start) yields to the next. A file in a language the caller has no script
156
+ * for refuses.
150
157
  */
151
- // implements REQ-kibi-non-numeric-proof-kinds
158
+ // implements REQ-kibi-non-numeric-proof-kinds, REQ-kibi-multilingual-code-proofs
152
159
  export function runCodeEvaluator(workspaceRoot, sourceFile, scripts, args, accept = () => true, options = {}) {
153
- const python = /\.py$/i.test(sourceFile);
154
- const tsx = python ? null : workspaceBin(workspaceRoot, "tsx");
155
- const runners = python
156
- ? pythonDomainInterpreters(workspaceRoot, sourceFile).map((interpreter) => [
157
- interpreter,
158
- ["-c", scripts.python],
159
- ])
160
- : (options.runners ?? ["bun", "tsx", "node"]).flatMap((runner) => {
160
+ const language = codeLanguage(sourceFile);
161
+ const script = language === null ? undefined : scripts[language];
162
+ if (language === null || script === undefined)
163
+ return {
164
+ ok: false,
165
+ failure: unsupportedLanguageReason("this reader", Object.keys(scripts).filter((key) => scripts[key] !== undefined), [sourceFile]),
166
+ language,
167
+ };
168
+ const fail = (failure) => ({ ok: false, failure, language });
169
+ let scriptDir = null;
170
+ let runners;
171
+ if (language === "prolog") {
172
+ let swipl;
173
+ try {
174
+ swipl = resolveSwipl();
175
+ }
176
+ catch (error) {
177
+ return fail(error instanceof Error ? error.message.split("\n")[0] ?? "" : String(error));
178
+ }
179
+ // swipl runs a script from a file, not from an argument.
180
+ scriptDir = mkdtempSync(path.join(os.tmpdir(), "kibi-prolog-"));
181
+ const scriptFile = path.join(scriptDir, "evaluator.pl");
182
+ writeFileSync(scriptFile, script);
183
+ runners = [
184
+ {
185
+ command: swipl.bin,
186
+ argv: [scriptFile, "--"],
187
+ env: { ...process.env, ...swiplChildEnv(swipl) },
188
+ },
189
+ ];
190
+ }
191
+ else if (language === "python")
192
+ runners = pythonDomainInterpreters(workspaceRoot, sourceFile).map((interpreter) => ({ command: interpreter, argv: ["-c", script] }));
193
+ else {
194
+ const tsx = workspaceBin(workspaceRoot, "tsx");
195
+ runners = (options.runners ?? ["bun", "tsx", "node"]).flatMap((runner) => {
161
196
  if (runner === "bun")
162
- return [["bun", ["-e", scripts.js]]];
197
+ return [{ command: "bun", argv: ["-e", script] }];
163
198
  if (runner === "tsx")
164
199
  return tsx === null
165
200
  ? []
166
- : [[tsx, ["--eval", scripts.js, "--"]]];
201
+ : [{ command: tsx, argv: ["--eval", script, "--"] }];
167
202
  return [
168
- [
169
- process.execPath,
170
- [
203
+ {
204
+ command: process.execPath,
205
+ argv: [
171
206
  "--experimental-strip-types",
172
207
  "--no-warnings",
173
208
  "--input-type=module",
174
209
  "-e",
175
- scripts.js,
210
+ script,
176
211
  ],
177
- ],
212
+ },
178
213
  ];
179
214
  });
215
+ }
180
216
  let failure = "";
181
- for (const [command, argv] of runners) {
182
- const run = spawnSyncThroughFiles(command, [...argv, ...args], {
183
- cwd: workspaceRoot,
184
- timeout: 60_000,
185
- });
186
- if (run.error)
187
- continue;
188
- const line = run.stdout.trim().split("\n").pop() ?? "";
189
- try {
190
- const parsed = JSON.parse(line);
191
- if (accept(parsed))
192
- return { ok: true, value: parsed, python };
193
- }
194
- catch {
195
- // Fall through to the next runner.
217
+ try {
218
+ for (const { command, argv, env } of runners) {
219
+ const run = spawnSyncThroughFiles(command, [...argv, ...args], {
220
+ cwd: workspaceRoot,
221
+ timeout: 60_000,
222
+ ...(env === undefined ? {} : { env }),
223
+ });
224
+ if (run.error)
225
+ continue;
226
+ const line = run.stdout.trim().split("\n").pop() ?? "";
227
+ try {
228
+ const parsed = JSON.parse(line);
229
+ if (accept(parsed))
230
+ return { ok: true, value: parsed, language };
231
+ }
232
+ catch {
233
+ // Fall through to the next runner.
234
+ }
235
+ failure = failureLine(run.stderr, language);
196
236
  }
197
- failure = failureLine(run.stderr, python);
198
237
  }
199
- return { ok: false, failure, python };
238
+ finally {
239
+ if (scriptDir !== null)
240
+ rmSync(scriptDir, { recursive: true, force: true });
241
+ }
242
+ return fail(failure);
200
243
  }
@@ -23,6 +23,14 @@ export declare function loadCoveredBySymbolsByTest(prolog: Pick<PrologPort, "que
23
23
  * make every receipt of that test silently fall back to snapshot matching.
24
24
  */
25
25
  export declare function receiptBindingContract(raw: unknown): ProofContract | null;
26
+ /**
27
+ * The code symbols a certificate contract loads at ingest: its domain, value
28
+ * constants, rule predicates and domains, initial states and pattern. They
29
+ * enter the binding with the test's own scope, so editing the file a domain
30
+ * is read from stales the receipt even when that symbol is not linked
31
+ * covered_by the test. A symbol already in scope binds as before.
32
+ */
33
+ export declare function contractCodeSymbolIds(contract: ProofContract): string[];
26
34
  /** Every project source a contract reads: its source, source counts and source domains. */
27
35
  export declare function contractSources(contract: ProofContract): SourceSpec[];
28
36
  export type ReceiptBindingInput = Readonly<{
@@ -1 +1 @@
1
- {"version":3,"file":"code-scope.d.ts","sourceRoot":"","sources":["../../../src/operations/proof/code-scope.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAE3E,OAAO,EAAE,KAAK,UAAU,EAAsB,MAAM,+BAA+B,CAAC;AACpF,OAAO,EACL,KAAK,aAAa,EAEnB,MAAM,gCAAgC,CAAC;AAKxC;;;;;;;;;;;GAWG;AAEH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,OAAO,EACjB,QAAQ,EAAE,OAAO,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99
  ...optionalProofContractFields(contract),
100
100
  };
101
101
  }
102
+ /**
103
+ * The code symbols a certificate contract loads at ingest: its domain, value
104
+ * constants, rule predicates and domains, initial states and pattern. They
105
+ * enter the binding with the test's own scope, so editing the file a domain
106
+ * is read from stales the receipt even when that symbol is not linked
107
+ * covered_by the test. A symbol already in scope binds as before.
108
+ */
109
+ // implements REQ-kibi-multilingual-code-proofs
110
+ export function contractCodeSymbolIds(contract) {
111
+ const ids = new Set();
112
+ const add = (entry) => {
113
+ const row = record(entry);
114
+ if (row !== null && typeof row.symbol_id === "string" && row.symbol_id !== "")
115
+ ids.add(row.symbol_id);
116
+ };
117
+ add(contract.domain_source);
118
+ add(contract.initial_source);
119
+ add(contract.pattern_source);
120
+ for (const entry of contract.value_source ?? [])
121
+ add(entry);
122
+ for (const entry of Object.values(contract.domains ?? {}))
123
+ add(entry);
124
+ for (const entry of Object.values(contract.predicate_source ?? {}))
125
+ add(entry);
126
+ return [...ids].sort();
127
+ }
102
128
  /** Every project source a contract reads: its source, source counts and source domains. */
103
129
  // implements REQ-kibi-source-proof-kinds
104
130
  export function contractSources(contract) {
@@ -154,7 +180,10 @@ export async function currentReceiptBindingHashes(input) {
154
180
  const authored = await input.readFile(absolute);
155
181
  const withoutReceipts = removeFrontmatterBlock(authored, "proof_receipts") ?? authored;
156
182
  const withoutLinks = removeFrontmatterBlock(withoutReceipts, "links") ?? withoutReceipts;
157
- const codeScope = resolveBoundSymbolScope(join(input.workspaceRoot, ".kb", "symbols.yaml"), receiptCodeScopeSymbolIds(contract, input.test.proof_bindings, input.coveredBySymbols));
183
+ const codeScope = resolveBoundSymbolScope(join(input.workspaceRoot, ".kb", "symbols.yaml"), [
184
+ ...receiptCodeScopeSymbolIds(contract, input.test.proof_bindings, input.coveredBySymbols),
185
+ ...contractCodeSymbolIds(contract),
186
+ ]);
158
187
  // A contract that reads project sources stales when what it reads
159
188
  // changes: each file's contents and the set of files a glob matches.
160
189
  const scope = [
@@ -43,6 +43,8 @@ export type ClaimExplainEntry = Readonly<{
43
43
  applicable: boolean;
44
44
  level: string | null;
45
45
  blocker?: string;
46
+ /** Why a claim with a derived binding is still not proved. */
47
+ notProved?: string;
46
48
  bindings: readonly Readonly<{
47
49
  test: string;
48
50
  kind: string;
@@ -51,6 +53,11 @@ export type ClaimExplainEntry = Readonly<{
51
53
  reason?: string;
52
54
  }>[];
53
55
  }>;
56
+ export type ClaimRefutation = Readonly<{
57
+ test: string;
58
+ claimKey: string;
59
+ reason: string;
60
+ }>;
54
61
  export type RequirementProofExplainView = {
55
62
  readonly kind: "requirement";
56
63
  readonly id: string;
@@ -63,6 +70,10 @@ export type RequirementProofExplainView = {
63
70
  test: string;
64
71
  reason: string;
65
72
  }[];
73
+ /** Claims a proof refuted: the test and what it read that breaks the claim. */
74
+ readonly refutations?: readonly ClaimRefutation[];
75
+ /** Proof-bearing symbols without source coordinates. */
76
+ readonly missingCoordinateSymbols?: readonly string[];
66
77
  /** How many applicable claims reach each level, and which are not proved. */
67
78
  readonly claimSummary?: ClaimSummary;
68
79
  readonly unprovedClaims?: readonly string[];
@@ -72,10 +83,73 @@ export type RequirementProofExplainView = {
72
83
  id: string;
73
84
  tests: readonly string[];
74
85
  }[];
86
+ /** Whether a scenario exercises the requirement's failure side. */
87
+ readonly negativePath?: NegativePathExplain;
88
+ /** Quantified claims grounded only on booleans or ground predicates. */
89
+ readonly dimension?: DimensionExplain;
90
+ /** Edge cases derived from the typed claims and the scenarios covering them. */
91
+ readonly cases?: CasesExplain;
75
92
  readonly tests: readonly ProofExplainTestBlock[];
76
93
  readonly productionSymbols: readonly ProofExplainSymbolBlock[];
77
94
  readonly structuralSymbols: readonly ProofExplainSymbolBlock[];
78
95
  };
96
+ export type NegativePathExplain = {
97
+ readonly status: string;
98
+ readonly negativeScenarios: readonly string[];
99
+ readonly claims: readonly string[];
100
+ readonly suggestedNegatives: readonly {
101
+ readonly claimKey: string;
102
+ readonly factId: string;
103
+ readonly assumption: Readonly<Record<string, unknown>>;
104
+ }[];
105
+ /** An approved waiver carries approvedBy; a reason alone awaits approval. */
106
+ readonly waiver?: {
107
+ readonly reason: string;
108
+ readonly approvedBy?: string;
109
+ };
110
+ };
111
+ export type DimensionClaimExplain = {
112
+ readonly claimKey: string;
113
+ readonly claimText: string;
114
+ readonly quantifier: string;
115
+ readonly factIds: readonly string[];
116
+ /** Typed groundings that would represent the quantifier, likeliest first. */
117
+ readonly rewrites: readonly string[];
118
+ /** An approved waiver carries approvedBy; a reason alone awaits approval. */
119
+ readonly waiver?: {
120
+ readonly reason: string;
121
+ readonly approvedBy?: string;
122
+ };
123
+ };
124
+ export type DimensionExplain = {
125
+ readonly status: string;
126
+ readonly claims: readonly DimensionClaimExplain[];
127
+ readonly waivedClaims: readonly DimensionClaimExplain[];
128
+ };
129
+ export type CaseExplain = {
130
+ readonly caseId: string;
131
+ readonly claimKey: string;
132
+ readonly factId: string;
133
+ readonly generator: string;
134
+ readonly constraint: string;
135
+ /** success, rejection or unspecified */
136
+ readonly predicted: string;
137
+ /** covered, uncovered, unspecified or waived */
138
+ readonly coverage: string;
139
+ readonly scenarios: readonly string[];
140
+ /** The assumes fact a scenario would state to land in the case. */
141
+ readonly assumption: Readonly<Record<string, unknown>>;
142
+ readonly waiver?: {
143
+ readonly reason: string;
144
+ readonly approvedBy?: string;
145
+ };
146
+ };
147
+ export type CasesExplain = {
148
+ readonly status: string;
149
+ readonly cases: readonly CaseExplain[];
150
+ readonly summary: Readonly<Record<string, number>>;
151
+ readonly limitReached: boolean;
152
+ };
79
153
  export type SymbolProofExplainView = {
80
154
  readonly kind: "symbol";
81
155
  readonly id: string;
@@ -88,6 +162,8 @@ export type SymbolProofExplainView = {
88
162
  };
89
163
  export type ProofExplainView = RequirementProofExplainView | SymbolProofExplainView;
90
164
  export declare function projectRequirementExplain(proof: Record<string, unknown>): RequirementProofExplainView;
165
+ /** One plain clause per gap, naming what it is about where Kibi knows. */
166
+ export declare function gapReason(gap: string, view: Pick<RequirementProofExplainView, "missingCoordinateSymbols">): string;
91
167
  export declare function projectSymbolExplain(payload: Record<string, unknown>): SymbolProofExplainView;
92
168
  export declare function renderProofExplain(view: ProofExplainView): string;
93
169
  export declare function classifyExplainTarget(id: string | undefined, options: {
@@ -1 +1 @@
1
- {"version":3,"file":"explain.d.ts","sourceRoot":"","sources":["../../../src/operations/proof/explain.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EACV,gBAAgB,EAEjB,MAAM,0CAA0C,CAAC;AAQlD,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG,QAAQ,CAAC;AAExD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,cAAc,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACvD,QAAQ,CAAC,aAA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