You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cross-file inference creates false edges via common .NET method names #437
The cross-file call resolution in extract.py matches unresolved callee names against any node label in the graph. Common .NET BCL method names (Contains, Equals, ToString, Where, Select, Add, Remove, etc.) match unintended nodes — for example, string.Contains() calls match F# union case EdgeRelation.Contains, or list.Add() matches a user-defined Add method in a completely unrelated module.
This creates hundreds of false INFERRED edges, pollutes community detection, and produces misleading god nodes.
Proposed Fix
Add a blocklist of ~120 common .NET BCL/framework method names that are skipped during cross-file call resolution. This is the same pattern used by the existing _SKIP_LABELS set but targeted at method names rather than module names.
Impact
Tested on a mixed F#/C#/Blazor project:
False INFERRED edges dropped from 538 to 362
Top hub changed from Contains (false positive) to BookService (correct)
Confirming this on Python + JavaScript (0.9.34), and flagging that the proposed remedy — a
~120-name .NET BCL blocklist — would not have caught my case, because the colliding names are all user-defined.
Corpus: a mixed Python/JS monorepo, three sibling applications under one directory, no shared code
layer between them by design. Extraction: --code-only --no-cluster (no LLM), 527 files, 6831 nodes,
15811 edges.
Of the 40 edges the graph drew between the three applications, 37 were INFERRED and all 37
were false. Representative, with names generalised:
Verified mechanism on one of them: a function get_cmap_color(cmap_name) in app A was linked to a
property def cmap(self) in app C. The only thing they share is the string cmap. Same for .load(), .update(), .toggle(), .norm() — ordinary domain vocabulary, not framework methods, so no
BCL/stdlib blocklist reaches them.
Two observations that may be useful for the fix:
The false edges concentrate exactly where they do the most damage. Intra-application edges were
fine (app A 9285, app B 3921, app C 579, all plausible). It is the cross-module edges — the ones a
reader consults precisely because they are surprising — where precision collapsed to ~7% (3/40).
A user checking "are these two subsystems coupled?" gets a confident wrong answer.
A blocklist is the wrong shape for this. The three EXTRACTED cross-application edges in the
same run were all correct (verified against source — genuine from x.y import z statements). The
split is clean: resolution that has a real binding is trustworthy; resolution that falls back to
matching a bare callee name against any node label in the graph is not. Rather than enumerating
names to skip, consider not emitting a cross-file INFERRED edge at all when the only evidence is a
name match on a dotted/receiver-less call (obj.method()), which is also what calls edges are never resolved for member/dotted calls (obj.method(), Type.method()) by deliberate design — only bare (undotted) calls resolve, via a fragile label-text match that isn't scoped to real definitions #2041 is about.
That would be language-agnostic and would have removed all 37 here without touching the 3 true ones.
Workaround for anyone landing here: filter confidence == "EXTRACTED" before reading the graph. On
that filter the output was accurate in my run — it correctly surfaced a real cross-application import I
did not know about.
A data point from a nearby change, since this issue is the reason I checked.
While adding object creation to the C# call_types (#2997, patch in #2998) I tested what happens when the constructed name is ambiguous. Two classes called Cache in different namespaces, one construction site, using on one of them: the result is no edge at all rather than a pick.
So for type-name targets the guard already behaves the way you describe here. I added a test that asserts it, so a later change cannot turn it into a false edge without the suite noticing.
Activity
fix(symbol-resolution): gate INFERRED cross-file calls on import evid…
singhsatyampratap commentedon Aug 6, 2026
Confirming this on Python + JavaScript (0.9.34), and flagging that the proposed remedy — a
~120-name .NET BCL blocklist — would not have caught my case, because the colliding names are all
user-defined.
Corpus: a mixed Python/JS monorepo, three sibling applications under one directory, no shared code
layer between them by design. Extraction:
--code-only --no-cluster(no LLM), 527 files, 6831 nodes,15811 edges.
Of the 40 edges the graph drew between the three applications, 37 were
INFERREDand all 37were false. Representative, with names generalised:
Verified mechanism on one of them: a function
get_cmap_color(cmap_name)in app A was linked to aproperty
def cmap(self)in app C. The only thing they share is the stringcmap. Same for.load(),.update(),.toggle(),.norm()— ordinary domain vocabulary, not framework methods, so noBCL/stdlib blocklist reaches them.
Two observations that may be useful for the fix:
fine (app A 9285, app B 3921, app C 579, all plausible). It is the cross-module edges — the ones a
reader consults precisely because they are surprising — where precision collapsed to ~7% (3/40).
A user checking "are these two subsystems coupled?" gets a confident wrong answer.
EXTRACTEDcross-application edges in thesame run were all correct (verified against source — genuine
from x.y import zstatements). Thesplit is clean: resolution that has a real binding is trustworthy; resolution that falls back to
matching a bare callee name against any node label in the graph is not. Rather than enumerating
names to skip, consider not emitting a cross-file
INFERREDedge at all when the only evidence is aname match on a dotted/receiver-less call (
obj.method()), which is also whatcallsedges are never resolved for member/dotted calls (obj.method(),Type.method()) by deliberate design — only bare (undotted) calls resolve, via a fragile label-text match that isn't scoped to real definitions #2041 is about.That would be language-agnostic and would have removed all 37 here without touching the 3 true ones.
Workaround for anyone landing here: filter
confidence == "EXTRACTED"before reading the graph. Onthat filter the output was accurate in my run — it correctly surfaced a real cross-application import I
did not know about.
durmazoguzhan commentedon Aug 24, 2026
A data point from a nearby change, since this issue is the reason I checked.
While adding object creation to the C#
call_types(#2997, patch in #2998) I tested what happens when the constructed name is ambiguous. Two classes calledCachein different namespaces, one construction site,usingon one of them: the result is no edge at all rather than a pick.So for type-name targets the guard already behaves the way you describe here. I added a test that asserts it, so a later change cannot turn it into a false edge without the suite noticing.