@colbymchenry/codegraph-win32-x64 1.2.0 → 1.3.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 (231) hide show
  1. package/lib/dist/bin/codegraph.d.ts +1 -1
  2. package/lib/dist/bin/codegraph.d.ts.map +1 -1
  3. package/lib/dist/bin/codegraph.js +232 -61
  4. package/lib/dist/bin/codegraph.js.map +1 -1
  5. package/lib/dist/bin/command-supervision.d.ts.map +1 -1
  6. package/lib/dist/bin/command-supervision.js +4 -1
  7. package/lib/dist/bin/command-supervision.js.map +1 -1
  8. package/lib/dist/db/index.d.ts +17 -5
  9. package/lib/dist/db/index.d.ts.map +1 -1
  10. package/lib/dist/db/index.js +68 -12
  11. package/lib/dist/db/index.js.map +1 -1
  12. package/lib/dist/db/migrations.d.ts +1 -1
  13. package/lib/dist/db/migrations.d.ts.map +1 -1
  14. package/lib/dist/db/migrations.js +19 -1
  15. package/lib/dist/db/migrations.js.map +1 -1
  16. package/lib/dist/db/queries.d.ts +76 -1
  17. package/lib/dist/db/queries.d.ts.map +1 -1
  18. package/lib/dist/db/queries.js +180 -0
  19. package/lib/dist/db/queries.js.map +1 -1
  20. package/lib/dist/db/schema.sql +19 -0
  21. package/lib/dist/directory.d.ts +9 -5
  22. package/lib/dist/directory.d.ts.map +1 -1
  23. package/lib/dist/directory.js +210 -19
  24. package/lib/dist/directory.js.map +1 -1
  25. package/lib/dist/extraction/cfml-extractor.d.ts +107 -0
  26. package/lib/dist/extraction/cfml-extractor.d.ts.map +1 -0
  27. package/lib/dist/extraction/cfml-extractor.js +494 -0
  28. package/lib/dist/extraction/cfml-extractor.js.map +1 -0
  29. package/lib/dist/extraction/grammars.d.ts +9 -0
  30. package/lib/dist/extraction/grammars.d.ts.map +1 -1
  31. package/lib/dist/extraction/grammars.js +115 -3
  32. package/lib/dist/extraction/grammars.js.map +1 -1
  33. package/lib/dist/extraction/index.d.ts +46 -1
  34. package/lib/dist/extraction/index.d.ts.map +1 -1
  35. package/lib/dist/extraction/index.js +338 -34
  36. package/lib/dist/extraction/index.js.map +1 -1
  37. package/lib/dist/extraction/languages/arkts.d.ts +3 -0
  38. package/lib/dist/extraction/languages/arkts.d.ts.map +1 -0
  39. package/lib/dist/extraction/languages/arkts.js +127 -0
  40. package/lib/dist/extraction/languages/arkts.js.map +1 -0
  41. package/lib/dist/extraction/languages/c-cpp.d.ts +42 -0
  42. package/lib/dist/extraction/languages/c-cpp.d.ts.map +1 -1
  43. package/lib/dist/extraction/languages/c-cpp.js +369 -4
  44. package/lib/dist/extraction/languages/c-cpp.js.map +1 -1
  45. package/lib/dist/extraction/languages/cfquery.d.ts +12 -0
  46. package/lib/dist/extraction/languages/cfquery.d.ts.map +1 -0
  47. package/lib/dist/extraction/languages/cfquery.js +28 -0
  48. package/lib/dist/extraction/languages/cfquery.js.map +1 -0
  49. package/lib/dist/extraction/languages/cfscript.d.ts +3 -0
  50. package/lib/dist/extraction/languages/cfscript.d.ts.map +1 -0
  51. package/lib/dist/extraction/languages/cfscript.js +73 -0
  52. package/lib/dist/extraction/languages/cfscript.js.map +1 -0
  53. package/lib/dist/extraction/languages/cobol.d.ts +33 -0
  54. package/lib/dist/extraction/languages/cobol.d.ts.map +1 -0
  55. package/lib/dist/extraction/languages/cobol.js +499 -0
  56. package/lib/dist/extraction/languages/cobol.js.map +1 -0
  57. package/lib/dist/extraction/languages/erlang.d.ts +3 -0
  58. package/lib/dist/extraction/languages/erlang.d.ts.map +1 -0
  59. package/lib/dist/extraction/languages/erlang.js +350 -0
  60. package/lib/dist/extraction/languages/erlang.js.map +1 -0
  61. package/lib/dist/extraction/languages/index.d.ts.map +1 -1
  62. package/lib/dist/extraction/languages/index.js +18 -0
  63. package/lib/dist/extraction/languages/index.js.map +1 -1
  64. package/lib/dist/extraction/languages/nix.d.ts +3 -0
  65. package/lib/dist/extraction/languages/nix.d.ts.map +1 -0
  66. package/lib/dist/extraction/languages/nix.js +294 -0
  67. package/lib/dist/extraction/languages/nix.js.map +1 -0
  68. package/lib/dist/extraction/languages/solidity.d.ts +3 -0
  69. package/lib/dist/extraction/languages/solidity.d.ts.map +1 -0
  70. package/lib/dist/extraction/languages/solidity.js +293 -0
  71. package/lib/dist/extraction/languages/solidity.js.map +1 -0
  72. package/lib/dist/extraction/languages/terraform.d.ts +3 -0
  73. package/lib/dist/extraction/languages/terraform.d.ts.map +1 -0
  74. package/lib/dist/extraction/languages/terraform.js +641 -0
  75. package/lib/dist/extraction/languages/terraform.js.map +1 -0
  76. package/lib/dist/extraction/languages/vbnet.d.ts +11 -0
  77. package/lib/dist/extraction/languages/vbnet.d.ts.map +1 -0
  78. package/lib/dist/extraction/languages/vbnet.js +141 -0
  79. package/lib/dist/extraction/languages/vbnet.js.map +1 -0
  80. package/lib/dist/extraction/mybatis-extractor.d.ts +30 -10
  81. package/lib/dist/extraction/mybatis-extractor.d.ts.map +1 -1
  82. package/lib/dist/extraction/mybatis-extractor.js +140 -38
  83. package/lib/dist/extraction/mybatis-extractor.js.map +1 -1
  84. package/lib/dist/extraction/tree-sitter-helpers.d.ts.map +1 -1
  85. package/lib/dist/extraction/tree-sitter-helpers.js +1 -0
  86. package/lib/dist/extraction/tree-sitter-helpers.js.map +1 -1
  87. package/lib/dist/extraction/tree-sitter-types.d.ts +3 -1
  88. package/lib/dist/extraction/tree-sitter-types.d.ts.map +1 -1
  89. package/lib/dist/extraction/tree-sitter.d.ts +38 -0
  90. package/lib/dist/extraction/tree-sitter.d.ts.map +1 -1
  91. package/lib/dist/extraction/tree-sitter.js +753 -10
  92. package/lib/dist/extraction/tree-sitter.js.map +1 -1
  93. package/lib/dist/extraction/wasm/tree-sitter-arkts.wasm +0 -0
  94. package/lib/dist/extraction/wasm/tree-sitter-cfml.wasm +0 -0
  95. package/lib/dist/extraction/wasm/tree-sitter-cfquery.wasm +0 -0
  96. package/lib/dist/extraction/wasm/tree-sitter-cfscript.wasm +0 -0
  97. package/lib/dist/extraction/wasm/tree-sitter-cobol.wasm +0 -0
  98. package/lib/dist/extraction/wasm/tree-sitter-erlang.wasm +0 -0
  99. package/lib/dist/extraction/wasm/tree-sitter-nix.wasm +0 -0
  100. package/lib/dist/extraction/wasm/tree-sitter-terraform.wasm +0 -0
  101. package/lib/dist/extraction/wasm/tree-sitter-vbnet.wasm +0 -0
  102. package/lib/dist/index.d.ts +63 -1
  103. package/lib/dist/index.d.ts.map +1 -1
  104. package/lib/dist/index.js +327 -5
  105. package/lib/dist/index.js.map +1 -1
  106. package/lib/dist/installer/index.d.ts.map +1 -1
  107. package/lib/dist/installer/index.js +3 -1
  108. package/lib/dist/installer/index.js.map +1 -1
  109. package/lib/dist/mcp/daemon.d.ts +25 -3
  110. package/lib/dist/mcp/daemon.d.ts.map +1 -1
  111. package/lib/dist/mcp/daemon.js +62 -8
  112. package/lib/dist/mcp/daemon.js.map +1 -1
  113. package/lib/dist/mcp/dynamic-boundaries.d.ts.map +1 -1
  114. package/lib/dist/mcp/dynamic-boundaries.js +2 -1
  115. package/lib/dist/mcp/dynamic-boundaries.js.map +1 -1
  116. package/lib/dist/mcp/early-ppid.d.ts +26 -0
  117. package/lib/dist/mcp/early-ppid.d.ts.map +1 -0
  118. package/lib/dist/mcp/early-ppid.js +29 -0
  119. package/lib/dist/mcp/early-ppid.js.map +1 -0
  120. package/lib/dist/mcp/index.d.ts.map +1 -1
  121. package/lib/dist/mcp/index.js +21 -4
  122. package/lib/dist/mcp/index.js.map +1 -1
  123. package/lib/dist/mcp/proxy.d.ts.map +1 -1
  124. package/lib/dist/mcp/proxy.js +29 -3
  125. package/lib/dist/mcp/proxy.js.map +1 -1
  126. package/lib/dist/mcp/query-pool.d.ts +14 -0
  127. package/lib/dist/mcp/query-pool.d.ts.map +1 -1
  128. package/lib/dist/mcp/query-pool.js +18 -0
  129. package/lib/dist/mcp/query-pool.js.map +1 -1
  130. package/lib/dist/mcp/session.d.ts.map +1 -1
  131. package/lib/dist/mcp/session.js +6 -0
  132. package/lib/dist/mcp/session.js.map +1 -1
  133. package/lib/dist/mcp/startup-handshake.d.ts +44 -0
  134. package/lib/dist/mcp/startup-handshake.d.ts.map +1 -0
  135. package/lib/dist/mcp/startup-handshake.js +73 -0
  136. package/lib/dist/mcp/startup-handshake.js.map +1 -0
  137. package/lib/dist/mcp/tools.d.ts +22 -0
  138. package/lib/dist/mcp/tools.d.ts.map +1 -1
  139. package/lib/dist/mcp/tools.js +88 -18
  140. package/lib/dist/mcp/tools.js.map +1 -1
  141. package/lib/dist/mcp/transport.d.ts.map +1 -1
  142. package/lib/dist/mcp/transport.js +18 -0
  143. package/lib/dist/mcp/transport.js.map +1 -1
  144. package/lib/dist/project-config.d.ts +38 -0
  145. package/lib/dist/project-config.d.ts.map +1 -1
  146. package/lib/dist/project-config.js +101 -2
  147. package/lib/dist/project-config.js.map +1 -1
  148. package/lib/dist/resolution/c-fnptr-synthesizer.d.ts +2 -1
  149. package/lib/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -1
  150. package/lib/dist/resolution/c-fnptr-synthesizer.js +170 -146
  151. package/lib/dist/resolution/c-fnptr-synthesizer.js.map +1 -1
  152. package/lib/dist/resolution/callback-synthesizer.d.ts.map +1 -1
  153. package/lib/dist/resolution/callback-synthesizer.js +982 -81
  154. package/lib/dist/resolution/callback-synthesizer.js.map +1 -1
  155. package/lib/dist/resolution/frameworks/cics.d.ts +20 -0
  156. package/lib/dist/resolution/frameworks/cics.d.ts.map +1 -0
  157. package/lib/dist/resolution/frameworks/cics.js +90 -0
  158. package/lib/dist/resolution/frameworks/cics.js.map +1 -0
  159. package/lib/dist/resolution/frameworks/index.d.ts.map +1 -1
  160. package/lib/dist/resolution/frameworks/index.js +6 -0
  161. package/lib/dist/resolution/frameworks/index.js.map +1 -1
  162. package/lib/dist/resolution/frameworks/java.d.ts.map +1 -1
  163. package/lib/dist/resolution/frameworks/java.js +14 -6
  164. package/lib/dist/resolution/frameworks/java.js.map +1 -1
  165. package/lib/dist/resolution/frameworks/terraform.d.ts +38 -0
  166. package/lib/dist/resolution/frameworks/terraform.d.ts.map +1 -0
  167. package/lib/dist/resolution/frameworks/terraform.js +277 -0
  168. package/lib/dist/resolution/frameworks/terraform.js.map +1 -0
  169. package/lib/dist/resolution/goframe-synthesizer.d.ts +2 -1
  170. package/lib/dist/resolution/goframe-synthesizer.d.ts.map +1 -1
  171. package/lib/dist/resolution/goframe-synthesizer.js +8 -3
  172. package/lib/dist/resolution/goframe-synthesizer.js.map +1 -1
  173. package/lib/dist/resolution/import-resolver.d.ts +7 -0
  174. package/lib/dist/resolution/import-resolver.d.ts.map +1 -1
  175. package/lib/dist/resolution/import-resolver.js +129 -4
  176. package/lib/dist/resolution/import-resolver.js.map +1 -1
  177. package/lib/dist/resolution/index.d.ts +49 -6
  178. package/lib/dist/resolution/index.d.ts.map +1 -1
  179. package/lib/dist/resolution/index.js +342 -65
  180. package/lib/dist/resolution/index.js.map +1 -1
  181. package/lib/dist/resolution/name-matcher.d.ts +0 -3
  182. package/lib/dist/resolution/name-matcher.d.ts.map +1 -1
  183. package/lib/dist/resolution/name-matcher.js +225 -33
  184. package/lib/dist/resolution/name-matcher.js.map +1 -1
  185. package/lib/dist/resolution/strip-comments.d.ts +1 -1
  186. package/lib/dist/resolution/strip-comments.d.ts.map +1 -1
  187. package/lib/dist/resolution/strip-comments.js +49 -0
  188. package/lib/dist/resolution/strip-comments.js.map +1 -1
  189. package/lib/dist/resolution/types.d.ts +29 -0
  190. package/lib/dist/resolution/types.d.ts.map +1 -1
  191. package/lib/dist/resolution/workspace-packages.d.ts +10 -0
  192. package/lib/dist/resolution/workspace-packages.d.ts.map +1 -1
  193. package/lib/dist/resolution/workspace-packages.js +142 -4
  194. package/lib/dist/resolution/workspace-packages.js.map +1 -1
  195. package/lib/dist/search/identifier-segments.d.ts +60 -0
  196. package/lib/dist/search/identifier-segments.d.ts.map +1 -0
  197. package/lib/dist/search/identifier-segments.js +176 -0
  198. package/lib/dist/search/identifier-segments.js.map +1 -0
  199. package/lib/dist/sync/git-hooks.d.ts.map +1 -1
  200. package/lib/dist/sync/git-hooks.js +2 -0
  201. package/lib/dist/sync/git-hooks.js.map +1 -1
  202. package/lib/dist/sync/watcher.d.ts +10 -5
  203. package/lib/dist/sync/watcher.d.ts.map +1 -1
  204. package/lib/dist/sync/watcher.js +51 -14
  205. package/lib/dist/sync/watcher.js.map +1 -1
  206. package/lib/dist/sync/worktree.d.ts.map +1 -1
  207. package/lib/dist/sync/worktree.js +5 -0
  208. package/lib/dist/sync/worktree.js.map +1 -1
  209. package/lib/dist/types.d.ts +19 -1
  210. package/lib/dist/types.d.ts.map +1 -1
  211. package/lib/dist/types.js +10 -0
  212. package/lib/dist/types.js.map +1 -1
  213. package/lib/node_modules/.package-lock.json +1 -1
  214. package/lib/package.json +1 -1
  215. package/package.json +1 -1
  216. package/lib/dist/reasoning/config.d.ts +0 -45
  217. package/lib/dist/reasoning/config.d.ts.map +0 -1
  218. package/lib/dist/reasoning/config.js +0 -171
  219. package/lib/dist/reasoning/config.js.map +0 -1
  220. package/lib/dist/reasoning/credentials.d.ts +0 -5
  221. package/lib/dist/reasoning/credentials.d.ts.map +0 -1
  222. package/lib/dist/reasoning/credentials.js +0 -83
  223. package/lib/dist/reasoning/credentials.js.map +0 -1
  224. package/lib/dist/reasoning/login.d.ts +0 -21
  225. package/lib/dist/reasoning/login.d.ts.map +0 -1
  226. package/lib/dist/reasoning/login.js +0 -85
  227. package/lib/dist/reasoning/login.js.map +0 -1
  228. package/lib/dist/reasoning/reasoner.d.ts +0 -43
  229. package/lib/dist/reasoning/reasoner.d.ts.map +0 -1
  230. package/lib/dist/reasoning/reasoner.js +0 -308
  231. package/lib/dist/reasoning/reasoner.js.map +0 -1
