kibi-cli 2.39.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 (163) hide show
  1. package/dist/cli-register-foundation.js +2 -2
  2. package/dist/commands/check.d.ts.map +1 -1
  3. package/dist/commands/check.js +33 -9
  4. package/dist/commands/doctor.d.ts.map +1 -1
  5. package/dist/commands/doctor.js +15 -0
  6. package/dist/commands/init.d.ts.map +1 -1
  7. package/dist/commands/init.js +4 -0
  8. package/dist/commands/migrate-plan-record.d.ts +18 -0
  9. package/dist/commands/migrate-plan-record.d.ts.map +1 -0
  10. package/dist/commands/migrate-plan-record.js +112 -0
  11. package/dist/commands/migrate.d.ts +11 -2
  12. package/dist/commands/migrate.d.ts.map +1 -1
  13. package/dist/commands/migrate.js +53 -7
  14. package/dist/commands/prove.d.ts.map +1 -1
  15. package/dist/commands/prove.js +18 -3
  16. package/dist/commands/sync/manifest.d.ts.map +1 -1
  17. package/dist/commands/sync/manifest.js +17 -4
  18. package/dist/commands/sync.d.ts.map +1 -1
  19. package/dist/commands/sync.js +8 -0
  20. package/dist/commands/telemetry.d.ts.map +1 -1
  21. package/dist/commands/telemetry.js +12 -2
  22. package/dist/extractors/symbol-title-match.d.ts +31 -0
  23. package/dist/extractors/symbol-title-match.d.ts.map +1 -0
  24. package/dist/extractors/symbol-title-match.js +133 -0
  25. package/dist/extractors/symbols-coordinator.d.ts.map +1 -1
  26. package/dist/extractors/symbols-coordinator.js +81 -12
  27. package/dist/operations/bootstrap/discovery-evidence.js +2 -2
  28. package/dist/operations/bootstrap/guidance-actions.d.ts.map +1 -1
  29. package/dist/operations/bootstrap/guidance-actions.js +12 -1
  30. package/dist/operations/bootstrap/plugin-offers.d.ts +7 -1
  31. package/dist/operations/bootstrap/plugin-offers.d.ts.map +1 -1
  32. package/dist/operations/bootstrap/plugin-offers.js +73 -3
  33. package/dist/operations/modeling/logic-modeling.d.ts.map +1 -1
  34. package/dist/operations/modeling/logic-modeling.js +2 -1
  35. package/dist/operations/modeling/model-requirement.d.ts.map +1 -1
  36. package/dist/operations/modeling/model-requirement.js +2 -1
  37. package/dist/operations/mutation/symbol-refresh.d.ts +2 -0
  38. package/dist/operations/mutation/symbol-refresh.d.ts.map +1 -1
  39. package/dist/operations/mutation/symbol-refresh.js +6 -1
  40. package/dist/operations/mutation/upsert.d.ts.map +1 -1
  41. package/dist/operations/mutation/upsert.js +7 -0
  42. package/dist/operations/planning/compile-intent.d.ts.map +1 -1
  43. package/dist/operations/planning/compile-intent.js +2 -1
  44. package/dist/operations/proof/claim-bindings.d.ts +11 -0
  45. package/dist/operations/proof/claim-bindings.d.ts.map +1 -1
  46. package/dist/operations/proof/claim-bindings.js +144 -1
  47. package/dist/operations/proof/code-certificates.d.ts +10 -3
  48. package/dist/operations/proof/code-certificates.d.ts.map +1 -1
  49. package/dist/operations/proof/code-certificates.js +65 -13
  50. package/dist/operations/proof/code-languages.d.ts +104 -0
  51. package/dist/operations/proof/code-languages.d.ts.map +1 -0
  52. package/dist/operations/proof/code-languages.js +119 -0
  53. package/dist/operations/proof/code-models.d.ts +2 -0
  54. package/dist/operations/proof/code-models.d.ts.map +1 -1
  55. package/dist/operations/proof/code-models.js +11 -5
  56. package/dist/operations/proof/code-runner.d.ts +12 -9
  57. package/dist/operations/proof/code-runner.d.ts.map +1 -1
  58. package/dist/operations/proof/code-runner.js +81 -38
  59. package/dist/operations/proof/code-scope.d.ts +8 -0
  60. package/dist/operations/proof/code-scope.d.ts.map +1 -1
  61. package/dist/operations/proof/code-scope.js +30 -1
  62. package/dist/operations/proof/explain.d.ts +13 -0
  63. package/dist/operations/proof/explain.d.ts.map +1 -1
  64. package/dist/operations/proof/explain.js +66 -0
  65. package/dist/operations/proof/ingest-proof.d.ts +2 -0
  66. package/dist/operations/proof/ingest-proof.d.ts.map +1 -1
  67. package/dist/operations/proof/ingest-proof.js +1 -0
  68. package/dist/operations/proof/java-package-shadow.d.ts +14 -0
  69. package/dist/operations/proof/java-package-shadow.d.ts.map +1 -0
  70. package/dist/operations/proof/java-package-shadow.js +389 -0
  71. package/dist/operations/proof/prolog-evaluator.d.ts +14 -0
  72. package/dist/operations/proof/prolog-evaluator.d.ts.map +1 -0
  73. package/dist/operations/proof/prolog-evaluator.js +247 -0
  74. package/dist/operations/proof/prolog-source-reader.d.ts +20 -0
  75. package/dist/operations/proof/prolog-source-reader.d.ts.map +1 -0
  76. package/dist/operations/proof/prolog-source-reader.js +1123 -0
  77. package/dist/operations/proof/source-code-readers.d.ts +6 -0
  78. package/dist/operations/proof/source-code-readers.d.ts.map +1 -1
  79. package/dist/operations/proof/source-code-readers.js +879 -75
  80. package/dist/plugins/approved-source-analyzers.generated.d.ts +13 -35
  81. package/dist/plugins/approved-source-analyzers.generated.d.ts.map +1 -1
  82. package/dist/plugins/approved-source-analyzers.generated.js +13 -35
  83. package/dist/plugins/plugin-install-check.d.ts +21 -0
  84. package/dist/plugins/plugin-install-check.d.ts.map +1 -0
  85. package/dist/plugins/plugin-install-check.js +62 -0
  86. package/dist/plugins/proof-reference-extractors.d.ts +20 -0
  87. package/dist/plugins/proof-reference-extractors.d.ts.map +1 -0
  88. package/dist/plugins/proof-reference-extractors.js +104 -0
  89. package/dist/plugins/reference-language-suggestion.d.ts +51 -0
  90. package/dist/plugins/reference-language-suggestion.d.ts.map +1 -0
  91. package/dist/plugins/reference-language-suggestion.js +277 -0
  92. package/dist/plugins/registry.d.ts.map +1 -1
  93. package/dist/plugins/registry.js +3 -1
  94. package/dist/plugins/source-analysis-service.d.ts.map +1 -1
  95. package/dist/plugins/source-analysis-service.js +4 -0
  96. package/dist/plugins/source-change-analysis.d.ts +26 -1
  97. package/dist/plugins/source-change-analysis.d.ts.map +1 -1
  98. package/dist/plugins/source-change-analysis.js +77 -5
  99. package/dist/plugins/source-classification.d.ts.map +1 -1
  100. package/dist/plugins/source-classification.js +23 -3
  101. package/dist/public/operations/catalog.d.ts +32 -7
  102. package/dist/public/operations/catalog.d.ts.map +1 -1
  103. package/dist/public/operations/check-executor.d.ts.map +1 -1
  104. package/dist/public/operations/check-executor.js +3 -0
  105. package/dist/public/operations/evidence-floor.d.ts +8 -0
  106. package/dist/public/operations/evidence-floor.d.ts.map +1 -1
  107. package/dist/public/operations/evidence-floor.js +19 -1
  108. package/dist/public/operations/specs/check-rules.generated.d.ts +1 -1
  109. package/dist/public/operations/specs/check-rules.generated.d.ts.map +1 -1
  110. package/dist/public/operations/specs/check-rules.generated.js +2 -1
  111. package/dist/public/operations/specs/check.d.ts +1 -1
  112. package/dist/public/operations/specs/mutation-schemas.d.ts +31 -6
  113. package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
  114. package/dist/public/operations/specs/reporting.d.ts +8 -0
  115. package/dist/public/operations/specs/reporting.d.ts.map +1 -1
  116. package/dist/public/operations/specs/reporting.js +26 -3
  117. package/dist/public/operations/specs/semantic.d.ts.map +1 -1
  118. package/dist/public/operations/specs/semantic.js +2 -1
  119. package/dist/public/operations/specs/upsert.d.ts +31 -6
  120. package/dist/public/operations/specs/upsert.d.ts.map +1 -1
  121. package/dist/public/operations/symbol-coordinates-check.d.ts +11 -0
  122. package/dist/public/operations/symbol-coordinates-check.d.ts.map +1 -0
  123. package/dist/public/operations/symbol-coordinates-check.js +66 -0
  124. package/dist/public/proof-protocol.d.ts +31 -6
  125. package/dist/public/proof-protocol.d.ts.map +1 -1
  126. package/dist/public/proof-protocol.js +45 -15
  127. package/dist/public/proof-sources.d.ts +4 -2
  128. package/dist/public/proof-sources.d.ts.map +1 -1
  129. package/dist/public/proof-sources.js +43 -4
  130. package/dist/public/skills/kibi-usage/SKILL.md +6 -3
  131. package/dist/public/skills/kibi-usage/resources/prolog-proofs.md +207 -0
  132. package/dist/public/skills/kibi-usage/resources/proof.md +44 -3
  133. package/dist/schemas/entity.schema.json +34 -6
  134. package/dist/traceability/analysis-gate.d.ts +3 -1
  135. package/dist/traceability/analysis-gate.d.ts.map +1 -1
  136. package/dist/traceability/analysis-gate.js +9 -1
  137. package/dist/traceability/staged-file-coverage.d.ts.map +1 -1
  138. package/dist/traceability/staged-file-coverage.js +7 -2
  139. package/dist/traceability/symbol-extract.d.ts +17 -0
  140. package/dist/traceability/symbol-extract.d.ts.map +1 -1
  141. package/dist/traceability/symbol-extract.js +69 -15
  142. package/dist/traceability/validate.d.ts.map +1 -1
  143. package/dist/traceability/validate.js +5 -7
  144. package/dist/utils/first-sentence.d.ts +9 -0
  145. package/dist/utils/first-sentence.d.ts.map +1 -0
  146. package/dist/utils/first-sentence.js +52 -0
  147. package/dist/utils/rule-registry.generated.d.ts +6 -0
  148. package/dist/utils/rule-registry.generated.d.ts.map +1 -1
  149. package/dist/utils/rule-registry.generated.js +7 -0
  150. package/package.json +5 -5
  151. package/src/public/operations/check-executor.ts +8 -0
  152. package/src/public/operations/evidence-floor.ts +29 -1
  153. package/src/public/operations/specs/check-rules.generated.ts +2 -1
  154. package/src/public/operations/specs/reporting.ts +38 -3
  155. package/src/public/operations/specs/semantic.ts +2 -1
  156. package/src/public/operations/symbol-coordinates-check.ts +79 -0
  157. package/src/public/proof-protocol-types.d.ts +22 -5
  158. package/src/public/proof-protocol.ts +78 -19
  159. package/src/public/proof-sources.ts +51 -3
  160. package/src/public/skills/kibi-usage/SKILL.md +6 -3
  161. package/src/public/skills/kibi-usage/resources/prolog-proofs.md +207 -0
  162. package/src/public/skills/kibi-usage/resources/proof.md +44 -3
  163. package/src/schemas/entity.schema.json +34 -6
