mirror of
https://github.com/safishamsi/graphify.git
synced 2026-09-15 10:05:36 +00:00
When a callee had exactly one same-named definition repo-wide, the cross-file resolver emitted a `calls` edge at INFERRED/0.8 even with no import path between caller and callee. On a monorepo this fabricated dependencies: a 14-package repo showed `platform`/`sidecar` depending on `registry-protocol` purely because it exported generically-named symbols that unresolved calls collapsed onto. JS/TS modules have no implicit cross-module scope, so a cross-file call is real only if the caller imported it. Direct JS/TS cross-file `calls` attribution is now gated on import evidence and left unresolved otherwise. Scoped to direct calls: other languages keep the #1553 single-candidate resolution (C/C++ headers, Ruby autoload, same-package implicit scope), and the indirect_call path (already INFERRED + callable-gated) is untouched. Also hardens caller/candidate -> file mapping to resolve via the node's `source_file` string (identifying the file node by its basename label) instead of `relative_to(root.resolve())`, which threw on a path-resolution/symlink mismatch and fell back to a non-matching absolute id — spuriously failing import evidence. This both makes the new gate safe and fixes legitimate cross-file calls being mislabeled INFERRED instead of EXTRACTED. Full suite: 2898 passed, 3 skipped. Verified via CLI on the reporter's repro (phantom dropped) and a control (imported call resolves EXTRACTED). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>