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
internal_dependency_links / popularity count import statements in zero-dependency mode but distinct neighbours with networkx #3024
file_data.internal_dependency_links and file_data.popularity mean different things depending on whether networkx is installed.
Full precision (build_dependency_graph, DiGraph): these are the graph's out- and in-degree, i.e. distinct neighbours. Importing lib twice from app counts as 1.
Zero-dependency (_fallback_build_graph): these count every resolved import statement, so the same app → lib pair counts as 2.
So the same repo produces different values for both columns, and for dependency_density, producer_ratio and ecosystem_role downstream of them, depending only on which optional engines are installed. repo_data.is_zero_dependency_mode is the only thing that tells a reader which meaning they are looking at.
Evidence
tests/tools_recorders/test_edge_data.py (#2992) pins both behaviours on one fixture. src/app.py imports src/lib.py twice and src/util.py once. The DiGraph gives out_degree 2; the fallback gives 3. The self-scan has 2 such repeated pairs (SUM(import_statements) 499 vs 497 edges).
The zero-dependency golden master (tests/golden_master_zero_dep_audit.json) records the statement-count values, so aligning the fallback to distinct neighbours needs a re-bless. #2992 kept both builders byte-identical and made the divergence visible instead: edge_data.import_statements reconciles the fallback's numbers.
Proposal
Make the fallback count distinct neighbours: += 1 per edge_data row instead of += import_statements. _resolve_edges() already gives it the collapsed pairs, so this is a one-line change plus a golden-master bless scoped to popularity / internal_dependency_links / dependency_density / producer_ratio / ecosystem_role (and the coordinate ripple).
Activity
Persist file/repo composition archetypes to the DB + add fit z-scores (…
Zero-dependency mode: exact degree counts + document what the mode co…
Native graph engine: remove networkx from the runtime (#3041) (#3054)