diff --git a/graphify/cache.py b/graphify/cache.py
index 3b52d33c35..57b9d35dda 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 YAML value naming a package script (a workflow's `pnpm run check`) or a local file (a compose bind mount) is recorded as a `language: "yaml"` raw_call and resolved to a `references` edge against the scanned corpus (#5225), so cached YAML 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/extract.py b/graphify/extract.py
index 0123ef02f6..4e7c37934c 100644
--- a/graphify/extract.py
+++ b/graphify/extract.py
@@ -35,6 +35,7 @@
from .pascal_singleton_resolution import resolve_pascal_singleton_calls
from .cpp_resolution import CppTypeLookup
from .markdown_resolution import MARKDOWN_MENTION_SUFFIXES, resolve_markdown_mentions
+from .yaml_resolution import YAML_REF_SUFFIXES, resolve_yaml_value_refs
# --- migrated to graphify/extractors/ (see graphify/extractors/MIGRATION.md) ---
from graphify.rcfile import (
@@ -10076,6 +10077,13 @@ def _resolve_kotlin_member_calls(
"markdown_mentions", MARKDOWN_MENTION_SUFFIXES, resolve_markdown_mentions
)
)
+# YAML values that name a package script or a local file (a workflow's
+# `pnpm run check`, a compose bind mount) become key --references--> target
+# edges, but only to a target that was scanned (#5225). The shared call pass
+# skips these raw_calls, so a script name is never matched as a call.
+register_language_resolver(
+ LanguageResolver("yaml_value_refs", YAML_REF_SUFFIXES, resolve_yaml_value_refs)
+)
# Inline markdown link: [text](target "optional title"). The negative lookbehind
@@ -13186,6 +13194,9 @@ def _looks_like_bash(result: object) -> bool:
# edge from a heading to whatever shares the name.
if rc.get("language") == "markdown":
continue
+ # A YAML value names a script or file; yaml_value_refs resolves it.
+ if rc.get("language") == "yaml":
+ continue
# A Solidity name is visible only through the caller contract's own
# bases; resolve_solidity_inherited_calls binds those. A corpus-wide
# name match would link `_transfer()` to any contract's `_transfer`.
diff --git a/graphify/extractors/yaml_config.py b/graphify/extractors/yaml_config.py
index 4bc25b41c8..33b2e924c8 100644
--- a/graphify/extractors/yaml_config.py
+++ b/graphify/extractors/yaml_config.py
@@ -20,6 +20,7 @@
from graphify.extractors.base import _file_stem, _make_id
from graphify.ids import normalize_id
+from graphify.extractors.yaml_refs import value_refs
_YAML_MAX_BYTES = 1_048_576 # 1 MiB
_MAX_PAIRS = 500
@@ -254,6 +255,19 @@ def add_edge(src: str, tgt: str, relation: str, line: int = 1,
add_node(file_nid, path.name, 1)
pair_count = [0]
+ # Scalar values that name a script or a local file (#5225). Recorded as
+ # raw_calls so the yaml_value_refs resolver can match them against the
+ # scanned corpus once every file is extracted; the cache keeps them.
+ refs: dict[int, list] = {}
+ raw_calls: list[dict] = []
+
+ def record(holder_nid: str, value_node: Any) -> None:
+ for kind, target, name in refs.get(id(value_node), ()):
+ raw_calls.append({
+ "language": "yaml", "caller_nid": holder_nid, "ref_kind": kind,
+ "target_path": target, "callee": name, "source_file": str_path,
+ "source_location": f"L{value_node.start_mark.line + 1}",
+ })
def walk(node: Any, parent_nid: str, parent_key: str | None, depth: int) -> None:
if depth > _MAX_DEPTH:
@@ -273,15 +287,20 @@ def walk(node: Any, parent_nid: str, parent_key: str | None, depth: int) -> None
add_edge(parent_nid, key_nid, "contains", line)
if isinstance(val, (yaml.MappingNode, yaml.SequenceNode)):
walk(val, key_nid, key_str, depth + 1)
+ else:
+ record(key_nid, val)
elif isinstance(node, yaml.SequenceNode):
# Lists of scalars carry no key structure; only recurse into
# structured items without minting index nodes (avoids explosion).
for item in node.value:
if isinstance(item, (yaml.MappingNode, yaml.SequenceNode)):
walk(item, parent_nid, parent_key, depth + 1)
+ else:
+ record(parent_nid, item)
multi = len(config_docs) > 1
for index, (doc, tree) in enumerate(config_docs):
+ refs = value_refs(path, tree)
if multi:
# Keep each document of a multi-document stream distinct (a k8s file
# holding a Deployment and a Service must not merge their metadata).
@@ -296,4 +315,7 @@ def walk(node: Any, parent_nid: str, parent_key: str | None, depth: int) -> None
else:
walk(tree, file_nid, None, 0)
- return {"nodes": nodes, "edges": edges}
+ result: dict = {"nodes": nodes, "edges": edges}
+ if raw_calls:
+ result["raw_calls"] = raw_calls
+ return result
diff --git a/graphify/extractors/yaml_refs.py b/graphify/extractors/yaml_refs.py
new file mode 100644
index 0000000000..f264a659dd
--- /dev/null
+++ b/graphify/extractors/yaml_refs.py
@@ -0,0 +1,163 @@
+"""Literal references in YAML scalar values (#5225).
+
+A workflow's ``run: pnpm run check`` names a package script, and a compose
+bind mount ``./settings.yaml:/etc/demo/settings.yaml`` names a host file. The
+structural walk in ``yaml_config`` keeps keys only, so these values were never
+looked at. This module reads them and says what each one names; it never
+checks that the target exists. Whether the named file was scanned, and
+whether the package declares the script, is only known once every file is
+extracted, so that question is answered later, against the corpus.
+
+Every target is a path relative to the YAML file's own folder, so the result
+holds no absolute path and survives the cache being moved with the project.
+
+Only literal forms are read. Anything that needs evaluation is skipped rather
+than guessed: GitHub expressions and shell variables, pipes, ``&&`` chains,
+named volumes, container-side paths, and absolute or remote paths.
+"""
+from __future__ import annotations
+
+import posixpath
+import shlex
+from pathlib import Path
+from typing import Any
+
+# A `run:` line holding any of these is a shell expression, not one command.
+_SHELL_META = frozenset("$`|&;<>(){}*?[]!~\\\"'")
+_PACKAGE_RUNNERS = frozenset({"npm", "pnpm", "yarn", "bun"})
+_INTERPRETERS = frozenset({"bash", "sh", "zsh", "python", "python3", "node", "pwsh", "ruby", "perl"})
+
+# A reference: ("script", package.json path, script name) or ("file", path, "").
+Ref = tuple[str, str, str]
+
+
+def _scalar(node: Any) -> str | None:
+ import yaml # type: ignore
+ if isinstance(node, yaml.ScalarNode) and node.tag == "tag:yaml.org,2002:str":
+ return node.value
+ return None
+
+
+def _get(node: Any, key: str) -> Any:
+ import yaml # type: ignore
+ if isinstance(node, yaml.MappingNode):
+ for k, v in node.value:
+ if isinstance(k, yaml.ScalarNode) and k.value == key:
+ return v
+ return None
+
+
+def _default_wd(node: Any) -> str | None:
+ return _scalar(_get(_get(_get(node, "defaults"), "run"), "working-directory"))
+
+
+def _local(rel: str) -> str | None:
+ """A plain relative path, normalised; None for anything else."""
+ if not rel or "${" in rel or "://" in rel or rel.startswith(("/", "~")):
+ return None
+ if any(c in rel for c in "$`*?"):
+ return None
+ return posixpath.normpath(rel)
+
+
+def _run_refs(command: str, wd: str, to_file: str) -> list[Ref]:
+ """References in one ``run:`` block, run from ``wd`` (repo-relative).
+
+ ``to_file`` turns a repo-relative path into one relative to the workflow.
+ Each line is read as one command; a line that is anything more than a
+ plain command is skipped.
+ """
+ refs: list[Ref] = []
+ for line in command.splitlines():
+ line = line.strip()
+ if not line or line.startswith("#") or any(c in _SHELL_META for c in line):
+ continue
+ try:
+ tokens = shlex.split(line)
+ except ValueError:
+ continue
+ if len(tokens) >= 3 and tokens[0] in _PACKAGE_RUNNERS and tokens[1] == "run" \
+ and not tokens[2].startswith("-"):
+ refs.append(("script", to_file(posixpath.join(wd, "package.json")), tokens[2]))
+ continue
+ script = None
+ if len(tokens) >= 2 and tokens[0] in _INTERPRETERS and not tokens[1].startswith("-"):
+ script = tokens[1]
+ elif tokens[0].startswith(("./", "../")):
+ script = tokens[0]
+ rel = _local(script) if script else None
+ if rel:
+ refs.append(("file", to_file(posixpath.join(wd, rel)), ""))
+ return refs
+
+
+def _workflow_refs(path: Path, tree: Any) -> dict[int, list[Ref]]:
+ import yaml # type: ignore
+ # The workflow runs from the repository root: the folder holding `.github`.
+ up = "../" * (len(path.parts) - 1 - [p.casefold() for p in path.parts].index(".github"))
+ out: dict[int, list[Ref]] = {}
+ jobs = _get(tree, "jobs")
+ if not isinstance(jobs, yaml.MappingNode):
+ return out
+ wf_wd = _default_wd(tree)
+ for _k, job in jobs.value:
+ job_wd = _default_wd(job) or wf_wd
+ steps = _get(job, "steps")
+ if not isinstance(steps, yaml.SequenceNode):
+ continue
+ for step in steps.value:
+ run = _get(step, "run")
+ command = _scalar(run)
+ if command is None:
+ continue
+ wd = _scalar(_get(step, "working-directory")) or job_wd or "."
+ wd = _local(wd) if wd != "." else "."
+ if wd is None or "${{" in command:
+ continue
+ refs = _run_refs(command, wd, lambda p: posixpath.normpath(up + p))
+ if refs:
+ out[id(run)] = refs
+ return out
+
+
+def _compose_refs(tree: Any) -> dict[int, list[Ref]]:
+ """Bind-mount host paths; compose resolves them against the file's folder."""
+ import yaml # type: ignore
+ out: dict[int, list[Ref]] = {}
+ services = _get(tree, "services")
+ if not isinstance(services, yaml.MappingNode):
+ return out
+ for _k, service in services.value:
+ volumes = _get(service, "volumes")
+ if not isinstance(volumes, yaml.SequenceNode):
+ continue
+ for item in volumes.value:
+ text = _scalar(item)
+ if text is not None:
+ # Short syntax HOST:CONTAINER[:MODE]; no colon is an anonymous volume.
+ host = text.split(":", 1)[0] if ":" in text else ""
+ node = item
+ elif _scalar(_get(item, "type")) == "bind":
+ node = _get(item, "source")
+ host = _scalar(node) or ""
+ else:
+ continue
+ # Only an explicit ./ or ../ is a host path: a bare name is a
+ # named volume, and an absolute path lies outside the project.
+ rel = _local(host) if host.startswith(("./", "../")) else None
+ if rel:
+ out[id(node)] = [("file", rel, "")]
+ return out
+
+
+def value_refs(path: Path, tree: Any) -> dict[int, list[Ref]]:
+ """References named by scalar values in one composed YAML document.
+
+ Keyed by ``id()`` of the scalar node, so the structural walk can attach
+ each one to the key node that holds it.
+ """
+ if "/.github/workflows/" in path.as_posix().casefold():
+ return _workflow_refs(path, tree)
+ if _get(tree, "services") is not None:
+ return _compose_refs(tree)
+ return {}
diff --git a/graphify/yaml_resolution.py b/graphify/yaml_resolution.py
new file mode 100644
index 0000000000..99c530ef8b
--- /dev/null
+++ b/graphify/yaml_resolution.py
@@ -0,0 +1,105 @@
+"""Resolve YAML value references against the scanned corpus (#5225).
+
+``extract_yaml`` reports each literal reference it reads from a value (a
+workflow's ``pnpm run check``, a compose bind mount's ``./settings.yaml``) as a
+``raw_calls`` entry tagged ``language: "yaml"``, with the target as a path
+relative to the YAML file's folder. Only now, with every file extracted, can
+the target be checked against what was actually scanned:
+
+* ``ref_kind: "file"`` links the key that holds the value to the scanned
+ file's node. A file that exists on disk but was not scanned (ignored,
+ excluded, outside the root) gets no edge.
+* ``ref_kind: "script"`` links it to the script's key node in the named
+ ``package.json``: the ``scripts`` key's child carrying the script's name.
+ No such package, or no such script, gets no edge.
+
+The edge is ``references`` and EXTRACTED: the YAML spells the target out, and
+the target was found, not inferred. The shared cross-file call pass skips
+these raw calls, so a script name never becomes a ``calls`` edge to a
+same-named function.
+"""
+from __future__ import annotations
+
+import posixpath
+from typing import Any
+
+from graphify.extractors.base import active_scan_root as _active_scan_root
+
+YAML_REF_SUFFIXES = frozenset({".yaml", ".yml"})
+
+
+def _norm(path: str, root: Any) -> str:
+ """A scanned file's path, absolute and POSIX, as the resolver keys it."""
+ p = path.replace("\\", "/")
+ if not posixpath.isabs(p) and root is not None:
+ p = posixpath.join(str(root).replace("\\", "/"), p)
+ return posixpath.normpath(p)
+
+
+def resolve_yaml_value_refs(
+ per_file: list[dict], all_nodes: list[dict], all_edges: list[dict]
+) -> None:
+ """Turn ``language: "yaml"`` raw calls into ``references`` edges in place."""
+ calls = [
+ rc for result in per_file if isinstance(result, dict)
+ for rc in result.get("raw_calls") or []
+ if isinstance(rc, dict) and rc.get("language") == "yaml"
+ ]
+ if not calls:
+ return
+ root = _active_scan_root()
+
+ # File nodes only: a file node's label is its path's last segment. The
+ # endswith test is a cheap filter so the path split runs only on
+ # candidates, not on every symbol in the corpus.
+ file_nid: dict[str, str] = {}
+ label: dict[str, str] = {}
+ for n in all_nodes:
+ sf, nid, lb = n.get("source_file"), n.get("id"), str(n.get("label", ""))
+ if not nid:
+ continue
+ label[nid] = lb
+ if sf and lb and str(sf).endswith(lb) \
+ and lb == posixpath.basename(str(sf).replace("\\", "/")):
+ file_nid.setdefault(_norm(str(sf), root), nid)
+
+ # `contains` children, kept only under package.json files and their
+ # `scripts` key: the one chain a script reference walks.
+ packages = {nid for nid in file_nid.values() if label.get(nid) == "package.json"}
+ # Two passes, so the result does not depend on edge order.
+ contains = [e for e in all_edges if e.get("relation") == "contains"]
+ scripts_of = {
+ e.get("source"): e.get("target") for e in contains
+ if e.get("source") in packages and label.get(e.get("target")) == "scripts"
+ }
+ script_keys = set(scripts_of.values())
+ by_script_name: dict[str, dict[str, str]] = {}
+ for e in contains:
+ if e.get("source") in script_keys:
+ by_script_name.setdefault(e.get("source"), {}).setdefault(
+ label.get(e.get("target"), ""), e.get("target"))
+
+ seen = {(e.get("source"), e.get("target"), e.get("relation")) for e in all_edges}
+ for rc in calls:
+ caller, holder_file = rc.get("caller_nid"), rc.get("source_file")
+ target_path = rc.get("target_path")
+ if not caller or not holder_file or not target_path:
+ continue
+ here = posixpath.dirname(_norm(str(holder_file), root))
+ target_file = file_nid.get(posixpath.normpath(posixpath.join(here, target_path)))
+ if target_file is None:
+ continue
+ if rc.get("ref_kind") == "script":
+ scripts = scripts_of.get(target_file)
+ target = by_script_name.get(scripts, {}).get(str(rc.get("callee") or "")) if scripts else None
+ else:
+ target = target_file
+ if not target or target == caller or (caller, target, "references") in seen:
+ continue
+ seen.add((caller, target, "references"))
+ all_edges.append({
+ "source": caller, "target": target, "relation": "references",
+ "context": "yaml_value", "confidence": "EXTRACTED",
+ "source_file": holder_file, "source_location": rc.get("source_location"),
+ "weight": 1.0,
+ })
diff --git a/tests/test_yaml_value_refs.py b/tests/test_yaml_value_refs.py
new file mode 100644
index 0000000000..db3f1fc33c
--- /dev/null
+++ b/tests/test_yaml_value_refs.py
@@ -0,0 +1,133 @@
+"""YAML scalar values that name a local file or a package script (#5225)."""
+from __future__ import annotations
+
+from pathlib import Path
+
+import pytest
+
+from graphify.extract import collect_files, extract
+
+
+def _repo(tmp_path: Path, files: dict[str, str]) -> Path:
+ 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")
+ return root
+
+
+def _refs(tmp_path: Path, root: Path) -> set[tuple[str, str]]:
+ """(source file, target label) for every non-containment edge out of YAML."""
+ data = extract(collect_files(root, root=root), root=root,
+ cache_root=tmp_path / "cache", parallel=False)
+ by_id = {n["id"]: n for n in data["nodes"]}
+ out = set()
+ for e in data["edges"]:
+ if e["relation"] == "contains":
+ continue
+ s, t = by_id.get(e["source"]), by_id.get(e["target"])
+ if s and t and str(s.get("source_file", "")).endswith((".yml", ".yaml")):
+ out.add((Path(s["source_file"]).name, t["label"]))
+ return out
+
+
+PKG = '{"scripts":{"check":"node verify.js"}}'
+WF = "on: push\njobs:\n c:\n runs-on: x\n steps:\n - run: {cmd}\n"
+
+
+@pytest.mark.parametrize("cmd", ["pnpm run check", "npm run check", "yarn run check"])
+def test_workflow_run_links_package_script(tmp_path, cmd):
+ root = _repo(tmp_path, {"package.json": PKG,
+ ".github/workflows/c.yml": WF.format(cmd=cmd)})
+ assert _refs(tmp_path, root) == {("c.yml", "check")}
+
+
+def test_step_working_directory_picks_that_package(tmp_path):
+ wf = ("on: push\njobs:\n c:\n runs-on: x\n steps:\n"
+ " - run: pnpm run check\n working-directory: web\n")
+ root = _repo(tmp_path, {"package.json": '{"scripts":{"lint":"x"}}',
+ "web/package.json": PKG,
+ ".github/workflows/c.yml": wf})
+ assert _refs(tmp_path, root) == {("c.yml", "check")}
+
+
+@pytest.mark.parametrize("level", ["workflow", "job"])
+def test_defaults_working_directory_is_inherited(tmp_path, level):
+ d = "defaults:\n run:\n working-directory: web\n"
+ if level == "workflow":
+ wf = "on: push\n" + d + "jobs:\n c:\n runs-on: x\n steps:\n - run: pnpm run check\n"
+ else:
+ wf = ("on: push\njobs:\n c:\n runs-on: x\n"
+ " defaults:\n run:\n working-directory: web\n"
+ " steps:\n - run: pnpm run check\n")
+ root = _repo(tmp_path, {"web/package.json": PKG, ".github/workflows/c.yml": wf})
+ assert _refs(tmp_path, root) == {("c.yml", "check")}
+
+
+@pytest.mark.parametrize("cmd", ["./scripts/check.sh", "bash scripts/check.sh"])
+def test_workflow_run_links_script_file(tmp_path, cmd):
+ root = _repo(tmp_path, {"scripts/check.sh": "echo ok\n",
+ ".github/workflows/c.yml": WF.format(cmd=cmd)})
+ assert _refs(tmp_path, root) == {("c.yml", "check.sh")}
+
+
+@pytest.mark.parametrize("cmd", [
+ "pnpm run ${{ matrix.task }}", "pnpm run check | tee log",
+ "pnpm run check && pnpm run build", "pnpm run $TASK", "pnpm run missing",
+])
+def test_workflow_run_does_not_guess(tmp_path, cmd):
+ root = _repo(tmp_path, {"package.json": PKG,
+ ".github/workflows/c.yml": WF.format(cmd=f"'{cmd}'")})
+ assert _refs(tmp_path, root) == set()
+
+
+SETTINGS = "kind: Settings\nmetadata:\n name: demo\n"
+
+
+@pytest.mark.parametrize("vol", [
+ "- ./settings.yaml:/etc/demo/settings.yaml:ro",
+ "- type: bind\n source: ./settings.yaml\n target: /etc/demo/settings.yaml",
+])
+def test_compose_bind_mount_links_host_file(tmp_path, vol):
+ compose = f"services:\n demo:\n volumes:\n {vol}\n"
+ root = _repo(tmp_path, {"compose.yaml": compose, "settings.yaml": SETTINGS})
+ assert _refs(tmp_path, root) == {("compose.yaml", "settings.yaml")}
+
+
+def test_compose_path_is_relative_to_the_compose_file(tmp_path):
+ compose = "services:\n demo:\n volumes:\n - ../settings.yaml:/etc/s.yaml\n"
+ root = _repo(tmp_path, {"deploy/compose.yaml": compose, "settings.yaml": SETTINGS})
+ assert _refs(tmp_path, root) == {("compose.yaml", "settings.yaml")}
+
+
+@pytest.mark.parametrize("vol", [
+ "data:/var/lib/data", "/etc/settings.yaml:/x", "${PWD}/settings.yaml:/x",
+ "../../../../etc/passwd:/x",
+])
+def test_compose_does_not_guess(tmp_path, vol):
+ compose = f"services:\n demo:\n volumes:\n - {vol}\n"
+ root = _repo(tmp_path, {"compose.yaml": compose, "settings.yaml": SETTINGS})
+ assert _refs(tmp_path, root) == set()
+
+
+def test_compose_command_argument_is_container_side(tmp_path):
+ # `command` runs inside the container, against the container's working
+ # directory, so `./settings.yaml` there is not the compose-relative file.
+ compose = "services:\n demo:\n command: --config ./settings.yaml\n"
+ root = _repo(tmp_path, {"compose.yaml": compose, "settings.yaml": SETTINGS})
+ assert _refs(tmp_path, root) == set()
+
+
+def test_unscanned_target_is_not_linked(tmp_path):
+ compose = "services:\n demo:\n volumes:\n - ./node_modules/x.yaml:/x\n"
+ root = _repo(tmp_path, {"compose.yaml": compose, "node_modules/x.yaml": SETTINGS})
+ assert _refs(tmp_path, root) == set()
+
+
+def test_link_appears_once_target_is_added_with_yaml_cached(tmp_path):
+ compose = "services:\n demo:\n volumes:\n - ./settings.yaml:/x\n"
+ root = _repo(tmp_path, {"compose.yaml": compose})
+ assert _refs(tmp_path, root) == set() # fills the cache for compose.yaml
+ (root / "settings.yaml").write_text(SETTINGS)
+ assert _refs(tmp_path, root) == {("compose.yaml", "settings.yaml")}