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
Bare import aliases can collapse into file-level self-loops #2037
Python package: playground/services/contracting.py containing from contracting import constants
Rust parent module imports such as use crate::fixture::{...} inside tests in fixture.rs
Rust external paths containing the current basename, such as ...::poseidon::{...} in poseidon.rs
The AST extraction initially emits a bare target such as builtins, contracting, or poseidon. During build_from_json(), the legacy-ID alias index can resolve that target to the importing file node, yielding an imports or imports_from edge whose source and target are identical.
Expected behavior
A file-level import or re-export that resolves to its own source should not be materialized. It carries no connectivity at file-node granularity and is reported as unhealthy by graphify diagnose multigraph.
Other meaningful self-edges, especially recursive calls, should remain intact.
Proposed fix
After endpoint resolution in build_from_json(), discard only self-loops whose relation is one of:
imports
imports_from
re_exports
A regression suite should cover the Python and Rust cases above and verify that recursive call self-loops are preserved.
Validation
The proposed patch removes all seven observed import self-loops across two real repositories. Their rebuilt diagnostics report zero self-loops, dangling endpoints, missing endpoints, or endpoint-collapse groups. The full Graphify test suite passes: 3,478 passed, 3 skipped.
Activity
chore: begin 0.9.21 cycle + changelog for #1940/#2027/#2030/#2037/#1983
safishamsi commentedon Jul 20, 2026
Fixed in v0.9.21 (#2038, thanks @Endogen). https://github.com/Graphify-Labs/graphify/releases/tag/v0.9.21
chore: begin 0.9.21 cycle + changelog for Graphify-Labs#1940/Graphify…