@optave/codegraph 3.9.0 → 3.9.2

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 (196) hide show
  1. package/README.md +12 -13
  2. package/dist/ast-analysis/engine.d.ts.map +1 -1
  3. package/dist/ast-analysis/engine.js +78 -48
  4. package/dist/ast-analysis/engine.js.map +1 -1
  5. package/dist/ast-analysis/visitors/ast-store-visitor.d.ts.map +1 -1
  6. package/dist/ast-analysis/visitors/ast-store-visitor.js +15 -18
  7. package/dist/ast-analysis/visitors/ast-store-visitor.js.map +1 -1
  8. package/dist/cli/commands/batch.d.ts.map +1 -1
  9. package/dist/cli/commands/batch.js +5 -17
  10. package/dist/cli/commands/batch.js.map +1 -1
  11. package/dist/cli/commands/structure.d.ts.map +1 -1
  12. package/dist/cli/commands/structure.js +18 -1
  13. package/dist/cli/commands/structure.js.map +1 -1
  14. package/dist/db/connection.d.ts +3 -0
  15. package/dist/db/connection.d.ts.map +1 -1
  16. package/dist/db/connection.js +24 -6
  17. package/dist/db/connection.js.map +1 -1
  18. package/dist/db/index.d.ts +1 -1
  19. package/dist/db/index.d.ts.map +1 -1
  20. package/dist/db/index.js +1 -1
  21. package/dist/db/index.js.map +1 -1
  22. package/dist/db/repository/base.d.ts +35 -0
  23. package/dist/db/repository/base.d.ts.map +1 -1
  24. package/dist/db/repository/base.js +8 -0
  25. package/dist/db/repository/base.js.map +1 -1
  26. package/dist/db/repository/index.d.ts +1 -0
  27. package/dist/db/repository/index.d.ts.map +1 -1
  28. package/dist/db/repository/index.js.map +1 -1
  29. package/dist/db/repository/native-repository.d.ts +7 -1
  30. package/dist/db/repository/native-repository.d.ts.map +1 -1
  31. package/dist/db/repository/native-repository.js +46 -1
  32. package/dist/db/repository/native-repository.js.map +1 -1
  33. package/dist/domain/analysis/context.d.ts.map +1 -1
  34. package/dist/domain/analysis/context.js +5 -15
  35. package/dist/domain/analysis/context.js.map +1 -1
  36. package/dist/domain/analysis/dependencies.d.ts +6 -33
  37. package/dist/domain/analysis/dependencies.d.ts.map +1 -1
  38. package/dist/domain/analysis/dependencies.js +18 -16
  39. package/dist/domain/analysis/dependencies.js.map +1 -1
  40. package/dist/domain/analysis/fn-impact.js +2 -2
  41. package/dist/domain/analysis/fn-impact.js.map +1 -1
  42. package/dist/domain/analysis/implementations.d.ts.map +1 -1
  43. package/dist/domain/analysis/implementations.js +3 -13
  44. package/dist/domain/analysis/implementations.js.map +1 -1
  45. package/dist/domain/graph/builder/context.d.ts +4 -0
  46. package/dist/domain/graph/builder/context.d.ts.map +1 -1
  47. package/dist/domain/graph/builder/context.js +4 -0
  48. package/dist/domain/graph/builder/context.js.map +1 -1
  49. package/dist/domain/graph/builder/incremental.d.ts.map +1 -1
  50. package/dist/domain/graph/builder/incremental.js +18 -0
  51. package/dist/domain/graph/builder/incremental.js.map +1 -1
  52. package/dist/domain/graph/builder/native-db-proxy.d.ts +24 -0
  53. package/dist/domain/graph/builder/native-db-proxy.d.ts.map +1 -0
  54. package/dist/domain/graph/builder/native-db-proxy.js +87 -0
  55. package/dist/domain/graph/builder/native-db-proxy.js.map +1 -0
  56. package/dist/domain/graph/builder/pipeline.d.ts.map +1 -1
  57. package/dist/domain/graph/builder/pipeline.js +410 -349
  58. package/dist/domain/graph/builder/pipeline.js.map +1 -1
  59. package/dist/domain/graph/builder/stages/build-edges.d.ts.map +1 -1
  60. package/dist/domain/graph/builder/stages/build-edges.js +44 -4
  61. package/dist/domain/graph/builder/stages/build-edges.js.map +1 -1
  62. package/dist/domain/graph/builder/stages/build-structure.js +2 -2
  63. package/dist/domain/graph/builder/stages/build-structure.js.map +1 -1
  64. package/dist/domain/graph/builder/stages/detect-changes.d.ts.map +1 -1
  65. package/dist/domain/graph/builder/stages/detect-changes.js +6 -28
  66. package/dist/domain/graph/builder/stages/detect-changes.js.map +1 -1
  67. package/dist/domain/graph/builder/stages/finalize.js +1 -1
  68. package/dist/domain/graph/builder/stages/finalize.js.map +1 -1
  69. package/dist/domain/graph/builder/stages/insert-nodes.d.ts.map +1 -1
  70. package/dist/domain/graph/builder/stages/insert-nodes.js +16 -12
  71. package/dist/domain/graph/builder/stages/insert-nodes.js.map +1 -1
  72. package/dist/domain/graph/builder/stages/resolve-imports.d.ts.map +1 -1
  73. package/dist/domain/graph/builder/stages/resolve-imports.js +21 -26
  74. package/dist/domain/graph/builder/stages/resolve-imports.js.map +1 -1
  75. package/dist/domain/graph/watcher.d.ts.map +1 -1
  76. package/dist/domain/graph/watcher.js +99 -95
  77. package/dist/domain/graph/watcher.js.map +1 -1
  78. package/dist/domain/parser.d.ts.map +1 -1
  79. package/dist/domain/parser.js +7 -2
  80. package/dist/domain/parser.js.map +1 -1
  81. package/dist/domain/queries.d.ts +1 -1
  82. package/dist/domain/queries.d.ts.map +1 -1
  83. package/dist/domain/queries.js +1 -1
  84. package/dist/domain/queries.js.map +1 -1
  85. package/dist/extractors/go.js +53 -35
  86. package/dist/extractors/go.js.map +1 -1
  87. package/dist/extractors/javascript.js +66 -27
  88. package/dist/extractors/javascript.js.map +1 -1
  89. package/dist/features/audit.d.ts.map +1 -1
  90. package/dist/features/audit.js +3 -2
  91. package/dist/features/audit.js.map +1 -1
  92. package/dist/features/boundaries.d.ts.map +1 -1
  93. package/dist/features/boundaries.js +3 -5
  94. package/dist/features/boundaries.js.map +1 -1
  95. package/dist/features/branch-compare.d.ts.map +1 -1
  96. package/dist/features/branch-compare.js +2 -1
  97. package/dist/features/branch-compare.js.map +1 -1
  98. package/dist/features/complexity.d.ts.map +1 -1
  99. package/dist/features/complexity.js +78 -58
  100. package/dist/features/complexity.js.map +1 -1
  101. package/dist/features/dataflow.d.ts.map +1 -1
  102. package/dist/features/dataflow.js +109 -118
  103. package/dist/features/dataflow.js.map +1 -1
  104. package/dist/features/flow.d.ts.map +1 -1
  105. package/dist/features/flow.js +2 -1
  106. package/dist/features/flow.js.map +1 -1
  107. package/dist/features/manifesto.d.ts.map +1 -1
  108. package/dist/features/manifesto.js +15 -1
  109. package/dist/features/manifesto.js.map +1 -1
  110. package/dist/features/structure.d.ts.map +1 -1
  111. package/dist/features/structure.js +147 -97
  112. package/dist/features/structure.js.map +1 -1
  113. package/dist/graph/algorithms/louvain.d.ts.map +1 -1
  114. package/dist/graph/algorithms/louvain.js +4 -2
  115. package/dist/graph/algorithms/louvain.js.map +1 -1
  116. package/dist/graph/classifiers/roles.d.ts +2 -0
  117. package/dist/graph/classifiers/roles.d.ts.map +1 -1
  118. package/dist/graph/classifiers/roles.js +13 -5
  119. package/dist/graph/classifiers/roles.js.map +1 -1
  120. package/dist/infrastructure/config.d.ts +1 -0
  121. package/dist/infrastructure/config.d.ts.map +1 -1
  122. package/dist/infrastructure/config.js +1 -0
  123. package/dist/infrastructure/config.js.map +1 -1
  124. package/dist/presentation/batch.d.ts.map +1 -1
  125. package/dist/presentation/batch.js +1 -0
  126. package/dist/presentation/batch.js.map +1 -1
  127. package/dist/presentation/communities.d.ts.map +1 -1
  128. package/dist/presentation/communities.js +38 -34
  129. package/dist/presentation/communities.js.map +1 -1
  130. package/dist/presentation/manifesto.d.ts.map +1 -1
  131. package/dist/presentation/manifesto.js +31 -33
  132. package/dist/presentation/manifesto.js.map +1 -1
  133. package/dist/presentation/queries-cli/inspect.d.ts.map +1 -1
  134. package/dist/presentation/queries-cli/inspect.js +47 -46
  135. package/dist/presentation/queries-cli/inspect.js.map +1 -1
  136. package/dist/presentation/structure.d.ts +1 -1
  137. package/dist/presentation/structure.d.ts.map +1 -1
  138. package/dist/presentation/structure.js +1 -1
  139. package/dist/presentation/structure.js.map +1 -1
  140. package/dist/shared/file-utils.d.ts.map +1 -1
  141. package/dist/shared/file-utils.js +94 -72
  142. package/dist/shared/file-utils.js.map +1 -1
  143. package/dist/shared/normalize.d.ts +12 -0
  144. package/dist/shared/normalize.d.ts.map +1 -1
  145. package/dist/shared/normalize.js +4 -0
  146. package/dist/shared/normalize.js.map +1 -1
  147. package/dist/types.d.ts +82 -1
  148. package/dist/types.d.ts.map +1 -1
  149. package/package.json +7 -7
  150. package/src/ast-analysis/engine.ts +99 -55
  151. package/src/ast-analysis/visitors/ast-store-visitor.ts +19 -21
  152. package/src/cli/commands/batch.ts +5 -26
  153. package/src/cli/commands/structure.ts +21 -1
  154. package/src/db/connection.ts +26 -7
  155. package/src/db/index.ts +2 -0
  156. package/src/db/repository/base.ts +43 -0
  157. package/src/db/repository/index.ts +1 -0
  158. package/src/db/repository/native-repository.ts +67 -1
  159. package/src/domain/analysis/context.ts +5 -15
  160. package/src/domain/analysis/dependencies.ts +19 -16
  161. package/src/domain/analysis/fn-impact.ts +2 -2
  162. package/src/domain/analysis/implementations.ts +3 -13
  163. package/src/domain/graph/builder/context.ts +4 -0
  164. package/src/domain/graph/builder/incremental.ts +21 -0
  165. package/src/domain/graph/builder/native-db-proxy.ts +98 -0
  166. package/src/domain/graph/builder/pipeline.ts +514 -416
  167. package/src/domain/graph/builder/stages/build-edges.ts +45 -3
  168. package/src/domain/graph/builder/stages/build-structure.ts +2 -2
  169. package/src/domain/graph/builder/stages/detect-changes.ts +11 -33
  170. package/src/domain/graph/builder/stages/finalize.ts +1 -1
  171. package/src/domain/graph/builder/stages/insert-nodes.ts +17 -14
  172. package/src/domain/graph/builder/stages/resolve-imports.ts +22 -23
  173. package/src/domain/graph/watcher.ts +118 -98
  174. package/src/domain/parser.ts +8 -2
  175. package/src/domain/queries.ts +1 -1
  176. package/src/extractors/go.ts +57 -32
  177. package/src/extractors/javascript.ts +67 -27
  178. package/src/features/audit.ts +3 -2
  179. package/src/features/boundaries.ts +3 -5
  180. package/src/features/branch-compare.ts +2 -3
  181. package/src/features/complexity.ts +94 -58
  182. package/src/features/dataflow.ts +153 -132
  183. package/src/features/flow.ts +2 -1
  184. package/src/features/manifesto.ts +15 -1
  185. package/src/features/structure.ts +167 -95
  186. package/src/graph/algorithms/louvain.ts +5 -2
  187. package/src/graph/classifiers/roles.ts +14 -5
  188. package/src/infrastructure/config.ts +1 -0
  189. package/src/presentation/batch.ts +1 -0
  190. package/src/presentation/communities.ts +44 -39
  191. package/src/presentation/manifesto.ts +35 -38
  192. package/src/presentation/queries-cli/inspect.ts +48 -46
  193. package/src/presentation/structure.ts +2 -2
  194. package/src/shared/file-utils.ts +116 -77
  195. package/src/shared/normalize.ts +10 -0
  196. package/src/types.ts +86 -0
