fix(resolution): resolve module-qualified calls colliding with builtin methods (#1681) - #1749
Merged
Merged
Conversation
…n methods isBuiltInOrExternal treated ledger.append as list.append unless the receiver matched a known class, so real module exports never reached resolveViaImport. Allow project-module receivers (verified via resolveImportPath) through while keeping stdlib/PyPI silent. Completes #1681 after #1748 fixed the FP half.
This was referenced Sep 8, 2026
colbymchenry
pushed a commit
that referenced
this pull request
Sep 8, 2026
inth3shadows
added a commit
to inth3shadows/codegraph
that referenced
this pull request
Sep 8, 2026
The maintainer asked on colbymchenry#1704 to drop the bits that were landing separately once colbymchenry#1749 merged. Both named PRs are on main now (colbymchenry#1748 bb1d309, colbymchenry#1749 edcd36e), along with three more python-resolution changes the same morning, so this reconciles against all of them rather than only the two. Six conflicts, resolved by what each side is now the authority on: - src/resolution/index.ts — take main in all three hunks. Its isPythonProjectModule is our own, byte-identical apart from one comment, so ours is deleted rather than merged; git had auto-merged both copies into a duplicate definition. Its isKnownClass is the stricter colbymchenry#1776 version, and the collection-binding filter now short-circuits before the class escape. - __tests__/resolution.test.ts — take main. Our +54 was subsumed by its +347; the delta of this branch against main for that file is now zero, which is exactly what was asked for. - src/extraction/tree-sitter.ts and codegraph-kernel/src/python.rs — keep both arms, main's first. colbymchenry#1748 claims the call-chain receiver (`d.setdefault(k, []).append(v)`) and encodes it as `<inner>().<method>`; ours stays the catch-all beneath it for the shapes that arm does not match, the attribute chain (`self.data.append`) and the subscript (`d[k].append`). The comments on both arms said they covered the call-chain shape and no longer do, so they are corrected in place. - __tests__/fixtures/kernel-parity/torture.py — union. bucket_chains keeps the call receivers; fabrication_shapes keeps a real attribute chain and a subscript, since its former call-chain line is now bucket_chains' job. What this branch still carries that main does not: the python attribute-type inference read from the AST, the chained-receiver gate, the kernel mirror for non-call receivers, the branch-guard changes and the module-suffix index. Verified: tsc --noEmit clean; npm test 4226 passed / 238 files. The three remaining failures (object-literal-methods, two in ui-steps-api) reproduce on a clean upstream/main worktree at ee83636 and are not from this merge; a fourth, ui-server-api's "under 100 ms", is a wall-clock assertion that passed and then failed at 113ms in the same command. NOT verified: the Rust arm. There is no cargo on this machine, so every kernel-*-parity suite describe.skipIf's itself and the python.rs change is unexercised.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ledger.append(row)afterfrom . import ledgerproduced nocallsedge becauseisBuiltInOrExternalclassified anyx.appendas a builtin unless the capitalized receiver matched a known class. Module receivers never qualified, so the ref never reachedresolveViaImport/resolvePythonModuleMember(which already handleledger.path()correctly).resolveImportPaths to a project file, let it through. Stdlib/PyPI receivers (os.remove) still stay silent — avoids reintroducing fabricated bare-name edges.mainvia fix(extraction): never fabricate an edge from a call-result receiver #1748 (d.setdefault(k, []).append(v)no longer exact-matches). Asserted here for regression coverage.Test plan
appendcallers empty;pathresolves); E FP already gone after fix(extraction): never fabricate an edge from a call-result receiver #1748__tests__/call-receiver-no-fabrication.test.tsstill greenfrom pkg import module) — zero recall on a common test/namespacing pattern #578 / [python] matching built-ins #1230 filters still greenRefs: #1681, #1704, #1748