mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-09-21 00:21:30 +00:00
Replay the C# scope-resolver cleanup on the Python side so both
providers share a single clean pattern:
* Drop `ws as unknown as WorkspaceIndex` — `WorkspaceIndex` is
`unknown` in the shared contract, so the narrow context assigns
structurally without a cast.
* Drop `{ id: scopeId } as unknown as Scope` — `pythonMergeBindings`
never read the scope (the parameter was `_scope`), so the stub
was a type-only ghost. Signature is now `(bindings)` and the
LanguageProvider slot wraps with an arrow adapter.
* Drop `allFilePaths as Set<string>` — the orchestrator hands a
`ReadonlySet<string>`; we copy it into a `Set` at the resolver
adapter so the legacy downstream `resolvePythonImportInternal`
chain (typed for mutable `Set<string>`) keeps working. The copy
is O(N) once per import, trivial cost.
Left intact on purpose: the `(callsite, def) → (def, callsite)`
arrow wrapper on `arityCompatibility`. That's a documented shape
difference between `LanguageProvider.arityCompatibility(def, callsite)`
and `ScopeResolver.arityCompatibility(callsite, def)`; both providers
(Python + C#) carry the same wrapper. Reconciling is a separate
refactor across both contracts.
No runtime behavior change.
Verified:
- npx tsc --noEmit clean
- Python + C# unit + integration suites 529/529 passing
|
||
|---|---|---|
| .. | ||
| cached-tree-parity.test.ts | ||
| python-fixtures.test.ts | ||
| python-hooks.test.ts | ||