From caacc3bac2d0c714f34fa4efd3abaa6ce3089ac6 Mon Sep 17 00:00:00 2001 From: Abhigyan Patwari <126312502+abhigyanpatwari@users.noreply.github.com> Date: Thu, 22 Oct 2026 12:05:08 +0530 Subject: [PATCH] fix(csharp): rank global-namespace types below the file's own namespaces (#3655) * fix(csharp): rank global-namespace types below the file's own namespaces C# global-namespace types were stored in the scope-independent workspaceFqnBindings channel. lookupNameClaim returns that channel at every scope, while namespace siblings are consulted only at the module scope. A type name looked up inside a method therefore stopped at the first global type with that name. The walk never reached the file's own or same-namespace declaration. On the merged lang-resolution corpus this caused four field-chain drops in csharp-field-types and csharp-deep-field-chain. It also bound calls to other fixtures' global types. For example, csharp-hello's Demo.Greeter.Main called csharp-optional-params' Greeter. The C# hook now stores global types in namespaceFqnBindings under the '' key. Each file's accessibility list follows C# name lookup: the declared namespace, the using targets of that declaration, the enclosing namespaces, then the global namespace. The compilation unit's using targets come after it. A using after a file-scoped namespace belongs to that namespace. Shared walker logic is unchanged (comments only); PHP's FQN keys still use workspaceFqnBindings. Corpus A/B against main: the four drops resolve and no drop is added. Wrong cross-fixture edges are retargeted or removed. One global-namespace fixture now types `this` as its own class and reaches a duplicated global User. Receiver bench call drops 128 -> 125, all-kind 192 -> 188 (baseline and BASELINE.md updated; the old note that these sites declined on ambiguity was wrong). Co-Authored-By: Claude Opus 5.5 * test(csharp): initialize voucher fixture payee * test(csharp): refresh initialized payee captures --------- Co-authored-by: Gergo Magyar Co-authored-by: Claude Opus 5.5 --- .../bench/receiver-resolution/BASELINE.md | 32 ++ .../bench/receiver-resolution/baseline.json | 14 +- gitnexus/bench/scope-capture/baselines.json | 128 ++++---- .../core/ingestion/finalize-orchestrator.ts | 1 + .../languages/csharp/namespace-siblings.ts | 284 ++++++++++++------ .../languages/csharp/scope-resolver.ts | 27 +- .../model/scope-resolution-indexes.ts | 33 +- .../contract/scope-resolver.ts | 13 +- .../passes/imported-return-types.ts | 6 +- .../passes/receiver-bound-calls.ts | 12 + .../validate-bindings-immutability.ts | 8 +- .../scope-resolution/scope/walkers.ts | 133 +++++--- .../expected-captures.json | 32 ++ .../Audit/Checker.cs | 14 + .../Audit/Recorder.cs | 12 + .../Billing/Reports/Summary.cs | 11 + .../Billing/Service.cs | 16 + .../Billing/Voucher.cs | 22 ++ .../Global/Voucher.cs | 8 + .../Program.cs | 8 + .../Tools/Importer.cs | 11 + ...rp-namespace-precedence-boundaries.test.ts | 202 +++++++++++++ .../test/integration/resolvers/csharp.test.ts | 53 ++++ .../csharp/csharp-hooks.test.ts | 215 +++++++++---- .../walkers-augmentations.test.ts | 17 ++ 25 files changed, 1018 insertions(+), 294 deletions(-) create mode 100644 gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Audit/Checker.cs create mode 100644 gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Audit/Recorder.cs create mode 100644 gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Billing/Reports/Summary.cs create mode 100644 gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Billing/Service.cs create mode 100644 gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Billing/Voucher.cs create mode 100644 gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Global/Voucher.cs create mode 100644 gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Program.cs create mode 100644 gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Tools/Importer.cs create mode 100644 gitnexus/test/integration/csharp-namespace-precedence-boundaries.test.ts diff --git a/gitnexus/bench/receiver-resolution/BASELINE.md b/gitnexus/bench/receiver-resolution/BASELINE.md index 845e771f0..b45e0f14a 100644 --- a/gitnexus/bench/receiver-resolution/BASELINE.md +++ b/gitnexus/bench/receiver-resolution/BASELINE.md @@ -29,6 +29,30 @@ more sites than the original standalone branch, which cleared 14. The `b12` alias control resolves. Zig call drops fall from 13 to 10; `no-chain` call drops move from 34 to 31 and `in-program` calls from 60 to 57. +## C# namespace precedence after main integration + +Types resolve through the enclosing namespace declaration's lookup tiers. +Its own namespace and scoped using targets precede enclosing and global +namespaces; compilation-unit usings follow. Registry candidate collection stops +at the winning tier, retaining ambiguity within that tier. Bare class receivers +exclude known nonzero generic arity outside the class itself. Positioned using +ownership uses binary search over namespace starts. + +Before the Zig merge, against main `2b6542737`, call drops move from 138 to 135, reads from 42 to 41, +writes stay at 20, and all-kind drops move from 200 to 196. The four cleared +sites are the two Address.Save calls in csharp-field-types and +csharp-deep-field-chain, plus the City read and GetName call in the latter. +All shape-arm states are unchanged. The resolution corpus has 5,313 rows versus +5,309 on main: 40 removed records and 44 added records, all in C#. +Process traversal is capped; these counts do not prove whole-flow coverage. + +After merging main `f6e42092`, the baseline is 132 call drops, 26 reads, +20 writes and 178 across all kinds. Initializing the fixture's `Voucher.Payee` +keeps those counts and all shape states unchanged. The current corpus has +5,324 records versus main's 5,319: 45 additions and 40 removals, all in C#. +The initializer adds a constructor capture; only the C# capture fingerprint +changes, and all 16 scaling ratios remain below their unchanged budgets. + ## JS/TS literal-key writes and class-level field receivers (#3498) Measured on top of #3654 (`a3db31923`, tree-identical to its squash merge @@ -950,6 +974,14 @@ Two incidental corrections from that check, both to KTD6: ### Merged main `f6e42092` Re-measured both benchmark arms after merging the Zig receiver fix from main. +Shape states remain unchanged; counts are 132 call drops and +178 drops of all kinds (26 reads, +20 writes). The counts include both main and this branch's fixes. + Shape states remain unchanged; counts are 133 call drops and 160 drops of all kinds (27 reads, 0 writes). The counts include both main and this branch's fixes. + +### After merging #3653 into the C# namespace branch + +Main `2b4456553` is merged normally. The measured baseline has 130 call drops and 156 across all kinds, with 26 reads and zero writes. Main has 133 calls, 27 reads and zero writes (160 total). Every shape state matches main. The fresh build and both TypeScript configurations pass, as do all 68 namespace-boundary, capture, hook and CommonJS merge checks. diff --git a/gitnexus/bench/receiver-resolution/baseline.json b/gitnexus/bench/receiver-resolution/baseline.json index 8a4d378bd..1378a427b 100644 --- a/gitnexus/bench/receiver-resolution/baseline.json +++ b/gitnexus/bench/receiver-resolution/baseline.json @@ -199,19 +199,19 @@ } }, "countArm": { - "callDrops": 133, - "totalDropsAllKinds": 160, + "callDrops": 130, + "totalDropsAllKinds": 156, "bySiteKind": { - "call": 133, - "read": 27 + "call": 130, + "read": 26 }, "callDropsByExtension": { ".java": 49, ".py": 24, ".ts": 16, ".zig": 10, - ".cs": 8, ".tsx": 6, + ".cs": 5, ".go": 4, ".php": 4, ".rs": 4, @@ -221,14 +221,14 @@ ".swift": 1 }, "callDropsByShape": { - "chain-field": 57, + "chain-field": 54, "no-chain": 31, "chain-call": 31, "<>": 13, "chain-unwrap": 1 }, "callDropsByOrigin": { - "in-program": 56, + "in-program": 53, "external": 44, "unknown": 31, "<>": 2 diff --git a/gitnexus/bench/scope-capture/baselines.json b/gitnexus/bench/scope-capture/baselines.json index 8d3ab7199..90649845d 100644 --- a/gitnexus/bench/scope-capture/baselines.json +++ b/gitnexus/bench/scope-capture/baselines.json @@ -11,11 +11,11 @@ "_rebaselined_callable_flow_2522_review": "PR #2522 review hardening: callable operands retain expression/qualified identity and formals retain signature metadata. Prior 3d4e32e7490c830516126e28931827949baa3594cb521f7a3d8dcfed95b6018a -> 57b3c55135af8d2af33b9a7c4bf89796a7bee5b5822b402a2dea91af7232cf4a; scaling 1.058 < 1.5.", "_rebaselined_callable_flow_2522_followup": "PR #2522 follow-up: provider-owned callable assignment/copy/formal/argument/invoke facts with invocation/constructor-result suppression. Prior 09ecd94911b830f52fa8807560abcbd79f163d02a2072870c1a59297e9a326e1 -> 3d4e32e7490c830516126e28931827949baa3594cb521f7a3d8dcfed95b6018a; scaling 1.039 < 1.5.", "_rebaselined": "#1976: F33 generic composite literal constructor inference adds generic_type captures in composite_literal patterns; fingerprint drift expected.", - "_rebaselined_receiver_chain_2747": "#2747 receiver-chain rollout: call matches whose receiver is itself an expression now carry `@reference.receiver-chain`, a compact encoding of the receiver's structure, so resolution types it by folding instead of re-parsing receiver source text. Capture GROUP counts are unchanged \u2014 the tag is added to existing call matches, never a new match \u2014 so this is digest drift only. Prior 57b3c55135af8d2af33b9a7c4bf89796a7bee5b5822b402a2dea91af7232cf4a -> 5d6c59c2f2c0dd937c53bf5d736e0f8376b2899a381e488a33aec23524823efb.", + "_rebaselined_receiver_chain_2747": "#2747 receiver-chain rollout: call matches whose receiver is itself an expression now carry `@reference.receiver-chain`, a compact encoding of the receiver's structure, so resolution types it by folding instead of re-parsing receiver source text. Capture GROUP counts are unchanged — the tag is added to existing call matches, never a new match — so this is digest drift only. Prior 57b3c55135af8d2af33b9a7c4bf89796a7bee5b5822b402a2dea91af7232cf4a -> 5d6c59c2f2c0dd937c53bf5d736e0f8376b2899a381e488a33aec23524823efb.", "_rebaselined_2766_go_pointer_receiver_fixture": "#2766: added test/fixtures/lang-resolution/go-pointer-receiver-field-chain/ (2 Go files) as the committed regression fixture for pointer-receiver base resolution. Go fixture_count 100 -> 102. Prior 5d6c59c2f2c0dd937c53bf5d736e0f8376b2899a381e488a33aec23524823efb -> 8cba537ff211fab3bac5fb4456cd1ffba14d6a2db75c40acae28ab8bf29f3d2e. FIXTURE-CORPUS GROWTH, NOT A CAPTURE CHANGE: the accompanying fix is a resolution-time lookup fallback (stripTypePreservingDecoration) and cannot move capture output; go was the ONLY language whose fingerprint drifted, and every other language matched its baseline on the same run.", - "_rebaselined_2766_receiver_chain_wire_v2": "#2766: receiver-chain wire format v1 -> v2 (name-free `await` / `index` step kinds). The VERSION prefix is part of every emitted `@reference.receiver-chain` capture, so every chain-minting language's capture text changed. WIRE-FORMAT CHANGE, NOT A CAPTURE-SET CHANGE: the same chains are minted for the same sites, spelled `2|\u2026` instead of `1|\u2026`. Exactly the 12 chain-minting languages drifted; c, cobol and dart did not, which is the check that this is the prefix and not a capture regression. Accompanied by SCHEMA_BUMP 34 -> 37 and INCREMENTAL_SCHEMA_VERSION 28 -> 31 so a stale index is rejected rather than replaying chains a v2 decoder refuses. Prior 8cba537ff211fab3bac5fb4456cd1ffba14d6a2db75c40acae28ab8bf29f3d2e -> 8162272bb897b0b89472c406321cf8d88a5ae4ea83ea9e3c45f8e817041bff9f.", - "_rebaselined_2766_await_subscript_emission": "#2766: extractMixedChain now walks THROUGH await and subscript nodes and peels transparent wrappers at loop entry, so sites whose receiver is `repos[0]` or `(await f())` mint a receiver chain where they previously minted none. EMISSION CHANGE: more sites carry `@reference.receiver-chain`; no existing chain changed shape. Only go and kotlin drifted of 15 \u2014 the two whose fixture corpora contain such receivers. Prior 8162272bb897b0b89472c406321cf8d88a5ae4ea83ea9e3c45f8e817041bff9f -> c9c908f441e3be12fad2448120ed3ea35dc235a12b3f63b0ec532ffdae11d9e9.", - "_rebaselined_2766_phantom_callee_read_site": "#2766: Go's `@reference.read` pattern matches EVERY selector_expression, so a member call `h.dep.Work()` minted THREE sites \u2014 the call, the genuine `h.dep` field read, and a PHANTOM read on the callee `h.dep.Work`. The phantom resolved through findOwnedMember (which prefers methods over fields) and emitted an ACCESSES edge to the METHOD duplicating the CALLS edge at the same position; visible today on any receiver the text cascade can type (`RunFromValueReceiver -> DoWork`). The emitter now drops a read match whose selector is in FUNCTION position. FEWER capture matches for Go, no other language affected \u2014 go was the only fingerprint of 15 that moved. A method VALUE (`f := h.dep.Work`) is not in function position and is untouched. Prior c9c908f441e3be12fad2448120ed3ea35dc235a12b3f63b0ec532ffdae11d9e9 -> 7bb524a32a2eed57a15b454e3a33480e92a496c683e6856ef02179693c0e02e3.", + "_rebaselined_2766_receiver_chain_wire_v2": "#2766: receiver-chain wire format v1 -> v2 (name-free `await` / `index` step kinds). The VERSION prefix is part of every emitted `@reference.receiver-chain` capture, so every chain-minting language's capture text changed. WIRE-FORMAT CHANGE, NOT A CAPTURE-SET CHANGE: the same chains are minted for the same sites, spelled `2|…` instead of `1|…`. Exactly the 12 chain-minting languages drifted; c, cobol and dart did not, which is the check that this is the prefix and not a capture regression. Accompanied by SCHEMA_BUMP 34 -> 37 and INCREMENTAL_SCHEMA_VERSION 28 -> 31 so a stale index is rejected rather than replaying chains a v2 decoder refuses. Prior 8cba537ff211fab3bac5fb4456cd1ffba14d6a2db75c40acae28ab8bf29f3d2e -> 8162272bb897b0b89472c406321cf8d88a5ae4ea83ea9e3c45f8e817041bff9f.", + "_rebaselined_2766_await_subscript_emission": "#2766: extractMixedChain now walks THROUGH await and subscript nodes and peels transparent wrappers at loop entry, so sites whose receiver is `repos[0]` or `(await f())` mint a receiver chain where they previously minted none. EMISSION CHANGE: more sites carry `@reference.receiver-chain`; no existing chain changed shape. Only go and kotlin drifted of 15 — the two whose fixture corpora contain such receivers. Prior 8162272bb897b0b89472c406321cf8d88a5ae4ea83ea9e3c45f8e817041bff9f -> c9c908f441e3be12fad2448120ed3ea35dc235a12b3f63b0ec532ffdae11d9e9.", + "_rebaselined_2766_phantom_callee_read_site": "#2766: Go's `@reference.read` pattern matches EVERY selector_expression, so a member call `h.dep.Work()` minted THREE sites — the call, the genuine `h.dep` field read, and a PHANTOM read on the callee `h.dep.Work`. The phantom resolved through findOwnedMember (which prefers methods over fields) and emitted an ACCESSES edge to the METHOD duplicating the CALLS edge at the same position; visible today on any receiver the text cascade can type (`RunFromValueReceiver -> DoWork`). The emitter now drops a read match whose selector is in FUNCTION position. FEWER capture matches for Go, no other language affected — go was the only fingerprint of 15 that moved. A method VALUE (`f := h.dep.Work`) is not in function position and is untouched. Prior c9c908f441e3be12fad2448120ed3ea35dc235a12b3f63b0ec532ffdae11d9e9 -> 7bb524a32a2eed57a15b454e3a33480e92a496c683e6856ef02179693c0e02e3.", "_rebaselined_2766_callee_position_marker": "#2766 review fix: a call's callee selector is no longer DROPPED at capture. An earlier commit on this branch dropped it outright, which also deleted the genuine field read on a func-typed struct field (`h.dep.Work()` where `Work func() error`) - callback/hook/mock structs lost their only ACCESSES evidence. The match is now emitted carrying `@reference.callee-position`, and the phantom is suppressed at EMIT by the resolved target's kind instead. Go only: the other 14 languages' fingerprints are byte-identical, which is the check that this is not a cross-language capture change. Prior 7bb524a32a2eed57a15b454e3a33480e92a496c683e6856ef02179693c0e02e3 -> e47302079e17a5e73711bbed5416557b49327cb67e4932008700ec6b8fb468b3; scaling 1.001 < 1.5; fixtures 102 (unchanged), capture_groups_fp 2103.", "_rebaselined_2813_interface_field_dispatch_fixture": "#2813: added test/fixtures/lang-resolution/go-interface-field-dispatch/ (8 Go files) as the committed regression fixture for calls through an interface-typed struct field. Go fixture_count 102 -> 110. FIXTURE-CORPUS GROWTH, NOT A CAPTURE CHANGE: the accompanying fixes are a detection-time method-set change (interface-impls.ts) and a resolution-time fan-out in the shared receiver pass, neither of which emits captures; go/query.ts and go/captures.ts are untouched. Go was the ONLY language whose fingerprint drifted, and every other language matched its baseline on the same run - the same check used for the #2766 fixture growth above. Prior e47302079e17a5e73711bbed5416557b49327cb67e4932008700ec6b8fb468b3 -> cffee41cadbf350855d99bd5aee7c015b1e8b31d1c343d02f113540abe86c765; scaling 1.074 < 1.5, capture_groups_fp 2303.", "_rebaselined_2837": "#2837: Go struct/interface captures re-anchored from the type_declaration onto the type_spec (@scope.class/@declaration.struct/@declaration.interface in languages/go/query.ts, @definition.struct/@definition.interface in GO_QUERIES). A grouped `type (...)` block used to yield ONE scope and ONE node for every type in it, so each type after the first lost its field typeBindings and every field-receiver call in the file emitted nothing. Capture COUNT is unchanged; only ranges moved, plus the new go-grouped-type-decl fixture. Prior c27fb803598581fa4eb7ddf5ef6f8369b9e3a150082d11362e7aa3ec8faaa832 -> e386598526e502d131e52a17d219635b3a4196d94f1ebdd25922a2582c985d18; scaling 1.054 < 1.5.", @@ -24,11 +24,11 @@ }, "cobol": { "fingerprint": "d77fe8c2e08894d40bfdfeb6df8f5eceefa9f870bdfce9d4b620e6ef298870c9", - "_rebaselined_2813_exact_method_sets": "#2813: Go embedded fields now emit `@reference.embedded-pointer` when spelled `*T` rather than `T`. A CAPTURE-EMISSION CHANGE, not fixture growth: fixture_count is unchanged at 110 and capture_groups_fp moves 2303 -> 2339 (+36), which is the new marker plus the WrongSigRepo/Recount rows added to two existing fixture files. The marker is required for exactness \u2014 Go gives `struct{ Base }` and `struct{ *Base }` different method sets, so structural interface satisfaction cannot be correct without knowing which was written (go.dev/ref/spec#Struct_types). Go was the ONLY language of 15 whose fingerprint moved, which is the check that this is a Go capture change and not a cross-language regression. Accompanied by SCHEMA_BUMP 39 -> 43 (skipping 40/41/42, taken by origin/main during review) so a warm cache cannot replay the pre-marker capture set. Prior cffee41cadbf350855d99bd5aee7c015b1e8b31d1c343d02f113540abe86c765 -> c27fb803598581fa4eb7ddf5ef6f8369b9e3a150082d11362e7aa3ec8faaa832; scaling 0.987 < 1.5.", + "_rebaselined_2813_exact_method_sets": "#2813: Go embedded fields now emit `@reference.embedded-pointer` when spelled `*T` rather than `T`. A CAPTURE-EMISSION CHANGE, not fixture growth: fixture_count is unchanged at 110 and capture_groups_fp moves 2303 -> 2339 (+36), which is the new marker plus the WrongSigRepo/Recount rows added to two existing fixture files. The marker is required for exactness — Go gives `struct{ Base }` and `struct{ *Base }` different method sets, so structural interface satisfaction cannot be correct without knowing which was written (go.dev/ref/spec#Struct_types). Go was the ONLY language of 15 whose fingerprint moved, which is the check that this is a Go capture change and not a cross-language regression. Accompanied by SCHEMA_BUMP 39 -> 43 (skipping 40/41/42, taken by origin/main during review) so a warm cache cannot replay the pre-marker capture set. Prior cffee41cadbf350855d99bd5aee7c015b1e8b31d1c343d02f113540abe86c765 -> c27fb803598581fa4eb7ddf5ef6f8369b9e3a150082d11362e7aa3ec8faaa832; scaling 0.987 < 1.5.", "scaling_budget": 1.5, "_rebaselined_callable_flow_2522_followup": "PR #2522 follow-up: COBOL procedure-pointer callable flow facts; multi-topic extraction now consumes each grouped scope/declaration match once instead of requiring a duplicate declaration-only match. Prior 68ee0e95eb9f86f2d92ca35f730f4c2d4d83abc1b5241ae767ff3437780ec8d1 -> d45bb091b0893d0de4fae2486b31ba21719c9377bf35a0908fd3a36fa1c3bf4e; scaling 0.853 < 1.5.", "_note": "Updated for F17-F23 fixes (P2: TIMES guard, ADD GIVING, SQL AS alias). See PR #1959.", - "_rebaselined_2793_declaratives": "PR #2793: corpus-only re-baseline. `cobol-declaratives` was added to test/fixtures/lang-resolution to reproduce the `Namespace\u2192Record` analyze abort (DECLARATIVES / USE AFTER STANDARD ERROR ON ), and this bench globs `lang-resolution/cobol-*`, so the corpus grew 14 -> 15 files. Verified capture-neutral: with that one fixture moved aside the fingerprint is byte-identical to the prior d45bb091b0893d0de4fae2486b31ba21719c9377bf35a0908fd3a36fa1c3bf4e. No COBOL capture code changed in that PR. Scaling 0.677 < 1.5.", + "_rebaselined_2793_declaratives": "PR #2793: corpus-only re-baseline. `cobol-declaratives` was added to test/fixtures/lang-resolution to reproduce the `Namespace→Record` analyze abort (DECLARATIVES / USE AFTER STANDARD ERROR ON ), and this bench globs `lang-resolution/cobol-*`, so the corpus grew 14 -> 15 files. Verified capture-neutral: with that one fixture moved aside the fingerprint is byte-identical to the prior d45bb091b0893d0de4fae2486b31ba21719c9377bf35a0908fd3a36fa1c3bf4e. No COBOL capture code changed in that PR. Scaling 0.677 < 1.5.", "_rebaselined_3486_semantic_rename": "#3486: Compared actual origin/main (191a954b), committed dd3bf and frozen provider source over the same unchanged corpus. Provider semantic facts replace line-only declarations: exact name spans and qualified/binding identities, full executable ownership scopes, section namespaces, data-item properties and identifier reads/calls. The 13 changed fixture entries gain 49 property declarations, 150 reads and 11 call-reference groups; sections become 5 namespaces instead of callable functions. The fixture corpus is unchanged. Fixture entries 15; changed entries 13; capture groups 110 -> 320. Fingerprint regenerated from the runner's canonicalized capture records. Scaling budgets unchanged." }, "c": { @@ -37,8 +37,8 @@ "_rebaselined_callable_flow_2522_review": "PR #2522 review hardening: callable operands retain expression/qualified identity and formals retain signature metadata. Prior 57fee292147ae6d2db7062da1e07d17122cf355207c8967fa85fd2ec9ca398a4 -> 3418cded9f7072152f68992f0a426f43ae7d9d553579a47075fc0cab185848a5; scaling 1.073 < 1.5.", "_rebaselined_callable_flow_2522_followup": "PR #2522 follow-up: C function-pointer signatures plus direct-callee argument metadata and invocation-result suppression. Prior 75bcdbbf006bf9bd263c0f5857461b118f39b164e9f821cb0651ad0ec46ef6ae -> 57fee292147ae6d2db7062da1e07d17122cf355207c8967fa85fd2ec9ca398a4; scaling 1.035 < 1.5.", "_rebaselined_callable_flow": "Callable-value-flow facts for C function pointers, copies, pointer-to-pointer cells, arguments, and indirect invokes. Prior 12a196b2d6249c8d86a931b12ecebc2a0cdf8d6f47683acdd0d8e9d8bc7657f5 -> 75bcdbbf006bf9bd263c0f5857461b118f39b164e9f821cb0651ad0ec46ef6ae; measured scaling ratio 0.980 < 1.5.", - "_added": "#1956: c added to the scope-capture bench (was UNBENCHED). C has no inheritance \u2014 flat scale source. Adding it exposed + fixed a pre-existing O(n^2) findNodeAtRange root-walk in c/captures.ts (threaded c.node, byte-identical over c-* fixtures); scaling 3.475 -> 0.96.", - "_note": "#1983: + c-static-linkage-worker fixture (caller.c/lib.c/lib.h/local.c \u2014 worker-path static-linkage side-channel test). Pure fixture-corpus drift: no c/captures.ts or query change branch-vs-main, existing fixtures' captures byte-identical (c-captures.test.ts 45/45), scaling stays linear (~0.97). The baseline was missed when the fixture landed; regenerated here. fingerprint 0de009b->39f3a83.", + "_added": "#1956: c added to the scope-capture bench (was UNBENCHED). C has no inheritance — flat scale source. Adding it exposed + fixed a pre-existing O(n^2) findNodeAtRange root-walk in c/captures.ts (threaded c.node, byte-identical over c-* fixtures); scaling 3.475 -> 0.96.", + "_note": "#1983: + c-static-linkage-worker fixture (caller.c/lib.c/lib.h/local.c — worker-path static-linkage side-channel test). Pure fixture-corpus drift: no c/captures.ts or query change branch-vs-main, existing fixtures' captures byte-identical (c-captures.test.ts 45/45), scaling stays linear (~0.97). The baseline was missed when the fixture landed; regenerated here. fingerprint 0de009b->39f3a83.", "_rebaselined": "#1919 open-language coverage: new lang-resolution fixtures + intended capture additions (F5/F9 c-cpp, F26/F28/F29 dart, F47/F48/F49/F51/F52 kotlin, F75/F79 swift). Fingerprint-only drift; scaling_ratio ~1.0 (linear, no perf regression).", "_rebaselined_3486_semantic_rename": "#3486: Compared actual origin/main (191a954b), committed dd3bf and frozen provider source over the same unchanged corpus. 72 pointer-parameter and 43 field type bindings are added; 19 reference-only struct/union specifiers stop introducing class scopes; 53 callable groups gain C/C++-compatible parameter type classes and normalized type spelling. The existing fixture corpus is unchanged. Fixture entries 15; changed entries 9; capture groups 545 -> 641. Fingerprint regenerated from the runner's canonicalized capture records. Scaling budgets unchanged." }, @@ -46,8 +46,8 @@ "_lexical_ownership_3532": "#3532: lexical ownership captures and fixture updates; fixture identities are relative to lang-resolution so serialized scope IDs are independent of checkout location. Full capture content remains hashed; scaling_budget is unchanged.", "fingerprint": "dfd1de80f55d8e1bacde91a99951e7eee4e76ccdc8a7477c5a8ac98d804ce05a", "scaling_budget": 1.5, - "_rebaselined_2833_qualified_member_fields": "#2833 follow-up: the six per-qualifier-depth `field_declaration` type-binding rules for a QUALIFIED generic member are replaced by three depth-agnostic ones that match the outer `qualified_identifier` itself, with the qualifier reduced to its top-level tail in `interpret.ts` (`cppQualifiedTail`). This is a CAPTURE-LOGIC change and it moves the fingerprint in two places at once. (1) A qualified NON-generic member (`ns::Address addr;`, `std::string name;`) was captured by nothing at all and now binds \u2014 that is the whole +24 on the fixture corpus, every one of them a `std::string` member. (2) Qualifier depth is no longer enumerated, so `a::b::c::Repo` (depth 3+) is captured where the old rules stopped at 2. Capture-name histogram, cpp-* corpus (278 files): `@type-binding.field` 8 -> 32, `@type-binding.name` and `@type-binding.type` 401 -> 425; synthetic DAO-20: `@type-binding.field` 40 -> 60, `@type-binding.name` and `@type-binding.type` 61 -> 81 (= 20 entities x the one `std::string name;` member the DAO unit already declared). NO OTHER TAG MOVED in either set \u2014 not one `@declaration.*`, `@scope.*` or `@reference.*` count \u2014 which is the property that says three rules replaced six without widening what a field_declaration matches. Measured over the 13 cpp-* fixture repos whose sources gained a binding, the distinct CALLS edge set is byte-identical before and after (32 edges): a reduced tail that names no workspace class binds nothing. Prior bd47c82d09a83cbf0ac857f41876fa31d22304043735582e913bccde06cf2c1a -> db1156d81b3e3341faf5e938a4a34417f4fd246588b6150b4686481823262529; scaling 1.04 < 1.5.", - "_rebaselined_2833_generic_member_fields": "#2833 review follow-up: the cpp DAO generator's unit gains two GENERIC member fields \u2014 `Repo repo;` (bare template_type) and `std::vector items;` (qualified_identifier wrapping a template_type) \u2014 plus the header declaring `template class Repo`. CORPUS CHANGE, NOT A CAPTURE-LOGIC CHANGE: no extractor edit accompanies it. It exists because the corpus had ZERO template-typed member fields and, across 279 cpp-* fixtures, not one qualified generic member either, so BOTH rounds of new `field_declaration` type-binding rules landed with a byte-identical cpp fingerprint \u2014 the gate was structurally blind to the exact thing being changed. Measured under the new corpus, the three states now differ: pre-#2833 query 0e7cbda71360b7ff35dd76091c77f288d6af6a5cfa9185ad85a372aae8c85191 (4521 groups) -> the three template_type field rules de07d8b5300ed867b460918e16b4d80259c7eb6efc1034d32bebe9ff7cab126d (4541) -> the six qualified rules bd47c82d09a83cbf0ac857f41876fa31d22304043735582e913bccde06cf2c1a (4561); under the OLD corpus all three were 856d02f3f9d22cb973877211100aee8e052d4bc545922f78704b1a21ce49ddcc. Capture-name histogram over the synthetic DAO-20: `@type-binding.field` 0 -> 40, `@declaration.field` 40 -> 80, `@type-binding.type`/`@type-binding.name` 20 -> 61, `@declaration.name` 104 -> 147 \u2014 40 = 20 entities x 2 fields, with the residual +1/+2/+3 attributable to the one-off header declaration; every `@reference.*` count is unchanged. Prior 856d02f3f9d22cb973877211100aee8e052d4bc545922f78704b1a21ce49ddcc -> bd47c82d09a83cbf0ac857f41876fa31d22304043735582e913bccde06cf2c1a; scaling 1.058 < 1.5. `c` is unaffected (3418cded..., unchanged).", + "_rebaselined_2833_qualified_member_fields": "#2833 follow-up: the six per-qualifier-depth `field_declaration` type-binding rules for a QUALIFIED generic member are replaced by three depth-agnostic ones that match the outer `qualified_identifier` itself, with the qualifier reduced to its top-level tail in `interpret.ts` (`cppQualifiedTail`). This is a CAPTURE-LOGIC change and it moves the fingerprint in two places at once. (1) A qualified NON-generic member (`ns::Address addr;`, `std::string name;`) was captured by nothing at all and now binds — that is the whole +24 on the fixture corpus, every one of them a `std::string` member. (2) Qualifier depth is no longer enumerated, so `a::b::c::Repo` (depth 3+) is captured where the old rules stopped at 2. Capture-name histogram, cpp-* corpus (278 files): `@type-binding.field` 8 -> 32, `@type-binding.name` and `@type-binding.type` 401 -> 425; synthetic DAO-20: `@type-binding.field` 40 -> 60, `@type-binding.name` and `@type-binding.type` 61 -> 81 (= 20 entities x the one `std::string name;` member the DAO unit already declared). NO OTHER TAG MOVED in either set — not one `@declaration.*`, `@scope.*` or `@reference.*` count — which is the property that says three rules replaced six without widening what a field_declaration matches. Measured over the 13 cpp-* fixture repos whose sources gained a binding, the distinct CALLS edge set is byte-identical before and after (32 edges): a reduced tail that names no workspace class binds nothing. Prior bd47c82d09a83cbf0ac857f41876fa31d22304043735582e913bccde06cf2c1a -> db1156d81b3e3341faf5e938a4a34417f4fd246588b6150b4686481823262529; scaling 1.04 < 1.5.", + "_rebaselined_2833_generic_member_fields": "#2833 review follow-up: the cpp DAO generator's unit gains two GENERIC member fields — `Repo repo;` (bare template_type) and `std::vector items;` (qualified_identifier wrapping a template_type) — plus the header declaring `template class Repo`. CORPUS CHANGE, NOT A CAPTURE-LOGIC CHANGE: no extractor edit accompanies it. It exists because the corpus had ZERO template-typed member fields and, across 279 cpp-* fixtures, not one qualified generic member either, so BOTH rounds of new `field_declaration` type-binding rules landed with a byte-identical cpp fingerprint — the gate was structurally blind to the exact thing being changed. Measured under the new corpus, the three states now differ: pre-#2833 query 0e7cbda71360b7ff35dd76091c77f288d6af6a5cfa9185ad85a372aae8c85191 (4521 groups) -> the three template_type field rules de07d8b5300ed867b460918e16b4d80259c7eb6efc1034d32bebe9ff7cab126d (4541) -> the six qualified rules bd47c82d09a83cbf0ac857f41876fa31d22304043735582e913bccde06cf2c1a (4561); under the OLD corpus all three were 856d02f3f9d22cb973877211100aee8e052d4bc545922f78704b1a21ce49ddcc. Capture-name histogram over the synthetic DAO-20: `@type-binding.field` 0 -> 40, `@declaration.field` 40 -> 80, `@type-binding.type`/`@type-binding.name` 20 -> 61, `@declaration.name` 104 -> 147 — 40 = 20 entities x 2 fields, with the residual +1/+2/+3 attributable to the one-off header declaration; every `@reference.*` count is unchanged. Prior 856d02f3f9d22cb973877211100aee8e052d4bc545922f78704b1a21ce49ddcc -> bd47c82d09a83cbf0ac857f41876fa31d22304043735582e913bccde06cf2c1a; scaling 1.058 < 1.5. `c` is unaffected (3418cded..., unchanged).", "_rebaselined_callable_flow_2522_review": "PR #2522 review hardening: callable operands retain expression/qualified identity and formals retain signature/cv metadata. Prior dde874d2c30bda9f634f9799281a66de800cad9f76cf65e7c31839e2ae9da9ff -> 57860dd2a8d4b06c6d2dd0d854c08b781faee3da8f2b6c42ba0c68a9f70e5ccb; scaling 1.090 < 1.5.", "_rebaselined_callable_flow_2522_followup": "PR #2522 follow-up: C++ overload-aware function/reference/member-pointer flow facts with invocation/constructor-result suppression. Prior 3a503a1513e7eede3f7a223dcce0896c06d15bdfa920445224c9025848c0d710 -> dde874d2c30bda9f634f9799281a66de800cad9f76cf65e7c31839e2ae9da9ff; scaling 1.034 < 1.5.", "_rebaselined_callable_flow": "Callable-value-flow facts for C++ function pointers/references, reference aliases, contextual arity, arguments, and member-pointer syntax. Prior 6ab657c8f9bfe988a3759098c2cffdcc0443def75ff263f1282b82c21d96e931 -> 3a503a1513e7eede3f7a223dcce0896c06d15bdfa920445224c9025848c0d710; measured scaling ratio 1.069 < 1.5.", @@ -55,11 +55,11 @@ "_note_1899_followup": "#1899 follow-up: braced-init metadata now carries element count, intentionally changing C++ capture output; CI benchmark scaling remains linear (1.129 < 1.5).", "_added": "#1956: cpp added to the scope-capture bench (was UNBENCHED). Heritage-bearing scale source (: public Base, public Mixin) drives emitCppInheritanceCaptures at scale. Adding it exposed + fixed a pre-existing O(n^2) findNodeAtRange root-walk in cpp/captures.ts (~12 sites, threaded c.node, byte-identical over 263 cpp-* fixtures); scaling 2.30 -> 1.12.", "_rebaselined": "#1919 open-language coverage: new lang-resolution fixtures + intended capture additions (F5/F9 c-cpp, F26/F28/F29 dart, F47/F48/F49/F51/F52 kotlin, F75/F79 swift). Fingerprint-only drift; scaling_ratio ~1.0 (linear, no perf regression). #2094: deleted C++ declarations retain @declaration.is-deleted metadata; deleted operator and pointer-return shapes plus the expanded deleted-overload fixture are included. Intended capture drift; scaling remains linear (1.139 < 1.5).", - "_note": "#1975: + cpp-out-of-line-class fixture, fixture_count 263->265. #1990: + cpp-adl-ns-plus-hidden-friend-same-name fixture (ADL hidden-friend + namespace-callable merge parity test). Pure fixture-corpus drift \u2014 no scope-extractor change; existing fixtures' captures byte-identical. fixture_count 265->267. #1995: + cpp-union-nested-tail-collision and cpp-anon-ns-tail-collision fixtures \u2014 pure fixture-corpus drift; fixture_count 270->272, fingerprint 538e8be->d63ded6. #1993: + cpp-cross-namespace-same-tail fixture \u2014 pure fixture-corpus drift; fixture_count 272->273, fingerprint d63ded6->6d6207ae. #2077 review follow-up: cpp-member-lattice adds cross-file, qualified-base, nested-template, inherited-using, this-receiver, and non-virtual-override regressions; fixture_count 274->275. Capture scaling remains linear (1.134 < 1.5). #1899: braced-init call arguments emit a conservative parameter-type capture; fixture_count 277, scaling remains linear (1.141 < 1.5).", + "_note": "#1975: + cpp-out-of-line-class fixture, fixture_count 263->265. #1990: + cpp-adl-ns-plus-hidden-friend-same-name fixture (ADL hidden-friend + namespace-callable merge parity test). Pure fixture-corpus drift — no scope-extractor change; existing fixtures' captures byte-identical. fixture_count 265->267. #1995: + cpp-union-nested-tail-collision and cpp-anon-ns-tail-collision fixtures — pure fixture-corpus drift; fixture_count 270->272, fingerprint 538e8be->d63ded6. #1993: + cpp-cross-namespace-same-tail fixture — pure fixture-corpus drift; fixture_count 272->273, fingerprint d63ded6->6d6207ae. #2077 review follow-up: cpp-member-lattice adds cross-file, qualified-base, nested-template, inherited-using, this-receiver, and non-virtual-override regressions; fixture_count 274->275. Capture scaling remains linear (1.134 < 1.5). #1899: braced-init call arguments emit a conservative parameter-type capture; fixture_count 277, scaling remains linear (1.141 < 1.5).", "_rebaselined_2522_review_fixes": "PR #2522 review fixes: outermost-chain passing modes; ->* ERROR-recovery role order; member-store visibility. Prior 57860dd2a8d4b06c6d2dd0d854c08b781faee3da8f2b6c42ba0c68a9f70e5ccb -> f29bc3f7b1622954d6f6b7647bc9cf6c7a2629ffcc0fe00ac7918e4925876b65; scaling ratio re-verified within budget.", - "_rebaselined_2522_prototype_value_cells": "Plain function/method prototypes no longer index as callable value cells (only pointer/parenthesized variable declarators do) \u2014 removes the spurious indirect-invoke facts that leaked phantom CALLS past two-phase suppression. Prior f29bc3f7b1622954d6f6b7647bc9cf6c7a2629ffcc0fe00ac7918e4925876b65 -> a70625bb0a9ef74e760d9d79cc5557485d0f0d3fb935e8a22a0c9556c65b5bb1; scaling re-verified within budget.", + "_rebaselined_2522_prototype_value_cells": "Plain function/method prototypes no longer index as callable value cells (only pointer/parenthesized variable declarators do) — removes the spurious indirect-invoke facts that leaked phantom CALLS past two-phase suppression. Prior f29bc3f7b1622954d6f6b7647bc9cf6c7a2629ffcc0fe00ac7918e4925876b65 -> a70625bb0a9ef74e760d9d79cc5557485d0f0d3fb935e8a22a0c9556c65b5bb1; scaling re-verified within budget.", "_rebaselined_receiver_chain_2747": "#2747: additionally adds the `cpp-receiver-chain-arrow` fixture, the behavioural proof for a `->` BASE receiver (`svc->getUser()->save()`) that the rollout fixed and that `cpp-chain-call/` could never catch because it uses the value `.` form. Prior a70625bb0a9ef74e760d9d79cc5557485d0f0d3fb935e8a22a0c9556c65b5bb1 -> 7e27aea46f3e17f33c41babbe0ddd982d1ab5920f143864763e0a1c6aef882a5.", - "_rebaselined_2766_receiver_chain_wire_v2": "#2766: receiver-chain wire format v1 -> v2 (name-free `await` / `index` step kinds). The VERSION prefix is part of every emitted `@reference.receiver-chain` capture, so every chain-minting language's capture text changed. WIRE-FORMAT CHANGE, NOT A CAPTURE-SET CHANGE: the same chains are minted for the same sites, spelled `2|\u2026` instead of `1|\u2026`. Exactly the 12 chain-minting languages drifted; c, cobol and dart did not, which is the check that this is the prefix and not a capture regression. Accompanied by SCHEMA_BUMP 34 -> 37 and INCREMENTAL_SCHEMA_VERSION 28 -> 31 so a stale index is rejected rather than replaying chains a v2 decoder refuses. Prior 7e27aea46f3e17f33c41babbe0ddd982d1ab5920f143864763e0a1c6aef882a5 -> 856d02f3f9d22cb973877211100aee8e052d4bc545922f78704b1a21ce49ddcc.", + "_rebaselined_2766_receiver_chain_wire_v2": "#2766: receiver-chain wire format v1 -> v2 (name-free `await` / `index` step kinds). The VERSION prefix is part of every emitted `@reference.receiver-chain` capture, so every chain-minting language's capture text changed. WIRE-FORMAT CHANGE, NOT A CAPTURE-SET CHANGE: the same chains are minted for the same sites, spelled `2|…` instead of `1|…`. Exactly the 12 chain-minting languages drifted; c, cobol and dart did not, which is the check that this is the prefix and not a capture regression. Accompanied by SCHEMA_BUMP 34 -> 37 and INCREMENTAL_SCHEMA_VERSION 28 -> 31 so a stale index is rejected rather than replaying chains a v2 decoder refuses. Prior 7e27aea46f3e17f33c41babbe0ddd982d1ab5920f143864763e0a1c6aef882a5 -> 856d02f3f9d22cb973877211100aee8e052d4bc545922f78704b1a21ce49ddcc.", "capture_groups_small": 5021, "capture_groups_large": 16021, "capture_groups_fp": 4601, @@ -69,37 +69,39 @@ }, "csharp": { "_rebaselined": "#1956 synth-widening: + csharp-qualified-base fixture; the synth now walks record_declaration + struct_declaration base_lists and handles alias_qualified_name (matching the #1940 legacy leg), so record/struct heritage now emits. csharp-record-base gains a record inherits capture. (record->record SAME-namespace EXTENDS is a separate registry resolution gap, tracked as follow-up.) Linear (~1.00). (Earlier #1956: heritage-bearing scale source.) | #942: scope-resolution-only cleanup reworded fixture comments; capture byte-positions shift, capture LOGIC unchanged. | #1924 F16: record primary-constructor base bindings now exclude constructor arguments; capture fingerprint changes, scaling remains linear. | #2036 review follow-up: csharp-record-base now exercises primary-constructor base dispatch end to end; +2 capture groups, scaling remains linear.", - "fingerprint": "af724813b5183ad9c98408a9c6944a44897b97d02e7f474ffa4ae637ca9ac1e3", + "fingerprint": "28a51b97c32bf95d85e5a322e443ab00cd490a1178269c2f6f9cfc4fb9776686", "scaling_budget": 1.5, "_rebaselined_callable_flow_2522_review": "PR #2522 review hardening: callable operands retain expression/qualified identity and formals retain signature metadata. Prior f31544530924748f9aa37d11cec570bc10c3ddf9d9b237e6df7a17623fd2bb3a -> 75cf380209fa7d1a8a3ec873be1a9424b4e5173be0b08234c2291e8521a9b3c1; scaling 1.061 < 1.5.", "_rebaselined_callable_flow_2522_followup": "PR #2522 follow-up: C# method-group/delegate callable flow facts with invocation-result suppression. Prior 2bb5bc8c19cb8eb08c9590545ad8a1968a7152951f7e12746e2d7901d542fed9 -> f31544530924748f9aa37d11cec570bc10c3ddf9d9b237e6df7a17623fd2bb3a; scaling 1.115 < 1.5.", "_note": "#2046: F35 qualified-constructor captures now emit @reference.qualified-name + a simple-name @reference.name on `new Ns.Foo()`/`new A.B.Foo()`; namespace_declaration/file_scoped_namespace_declaration now emit @declaration.namespace name captures (feeding the non-destructive namespacePrefix sidecar for `new B.Foo()` same-tail disambiguation). + csharp-interface-only-base and csharp-namespace-qualified-ctor fixtures. Pure capture-additive + fixture-corpus drift; scaling stays linear (~1.11).", "_rebaselined_2563_instance_ownership": "#2563: csharp-using-static adds same-file ownership, local-function, overload, partial-class, and cross-namespace same-name coverage. Prior 75cf380209fa7d1a8a3ec873be1a9424b4e5173be0b08234c2291e8521a9b3c1 -> e05dc27456bde8175948586c9e7689033a378fa40e9ca4ce78cce41fbea0f2f8; scaling 1.058 < 1.5.", - "_rebaselined_receiver_chain_2747": "#2747 receiver-chain rollout: call matches whose receiver is itself an expression now carry `@reference.receiver-chain`, a compact encoding of the receiver's structure, so resolution types it by folding instead of re-parsing receiver source text. Capture GROUP counts are unchanged \u2014 the tag is added to existing call matches, never a new match \u2014 so this is digest drift only. Prior 05a85bae70cf9c94f42459c843cfc36e3e81c872e5dcc7d77bc42fbc390f4bfe -> 8a282254b93b3ef2ff34c2fdba819ebc95c53c4fcb09942cbad99f96d3687855.", - "_rebaselined_2766_receiver_chain_wire_v2": "#2766: receiver-chain wire format v1 -> v2 (name-free `await` / `index` step kinds). The VERSION prefix is part of every emitted `@reference.receiver-chain` capture, so every chain-minting language's capture text changed. WIRE-FORMAT CHANGE, NOT A CAPTURE-SET CHANGE: the same chains are minted for the same sites, spelled `2|\u2026` instead of `1|\u2026`. Exactly the 12 chain-minting languages drifted; c, cobol and dart did not, which is the check that this is the prefix and not a capture regression. Accompanied by SCHEMA_BUMP 34 -> 37 and INCREMENTAL_SCHEMA_VERSION 28 -> 31 so a stale index is rejected rather than replaying chains a v2 decoder refuses. Prior 8a282254b93b3ef2ff34c2fdba819ebc95c53c4fcb09942cbad99f96d3687855 -> 476d98a7cc659951c315d63319c8077bbcf0e5f3ec12d32ed773992a1f3a2adc.", - "capture_groups_small": 4259, - "capture_groups_large": 13609, - "capture_groups_fp": 2657, - "fixture_count": 178, + "_rebaselined_receiver_chain_2747": "#2747 receiver-chain rollout: call matches whose receiver is itself an expression now carry `@reference.receiver-chain`, a compact encoding of the receiver's structure, so resolution types it by folding instead of re-parsing receiver source text. Capture GROUP counts are unchanged — the tag is added to existing call matches, never a new match — so this is digest drift only. Prior 05a85bae70cf9c94f42459c843cfc36e3e81c872e5dcc7d77bc42fbc390f4bfe -> 8a282254b93b3ef2ff34c2fdba819ebc95c53c4fcb09942cbad99f96d3687855.", + "_rebaselined_2766_receiver_chain_wire_v2": "#2766: receiver-chain wire format v1 -> v2 (name-free `await` / `index` step kinds). The VERSION prefix is part of every emitted `@reference.receiver-chain` capture, so every chain-minting language's capture text changed. WIRE-FORMAT CHANGE, NOT A CAPTURE-SET CHANGE: the same chains are minted for the same sites, spelled `2|…` instead of `1|…`. Exactly the 12 chain-minting languages drifted; c, cobol and dart did not, which is the check that this is the prefix and not a capture regression. Accompanied by SCHEMA_BUMP 34 -> 37 and INCREMENTAL_SCHEMA_VERSION 28 -> 31 so a stale index is rejected rather than replaying chains a v2 decoder refuses. Prior 8a282254b93b3ef2ff34c2fdba819ebc95c53c4fcb09942cbad99f96d3687855 -> 476d98a7cc659951c315d63319c8077bbcf0e5f3ec12d32ed773992a1f3a2adc.", + "capture_groups_small": 4509, + "capture_groups_large": 14409, + "capture_groups_fp": 2841, + "fixture_count": 186, "_rebaselined_1432_member_call_callee_name": "#1432 (Zig): the shared callable-flow reader no longer names a callee by simple name for a MEMBER call (`@callable-flow.direct-callee-name` requires a direct designator: `f(x)`, `ns.f(x)`), and a member call is a field-stored-callable invoke only when a MEMBER store (`o.f = handler`) or a declared callable-typed field is visible - a same-named plain binding no longer gates it. CAPTURE-EMISSION CHANGE, not fixture growth (fixture_count unchanged). Only drift: `string.Join(\", \", args)` (csharp-variadic-resolution/Utils/Logger.cs) loses `direct-callee-name|Join`; the argument fact itself is unchanged, capture_groups_fp 2657 (unchanged). Prior 2930ef49fdce984a4c051409880bddfe8445e30e1c6bf802bd90a0a0f8f6b094 -> 9c4d2ca55707a03185ea45e554462e81e6d83c9f8d0ea3cd63db5c362ad1bfec.", - "_rebaselined_3486_semantic_rename": "#3486: Compared actual origin/main (191a954b), committed dd3bf and frozen provider source over the same unchanged corpus. 89 constructor-parameter type bindings are added, 46 field declarations become addressable properties, and 3 existing member reads gain receiver-chain tags. Reversing exactly these three changes restores the complete main capture set. Fixture entries 178; changed entries 47; capture groups 2657 -> 2746. Fingerprint regenerated from the runner's canonicalized capture records. Scaling budgets unchanged." + "_rebaselined_3486_semantic_rename": "#3486: Compared actual origin/main (191a954b), committed dd3bf and frozen provider source over the same unchanged corpus. 89 constructor-parameter type bindings are added, 46 field declarations become addressable properties, and 3 existing member reads gain receiver-chain tags. Reversing exactly these three changes restores the complete main capture set. Fixture entries 178; changed entries 47; capture groups 2657 -> 2746. Fingerprint regenerated from the runner's canonicalized capture records. Scaling budgets unchanged.", + "_rebaselined_global_namespace_precedence": "C# global-namespace precedence: fixture growth only. The new csharp-global-namespace-precedence fixture adds 8 files and 94 capture groups; no existing entry changes (the C# capture golden gains only those 8 entries). Capture emission is unchanged. Fixture entries 178 -> 186; capture groups 2746 -> 2840. Prior af724813b5183ad9c98408a9c6944a44897b97d02e7f474ffa4ae637ca9ac1e3 -> 98b066eb5a5d6b5ece83e9fb61cff19cc7bc4b2538f7bddfcd1dc416d1ce4cb4; scaling 1.108 < 1.5.", + "_rebaselined_3498_payee_initializer": "Review follow-up initializes Voucher.Payee in the namespace-precedence fixture. Only this fixture input changes: one constructor capture is added (2840 -> 2841 groups), fixture_count stays186; only the C# fingerprint changes. Current measured synthetic counts4509/14409, scaling1.109 below unchanged1.5; all16 languages remain within budget." }, "rust": { "_lexical_ownership_3532": "#3532: lexical ownership captures and fixture updates; fixture identities are relative to lang-resolution so serialized scope IDs are independent of checkout location. Full capture content remains hashed; scaling_budget is unchanged.", "fingerprint": "7d314a184cba1e5c47260d0a5018107146437f56a2bd183ae0670f0d77a3fbd2", "scaling_budget": 1.5, - "_rebaselined_generic_instantiation_2912": "#2912: RUST_SCOPE_QUERY tags trait-impl heritage with the instantiation the impl was written with (`impl Validator for V`), so interface dispatch can prune implementors of an instantiation the receiver cannot hold. Additive capture text on existing impl matches \u2014 the same matches are minted, carrying one more field \u2014 so this is digest drift, not a capture-set change: capture_groups_fp (3556) and fixture_count (202) are both unchanged, which is the check that no match appeared or vanished. Prior 116a971fee0004f340477aff69fa110a1d92bd8ba882d7c926483c6b1e8ca2b9 -> e61653008ff2de506cfd47f905fa9eb22d82fbbfe94d2a1d8190c358211b57b7; scaling 1.018 < 1.5. Only rust and dart move; the other 13 languages are byte-identical.", - "_rebaselined_mod_node_identity_2745_review": "#2745 review: added rust-2742-mod-members, rust-2742-nested-mods and rust-2742-type-vs-module under lang-resolution for the container/owner-edge fix, nested inline modules, and the imported-type-vs-module precedence. emitRustScopeCaptures is unchanged \u2014 verified by removing ONLY those three fixture dirs and re-running, which reproduces the prior fingerprint exactly, so the shift is purely corpus growth (fixture_count 196 -> 202, capture_groups_fp 3432 -> 3556). Prior 90fda086a4e13aa069a5981f63ed58ab1c71f1ed3da5e1480a080e1992b0d3e5 -> 05acbaca48427e0d9e0793bcd0ce4057712d3716b5e7868189c12e05ef8dd300; scaling 1.022 local / 1.057 CI < 1.5. NOTE for the next fixture author: a new rust-* fixture drifts BOTH this bench baseline and the rust-captures-golden snapshot. Updating only the golden is how this reached CI red.", + "_rebaselined_generic_instantiation_2912": "#2912: RUST_SCOPE_QUERY tags trait-impl heritage with the instantiation the impl was written with (`impl Validator for V`), so interface dispatch can prune implementors of an instantiation the receiver cannot hold. Additive capture text on existing impl matches — the same matches are minted, carrying one more field — so this is digest drift, not a capture-set change: capture_groups_fp (3556) and fixture_count (202) are both unchanged, which is the check that no match appeared or vanished. Prior 116a971fee0004f340477aff69fa110a1d92bd8ba882d7c926483c6b1e8ca2b9 -> e61653008ff2de506cfd47f905fa9eb22d82fbbfe94d2a1d8190c358211b57b7; scaling 1.018 < 1.5. Only rust and dart move; the other 13 languages are byte-identical.", + "_rebaselined_mod_node_identity_2745_review": "#2745 review: added rust-2742-mod-members, rust-2742-nested-mods and rust-2742-type-vs-module under lang-resolution for the container/owner-edge fix, nested inline modules, and the imported-type-vs-module precedence. emitRustScopeCaptures is unchanged — verified by removing ONLY those three fixture dirs and re-running, which reproduces the prior fingerprint exactly, so the shift is purely corpus growth (fixture_count 196 -> 202, capture_groups_fp 3432 -> 3556). Prior 90fda086a4e13aa069a5981f63ed58ab1c71f1ed3da5e1480a080e1992b0d3e5 -> 05acbaca48427e0d9e0793bcd0ce4057712d3716b5e7868189c12e05ef8dd300; scaling 1.022 local / 1.057 CI < 1.5. NOTE for the next fixture author: a new rust-* fixture drifts BOTH this bench baseline and the rust-captures-golden snapshot. Updating only the golden is how this reached CI red.", "_rebaselined_dyn_trait_object_2604": "#2604: RUST_SCOPE_QUERY now captures function_signature_item (abstract trait methods, no body) as a scope + declaration, so a &dyn Trait receiver can dispatch a CALLS edge to the trait's own method. Additive capture shift across every bench fixture with a required trait method. Prior df369c5a5f8de7753fc8bab8b4108ef5081750974ea5085ba9a867675ac9eb29 -> f7742f65f14d7d6590df7f16303fc3cc9dc0c233cd80bf90c98b084933cd3846; scaling 1.033 < 1.5.", "_rebaselined_callable_flow_2522_review": "PR #2522 review hardening: callable operands retain expression/qualified identity and formals retain signature metadata. Prior 65e5bca66bb1ca117949409e8fb5c80ee69d6f1b5318908eaaecf08da0482e5c -> df369c5a5f8de7753fc8bab8b4108ef5081750974ea5085ba9a867675ac9eb29; scaling 1.065 < 1.5.", "_rebaselined_callable_flow_2522_followup": "PR #2522 follow-up: Rust fn-value callable flow facts with invocation/constructor-result suppression. Prior ac610bbe97666bf285923479dd7b43a2fe4c5354aae8df1bcbafdc04fb220f82 -> 65e5bca66bb1ca117949409e8fb5c80ee69d6f1b5318908eaaecf08da0482e5c; scaling 1.024 < 1.5.", - "_rebaselined": "#1956 tri-review U1: rust-qualified-trait fixture (scoped + generic-of-scoped impl trait paths); bareTypeIdentifier now resolves scoped_type_identifier bases by their name: tail (additive, no existing-fixture drift); linear (~1.04). #1975: + rust-scoped-impl fixture (impl a::Inner / b::Inner inherent scoped impls) \u2014 legacy @definition.impl scoped arm + findEnclosingClassInfo inherent-impl scoped target; rust scope-extractor captures byte-identical. | #942: scope-resolution-only cleanup reworded fixture comments; capture byte-positions shift, capture LOGIC unchanged.", - "_note": "PR #1934: F66/F68 let-binding pattern narrowing; F71 union (Struct-labeled, now materialized via legacy @definition.struct + resolvable); F72 macro FULLY WIRED \u2014 @declaration.macro/@reference.macro + MacroRegistry \u2192 USES edges to Macro nodes (never a same-named fn). + rust-macro / rust-union fixtures and merged with origin/main #1975 rust-scoped-impl; fingerprint re-baselined (scaling ~0.99, fixture_count 126). #1992: + rust-nested-tail-collision-generic and rust-generic-impl-same-method-name (F3) fixtures \u2014 pure fixture-corpus drift, no scope-extractor change; fixture_count 127->129, fingerprint 56ffc1c0->b00aea0f.", + "_rebaselined": "#1956 tri-review U1: rust-qualified-trait fixture (scoped + generic-of-scoped impl trait paths); bareTypeIdentifier now resolves scoped_type_identifier bases by their name: tail (additive, no existing-fixture drift); linear (~1.04). #1975: + rust-scoped-impl fixture (impl a::Inner / b::Inner inherent scoped impls) — legacy @definition.impl scoped arm + findEnclosingClassInfo inherent-impl scoped target; rust scope-extractor captures byte-identical. | #942: scope-resolution-only cleanup reworded fixture comments; capture byte-positions shift, capture LOGIC unchanged.", + "_note": "PR #1934: F66/F68 let-binding pattern narrowing; F71 union (Struct-labeled, now materialized via legacy @definition.struct + resolvable); F72 macro FULLY WIRED — @declaration.macro/@reference.macro + MacroRegistry → USES edges to Macro nodes (never a same-named fn). + rust-macro / rust-union fixtures and merged with origin/main #1975 rust-scoped-impl; fingerprint re-baselined (scaling ~0.99, fixture_count 126). #1992: + rust-nested-tail-collision-generic and rust-generic-impl-same-method-name (F3) fixtures — pure fixture-corpus drift, no scope-extractor change; fixture_count 127->129, fingerprint 56ffc1c0->b00aea0f.", "_rebaselined_import_disambiguation_2514": "#2514: added rust-import-* and rust-dup-* fixtures under lang-resolution for the range-binding ambiguity latch + import-disambiguated resolution (for-loops / struct destructuring across explicit/aliased/glob use imports). emitRustScopeCaptures is unchanged; the corpus fingerprint shifts purely because the fixture set grew (130 -> 174). Prior f7742f65f14d7d6590df7f16303fc3cc9dc0c233cd80bf90c98b084933cd3846 -> 655aed01cf1b6b84fa0c64d48dfb2526ecb67f47d90f0a91edabacd269a212db; scaling 1.06 < 1.5.", - "_rebaselined_self_type_binding_2714": "#2714: a Rust `Self` type binding now records the enclosing impl's type instead of the literal 'Self'. `let fresh = Self { .. }` inside `impl User` binds `fresh: User`; recorded verbatim it bound `fresh: Self`, which resolves to nothing. The type-env channel already substituted this (type-extractors/rust.ts findEnclosingImplType); the scope-resolution channel did not, so the two disagreed. The gap was invisible while lookupCore Step 1 still walked the lexical chain for NAMED receivers \u2014 the impl scope binds the method by name, so fresh.validate() resolved by accident \u2014 and became a lost CALLS edge when #2714 stopped that walk. Only the rust fingerprint moves; the other 14 languages are byte-identical.", + "_rebaselined_self_type_binding_2714": "#2714: a Rust `Self` type binding now records the enclosing impl's type instead of the literal 'Self'. `let fresh = Self { .. }` inside `impl User` binds `fresh: User`; recorded verbatim it bound `fresh: Self`, which resolves to nothing. The type-env channel already substituted this (type-extractors/rust.ts findEnclosingImplType); the scope-resolution channel did not, so the two disagreed. The gap was invisible while lookupCore Step 1 still walked the lexical chain for NAMED receivers — the impl scope binds the method by name, so fresh.validate() resolved by accident — and became a lost CALLS edge when #2714 stopped that walk. Only the rust fingerprint moves; the other 14 languages are byte-identical.", "_rebaselined_module_tree_2730": "#2730 + #2741 review: RUST_SCOPE_QUERY captures mod_item as @declaration.namespace (a Rust module is an item, mirroring the C++ namespace_definition capture) and tags scoped call sites with @reference.qualified-name so the written path survives to resolution. Both are additive captures: every bench fixture holding a mod block or a Foo::bar() call gains groups, and the corpus also grew by the rust-2730-* fixtures added for the fix and its review (workspace-crates, type-qualified, gaps, samename-wrapper, crate-layout). Prior 7f1240b38457468f06b7931e0c2c578f218f922774d0dc7e2ee6ef3b08d4d689 -> 90fda086a4e13aa069a5981f63ed58ab1c71f1ed3da5e1480a080e1992b0d3e5; scaling 1.061 < 1.5; fixture_count 196. Only the rust fingerprint moves; the other 14 languages are byte-identical. The earlier revision of this note cited 655aed01... as the prior value, which was two rebaselines stale (it predates #2604 and #2714); the CI gate compares live fingerprints, not this prose, so nothing caught it.", - "_rebaselined_receiver_chain_2747": "#2747 receiver-chain rollout: call matches whose receiver is itself an expression now carry `@reference.receiver-chain`, a compact encoding of the receiver's structure, so resolution types it by folding instead of re-parsing receiver source text. Capture GROUP counts are unchanged \u2014 the tag is added to existing call matches, never a new match \u2014 so this is digest drift only. Prior 05acbaca48427e0d9e0793bcd0ce4057712d3716b5e7868189c12e05ef8dd300 -> 83812d82f0e2c3eb552f3246381ca3dd5ccd6783d63aba3325f1343e7772280c.", - "_rebaselined_2766_receiver_chain_wire_v2": "#2766: receiver-chain wire format v1 -> v2 (name-free `await` / `index` step kinds). The VERSION prefix is part of every emitted `@reference.receiver-chain` capture, so every chain-minting language's capture text changed. WIRE-FORMAT CHANGE, NOT A CAPTURE-SET CHANGE: the same chains are minted for the same sites, spelled `2|\u2026` instead of `1|\u2026`. Exactly the 12 chain-minting languages drifted; c, cobol and dart did not, which is the check that this is the prefix and not a capture regression. Accompanied by SCHEMA_BUMP 34 -> 37 and INCREMENTAL_SCHEMA_VERSION 28 -> 31 so a stale index is rejected rather than replaying chains a v2 decoder refuses. Prior 83812d82f0e2c3eb552f3246381ca3dd5ccd6783d63aba3325f1343e7772280c -> 6174889b8c98e0af430fa54c268dc781989ca9a8172d690eebae37a95f77e809.", + "_rebaselined_receiver_chain_2747": "#2747 receiver-chain rollout: call matches whose receiver is itself an expression now carry `@reference.receiver-chain`, a compact encoding of the receiver's structure, so resolution types it by folding instead of re-parsing receiver source text. Capture GROUP counts are unchanged — the tag is added to existing call matches, never a new match — so this is digest drift only. Prior 05acbaca48427e0d9e0793bcd0ce4057712d3716b5e7868189c12e05ef8dd300 -> 83812d82f0e2c3eb552f3246381ca3dd5ccd6783d63aba3325f1343e7772280c.", + "_rebaselined_2766_receiver_chain_wire_v2": "#2766: receiver-chain wire format v1 -> v2 (name-free `await` / `index` step kinds). The VERSION prefix is part of every emitted `@reference.receiver-chain` capture, so every chain-minting language's capture text changed. WIRE-FORMAT CHANGE, NOT A CAPTURE-SET CHANGE: the same chains are minted for the same sites, spelled `2|…` instead of `1|…`. Exactly the 12 chain-minting languages drifted; c, cobol and dart did not, which is the check that this is the prefix and not a capture regression. Accompanied by SCHEMA_BUMP 34 -> 37 and INCREMENTAL_SCHEMA_VERSION 28 -> 31 so a stale index is rejected rather than replaying chains a v2 decoder refuses. Prior 83812d82f0e2c3eb552f3246381ca3dd5ccd6783d63aba3325f1343e7772280c -> 6174889b8c98e0af430fa54c268dc781989ca9a8172d690eebae37a95f77e809.", "capture_groups_small": 5507, "capture_groups_large": 17607, "capture_groups_fp": 3556, @@ -115,9 +117,9 @@ "_rebaselined_callable_flow_2522_review": "PR #2522 review hardening: callable operands retain expression/qualified identity and formals retain signature metadata. Prior df7b1565f9115d66b1ae32e4a408d651afb2521b14e5ca615f3be426c29af618 -> 4a688fa5a7016546f7f3c6d44de023608ae80c5b0e3670c16f6e61b3632608fd; scaling 1.078 < 1.5.", "_rebaselined_callable_flow_2522_followup": "PR #2522 follow-up: PHP first-class callable and variable-invocation flow facts with invocation-result suppression. Prior 31c9e3f3cb7094a2bf9021cf9db859036e002f8b44605cd993b470fc600e97cb -> df7b1565f9115d66b1ae32e4a408d651afb2521b14e5ca615f3be426c29af618; scaling 1.074 < 1.5.", "_rebaselined": "#1956: heritage-bearing scale source (class extends Base + use trait); both forms gated at scale; linear (~1.04). | #2481/#2482: PHP imports carry a symbol-kind capture so function/constant imports resolve by declaring file; capture shape changes, scaling remains linear (~1.04).", - "_note": "PR #1931: F53 import multi-clause, F54 enum_case, F55 anonymous_class \u2014 fixture count 138\u2192140, fingerprint drift expected.", - "_rebaselined_receiver_chain_2747": "#2747 receiver-chain rollout: call matches whose receiver is itself an expression now carry `@reference.receiver-chain`, a compact encoding of the receiver's structure, so resolution types it by folding instead of re-parsing receiver source text. Capture GROUP counts are unchanged \u2014 the tag is added to existing call matches, never a new match \u2014 so this is digest drift only. Prior 4a688fa5a7016546f7f3c6d44de023608ae80c5b0e3670c16f6e61b3632608fd -> 3745662053c76b6ae0a84a29aad319626ed5ccb88f7b9376c2680d3dc6502e28.", - "_rebaselined_2766_receiver_chain_wire_v2": "#2766: receiver-chain wire format v1 -> v2 (name-free `await` / `index` step kinds). The VERSION prefix is part of every emitted `@reference.receiver-chain` capture, so every chain-minting language's capture text changed. WIRE-FORMAT CHANGE, NOT A CAPTURE-SET CHANGE: the same chains are minted for the same sites, spelled `2|\u2026` instead of `1|\u2026`. Exactly the 12 chain-minting languages drifted; c, cobol and dart did not, which is the check that this is the prefix and not a capture regression. Accompanied by SCHEMA_BUMP 34 -> 37 and INCREMENTAL_SCHEMA_VERSION 28 -> 31 so a stale index is rejected rather than replaying chains a v2 decoder refuses. Prior 3745662053c76b6ae0a84a29aad319626ed5ccb88f7b9376c2680d3dc6502e28 -> b213a872342da2d866b04681dede988770e4d3dfdc0d6e9f62212ec5b59cdc2c.", + "_note": "PR #1931: F53 import multi-clause, F54 enum_case, F55 anonymous_class — fixture count 138→140, fingerprint drift expected.", + "_rebaselined_receiver_chain_2747": "#2747 receiver-chain rollout: call matches whose receiver is itself an expression now carry `@reference.receiver-chain`, a compact encoding of the receiver's structure, so resolution types it by folding instead of re-parsing receiver source text. Capture GROUP counts are unchanged — the tag is added to existing call matches, never a new match — so this is digest drift only. Prior 4a688fa5a7016546f7f3c6d44de023608ae80c5b0e3670c16f6e61b3632608fd -> 3745662053c76b6ae0a84a29aad319626ed5ccb88f7b9376c2680d3dc6502e28.", + "_rebaselined_2766_receiver_chain_wire_v2": "#2766: receiver-chain wire format v1 -> v2 (name-free `await` / `index` step kinds). The VERSION prefix is part of every emitted `@reference.receiver-chain` capture, so every chain-minting language's capture text changed. WIRE-FORMAT CHANGE, NOT A CAPTURE-SET CHANGE: the same chains are minted for the same sites, spelled `2|…` instead of `1|…`. Exactly the 12 chain-minting languages drifted; c, cobol and dart did not, which is the check that this is the prefix and not a capture regression. Accompanied by SCHEMA_BUMP 34 -> 37 and INCREMENTAL_SCHEMA_VERSION 28 -> 31 so a stale index is rejected rather than replaying chains a v2 decoder refuses. Prior 3745662053c76b6ae0a84a29aad319626ed5ccb88f7b9376c2680d3dc6502e28 -> b213a872342da2d866b04681dede988770e4d3dfdc0d6e9f62212ec5b59cdc2c.", "_rebaselined_3486_semantic_rename": "#3486: Compared actual origin/main (191a954b), committed dd3bf and frozen provider source over the same unchanged corpus. The existing php-use-function-const/app/Config/constants.php fixture now captures its MAX_RETRIES declaration. Its one new declaration group is the entire delta. Fixture entries 143; changed entries 1; capture groups 2241 -> 2242. Fingerprint regenerated from the runner's canonicalized capture records. Scaling budgets unchanged." }, "ruby": { @@ -128,10 +130,10 @@ "_rebaselined_callable_flow_2522_review": "PR #2522 review hardening: callable operands retain expression/qualified identity and formals retain signature metadata. Prior cff273ae6cb7232c977d9241581834a2a2fa8bcf6369f7bd8f2471cd4419a6ef -> bf50ec6a53c8c91680dc6feac63a8956e78b1059249232dc25a0cfed25f31236; scaling 1.103 < 1.5.", "_rebaselined_callable_flow_2522_followup": "PR #2522 follow-up: Ruby Method/Proc callable flow facts with invocation/constructor-result suppression. Prior b5ea93bb3d0469c3821a8c70f5d5991c6f326e41097c119ad691154301dcc753 -> cff273ae6cb7232c977d9241581834a2a2fa8bcf6369f7bd8f2471cd4419a6ef; scaling 1.086 < 1.5.", "_rebaselined": "#1956 synth-widening: + ruby-qualified-base fixture; synth now reduces a scope_resolution superclass (class C < Mod::Super) to its trailing constant (matching the #1940 legacy leg), at parity. Linear (~1.03). (Earlier #1956: heritage-bearing scale source.) | #942: scope-resolution-only cleanup reworded fixture comments; capture byte-positions shift, capture LOGIC unchanged.", - "_note": "F62: + scope_resolution class/module declaration captures \u2014 fixture count 78\u219281, fingerprint drift expected. #1975: + ruby-tail-collision fixture (Foo::Bar vs Baz::Bar stay distinct nodes) \u2014 pure fixture-corpus drift, scope-extractor captures unchanged; 81\u219282. #1991: + ruby-nested-mixin-tail-collision fixture (85\u219286). Recomputed on the #942 merge (fixture-comment rewording shifts capture byte-positions, capture LOGIC unchanged): bf6b13a -> b5ea93bb.", + "_note": "F62: + scope_resolution class/module declaration captures — fixture count 78→81, fingerprint drift expected. #1975: + ruby-tail-collision fixture (Foo::Bar vs Baz::Bar stay distinct nodes) — pure fixture-corpus drift, scope-extractor captures unchanged; 81→82. #1991: + ruby-nested-mixin-tail-collision fixture (85→86). Recomputed on the #942 merge (fixture-comment rewording shifts capture byte-positions, capture LOGIC unchanged): bf6b13a -> b5ea93bb.", "_rebaselined_2522_review_fixes": "PR #2522 review fixes: bare identifiers are calls, not callable references (bareNamesAreCalls). Prior bf50ec6a53c8c91680dc6feac63a8956e78b1059249232dc25a0cfed25f31236 -> 070e4e11502442998ddf4048c2981cf1b2b735a87362ff854c5d14d71f98f4e2; scaling ratio re-verified within budget.", - "_rebaselined_receiver_chain_2747": "#2747 receiver-chain rollout: call matches whose receiver is itself an expression now carry `@reference.receiver-chain`, a compact encoding of the receiver's structure, so resolution types it by folding instead of re-parsing receiver source text. Capture GROUP counts are unchanged \u2014 the tag is added to existing call matches, never a new match \u2014 so this is digest drift only. Prior fea3edf82f521995147874b7f6c5f9e2eb88efdebf6365668f3260e913f0b558 -> fc81941b0a921074fa80dc448284de9a23bd07358ddc84d4894797cc08c3fe83.", - "_rebaselined_2766_receiver_chain_wire_v2": "#2766: receiver-chain wire format v1 -> v2 (name-free `await` / `index` step kinds). The VERSION prefix is part of every emitted `@reference.receiver-chain` capture, so every chain-minting language's capture text changed. WIRE-FORMAT CHANGE, NOT A CAPTURE-SET CHANGE: the same chains are minted for the same sites, spelled `2|\u2026` instead of `1|\u2026`. Exactly the 12 chain-minting languages drifted; c, cobol and dart did not, which is the check that this is the prefix and not a capture regression. Accompanied by SCHEMA_BUMP 34 -> 37 and INCREMENTAL_SCHEMA_VERSION 28 -> 31 so a stale index is rejected rather than replaying chains a v2 decoder refuses. Prior fc81941b0a921074fa80dc448284de9a23bd07358ddc84d4894797cc08c3fe83 -> 1c8c9c4b54036fa24c2a81e39ea530e938645c856d369075e5f437da78218c57.", + "_rebaselined_receiver_chain_2747": "#2747 receiver-chain rollout: call matches whose receiver is itself an expression now carry `@reference.receiver-chain`, a compact encoding of the receiver's structure, so resolution types it by folding instead of re-parsing receiver source text. Capture GROUP counts are unchanged — the tag is added to existing call matches, never a new match — so this is digest drift only. Prior fea3edf82f521995147874b7f6c5f9e2eb88efdebf6365668f3260e913f0b558 -> fc81941b0a921074fa80dc448284de9a23bd07358ddc84d4894797cc08c3fe83.", + "_rebaselined_2766_receiver_chain_wire_v2": "#2766: receiver-chain wire format v1 -> v2 (name-free `await` / `index` step kinds). The VERSION prefix is part of every emitted `@reference.receiver-chain` capture, so every chain-minting language's capture text changed. WIRE-FORMAT CHANGE, NOT A CAPTURE-SET CHANGE: the same chains are minted for the same sites, spelled `2|…` instead of `1|…`. Exactly the 12 chain-minting languages drifted; c, cobol and dart did not, which is the check that this is the prefix and not a capture regression. Accompanied by SCHEMA_BUMP 34 -> 37 and INCREMENTAL_SCHEMA_VERSION 28 -> 31 so a stale index is rejected rather than replaying chains a v2 decoder refuses. Prior fc81941b0a921074fa80dc448284de9a23bd07358ddc84d4894797cc08c3fe83 -> 1c8c9c4b54036fa24c2a81e39ea530e938645c856d369075e5f437da78218c57.", "_rebaselined_3354_callable_alternatives": "#3354 callable alternatives: a callable chosen by a value-selecting source now flows every branch it can yield (`a ?? b`, `a || b`, `a or b`, `c ? a : b`, statement `if`, elvis), and an operator branch (`x == f || g`) stays opaque instead of seeding a qualified name. Verified by running the BASE (merge-base 233ca2849) and HEAD emitters over the SAME HEAD fixture corpus: every added or removed match is an `@callable-flow.*` match on one of those sources, and the pre-existing corpus is byte-identical (all other languages: zero delta). The rest of the drift is corpus growth from this PR's regression fixture, which this bench globs. Corpus growth: ruby-callable-alternatives/app.rb (+1 file, +58 groups). Emitter delta: +5 / -0: seeds for single-statement `if` / `elsif` branches (run_then, run_else, run_sweep, run_a, run_b); the multi-statement branch contributes nothing. capture_groups_fp 1358 -> 1416, fixture_count 91 -> 92; synthetic counts unchanged; scaling 1.04 < 1.5. Prior 1c8c9c4b54036fa24c2a81e39ea530e938645c856d369075e5f437da78218c57 -> 45e65d9fa8a9e5e905ddb596b179b77c86ed13ab5139c6b17ccaaf7315dfe46a.", "capture_groups_small": 3011, "capture_groups_large": 9611, @@ -151,8 +153,8 @@ "_rebaselined_callable_flow_2522_followup": "PR #2522 follow-up: Swift function-value callable flow facts with invocation-result suppression. Prior 180ac68e780bdf6f9089d53f51cbb9a66aed3e7774631cc3fcbaae5020213998 -> 5f923c6604d825d12b249f31c155b0f4d13a8379d532e5dde64a0f9b15cf4725; scaling 1.043 < 1.5.", "_rebaselined": "#1919 open-language coverage: new lang-resolution fixtures + intended capture additions (F5/F9 c-cpp, F26/F28/F29 dart, F47/F48/F49/F51/F52 kotlin, F75/F79 swift). Fingerprint-only drift; scaling_ratio ~1.0 (linear, no perf regression).", "_rebaselined_2522_review_fixes": "PR #2522 review fixes: assignment target:/result: fields join the shared fallback. Prior 7687ee2466e16020a12440a03fbda53e63aa05f94b4481f6133c09867a0d560d -> 115c5da807e36bb12fdeba28e44f2b6484ef322ff26c19fa0f191febaf774248; scaling ratio re-verified within budget.", - "_rebaselined_receiver_chain_2747": "#2747 receiver-chain rollout: call matches whose receiver is itself an expression now carry `@reference.receiver-chain`, a compact encoding of the receiver's structure, so resolution types it by folding instead of re-parsing receiver source text. Capture GROUP counts are unchanged \u2014 the tag is added to existing call matches, never a new match \u2014 so this is digest drift only. Prior 115c5da807e36bb12fdeba28e44f2b6484ef322ff26c19fa0f191febaf774248 -> a6fca5f052ae5ec635b56051e28a168c864a988b2221a3279ddd69807378ba0b.", - "_rebaselined_2766_receiver_chain_wire_v2": "#2766: receiver-chain wire format v1 -> v2 (name-free `await` / `index` step kinds). The VERSION prefix is part of every emitted `@reference.receiver-chain` capture, so every chain-minting language's capture text changed. WIRE-FORMAT CHANGE, NOT A CAPTURE-SET CHANGE: the same chains are minted for the same sites, spelled `2|\u2026` instead of `1|\u2026`. Exactly the 12 chain-minting languages drifted; c, cobol and dart did not, which is the check that this is the prefix and not a capture regression. Accompanied by SCHEMA_BUMP 34 -> 37 and INCREMENTAL_SCHEMA_VERSION 28 -> 31 so a stale index is rejected rather than replaying chains a v2 decoder refuses. Prior a6fca5f052ae5ec635b56051e28a168c864a988b2221a3279ddd69807378ba0b -> 2f04ae960123cf50138a49fabdc5a146c2963170cecf5755c552b23c9055a9e7.", + "_rebaselined_receiver_chain_2747": "#2747 receiver-chain rollout: call matches whose receiver is itself an expression now carry `@reference.receiver-chain`, a compact encoding of the receiver's structure, so resolution types it by folding instead of re-parsing receiver source text. Capture GROUP counts are unchanged — the tag is added to existing call matches, never a new match — so this is digest drift only. Prior 115c5da807e36bb12fdeba28e44f2b6484ef322ff26c19fa0f191febaf774248 -> a6fca5f052ae5ec635b56051e28a168c864a988b2221a3279ddd69807378ba0b.", + "_rebaselined_2766_receiver_chain_wire_v2": "#2766: receiver-chain wire format v1 -> v2 (name-free `await` / `index` step kinds). The VERSION prefix is part of every emitted `@reference.receiver-chain` capture, so every chain-minting language's capture text changed. WIRE-FORMAT CHANGE, NOT A CAPTURE-SET CHANGE: the same chains are minted for the same sites, spelled `2|…` instead of `1|…`. Exactly the 12 chain-minting languages drifted; c, cobol and dart did not, which is the check that this is the prefix and not a capture regression. Accompanied by SCHEMA_BUMP 34 -> 37 and INCREMENTAL_SCHEMA_VERSION 28 -> 31 so a stale index is rejected rather than replaying chains a v2 decoder refuses. Prior a6fca5f052ae5ec635b56051e28a168c864a988b2221a3279ddd69807378ba0b -> 2f04ae960123cf50138a49fabdc5a146c2963170cecf5755c552b23c9055a9e7.", "_rebaselined_inferred_field_receiver_2807": "#2807: optional property annotations (`var a: Outer?`) now emit a type binding. The prior pattern required the `user_type` to be a DIRECT child of the annotation, so an `optional_type` wrapper meant an optional field was never typed at all and its receiver could not resolve. ADDS @type-binding.annotation captures on the optional form only; no capture is removed. Prior 2f04ae960123cf50138a49fabdc5a146c2963170cecf5755c552b23c9055a9e7 -> adef9284feaecd39cb490aebce83876e15b9150c7a04b00a396feb78b7e1e0a9; scaling 1.023 < 1.5.", "_rebaselined_nested_constructor_3262": "#3262: the existing nested-constructor fixture now uses the qualified legal form `extension Outer.Container`, covering full extension-owner recovery. Fixture-only capture drift; no capture logic changed. Prior adef9284feaecd39cb490aebce83876e15b9150c7a04b00a396feb78b7e1e0a9 -> 3ac80b64776969effb75c8d32aa0bc38fc6a41c6c115a33829c502559fa404f9; scaling 1.025 < 1.5.", "_rebaselined_3309_call_result_assignment": "#3309: the Swift protocol-extension regression fixture adds one file with an untyped local initialized from a helper call, plus a compound-field receiver call. The capture query is unchanged; this is fixture-corpus growth only. capture_groups_fp 1235 -> 1272 and fixture_count 62 -> 64; synthetic scale counts remain 5012/16012. Prior adef9284feaecd39cb490aebce83876e15b9150c7a04b00a396feb78b7e1e0a9 -> 4d32535d454cd79086f0fcaec3b75de855c1314e73630321460e569f19aa484f; measured scaling 1.020 < 1.5.", @@ -166,7 +168,7 @@ "fingerprint": "1c5b892a136318eddee3435225284896c2effb52dd51ca5717c92887ae4a39a3", "scaling_budget": 1.5, "_rebaselined_2963_package_imports": "#3369 package-import fixtures: dart-package-imports adds six .dart files. CORPUS GROWTH ONLY, NOT A CAPTURE CHANGE: parking that directory restores 795290a9524ee0dc38af635536e9744c401ec13828ec77822d39e59e1cd6e649 byte-for-byte. The six files contribute 33 capture groups (862 -> 895) and fixture_count 37 -> 43. Synthetic scale counts stay 5011/16011. Local scaling 1.091 < 1.5. Prior 795290a9524ee0dc38af635536e9744c401ec13828ec77822d39e59e1cd6e649 -> f4edcfedb6e97def5ffbb9d3227fce2549e5c6c6cc876a05bc3b68a46ed30c24.", - "_rebaselined_generic_instantiation_2912": "#2912: the Dart heritage marker carries a fourth field \u2014 the type arguments the clause was written with (`implements Validator`) \u2014 so interface dispatch can prune implementors of a mismatched instantiation. Additive marker text on existing heritage matches rather than a new match, so this is digest drift only; a marker from a pre-#2912 cache simply has no fourth field and reads as unknown. Prior ba93c90dcd341259e8e088816bc8c76ad27882419f665e35c056dc22fa54cf73 -> 3a8ddabbeb1cba47a4757451d4f79d726ca230fd15e860772b11526fbb1c6687; scaling 1.027 < 1.5.", + "_rebaselined_generic_instantiation_2912": "#2912: the Dart heritage marker carries a fourth field — the type arguments the clause was written with (`implements Validator`) — so interface dispatch can prune implementors of a mismatched instantiation. Additive marker text on existing heritage matches rather than a new match, so this is digest drift only; a marker from a pre-#2912 cache simply has no fourth field and reads as unknown. Prior ba93c90dcd341259e8e088816bc8c76ad27882419f665e35c056dc22fa54cf73 -> 3a8ddabbeb1cba47a4757451d4f79d726ca230fd15e860772b11526fbb1c6687; scaling 1.027 < 1.5.", "_rebaselined_2538": "#2538: Dart extension type headers are preprocessed into normal extension declarations before scope capture, so extension type symbols and their methods are now emitted. Intentional Dart-only capture fingerprint drift; CI measured scaling 1.042 < 1.5.", "_rebaselined_2538_implements": "#2538 tri-review follow-up: Dart extension type implements clauses now emit heritage markers and fixture coverage asserts IMPLEMENTS edges, including multi-arg generic interfaces. Prior committed baseline 66a46d5ff09f3d11b2771db0f48596fe7057e95c5bc8f56241fdb911137298c3 -> ba93c90dcd341259e8e088816bc8c76ad27882419f665e35c056dc22fa54cf73; scaling 0.945 < 1.5.", "_rebaselined_callable_flow_2522_review": "PR #2522 review hardening: callable operands retain expression/qualified identity and formals retain signature metadata. Prior 29ce2bfe70b246b1c9d5e99c0ec11e850c22e9672737592207242b7f4cc824b8 -> 66a46d5ff09f3d11b2771db0f48596fe7057e95c5bc8f56241fdb911137298c3; scaling 1.054 < 1.5.", @@ -187,7 +189,7 @@ "_rebaselined_2900_record_heritage": "#2900 review follow-up: the Java scale unit now includes a record implementing Marker, so the record-declaration @reference.inherits path is fingerprinted and exercised at scale. Prior b29e263524f55151dcb7cfc4c929d3d1d7bb360355cee4e832158f927857f663 -> 36d689c58526c4482fbd701d1d9ca156623a3970734ead145717858712271ab5; scaling 1.042 < 1.5.", "_rebaselined_callable_flow_2522_review": "PR #2522 review hardening: callable operands retain expression/qualified identity and formals retain signature metadata; same-name lexical regions use an O(ancestor-depth) ID-set lookup. Prior d5c59d7dc9e206637515d5aea1163f7c1cdd76410c38c5fe6143d13d19677d6a -> 004a3592998dca1193bd1429a8284513725de7764f2a3eceedaaa984cfd763b4; scaling 0.992 < 1.5.", "_rebaselined_callable_flow_2522_followup": "PR #2522 follow-up: Java method-reference/SAM callable flow facts with invocation-result suppression. Prior 062d754764aaa8a6772fb90875c710502a63e3e7a300e633942381ed914faada -> d5c59d7dc9e206637515d5aea1163f7c1cdd76410c38c5fe6143d13d19677d6a; scaling 1.074 < 1.5.", - "_rebaselined": "#2357 (supersedes #2353): + java-cast-receiver, java-this-field-chain, java-this-dispatch fixtures (cast-wrapped receivers, this.field chains incl. initializer contexts, bare-this dispatch pinning). Drift is purely fixture-additive: with the three new dirs parked, the fingerprint reproduces the prior baseline byte-identically \u2014 no emit/capture change. #1956 synth-widening: + java-iface-extends fixture; synthesizeJavaInheritanceReferences now ALSO walks interface_declaration extends_interfaces (interface IA extends IB, IC), matching the #1940 legacy leg. (Earlier U2+review: java-qualified-base fixture covers 2- AND 3-segment qualified bases guarding the legacy end-anchor; synth tail-resolves scoped bases.) Linear (~1.03). (Earliest: java added to bench, exposed+fixed the O(n^2) findNodeAtRange root-walk; 3.09 -> ~0.99.) | #942: scope-resolution-only cleanup reworded fixture comments; capture byte-positions shift, capture LOGIC unchanged.", + "_rebaselined": "#2357 (supersedes #2353): + java-cast-receiver, java-this-field-chain, java-this-dispatch fixtures (cast-wrapped receivers, this.field chains incl. initializer contexts, bare-this dispatch pinning). Drift is purely fixture-additive: with the three new dirs parked, the fingerprint reproduces the prior baseline byte-identically — no emit/capture change. #1956 synth-widening: + java-iface-extends fixture; synthesizeJavaInheritanceReferences now ALSO walks interface_declaration extends_interfaces (interface IA extends IB, IC), matching the #1940 legacy leg. (Earlier U2+review: java-qualified-base fixture covers 2- AND 3-segment qualified bases guarding the legacy end-anchor; synth tail-resolves scoped bases.) Linear (~1.03). (Earliest: java added to bench, exposed+fixed the O(n^2) findNodeAtRange root-walk; 3.09 -> ~0.99.) | #942: scope-resolution-only cleanup reworded fixture comments; capture byte-positions shift, capture LOGIC unchanged.", "_note": "#1928 / #2045: F35 adds qualified + qualified-generic constructor query captures (`new pkg.Foo()`, `new a.b.Foo()`, `new pkg.Box()`); F38 synthesizes `@reference.call.constructor` on `super(...)`/`this(...)` explicit_constructor_invocation nodes; F41 generic-aware stripQualifier in interpret (type-binding normalization). + java-qualified-constructor and java-explicit-constructor fixtures. Pure capture-additive + fixture-corpus drift; scaling stays linear (~1.06).", "_rebaselined_2522_review_fixes": "PR #2522 review fixes: get/test dropped from callableProtocolMethods. Prior 004a3592998dca1193bd1429a8284513725de7764f2a3eceedaaa984cfd763b4 -> f3b4f4b6610e07c3ac90deb1c53d3572b6ad55a36e5d7134984876d30031ff67; scaling ratio re-verified within budget.", "_rebaselined_2550_instance_model": "PR #2549 (#2550): anonymous class bodies emit synthesized @declaration.class/@declaration.name (Worker$N), an @reference.inherits to the constructed type, and receiver @type-binding.* captures; six new java-* fixtures joined the corpus. Prior f3b4f4b6610e07c3ac90deb1c53d3572b6ad55a36e5d7134984876d30031ff67 -> d79c3b92acfc866094981499b977388ca14f90839bca0c040342ab1cec00aa90; scaling 1.058 < 1.5.", @@ -195,8 +197,8 @@ "_rebaselined_2564_record_capture": "PR for #2564: JAVA_QUERIES gained a (record_declaration name: (identifier) @name) @definition.record capture, previously entirely missing (record_declaration had no structure-phase capture at all, unlike class/interface/enum) - a record's methods existed as ownerless Method nodes with no HAS_METHOD edge. Two new java-* fixtures (java-record-methods, java-new-expr-chain-call) joined the corpus. Prior 975b68aaac6d06094260fb0c67f9b1bc03692ba7220669d192aca9dccd5fc0ca -> 85fc7af9c3c1bceac76cb4f27214410b04967682a2eaa7e468e26efd1f4e2537; scaling 1.059 < 1.5.", "_rebaselined_2561_enum_constant_receiver": "PR for #2561: synthesizeJavaAnonymousClassDeclarations now emits a class-scope @type-binding.annotation/name/type per enum constant (constant simple name -> its E$N synthesized class when bodied, else the host enum) so E.CONST.method() resolves through the existing compound-receiver chain walk. Two drivers of the drift, both in the java-enum-constant-body fixture (this bench's corpus IS test/fixtures/lang-resolution): (1) one extra type-binding match per enum_constant from the capture change; (2) review follow-up added a body-less Plain.java enum + EnumConst.dispatchToConstant/dispatchInherited methods (bodied-override, inherited-via-MRO, and body-less dispatch call sites). The review's fail-safe hardening (bodied constant binds ONLY to E$N, never the host enum, when name synthesis fails on a malformed tree) is output-neutral on this well-formed corpus (verified: fingerprint identical with and without it). Prior 85fc7af9c3c1bceac76cb4f27214410b04967682a2eaa7e468e26efd1f4e2537 -> d04298a91beec76d0fa7099b3d71265723be60c1df688969aa954f135dd49686; scaling < 1.5.", "_rebaselined_2562_local_classes": "#2562: Java block-local classes, enums, records, and interfaces use source-type-relative JLS 13.1 Host$NLocal identities with javac-compatible per-(host, simple-name) numbering; anonymous numbering remains separate. Lexical aliases begin at each declaration and end with its immediate block. Expanded java-local-class-naming fixtures cover declaration order, disjoint blocks, initializers, lambdas, local type kinds, and recursive local/member/anonymous host chains. Prior d04298a91beec76d0fa7099b3d71265723be60c1df688969aa954f135dd49686 -> 6dd5913a58400a191ff54abf9b852b03d5add657d16c11e60a7c4608ba186197; scaling 1.204 < 1.5.", - "_rebaselined_receiver_chain_2747": "#2747 receiver-chain rollout: call matches whose receiver is itself an expression now carry `@reference.receiver-chain`, a compact encoding of the receiver's structure, so resolution types it by folding instead of re-parsing receiver source text. Capture GROUP counts are unchanged \u2014 the tag is added to existing call matches, never a new match \u2014 so this is digest drift only. Prior 6dd5913a58400a191ff54abf9b852b03d5add657d16c11e60a7c4608ba186197 -> 310adbc2e0827b5ac749acaa981cd12d256fc5b7cbc5592c5bee219e92abf9ee.", - "_rebaselined_2766_receiver_chain_wire_v2": "#2766: receiver-chain wire format v1 -> v2 (name-free `await` / `index` step kinds). The VERSION prefix is part of every emitted `@reference.receiver-chain` capture, so every chain-minting language's capture text changed. WIRE-FORMAT CHANGE, NOT A CAPTURE-SET CHANGE: the same chains are minted for the same sites, spelled `2|\u2026` instead of `1|\u2026`. Exactly the 12 chain-minting languages drifted; c, cobol and dart did not, which is the check that this is the prefix and not a capture regression. Accompanied by SCHEMA_BUMP 34 -> 37 and INCREMENTAL_SCHEMA_VERSION 28 -> 31 so a stale index is rejected rather than replaying chains a v2 decoder refuses. Prior 310adbc2e0827b5ac749acaa981cd12d256fc5b7cbc5592c5bee219e92abf9ee -> a9943355e945e03ddb87c800f4cc1f62b3d04feefb3ec64c258d8e0bb3b3fcd9.", + "_rebaselined_receiver_chain_2747": "#2747 receiver-chain rollout: call matches whose receiver is itself an expression now carry `@reference.receiver-chain`, a compact encoding of the receiver's structure, so resolution types it by folding instead of re-parsing receiver source text. Capture GROUP counts are unchanged — the tag is added to existing call matches, never a new match — so this is digest drift only. Prior 6dd5913a58400a191ff54abf9b852b03d5add657d16c11e60a7c4608ba186197 -> 310adbc2e0827b5ac749acaa981cd12d256fc5b7cbc5592c5bee219e92abf9ee.", + "_rebaselined_2766_receiver_chain_wire_v2": "#2766: receiver-chain wire format v1 -> v2 (name-free `await` / `index` step kinds). The VERSION prefix is part of every emitted `@reference.receiver-chain` capture, so every chain-minting language's capture text changed. WIRE-FORMAT CHANGE, NOT A CAPTURE-SET CHANGE: the same chains are minted for the same sites, spelled `2|…` instead of `1|…`. Exactly the 12 chain-minting languages drifted; c, cobol and dart did not, which is the check that this is the prefix and not a capture regression. Accompanied by SCHEMA_BUMP 34 -> 37 and INCREMENTAL_SCHEMA_VERSION 28 -> 31 so a stale index is rejected rather than replaying chains a v2 decoder refuses. Prior 310adbc2e0827b5ac749acaa981cd12d256fc5b7cbc5592c5bee219e92abf9ee -> a9943355e945e03ddb87c800f4cc1f62b3d04feefb3ec64c258d8e0bb3b3fcd9.", "capture_groups_small": 6255, "capture_groups_large": 20005, "capture_groups_fp": 3586, @@ -210,8 +212,8 @@ "_rebaselined_2935_synthetic_declarations": "PR #2935 review follow-up: the local-type stress corpus includes synthesized anonymous declarations, which now carry the presence-only @declaration.is-synthetic sidecar. DIGEST DRIFT ONLY, NOT A CAPTURE-SET CHANGE. Prior 8c50bbc83dff4f7f5abd06078aa6abc6b64af05fddb17ee826b5f3df3d346633 -> 560734cd053fb4f4b23aa04bc7870c22089a8deedb0217fa9c1b4db689e02a97; CI scaling 1.002 < 1.5.", "_rebaselined_2917_record_component_accessors": "#2917: the focused local-type fixture corpus contains local records, so their implicit component accessors add the same bounded scope/declaration captures as the general Java corpus. No local-type naming logic changed. Prior 8c50bbc83dff4f7f5abd06078aa6abc6b64af05fddb17ee826b5f3df3d346633 -> 3e22f368a4ee139be7cb91ff4fb77ddadf60c55efe8d66955ec81f366a46e460; scaling 1.032 < 1.5, capture_groups_fp 680. Re-measured on top of #2935's is-synthetic sidecar after merging origin/main: 560734cd053fb4f4b23aa04bc7870c22089a8deedb0217fa9c1b4db689e02a97 -> bdde823fa725e636e257940efb4c8655aa23124c1727cbaa8856d1ad8f71729e; scaling 0.997 < 1.5, capture_groups_fp 680.", "_added": "#2562 performance follow-up: co-scales same-host, same-name local classes and anonymous classes to gate JLS binary-name ordinal allocation. Precomputed per-sequence ordinals reduce the focused 100->800 workload from 176->6655ms to 141->752ms; normalized 250->800 scaling is 1.054.", - "_rebaselined_receiver_chain_2747": "#2747 receiver-chain rollout: call matches whose receiver is itself an expression now carry `@reference.receiver-chain`, a compact encoding of the receiver's structure, so resolution types it by folding instead of re-parsing receiver source text. Capture GROUP counts are unchanged \u2014 the tag is added to existing call matches, never a new match \u2014 so this is digest drift only. Prior a9ad88de21ca6747a923260dbdf677fb74a004abbf9d57781f745e3a9027530b -> 3ca67847ea2b9a71b0a41e09f943767e5a2d3a113d3e203499ee364e37f40236.", - "_rebaselined_2766_receiver_chain_wire_v2": "#2766: receiver-chain wire format v1 -> v2 (name-free `await` / `index` step kinds). The VERSION prefix is part of every emitted `@reference.receiver-chain` capture, so every chain-minting language's capture text changed. WIRE-FORMAT CHANGE, NOT A CAPTURE-SET CHANGE: the same chains are minted for the same sites, spelled `2|\u2026` instead of `1|\u2026`. Exactly the 12 chain-minting languages drifted; c, cobol and dart did not, which is the check that this is the prefix and not a capture regression. Accompanied by SCHEMA_BUMP 34 -> 37 and INCREMENTAL_SCHEMA_VERSION 28 -> 31 so a stale index is rejected rather than replaying chains a v2 decoder refuses. Prior 3ca67847ea2b9a71b0a41e09f943767e5a2d3a113d3e203499ee364e37f40236 -> 8c50bbc83dff4f7f5abd06078aa6abc6b64af05fddb17ee826b5f3df3d346633.", + "_rebaselined_receiver_chain_2747": "#2747 receiver-chain rollout: call matches whose receiver is itself an expression now carry `@reference.receiver-chain`, a compact encoding of the receiver's structure, so resolution types it by folding instead of re-parsing receiver source text. Capture GROUP counts are unchanged — the tag is added to existing call matches, never a new match — so this is digest drift only. Prior a9ad88de21ca6747a923260dbdf677fb74a004abbf9d57781f745e3a9027530b -> 3ca67847ea2b9a71b0a41e09f943767e5a2d3a113d3e203499ee364e37f40236.", + "_rebaselined_2766_receiver_chain_wire_v2": "#2766: receiver-chain wire format v1 -> v2 (name-free `await` / `index` step kinds). The VERSION prefix is part of every emitted `@reference.receiver-chain` capture, so every chain-minting language's capture text changed. WIRE-FORMAT CHANGE, NOT A CAPTURE-SET CHANGE: the same chains are minted for the same sites, spelled `2|…` instead of `1|…`. Exactly the 12 chain-minting languages drifted; c, cobol and dart did not, which is the check that this is the prefix and not a capture regression. Accompanied by SCHEMA_BUMP 34 -> 37 and INCREMENTAL_SCHEMA_VERSION 28 -> 31 so a stale index is rejected rather than replaying chains a v2 decoder refuses. Prior 3ca67847ea2b9a71b0a41e09f943767e5a2d3a113d3e203499ee364e37f40236 -> 8c50bbc83dff4f7f5abd06078aa6abc6b64af05fddb17ee826b5f3df3d346633.", "capture_groups_fp": 680, "_rebaselined_3486_semantic_rename": "#3486: Compared actual origin/main (191a954b), committed dd3bf and frozen provider source over the same unchanged corpus. 2 constructor-parameter type bindings are added and 38 duplicate qualified free-call matches are removed. Every removed free-call match retains a member-call match with the identical call anchor and name capture. Fixture entries 6; changed entries 6; capture groups 680 -> 644. Fingerprint regenerated from the runner's canonicalized capture records. Scaling budgets unchanged." }, @@ -222,26 +224,26 @@ "_rebaselined_3446_mcp_tools_fixture": "#3446 adds typescript-mcp-tools/src/{handlers,server,tools}.ts: corpus growth only, with fixture_count 171 -> 174 and capture_groups_fp 2753 -> 2894. Excluding only that fixture directory restores the prior fingerprint 77c9b4ea654123a64972db8348190ec250b669472b150db65ea8c7f20b355467 exactly. The scope emitter, synthetic capture counts (4503/14403), scaling budget, and other language baselines are unchanged.", "_rebaselined_3190": "Capture matches now retain explicit ESM export/private evidence, including synthesized default HOCs; CommonJS surfaces remain undecided. Capture group counts unchanged. Scaling budget unchanged.", "scaling_budget": 1.5, - "_rebaselined_2934_import_type_only": "#2934: `import-decomposer.ts` attaches a presence-only `@import.type-only` synthetic capture to specifiers `tsc` erases, so `check --cycles` can stop counting type-only edges as initialization cycles. DIGEST DRIFT ONLY, NOT A CAPTURE-SET CHANGE \u2014 the tag is added to import matches that already existed, never a new match, the same shape as the #2747 receiver-chain rebaseline. Every count is unchanged: capture_groups_fp 2414, fixture_count 155, capture_groups_small/large 4503/14403 (those measure the SYNTHETIC scaling source, which has no imports at all). The fingerprint moves because `canonicalizeMatch` in measure.mjs hashes every TAG on every match, synthetics included, so one extra presence-only tag on an existing match rewrites that match's canonical string. Attribution is exact, not inferred: neutralizing ONLY the `m['@import.type-only'] = \u2026` assignment in import-decomposer.ts and re-running returns the fingerprint to c2fbf8a89e5686dd\u2026 byte-for-byte, so nothing else in the TypeScript capture stream moved. All 14 other languages report ok. Scaling 0.997 < 1.5. NOTE ON THE CONTROL: javascript did not move (2026993b\u2026, 43 fixtures), but it is a WEAK control here \u2014 `import type` is TypeScript-only syntax, so a JS corpus cannot express the construct and could not have drifted either way. It evidences no collateral damage, not the correctness of the TS change; the exact-attribution check above is what does that. Prior c2fbf8a89e5686dd1ff3659b20d41d8b05ebcc9790356e3653ee0c8ca5d365c8 -> f719163eb03a447c9e40ca316a905dd76cee82192a75a403df478ebbdc13e98f.", + "_rebaselined_2934_import_type_only": "#2934: `import-decomposer.ts` attaches a presence-only `@import.type-only` synthetic capture to specifiers `tsc` erases, so `check --cycles` can stop counting type-only edges as initialization cycles. DIGEST DRIFT ONLY, NOT A CAPTURE-SET CHANGE — the tag is added to import matches that already existed, never a new match, the same shape as the #2747 receiver-chain rebaseline. Every count is unchanged: capture_groups_fp 2414, fixture_count 155, capture_groups_small/large 4503/14403 (those measure the SYNTHETIC scaling source, which has no imports at all). The fingerprint moves because `canonicalizeMatch` in measure.mjs hashes every TAG on every match, synthetics included, so one extra presence-only tag on an existing match rewrites that match's canonical string. Attribution is exact, not inferred: neutralizing ONLY the `m['@import.type-only'] = …` assignment in import-decomposer.ts and re-running returns the fingerprint to c2fbf8a89e5686dd… byte-for-byte, so nothing else in the TypeScript capture stream moved. All 14 other languages report ok. Scaling 0.997 < 1.5. NOTE ON THE CONTROL: javascript did not move (2026993b…, 43 fixtures), but it is a WEAK control here — `import type` is TypeScript-only syntax, so a JS corpus cannot express the construct and could not have drifted either way. It evidences no collateral damage, not the correctness of the TS change; the exact-attribution check above is what does that. Prior c2fbf8a89e5686dd1ff3659b20d41d8b05ebcc9790356e3653ee0c8ca5d365c8 -> f719163eb03a447c9e40ca316a905dd76cee82192a75a403df478ebbdc13e98f.", "_rebaselined_callable_flow_2522_review": "PR #2522 review hardening: callable operands retain expression/qualified identity and formals retain signature metadata. Prior 27f937bfb47d4bded316ea3c785ff659c8cd88a5761d928f113477a08c802c78 -> e05446620c5b80b7aae291cfdf32f693580fada2ae687124769b04a0c03bfe63; scaling 0.983 < 1.5.", "_rebaselined_callable_flow_2522_followup": "PR #2522 follow-up: lexical callable bindings, direct-callee argument metadata, and invocation-result suppression. Prior db5933cc6760234ed7d495123410feba6de243646d583f20d43032b9459f81fd -> 27f937bfb47d4bded316ea3c785ff659c8cd88a5761d928f113477a08c802c78; scaling 0.975 < 1.5.", "_rebaselined_callable_flow": "Callable assignment/copy/formal/argument/invoke facts (also consumed by Vue script blocks). Prior 25de86fd3377132c4e35d3d98f4f94a58e0cfeb7c22948a8ea3be4e793be74fd -> db5933cc6760234ed7d495123410feba6de243646d583f20d43032b9459f81fd; measured scaling ratio 0.951 < 1.5.", - "_rebaselined": "#1962: F44 (class scope@), F85 (enum member declarations), F87 (optional_parameter type annotations) add new captures \u2014 fingerprint drift expected.", - "_note": "#1968: F44, F85, F87 \u2014 fingerprint drift expected.", + "_rebaselined": "#1962: F44 (class scope@), F85 (enum member declarations), F87 (optional_parameter type annotations) add new captures — fingerprint drift expected.", + "_note": "#1968: F44, F85, F87 — fingerprint drift expected.", "_rebaselined_2522": "#2522 intentional @reference.value-ref/property-key capture additions. GitHub Actions run 29553361660 job 87800394279: prior 3f44a4a6892698df2d145c8ff2812c3b318807648983c88aca28fbd694f172f9 -> 25de86fd3377132c4e35d3d98f4f94a58e0cfeb7c22948a8ea3be4e793be74fd; scaling ratio 0.987 < 1.5.", "_rebaselined_2550_instance_model": "PR #2549 (#2545/#2551): object literals emit @scope.object (was unscoped, then @scope.block during development). Prior e05446620c5b80b7aae291cfdf32f693580fada2ae687124769b04a0c03bfe63 -> 3280b13d3f9378ab23eee31c2edc779b5a9ae1e7bb510c23a24855b44406d2f4; scaling 0.981 < 1.5.", - "_rebaselined_receiver_owner_2701": "#2701: every non-arrow function form now carries a `@receiver-owner.this` marker on the same node as `@scope.function`, so a scope that BINDS its own `this` can stop the receiver walk (`Scope.ownsReceivers`). Verified before re-baselining by diffing the capture-name histogram over this same fixture corpus against 1d3088173f6f93827641b476d614d5d15cd4f3ea: the ONLY delta is @receiver-owner.this (typescript +143, javascript +32) \u2014 every other capture count is byte-identical, so no existing capture moved. Prior 3280b13d3f9378ab23eee31c2edc779b5a9ae1e7bb510c23a24855b44406d2f4 -> 281e95484203b481094729ca249ef0423c41273eac35e424cdfd032a0dac7699.", - "_rebaselined_receiver_chain_2747": "#2747 receiver-chain rollout: call matches whose receiver is itself an expression now carry `@reference.receiver-chain`, a compact encoding of the receiver's structure, so resolution types it by folding instead of re-parsing receiver source text. Capture GROUP counts are unchanged \u2014 the tag is added to existing call matches, never a new match \u2014 so this is digest drift only. Prior cad25be9f81d6e021ebae8dcb166bc0af3a1ba8021f1506f6ca93fd4c2649000 -> 9e112415f1169f08576826c12ea1d137d1994e34b44c45986c9ffee83b8b4edc.", - "_rebaselined_2766_receiver_chain_wire_v2": "#2766: receiver-chain wire format v1 -> v2 (name-free `await` / `index` step kinds). The VERSION prefix is part of every emitted `@reference.receiver-chain` capture, so every chain-minting language's capture text changed. WIRE-FORMAT CHANGE, NOT A CAPTURE-SET CHANGE: the same chains are minted for the same sites, spelled `2|\u2026` instead of `1|\u2026`. Exactly the 12 chain-minting languages drifted; c, cobol and dart did not, which is the check that this is the prefix and not a capture regression. Accompanied by SCHEMA_BUMP 34 -> 37 and INCREMENTAL_SCHEMA_VERSION 28 -> 31 so a stale index is rejected rather than replaying chains a v2 decoder refuses. Prior 9e112415f1169f08576826c12ea1d137d1994e34b44c45986c9ffee83b8b4edc -> cdefe88d3c275f31953216c676ef32c7bf5727d56b9c3840b81ee6bf85749dff.", - "_rebaselined_inferred_field_receiver_2807": "#2807: inference-typed class fields now emit a type binding \u2014 `public_field_definition` with a `new_expression` value, and `this. = new ...` carrying a @type-binding.this-field marker. ADDS @type-binding.constructor captures only; no capture is removed, and the annotated form is unchanged because annotation outranks constructor-inferred in typeBindingStrength. Prior cdefe88d3c275f31953216c676ef32c7bf5727d56b9c3840b81ee6bf85749dff -> 248b56f0d7a0a6fc7a949dc7afb8611e135ed642bccc2631b96ebb9d686bb965; scaling 0.994 < 1.5.", - "_rebaselined_ts_heritage_2842": "#2842 review: TypeScript heritage capture now emits `@reference.inherits` for `interface_declaration` (bases on `extends_type_clause`) and `abstract_class_declaration` (bases on `class_heritage`), which were both silently skipped \u2014 so `interface B extends A` and `abstract class X implements I` produced no edge and every interface-dispatch walk dead-ended on a bodiless declaration. Verified before re-baselining by diffing the capture-name histogram over this same fixture corpus (145 files) with and without the change: the ONLY deltas are @reference.inherits 17 -> 20 (+3) and its paired @reference.name 245 -> 248 (+3), emitted together by emitTsInheritanceBase. Every other capture count is byte-identical, so no existing capture moved. The +3 is the three `interface X extends BasePayload` declarations in typescript-generic-calls/src/{auth,admin,guest}.ts. javascript is unchanged (no interfaces in the language). Prior 248b56f0d7a0a6fc7a949dc7afb8611e135ed642bccc2631b96ebb9d686bb965 -> 7a960908031331360ce582f5b55b7681e1cd7f8a2eabfd73c00982cb17f2a949.", + "_rebaselined_receiver_owner_2701": "#2701: every non-arrow function form now carries a `@receiver-owner.this` marker on the same node as `@scope.function`, so a scope that BINDS its own `this` can stop the receiver walk (`Scope.ownsReceivers`). Verified before re-baselining by diffing the capture-name histogram over this same fixture corpus against 1d3088173f6f93827641b476d614d5d15cd4f3ea: the ONLY delta is @receiver-owner.this (typescript +143, javascript +32) — every other capture count is byte-identical, so no existing capture moved. Prior 3280b13d3f9378ab23eee31c2edc779b5a9ae1e7bb510c23a24855b44406d2f4 -> 281e95484203b481094729ca249ef0423c41273eac35e424cdfd032a0dac7699.", + "_rebaselined_receiver_chain_2747": "#2747 receiver-chain rollout: call matches whose receiver is itself an expression now carry `@reference.receiver-chain`, a compact encoding of the receiver's structure, so resolution types it by folding instead of re-parsing receiver source text. Capture GROUP counts are unchanged — the tag is added to existing call matches, never a new match — so this is digest drift only. Prior cad25be9f81d6e021ebae8dcb166bc0af3a1ba8021f1506f6ca93fd4c2649000 -> 9e112415f1169f08576826c12ea1d137d1994e34b44c45986c9ffee83b8b4edc.", + "_rebaselined_2766_receiver_chain_wire_v2": "#2766: receiver-chain wire format v1 -> v2 (name-free `await` / `index` step kinds). The VERSION prefix is part of every emitted `@reference.receiver-chain` capture, so every chain-minting language's capture text changed. WIRE-FORMAT CHANGE, NOT A CAPTURE-SET CHANGE: the same chains are minted for the same sites, spelled `2|…` instead of `1|…`. Exactly the 12 chain-minting languages drifted; c, cobol and dart did not, which is the check that this is the prefix and not a capture regression. Accompanied by SCHEMA_BUMP 34 -> 37 and INCREMENTAL_SCHEMA_VERSION 28 -> 31 so a stale index is rejected rather than replaying chains a v2 decoder refuses. Prior 9e112415f1169f08576826c12ea1d137d1994e34b44c45986c9ffee83b8b4edc -> cdefe88d3c275f31953216c676ef32c7bf5727d56b9c3840b81ee6bf85749dff.", + "_rebaselined_inferred_field_receiver_2807": "#2807: inference-typed class fields now emit a type binding — `public_field_definition` with a `new_expression` value, and `this. = new ...` carrying a @type-binding.this-field marker. ADDS @type-binding.constructor captures only; no capture is removed, and the annotated form is unchanged because annotation outranks constructor-inferred in typeBindingStrength. Prior cdefe88d3c275f31953216c676ef32c7bf5727d56b9c3840b81ee6bf85749dff -> 248b56f0d7a0a6fc7a949dc7afb8611e135ed642bccc2631b96ebb9d686bb965; scaling 0.994 < 1.5.", + "_rebaselined_ts_heritage_2842": "#2842 review: TypeScript heritage capture now emits `@reference.inherits` for `interface_declaration` (bases on `extends_type_clause`) and `abstract_class_declaration` (bases on `class_heritage`), which were both silently skipped — so `interface B extends A` and `abstract class X implements I` produced no edge and every interface-dispatch walk dead-ended on a bodiless declaration. Verified before re-baselining by diffing the capture-name histogram over this same fixture corpus (145 files) with and without the change: the ONLY deltas are @reference.inherits 17 -> 20 (+3) and its paired @reference.name 245 -> 248 (+3), emitted together by emitTsInheritanceBase. Every other capture count is byte-identical, so no existing capture moved. The +3 is the three `interface X extends BasePayload` declarations in typescript-generic-calls/src/{auth,admin,guest}.ts. javascript is unchanged (no interfaces in the language). Prior 248b56f0d7a0a6fc7a949dc7afb8611e135ed642bccc2631b96ebb9d686bb965 -> 7a960908031331360ce582f5b55b7681e1cd7f8a2eabfd73c00982cb17f2a949.", "capture_groups_small": 4503, "capture_groups_large": 14403, "capture_groups_fp": 2465, "fixture_count": 167, - "_rebaselined_blind_spots_2856": "#2856 blind-spots series: the JS/TS SCOPE queries gained capture rules, so fingerprint drift is expected and additive. Verified before re-baselining by diffing the capture-name sets in both scope queries against origin/main: TypeScript gained exactly @reference.read.identifier (A2 bare-identifier reads in value positions) and @reference.type (R2-2 type references, so a declared contract stops reporting incoming:{}); JavaScript gained exactly @reference.read.identifier, @reference.read.destructured (R2-1c) and @reference.write.property-key (R2-1b record-construction writes). NOTHING was removed on either side \u2014 the delta is a pure superset, which is the check that no existing capture moved. capture_groups_small/large are unchanged (4503/14403) because those measure the SYNTHETIC scaling source, which this branch does not touch; only the fixture-corpus count moves. capture_groups_fp 2097 -> 2338 and fixture_count 146 -> 151 from 21 new lang-resolution fixtures. Scaling stayed linear and inside budget: typescript 1.116 < 1.5, javascript 1.010 < 1.5. Prior typescript ed92588e0fc7b28b3a0174339ac378b4dd85965fe007db1208dea97a65ce0571 -> f66a3e6f1e096431e7046505129a627deaa00ca0de5bc846b080591b397248f7; prior javascript 806f70ad3cce5fc849f6d06a08ace8a95f92a1ea84a2418fddabb1eef5846594 -> 2026993b81b873839dd2ef8797d9c14d9c48516b2b57b05ac17d8d43f2f4eba3.", - "_rebaselined_type_parameter_shadowing_w2_8": "W2-8: `@declaration.type-parameters` is now captured on generic FUNCTIONS, generator functions and type ALIASES, not only on class/interface declarations. NO NEW CAPTURE NAME \u2014 verified by diffing the capture-name sets against the wave-1 branch, which returns empty; the tag already existed and simply fires on more declarations. That is the whole delta: capture_groups_fp 2338 -> 2371 (+33 occurrences of an existing tag) and fixture_count 151 -> 152 (one new fixture, typescript-type-parameters). capture_groups_small/large unchanged at 4503/14403, since those measure the synthetic scaling source this does not touch. Scaling 1.06 < 1.5. JavaScript is untouched \u2014 it has no type parameters \u2014 and its fingerprint does not move, which is the check that this is the TS declaration rules and not something broader. Prior f66a3e6f1e096431e7046505129a627deaa00ca0de5bc846b080591b397248f7 -> 62c7f1bfbe568eed927fb78f00061ed5e49d12511fd8260648b876df386f3b4c.", - "_rebaselined_2899_review_type_parameter_scope_fixtures": "PR #2899 review follow-up: FIXTURE-CORPUS GROWTH ONLY \u2014 no query rule changed and no capture name was added or removed. `typescript/query.ts` is byte-identical to the previous baseline; the type-parameter shadowing defect was fixed on the RESOLUTION side (`walkers.ts` gains a `declarationOpenedScope` gate so a declaration's `typeParameters` bind only inside the scope that declaration opened, and the `USES` guard moved from `graph-bridge/references-to-edges.ts` to `resolve-references.ts` where the spelled `site.name` is in hand). The fingerprint moves because measure.mjs fingerprints the whole `lang-resolution/typescript-*` fixture corpus and the regression tests add three files to `typescript-type-parameters/src/` (values.ts, aliased.ts, namespaced.ts) plus two scope-less generic aliases in shapes.ts. Per-file accounting sums exactly to the delta: shapes.ts 33->35 (+2), values.ts +11, aliased.ts +10, namespaced.ts +20 = +43. capture_groups_fp 2371 -> 2414; fixture_count 152 -> 155. capture_groups_small/large unchanged at 4503/14403 (they measure the SYNTHETIC scaling source, untouched). JAVASCRIPT IS THE CONTROL AND DID NOT MOVE (fingerprint 2026993b..., 43 fixtures) \u2014 which is the check that this is corpus growth and not a capture regression; all 14 other languages report `ok`. Scaling 0.976 < 1.5. Prior 62c7f1bfbe568eed927fb78f00061ed5e49d12511fd8260648b876df386f3b4c -> c2fbf8a89e5686dd1ff3659b20d41d8b05ebcc9790356e3653ee0c8ca5d365c8.", + "_rebaselined_blind_spots_2856": "#2856 blind-spots series: the JS/TS SCOPE queries gained capture rules, so fingerprint drift is expected and additive. Verified before re-baselining by diffing the capture-name sets in both scope queries against origin/main: TypeScript gained exactly @reference.read.identifier (A2 bare-identifier reads in value positions) and @reference.type (R2-2 type references, so a declared contract stops reporting incoming:{}); JavaScript gained exactly @reference.read.identifier, @reference.read.destructured (R2-1c) and @reference.write.property-key (R2-1b record-construction writes). NOTHING was removed on either side — the delta is a pure superset, which is the check that no existing capture moved. capture_groups_small/large are unchanged (4503/14403) because those measure the SYNTHETIC scaling source, which this branch does not touch; only the fixture-corpus count moves. capture_groups_fp 2097 -> 2338 and fixture_count 146 -> 151 from 21 new lang-resolution fixtures. Scaling stayed linear and inside budget: typescript 1.116 < 1.5, javascript 1.010 < 1.5. Prior typescript ed92588e0fc7b28b3a0174339ac378b4dd85965fe007db1208dea97a65ce0571 -> f66a3e6f1e096431e7046505129a627deaa00ca0de5bc846b080591b397248f7; prior javascript 806f70ad3cce5fc849f6d06a08ace8a95f92a1ea84a2418fddabb1eef5846594 -> 2026993b81b873839dd2ef8797d9c14d9c48516b2b57b05ac17d8d43f2f4eba3.", + "_rebaselined_type_parameter_shadowing_w2_8": "W2-8: `@declaration.type-parameters` is now captured on generic FUNCTIONS, generator functions and type ALIASES, not only on class/interface declarations. NO NEW CAPTURE NAME — verified by diffing the capture-name sets against the wave-1 branch, which returns empty; the tag already existed and simply fires on more declarations. That is the whole delta: capture_groups_fp 2338 -> 2371 (+33 occurrences of an existing tag) and fixture_count 151 -> 152 (one new fixture, typescript-type-parameters). capture_groups_small/large unchanged at 4503/14403, since those measure the synthetic scaling source this does not touch. Scaling 1.06 < 1.5. JavaScript is untouched — it has no type parameters — and its fingerprint does not move, which is the check that this is the TS declaration rules and not something broader. Prior f66a3e6f1e096431e7046505129a627deaa00ca0de5bc846b080591b397248f7 -> 62c7f1bfbe568eed927fb78f00061ed5e49d12511fd8260648b876df386f3b4c.", + "_rebaselined_2899_review_type_parameter_scope_fixtures": "PR #2899 review follow-up: FIXTURE-CORPUS GROWTH ONLY — no query rule changed and no capture name was added or removed. `typescript/query.ts` is byte-identical to the previous baseline; the type-parameter shadowing defect was fixed on the RESOLUTION side (`walkers.ts` gains a `declarationOpenedScope` gate so a declaration's `typeParameters` bind only inside the scope that declaration opened, and the `USES` guard moved from `graph-bridge/references-to-edges.ts` to `resolve-references.ts` where the spelled `site.name` is in hand). The fingerprint moves because measure.mjs fingerprints the whole `lang-resolution/typescript-*` fixture corpus and the regression tests add three files to `typescript-type-parameters/src/` (values.ts, aliased.ts, namespaced.ts) plus two scope-less generic aliases in shapes.ts. Per-file accounting sums exactly to the delta: shapes.ts 33->35 (+2), values.ts +11, aliased.ts +10, namespaced.ts +20 = +43. capture_groups_fp 2371 -> 2414; fixture_count 152 -> 155. capture_groups_small/large unchanged at 4503/14403 (they measure the SYNTHETIC scaling source, untouched). JAVASCRIPT IS THE CONTROL AND DID NOT MOVE (fingerprint 2026993b..., 43 fixtures) — which is the check that this is corpus growth and not a capture regression; all 14 other languages report `ok`. Scaling 0.976 < 1.5. Prior 62c7f1bfbe568eed927fb78f00061ed5e49d12511fd8260648b876df386f3b4c -> c2fbf8a89e5686dd1ff3659b20d41d8b05ebcc9790356e3653ee0c8ca5d365c8.", "_rebaselined_2953_workspace_fixture": "#2953 adds test/fixtures/lang-resolution/typescript-pnpm-workspace-imports, a pnpm monorepo of 12 .ts files, and the TypeScript capture corpus is collected from test/fixtures. CORPUS GROWTH ONLY, NOT A CAPTURE CHANGE: fixture_count 155 -> 167 and capture_groups_fp 2414 -> 2465 are the 12 new files' own matches; capture_groups_small/large are unchanged at 4503/14403 because those measure the SYNTHETIC scaling source, which the fixture corpus does not feed. Attribution is exact rather than inferred: moving that one fixture directory aside and re-running returns typescript to f719163eb03a447c9e40ca316a905dd76cee82192a75a403df478ebbdc13e98f byte-for-byte with fixture_count back at 155, and [scope-capture --check] PASSES for all 15 languages - so nothing in the TypeScript capture stream moved. #2953 changes import RESOLUTION, which runs after capture and feeds no capture tag. Prior f719163eb03a447c9e40ca316a905dd76cee82192a75a403df478ebbdc13e98f -> 05d1dadd6c9ef35c74079fa50f341b1b36e4fb02c9a89dd1b59f32b7cfd5e633.", "_rebaselined_1432_member_call_callee_name": "#1432 (Zig): the shared callable-flow reader no longer names a callee by simple name for a MEMBER call (`@callable-flow.direct-callee-name` requires a direct designator: `f(x)`, `ns.f(x)`), and a member call is a field-stored-callable invoke only when a MEMBER store (`o.f = handler`) or a declared callable-typed field is visible - a same-named plain binding no longer gates it. CAPTURE-EMISSION CHANGE, not fixture growth (fixture_count unchanged). Drift: `await svc.verify(token, ...)` (typescript-generic-calls/src/guest.ts, member call) and `initializer()(() => {...})` (typescript-hof-callbacks/src/store.ts, call-of-call) lose `direct-callee-name`. `await verifyToken(token, ...)` (admin.ts/auth.ts) KEEPS `direct-callee-name|verifyToken`: tree-sitter-typescript parses `await f(x)` as call_expression(function: await_expression(f), type_arguments, ...), and wrappedExpression now unwraps `await_expression` so the direct designator survives as it does for the un-awaited spelling. capture_groups_fp 2465 (unchanged). Prior 05d1dadd6c9ef35c74079fa50f341b1b36e4fb02c9a89dd1b59f32b7cfd5e633 -> fed04ed1d5db112387781e405da208ae6b3ab803889773b0455be96f01b893ff.", "_rebaselined_3354_callable_alternatives": "#3354 callable alternatives: a callable chosen by a value-selecting source now flows every branch it can yield (`a ?? b`, `a || b`, `a or b`, `c ? a : b`, statement `if`, elvis), and an operator branch (`x == f || g`) stays opaque instead of seeding a qualified name. Verified by running the BASE (merge-base 233ca2849) and HEAD emitters over the SAME HEAD fixture corpus: every added or removed match is an `@callable-flow.*` match on one of those sources, and the pre-existing corpus is byte-identical (all other languages: zero delta). The rest of the drift is corpus growth from this PR's regression fixture, which this bench globs. Corpus growth: typescript-callable-alternatives/{index,compare,worker,sweep/index}.ts (+4 files, +288 groups). Emitter delta: +18 / -14: `??` / `||` / `&&` / ternary seeds and copies now name each operand (`&&` its right operand only); the 14 removed matches are the whole-expression seeds and copies carrying a qualified name of the compound source, including the comparison branches in compare.ts that now stay opaque. capture_groups_fp 2465 -> 2753, fixture_count 167 -> 171; synthetic counts unchanged; scaling 0.963 < 1.5. Prior 60e75bbe846f7200005f12c4d95c32e82d9d3feae9f2fd594e484670762b82b0 -> 77c9b4ea654123a64972db8348190ec250b669472b150db65ea8c7f20b355467.", @@ -259,10 +261,10 @@ "_rebaselined": "#1956 synth-widening: + javascript-qualified-base fixture; synthesizeJsInheritanceReferences now handles a member_expression base (class S extends ns.Base -> Base), matching the #1940 legacy leg + the TS terminalTsTypeNameNode property_identifier case, at parity. Linear (~1.05). | #942: scope-resolution-only cleanup reworded fixture comments; capture byte-positions shift, capture LOGIC unchanged.", "_rebaselined_2522": "#2522 intentional @reference.value-ref/property-key capture additions. GitHub Actions run 29553361660 job 87800394279: prior d72f03c6c502235d2d4b74d66baa5c7d361f040d7a1b72e84acad61210d05ae8 -> 5567dd47e7ba29821a518c4a9852adc3b774e25ef3e7a6e2b3ecb7b59ddab73c; scaling ratio 1.031 < 1.5.", "_rebaselined_2550_instance_model": "PR #2549 (#2545/#2551): object literals emit @scope.object. Prior 479927409bbdd9852a36172c8260aa56df260e99129a7a9c20a0d1903dd5538b -> f1ccf42a36895c8e34dcb724286f247d469835f2dcbb23ad3347190adc7fde1c; scaling 1.096 < 1.5.", - "_rebaselined_receiver_owner_2701": "#2701: every non-arrow function form now carries a `@receiver-owner.this` marker on the same node as `@scope.function`, so a scope that BINDS its own `this` can stop the receiver walk (`Scope.ownsReceivers`). Verified before re-baselining by diffing the capture-name histogram over this same fixture corpus against 1d3088173f6f93827641b476d614d5d15cd4f3ea: the ONLY delta is @receiver-owner.this (typescript +143, javascript +32) \u2014 every other capture count is byte-identical, so no existing capture moved. Prior f1ccf42a36895c8e34dcb724286f247d469835f2dcbb23ad3347190adc7fde1c -> 90601494695b834d3a9af7ac4844eac603f4f432809a05554cc59de0674a4354.", - "_rebaselined_receiver_chain_2747": "#2747 receiver-chain rollout: call matches whose receiver is itself an expression now carry `@reference.receiver-chain`, a compact encoding of the receiver's structure, so resolution types it by folding instead of re-parsing receiver source text. Capture GROUP counts are unchanged \u2014 the tag is added to existing call matches, never a new match \u2014 so this is digest drift only. Prior 1c71ef628eb75a3b111afa8c2a7c351c16a7f5aab9fac2f098f82b2866312aa8 -> 83344b7cba093702f4528eeee44e438809c229d43b12e69ed288812ce7ffc7bc.", - "_rebaselined_2766_receiver_chain_wire_v2": "#2766: receiver-chain wire format v1 -> v2 (name-free `await` / `index` step kinds). The VERSION prefix is part of every emitted `@reference.receiver-chain` capture, so every chain-minting language's capture text changed. WIRE-FORMAT CHANGE, NOT A CAPTURE-SET CHANGE: the same chains are minted for the same sites, spelled `2|\u2026` instead of `1|\u2026`. Exactly the 12 chain-minting languages drifted; c, cobol and dart did not, which is the check that this is the prefix and not a capture regression. Accompanied by SCHEMA_BUMP 34 -> 37 and INCREMENTAL_SCHEMA_VERSION 28 -> 31 so a stale index is rejected rather than replaying chains a v2 decoder refuses. Prior 83344b7cba093702f4528eeee44e438809c229d43b12e69ed288812ce7ffc7bc -> 806f70ad3cce5fc849f6d06a08ace8a95f92a1ea84a2418fddabb1eef5846594.", - "_rebaselined_blind_spots_2856": "#2856 blind-spots series: the JS/TS SCOPE queries gained capture rules, so fingerprint drift is expected and additive. Verified before re-baselining by diffing the capture-name sets in both scope queries against origin/main: TypeScript gained exactly @reference.read.identifier (A2 bare-identifier reads in value positions) and @reference.type (R2-2 type references, so a declared contract stops reporting incoming:{}); JavaScript gained exactly @reference.read.identifier, @reference.read.destructured (R2-1c) and @reference.write.property-key (R2-1b record-construction writes). NOTHING was removed on either side \u2014 the delta is a pure superset, which is the check that no existing capture moved. capture_groups_small/large are unchanged (4503/14403) because those measure the SYNTHETIC scaling source, which this branch does not touch; only the fixture-corpus count moves. capture_groups_fp 2097 -> 2338 and fixture_count 146 -> 151 from 21 new lang-resolution fixtures. Scaling stayed linear and inside budget: typescript 1.116 < 1.5, javascript 1.010 < 1.5. Prior typescript ed92588e0fc7b28b3a0174339ac378b4dd85965fe007db1208dea97a65ce0571 -> f66a3e6f1e096431e7046505129a627deaa00ca0de5bc846b080591b397248f7; prior javascript 806f70ad3cce5fc849f6d06a08ace8a95f92a1ea84a2418fddabb1eef5846594 -> 2026993b81b873839dd2ef8797d9c14d9c48516b2b57b05ac17d8d43f2f4eba3." + "_rebaselined_receiver_owner_2701": "#2701: every non-arrow function form now carries a `@receiver-owner.this` marker on the same node as `@scope.function`, so a scope that BINDS its own `this` can stop the receiver walk (`Scope.ownsReceivers`). Verified before re-baselining by diffing the capture-name histogram over this same fixture corpus against 1d3088173f6f93827641b476d614d5d15cd4f3ea: the ONLY delta is @receiver-owner.this (typescript +143, javascript +32) — every other capture count is byte-identical, so no existing capture moved. Prior f1ccf42a36895c8e34dcb724286f247d469835f2dcbb23ad3347190adc7fde1c -> 90601494695b834d3a9af7ac4844eac603f4f432809a05554cc59de0674a4354.", + "_rebaselined_receiver_chain_2747": "#2747 receiver-chain rollout: call matches whose receiver is itself an expression now carry `@reference.receiver-chain`, a compact encoding of the receiver's structure, so resolution types it by folding instead of re-parsing receiver source text. Capture GROUP counts are unchanged — the tag is added to existing call matches, never a new match — so this is digest drift only. Prior 1c71ef628eb75a3b111afa8c2a7c351c16a7f5aab9fac2f098f82b2866312aa8 -> 83344b7cba093702f4528eeee44e438809c229d43b12e69ed288812ce7ffc7bc.", + "_rebaselined_2766_receiver_chain_wire_v2": "#2766: receiver-chain wire format v1 -> v2 (name-free `await` / `index` step kinds). The VERSION prefix is part of every emitted `@reference.receiver-chain` capture, so every chain-minting language's capture text changed. WIRE-FORMAT CHANGE, NOT A CAPTURE-SET CHANGE: the same chains are minted for the same sites, spelled `2|…` instead of `1|…`. Exactly the 12 chain-minting languages drifted; c, cobol and dart did not, which is the check that this is the prefix and not a capture regression. Accompanied by SCHEMA_BUMP 34 -> 37 and INCREMENTAL_SCHEMA_VERSION 28 -> 31 so a stale index is rejected rather than replaying chains a v2 decoder refuses. Prior 83344b7cba093702f4528eeee44e438809c229d43b12e69ed288812ce7ffc7bc -> 806f70ad3cce5fc849f6d06a08ace8a95f92a1ea84a2418fddabb1eef5846594.", + "_rebaselined_blind_spots_2856": "#2856 blind-spots series: the JS/TS SCOPE queries gained capture rules, so fingerprint drift is expected and additive. Verified before re-baselining by diffing the capture-name sets in both scope queries against origin/main: TypeScript gained exactly @reference.read.identifier (A2 bare-identifier reads in value positions) and @reference.type (R2-2 type references, so a declared contract stops reporting incoming:{}); JavaScript gained exactly @reference.read.identifier, @reference.read.destructured (R2-1c) and @reference.write.property-key (R2-1b record-construction writes). NOTHING was removed on either side — the delta is a pure superset, which is the check that no existing capture moved. capture_groups_small/large are unchanged (4503/14403) because those measure the SYNTHETIC scaling source, which this branch does not touch; only the fixture-corpus count moves. capture_groups_fp 2097 -> 2338 and fixture_count 146 -> 151 from 21 new lang-resolution fixtures. Scaling stayed linear and inside budget: typescript 1.116 < 1.5, javascript 1.010 < 1.5. Prior typescript ed92588e0fc7b28b3a0174339ac378b4dd85965fe007db1208dea97a65ce0571 -> f66a3e6f1e096431e7046505129a627deaa00ca0de5bc846b080591b397248f7; prior javascript 806f70ad3cce5fc849f6d06a08ace8a95f92a1ea84a2418fddabb1eef5846594 -> 2026993b81b873839dd2ef8797d9c14d9c48516b2b57b05ac17d8d43f2f4eba3." }, "kotlin": { "fingerprint": "026392f9a60d9808dd993fa6d26f3a2ca6240ed6ac63981d614058ae7acd29e2", @@ -274,13 +276,13 @@ "_rebaselined_callable_flow_2522_followup": "PR #2522 follow-up: Kotlin callable-reference flow facts with invocation-result suppression. Prior 4900431791f2b9280009deb2b82659c26ead8aa6fb8731190a7c505dec5a9041 -> bddba25d5a88152bbbee8d70e82c944b5302accb4b625df782adb1d4f7a7ac12; scaling 0.880 < 1.5.", "_added": "#1951: bench coverage added (was ungated); scale source heritage-bearing (: Base()); js/kotlin O(n^2) findNodeAtRange-per-match fixed to threaded captured node, now linear.", "_rebaselined": "#1919 review CF3 fix: extended kotlin-local-property-owner (init/accessor destructuring) + new dart-accessor-owner fixture (getter/setter ownership). Fingerprint-only corpus drift; scaling ~1.0.", - "_rebaselined_2271": "PR #2271: re-vendored tree-sitter-kotlin 0.3.8 -> unreleased fwcd main c8ac3d26 for `fun interface` support + new kotlin-fun-interface fixture in the corpus. Drift is both corpus-additive (the fixture) and grammar-driven (the new grammar parses `fun interface` as a class_declaration, not an ERROR node). Baselined to the NEW grammar's fingerprint, so this --check passes only once the regenerated prebuilds land \u2014 until then CI loads the committed 0.3.8 binary and the bench is red, same as the kotlin fun-interface integration tests. scaling ~0.83 (linear).", + "_rebaselined_2271": "PR #2271: re-vendored tree-sitter-kotlin 0.3.8 -> unreleased fwcd main c8ac3d26 for `fun interface` support + new kotlin-fun-interface fixture in the corpus. Drift is both corpus-additive (the fixture) and grammar-driven (the new grammar parses `fun interface` as a class_declaration, not an ERROR node). Baselined to the NEW grammar's fingerprint, so this --check passes only once the regenerated prebuilds land — until then CI loads the committed 0.3.8 binary and the bench is red, same as the kotlin fun-interface integration tests. scaling ~0.83 (linear).", "_rebaselined_2522_review_fixes": "PR #2522 review fixes: fieldless assignment nodes decomposed positionally. Prior e856951c2a779163d555dadc8e1bf59304a86caed78ac1f450d9caa2b50f63d1 -> 4b31f46cfb004ba769a96feeb06ae4ef109c77410f54e7aaab4a688df599b112; scaling ratio re-verified within budget.", "_rebaselined_2550_instance_model": "PR #2549 (#2545): anonymous object expressions (object_literal) emit @scope.class, and the kotlin-object-literal-scope fixture joined the corpus. Prior 4b31f46cfb004ba769a96feeb06ae4ef109c77410f54e7aaab4a688df599b112 -> a6fce0dff00e88d41d85023eaf3f35016b5217c7e5225f24a598e4c70bb63091; scaling 0.951 < 1.5.", "_rebaselined_2563_instance_ownership": "#2563: kotlin-instance-ownership adds unrelated, inherited, outer-instance, and anonymous-object coverage. Prior a6fce0dff00e88d41d85023eaf3f35016b5217c7e5225f24a598e4c70bb63091 -> 9f159f8810d342ef1c821f466efd6920dad9a190f06000056e6cd2815861b195; scaling 1.257 < 1.5.", - "_rebaselined_receiver_chain_2747": "#2747 receiver-chain rollout: call matches whose receiver is itself an expression now carry `@reference.receiver-chain`, a compact encoding of the receiver's structure, so resolution types it by folding instead of re-parsing receiver source text. Capture GROUP counts are unchanged \u2014 the tag is added to existing call matches, never a new match \u2014 so this is digest drift only. Prior 9f159f8810d342ef1c821f466efd6920dad9a190f06000056e6cd2815861b195 -> d3c4d2fa0d82d248a2299cfc888b067187ad1faf2c87a97f93c6ed835eefc3f1.", - "_rebaselined_2766_receiver_chain_wire_v2": "#2766: receiver-chain wire format v1 -> v2 (name-free `await` / `index` step kinds). The VERSION prefix is part of every emitted `@reference.receiver-chain` capture, so every chain-minting language's capture text changed. WIRE-FORMAT CHANGE, NOT A CAPTURE-SET CHANGE: the same chains are minted for the same sites, spelled `2|\u2026` instead of `1|\u2026`. Exactly the 12 chain-minting languages drifted; c, cobol and dart did not, which is the check that this is the prefix and not a capture regression. Accompanied by SCHEMA_BUMP 34 -> 37 and INCREMENTAL_SCHEMA_VERSION 28 -> 31 so a stale index is rejected rather than replaying chains a v2 decoder refuses. Prior d3c4d2fa0d82d248a2299cfc888b067187ad1faf2c87a97f93c6ed835eefc3f1 -> c1f0cc9058ab11b7cd6fc8b440deb6db2b2f530f2eb21178923e68a3d0796c4b.", - "_rebaselined_2766_await_subscript_emission": "#2766: extractMixedChain now walks THROUGH await and subscript nodes and peels transparent wrappers at loop entry, so sites whose receiver is `repos[0]` or `(await f())` mint a receiver chain where they previously minted none. EMISSION CHANGE: more sites carry `@reference.receiver-chain`; no existing chain changed shape. Only go and kotlin drifted of 15 \u2014 the two whose fixture corpora contain such receivers. Prior c1f0cc9058ab11b7cd6fc8b440deb6db2b2f530f2eb21178923e68a3d0796c4b -> efd5dbf80ffcd3bab2834d1010f6fe2b239dcc5d58229938dea9cff8d0f380f2.", + "_rebaselined_receiver_chain_2747": "#2747 receiver-chain rollout: call matches whose receiver is itself an expression now carry `@reference.receiver-chain`, a compact encoding of the receiver's structure, so resolution types it by folding instead of re-parsing receiver source text. Capture GROUP counts are unchanged — the tag is added to existing call matches, never a new match — so this is digest drift only. Prior 9f159f8810d342ef1c821f466efd6920dad9a190f06000056e6cd2815861b195 -> d3c4d2fa0d82d248a2299cfc888b067187ad1faf2c87a97f93c6ed835eefc3f1.", + "_rebaselined_2766_receiver_chain_wire_v2": "#2766: receiver-chain wire format v1 -> v2 (name-free `await` / `index` step kinds). The VERSION prefix is part of every emitted `@reference.receiver-chain` capture, so every chain-minting language's capture text changed. WIRE-FORMAT CHANGE, NOT A CAPTURE-SET CHANGE: the same chains are minted for the same sites, spelled `2|…` instead of `1|…`. Exactly the 12 chain-minting languages drifted; c, cobol and dart did not, which is the check that this is the prefix and not a capture regression. Accompanied by SCHEMA_BUMP 34 -> 37 and INCREMENTAL_SCHEMA_VERSION 28 -> 31 so a stale index is rejected rather than replaying chains a v2 decoder refuses. Prior d3c4d2fa0d82d248a2299cfc888b067187ad1faf2c87a97f93c6ed835eefc3f1 -> c1f0cc9058ab11b7cd6fc8b440deb6db2b2f530f2eb21178923e68a3d0796c4b.", + "_rebaselined_2766_await_subscript_emission": "#2766: extractMixedChain now walks THROUGH await and subscript nodes and peels transparent wrappers at loop entry, so sites whose receiver is `repos[0]` or `(await f())` mint a receiver chain where they previously minted none. EMISSION CHANGE: more sites carry `@reference.receiver-chain`; no existing chain changed shape. Only go and kotlin drifted of 15 — the two whose fixture corpora contain such receivers. Prior c1f0cc9058ab11b7cd6fc8b440deb6db2b2f530f2eb21178923e68a3d0796c4b -> efd5dbf80ffcd3bab2834d1010f6fe2b239dcc5d58229938dea9cff8d0f380f2.", "_rebaselined_2960_declared_package_fixture": "#2960 adds four Kotlin declared-package import-resolution fixture files. This is fixture-corpus growth only: fixture_count 137 -> 141 and capture_groups_fp 2334 -> 2367; the synthetic capture counts remain 4753/15203, no Kotlin scope-capture query or implementation changed, and package resolution runs after capture. Other language fingerprints matched their baselines in the same CI run. Prior a184f8ff0ae40d246db855b63f7ff26bda3afac03e5f4c76e4593c7e2cefce54 -> f98e7e936afbce0e99588285cfc603bf945fd58c5de45271860509a5d90eb832.", "capture_groups_small": 5253, "capture_groups_large": 16803, @@ -288,7 +290,7 @@ "fixture_count": 142, "_rebaselined_1432_member_call_callee_name": "#1432 (Zig): the shared callable-flow reader no longer names a callee by simple name for a MEMBER call (`@callable-flow.direct-callee-name` requires a direct designator: `f(x)`, `ns.f(x)`), and a member call is a field-stored-callable invoke only when a MEMBER store (`o.f = handler`) or a declared callable-typed field is visible - a same-named plain binding no longer gates it. CAPTURE-EMISSION CHANGE, not fixture growth (fixture_count unchanged). Only drift: `users.map { it.name }.forEach { name -> println(name) }` (kotlin-lambda-scopes/App.kt) loses `direct-callee-name|forEach` (member call). capture_groups_fp 2334 (unchanged). Prior a184f8ff0ae40d246db855b63f7ff26bda3afac03e5f4c76e4593c7e2cefce54 -> 5a181af0dbc9451937da0964c40d3f3f9820914ca429d873bb5c812b5e2b9284.", "_rebaselined_1432_rebase_onto_2960": "#1432 rebase onto main @ aac7515d: the kotlin fingerprint is a COMBINATION of two independent changes, so neither side of the merge conflict was correct on its own and resolving it by picking a side would have committed a fingerprint no run can reproduce. main's #2960 added four declared-package fixture files (fixture_count 137 -> 141, capture_groups_fp 2334 -> 2367); this branch's `_rebaselined_1432_member_call_callee_name` drops `direct-callee-name|forEach` from one member call. Recomputed under both: capture_groups_fp 2367 and fixture_count 141 match main's committed counts EXACTLY (this branch's change is emission-only and moves no count), capture_groups_small/large stay 4753/15203 (the SYNTHETIC scaling source, which neither change touches), scaling 1.003 < 1.5, and the other 14 languages report ok against their committed baselines in the same run - which is the check that the rebase replayed nothing else into the capture stream. Attribution is exact rather than inferred: moving test/fixtures/lang-resolution/kotlin-import-package-evidence aside and re-running returns kotlin to 5a181af0dbc9451937da0964c40d3f3f9820914ca429d873bb5c812b5e2b9284 byte-for-byte with fixture_count back at 137 and capture_groups_fp back at 2334 - this branch's pre-rebase value - so the whole delta is #2960's corpus growth layered on top, with nothing else moving. Prior (this branch, pre-rebase) 5a181af0dbc9451937da0964c40d3f3f9820914ca429d873bb5c812b5e2b9284 and (main) f98e7e936afbce0e99588285cfc603bf945fd58c5de45271860509a5d90eb832 -> 973d702510002dda76166e017c5eca90cae37a139f5a512877b7a1b04ad19dc5.", - "_rebaselined_1432_merge_main_2885": "#1432 merge of main @ 212e007a: the kotlin fingerprint is again a COMBINATION of two independent changes \u2014 main's #2885 JVM property accessors / interface-abstract (4753/15203 -> 5753/18403, capture_groups_fp 2367 -> 2563) and this branch's `_rebaselined_1432_member_call_callee_name` (drops `direct-callee-name|forEach` from one member call). Neither side's value reproduces under the merged tree. Recomputed under both: counts 5753/18403/2563 and fixture_count 141 match main's committed counts EXACTLY (this branch's change is emission-only), scaling 1.061 < 1.5, and csharp / cpp / typescript measure byte-for-byte at this branch's committed values (main did not touch them since the merge-base) while the other 11 languages report ok \u2014 the check that the merge replayed nothing else into the capture stream. Prior (main) aeafc7a87402c933786ef582b7c98683b1822b78fa909e605cb97552867fa0d5 and (this branch) 973d702510002dda76166e017c5eca90cae37a139f5a512877b7a1b04ad19dc5 -> a9d3f0db7547ff47856159debf15d2a6f427efca97a6af27b4004174ed432132.", + "_rebaselined_1432_merge_main_2885": "#1432 merge of main @ 212e007a: the kotlin fingerprint is again a COMBINATION of two independent changes — main's #2885 JVM property accessors / interface-abstract (4753/15203 -> 5753/18403, capture_groups_fp 2367 -> 2563) and this branch's `_rebaselined_1432_member_call_callee_name` (drops `direct-callee-name|forEach` from one member call). Neither side's value reproduces under the merged tree. Recomputed under both: counts 5753/18403/2563 and fixture_count 141 match main's committed counts EXACTLY (this branch's change is emission-only), scaling 1.061 < 1.5, and csharp / cpp / typescript measure byte-for-byte at this branch's committed values (main did not touch them since the merge-base) while the other 11 languages report ok — the check that the merge replayed nothing else into the capture stream. Prior (main) aeafc7a87402c933786ef582b7c98683b1822b78fa909e605cb97552867fa0d5 and (this branch) 973d702510002dda76166e017c5eca90cae37a139f5a512877b7a1b04ad19dc5 -> a9d3f0db7547ff47856159debf15d2a6f427efca97a6af27b4004174ed432132.", "_rebaselined_3354_callable_alternatives": "#3354 callable alternatives: a callable chosen by a value-selecting source now flows every branch it can yield (`a ?? b`, `a || b`, `a or b`, `c ? a : b`, statement `if`, elvis), and an operator branch (`x == f || g`) stays opaque instead of seeding a qualified name. Verified by running the BASE (merge-base 233ca2849) and HEAD emitters over the SAME HEAD fixture corpus: every added or removed match is an `@callable-flow.*` match on one of those sources, and the pre-existing corpus is byte-identical (all other languages: zero delta). The rest of the drift is corpus growth from this PR's regression fixture, which this bench globs. Corpus growth: kotlin-callable-alternatives/App.kt (+1 file, +71 groups). Emitter delta: +8 / -2: elvis and `if` expression (bare and braced) seeds and copies now name each operand; the 2 removed matches are the whole-expression seed and copy carrying a qualified name of the compound source; the multi-statement `if` stays opaque. capture_groups_fp 2563 -> 2634, fixture_count 141 -> 142; synthetic counts unchanged; scaling 1.17 < 1.5. Prior a9d3f0db7547ff47856159debf15d2a6f427efca97a6af27b4004174ed432132 -> f3fefe058484823761b52df5715f41d65fa4ff0223843bcc86893d7b0a6b3de2.", "_rebaselined_3486_semantic_rename": "#3486: Compared actual origin/main (191a954b), committed dd3bf and frozen provider source over the same unchanged corpus. 1 existing member-read match gains a receiver-chain tag; removing only that added tag restores the complete main capture set. No group is added or removed. Fixture entries 142; changed entries 1; capture groups 2634 -> 2634. Fingerprint regenerated from the runner's canonicalized capture records. Scaling budgets unchanged." }, @@ -296,6 +298,6 @@ "_lexical_ownership_3532": "#3532: lexical ownership captures and fixture updates; fixture identities are relative to lang-resolution so serialized scope IDs are independent of checkout location. Full capture content remains hashed; scaling_budget is unchanged.", "fingerprint": "3f41a3c6d9161f95c0c906cc979e6ef853c25b39052c5cab274dba2aabf270ba", "scaling_budget": 1.5, - "_added": "#3354 review: one TS `handler || w === \"k0\" || \u2026` chain, operand count = entity count (250 -> 800). Guards callable-flow value-alternative expansion (valueAlternatives + per-leaf visibility walks) against per-leaf cost that grows with chain depth: before the fix this measured 7.5-8.0 (super-linear; 8000 operands overflowed the stack), after it 1.11-1.22. Synthetic-only fingerprint (no fixture corpus); identical before and after the fix." + "_added": "#3354 review: one TS `handler || w === \"k0\" || …` chain, operand count = entity count (250 -> 800). Guards callable-flow value-alternative expansion (valueAlternatives + per-leaf visibility walks) against per-leaf cost that grows with chain depth: before the fix this measured 7.5-8.0 (super-linear; 8000 operands overflowed the stack), after it 1.11-1.22. Synthetic-only fingerprint (no fixture corpus); identical before and after the fix." } } diff --git a/gitnexus/src/core/ingestion/finalize-orchestrator.ts b/gitnexus/src/core/ingestion/finalize-orchestrator.ts index 0c1701778..e72182acd 100644 --- a/gitnexus/src/core/ingestion/finalize-orchestrator.ts +++ b/gitnexus/src/core/ingestion/finalize-orchestrator.ts @@ -159,6 +159,7 @@ export function finalizeScopeModel( namespaceFqnBindings: new Map(), namespaceTypeBindings: new Map(), accessibleNamespacesByScope: new Map(), + namespaceLookupTiersByScope: new Map(), referenceSites: Object.freeze([...allReferenceSites]), sccs: finalizeOut.sccs, stats: finalizeOut.stats, diff --git a/gitnexus/src/core/ingestion/languages/csharp/namespace-siblings.ts b/gitnexus/src/core/ingestion/languages/csharp/namespace-siblings.ts index 10aefb45e..3ac1f00f7 100644 --- a/gitnexus/src/core/ingestion/languages/csharp/namespace-siblings.ts +++ b/gitnexus/src/core/ingestion/languages/csharp/namespace-siblings.ts @@ -26,8 +26,9 @@ * / `Scope.typeBindings`. That per-file copy was O(files²) for a * concentrated namespace and OOM'd large solutions (#1871; the global * twin was fixed in #1905/#1954). The walkers consult these channels - * gated by `accessibleNamespacesByScope` (a file's own namespace + - * `using` targets), so visibility is unchanged — only the storage is + * gated by `accessibleNamespacesByScope` (a file's own and enclosing + * namespaces, the global namespace, and `using` targets, in C# lookup + * order), so visibility is unchanged — only the storage is * shared. Finalized bindings remain first in `lookupBindingsAt`, and * local lexical `Scope.bindings` remains the first-tier shadowing * channel. (`using static` member exposure still uses the per-scope @@ -478,9 +479,9 @@ export function populateCsharpNamespaceSiblings( // both time and memory and OOM'd large no-namespace solutions (tens of // thousands of files in the global bucket → billions of Map entries). This // mirrors how Roslyn resolves against a single `Compilation.GlobalNamespace` - // symbol instead of per-file copies, and is the typeBindings analogue of the - // `workspaceFqnBindings` fast-path (#1905). `findReceiverTypeBinding` / - // `followChainPostFinalize` consult this channel as a final fallback. + // symbol instead of per-file copies (#1905). `findReceiverTypeBinding` / + // `followChainPostFinalize` consult this channel as a final fallback. Global + // class bindings go through the per-namespace channel instead (see below). const workspaceTypeBindings = indexes.workspaceTypeBindings as Map; const globalBucket = buckets.get(''); if (globalBucket !== undefined) { @@ -523,38 +524,94 @@ export function populateCsharpNamespaceSiblings( } } - // Materialize each file's accessible namespaces (its own declared namespaces + - // every `using namespace X;` target, plus dotted-path prefixes), keyed by the - // file's Module scope id. This is the SAME accessibility set the per-file copy - // above used to derive — now stored so the language-neutral walkers can gate - // their `namespaceFqnBindings` / `namespaceTypeBindings` lookups to exactly the - // namespaces a file can see. The global ('') namespace is excluded: it is - // type-visible everywhere and handled by the flat workspace channels. + // Namespace lookup follows declaration scopes. Types from one precedence + // group compete together; a nearer group hides later groups. const accessibleNamespacesByScope = indexes.accessibleNamespacesByScope as Map; + const namespaceTiers = indexes.namespaceLookupTiersByScope as + | Map + | undefined; for (const parsed of parsedFiles) { - const moduleScope = parsed.scopes.find((s) => s.kind === 'Module'); + const moduleScope = parsed.scopes.find((scope) => scope.kind === 'Module'); if (moduleScope === undefined) continue; - const accessibleNamespaces = new Set(); - const struct = structureByFile.get(parsed.filePath); - if (struct !== undefined) { - for (const n of struct.namespaces) accessibleNamespaces.add(n); + const declared = structureByFile.get(parsed.filePath)?.namespaces ?? []; + const usings = usingTargetsByDeclaration(parsed, declared); + const namespaceScopes = parsed.scopes + .filter((scope) => scope.kind === 'Namespace') + .sort((a, b) => comparePositions(a.range.startLine, a.range.startCol, b.range)); + const namesByScope = new Map(); + for (let i = 0; i < namespaceScopes.length; i++) { + const scope = namespaceScopes[i]!; + const name = declaredNameAt(declared, namespaceScopes.length, i); + const parentName = scope.parent === null ? undefined : namesByScope.get(scope.parent); + if (name !== undefined) + namesByScope.set(scope.id, parentName === undefined ? name : `${parentName}.${name}`); } - for (const imp of parsed.parsedImports) { - if (imp.kind === 'namespace' && imp.targetRaw !== null) { - accessibleNamespaces.add(imp.targetRaw); + const scopesById = new Map(namespaceScopes.map((scope) => [scope.id, scope])); + const sourceLines = (inputs.fileContents.get(parsed.filePath) ?? '').split('\n'); + const fileScoped = namespaceScopes.find((scope) => { + let inComment = false; + for (let line = scope.range.startLine - 1; line < scope.range.endLine; line++) { + const text = sourceLines[line] ?? ''; + const start = line === scope.range.startLine - 1 ? scope.range.startCol : 0; + for (let column = start; column < text.length; column++) { + if (inComment) { + if (text[column] === '*' && text[column + 1] === '/') { + inComment = false; + column++; + } + continue; + } + if (text[column] === '/' && text[column + 1] === '/') break; + if (text[column] === '/' && text[column + 1] === '*') { + inComment = true; + column++; + continue; + } + if (text[column] === '{') return false; + if (text[column] === ';') return true; + } } - } - const expandedNamespaces = new Set(accessibleNamespaces); - for (const ns of accessibleNamespaces) { - const segments = ns.split('.'); - for (let i = segments.length - 1; i > 0; i--) { - expandedNamespaces.add(segments.slice(0, i).join('.')); + return false; + }); + const install = (scopeId: ScopeId, owner?: Scope): void => { + const tiers: string[][] = []; + const seen = new Set(); + const imported: string[] = []; + const addNamespace = (name: string): void => { + if (!seen.has(name)) { + seen.add(name); + tiers.push([name]); + } + }; + const visited = new Set(); + let current = owner; + while (current !== undefined && !visited.has(current.id)) { + visited.add(current.id); + const name = namesByScope.get(current.id); + if (name !== undefined) { + addNamespace(name); + const targets = usings.byDeclaration.get(current.id) ?? []; + if (targets.length > 0) { + tiers.push([...targets]); + imported.push(...targets); + } + for (const enclosing of enclosingNamespaces(name)) addNamespace(enclosing); + } + current = current.parent === null ? undefined : scopesById.get(current.parent); } - } - expandedNamespaces.delete(''); // global handled by the flat workspace channels - if (expandedNamespaces.size > 0) { - accessibleNamespacesByScope.set(moduleScope.id, [...expandedNamespaces]); - } + addNamespace(''); + if (usings.compilationUnit.length > 0) { + tiers.push([...usings.compilationUnit]); + imported.push(...usings.compilationUnit); + } + for (const target of imported) { + for (const prefix of enclosingNamespaces(target)) addNamespace(prefix); + } + accessibleNamespacesByScope.set(scopeId, [...new Set(tiers.flat())]); + namespaceTiers?.set(scopeId, tiers); + }; + install(moduleScope.id, fileScoped); + for (const scope of namespaceScopes) install(scope.id, scope); } // `using static X.Y.Z;` — expose every public static method of @@ -633,20 +690,14 @@ export function populateCsharpNamespaceSiblings( // augmentation removes an O(importers × bucket-size) fanout on popular // namespaces — the cross-namespace twin of the same-namespace blow-up. - // Workspace-level binding channel for global-namespace types (see the - // global fast-path below). `lookupBindingsAt` consults this as a third - // source after finalized + per-scope augmented bindings. Its inner arrays - // are mutable by contract (append-only, like `bindingAugmentations` — see - // the ScopeResolutionIndexes doc + validateBindingsImmutability), so the - // ReadonlyMap→Map cast is localized to this one line and all writes go - // through `getWorkspaceBucket`. - const workspace = indexes.workspaceFqnBindings as Map; - // Per-namespace binding channel for NAMED-namespace class visibility — the - // namespace-scoped analogue of `workspace`, populated once per named bucket - // (#1871). Replaces the per-scope `bindingAugmentations` fanout (O(scopes × - // defs)) for same-namespace siblings AND the per-file cross-namespace-`using` - // injection above. `lookupBindingsAt` consults it gated by - // `accessibleNamespacesByScope`. + // Per-namespace binding channel for class visibility, populated once per + // bucket (#1871), the global ('') bucket included. Replaces the per-scope + // `bindingAugmentations` fanout (O(scopes × defs)) for same-namespace + // siblings AND the per-file cross-namespace-`using` injection above. + // `lookupBindingsAt` consults it gated by `accessibleNamespacesByScope`. + // Its inner arrays are mutable by contract (append-only, like + // `bindingAugmentations`; see the ScopeResolutionIndexes doc and + // validateBindingsImmutability). const namespaceFqn = indexes.namespaceFqnBindings as Map>; for (const [nsName, bucket] of buckets) { @@ -670,42 +721,20 @@ export function populateCsharpNamespaceSiblings( arr.push(def); } - // Global-namespace fast path (Unity OOM guard). Types declared in the - // default (global) namespace are visible from EVERY file in C# — the - // global namespace is always implicitly in scope — so one workspace- - // level entry per simple name is both semantically correct and O(D) - // instead of the O(S·D) per-scope augmentation that materialized - // billions of BindingRefs on large Unity solutions (tens of thousands - // of global types × tens of thousands of scopes). `walkScopeChain` - // checks local `scope.bindings` first, so local declarations still - // shadow these workspace entries; a file resolving its own global type - // hits the local binding before this map. Dedup by `def.nodeId` keeps - // partial-class / duplicate declarations from double-emitting. - if (nsName === '') { - for (const [name, defs] of defsByName) { - const bucket = getWorkspaceBucket(workspace, name); - const seen = new Set(); - for (const b of bucket) seen.add(b.def.nodeId); - for (const def of defs) { - if (seen.has(def.nodeId)) continue; // dedup by nodeId (keeps partials, drops re-emits) - seen.add(def.nodeId); - bucket.push({ def, origin: 'namespace' }); - } - } - continue; - } - - // Named-namespace fast path (#1871) — the namespace-scoped mirror of the - // global path above. One `namespaceFqnBindings[nsName]` entry per simple - // name, O(D) per bucket, instead of the prior O(scopes × defs) per-scope - // augmentation that materialized O(files²) BindingRefs for a concentrated - // named namespace. `lookupBindingsAt` consults this gated by - // `accessibleNamespacesByScope` and ranks finalized `scope.bindings` - // (local declarations) ABOVE it, so local types still shadow — exactly as - // `walkScopeChain` shadows the global workspace entries. Dedup by + // One `namespaceFqnBindings[nsName]` entry per simple name, O(D) per + // bucket, instead of the prior O(scopes × defs) per-scope augmentation + // that materialized O(files²) BindingRefs for a concentrated namespace + // (#1871), and billions for the global bucket of a large Unity solution + // (tens of thousands of global types × tens of thousands of scopes). + // Global types share this channel rather than a scope-independent one: + // the walkers consult it at the provider's owning scopes through their + // ordered accessibility list, so a global type no longer answers from a + // method scope before the walk reaches the file's own namespace. + // `lookupBindingsAt` ranks finalized `scope.bindings` (local declarations) + // ABOVE this channel, so local types still shadow it. Dedup by // `def.nodeId` keeps partial-class / duplicate declarations from - // double-emitting. (The prior local-shadow and self-reference skips are now - // handled by lookup precedence, identical to the global path.) + // double-emitting. (The prior local-shadow and self-reference skips are + // handled by lookup precedence.) let nsMap = namespaceFqn.get(nsName); for (const [name, defs] of defsByName) { let bucketArr = nsMap?.get(name); @@ -755,20 +784,89 @@ function getAugmentationBucket( return bucketArr; } -/** Get-or-create a mutable inner bucket inside the `workspaceFqnBindings` - * channel (the scope-independent third channel; see - * `ScopeResolutionIndexes.workspaceFqnBindings`). Like - * `getAugmentationBucket`, the inner arrays are mutable by contract — - * callers `push` directly. Keeping the get-or-create here means the one - * ReadonlyMap→Map cast at the call site is the only place the mutable - * view is taken. */ -function getWorkspaceBucket(workspace: Map, name: string): BindingRef[] { - let bucketArr = workspace.get(name); - if (bucketArr === undefined) { - bucketArr = []; - workspace.set(name, bucketArr); +/** `using` targets of one file, grouped by the declaration that owns them. */ +interface UsingTargetsByDeclaration { + readonly byDeclaration: ReadonlyMap; + /** Directives at compilation-unit level. */ + readonly compilationUnit: readonly string[]; +} + +/** + * Group a file's `using` targets by the declaration that owns them, which is + * the level C# name lookup consults them at. + * + * A directive belongs to the last namespace declaration that starts before it. + * For a block namespace, that declaration contains it. A file-scoped + * `namespace X;` scope covers only its own line, and the directives after it + * still belong to `X`. Directives cannot follow a closed block namespace + * (CS1529), so the rule needs no other case. Namespace scopes pair with + * `declared` by source order. When the counts disagree, as with an incomplete + * line scan, every namespace-level directive goes to the first declared + * namespace, matching how top-level classes are attributed above. + */ +function usingTargetsByDeclaration( + parsed: ParsedFile, + declared: readonly string[], +): UsingTargetsByDeclaration { + const namespaceScopes = parsed.scopes + .filter((s) => s.kind === 'Namespace') + .sort((a, b) => comparePositions(a.range.startLine, a.range.startCol, b.range)); + const byDeclaration = new Map(); + const compilationUnit: string[] = []; + for (const imp of parsed.parsedImports) { + if (imp.kind !== 'namespace' || imp.targetRaw === null) continue; + const at = imp.atRange; + let owner = -1; + if (at !== undefined) { + let lo = 0; + let hi = namespaceScopes.length; + while (lo < hi) { + const mid = Math.floor((lo + hi) / 2); + if (comparePositions(at.startLine, at.startCol, namespaceScopes[mid]!.range) > 0) { + lo = mid + 1; + } else { + hi = mid; + } + } + owner = lo - 1; + } + const name = owner === -1 ? undefined : declaredNameAt(declared, namespaceScopes.length, owner); + if (name === undefined) { + compilationUnit.push(imp.targetRaw); + continue; + } + const ownerScope = namespaceScopes[owner]; + if (ownerScope !== undefined) { + const ownTargets = byDeclaration.get(ownerScope.id) ?? []; + ownTargets.push(imp.targetRaw); + byDeclaration.set(ownerScope.id, ownTargets); + } } - return bucketArr; + return { byDeclaration, compilationUnit }; +} + +/** The declared namespace name for the `index`-th Namespace scope, or the first + * declared name when scopes and declarations do not pair one-to-one. */ +function declaredNameAt( + declared: readonly string[], + scopeCount: number, + index: number, +): string | undefined { + return declared.length === scopeCount ? declared[index] : declared[0]; +} + +/** Sign of position (`line`, `col`) relative to the start of `range`. */ +function comparePositions(line: number, col: number, range: Scope['range']): number { + return line !== range.startLine ? line - range.startLine : col - range.startCol; +} + +/** The namespaces enclosing a dotted namespace name, innermost first: + * `A.B.C` → `A.B`, `A`. The global namespace is not included. */ +function enclosingNamespaces(ns: string): string[] { + const segments = ns.split('.'); + const out: string[] = []; + for (let i = segments.length - 1; i > 0; i--) out.push(segments.slice(0, i).join('.')); + return out; } function isTypeDef(def: SymbolDefinition): boolean { diff --git a/gitnexus/src/core/ingestion/languages/csharp/scope-resolver.ts b/gitnexus/src/core/ingestion/languages/csharp/scope-resolver.ts index b767e8c3f..8a6a49dd1 100644 --- a/gitnexus/src/core/ingestion/languages/csharp/scope-resolver.ts +++ b/gitnexus/src/core/ingestion/languages/csharp/scope-resolver.ts @@ -6,10 +6,13 @@ * canonical shape. */ -import type { ParsedFile } from 'gitnexus-shared'; +import type { ParsedFile, ScopeId } from 'gitnexus-shared'; import { CLASS_KINDS, SupportedLanguages } from 'gitnexus-shared'; import { buildMro, defaultLinearize } from '../../scope-resolution/passes/mro.js'; -import { populateClassOwnedMembers } from '../../scope-resolution/scope/walkers.js'; +import { + populateClassOwnedMembers, + lookupNameClaim, +} from '../../scope-resolution/scope/walkers.js'; import { populateCsharpNamespacePrefixes } from './qualified-type-names.js'; import type { ScopeResolver } from '../../scope-resolution/contract/scope-resolver.js'; import { @@ -119,6 +122,26 @@ const csharpScopeResolver: ScopeResolver = { // `namespace-siblings.ts` for the implementation. populateNamespaceSiblings: populateCsharpNamespaceSiblings, + isBareClassReceiverCandidate: ({ candidate, spelling, inScope, scopes }) => { + if (candidate.typeParameters === undefined || candidate.typeParameters.length === 0) + return true; + if (spelling.includes('.') || spelling.includes('<') || spelling.includes('::')) return true; + if (candidate.qualifiedName?.split('.').at(-1) !== spelling) return true; + const claim = lookupNameClaim(inScope, spelling, scopes, { purpose: 'value' }); + if (claim.imports.some((edge) => edge.kind === 'alias')) return true; + const visited = new Set(); + let current: ScopeId | null = inScope; + while (current !== null && !visited.has(current)) { + visited.add(current); + const scope = scopes.scopeTree.getScope(current); + if (scope === undefined) break; + if (scope.kind === 'Class' && scope.ownedDefs.some((def) => def.nodeId === candidate.nodeId)) + return true; + current = scope.parent; + } + return false; + }, + // C# is statically typed — type information is reliable. Field- // fallback heuristic stays off (the type-binding layer already // produces precise owner types); return-type propagation on is fine diff --git a/gitnexus/src/core/ingestion/model/scope-resolution-indexes.ts b/gitnexus/src/core/ingestion/model/scope-resolution-indexes.ts index 4f8ed0ee6..129befbf1 100644 --- a/gitnexus/src/core/ingestion/model/scope-resolution-indexes.ts +++ b/gitnexus/src/core/ingestion/model/scope-resolution-indexes.ts @@ -81,12 +81,14 @@ export interface ScopeResolutionIndexes { /** Workspace-level binding lookup, shared instead of per-scope * duplication. Consulted by `lookupBindingsAt` as a third source after * finalized and per-scope augmented bindings. Language-specific - * namespace-sibling hooks populate it with disjoint key formats that - * never collide — e.g. backslash-separated FQNs (`App\Models\User`) for - * backslash-namespace languages, and bare simple names (`User`) for - * global-/default-namespace types that are visible from every file. The - * shared map gives those workspace-wide names one entry each instead of - * O(scopes × defs) per-scope augmentation. */ + * namespace-sibling hooks populate it with keys that mean the same thing + * from every scope — e.g. backslash-separated FQNs (`App\Models\User`) for + * backslash-namespace languages. The shared map gives those workspace-wide + * names one entry each instead of O(scopes × defs) per-scope augmentation. + * It answers at EVERY scope, ahead of anything an enclosing scope binds, so + * a bare simple name belongs here only if no nearer declaration can hide + * it. A default namespace whose simple names rank below the file's own + * namespaces goes through `namespaceFqnBindings` under its own key instead. */ readonly workspaceFqnBindings: ReadonlyMap; /** Workspace-level *type* binding lookup — the typeBindings analogue of * `workspaceFqnBindings`. Holds names that are type-visible from every file @@ -123,16 +125,17 @@ export interface ScopeResolutionIndexes { * after the per-scope chain and the flat `workspaceTypeBindings` miss. * Populated post-finalize; most languages leave it empty. */ readonly namespaceTypeBindings: ReadonlyMap>; - /** Accessibility gate for the per-namespace channels: maps a module ScopeId to - * the namespace names type-visible from that file — its own declared - * namespace(s) plus every imported/`using`d namespace (and dotted prefixes). - * This is the same per-file accessible-namespace set the C# hook already - * derives (`expandedNamespaces`), materialized so the language-neutral walkers - * can consult `namespaceFqnBindings` / `namespaceTypeBindings` for exactly the - * namespaces a file can see — preserving namespace visibility semantics - * without the per-file binding copy. Empty when no language populates the - * namespace channels. */ + /** Accessibility gate for the per-namespace channels. A declaration or module + * scope maps to the namespace names visible there, including enclosing and + * global namespaces where the provider permits them. Provider ordering + * preserves lookup precedence without copying definitions into every scope. + * Empty for bundles that do not populate the namespace channels. */ readonly accessibleNamespacesByScope: ReadonlyMap; + /** Optional precedence groups for namespace lookup. Candidates in one group + * compete together; the first group containing a name hides later groups. + * Keys may be declaration scopes as well as module scopes. Bundles that + * omit this channel retain their existing flat accessibility semantics. */ + readonly namespaceLookupTiersByScope?: ReadonlyMap; /** Pre-resolution usage facts; consumed by the resolution phase. */ readonly referenceSites: readonly ReferenceSite[]; /** SCC condensation of the file-level import graph — callers that want diff --git a/gitnexus/src/core/ingestion/scope-resolution/contract/scope-resolver.ts b/gitnexus/src/core/ingestion/scope-resolution/contract/scope-resolver.ts index e87ce34f9..9228f84ea 100644 --- a/gitnexus/src/core/ingestion/scope-resolution/contract/scope-resolver.ts +++ b/gitnexus/src/core/ingestion/scope-resolution/contract/scope-resolver.ts @@ -167,7 +167,7 @@ * unconditionally), and `indexes.namespaceFqnBindings` + * `indexes.namespaceTypeBindings` (per-namespace, consulted only for the * namespaces in `indexes.accessibleNamespacesByScope` for the caller's - * module). All but `indexes.bindings` are mutable post-finalize and + * owning scope). All but `indexes.bindings` are mutable post-finalize and * populated by hooks; only `indexes.bindings` is frozen. * * `indexes.bindings` is the **finalize-output channel**. After @@ -1117,6 +1117,17 @@ export interface ScopeResolver { */ readonly isNamespaceMemberVisible?: (ctx: { readonly member: SymbolDefinition }) => boolean; + /** Optional compatibility rule for bare class-name receivers. Runs before + * namespace precedence selection, so an incompatible declaration cannot + * hide a compatible declaration in an enclosing namespace. Value receivers + * and declared-type lookups keep their existing rules. */ + readonly isBareClassReceiverCandidate?: (ctx: { + readonly candidate: SymbolDefinition; + readonly spelling: string; + readonly inScope: ScopeId; + readonly scopes: ScopeResolutionIndexes; + }) => boolean; + /** * When true, a qualified receiver is walked SEGMENT BY SEGMENT from its * verified namespace root instead of being split once at the last dot: diff --git a/gitnexus/src/core/ingestion/scope-resolution/passes/imported-return-types.ts b/gitnexus/src/core/ingestion/scope-resolution/passes/imported-return-types.ts index fd0b24657..dba94193a 100644 --- a/gitnexus/src/core/ingestion/scope-resolution/passes/imported-return-types.ts +++ b/gitnexus/src/core/ingestion/scope-resolution/passes/imported-return-types.ts @@ -56,7 +56,6 @@ import { lookupNameClaim, findReceiverTypeBinding, namesAtScope, - moduleScopeIdOf, namespaceTypeBindingFor, } from '../scope/walkers.js'; @@ -236,9 +235,6 @@ export function followChainPostFinalize( ): TypeRef { let current = start; const visited = new Set(); - // The caller's module scope is fixed across the walk; resolve it once so the - // accessibility-gated per-namespace fallback below can be consulted cheaply. - const moduleScopeId = moduleScopeIdOf(fromScopeId, scopes); for (let depth = 0; depth < RECHAIN_MAX_DEPTH; depth++) { const lookupScope = current.declaredAtScope ?? fromScopeId; if (current.rawName.includes('.')) { @@ -291,7 +287,7 @@ export function followChainPostFinalize( // Both live in shared channels rather than each Scope.typeBindings to avoid // the O(files × names) blow-up. if (next === undefined && claim.status === 'absent') { - const nsHit = namespaceTypeBindingFor(moduleScopeId, current.rawName, scopes); + const nsHit = namespaceTypeBindingFor(lookupScope, current.rawName, scopes); if (nsHit !== undefined && nsHit !== current) next = nsHit; } if (next === undefined && claim.status === 'absent') { diff --git a/gitnexus/src/core/ingestion/scope-resolution/passes/receiver-bound-calls.ts b/gitnexus/src/core/ingestion/scope-resolution/passes/receiver-bound-calls.ts index 4eee46061..dc288a8b9 100644 --- a/gitnexus/src/core/ingestion/scope-resolution/passes/receiver-bound-calls.ts +++ b/gitnexus/src/core/ingestion/scope-resolution/passes/receiver-bound-calls.ts @@ -212,6 +212,7 @@ type ReceiverBoundProviderSubset = Pick< | 'markConstructionSites' | 'namespaceExportsIncludeImportedNames' | 'isNamespaceMemberVisible' + | 'isBareClassReceiverCandidate' | 'importsBindAtLexicalScope' | 'resolveNamespaceChains' >; @@ -1923,11 +1924,22 @@ export function emitReceiverBoundCalls( // opted in. Only a bare tail is walked here; `ns.Type.field.m()` is the // compound resolver's shape. sourceBindingGrounded = true; + const classReceiverCandidate = provider.isBareClassReceiverCandidate; const classDef = findClassBindingInScope(site.inScope, receiverName, scopes, undefined, { onNameFallback, position: site.atRange, purpose: 'value', + classCandidateFilter: + classReceiverCandidate === undefined + ? undefined + : (candidate) => + classReceiverCandidate({ + candidate, + spelling: receiverName, + inScope: site.inScope, + scopes, + }), }) ?? resolveNamespaceQualifiedClass(receiverName, site.inScope, namespaceTargets, site.atRange); if (classDef !== undefined) { diff --git a/gitnexus/src/core/ingestion/scope-resolution/pipeline/validate-bindings-immutability.ts b/gitnexus/src/core/ingestion/scope-resolution/pipeline/validate-bindings-immutability.ts index 19c2805af..320b95bf1 100644 --- a/gitnexus/src/core/ingestion/scope-resolution/pipeline/validate-bindings-immutability.ts +++ b/gitnexus/src/core/ingestion/scope-resolution/pipeline/validate-bindings-immutability.ts @@ -75,10 +75,10 @@ export function validateBindingsImmutability( } // Third channel: `workspaceFqnBindings` (scope-independent, shared map - // populated by language namespace-sibling hooks — PHP FQN keys, C# - // global-namespace simple names). Like bindingAugmentations its inner - // arrays are mutable by contract (hooks `push()` directly), so freezing - // one is the same defect as freezing an augmentation bucket. + // populated by language namespace-sibling hooks — e.g. PHP FQN keys). Like + // bindingAugmentations its inner arrays are mutable by contract (hooks + // `push()` directly), so freezing one is the same defect as freezing an + // augmentation bucket. for (const [name, bucket] of indexes.workspaceFqnBindings) { if (Object.isFrozen(bucket)) { onWarn( diff --git a/gitnexus/src/core/ingestion/scope-resolution/scope/walkers.ts b/gitnexus/src/core/ingestion/scope-resolution/scope/walkers.ts index 9b8fc5c87..863b8c48d 100644 --- a/gitnexus/src/core/ingestion/scope-resolution/scope/walkers.ts +++ b/gitnexus/src/core/ingestion/scope-resolution/scope/walkers.ts @@ -49,6 +49,7 @@ import { definitionIdPosition } from '../utils/definition-id.js'; const EMPTY_BINDINGS: readonly BindingRef[] = Object.freeze([]); interface IndexedNameLookupOptions extends NameLookupOptions { + readonly classCandidateFilter?: (def: SymbolDefinition) => boolean; /** Add same-scope candidates beside legacy local bindings. Explicit name * claims still select their own candidates through the shared resolver. */ readonly expandLocalBindings?: ( @@ -58,6 +59,15 @@ interface IndexedNameLookupOptions extends NameLookupOptions { ) => readonly BindingRef[]; } +function compatibleClassBindings( + bindings: readonly BindingRef[], + accept?: (def: SymbolDefinition) => boolean, +): readonly BindingRef[] { + return accept === undefined + ? bindings + : bindings.filter((binding) => !isClassLike(binding.def.type) || accept(binding.def)); +} + /** Resolve ownership before any target-kind filtering or global fallback. */ export function lookupNameClaim( startScope: ScopeId, @@ -72,8 +82,14 @@ export function lookupNameClaim( scopes: scopes.scopeTree, importsAt: (scope) => scopes.imports?.get(scope.id) ?? scope.imports, bindingsAt: (scope, spelling) => { - const local = scope.bindings.get(spelling) ?? []; - const augmented = scopes.bindingAugmentations.get(scope.id)?.get(spelling) ?? []; + const local = compatibleClassBindings( + scope.bindings.get(spelling) ?? EMPTY_BINDINGS, + options.classCandidateFilter, + ); + const augmented = compatibleClassBindings( + scopes.bindingAugmentations.get(scope.id)?.get(spelling) ?? EMPTY_BINDINGS, + options.classCandidateFilter, + ); // Unrelated claims must not change the legacy local binding tier. // Providers may add candidates that share that selected tier. if (local.length > 0 && nameClaimsFor(scope, spelling).length === 0) { @@ -85,7 +101,7 @@ export function lookupNameClaim( ) ?? EMPTY_BINDINGS; return [ ...local, - ...additional, + ...compatibleClassBindings(additional, options.classCandidateFilter), ...augmented.filter( (binding) => binding.declarationRange !== undefined || binding.availableFrom !== undefined, @@ -94,10 +110,21 @@ export function lookupNameClaim( } return [ ...local, - ...(scopes.bindings.get(scope.id)?.get(spelling) ?? []), + ...compatibleClassBindings( + scopes.bindings.get(scope.id)?.get(spelling) ?? EMPTY_BINDINGS, + options.classCandidateFilter, + ), ...augmented, - ...(collectNamespaceFqnBindings(scope.id, spelling, scopes) ?? []), - ...(scopes.workspaceFqnBindings?.get(spelling) ?? []), + ...(collectNamespaceFqnBindings( + scope.id, + spelling, + scopes, + options.classCandidateFilter, + ) ?? []), + ...compatibleClassBindings( + scopes.workspaceFqnBindings?.get(spelling) ?? EMPTY_BINDINGS, + options.classCandidateFilter, + ), ]; }, }, @@ -166,11 +193,8 @@ export function lookupBindingsAt( const finalized = scopes.bindings.get(scopeId)?.get(name); const augmented = scopes.bindingAugmentations.get(scopeId)?.get(name); const workspace = scopes.workspaceFqnBindings?.get(name); - // Per-namespace channel (#1871 named-namespace generalization). Gated by - // accessibility: only a *module* scope carries an `accessibleNamespacesByScope` - // entry, so this collects nothing at child scopes and at module scopes only for - // the namespaces that file can see. Empty (no entry) for every non-C# bundle, - // so the behavior of the three pre-existing channels is unchanged. + // Providers attach visible namespace channels to their owning scopes. + // An absent entry leaves the pre-existing channels unchanged. const namespaceRefs = collectNamespaceFqnBindings(scopeId, name, scopes); const fLen = finalized?.length ?? 0; const aLen = augmented?.length ?? 0; @@ -182,11 +206,11 @@ export function lookupBindingsAt( if (fLen === 0 && aLen === 0 && nLen === 0) return workspace!; if (fLen === 0 && aLen === 0 && wLen === 0) return namespaceRefs!; // Merge in precedence order, deduped by `def.nodeId` so the strongest source - // wins duplicate metadata. Named-namespace refs come BEFORE the flat global - // `workspace` channel: pre-#1871 these lived in `bindingAugmentations` (which - // `lookupBindingsAt` already ranks above `workspaceFqnBindings`), so a name in - // both an accessible named namespace and the global namespace must still - // resolve named-first. Order: finalized > augmented > namespace > workspace. + // wins duplicate metadata. Namespace refs come BEFORE the flat `workspace` + // channel: pre-#1871 they lived in `bindingAugmentations` (which + // `lookupBindingsAt` already ranks above `workspaceFqnBindings`), and their + // relative order is the accessibility list's, which the provider sets. + // Order: finalized > augmented > namespace > workspace. const seen = new Set(); const out: BindingRef[] = []; for (const src of [finalized, augmented, namespaceRefs, workspace]) { @@ -203,16 +227,32 @@ export function lookupBindingsAt( /** * Collect `BindingRef`s for `name` from the per-namespace channel * (`namespaceFqnBindings`) across every namespace accessible from `scopeId`. - * Accessibility comes from `accessibleNamespacesByScope`, which is keyed by - * *module* scope id — so this returns `undefined` at non-module scopes and at - * every scope in a bundle that didn't populate the channel (all non-C# today). - * Language-neutral: keyed only by namespace strings and the index. + * Accessibility is supplied by the provider at declaration or module scopes. + * Optional precedence groups stop at the nearest matching group, preserving + * ambiguity within that group. Bundles without groups retain flat collection. */ function collectNamespaceFqnBindings( scopeId: ScopeId, name: string, scopes: ScopeResolutionIndexes, + acceptClass?: (def: SymbolDefinition) => boolean, ): readonly BindingRef[] | undefined { + const tiers = scopes.namespaceLookupTiersByScope?.get(scopeId); + if (tiers !== undefined) { + for (const tier of tiers) { + const candidates: BindingRef[] = []; + for (const namespace of tier) { + candidates.push( + ...compatibleClassBindings( + scopes.namespaceFqnBindings?.get(namespace)?.get(name) ?? EMPTY_BINDINGS, + acceptClass, + ), + ); + } + if (candidates.length > 0) return candidates; + } + return undefined; + } const namespaces = scopes.accessibleNamespacesByScope?.get(scopeId); if (namespaces === undefined || namespaces.length === 0) return undefined; let collected: BindingRef[] | undefined; @@ -220,7 +260,7 @@ function collectNamespaceFqnBindings( const bucket = scopes.namespaceFqnBindings?.get(ns)?.get(name); if (bucket !== undefined && bucket.length > 0) { if (collected === undefined) collected = []; - for (const r of bucket) collected.push(r); + for (const r of compatibleClassBindings(bucket, acceptClass)) collected.push(r); } } return collected; @@ -241,11 +281,11 @@ const EMPTY_NAMES: Iterable = Object.freeze([]) as readonly string[]; * * Scope: enumerates only the per-scope `bindings` and `bindingAugmentations` * channels. It deliberately EXCLUDES the scope-independent - * `workspaceFqnBindings` channel (PHP FQN keys, C# global-namespace simple - * names). `lookupBindingsAt` consults that third channel when resolving a - * specific name, but name *enumeration* here does not — those names apply at - * every scope and would flood per-scope callers. Callers that need - * workspace-level names must read `workspaceFqnBindings` directly. + * `workspaceFqnBindings` channel (FQN keys). `lookupBindingsAt` consults that + * third channel when resolving a specific name, but name *enumeration* here + * does not — those names apply at every scope and would flood per-scope + * callers. Callers that need workspace-level names must read + * `workspaceFqnBindings` directly. */ export function namesAtScope(scopeId: ScopeId, scopes: ScopeResolutionIndexes): Iterable { const finalized = scopes.bindings.get(scopeId); @@ -542,13 +582,12 @@ export function findReceiverTypeBinding( const claim = lookupNameClaim(startScope, receiverName, scopes, options); // An absent name keeps the type an undeclared write gave it in this scope. if (claim.status !== 'absent' || claim.typeBinding !== undefined) return claim.typeBinding; - const moduleScopeId = moduleScopeIdOf(startScope, scopes); // Fallback 1 — named namespaces accessible from this file (own + `using`d), // gated by `accessibleNamespacesByScope`. Consulted BEFORE the global channel // so a more-specific named binding wins, matching the pre-#1871 order where // these lived in the file's own `Scope.typeBindings` (the chain, above the // global fallback). Shared-channel routing avoids the O(files × names) blow-up. - const named = namespaceTypeBindingFor(moduleScopeId, receiverName, scopes); + const named = namespaceTypeBindingFor(startScope, receiverName, scopes); if (named !== undefined) return named; // Fallback 2 — global/default namespace: C# global types are visible from // every file (see `workspaceTypeBindings` doc), so this flat channel is the @@ -558,19 +597,24 @@ export function findReceiverTypeBinding( /** * Resolve a typeBinding for `name` from the per-namespace channel - * (`namespaceTypeBindings`) across the namespaces accessible from `moduleScopeId`. - * First accessible-namespace hit wins. Returns `undefined` when the module has no - * accessibility entry (non-module scope id, or a bundle that didn't populate the - * channel — all non-C# today). Shared by the two typeBindings chain-walkers so - * the named-namespace fallback stays identical between them. + * (`namespaceTypeBindings`) from the nearest scope carrying an accessibility + * entry. First accessible-namespace hit wins. Missing entries and parent cycles + * return no answer. Shared by the two post-finalize type-binding walkers. */ export function namespaceTypeBindingFor( - moduleScopeId: ScopeId | null, + startScopeId: ScopeId | null, name: string, scopes: ScopeResolutionIndexes, ): TypeRef | undefined { - if (moduleScopeId === null) return undefined; - const namespaces = scopes.accessibleNamespacesByScope?.get(moduleScopeId); + let scopeId = startScopeId; + const visited = new Set(); + let namespaces: readonly string[] | undefined; + while (scopeId !== null && !visited.has(scopeId)) { + visited.add(scopeId); + namespaces = scopes.accessibleNamespacesByScope?.get(scopeId); + if (namespaces !== undefined) break; + scopeId = scopes.scopeTree.getScope(scopeId)?.parent ?? null; + } if (namespaces === undefined) return undefined; for (const ns of namespaces) { const hit = scopes.namespaceTypeBindings?.get(ns)?.get(name); @@ -879,7 +923,7 @@ function soleBoundBaseName(bound: string): string | undefined { return base.length === 0 ? undefined : base; } -export type ClassBindingLookup = NameLookupOptions & { +export type ClassBindingLookup = IndexedNameLookupOptions & { /** A selected class came from a workspace-name guess, rather than a * binding/namespace decision. Observers must not treat it as edit proof. */ readonly onNameFallback?: () => void; @@ -970,7 +1014,8 @@ export function findClassBindingInScope( def !== undefined && isClassLike(def.type) && targetFiles.has(def.filePath) && - (lookup?.namespaceMemberVisible?.(def) ?? true) + (lookup?.namespaceMemberVisible?.(def) ?? true) && + (lookup?.classCandidateFilter?.(def) ?? true) ) candidates.set(def.nodeId, def); } @@ -988,7 +1033,11 @@ export function findClassBindingInScope( const qnames = scopes.qualifiedNames.get(receiverName); if (qnames.length === 1) { const def = scopes.defs.get(qnames[0]!); - if (def !== undefined && isClassLike(def.type)) { + if ( + def !== undefined && + isClassLike(def.type) && + (lookup?.classCandidateFilter?.(def) ?? true) + ) { lookup?.onNameFallback?.(); return def; } @@ -1002,7 +1051,11 @@ export function findClassBindingInScope( const simpleIds = scopes.qualifiedNames.get(simple); if (simpleIds.length === 1) { const def = scopes.defs.get(simpleIds[0]!); - if (def !== undefined && isClassLike(def.type)) { + if ( + def !== undefined && + isClassLike(def.type) && + (lookup?.classCandidateFilter?.(def) ?? true) + ) { lookup?.onNameFallback?.(); return def; } diff --git a/gitnexus/test/fixtures/csharp-captures-golden/expected-captures.json b/gitnexus/test/fixtures/csharp-captures-golden/expected-captures.json index 02d621116..e7723c496 100644 --- a/gitnexus/test/fixtures/csharp-captures-golden/expected-captures.json +++ b/gitnexus/test/fixtures/csharp-captures-golden/expected-captures.json @@ -191,6 +191,38 @@ "captureGroups": 25, "digest": "28246dd1c88ecfe07fcee84ba314dbd9e39ccd0c30f20b8fb4633ec71e48e375" }, + "csharp-global-namespace-precedence/Audit/Checker.cs": { + "captureGroups": 12, + "digest": "3d2b6d491fe36886ee16d556d17f725aa7e3abe4c3a060921b95651b3bc789f3" + }, + "csharp-global-namespace-precedence/Audit/Recorder.cs": { + "captureGroups": 12, + "digest": "807da0ef85a563fccf5a350d922c632ba82005bf4596af44784b2a3342904b1b" + }, + "csharp-global-namespace-precedence/Billing/Reports/Summary.cs": { + "captureGroups": 11, + "digest": "c0bb69ad176fdf9c98614e30caf5c5bbd0f19fc177c3599867df6d23ec42bf54" + }, + "csharp-global-namespace-precedence/Billing/Service.cs": { + "captureGroups": 16, + "digest": "67c79d86f33ef9e01aaafeed049dceb50797e1e69ba9280412f10682262a219b" + }, + "csharp-global-namespace-precedence/Billing/Voucher.cs": { + "captureGroups": 20, + "digest": "31c8376a7c60a5303dcc45a67258a25ce16434d93aeaa9de7a7fb6e21915d8d3" + }, + "csharp-global-namespace-precedence/Global/Voucher.cs": { + "captureGroups": 6, + "digest": "936e83dab4b1ed046d7ac5ae868c42672b55a92e475af7a7eff93b9645b946d9" + }, + "csharp-global-namespace-precedence/Program.cs": { + "captureGroups": 8, + "digest": "e7f5a4aed98f0dc1ac2ded7f90dd772dd8f3f33f3f54ffa4df1106585b4d03ad" + }, + "csharp-global-namespace-precedence/Tools/Importer.cs": { + "captureGroups": 10, + "digest": "59a1dc4ccdb9f278140bfce172460c55335c6e6810253a2570259f71a7c36dae" + }, "csharp-grandparent-resolution/Models/A.cs": { "captureGroups": 10, "digest": "159a52b959e021b1a34cc0dfbf1ba1a0748a0f29c84634948e2e85afc75db003" diff --git a/gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Audit/Checker.cs b/gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Audit/Checker.cs new file mode 100644 index 000000000..96bf7bb68 --- /dev/null +++ b/gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Audit/Checker.cs @@ -0,0 +1,14 @@ +namespace Audit +{ + using Billing; + + public class Checker + { + public void Check(Voucher voucher) + { + // A using directive inside a namespace declaration is consulted at + // that namespace's level, before the global namespace. + voucher.Post(); + } + } +} diff --git a/gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Audit/Recorder.cs b/gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Audit/Recorder.cs new file mode 100644 index 000000000..e7c256fad --- /dev/null +++ b/gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Audit/Recorder.cs @@ -0,0 +1,12 @@ +namespace Audit.Trail; + +using Billing; + +public class Recorder +{ + public void Record(Voucher voucher) + { + // A using after a file-scoped namespace belongs to that namespace. + voucher.Post(); + } +} diff --git a/gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Billing/Reports/Summary.cs b/gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Billing/Reports/Summary.cs new file mode 100644 index 000000000..d8234a813 --- /dev/null +++ b/gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Billing/Reports/Summary.cs @@ -0,0 +1,11 @@ +namespace Billing.Reports +{ + public class Summary + { + public void Print(Voucher voucher) + { + // Enclosing namespace: Billing is searched before the global namespace. + voucher.Post(); + } + } +} diff --git a/gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Billing/Service.cs b/gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Billing/Service.cs new file mode 100644 index 000000000..6b25cd2c3 --- /dev/null +++ b/gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Billing/Service.cs @@ -0,0 +1,16 @@ +namespace Billing; + +public class Service +{ + public static void Settle(Voucher voucher) + { + // Same namespace: Billing.Voucher hides the global Voucher. + voucher.Post(); + voucher.Payee.Notify(); + } + + public static Voucher Open() + { + return new Voucher(); + } +} diff --git a/gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Billing/Voucher.cs b/gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Billing/Voucher.cs new file mode 100644 index 000000000..cd8f3c047 --- /dev/null +++ b/gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Billing/Voucher.cs @@ -0,0 +1,22 @@ +namespace Billing; + +public class Voucher +{ + public Payee Payee { get; set; } = new Payee(); + + public void Post() + { + } + + public static Voucher Create() + { + return new Voucher(); + } +} + +public class Payee +{ + public void Notify() + { + } +} diff --git a/gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Global/Voucher.cs b/gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Global/Voucher.cs new file mode 100644 index 000000000..f720c63bd --- /dev/null +++ b/gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Global/Voucher.cs @@ -0,0 +1,8 @@ +// Global (unnamed) namespace. An unrelated type that shares its simple name +// with `Billing.Voucher`. +public class Voucher +{ + public void Post() + { + } +} diff --git a/gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Program.cs b/gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Program.cs new file mode 100644 index 000000000..30bb40568 --- /dev/null +++ b/gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Program.cs @@ -0,0 +1,8 @@ +public class Program +{ + public static void Main(Voucher voucher) + { + // Outside any namespace: the global Voucher. + voucher.Post(); + } +} diff --git a/gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Tools/Importer.cs b/gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Tools/Importer.cs new file mode 100644 index 000000000..0188c2268 --- /dev/null +++ b/gitnexus/test/fixtures/lang-resolution/csharp-global-namespace-precedence/Tools/Importer.cs @@ -0,0 +1,11 @@ +using Billing; + +public class Importer +{ + public void Import(Voucher voucher) + { + // The global namespace's own types are searched before the + // compilation unit's using directives, so this is the global Voucher. + voucher.Post(); + } +} diff --git a/gitnexus/test/integration/csharp-namespace-precedence-boundaries.test.ts b/gitnexus/test/integration/csharp-namespace-precedence-boundaries.test.ts new file mode 100644 index 000000000..8edba6590 --- /dev/null +++ b/gitnexus/test/integration/csharp-namespace-precedence-boundaries.test.ts @@ -0,0 +1,202 @@ +import { describe, expect, it } from 'vitest'; +import fs from 'node:fs/promises'; +import os from 'node:os'; +import path from 'node:path'; +import { runPipelineFromRepo } from '../../src/core/ingestion/pipeline.js'; + +describe('C# namespace lookup boundaries', () => { + it.each([ + { + name: 'an earlier dotted namespace cannot override a later namespace', + files: { + 'Mixed.cs': `namespace Billing.Reports { public class Empty {} } +namespace Audit { public class Checker { public void Check() { var v = new Voucher(); v.Post(); } } }`, + 'Billing.cs': 'namespace Billing; public class Voucher { public void Post() {} }', + 'Audit.cs': 'namespace Audit; public class Voucher { public void Post() {} }', + }, + caller: 'Check', + member: 'Post', + target: 'Audit.cs', + }, + { + name: 'a using inside one namespace cannot leak into a sibling namespace', + files: { + 'Mixed.cs': `namespace Tools { +using Lib; +public class Empty {} +} +namespace Consumer { public class Runner { public void Run() { var t = new Token(); t.Go(); } } }`, + 'Lib.cs': 'namespace Lib; public class Token { public void Go() {} }', + 'Global.cs': 'public class Token { public void Go() {} }', + }, + caller: 'Run', + member: 'Go', + target: 'Global.cs', + }, + { + name: 'a bare type name cannot select a generic type with a different arity', + files: { + 'Global.cs': 'public class ArityToken { public static void Apply() {} }', + 'Client.cs': `namespace Client { +public class ArityToken { public static void Apply() {} } +public class Runner { public void Run() { ArityToken.Apply(); } } +}`, + }, + caller: 'Run', + member: 'Apply', + target: 'Global.cs', + }, + { + name: 'a generic class keeps its own short name inside its body', + files: { + 'Global.cs': 'public class ArityToken { public static void Apply() {} }', + 'Client.cs': `namespace Client { +public class ArityToken { +public static void Apply() {} +public static void Run() { ArityToken.Apply(); } +} +}`, + }, + caller: 'Run', + member: 'Apply', + target: 'Client.cs', + }, + { + name: 'an incompatible generic type cannot hide an enclosing zero-arity type', + files: { + 'Billing.cs': + 'namespace Billing; public class ArityToken { public static void Apply() {} }', + 'Client.cs': `namespace Billing.Client { +public class ArityToken { public static void Apply() {} } +public class Runner { public void Run() { ArityToken.Apply(); } } +}`, + }, + caller: 'Run', + member: 'Apply', + target: 'Billing.cs', + }, + { + name: 'a same-name alias to a closed generic remains a class receiver', + files: { + 'Use.cs': + 'using Result = Lib.Result; public class Runner { public void Run() { Result.Apply(); } }', + 'Lib.cs': 'namespace Lib; public class Result { public static void Apply() {} }', + 'Global.cs': 'public class Result { public static void Apply() {} }', + }, + caller: 'Run', + member: 'Apply', + target: 'Lib.cs', + }, + { + name: 'a nested block namespace uses its qualified identity', + files: { + 'Use.cs': `namespace A { +namespace B { +public class Runner { public void Run() { var t = new Token(); t.Go(); } } +} +}`, + 'AB.cs': 'namespace A.B; public class Token { public void Go() {} }', + 'A.cs': 'namespace A; public class Token { public void Go() {} }', + 'B.cs': 'namespace B; public class Token { public void Go() {} }', + }, + caller: 'Run', + member: 'Go', + target: 'AB.cs', + }, + { + name: 'a trailing semicolon does not make a block namespace file-scoped', + files: { + 'Use.cs': `namespace Tools { +using Lib; +public class Empty {} +}; +public class Runner { public void Run() { var t = new Token(); t.Go(); } }`, + 'Lib.cs': 'namespace Lib; public class Token { public void Go() {} }', + 'Global.cs': 'public class Token { public void Go() {} }', + }, + caller: 'Run', + member: 'Go', + target: 'Global.cs', + }, + { + name: 'a file-scoped namespace may put its semicolon on the next line', + files: { + 'Use.cs': `namespace Actual +; +public class Runner { public void Run() { var t = new Token(); t.Go(); } }`, + 'Actual.cs': 'namespace Actual; public class Token { public void Go() {} }', + 'Global.cs': 'public class Token { public void Go() {} }', + }, + caller: 'Run', + member: 'Go', + target: 'Actual.cs', + }, + { + name: 'comment punctuation cannot classify a block namespace as file-scoped', + files: { + 'Use.cs': `namespace Tools /* ; */ +{ +using Lib; +public class Empty {} +}; +public class Runner { public void Run() { var t = new Token(); t.Go(); } }`, + 'Lib.cs': 'namespace Lib; public class Token { public void Go() {} }', + 'Global.cs': 'public class Token { public void Go() {} }', + }, + caller: 'Run', + member: 'Go', + target: 'Global.cs', + }, + ])( + '$name', + async ({ files, caller, member, target }) => { + const root = await fs.mkdtemp(path.join(os.tmpdir(), 'csharp-lookup-boundary-')); + try { + for (const [name, content] of Object.entries(files)) { + await fs.writeFile(path.join(root, name), content); + } + const result = await runPipelineFromRepo(root, () => {}, {}); + const targets = [...result.graph.iterRelationships()] + .filter( + (edge) => + edge.type === 'CALLS' && + result.graph.getNode(edge.sourceId)?.properties.name === caller && + result.graph.getNode(edge.targetId)?.properties.name === member, + ) + .map((edge) => result.graph.getNode(edge.targetId)?.properties.filePath); + expect(targets).toEqual([target]); + } finally { + await fs.rm(root, { recursive: true, force: true }); + } + }, + 120000, + ); + + it('ranks the global type before a compilation-unit using in type references', async () => { + const root = await fs.mkdtemp(path.join(os.tmpdir(), 'csharp-type-reference-tier-')); + try { + await fs.writeFile( + path.join(root, 'ABilling.cs'), + 'namespace Billing; public class RefVoucher {}', + ); + await fs.writeFile(path.join(root, 'ZGlobal.cs'), 'public class RefVoucher {}'); + await fs.writeFile( + path.join(root, 'Use.cs'), + 'using Billing;\npublic class Box {}\npublic class Consumer { public Box field; }', + ); + const result = await runPipelineFromRepo(root, () => {}, {}); + const targets = [...result.graph.iterRelationships()] + .filter( + (edge) => + edge.type === 'USES' && + result.graph.getNode(edge.sourceId)?.properties.filePath === 'Use.cs' && + result.graph.getNode(edge.targetId)?.properties.name === 'RefVoucher', + ) + .map((edge) => result.graph.getNode(edge.targetId)?.properties.filePath); + expect(targets).not.toEqual([]); + expect(new Set(targets)).toEqual(new Set(['ZGlobal.cs'])); + } finally { + await fs.rm(root, { recursive: true, force: true }); + } + }, 120000); +}); diff --git a/gitnexus/test/integration/resolvers/csharp.test.ts b/gitnexus/test/integration/resolvers/csharp.test.ts index 606eb485f..e10f4771d 100644 --- a/gitnexus/test/integration/resolvers/csharp.test.ts +++ b/gitnexus/test/integration/resolvers/csharp.test.ts @@ -11,6 +11,7 @@ import { getRelationships, getNodesByLabel, getNodesByLabelFull, + getResolutionOutcomes, edgeSet, runPipelineFromRepo, writeFixtureRepo, @@ -2904,3 +2905,55 @@ describe('C# inline constructor receiver resolution', () => { expect(call!.rel.targetId).toContain('Other.DoWork'); }); }); + +// --------------------------------------------------------------------------- +// Global-namespace precedence: a global type must not hide a same-named type +// that C# name lookup reaches first. Inside a namespace declaration a simple +// name binds to the current namespace, then each enclosing one, and the global +// namespace is the outermost. Each namespace declaration's using directives are +// consulted at that level. So the compilation unit's usings come after the +// global namespace's own types. The fixture pairs `Billing.Voucher` with an +// unrelated global `Voucher` in another file. +// --------------------------------------------------------------------------- + +describe('C# global-namespace type precedence', () => { + let result: PipelineResult; + + beforeAll(async () => { + result = await runPipelineFromRepo( + path.join(FIXTURES, 'csharp-global-namespace-precedence'), + () => {}, + ); + }, 60000); + + it.each([ + ['Create', 'Voucher', 'Billing/Voucher.cs', 'own class, constructed inside itself'], + ['Open', 'Voucher', 'Billing/Voucher.cs', 'same-namespace sibling constructor'], + ['Settle', 'Post', 'Billing/Voucher.cs', 'same-namespace sibling member'], + ['Settle', 'Notify', 'Billing/Voucher.cs', 'field chain through the sibling'], + ['Print', 'Post', 'Billing/Voucher.cs', 'enclosing namespace'], + ['Check', 'Post', 'Billing/Voucher.cs', 'using inside a block namespace'], + ['Record', 'Post', 'Billing/Voucher.cs', 'using after a file-scoped namespace'], + ['Main', 'Post', 'Global/Voucher.cs', 'file outside any namespace'], + ['Import', 'Post', 'Global/Voucher.cs', 'global type before compilation-unit using'], + ])('%s -> %s resolves only into %s (%s)', (caller, callee, targetFile) => { + const targetFiles = getRelationships(result, 'CALLS') + .filter((e) => e.source === caller && e.target === callee) + .map((e) => e.targetFilePath); + expect(targetFiles).toEqual([targetFile]); + }); + + it('reads the Payee property of Billing.Voucher in the field chain', () => { + const reads = getRelationships(result, 'ACCESSES') + .filter((e) => e.source === 'Settle') + .map((e) => `${e.targetLabel}:${e.target}@${e.targetFilePath}`); + expect(reads).toEqual(['Property:Payee@Billing/Voucher.cs']); + }); + + it('leaves no receiver unresolved', () => { + const drops = getResolutionOutcomes(result).filter( + (outcome) => outcome.kind === 'suppressed' && outcome.reason === 'receiver-unresolved', + ); + expect(drops).toEqual([]); + }); +}); diff --git a/gitnexus/test/unit/scope-resolution/csharp/csharp-hooks.test.ts b/gitnexus/test/unit/scope-resolution/csharp/csharp-hooks.test.ts index d768dde0d..586759efd 100644 --- a/gitnexus/test/unit/scope-resolution/csharp/csharp-hooks.test.ts +++ b/gitnexus/test/unit/scope-resolution/csharp/csharp-hooks.test.ts @@ -209,7 +209,7 @@ describe('populateCsharpNamespaceSiblings', () => { kind, parent, filePath, - range: { startLine: 1, startColumn: 0, endLine: 10, endColumn: 0 }, + range: { startLine: 1, startCol: 0, endLine: 10, endCol: 0 }, bindings: new Map(), imports: [], ownedDefs, @@ -235,11 +235,19 @@ describe('populateCsharpNamespaceSiblings', () => { const moduleA = scope('scope:a:module', 'Module', 'a.cs'); const moduleB = scope('scope:b:module', 'Module', 'b.cs'); const classB = scope('scope:b:class', 'Class', 'b.cs', moduleB.id, [sibling]); + const namespaceA = { + ...scope('scope:a:namespace', 'Namespace', 'a.cs', moduleA.id), + range: { startLine: 1, startCol: 0, endLine: 1, endCol: 15 }, + }; + const namespaceB = { + ...scope('scope:b:namespace', 'Namespace', 'b.cs', moduleB.id), + range: { startLine: 1, startCol: 0, endLine: 1, endCol: 15 }, + }; const parsedFiles: ParsedFile[] = [ { filePath: 'a.cs', moduleScope: moduleA.id, - scopes: Object.freeze([moduleA]), + scopes: Object.freeze([moduleA, namespaceA]), parsedImports: Object.freeze([]), localDefs: Object.freeze([]), referenceSites: Object.freeze([]), @@ -247,7 +255,7 @@ describe('populateCsharpNamespaceSiblings', () => { { filePath: 'b.cs', moduleScope: moduleB.id, - scopes: Object.freeze([moduleB, classB]), + scopes: Object.freeze([moduleB, namespaceB, classB]), parsedImports: Object.freeze([]), localDefs: Object.freeze([sibling]), referenceSites: Object.freeze([]), @@ -347,17 +355,25 @@ describe('populateCsharpNamespaceSiblings', () => { expect(namespaceFqnBindings.get('Demo')?.get('B')?.[0]?.def.nodeId).toBe('def:b.B'); }); - it('routes global-namespace types to workspaceFqnBindings, not per-scope augmentations (#1871 OOM guard)', () => { - // Types declared with NO `namespace` (the global/default namespace) are - // visible from every C# file, so the hook writes ONE workspace-level entry - // per simple name instead of O(scopes x defs) per-scope augmentations — - // the fix for the #1871 Unity-scale OOM. This pins both halves of that - // contract: global types are reachable via `workspaceFqnBindings`, and the - // per-scope augmentation channel stays empty for them. - // - // Note: the mock MUST supply `workspaceFqnBindings` — the global fast path - // reads `indexes.workspaceFqnBindings` directly, so omitting it (as the - // other tests in this suite do) would throw. + // Every channel the hook writes, so a test can assert which ones stayed empty. + const emptyIndexes = () => ({ + bindings: new Map>(), + bindingAugmentations: new Map>(), + workspaceFqnBindings: new Map(), + workspaceTypeBindings: new Map(), + namespaceFqnBindings: new Map>(), + namespaceTypeBindings: new Map>(), + accessibleNamespacesByScope: new Map(), + }); + + it('routes global-namespace types to the shared per-namespace channel under the global key (#1871 OOM guard)', () => { + // Types declared with NO `namespace` (the global/default namespace) get ONE + // shared entry per simple name instead of O(scopes x defs) per-scope + // augmentations — the fix for the #1871 Unity-scale OOM. They live in + // `namespaceFqnBindings['']`, gated per file like any other namespace, NOT + // in the scope-independent `workspaceFqnBindings` channel: that one answers + // at every scope, so a global type hid the file's own namespace siblings + // from any lookup that started inside a method. const defA = classDef('def:a.A', 'a.cs', 'A'); // simple name => global namespace const defB = classDef('def:b.B', 'b.cs', 'B'); const moduleA = scope('scope:a:module', 'Module', 'a.cs'); @@ -382,41 +398,34 @@ describe('populateCsharpNamespaceSiblings', () => { referenceSites: Object.freeze([]), } as ParsedFile, ]; - const bindingAugmentations = new Map>(); - const workspaceFqnBindings = new Map(); + const indexes = emptyIndexes(); - populateCsharpNamespaceSiblings( - parsedFiles, - { - bindings: new Map(), - bindingAugmentations, - workspaceFqnBindings, - } as unknown as ScopeResolutionIndexes, - { - fileContents: new Map([ - ['a.cs', 'class A { }\n'], // no `namespace` => global - ['b.cs', 'class B { }\n'], - ]), - }, - ); + populateCsharpNamespaceSiblings(parsedFiles, indexes as unknown as ScopeResolutionIndexes, { + fileContents: new Map([ + ['a.cs', 'class A { }\n'], // no `namespace` => global + ['b.cs', 'class B { }\n'], + ]), + }); - // Global types are reachable workspace-wide via simple-name keys. - expect(workspaceFqnBindings.get('A')?.map((b) => b.def.nodeId)).toEqual(['def:a.A']); - expect(workspaceFqnBindings.get('B')?.map((b) => b.def.nodeId)).toEqual(['def:b.B']); + const global = indexes.namespaceFqnBindings.get(''); + expect(global?.get('A')?.map((b) => b.def.nodeId)).toEqual(['def:a.A']); + expect(global?.get('B')?.map((b) => b.def.nodeId)).toEqual(['def:b.B']); // O(D) invariant: one entry per unique simple name, never scopes x defs. - expect(workspaceFqnBindings.size).toBe(2); - // The whole point of the fast path: no per-scope augmentation explosion. - expect(bindingAugmentations.size).toBe(0); - // Workspace entries carry the cross-file `namespace` origin (so shadowing - // precedence in lookupBindingsAt orders them after local/finalized). - expect(workspaceFqnBindings.get('A')?.[0]?.origin).toBe('namespace'); + expect(global?.size).toBe(2); + // Cross-file `namespace` origin, so lookupBindingsAt orders it after + // local/finalized bindings. + expect(global?.get('A')?.[0]?.origin).toBe('namespace'); + // Neither the per-scope nor the scope-independent channel is used. + expect(indexes.bindingAugmentations.size).toBe(0); + expect(indexes.workspaceFqnBindings.size).toBe(0); + // Every file can see the global namespace through its accessibility list. + expect(indexes.accessibleNamespacesByScope.get(moduleA.id)).toEqual(['']); + expect(indexes.accessibleNamespacesByScope.get(moduleB.id)).toEqual(['']); }); - it('keeps every declaration of a repeated global simple name (partial classes across files)', () => { - // Two global-namespace files each declare `Foo` (a partial class split - // across files => distinct nodeIds, same simple name). Both must survive - // in the workspace channel — the fast path de-dups by nodeId, not by name, - // so partial-class members from both files stay resolvable. + it('keeps every declaration of a repeated global simple name', () => { + // Two global-namespace files declare `Foo` with distinct nodeIds. + // Both declarations must survive the shared channel. const foo1 = classDef('def:foo1.Foo', 'foo1.cs', 'Foo'); const foo2 = classDef('def:foo2.Foo', 'foo2.cs', 'Foo'); const moduleA = scope('scope:foo1:module', 'Module', 'foo1.cs'); @@ -441,33 +450,111 @@ describe('populateCsharpNamespaceSiblings', () => { referenceSites: Object.freeze([]), } as ParsedFile, ]; - const bindingAugmentations = new Map>(); - const workspaceFqnBindings = new Map(); + const indexes = emptyIndexes(); - populateCsharpNamespaceSiblings( - parsedFiles, - { - bindings: new Map(), - bindingAugmentations, - workspaceFqnBindings, - } as unknown as ScopeResolutionIndexes, - { - fileContents: new Map([ - ['foo1.cs', 'class Foo { }\n'], - ['foo2.cs', 'class Foo { }\n'], - ]), - }, - ); + populateCsharpNamespaceSiblings(parsedFiles, indexes as unknown as ScopeResolutionIndexes, { + fileContents: new Map([ + ['foo1.cs', 'class Foo { }\n'], + ['foo2.cs', 'class Foo { }\n'], + ]), + }); - // Both partial declarations are kept (de-dup is by nodeId, not name). + // Both declarations are kept (de-dup is by nodeId, not name). expect( - workspaceFqnBindings - .get('Foo') + indexes.namespaceFqnBindings + .get('') + ?.get('Foo') ?.map((b) => b.def.nodeId) .sort(), ).toEqual(['def:foo1.Foo', 'def:foo2.Foo']); - expect(bindingAugmentations.size).toBe(0); + expect(indexes.bindingAugmentations.size).toBe(0); }); + + // C# name lookup order (ECMA-334, namespace and type names): the declared + // namespace, that declaration's using directives, then each enclosing + // namespace; the global namespace is the outermost, and the compilation + // unit's using directives come after its own types. Dotted prefixes of using + // targets are not lookup scopes and rank last. + const at = (line: number, col: number) => ({ + startLine: line, + startCol: col, + endLine: line, + endCol: col + 1, + }); + const usingOf = (target: string, line: number, col = 0): ParsedImport => ({ + kind: 'namespace', + localName: target.slice(target.lastIndexOf('.') + 1), + importedName: target, + targetRaw: target, + atRange: at(line, col), + }); + it.each([ + ['a file outside any namespace', 'class P { }\n', [], [], ['']], + [ + 'a compilation-unit using in a global file', + 'using Billing.Core;\nclass P { }\n', + [], + [usingOf('Billing.Core', 1)], + ['', 'Billing.Core', 'Billing'], + ], + [ + 'a compilation-unit using before a file-scoped namespace', + 'using Billing;\nnamespace Audit.Trail;\nclass R { }\n', + [{ ...at(2, 0), endCol: 22 }], + [usingOf('Billing', 1)], + ['Audit.Trail', 'Audit', '', 'Billing'], + ], + [ + 'a using after a file-scoped namespace', + 'namespace Audit.Trail;\nusing Billing;\nclass R { }\n', + [{ ...at(1, 0), endCol: 22 }], + [usingOf('Billing', 2)], + ['Audit.Trail', 'Billing', 'Audit', ''], + ], + [ + 'a using inside a block namespace', + 'namespace Audit.Trail {\n using Billing;\n class R { }\n}\n', + [{ startLine: 1, startCol: 0, endLine: 4, endCol: 1 }], + [usingOf('Billing', 2, 2)], + ['Audit.Trail', 'Billing', 'Audit', ''], + ], + ])( + 'orders accessible namespaces in C# lookup order for %s', + (_label, content, namespaceRanges, parsedImports, expected) => { + const moduleScope = scope('scope:f:module', 'Module', 'f.cs'); + const namespaceScopes = namespaceRanges.map( + (range, i) => + ({ + ...scope(`scope:f:ns${i}`, 'Namespace', 'f.cs', moduleScope.id), + range, + }) as Scope, + ); + const parsedFiles: ParsedFile[] = [ + { + filePath: 'f.cs', + moduleScope: moduleScope.id, + scopes: Object.freeze([moduleScope, ...namespaceScopes]), + parsedImports: Object.freeze(parsedImports), + localDefs: Object.freeze([]), + referenceSites: Object.freeze([]), + } as ParsedFile, + ]; + const indexes = emptyIndexes(); + + populateCsharpNamespaceSiblings(parsedFiles, indexes as unknown as ScopeResolutionIndexes, { + fileContents: new Map([['f.cs', content]]), + }); + + const blockNamespace = + _label === 'a using inside a block namespace' ? namespaceScopes[0] : undefined; + expect(indexes.accessibleNamespacesByScope.get(blockNamespace?.id ?? moduleScope.id)).toEqual( + expected, + ); + if (blockNamespace !== undefined) { + expect(indexes.accessibleNamespacesByScope.get(moduleScope.id)).toEqual(['']); + } + }, + ); }); describe('csharpReceiverBinding', () => { diff --git a/gitnexus/test/unit/scope-resolution/walkers-augmentations.test.ts b/gitnexus/test/unit/scope-resolution/walkers-augmentations.test.ts index 60bbadb87..93fd10887 100644 --- a/gitnexus/test/unit/scope-resolution/walkers-augmentations.test.ts +++ b/gitnexus/test/unit/scope-resolution/walkers-augmentations.test.ts @@ -85,6 +85,23 @@ function indexesForScopeLookup( } describe('lookupBindingsAt', () => { + it('retains ambiguity within the winning namespace tier and hides later tiers', () => { + const indexes: ScopeResolutionIndexes = { + ...indexesWith({}), + accessibleNamespacesByScope: new Map([[SCOPE, ['first', 'second', 'outer']]]), + namespaceLookupTiersByScope: new Map([[SCOPE, [['first', 'second'], ['outer']]]]), + namespaceFqnBindings: new Map([ + ['first', new Map([['name', [ref('A', 'namespace')]]])], + ['second', new Map([['name', [ref('B', 'namespace')]]])], + ['outer', new Map([['name', [ref('C', 'namespace')]]])], + ]), + }; + expect(lookupBindingsAt(SCOPE, 'name', indexes).map((binding) => binding.def.nodeId)).toEqual([ + 'A', + 'B', + ]); + }); + it('returns the finalized bucket when augmentations are absent', () => { const finalized = [ref('A'), ref('B')]; const out = lookupBindingsAt(SCOPE, 'name', indexesWith({ finalized }));