Repository navigation
Description
Running /graphify --update on a TS monorepo (~10.6k nodes, 23.5k edges, 629 communities). Two recurring extractor issues surfaced when answering the auto-generated "Suggested Questions" — both inflate the god-node list and the surprising-connection list with false positives.
1. Local const/let identifiers form phantom god-nodes
A test file with const set = new Set(DOMAIN_EVENT_TYPES) produces a node labeled simply set. Across many test files, identical bare identifiers (set, sorted, getAttr, …) collide on the same node ID and accumulate edges to unrelated communities. Result: set reports betweenness 0.113 across ~23 communities even though it's a one-line local in a single file.
Repro signal: "Suggested Questions" surfaces questions like "Why does set connect Community 57 to Community 128 …" — the node turns out to be a local var, not an architectural bridge.
Fix: namespace local const/let/var identifiers by file or function scope (e.g. events_types_test::set) so they can't collide across files. Module-level / exported symbols should keep bare IDs.
2. Markdown fragmentation creates thousands of dead-end nodes
The doc extractor emits one node per fenced code block (code:bash (# Repo root)) and one per bare section heading (Stack, Design Context), each with a single contains edge to its parent doc. They never link to anything else and inflate the "weakly-connected nodes" warning. In my graph, 305 connected components total — giant = 7,439; next = 100; rest are mostly markdown fragments.
Repro signal: "Suggested Questions" surfaces "What connects Design Context, Stack, code:bash (# Repo root (Turborepo)) to the rest of the system?" The answer is "nothing, by design — they're markdown fragments."
Fix options (pick one):
- Drop fenced code-block and bare-heading nodes entirely (low value).
- Or: cross-link headings to code symbols when the heading text matches an exported symbol name.
3. Minor: covers edges between audit docs and "GAP" cells get tagged AMBIGUOUS
Lower priority. When a doc explicitly says "not covered — accessed via getDirectDb()", the covers edge from doc → table gets confidence AMBIGUOUS because the cell text reads as negation. It's an explicit architectural decision, not low confidence. A relation: intentionally_excludes (or documents_exclusion) variant would let the audit flow report "documented gaps" separately from "uncertain coverage."
Happy to PR fix #1 if useful — it should be a small change in the AST extractor's identifier-naming step. Fix #2 is a judgement call I'd defer to you.
Activity
fix JS/TS phantom god-nodes from arrow-fn locals and drop markdown co…
safishamsi commentedon May 29, 2026
Fixed in 925eb81. Two root causes addressed:
JS/TS phantom god-nodes —
_js_extra_walknow only emitslexical_declarationnodes at program scope (top-level or direct export). Arrow-function-localconstassignments no longer generate graph nodes.Markdown code-block orphan nodes —
extract_markdownno longer emitscodeblock_Nnodes. Fenced blocks had onlycontainsedges and no semantic meaning in the graph; they were inflating node counts and showing up as disconnected orphans.Both fixes ship in v0.8.24. Thanks for the detailed report!
add missing test coverage for #1077 scope guard and markdown fence fixes
fix JS/TS phantom god-nodes from arrow-fn locals and drop markdown co…
add missing test coverage for Graphify-Labs#1077 scope guard and mark…
fix(js): retain lazy CommonJS require dependencies (#2700)
fix(js): extract methods assigned to factory object APIs (#2745)