kibi-cli 2.2.0 → 2.3.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 (183) hide show
  1. package/dist/cli-operation-loader.d.ts.map +1 -1
  2. package/dist/cli-operation-loader.js +3 -0
  3. package/dist/cli-operation-metadata.d.ts +4 -0
  4. package/dist/cli-operation-metadata.d.ts.map +1 -1
  5. package/dist/cli-operation-metadata.js +5 -0
  6. package/dist/cli-register-reporting.d.ts.map +1 -1
  7. package/dist/cli-register-reporting.js +4 -0
  8. package/dist/commands/check-diff.d.ts +5 -0
  9. package/dist/commands/check-diff.d.ts.map +1 -0
  10. package/dist/commands/check-diff.js +62 -0
  11. package/dist/commands/check-generated.d.ts.map +1 -1
  12. package/dist/commands/check-generated.js +41 -18
  13. package/dist/commands/check.d.ts.map +1 -1
  14. package/dist/commands/check.js +210 -73
  15. package/dist/commands/doctor.d.ts.map +1 -1
  16. package/dist/commands/doctor.js +63 -29
  17. package/dist/commands/github-init.d.ts.map +1 -1
  18. package/dist/commands/github-init.js +9 -2
  19. package/dist/commands/sync/manifest.d.ts.map +1 -1
  20. package/dist/commands/sync/manifest.js +3 -1
  21. package/dist/engine.d.ts +15 -1
  22. package/dist/engine.d.ts.map +1 -1
  23. package/dist/engine.js +252 -52
  24. package/dist/extractors/symbols-coordinator.d.ts +7 -0
  25. package/dist/extractors/symbols-coordinator.d.ts.map +1 -1
  26. package/dist/extractors/symbols-coordinator.js +75 -39
  27. package/dist/operations/modeling/predicate-inference-1.js +1 -1
  28. package/dist/operations/mutation/source-authoring.d.ts.map +1 -1
  29. package/dist/operations/mutation/source-authoring.js +175 -53
  30. package/dist/operations/mutation/upsert.d.ts.map +1 -1
  31. package/dist/operations/mutation/upsert.js +5 -7
  32. package/dist/operations/planning/apply-plan.d.ts.map +1 -1
  33. package/dist/operations/planning/apply-plan.js +5 -9
  34. package/dist/operations/proof/ingest-proof.d.ts.map +1 -1
  35. package/dist/operations/proof/ingest-proof.js +1 -0
  36. package/dist/operations/semantic-advisor/analysis-receipt.d.ts.map +1 -1
  37. package/dist/operations/semantic-advisor/analysis-receipt.js +7 -1
  38. package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -1
  39. package/dist/operations/semantic-advisor/analyze-prose.js +26 -4
  40. package/dist/operations/semantic-advisor/clauses.d.ts +1 -0
  41. package/dist/operations/semantic-advisor/clauses.d.ts.map +1 -1
  42. package/dist/operations/semantic-advisor/clauses.js +7 -1
  43. package/dist/performance-trace.d.ts +17 -0
  44. package/dist/performance-trace.d.ts.map +1 -0
  45. package/dist/performance-trace.js +134 -0
  46. package/dist/plugins/approved-source-analyzers.d.ts +13 -0
  47. package/dist/plugins/approved-source-analyzers.d.ts.map +1 -0
  48. package/dist/plugins/approved-source-analyzers.generated.d.ts +71 -0
  49. package/dist/plugins/approved-source-analyzers.generated.d.ts.map +1 -0
  50. package/dist/plugins/approved-source-analyzers.generated.js +77 -0
  51. package/dist/plugins/approved-source-analyzers.js +3 -0
  52. package/dist/plugins/maintenance-source-analysis.d.ts +14 -0
  53. package/dist/plugins/maintenance-source-analysis.d.ts.map +1 -0
  54. package/dist/plugins/maintenance-source-analysis.js +191 -0
  55. package/dist/plugins/registry.d.ts +2 -1
  56. package/dist/plugins/registry.d.ts.map +1 -1
  57. package/dist/plugins/registry.js +6 -1
  58. package/dist/plugins/source-analysis-service.d.ts +36 -1
  59. package/dist/plugins/source-analysis-service.d.ts.map +1 -1
  60. package/dist/plugins/source-analysis-service.js +184 -27
  61. package/dist/plugins/source-change-analysis.d.ts +15 -0
  62. package/dist/plugins/source-change-analysis.d.ts.map +1 -0
  63. package/dist/plugins/source-change-analysis.js +54 -0
  64. package/dist/plugins/source-classification.d.ts +41 -0
  65. package/dist/plugins/source-classification.d.ts.map +1 -0
  66. package/dist/plugins/source-classification.js +490 -0
  67. package/dist/prolog/swipl-resolver.d.ts +88 -0
  68. package/dist/prolog/swipl-resolver.d.ts.map +1 -0
  69. package/dist/prolog/swipl-resolver.js +446 -0
  70. package/dist/prolog.d.ts +15 -1
  71. package/dist/prolog.d.ts.map +1 -1
  72. package/dist/prolog.js +67 -6
  73. package/dist/public/impact/analyzer.d.ts.map +1 -1
  74. package/dist/public/impact/analyzer.js +56 -5
  75. package/dist/public/impact/diagnostics.d.ts.map +1 -1
  76. package/dist/public/impact/diagnostics.js +3 -1
  77. package/dist/public/impact/manifest.d.ts.map +1 -1
  78. package/dist/public/impact/manifest.js +15 -1
  79. package/dist/public/impact/source-changes.d.ts.map +1 -1
  80. package/dist/public/impact/source-changes.js +35 -27
  81. package/dist/public/impact/types.d.ts +2 -0
  82. package/dist/public/impact/types.d.ts.map +1 -1
  83. package/dist/public/operations/catalog.d.ts +44 -0
  84. package/dist/public/operations/catalog.d.ts.map +1 -1
  85. package/dist/public/operations/catalog.js +2 -0
  86. package/dist/public/operations/contracts.d.ts.map +1 -1
  87. package/dist/public/operations/contracts.js +309 -8
  88. package/dist/public/operations/impact-review-preparation.d.ts +14 -0
  89. package/dist/public/operations/impact-review-preparation.d.ts.map +1 -0
  90. package/dist/public/operations/impact-review-preparation.js +379 -0
  91. package/dist/public/operations/index.d.ts +2 -0
  92. package/dist/public/operations/index.d.ts.map +1 -1
  93. package/dist/public/operations/index.js +2 -0
  94. package/dist/public/operations/node-ports.d.ts.map +1 -1
  95. package/dist/public/operations/node-ports.js +1 -35
  96. package/dist/public/operations/proof-receipt-projection.d.ts +5 -0
  97. package/dist/public/operations/proof-receipt-projection.d.ts.map +1 -0
  98. package/dist/public/operations/proof-receipt-projection.js +36 -0
  99. package/dist/public/operations/specs/impact-review-preparation.d.ts +47 -0
  100. package/dist/public/operations/specs/impact-review-preparation.d.ts.map +1 -0
  101. package/dist/public/operations/specs/impact-review-preparation.js +43 -0
  102. package/dist/public/operations/types.d.ts +1 -1
  103. package/dist/public/operations/types.d.ts.map +1 -1
  104. package/dist/public/skills/kibi-usage/resources/operation-access.md +1 -0
  105. package/dist/traceability/analysis-gate.d.ts +39 -0
  106. package/dist/traceability/analysis-gate.d.ts.map +1 -0
  107. package/dist/traceability/analysis-gate.js +51 -0
  108. package/dist/traceability/git-change-snapshot.d.ts +27 -0
  109. package/dist/traceability/git-change-snapshot.d.ts.map +1 -0
  110. package/dist/traceability/git-change-snapshot.js +411 -0
  111. package/dist/traceability/git-staged.d.ts +5 -1
  112. package/dist/traceability/git-staged.d.ts.map +1 -1
  113. package/dist/traceability/git-staged.js +16 -11
  114. package/dist/traceability/impact-evaluator.d.ts +54 -0
  115. package/dist/traceability/impact-evaluator.d.ts.map +1 -0
  116. package/dist/traceability/impact-evaluator.js +270 -0
  117. package/dist/traceability/impact-git-tree.d.ts +12 -0
  118. package/dist/traceability/impact-git-tree.d.ts.map +1 -0
  119. package/dist/traceability/impact-git-tree.js +46 -0
  120. package/dist/traceability/impact-knowledge.d.ts +16 -0
  121. package/dist/traceability/impact-knowledge.d.ts.map +1 -0
  122. package/dist/traceability/impact-knowledge.js +165 -0
  123. package/dist/traceability/impact-policy.d.ts +15 -0
  124. package/dist/traceability/impact-policy.d.ts.map +1 -0
  125. package/dist/traceability/impact-policy.js +48 -0
  126. package/dist/traceability/impact-policy.v1.schema.json +48 -0
  127. package/dist/traceability/impact-pr-diff.d.ts +5 -0
  128. package/dist/traceability/impact-pr-diff.d.ts.map +1 -0
  129. package/dist/traceability/impact-pr-diff.js +83 -0
  130. package/dist/traceability/impact-record-validation.d.ts +9 -0
  131. package/dist/traceability/impact-record-validation.d.ts.map +1 -0
  132. package/dist/traceability/impact-record-validation.js +113 -0
  133. package/dist/traceability/impact-review.d.ts +148 -0
  134. package/dist/traceability/impact-review.d.ts.map +1 -0
  135. package/dist/traceability/impact-review.js +494 -0
  136. package/dist/traceability/impact-review.schema.json +365 -0
  137. package/dist/traceability/impact-side-evidence.d.ts +13 -0
  138. package/dist/traceability/impact-side-evidence.d.ts.map +1 -0
  139. package/dist/traceability/impact-side-evidence.js +240 -0
  140. package/dist/traceability/reviewed-coordinate-refresh.d.ts +10 -0
  141. package/dist/traceability/reviewed-coordinate-refresh.d.ts.map +1 -0
  142. package/dist/traceability/reviewed-coordinate-refresh.js +49 -0
  143. package/dist/traceability/snapshot-knowledge.d.ts +4 -0
  144. package/dist/traceability/snapshot-knowledge.d.ts.map +1 -0
  145. package/dist/traceability/snapshot-knowledge.js +98 -0
  146. package/dist/traceability/staged-file-coverage.d.ts +23 -0
  147. package/dist/traceability/staged-file-coverage.d.ts.map +1 -1
  148. package/dist/traceability/staged-impact-contract.d.ts.map +1 -1
  149. package/dist/traceability/staged-impact-contract.js +2 -16
  150. package/dist/traceability/staged-symbols-manifest.d.ts +4 -0
  151. package/dist/traceability/staged-symbols-manifest.d.ts.map +1 -1
  152. package/dist/traceability/staged-symbols-manifest.js +17 -6
  153. package/dist/traceability/symbol-extract.d.ts +3 -5
  154. package/dist/traceability/symbol-extract.d.ts.map +1 -1
  155. package/dist/traceability/symbol-extract.js +49 -34
  156. package/dist/traceability/temp-kb.d.ts +1 -1
  157. package/dist/traceability/temp-kb.d.ts.map +1 -1
  158. package/dist/traceability/temp-kb.js +49 -13
  159. package/dist/traceability/trusted-pr-event.d.ts +13 -0
  160. package/dist/traceability/trusted-pr-event.d.ts.map +1 -0
  161. package/dist/traceability/trusted-pr-event.js +105 -0
  162. package/dist/utils/canonical-path.d.ts +3 -0
  163. package/dist/utils/canonical-path.d.ts.map +1 -0
  164. package/dist/utils/canonical-path.js +33 -0
  165. package/package.json +14 -5
  166. package/src/public/impact/analyzer.ts +88 -5
  167. package/src/public/impact/diagnostics.ts +7 -5
  168. package/src/public/impact/manifest.ts +14 -1
  169. package/src/public/impact/source-changes.ts +39 -34
  170. package/src/public/impact/types.ts +5 -0
  171. package/src/public/operations/catalog.ts +2 -0
  172. package/src/public/operations/contracts.ts +385 -9
  173. package/src/public/operations/impact-review-preparation.ts +548 -0
  174. package/src/public/operations/index.ts +2 -0
  175. package/src/public/operations/node-ports.ts +1 -39
  176. package/src/public/operations/proof-receipt-projection.ts +39 -0
  177. package/src/public/operations/specs/impact-review-preparation.ts +46 -0
  178. package/src/public/operations/types.ts +1 -0
  179. package/src/public/skills/kibi-usage/resources/operation-access.md +1 -0
  180. package/src/traceability/impact-policy.v1.schema.json +48 -0
  181. package/src/traceability/impact-review.schema.json +365 -0
  182. package/templates/github/kibi-badge.yml +0 -4
  183. package/templates/github/kibi-report.yml +0 -4
