Skip to content

get_architecture hotspots report inflated fan_in that contradicts actual graph in-degree (same-name collision across languages) #725

Description

@martingarramon

Version: v0.8.1 (linux-amd64)

Summary

get_architecture reports a hotspot fan_in that does not match the node's real in-degree in the graph. For short identifiers shared across languages (e.g. commit, parse, add), the reported fan_in appears to aggregate by bare name rather than by resolved node — producing large over-counts, and attributing the count to a node that actually has in-degree 0.

Environment

  • Mixed Python + TypeScript/JavaScript monorepo, indexed with mode: full.
  • Two distinct symbols named commit: a JS arrow function commit (defined in a React page component) and a Python method Store.commit.

Observed

get_architecture

hotspots: [{ name: "commit", qualified_name: "…/web/src/pages/Editor.commit", fan_in: 234 }, …]

But that JS commit has one local call-site, and querying the graph directly shows it has zero inbound edges:

query_graph:  MATCH (n {name:'commit'})<-[r]-(c)
              RETURN n.qualified_name, count(r)
→ only the Python Store.commit, in_degree 20.
  The JS Editor.commit node returns nothing (in_degree 0).

So fan_in: 234 is not reproducible from CALLS/USAGE edges.

Hotspots whose names are class-qualified Python methods matched their real in-degree correctly (a function reported with fan_in: 46 had graph in_degree 46), so the inflation is specific to short bare names shared across the Python/JS boundary.

Expected

Hotspot fan_in should equal the node's resolved inbound CALLS/USAGE in-degree (the value query_graph / search_code already report per node), not a count aggregated by bare name.

Impact

get_architecture is the first-call "understand this codebase" tool; an inflated headline metric on the wrong node is misleading. The qualitative structure (clusters, layers, routes, languages) is accurate — only the hotspot fan_in figures are affected.

Possibly related to #558 (Class in_degree/out_degree = 0) — both are node-level degree-metric correctness issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingparsing/qualityGraph extraction bugs, false positives, missing edgespriority/normalStandard review queue; useful PR with ordinary maintainer urgency.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions