@quolu/lattice 0.70.0 → 0.71.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 (602) hide show
  1. package/package.json +1 -1
  2. package/sensor/dist/bin/lattice-sensor.js +746 -323
  3. package/sensor/dist/bin/viewer-gate.d.ts +17 -0
  4. package/sensor/dist/bin/viewer-gate.d.ts.map +1 -0
  5. package/sensor/dist/bin/viewer-gate.js +31 -0
  6. package/sensor/dist/bin/viewer-gate.js.map +1 -0
  7. package/sensor/dist/context/formatter.d.ts +7 -1
  8. package/sensor/dist/context/formatter.d.ts.map +1 -1
  9. package/sensor/dist/context/formatter.js +12 -6
  10. package/sensor/dist/context/formatter.js.map +1 -1
  11. package/sensor/dist/context/index.d.ts +12 -0
  12. package/sensor/dist/context/index.d.ts.map +1 -1
  13. package/sensor/dist/context/index.js +103 -16
  14. package/sensor/dist/context/index.js.map +1 -1
  15. package/sensor/dist/db/index.d.ts +23 -2
  16. package/sensor/dist/db/index.d.ts.map +1 -1
  17. package/sensor/dist/db/index.js +109 -31
  18. package/sensor/dist/db/index.js.map +1 -1
  19. package/sensor/dist/db/migrations.d.ts +1 -1
  20. package/sensor/dist/db/migrations.d.ts.map +1 -1
  21. package/sensor/dist/db/migrations.js +68 -1
  22. package/sensor/dist/db/migrations.js.map +1 -1
  23. package/sensor/dist/db/queries.d.ts +583 -6
  24. package/sensor/dist/db/queries.d.ts.map +1 -1
  25. package/sensor/dist/db/queries.js +1425 -57
  26. package/sensor/dist/db/queries.js.map +1 -1
  27. package/sensor/dist/db/schema.sql +27 -4
  28. package/sensor/dist/db/sqlite-adapter.d.ts +2 -0
  29. package/sensor/dist/db/sqlite-adapter.d.ts.map +1 -1
  30. package/sensor/dist/db/sqlite-adapter.js +56 -7
  31. package/sensor/dist/db/sqlite-adapter.js.map +1 -1
  32. package/sensor/dist/db/synthesis-stage.d.ts +12 -0
  33. package/sensor/dist/db/synthesis-stage.d.ts.map +1 -0
  34. package/sensor/dist/db/synthesis-stage.js +93 -0
  35. package/sensor/dist/db/synthesis-stage.js.map +1 -0
  36. package/sensor/dist/db/wal-valve.d.ts +32 -12
  37. package/sensor/dist/db/wal-valve.d.ts.map +1 -1
  38. package/sensor/dist/db/wal-valve.js +65 -22
  39. package/sensor/dist/db/wal-valve.js.map +1 -1
  40. package/sensor/dist/db/wsl-shared-index.d.ts +53 -0
  41. package/sensor/dist/db/wsl-shared-index.d.ts.map +1 -0
  42. package/sensor/dist/db/wsl-shared-index.js +121 -0
  43. package/sensor/dist/db/wsl-shared-index.js.map +1 -0
  44. package/sensor/dist/directory.d.ts +126 -2
  45. package/sensor/dist/directory.d.ts.map +1 -1
  46. package/sensor/dist/directory.js +285 -16
  47. package/sensor/dist/directory.js.map +1 -1
  48. package/sensor/dist/errors.d.ts +14 -0
  49. package/sensor/dist/errors.d.ts.map +1 -1
  50. package/sensor/dist/errors.js +16 -1
  51. package/sensor/dist/errors.js.map +1 -1
  52. package/sensor/dist/extraction/cfml-extractor.d.ts +1 -0
  53. package/sensor/dist/extraction/cfml-extractor.d.ts.map +1 -1
  54. package/sensor/dist/extraction/cfml-extractor.js +15 -3
  55. package/sensor/dist/extraction/cfml-extractor.js.map +1 -1
  56. package/sensor/dist/extraction/dfm-extractor.d.ts.map +1 -1
  57. package/sensor/dist/extraction/dfm-extractor.js +14 -10
  58. package/sensor/dist/extraction/dfm-extractor.js.map +1 -1
  59. package/sensor/dist/extraction/extraction-version.d.ts +1 -1
  60. package/sensor/dist/extraction/extraction-version.d.ts.map +1 -1
  61. package/sensor/dist/extraction/extraction-version.js +3 -1
  62. package/sensor/dist/extraction/extraction-version.js.map +1 -1
  63. package/sensor/dist/extraction/function-ref.d.ts +6 -4
  64. package/sensor/dist/extraction/function-ref.d.ts.map +1 -1
  65. package/sensor/dist/extraction/function-ref.js +35 -14
  66. package/sensor/dist/extraction/function-ref.js.map +1 -1
  67. package/sensor/dist/extraction/generated-detection.d.ts +48 -12
  68. package/sensor/dist/extraction/generated-detection.d.ts.map +1 -1
  69. package/sensor/dist/extraction/generated-detection.js +176 -11
  70. package/sensor/dist/extraction/generated-detection.js.map +1 -1
  71. package/sensor/dist/extraction/grammars.d.ts +38 -0
  72. package/sensor/dist/extraction/grammars.d.ts.map +1 -1
  73. package/sensor/dist/extraction/grammars.js +115 -3
  74. package/sensor/dist/extraction/grammars.js.map +1 -1
  75. package/sensor/dist/extraction/index.d.ts +218 -14
  76. package/sensor/dist/extraction/index.d.ts.map +1 -1
  77. package/sensor/dist/extraction/index.js +887 -175
  78. package/sensor/dist/extraction/index.js.map +1 -1
  79. package/sensor/dist/extraction/languages/c-cpp.d.ts +58 -0
  80. package/sensor/dist/extraction/languages/c-cpp.d.ts.map +1 -1
  81. package/sensor/dist/extraction/languages/c-cpp.js +310 -19
  82. package/sensor/dist/extraction/languages/c-cpp.js.map +1 -1
  83. package/sensor/dist/extraction/languages/dart.d.ts.map +1 -1
  84. package/sensor/dist/extraction/languages/dart.js +8 -3
  85. package/sensor/dist/extraction/languages/dart.js.map +1 -1
  86. package/sensor/dist/extraction/languages/erlang.d.ts.map +1 -1
  87. package/sensor/dist/extraction/languages/erlang.js +58 -22
  88. package/sensor/dist/extraction/languages/erlang.js.map +1 -1
  89. package/sensor/dist/extraction/languages/javascript.js +1 -1
  90. package/sensor/dist/extraction/languages/javascript.js.map +1 -1
  91. package/sensor/dist/extraction/languages/kotlin.d.ts.map +1 -1
  92. package/sensor/dist/extraction/languages/kotlin.js +169 -36
  93. package/sensor/dist/extraction/languages/kotlin.js.map +1 -1
  94. package/sensor/dist/extraction/languages/lua.d.ts.map +1 -1
  95. package/sensor/dist/extraction/languages/lua.js +4 -1
  96. package/sensor/dist/extraction/languages/lua.js.map +1 -1
  97. package/sensor/dist/extraction/languages/objc.d.ts.map +1 -1
  98. package/sensor/dist/extraction/languages/objc.js +4 -0
  99. package/sensor/dist/extraction/languages/objc.js.map +1 -1
  100. package/sensor/dist/extraction/languages/python.d.ts.map +1 -1
  101. package/sensor/dist/extraction/languages/python.js +71 -0
  102. package/sensor/dist/extraction/languages/python.js.map +1 -1
  103. package/sensor/dist/extraction/languages/rust.d.ts +20 -0
  104. package/sensor/dist/extraction/languages/rust.d.ts.map +1 -1
  105. package/sensor/dist/extraction/languages/rust.js +50 -20
  106. package/sensor/dist/extraction/languages/rust.js.map +1 -1
  107. package/sensor/dist/extraction/languages/scala.d.ts.map +1 -1
  108. package/sensor/dist/extraction/languages/scala.js +18 -3
  109. package/sensor/dist/extraction/languages/scala.js.map +1 -1
  110. package/sensor/dist/extraction/languages/swift.d.ts +15 -0
  111. package/sensor/dist/extraction/languages/swift.d.ts.map +1 -1
  112. package/sensor/dist/extraction/languages/swift.js +50 -0
  113. package/sensor/dist/extraction/languages/swift.js.map +1 -1
  114. package/sensor/dist/extraction/languages/typescript.d.ts.map +1 -1
  115. package/sensor/dist/extraction/languages/typescript.js +9 -2
  116. package/sensor/dist/extraction/languages/typescript.js.map +1 -1
  117. package/sensor/dist/extraction/liquid-extractor.d.ts +18 -0
  118. package/sensor/dist/extraction/liquid-extractor.d.ts.map +1 -1
  119. package/sensor/dist/extraction/liquid-extractor.js +98 -22
  120. package/sensor/dist/extraction/liquid-extractor.js.map +1 -1
  121. package/sensor/dist/extraction/mybatis-extractor.d.ts.map +1 -1
  122. package/sensor/dist/extraction/mybatis-extractor.js +6 -4
  123. package/sensor/dist/extraction/mybatis-extractor.js.map +1 -1
  124. package/sensor/dist/extraction/parse-pool.d.ts +7 -0
  125. package/sensor/dist/extraction/parse-pool.d.ts.map +1 -1
  126. package/sensor/dist/extraction/parse-pool.js +20 -1
  127. package/sensor/dist/extraction/parse-pool.js.map +1 -1
  128. package/sensor/dist/extraction/syntax-tokens.d.ts +103 -0
  129. package/sensor/dist/extraction/syntax-tokens.d.ts.map +1 -0
  130. package/sensor/dist/extraction/syntax-tokens.js +381 -0
  131. package/sensor/dist/extraction/syntax-tokens.js.map +1 -0
  132. package/sensor/dist/extraction/tree-sitter-helpers.d.ts +5 -0
  133. package/sensor/dist/extraction/tree-sitter-helpers.d.ts.map +1 -1
  134. package/sensor/dist/extraction/tree-sitter-helpers.js +17 -0
  135. package/sensor/dist/extraction/tree-sitter-helpers.js.map +1 -1
  136. package/sensor/dist/extraction/tree-sitter-types.d.ts +31 -3
  137. package/sensor/dist/extraction/tree-sitter-types.d.ts.map +1 -1
  138. package/sensor/dist/extraction/tree-sitter.d.ts +101 -18
  139. package/sensor/dist/extraction/tree-sitter.d.ts.map +1 -1
  140. package/sensor/dist/extraction/tree-sitter.js +928 -134
  141. package/sensor/dist/extraction/tree-sitter.js.map +1 -1
  142. package/sensor/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
  143. package/sensor/dist/file-limits.d.ts +40 -0
  144. package/sensor/dist/file-limits.d.ts.map +1 -0
  145. package/sensor/dist/file-limits.js +147 -0
  146. package/sensor/dist/file-limits.js.map +1 -0
  147. package/sensor/dist/graph/branch-guards.d.ts +265 -0
  148. package/sensor/dist/graph/branch-guards.d.ts.map +1 -0
  149. package/sensor/dist/graph/branch-guards.js +2325 -0
  150. package/sensor/dist/graph/branch-guards.js.map +1 -0
  151. package/sensor/dist/graph/dead-code.d.ts +251 -0
  152. package/sensor/dist/graph/dead-code.d.ts.map +1 -0
  153. package/sensor/dist/graph/dead-code.js +776 -0
  154. package/sensor/dist/graph/dead-code.js.map +1 -0
  155. package/sensor/dist/graph/dynamic-boundary-report.d.ts +121 -0
  156. package/sensor/dist/graph/dynamic-boundary-report.d.ts.map +1 -0
  157. package/sensor/dist/graph/dynamic-boundary-report.js +283 -0
  158. package/sensor/dist/graph/dynamic-boundary-report.js.map +1 -0
  159. package/sensor/dist/graph/index.d.ts +4 -0
  160. package/sensor/dist/graph/index.d.ts.map +1 -1
  161. package/sensor/dist/graph/index.js +16 -1
  162. package/sensor/dist/graph/index.js.map +1 -1
  163. package/sensor/dist/graph/named-symbol-flow.d.ts +125 -0
  164. package/sensor/dist/graph/named-symbol-flow.d.ts.map +1 -0
  165. package/sensor/dist/graph/named-symbol-flow.js +552 -0
  166. package/sensor/dist/graph/named-symbol-flow.js.map +1 -0
  167. package/sensor/dist/graph/queries.d.ts.map +1 -1
  168. package/sensor/dist/graph/queries.js +2 -0
  169. package/sensor/dist/graph/queries.js.map +1 -1
  170. package/sensor/dist/graph/symbol-lookup.d.ts +83 -0
  171. package/sensor/dist/graph/symbol-lookup.d.ts.map +1 -0
  172. package/sensor/dist/graph/symbol-lookup.js +181 -0
  173. package/sensor/dist/graph/symbol-lookup.js.map +1 -0
  174. package/sensor/dist/graph/traversal.d.ts +9 -0
  175. package/sensor/dist/graph/traversal.d.ts.map +1 -1
  176. package/sensor/dist/graph/traversal.js +62 -36
  177. package/sensor/dist/graph/traversal.js.map +1 -1
  178. package/sensor/dist/graph/type-hierarchy.d.ts +155 -0
  179. package/sensor/dist/graph/type-hierarchy.d.ts.map +1 -0
  180. package/sensor/dist/graph/type-hierarchy.js +382 -0
  181. package/sensor/dist/graph/type-hierarchy.js.map +1 -0
  182. package/sensor/dist/index.d.ts +272 -10
  183. package/sensor/dist/index.d.ts.map +1 -1
  184. package/sensor/dist/index.js +510 -34
  185. package/sensor/dist/index.js.map +1 -1
  186. package/sensor/dist/mcp/answer-freshness.d.ts +10 -0
  187. package/sensor/dist/mcp/answer-freshness.d.ts.map +1 -0
  188. package/sensor/dist/mcp/answer-freshness.js +68 -0
  189. package/sensor/dist/mcp/answer-freshness.js.map +1 -0
  190. package/sensor/dist/mcp/daemon-manager.d.ts +1 -1
  191. package/sensor/dist/mcp/daemon-manager.d.ts.map +1 -1
  192. package/sensor/dist/mcp/daemon-manager.js +17 -1
  193. package/sensor/dist/mcp/daemon-manager.js.map +1 -1
  194. package/sensor/dist/mcp/daemon-paths.d.ts +8 -0
  195. package/sensor/dist/mcp/daemon-paths.d.ts.map +1 -1
  196. package/sensor/dist/mcp/daemon-paths.js +65 -2
  197. package/sensor/dist/mcp/daemon-paths.js.map +1 -1
  198. package/sensor/dist/mcp/daemon-registry.d.ts +17 -4
  199. package/sensor/dist/mcp/daemon-registry.d.ts.map +1 -1
  200. package/sensor/dist/mcp/daemon-registry.js +133 -23
  201. package/sensor/dist/mcp/daemon-registry.js.map +1 -1
  202. package/sensor/dist/mcp/daemon.d.ts +26 -13
  203. package/sensor/dist/mcp/daemon.d.ts.map +1 -1
  204. package/sensor/dist/mcp/daemon.js +126 -32
  205. package/sensor/dist/mcp/daemon.js.map +1 -1
  206. package/sensor/dist/mcp/dynamic-boundaries.d.ts +1 -10
  207. package/sensor/dist/mcp/dynamic-boundaries.d.ts.map +1 -1
  208. package/sensor/dist/mcp/dynamic-boundaries.js +46 -42
  209. package/sensor/dist/mcp/dynamic-boundaries.js.map +1 -1
  210. package/sensor/dist/mcp/engine.d.ts +31 -9
  211. package/sensor/dist/mcp/engine.d.ts.map +1 -1
  212. package/sensor/dist/mcp/engine.js +190 -79
  213. package/sensor/dist/mcp/engine.js.map +1 -1
  214. package/sensor/dist/mcp/explore-dedup.d.ts +140 -0
  215. package/sensor/dist/mcp/explore-dedup.d.ts.map +1 -0
  216. package/sensor/dist/mcp/explore-dedup.js +239 -0
  217. package/sensor/dist/mcp/explore-dedup.js.map +1 -0
  218. package/sensor/dist/mcp/explore-diagnostics.d.ts +289 -0
  219. package/sensor/dist/mcp/explore-diagnostics.d.ts.map +1 -0
  220. package/sensor/dist/mcp/explore-diagnostics.js +558 -0
  221. package/sensor/dist/mcp/explore-diagnostics.js.map +1 -0
  222. package/sensor/dist/mcp/explore-session-state.d.ts +217 -0
  223. package/sensor/dist/mcp/explore-session-state.d.ts.map +1 -0
  224. package/sensor/dist/mcp/explore-session-state.js +322 -0
  225. package/sensor/dist/mcp/explore-session-state.js.map +1 -0
  226. package/sensor/dist/mcp/index-freshness-worker.d.ts +2 -0
  227. package/sensor/dist/mcp/index-freshness-worker.d.ts.map +1 -0
  228. package/sensor/dist/mcp/index-freshness-worker.js +30 -0
  229. package/sensor/dist/mcp/index-freshness-worker.js.map +1 -0
  230. package/sensor/dist/mcp/index-freshness.d.ts +7 -0
  231. package/sensor/dist/mcp/index-freshness.d.ts.map +1 -0
  232. package/sensor/dist/mcp/index-freshness.js +94 -0
  233. package/sensor/dist/mcp/index-freshness.js.map +1 -0
  234. package/sensor/dist/mcp/index.d.ts +3 -1
  235. package/sensor/dist/mcp/index.d.ts.map +1 -1
  236. package/sensor/dist/mcp/index.js +109 -12
  237. package/sensor/dist/mcp/index.js.map +1 -1
  238. package/sensor/dist/mcp/liveness-watchdog.d.ts +4 -1
  239. package/sensor/dist/mcp/liveness-watchdog.d.ts.map +1 -1
  240. package/sensor/dist/mcp/liveness-watchdog.js +11 -2
  241. package/sensor/dist/mcp/liveness-watchdog.js.map +1 -1
  242. package/sensor/dist/mcp/project-lifecycle.d.ts +9 -0
  243. package/sensor/dist/mcp/project-lifecycle.d.ts.map +1 -0
  244. package/sensor/dist/mcp/project-lifecycle.js +182 -0
  245. package/sensor/dist/mcp/project-lifecycle.js.map +1 -0
  246. package/sensor/dist/mcp/proxy.d.ts.map +1 -1
  247. package/sensor/dist/mcp/proxy.js +15 -1
  248. package/sensor/dist/mcp/proxy.js.map +1 -1
  249. package/sensor/dist/mcp/query-pool.d.ts +2 -2
  250. package/sensor/dist/mcp/query-pool.d.ts.map +1 -1
  251. package/sensor/dist/mcp/query-pool.js +9 -7
  252. package/sensor/dist/mcp/query-pool.js.map +1 -1
  253. package/sensor/dist/mcp/query-worker.js +2 -2
  254. package/sensor/dist/mcp/query-worker.js.map +1 -1
  255. package/sensor/dist/mcp/server-instructions.d.ts +2 -2
  256. package/sensor/dist/mcp/server-instructions.d.ts.map +1 -1
  257. package/sensor/dist/mcp/server-instructions.js +13 -6
  258. package/sensor/dist/mcp/server-instructions.js.map +1 -1
  259. package/sensor/dist/mcp/session.d.ts +16 -0
  260. package/sensor/dist/mcp/session.d.ts.map +1 -1
  261. package/sensor/dist/mcp/session.js +36 -13
  262. package/sensor/dist/mcp/session.js.map +1 -1
  263. package/sensor/dist/mcp/startup-handshake.d.ts +3 -1
  264. package/sensor/dist/mcp/startup-handshake.d.ts.map +1 -1
  265. package/sensor/dist/mcp/startup-handshake.js +10 -2
  266. package/sensor/dist/mcp/startup-handshake.js.map +1 -1
  267. package/sensor/dist/mcp/tools.d.ts +496 -38
  268. package/sensor/dist/mcp/tools.d.ts.map +1 -1
  269. package/sensor/dist/mcp/tools.js +4021 -772
  270. package/sensor/dist/mcp/tools.js.map +1 -1
  271. package/sensor/dist/mcp/writer-lock.d.ts +61 -0
  272. package/sensor/dist/mcp/writer-lock.d.ts.map +1 -0
  273. package/sensor/dist/mcp/writer-lock.js +260 -0
  274. package/sensor/dist/mcp/writer-lock.js.map +1 -0
  275. package/sensor/dist/project-config.d.ts +23 -0
  276. package/sensor/dist/project-config.d.ts.map +1 -1
  277. package/sensor/dist/project-config.js +39 -2
  278. package/sensor/dist/project-config.js.map +1 -1
  279. package/sensor/dist/resolution/alias-binding.d.ts +56 -0
  280. package/sensor/dist/resolution/alias-binding.d.ts.map +1 -0
  281. package/sensor/dist/resolution/alias-binding.js +127 -0
  282. package/sensor/dist/resolution/alias-binding.js.map +1 -0
  283. package/sensor/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -1
  284. package/sensor/dist/resolution/c-fnptr-synthesizer.js +21 -19
  285. package/sensor/dist/resolution/c-fnptr-synthesizer.js.map +1 -1
  286. package/sensor/dist/resolution/callback-synthesizer.d.ts +23 -1
  287. package/sensor/dist/resolution/callback-synthesizer.d.ts.map +1 -1
  288. package/sensor/dist/resolution/callback-synthesizer.js +356 -155
  289. package/sensor/dist/resolution/callback-synthesizer.js.map +1 -1
  290. package/sensor/dist/resolution/cpp-constructor.d.ts +4 -0
  291. package/sensor/dist/resolution/cpp-constructor.d.ts.map +1 -0
  292. package/sensor/dist/resolution/cpp-constructor.js +123 -0
  293. package/sensor/dist/resolution/cpp-constructor.js.map +1 -0
  294. package/sensor/dist/resolution/cpp-macro-visibility.d.ts +12 -0
  295. package/sensor/dist/resolution/cpp-macro-visibility.d.ts.map +1 -0
  296. package/sensor/dist/resolution/cpp-macro-visibility.js +342 -0
  297. package/sensor/dist/resolution/cpp-macro-visibility.js.map +1 -0
  298. package/sensor/dist/resolution/expo-router-synthesizer.d.ts +32 -0
  299. package/sensor/dist/resolution/expo-router-synthesizer.d.ts.map +1 -0
  300. package/sensor/dist/resolution/expo-router-synthesizer.js +189 -0
  301. package/sensor/dist/resolution/expo-router-synthesizer.js.map +1 -0
  302. package/sensor/dist/resolution/frameworks/csharp.d.ts.map +1 -1
  303. package/sensor/dist/resolution/frameworks/csharp.js +96 -2
  304. package/sensor/dist/resolution/frameworks/csharp.js.map +1 -1
  305. package/sensor/dist/resolution/frameworks/expo-router.d.ts +189 -0
  306. package/sensor/dist/resolution/frameworks/expo-router.d.ts.map +1 -0
  307. package/sensor/dist/resolution/frameworks/expo-router.js +785 -0
  308. package/sensor/dist/resolution/frameworks/expo-router.js.map +1 -0
  309. package/sensor/dist/resolution/frameworks/express.d.ts.map +1 -1
  310. package/sensor/dist/resolution/frameworks/express.js +251 -16
  311. package/sensor/dist/resolution/frameworks/express.js.map +1 -1
  312. package/sensor/dist/resolution/frameworks/index.d.ts +5 -0
  313. package/sensor/dist/resolution/frameworks/index.d.ts.map +1 -1
  314. package/sensor/dist/resolution/frameworks/index.js +29 -1
  315. package/sensor/dist/resolution/frameworks/index.js.map +1 -1
  316. package/sensor/dist/resolution/frameworks/java.d.ts.map +1 -1
  317. package/sensor/dist/resolution/frameworks/java.js +79 -47
  318. package/sensor/dist/resolution/frameworks/java.js.map +1 -1
  319. package/sensor/dist/resolution/frameworks/laravel.d.ts.map +1 -1
  320. package/sensor/dist/resolution/frameworks/laravel.js +294 -4
  321. package/sensor/dist/resolution/frameworks/laravel.js.map +1 -1
  322. package/sensor/dist/resolution/frameworks/nestjs.d.ts.map +1 -1
  323. package/sensor/dist/resolution/frameworks/nestjs.js +6 -14
  324. package/sensor/dist/resolution/frameworks/nestjs.js.map +1 -1
  325. package/sensor/dist/resolution/frameworks/nextjs.d.ts +76 -0
  326. package/sensor/dist/resolution/frameworks/nextjs.d.ts.map +1 -0
  327. package/sensor/dist/resolution/frameworks/nextjs.js +328 -0
  328. package/sensor/dist/resolution/frameworks/nextjs.js.map +1 -0
  329. package/sensor/dist/resolution/frameworks/object-literal.d.ts +32 -0
  330. package/sensor/dist/resolution/frameworks/object-literal.d.ts.map +1 -0
  331. package/sensor/dist/resolution/frameworks/object-literal.js +139 -0
  332. package/sensor/dist/resolution/frameworks/object-literal.js.map +1 -0
  333. package/sensor/dist/resolution/frameworks/package-deps.d.ts +14 -0
  334. package/sensor/dist/resolution/frameworks/package-deps.d.ts.map +1 -0
  335. package/sensor/dist/resolution/frameworks/package-deps.js +78 -0
  336. package/sensor/dist/resolution/frameworks/package-deps.js.map +1 -0
  337. package/sensor/dist/resolution/frameworks/python.d.ts.map +1 -1
  338. package/sensor/dist/resolution/frameworks/python.js +166 -0
  339. package/sensor/dist/resolution/frameworks/python.js.map +1 -1
  340. package/sensor/dist/resolution/frameworks/react-native.d.ts +26 -0
  341. package/sensor/dist/resolution/frameworks/react-native.d.ts.map +1 -1
  342. package/sensor/dist/resolution/frameworks/react-native.js +153 -14
  343. package/sensor/dist/resolution/frameworks/react-native.js.map +1 -1
  344. package/sensor/dist/resolution/frameworks/react-router.d.ts +46 -0
  345. package/sensor/dist/resolution/frameworks/react-router.d.ts.map +1 -0
  346. package/sensor/dist/resolution/frameworks/react-router.js +187 -0
  347. package/sensor/dist/resolution/frameworks/react-router.js.map +1 -0
  348. package/sensor/dist/resolution/frameworks/react.d.ts +2 -1
  349. package/sensor/dist/resolution/frameworks/react.d.ts.map +1 -1
  350. package/sensor/dist/resolution/frameworks/react.js +188 -139
  351. package/sensor/dist/resolution/frameworks/react.js.map +1 -1
  352. package/sensor/dist/resolution/frameworks/svelte.d.ts.map +1 -1
  353. package/sensor/dist/resolution/frameworks/svelte.js +6 -1
  354. package/sensor/dist/resolution/frameworks/svelte.js.map +1 -1
  355. package/sensor/dist/resolution/frameworks/sveltekit-router.d.ts +36 -0
  356. package/sensor/dist/resolution/frameworks/sveltekit-router.d.ts.map +1 -0
  357. package/sensor/dist/resolution/frameworks/sveltekit-router.js +156 -0
  358. package/sensor/dist/resolution/frameworks/sveltekit-router.js.map +1 -0
  359. package/sensor/dist/resolution/frameworks/swift.d.ts.map +1 -1
  360. package/sensor/dist/resolution/frameworks/swift.js +140 -99
  361. package/sensor/dist/resolution/frameworks/swift.js.map +1 -1
  362. package/sensor/dist/resolution/frameworks/tanstack-router.d.ts +84 -0
  363. package/sensor/dist/resolution/frameworks/tanstack-router.d.ts.map +1 -0
  364. package/sensor/dist/resolution/frameworks/tanstack-router.js +437 -0
  365. package/sensor/dist/resolution/frameworks/tanstack-router.js.map +1 -0
  366. package/sensor/dist/resolution/frameworks/vue-router.d.ts +82 -0
  367. package/sensor/dist/resolution/frameworks/vue-router.d.ts.map +1 -0
  368. package/sensor/dist/resolution/frameworks/vue-router.js +377 -0
  369. package/sensor/dist/resolution/frameworks/vue-router.js.map +1 -0
  370. package/sensor/dist/resolution/import-resolver.d.ts +38 -0
  371. package/sensor/dist/resolution/import-resolver.d.ts.map +1 -1
  372. package/sensor/dist/resolution/import-resolver.js +394 -28
  373. package/sensor/dist/resolution/import-resolver.js.map +1 -1
  374. package/sensor/dist/resolution/index.d.ts +89 -25
  375. package/sensor/dist/resolution/index.d.ts.map +1 -1
  376. package/sensor/dist/resolution/index.js +573 -148
  377. package/sensor/dist/resolution/index.js.map +1 -1
  378. package/sensor/dist/resolution/js-builtins.d.ts +13 -0
  379. package/sensor/dist/resolution/js-builtins.d.ts.map +1 -0
  380. package/sensor/dist/resolution/js-builtins.js +46 -0
  381. package/sensor/dist/resolution/js-builtins.js.map +1 -0
  382. package/sensor/dist/resolution/name-matcher.d.ts +99 -22
  383. package/sensor/dist/resolution/name-matcher.d.ts.map +1 -1
  384. package/sensor/dist/resolution/name-matcher.js +2220 -86
  385. package/sensor/dist/resolution/name-matcher.js.map +1 -1
  386. package/sensor/dist/resolution/next-router-synthesizer.d.ts +27 -0
  387. package/sensor/dist/resolution/next-router-synthesizer.d.ts.map +1 -0
  388. package/sensor/dist/resolution/next-router-synthesizer.js +113 -0
  389. package/sensor/dist/resolution/next-router-synthesizer.js.map +1 -0
  390. package/sensor/dist/resolution/path-aliases.d.ts +6 -4
  391. package/sensor/dist/resolution/path-aliases.d.ts.map +1 -1
  392. package/sensor/dist/resolution/path-aliases.js +125 -17
  393. package/sensor/dist/resolution/path-aliases.js.map +1 -1
  394. package/sensor/dist/resolution/react-router-synthesizer.d.ts +33 -0
  395. package/sensor/dist/resolution/react-router-synthesizer.d.ts.map +1 -0
  396. package/sensor/dist/resolution/react-router-synthesizer.js +126 -0
  397. package/sensor/dist/resolution/react-router-synthesizer.js.map +1 -0
  398. package/sensor/dist/resolution/resolver-pool.d.ts +2 -0
  399. package/sensor/dist/resolution/resolver-pool.d.ts.map +1 -1
  400. package/sensor/dist/resolution/resolver-pool.js +4 -0
  401. package/sensor/dist/resolution/resolver-pool.js.map +1 -1
  402. package/sensor/dist/resolution/strip-comments.d.ts +6 -0
  403. package/sensor/dist/resolution/strip-comments.d.ts.map +1 -1
  404. package/sensor/dist/resolution/strip-comments.js +58 -0
  405. package/sensor/dist/resolution/strip-comments.js.map +1 -1
  406. package/sensor/dist/resolution/sveltekit-synthesizer.d.ts +58 -0
  407. package/sensor/dist/resolution/sveltekit-synthesizer.d.ts.map +1 -0
  408. package/sensor/dist/resolution/sveltekit-synthesizer.js +173 -0
  409. package/sensor/dist/resolution/sveltekit-synthesizer.js.map +1 -0
  410. package/sensor/dist/resolution/swift-type-visibility.d.ts +52 -0
  411. package/sensor/dist/resolution/swift-type-visibility.d.ts.map +1 -0
  412. package/sensor/dist/resolution/swift-type-visibility.js +328 -0
  413. package/sensor/dist/resolution/swift-type-visibility.js.map +1 -0
  414. package/sensor/dist/resolution/synth-utils.d.ts +26 -0
  415. package/sensor/dist/resolution/synth-utils.d.ts.map +1 -0
  416. package/sensor/dist/resolution/synth-utils.js +75 -0
  417. package/sensor/dist/resolution/synth-utils.js.map +1 -0
  418. package/sensor/dist/resolution/tanstack-router-synthesizer.d.ts +31 -0
  419. package/sensor/dist/resolution/tanstack-router-synthesizer.d.ts.map +1 -0
  420. package/sensor/dist/resolution/tanstack-router-synthesizer.js +114 -0
  421. package/sensor/dist/resolution/tanstack-router-synthesizer.js.map +1 -0
  422. package/sensor/dist/resolution/tier-synthesizer.d.ts +54 -0
  423. package/sensor/dist/resolution/tier-synthesizer.d.ts.map +1 -0
  424. package/sensor/dist/resolution/tier-synthesizer.js +1294 -0
  425. package/sensor/dist/resolution/tier-synthesizer.js.map +1 -0
  426. package/sensor/dist/resolution/types.d.ts +78 -2
  427. package/sensor/dist/resolution/types.d.ts.map +1 -1
  428. package/sensor/dist/resolution/types.js +64 -0
  429. package/sensor/dist/resolution/types.js.map +1 -1
  430. package/sensor/dist/resolution/vue-router-synthesizer.d.ts +30 -0
  431. package/sensor/dist/resolution/vue-router-synthesizer.d.ts.map +1 -0
  432. package/sensor/dist/resolution/vue-router-synthesizer.js +115 -0
  433. package/sensor/dist/resolution/vue-router-synthesizer.js.map +1 -0
  434. package/sensor/dist/search/identifier-segments.d.ts +10 -0
  435. package/sensor/dist/search/identifier-segments.d.ts.map +1 -1
  436. package/sensor/dist/search/identifier-segments.js +29 -0
  437. package/sensor/dist/search/identifier-segments.js.map +1 -1
  438. package/sensor/dist/search/query-paths.d.ts +106 -0
  439. package/sensor/dist/search/query-paths.d.ts.map +1 -0
  440. package/sensor/dist/search/query-paths.js +513 -0
  441. package/sensor/dist/search/query-paths.js.map +1 -0
  442. package/sensor/dist/search/query-utils.d.ts +22 -2
  443. package/sensor/dist/search/query-utils.d.ts.map +1 -1
  444. package/sensor/dist/search/query-utils.js +56 -16
  445. package/sensor/dist/search/query-utils.js.map +1 -1
  446. package/sensor/dist/sync/watch-policy.d.ts +14 -0
  447. package/sensor/dist/sync/watch-policy.d.ts.map +1 -1
  448. package/sensor/dist/sync/watch-policy.js +19 -0
  449. package/sensor/dist/sync/watch-policy.js.map +1 -1
  450. package/sensor/dist/sync/watcher.d.ts +74 -35
  451. package/sensor/dist/sync/watcher.d.ts.map +1 -1
  452. package/sensor/dist/sync/watcher.js +281 -99
  453. package/sensor/dist/sync/watcher.js.map +1 -1
  454. package/sensor/dist/telemetry/index.d.ts +4 -2
  455. package/sensor/dist/telemetry/index.d.ts.map +1 -1
  456. package/sensor/dist/telemetry/index.js +92 -41
  457. package/sensor/dist/telemetry/index.js.map +1 -1
  458. package/sensor/dist/types.d.ts +18 -2
  459. package/sensor/dist/types.d.ts.map +1 -1
  460. package/sensor/dist/types.js +2 -0
  461. package/sensor/dist/types.js.map +1 -1
  462. package/sensor/dist/ui-server/api/deadcode.d.ts +84 -0
  463. package/sensor/dist/ui-server/api/deadcode.d.ts.map +1 -0
  464. package/sensor/dist/ui-server/api/deadcode.js +136 -0
  465. package/sensor/dist/ui-server/api/deadcode.js.map +1 -0
  466. package/sensor/dist/ui-server/api/effects.d.ts +94 -0
  467. package/sensor/dist/ui-server/api/effects.d.ts.map +1 -0
  468. package/sensor/dist/ui-server/api/effects.js +527 -0
  469. package/sensor/dist/ui-server/api/effects.js.map +1 -0
  470. package/sensor/dist/ui-server/api/entrypoints.d.ts +92 -0
  471. package/sensor/dist/ui-server/api/entrypoints.d.ts.map +1 -0
  472. package/sensor/dist/ui-server/api/entrypoints.js +361 -0
  473. package/sensor/dist/ui-server/api/entrypoints.js.map +1 -0
  474. package/sensor/dist/ui-server/api/events.d.ts +183 -0
  475. package/sensor/dist/ui-server/api/events.d.ts.map +1 -0
  476. package/sensor/dist/ui-server/api/events.js +430 -0
  477. package/sensor/dist/ui-server/api/events.js.map +1 -0
  478. package/sensor/dist/ui-server/api/file.d.ts +66 -0
  479. package/sensor/dist/ui-server/api/file.d.ts.map +1 -0
  480. package/sensor/dist/ui-server/api/file.js +235 -0
  481. package/sensor/dist/ui-server/api/file.js.map +1 -0
  482. package/sensor/dist/ui-server/api/filecode.d.ts +126 -0
  483. package/sensor/dist/ui-server/api/filecode.d.ts.map +1 -0
  484. package/sensor/dist/ui-server/api/filecode.js +205 -0
  485. package/sensor/dist/ui-server/api/filecode.js.map +1 -0
  486. package/sensor/dist/ui-server/api/flow.d.ts +226 -0
  487. package/sensor/dist/ui-server/api/flow.d.ts.map +1 -0
  488. package/sensor/dist/ui-server/api/flow.js +612 -0
  489. package/sensor/dist/ui-server/api/flow.js.map +1 -0
  490. package/sensor/dist/ui-server/api/hierarchy.d.ts +81 -0
  491. package/sensor/dist/ui-server/api/hierarchy.d.ts.map +1 -0
  492. package/sensor/dist/ui-server/api/hierarchy.js +92 -0
  493. package/sensor/dist/ui-server/api/hierarchy.js.map +1 -0
  494. package/sensor/dist/ui-server/api/index.d.ts +90 -0
  495. package/sensor/dist/ui-server/api/index.d.ts.map +1 -0
  496. package/sensor/dist/ui-server/api/index.js +332 -0
  497. package/sensor/dist/ui-server/api/index.js.map +1 -0
  498. package/sensor/dist/ui-server/api/map.d.ts +256 -0
  499. package/sensor/dist/ui-server/api/map.d.ts.map +1 -0
  500. package/sensor/dist/ui-server/api/map.js +760 -0
  501. package/sensor/dist/ui-server/api/map.js.map +1 -0
  502. package/sensor/dist/ui-server/api/node.d.ts +81 -0
  503. package/sensor/dist/ui-server/api/node.d.ts.map +1 -0
  504. package/sensor/dist/ui-server/api/node.js +388 -0
  505. package/sensor/dist/ui-server/api/node.js.map +1 -0
  506. package/sensor/dist/ui-server/api/nodes.d.ts +25 -0
  507. package/sensor/dist/ui-server/api/nodes.d.ts.map +1 -0
  508. package/sensor/dist/ui-server/api/nodes.js +45 -0
  509. package/sensor/dist/ui-server/api/nodes.js.map +1 -0
  510. package/sensor/dist/ui-server/api/program.d.ts +139 -0
  511. package/sensor/dist/ui-server/api/program.d.ts.map +1 -0
  512. package/sensor/dist/ui-server/api/program.js +315 -0
  513. package/sensor/dist/ui-server/api/program.js.map +1 -0
  514. package/sensor/dist/ui-server/api/respond.d.ts +76 -0
  515. package/sensor/dist/ui-server/api/respond.d.ts.map +1 -0
  516. package/sensor/dist/ui-server/api/respond.js +186 -0
  517. package/sensor/dist/ui-server/api/respond.js.map +1 -0
  518. package/sensor/dist/ui-server/api/route-roots.d.ts +39 -0
  519. package/sensor/dist/ui-server/api/route-roots.d.ts.map +1 -0
  520. package/sensor/dist/ui-server/api/route-roots.js +96 -0
  521. package/sensor/dist/ui-server/api/route-roots.js.map +1 -0
  522. package/sensor/dist/ui-server/api/routes.d.ts +59 -0
  523. package/sensor/dist/ui-server/api/routes.d.ts.map +1 -0
  524. package/sensor/dist/ui-server/api/routes.js +108 -0
  525. package/sensor/dist/ui-server/api/routes.js.map +1 -0
  526. package/sensor/dist/ui-server/api/screens.d.ts +117 -0
  527. package/sensor/dist/ui-server/api/screens.d.ts.map +1 -0
  528. package/sensor/dist/ui-server/api/screens.js +611 -0
  529. package/sensor/dist/ui-server/api/screens.js.map +1 -0
  530. package/sensor/dist/ui-server/api/search.d.ts +29 -0
  531. package/sensor/dist/ui-server/api/search.d.ts.map +1 -0
  532. package/sensor/dist/ui-server/api/search.js +232 -0
  533. package/sensor/dist/ui-server/api/search.js.map +1 -0
  534. package/sensor/dist/ui-server/api/session.d.ts +52 -0
  535. package/sensor/dist/ui-server/api/session.d.ts.map +1 -0
  536. package/sensor/dist/ui-server/api/session.js +196 -0
  537. package/sensor/dist/ui-server/api/session.js.map +1 -0
  538. package/sensor/dist/ui-server/api/source.d.ts +200 -0
  539. package/sensor/dist/ui-server/api/source.d.ts.map +1 -0
  540. package/sensor/dist/ui-server/api/source.js +422 -0
  541. package/sensor/dist/ui-server/api/source.js.map +1 -0
  542. package/sensor/dist/ui-server/api/stats.d.ts +27 -0
  543. package/sensor/dist/ui-server/api/stats.d.ts.map +1 -0
  544. package/sensor/dist/ui-server/api/stats.js +164 -0
  545. package/sensor/dist/ui-server/api/stats.js.map +1 -0
  546. package/sensor/dist/ui-server/api/steps.d.ts +274 -0
  547. package/sensor/dist/ui-server/api/steps.d.ts.map +1 -0
  548. package/sensor/dist/ui-server/api/steps.js +1544 -0
  549. package/sensor/dist/ui-server/api/steps.js.map +1 -0
  550. package/sensor/dist/ui-server/api/trail-store.d.ts +142 -0
  551. package/sensor/dist/ui-server/api/trail-store.d.ts.map +1 -0
  552. package/sensor/dist/ui-server/api/trail-store.js +325 -0
  553. package/sensor/dist/ui-server/api/trail-store.js.map +1 -0
  554. package/sensor/dist/ui-server/api/trails.d.ts +163 -0
  555. package/sensor/dist/ui-server/api/trails.d.ts.map +1 -0
  556. package/sensor/dist/ui-server/api/trails.js +369 -0
  557. package/sensor/dist/ui-server/api/trails.js.map +1 -0
  558. package/sensor/dist/ui-server/api/when.d.ts +133 -0
  559. package/sensor/dist/ui-server/api/when.d.ts.map +1 -0
  560. package/sensor/dist/ui-server/api/when.js +275 -0
  561. package/sensor/dist/ui-server/api/when.js.map +1 -0
  562. package/sensor/dist/ui-server/api/wire.d.ts +179 -0
  563. package/sensor/dist/ui-server/api/wire.d.ts.map +1 -0
  564. package/sensor/dist/ui-server/api/wire.js +231 -0
  565. package/sensor/dist/ui-server/api/wire.js.map +1 -0
  566. package/sensor/dist/ui-server/assets.d.ts +40 -0
  567. package/sensor/dist/ui-server/assets.d.ts.map +1 -0
  568. package/sensor/dist/ui-server/assets.js +110 -0
  569. package/sensor/dist/ui-server/assets.js.map +1 -0
  570. package/sensor/dist/ui-server/constants.d.ts +32 -0
  571. package/sensor/dist/ui-server/constants.d.ts.map +1 -0
  572. package/sensor/dist/ui-server/constants.js +35 -0
  573. package/sensor/dist/ui-server/constants.js.map +1 -0
  574. package/sensor/dist/ui-server/highlight/index.d.ts +113 -0
  575. package/sensor/dist/ui-server/highlight/index.d.ts.map +1 -0
  576. package/sensor/dist/ui-server/highlight/index.js +307 -0
  577. package/sensor/dist/ui-server/highlight/index.js.map +1 -0
  578. package/sensor/dist/ui-server/highlight/languages.d.ts +36 -0
  579. package/sensor/dist/ui-server/highlight/languages.d.ts.map +1 -0
  580. package/sensor/dist/ui-server/highlight/languages.js +50 -0
  581. package/sensor/dist/ui-server/highlight/languages.js.map +1 -0
  582. package/sensor/dist/ui-server/index.d.ts +92 -0
  583. package/sensor/dist/ui-server/index.d.ts.map +1 -0
  584. package/sensor/dist/ui-server/index.js +399 -0
  585. package/sensor/dist/ui-server/index.js.map +1 -0
  586. package/sensor/dist/ui-server/open-browser.d.ts +31 -0
  587. package/sensor/dist/ui-server/open-browser.d.ts.map +1 -0
  588. package/sensor/dist/ui-server/open-browser.js +79 -0
  589. package/sensor/dist/ui-server/open-browser.js.map +1 -0
  590. package/sensor/dist/ui-server/security.d.ts +127 -0
  591. package/sensor/dist/ui-server/security.d.ts.map +1 -0
  592. package/sensor/dist/ui-server/security.js +332 -0
  593. package/sensor/dist/ui-server/security.js.map +1 -0
  594. package/sensor/dist/ui-server/static.d.ts +45 -0
  595. package/sensor/dist/ui-server/static.d.ts.map +1 -0
  596. package/sensor/dist/ui-server/static.js +165 -0
  597. package/sensor/dist/ui-server/static.js.map +1 -0
  598. package/sensor/dist/utils.d.ts +14 -2
  599. package/sensor/dist/utils.d.ts.map +1 -1
  600. package/sensor/dist/utils.js +25 -10
  601. package/sensor/dist/utils.js.map +1 -1
  602. package/src/sensor-adapter.mjs +5 -1
