@optave/codegraph 3.4.0 → 3.4.1

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 (410) hide show
  1. package/README.md +7 -7
  2. package/dist/ast-analysis/engine.d.ts.map +1 -1
  3. package/dist/ast-analysis/engine.js +3 -9
  4. package/dist/ast-analysis/engine.js.map +1 -1
  5. package/dist/ast-analysis/shared.d.ts.map +1 -1
  6. package/dist/ast-analysis/shared.js +0 -1
  7. package/dist/ast-analysis/shared.js.map +1 -1
  8. package/dist/ast-analysis/visitors/cfg-conditionals.d.ts +5 -0
  9. package/dist/ast-analysis/visitors/cfg-conditionals.d.ts.map +1 -0
  10. package/dist/ast-analysis/visitors/cfg-conditionals.js +166 -0
  11. package/dist/ast-analysis/visitors/cfg-conditionals.js.map +1 -0
  12. package/dist/ast-analysis/visitors/cfg-loops.d.ts +7 -0
  13. package/dist/ast-analysis/visitors/cfg-loops.d.ts.map +1 -0
  14. package/dist/ast-analysis/visitors/cfg-loops.js +73 -0
  15. package/dist/ast-analysis/visitors/cfg-loops.js.map +1 -0
  16. package/dist/ast-analysis/visitors/cfg-shared.d.ts +56 -0
  17. package/dist/ast-analysis/visitors/cfg-shared.d.ts.map +1 -0
  18. package/dist/ast-analysis/visitors/cfg-shared.js +107 -0
  19. package/dist/ast-analysis/visitors/cfg-shared.js.map +1 -0
  20. package/dist/ast-analysis/visitors/cfg-try-catch.d.ts +4 -0
  21. package/dist/ast-analysis/visitors/cfg-try-catch.d.ts.map +1 -0
  22. package/dist/ast-analysis/visitors/cfg-try-catch.js +100 -0
  23. package/dist/ast-analysis/visitors/cfg-try-catch.js.map +1 -0
  24. package/dist/ast-analysis/visitors/cfg-visitor.d.ts +2 -2
  25. package/dist/ast-analysis/visitors/cfg-visitor.d.ts.map +1 -1
  26. package/dist/ast-analysis/visitors/cfg-visitor.js +11 -445
  27. package/dist/ast-analysis/visitors/cfg-visitor.js.map +1 -1
  28. package/dist/ast-analysis/visitors/complexity-visitor.d.ts.map +1 -1
  29. package/dist/ast-analysis/visitors/complexity-visitor.js.map +1 -1
  30. package/dist/ast-analysis/visitors/dataflow-visitor.d.ts.map +1 -1
  31. package/dist/ast-analysis/visitors/dataflow-visitor.js.map +1 -1
  32. package/dist/cli/commands/batch.d.ts.map +1 -1
  33. package/dist/cli/commands/batch.js +4 -3
  34. package/dist/cli/commands/batch.js.map +1 -1
  35. package/dist/cli/commands/branch-compare.js +1 -1
  36. package/dist/cli/commands/branch-compare.js.map +1 -1
  37. package/dist/cli/commands/build.js +1 -1
  38. package/dist/cli/commands/build.js.map +1 -1
  39. package/dist/cli/commands/info.d.ts.map +1 -1
  40. package/dist/cli/commands/info.js +1 -2
  41. package/dist/cli/commands/info.js.map +1 -1
  42. package/dist/cli/commands/path.d.ts.map +1 -1
  43. package/dist/cli/commands/path.js +7 -2
  44. package/dist/cli/commands/path.js.map +1 -1
  45. package/dist/cli/commands/plot.d.ts.map +1 -1
  46. package/dist/cli/commands/plot.js +2 -2
  47. package/dist/cli/commands/plot.js.map +1 -1
  48. package/dist/cli/commands/watch.js +1 -1
  49. package/dist/cli/commands/watch.js.map +1 -1
  50. package/dist/cli/index.js +2 -2
  51. package/dist/cli/index.js.map +1 -1
  52. package/dist/cli/shared/open-graph.d.ts +2 -2
  53. package/dist/cli/shared/open-graph.d.ts.map +1 -1
  54. package/dist/cli/shared/open-graph.js.map +1 -1
  55. package/dist/cli/types.d.ts +1 -1
  56. package/dist/cli/types.d.ts.map +1 -1
  57. package/dist/cli.js +2 -3
  58. package/dist/cli.js.map +1 -1
  59. package/dist/db/connection.d.ts +17 -0
  60. package/dist/db/connection.d.ts.map +1 -1
  61. package/dist/db/connection.js +91 -2
  62. package/dist/db/connection.js.map +1 -1
  63. package/dist/db/index.d.ts +1 -1
  64. package/dist/db/index.d.ts.map +1 -1
  65. package/dist/db/index.js +1 -1
  66. package/dist/db/index.js.map +1 -1
  67. package/dist/db/migrations.d.ts.map +1 -1
  68. package/dist/db/migrations.js +7 -0
  69. package/dist/db/migrations.js.map +1 -1
  70. package/dist/domain/analysis/brief.d.ts.map +1 -1
  71. package/dist/domain/analysis/brief.js +1 -3
  72. package/dist/domain/analysis/brief.js.map +1 -1
  73. package/dist/domain/analysis/context.d.ts.map +1 -1
  74. package/dist/domain/analysis/context.js +2 -4
  75. package/dist/domain/analysis/context.js.map +1 -1
  76. package/dist/domain/analysis/dependencies.d.ts +49 -0
  77. package/dist/domain/analysis/dependencies.d.ts.map +1 -1
  78. package/dist/domain/analysis/dependencies.js +145 -0
  79. package/dist/domain/analysis/dependencies.js.map +1 -1
  80. package/dist/domain/analysis/diff-impact.d.ts +76 -0
  81. package/dist/domain/analysis/diff-impact.d.ts.map +1 -0
  82. package/dist/domain/analysis/diff-impact.js +282 -0
  83. package/dist/domain/analysis/diff-impact.js.map +1 -0
  84. package/dist/domain/analysis/exports.d.ts.map +1 -1
  85. package/dist/domain/analysis/exports.js +0 -1
  86. package/dist/domain/analysis/exports.js.map +1 -1
  87. package/dist/domain/analysis/fn-impact.d.ts +66 -0
  88. package/dist/domain/analysis/fn-impact.d.ts.map +1 -0
  89. package/dist/domain/analysis/fn-impact.js +189 -0
  90. package/dist/domain/analysis/fn-impact.js.map +1 -0
  91. package/dist/domain/analysis/impact.d.ts +8 -148
  92. package/dist/domain/analysis/impact.d.ts.map +1 -1
  93. package/dist/domain/analysis/impact.js +8 -568
  94. package/dist/domain/analysis/impact.js.map +1 -1
  95. package/dist/domain/analysis/module-map.d.ts.map +1 -1
  96. package/dist/domain/analysis/module-map.js +1 -3
  97. package/dist/domain/analysis/module-map.js.map +1 -1
  98. package/dist/domain/graph/builder/context.d.ts +2 -3
  99. package/dist/domain/graph/builder/context.d.ts.map +1 -1
  100. package/dist/domain/graph/builder/context.js.map +1 -1
  101. package/dist/domain/graph/builder/helpers.d.ts +4 -5
  102. package/dist/domain/graph/builder/helpers.d.ts.map +1 -1
  103. package/dist/domain/graph/builder/helpers.js +1 -2
  104. package/dist/domain/graph/builder/helpers.js.map +1 -1
  105. package/dist/domain/graph/builder/incremental.d.ts +2 -3
  106. package/dist/domain/graph/builder/incremental.d.ts.map +1 -1
  107. package/dist/domain/graph/builder/incremental.js.map +1 -1
  108. package/dist/domain/graph/builder/pipeline.d.ts.map +1 -1
  109. package/dist/domain/graph/builder/pipeline.js +6 -0
  110. package/dist/domain/graph/builder/pipeline.js.map +1 -1
  111. package/dist/domain/graph/builder/stages/build-edges.d.ts.map +1 -1
  112. package/dist/domain/graph/builder/stages/build-edges.js +12 -2
  113. package/dist/domain/graph/builder/stages/build-edges.js.map +1 -1
  114. package/dist/domain/graph/builder/stages/build-structure.d.ts.map +1 -1
  115. package/dist/domain/graph/builder/stages/build-structure.js +155 -59
  116. package/dist/domain/graph/builder/stages/build-structure.js.map +1 -1
  117. package/dist/domain/graph/builder/stages/detect-changes.d.ts.map +1 -1
  118. package/dist/domain/graph/builder/stages/detect-changes.js +6 -6
  119. package/dist/domain/graph/builder/stages/detect-changes.js.map +1 -1
  120. package/dist/domain/graph/builder/stages/finalize.d.ts.map +1 -1
  121. package/dist/domain/graph/builder/stages/finalize.js +85 -61
  122. package/dist/domain/graph/builder/stages/finalize.js.map +1 -1
  123. package/dist/domain/graph/builder/stages/insert-nodes.d.ts.map +1 -1
  124. package/dist/domain/graph/builder/stages/insert-nodes.js.map +1 -1
  125. package/dist/domain/graph/builder/stages/resolve-imports.d.ts.map +1 -1
  126. package/dist/domain/graph/builder/stages/resolve-imports.js +58 -11
  127. package/dist/domain/graph/builder/stages/resolve-imports.js.map +1 -1
  128. package/dist/domain/graph/cycles.js +2 -2
  129. package/dist/domain/graph/cycles.js.map +1 -1
  130. package/dist/domain/graph/resolve.d.ts.map +1 -1
  131. package/dist/domain/graph/resolve.js +10 -8
  132. package/dist/domain/graph/resolve.js.map +1 -1
  133. package/dist/domain/graph/watcher.d.ts.map +1 -1
  134. package/dist/domain/graph/watcher.js +1 -3
  135. package/dist/domain/graph/watcher.js.map +1 -1
  136. package/dist/domain/parser.d.ts.map +1 -1
  137. package/dist/domain/parser.js +11 -12
  138. package/dist/domain/parser.js.map +1 -1
  139. package/dist/domain/queries.d.ts +3 -2
  140. package/dist/domain/queries.d.ts.map +1 -1
  141. package/dist/domain/queries.js +3 -2
  142. package/dist/domain/queries.js.map +1 -1
  143. package/dist/domain/search/generator.d.ts.map +1 -1
  144. package/dist/domain/search/generator.js.map +1 -1
  145. package/dist/extractors/csharp.js +2 -2
  146. package/dist/extractors/csharp.js.map +1 -1
  147. package/dist/extractors/go.js +2 -2
  148. package/dist/extractors/go.js.map +1 -1
  149. package/dist/extractors/helpers.d.ts +5 -0
  150. package/dist/extractors/helpers.d.ts.map +1 -1
  151. package/dist/extractors/helpers.js +5 -0
  152. package/dist/extractors/helpers.js.map +1 -1
  153. package/dist/extractors/javascript.js +58 -60
  154. package/dist/extractors/javascript.js.map +1 -1
  155. package/dist/extractors/php.js +2 -2
  156. package/dist/extractors/php.js.map +1 -1
  157. package/dist/extractors/python.js +2 -2
  158. package/dist/extractors/python.js.map +1 -1
  159. package/dist/extractors/rust.js +2 -2
  160. package/dist/extractors/rust.js.map +1 -1
  161. package/dist/features/audit.d.ts.map +1 -1
  162. package/dist/features/audit.js +1 -2
  163. package/dist/features/audit.js.map +1 -1
  164. package/dist/features/branch-compare.d.ts.map +1 -1
  165. package/dist/features/branch-compare.js +2 -3
  166. package/dist/features/branch-compare.js.map +1 -1
  167. package/dist/features/cfg.d.ts.map +1 -1
  168. package/dist/features/cfg.js +2 -4
  169. package/dist/features/cfg.js.map +1 -1
  170. package/dist/features/cochange.js +4 -4
  171. package/dist/features/cochange.js.map +1 -1
  172. package/dist/features/communities.js +4 -4
  173. package/dist/features/communities.js.map +1 -1
  174. package/dist/features/complexity-query.d.ts +37 -0
  175. package/dist/features/complexity-query.d.ts.map +1 -0
  176. package/dist/features/complexity-query.js +263 -0
  177. package/dist/features/complexity-query.js.map +1 -0
  178. package/dist/features/complexity.d.ts +2 -30
  179. package/dist/features/complexity.d.ts.map +1 -1
  180. package/dist/features/complexity.js +7 -261
  181. package/dist/features/complexity.js.map +1 -1
  182. package/dist/features/dataflow.d.ts.map +1 -1
  183. package/dist/features/dataflow.js +8 -24
  184. package/dist/features/dataflow.js.map +1 -1
  185. package/dist/features/export.d.ts +7 -8
  186. package/dist/features/export.d.ts.map +1 -1
  187. package/dist/features/export.js.map +1 -1
  188. package/dist/features/flow.d.ts.map +1 -1
  189. package/dist/features/flow.js.map +1 -1
  190. package/dist/features/graph-enrichment.d.ts.map +1 -1
  191. package/dist/features/graph-enrichment.js +1 -3
  192. package/dist/features/graph-enrichment.js.map +1 -1
  193. package/dist/features/manifesto.js +8 -8
  194. package/dist/features/manifesto.js.map +1 -1
  195. package/dist/features/snapshot.d.ts.map +1 -1
  196. package/dist/features/snapshot.js +0 -1
  197. package/dist/features/snapshot.js.map +1 -1
  198. package/dist/features/structure-query.d.ts +76 -0
  199. package/dist/features/structure-query.d.ts.map +1 -0
  200. package/dist/features/structure-query.js +245 -0
  201. package/dist/features/structure-query.js.map +1 -0
  202. package/dist/features/structure.d.ts +12 -67
  203. package/dist/features/structure.d.ts.map +1 -1
  204. package/dist/features/structure.js +188 -244
  205. package/dist/features/structure.js.map +1 -1
  206. package/dist/features/triage.js +2 -2
  207. package/dist/features/triage.js.map +1 -1
  208. package/dist/graph/algorithms/leiden/adapter.d.ts.map +1 -1
  209. package/dist/graph/algorithms/leiden/adapter.js +2 -9
  210. package/dist/graph/algorithms/leiden/adapter.js.map +1 -1
  211. package/dist/graph/classifiers/roles.d.ts +5 -1
  212. package/dist/graph/classifiers/roles.d.ts.map +1 -1
  213. package/dist/graph/classifiers/roles.js +20 -12
  214. package/dist/graph/classifiers/roles.js.map +1 -1
  215. package/dist/index.d.ts +1 -0
  216. package/dist/index.d.ts.map +1 -1
  217. package/dist/index.js.map +1 -1
  218. package/dist/infrastructure/config.d.ts.map +1 -1
  219. package/dist/infrastructure/config.js +12 -11
  220. package/dist/infrastructure/config.js.map +1 -1
  221. package/dist/infrastructure/native.d.ts.map +1 -1
  222. package/dist/infrastructure/native.js +7 -3
  223. package/dist/infrastructure/native.js.map +1 -1
  224. package/dist/infrastructure/registry.d.ts.map +1 -1
  225. package/dist/infrastructure/registry.js +1 -1
  226. package/dist/infrastructure/registry.js.map +1 -1
  227. package/dist/infrastructure/update-check.js +3 -3
  228. package/dist/infrastructure/update-check.js.map +1 -1
  229. package/dist/mcp/server.d.ts.map +1 -1
  230. package/dist/mcp/server.js +2 -8
  231. package/dist/mcp/server.js.map +1 -1
  232. package/dist/mcp/tool-registry.d.ts.map +1 -1
  233. package/dist/mcp/tool-registry.js +9 -4
  234. package/dist/mcp/tool-registry.js.map +1 -1
  235. package/dist/mcp/tools/audit.js +1 -1
  236. package/dist/mcp/tools/audit.js.map +1 -1
  237. package/dist/mcp/tools/cfg.js +1 -1
  238. package/dist/mcp/tools/cfg.js.map +1 -1
  239. package/dist/mcp/tools/check.js +2 -2
  240. package/dist/mcp/tools/check.js.map +1 -1
  241. package/dist/mcp/tools/dataflow.js +2 -2
  242. package/dist/mcp/tools/dataflow.js.map +1 -1
  243. package/dist/mcp/tools/export-graph.js +1 -1
  244. package/dist/mcp/tools/export-graph.js.map +1 -1
  245. package/dist/mcp/tools/index.d.ts.map +1 -1
  246. package/dist/mcp/tools/index.js.map +1 -1
  247. package/dist/mcp/tools/path.d.ts +1 -0
  248. package/dist/mcp/tools/path.d.ts.map +1 -1
  249. package/dist/mcp/tools/path.js +9 -0
  250. package/dist/mcp/tools/path.js.map +1 -1
  251. package/dist/mcp/tools/query.js +1 -1
  252. package/dist/mcp/tools/query.js.map +1 -1
  253. package/dist/mcp/tools/semantic-search.js +1 -1
  254. package/dist/mcp/tools/semantic-search.js.map +1 -1
  255. package/dist/mcp/tools/sequence.js +1 -1
  256. package/dist/mcp/tools/sequence.js.map +1 -1
  257. package/dist/mcp/tools/symbol-children.js +1 -1
  258. package/dist/mcp/tools/symbol-children.js.map +1 -1
  259. package/dist/mcp/tools/triage.js +1 -1
  260. package/dist/mcp/tools/triage.js.map +1 -1
  261. package/dist/presentation/audit.d.ts.map +1 -1
  262. package/dist/presentation/audit.js +0 -1
  263. package/dist/presentation/audit.js.map +1 -1
  264. package/dist/presentation/diff-impact-mermaid.d.ts +11 -0
  265. package/dist/presentation/diff-impact-mermaid.d.ts.map +1 -0
  266. package/dist/presentation/diff-impact-mermaid.js +105 -0
  267. package/dist/presentation/diff-impact-mermaid.js.map +1 -0
  268. package/dist/presentation/flow.d.ts.map +1 -1
  269. package/dist/presentation/flow.js +0 -2
  270. package/dist/presentation/flow.js.map +1 -1
  271. package/dist/presentation/manifesto.d.ts.map +1 -1
  272. package/dist/presentation/manifesto.js +0 -1
  273. package/dist/presentation/manifesto.js.map +1 -1
  274. package/dist/presentation/queries-cli/inspect.d.ts.map +1 -1
  275. package/dist/presentation/queries-cli/inspect.js.map +1 -1
  276. package/dist/presentation/queries-cli/path.d.ts.map +1 -1
  277. package/dist/presentation/queries-cli/path.js +45 -1
  278. package/dist/presentation/queries-cli/path.js.map +1 -1
  279. package/dist/presentation/result-formatter.d.ts.map +1 -1
  280. package/dist/presentation/result-formatter.js +1 -3
  281. package/dist/presentation/result-formatter.js.map +1 -1
  282. package/dist/presentation/sequence.d.ts.map +1 -1
  283. package/dist/presentation/sequence.js +0 -1
  284. package/dist/presentation/sequence.js.map +1 -1
  285. package/dist/presentation/structure.d.ts.map +1 -1
  286. package/dist/presentation/structure.js.map +1 -1
  287. package/dist/presentation/triage.d.ts.map +1 -1
  288. package/dist/presentation/triage.js +0 -1
  289. package/dist/presentation/triage.js.map +1 -1
  290. package/dist/shared/constants.d.ts +9 -3
  291. package/dist/shared/constants.d.ts.map +1 -1
  292. package/dist/shared/constants.js +6 -3
  293. package/dist/shared/constants.js.map +1 -1
  294. package/dist/shared/errors.d.ts +2 -0
  295. package/dist/shared/errors.d.ts.map +1 -1
  296. package/dist/shared/errors.js +4 -0
  297. package/dist/shared/errors.js.map +1 -1
  298. package/dist/shared/version.d.ts +2 -0
  299. package/dist/shared/version.d.ts.map +1 -0
  300. package/dist/shared/version.js +5 -0
  301. package/dist/shared/version.js.map +1 -0
  302. package/dist/types.d.ts +2 -2
  303. package/dist/types.d.ts.map +1 -1
  304. package/package.json +8 -7
  305. package/src/ast-analysis/engine.ts +3 -9
  306. package/src/ast-analysis/shared.ts +0 -1
  307. package/src/ast-analysis/visitors/cfg-conditionals.ts +227 -0
  308. package/src/ast-analysis/visitors/cfg-loops.ts +136 -0
  309. package/src/ast-analysis/visitors/cfg-shared.ts +196 -0
  310. package/src/ast-analysis/visitors/cfg-try-catch.ts +142 -0
  311. package/src/ast-analysis/visitors/cfg-visitor.ts +34 -655
  312. package/src/ast-analysis/visitors/complexity-visitor.ts +0 -1
  313. package/src/ast-analysis/visitors/dataflow-visitor.ts +0 -1
  314. package/src/cli/commands/batch.ts +4 -3
  315. package/src/cli/commands/branch-compare.ts +1 -1
  316. package/src/cli/commands/build.ts +1 -1
  317. package/src/cli/commands/info.ts +1 -2
  318. package/src/cli/commands/path.ts +7 -2
  319. package/src/cli/commands/plot.ts +2 -2
  320. package/src/cli/commands/watch.ts +1 -1
  321. package/src/cli/index.ts +2 -2
  322. package/src/cli/shared/open-graph.ts +2 -2
  323. package/src/cli/types.ts +1 -1
  324. package/src/cli.ts +2 -3
  325. package/src/db/connection.ts +97 -13
  326. package/src/db/index.ts +2 -0
  327. package/src/db/migrations.ts +7 -0
  328. package/src/domain/analysis/brief.ts +0 -1
  329. package/src/domain/analysis/context.ts +2 -6
  330. package/src/domain/analysis/dependencies.ts +165 -0
  331. package/src/domain/analysis/diff-impact.ts +354 -0
  332. package/src/domain/analysis/exports.ts +0 -2
  333. package/src/domain/analysis/fn-impact.ts +241 -0
  334. package/src/domain/analysis/impact.ts +8 -718
  335. package/src/domain/analysis/module-map.ts +1 -5
  336. package/src/domain/graph/builder/context.ts +2 -2
  337. package/src/domain/graph/builder/helpers.ts +14 -11
  338. package/src/domain/graph/builder/incremental.ts +33 -28
  339. package/src/domain/graph/builder/pipeline.ts +8 -0
  340. package/src/domain/graph/builder/stages/build-edges.ts +17 -4
  341. package/src/domain/graph/builder/stages/build-structure.ts +205 -76
  342. package/src/domain/graph/builder/stages/detect-changes.ts +11 -12
  343. package/src/domain/graph/builder/stages/finalize.ts +100 -81
  344. package/src/domain/graph/builder/stages/insert-nodes.ts +12 -8
  345. package/src/domain/graph/builder/stages/resolve-imports.ts +75 -10
  346. package/src/domain/graph/cycles.ts +2 -2
  347. package/src/domain/graph/resolve.ts +14 -8
  348. package/src/domain/graph/watcher.ts +2 -4
  349. package/src/domain/parser.ts +11 -13
  350. package/src/domain/queries.ts +2 -2
  351. package/src/domain/search/generator.ts +3 -4
  352. package/src/extractors/csharp.ts +2 -2
  353. package/src/extractors/go.ts +2 -2
  354. package/src/extractors/helpers.ts +6 -0
  355. package/src/extractors/javascript.ts +58 -61
  356. package/src/extractors/php.ts +2 -2
  357. package/src/extractors/python.ts +2 -2
  358. package/src/extractors/rust.ts +2 -2
  359. package/src/features/audit.ts +1 -2
  360. package/src/features/branch-compare.ts +3 -9
  361. package/src/features/cfg.ts +2 -4
  362. package/src/features/cochange.ts +4 -4
  363. package/src/features/communities.ts +4 -4
  364. package/src/features/complexity-query.ts +370 -0
  365. package/src/features/complexity.ts +6 -365
  366. package/src/features/dataflow.ts +48 -70
  367. package/src/features/export.ts +12 -16
  368. package/src/features/flow.ts +0 -1
  369. package/src/features/graph-enrichment.ts +1 -3
  370. package/src/features/manifesto.ts +8 -8
  371. package/src/features/snapshot.ts +1 -2
  372. package/src/features/structure-query.ts +387 -0
  373. package/src/features/structure.ts +231 -376
  374. package/src/features/triage.ts +2 -2
  375. package/src/graph/algorithms/leiden/adapter.ts +2 -9
  376. package/src/graph/classifiers/roles.ts +22 -13
  377. package/src/index.ts +1 -0
  378. package/src/infrastructure/config.ts +12 -13
  379. package/src/infrastructure/native.ts +7 -3
  380. package/src/infrastructure/registry.ts +1 -1
  381. package/src/infrastructure/update-check.ts +3 -3
  382. package/src/mcp/server.ts +2 -10
  383. package/src/mcp/tool-registry.ts +11 -4
  384. package/src/mcp/tools/audit.ts +1 -1
  385. package/src/mcp/tools/cfg.ts +1 -1
  386. package/src/mcp/tools/check.ts +2 -2
  387. package/src/mcp/tools/dataflow.ts +2 -2
  388. package/src/mcp/tools/export-graph.ts +1 -1
  389. package/src/mcp/tools/index.ts +0 -1
  390. package/src/mcp/tools/path.ts +10 -0
  391. package/src/mcp/tools/query.ts +1 -1
  392. package/src/mcp/tools/semantic-search.ts +1 -1
  393. package/src/mcp/tools/sequence.ts +1 -1
  394. package/src/mcp/tools/symbol-children.ts +1 -1
  395. package/src/mcp/tools/triage.ts +1 -1
  396. package/src/presentation/audit.ts +0 -1
  397. package/src/presentation/diff-impact-mermaid.ts +127 -0
  398. package/src/presentation/flow.ts +0 -2
  399. package/src/presentation/manifesto.ts +0 -1
  400. package/src/presentation/queries-cli/inspect.ts +0 -1
  401. package/src/presentation/queries-cli/path.ts +71 -1
  402. package/src/presentation/result-formatter.ts +0 -1
  403. package/src/presentation/sequence.ts +0 -1
  404. package/src/presentation/structure.ts +0 -12
  405. package/src/presentation/triage.ts +0 -1
  406. package/src/shared/constants.ts +33 -19
  407. package/src/shared/errors.ts +5 -0
  408. package/src/shared/version.ts +10 -0
  409. package/src/types.ts +4 -10
  410. package/src/vendor.d.ts +0 -39
