Summary
codegraph roles --role dead --file src/graph/model.ts -T --json and codegraph fn-impact <method> -T --json report zero callers (totalDependents: 0) for several CodeGraph (src/graph/model.ts) methods/getters that are demonstrably called throughout src/. This is distinct from #1723 (which covers kind: parameter and interface-member type declarations that have no call edges by construction) — these are real class methods on a widely-used class with real call sites the resolver fails to attribute.
Repro
$ codegraph roles --role dead -T --file src/graph/model.ts --json
Flags (role dead-unresolved) among others:
CodeGraph.constructor
CodeGraph.directed (getter)
CodeGraph.nodeCount (getter)
CodeGraph.edgeCount (getter)
CodeGraph.nodeIds
CodeGraph.getEdgeAttrs
CodeGraph.successors
CodeGraph.predecessors
CodeGraph.neighbors
CodeGraph.outDegree
CodeGraph.inDegree
But grepping the codebase shows real call sites, e.g.:
graph.directed — 15+ read sites across src/graph/algorithms/** (bfs.ts, centrality.ts, shortest-path.ts, leiden/cpm.ts, leiden/modularity.ts, leiden/optimiser.ts, leiden/partition.ts, ...)
graph.nodeCount / graph.edgeCount — src/features/communities.ts, src/graph/algorithms/louvain.ts
graph.successors(node) — src/graph/algorithms/bfs.ts:11, src/graph/algorithms/tarjan.ts:25, src/graph/algorithms/shortest-path.ts:42
new CodeGraph(...) — 6 call sites in src/
$ codegraph fn-impact "CodeGraph.successors" -T --json
{ "totalDependents": 0, "direct": 0, "transitive": 0, "role": "dead-unresolved", ... }
Impact
codegraph roles --role dead / fn-impact are unreliable for the core CodeGraph model class — the class with the widest fan-out in the codebase reports zero callers for methods that are its primary public API, actively used. Any dead-code-driven cleanup pass risks deleting load-bearing graph-traversal methods if it trusts these results without manual grep verification.
Suspected cause
Call-edge resolution likely fails to attribute <var>.<method>(...) / <var>.<getter> accesses back to CodeGraph's declaration when the receiver variable isn't statically obvious as a CodeGraph instance (e.g. generic parameter names like graph, g, s.graph), unlike #1723 which is about type-level declarations never having call edges by construction. Needs investigation in the resolver/call-graph extraction layer (native + WASM) responsible for method-call attribution.
Discovered during
Titan-run grind phase 22 (fix/native-func-prop-1432 — /titan-grind --phase 22), while triaging codegraph roles --role dead --file src/graph/model.ts output as part of dead-symbol classification.
Summary
codegraph roles --role dead --file src/graph/model.ts -T --jsonandcodegraph fn-impact <method> -T --jsonreport zero callers (totalDependents: 0) for severalCodeGraph(src/graph/model.ts) methods/getters that are demonstrably called throughoutsrc/. This is distinct from #1723 (which coverskind: parameterand interface-member type declarations that have no call edges by construction) — these are real class methods on a widely-used class with real call sites the resolver fails to attribute.Repro
Flags (role
dead-unresolved) among others:CodeGraph.constructorCodeGraph.directed(getter)CodeGraph.nodeCount(getter)CodeGraph.edgeCount(getter)CodeGraph.nodeIdsCodeGraph.getEdgeAttrsCodeGraph.successorsCodeGraph.predecessorsCodeGraph.neighborsCodeGraph.outDegreeCodeGraph.inDegreeBut grepping the codebase shows real call sites, e.g.:
graph.directed— 15+ read sites acrosssrc/graph/algorithms/**(bfs.ts, centrality.ts, shortest-path.ts, leiden/cpm.ts, leiden/modularity.ts, leiden/optimiser.ts, leiden/partition.ts, ...)graph.nodeCount/graph.edgeCount—src/features/communities.ts,src/graph/algorithms/louvain.tsgraph.successors(node)—src/graph/algorithms/bfs.ts:11,src/graph/algorithms/tarjan.ts:25,src/graph/algorithms/shortest-path.ts:42new CodeGraph(...)— 6 call sites insrc/Impact
codegraph roles --role dead/fn-impactare unreliable for the coreCodeGraphmodel class — the class with the widest fan-out in the codebase reports zero callers for methods that are its primary public API, actively used. Any dead-code-driven cleanup pass risks deleting load-bearing graph-traversal methods if it trusts these results without manual grep verification.Suspected cause
Call-edge resolution likely fails to attribute
<var>.<method>(...)/<var>.<getter>accesses back toCodeGraph's declaration when the receiver variable isn't statically obvious as aCodeGraphinstance (e.g. generic parameter names likegraph,g,s.graph), unlike #1723 which is about type-level declarations never having call edges by construction. Needs investigation in the resolver/call-graph extraction layer (native + WASM) responsible for method-call attribution.Discovered during
Titan-run grind phase 22 (
fix/native-func-prop-1432—/titan-grind --phase 22), while triagingcodegraph roles --role dead --file src/graph/model.tsoutput as part of dead-symbol classification.