@@ -5,18 +5,38 @@
5
5
  */
6
6
  import { SqliteDatabase } from './sqlite-adapter';
7
7
  import { Node, Edge, FileRecord, UnresolvedReference, NodeKind, EdgeKind, Language, GraphStats, SearchOptions, SearchResult } from '../types';
8
+ /**
9
+ * How much of the exact-name bonus a `deprioritize`d path keeps (#982). Damped
10
+ * rather than zeroed: a query that genuinely targets that tree must still rank
11
+ * it, the same "discount, don't erase" rule the path penalty follows.
12
+ *
13
+ * Derived rather than picked. `nameMatchBonus`'s prefix arm tops out below
14
+ * `10 + 30 = 40`, and a de-prioritized node also takes the -15 path penalty, so
15
+ * `80 * SCALE - 15 > 40` is what stops a damped WHOLE-QUERY exact match from
16
+ * losing to a mere prefix match. 0.75 clears it (45). Measured on a 62k-node
17
+ * django index: at 0.25 that invariant breaks in practice — `child`, `parent`
18
+ * and `method` lose rank 1 to `children`, `all_parents` and `method_decorator`
19
+ * — while crowd-out removal is almost flat between 0.75 and 0.5 (39 vs 40 of 88
20
+ * peripheral top-10 slots cleared), so a deeper discount buys little and costs
21
+ * the invariant. Pinned by a test.
22
+ */
23
+ export declare const DEPRIORITIZED_NAME_BONUS_SCALE = 0.75;
8
24
  /**
9
25
  * Query builder for the knowledge graph database
10
26
  */
