gitnexus 1.6.5-rc.8 → 1.6.5

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 (335) hide show
  1. package/dist/_shared/scope-resolution/finalize-algorithm.js +10 -2
  2. package/dist/_shared/scope-resolution/finalize-algorithm.js.map +1 -1
  3. package/dist/_shared/scope-resolution/method-dispatch-index.d.ts +26 -0
  4. package/dist/_shared/scope-resolution/method-dispatch-index.d.ts.map +1 -1
  5. package/dist/_shared/scope-resolution/method-dispatch-index.js +22 -3
  6. package/dist/_shared/scope-resolution/method-dispatch-index.js.map +1 -1
  7. package/dist/_shared/scope-resolution/registries/lookup-core.js +18 -1
  8. package/dist/_shared/scope-resolution/registries/lookup-core.js.map +1 -1
  9. package/dist/_shared/scope-resolution/symbol-definition.d.ts +2 -0
  10. package/dist/_shared/scope-resolution/symbol-definition.d.ts.map +1 -1
  11. package/dist/cli/ai-context.d.ts +1 -0
  12. package/dist/cli/ai-context.js +70 -16
  13. package/dist/cli/analyze.d.ts +30 -2
  14. package/dist/cli/analyze.js +45 -5
  15. package/dist/cli/index.js +8 -1
  16. package/dist/cli/setup.js +18 -0
  17. package/dist/cli/wiki.d.ts +2 -0
  18. package/dist/cli/wiki.js +11 -0
  19. package/dist/core/augmentation/engine.js +24 -4
  20. package/dist/core/embeddings/http-client.js +22 -6
  21. package/dist/core/incremental/shadow-candidates.d.ts +44 -0
  22. package/dist/core/incremental/shadow-candidates.js +74 -0
  23. package/dist/core/incremental/subgraph-extract.d.ts +64 -0
  24. package/dist/core/incremental/subgraph-extract.js +111 -0
  25. package/dist/core/ingestion/call-processor.d.ts +12 -1
  26. package/dist/core/ingestion/call-processor.js +183 -47
  27. package/dist/core/ingestion/class-extractors/configs/c-cpp.js +38 -0
  28. package/dist/core/ingestion/class-extractors/generic.js +8 -0
  29. package/dist/core/ingestion/class-types.d.ts +15 -0
  30. package/dist/core/ingestion/community-processor.js +18 -0
  31. package/dist/core/ingestion/import-resolvers/standard.d.ts +5 -0
  32. package/dist/core/ingestion/import-resolvers/standard.js +31 -1
  33. package/dist/core/ingestion/import-resolvers/utils.js +4 -0
  34. package/dist/core/ingestion/languages/c-cpp.js +20 -2
  35. package/dist/core/ingestion/languages/cpp/adl.d.ts +141 -0
  36. package/dist/core/ingestion/languages/cpp/adl.js +478 -0
  37. package/dist/core/ingestion/languages/cpp/arity-metadata.d.ts +18 -0
  38. package/dist/core/ingestion/languages/cpp/arity-metadata.js +170 -0
  39. package/dist/core/ingestion/languages/cpp/arity.d.ts +17 -0
  40. package/dist/core/ingestion/languages/cpp/arity.js +31 -0
  41. package/dist/core/ingestion/languages/cpp/captures.d.ts +2 -0
  42. package/dist/core/ingestion/languages/cpp/captures.js +1131 -0
  43. package/dist/core/ingestion/languages/cpp/conversion-rank.d.ts +31 -0
  44. package/dist/core/ingestion/languages/cpp/conversion-rank.js +47 -0
  45. package/dist/core/ingestion/languages/cpp/file-local-linkage.d.ts +118 -0
  46. package/dist/core/ingestion/languages/cpp/file-local-linkage.js +266 -0
  47. package/dist/core/ingestion/languages/cpp/header-scan.d.ts +8 -0
  48. package/dist/core/ingestion/languages/cpp/header-scan.js +50 -0
  49. package/dist/core/ingestion/languages/cpp/import-decomposer.d.ts +19 -0
  50. package/dist/core/ingestion/languages/cpp/import-decomposer.js +111 -0
  51. package/dist/core/ingestion/languages/cpp/import-target.d.ts +10 -0
  52. package/dist/core/ingestion/languages/cpp/import-target.js +13 -0
  53. package/dist/core/ingestion/languages/cpp/index.d.ts +11 -0
  54. package/dist/core/ingestion/languages/cpp/index.js +11 -0
  55. package/dist/core/ingestion/languages/cpp/inline-namespaces.d.ts +67 -0
  56. package/dist/core/ingestion/languages/cpp/inline-namespaces.js +176 -0
  57. package/dist/core/ingestion/languages/cpp/interpret.d.ts +35 -0
  58. package/dist/core/ingestion/languages/cpp/interpret.js +113 -0
  59. package/dist/core/ingestion/languages/cpp/merge-bindings.d.ts +13 -0
  60. package/dist/core/ingestion/languages/cpp/merge-bindings.js +29 -0
  61. package/dist/core/ingestion/languages/cpp/query.d.ts +3 -0
  62. package/dist/core/ingestion/languages/cpp/query.js +508 -0
  63. package/dist/core/ingestion/languages/cpp/range-bindings.d.ts +20 -0
  64. package/dist/core/ingestion/languages/cpp/range-bindings.js +212 -0
  65. package/dist/core/ingestion/languages/cpp/scope-resolver.d.ts +17 -0
  66. package/dist/core/ingestion/languages/cpp/scope-resolver.js +246 -0
  67. package/dist/core/ingestion/languages/cpp/simple-hooks.d.ts +24 -0
  68. package/dist/core/ingestion/languages/cpp/simple-hooks.js +62 -0
  69. package/dist/core/ingestion/languages/cpp/two-phase-lookup.d.ts +76 -0
  70. package/dist/core/ingestion/languages/cpp/two-phase-lookup.js +195 -0
  71. package/dist/core/ingestion/languages/java/arity-metadata.d.ts +18 -0
  72. package/dist/core/ingestion/languages/java/arity-metadata.js +40 -0
  73. package/dist/core/ingestion/languages/java/arity.d.ts +10 -0
  74. package/dist/core/ingestion/languages/java/arity.js +24 -0
  75. package/dist/core/ingestion/languages/java/cache-stats.d.ts +15 -0
  76. package/dist/core/ingestion/languages/java/cache-stats.js +26 -0
  77. package/dist/core/ingestion/languages/java/captures.d.ts +17 -0
  78. package/dist/core/ingestion/languages/java/captures.js +187 -0
  79. package/dist/core/ingestion/languages/java/import-decomposer.d.ts +18 -0
  80. package/dist/core/ingestion/languages/java/import-decomposer.js +85 -0
  81. package/dist/core/ingestion/languages/java/import-target.d.ts +17 -0
  82. package/dist/core/ingestion/languages/java/import-target.js +100 -0
  83. package/dist/core/ingestion/languages/java/index.d.ts +29 -0
  84. package/dist/core/ingestion/languages/java/index.js +29 -0
  85. package/dist/core/ingestion/languages/java/interpret.d.ts +13 -0
  86. package/dist/core/ingestion/languages/java/interpret.js +131 -0
  87. package/dist/core/ingestion/languages/java/merge-bindings.d.ts +12 -0
  88. package/dist/core/ingestion/languages/java/merge-bindings.js +40 -0
  89. package/dist/core/ingestion/languages/java/query.d.ts +30 -0
  90. package/dist/core/ingestion/languages/java/query.js +192 -0
  91. package/dist/core/ingestion/languages/java/receiver-binding.d.ts +11 -0
  92. package/dist/core/ingestion/languages/java/receiver-binding.js +95 -0
  93. package/dist/core/ingestion/languages/java/scope-resolver.d.ts +50 -0
  94. package/dist/core/ingestion/languages/java/scope-resolver.js +74 -0
  95. package/dist/core/ingestion/languages/java/simple-hooks.d.ts +13 -0
  96. package/dist/core/ingestion/languages/java/simple-hooks.js +34 -0
  97. package/dist/core/ingestion/languages/java.js +11 -0
  98. package/dist/core/ingestion/languages/php/arity-metadata.d.ts +28 -0
  99. package/dist/core/ingestion/languages/php/arity-metadata.js +63 -0
  100. package/dist/core/ingestion/languages/php/arity.d.ts +25 -0
  101. package/dist/core/ingestion/languages/php/arity.js +40 -0
  102. package/dist/core/ingestion/languages/php/cache-stats.d.ts +15 -0
  103. package/dist/core/ingestion/languages/php/cache-stats.js +26 -0
  104. package/dist/core/ingestion/languages/php/captures.d.ts +34 -0
  105. package/dist/core/ingestion/languages/php/captures.js +739 -0
  106. package/dist/core/ingestion/languages/php/import-decomposer.d.ts +28 -0
  107. package/dist/core/ingestion/languages/php/import-decomposer.js +265 -0
  108. package/dist/core/ingestion/languages/php/import-target.d.ts +47 -0
  109. package/dist/core/ingestion/languages/php/import-target.js +100 -0
  110. package/dist/core/ingestion/languages/php/index.d.ts +68 -0
  111. package/dist/core/ingestion/languages/php/index.js +72 -0
  112. package/dist/core/ingestion/languages/php/interpret.d.ts +36 -0
  113. package/dist/core/ingestion/languages/php/interpret.js +241 -0
  114. package/dist/core/ingestion/languages/php/merge-bindings.d.ts +19 -0
  115. package/dist/core/ingestion/languages/php/merge-bindings.js +47 -0
  116. package/dist/core/ingestion/languages/php/namespace-siblings.d.ts +51 -0
  117. package/dist/core/ingestion/languages/php/namespace-siblings.js +288 -0
  118. package/dist/core/ingestion/languages/php/query.d.ts +32 -0
  119. package/dist/core/ingestion/languages/php/query.js +326 -0
  120. package/dist/core/ingestion/languages/php/receiver-binding.d.ts +36 -0
  121. package/dist/core/ingestion/languages/php/receiver-binding.js +128 -0
  122. package/dist/core/ingestion/languages/php/scope-resolver.d.ts +23 -0
  123. package/dist/core/ingestion/languages/php/scope-resolver.js +358 -0
  124. package/dist/core/ingestion/languages/php/simple-hooks.d.ts +42 -0
  125. package/dist/core/ingestion/languages/php/simple-hooks.js +111 -0
  126. package/dist/core/ingestion/languages/php.d.ts +0 -7
  127. package/dist/core/ingestion/languages/php.js +15 -0
  128. package/dist/core/ingestion/markdown-processor.js +6 -1
  129. package/dist/core/ingestion/model/symbol-table.d.ts +1 -0
  130. package/dist/core/ingestion/model/symbol-table.js +3 -0
  131. package/dist/core/ingestion/parsing-processor.d.ts +22 -2
  132. package/dist/core/ingestion/parsing-processor.js +123 -50
  133. package/dist/core/ingestion/pipeline-phases/cross-file-impl.js +54 -2
  134. package/dist/core/ingestion/pipeline-phases/parse-impl.d.ts +5 -0
  135. package/dist/core/ingestion/pipeline-phases/parse-impl.js +119 -11
  136. package/dist/core/ingestion/pipeline-phases/parse.d.ts +14 -0
  137. package/dist/core/ingestion/pipeline.d.ts +13 -0
  138. package/dist/core/ingestion/registry-primary-flag.js +2 -0
  139. package/dist/core/ingestion/scope-extractor.js +4 -0
  140. package/dist/core/ingestion/scope-resolution/contract/scope-resolver.d.ts +167 -0
  141. package/dist/core/ingestion/scope-resolution/contract/scope-resolver.js +3 -0
  142. package/dist/core/ingestion/scope-resolution/graph-bridge/ids.d.ts +1 -0
  143. package/dist/core/ingestion/scope-resolution/graph-bridge/ids.js +12 -0
  144. package/dist/core/ingestion/scope-resolution/graph-bridge/method-dispatch.d.ts +1 -1
  145. package/dist/core/ingestion/scope-resolution/graph-bridge/method-dispatch.js +12 -2
  146. package/dist/core/ingestion/scope-resolution/graph-bridge/node-lookup.js +16 -0
  147. package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.d.ts +36 -0
  148. package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.js +204 -13
  149. package/dist/core/ingestion/scope-resolution/passes/imported-return-types.js +1 -1
  150. package/dist/core/ingestion/scope-resolution/passes/overload-narrowing.d.ts +55 -4
  151. package/dist/core/ingestion/scope-resolution/passes/overload-narrowing.js +186 -5
  152. package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.d.ts +10 -1
  153. package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.js +207 -9
  154. package/dist/core/ingestion/scope-resolution/pipeline/phase.js +13 -1
  155. package/dist/core/ingestion/scope-resolution/pipeline/registry.js +6 -0
  156. package/dist/core/ingestion/scope-resolution/pipeline/run.d.ts +17 -0
  157. package/dist/core/ingestion/scope-resolution/pipeline/run.js +86 -8
  158. package/dist/core/ingestion/scope-resolution/scope/walkers.d.ts +30 -0
  159. package/dist/core/ingestion/scope-resolution/scope/walkers.js +90 -8
  160. package/dist/core/ingestion/tree-sitter-queries.d.ts +2 -2
  161. package/dist/core/ingestion/tree-sitter-queries.js +23 -0
  162. package/dist/core/ingestion/utils/ast-helpers.js +6 -1
  163. package/dist/core/ingestion/utils/template-arguments.d.ts +11 -0
  164. package/dist/core/ingestion/utils/template-arguments.js +65 -0
  165. package/dist/core/ingestion/workers/parse-worker.d.ts +3 -0
  166. package/dist/core/ingestion/workers/parse-worker.js +42 -1
  167. package/dist/core/lbug/lbug-adapter.d.ts +39 -0
  168. package/dist/core/lbug/lbug-adapter.js +348 -48
  169. package/dist/core/run-analyze.d.ts +2 -0
  170. package/dist/core/run-analyze.js +323 -29
  171. package/dist/core/search/hybrid-search.d.ts +3 -0
  172. package/dist/core/search/hybrid-search.js +23 -6
  173. package/dist/core/wiki/generator.js +4 -3
  174. package/dist/core/wiki/html-viewer.js +2 -1
  175. package/dist/core/wiki/llm-client.d.ts +4 -0
  176. package/dist/core/wiki/llm-client.js +3 -3
  177. package/dist/core/wiki/mermaid-sanitizer.d.ts +2 -0
  178. package/dist/core/wiki/mermaid-sanitizer.js +100 -0
  179. package/dist/mcp/local/local-backend.js +20 -7
  180. package/dist/storage/file-hash.d.ts +47 -0
  181. package/dist/storage/file-hash.js +86 -0
  182. package/dist/storage/parse-cache.d.ts +73 -0
  183. package/dist/storage/parse-cache.js +253 -0
  184. package/dist/storage/repo-manager.d.ts +41 -1
  185. package/dist/storage/repo-manager.js +61 -6
  186. package/hooks/claude/gitnexus-hook.cjs +42 -4
  187. package/hooks/claude/hook-db-lock-probe.cjs +238 -0
  188. package/hooks/claude/hook-lock.cjs +119 -0
  189. package/hooks/claude/win-rm-list-json.ps1 +76 -0
  190. package/package.json +1 -1
  191. package/scripts/build.js +6 -2
  192. package/vendor/node_modules/node-addon-api/node_addon_api.target.mk +16 -16
  193. package/vendor/node_modules/node-addon-api/node_addon_api_except.target.mk +16 -16
  194. package/vendor/node_modules/node-addon-api/node_addon_api_except_all.target.mk +16 -16
  195. package/vendor/node_modules/node-addon-api/node_addon_api_maybe.target.mk +16 -16
  196. package/web/assets/{agent-BpHQleHE.js → agent-D2kLt6Dl.js} +91 -91
  197. package/web/assets/architecture-7EHR7CIX-6QZW5X65-BETj2x4g.js +1 -0
  198. package/web/assets/architectureDiagram-UL44E2DR-DvIkEGkp.js +36 -0
  199. package/web/assets/blockDiagram-7IZFK4PR-B4niSLvR.js +132 -0
  200. package/web/assets/{c4Diagram-DFAF54RM-DeJV1rCn.js → c4Diagram-Y2BXMSZH-DIzEXalR.js} +6 -6
  201. package/web/assets/chunk-2T2R6R2M-n6s9JZqv.js +4 -0
  202. package/web/assets/chunk-2UTLFMKG-CMBB1TMN.js +1 -0
  203. package/web/assets/{chunk-7RZVMHOQ-BdIU-RGO.js → chunk-3SSMPTDK-BzGeeheI.js} +1 -1
  204. package/web/assets/chunk-4R4BOZG6-mKhL59ul.js +159 -0
  205. package/web/assets/chunk-5IMINLNL-CnTLsXIV.js +1 -0
  206. package/web/assets/chunk-5VCL7Z4A-w1BCx98Z.js +1 -0
  207. package/web/assets/chunk-6764PJDD-ChwMM2z4.js +1 -0
  208. package/web/assets/chunk-67TQ5CYL-CChC2cAv.js +124 -0
  209. package/web/assets/chunk-7J6CGLKN-DT-b53FT.js +10 -0
  210. package/web/assets/chunk-7W6UQGC5-CgFyfZ6k.js +1 -0
  211. package/web/assets/chunk-AQ6EADP3-CCFje6lL.js +1 -0
  212. package/web/assets/{chunk-KSICW3F5-C2tZmXwv.js → chunk-AZZRMDJM-5E9ARdDQ.js} +1 -1
  213. package/web/assets/chunk-C62D2QBJ-CDAWj26E.js +1 -0
  214. package/web/assets/chunk-CEXFNPSA-D68Tk6ls.js +1 -0
  215. package/web/assets/chunk-INKRHTLW-ELpfuk9h.js +70 -0
  216. package/web/assets/chunk-J5EP6P6S-DxWW0yvu.js +1 -0
  217. package/web/assets/{chunk-AEOMTBSW-D7qjBMHW.js → chunk-JQRUD6KW-Dcq_Qnyy.js} +1 -1
  218. package/web/assets/chunk-KGFNY3KK-W-VR57xb.js +62 -0
  219. package/web/assets/chunk-KGYTTC2M-C6PHeuay.js +1 -0
  220. package/web/assets/chunk-KNLZD3CH-BuZBOcso.js +1 -0
  221. package/web/assets/chunk-KRXBNO2N-DH2NPM7I.js +1 -0
  222. package/web/assets/chunk-LCXTWHL2-CqJ0oo1x.js +231 -0
  223. package/web/assets/chunk-LII3EMHJ-3X33tCpU.js +1 -0
  224. package/web/assets/chunk-QA3QBVWF-D5Ha3GgB.js +2 -0
  225. package/web/assets/chunk-RERM46MO-DQNbXtfw.js +1 -0
  226. package/web/assets/chunk-RG4AUYOV-D0M6vdq9.js +206 -0
  227. package/web/assets/chunk-RKZBBQEN-BmTPLSyv.js +1 -0
  228. package/web/assets/chunk-RLI5ZMPA-DExu2DOK.js +1 -0
  229. package/web/assets/chunk-T2UQINTJ-kGYG7ppP.js +1 -0
  230. package/web/assets/chunk-T5OCTHI4--9wWpVws.js +1 -0
  231. package/web/assets/chunk-UP6H54XL-DsKdC6jC.js +1 -0
  232. package/web/assets/chunk-UXSXWOXI-DR81EqLr.js +1 -0
  233. package/web/assets/chunk-UY5QBCOK-Du-c56gs.js +1 -0
  234. package/web/assets/chunk-W44A43WB-lrCpuupA.js +1 -0
  235. package/web/assets/chunk-ZXARS5L4-CSZRiyOf.js +1 -0
  236. package/web/assets/classDiagram-KGZ6W3CR-BB-saqC1.js +1 -0
  237. package/web/assets/classDiagram-v2-72OJOZXJ-Bp2bAlS5.js +1 -0
  238. package/web/assets/cose-bilkent-UX7MHV2Q-BHv2bbtl.js +1 -0
  239. package/web/assets/dagre-ND4H6XIP-DsIr9MOv.js +4 -0
  240. package/web/assets/diagram-3NCE3AQN-BUxnDPOY.js +43 -0
  241. package/web/assets/diagram-GF46GFSD-BJTyqqvI.js +24 -0
  242. package/web/assets/diagram-HNR7UZ2L-fUWreZzx.js +3 -0
  243. package/web/assets/diagram-QXG6HAR7-DilMHamP.js +24 -0
  244. package/web/assets/diagram-WEQXMOUZ-8KUrarg1.js +10 -0
  245. package/web/assets/erDiagram-L5TCEMPS-Doj9mSiW.js +85 -0
  246. package/web/assets/eventmodeling-FCH6USID-MREXMVOE-B3myHUst.js +1 -0
  247. package/web/assets/{flowDiagram-OTCZ4VVT-aAZw4c_M.js → flowDiagram-H6V6AXG4-BOSR-i3p.js} +12 -12
  248. package/web/assets/ganttDiagram-JCBTUEKG-BHQssTz6.js +292 -0
  249. package/web/assets/gitGraph-WXDBUCRP-R675I2BI-DF3rtf4A.js +1 -0
  250. package/web/assets/gitGraphDiagram-S2ZK5IYY-CCwVLT__.js +106 -0
  251. package/web/assets/index-j4-NuleT.js +623 -0
  252. package/web/assets/info-J43DQDTF-KCYPFFUO-R4XV_akJ.js +1 -0
  253. package/web/assets/infoDiagram-3YFTVSEB-Ce_TvtaV.js +2 -0
  254. package/web/assets/{ishikawaDiagram-YMYX4NHK-BF8AtDaj.js → ishikawaDiagram-BNXS4ZKH-4MXIDCSF.js} +6 -6
  255. package/web/assets/journeyDiagram-M6C3CM3L-DNPYCpvq.js +139 -0
  256. package/web/assets/kanban-definition-75IXJCU3-yYdfm8Kk.js +89 -0
  257. package/web/assets/{katex-GD7MH7QM-CJiOjBBJ.js → katex-K3KEBU37-CrVLz8l7.js} +1 -1
  258. package/web/assets/mindmap-definition-2TDM6QVE-DFNEKM77.js +96 -0
  259. package/web/assets/packet-YPE3B663-LP52Z2RK-CgQPdNZa.js +1 -0
  260. package/web/assets/pie-LRSECV5Y-TCRJHUBD-BzWOwc_c.js +1 -0
  261. package/web/assets/pieDiagram-CU6KROY3-iZAqpvhd.js +30 -0
  262. package/web/assets/quadrantDiagram-VICAPDV7-bAm6Hi_5.js +7 -0
  263. package/web/assets/radar-GUYGQ44K-RDLRG3WG-B7KG0FN7.js +1 -0
  264. package/web/assets/requirementDiagram-JXO7QTGE-CtDijhnf.js +84 -0
  265. package/web/assets/sankeyDiagram-URQDO5SZ-LFJz53u5.js +40 -0
  266. package/web/assets/sequenceDiagram-VS2MUI6T-BdjvyCHM.js +162 -0
  267. package/web/assets/stateDiagram-7D4R322I-e5odN9fG.js +1 -0
  268. package/web/assets/stateDiagram-v2-36443NZ5-vPsvjR2D.js +1 -0
  269. package/web/assets/timeline-definition-O6YCAMPW-DPAksNQp.js +120 -0
  270. package/web/assets/treeView-BLDUP644-QA4HXRO3-CRSxEwLO.js +1 -0
  271. package/web/assets/treemap-LRROVOQU-LLAWBHMP-a0PfKoVn.js +1 -0
  272. package/web/assets/vennDiagram-MWXL3ELB-Dtlfdt7J.js +34 -0
  273. package/web/assets/wardley-L42UT6IY-5TKZOOLJ-BKQ6e5mC.js +1 -0
  274. package/web/assets/wardleyDiagram-CUQ6CDDI-B23uRMUC.js +78 -0
  275. package/web/assets/{xychartDiagram-ZHJ5623Y-DZ7fP1_3.js → xychartDiagram-N2JHSOCM-DxwHeksW.js} +6 -6
  276. package/web/index.html +13 -2
  277. package/web/assets/architecture-YZFGNWBL-S5CXDPWN-BUzkWgDl.js +0 -1
  278. package/web/assets/architectureDiagram-EMZXCZ2Q-CXbzok1G.js +0 -36
  279. package/web/assets/blockDiagram-IGV67L2C-DA1QJ4ZB.js +0 -132
  280. package/web/assets/chunk-3GS5O3IE-B8hpnia8.js +0 -231
  281. package/web/assets/chunk-3YCYZ6SJ-B-BVu21C.js +0 -1
  282. package/web/assets/chunk-6NTNNK5N-DW-jYSDr.js +0 -1
  283. package/web/assets/chunk-A34GCYZU-BbZl-IKy.js +0 -1
  284. package/web/assets/chunk-DJ7UZH7F-B5tMfF87.js +0 -1
  285. package/web/assets/chunk-DKKBVRCY-Djm-6K_e.js +0 -4
  286. package/web/assets/chunk-DU5LTGQ6-QPoynYcp.js +0 -1
  287. package/web/assets/chunk-FXACKDTF-jieSmbe2.js +0 -159
  288. package/web/assets/chunk-H3VCZNTA-8EMHZ3SV.js +0 -1
  289. package/web/assets/chunk-HN6EAY2L-CgE_agsD.js +0 -1
  290. package/web/assets/chunk-O5ABG6QK-DEZV1O19.js +0 -1
  291. package/web/assets/chunk-PK6DOVAG-BXv0JnsJ.js +0 -206
  292. package/web/assets/chunk-RNJOYNJ4-BiBkF9dN.js +0 -1
  293. package/web/assets/chunk-RWUO3TPN-DTWzAhQ1.js +0 -1
  294. package/web/assets/chunk-TBF5ZNIQ-BSl6s9lT.js +0 -1
  295. package/web/assets/chunk-TU3PZOEN-DE5Qhc0N.js +0 -1
  296. package/web/assets/chunk-TYMNRAUI-D1NDLIMG.js +0 -1
  297. package/web/assets/chunk-VELTKBKT-C9dVN39o.js +0 -1
  298. package/web/assets/chunk-W7ZLLLMY-Bu-cdLzs.js +0 -1
  299. package/web/assets/chunk-WSB5WSVC-Dor71SOz.js +0 -1
  300. package/web/assets/chunk-XGPFEOL4-CUonLRle.js +0 -1
  301. package/web/assets/classDiagram-PPOCWD7C-Cdd6UdVv.js +0 -1
  302. package/web/assets/classDiagram-v2-23LJLIIU-DNhxY2Ib.js +0 -1
  303. package/web/assets/cose-bilkent-PNC4W37J-DdZq7Qz_.js +0 -1
  304. package/web/assets/dagre-E77IOHMT-Cfj_6e17.js +0 -4
  305. package/web/assets/diagram-H7BISOXX-BNvpsrBv.js +0 -43
  306. package/web/assets/diagram-JC5VWROH-Cn0rtDbJ.js +0 -24
  307. package/web/assets/diagram-LXUTUG65-CHfoVKNm.js +0 -10
  308. package/web/assets/diagram-WEHSV5V5-BLxHksnu.js +0 -24
  309. package/web/assets/erDiagram-GCSMX5X6-DfdN6iqF.js +0 -85
  310. package/web/assets/ganttDiagram-MUNLMDZQ-BEfC_7Or.js +0 -292
  311. package/web/assets/gitGraph-7Q5UKJZL-54BCDZD5-B6ZeRLP0.js +0 -1
  312. package/web/assets/gitGraphDiagram-3HKGZ4G3-CG0kC8Q5.js +0 -106
  313. package/web/assets/index-3NUCUW2s.js +0 -886
  314. package/web/assets/info-OMHHGYJF-BF2H5H6G-BIOsZy0W.js +0 -1
  315. package/web/assets/infoDiagram-MN7RKWGX-DUoMH-pq.js +0 -2
  316. package/web/assets/journeyDiagram-SO5T7YLQ-BW8oKa3N.js +0 -139
  317. package/web/assets/kanban-definition-LJHFXRCJ-DzbOsR-2.js +0 -89
  318. package/web/assets/mindmap-definition-2EUWGEK5-BIXGQALq.js +0 -96
  319. package/web/assets/packet-4T2RLAQJ-EV4IVRXR-Bs7ysNMU.js +0 -1
  320. package/web/assets/pie-ZZUOXDRM-N23DN5KN-Csi8nnbH.js +0 -1
  321. package/web/assets/pieDiagram-3IATQBI2-QY-u7P6a.js +0 -30
  322. package/web/assets/quadrantDiagram-E256RVCF-Di4aNiU8.js +0 -7
  323. package/web/assets/radar-PYXPWWZC-P6TP7ZYP-DJlyXh2-.js +0 -1
  324. package/web/assets/requirementDiagram-M5DCFWZL-CzUUrhQD.js +0 -84
  325. package/web/assets/sankeyDiagram-L3NBLAOT-D2fbMiIU.js +0 -10
  326. package/web/assets/sequenceDiagram-ZOUHS735-BNdkqguh.js +0 -157
  327. package/web/assets/stateDiagram-MLPALWAM-51_Q2w2L.js +0 -1
  328. package/web/assets/stateDiagram-v2-B5LQ5ZB2-8nHs2aNE.js +0 -1
  329. package/web/assets/timeline-definition-5SPVSISX-DkMiGj4Z.js +0 -120
  330. package/web/assets/treeView-SZITEDCU-5DXDK3XO-Cy6P0_CZ.js +0 -1
  331. package/web/assets/treemap-W4RFUUIX-WYLRDWKO-C_pp1R7A.js +0 -1
  332. package/web/assets/vennDiagram-IE5QUKF5-BCxMmf9q.js +0 -34
  333. package/web/assets/wardley-RL74JXVD-BCRCBASE-CMStJhpn.js +0 -1
  334. package/web/assets/wardleyDiagram-XU3VSMPF-ijlLF77s.js +0 -20
  335. /package/web/assets/{context-builder-CqQNhRj1.js → context-builder-_HS0v2ma.js} +0 -0
