Skip to content

Name-only identifier resolution creates false cross-module reference edges and inflated betweenness #2460

Open

Description

@ndjoumessi

Summary

Cross-module reference resolution appears to match identifiers by normalized name only, without qualifying by module / import source. A namespace import gets merged with an unrelated local symbol that happens to share the name, collapsing two distinct entities into a single graph node.

Concrete example (observed)

  • Mobile: import * as Notifications from 'expo-notifications' → many calls Notifications.scheduleNotificationAsync(), .setNotificationHandler(), .getExpoPushTokenAsync().
  • Web: const Notifications = lazy(() => import('@/pages/Notifications')) in App.tsx (a routed page).

These are unrelated. Graphify merged them into one node (shared norm_label = notifications) and attached the mobile push-service calls as references edges pointing at the web route node — code that never imports it. The result was a phantom mobile ⇄ web bridge with betweenness centrality 0.256, surfaced in GRAPH_REPORT.md's Suggested Questions as a genuine cross-community connection. It is an artifact, not a real dependency.

Impact

False references edges → inflated betweenness → spurious "surprising connections" / bridge nodes in the report. This misleads exactly the architectural-insight use case the report is meant to serve. INFERRED (model-reasoned) edges are similarly prone.

Suggested fix

  • Qualify identifiers by their import source / module path during edge resolution (a namespace import X from package p should not unify with a local const X in another module).
  • Or attach a lower confidence to cross-module, name-only matches, and exclude low-confidence edges from betweenness / god-node analysis.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions