fix(extract): don't promote module-imported same-named calls to EXTRACTED (#2945)

When an ambiguous bare call resolves to a candidate solely because the
caller imported the candidate's source module (not the symbol itself), the
edge was promoted to EXTRACTED, falsely certifying a same-named symbol that
was never actually imported. Keep the resolution (for graph connectivity) but
mark it INFERRED. Symbol-level (from X import Y) imports still promote to
EXTRACTED.
This commit is contained in:
nothariharan committed 2026-10-23 16:14:23 +05:30
1 parent c588b72d93
commit e73ca4e4a7
1 file changed
+5 -1
+5 -1
View File
@@ -10714,7 +10714,11 @@ def extract(
]
if len(module_matches) == 1:
tgt = module_matches[0]
has_import_evidence = True
# Module-level import evidence only proves the caller pulled in
# the callee's source file, not that it imported this specific
# symbol. Promoting to EXTRACTED here falsely certifies a
# same-named symbol that was never actually imported (#2945).
has_import_evidence = False
else:
# No unique import evidence. Instead of dropping the edge
# outright (which let a single same-named test mock erase the