Both LanguageProvider hooks were dead weight:
- `shouldShadow` had zero call sites — the interface declared it,
Python implemented a trivial always-true no-op, but no consumer
ever read it. The shadowing decision lives in pythonMergeBindings
and the central merge algorithm, not in a per-scope predicate.
- `shouldCreateScope` had one call site in pass1BuildScopes but the
only language implementing it (Python) always returned true. No
producer ever emits a `@scope.block` for Python, so the hook's
"declines to create" branch was unreachable. Other languages
didn't implement it at all.
Removing both:
- Drops the interface declarations in language-provider.ts.
- Drops `shouldCreateScope` from ScopeExtractorHooks Pick and from
the pass1BuildScopes conditional — the stack-based parent-resolve
loop becomes unconditional.
- Drops pythonShouldShadow / pythonShouldCreateScope from simple-hooks,
the Python index barrel, and the python.ts provider wiring.
- Drops the tests that exercised the removed hooks: one block-
suppression scenario in scope-extractor.test.ts, one shouldCreateScope
test in parse-worker-scope-integration.test.ts, and the
pythonShouldShadow / pythonShouldCreateScope always-true assertions
in python-hooks.test.ts. pythonBindingScopeFor's delegate-to-default
test is preserved in its own describe block.
Shadowing itself is unchanged: pythonMergeBindings still runs, LEGB
ordering still applies, wildcard transparency is still handled via
the merge precedence rules. The hook API just no longer has a
vestigial per-scope toggle we decided not to use.
Verification: 204/204 test/integration/resolvers/python.test.ts both
REGISTRY_PRIMARY_PYTHON=0 and =1. 335/335 scope-resolution + graph
unit tests (was 339, net -4 after removing the hook-specific
assertions). tsc clean.
CI run 24666612657 failed on three jobs. Fixes:
quality/format:
- Prettier --check flagged 3 files after the accumulated branch work.
Ran prettier --write from repo root (CI's invocation cwd) to apply:
simple-hooks.ts, resolve-references.ts, python-hooks.test.ts.
tests/{ubuntu,macos,windows} — 9 assertion failures, all traceable to
Python landing in MIGRATED_LANGUAGES (default-on registry-primary):
- registry-primary-flag.test.ts (3 tests): the 'returns false by
default' / 'primaryLanguages empty' / 'Python mid-process
mutation' assertions were written in Ring 2 when MIGRATED_LANGUAGES
was empty. Rewrote to assert MIGRATED_LANGUAGES membership is the
default, use Java (unmigrated) for the no-stale-cache test, and
verify env overrides work in both directions (migrated-off,
unmigrated-on).
- call-processor.test.ts (6 tests in SM-10 + D2-widen blocks):
these exercise the LEGACY call-resolution DAG on .py fixtures.
processCalls now gates Python out (isRegistryPrimary === true by
default), returning 0 edges. Added REGISTRY_PRIMARY_PYTHON=false
override in the relevant beforeEach + restore in afterEach, so
the legacy DAG runs for these test-local fixtures without
affecting the production-default behavior.
Local verification: 4126/4126 unit tests pass, prettier clean.