@@ -1 +1 @@
1
- {"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/commands/sync.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA6BjE,OAAO,EAEL,yBAAyB,EAE1B,MAAM,gDAAgD,CAAC;AAGxD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EACL,KAAK,gBAAgB,EAGtB,MAAM,6BAA6B,CAAC;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ACZ,KAAK,EAAE,MAAM,IAAI,GAChB,IAAI,CAMN;AAED,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,UAAU,EAAE,EACzB,QAAQ,EAAE,OAAO,EACjB,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,GACf,IAAI,CAIN;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE;IACjD,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,IAAI,CAMP;AAED,wBAAgB,iCAAiC,CAC/C,WAAW,EAAE,UAAU,EAAE,EACzB,oBAAoB,EAAE,OAAO,EAC7B,iBAAiB,EAAE,MAAM,EACzB,WAAW,EAAE,MAAM,GAClB,IAAI,CAUN;AAGD,wBAAsB,WAAW,CAC/B,OAAO,GAAE;IACP,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,2EAA2E;IAC3E,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,wEAAwE;IACxE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,uEAAuE;IACvE,KAAK,CAAC,EAAE,OAAO,CAAC;CACZ,EACN,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,UAAU,CAAC,CAkxCrB;AAED,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -27,6 +27,7 @@ import { extractRelationshipShard, validateRelationships, } from "../extractors/
27
27
  import { acquireSymbolCompilerLock, releaseSymbolCompilerLock, } from "../operations/mutation/symbol-compiler-lock.js";
28
28
  import { analyzeSemanticAdvisorInput } from "../operations/semantic-advisor/analyze-prose.js";
29
29
  import { validateSemanticInventoryBoundary } from "../operations/semantic-advisor/ingestion-boundary.js";
30
+ import { sourceAnalyzerInstallProblems } from "../plugins/plugin-install-check.js";
30
31
  import { PrologProcess } from "../prolog.js";
31
32
  import { detachedHeadWriteRefusal, resolveBranchAttachment, } from "../utils/branch-resolver.js";
32
33
  import { branchStoreManifestPath, branchStorePath, branchStoresRoot, ensureBranchStoreManifest, expectedBranchStoreManifest, } from "../utils/branch-store-locator.js";
@@ -573,6 +574,13 @@ export async function syncCommand(options = {}, runtime = {}) {
573
574
  // on a partially published compiler dependency.
574
575
  const refreshedManifestKeys = new Set();
575
576
  if (!validateOnly && options.refreshSymbolCoordinates) {
577
+ // A declared source analyzer that is missing or not the qualified
578
+ // build would drop every coordinate it places; refuse the refresh and
579
+ // keep the stored coordinates instead of reporting success.
580
+ // implements REQ-symbol-coordinates-derived-locally
581
+ const installProblems = sourceAnalyzerInstallProblems(workspaceRoot);
582
+ if (installProblems.length > 0)
583
+ throw new Error(`Symbol coordinate refresh refused: ${installProblems.map((row) => row.problem).join("; ")}. ${installProblems.map((row) => row.fix).join(" ")} The stored coordinates were kept.`);
576
584
  for (const file of manifestFiles) {
577
585
  await refreshManifestCoordinates(file, workspaceRoot, {
578
586
  refreshSymbolCoordinates: options.refreshSymbolCoordinates,
@@ -1 +1 @@
1
- {"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/commands/telemetry.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAG9D,4EAA4E;AAC5E,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAAO,EAC1C,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,OAAO,CAAC,aAAa,CAAC,CAsBxB"}
1
+ {"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/commands/telemetry.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAU9D,4EAA4E;AAC5E,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAAO,EAC1C,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,OAAO,CAAC,aAAa,CAAC,CA4BxB"}
@@ -1,5 +1,11 @@
1
1
  // implements REQ-kibi-anonymous-usage-telemetry
2
- import { TELEMETRY_DOCS_URL, setTelemetryPreference, telemetryStatus, } from "kibi-agent-core/usage-telemetry";
2
+ import { TELEMETRY_DOCS_URL, detectTelemetryHost, setTelemetryPreference, telemetryStatus, } from "kibi-agent-core/usage-telemetry";
3
+ /** Where the channel in effect comes from, in words. */
4
+ const CHANNEL_SOURCE_TEXT = {
5
+ KIBI_TELEMETRY_CHANNEL: "set by KIBI_TELEMETRY_CHANNEL",
6
+ checkout: "Kibi runs from a checkout of its own repository",
7
+ installed: "Kibi runs from an installed package",
8
+ };
3
9
  // implements REQ-kibi-anonymous-usage-telemetry
4
10
  /** `kibi telemetry [status|enable|disable]`: show or persist the choice. */
5
11
  export async function telemetryCommand(action, options = {}, env = process.env) {
@@ -12,11 +18,15 @@ export async function telemetryCommand(action, options = {}, env = process.env)
12
18
  setTelemetryPreference(chosen === "enable" ? "enabled" : "disabled", env);
13
19
  }
14
20
  const status = telemetryStatus(env);
21
+ // The host this shell's events carry comes from KIBI_HOST or the
22
+ // variables an agent host set for the processes it starts.
23
+ const host = detectTelemetryHost(env) ?? "unknown";
15
24
  if (options.format === "json") {
16
- console.log(JSON.stringify({ ...status, docs: TELEMETRY_DOCS_URL }));
25
+ console.log(JSON.stringify({ ...status, host, docs: TELEMETRY_DOCS_URL }));
17
26
  return { exitCode: 0 };
18
27
  }
19
28
  console.log(`Anonymous usage telemetry is ${status.enabled ? "on" : "off"} (${status.reason}).`);
29
+ console.log(`Channel: ${status.channel} (${CHANNEL_SOURCE_TEXT[status.channelSource]}). Host: ${host} (set KIBI_HOST to override).`);
20
30
  console.log(`Settings and queue: ${status.directory}`);
21
31
  console.log(`What is collected: ${TELEMETRY_DOCS_URL}`);
22
32
  return { exitCode: 0 };
@@ -0,0 +1,31 @@
1
+ /** The declaration fields a symbol title is matched against. */
2
+ export type TitledDeclaration = {
3
+ readonly name: string;
4
+ readonly qualifiedName?: string;
5
+ readonly kind?: string;
6
+ readonly containerName?: string;
7
+ readonly startLine: number;
8
+ readonly startColumn: number;
9
+ readonly endLine: number;
10
+ readonly endColumn: number;
11
+ };
12
+ export type TitleMatch<T> = {
13
+ readonly symbol: T;
14
+ } | {
15
+ readonly failure: string;
16
+ };
17
+ /**
18
+ * Titles that name a declaration besides its qualified name and name: the
19
+ * Terraform address of a block (`aws_s3_bucket.this`, `data.x.y`,
20
+ * `module.m`, `var.v`, `output.o`, `local.l`) and the dotted labels of a
21
+ * generic HCL block (`source.amazon-ebs.ubuntu`).
22
+ */
23
+ export declare function declarationTitleAliases(symbol: Pick<TitledDeclaration, "qualifiedName">): string[];
24
+ /**
25
+ * Place a symbol title: a qualified name first, then a declaration alias,
26
+ * then a bare name. A bare type name shared with its constructors (a Java
27
+ * class `OS` and `OS()`) names the type.
28
+ * Anything else that is not exactly one declaration fails with the reason.
29
+ */
30
+ export declare function matchDeclarationTitle<T extends TitledDeclaration>(title: string, declared: readonly T[], sourceFile: string, all?: readonly TitledDeclaration[]): TitleMatch<T>;
31
+ //# sourceMappingURL=symbol-title-match.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"symbol-title-match.d.ts","sourceRoot":"","sources":["../../src/extractors/symbol-title-match.ts"],"names":[],"mappings":"AAkBA,gEAAgE;AAChE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,UAAU,CAAC,CAAC,IACpB;IAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;CAAE,GACtB;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAmBjC;;;;;GAKG;AAEH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,IAAI,CAAC,iBAAiB,EAAE,eAAe,CAAC,GAC/C,MAAM,EAAE,CA2BV;AAsCD;;;;;GAKG;AAEH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,iBAAiB,EAC/D,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,SAAS,CAAC,EAAE,EACtB,UAAU,EAAE,MAAM,EAClB,GAAG,GAAE,SAAS,iBAAiB,EAAa,GAC3C,UAAU,CAAC,CAAC,CAAC,CA2Cf"}
@@ -0,0 +1,133 @@
1
+ /*
2
+ Kibi — repo-local, per-branch, queryable long-term memory for software projects
3
+ Copyright (C) 2026 Piotr Franczyk
4
+
5
+ This program is free software: you can redistribute it and/or modify
6
+ it under the terms of the GNU Affero General Public License as published by
7
+ the Free Software Foundation, either version 3 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU Affero General Public License for more details.
14
+
15
+ You should have received a copy of the GNU Affero General Public License
16
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+ const TERRAFORM_LOCATOR = /^terraform:(resource|data|module|variable|output|local)\[(.*)\]$/;
19
+ const HCL_LOCATOR = /^hcl:(\[.*\])$/;
20
+ function jsonStrings(text) {
21
+ try {
22
+ const value = JSON.parse(text);
23
+ return Array.isArray(value) &&
24
+ value.length > 0 &&
25
+ value.every((item) => typeof item === "string")
26
+ ? value
27
+ : null;
28
+ }
29
+ catch {
30
+ return null;
31
+ }
32
+ }
33
+ /**
34
+ * Titles that name a declaration besides its qualified name and name: the
35
+ * Terraform address of a block (`aws_s3_bucket.this`, `data.x.y`,
36
+ * `module.m`, `var.v`, `output.o`, `local.l`) and the dotted labels of a
37
+ * generic HCL block (`source.amazon-ebs.ubuntu`).
38
+ */
39
+ // implements REQ-symbol-coordinates-derived-locally
40
+ export function declarationTitleAliases(symbol) {
41
+ const locator = symbol.qualifiedName ?? "";
42
+ const terraform = TERRAFORM_LOCATOR.exec(locator);
43
+ if (terraform) {
44
+ const kind = terraform[1];
45
+ const labels = jsonStrings(`[${terraform[2]}]`);
46
+ if (labels === null)
47
+ return [];
48
+ const dotted = labels.join(".");
49
+ switch (kind) {
50
+ case "resource":
51
+ return labels.length === 2 ? [dotted, `resource.${dotted}`] : [];
52
+ case "data":
53
+ return labels.length === 2 ? [`data.${dotted}`] : [];
54
+ case "variable":
55
+ return labels.length === 1
56
+ ? [`var.${dotted}`, `variable.${dotted}`]
57
+ : [];
58
+ default:
59
+ return labels.length === 1 ? [`${kind}.${dotted}`] : [];
60
+ }
61
+ }
62
+ const hcl = HCL_LOCATOR.exec(locator);
63
+ if (hcl?.[1] !== undefined) {
64
+ const parts = jsonStrings(hcl[1]);
65
+ return parts !== null && parts.length > 1 ? [parts.join(".")] : [];
66
+ }
67
+ return [];
68
+ }
69
+ /** A constructor: a method named like the type that holds it. */
70
+ function isConstructorOf(member, type) {
71
+ return (member !== type &&
72
+ member.kind === "method" &&
73
+ member.containerName === member.name &&
74
+ type.name === member.name &&
75
+ type.kind !== "method" &&
76
+ type.kind !== "function");
77
+ }
78
+ function lines(symbol) {
79
+ return symbol.startLine === symbol.endLine
80
+ ? `line ${symbol.startLine}`
81
+ : `lines ${symbol.startLine}-${symbol.endLine}`;
82
+ }
83
+ /** The title that places this declaration and no other in the file. */
84
+ function uniqueTitle(symbol, all) {
85
+ const alias = declarationTitleAliases(symbol)[0];
86
+ if (alias !== undefined)
87
+ return alias;
88
+ const sameName = all.filter((other) => other.name === symbol.name);
89
+ return sameName.length > 1 && symbol.qualifiedName !== undefined
90
+ ? symbol.qualifiedName
91
+ : symbol.name;
92
+ }
93
+ const LISTED_DECLARATIONS = 8;
94
+ /**
95
+ * Place a symbol title: a qualified name first, then a declaration alias,
96
+ * then a bare name. A bare type name shared with its constructors (a Java
97
+ * class `OS` and `OS()`) names the type.
98
+ * Anything else that is not exactly one declaration fails with the reason.
99
+ */
100
+ // implements REQ-symbol-coordinates-derived-locally
101
+ export function matchDeclarationTitle(title, declared, sourceFile, all = declared) {
102
+ const byQualifiedName = declared.filter((symbol) => (symbol.qualifiedName ?? symbol.name) === title);
103
+ const byAlias = byQualifiedName.length
104
+ ? byQualifiedName
105
+ : declared.filter((symbol) => declarationTitleAliases(symbol).includes(title));
106
+ const byName = byAlias.length
107
+ ? byAlias
108
+ : declared.filter((symbol) => symbol.name === title);
109
+ const candidates = byName.filter((symbol) => !byName.some((other) => isConstructorOf(symbol, other)));
110
+ const [only] = candidates;
111
+ if (candidates.length === 1 && only !== undefined)
112
+ return { symbol: only };
113
+ if (candidates.length > 1) {
114
+ const titles = candidates.map((symbol) => uniqueTitle(symbol, all));
115
+ const distinct = new Set(titles).size === titles.length;
116
+ return {
117
+ failure: `'${title}' matches ${candidates.length} declarations in ${sourceFile} (${candidates.map((symbol, index) => `${titles[index]} on ${lines(symbol)}`).join(", ")}); ${distinct ? "use one of those titles" : "no title tells them apart"}`,
118
+ };
119
+ }
120
+ if (all.some((symbol) => symbol.name === title ||
121
+ symbol.qualifiedName === title ||
122
+ declarationTitleAliases(symbol).includes(title)))
123
+ return {
124
+ failure: `'${title}' is declared in a part of ${sourceFile} the source analysis could not read`,
125
+ };
126
+ const titles = [...new Set(all.map((symbol) => uniqueTitle(symbol, all)))];
127
+ const listed = titles.length === 0
128
+ ? "the extractor found no declarations there"
129
+ : `declarations there: ${titles.slice(0, LISTED_DECLARATIONS).join(", ")}${titles.length > LISTED_DECLARATIONS ? `, and ${titles.length - LISTED_DECLARATIONS} more` : ""}`;
130
+ return {
131
+ failure: `no declaration titled '${title}' found in ${sourceFile} (${listed})`,
132
+ };
133
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"symbols-coordinator.d.ts","sourceRoot":"","sources":["../../src/extractors/symbols-coordinator.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAUnF,OAAO,EACL,KAAK,mBAAmB,EAExB,kCAAkC,EACnC,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EAAE,mBAAmB,EAAE,CAAC;AAEpC,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEvD,MAAM,MAAM,gBAAgB,GACxB,UAAU,GACV,OAAO,GACP,QAAQ,GACR,UAAU,GACV,UAAU,GACV,WAAW,GACX,MAAM,GACN,MAAM,GACN,UAAU,GACV,SAAS,CAAC;AAEd,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,gBAAgB,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,oBAAoB;I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,GAC1C,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAqJhC"}
@@ -20,7 +20,9 @@ import * as path from "node:path";
20
20
  import { createMaintenanceSourceAnalysisService } from "../plugins/maintenance-source-analysis.js";
21
21
  import { createSourceAnalysisService, } from "../plugins/source-analysis-service.js";
22
22
  import { extensionLanguage, isTsJsSourcePath, } from "../plugins/source-classification.js";
23
+ import { analysisObligation } from "../traceability/analysis-gate.js";
23
24
  import { resolveWorkspaceSourceAbsolute } from "../utils/repo-relative-path.js";
25
+ import { matchDeclarationTitle } from "./symbol-title-match.js";
24
26
  import { createTsMorphSourceAnalysisProvider, enrichSymbolCoordinatesWithTsMorph, } from "./symbols-ts.js";
25
27
  const DEFAULT_SOURCE_ANALYSIS_PROVIDERS = [
26
28
  createTsMorphSourceAnalysisProvider(),
@@ -83,6 +85,31 @@ export async function analyzeSourceTextWithRegistry(filePath, content, registry)
83
85
  return analyzeSourceText(filePath, content);
84
86
  }
85
87
  }
88
+ /**
89
+ * The uncovered ranges of a partial analysis whose gaps are local (a macro,
90
+ * an include, a dynamic definition), or null when the gap affects the whole
91
+ * file (syntax, parse, timeout, integrity, a diagnostic limit) or the provider
92
+ * named no ranges. A symbol declared outside every local range was parsed in
93
+ * full, so its span stays trustworthy.
94
+ */
95
+ // implements REQ-source-analysis-v2
96
+ function localPartialRanges(analysis) {
97
+ const codes = analysis.diagnostics.map((diagnostic) => diagnostic.code);
98
+ if (codes.some((code) => /LIMIT/i.test(code)))
99
+ return null;
100
+ const obligation = analysisObligation("after", {
101
+ status: "partial",
102
+ diagnosticCodes: codes,
103
+ uncoveredRanges: analysis.uncoveredRanges,
104
+ }, []);
105
+ return obligation.kind === "blocked" ? null : analysis.uncoveredRanges;
106
+ }
107
+ /** Diagnostics as `CODE (line N): message`, one per distinct message. */
108
+ function describeAnalysisDiagnostics(diagnostics) {
109
+ return [
110
+ ...new Set(diagnostics.map((diagnostic) => `${diagnostic.code}${diagnostic.range ? ` (line ${diagnostic.range.startLine})` : ""}: ${diagnostic.message}`)),
111
+ ].join("; ");
112
+ }
86
113
  function isCoordinateOnlyDecoratorPartial(analysis) {
87
114
  if (analysis.status !== "partial" ||
88
115
  analysis.language !== "python" ||
@@ -124,8 +151,14 @@ export async function enrichSymbolCoordinates(entries, workspaceRoot, deps) {
124
151
  if (!entry)
125
152
  continue;
126
153
  const resolved = resolveSourcePath(entry.sourceFile, workspaceRoot);
127
- if (!resolved || !fs.statSync(resolved.absolutePath).isFile())
154
+ if (!resolved || !fs.statSync(resolved.absolutePath).isFile()) {
155
+ if (entry.sourceFile)
156
+ output[index] = {
157
+ ...entry,
158
+ coordinateRefreshFailure: unreadableSourceReason(entry.sourceFile, workspaceRoot),
159
+ };
128
160
  continue;
161
+ }
129
162
  const ext = path.extname(resolved.absolutePath).toLowerCase();
130
163
  if (isTsJsSourcePath(resolved.absolutePath)) {
131
164
  tsIndices.push(index);
@@ -143,27 +176,55 @@ export async function enrichSymbolCoordinates(entries, workspaceRoot, deps) {
143
176
  }
144
177
  const coordinateOnlyPartial = deps?.allowPythonDecoratorCoordinates === true &&
145
178
  isCoordinateOnlyDecoratorPartial(analysis);
179
+ const localGaps = analysis.status === "partial" && !coordinateOnlyPartial
180
+ ? localPartialRanges(analysis)
181
+ : null;
146
182
  if (analysis.status === "failed" ||
147
- (analysis.status === "partial" && !coordinateOnlyPartial))
148
- throw new Error(`Cannot refresh incomplete source analysis for ${logicalPath}: ${analysis.diagnostics.map((d) => d.message).join("; ")}`);
183
+ (analysis.status === "partial" && !coordinateOnlyPartial && !localGaps)) {
184
+ // A file the analyzer cannot read as a whole (a syntax error, which a
185
+ // grammar may also report for valid code, a timeout, a changed grammar)
186
+ // gives its own symbols no coordinates; every other file still refreshes.
187
+ const reason = `Cannot refresh incomplete source analysis for ${logicalPath}: ${describeAnalysisDiagnostics(analysis.diagnostics)}`;
188
+ if (firstAnalysis)
189
+ console.warn(`[kibi] ${reason}`);
190
+ output[index] = { ...entry, coordinateRefreshFailure: reason };
191
+ continue;
192
+ }
193
+ if (localGaps && firstAnalysis) {
194
+ console.warn(`[kibi] ${logicalPath}: source analysis is partial; symbols declared on ${localGaps.map((range) => (range.startLine === range.endLine ? `line ${range.startLine}` : `lines ${range.startLine}-${range.endLine}`)).join(", ")} keep no coordinates (${describeAnalysisDiagnostics(analysis.diagnostics)})`);
195
+ }
149
196
  if (coordinateOnlyPartial && firstAnalysis) {
150
197
  console.warn(`[kibi] Coordinate-only refresh for ${logicalPath}; source analysis remains partial: ${analysis.diagnostics.map((diagnostic) => diagnostic.message).join("; ")}`);
151
198
  }
152
199
  if (analysis.status === "unsupported") {
200
+ const pack = analysis.diagnostics.find((diagnostic) => diagnostic.code.startsWith("TREESITTER_LANGUAGE_PACK_"));
201
+ const fileLevel = analysis.diagnostics.find((diagnostic) => diagnostic.code === "source_file_level_only");
202
+ if (fileLevel && !pack && firstAnalysis)
203
+ console.warn(`[kibi] ${logicalPath}: symbol coordinates are approximate (placed by text match). ${fileLevel.message}`);
204
+ if (pack && firstAnalysis)
205
+ console.warn(`[kibi] ${logicalPath}: symbol coordinates are approximate until its grammar pack is installed. ${pack.message}`);
153
206
  // Preserve the legacy coarse heuristic until the file-level migration;
154
207
  // it is never exposed as parser-backed symbol evidence.
155
- output[index] = enrichWithRegexHeuristic(entry, resolved.absolutePath);
208
+ const placed = enrichWithRegexHeuristic(entry, resolved.absolutePath);
209
+ output[index] =
210
+ placed.sourceLine === undefined
211
+ ? {
212
+ ...placed,
213
+ coordinateRefreshFailure: `no text match for '${entry.title}' in ${logicalPath}, which has no parser-backed declarations (${(pack ?? fileLevel)?.message ?? "no symbol extractor reads this file type"})`,
214
+ }
215
+ : placed;
156
216
  continue;
157
217
  }
158
- const exact = analysis.symbols.filter((symbol) => (symbol.qualifiedName ?? symbol.name) === entry.title);
159
- const candidates = exact.length
160
- ? exact
161
- : analysis.symbols.filter((symbol) => symbol.name === entry.title);
162
- if (candidates.length !== 1)
163
- continue;
164
- const symbol = candidates[0];
165
- if (!symbol)
218
+ const declared = localGaps
219
+ ? analysis.symbols.filter((symbol) => !localGaps.some((range) => range.startLine <= symbol.startLine &&
220
+ symbol.startLine <= range.endLine))
221
+ : analysis.symbols;
222
+ const match = matchDeclarationTitle(entry.title, declared, logicalPath, analysis.symbols);
223
+ if ("failure" in match) {
224
+ output[index] = { ...entry, coordinateRefreshFailure: match.failure };
166
225
  continue;
226
+ }
227
+ const symbol = match.symbol;
167
228
  output[index] = {
168
229
  ...entry,
169
230
  sourceLine: symbol.startLine,
@@ -227,6 +288,14 @@ function enrichWithRegexHeuristic(entry, absolutePath) {
227
288
  return entry;
228
289
  }
229
290
  }
291
+ function unreadableSourceReason(sourceFile, workspaceRoot) {
292
+ const absolute = resolveWorkspaceSourceAbsolute(workspaceRoot, sourceFile);
293
+ if (absolute === null)
294
+ return `${sourceFile} is not a file path inside the workspace`;
295
+ if (!fs.existsSync(absolute))
296
+ return `${sourceFile} does not exist`;
297
+ return `${sourceFile} is not a regular file`;
298
+ }
230
299
  function resolveSourcePath(sourceFile, workspaceRoot) {
231
300
  if (!sourceFile)
232
301
  return null;
@@ -10,9 +10,9 @@ const SCAN_PATTERNS = [
10
10
  "**/Cargo.toml",
11
11
  "**/go.mod",
12
12
  "**/opencode.json",
13
- "**/*.{ts,tsx,mts,cts,js,jsx,mjs,cjs,py,rb,go,rs,java,kt,swift,php,c,cc,cpp,h,hpp,pl,plt}",
13
+ "**/*.{ts,tsx,mts,cts,js,jsx,mjs,cjs,py,pyi,rb,go,rs,java,kt,swift,php,c,cc,cpp,cxx,h,hh,hpp,hxx,cs,sh,bash,tf,hcl,pl,plt}",
14
14
  ];
15
- const CODE_EXTENSION = /\.(ts|tsx|mts|cts|js|jsx|mjs|cjs|py|rb|go|rs|java|kt|swift|php|c|cc|cpp|h|hpp|pl|plt)$/i;
15
+ const CODE_EXTENSION = /\.(ts|tsx|mts|cts|js|jsx|mjs|cjs|py|pyi|rb|go|rs|java|kt|swift|php|c|cc|cpp|cxx|h|hh|hpp|hxx|cs|sh|bash|tf|hcl|pl|plt)$/i;
16
16
  const LAYOUT_ROOTS = new Set([
17
17
  "src",
18
18
  "app",
@@ -1 +1 @@
1
- {"version":3,"file":"guidance-actions.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/guidance-actions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EACV,gBAAgB,EAChB,wBAAwB,EACxB,SAAS,EACT,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAkBpB,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,gBAAgB,EAC5B,QAAQ,EAAE,wBAAwB,EAClC,UAAU,EAAE,SAAS,SAAS,EAAE,EAChC,OAAO,EAAE,SAAS,gBAAgB,EAAE,EACpC,MAAM,GAAE,SAAS,WAAW,EAAO,GAClC,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAgG9C"}
1
+ {"version":3,"file":"guidance-actions.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/guidance-actions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EACV,gBAAgB,EAChB,wBAAwB,EACxB,SAAS,EACT,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAkBpB,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,gBAAgB,EAC5B,QAAQ,EAAE,wBAAwB,EAClC,UAAU,EAAE,SAAS,SAAS,EAAE,EAChC,OAAO,EAAE,SAAS,gBAAgB,EAAE,EACpC,MAAM,GAAE,SAAS,WAAW,EAAO,GAClC,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CA6G9C"}
@@ -94,7 +94,18 @@ export function buildActions(root, activation, declared, candidates, signals, of
94
94
  capability: offer.capability,
95
95
  mode: offer.mode,
96
96
  evidence: offer.evidence,
97
- description: `${offer.reason} (${summary(offer.evidence)}). Ask the operator whether to enable the experimental ${offer.package}; on yes, install it as a dev dependency and add it to package.json kibi.plugins with "${offer.capability}": { "mode": "${offer.mode}" }; on no, add "${offer.package}" to kibi.declinedPlugins so bootstrap stops offering it.`,
97
+ ...(offer.alsoActivate === undefined
98
+ ? {}
99
+ : { alsoActivate: offer.alsoActivate }),
100
+ ...(offer.alsoInstall === undefined
101
+ ? {}
102
+ : { alsoInstall: offer.alsoInstall }),
103
+ description: `${offer.reason} (${summary(offer.evidence)}). Ask the operator whether to enable the experimental ${offer.package}; on yes, install ${offer.alsoInstall === undefined ? "it as a dev dependency" : `it and ${offer.alsoInstall.join(", ")} as dev dependencies`} and add it to package.json kibi.plugins with ${[
104
+ [offer.capability, offer.mode],
105
+ ...Object.entries(offer.alsoActivate ?? {}),
106
+ ]
107
+ .map(([capability, mode]) => `"${capability}": { "mode": "${mode}" }`)
108
+ .join(", ")}; on no, add "${offer.package}" to kibi.declinedPlugins so bootstrap stops offering it.`,
98
109
  });
99
110
  result.push({
100
111
  order,
@@ -8,6 +8,10 @@ export type PluginOffer = {
8
8
  readonly reason: string;
9
9
  readonly fileCount: number;
10
10
  readonly evidence: readonly string[];
11
+ /** Further capabilities of the same package to activate, with their modes. */
12
+ readonly alsoActivate?: Readonly<Record<string, "augment" | "replace">>;
13
+ /** Data packages to install next to it, such as kibi-lang-* grammar packs. */
14
+ readonly alsoInstall?: readonly string[];
11
15
  };
12
16
  /**
13
17
  * Below this many requirements a reader can scan the list, and a question
@@ -19,7 +23,9 @@ export declare const SEARCH_HINTS_OFFER_REQUIREMENTS = 50;
19
23
  * offered when production React or Angular component files exist, and
20
24
  * kibi-plugin-search-hints once the KB holds enough requirements that a
21
25
  * question worded differently from them is likely to miss; neither is
22
- * offered once the project activated or declined it.
26
+ * offered once the project activated or declined it. kibi-plugin-treesitter
27
+ * is offered for sources in any language it reads until it is listed, and
28
+ * for Go, Java, C# and Rust sources until it is active for source proofs.
23
29
  */
24
30
  export declare function pluginOffers(context: OperationContext, files: readonly string[]): Promise<readonly PluginOffer[]>;
25
31
  //# sourceMappingURL=plugin-offers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-offers.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/plugin-offers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAGjF,oFAAoF;AAEpF,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,8CAA8C;IAC9C,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC,CAAC;AAUF;;;GAGG;AAEH,eAAO,MAAM,+BAA+B,KAAK,CAAC;AAyDlD;;;;;;GAMG;AAEH,wBAAsB,YAAY,CAChC,OAAO,EAAE,gBAAgB,EACzB,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,OAAO,CAAC,SAAS,WAAW,EAAE,CAAC,CA6BjC"}
1
+ {"version":3,"file":"plugin-offers.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/plugin-offers.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAOjF,oFAAoF;AAEpF,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,8CAA8C;IAC9C,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,8EAA8E;IAC9E,QAAQ,CAAC,YAAY,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC;IACxE,8EAA8E;IAC9E,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1C,CAAC;AAUF;;;GAGG;AAEH,eAAO,MAAM,+BAA+B,KAAK,CAAC;AA0GlD;;;;;;;;GAQG;AAEH,wBAAsB,YAAY,CAChC,OAAO,EAAE,gBAAgB,EACzB,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,OAAO,CAAC,SAAS,WAAW,EAAE,CAAC,CAoEjC"}
@@ -1,5 +1,8 @@
1
1
  import path from "node:path";
2
+ import { REFERENCE_PLUGIN_PACKAGE } from "../../plugins/proof-reference-extractors.js";
3
+ import { describeReferenceLanguageSuggestion, manifestDeclares, pinnedPackVersions, referenceLanguageSuggestion, workspaceInstalledVersion, } from "../../plugins/reference-language-suggestion.js";
2
4
  import { KB_PATHS } from "../../utils/kb-paths.js";
5
+ import { PLUGIN_LANGUAGE_PACKS, pluginReferenceLanguage, } from "../proof/code-languages.js";
3
6
  const UI_PLUGIN = "kibi-plugin-ui";
4
7
  const UI_CAPABILITY = "kibi.check-policy.v1";
5
8
  const UI_SOURCE = /(?:\.(?:tsx|jsx)|\.component\.ts)$/i;
@@ -13,6 +16,47 @@ const HINTS_CAPABILITY = "kibi.search-hints.v1";
13
16
  */
14
17
  // implements REQ-kibi-plugin-search-hints
15
18
  export const SEARCH_HINTS_OFFER_REQUIREMENTS = 50;
19
+ /** The project's kibi block as written, for offers that look at capabilities. */
20
+ function kibiConfigOf(manifest) {
21
+ if (typeof manifest !== "object" || manifest === null)
22
+ return {};
23
+ const kibi = manifest.kibi;
24
+ if (typeof kibi !== "object" || kibi === null || Array.isArray(kibi))
25
+ return {};
26
+ const { plugins, declinedPlugins } = kibi;
27
+ return {
28
+ plugins: Array.isArray(plugins)
29
+ ? plugins.flatMap((entry) => {
30
+ if (typeof entry !== "object" || entry === null)
31
+ return [];
32
+ const { package: name, capabilities } = entry;
33
+ return typeof name === "string"
34
+ ? [
35
+ {
36
+ package: name,
37
+ capabilities: typeof capabilities === "object" && capabilities !== null
38
+ ? capabilities
39
+ : {},
40
+ },
41
+ ]
42
+ : [];
43
+ })
44
+ : [],
45
+ declinedPlugins: Array.isArray(declinedPlugins)
46
+ ? declinedPlugins.filter((name) => typeof name === "string")
47
+ : [],
48
+ };
49
+ }
50
+ async function readManifest(context) {
51
+ try {
52
+ if (!context.fs)
53
+ return undefined;
54
+ return JSON.parse(await context.fs.readFile(path.join(context.workspaceRoot, "package.json")));
55
+ }
56
+ catch {
57
+ return undefined;
58
+ }
59
+ }
16
60
  /** Plugin names the project activated or declined, from its package.json. */
17
61
  async function configuredPlugins(context) {
18
62
  let manifest;
@@ -70,19 +114,45 @@ async function requirementFiles(context) {
70
114
  * offered when production React or Angular component files exist, and
71
115
  * kibi-plugin-search-hints once the KB holds enough requirements that a
72
116
  * question worded differently from them is likely to miss; neither is
73
- * offered once the project activated or declined it.
117
+ * offered once the project activated or declined it. kibi-plugin-treesitter
118
+ * is offered for sources in any language it reads until it is listed, and
119
+ * for Go, Java, C# and Rust sources until it is active for source proofs.
74
120
  */
75
- // implements REQ-bootstrap-ui-plugin-offer, REQ-kibi-plugin-search-hints
121
+ // implements REQ-bootstrap-ui-plugin-offer, REQ-kibi-plugin-search-hints, REQ-kibi-tree-sitter-references
76
122
  export async function pluginOffers(context, files) {
77
123
  const uiFiles = files.filter((file) => UI_SOURCE.test(file) && !NOT_PRODUCTION.test(file));
78
124
  const requirements = await requirementFiles(context);
79
125
  const wantsHints = requirements.length >= SEARCH_HINTS_OFFER_REQUIREMENTS;
80
- if (uiFiles.length === 0 && !wantsHints)
126
+ // Any language the plugin reads (for symbols, or for proofs too).
127
+ const wantsReferences = files.some((file) => pluginReferenceLanguage(file) !== null ||
128
+ PLUGIN_LANGUAGE_PACKS.some((language) => language.pattern.test(file)));
129
+ if (uiFiles.length === 0 && !wantsHints && !wantsReferences)
81
130
  return [];
82
131
  const configured = await configuredPlugins(context);
83
132
  if (configured === undefined)
84
133
  return [];
85
134
  const offers = [];
135
+ const manifest = wantsReferences ? await readManifest(context) : undefined;
136
+ const references = wantsReferences
137
+ ? referenceLanguageSuggestion(files, kibiConfigOf(manifest), workspaceInstalledVersion(context.workspaceRoot), pinnedPackVersions(context.workspaceRoot), undefined, manifestDeclares(manifest, REFERENCE_PLUGIN_PACKAGE))
138
+ : null;
139
+ if (references !== null && references.capabilities.length > 0) {
140
+ const [capability, ...more] = references.capabilities;
141
+ offers.push({
142
+ package: references.package,
143
+ capability: capability,
144
+ mode: "augment",
145
+ reason: describeReferenceLanguageSuggestion(references),
146
+ fileCount: references.languages.reduce((total, language) => total + language.files, 0),
147
+ evidence: references.evidence,
148
+ ...(references.packs.length > 0 ? { alsoInstall: references.packs } : {}),
149
+ ...(more.length > 0
150
+ ? {
151
+ alsoActivate: Object.fromEntries(more.map((name) => [name, "augment"])),
152
+ }
153
+ : {}),
154
+ });
155
+ }
86
156
  if (uiFiles.length > 0 && !configured.has(UI_PLUGIN))
87
157
  offers.push({
88
158
  package: UI_PLUGIN,
@@ -1 +1 @@
1
- {"version":3,"file":"logic-modeling.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/logic-modeling.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,WAAW,EAIjB,MAAM,mBAAmB,CAAC;AAS3B,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAA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AQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACpD;AAUD,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,mBAAmB,GACzB,oBAAoB,CAoHtB"}
@@ -1,5 +1,6 @@
1
1
  import { createHash } from "node:crypto";
2
2
  import { logicSemanticKey, utf8Span, validateLogicIr, } from "../../logic/ir.js";
3
+ import { firstSentence } from "../../utils/first-sentence.js";
3
4
  import { modeledClaimRole, normalizeSemanticClause, semanticClaimKey, } from "../semantic-advisor/clauses.js";
4
5
  import { advisorPropositionRole } from "../semantic-advisor/proposition-role.js";
5
6
  import { semanticSourceHash } from "../semantic-advisor/shared.js";
@@ -86,7 +87,7 @@ export function buildLogicApplyPlan(input) {
86
87
  type: "req",
87
88
  id: input.requirementId ?? `REQ-LOGIC-${shortId(claimText)}`,
88
89
  properties: {
89
- title: claimText.split(/[.!?]/, 1)[0] || "Typed logical requirement",
90
+ title: firstSentence(claimText) || "Typed logical requirement",
90
91
  status: "open",
91
92
  source: input.source,
92
93
  semantic_text: input.text.trim(),
@@ -1 +1 @@
1
- {"version":3,"file":"model-requirement.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/model-requirement.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAEp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AAC,CAajC"}
1
+ {"version":3,"file":"model-requirement.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/model-requirement.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAkBjF,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,iCAAiC,EACjC,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,wBAAwB,CAAC;AAUhC,YAAY,EACV,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAuBhC,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,cAAc,EACxB,cAAc,EAAE,MAAM,GACrB;IAAE,QAAQ,EAAE,cAAc,CAAC;IAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAuBhE;AA2KD,OAAO,EACL,iCAAiC,EACjC,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,GACxB,CAAC;AAIF,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,EAAE;IACP,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,GACA,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA+CzB;AAuOD,wBAAsB,4BAA4B,CAChD,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAIxB;AAED,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,oBAAoB,EAC1B,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,sBAAsB,CAAC,CAwHjC;AAED,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,oBAAoB,EAC1B,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,sBAAsB,CAAC,CAajC"}
@@ -1,4 +1,5 @@
1
1
  import { buildStrictWriteSet, } from "../../public/check-types.js";
2
+ import { firstSentence } from "../../utils/first-sentence.js";
2
3
  import { readKbManifestStatus } from "../../utils/kb-manifest.js";
3
4
  import { factSourcePath, isConventionalSubjectKey, normalizeSubjectKey, } from "../../utils/strict-modeling.js";
4
5
  import { modeledClaimRole, normalizeSemanticClause, semanticClaimKey, } from "../semantic-advisor/clauses.js";
@@ -345,7 +346,7 @@ async function unresolvedConditionalResult(args, extracted, reason, workspaceRoo
345
346
  type: "req",
346
347
  id: args.requirementId,
347
348
  properties: {
348
- title: claimText.split(/[.!?]/, 1)[0] || "Conditional requirement",
349
+ title: firstSentence(claimText) || "Conditional requirement",
349
350
  status: "open",
350
351
  source: extracted.source,
351
352
  semantic_text: semanticText,
@@ -5,6 +5,8 @@ export type RefreshResult = {
5
5
  readonly found: boolean;
6
6
  readonly outcome?: TargetedRefreshOutcome;
7
7
  readonly publication?: ArtifactPublicationReceipt;
8
+ /** Why the symbol got no coordinates, when the refresh could not place it. */
9
+ readonly unplaced?: string;
8
10
  };
9
11
  export type ArtifactPublicationReceipt = {
10
12
  readonly path: string;