Skip to content

fix(registry): don't swallow call suffixes on aliased-import direct hits#1011

Merged
DeusData merged 1 commit into
mainfrom
fix/import-map-suffix-swallow
Jul 10, 2026
Merged

fix(registry): don't swallow call suffixes on aliased-import direct hits#1011
DeusData merged 1 commit into
mainfrom
fix/import-map-suffix-swallow

Conversation

@DeusData

Copy link
Copy Markdown
Owner

Closes #1000.

Bisected regression from #979 (not in any release — v0.9.0 predates it). The direct-hit early return in resolve_import_map fires before suffix handling, so imported_symbol.method() calls whose base symbol is an indexed node bound to the base node instead of base.method.

Measured on django (identical checkout, full mode):

broken main fixed v0.9.0 baseline
CALLS 72,175 74,708 74,685
TESTS 29,236 38,035 38,032

The fix keeps #979's feature intact (direct hit only for suffix-less callees — the aliased bare-call case it was written for); the +23 CALLS over baseline are #979's genuine wins. Example of the regression: auth.login ⇒ Signal.send had degraded to an edge onto the user_logged_in Variable node.

Reproduce-first: resolve_import_map_alias_with_suffix_hits_method — RED on unguarded code, GREEN with the fix; #979's own resolve_import_map_bare_alias stays green (registry suite 56/56). lint-ci clean.

Thanks @LA-10 — the #979 feature itself is solid; this only scopes its early return.

@DeusData DeusData added this to the 0.9.1-rc milestone Jul 10, 2026
@DeusData DeusData enabled auto-merge July 10, 2026 19:07
The #979 direct-hit early return in resolve_import_map fires before
suffix handling, so any imported_symbol.method() call whose base symbol
is itself an indexed node resolved to the base node instead of
base.method — the exact mis-resolution the neighboring comment warns
about. On django this degraded the graph by ~11K edges (CALLS
74,685->72,175, TESTS 38,032->29,236); auth.login => Signal.send became
an edge onto the user_logged_in Variable node.

Take the direct hit only for suffix-less callees — precisely the
aliased direct-symbol import case (#875) the early return was added
for. Verified on django: CALLS 74,708 (baseline + the 23 genuine #979
wins), TESTS 38,035; the #979 bare-alias test stays green.

Reproduce-first: resolve_import_map_alias_with_suffix_hits_method is
RED on the unguarded code (returns the bare symbol QN) and GREEN with
the guard.

Closes #1000

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
@DeusData DeusData merged commit 0756b2b into main Jul 10, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression (main, post-v0.9.0): #979 import-map direct-hit swallows call suffixes — django loses ~11K CALLS/TESTS edges

1 participant