GitNexus/gitnexus/test/integration/resolvers
samuel mbabhazi 9772bcd24f
feat(api_impact): list the callers of the requesting function as indirect consumers (#3720)
* feat(api_impact): list the callers of the requesting function as indirect consumers

The FETCHES edge is file-level, so api_impact saw only the file that sends
the request. The files that call its request function never mention the URL
and were missing from the report (#3644).

The edge's reason now names the callables whose spans contain the request
sites, one `|via:<id>` field each, under the containment rule the R3-6 sink
set already uses; that rule moves into EnclosingCallableIndex so both stay
one. Several sites of one file for one route now share the edge instead of
colliding on its id. api_impact follows the CALLS edges into those callables
one level up and reports the callers as `indirectConsumers`, apart from the
direct consumers and outside the risk level. Direct consumer files and the
handler file are left out. An index built before the attribution carries no
field. Expo navigation sites carry their real line so they attribute to the
component that contains them.

Closes #3644

* fix(api_impact): attribute a request site by its AST enclosing callable

A helper defined on the line of the request has the smaller span, so the
line-only lookup named it and the callers of the real requesting function
vanished from indirectConsumers. The parser now records the enclosing
callable of each fetch site and of each wrapper call (through the call's
position), and attribution prefers that identity; the span lookup remains
for sites found by text scan. The same preference applies to the R3-6 sink
set. A real analyze of the fixture followed by api_impact pins the helper
case and the wrapper case.

* test(bench): rebaseline receiver resolution for the indirect-consumers fixture

The api-impact-indirect-consumers fixture adds three receiver-unresolved
sites to the corpus: two `.then(...)` calls on the untyped return of
`fetch(...)` and of the local wrapper `apiFetch(...)`, and one
`req.query.path` read inside an inline Express handler with an untyped
`req`. Call drops 138 -> 140, reads 30 -> 31, all kinds 168 -> 171. No
shape-arm state and no existing site changed.

* fix(api_impact): preserve module-scope request attribution

Keep AST-confirmed module scope distinct from missing attribution for direct
fetches, HTTP clients, and wrapper calls. Prevent overlapping callable spans
from inventing indirect consumers or process sinks.

Preserve span fallback for callable forms the generic identity walk cannot
name. Add eight regression cases, including real analyze/api_impact coverage.
Rebaseline receiver-resolution counts for the two then calls and one property
read added by this PR's existing fixtures; shape expectations are unchanged.

---------

Co-authored-by: Gergo Magyar <gergomagyar0@gmail.com>
Co-authored-by: Gergő Magyar <gergomagyar@icloud.com>
2026-10-25 18:29:09 +00:00
..
api-deep-flow.test.ts feat: configure prettier with pre-commit hook (#563) 2026-03-28 14:58:04 +00:00
barrel-dir-index-wildcard.test.ts fix(resolution): label fallback guesses and preserve export visibility (#3190) 2026-09-10 11:38:19 +01:00
barrel-named-import-class-method.test.ts fix(resolution): label fallback guesses and preserve export visibility (#3190) 2026-09-10 11:38:19 +01:00
barrel-named-over-star-precedence.test.ts fix(resolution): label fallback guesses and preserve export visibility (#3190) 2026-09-10 11:38:19 +01:00
barrel-review-3182-repros.test.ts fix(resolution): label fallback guesses and preserve export visibility (#3190) 2026-09-10 11:38:19 +01:00
barrel-wildcard-arrow-const.test.ts fix(resolution): label fallback guesses and preserve export visibility (#3190) 2026-09-10 11:38:19 +01:00
barrel-workspace-hop.test.ts fix(go, workspace): resolve test siblings and tighten package discovery (#3191) 2026-09-10 12:22:12 +01:00
c-coverage.test.ts fix(ingestion): close remaining open language parsing-layer coverage gaps (#1919) (#2072) 2026-06-08 08:09:43 +01:00
c.test.ts perf(ingestion): Linux-kernel-scale analysis — worker-pool parse + finalize O(n²) + scope-resolution memory wall (#1983) (#2038) 2026-06-06 22:46:34 +01:00
callable-alternatives-providers.test.ts fix(impact): fail closed on id-less targets and follow ??/||/?: callable values (#3354) (#3373) 2026-09-25 21:43:24 +01:00
callable-value-flow.test.ts feat(cache): derive parser and PDG cache identities automatically (#3606) 2026-10-17 07:38:45 +03:00
cobol-parsing-coverage.test.ts fix: COBOL parsing-layer coverage gaps — F17-F23 (#1925) (#1959) 2026-06-01 21:08:07 +01:00
cobol-scope.test.ts refactor(ingestion): delete legacy call-resolution DAG + heritage processor (RING4-1, #942) (#2023) 2026-06-04 11:07:37 +01:00
cobol.test.ts fix(lbug/mcp): exact symbol content + 0-based line storage with 1-based MCP display (#2377, #2379) (#2380) 2026-07-06 16:16:45 +01:00
configurable-fetch-wrapper.test.ts feat(cache): derive parser and PDG cache identities automatically (#3606) 2026-10-17 07:38:45 +03:00
cpp-local-using-headers.test.ts fix(scope): resolve local imports by lexical ownership (#3532) 2026-10-10 08:13:55 +03:00
cpp-local-using.test.ts fix(scope): resolve local imports by lexical ownership (#3532) 2026-10-10 08:13:55 +03:00
cpp-qualified-receiver-typing.test.ts fix(cpp): type receivers declared or produced through qualified names (#3656) 2026-10-22 08:21:37 +00:00
cpp.test.ts fix(rename): extend safe refactoring and flow coverage across languages (#3557) 2026-10-13 08:38:17 +03:00
csharp-1924.test.ts fix(csharp): qualified/alias constructor names, : base/: this initializers, generic type-arg strip (#2046) 2026-06-05 07:04:57 +01:00
csharp.test.ts fix(csharp): bind nullable field types for receiver resolution (#3498) (#3664) 2026-10-22 20:05:33 +00:00
dart-coverage.test.ts chore(vendor): update tree-sitter-dart to 1.0.0-g0038280 (#3633) 2026-10-19 15:41:34 +01:00
dart.test.ts fix(swift,dart): type chained receivers through hoisted return types (#3498) (#3666) 2026-10-22 22:52:11 +00:00
express-routes.test.ts fix(routes): scope inline Express handlers and report api_impact lower bound (#3643) 2026-10-20 17:44:08 +01:00
fastapi-depends.test.ts fix(scope): resolve local imports by lexical ownership (#3532) 2026-10-10 08:13:55 +03:00
fetch-consumer-attribution.test.ts feat(api_impact): list the callers of the requesting function as indirect consumers (#3720) 2026-10-25 18:29:09 +00:00
fetch-wrapper-consumers.test.ts fix(routes): link consumers to wrapper-composed URLs (#3697) 2026-10-23 18:25:20 +01:00
fetch-wrapper-persistence.test.ts fix(scope): preserve lexical bindings in HTTP wrapper detection (#3632) 2026-10-20 11:36:06 +01:00
generic-field-receiver-matrix.test.ts fix(scope): resolve local imports by lexical ownership (#3532) 2026-10-10 08:13:55 +03:00
generic-interface-dispatch.test.ts fix(scope-resolution): make interface dispatch generic-instantiation aware (#2912) (#2939) 2026-08-13 14:50:53 +01:00
go-external-test-package.test.ts feat(go): index gin/echo routes and report them in impact (#3402) (#3417) 2026-10-01 10:22:45 +01:00
go-namespace-member-visibility.test.ts fix(rename): extend safe refactoring and flow coverage across languages (#3557) 2026-10-13 08:38:17 +03:00
go.test.ts fix(go): resolve imports within selected modules (#3654) 2026-10-21 18:24:18 +00:00
helpers.ts fix(resolution): correct receiver drops and property ownership (#3653) 2026-10-22 05:59:59 +01:00
inferred-field-receiver-matrix.test.ts fix(swift,dart): type chained receivers through hoisted return types (#3498) (#3666) 2026-10-22 22:52:11 +00:00
ipynb-python-pipeline.test.ts fix(scope): keep nested declarations out of module bindings (#3502) 2026-10-08 11:05:41 +03:00
java-1928.test.ts fix(java): close parsing-layer coverage gaps F35/F38/F41 (#1928) (#2045) 2026-06-05 06:39:12 +01:00
java-javac-local-types.test.ts feat(storage): add configurable index storage and content retention tiers (#3060) 2026-09-12 20:31:55 +00:00
java-lombok.test.ts feat(cache): derive parser and PDG cache identities automatically (#3606) 2026-10-17 07:38:45 +03:00
java.test.ts fix(scope): bind same-package inheritance bases when the simple name is reused elsewhere (#3659) 2026-10-22 12:45:11 +00:00
javascript-const-references.test.ts feat: close reported graph blind spots in reference resolution, analyze and storage (#2856) 2026-08-08 09:58:14 +01:00
javascript-object-properties.test.ts fix(resolution): correct receiver drops and property ownership (#3653) 2026-10-22 05:59:59 +01:00
javascript.test.ts fix(resolution): correct receiver drops and property ownership (#3653) 2026-10-22 05:59:59 +01:00
js-parsing-coverage.test.ts fix: JS/TS scope-resolution coverage gaps — F44, F83, F85, F86, F87 (#1929) (#1968) 2026-06-02 06:57:28 +01:00
kotlin-coverage.test.ts fix(grammars): load vendored tree-sitter grammars from vendor/ by absolute path (#2111) (#2144) 2026-06-10 14:20:42 +01:00
kotlin-jvm-accessors.test.ts fix(rename): extend safe refactoring and flow coverage across languages (#3557) 2026-10-13 08:38:17 +03:00
kotlin.test.ts fix(kotlin): type locals from package-qualified factory calls (#3660) 2026-10-22 16:49:06 +00:00
laravel-route-resolution.test.ts perf(ingestion): Linux-kernel-scale analysis — worker-pool parse + finalize O(n²) + scope-resolution memory wall (#1983) (#2038) 2026-06-06 22:46:34 +01:00
local-import-persistence.test.ts feat(cache): derive parser and PDG cache identities automatically (#3606) 2026-10-17 07:38:45 +03:00
member-call-producer.test.ts fix(resolution): correct receiver drops and property ownership (#3653) 2026-10-22 05:59:59 +01:00
name-fallback-edges.test.ts fix(resolution): label fallback guesses and preserve export visibility (#3190) 2026-09-10 11:38:19 +01:00
nuxt-scope.test.ts feat: ✨ resolve Nuxt/Nitro auto-imports in TypeScript scope resolver (#2026) 2026-06-24 12:32:51 +01:00
parameter-producer.test.ts fix(resolution): correct receiver drops and property ownership (#3653) 2026-10-22 05:59:59 +01:00
php-coverage.test.ts fix(php): import decomposition, enum cases, anonymous class scope — F53,F54,F55 (#1931) (#1989) 2026-06-04 12:57:38 +01:00
php-response-shapes.test.ts feat: configure prettier with pre-commit hook (#563) 2026-03-28 14:58:04 +00:00
php.test.ts fix(php): type locals from namespaced-function factory calls (#3498) (#3662) 2026-10-22 18:55:04 +00:00
polyglot-property-isolation.test.ts feat: close reported graph blind spots in reference resolution, analyze and storage (#2856) 2026-08-08 09:58:14 +01:00
python-constructor-field-receiver.test.ts fix: type an inference-typed class field so it can act as a call receiver (#2807) (#2810) 2026-08-04 19:31:25 +01:00
python-mcp-tools.test.ts fix(mcp): project tool_map flows from handlers (#1113) 2026-04-27 17:13:02 +01:00
python-module-accessors.test.ts fix(scope): label library-rooted receiver drops as external from provider evidence (#3658) 2026-10-22 12:14:28 +01:00
python-namespace-semantics.test.ts fix(python): resolve calls through aliased package re-exports (#3504) 2026-10-08 13:51:20 +03:00
python-parsing-coverage.test.ts refactor(ingestion): delete legacy call-resolution DAG + heritage processor (RING4-1, #942) (#2023) 2026-06-04 11:07:37 +01:00
python.test.ts fix(scope): follow namespace factory return types and record untyped drops (#3648) 2026-10-21 10:24:26 +00:00
receiver-chain-walker-spellings.test.ts fix(ingestion): read more receiver-chain spellings (#3498) (#3667) 2026-10-22 23:33:50 +00:00
receiver-origin-library-boundary.test.ts fix(scope): label library-rooted receiver drops as external from provider evidence (#3658) 2026-10-22 12:14:28 +01:00
receiver-origin-provider-review.test.ts fix(scope): label library-rooted receiver drops as external from provider evidence (#3658) 2026-10-22 12:14:28 +01:00
route-mapping.test.ts feat: configure eslint with unused import removal (#564) 2026-03-28 15:28:09 +00:00
ruby-accessor-dispatch.test.ts fix(rename): extend safe refactoring and flow coverage across languages (#3557) 2026-10-13 08:38:17 +03:00
ruby-namespaced.test.ts fix(ruby): scope-resolution namespaced class/module definitions — F62 (#1933) (#1972) 2026-06-02 13:20:01 +01:00
ruby-scope.test.ts refactor(ingestion): delete legacy call-resolution DAG + heritage processor (RING4-1, #942) (#2023) 2026-06-04 11:07:37 +01:00
ruby.test.ts fix(scope): keep nested declarations out of module bindings (#3502) 2026-10-08 11:05:41 +03:00
rust-cargo-review-regressions.test.ts fix(scope): resolve local imports by lexical ownership (#3532) 2026-10-10 08:13:55 +03:00
rust-cargo-target-fallback.test.ts fix(scope): resolve local imports by lexical ownership (#3532) 2026-10-10 08:13:55 +03:00
rust-coverage.test.ts fix(rust): respect Cargo target boundaries in name fallback (#3294) 2026-09-16 11:36:07 +01:00
rust-f70.test.ts fix(rust): F70 — replace struct_expression name:(_) with three specific patterns (#2051) 2026-06-05 17:46:07 +01:00
rust-import-scope.test.ts fix(scope): resolve local imports by lexical ownership (#3532) 2026-10-10 08:13:55 +03:00
rust-scope.test.ts refactor(ingestion): delete legacy call-resolution DAG + heritage processor (RING4-1, #942) (#2023) 2026-06-04 11:07:37 +01:00
rust.test.ts fix(rust): see through Box, Rc and Arc on struct field types (#3498) (#3665) 2026-10-22 21:19:27 +00:00
shape-check.test.ts feat: configure prettier with pre-commit hook (#563) 2026-03-28 14:58:04 +00:00
swift-local-vs-method-label-split.test.ts fix(swift): resolve inherited protocol extension calls (#3309) 2026-09-19 07:44:35 +01:00
swift.test.ts fix(swift,dart): type chained receivers through hoisted return types (#3498) (#3666) 2026-10-22 22:52:11 +00:00
typescript-alias-fields.test.ts feat: close reported graph blind spots in reference resolution, analyze and storage (#2856) 2026-08-08 09:58:14 +01:00
typescript-callable-alternatives.test.ts fix(impact): fail closed on id-less targets and follow ??/||/?: callable values (#3354) (#3373) 2026-09-25 21:43:24 +01:00
typescript-esm-js-extension.test.ts refactor(ingestion): colocate import resolution rules (#3670) 2026-10-22 03:49:35 +00:00
typescript-hoc-wrapped.test.ts refactor(ingestion): delete legacy call-resolution DAG + heritage processor (RING4-1, #942) (#2023) 2026-06-04 11:07:37 +01:00
typescript-hof-callbacks.test.ts refactor(ingestion): delete legacy call-resolution DAG + heritage processor (RING4-1, #942) (#2023) 2026-06-04 11:07:37 +01:00
typescript-inferred-field-receiver.test.ts fix: type an inference-typed class field so it can act as a call receiver (#2807) (#2810) 2026-08-04 19:31:25 +01:00
typescript-jsx-as-call.test.ts refactor(ingestion): delete legacy call-resolution DAG + heritage processor (RING4-1, #942) (#2023) 2026-06-04 11:07:37 +01:00
typescript-mcp-tools.test.ts feat(cache): derive parser and PDG cache identities automatically (#3606) 2026-10-17 07:38:45 +03:00
typescript-namespace-const.test.ts feat: close reported graph blind spots in reference resolution, analyze and storage (#2856) 2026-08-08 09:58:14 +01:00
typescript-type-parameters.test.ts fix: close the nine follow-up review findings from #2856 (routes, receiver typing, truncation honesty) (#2899) 2026-08-09 11:44:52 +01:00
typescript-value-refs.test.ts fix(resolution): resolve Go pointer-receiver calls, and report the program boundary instead of hedging (#2766) (#2782) 2026-08-01 22:42:18 +01:00
typescript-workspace-packages.test.ts fix(typescript): resolve imports against declared config, not path suffixes (#2953) (#2956) 2026-08-14 10:13:04 +01:00
typescript.test.ts fix(resolution): correct receiver drops and property ownership (#3653) 2026-10-22 05:59:59 +01:00
value-ref-locality.test.ts fix(test): align fixtures and mocks with current types (#3471) 2026-10-05 04:47:37 +01:00
vue-scope.test.ts fix(vue): F89 JSDoc fix, F90 dual-script merge, F92 lang plumbing (#1936) (#2050) 2026-06-07 06:02:30 +01:00
vue.test.ts feat(vue): Vue SFC support + destructured call result tracking (#604) 2026-04-03 14:18:55 +05:30
zig-build-modules.test.ts feat: add Zig language support (#1432) 2026-09-03 13:29:42 +01:00
zig-local-imports.test.ts fix(scope): resolve local imports by lexical ownership (#3532) 2026-10-10 08:13:55 +03:00
zig-static-gating.test.ts fix(zig): resolve cross-file static gates (#3185) 2026-09-07 07:19:30 +01:00
zig.test.ts fix(zig): resolve import-alias, forwarding-constructor, anonymous-container and type-application receivers (#3652) 2026-10-22 01:24:26 +00:00