@@ -23,6 +23,7 @@ import { hasDataflowTable, openReadonlyOrFail, openReadonlyWithNative } from '..
23
23
  import { ALL_SYMBOL_KINDS, normalizeSymbol } from '../domain/queries.js';
24
24
  import { debug, info } from '../infrastructure/logger.js';
25
25
  import { isTestFile } from '../infrastructure/test-filter.js';
26
+ import type { NormalizedSymbol } from '../shared/normalize.js';
26
27
  import { paginateResult } from '../shared/paginate.js';
27
28
  import type { BetterSqlite3Database, NativeDatabase, NodeRow, TreeSitterNode } from '../types.js';
28
29
  import { findNodes } from './shared/find-nodes.js';
@@ -438,85 +439,126 @@ function prepareDataflowStmts(db: BetterSqlite3Database): DataflowStmts {
438
439
  };
439
440
  }
440
441
 
441
- function buildNodeDataflowResult(
442
- node: NodeRow,
443
- stmts: DataflowStmts,
444
- db: BetterSqlite3Database,
445
- hc: Map<string, string | null>,
442
+ // ─── Shared dataflow result builder ──────────────────────────────────
443
+
444
+ /** Pre-mapped raw dataflow edge arrays shared between SQL and native paths. */
445
+ interface RawDataflowEdges {
446
+ flowsTo: {
447
+ target: string;
448
+ kind: string;
449
+ file: string;
450
+ line: number;
451
+ paramIndex: number;
452
+ expression: string;
453
+ confidence: number;
454
+ }[];
455
+ flowsFrom: {
456
+ source: string;
457
+ kind: string;
458
+ file: string;
459
+ line: number;
460
+ paramIndex: number;
461
+ expression: string;
462
+ confidence: number;
463
+ }[];
464
+ returnConsumers: {
465
+ consumer: string;
466
+ kind: string;
467
+ file: string;
468
+ line: number;
469
+ expression: string;
470
+ }[];
471
+ returnedBy: { producer: string; kind: string; file: string; line: number; expression: string }[];
472
+ mutatesTargets: { target: string; expression: string; line: number }[];
473
+ mutatedBy: { source: string; expression: string; line: number }[];
474
+ }
475
+
476
+ /**
477
+ * Build a unified dataflow result from pre-mapped edge data.
478
+ * Shared between the SQL and native code paths.
479
+ */
480
+ function buildDataflowResult(
481
+ sym: NormalizedSymbol,
482
+ edges: RawDataflowEdges,
446
483
  noTests: boolean,
447
484
  ): Record<string, unknown> {
448
- const sym = normalizeSymbol(node, db, hc);
449
-
450
- const flowsTo = stmts.flowsToOut.all(node.id).map((r: any) => ({
451
- target: r.target_name,
452
- kind: r.target_kind,
453
- file: r.target_file,
454
- line: r.line,
455
- paramIndex: r.param_index,
456
- expression: r.expression,
457
- confidence: r.confidence,
458
- }));
459
-
460
- const flowsFrom = stmts.flowsToIn.all(node.id).map((r: any) => ({
461
- source: r.source_name,
462
- kind: r.source_kind,
463
- file: r.source_file,
464
- line: r.line,
465
- paramIndex: r.param_index,
466
- expression: r.expression,
467
- confidence: r.confidence,
468
- }));
469
-
470
- const returnConsumers = stmts.returnsOut.all(node.id).map((r: any) => ({
471
- consumer: r.target_name,
472
- kind: r.target_kind,
473
- file: r.target_file,
474
- line: r.line,
475
- expression: r.expression,
476
- }));
477
-
478
- const returnedBy = stmts.returnsIn.all(node.id).map((r: any) => ({
479
- producer: r.source_name,
480
- kind: r.source_kind,
481
- file: r.source_file,
482
- line: r.line,
483
- expression: r.expression,
484
- }));
485
-
486
- const mutatesTargets = stmts.mutatesOut.all(node.id).map((r: any) => ({
487
- target: r.target_name,
488
- expression: r.expression,
489
- line: r.line,
490
- }));
491
-
492
- const mutatedBy = stmts.mutatesIn.all(node.id).map((r: any) => ({
493
- source: r.source_name,
494
- expression: r.expression,
495
- line: r.line,
496
- }));
497
-
498
485
  if (noTests) {
499
486
  const filter = (arr: any[]) => arr.filter((r: any) => !isTestFile(r.file));
500
487
  return {
501
488
  ...sym,
502
- flowsTo: filter(flowsTo),
503
- flowsFrom: filter(flowsFrom),
504
- returns: returnConsumers.filter((r) => !isTestFile(r.file)),
505
- returnedBy: returnedBy.filter((r) => !isTestFile(r.file)),
506
- mutates: mutatesTargets,
507
- mutatedBy,
489
+ flowsTo: filter(edges.flowsTo),
490
+ flowsFrom: filter(edges.flowsFrom),
491
+ returns: edges.returnConsumers.filter((r: any) => !isTestFile(r.file)),
492
+ returnedBy: edges.returnedBy.filter((r: any) => !isTestFile(r.file)),
493
+ mutates: edges.mutatesTargets,
494
+ mutatedBy: edges.mutatedBy,
508
495
  };
509
496
  }
510
497
 
511
498
  return {
512
499
  ...sym,
513
- flowsTo,
514
- flowsFrom,
515
- returns: returnConsumers,
516
- returnedBy,
517
- mutates: mutatesTargets,
518
- mutatedBy,
500
+ flowsTo: edges.flowsTo,
501
+ flowsFrom: edges.flowsFrom,
502
+ returns: edges.returnConsumers,
503
+ returnedBy: edges.returnedBy,
504
+ mutates: edges.mutatesTargets,
505
+ mutatedBy: edges.mutatedBy,
506
+ };
507
+ }
508
+
509
+ function buildNodeDataflowResult(
510
+ node: NodeRow,
511
+ stmts: DataflowStmts,
512
+ db: BetterSqlite3Database,
513
+ hc: Map<string, string | null>,
514
+ noTests: boolean,
515
+ ): Record<string, unknown> {
516
+ const sym = normalizeSymbol(node, db, hc);
517
+ const edges: RawDataflowEdges = {
518
+ flowsTo: stmts.flowsToOut.all(node.id).map((r: any) => ({
519
+ target: r.target_name,
520
+ kind: r.target_kind,
521
+ file: r.target_file,
522
+ line: r.line,
523
+ paramIndex: r.param_index,
524
+ expression: r.expression,
525
+ confidence: r.confidence,
526
+ })),
527
+ flowsFrom: stmts.flowsToIn.all(node.id).map((r: any) => ({
528
+ source: r.source_name,
529
+ kind: r.source_kind,
530
+ file: r.source_file,
531
+ line: r.line,
532
+ paramIndex: r.param_index,
533
+ expression: r.expression,
534
+ confidence: r.confidence,
535
+ })),
536
+ returnConsumers: stmts.returnsOut.all(node.id).map((r: any) => ({
537
+ consumer: r.target_name,
538
+ kind: r.target_kind,
539
+ file: r.target_file,
540
+ line: r.line,
541
+ expression: r.expression,
542
+ })),
543
+ returnedBy: stmts.returnsIn.all(node.id).map((r: any) => ({
544
+ producer: r.source_name,
545
+ kind: r.source_kind,
546
+ file: r.source_file,
547
+ line: r.line,
548
+ expression: r.expression,
549
+ })),
550
+ mutatesTargets: stmts.mutatesOut.all(node.id).map((r: any) => ({
551
+ target: r.target_name,
552
+ expression: r.expression,
553
+ line: r.line,
554
+ })),
555
+ mutatedBy: stmts.mutatesIn.all(node.id).map((r: any) => ({
556
+ source: r.source_name,
557
+ expression: r.expression,
558
+ line: r.line,
559
+ })),
519
560
  };
561
+ return buildDataflowResult(sym, edges, noTests);
520
562
  }
521
563
 
522
564
  function buildNativeDataflowResult(
@@ -528,72 +570,51 @@ function buildNativeDataflowResult(
528
570
  ): Record<string, unknown> {
529
571
  const sym = normalizeSymbol(node, db, hc);
530
572
  const d = nativeDb.getDataflowEdges!(node.id);
531
-
532
- const flowsTo = d.flowsToOut.map((r: any) => ({
533
- target: r.name,
534
- kind: r.kind,
535
- file: r.file,
536
- line: r.line,
537
- paramIndex: r.paramIndex,
538
- expression: r.expression,
539
- confidence: r.confidence,
540
- }));
541
- const flowsFrom = d.flowsToIn.map((r: any) => ({
542
- source: r.name,
543
- kind: r.kind,
544
- file: r.file,
545
- line: r.line,
546
- paramIndex: r.paramIndex,
547
- expression: r.expression,
548
- confidence: r.confidence,
549
- }));
550
- const returnConsumers = d.returnsOut.map((r: any) => ({
551
- consumer: r.name,
552
- kind: r.kind,
553
- file: r.file,
554
- line: r.line,
555
- expression: r.expression,
556
- }));
557
- const returnedBy = d.returnsIn.map((r: any) => ({
558
- producer: r.name,
559
- kind: r.kind,
560
- file: r.file,
561
- line: r.line,
562
- expression: r.expression,
563
- }));
564
- const mutatesTargets = d.mutatesOut.map((r: any) => ({
565
- target: r.name,
566
- expression: r.expression,
567
- line: r.line,
568
- }));
569
- const mutatedBy = d.mutatesIn.map((r: any) => ({
570
- source: r.name,
571
- expression: r.expression,
572
- line: r.line,
573
- }));
574
-
575
- if (noTests) {
576
- const filter = (arr: any[]) => arr.filter((r: any) => !isTestFile(r.file));
577
- return {
578
- ...sym,
579
- flowsTo: filter(flowsTo),
580
- flowsFrom: filter(flowsFrom),
581
- returns: returnConsumers.filter((r: any) => !isTestFile(r.file)),
582
- returnedBy: returnedBy.filter((r: any) => !isTestFile(r.file)),
583
- mutates: mutatesTargets,
584
- mutatedBy,
585
- };
586
- }
587
-
588
- return {
589
- ...sym,
590
- flowsTo,
591
- flowsFrom,
592
- returns: returnConsumers,
593
- returnedBy,
594
- mutates: mutatesTargets,
595
- mutatedBy,
573
+ const edges: RawDataflowEdges = {
574
+ flowsTo: d.flowsToOut.map((r: any) => ({
575
+ target: r.name,
576
+ kind: r.kind,
577
+ file: r.file,
578
+ line: r.line,
579
+ paramIndex: r.paramIndex,
580
+ expression: r.expression,
581
+ confidence: r.confidence,
582
+ })),
583
+ flowsFrom: d.flowsToIn.map((r: any) => ({
584
+ source: r.name,
585
+ kind: r.kind,
586
+ file: r.file,
587
+ line: r.line,
588
+ paramIndex: r.paramIndex,
589
+ expression: r.expression,
590
+ confidence: r.confidence,
591
+ })),
592
+ returnConsumers: d.returnsOut.map((r: any) => ({
593
+ consumer: r.name,
594
+ kind: r.kind,
595
+ file: r.file,
596
+ line: r.line,
597
+ expression: r.expression,
598
+ })),
599
+ returnedBy: d.returnsIn.map((r: any) => ({
600
+ producer: r.name,
601
+ kind: r.kind,
602
+ file: r.file,
603
+ line: r.line,
604
+ expression: r.expression,
605
+ })),
606
+ mutatesTargets: d.mutatesOut.map((r: any) => ({
607
+ target: r.name,
608
+ expression: r.expression,
609
+ line: r.line,
610
+ })),
611
+ mutatedBy: d.mutatesIn.map((r: any) => ({
612
+ source: r.name,
613
+ expression: r.expression,
614
+ line: r.line,
615
+ })),
596
616
  };
617
+ return buildDataflowResult(sym, edges, noTests);
597
618
  }
598
619
 
599
620
  export function dataflowData(
@@ -8,6 +8,7 @@
8
8
  import { openReadonlyOrFail } from '../db/index.js';
9
9
  import { CORE_SYMBOL_KINDS, findMatchingNodes } from '../domain/queries.js';
10
10
  import { isTestFile } from '../infrastructure/test-filter.js';
11
+ import { toSymbolRef } from '../shared/normalize.js';
11
12
  import { paginateResult } from '../shared/paginate.js';
12
13
  import { FRAMEWORK_ENTRY_PREFIXES } from './structure.js';
13
14
 
@@ -175,7 +176,7 @@ function bfsCallees(
175
176
 
176
177
  visited.add(c.id);
177
178
  nextFrontier.push(c.id);
178
- const nodeInfo: NodeInfo = { name: c.name, kind: c.kind, file: c.file, line: c.line };
179
+ const nodeInfo: NodeInfo = toSymbolRef(c);
179
180
  levelNodes.push(nodeInfo);
180
181
  nodeDepths.set(c.id, d);
181
182
  idToNode.set(c.id, nodeInfo);
@@ -5,6 +5,7 @@ import { loadConfig } from '../infrastructure/config.js';
5
5
  import { debug } from '../infrastructure/logger.js';
6
6
  import { paginateResult } from '../shared/paginate.js';
7
7
  import type { BetterSqlite3Database, CodegraphConfig, ThresholdRule } from '../types.js';
8
+ import type { BoundaryViolation } from './boundaries.js';
8
9
  import { evaluateBoundaries } from './boundaries.js';
9
10
 
10
11
  // ─── Rule Definitions ─────────────────────────────────────────────────
@@ -416,7 +417,20 @@ function evaluateBoundaryRules(
416
417
  return;
417
418
  }
418
419
 
419
- const result = evaluateBoundaries(db, boundaryConfig, { noTests: opts.noTests || false });
420
+ let result: { violations: BoundaryViolation[]; violationCount: number };
421
+ try {
422
+ result = evaluateBoundaries(db, boundaryConfig, { noTests: opts.noTests || false });
423
+ } catch (e: unknown) {
424
+ debug(`boundary check failed: ${(e as Error).message}`);
425
+ ruleResults.push({
426
+ name: 'boundaries',
427
+ level: 'graph',
428
+ status: 'warn',
429
+ thresholds: effectiveThresholds,
430
+ violationCount: 0,
431
+ });
432
+ return;
433
+ }
420
434
  const hasBoundaryViolations = result.violationCount > 0;
421
435
 
422
436
  if (!hasBoundaryViolations) {