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
Swift/Foundation/SwiftUI builtins missing from _LANGUAGE_BUILTIN_GLOBALS and _BUILTIN_NOISE_LABELS (false god-nodes, phantom bridges) #2147
_LANGUAGE_BUILTIN_GLOBALS (graphify/extractors/base.py:13) and _BUILTIN_NOISE_LABELS (graphify/analyze.py:11) exist specifically to stop language built-ins (String, Promise, str, dict, ...) from becoming false "god nodes" that create phantom bridges between unrelated parts of a graph (per the comment referencing #726: "Without this filter they become god-nodes accumulating spurious edges from every call site").
Both lists cover JavaScript/TypeScript and Python only. Swift/Foundation/SwiftUI types are entirely absent from both, and there is no graphify/extractors/swift.py — Swift extraction still lives in the pre-modular extract.py (5,372 lines) rather than the newer per-language extractors/ layout used by Go, Rust, C#, Dart, Pascal, Objective-C, etc.
Repro
Ran /graphify (full pipeline: AST + LLM-vision semantic extraction) on a ~360k-word Swift codebase (macOS + iOS audio player, SwiftUI + Foundation + AVFoundation). Results:
God Nodes report surfaced framework types, not architecture:
Foundation, NSLock, View, Data are Swift/Foundation/SwiftUI built-ins, not project abstractions — exactly the class of noise _BUILTIN_NOISE_LABELS is supposed to filter, but it only lists Python names (str, MagicMock, typing, ...).
graphify path between two genuinely unrelated symbols (DesignSystem, a SwiftUI style helper, and playFLACViaAudioUnit(), an audio-streaming method) returned a "shortest path":
The entire "connection" is two unrelated symbols both touching the Sendable protocol. If Sendable (and Codable, Equatable, Identifiable, Hashable, AnyObject, etc.) were filtered the way Promise/Map/dict/str are, this phantom bridge would not exist.
Where it lives
graphify/extractors/base.py:13-32 — _LANGUAGE_BUILTIN_GLOBALS, used at extract.py:2434 (member-call receiver resolution) and extract.py:5038 (call-target resolution). Zero Swift/Obj-C entries.
graphify/analyze.py:11-21 — _BUILTIN_NOISE_LABELS, used in god_nodes() (analyze.py:113). Zero Swift entries.
No graphify/extractors/swift.py exists at all (checked against go.py, rust.py, dart.py, csharp.py, pascal.py, objc.py, elixir.py, apex.py, etc., which do exist).
Suggested fix
Add a Swift/Objective-C section to _LANGUAGE_BUILTIN_GLOBALS, at minimum: Sendable, Codable, Decodable, Encodable, Equatable, Hashable, Identifiable, Comparable, CustomStringConvertible, AnyObject, Error, LocalizedError, plus common Foundation/SwiftUI value types (String, Int, Double, Float, Bool, Data, URL, Date, View, Color, Font) that show up as constructor/coercion or protocol-conformance targets from every file.
Extend _BUILTIN_NOISE_LABELS with the same set so god_nodes() doesn't rank them.
Longer term: migrate Swift extraction out of extract.py into graphify/extractors/swift.py to match the modular per-language pattern already used for Go/Rust/C#/Dart/Pascal/Obj-C, so language-specific builtin/noise lists live next to the extractor that needs them instead of one shared global list.
Happy to share the reproduction corpus details or test further if useful.
Activity
fix(extract,analyze): filter Swift/Foundation/SwiftUI builtins from r…
chore: bump to 0.9.27; changelog for #2167/#2169/#2154/#2153/#2147/#2168
safishamsi commentedon Jul 26, 2026
Fixed in v0.9.27 (#2149, thanks @MasterFede5). Swift/Foundation/SwiftUI builtins are filtered from call resolution and god-node ranking. https://github.com/Graphify-Labs/graphify/releases/tag/v0.9.27
Squashed commit of the following:
fix(go): filter Go predeclared functions from call-target resolution
fix(extract,analyze): filter Swift/Foundation/SwiftUI builtins from r…
chore: bump to 0.9.27; changelog for Graphify-Labs#2167/Graphify-Labs…
fix(go): filter Go predeclared functions from call-target resolution
merge: backport upstream Swift extras (Graphify-Labs#2181 Graphify-La…