11
27
  export declare class QueryBuilder {
12
28
  private db;
13
29
  private projectNameTokens;
30
+ private isDeprioritizedPath;
31
+ private _fts5Available;
14
32
  private nodeCache;
15
33
  private readonly maxCacheSize;
34
+ private dominantFileMemo;
16
35
  private stmts;
17
36
  private segmentedNames;
18
37
  private static readonly MAX_SEGMENTED_NAMES;
19
38
  private batchStmts;
39
+ private edgeKindStmts;
20
40
  private static readonly BATCH_SIZES;
21
41
  /**
22
42
  * Run `rows` through a multi-row `INSERT` built as `head + (tuple,)*n`,
@@ -37,11 +57,21 @@ export declare class QueryBuilder {
37
57
  * lazily on next use.
38
58
  */
39
59
  rebind(db: SqliteDatabase): void;
60
+ private edgeKindStmt;
40
61
  /** Set the normalized project-name tokens used to down-weight non-discriminative
41
62
  * query words in path scoring (#720). Called once when the project opens. */
42
63
  setProjectNameTokens(tokens: Set<string>): void;
43
64
  /** The normalized project-name tokens (#720); empty if none were derived. */
44
65
  getProjectNameTokens(): Set<string>;
66
+ /**
67
+ * Set the predicate that marks a path as de-prioritized by the project's
68
+ * `lattice-sensor.json` `deprioritize` patterns (#982). Ranking-only: those paths
69
+ * stay indexed and findable, they just stop outranking first-party code.
70
+ * Called once when the project opens; undefined disables the lever.
71
+ */
72
+ setDeprioritizedPathMatcher(matcher: ((filePath: string) => boolean) | undefined): void;
73
+ /** The `deprioritize` predicate (#982), so other rankers apply the same lever. */
74
+ getDeprioritizedPathMatcher(): ((filePath: string) => boolean) | undefined;
45
75
  /**
46
76
  * Insert a new node
47
77
  */
@@ -157,10 +187,24 @@ export declare class QueryBuilder {
157
187
  * Clear the node cache
158
188
  */
159
189
  clearCache(): void;
190
+ /**
191
+ * Whether any node in `filePath` is exported — `getNodesByFile(f).some((n) =>
192
+ * n.isExported)` as one indexed probe, without decoding the file's nodes.
193
+ */
194
+ fileHasExportedNode(filePath: string): boolean;
195
+ /** The exported nodes of a file, in {@link getNodesByFile} order, decoding only those rows. */
196
+ getExportedNodesByFile(filePath: string): Node[];
197
+ /** The nodes of a file with one name, in {@link getNodesByFile} order, decoding only those rows. */
198
+ getNodesByFileAndName(filePath: string, name: string): Node[];
160
199
  /**
161
200
  * Get all nodes in a file
162
201
  */
163
202
  getNodesByFile(filePath: string): Node[];
203
+ /**
204
+ * Get all nodes in several files at once — one chunked `IN` query rather than
205
+ * one {@link getNodesByFile} per file (#1975).
206
+ */
207
+ getNodesByFiles(filePaths: readonly string[]): Node[];
164
208
  /**
165
209
  * Find the file that holds the densest concentration of the project's
166
210
  * internal call graph — the "core" file. Used by context-builder to
@@ -178,12 +222,29 @@ export declare class QueryBuilder {
178
222
  * Excludes test/spec files from candidacy via path-pattern. The agent's
179
223
  * typical question is "how does X work", not "how is X tested", so
180
224
  * boosting a test file's directory would be a misfire.
225
+ *
226
+ * The answer depends only on the graph, never on the query, and the
227
+ * aggregation behind it scans every edge — seconds on a large index, paid
228
+ * by every generic explore (#1864). So it is memoized per database change
229
+ * stamp: recomputed only after something wrote to the database.
181
230
  */
182
231
  getDominantFile(): {
183
232
  filePath: string;
184
233
  edgeCount: number;
185
234
  nextEdgeCount: number;
186
235
  } | null;
236
+ /**
237
+ * A value that differs whenever the database content may have changed
238
+ * since the last call, whoever changed it: `total_changes()` counts the
239
+ * rows this connection inserted, updated or deleted, and
240
+ * `PRAGMA data_version` moves when any OTHER connection — another process's
241
+ * sync, a CLI `lattice sensor index` beside a running MCP server — commits. Both
242
+ * are O(1), so no write path has to remember to invalidate anything.
243
+ * Coarse on purpose: any write, not just one to nodes/edges, forces a
244
+ * recompute, which only costs time, never a stale answer.
245
+ */
246
+ private getChangeStamp;
247
+ private computeDominantFile;
187
248
  /**
188
249
  * Find the file that holds the densest concentration of the project's
189
250
  * `route` nodes (framework-emitted: Express/Gin/Flask/Rails/Drupal/etc.).
@@ -219,6 +280,10 @@ export declare class QueryBuilder {
219
280
  handlerFile: string;
220
281
  handlerLine: number;
221
282
  handlerKind: string;
283
+ /** The route node itself: where the URL is REGISTERED, not where it is served. */
284
+ routeId: string;
285
+ routeFile: string;
286
+ routeLine: number;
222
287
  }>;
223
288
  topHandlerFile: string | null;
224
289
  topHandlerFileCount: number;
@@ -236,6 +301,14 @@ export declare class QueryBuilder {
236
301
  * memory O(1) in the node count rather than O(nodes) (#610).
237
302
  */
238
303
  iterateNodesByKind(kind: NodeKind): IterableIterator<Node>;
304
+ /**
305
+ * iterateNodesByKind narrowed to some languages, in the same canonical
306
+ * order — the ORDER BY is total (`id` is unique), so this yields exactly the
307
+ * nodes a caller filtering iterateNodesByKind by language would keep, in the
308
+ * same sequence. A Go pass on a TypeScript monorepo otherwise materialized
309
+ * every method in the project to find a couple of Go ones.
310
+ */
311
+ iterateNodesByKindIn(kind: NodeKind, languages: readonly string[]): IterableIterator<Node>;
239
312
  /**
240
313
  * Get all nodes in the database
241
314
  */
@@ -258,7 +331,22 @@ export declare class QueryBuilder {
258
331
  */
259
332
  getDistinctFileLanguages(): Set<string>;
260
333
  /**
261
- * Get nodes by exact name match (uses idx_nodes_name index)
334
+ * Get nodes by exact name match (uses idx_nodes_name index).
335
+ *
336
+ * This is resolution's candidate list, and the ORDER BY is load-bearing for
337
+ * index correctness, not cosmetic (CG-33). When a reference names a symbol
338
+ * that several files define and nothing disambiguates them, resolution binds
339
+ * to the first candidate — so without an ORDER BY the winner was decided by
340
+ * rowid, i.e. by the order files happened to be WRITTEN. A full index writes
341
+ * them in scan order; an incremental sync appends each file as it changes, so
342
+ * the same tree resolved to different edges depending on how the index was
343
+ * built, and a long-lived synced index drifted away from a rebuild of itself
344
+ * (measured at 4.3% of distinct edges, mostly `calls`).
345
+ *
346
+ * `(file_path, start_line)` is a property of the CODE, so both paths now pick
347
+ * the same candidate. The sort is paid once per distinct name per resolution
348
+ * run — ReferenceResolver memoizes this in its nameCache — and the population
349
+ * is capped by AMBIGUOUS_NAME_CEILING (#999).
262
350
  */
263
351
  getNodesByName(name: string): Node[];
264
352
  /**
@@ -266,14 +354,27 @@ export declare class QueryBuilder {
266
354
  * skip idx_nodes_name under SQLite's default case-insensitive LIKE).
267
355
  */
268
356
  getNodesByNamePrefix(prefix: string, limit?: number): Node[];
357
+ /** File nodes whose basename starts with `prefix`, without a result cap. */
358
+ getFileNodesByNamePrefix(prefix: string): Node[];
269
359
  /**
270
360
  * Get nodes by exact qualified name match (uses idx_nodes_qualified_name index)
271
361
  */
272
362
  getNodesByQualifiedNameExact(qualifiedName: string): Node[];
273
363
  /**
274
- * Get nodes by lowercase name match (uses idx_nodes_lower_name expression index)
364
+ * Get nodes by name, case-insensitively (seeks the idx_nodes_lower_name
365
+ * expression index).
366
+ *
367
+ * The parameter is lowered in SQL rather than trusted to arrive lowered, so
368
+ * the lookup means the same thing whatever casing a caller hands it. Written
369
+ * as a bare `lower(name) = ?` it silently returned nothing for any input
370
+ * carrying an uppercase letter, and — because SQLite's `lower()` folds ASCII
371
+ * only while JavaScript's `.toLowerCase()` folds Unicode — a caller that
372
+ * pre-lowered in JavaScript could not match a non-ASCII name at all.
373
+ *
374
+ * Note this hardens the query, not its one caller: `matchFuzzy` still lowers
375
+ * in JavaScript before calling, so the non-ASCII gap remains open there.
275
376
  */
276
- getNodesByLowerName(lowerName: string): Node[];
377
+ getNodesByLowerName(name: string): Node[];
277
378
  /**
278
379
  * Search nodes by name using FTS with fallback to LIKE for better matching
279
380
  *
@@ -299,6 +400,13 @@ export declare class QueryBuilder {
299
400
  * node count on any real codebase.
300
401
  */
301
402
  private searchNodesFuzzy;
403
+ /** Bounded miss diagnostics, independent of relevance filters and ranking. */
404
+ getExploreMissDiagnostics(query: string): {
405
+ matched: string[];
406
+ unmatched: string[];
407
+ candidates: string[];
408
+ limited: boolean;
409
+ };
302
410
  /**
303
411
  * FTS5 search with prefix matching
304
412
  */
@@ -329,6 +437,10 @@ export declare class QueryBuilder {
329
437
  findNodesByNameSubstring(substring: string, options?: SearchOptions & {
330
438
  excludePrefix?: boolean;
331
439
  }): SearchResult[];
440
+ /** Must run before file replacement/deletion cascades the endpoint edges. */
441
+ hasSynthesizedEdgesTouchingFile(filePath: string): boolean;
442
+ wasSynthesisInput(filePath: string): boolean;
443
+ replaceSynthesisInputs(files: string[]): void;
332
444
  /**
333
445
  * Insert a new edge
334
446
  */
@@ -342,13 +454,318 @@ export declare class QueryBuilder {
342
454
  */
343
455
  deleteEdgesBySource(sourceId: string): void;
344
456
  /**
345
- * Get outgoing edges from a node
457
+ * Get outgoing edges from a node. Preserve the source/kind index order
458
+ * (calls before imports/references), then break ties deterministically.
346
459
  */
347
460
  getOutgoingEdges(sourceId: string, kinds?: EdgeKind[], provenance?: string): Edge[];
348
461
  /**
349
- * Get incoming edges to a node
462
+ * Get incoming edges to a node. Kind must precede opaque source IDs:
463
+ * file IDs sort before function IDs, so source-first ordering lets imports
464
+ * displace actual calls in capped caller lists. Keep deterministic ties
465
+ * without changing the target/kind index's established kind precedence.
350
466
  */
351
467
  getIncomingEdges(targetId: string, kinds?: EdgeKind[]): Edge[];
468
+ /**
469
+ * Outgoing edges for MANY source nodes in one query.
470
+ *
471
+ * The batch form of {@link getOutgoingEdges}. Building a nested outline needs
472
+ * the `contains` edges of every container in a file at once; doing that one
473
+ * source at a time is a query per symbol on files that have hundreds.
474
+ */
475
+ getOutgoingEdgesFrom(sourceIds: readonly string[], kinds?: EdgeKind[]): Edge[];
476
+ /**
477
+ * Fan-in (total incoming edge count) for MANY nodes in one query.
478
+ *
479
+ * The per-node alternative — `getIncomingEdges(id).length` — is an indexed
480
+ * lookup each, but a symbol screen rendering a couple of hundred callees
481
+ * would issue a couple of hundred of them. Ids with no incoming edges are
482
+ * absent from the map rather than present as 0, so callers can tell "no
483
+ * edges" from "not asked about".
484
+ */
485
+ countIncomingEdges(ids: readonly string[]): Map<string, number>;
486
+ /**
487
+ * Incoming edges for MANY target nodes in one query — the mirror of
488
+ * {@link getOutgoingEdgesFrom}. Needed wherever a whole file's inbound edges
489
+ * are wanted at once ("which files import anything in this one?").
490
+ */
491
+ getIncomingEdgesTo(targetIds: readonly string[], kinds?: EdgeKind[]): Edge[];
492
+ /**
493
+ * Fan-out (total outgoing edge count) for MANY nodes in one query — the
494
+ * mirror of {@link countIncomingEdges}. Ids with no outgoing edges are absent
495
+ * from the map rather than present as 0.
496
+ */
497
+ countOutgoingEdges(ids: readonly string[]): Map<string, number>;
498
+ /**
499
+ * Symbols nothing in the index points at — the candidate set behind the dead
500
+ * code list (`src/graph/dead-code.ts`).
501
+ *
502
+ * "Points at" is every edge kind EXCEPT `contains`: a class containing a
503
+ * method is structure, not use, and counting it would make every member look
504
+ * reached by its own container. A self-edge is excluded for the same reason
505
+ * a recursive function is not its own caller.
506
+ *
507
+ * One scan, one index probe per candidate. `NOT EXISTS` over
508
+ * `idx_edges_target_kind` is what keeps it that way — the alternative
509
+ * (`LEFT JOIN edges … GROUP BY`) builds a row per edge for the whole table
510
+ * before discarding all but the empty groups. Ordered by position so the
511
+ * answer is stable across runs and groups by file without a second sort.
512
+ *
513
+ * The result is deliberately NOT called dead code: an unreferenced symbol is
514
+ * a symbol with no STATIC reference, and the caller applies the exclusions
515
+ * (tests, generated files, overrides, unresolved names) that turn the
516
+ * candidate set into a claim worth making.
517
+ */
518
+ getUnreferencedNodes(kinds: readonly string[], limit: number): Array<{
519
+ node: Node;
520
+ generated: boolean;
521
+ }>;
522
+ /**
523
+ * Which of `names` the index holds an UNRESOLVED reference to.
524
+ *
525
+ * The point is honesty about our own blind spots. A `failed` row in
526
+ * `unresolved_refs` records that some file referenced a name and the resolver
527
+ * could not decide what it meant — so a symbol with that name cannot be
528
+ * called unreferenced, whatever the edge table says. It is deliberately
529
+ * matched loosely, on the reference name AND on its tail (`util.greet` →
530
+ * `greet`), because the question being asked is "could this name be the one
531
+ * we failed to follow", and a maybe has to count as a yes.
532
+ *
533
+ * Bounded-lookup like {@link getGeneratedPathsAmong}: the caller holds a
534
+ * candidate list, so this is a chunked probe over `idx_unresolved_name`, not
535
+ * a scan of the table.
536
+ */
537
+ getUnresolvedNamesAmong(names: Iterable<string>): Set<string>;
538
+ /**
539
+ * Which of `nodeIds` extend or implement a type the resolver could not follow.
540
+ * An ancestor outside the index (`React.Component`, `stream.Transform`, a
541
+ * framework interface) leaves no edge, only this `extends` / `implements`
542
+ * row, so it is the one record that such an ancestor exists (#1973).
543
+ * Chunked probe over `idx_unresolved_from_node`.
544
+ */
545
+ getUnresolvedSupertypeSourcesAmong(nodeIds: Iterable<string>): Set<string>;
546
+ /**
547
+ * Which of `names` are carried by MORE THAN ONE symbol, at least one of which
548
+ * something points at.
549
+ *
550
+ * The false positive this exists to kill: `LatticeSensor.getTopRouteFile` calls
551
+ * `this.queries.getTopRouteFile()`, and the resolver — which prefers a
552
+ * same-name definition in the call site's own file — attaches that edge to
553
+ * the *calling* method. One of the two ends up with a self-edge and the other
554
+ * with nothing at all, and neither is unreferenced. From the edge table the
555
+ * mis-resolution and a genuinely unused twin are the same picture, so the
556
+ * claim is not made about either.
557
+ *
558
+ * Both halves of the condition are load-bearing. **More than one symbol**:
559
+ * a uniquely-named function that only calls itself is genuinely dead, and
560
+ * excluding every recursive function would gut the list. **Self-edges
561
+ * counted**: the self-edge IS the fingerprint of the mis-resolution above, so
562
+ * it has to count as evidence that this name resolves somewhere.
563
+ *
564
+ * Chunked probe over `idx_nodes_name`, bounded by the caller's candidate list.
565
+ */
566
+ getAmbiguousReferencedNames(names: Iterable<string>): Set<string>;
567
+ /**
568
+ * Which of the given languages the index records an EXPORT marker for.
569
+ *
570
+ * A self-measurement, and the honest basis for a whole class of exclusion.
571
+ * The dead code report's strongest filter is "exported symbols may be reached
572
+ * from outside this repository" — and that filter silently does nothing for a
573
+ * language whose exports are not recorded, either because the extractor does
574
+ * not record them (Rust `pub`) or because the language has no such concept at
575
+ * all (Python, C, Ruby: the header or the module IS the surface). Rather than
576
+ * carry a table of which is which, ask the index: if nothing in this language
577
+ * is marked exported, the filter did not run, and no claim about outside
578
+ * reachability can be made for it.
579
+ *
580
+ * `idx_nodes_language` covers the grouping; the caller passes the handful of
581
+ * languages its candidates are actually in.
582
+ */
583
+ getLanguagesWithExports(languages: Iterable<string>): Set<string>;
584
+ /**
585
+ * The nodes with the most DISTINCT dependents, most first.
586
+ *
587
+ * "Distinct" is the difference that matters: a helper called forty times from
588
+ * one function has a fan-in of 40 but exactly one dependent. This counts the
589
+ * second thing — the number a reader means by "N callers" — so the top of
590
+ * this list is the set of symbols a change actually radiates furthest from.
591
+ *
592
+ * `contains` is excluded because it is structure, not dependency: counting it
593
+ * would rank every file and class above the code they hold.
594
+ */
595
+ getTopDependedOn(limit: number): Array<{
596
+ nodeId: string;
597
+ dependents: number;
598
+ }>;
599
+ /**
600
+ * The graph's executable roots — files that RUN something at module level,
601
+ * ranked by how much of the project they set in motion.
602
+ *
603
+ * The engine records a statement at the top level of a file as an edge from
604
+ * the *file* node, so `src/bin/lattice-sensor.ts` calling `program.parse()` at
605
+ * module scope is a `calls` edge out of a `file`. That set is what makes the
606
+ * roots of a dependency graph visible: a library module holds definitions and
607
+ * runs nothing until someone imports it, while a CLI, a worker entry or a
608
+ * build script does its work on the way down the file. `instantiates` counts
609
+ * the same way — `new Server(...)` at module scope is the same act.
610
+ *
611
+ * A call made while initializing a module-level `variable` / `constant` —
612
+ * `const service = new Service()`, `app = FastAPI()` — is attributed to the
613
+ * declared name (#693), not to the file, so the file's own edges alone would
614
+ * miss most of what a real entry point runs. Those names are the file's
615
+ * top-level code too, so `tops` counts them alongside the file node.
616
+ *
617
+ * Ranking multiplies the two things an entry point does: it runs (calls), and
618
+ * it wires the project together (distinct other files its symbols reach). One
619
+ * alone is misleading — a registration table makes hundreds of module-level
620
+ * calls into itself, and a barrel file imports everything and runs nothing.
621
+ * The product puts the file that does both at the top.
622
+ */
623
+ getTopCallingFiles(limit: number): Array<{
624
+ nodeId: string;
625
+ filePath: string;
626
+ calls: number;
627
+ reaches: number;
628
+ score: number;
629
+ }>;
630
+ /**
631
+ * How many OTHER files depend on each of the given files.
632
+ *
633
+ * Counted through the symbols, not the file nodes: an `imports` edge points
634
+ * at the imported symbol, so a file node almost never receives one and
635
+ * counting edges into it would report every file as depended on by nobody.
636
+ * Same-file edges are excluded, which is what makes zero mean "nothing else
637
+ * in the index reaches into this file" — the honest reading of a root.
638
+ */
639
+ getFileDependentCounts(filePaths: string[]): Array<{
640
+ filePath: string;
641
+ dependents: number;
642
+ }>;
643
+ /**
644
+ * How far each of the given files reaches OUT: distinct other files its
645
+ * symbols touch, and how many references that is.
646
+ *
647
+ * The mirror of {@link getFileDependentCounts}, and the same reasoning about
648
+ * `contains` and same-file edges applies. It is driven from `nodes` rather
649
+ * than from `edges` so the work is proportional to the files asked about —
650
+ * the entry-points endpoint asks it about every test file in the index, and
651
+ * an edge-first plan would scan the whole table to answer a question about a
652
+ * tenth of it.
653
+ */
654
+ getFileReachCounts(filePaths: string[]): Array<{
655
+ filePath: string;
656
+ reaches: number;
657
+ refs: number;
658
+ }>;
659
+ /**
660
+ * The `file` nodes for the given paths, in one query.
661
+ *
662
+ * A file's own node is what makes a file row navigable, and looking it up
663
+ * with {@link getNodesInFile} means materialising every symbol in the file to
664
+ * throw all but one away.
665
+ */
666
+ getFileNodes(filePaths: string[]): Node[];
667
+ /**
668
+ * Roll the whole edge table up to module granularity in one pass.
669
+ *
670
+ * The caller decides what a module IS — it hands in a file → module
671
+ * assignment and gets back the cross-module traffic. That split is
672
+ * deliberate: naming modules is a *policy* (top-level directories, a façade
673
+ * file kept separate, a monorepo root) that belongs where the reader lives,
674
+ * while grouping a million edges by it is *mechanics* that must happen in
675
+ * SQLite. Doing the fold in JavaScript instead means materialising every
676
+ * cross-file edge in memory; doing the naming in SQL means a tower of
677
+ * `instr`/`substr` no one can read.
678
+ *
679
+ * The assignment lands in a TEMP table with a primary key, so the join is
680
+ * indexed and the result set is bounded by modules², not by edges. Temp
681
+ * tables live in SQLite's own temp database, so this stays valid against a
682
+ * read-only main.
683
+ *
684
+ * Two result sets, because they need two different groupings over the same
685
+ * join: `links` counts edges per (module, module, kind), and `pairs` names
686
+ * the busiest symbol pairs behind each link (the map's tooltip). `pairs` is
687
+ * ranked and cut inside SQLite — the un-cut grouping is the one thing here
688
+ * that scales with distinct symbol names rather than with modules. Pairs are
689
+ * ranked by `declared` before raw count, so a link's tooltip names the
690
+ * symbols the source actually points at rather than whichever `has`/`get`
691
+ * happened to name-match most often.
692
+ *
693
+ * `declared` is the subset of a link's edges that came from something the
694
+ * source *writes down*: an import, a qualified name, an inheritance clause,
695
+ * or a call through a typed receiver. It exists because bare name matching
696
+ * (`resolvedBy: 'exact-match'`) is what invents cross-module links out of
697
+ * common method names — `run`, `push`, `finish` — and a map that lets those
698
+ * decide the layering puts the storage layer above the CLI.
699
+ */
700
+ aggregateModuleGraph(assignments: ReadonlyArray<{
701
+ filePath: string;
702
+ module: string;
703
+ }>, options: {
704
+ kinds: readonly EdgeKind[];
705
+ minConfidence: number;
706
+ topPairsPerLink: number;
707
+ pairKinds: readonly EdgeKind[];
708
+ }): {
709
+ links: Array<{
710
+ source: string;
711
+ target: string;
712
+ kind: EdgeKind;
713
+ count: number;
714
+ declared: number;
715
+ uncertain: number;
716
+ }>;
717
+ pairs: Array<{
718
+ source: string;
719
+ target: string;
720
+ from: string;
721
+ to: string;
722
+ count: number;
723
+ declared: number;
724
+ }>;
725
+ };
726
+ /**
727
+ * Every ordered pair of files where one reaches into the other, once each.
728
+ *
729
+ * The input a cycle finder wants: file-level circular dependencies are the
730
+ * strongly connected components of this graph. One query instead of the
731
+ * dependency lookup per file that {@link GraphQueryManager.findCircularDependencies}
732
+ * does — which matters because a cycle report is only interesting on a large
733
+ * repo, and that is exactly where a query per file stops being affordable.
734
+ *
735
+ * `contains` is excluded (a file "contains" its own symbols, which is not a
736
+ * dependency), and so are same-file edges and low-confidence name matches:
737
+ * a cycle conjured by a common method name is a false alarm a reader cannot
738
+ * check.
739
+ */
740
+ getCrossFileDependencyPairs(minConfidence: number): Array<{
741
+ source: string;
742
+ target: string;
743
+ }>;
744
+ /**
745
+ * Every unresolved reference recorded in one FILE, ordered by line.
746
+ *
747
+ * The per-symbol form above answers "what does this body reach that the
748
+ * index does not hold". A whole-file reader asks the same question of every
749
+ * line at once, and asking it one symbol at a time is a query per symbol —
750
+ * 153 of them on this repo's largest file. `unresolved_refs.file_path` is
751
+ * indexed, so this is one lookup whatever the file holds.
752
+ *
753
+ * `limit` bounds the answer rather than the work: the caller draws a marker
754
+ * per row, and a generated file with fifty thousand of them would ship
755
+ * megabytes to say something a count already says. Rows come back in line
756
+ * order, so a cap trims the END of the file, which is at least legible.
757
+ */
758
+ getUnresolvedReferencesInFile(filePath: string, limit?: number): UnresolvedReference[];
759
+ /**
760
+ * References recorded against a symbol that never resolved to a node — the
761
+ * calls and type mentions that leave the index (a third-party package, a
762
+ * runtime builtin, a language construct extraction doesn't model).
763
+ *
764
+ * Read-only. It exists so a reader can say "N calls into symbols outside the
765
+ * index" instead of silently showing a callee list shorter than the body's
766
+ * call sites, which reads as "nothing else happens here".
767
+ */
768
+ getUnresolvedReferencesFrom(fromNodeId: string): UnresolvedReference[];
352
769
  /**
353
770
  * Find all edges where both source and target are in the given node set.
354
771
  * Useful for recovering inter-node connectivity after BFS.
@@ -422,6 +839,90 @@ export declare class QueryBuilder {
422
839
  * wonder why the index never converges.
423
840
  */
424
841
  getExtractionAheadFileCount(currentVersion: number): number;
842
+ /**
843
+ * Which of `filePaths` the index flagged as tool-generated (schema v9+).
844
+ *
845
+ * Bounded-lookup by design: every consumer already holds a short candidate
846
+ * list (a ranked file group, an FTS result page, a LIMIT-20 aggregate), so
847
+ * this stays a partial-index probe over a handful of paths — no whole-repo
848
+ * set to materialize, and no cache to invalidate, which means a ranking call
849
+ * can never serve a verdict the last sync already replaced.
850
+ *
851
+ * Returns ONLY the content/index signal; callers union it with
852
+ * {@link isGeneratedFile} so pre-v9 databases (column present, all zeros
853
+ * until a re-index) keep the path-only behavior rather than regressing.
854
+ */
855
+ getGeneratedPathsAmong(filePaths: Iterable<string>): Set<string>;
856
+ /**
857
+ * A reusable `(path) => boolean` over a bounded candidate list, unioning the
858
+ * indexed flag with the path convention. This is the shape every ranking
859
+ * comparator wants: one query up front, then O(1) per comparison.
860
+ */
861
+ generatedPredicateFor(filePaths: Iterable<string>): (filePath: string) => boolean;
862
+ /**
863
+ * Which of `filePaths` are AMBIENT DECLARATION files — they declare nothing
864
+ * but types, and nothing in the index depends on them (CG-28). A hand-written
865
+ * ambient `.d.ts` of global shims, a vendored typings file, module
866
+ * augmentation: reachable only by name, structurally attached to nothing.
867
+ *
868
+ * Structural, not extension-based, so a hand-written `types.ts` and a `.d.ts`
869
+ * are judged by the same rule and a `.d.ts` that does declare a class or a
870
+ * const is (correctly) not caught. Four conditions, all required:
871
+ *
872
+ * 1. it declares at least one symbol — an empty or unparsed file is not a
873
+ * declaration file, it is a file we know nothing about;
874
+ * 2. EVERY declared symbol is a type-level kind (interface / type alias /
875
+ * enum / namespace). The narrowness is deliberate and measured: a rule
876
+ * of "no callables" alone flags 1–18% of a repo, including Kotlin sealed
877
+ * classes, Rust `mod.rs` re-exports and django's locale constant tables —
878
+ * real source that must not be demoted. This rule flags 0–4%;
879
+ * 3. no symbol in it originates a `calls`/`instantiates` edge — the direct
880
+ * evidence that nothing here has a body;
881
+ * 4. NOTHING ELSE IN THE INDEX points at it. This is the condition that
882
+ * separates an ambient shim from a working type module, and it is why
883
+ * the flag is narrow enough to be safe: `displacement-ts`'s pipeline
884
+ * `types.ts` passes 1–3 identically but carries 13 inbound imports and
885
+ * 21 references, so the files that answer a query about the pipeline are
886
+ * typed BY it — it is part of that answer's structure. An ambient
887
+ * `declare global` shim has zero. Deliberately index-wide rather than
888
+ * restricted to the candidate list: the file that imports it is usually
889
+ * not itself a candidate.
890
+ *
891
+ * ### Interface MEMBERS are transparent to all four conditions
892
+ *
893
+ * A `method_signature` / `property_signature` inside an interface enters the
894
+ * graph as a `method` / `property` node (#1638). Read literally that would
895
+ * break every condition here at once: condition 2 sees non-type kinds and
896
+ * stops flagging, and — worse, because it is silent — condition 4 starts
897
+ * seeing inbound `calls` edges the moment a call site through the shim's API
898
+ * finally has a signature to land on. An ambient `.d.ts` would quietly lose
899
+ * its damping precisely BECAUSE the platform API it declares is widely used.
900
+ *
901
+ * So an interface-owned member is treated the way `parameter` already is: it
902
+ * neither qualifies, disqualifies, nor counts as inbound dependency. That is
903
+ * not a new judgement call, it is what keeps the rule measuring what it was
904
+ * measured on — before #1638 these nodes did not exist, so excluding them
905
+ * reproduces the 0–4% flag rate the thresholds above were tuned against. It
906
+ * is also the semantically right answer: a signature with no body is on the
907
+ * same side of the line as the interface that owns it, and a call edge
908
+ * landing on one is still not a file that can answer a flow question.
909
+ *
910
+ * The interface ITSELF is untouched: the `references` edges an importing
911
+ * module aims at `UploadStorage` still disqualify the file under (4), which
912
+ * is what keeps a depended-on `types.ts` out of the flag.
913
+ *
914
+ * Bounded-lookup like {@link getGeneratedPathsAmong}: callers hold a ranked
915
+ * candidate list, so this is a partial-index probe over a handful of paths.
916
+ */
917
+ getAmbientDeclarationPathsAmong(filePaths: Iterable<string>): Set<string>;
918
+ /**
919
+ * A reusable `(path) => boolean` ambient-declaration test over a bounded
920
+ * candidate list — the shape a ranking comparator wants: one query up front,
921
+ * O(1) per comparison.
922
+ */
923
+ ambientDeclarationPredicateFor(filePaths: Iterable<string>): (filePath: string) => boolean;
924
+ /** How many indexed files carry the generated flag. Surfaced by `status`. */
925
+ countGeneratedFiles(): number;
425
926
  /**
426
927
  * Delete a file record and its nodes
427
928
  */
@@ -439,6 +940,33 @@ export declare class QueryBuilder {
439
940
  * null when nothing is indexed yet. One indexed aggregate, no per-row scan. (#329)
440
941
  */
441
942
  getLastIndexedAt(): number | null;
943
+ /**
944
+ * The index's revision marker: how far the last sync got, and how many files
945
+ * it left behind — one query, both numbers.
946
+ *
947
+ * This is the cheapest honest answer to "has the index moved since I last
948
+ * looked". `MAX(indexed_at)` alone is not enough: a sync that only DELETES
949
+ * files (a branch checkout that removed a directory) advances nothing, and
950
+ * the graph the viewer is showing has still changed underneath it. The row
951
+ * count catches exactly that case.
952
+ */
953
+ getIndexRevision(): {
954
+ lastIndexedAt: number | null;
955
+ fileCount: number;
956
+ };
957
+ /**
958
+ * Files re-indexed strictly after `since` (ms since epoch), newest first.
959
+ *
960
+ * `total` is the real count; `paths` is capped at `limit`. Used by the
961
+ * viewer's live channel to name what a sync just picked up. A file the same
962
+ * sync DELETED cannot appear here — it has no row left — which is why the
963
+ * caller compares {@link getIndexRevision} as well rather than treating an
964
+ * empty list as "nothing happened".
965
+ */
966
+ getFilesIndexedSince(since: number, limit: number): {
967
+ paths: string[];
968
+ total: number;
969
+ };
442
970
  /**
443
971
  * Get files that need re-indexing (hash changed)
444
972
  */
@@ -486,7 +1014,7 @@ export declare class QueryBuilder {
486
1014
  * (§7a.2) — while the seek is O(batch) forever. `id` is the rowid alias, so
487
1015
  * the enumeration order is identical to the OFFSET reader's.
488
1016
  */
489
- getUnresolvedReferencesBatchAfter(afterRowId: number, limit: number): UnresolvedReference[];
1017
+ getUnresolvedReferencesBatchAfter(afterRowId: number, limit: number, prerequisites?: boolean): UnresolvedReference[];
490
1018
  /**
491
1019
  * Get all tracked file paths (lightweight — no full FileRecord objects)
492
1020
  */
@@ -579,11 +1107,60 @@ export declare class QueryBuilder {
579
1107
  * arbitrary subset would be both wasted work and incoherent coverage.
580
1108
  */
581
1109
  getRetryableFailedReferences(names: string[], perNameCeiling?: number): UnresolvedReference[];
1110
+ /**
1111
+ * Resolution edges whose TARGET symbol is named one of `names` — the edges a
1112
+ * sync must re-resolve after `names` gained or lost a definition (CG-33).
1113
+ *
1114
+ * Resolution binds a reference to a node whose name matches the reference's
1115
+ * tail, and it picks among ALL same-named definitions project-wide. So adding
1116
+ * or removing one definition of `pct` changes the answer for every `pct(...)`
1117
+ * reference in the repo — including references in files this sync never
1118
+ * touches, whose edges nothing else revisits. Those edges' current target is,
1119
+ * by that same rule, a node named `pct`, which is why the target's name is a
1120
+ * sufficient (and index-backed, via idx_nodes_name) way to find them without
1121
+ * a schema change or a scan of edge metadata.
1122
+ *
1123
+ * Returns the source file/language alongside each edge so the caller can
1124
+ * resurrect it as its original reference. Excludes `provenance='heuristic'`
1125
+ * (synthesized dispatch edges are not resolution output and carry no refName
1126
+ * stamp to resurrect from — deleting one would be a permanent loss).
1127
+ *
1128
+ * Names matching more than `perNameCeiling` edges are skipped entirely, same
1129
+ * rationale and same default as {@link getRetryableFailedReferences}: at that
1130
+ * population the name is generic (`get`, `clear`, …), one definition changing
1131
+ * won't flip most of them, and rebinding an arbitrary subset is both wasted
1132
+ * work and incoherent coverage.
1133
+ */
1134
+ getResolutionEdgesByTargetName(names: string[], perNameCeiling?: number): Array<Edge & {
1135
+ edgeId: number;
1136
+ sourceFilePath: string;
1137
+ sourceLanguage: Language;
1138
+ }>;
1139
+ /** Delete edges by primary key — the rebind pass's half of a re-resolution. */
1140
+ deleteEdgesByIds(edgeIds: number[]): number;
1141
+ /**
1142
+ * Replace resolution edges with their original unresolved references as one
1143
+ * transaction. If ref insertion fails, the edge deletion is rolled back.
1144
+ */
1145
+ replaceResolutionEdgesWithUnresolvedRefs(edgeIds: number[], refs: UnresolvedReference[]): number;
582
1146
  /**
583
1147
  * Distinct node names present in the given files — the symbol names a sync
584
1148
  * pass uses to look up retryable failed refs after those files changed.
585
1149
  */
586
1150
  getNodeNamesByFiles(filePaths: string[]): string[];
1151
+ /**
1152
+ * Distinct `file\0name` pairs defined by the given files — the shape sync's
1153
+ * definition delta needs (CG-33).
1154
+ *
1155
+ * Deliberately NOT `getNodeNamesByFiles`: a bare name set is taken over the
1156
+ * WHOLE changed batch, so a name that moves between two files in one commit
1157
+ * (or exists in one changed file and is newly added to another) appears on
1158
+ * both sides and cancels out of the symmetric difference — even though a
1159
+ * definition genuinely appeared or vanished and every reference to that name
1160
+ * repo-wide may now bind elsewhere. Keying by file makes each definition its
1161
+ * own fact, so the move is seen as one removal plus one addition.
1162
+ */
1163
+ getNodeNamePairsByFiles(filePaths: string[]): Set<string>;
587
1164
  /**
588
1165
  * Lightweight (nodes, edges) count snapshot. Used around an index/sync
589
1166
  * run to compute true additions across extraction + resolution +