Commit a62bab7
committed
fix(resolver): resolveByGlobal picks the single best match, not every candidate
resolveByGlobal's exact-name lookup returned every same-named symbol in the
codebase that cleared the 0.5 directory-proximity confidence threshold, and
resolveCallTargets/emitDirectCallEdgesForCall then emitted a calls edge to
each one instead of the single most likely target. A bare (no-receiver) or
this/self/super call carries no type info to disambiguate, so fanning out
turned one real call site into N-1 false edges (e.g. four object-literal
close() methods in src/db/connection.ts each getting a calls edge from every
caller that destructures a close() handle).
Fix: reduce the exact-name lookup to the single unambiguous highest-confidence
candidate. A genuine tie at the top confidence has no principled winner and
now resolves to nothing rather than betting on all of them, falling through
to the narrower same-class-sibling fallback instead.
Mirrored in both engines: src/domain/graph/resolver/strategy.ts (WASM/TS) and
crates/codegraph-core/src/domain/graph/builder/stages/build_edges.rs (native).
Updates two pre-existing tests whose fixtures/assertions had baked in the old
fan-out behavior as expected (#1519's byName suite, #1752's reverse-dep
reconnect baseline, which had already flagged this exact scenario as a
"separate, pre-existing concern — filed independently").
Impact: 2 functions changed, 10 affected1 parent 51b9e23 commit a62bab7
5 files changed
Lines changed: 276 additions & 58 deletions
File tree
- crates/codegraph-core/src/domain/graph/builder/stages
- src/domain/graph/resolver
- tests
- integration
- unit
Lines changed: 96 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
934 | 934 | | |
935 | 935 | | |
936 | 936 | | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
937 | 971 | | |
938 | 972 | | |
939 | 973 | | |
| |||
1180 | 1214 | | |
1181 | 1215 | | |
1182 | 1216 | | |
1183 | | - | |
1184 | | - | |
1185 | | - | |
1186 | | - | |
1187 | | - | |
1188 | | - | |
| 1217 | + | |
1189 | 1218 | | |
1190 | 1219 | | |
1191 | 1220 | | |
| |||
2854 | 2883 | | |
2855 | 2884 | | |
2856 | 2885 | | |
| 2886 | + | |
| 2887 | + | |
| 2888 | + | |
| 2889 | + | |
| 2890 | + | |
| 2891 | + | |
| 2892 | + | |
| 2893 | + | |
| 2894 | + | |
| 2895 | + | |
| 2896 | + | |
| 2897 | + | |
| 2898 | + | |
| 2899 | + | |
| 2900 | + | |
| 2901 | + | |
| 2902 | + | |
| 2903 | + | |
| 2904 | + | |
| 2905 | + | |
| 2906 | + | |
| 2907 | + | |
| 2908 | + | |
| 2909 | + | |
| 2910 | + | |
| 2911 | + | |
| 2912 | + | |
| 2913 | + | |
| 2914 | + | |
| 2915 | + | |
| 2916 | + | |
| 2917 | + | |
| 2918 | + | |
| 2919 | + | |
| 2920 | + | |
| 2921 | + | |
| 2922 | + | |
| 2923 | + | |
| 2924 | + | |
| 2925 | + | |
| 2926 | + | |
| 2927 | + | |
| 2928 | + | |
| 2929 | + | |
| 2930 | + | |
| 2931 | + | |
| 2932 | + | |
| 2933 | + | |
| 2934 | + | |
| 2935 | + | |
| 2936 | + | |
| 2937 | + | |
| 2938 | + | |
| 2939 | + | |
| 2940 | + | |
| 2941 | + | |
| 2942 | + | |
| 2943 | + | |
| 2944 | + | |
| 2945 | + | |
| 2946 | + | |
2857 | 2947 | | |
2858 | 2948 | | |
2859 | 2949 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
328 | 361 | | |
329 | 362 | | |
330 | 363 | | |
331 | 364 | | |
332 | 365 | | |
333 | 366 | | |
334 | | - | |
335 | | - | |
| 367 | + | |
| 368 | + | |
336 | 369 | | |
337 | 370 | | |
338 | 371 | | |
| |||
344 | 377 | | |
345 | 378 | | |
346 | 379 | | |
347 | | - | |
348 | | - | |
349 | | - | |
| 380 | + | |
350 | 381 | | |
351 | 382 | | |
352 | 383 | | |
| |||
Lines changed: 40 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
13 | 17 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
18 | 33 | | |
19 | 34 | | |
20 | 35 | | |
| |||
42 | 57 | | |
43 | 58 | | |
44 | 59 | | |
45 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
46 | 63 | | |
47 | 64 | | |
48 | 65 | | |
49 | 66 | | |
50 | | - | |
| 67 | + | |
51 | 68 | | |
52 | 69 | | |
53 | 70 | | |
| |||
127 | 144 | | |
128 | 145 | | |
129 | 146 | | |
130 | | - | |
| 147 | + | |
131 | 148 | | |
132 | 149 | | |
133 | 150 | | |
| |||
166 | 183 | | |
167 | 184 | | |
168 | 185 | | |
169 | | - | |
| 186 | + | |
170 | 187 | | |
171 | 188 | | |
172 | 189 | | |
173 | 190 | | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
178 | 195 | | |
179 | 196 | | |
180 | | - | |
| 197 | + | |
181 | 198 | | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
194 | 204 | | |
195 | 205 | | |
196 | 206 | | |
| |||
0 commit comments