@@ -1,27 +1,76 @@
1
1
  import * as path from "node:path";
2
+ import { createMaintenanceSourceAnalysisService, readSnapshotSourceConfig, } from "../../plugins/maintenance-source-analysis.js";
3
+ import { analyzeSourceChanges, assertSourceAnalysisGate, } from "../../plugins/source-change-analysis.js";
4
+ import { captureStagedSnapshot } from "../../traceability/git-change-snapshot.js";
5
+ import { readSnapshotKnowledge } from "../../traceability/snapshot-knowledge.js";
2
6
  import { extractSymbolsFromStagedFileAsync } from "../../traceability/symbol-extract.js";
3
7
  import { createSemanticReviewDiagnostics, createSymbolGranularityDiagnostics, } from "./diagnostics.js";
4
8
  import { createImpactManifestLookup, readImpactManifestResults, } from "./manifest.js";
9
+ import { normalizeSourceFile } from "./source-changes.js";
5
10
  import { collectSourceChanges, uniqueSorted } from "./source-changes.js";
6
11
  import { buildNextActions, collectLinkedEntities, formatExtractedSymbols, } from "./summaries.js";
7
12
  import { createSymbolQualityDiagnostics } from "./symbol-quality.js";
8
13
  export async function analyzeChangedFileImpact(options) {
9
14
  const workspaceRoot = path.resolve(options.workspaceRoot);
10
- const sourceChanges = collectSourceChanges({ ...options, workspaceRoot });
11
- const sourceFiles = uniqueSorted(sourceChanges.map((change) => change.file));
12
- const manifestResults = readImpactManifestResults(workspaceRoot);
15
+ const snapshot = options.staged
16
+ ? captureStagedSnapshot(workspaceRoot)
17
+ : undefined;
18
+ const filter = new Set((options.sourceFiles ?? []).map((file) => normalizeSourceFile(workspaceRoot, file)));
19
+ const snapshotAnalysisInventory = snapshot
20
+ ? snapshot.inventory.filter((file) => filter.size === 0 || filter.has(file.path))
21
+ : undefined;
22
+ const snapshotSourceInventory = snapshot
23
+ ? snapshot.inventory.filter((file) => file.analysisDepth !== "metadata" &&
24
+ !file.skipReason &&
25
+ file.content !== undefined &&
26
+ (filter.size === 0 || filter.has(file.path)))
27
+ : undefined;
28
+ const sourceChanges = snapshot
29
+ ? (snapshotSourceInventory ?? []).map((file) => ({
30
+ file: file.path,
31
+ status: file.status,
32
+ hunkRanges: file.hunkRanges,
33
+ content: file.content ?? "",
34
+ }))
35
+ : collectSourceChanges({ ...options, workspaceRoot });
36
+ const service = createMaintenanceSourceAnalysisService(workspaceRoot, snapshot ? readSnapshotSourceConfig(snapshot) : undefined);
37
+ const analyses = snapshot
38
+ ? await analyzeSourceChanges(snapshotAnalysisInventory ?? [], service)
39
+ : undefined;
40
+ if (analyses)
41
+ assertSourceAnalysisGate(snapshotAnalysisInventory ?? [], analyses);
42
+ const sourceFiles = uniqueSorted(snapshot
43
+ ? snapshot.inventory
44
+ .filter((file) => file.analysisDepth !== "metadata" &&
45
+ (filter.size === 0 || filter.has(file.path)))
46
+ .map((file) => file.path)
47
+ : sourceChanges.map((change) => change.file));
48
+ const manifestResults = snapshot
49
+ ? readSnapshotKnowledge(snapshot.readGit, snapshot.headTree, snapshot.readBlobs).filter((result) => result.entity.type === "symbol")
50
+ : readImpactManifestResults(workspaceRoot);
13
51
  const manifestLookup = createImpactManifestLookup(manifestResults);
14
52
  const symbolsByFile = new Map();
15
53
  const sourceContentByFile = new Map();
54
+ const sourceSymbolsByFile = new Map();
16
55
  for (const change of sourceChanges) {
17
56
  sourceContentByFile.set(change.file, change.content);
18
- // Maintenance path: builtin-only (do not pass registry / workspaceRoot).
57
+ const analysis = analyses?.get(change.file)?.after ??
58
+ (await service.analyzeTextV2(change.file, change.content));
19
59
  const extracted = await extractSymbolsFromStagedFileAsync({
20
60
  path: change.file,
21
61
  status: change.status,
22
62
  hunkRanges: [...change.hunkRanges],
23
63
  content: change.content,
24
- }, manifestLookup, {});
64
+ }, manifestLookup, { analyzeText: async () => analysis });
65
+ const allSymbols = await extractSymbolsFromStagedFileAsync({
66
+ path: change.file,
67
+ status: change.status,
68
+ content: change.content,
69
+ hunkRanges: [
70
+ { start: 1, end: Math.max(1, change.content.split("\n").length) },
71
+ ],
72
+ }, manifestLookup, { analyzeText: async () => analysis });
73
+ sourceSymbolsByFile.set(change.file, allSymbols);
25
74
  symbolsByFile.set(change.file, extracted.filter((symbol) => symbol.hunkRanges.length > 0));