@@ -0,0 +1,141 @@
1
+ /**
2
+ * C++ argument-dependent lookup (ADL / Koenig lookup).
3
+ *
4
+ * When ordinary unqualified lookup fails for a free-call site, ADL also
5
+ * considers candidates declared in the **associated namespaces** of the
6
+ * call's argument types (ISO C++ `[basic.lookup.argdep]`). The canonical
7
+ * pattern V1 unlocks:
8
+ *
9
+ * namespace audit { struct Event; void record(Event); }
10
+ * namespace app { void run() { audit::Event e; record(e); } }
11
+ *
12
+ * Without ADL: `record(e)` is unresolved because `app::run` doesn't
13
+ * `using` anything. With V1 ADL: `audit::record` is discovered via
14
+ * `audit::Event`'s associated namespace.
15
+ *
16
+ * ## Current boundary
17
+ *
18
+ * The current implementation covers class-typed arguments (value, pointer,
19
+ * and reference) and template specializations with explicit type arguments:
20
+ * - `audit::Event e`, `audit::Event* p`, `audit::Event** pp`
21
+ * - `audit::Event& r`, `audit::Event&& rr`
22
+ * - `std::vector<audit::Event>` (template namespace + template-arg namespaces)
23
+ *
24
+ * V2 additionally walks class ancestors (via MRO), so base-class enclosing
25
+ * namespaces also contribute associated namespaces.
26
+ *
27
+ * **GitNexus approximation (not strict ISO C++ ADL):** passing a qualified
28
+ * function reference like `utils::worker` contributes `utils` to the associated
29
+ * set, enabling resolution of unqualified calls like `with_callback(utils::worker)`
30
+ * to `utils::with_callback`. Under ISO C++ `[basic.lookup.argdep]`, associated
31
+ * entities for function-type arguments come from the **parameter types and return
32
+ * type** of each function in the overload set — NOT the function's enclosing
33
+ * namespace. For `void worker()`, the standard-compliant associated set is empty.
34
+ * GitNexus instead contributes the enclosing namespace of any Function/Method
35
+ * def whose simple name matches, because it enables the dominant real-world ADL
36
+ * pattern at reasonable precision cost.
37
+ *
38
+ * For qualified refs (e.g. `utils::worker`) the namespace is confirmed via a
39
+ * workspace lookup (only contributed when a Function/Method named `worker` exists
40
+ * in `utils`). For unqualified refs the workspace is searched for any Function
41
+ * def with that simple name. Locally-declared function-pointer variables
42
+ * (e.g. `void (*g)()`) and function parameters are excluded from this path.
43
+ *
44
+ * ADL candidates are merged with ordinary unqualified-lookup candidates
45
+ * in the free-call fallback before overload narrowing.
46
+ *
47
+ * ## Parenthesized-name suppression
48
+ *
49
+ * `(f)(s)` MUST NOT trigger ADL — the parenthesized name forces ordinary
50
+ * lookup only. `captures.ts` records sites whose `function` child is a
51
+ * `parenthesized_expression` into `noAdlSites`; `pickCppAdlCandidates`
52
+ * short-circuits when the site key is present.
53
+ *
54
+ * ## State lifecycle
55
+ *
56
+ * Three module-level maps populated per pipeline invocation, cleared via
57
+ * `clearCppAdlState()` (called from `clearFileLocalNames`):
58
+ *
59
+ * - `argInfoBySite` — per-call-site argument shape (capture-time)
60
+ * - `noAdlSites` — call sites with parenthesized function (capture-time)
61
+ * - `classToNamespaceQualifiedName` — class def → its enclosing namespace
62
+ * qualified name (`populateCppAssociatedNamespaces` time)
63
+ *
64
+ * The class→namespace map uses qualified names (not scope IDs) because
65
+ * C++ namespaces are open: `namespace N { ... }` in file A and
66
+ * `namespace N { ... }` in file B produce two distinct Namespace scopes
67
+ * but logically share the same namespace. ADL must consider candidates
68
+ * declared in either file.
69
+ */
70
+ import type { ParsedFile, SymbolDefinition } from '../../../../_shared/index.js';
71
+ import type { ScopeResolutionIndexes } from '../../model/scope-resolution-indexes.js';
72
+ /**
73
+ * Per-argument shape information collected at capture time. ADL fires for
74
+ * arguments where `simpleClassName !== ''`, including class pointers and
75
+ * references whose declarator chain resolves to a named class type.
76
+ * Free-function reference arguments use `functionRefText`.
77
+ */
78
+ export interface CppAdlArgInfo {
79
+ /** Simple class-like type name (last segment of qualified name); empty
80
+ * for primitives, literals, function pointers, etc. */
81
+ readonly simpleClassName: string;
82
+ /** Template's own simple class-like name (e.g. `vector` for
83
+ * `std::vector<N::T>`), empty when arg type is not a template spec. */
84
+ readonly templateSimpleClassName: string;
85
+ /** Template's own enclosing namespace (dot-qualified, e.g. `std`), empty
86
+ * when unavailable / unqualified. */
87
+ readonly templateNamespace: string;
88
+ /** Class-like names extracted from explicit type template arguments,
89
+ * recursively bounded. */
90
+ readonly templateArgClassNames: readonly string[];
91
+ /** Enclosing namespaces extracted from explicit type template arguments,
92
+ * recursively bounded. */
93
+ readonly templateArgNamespaces: readonly string[];
94
+ /** When set, the arg is a potential free-function reference (not a locally-
95
+ * declared function-pointer variable or function parameter). Contains the
96
+ * identifier text as written in source (e.g. `"utils::worker"` or
97
+ * `"worker"`). GitNexus approximation: the function's enclosing namespace
98
+ * is contributed to the ADL associated set. For qualified refs a workspace
99
+ * lookup confirms a Function/Method with that simple name exists in the
100
+ * namespace before contributing; for unqualified refs every namespace
101
+ * containing a matching Function/Method def is contributed. */
102
+ readonly functionRefText?: string;
103
+ }
104
+ /** Record per-call-site argument info. Called once per call site from
105
+ * `emitCppScopeCaptures`. */
106
+ export declare function markCppAdlSiteArgs(filePath: string, line: number, col: number, args: readonly CppAdlArgInfo[]): void;
107
+ /** Mark a call site as ADL-suppressed (function child wrapped in
108
+ * `parenthesized_expression`, e.g. `(f)(s)`). */
109
+ export declare function markCppAdlSiteNoAdl(filePath: string, line: number, col: number): void;
110
+ /** Clear ADL state. Called from `clearFileLocalNames` so all C++ resolver
111
+ * per-pipeline state is reset together. */
112
+ export declare function clearCppAdlState(): void;
113
+ /**
114
+ * Walk `parsed.scopes` to record each Class def's enclosing namespace
115
+ * qualified name. Run from the cpp resolver's `populateOwners` hook so
116
+ * the index is available before any resolution pass consults it.
117
+ *
118
+ * Computes the namespace's qualified name by walking parent scope chain
119
+ * and looking up Namespace defs in each parent's `ownedDefs`. The
120
+ * resulting name is dot-joined (matching `populateClassOwnedMembers`'s
121
+ * dotted convention; conversion to `::` is consumer-internal).
122
+ */
123
+ export declare function populateCppAssociatedNamespaces(parsed: ParsedFile): void;
124
+ /**
125
+ * ADL candidate collector. Returns:
126
+ * - `readonly SymbolDefinition[]` — ADL candidates to merge with
127
+ * ordinary unqualified lookup candidates.
128
+ * - `undefined` — no ADL candidates.
129
+ *
130
+ * Fires only when:
131
+ * - the call site is not in `noAdlSites` (parenthesized form), AND
132
+ * - at least one argument resolves to a named class type (value,
133
+ * pointer, or reference; but not function pointer, literal, or primitive).
134
+ */
135
+ export declare function pickCppAdlCandidates(site: {
136
+ readonly name: string;
137
+ readonly atRange: {
138
+ startLine: number;
139
+ startCol: number;
140
+ };
141
+ }, callerParsed: ParsedFile, scopes: ScopeResolutionIndexes, parsedFiles: readonly ParsedFile[]): readonly SymbolDefinition[] | undefined;
@@ -0,0 +1,478 @@
1
+ /**
2
+ * C++ argument-dependent lookup (ADL / Koenig lookup).
3
+ *
4
+ * When ordinary unqualified lookup fails for a free-call site, ADL also
5
+ * considers candidates declared in the **associated namespaces** of the
6
+ * call's argument types (ISO C++ `[basic.lookup.argdep]`). The canonical
7
+ * pattern V1 unlocks:
8
+ *
9
+ * namespace audit { struct Event; void record(Event); }
10
+ * namespace app { void run() { audit::Event e; record(e); } }
11
+ *
12
+ * Without ADL: `record(e)` is unresolved because `app::run` doesn't
13
+ * `using` anything. With V1 ADL: `audit::record` is discovered via
14
+ * `audit::Event`'s associated namespace.
15
+ *
16
+ * ## Current boundary
17
+ *
18
+ * The current implementation covers class-typed arguments (value, pointer,
19
+ * and reference) and template specializations with explicit type arguments:
20
+ * - `audit::Event e`, `audit::Event* p`, `audit::Event** pp`
21
+ * - `audit::Event& r`, `audit::Event&& rr`
22
+ * - `std::vector<audit::Event>` (template namespace + template-arg namespaces)
23
+ *
24
+ * V2 additionally walks class ancestors (via MRO), so base-class enclosing
25
+ * namespaces also contribute associated namespaces.
26
+ *
27
+ * **GitNexus approximation (not strict ISO C++ ADL):** passing a qualified
28
+ * function reference like `utils::worker` contributes `utils` to the associated
29
+ * set, enabling resolution of unqualified calls like `with_callback(utils::worker)`
30
+ * to `utils::with_callback`. Under ISO C++ `[basic.lookup.argdep]`, associated
31
+ * entities for function-type arguments come from the **parameter types and return
32
+ * type** of each function in the overload set — NOT the function's enclosing
33
+ * namespace. For `void worker()`, the standard-compliant associated set is empty.
34
+ * GitNexus instead contributes the enclosing namespace of any Function/Method
35
+ * def whose simple name matches, because it enables the dominant real-world ADL
36
+ * pattern at reasonable precision cost.
37
+ *
38
+ * For qualified refs (e.g. `utils::worker`) the namespace is confirmed via a
39
+ * workspace lookup (only contributed when a Function/Method named `worker` exists
40
+ * in `utils`). For unqualified refs the workspace is searched for any Function
41
+ * def with that simple name. Locally-declared function-pointer variables
42
+ * (e.g. `void (*g)()`) and function parameters are excluded from this path.
43
+ *
44
+ * ADL candidates are merged with ordinary unqualified-lookup candidates
45
+ * in the free-call fallback before overload narrowing.
46
+ *
47
+ * ## Parenthesized-name suppression
48
+ *
49
+ * `(f)(s)` MUST NOT trigger ADL — the parenthesized name forces ordinary
50
+ * lookup only. `captures.ts` records sites whose `function` child is a
51
+ * `parenthesized_expression` into `noAdlSites`; `pickCppAdlCandidates`
52
+ * short-circuits when the site key is present.
53
+ *
54
+ * ## State lifecycle
55
+ *
56
+ * Three module-level maps populated per pipeline invocation, cleared via
57
+ * `clearCppAdlState()` (called from `clearFileLocalNames`):
58
+ *
59
+ * - `argInfoBySite` — per-call-site argument shape (capture-time)
60
+ * - `noAdlSites` — call sites with parenthesized function (capture-time)
61
+ * - `classToNamespaceQualifiedName` — class def → its enclosing namespace
62
+ * qualified name (`populateCppAssociatedNamespaces` time)
63
+ *
64
+ * The class→namespace map uses qualified names (not scope IDs) because
65
+ * C++ namespaces are open: `namespace N { ... }` in file A and
66
+ * `namespace N { ... }` in file B produce two distinct Namespace scopes
67
+ * but logically share the same namespace. ADL must consider candidates
68
+ * declared in either file.
69
+ */
70
+ import { isCppInlineNamespaceScope } from './inline-namespaces.js';
71
+ const argInfoBySite = new Map();
72
+ const noAdlSites = new Set();
73
+ const classToNamespaceQualifiedName = new Map();
74
+ function siteKey(filePath, line, col) {
75
+ return `${filePath}:${line}:${col}`;
76
+ }
77
+ /** Record per-call-site argument info. Called once per call site from
78
+ * `emitCppScopeCaptures`. */
79
+ export function markCppAdlSiteArgs(filePath, line, col, args) {
80
+ argInfoBySite.set(siteKey(filePath, line, col), args);
81
+ }
82
+ /** Mark a call site as ADL-suppressed (function child wrapped in
83
+ * `parenthesized_expression`, e.g. `(f)(s)`). */
84
+ export function markCppAdlSiteNoAdl(filePath, line, col) {
85
+ noAdlSites.add(siteKey(filePath, line, col));
86
+ }
87
+ /** Clear ADL state. Called from `clearFileLocalNames` so all C++ resolver
88
+ * per-pipeline state is reset together. */
89
+ export function clearCppAdlState() {
90
+ argInfoBySite.clear();
91
+ noAdlSites.clear();
92
+ classToNamespaceQualifiedName.clear();
93
+ }
94
+ /**
95
+ * Walk `parsed.scopes` to record each Class def's enclosing namespace
96
+ * qualified name. Run from the cpp resolver's `populateOwners` hook so
97
+ * the index is available before any resolution pass consults it.
98
+ *
99
+ * Computes the namespace's qualified name by walking parent scope chain
100
+ * and looking up Namespace defs in each parent's `ownedDefs`. The
101
+ * resulting name is dot-joined (matching `populateClassOwnedMembers`'s
102
+ * dotted convention; conversion to `::` is consumer-internal).
103
+ */
104
+ export function populateCppAssociatedNamespaces(parsed) {
105
+ const scopesById = new Map();
106
+ for (const scope of parsed.scopes)
107
+ scopesById.set(scope.id, scope);
108
+ for (const scope of parsed.scopes) {
109
+ if (scope.kind !== 'Class')
110
+ continue;
111
+ const nsQName = computeEnclosingNamespaceQName(scope, scopesById);
112
+ if (nsQName === '')
113
+ continue;
114
+ for (const def of scope.ownedDefs) {
115
+ if (def.type !== 'Class' && def.type !== 'Struct' && def.type !== 'Interface')
116
+ continue;
117
+ classToNamespaceQualifiedName.set(def.nodeId, nsQName);
118
+ }
119
+ }
120
+ // Enum defs live in Namespace scopes directly (not inside Class scopes).
121
+ // Map each Enum def to its enclosing namespace so ADL on enum-typed
122
+ // arguments contributes the correct associated namespace.
123
+ for (const scope of parsed.scopes) {
124
+ if (scope.kind !== 'Namespace')
125
+ continue;
126
+ const nsQName = computeNamespaceQName(scope, scopesById);
127
+ if (nsQName === '')
128
+ continue;
129
+ for (const def of scope.ownedDefs) {
130
+ if (def.type !== 'Enum')
131
+ continue;
132
+ classToNamespaceQualifiedName.set(def.nodeId, nsQName);
133
+ }
134
+ }
135
+ }
136
+ /**
137
+ * ADL candidate collector. Returns:
138
+ * - `readonly SymbolDefinition[]` — ADL candidates to merge with
139
+ * ordinary unqualified lookup candidates.
140
+ * - `undefined` — no ADL candidates.
141
+ *
142
+ * Fires only when:
143
+ * - the call site is not in `noAdlSites` (parenthesized form), AND
144
+ * - at least one argument resolves to a named class type (value,
145
+ * pointer, or reference; but not function pointer, literal, or primitive).
146
+ */
147
+ export function pickCppAdlCandidates(site, callerParsed, scopes, parsedFiles) {
148
+ const key = siteKey(callerParsed.filePath, site.atRange.startLine, site.atRange.startCol);
149
+ if (noAdlSites.has(key))
150
+ return undefined;
151
+ const args = argInfoBySite.get(key);
152
+ if (args === undefined || args.length === 0)
153
+ return undefined;
154
+ // Collect associated namespace QNames from every participating class-typed arg
155
+ // and from function-reference args.
156
+ const associatedNamespaces = new Set();
157
+ for (const arg of args) {
158
+ collectAssociatedNamespacesForAdlArg(arg, scopes, associatedNamespaces);
159
+ if (arg.functionRefText !== undefined) {
160
+ collectFunctionRefNamespaces(arg.functionRefText, parsedFiles, associatedNamespaces);
161
+ }
162
+ }
163
+ if (associatedNamespaces.size === 0)
164
+ return undefined;
165
+ // Walk every namespace scope in every parsed file; collect callable
166
+ // ownedDefs whose enclosing namespace matches one of the associated
167
+ // QNames AND whose simple name matches the call's name.
168
+ // ISO C++: inline namespaces are transparent — candidates in inline
169
+ // children of an associated namespace are also ADL-reachable.
170
+ const candidates = [];
171
+ const seenKey = new Set();
172
+ for (const parsed of parsedFiles) {
173
+ const scopesById = new Map();
174
+ for (const sc of parsed.scopes)
175
+ scopesById.set(sc.id, sc);
176
+ for (const scope of parsed.scopes) {
177
+ if (scope.kind !== 'Namespace')
178
+ continue;
179
+ const qName = computeNamespaceQName(scope, scopesById);
180
+ if (!associatedNamespaces.has(qName)) {
181
+ // Check if this is an inline-namespace child of an associated NS.
182
+ // ISO C++ inline namespaces are transparent for ADL: if the outer
183
+ // namespace is in the associated set, candidates in the inline child
184
+ // are also reachable.
185
+ if (!isCppInlineNamespaceScope(scope.id))
186
+ continue;
187
+ const parentScope = scope.parent !== null ? scopesById.get(scope.parent) : undefined;
188
+ if (parentScope === undefined || parentScope.kind !== 'Namespace')
189
+ continue;
190
+ const parentQName = computeNamespaceQName(parentScope, scopesById);
191
+ if (!associatedNamespaces.has(parentQName))
192
+ continue;
193
+ }
194
+ for (const def of scope.ownedDefs) {
195
+ if (def.type !== 'Function' && def.type !== 'Method' && def.type !== 'Constructor') {
196
+ continue;
197
+ }
198
+ const simple = def.qualifiedName?.split('.').pop() ?? def.qualifiedName ?? '';
199
+ if (simple !== site.name)
200
+ continue;
201
+ // Dedup by nodeId — using normalized parameter-types as the key
202
+ // would collapse `process(int)`/`process(long)`-style overloads
203
+ // (both normalize to `['int']`) before
204
+ // `isOverloadAmbiguousAfterNormalization` can detect them.
205
+ if (seenKey.has(def.nodeId))
206
+ continue;
207
+ seenKey.add(def.nodeId);
208
+ candidates.push(def);
209
+ }
210
+ }
211
+ // ISO C++ `[basic.lookup.argdep]` §2: hidden friend functions declared
212
+ // inside a class body are visible via ADL when the class is an associated
213
+ // class. Scan Class scopes whose enclosing namespace is in the associated
214
+ // set for callable ownedDefs matching the call name. This enables the
215
+ // canonical "hidden friend" idiom:
216
+ // struct Foo { friend void swap(Foo&, Foo&) {} };
217
+ for (const scope of parsed.scopes) {
218
+ if (scope.kind !== 'Class')
219
+ continue;
220
+ // Check if ANY class def in this scope has an associated namespace.
221
+ let isAssociatedClass = false;
222
+ for (const def of scope.ownedDefs) {
223
+ if (def.type !== 'Class' && def.type !== 'Struct' && def.type !== 'Interface')
224
+ continue;
225
+ const nsQName = classToNamespaceQualifiedName.get(def.nodeId);
226
+ if (nsQName !== undefined && associatedNamespaces.has(nsQName)) {
227
+ isAssociatedClass = true;
228
+ break;
229
+ }
230
+ }
231
+ if (!isAssociatedClass)
232
+ continue;
233
+ // Also scan Function scopes that are direct children of this class
234
+ // scope — friend function definitions create their own Function scope
235
+ // underneath the Class scope.
236
+ for (const childScope of parsed.scopes) {
237
+ if (childScope.parent !== scope.id)
238
+ continue;
239
+ if (childScope.kind !== 'Function')
240
+ continue;
241
+ for (const def of childScope.ownedDefs) {
242
+ if (def.type !== 'Function' && def.type !== 'Method' && def.type !== 'Constructor') {
243
+ continue;
244
+ }
245
+ const simple = def.qualifiedName?.split('.').pop() ?? def.qualifiedName ?? '';
246
+ if (simple !== site.name)
247
+ continue;
248
+ if (seenKey.has(def.nodeId))
249
+ continue;
250
+ seenKey.add(def.nodeId);
251
+ candidates.push(def);
252
+ }
253
+ }
254
+ for (const def of scope.ownedDefs) {
255
+ if (def.type !== 'Function' && def.type !== 'Method' && def.type !== 'Constructor') {
256
+ continue;
257
+ }
258
+ const simple = def.qualifiedName?.split('.').pop() ?? def.qualifiedName ?? '';
259
+ if (simple !== site.name)
260
+ continue;
261
+ if (seenKey.has(def.nodeId))
262
+ continue;
263
+ seenKey.add(def.nodeId);
264
+ candidates.push(def);
265
+ }
266
+ }
267
+ }
268
+ if (candidates.length === 0)
269
+ return undefined;
270
+ return candidates;
271
+ }
272
+ function collectAssociatedNamespacesForAdlArg(arg, scopes, associatedNamespaces) {
273
+ // For template args this may be the template name itself (e.g. `vector`);
274
+ // simple-name lookup can match project classes with the same name (known
275
+ // V1/V2 simplification).
276
+ addAssociatedNamespaceForClassName(arg.simpleClassName, scopes, associatedNamespaces);
277
+ // Includes template-owner namespaces (e.g. `std` in std::vector<T>). If
278
+ // that surfaces extra candidates, merged-candidate overload narrowing in
279
+ // free-call-fallback suppresses arbitrary edge emission.
280
+ if (arg.templateNamespace.length > 0)
281
+ associatedNamespaces.add(arg.templateNamespace);
282
+ for (const ns of arg.templateArgNamespaces) {
283
+ if (ns.length > 0)
284
+ associatedNamespaces.add(ns);
285
+ }
286
+ for (const className of arg.templateArgClassNames) {
287
+ addAssociatedNamespaceForClassName(className, scopes, associatedNamespaces);
288
+ }
289
+ }
290
+ function addAssociatedNamespaceForClassName(simpleClassName, scopes, associatedNamespaces) {
291
+ if (simpleClassName.length === 0)
292
+ return;
293
+ const classLookup = findCppClassDefBySimpleName(simpleClassName, scopes);
294
+ if (classLookup === undefined)
295
+ return;
296
+ const { classDef, ambiguous } = classLookup;
297
+ const nsQName = classToNamespaceQualifiedName.get(classDef.nodeId);
298
+ if (nsQName !== undefined)
299
+ associatedNamespaces.add(nsQName);
300
+ // Preserve V1 collision behavior for the direct class namespace, but avoid
301
+ // amplifying a same-simple-name collision by walking an arbitrary class's
302
+ // full MRO chain.
303
+ if (ambiguous)
304
+ return;
305
+ for (const ancestorDefId of scopes.methodDispatch.mroFor(classDef.nodeId)) {
306
+ const ancestorNsQName = classToNamespaceQualifiedName.get(ancestorDefId);
307
+ if (ancestorNsQName !== undefined)
308
+ associatedNamespaces.add(ancestorNsQName);
309
+ }
310
+ }
311
+ /** Walk upward from a Class scope, finding the innermost enclosing
312
+ * Namespace scope, and return that namespace's qualified name (dot-
313
+ * joined, outermost-first). Returns '' when the class has no enclosing
314
+ * namespace (e.g., declared at translation-unit scope). */
315
+ function computeEnclosingNamespaceQName(classScope, scopesById) {
316
+ let parentId = classScope.parent;
317
+ while (parentId !== null) {
318
+ const parent = scopesById.get(parentId);
319
+ if (parent === undefined)
320
+ return '';
321
+ if (parent.kind === 'Namespace') {
322
+ return computeNamespaceQName(parent, scopesById);
323
+ }
324
+ parentId = parent.parent;
325
+ }
326
+ return '';
327
+ }
328
+ /** Walk upward from a Namespace scope collecting each enclosing
329
+ * Namespace's simple name (innermost last). Returns the dot-joined
330
+ * qualified name (e.g., `outer.inner`). The namespace's own def lives
331
+ * in its OWN scope's `ownedDefs` (the C++ extractor stamps the
332
+ * namespace-decl def into the namespace scope itself, not the parent
333
+ * module scope). */
334
+ function computeNamespaceQName(nsScope, scopesById) {
335
+ const segments = [];
336
+ let currentId = nsScope.parent;
337
+ let current = nsScope;
338
+ // Outer guard against pathological cycles in malformed scope trees.
339
+ let safety = 64;
340
+ while (current !== undefined && safety-- > 0) {
341
+ const nsDef = findNamespaceDefInScope(current);
342
+ if (nsDef === undefined) {
343
+ // No name found — bail out. Returning a partial QName would risk
344
+ // false ADL associations.
345
+ return '';
346
+ }
347
+ const simple = nsDef.qualifiedName?.split('.').pop() ?? nsDef.qualifiedName ?? '';
348
+ segments.unshift(simple);
349
+ // Walk up to next enclosing namespace (skipping non-namespace parents).
350
+ let nextId = currentId;
351
+ let nextNs;
352
+ while (nextId !== null) {
353
+ const nx = scopesById.get(nextId);
354
+ if (nx === undefined)
355
+ break;
356
+ if (nx.kind === 'Namespace') {
357
+ nextNs = nx;
358
+ currentId = nx.parent;
359
+ break;
360
+ }
361
+ nextId = nx.parent;
362
+ }
363
+ current = nextNs;
364
+ }
365
+ return segments.join('.');
366
+ }
367
+ /** Find the Namespace def attached to this scope (the namespace's own
368
+ * decl, stamped into its own `ownedDefs` by the C++ extractor). Returns
369
+ * the first Namespace-type def encountered — for normal C++ the scope
370
+ * carries exactly one Namespace-typed self def. */
371
+ function findNamespaceDefInScope(scope) {
372
+ for (const def of scope.ownedDefs) {
373
+ if (def.type === 'Namespace')
374
+ return def;
375
+ }
376
+ return undefined;
377
+ }
378
+ /** Find a class-like or enum def by simple name across the workspace.
379
+ * V1 still arbitrary-picks the first match on collisions (multiple defs
380
+ * share the simple name), but reports the collision so callers can avoid
381
+ * amplifying that uncertainty (for example by skipping MRO expansion).
382
+ * C++ ADL strictness would require full type-driven lookup.
383
+ *
384
+ * ISO C++ `[basic.lookup.argdep]` §2: enumerations contribute their
385
+ * enclosing namespace to the associated set, just like class types. */
386
+ function findCppClassDefBySimpleName(simpleName, scopes) {
387
+ let firstMatch;
388
+ for (const def of scopes.defs.byId.values()) {
389
+ if (def.type !== 'Class' &&
390
+ def.type !== 'Struct' &&
391
+ def.type !== 'Interface' &&
392
+ def.type !== 'Enum')
393
+ continue;
394
+ const simple = def.qualifiedName?.split('.').pop() ?? def.qualifiedName ?? '';
395
+ if (simple !== simpleName)
396
+ continue;
397
+ if (firstMatch === undefined) {
398
+ firstMatch = def;
399
+ continue;
400
+ }
401
+ return { classDef: firstMatch, ambiguous: true };
402
+ }
403
+ if (firstMatch === undefined)
404
+ return undefined;
405
+ return { classDef: firstMatch, ambiguous: false };
406
+ }
407
+ /**
408
+ * Contribute associated namespaces for a function-reference argument.
409
+ *
410
+ * - **Qualified refs** (`utils::worker`, `outer::inner::fn`): the namespace
411
+ * is extracted from the qualifier text (converting `::` to `.` for dot-joined
412
+ * QName matching). A workspace lookup then **verifies** that a Function or
413
+ * Method def named `worker` (the simple name after the last `::`) actually
414
+ * exists in the extracted namespace. This prevents false positives from
415
+ * namespace-qualified variables, enum values, and static data members, which
416
+ * also produce `qualified_identifier` AST nodes in tree-sitter-cpp (the
417
+ * AST node type alone does not distinguish functions from non-function names).
418
+ * - **Unqualified refs** (`worker`): the workspace is searched for any
419
+ * Function/Method def whose simple name matches. Every distinct enclosing
420
+ * namespace found is added — overloads across the same namespace produce
421
+ * a single entry; GitNexus does not select a specific overload at this stage.
422
+ */
423
+ function collectFunctionRefNamespaces(refText, parsedFiles, out) {
424
+ const colonIdx = refText.lastIndexOf('::');
425
+ if (colonIdx !== -1) {
426
+ // Qualified ref: extract namespace prefix and normalise :: → dot notation.
427
+ const nsText = refText.slice(0, colonIdx).replace(/::/g, '.');
428
+ if (nsText === '')
429
+ return;
430
+ const simpleName = refText.slice(colonIdx + 2);
431
+ // Verify that a Function/Method named `simpleName` exists in `nsText`.
432
+ // Without this guard every `a::b` qualified_identifier arg (variable,
433
+ // enum value, static member, type alias) would blindly contribute `a`
434
+ // to the associated set and risk a false-positive CALLS edge.
435
+ for (const parsed of parsedFiles) {
436
+ const scopesById = new Map();
437
+ for (const sc of parsed.scopes)
438
+ scopesById.set(sc.id, sc);
439
+ for (const scope of parsed.scopes) {
440
+ if (scope.kind !== 'Namespace')
441
+ continue;
442
+ if (computeNamespaceQName(scope, scopesById) !== nsText)
443
+ continue;
444
+ for (const def of scope.ownedDefs) {
445
+ if (def.type !== 'Function' && def.type !== 'Method')
446
+ continue;
447
+ const simple = def.qualifiedName?.split('.').pop() ?? def.qualifiedName ?? '';
448
+ if (simple === simpleName) {
449
+ out.add(nsText);
450
+ return; // Namespace confirmed; no need to scan further files.
451
+ }
452
+ }
453
+ }
454
+ }
455
+ return;
456
+ }
457
+ // Unqualified: search all namespace scopes for a Function def with this
458
+ // simple name and contribute its enclosing namespace.
459
+ for (const parsed of parsedFiles) {
460
+ const scopesById = new Map();
461
+ for (const sc of parsed.scopes)
462
+ scopesById.set(sc.id, sc);
463
+ for (const scope of parsed.scopes) {
464
+ if (scope.kind !== 'Namespace')
465
+ continue;
466
+ for (const def of scope.ownedDefs) {
467
+ if (def.type !== 'Function' && def.type !== 'Method')
468
+ continue;
469
+ const simple = def.qualifiedName?.split('.').pop() ?? def.qualifiedName ?? '';
470
+ if (simple !== refText)
471
+ continue;
472
+ const nsQName = computeNamespaceQName(scope, scopesById);
473
+ if (nsQName !== '')
474
+ out.add(nsQName);
475
+ }
476
+ }
477
+ }
478
+ }
@@ -0,0 +1,18 @@
1
+ import type { SyntaxNode } from '../../utils/ast-helpers.js';
2
+ export interface CppArityInfo {
3
+ parameterCount?: number;
4
+ requiredParameterCount?: number;
5
+ parameterTypes?: string[];
6
+ }
7
+ /**
8
+ * Compute declaration arity from a C++ function definition or declaration node.
9
+ * Extends the C arity computation with support for:
10
+ * - optional_parameter_declaration (default parameters)
11
+ * - variadic_parameter_declaration / parameter packs
12
+ * - (void) explicit zero-parameter form
13
+ */
14
+ export declare function computeCppDeclarationArity(node: SyntaxNode): CppArityInfo;
15
+ /**
16
+ * Compute call-site arity from a call_expression node.
17
+ */
18
+ export declare function computeCppCallArity(node: SyntaxNode): number;