GitNexus/gitnexus/test
Mick Cooney 22ffcd3220 test(r): caller-attribution scope-anchor unit tests and fixture (expected-fail)
Adds the tests for the R caller-attribution fix BEFORE the fix, so the fix commit only flips them to normal tests.

Defect: R's @scope.function anchors on the function_definition while
@declaration.function / @declaration.method anchor on the enclosing assignment
or method argument. The def is therefore owned by the Module / outer-function /
Class scope, and resolveCallerGraphId credits every call in a body to the FIRST
callable that scope owns (false inner -> inner self-loops, R6 calls credited to
the class's first method, module-level calls credited to a function not File).

Contents:
- test/unit/scope-resolution/r/scope-function-anchors.test.ts: scope-tree proofs
  via extractParsedFile + populateClassOwnedMembers (named forms, nesting,
  anonymous lambdas, R6/R5 methods, nested helper in a method, class-body field
  default, single-function file, member-assigned functions, def node id pins).
- test/fixtures/lang-resolution/r-call-attribution/: synthetic fixture, a decoy
  first function per file, unique leaf callees.
- test/integration/resolvers/r.test.ts: new 'R caller attribution' describe with
  exact per-source edge sets and named-type invariance counts.

Assertions that fail at HEAD because of the misattribution are wrapped in
it.fails (one assertion per it, value-comparing, no non-null derefs) and are
unwrapped by the fix commit; assertions that already hold stay plain; each
wrapped case has a plain twin (the target edge exists from any source). The
step-1-only HEAD pins assert the defect itself and are deleted by the fix
commit. Verified: every wrapped test fails without the wrapper at HEAD with an
assertion mismatch (no throws) and passes when the query is patched with the
two scope patterns; only the HEAD pins flip.
2026-10-01 13:37:57 +01:00
..
fixtures test(r): caller-attribution scope-anchor unit tests and fixture (expected-fail) 2026-10-01 13:37:57 +01:00
helpers fix(r): register R in grammar-literal-validation gate's language maps 2026-10-01 13:37:57 +01:00
integration test(r): caller-attribution scope-anchor unit tests and fixture (expected-fail) 2026-10-01 13:37:57 +01:00
unit test(r): caller-attribution scope-anchor unit tests and fixture (expected-fail) 2026-10-01 13:37:57 +01:00
utils feat(storage): add configurable index storage and content retention tiers (#3060) 2026-09-12 20:31:55 +00:00