26
75
  }
27
76
  const activeSourceFiles = new Set(sourceFiles);
@@ -34,6 +83,7 @@ export async function analyzeChangedFileImpact(options) {
34
83
  manifestResults: activeManifestResults,
35
84
  symbolsByFile,
36
85
  sourceContentByFile,
86
+ sourceSymbolsByFile,
37
87
  workspaceRoot,
38
88
  }),
39
89
  ...createSymbolQualityDiagnostics({
@@ -46,6 +96,7 @@ export async function analyzeChangedFileImpact(options) {
46
96
  const cappedDiagnostics = maxDiagnostics !== undefined && maxDiagnostics >= 0
47
97
  ? impactDiagnostics.slice(0, maxDiagnostics)
48
98
  : impactDiagnostics;
99
+ snapshot?.assertUnchanged();
49
100
  return {
50
101
  impactDiagnostics: cappedDiagnostics,
51
102
  sourceFiles,
@@ -1 +1 @@
1
- {"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../../src/public/impact/diagnostics.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAYrF,OAAO,KAAK,EACV,iBAAiB,EACjB,gCAAgC,EAChC,mCAAmC,EACpC,MAAM,YAAY,CAAC;AA2FpB,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,mCAAmC,GAC3C,oBAAoB,EAAE,CA+CxB;AAED,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,gCAAgC,GACxC,oBAAoB,EAAE,CAsBxB;AAED,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,SAAS,oBAAoB,EAAE,GAC3C,OAAO,CAET;AAED,wBAAgB,6BAA6B,CAC3C,WAAW,EAAE,SAAS,iBAAiB,EAAE,GACxC,OAAO,CAIT"}
1
+ {"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../../src/public/impact/diagnostics.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAYrF,OAAO,KAAK,EACV,iBAAiB,EACjB,gCAAgC,EAChC,mCAAmC,EACpC,MAAM,YAAY,CAAC;AA6FpB,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,mCAAmC,GAC3C,oBAAoB,EAAE,CA+CxB;AAED,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,gCAAgC,GACxC,oBAAoB,EAAE,CAsBxB;AAED,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,SAAS,oBAAoB,EAAE,GAC3C,OAAO,CAET;AAED,wBAAgB,6BAA6B,CAC3C,WAAW,EAAE,SAAS,iBAAiB,EAAE,GACxC,OAAO,CAIT"}
@@ -38,7 +38,9 @@ function readSourceSymbols(sourceFile, sourceContentByFile, workspaceRoot) {
38
38
  });
39
39
  }
40
40
  function getGranularSymbolsForSourceFile(sourceFile, options) {
41
- const sourceSymbols = readSourceSymbols(sourceFile, options.sourceContentByFile, options.workspaceRoot ?? process.cwd());
41
+ const sourceSymbols = options.sourceSymbolsByFile
42
+ ? (options.sourceSymbolsByFile.get(sourceFile) ?? [])
43
+ : readSourceSymbols(sourceFile, options.sourceContentByFile, options.workspaceRoot ?? process.cwd());
42
44
  const changedSymbols = options.symbolsByFile.get(sourceFile);
43
45
  return {
44
46
  candidateSymbols: changedSymbols ?? sourceSymbols,
@@ -1 +1 @@
1
- {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../src/public/impact/manifest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAc3E,wBAAgB,yBAAyB,CACvC,aAAa,EAAE,MAAM,GACpB,SAAS,gBAAgB,EAAE,CAkB7B;AAED,wBAAgB,0BAA0B,CACxC,eAAe,EAAE,SAAS,gBAAgB,EAAE,GAC3C,cAAc,CAYhB"}
1
+ {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../src/public/impact/manifest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAc3E,wBAAgB,yBAAyB,CACvC,aAAa,EAAE,MAAM,GACpB,SAAS,gBAAgB,EAAE,CAkB7B;AAED,wBAAgB,0BAA0B,CACxC,eAAe,EAAE,SAAS,gBAAgB,EAAE,GAC3C,cAAc,CAwBhB"}
@@ -1,6 +1,7 @@
1
1
  import { existsSync } from "node:fs";
2
2
  import * as path from "node:path";
3
3
  import { extractFromManifest } from "../../extractors/manifest.js";
4
+ import { createManifestLookupSentinelKey } from "../../traceability/symbol-extract.js";
4
5
  import { CANONICAL_ENTITY_PATHS } from "../../utils/kb-paths.js";
5
6
  import { isTraceabilityRelationshipType } from "../symbol-granularity.js";
6
7
  import { normalizeSourceFile } from "./source-changes.js";
@@ -29,9 +30,22 @@ export function readImpactManifestResults(workspaceRoot) {
29
30
  }
30
31
  export function createImpactManifestLookup(manifestResults) {
31
32
  const manifestLookup = new Map();
33
+ manifestLookup.set(createManifestLookupSentinelKey(".kb/symbols.yaml"), {
34
+ id: "__captured_manifest__",
35
+ relationships: [],
36
+ });
37
+ const ambiguous = new Set();
32
38
  for (const result of manifestResults) {
33
39
  const sourceFile = result.sourceFile ?? result.entity.source;
34
- manifestLookup.set(`${sourceFile}:${result.entity.title}`, {
40
+ const key = `${sourceFile}:${result.entity.title}`;
41
+ if (ambiguous.has(key))
42
+ continue;
43
+ if (manifestLookup.has(key)) {
44
+ manifestLookup.delete(key);
45
+ ambiguous.add(key);
46
+ continue;
47
+ }
48
+ manifestLookup.set(key, {
35
49
  id: result.entity.id,
36
50
  relationships: toTraceabilityRelationships(result.relationships),
37
51
  });
@@ -1 +1 @@
1
- {"version":3,"file":"source-changes.d.ts","sourceRoot":"","sources":["../../../src/public/impact/source-changes.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAiBzE,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,GACjB,MAAM,CAKR;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAE/D;AA6HD,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,wBAAwB,GAChC,YAAY,EAAE,CAchB"}
1
+ {"version":3,"file":"source-changes.d.ts","sourceRoot":"","sources":["../../../src/public/impact/source-changes.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAMzE,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,GACjB,MAAM,CAKR;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAE/D;AA4ID,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,wBAAwB,GAChC,YAAY,EAAE,CAchB"}
@@ -1,20 +1,11 @@
1
- import { execSync } from "node:child_process";
2
- import { existsSync, readFileSync } from "node:fs";
1
+ import { execFileSync, execSync } from "node:child_process";
2
+ import { existsSync, lstatSync, readFileSync, realpathSync } from "node:fs";
3
3
  import * as path from "node:path";
4
+ import { isQualifiedSourcePath } from "../../plugins/source-classification.js";
4
5
  import { getStagedFiles, parseHunksFromDiff, } from "../../traceability/git-staged.js";
5
6
  import { hasMeaningfulSourceDiff } from "./diff-meaning.js";
6
- const SOURCE_EXTENSIONS = new Set([
7
- ".ts",
8
- ".tsx",
9
- ".js",
10
- ".jsx",
11
- ".mts",
12
- ".cts",
13
- ".mjs",
14
- ".cjs",
15
- ]);
16
7
  function isSupportedSourcePath(filePath) {
17
- return SOURCE_EXTENSIONS.has(path.extname(filePath));
8
+ return isQualifiedSourcePath(filePath);
18
9
  }
19
10
  export function normalizeSourceFile(workspaceRoot, sourceFile) {
20
11
  const relativePath = path.isAbsolute(sourceFile)
@@ -25,26 +16,41 @@ export function normalizeSourceFile(workspaceRoot, sourceFile) {
25
16
  export function uniqueSorted(values) {
26
17
  return [...new Set(values)].sort();
27
18
  }
28
- function escapeGitPath(filePath) {
29
- return filePath.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
30
- }
31
- function runGit(workspaceRoot, command) {
32
- return execSync(command, { cwd: workspaceRoot, encoding: "utf8" });
19
+ function runGit(workspaceRoot, args) {
20
+ return execFileSync("git", [...args], {
21
+ cwd: workspaceRoot,
22
+ encoding: "utf8",
23
+ env: { ...process.env, GIT_LITERAL_PATHSPECS: "1" },
24
+ });
33
25
  }
34
26
  function readWorkingTreeSource(workspaceRoot, sourceFile) {
35
27
  const absolutePath = path.resolve(workspaceRoot, sourceFile);
36
- if (!existsSync(absolutePath))
28
+ const relative = path.relative(workspaceRoot, absolutePath);
29
+ if (!relative || relative.startsWith("..") || path.isAbsolute(relative))
30
+ throw new Error("Source path must remain inside the workspace");
31
+ if (!existsSync(absolutePath) || !lstatSync(absolutePath).isFile())
32
+ return null;
33
+ const actualRelative = path.relative(realpathSync(workspaceRoot), realpathSync(absolutePath));
34
+ if (actualRelative.startsWith("..") || path.isAbsolute(actualRelative))
35
+ throw new Error("Source path escapes the workspace");
36
+ const bytes = readFileSync(absolutePath);
37
+ if (bytes.includes(0))
38
+ return null;
39
+ try {
40
+ return new TextDecoder("utf-8", { fatal: true }).decode(bytes);
41
+ }
42
+ catch {
37
43
  return null;
38
- return readFileSync(absolutePath, "utf8");
44
+ }
39
45
  }
40
46
  function fullFileHunk(content) {
41
47
  return [{ start: 1, end: Math.max(1, content.split(/\r?\n/).length) }];
42
48
  }
43
49
  function getWorkingTreeDiffSourceFiles(workspaceRoot) {
44
50
  try {
45
- return uniqueSorted(runGit(workspaceRoot, "git diff --name-only --diff-filter=ACMR")
46
- .split(/\r?\n/)
47
- .map((filePath) => normalizeSourceFile(workspaceRoot, filePath.trim()))
51
+ return uniqueSorted(runGit(workspaceRoot, ["diff", "--name-only", "-z", "--diff-filter=ACMR"])
52
+ .split("\0")
53
+ .map((filePath) => normalizeSourceFile(workspaceRoot, filePath))
48
54
  .filter((filePath) => filePath.length > 0)
49
55
  .filter(isSupportedSourcePath));
50
56
  }
@@ -54,7 +60,7 @@ function getWorkingTreeDiffSourceFiles(workspaceRoot) {
54
60
  }
55
61
  function getWorkingTreeHunks(workspaceRoot, sourceFile) {
56
62
  try {
57
- const diffText = runGit(workspaceRoot, `git diff -U0 -- "${escapeGitPath(sourceFile)}"`);
63
+ const diffText = runGit(workspaceRoot, ["diff", "-U0", "--", sourceFile]);
58
64
  return parseHunksFromDiff(diffText);
59
65
  }
60
66
  catch {
@@ -69,7 +75,8 @@ function getStagedSourceChanges(workspaceRoot, sourceFileFilter) {
69
75
  .flatMap((file) => {
70
76
  if (file.content === undefined || file.hunkRanges.length === 0)
71
77
  return [];
72
- if (file.diffText !== undefined &&
78
+ if (!/\.(pyi?|go|rs)$/.test(file.path) &&
79
+ file.diffText !== undefined &&
73
80
  !hasMeaningfulSourceDiff(file.diffText)) {
74
81
  return [];
75
82
  }
@@ -91,8 +98,9 @@ function getWorkingTreeSourceChanges(workspaceRoot, sourceFileFilter) {
91
98
  const content = readWorkingTreeSource(workspaceRoot, sourceFile);
92
99
  if (content === null)
93
100
  return [];
94
- const diffText = runGit(workspaceRoot, `git diff -U0 -- "${escapeGitPath(sourceFile)}"`);
95
- if (!hasMeaningfulSourceDiff(diffText))
101
+ const diffText = runGit(workspaceRoot, ["diff", "-U0", "--", sourceFile]);
102
+ if (!/\.(pyi?|go|rs)$/.test(sourceFile) &&
103
+ !hasMeaningfulSourceDiff(diffText))
96
104
  return [];
97
105
  const hunkRanges = getWorkingTreeHunks(workspaceRoot, sourceFile);
98
106
  if (hunkRanges.length === 0)
@@ -26,6 +26,8 @@ export type SymbolGranularityDiagnosticsOptions = {
26
26
  readonly activeEntityIds?: ReadonlySet<string>;
27
27
  readonly symbolsByFile: SymbolsByFile;
28
28
  readonly sourceContentByFile?: ReadonlyMap<string, string>;
29
+ /** Complete snapshot analysis; when supplied, filesystem fallback is forbidden. */
30
+ readonly sourceSymbolsByFile?: ReadonlyMap<string, readonly ExtractedSymbol[]>;
29
31
  readonly workspaceRoot?: string;
30
32
  };
31
33
  export type SemanticReviewDiagnosticsOptions = {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/public/impact/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAE5E,MAAM,MAAM,yBAAyB,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEhF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,QAAQ,EAAE,yBAAyB,CAAC;IAC7C,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EACb,QAAQ,GACR,aAAa,GACb,UAAU,GACV,MAAM,GACN,QAAQ,GACR,YAAY,GACZ,eAAe,GACf,MAAM,CAAC;IACX,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAA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AgB,EAAE,MAAM,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,CAAC,iBAAiB,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAC5D,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,QAAQ,CAAC,gBAAgB,EAAE,SAAS,qBAAqB,EAAE,CAAC;IAC5D,QAAQ,CAAC,cAAc,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACvD,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IACtC,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAC;IAC1C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,CAAC"}
@@ -1520,6 +1520,50 @@ export declare const OPERATION_CATALOG: readonly [{
1520
1520
  readonly requiresProlog: true;
1521
1521
  readonly effects: readonly ["kb-read", "workspace-read"];
1522
1522
  readonly execute: typeof import("./check-executor.js").executeCheck;
1523
+ }, {
1524
+ readonly name: "kb_prepare_impact_review";
1525
+ readonly cliName: "prepare-impact-review";
1526
+ readonly description: "Prepare complete content-bound impact-review authoring inputs from the current staged snapshot or explicitly selected immutable Git commits. Returns strict reviewer schemas and an unauthored template; it does not decide, approve, sign, stage, or prove the review.";
1527
+ readonly businessInputSchema: {
1528
+ readonly type: "object";
1529
+ readonly additionalProperties: false;
1530
+ readonly required: readonly ["scope"];
1531
+ readonly properties: {
1532
+ readonly scope: {
1533
+ readonly oneOf: readonly [{
1534
+ readonly type: "object";
1535
+ readonly additionalProperties: false;
1536
+ readonly required: readonly ["kind"];
1537
+ readonly properties: {
1538
+ readonly kind: {
1539
+ readonly const: "staged";
1540
+ };
1541
+ };
1542
+ }, {
1543
+ readonly type: "object";
1544
+ readonly additionalProperties: false;
1545
+ readonly required: readonly ["kind", "baseCommit", "headCommit"];
1546
+ readonly properties: {
1547
+ readonly kind: {
1548
+ readonly const: "diff";
1549
+ };
1550
+ readonly baseCommit: {
1551
+ readonly type: "string";
1552
+ readonly pattern: "^(?:[a-f0-9]{40}|[a-f0-9]{64})$";
1553
+ };
1554
+ readonly headCommit: {
1555
+ readonly type: "string";
1556
+ readonly pattern: "^(?:[a-f0-9]{40}|[a-f0-9]{64})$";
1557
+ };
1558
+ };
1559
+ }];
1560
+ };
1561
+ };
1562
+ };
1563
+ readonly requiresProlog: false;
1564
+ readonly effects: readonly ["workspace-read", "kb-read"];
1565
+ readonly agentVisibleStructuredData: true;
1566
+ readonly execute: typeof import("./impact-review-preparation.js").executePrepareImpactReview;
1523
1567
  }, {
1524
1568
  readonly name: "kb_sparql_remote";
1525
1569
  readonly cliName: "sparql-remote";
@@ -1 +1 @@
1
- {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/public/operations/catalog.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;EAuBe,CAAC;AAyF9C,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,aAAa,GAClB,qBAAqB,CA+BvB;AAQD,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,qBAAqB,GAAG,SAAS,EACvC,IAAI,EAAE,aAAa,GAClB,qBAAqB,CAKvB;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,aAAa,GAAG,qBAAqB,CAElE;AAGD,wBAAgB,SAAS,IAAI,SAAS,qBAAqB,EAAE,CAE5D"}
@@ -2,6 +2,7 @@ import { OPERATION_DATA_SCHEMAS, declaredEffects, } from "./contracts.js";
2
2
  import { planBootstrapSpec } from "./specs/bootstrap.js";
3
3
  import { checkSpec } from "./specs/check.js";
4
4
  import { querySpec, searchSpec, statusSpec } from "./specs/discovery.js";
5
+ import { prepareImpactReviewSpec } from "./specs/impact-review-preparation.js";
5
6
  import { modelRequirementSpec, suggestPredicatesSpec, } from "./specs/modeling.js";
6
7
  import { deleteSpec, upsertSpec, validateUpsertSpec, } from "./specs/mutation.js";
7
8
  import { applyPlanSpec, compileIntentSpec } from "./specs/planning.js";
@@ -28,6 +29,7 @@ export const OPERATION_CATALOG = [
28
29
  upsertSpec,
29
30
  deleteSpec,
30
31
  checkSpec,
32
+ prepareImpactReviewSpec,
31
33
  sparqlRemoteSpec,
32
34
  compileIntentSpec,
33
35
  applyPlanSpec,
@@ -1 +1 @@
1
- {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../src/public/operations/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,0BAA0B,EAC1B,aAAa,EACd,MAAM,YAAY,CAAC;AAEpB,oEAAoE;AACpE,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAwDpE;;uEAEuE;AACvE,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,mBAAmB,GAC1B,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