Skip to content

fix(resolution): resolve module-qualified calls colliding with builtin methods (#1681) - #1749

Merged
colbymchenry merged 1 commit into
mainfrom
fix/1681-python-module-builtin-collision
Sep 8, 2026
Merged

colbymchenry merged 1 commit into
mainfrom
fix/1681-python-module-builtin-collision

Conversation

@colbymchenry

Copy link
Copy Markdown
Owner

Summary

Test plan

Refs: #1681, #1704, #1748

…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.
@colbymchenry
colbymchenry merged commit edcd36e into main Sep 8, 2026
@colbymchenry
colbymchenry deleted the fix/1681-python-module-builtin-collision branch September 8, 2026 05:27
colbymchenry pushed a commit that referenced this pull request Sep 8, 2026
)

Fixes #1631.

Rebased contributor PR #1632 onto main (post-#1749). Lexical containment for `fileExists` filesystem fallback via `lexicalPathWithinRoot`; #935 in-root symlink behaviour preserved.
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.
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.

1 participant