@@ -25,6 +25,28 @@ export declare class NotIndexedError extends Error {
25
25
  */
26
26
  export declare class PathRefusalError extends Error {
27
27
  }
28
+ /**
29
+ * Normalize Erlang-native symbol spellings in an explore query into the shapes
30
+ * the rest of the pipeline already understands. Agents working Erlang code
31
+ * name symbols the way the language spells them — `mod:fn/3`, `init/2` — and
32
+ * those tokens previously died in both consumers: the flow-builder's token
33
+ * filter rejects `:` and `/arity` outright, and the search-side field parser
34
+ * eats `mod:fn` as an unknown `field:value`. Measured on cowboy: the agent
35
+ * named `cowboy_stream_h:request_process/3` in two queries, got no body back
36
+ * either time, and fell back to Read.
37
+ *
38
+ * - `fn/3` → `fn` (arity tail after an identifier; a path segment like
39
+ * `src/2fa` doesn't match because the tail must be all digits)
40
+ * - `mod:fn` → `mod.fn` (exactly one colon between identifiers, so it rides
41
+ * the existing Class.method qualified handling; `::`, URLs, drive letters,
42
+ * and times don't match, and the query language's own field prefixes —
43
+ * kind:/lang:/language:/path:/name: — are left alone)
44
+ *
45
+ * Safe cross-language: Lua's `t:m` spelling maps to the same `t.m` its
46
+ * qualified names use, and no other supported spelling contains a bare
47
+ * single-colon identifier pair.
48
+ */
49
+ export declare function normalizeQuerySpelling(query: string): string;
28
50
  /**
29
51
  * Calculate the recommended number of codegraph_explore calls based on project size.
30
52
  * Larger codebases need more exploration calls to cover their surface area,
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/mcp/tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,SAAS,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAe9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAW3C;;;;;;;;;;GAUG;AACH,qBAAa,eAAgB,SAAQ,KAAK;CAAG;AAE7C;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;CAAG;AA+C9C;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAM1D;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,mBAAmB;IAClC,2CAA2C;IAC3C,cAAc,EAAE,MAAM,CAAC;IACvB,6DAA6D;IA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AEG;IACH,OAAO,CAAC,cAAc;IAYtB,OAAO,CAAC,mBAAmB;IAgB3B,OAAO,CAAC,cAAc;IAgBtB;;;;;OAKG;IACH,OAAO,CAAC,SAAS;IASjB,OAAO,CAAC,YAAY;IA4BpB;;;;;;OAMG;IACH,OAAO,CAAC,qBAAqB;IAe7B,OAAO,CAAC,iBAAiB;IA8BzB,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,WAAW;CAMpB"}
@@ -6,6 +6,7 @@
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.ToolHandler = exports.tools = exports.PathRefusalError = exports.NotIndexedError = void 0;
9
+ exports.normalizeQuerySpelling = normalizeQuerySpelling;
9
10
  exports.getExploreBudget = getExploreBudget;
10
11
  exports.getExploreOutputBudget = getExploreOutputBudget;
11
12
  exports.formatStaleBanner = formatStaleBanner;
@@ -85,6 +86,32 @@ function lastQualifierPart(symbol) {
85
86
  const parts = symbol.split(/::|[./]/).filter((p) => p.length > 0);
86
87
  return parts[parts.length - 1] ?? symbol;
87
88
  }
89
+ /**
90
+ * Normalize Erlang-native symbol spellings in an explore query into the shapes
91
+ * the rest of the pipeline already understands. Agents working Erlang code
92
+ * name symbols the way the language spells them — `mod:fn/3`, `init/2` — and
93
+ * those tokens previously died in both consumers: the flow-builder's token
94
+ * filter rejects `:` and `/arity` outright, and the search-side field parser
95
+ * eats `mod:fn` as an unknown `field:value`. Measured on cowboy: the agent
96
+ * named `cowboy_stream_h:request_process/3` in two queries, got no body back
97
+ * either time, and fell back to Read.
98
+ *
99
+ * - `fn/3` → `fn` (arity tail after an identifier; a path segment like
100
+ * `src/2fa` doesn't match because the tail must be all digits)
101
+ * - `mod:fn` → `mod.fn` (exactly one colon between identifiers, so it rides
102
+ * the existing Class.method qualified handling; `::`, URLs, drive letters,
103
+ * and times don't match, and the query language's own field prefixes —
104
+ * kind:/lang:/language:/path:/name: — are left alone)
105
+ *
106
+ * Safe cross-language: Lua's `t:m` spelling maps to the same `t.m` its
107
+ * qualified names use, and no other supported spelling contains a bare
108
+ * single-colon identifier pair.
109
+ */
110
+ function normalizeQuerySpelling(query) {
111
+ return query
112
+ .replace(/\b([A-Za-z_][\w@]*)\/(\d{1,3})(?=$|[\s,()[\]/])/g, '$1')
113
+ .replace(/(^|[\s,()[\]])(?!(?:kind|lang|language|path|name):)([a-z_][\w@]*):([A-Za-z_][\w@]*)(?=$|[\s,()[\]])/g, '$1$2.$3');
114
+ }
88
115
  /**
89
116
  * Calculate the recommended number of codegraph_explore calls based on project size.
90
117
  * Larger codebases need more exploration calls to cover their surface area,
@@ -274,8 +301,7 @@ function numberSourceLines(slice, firstLineNumber) {
274
301
  * extension) stop blowing every header up to H1–H4. The path is bold + a code
275
302
  * span so it still reads as a header, and the leading ``**` `` stays a UNIQUE,
276
303
  * greppable marker — no other explore line begins with it — that the explore
277
- * truncation boundary (`handleExplore`) and the offload chunker
278
- * (`reasoning/reasoner.ts`) both key off to cut on whole file sections.
304
+ * truncation boundary (`handleExplore`) keys off to cut on whole file sections.
279
305
  */
280
306
  const FILE_SECTION_PREFIX = '**`';
281
307
  // Placeholder for codegraph_explore's "Found N symbols across M files." line.
@@ -1208,15 +1234,20 @@ class ToolHandler {
1208
1234
  return await this.handleStatus(args);
1209
1235
  }
1210
1236
  // Read tools: off-load the CPU-heavy dispatch to the worker pool when one
1211
- // is attached and healthy (daemon mode), so the daemon's single event loop
1212
- // stays free for the MCP transport under concurrent load otherwise N
1213
- // concurrent explores serialize AND starve the transport until the whole
1214
- // batch drains (clients then time out). With no pool (direct mode) or a
1215
- // degraded one, dispatch runs in-process exactly as before. Either way the
1216
- // result flows through the cross-cutting notices worktree-index mismatch
1217
- // (#155) and per-file staleness (#403) which need the watched MAIN
1218
- // instance and so are always applied here, never in the worker.
1219
- const result = (this.queryPool && this.queryPool.healthy)
1237
+ // is attached, healthy, AND has finished its first cold start (daemon
1238
+ // mode), so the daemon's single event loop stays free for the MCP
1239
+ // transport under concurrent load otherwise N concurrent explores
1240
+ // serialize AND starve the transport until the whole batch drains
1241
+ // (clients then time out). Before the first worker is warm, calls run
1242
+ // in-process: a call queued behind a cold start sat invisible until the
1243
+ // 45s busy backstop the daemon's first tool call stalling for however
1244
+ // long a worker spawn takes on a loaded machine (the #662 flake). With
1245
+ // no pool (direct mode) or a degraded one, dispatch runs in-process
1246
+ // exactly as before. Either way the result flows through the
1247
+ // cross-cutting notices — worktree-index mismatch (#155) and per-file
1248
+ // staleness (#403) — which need the watched MAIN instance and so are
1249
+ // always applied here, never in the worker.
1250
+ const result = (this.queryPool && this.queryPool.healthy && this.queryPool.ready)
1220
1251
  ? await this.queryPool.run(toolName, args)
1221
1252
  : await this.executeReadTool(toolName, args);
1222
1253
  const withWorktree = this.withWorktreeNotice(result, args.projectPath);
@@ -1660,7 +1691,7 @@ class ToolHandler {
1660
1691
  // names (Class.method / Class::method) — the agent's most precise input,
1661
1692
  // resolved exactly by findAllSymbols. (The old strip mangled Class.method
1662
1693
  // into Class, throwing the method away.)
1663
- const FILE_EXT = /\.(?:java|kt|kts|ts|tsx|js|jsx|mjs|cjs|cs|py|go|rb|php|swift|rs|cpp|cc|cxx|c|h|hpp|scala|lua|dart|vue|svelte|astro)$/i;
1694
+ const FILE_EXT = /\.(?:java|kt|kts|ts|tsx|js|jsx|mjs|cjs|cs|py|go|rb|php|swift|rs|cpp|cc|cxx|c|h|hpp|scala|lua|dart|vue|svelte|astro|erl|hrl)$/i;
1664
1695
  const tokens = [...new Set(query.split(/[\s,()[\]]+/)
1665
1696
  .map((t) => t.replace(FILE_EXT, '').trim())
1666
1697
  .filter((t) => t.length >= 3 && /^[A-Za-z_$][\w$]*(?:(?:::|\.)[\w$]+)*$/.test(t)))].slice(0, 16);
@@ -1722,13 +1753,19 @@ class ToolHandler {
1722
1753
  }
1723
1754
  // Same token, non-callable synth endpoints (capped, precision-gated on an
1724
1755
  // actual heuristic edge so plain config constants never qualify).
1756
+ // Per-token sub-cap so one token's many endpoints (10 nix option writes
1757
+ // of `programs.git.enable` across test configs) can't fill the pool
1758
+ // before later tokens (`home.file`) get a slot.
1725
1759
  if (dynNamed.size < 12) {
1760
+ let tokenDyn = 0;
1726
1761
  for (const n of hits) {
1727
1762
  if (CALLABLE.has(n.kind) || !DYN_KINDS.has(n.kind) || dynNamed.has(n.id))
1728
1763
  continue;
1729
- if (hasHeuristicEdge(n.id))
1764
+ if (hasHeuristicEdge(n.id)) {
1730
1765
  dynNamed.set(n.id, n);
1731
- if (dynNamed.size >= 12)
1766
+ tokenDyn++;
1767
+ }
1768
+ if (dynNamed.size >= 12 || tokenDyn >= 4)
1732
1769
  break;
1733
1770
  }
1734
1771
  }
@@ -2359,9 +2396,12 @@ class ToolHandler {
2359
2396
  * tax on small projects while earning its keep on large ones.
2360
2397
  */
2361
2398
  async handleExplore(args) {
2362
- const query = this.validateString(args.query, 'query');
2363
- if (typeof query !== 'string')
2364
- return query;
2399
+ const rawQuery = this.validateString(args.query, 'query');
2400
+ if (typeof rawQuery !== 'string')
2401
+ return rawQuery;
2402
+ // One normalization point so the flow-builder, relevance search, and
2403
+ // ranking all see the same canonical spelling (Erlang `mod:fn/arity`).
2404
+ const query = normalizeQuerySpelling(rawQuery);
2365
2405
  const cg = this.getCodeGraph(args.projectPath);
2366
2406
  const projectRoot = cg.getProjectRoot();
2367
2407
  // Resolve adaptive output budget from project size. Falls back to the
@@ -2443,7 +2483,7 @@ class ToolHandler {
2443
2483
  // overloads (the query also named the type) all earn it. (#1064)
2444
2484
  const tierSeedIds = new Set();
2445
2485
  {
2446
- const FILE_EXT = /\.(?:java|kt|kts|ts|tsx|js|jsx|mjs|cjs|cs|py|go|rb|php|swift|rs|cpp|cc|cxx|c|h|hpp|scala|lua|dart|vue|svelte|astro)$/i;
2486
+ const FILE_EXT = /\.(?:java|kt|kts|ts|tsx|js|jsx|mjs|cjs|cs|py|go|rb|php|swift|rs|cpp|cc|cxx|c|h|hpp|scala|lua|dart|vue|svelte|astro|erl|hrl)$/i;
2447
2487
  const CALLABLE = new Set(['method', 'function', 'component', 'constructor']);
2448
2488
  const isTestPath = (p) => /(^|\/)(tests?|specs?|__tests__|testdata|mocks?|fixtures?)\//i.test(p) || /\.(test|spec)\.[a-z]+$/i.test(p);
2449
2489
  const bodyLines = (n) => Math.max(0, (n.endLine ?? n.startLine) - n.startLine);
@@ -3874,6 +3914,16 @@ class ToolHandler {
3874
3914
  lines.push(`**Journal mode:** ⚠ ${journalMode || 'unknown'} — WAL not active, so reads ` +
3875
3915
  `can block on a concurrent write (WAL appears unsupported on this filesystem)`);
3876
3916
  }
3917
+ // Non-zero at rest means a resolution pass was interrupted mid-run, so
3918
+ // some files' call/impact edges are missing until the next sync sweeps
3919
+ // the leftovers (#1187). Surface it — an agent trusting an incomplete
3920
+ // blast radius is worse than one that knows to re-sync.
3921
+ const pendingRefs = cg.getPendingReferenceCount();
3922
+ if (pendingRefs > 0) {
3923
+ lines.push(`**Pending resolution:** ⚠ ${pendingRefs} references from an interrupted ` +
3924
+ `index run — some caller/impact edges are missing until the next sync ` +
3925
+ `(any file change triggers it, or run \`codegraph sync\`)`);
3926
+ }
3877
3927
  lines.push('', '**Nodes by Kind:**');
3878
3928
  for (const [kind, count] of Object.entries(stats.nodesByKind)) {
3879
3929
  if (count > 0) {
@@ -4187,6 +4237,26 @@ class ToolHandler {
4187
4237
  * results across all matching symbols (e.g., multiple classes with an `execute` method).
4188
4238
  */
4189
4239
  findAllSymbols(cg, symbol) {
4240
+ // Nix option paths: the declaration is stored as `options.<path>` and
4241
+ // config writes carry longer/quoted tails (`<path>."git/config".text`),
4242
+ // so a dotted option token (`xdg.configFile`, `launchd.user.agents`) has
4243
+ // no exact-name node and would degrade to bare-tail FTS soup — burying
4244
+ // the declaration hub the nix-option-path edges hang off. Resolve the
4245
+ // convention directly: declaration first, then the exact write, then a
4246
+ // capped prefix scan of write sites. Three index hits; non-nix graphs
4247
+ // fall straight through.
4248
+ if (/^[a-z][\w'-]*(?:\.[\w'-]+)+$/.test(symbol)) {
4249
+ const optionHits = [
4250
+ ...cg.getNodesByName(`options.${symbol}`),
4251
+ ...cg.getNodesByName(symbol),
4252
+ ...cg.getNodesByNamePrefix(`${symbol}.`, 12),
4253
+ ].filter((n) => n.language === 'nix');
4254
+ if (optionHits.length > 0) {
4255
+ const seen = new Set();
4256
+ const nodes = optionHits.filter((n) => !seen.has(n.id) && !!seen.add(n.id)).slice(0, 10);
4257
+ return { nodes, note: '' };
4258
+ }
4259
+ }
4190
4260
  let results = cg.searchNodes(symbol, { limit: 50 });
4191
4261
  // Mirror the fallback in `findSymbol` for qualified queries — FTS
4192
4262
  // strips colons, so a module-qualified lookup needs a second pass