GitNexus/gitnexus-shared/src
Abhinav Pandey c5a4c2a63b
fix(resolution): address review findings on #3182
Bot findings (13) and human findings (magyargergo, 6) on the scope-resolution
precision PR, each classified and fixed minimally in the PR's spirit — never
guess: refuse where impossible, label where undecidable.

Bot findings:
- finalize-algorithm.ts:1026 (Variable excluded from wildcard collisions) → TP.
  Introduced tri-state SymbolDefinition.isExported (export evidence supplied by
  the TS/JS capture emitters via @declaration.is-exported). With evidence an
  exported Variable collides; without it the prior exclusion stands.
- typescript/scope-resolver.ts:138 (private `function foo` counted as a
  wildcard provider) → TP. A def marked isExported:false is neither a collision
  candidate nor published by the `export *` closure (indexTopLevelExportsByName).
- node-workspace-packages.ts:474 (rejection evicts newer memo entry) → TP.
  Delete only when the memo still holds this load's own promise.
- dart/name-fallback-visibility.ts:68 (cross-directory `part`) → TP. The Dart
  query captures no `part` directive, so cross-file `_` names are undecidable:
  the refusal is downgraded to a labeled guess (never refused) and documented.
- go/name-fallback-visibility.ts:116 (root-package exception before _test.go)
  → TP. A candidate in any other package's `_test.go` is refused first, before
  the module-root and import checks.
- go/package-siblings.ts:76 (real package named `foo_test`) → TP. `_test` is
  stripped only when a non-test sibling in the directory declares the stripped
  name (or no non-test sibling exists); a declared `foo_test` package keeps it.
- rust/name-fallback-visibility.ts:91 (`use crate:🅰️:other` authorizes every
  item of `a`) → TP. The parent-path match now requires the imported item to be
  the candidate; a module path match or glob still authorizes the module.
- ruby/name-fallback-visibility.ts:155 (`includes(constant)` substring) → TP.
  Qualified mentions are matched segment-wise on `::` / `.`.
- name-fallback-summary.ts:104 (callsByLanguage never supplied) → TP. The
  pipeline now builds resolvedCalleeNamesByCaller through the emit sink
  (complete under streaming) and run-analyze feeds countCallsByLanguage.
- free-call-fallback.ts:710 (dedup keeps first site's label) → TP, see below.
- barrel-wildcard-arrow-const.test.ts:22 (fixture cleanup) → nit, try/finally.
- utils/name-fallback-visibility.ts:24 (`crate::` comment) → nit, corrected.
- community-processor.ts:318 ("only these four") → nit, five.

Human findings (magyargergo):
- finalize-algorithm.ts:1374 (nested function admitted as top-level export) →
  TP. The export marker stops at nesting boundaries (function bodies, class
  bodies, object literals), so the nested def is isExported:false and skipped;
  additionally resolveDefGraphId fails closed before the label-agnostic simple
  key when a function-local callable of that name exists in the file, so a
  non-callable def can no longer alias onto `wrapper.selected`.
- javascript/scope-resolver.ts:105 (CJS `module.exports = { alpha() {} }` +
  destructured require) → TP. Members of the module.exports object literal are
  marked isExported:true, and the top-level export index admits a marked
  member regardless of its Method label. Regression covers the duplicate-name case.
- finalize-algorithm.ts:1049 (class member shadows a star-vs-star collision) →
  TP. The shadow set is limited to module-level bindings (canShadowWildcard).
- node-workspace-packages.ts:730 (vite lib.entry matched inside a comment) →
  TP. Comments are stripped (stripJsComments) and every live lib.entry is a
  candidate, so two disagreeing entries are refused as ambiguous.
- ruby/name-fallback-visibility.ts:160 (instance_eval rebinds self) → TP. A
  caller file using instance_eval/class_eval/instance_exec/class_exec/
  module_eval/module_exec keeps class-owned guesses labeled instead of refused
  (file-level, source-text based — the site cannot tell its enclosing block).
- free-call-fallback.ts:710 (ordering; overlaps the bot finding) → TP. The
  deduplicated edge's label is decided at flush from every collapsed site: one
  site resolved through a real binding proves the edge (0.85 import-resolved);
  it is a guess only when all sites were guesses. Order never decides.

Validation note: integration tests run the parse workers from gitnexus/dist,
so `npm run build` in gitnexus/ is required before the suite reflects capture
changes (a stale dist masked the marker in the first run). Full suite: 20660
passed, 15 failed, all in the known environmental set (analyzer-identity*,
evidence-provenance-helper, hooks linked-worktree, pinned-install retry,
git-utils ENOTEMPTY).

Overlaps between bot and human: free-call-fallback.ts:710 ordering (both), and
the finalize-algorithm collision set (bot: Variable candidates; human: member
shadowing and nested functions) — all resolved by the same export-evidence
mechanism.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015dSxjDEzuYDENrR314EiFc
2026-09-05 14:22:08 +05:30
..
graph feat(zig): mark CALLS edges inside comptime-false branches as staticGated (#3161) 2026-09-03 19:49:16 +01:00
integrations fix(embeddings): retry unparseable 200 responses and survive partial embedding failures (#2790) (#2795) 2026-08-02 20:43:59 +00:00
lbug feat(ingestion): resolve Spring messaging destinations into Destination nodes (#3132) 2026-09-02 11:46:50 +01:00
scope-resolution fix(resolution): address review findings on #3182 2026-09-05 14:22:08 +05:30
impact-risk.ts fix(impact): make File risk comparable via shared axes (#3075) (#3082) 2026-08-29 11:58:15 +00:00
index.ts fix(resolution): label name-fallback guesses and refuse the impossible; bind exports and named imports to module-level declarations 2026-09-05 12:18:17 +05:30
language-detection.ts feat: add Zig language support (#1432) 2026-09-03 13:29:42 +01:00
languages.ts feat: add Zig language support (#1432) 2026-09-03 13:29:42 +01:00
mro-strategy.ts feat(ingestion): language-agnostic heritage extractor with config+factory pattern (#890) 2026-04-17 17:51:17 +01:00
pipeline.ts feat(progress): add per-language progress reporting to scope-resolution phase (#1813) 2026-05-25 11:53:54 +01:00
test-helpers.ts feat: shared resilient-fetch (retries + circuit breaker) (#1448) 2026-05-09 15:18:09 +01:00