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
Rust: private/test-scoped fns collapse into unrelated enum-variant/production-fn nodes of the same bare name, manufacturing false god nodes #2774
Version: graphifyy 0.7.5 Environment: Linux x86_64, Python 3.14 (Rust codebase, tree-sitter-rust) Related:#2315 (Python decorator name-binding, same root cause: symbol resolution by bare name), #1829 (node ID collision for same-basename files)
Summary
Node identity is assigned from the bare symbol name alone, with no scope, visibility, or type-context resolution. This produces two distinct failure modes in a Rust codebase, both of which manufactured false "god nodes" that a downstream doc treated as core architectural abstractions:
1. Private functions absorb edges meant for enum variants of the same name
engine/src/lexicon.rs defines private fn string(value: &Ipld), fn integer(value: &Ipld), both non-pub, un-callable from outside the module. In the generated graph these rank as god nodes (#2 and #8 by degree, 62 and 52 edges respectively — 2nd only to the actual central Engine facade at 120).
The inflating edges come from unrelated call sites constructing Ipld::String(s) / Value::String(s) / Ipld::Integer(i) enum variants in a completely different file (desktop/src/backend/handlers.rs). The variant construction and the private validator function share only a bare name — graphify links them as if one calls the other. Rust's privacy rules make the literal claimed edge (desktop/ calling a private lexicon.rs fn) impossible.
2. Test-fixture helpers absorb edges meant for production entry points
Similarly, engine.rs contains test-only fixture helpers fn map(pairs: &[(&str, Ipld)]) -> Ipld and fn consent() -> Ipld (inside #[cfg(test)] scope). These collapsed into the same nodes as the productionIpld::Map variant and the real auth entry point create_consent(), again ranking in the global top-10 by degree (55 and 54 edges).
Impact
A human using GRAPH_REPORT.md's "God Nodes" list to understand the codebase's core abstractions gets 4 of the top 10 wrong: string(), map(), integer(), consent() are all name-collision artifacts of test/private helpers, not the real abstractions their names suggest. This was caught only by manually opening each file and checking pub-ness / #[cfg(test)] scope against every degree-ranked node — something the graph itself gives no signal to prompt.
Ask
At minimum, encode visibility (pub/private) and test-cfg scope as node/edge metadata, so GRAPH_REPORT.md can flag (or filter) nodes where visibility makes a claimed cross-file/cross-module edge structurally impossible.
Activity