diff --git a/graphify/cache.py b/graphify/cache.py
index 3b52d33c35..1804e424cc 100644
--- a/graphify/cache.py
+++ b/graphify/cache.py
@@ -38,7 +38,7 @@
_EXTRACTOR_VERSION = "unknown"
# Bump when AST cache-key semantics change independently of the package version.
-_AST_CACHE_SCHEMA = 48 # A Go same-package member call types its receiver by a bare name scoped to the caller's own package instead of matching that name against every package in the corpus, so two packages each declaring a type with the same name (e.g. `alpha.Service` and `beta.Service`) keep their own same-file member calls instead of both losing them to a corpus-wide ambiguity bail (#5242); each Java overload gets its own node keyed by arity and erased signature (with generic bounds erased per scope), and the `affected` override-matching is made arity-aware so a split `run(int)` is not tied to a supertype `run()` by label alone (#5251); a JS `this.x = function(params){}` member's own params and enclosing-bound names shadow outer names, so an argument-position param no longer fabricates a false `indirect_call` to a same-named corpus function (#5241); a C/C++ directory-qualified angle include `
` resolves to the local file and standard-library headers are kept off the alias index (#5218); and a SQL table named with non-ASCII letters that the grammar collapses no longer mints an empty-id node or an edge to an empty id (#5250); a Pascal unit the tree-sitter grammar cannot parse end to end is recovered through a byte-length-preserving masked retry (escaped string literals and compiler directives) instead of yielding no nodes (#5264), and the Pascal extractor now records unit-level global variables and a qualifier on unresolved qualified raw_calls so a call through a global object variable (`DM.Open`, the Delphi data-module idiom) resolves to the variable's type member (#3101); so cached Go, Java, JS/TS, C/C++, SQL and Pascal extractions re-run; prior (47): A JS/TS name bound in an enclosing scope and captured into a tracked nested closure no longer fabricates a false `indirect_call` to a same-named corpus function (#5217); a T-SQL procedure that parses structurally (not via ERROR recovery) keeps its INSERT/UPDATE/DELETE/SELECT INTO writes (#5146); and an Oracle `CREATE PACKAGE [BODY]`'s member procedures and functions, and their table reads/writes, are recovered instead of yielding only a file node (#5168); and nested types get owner-qualified ids so same-named nested types under different owners no longer collide into one node, with qualified calls (`Outer.Inner.m()`, `Outer::Inner::m()`) resolving through the owner chain (#5185); so cached JS/TS, SQL and nested-type (C#, Java, Scala, C++, TS) extractions re-run; prior (46): A non-UTF-8 C# file with any preprocessor directive is decoded (Windows-1252/UTF-16, #4145) before the directive blanking of #5003 instead of being parsed as raw bytes, so its non-ASCII identifiers are no longer cut short and later members are no longer dropped (#5194); a C# explicit interface implementation (`void IFoo.Bar()`) is kept out of overload binding and gets a distinct node id so it no longer collapses with a public `Bar` overload and calls dispatch to the right member (#5193); and members whose names differ only by a leading/trailing `_` (or `~`, or by case) get distinct node ids in Kotlin (#5206), Swift (#5204), Dart (#5200) and C++ (including constructor `Foo` vs destructor `~Foo`, #5202), as already done for Python/C#/Java/PHP; a variadic parameter (`xs ...T`, `T... xs`, `params T[]`, `T*`, `...$xs`) references its element type in Go, Java, C#, Scala and PHP (#4638); and a Dart legacy typedef that returns a function type (`typedef int Function(int) Make();`) is named by its own declared name instead of `Function` (#4641); so cached C#, Kotlin, Swift, Dart, C++, Go, Java, Scala and PHP extractions re-run; prior (45): A C# field or primary-constructor parameter whose type name does not start with a capital (`_Pair`, `pair`, `bool`) is recorded in the receiver table, and a member call on a receiver that no local, parameter, field or property declares carries `receiver_undeclared`, so `_Pair.Make()`/`pair.Create()` bind as static calls (#5174); a Java call through a class-qualified static field (`Service.INSTANCE.get()`) resolves via the field's declared type, recorded in a static-field type table (#5149); and a SQL routine body preserves comma joins and keeps a `@dblink` suffix distinct, an unparsed derived table's alias is no longer read as a table, and Oracle `[NON]EDITIONABLE` PROCEDURE/FUNCTION/TRIGGER DDL is recovered instead of yielding only a file node (#5169, #5147, #5167); so cached C#, Java and SQL extractions re-run; prior (44): A folded C++ parameterless member records its `definition_file` anchored to the source root instead of a cache-root-relative `../`-walk; a PHP route closure takes its path only from the arguments before it, so a string argument after the closure no longer becomes the route's path or leaks into an enclosing group's prefix (#5135); two module-level declarations in one file differing only by a leading/trailing `_` keep distinct ids (the first keeps the plain id, the rest are salted) across JS, TS, C, C++, PHP, Ruby, Kotlin, Swift and Lua (#2810); PHP methods of one class/trait/interface/enum differing only by a `_` keep distinct ids (#5137); and Java members differing only by a `_` or only by case keep distinct ids (#5151); so cached C++, PHP, Java and module-level-id extractions re-run; prior (43): A dotted Python subscript annotation (`mod.MyBox[Foo]`) walks its value once as the type, not again as its own generic argument, so the false `generic_arg` reference no longer replaces the real `parameter_type`/`return_type` edge, a C++ plain class/struct forward folds into its unique exactly-qualified definition when one file reaches the other through unconditional exact quoted includes, and a parameterless member declaration folds into its proven out-of-line definition by matching return type/qualifiers, with per-node `_cpp_member_records`/`_cpp_class_kind` facts persisted (#5117); a C++ member receiver resolves through a scoped type alias (`using Alias = ns::Type;`) and through inherited fields/methods, with forward-declared pointee types completed at the use site via a lexical-scope lookup, fail-closed on ambiguous/virtual/diamond bases (#5118); and a C++ out-of-line template member keeps its proven primary-template owner while calls in a `#if`-guarded initializer or argument list are recovered from byte-preserving branch views, with dependent receivers left unresolved (#5115); so cached Python and C++ extractions re-run; prior (42): A bare, unqualified free-function mention in a Markdown document (`token` in prose, no `()` and no namespace) binds to a same-named function only when the defining file, or another symbol from it, is cited within the heading's section chain, instead of matching any same-named callable anywhere in the corpus; reference-style links (`[text][label]`) resolve at the use site (#4804, #4806); and a C# classic extension-method call (`x.Foo()` where `Foo` is a `static ... Foo(this X x, ...)`) binds to the extension's declaration through a post-nominal additive pass, gated to a visible namespace, a matching `this` type and a unique applicable method, with a BCL deny-list and fail-closed on ambiguity or an instance-method shadow (#4828); so cached Markdown and C# extractions re-run; prior (41): A C++ member-call chain routed through class fields declared in other headers (`client.actions->Execute()`, with value `.`, raw-pointer `->` and single-arg `unique_ptr`/`shared_ptr` receivers) resolves to the field type's member across the include set, gated to a unique type and member and fail-closed otherwise, and class fields are persisted on the node (#5098); and a Markdown code span naming an uppercase `\`-namespace class (`\Foo\Bar`, `App\API`) or a type-qualified method call (`Type::member()`) is kept as a symbol mention instead of being dropped, while a non-call `Type::CONST`/`Type::class` stays dropped (#5093); so cached C++ and Markdown extractions re-run; prior (40): Solidity members, free functions and types whose names differ only by a leading `_` (or by case) in one scope (`_grantRole(bytes32,address)` / `grantRole(bytes32,address)`) get separate node ids: the one public name keeps its id and the others are salted, as in Python and C# (#3302, #4415), so the `_` function no longer vanishes and its calls stop landing on its twin (#5027); a Solidity call on a receiver of a contract or interface type (`IERC20 token; token.transfer()`, `IERC20(a).transfer()`, `token().balanceOf()`) binds by name and arity through that type's linearization to the type's own member instead of producing no edge, gated to a single visible contract/interface and fail-closed on an unknown or ambiguous type (#5060); a Solidity call attached by a `using A for T` directive (`using SafeCast for uint256; x.toUint48()`) binds to the library or free function it attaches, matched by the receiver's type and an arity one greater than the call (the receiver), fail-closed when the type is unknown or two functions fit (#5062); a C# constructor (instance, static or primary) is its own node owned by its type through a `method` edge, its body and `: base(...)`/`: this(...)` calls credited to it, and `new X(...)`/`: base`/`: this` additively link the arity-correct overload (#5054); and a C# call inside a property/indexer accessor, expression body, operator or conversion is credited to that member (an indexer is a `this[]` node, an operator a `.operator +()` node) instead of being lost (#5056), so cached Solidity and C# extractions re-run; prior (39): A Markdown code span written as a backslash namespace (`\Foo\Bar`) or a type-qualified member (`Type::member`) is recognised as a symbol mention and emits a `ns_qualified` raw_call (#4610, #4695), so cached Markdown extractions re-run; prior (38): C# preprocessor directives and `#if` branches that would derail tree-sitter-c-sharp are blanked before parsing (byte-length preserving, so lines and columns do not move), so a directive no longer closes the enclosing class early and drops later members or calls (#5003); a Solidity library call (`Lib.f()`, including an aliased import), and an `emit`/`revert`/`require` naming a declared event or error, link to the member they name instead of producing no edge, resolved only when a single visible type and a unique name/arity member match (#5001, #5005); and a YAML `<<` merge sequence gives the earlier anchor precedence for a duplicated key, matching the merge spec and PyYAML, so the winning key carries its correct source line (#4995); so cached C#, Solidity and YAML extractions re-run; prior (37): Solidity `import "../x/Y.sol"` resolves the `..` to the real file instead of a dangling stub that kept the importer's own folder (#4985); a Python module-level singleton (`g = Service()` then `g.method()`) resolves its member calls through the instance's type, gated by an exact-spelling and lexical-shadow guard (#4972); Kotlin resolves a call to an overloaded method and attributes calls inside an `init {}` block to the class, and a bare call no longer binds to a class the caller cannot reach (#4935, #4956); a Go same-file member call resolves through the receiver's type instead of a declaration-order-dependent same-named method (#4962, #4966); a Go member call on a receiver typed from another package (`pkg.T`) binds only to the `T` declared at the path the file imports `pkg` from (#3368, #4853); and a Go interface method call additively dispatches to the interface's implicit implementers (#4934), so cached Solidity, Python, Kotlin and Go extractions re-run; prior (36): C++ extraction changes: a type-alias reference (`using Foo = Bar;` then `Foo x;`) binds by exact spelling so it no longer loses to a same-normalized function, and a salted alias keeps its own `contains` edge (#4951); a member call `x.m()` binds by the receiver's type, now typed from parameters and class fields and not just locals, with untyped receivers kept bound in-file (#3215, #4946); an out-of-line/split-header definition attaches to the unique owner whose class file is in its include set via a `_cpp_qualified` identity marker, instead of file-containing or cross-binding to an unrelated same-named function (#4916, #4920); and a local callable value (a lambda or `std::function` local) is kept out of global call resolution by byte-range binding lifetimes so it no longer mints a spurious INFERRED call to a same-named global (#4917, #4921), so cached C++ extractions re-run; prior (35): A Rust module-qualified call like `crate::b::helper()` resolves to the function it names via qualifier-verified cross-file resolution, kept inside the caller's crate and out of local names (#2135, #4944); a Rust call written inside an expression macro's arguments (`println!`, `vec!`, ...) is linked, with a parsed call winning the dedupe (#4945); and cache keys keep their written case (file I/O through os_long_path, cache identity via normpath not normcase, and the digest salt no longer lowercased) so README.md and readme.md stop sharing one digest on a case-sensitive filesystem, which also changes the salt digest for any relative path carrying an uppercase char (#4925, #4937), so cached Rust extractions and any uppercase-path cache entries re-run; prior (34): A bare call inside a Python method no longer self-binds to a same-named method, so it resolves to the imported/module function instead (#4933); a Go method value reached through a receiver field is linked as an indirect_call (#4931); and a Go package-level `var` initialiser references the types it names (#4932), so cached Python and Go extractions re-run; prior (33): A Scala `extension (x: T)` method is scoped to its receiver type T (#2044, #4856); and a Terraform node carries its original scope so ids stay portable when the cached project is moved to a new directory (#4858, #4861), so cached Scala and Terraform extractions re-run; prior (32): A type and a function whose names differ only in case get separate node ids (#4904, #4908); and a PHP `Scope::MEMBER` access in a class-level initializer (const value, property/parameter default) emits a references_constant edge (#4648, #4895); R `setClass`/`setRefClass` `contains=` superclasses get inherits edges (#4902); an Elixir bare call resolves to the caller's own module first (#4900); a Dart mixin `on A, B` clause resolves every constraint (#4899); and a Fortran derived-type `extends` emits an inherits edge (#4897), so cached extractions for those languages re-run (#4904); Go credits a call in a package-level `var` initialiser (and its closures) to the file node (#4867); a Go method value passed as an argument is linked as an `indirect_call` (#4868); a Go receiver's field whose struct is declared in a sibling file of the same package is typed so its member calls resolve (#4866); and a Python dispatch table's `module.func` values resolve to the referenced functions as `indirect_call`s (#4773), so cached Go and Python extractions re-run; prior (30): File and per-declaration ids are kept distinct so a top-level declaration sharing the file's name is not dropped (#4854); a SystemVerilog `function new(...)` constructor gets its own node, `method` edge and parameter refs (#4848); a Go `var x = T{}`/`var x = &T{}` types `x` as `T` for receiver resolution like `x := T{}` (#4843); a PowerShell `using module`/`using assembly` name drops its file extension (#4847); a Solidity free-function `using {a, b} for T` set emits `uses` edges (#4846); a CommonLisp forward-referenced superclass binds to its local node instead of a sourceless stub (#4845); and Pascal `inherited`/`inline` form component blocks are recognised so later `object` blocks keep their parent (#4844), so cached extractions across those languages re-run; prior (29): OCaml `and`-chained module/class bindings are all walked (only the first was, so later bindings were silently dropped, #4822), and a SystemVerilog class `task` method is modeled like a `function` one with its own node and parameter refs while its task-locals no longer leak as class fields (#4774), so cached OCaml and Verilog/SystemVerilog extractions re-run; prior (28): Markdown ATX headings parse per CommonMark (closing `#` runs dropped, 0-3 space indent, hash-only lines mint no node, #4790) and fenced code blocks are tracked by CommonMark rules so headings inside fences stop leaking (#4787); YAML keys carry their written spelling and real line and `on`/`off`/`yes`/`no` keys no longer fold to booleans (#4784); rationale labels redact more credential shapes before caching (#4647); Razor `@implements` interface edges are extracted (#4820); aliased Terraform providers get their own node and `provider =` refs resolve (#4819); COBOL paragraphs after a nested `END PROGRAM` reattach to the enclosing program (#4824); Blade `wire:click` binds the bare method name (#4823); a Pascal record is a type with its own methods (#4825); VB.NET operator declarations are extracted as members with their bodies walked (#4821); and a Fortran call resolves to the subroutine it names (#4795), so cached Markdown/YAML/rationale/Razor/Terraform/COBOL/Blade/Pascal/VB.NET/Fortran extractions re-run; prior (27): VB.NET external namespace/type stubs now carry a `source_file` sentinel (#4725); Python member calls resolve through injected fields and method-result types (#4726); a Rust `use` is scoped to the crate it names (#4699), so cached VB.NET/Python/Rust extractions re-run; prior (26): Zig no longer crosses a call between a method and a same-named free function (#4755), and a Dart unnamed `extension on T` is detected (#4741), so cached Zig and Dart extractions re-run; prior (25): Python/Go/C++/Rust explicit type aliases (and Rust `union` items) are extracted as type nodes so references resolve instead of minting sourceless stubs (#4578/#4579/#4580/#4581); each C# method overload gets its own node bound by arity (#4584); a package.json dependency's manifest entry links to its ref node (#4569), so cached extractions re-run; prior (24): Objective-C `NS_CLOSED_ENUM` declarations are extracted as enums like `NS_ENUM` (#4705), and a `CREATE TABLE` whose column default the SQL grammar rejects (MySQL `DEFAULT current_timestamp()`) is recovered from its ERROR node (#4613), so cached ObjC and SQL extractions re-run; prior (23): `.yaml`/`.yml` files are structurally extracted (keys as nodes, config-vs-data gated) and reclassified from document to code (#2214), so cached YAML re-extracts; prior (22): SQL labels drop T-SQL brackets and routine bodies emit `reads_from`/`writes_to` (#4635), and a `GO` batch separator ends a statement (#4651), so cached `.sql` extractions re-run; prior (21): a CommonJS `const X = require('./m')` binding no longer mints a module-scope node that shadows the class the required file exports, so `new X()` resolves to the required declaration (#4621); prior (20): Obsidian `[[wikilink]]` targets that start with the scan root's own folder names now resolve to the real page (#4559), so cached markdown extractions re-run; prior (19): Dart `typedef` declarations are extracted as aliases (not variables of type `typedef`); C++ Metal/CUDA GPU qualifiers no longer mint sourceless god nodes (#4550); a `.h` header containing `extern "C"` routes to the C++ extractor; prior (18): Kotlin `typealias` (#4553), C# `delegate` (#4552), and Swift `macro` declarations (#4551) are now extracted so references stop minting sourceless stubs; Rust `use` rooted at a `mod` declared in the same scope carries `_rust_use_name` (#4564); prior (17): Python pytest-fixture markers (`_py_fixture`/`_python_fixture_param`, #4332) and module-level class-id collision salting (#2810); TS `this.field` typed from any method incl. static (#4473); Solidity callables carry `metadata.arity` + inherited-call/`super`/modifier raw calls (#4379); Go type-decl and Rust file-item case-distinct node ids (#4444); prior (16): Rust `use` edges carry the imported name as written (`_rust_use_name`, #4439); (15): Go generic receiver types normalized (`Box[T]` -> `Box`) so methods attach to the type node; prior (14): C# receiver resolution for nameless/`new X()`/`foreach` receivers (defer + receiver-chain markers) and `_`/case-distinct node ids (underscore-salted); prior (13): Kotlin/Scala/C++/Swift generic & template type params no longer mint sourceless stubs; Objective-C NS_ENUM/NS_OPTIONS extraction and `_callable`/`_callable_class` markers; Go and PHP receiver-typed member calls park cross-repo (`go_type_table`/`php_type_table`, receiver fields); prior (12): Java inherited-supertype (`receiver_unbound`) and chained/new/cast receiver typing (`java_receiver_chain`, `_java_ret`); C/C++ quoted cross-directory include provenance (`include_kind`); JS external imports anchored to the package, not the path leaf; prior (11): Python property-accessor decorators / `Self`, Swift `Self`, Go generic type params, Python forward type-hint file node, PowerShell dot-source, C# verbatim-interpolated string recovery; (10): C# partial types carry `type_path`; (9): Python property-read raw calls and `_py_property` nodes; (8): Rust `use`-group per-binding edges; (7): Python opaque-base/super(args) markers + nested-class enclosing ids.
+_AST_CACHE_SCHEMA = 49 # A tsconfig `extends` naming a local config, and an exact `compilerOptions.paths` alias, point at the scanned file instead of a concept stub or nothing (#5223), so cached JSON config extractions re-run; prior (48): A Go same-package member call types its receiver by a bare name scoped to the caller's own package instead of matching that name against every package in the corpus, so two packages each declaring a type with the same name (e.g. `alpha.Service` and `beta.Service`) keep their own same-file member calls instead of both losing them to a corpus-wide ambiguity bail (#5242); each Java overload gets its own node keyed by arity and erased signature (with generic bounds erased per scope), and the `affected` override-matching is made arity-aware so a split `run(int)` is not tied to a supertype `run()` by label alone (#5251); a JS `this.x = function(params){}` member's own params and enclosing-bound names shadow outer names, so an argument-position param no longer fabricates a false `indirect_call` to a same-named corpus function (#5241); a C/C++ directory-qualified angle include `` resolves to the local file and standard-library headers are kept off the alias index (#5218); and a SQL table named with non-ASCII letters that the grammar collapses no longer mints an empty-id node or an edge to an empty id (#5250); a Pascal unit the tree-sitter grammar cannot parse end to end is recovered through a byte-length-preserving masked retry (escaped string literals and compiler directives) instead of yielding no nodes (#5264), and the Pascal extractor now records unit-level global variables and a qualifier on unresolved qualified raw_calls so a call through a global object variable (`DM.Open`, the Delphi data-module idiom) resolves to the variable's type member (#3101); so cached Go, Java, JS/TS, C/C++, SQL and Pascal extractions re-run; prior (47): A JS/TS name bound in an enclosing scope and captured into a tracked nested closure no longer fabricates a false `indirect_call` to a same-named corpus function (#5217); a T-SQL procedure that parses structurally (not via ERROR recovery) keeps its INSERT/UPDATE/DELETE/SELECT INTO writes (#5146); and an Oracle `CREATE PACKAGE [BODY]`'s member procedures and functions, and their table reads/writes, are recovered instead of yielding only a file node (#5168); and nested types get owner-qualified ids so same-named nested types under different owners no longer collide into one node, with qualified calls (`Outer.Inner.m()`, `Outer::Inner::m()`) resolving through the owner chain (#5185); so cached JS/TS, SQL and nested-type (C#, Java, Scala, C++, TS) extractions re-run; prior (46): A non-UTF-8 C# file with any preprocessor directive is decoded (Windows-1252/UTF-16, #4145) before the directive blanking of #5003 instead of being parsed as raw bytes, so its non-ASCII identifiers are no longer cut short and later members are no longer dropped (#5194); a C# explicit interface implementation (`void IFoo.Bar()`) is kept out of overload binding and gets a distinct node id so it no longer collapses with a public `Bar` overload and calls dispatch to the right member (#5193); and members whose names differ only by a leading/trailing `_` (or `~`, or by case) get distinct node ids in Kotlin (#5206), Swift (#5204), Dart (#5200) and C++ (including constructor `Foo` vs destructor `~Foo`, #5202), as already done for Python/C#/Java/PHP; a variadic parameter (`xs ...T`, `T... xs`, `params T[]`, `T*`, `...$xs`) references its element type in Go, Java, C#, Scala and PHP (#4638); and a Dart legacy typedef that returns a function type (`typedef int Function(int) Make();`) is named by its own declared name instead of `Function` (#4641); so cached C#, Kotlin, Swift, Dart, C++, Go, Java, Scala and PHP extractions re-run; prior (45): A C# field or primary-constructor parameter whose type name does not start with a capital (`_Pair`, `pair`, `bool`) is recorded in the receiver table, and a member call on a receiver that no local, parameter, field or property declares carries `receiver_undeclared`, so `_Pair.Make()`/`pair.Create()` bind as static calls (#5174); a Java call through a class-qualified static field (`Service.INSTANCE.get()`) resolves via the field's declared type, recorded in a static-field type table (#5149); and a SQL routine body preserves comma joins and keeps a `@dblink` suffix distinct, an unparsed derived table's alias is no longer read as a table, and Oracle `[NON]EDITIONABLE` PROCEDURE/FUNCTION/TRIGGER DDL is recovered instead of yielding only a file node (#5169, #5147, #5167); so cached C#, Java and SQL extractions re-run; prior (44): A folded C++ parameterless member records its `definition_file` anchored to the source root instead of a cache-root-relative `../`-walk; a PHP route closure takes its path only from the arguments before it, so a string argument after the closure no longer becomes the route's path or leaks into an enclosing group's prefix (#5135); two module-level declarations in one file differing only by a leading/trailing `_` keep distinct ids (the first keeps the plain id, the rest are salted) across JS, TS, C, C++, PHP, Ruby, Kotlin, Swift and Lua (#2810); PHP methods of one class/trait/interface/enum differing only by a `_` keep distinct ids (#5137); and Java members differing only by a `_` or only by case keep distinct ids (#5151); so cached C++, PHP, Java and module-level-id extractions re-run; prior (43): A dotted Python subscript annotation (`mod.MyBox[Foo]`) walks its value once as the type, not again as its own generic argument, so the false `generic_arg` reference no longer replaces the real `parameter_type`/`return_type` edge, a C++ plain class/struct forward folds into its unique exactly-qualified definition when one file reaches the other through unconditional exact quoted includes, and a parameterless member declaration folds into its proven out-of-line definition by matching return type/qualifiers, with per-node `_cpp_member_records`/`_cpp_class_kind` facts persisted (#5117); a C++ member receiver resolves through a scoped type alias (`using Alias = ns::Type;`) and through inherited fields/methods, with forward-declared pointee types completed at the use site via a lexical-scope lookup, fail-closed on ambiguous/virtual/diamond bases (#5118); and a C++ out-of-line template member keeps its proven primary-template owner while calls in a `#if`-guarded initializer or argument list are recovered from byte-preserving branch views, with dependent receivers left unresolved (#5115); so cached Python and C++ extractions re-run; prior (42): A bare, unqualified free-function mention in a Markdown document (`token` in prose, no `()` and no namespace) binds to a same-named function only when the defining file, or another symbol from it, is cited within the heading's section chain, instead of matching any same-named callable anywhere in the corpus; reference-style links (`[text][label]`) resolve at the use site (#4804, #4806); and a C# classic extension-method call (`x.Foo()` where `Foo` is a `static ... Foo(this X x, ...)`) binds to the extension's declaration through a post-nominal additive pass, gated to a visible namespace, a matching `this` type and a unique applicable method, with a BCL deny-list and fail-closed on ambiguity or an instance-method shadow (#4828); so cached Markdown and C# extractions re-run; prior (41): A C++ member-call chain routed through class fields declared in other headers (`client.actions->Execute()`, with value `.`, raw-pointer `->` and single-arg `unique_ptr`/`shared_ptr` receivers) resolves to the field type's member across the include set, gated to a unique type and member and fail-closed otherwise, and class fields are persisted on the node (#5098); and a Markdown code span naming an uppercase `\`-namespace class (`\Foo\Bar`, `App\API`) or a type-qualified method call (`Type::member()`) is kept as a symbol mention instead of being dropped, while a non-call `Type::CONST`/`Type::class` stays dropped (#5093); so cached C++ and Markdown extractions re-run; prior (40): Solidity members, free functions and types whose names differ only by a leading `_` (or by case) in one scope (`_grantRole(bytes32,address)` / `grantRole(bytes32,address)`) get separate node ids: the one public name keeps its id and the others are salted, as in Python and C# (#3302, #4415), so the `_` function no longer vanishes and its calls stop landing on its twin (#5027); a Solidity call on a receiver of a contract or interface type (`IERC20 token; token.transfer()`, `IERC20(a).transfer()`, `token().balanceOf()`) binds by name and arity through that type's linearization to the type's own member instead of producing no edge, gated to a single visible contract/interface and fail-closed on an unknown or ambiguous type (#5060); a Solidity call attached by a `using A for T` directive (`using SafeCast for uint256; x.toUint48()`) binds to the library or free function it attaches, matched by the receiver's type and an arity one greater than the call (the receiver), fail-closed when the type is unknown or two functions fit (#5062); a C# constructor (instance, static or primary) is its own node owned by its type through a `method` edge, its body and `: base(...)`/`: this(...)` calls credited to it, and `new X(...)`/`: base`/`: this` additively link the arity-correct overload (#5054); and a C# call inside a property/indexer accessor, expression body, operator or conversion is credited to that member (an indexer is a `this[]` node, an operator a `.operator +()` node) instead of being lost (#5056), so cached Solidity and C# extractions re-run; prior (39): A Markdown code span written as a backslash namespace (`\Foo\Bar`) or a type-qualified member (`Type::member`) is recognised as a symbol mention and emits a `ns_qualified` raw_call (#4610, #4695), so cached Markdown extractions re-run; prior (38): C# preprocessor directives and `#if` branches that would derail tree-sitter-c-sharp are blanked before parsing (byte-length preserving, so lines and columns do not move), so a directive no longer closes the enclosing class early and drops later members or calls (#5003); a Solidity library call (`Lib.f()`, including an aliased import), and an `emit`/`revert`/`require` naming a declared event or error, link to the member they name instead of producing no edge, resolved only when a single visible type and a unique name/arity member match (#5001, #5005); and a YAML `<<` merge sequence gives the earlier anchor precedence for a duplicated key, matching the merge spec and PyYAML, so the winning key carries its correct source line (#4995); so cached C#, Solidity and YAML extractions re-run; prior (37): Solidity `import "../x/Y.sol"` resolves the `..` to the real file instead of a dangling stub that kept the importer's own folder (#4985); a Python module-level singleton (`g = Service()` then `g.method()`) resolves its member calls through the instance's type, gated by an exact-spelling and lexical-shadow guard (#4972); Kotlin resolves a call to an overloaded method and attributes calls inside an `init {}` block to the class, and a bare call no longer binds to a class the caller cannot reach (#4935, #4956); a Go same-file member call resolves through the receiver's type instead of a declaration-order-dependent same-named method (#4962, #4966); a Go member call on a receiver typed from another package (`pkg.T`) binds only to the `T` declared at the path the file imports `pkg` from (#3368, #4853); and a Go interface method call additively dispatches to the interface's implicit implementers (#4934), so cached Solidity, Python, Kotlin and Go extractions re-run; prior (36): C++ extraction changes: a type-alias reference (`using Foo = Bar;` then `Foo x;`) binds by exact spelling so it no longer loses to a same-normalized function, and a salted alias keeps its own `contains` edge (#4951); a member call `x.m()` binds by the receiver's type, now typed from parameters and class fields and not just locals, with untyped receivers kept bound in-file (#3215, #4946); an out-of-line/split-header definition attaches to the unique owner whose class file is in its include set via a `_cpp_qualified` identity marker, instead of file-containing or cross-binding to an unrelated same-named function (#4916, #4920); and a local callable value (a lambda or `std::function` local) is kept out of global call resolution by byte-range binding lifetimes so it no longer mints a spurious INFERRED call to a same-named global (#4917, #4921), so cached C++ extractions re-run; prior (35): A Rust module-qualified call like `crate::b::helper()` resolves to the function it names via qualifier-verified cross-file resolution, kept inside the caller's crate and out of local names (#2135, #4944); a Rust call written inside an expression macro's arguments (`println!`, `vec!`, ...) is linked, with a parsed call winning the dedupe (#4945); and cache keys keep their written case (file I/O through os_long_path, cache identity via normpath not normcase, and the digest salt no longer lowercased) so README.md and readme.md stop sharing one digest on a case-sensitive filesystem, which also changes the salt digest for any relative path carrying an uppercase char (#4925, #4937), so cached Rust extractions and any uppercase-path cache entries re-run; prior (34): A bare call inside a Python method no longer self-binds to a same-named method, so it resolves to the imported/module function instead (#4933); a Go method value reached through a receiver field is linked as an indirect_call (#4931); and a Go package-level `var` initialiser references the types it names (#4932), so cached Python and Go extractions re-run; prior (33): A Scala `extension (x: T)` method is scoped to its receiver type T (#2044, #4856); and a Terraform node carries its original scope so ids stay portable when the cached project is moved to a new directory (#4858, #4861), so cached Scala and Terraform extractions re-run; prior (32): A type and a function whose names differ only in case get separate node ids (#4904, #4908); and a PHP `Scope::MEMBER` access in a class-level initializer (const value, property/parameter default) emits a references_constant edge (#4648, #4895); R `setClass`/`setRefClass` `contains=` superclasses get inherits edges (#4902); an Elixir bare call resolves to the caller's own module first (#4900); a Dart mixin `on A, B` clause resolves every constraint (#4899); and a Fortran derived-type `extends` emits an inherits edge (#4897), so cached extractions for those languages re-run (#4904); Go credits a call in a package-level `var` initialiser (and its closures) to the file node (#4867); a Go method value passed as an argument is linked as an `indirect_call` (#4868); a Go receiver's field whose struct is declared in a sibling file of the same package is typed so its member calls resolve (#4866); and a Python dispatch table's `module.func` values resolve to the referenced functions as `indirect_call`s (#4773), so cached Go and Python extractions re-run; prior (30): File and per-declaration ids are kept distinct so a top-level declaration sharing the file's name is not dropped (#4854); a SystemVerilog `function new(...)` constructor gets its own node, `method` edge and parameter refs (#4848); a Go `var x = T{}`/`var x = &T{}` types `x` as `T` for receiver resolution like `x := T{}` (#4843); a PowerShell `using module`/`using assembly` name drops its file extension (#4847); a Solidity free-function `using {a, b} for T` set emits `uses` edges (#4846); a CommonLisp forward-referenced superclass binds to its local node instead of a sourceless stub (#4845); and Pascal `inherited`/`inline` form component blocks are recognised so later `object` blocks keep their parent (#4844), so cached extractions across those languages re-run; prior (29): OCaml `and`-chained module/class bindings are all walked (only the first was, so later bindings were silently dropped, #4822), and a SystemVerilog class `task` method is modeled like a `function` one with its own node and parameter refs while its task-locals no longer leak as class fields (#4774), so cached OCaml and Verilog/SystemVerilog extractions re-run; prior (28): Markdown ATX headings parse per CommonMark (closing `#` runs dropped, 0-3 space indent, hash-only lines mint no node, #4790) and fenced code blocks are tracked by CommonMark rules so headings inside fences stop leaking (#4787); YAML keys carry their written spelling and real line and `on`/`off`/`yes`/`no` keys no longer fold to booleans (#4784); rationale labels redact more credential shapes before caching (#4647); Razor `@implements` interface edges are extracted (#4820); aliased Terraform providers get their own node and `provider =` refs resolve (#4819); COBOL paragraphs after a nested `END PROGRAM` reattach to the enclosing program (#4824); Blade `wire:click` binds the bare method name (#4823); a Pascal record is a type with its own methods (#4825); VB.NET operator declarations are extracted as members with their bodies walked (#4821); and a Fortran call resolves to the subroutine it names (#4795), so cached Markdown/YAML/rationale/Razor/Terraform/COBOL/Blade/Pascal/VB.NET/Fortran extractions re-run; prior (27): VB.NET external namespace/type stubs now carry a `source_file` sentinel (#4725); Python member calls resolve through injected fields and method-result types (#4726); a Rust `use` is scoped to the crate it names (#4699), so cached VB.NET/Python/Rust extractions re-run; prior (26): Zig no longer crosses a call between a method and a same-named free function (#4755), and a Dart unnamed `extension on T` is detected (#4741), so cached Zig and Dart extractions re-run; prior (25): Python/Go/C++/Rust explicit type aliases (and Rust `union` items) are extracted as type nodes so references resolve instead of minting sourceless stubs (#4578/#4579/#4580/#4581); each C# method overload gets its own node bound by arity (#4584); a package.json dependency's manifest entry links to its ref node (#4569), so cached extractions re-run; prior (24): Objective-C `NS_CLOSED_ENUM` declarations are extracted as enums like `NS_ENUM` (#4705), and a `CREATE TABLE` whose column default the SQL grammar rejects (MySQL `DEFAULT current_timestamp()`) is recovered from its ERROR node (#4613), so cached ObjC and SQL extractions re-run; prior (23): `.yaml`/`.yml` files are structurally extracted (keys as nodes, config-vs-data gated) and reclassified from document to code (#2214), so cached YAML re-extracts; prior (22): SQL labels drop T-SQL brackets and routine bodies emit `reads_from`/`writes_to` (#4635), and a `GO` batch separator ends a statement (#4651), so cached `.sql` extractions re-run; prior (21): a CommonJS `const X = require('./m')` binding no longer mints a module-scope node that shadows the class the required file exports, so `new X()` resolves to the required declaration (#4621); prior (20): Obsidian `[[wikilink]]` targets that start with the scan root's own folder names now resolve to the real page (#4559), so cached markdown extractions re-run; prior (19): Dart `typedef` declarations are extracted as aliases (not variables of type `typedef`); C++ Metal/CUDA GPU qualifiers no longer mint sourceless god nodes (#4550); a `.h` header containing `extern "C"` routes to the C++ extractor; prior (18): Kotlin `typealias` (#4553), C# `delegate` (#4552), and Swift `macro` declarations (#4551) are now extracted so references stop minting sourceless stubs; Rust `use` rooted at a `mod` declared in the same scope carries `_rust_use_name` (#4564); prior (17): Python pytest-fixture markers (`_py_fixture`/`_python_fixture_param`, #4332) and module-level class-id collision salting (#2810); TS `this.field` typed from any method incl. static (#4473); Solidity callables carry `metadata.arity` + inherited-call/`super`/modifier raw calls (#4379); Go type-decl and Rust file-item case-distinct node ids (#4444); prior (16): Rust `use` edges carry the imported name as written (`_rust_use_name`, #4439); (15): Go generic receiver types normalized (`Box[T]` -> `Box`) so methods attach to the type node; prior (14): C# receiver resolution for nameless/`new X()`/`foreach` receivers (defer + receiver-chain markers) and `_`/case-distinct node ids (underscore-salted); prior (13): Kotlin/Scala/C++/Swift generic & template type params no longer mint sourceless stubs; Objective-C NS_ENUM/NS_OPTIONS extraction and `_callable`/`_callable_class` markers; Go and PHP receiver-typed member calls park cross-repo (`go_type_table`/`php_type_table`, receiver fields); prior (12): Java inherited-supertype (`receiver_unbound`) and chained/new/cast receiver typing (`java_receiver_chain`, `_java_ret`); C/C++ quoted cross-directory include provenance (`include_kind`); JS external imports anchored to the package, not the path leaf; prior (11): Python property-accessor decorators / `Self`, Swift `Self`, Go generic type params, Python forward type-hint file node, PowerShell dot-source, C# verbatim-interpolated string recovery; (10): C# partial types carry `type_path`; (9): Python property-read raw calls and `_py_property` nodes; (8): Rust `use`-group per-binding edges; (7): Python opaque-base/super(args) markers + nested-class enclosing ids.
# Per-process memo: distributions() scans site-packages metadata, which is
diff --git a/graphify/extractors/json_config.py b/graphify/extractors/json_config.py
index c71cb21035..ea1eb9111d 100644
--- a/graphify/extractors/json_config.py
+++ b/graphify/extractors/json_config.py
@@ -2,11 +2,66 @@
from __future__ import annotations
+import os
from pathlib import Path
from graphify.extractors.base import _file_stem, _make_id, _read_text
+from graphify.extractors.resolution import _read_json_config, _resolve_js_module_path
from graphify.ids import normalize_id
+def _local_extends_target(config: Path, ref: str) -> "Path | None":
+ """The on-disk config a relative `extends` names, or None (#5223).
+
+ tsc resolves a relative or absolute `extends` against the citing config's
+ directory and, when that file is missing and the value does not end in
+ `.json`, retries with `.json` appended. Anything else is a package
+ specifier, resolved through node_modules, and stays a stub.
+ """
+ if not (ref.startswith(("./", "../")) or os.path.isabs(ref)):
+ return None
+ cand = Path(os.path.normpath(config.parent / ref))
+ if cand.is_file():
+ return cand
+ if not ref.endswith(".json"):
+ with_json = cand.with_name(cand.name + ".json")
+ if with_json.is_file():
+ return with_json
+ return None
+
+
+def _paths_base(config: Path) -> "Path | None":
+ """Directory a config's `compilerOptions.paths` targets resolve against.
+
+ tsc uses `baseUrl` when one is in effect (the config's own, else the nearest
+ one inherited through `extends`, each resolved against the config declaring
+ it), and otherwise the directory of the config declaring `paths`. Returns
+ None when the chain leaves the scan (a package `extends`) before a baseUrl
+ is found, since the base can then not be known (#5223).
+ """
+ seen: set[str] = set()
+ current = config
+ while str(current) not in seen:
+ seen.add(str(current))
+ data = _read_json_config(current) or {}
+ opts = data.get("compilerOptions")
+ base = opts.get("baseUrl") if isinstance(opts, dict) else None
+ if isinstance(base, str) and base:
+ return Path(os.path.normpath(current.parent / base))
+ ext = data.get("extends")
+ if not ext:
+ return config.parent
+ # TS 5 array: later entries override earlier ones, so the last wins.
+ if isinstance(ext, list):
+ ext = next((e for e in reversed(ext) if isinstance(e, str)), None)
+ elif not isinstance(ext, str):
+ ext = None
+ nxt = _local_extends_target(current, ext) if ext else None
+ if nxt is None:
+ return None
+ current = nxt
+ return None
+
+
_CONFIG_JSON_NAMES = frozenset({
"package.json", "tsconfig.json", "jsconfig.json", "composer.json",
"deno.json", "deno.jsonc", "bower.json", "manifest.json",
@@ -134,7 +189,7 @@ def add_node(nid: str, label: str, line: int, file_type: str = "code") -> None:
"source_file": str_path, "source_location": f"L{line}"})
def add_edge(src: str, tgt: str, relation: str, line: int,
- context: str | None = None) -> None:
+ context: str | None = None, target_file: "Path | None" = None) -> None:
if not src or not tgt or src == tgt:
return
edge = {"source": src, "target": tgt, "relation": relation,
@@ -142,8 +197,17 @@ def add_edge(src: str, tgt: str, relation: str, line: int,
"source_location": f"L{line}", "weight": 1.0}
if context:
edge["context"] = context
+ if target_file is not None:
+ edge["target_file"] = str(target_file)
edges.append(edge)
+ _base_memo: list = []
+
+ def paths_base() -> "Path | None":
+ if not _base_memo:
+ _base_memo.append(_paths_base(path))
+ return _base_memo[0]
+
file_nid = _make_id(str(path))
add_node(file_nid, path.name, 1)
@@ -211,17 +275,47 @@ def walk_object(obj_node, parent_nid: str, parent_key: str | None,
if item.type == "string":
content = item.child_by_field_name("string_content")
ref = _read_text(content, source) if content else _read_text(item, source).strip('"\'')
- if ref:
+ local = _local_extends_target(path, ref) if ref else None
+ if local is not None:
+ add_edge(key_nid, _make_id(str(local)), "extends", line,
+ context="import", target_file=local)
+ elif ref:
ref_nid = _make_id("ref", ref)
if ref_nid:
add_node(ref_nid, ref, line, file_type="concept")
add_edge(key_nid, ref_nid, "extends", line, context="import")
+ elif val.type == "array" and parent_key == "paths" and "*" not in key:
+ # An exact `paths` alias names the module it maps to; tsc takes
+ # the first target that exists. Wildcard aliases need an
+ # expansion policy and get no edge (#5223).
+ base = paths_base()
+ for item in val.children if base is not None else ():
+ if item.type != "string":
+ continue
+ content = item.child_by_field_name("string_content")
+ t = _read_text(content, source) if content else _read_text(item, source).strip('"')
+ if not t or "*" in t:
+ continue
+ hit = _resolve_js_module_path(Path(os.path.normpath(base / t)))
+ if hit is not None and hit.is_file():
+ add_edge(file_nid, _make_id(str(hit)), "references", line,
+ target_file=hit)
+ break
+
elif val.type == "string":
content = val.child_by_field_name("string_content")
val_text = _read_text(content, source) if content else _read_text(val, source).strip('"\'')
- if key == "extends" and val_text:
+ local = (_local_extends_target(path, val_text)
+ if key == "extends" and val_text else None)
+ if local is not None:
+ # A local config: edge only, stamped so extract()'s
+ # target_file pass repoints it at that file's node (#5223).
+ add_edge(file_nid, _make_id(str(local)), "extends", line,
+ context="import", target_file=local)
+
+ elif key == "extends" and val_text:
# Namespace external refs to avoid ID collision with file nodes (J-4)
ref_nid = _make_id("ref", val_text)
if ref_nid:
diff --git a/tests/test_tsconfig_declaration_targets.py b/tests/test_tsconfig_declaration_targets.py
new file mode 100644
index 0000000000..b8fba2bfe5
--- /dev/null
+++ b/tests/test_tsconfig_declaration_targets.py
@@ -0,0 +1,84 @@
+"""#5223: tsconfig `extends` and `paths` declarations point at scanned files."""
+import pytest
+from graphify.extract import collect_files, extract
+from graphify.build import build_from_json
+
+
+def _edges(tmp_path, files):
+ root = tmp_path / "repo"
+ for name, text in files.items():
+ p = root / name
+ p.parent.mkdir(parents=True, exist_ok=True)
+ p.write_text(text, encoding="utf-8")
+ data = extract(collect_files(root, root=root), root=root,
+ cache_root=tmp_path / "cache", parallel=False)
+ g = build_from_json(data, root=root, dedup=False)
+ # The graph is undirected; build keeps each edge's direction in _src/_tgt.
+ out = set()
+ for u, v, e in g.edges(data=True):
+ if e.get("relation") == "contains":
+ continue
+ a, b = e.get("_src", u), e.get("_tgt", v)
+ out.add((g.nodes[a].get("source_file"), e["relation"],
+ g.nodes[b].get("source_file"), g.nodes[b].get("file_type")))
+ return out
+
+
+TS = "export const a = 1;"
+BASE = '{"compilerOptions":{"strict":true}}' # a real base config, so it is scanned
+
+
+@pytest.mark.parametrize("files, citing, target", [
+ ({"a/tsconfig.json": "{}", "a/tsconfig.build.json": '{"extends":"./tsconfig.json"}',
+ "b/tsconfig.json": "{}", "b/tsconfig.build.json": '{"extends":"./tsconfig.json"}'},
+ "a/tsconfig.build.json", "a/tsconfig.json"),
+ ({"base.json": BASE, "tsconfig.json": '{"extends":["./base.json"]}'},
+ "tsconfig.json", "base.json"),
+ ({"tsconfig.base.json": BASE, "tsconfig.json": '{"extends":"./tsconfig.base"}'},
+ "tsconfig.json", "tsconfig.base.json"),
+ ({"tsconfig.base.json": BASE, "pkg/tsconfig.json": '{"extends":"../tsconfig.base.json"}'},
+ "pkg/tsconfig.json", "tsconfig.base.json"),
+ ({"a/tsconfig.json": "{}", "a/tsconfig.build.json": '{\n// c\n"extends":"./tsconfig.json",\n}'},
+ "a/tsconfig.build.json", "a/tsconfig.json"),
+], ids=["string", "array", "no-suffix", "parent-dir", "jsonc"])
+def test_local_extends_points_at_the_real_config(tmp_path, files, citing, target):
+ assert (citing, "extends", target, "code") in _edges(tmp_path, files)
+
+
+@pytest.mark.parametrize("value", ["@tsconfig/node18/tsconfig.json", "./missing.json"])
+def test_external_or_missing_extends_keeps_its_stub(tmp_path, value):
+ edges = _edges(tmp_path, {"tsconfig.json": f'{{"extends":"{value}"}}'})
+ assert [e for e in edges if e[1] == "extends"] == [
+ ("tsconfig.json", "extends", "tsconfig.json", "concept")]
+
+
+@pytest.mark.parametrize("config, target", [
+ ('{"compilerOptions":{"baseUrl":".","paths":{"@demo":["src/index.ts"]}}}', "src/index.ts"),
+ ('{"compilerOptions":{"paths":{"@demo":["./src/index.ts"]}}}', "src/index.ts"),
+ ('{"compilerOptions":{"baseUrl":"./src","paths":{"@demo":["index.ts"]}}}', "src/index.ts"),
+ ('{"compilerOptions":{"paths":{"@demo":["gone.ts","src/index.ts"]}}}', "src/index.ts"),
+ ('{"compilerOptions":{"paths":{"@demo":["src/index"]}}}', "src/index.ts"),
+], ids=["repro", "no-baseurl", "baseurl-subdir", "fallback", "extensionless"])
+def test_exact_paths_alias_references_its_file(tmp_path, config, target):
+ edges = _edges(tmp_path, {"tsconfig.json": config, "src/index.ts": TS})
+ assert ("tsconfig.json", "references", target, "code") in edges
+
+
+@pytest.mark.parametrize("config", [
+ '{"compilerOptions":{"paths":{"@/*":["src/*"]}}}',
+ '{"compilerOptions":{"paths":{"@demo":["gone.ts"]}}}',
+], ids=["wildcard", "missing"])
+def test_wildcard_or_missing_paths_target_gets_no_edge(tmp_path, config):
+ edges = _edges(tmp_path, {"tsconfig.json": config, "src/index.ts": TS})
+ assert not [e for e in edges if e[1] == "references"]
+
+
+def test_paths_use_baseurl_inherited_through_extends(tmp_path):
+ """tsc resolves `paths` against an inherited baseUrl, so x.ts at the root is wrong."""
+ edges = _edges(tmp_path, {
+ "base/tsconfig.json": '{"compilerOptions":{"baseUrl":"../lib"}}',
+ "tsconfig.json": '{"extends":"./base/tsconfig.json","compilerOptions":{"paths":{"@d":["x.ts"]}}}',
+ "lib/x.ts": TS, "x.ts": TS})
+ # tsc 5.9.3 resolves `@d` here to lib/x.ts (checked with --traceResolution).
+ assert {e for e in edges if e[1] == "references"} == {
+ ("tsconfig.json", "references", "lib/x.ts", "code")}