fix(extraction): never fabricate an edge from a call-result receiver - #1748
Merged
Merged
Conversation
A member call whose receiver is itself a call — `d.setdefault(k, []).append(v)`, `make().run()` — used to drop the receiver at extraction time, degrade to the bare method name, and exact-match any top-level project symbol of that name (Python and JavaScript/TypeScript). Keep the inner callee encoded as `<inner>().<method>` in the TS extractor and native kernel; the name-matcher refuses to guess for that shape (store-accessor exception only). Based on #1692, rebased onto main after #1746. Fixes #1683.
This was referenced Sep 8, 2026
colbymchenry
added a commit
that referenced
this pull request
Sep 8, 2026
…n methods (#1749) 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. Co-authored-by: Colby McHenry <colbymchenry@users.noreply.github.com>
This was referenced 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.
2 tasks
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
d.setdefault(k, []).append(v),make().run()) no longer drop the receiver and exact-match an unrelated top-levelappend/push/runin Python and JS/TS.<inner>().<method>; name-matcher refuses to guess for that shape (store-accessor exception only).main(post-fix(resolution): a binding in a module that exports nothing is not a cross-file candidate (#1719) #1746); CHANGELOG conflict resolved alongside Kotlin, Go, Rust: a private / unexported / non-pub definition is accepted as a cross-file name-match target #1731/An import of a workspace package resolves onto a non-exported local variable of the same name (157 edges in vitejs/vite) #1719 entries.Test plan
main(fabricatedexact-matchedges).lib.pushpreserved.__tests__/call-receiver-no-fabrication.test.tsfail→pass (kernel +CODEGRAPH_KERNEL=0).__tests__/object-literal-methods.test.ts,__tests__/resolution.test.ts, kernel TS/JS + grammar parity — pass.codegraph-kernelfor linux-x64 before kernel-path verification.Fixes #1683
Supersedes #1692 (same fix, rebased)