@@ -5,6 +5,7 @@ import type { Tree } from 'web-tree-sitter';
5
5
  import { Language, Parser, Query } from 'web-tree-sitter';
6
6
  import { debug, warn } from '../infrastructure/logger.js';
7
7
  import { getNative, getNativePackageVersion, loadNative } from '../infrastructure/native.js';
8
+ import { toErrorMessage } from '../shared/errors.js';
8
9
  import type {
9
10
  EngineMode,
10
11
  ExtractorOutput,
@@ -69,7 +70,6 @@ interface ParseEngineOpts {
69
70
 
70
71
  interface ResolvedEngine {
71
72
  name: 'native' | 'wasm';
72
- // biome-ignore lint/suspicious/noExplicitAny: native addon has no type declarations
73
73
  native: any;
74
74
  }
75
75
 
@@ -171,7 +171,6 @@ export function disposeParsers(): void {
171
171
  _queryCache.clear();
172
172
  if (_cachedLanguages) {
173
173
  for (const [id, lang] of _cachedLanguages) {
174
- // biome-ignore lint/suspicious/noExplicitAny: .delete() exists at runtime on WASM Language objects but is missing from typings
175
174
  if (lang && typeof (lang as any).delete === 'function') {
176
175
  try {
177
176
  (lang as any).delete();
@@ -197,7 +196,6 @@ export function getParser(parsers: Map<string, Parser | null>, filePath: string)
197
196
  * don't each need to create parsers and re-parse independently.
198
197
  * Only parses files whose extension is in SUPPORTED_EXTENSIONS.
199
198
  */
200
- // biome-ignore lint/suspicious/noExplicitAny: fileSymbols values have dynamic shape from extractors
201
199
  export async function ensureWasmTrees(
202
200
  fileSymbols: Map<string, any>,
203
201
  rootDir: string,
@@ -274,7 +272,6 @@ function resolveEngine(opts: ParseEngineOpts = {}): ResolvedEngine {
274
272
  * - Backward compat for older native binaries missing js_name annotations
275
273
  * - dataflow argFlows/mutations bindingType -> binding wrapper
276
274
  */
277
- // biome-ignore lint/suspicious/noExplicitAny: native addon result has no type declarations
278
275
  function patchNativeResult(r: any): ExtractorOutput {
279
276
  // lineCount: napi(js_name) emits "lineCount"; older binaries may emit "line_count"
280
277
  r.lineCount = r.lineCount ?? r.line_count ?? null;
@@ -433,7 +430,6 @@ export const SUPPORTED_EXTENSIONS: Set<string> = new Set(_extToLang.keys());
433
430
  * matches inside comments and string literals.
434
431
  * TODO: Remove once all published native binaries include typeMap extraction (>= 3.2.0)
435
432
  */
436
- // biome-ignore lint/suspicious/noExplicitAny: return shape matches native result typeMap
437
433
  async function backfillTypeMap(
438
434
  filePath: string,
439
435
  source?: string,
@@ -442,7 +438,8 @@ async function backfillTypeMap(
442
438
  if (!code) {
443
439
  try {
444
440
  code = fs.readFileSync(filePath, 'utf-8');
445
- } catch {
441
+ } catch (e) {
442
+ debug(`backfillTypeMap: failed to read ${filePath}: ${toErrorMessage(e)}`);
446
443
  return { typeMap: new Map(), backfilled: false };
447
444
  }
448
445
  }
@@ -458,7 +455,9 @@ async function backfillTypeMap(
458
455
  if (extracted?.tree && typeof extracted.tree.delete === 'function') {
459
456
  try {
460
457
  extracted.tree.delete();
461
- } catch {}
458
+ } catch (e) {
459
+ debug(`backfillTypeMap: WASM tree cleanup failed: ${toErrorMessage(e)}`);
460
+ }
462
461
  }
463
462
  }
464
463
  }
@@ -488,7 +487,6 @@ function wasmExtractSymbols(
488
487
  if (!entry) return null;
489
488
  const query = _queryCache.get(entry.id) ?? undefined;
490
489
  // Query (web-tree-sitter) is structurally compatible with TreeSitterQuery at runtime
491
- // biome-ignore lint/suspicious/noExplicitAny: thin WASM wrapper type mismatch
492
490
  const symbols = entry.extractor(tree as any, filePath, query as any);
493
491
  return symbols ? { symbols, tree, langId: entry.id } : null;
494
492
  }
@@ -571,14 +569,16 @@ export async function parseFilesAuto(
571
569
  symbols.typeMap = extracted.symbols.typeMap;
572
570
  symbols._typeMapBackfilled = true;
573
571
  }
574
- } catch {
575
- /* skip — typeMap is a best-effort backfill */
572
+ } catch (e) {
573
+ debug(`batchExtract: typeMap backfill failed: ${toErrorMessage(e)}`);
576
574
  } finally {
577
575
  // Free the WASM tree to prevent memory accumulation across repeated builds
578
576
  if (extracted?.tree && typeof extracted.tree.delete === 'function') {
579
577
  try {
580
578
  extracted.tree.delete();
581
- } catch {}
579
+ } catch (e) {
580
+ debug(`batchExtract: WASM tree cleanup failed: ${toErrorMessage(e)}`);
581
+ }
582
582
  }
583
583
  }
584
584
  }
@@ -638,7 +638,6 @@ export function getActiveEngine(opts: ParseEngineOpts = {}): {
638
638
  * Create a native ParseTreeCache for incremental parsing.
639
639
  * Returns null if the native engine is unavailable (WASM fallback).
640
640
  */
641
- // biome-ignore lint/suspicious/noExplicitAny: native ParseTreeCache has no type declarations
642
641
  export function createParseTreeCache(): any {
643
642
  const native = loadNative();
644
643
  if (!native || !native.ParseTreeCache) return null;
@@ -648,7 +647,6 @@ export function createParseTreeCache(): any {
648
647
  /**
649
648
  * Parse a file incrementally using the cache, or fall back to full parse.
650
649
  */
651
- // biome-ignore lint/suspicious/noExplicitAny: cache is native ParseTreeCache with no type declarations
652
650
  export async function parseFileIncremental(
653
651
  cache: any,
654
652
  filePath: string,
@@ -8,6 +8,7 @@
8
8
 
9
9
  // ── Re-export from dedicated module for backward compat ───────────────────
10
10
  export { isTestFile, TEST_PATTERN } from '../infrastructure/test-filter.js';
11
+ export { diffImpactMermaid } from '../presentation/diff-impact-mermaid.js';
11
12
  export { iterListFunctions, iterRoles, iterWhere } from '../shared/generators.js';
12
13
  // ── Kind/edge constants (canonical source: kinds.js) ─────────────────────
13
14
  export {
@@ -24,11 +25,10 @@ export {
24
25
  export { kindIcon, normalizeSymbol } from '../shared/normalize.js';
25
26
  export { briefData } from './analysis/brief.js';
26
27
  export { contextData, explainData } from './analysis/context.js';
27
- export { fileDepsData, fnDepsData, pathData } from './analysis/dependencies.js';
28
+ export { fileDepsData, filePathData, fnDepsData, pathData } from './analysis/dependencies.js';
28
29
  export { exportsData } from './analysis/exports.js';
29
30
  export {
30
31
  diffImpactData,
31
- diffImpactMermaid,
32
32
  fnImpactData,
33
33
  impactAnalysisData,
34
34
  } from './analysis/impact.js';
@@ -1,10 +1,9 @@
1
1
  import fs from 'node:fs';
2
2
  import path from 'node:path';
3
- import type BetterSqlite3 from 'better-sqlite3';
4
3
  import { closeDb, findDbPath, openDb } from '../../db/index.js';
5
4
  import { warn } from '../../infrastructure/logger.js';
6
5
  import { DbError } from '../../shared/errors.js';
7
- import type { NodeRow } from '../../types.js';
6
+ import type { BetterSqlite3Database, NodeRow } from '../../types.js';
8
7
  import { embed, getModelConfig } from './models.js';
9
8
  import { buildSourceText } from './strategies/source.js';
10
9
  import { buildStructuredText } from './strategies/structured.js';
@@ -17,7 +16,7 @@ export function estimateTokens(text: string): number {
17
16
  return Math.ceil(text.length / 4);
18
17
  }
19
18
 
20
- function initEmbeddingsSchema(db: BetterSqlite3.Database): void {
19
+ function initEmbeddingsSchema(db: BetterSqlite3Database): void {
21
20
  db.exec(`
22
21
  CREATE TABLE IF NOT EXISTS embeddings (
23
22
  node_id INTEGER PRIMARY KEY,
@@ -71,7 +70,7 @@ export async function buildEmbeddings(
71
70
  );
72
71
  }
73
72
 
74
- const db = openDb(dbPath) as BetterSqlite3.Database;
73
+ const db = openDb(dbPath) as BetterSqlite3Database;
75
74
  initEmbeddingsSchema(db);
76
75
 
77
76
  db.exec('DELETE FROM embeddings');
@@ -6,7 +6,7 @@ import type {
6
6
  TreeSitterNode,
7
7
  TreeSitterTree,
8
8
  } from '../types.js';
9
- import { extractModifierVisibility, findChild, nodeEndLine } from './helpers.js';
9
+ import { extractModifierVisibility, findChild, MAX_WALK_DEPTH, nodeEndLine } from './helpers.js';
10
10
 
11
11
  /**
12
12
  * Extract symbols from C# files.
@@ -333,7 +333,7 @@ function extractCSharpTypeMapDepth(
333
333
  ctx: ExtractorOutput,
334
334
  depth: number,
335
335
  ): void {
336
- if (depth >= 200) return;
336
+ if (depth >= MAX_WALK_DEPTH) return;
337
337
 
338
338
  // local_declaration_statement → variable_declaration → type + variable_declarator(s)
339
339
  if (node.type === 'variable_declaration') {
@@ -6,7 +6,7 @@ import type {
6
6
  TreeSitterTree,
7
7
  TypeMapEntry,
8
8
  } from '../types.js';
9
- import { findChild, goVisibility, nodeEndLine } from './helpers.js';
9
+ import { findChild, goVisibility, MAX_WALK_DEPTH, nodeEndLine } from './helpers.js';
10
10
 
11
11
  /**
12
12
  * Extract symbols from Go files.
@@ -233,7 +233,7 @@ function setIfHigher(
233
233
  }
234
234
 
235
235
  function extractGoTypeMapDepth(node: TreeSitterNode, ctx: ExtractorOutput, depth: number): void {
236
- if (depth >= 200) return;
236
+ if (depth >= MAX_WALK_DEPTH) return;
237
237
 
238
238
  // var x MyType = ... or var x, y MyType → var_declaration > var_spec (confidence 0.9)
239
239
  if (node.type === 'var_spec') {
@@ -1,5 +1,11 @@
1
1
  import type { TreeSitterNode } from '../types.js';
2
2
 
3
+ /**
4
+ * Maximum recursion depth for tree-sitter AST walkers.
5
+ * Shared across all language extractors to prevent stack overflow on deeply nested ASTs.
6
+ */
7
+ export const MAX_WALK_DEPTH = 200;
8
+
3
9
  export function nodeEndLine(node: TreeSitterNode): number {
4
10
  return node.endPosition.row + 1;
5
11
  }
@@ -12,7 +12,7 @@ import type {
12
12
  TreeSitterTree,
13
13
  TypeMapEntry,
14
14
  } from '../types.js';
15
- import { findChild, nodeEndLine } from './helpers.js';
15
+ import { findChild, MAX_WALK_DEPTH, nodeEndLine } from './helpers.js';
16
16
 
17
17
  /** Built-in globals that start with uppercase but are not user-defined types. */
18
18
  const BUILTIN_GLOBALS: Set<string> = new Set([
@@ -102,44 +102,42 @@ function extractSymbolsQuery(tree: TreeSitterTree, query: TreeSitterQuery): Extr
102
102
  const c: Record<string, TreeSitterNode> = Object.create(null);
103
103
  for (const cap of match.captures) c[cap.name] = cap.node;
104
104
 
105
- if (c['fn_node']) {
105
+ if (c.fn_node) {
106
106
  // function_declaration
107
- const fnChildren = extractParameters(c['fn_node']);
107
+ const fnChildren = extractParameters(c.fn_node);
108
108
  definitions.push({
109
- name: c['fn_name']!.text,
109
+ name: c.fn_name!.text,
110
110
  kind: 'function',
111
- line: c['fn_node'].startPosition.row + 1,
112
- endLine: nodeEndLine(c['fn_node']),
111
+ line: c.fn_node.startPosition.row + 1,
112
+ endLine: nodeEndLine(c.fn_node),
113
113
  children: fnChildren.length > 0 ? fnChildren : undefined,
114
114
  });
115
- } else if (c['varfn_name']) {
115
+ } else if (c.varfn_name) {
116
116
  // variable_declarator with arrow_function / function_expression
117
- const declNode = c['varfn_name'].parent?.parent;
118
- const line = declNode
119
- ? declNode.startPosition.row + 1
120
- : c['varfn_name'].startPosition.row + 1;
121
- const varFnChildren = extractParameters(c['varfn_value']!);
117
+ const declNode = c.varfn_name.parent?.parent;
118
+ const line = declNode ? declNode.startPosition.row + 1 : c.varfn_name.startPosition.row + 1;
119
+ const varFnChildren = extractParameters(c.varfn_value!);
122
120
  definitions.push({
123
- name: c['varfn_name'].text,
121
+ name: c.varfn_name.text,
124
122
  kind: 'function',
125
123
  line,
126
- endLine: nodeEndLine(c['varfn_value']!),
124
+ endLine: nodeEndLine(c.varfn_value!),
127
125
  children: varFnChildren.length > 0 ? varFnChildren : undefined,
128
126
  });
129
- } else if (c['cls_node']) {
127
+ } else if (c.cls_node) {
130
128
  // class_declaration
131
- const className = c['cls_name']!.text;
132
- const startLine = c['cls_node'].startPosition.row + 1;
133
- const clsChildren = extractClassProperties(c['cls_node']);
129
+ const className = c.cls_name!.text;
130
+ const startLine = c.cls_node.startPosition.row + 1;
131
+ const clsChildren = extractClassProperties(c.cls_node);
134
132
  definitions.push({
135
133
  name: className,
136
134
  kind: 'class',
137
135
  line: startLine,
138
- endLine: nodeEndLine(c['cls_node']),
136
+ endLine: nodeEndLine(c.cls_node),
139
137
  children: clsChildren.length > 0 ? clsChildren : undefined,
140
138
  });
141
139
  const heritage =
142
- c['cls_node'].childForFieldName('heritage') || findChild(c['cls_node'], 'class_heritage');
140
+ c.cls_node.childForFieldName('heritage') || findChild(c.cls_node, 'class_heritage');
143
141
  if (heritage) {
144
142
  const superName = extractSuperclass(heritage);
145
143
  if (superName) classes.push({ name: className, extends: superName, line: startLine });
@@ -148,58 +146,58 @@ function extractSymbolsQuery(tree: TreeSitterTree, query: TreeSitterQuery): Extr
148
146
  classes.push({ name: className, implements: iface, line: startLine });
149
147
  }
150
148
  }
151
- } else if (c['meth_node']) {
149
+ } else if (c.meth_node) {
152
150
  // method_definition
153
- const methName = c['meth_name']!.text;
154
- const parentClass = findParentClass(c['meth_node']);
151
+ const methName = c.meth_name!.text;
152
+ const parentClass = findParentClass(c.meth_node);
155
153
  const fullName = parentClass ? `${parentClass}.${methName}` : methName;
156
- const methChildren = extractParameters(c['meth_node']);
157
- const methVis = extractVisibility(c['meth_node']);
154
+ const methChildren = extractParameters(c.meth_node);
155
+ const methVis = extractVisibility(c.meth_node);
158
156
  definitions.push({
159
157
  name: fullName,
160
158
  kind: 'method',
161
- line: c['meth_node'].startPosition.row + 1,
162
- endLine: nodeEndLine(c['meth_node']),
159
+ line: c.meth_node.startPosition.row + 1,
160
+ endLine: nodeEndLine(c.meth_node),
163
161
  children: methChildren.length > 0 ? methChildren : undefined,
164
162
  visibility: methVis,
165
163
  });
166
- } else if (c['iface_node']) {
164
+ } else if (c.iface_node) {
167
165
  // interface_declaration (TS/TSX only)
168
- const ifaceName = c['iface_name']!.text;
166
+ const ifaceName = c.iface_name!.text;
169
167
  definitions.push({
170
168
  name: ifaceName,
171
169
  kind: 'interface',
172
- line: c['iface_node'].startPosition.row + 1,
173
- endLine: nodeEndLine(c['iface_node']),
170
+ line: c.iface_node.startPosition.row + 1,
171
+ endLine: nodeEndLine(c.iface_node),
174
172
  });
175
173
  const body =
176
- c['iface_node'].childForFieldName('body') ||
177
- findChild(c['iface_node'], 'interface_body') ||
178
- findChild(c['iface_node'], 'object_type');
174
+ c.iface_node.childForFieldName('body') ||
175
+ findChild(c.iface_node, 'interface_body') ||
176
+ findChild(c.iface_node, 'object_type');
179
177
  if (body) extractInterfaceMethods(body, ifaceName, definitions);
180
- } else if (c['type_node']) {
178
+ } else if (c.type_node) {
181
179
  // type_alias_declaration (TS/TSX only)
182
180
  definitions.push({
183
- name: c['type_name']!.text,
181
+ name: c.type_name!.text,
184
182
  kind: 'type',
185
- line: c['type_node'].startPosition.row + 1,
186
- endLine: nodeEndLine(c['type_node']),
183
+ line: c.type_node.startPosition.row + 1,
184
+ endLine: nodeEndLine(c.type_node),
187
185
  });
188
- } else if (c['imp_node']) {
186
+ } else if (c.imp_node) {
189
187
  // import_statement
190
- const isTypeOnly = c['imp_node'].text.startsWith('import type');
191
- const modPath = c['imp_source']!.text.replace(/['"]/g, '');
192
- const names = extractImportNames(c['imp_node']);
188
+ const isTypeOnly = c.imp_node.text.startsWith('import type');
189
+ const modPath = c.imp_source!.text.replace(/['"]/g, '');
190
+ const names = extractImportNames(c.imp_node);
193
191
  imports.push({
194
192
  source: modPath,
195
193
  names,
196
- line: c['imp_node'].startPosition.row + 1,
194
+ line: c.imp_node.startPosition.row + 1,
197
195
  typeOnly: isTypeOnly,
198
196
  });
199
- } else if (c['exp_node']) {
197
+ } else if (c.exp_node) {
200
198
  // export_statement
201
- const exportLine = c['exp_node'].startPosition.row + 1;
202
- const decl = c['exp_node'].childForFieldName('declaration');
199
+ const exportLine = c.exp_node.startPosition.row + 1;
200
+ const decl = c.exp_node.childForFieldName('declaration');
203
201
  if (decl) {
204
202
  const declType = decl.type;
205
203
  const kindMap: Record<string, string> = {
@@ -214,12 +212,11 @@ function extractSymbolsQuery(tree: TreeSitterTree, query: TreeSitterQuery): Extr
214
212
  if (n) exps.push({ name: n.text, kind: kind as Export['kind'], line: exportLine });
215
213
  }
216
214
  }
217
- const source =
218
- c['exp_node'].childForFieldName('source') || findChild(c['exp_node'], 'string');
215
+ const source = c.exp_node.childForFieldName('source') || findChild(c.exp_node, 'string');
219
216
  if (source && !decl) {
220
217
  const modPath = source.text.replace(/['"]/g, '');
221
- const reexportNames = extractImportNames(c['exp_node']);
222
- const nodeText = c['exp_node'].text;
218
+ const reexportNames = extractImportNames(c.exp_node);
219
+ const nodeText = c.exp_node.text;
223
220
  const isWildcard = nodeText.includes('export *') || nodeText.includes('export*');
224
221
  imports.push({
225
222
  source: modPath,
@@ -229,25 +226,25 @@ function extractSymbolsQuery(tree: TreeSitterTree, query: TreeSitterQuery): Extr
229
226
  wildcardReexport: isWildcard && reexportNames.length === 0,
230
227
  });
231
228
  }
232
- } else if (c['callfn_node']) {
229
+ } else if (c.callfn_node) {
233
230
  // call_expression with identifier function
234
231
  calls.push({
235
- name: c['callfn_name']!.text,
236
- line: c['callfn_node'].startPosition.row + 1,
232
+ name: c.callfn_name!.text,
233
+ line: c.callfn_node.startPosition.row + 1,
237
234
  });
238
- } else if (c['callmem_node']) {
235
+ } else if (c.callmem_node) {
239
236
  // call_expression with member_expression function
240
- const callInfo = extractCallInfo(c['callmem_fn']!, c['callmem_node']);
237
+ const callInfo = extractCallInfo(c.callmem_fn!, c.callmem_node);
241
238
  if (callInfo) calls.push(callInfo);
242
- const cbDef = extractCallbackDefinition(c['callmem_node'], c['callmem_fn']);
239
+ const cbDef = extractCallbackDefinition(c.callmem_node, c.callmem_fn);
243
240
  if (cbDef) definitions.push(cbDef);
244
- } else if (c['callsub_node']) {
241
+ } else if (c.callsub_node) {
245
242
  // call_expression with subscript_expression function
246
- const callInfo = extractCallInfo(c['callsub_fn']!, c['callsub_node']);
243
+ const callInfo = extractCallInfo(c.callsub_fn!, c.callsub_node);
247
244
  if (callInfo) calls.push(callInfo);
248
- } else if (c['assign_node']) {
245
+ } else if (c.assign_node) {
249
246
  // CommonJS: module.exports = require(...) / module.exports = { ...require(...) }
250
- handleCommonJSAssignment(c['assign_left']!, c['assign_right']!, c['assign_node'], imports);
247
+ handleCommonJSAssignment(c.assign_left!, c.assign_right!, c.assign_node, imports);
251
248
  }
252
249
  }
253
250
 
@@ -929,7 +926,7 @@ function extractTypeMapWalk(rootNode: TreeSitterNode, typeMap: Map<string, TypeM
929
926
  }
930
927
 
931
928
  function walk(node: TreeSitterNode, depth: number): void {
932
- if (depth >= 200) return;
929
+ if (depth >= MAX_WALK_DEPTH) return;
933
930
  const t = node.type;
934
931
  if (t === 'variable_declarator') {
935
932
  const nameN = node.childForFieldName('name');
@@ -5,7 +5,7 @@ import type {
5
5
  TreeSitterNode,
6
6
  TreeSitterTree,
7
7
  } from '../types.js';
8
- import { extractModifierVisibility, findChild, nodeEndLine } from './helpers.js';
8
+ import { extractModifierVisibility, findChild, MAX_WALK_DEPTH, nodeEndLine } from './helpers.js';
9
9
 
10
10
  function extractPhpParameters(fnNode: TreeSitterNode): SubDeclaration[] {
11
11
  const params: SubDeclaration[] = [];
@@ -340,7 +340,7 @@ function extractPhpTypeMap(node: TreeSitterNode, ctx: ExtractorOutput): void {
340
340
  }
341
341
 
342
342
  function extractPhpTypeMapDepth(node: TreeSitterNode, ctx: ExtractorOutput, depth: number): void {
343
- if (depth >= 200) return;
343
+ if (depth >= MAX_WALK_DEPTH) return;
344
344
 
345
345
  // Function/method parameters with type hints
346
346
  if (
@@ -6,7 +6,7 @@ import type {
6
6
  TreeSitterTree,
7
7
  TypeMapEntry,
8
8
  } from '../types.js';
9
- import { findChild, nodeEndLine, pythonVisibility } from './helpers.js';
9
+ import { findChild, MAX_WALK_DEPTH, nodeEndLine, pythonVisibility } from './helpers.js';
10
10
 
11
11
  /** Built-in globals that start with uppercase but are not user-defined types. */
12
12
  const BUILTIN_GLOBALS_PY: Set<string> = new Set([
@@ -365,7 +365,7 @@ function extractPythonTypeMapDepth(
365
365
  ctx: ExtractorOutput,
366
366
  depth: number,
367
367
  ): void {
368
- if (depth >= 200) return;
368
+ if (depth >= MAX_WALK_DEPTH) return;
369
369
 
370
370
  // typed_parameter: identifier : type (confidence 0.9)
371
371
  if (node.type === 'typed_parameter') {
@@ -5,7 +5,7 @@ import type {
5
5
  TreeSitterNode,
6
6
  TreeSitterTree,
7
7
  } from '../types.js';
8
- import { findChild, nodeEndLine, rustVisibility } from './helpers.js';
8
+ import { findChild, MAX_WALK_DEPTH, nodeEndLine, rustVisibility } from './helpers.js';
9
9
 
10
10
  /**
11
11
  * Extract symbols from Rust files.
@@ -274,7 +274,7 @@ function extractRustTypeMap(node: TreeSitterNode, ctx: ExtractorOutput): void {
274
274
  }
275
275
 
276
276
  function extractRustTypeMapDepth(node: TreeSitterNode, ctx: ExtractorOutput, depth: number): void {
277
- if (depth >= 200) return;
277
+ if (depth >= MAX_WALK_DEPTH) return;
278
278
 
279
279
  // let x: MyType = ...
280
280
  if (node.type === 'let_declaration') {
@@ -30,7 +30,7 @@ function resolveThresholds(
30
30
  const repoRoot = path.resolve(dbDir, '..');
31
31
  return loadConfig(repoRoot);
32
32
  })();
33
- const userRules = (cfg as Record<string, unknown>)['manifesto'] || {};
33
+ const userRules = (cfg as Record<string, unknown>).manifesto || {};
34
34
  const resolved: Record<string, ThresholdEntry> = {};
35
35
  for (const def of FUNCTION_RULES) {
36
36
  const user = (userRules as Record<string, { warn?: number; fail?: number }>)[def.name];
@@ -163,7 +163,6 @@ export function auditData(
163
163
  const explained = explainData(target, customDbPath, { noTests, depth: 0 });
164
164
 
165
165
  // Apply --file and --kind filters for function targets
166
- // biome-ignore lint/suspicious/noExplicitAny: explainData returns a union type that varies by kind
167
166
  let results: any[] = explained.results;
168
167
  if (explained.kind === 'function') {
169
168
  if (fileFilters.length > 0)
@@ -6,13 +6,7 @@ import Database from 'better-sqlite3';
6
6
  import { buildGraph } from '../domain/graph/builder.js';
7
7
  import { kindIcon } from '../domain/queries.js';
8
8
  import { isTestFile } from '../infrastructure/test-filter.js';
9
- import type { BetterSqlite3Database, EngineMode } from '../types.js';
10
-
11
- type DatabaseConstructor = new (
12
- path: string,
13
- opts?: Record<string, unknown>,
14
- ) => BetterSqlite3Database;
15
- const Db = Database as unknown as DatabaseConstructor;
9
+ import type { EngineMode } from '../types.js';
16
10
 
17
11
  // ─── Git Helpers ────────────────────────────────────────────────────────
18
12
 
@@ -111,7 +105,7 @@ function loadSymbolsFromDb(
111
105
  changedFiles: string[],
112
106
  noTests: boolean,
113
107
  ): Map<string, SymbolInfo> {
114
- const db = new Db(dbPath, { readonly: true });
108
+ const db = new Database(dbPath, { readonly: true });
115
109
  try {
116
110
  const symbols = new Map<string, SymbolInfo>();
117
111
 
@@ -180,7 +174,7 @@ function loadCallersFromDb(
180
174
  ): CallerInfo[] {
181
175
  if (nodeIds.length === 0) return [];
182
176
 
183
- const db = new Db(dbPath, { readonly: true });
177
+ const db = new Database(dbPath, { readonly: true });
184
178
  try {
185
179
  const allCallers = new Set<string>();
186
180
 
@@ -62,8 +62,7 @@ export function buildFunctionCFG(functionNode: TreeSitterNode, langId: string):
62
62
  };
63
63
 
64
64
  const results = walkWithVisitors(functionNode, [visitor], langId, walkerOpts);
65
- // biome-ignore lint/complexity/useLiteralKeys: noPropertyAccessFromIndexSignature requires bracket notation
66
- const cfgResults = (results['cfg'] || []) as Array<{
65
+ const cfgResults = (results.cfg || []) as Array<{
67
66
  funcNode: TreeSitterNode;
68
67
  blocks: CfgBuildBlock[];
69
68
  edges: CfgBuildEdge[];
@@ -214,8 +213,7 @@ function buildVisitorCfgMap(
214
213
  },
215
214
  };
216
215
  const walkResults = walkWithVisitors(tree?.rootNode, [visitor], langId, walkerOpts);
217
- // biome-ignore lint/complexity/useLiteralKeys: noPropertyAccessFromIndexSignature requires bracket notation
218
- const cfgResults = (walkResults['cfg'] || []) as VisitorCfgResult[];
216
+ const cfgResults = (walkResults.cfg || []) as VisitorCfgResult[];
219
217
  const visitorCfgByLine = new Map<number, VisitorCfgResult[]>();
220
218
  for (const r of cfgResults) {
221
219
  if (r.funcNode) {
@@ -472,10 +472,10 @@ function getCoChangeMeta(db: BetterSqlite3Database): CoChangeMeta | null {
472
472
  meta[row.key] = row.value;
473
473
  }
474
474
  return {
475
- analyzedAt: meta['analyzed_at'] || null,
476
- since: meta['since'] || null,
477
- minSupport: meta['min_support'] ? parseInt(meta['min_support'], 10) : null,
478
- lastCommit: meta['last_analyzed_commit'] || null,
475
+ analyzedAt: meta.analyzed_at || null,
476
+ since: meta.since || null,
477
+ minSupport: meta.min_support ? parseInt(meta.min_support, 10) : null,
478
+ lastCommit: meta.last_analyzed_commit || null,
479
479
  };
480
480
  } catch {
481
481
  return null;
@@ -50,12 +50,12 @@ function buildCommunityObjects(
50
50
  const memberData: CommunityMember[] = [];
51
51
  for (const key of members) {
52
52
  const attrs = graph.getNodeAttrs(key)!;
53
- const dir = getDirectory(attrs['file'] as string);
53
+ const dir = getDirectory(attrs.file as string);
54
54
  dirCounts[dir] = (dirCounts[dir] || 0) + 1;
55
55
  memberData.push({
56
- name: attrs['label'] as string,
57
- file: attrs['file'] as string,
58
- ...(attrs['kind'] ? { kind: attrs['kind'] as string } : {}),
56
+ name: attrs.label as string,
57
+ file: attrs.file as string,
58
+ ...(attrs.kind ? { kind: attrs.kind as string } : {}),
59
59
  });
60
60
  }
61
61