#909·GitNexus

Meta: Pure Scope-Based Resolution in the Semantic Model

Author: magyargergoCreated Apr 18, 2026Updated Sep 18, 2026
Labelsrefactorsemantic-modelrfc:scope-resolutiontracking

RFC: RFC: Pure Scope-Based Resolution in the Semantic Model Predecessor: ️ RFC: From fuzzy lookups to a semantic model Complements: ️ Ingestion Roadmap — Phase 3 + Phase 4 Triggering feedback: #902 (closed; work absorbed into #912)


What this is

Replace today's call-resolution DAG and TieredCandidates API with a pure scope-based resolution layer on the SemanticModel. Resolver consults three scope-aware per-kind entry points — ClassRegistry.lookup(name, scope), MethodRegistry.lookup(name, scope), FieldRegistry.lookup(name, scope) — backed by a scope tree with declarations, imports, and type bindings. Confidence and provenance become first-class per resolution. No AST reads at resolution time. Details in the Notion RFC.

Rollout — 5 rings, shadow-first

Ring 1 (types) → Ring 2 (plumbing: shared + package-local)
             → Ring 3 (per-language migrations, parallel)
             → Ring 4 (DAG retirement, gated on all production langs flipped)
             → Ring 5 (perf + docs)

Per-language flip threshold: ≥ 99% fixture parity, ≥ 98% corpus parity vs legacy DAG under shadow mode. See RFC §6 for the full delivery plan.

Child issues

Ring 1 — Types & contracts

  • #910 — Scope-resolution types + constants in gitnexus-shared
  • #911 — LanguageProvider hook interface extensions

Ring 2 — SHARED (pure logic, to gitnexus-shared)

  • #912 — Scope / ScopeTree / PositionIndex (generalizes closed #902)
  • #913 — DefIndex / ModuleScopeIndex / QualifiedNameIndex
  • #914 — MethodDispatchIndex build function over HeritageMap
  • #915 — SCC-aware finalize algorithm (bounded fixpoint)
  • #916 — resolveTypeRef (strict helper)
  • #917 — ClassRegistry / MethodRegistry / FieldRegistry + evidence composition
  • #918 — Shadow-mode diff/comparison logic

Ring 2 — PACKAGE-LOCAL (integration + I/O, to gitnexus/)

  • #919 — ScopeExtractor driver (tree-sitter + provider hooks → shared ScopeTree)
  • #920 — parse-worker.ts integration — emit ParsedFile artifacts
  • #921 — Finalize orchestrator
  • #922 — Per-language import-target resolution adapters
  • #923 — Shadow harness + parity dashboard
  • #924 — REGISTRY_PRIMARY_<LANG> flag routing
  • #925 — ReferenceIndex emission to LadybugDB

Ring 3 — Per-language migrations (parallel; one ticket per SupportedLanguages member)

  • #926 — LANG-python (first rollout; biggest calibration signal)
  • #934 — LANG-csharp
  • #927 — LANG-typescript
  • #928 — LANG-javascript
  • #929 — LANG-java
  • #930 — LANG-go
  • #931 — LANG-ruby
  • #932 — LANG-rust
  • #933 — LANG-kotlin
  • #935 — LANG-cpp
  • #936 — LANG-c
  • #937 — LANG-swift
  • #938 — LANG-php
  • #939 — LANG-dart
  • #940 — LANG-vue
  • #941 — LANG-cobol (regex provider; validates parse-source-agnostic contract)

Ring 4 — DAG retirement (gated)

  • #942 — Delete call-resolution DAG stages 1–4
  • #943 — Delete ResolutionContext.resolve, TieredCandidates, legacy plumbing
  • #944 — Delete shadow harness

Ring 5 — Performance + docs

  • #945 — Calibrate EvidenceWeights against corpus parity
  • #946 — Benchmark finalize phase
  • #947 — Update ARCHITECTURE.md + skill docs
  • #948 — Close #429 (centralized confidence constants)

How to contribute

Ring 3 language tickets are the natural good first issue for external contributors who know a given language. Each is self-contained: one scopes.scm (or regex tagger for COBOL), a few LanguageProvider hooks, a fixture set, and shadow-mode parity verification. See RFC §5 for the extraction contract.

Ring 2 plumbing (#912–#925), Ring 4 deletions (#942–#944), Ring 5 calibration (#945–#948) are core-team work.

Critical path

Ring 1 (#910, #911) → Ring 2 (#912–#925) → all production Ring 3 (#926–#941) → Ring 4 (#942–#944)

Ring 3 languages can draft scopes.scm and fixture sets in parallel with Ring 2 — the contract in RFC §5.1 is stable. Ring 5 floats.

Status

Ring State
Ring 1 Ready to start
Ring 2 SHARED Blocked on Ring 1 (#910 #911)
Ring 2 PKG Blocked on Ring 2 SHARED
Ring 3 Blocked on Ring 2 (can draft scopes.scm + fixtures in parallel)
Ring 4 Blocked on all production Ring 3 languages flipped + stable for one release cycle
Ring 5 Can run alongside any ring

Source: abhigyanpatwari/GitNexus