Skip to content

fix(extraction): a TS/JS call through a host-global chain emits no ref (#1707) - #1766

Merged
colbymchenry merged 1 commit into
mainfrom
fix/1707-chained-receiver-host-global
Sep 8, 2026
Merged

colbymchenry merged 1 commit into
mainfrom
fix/1707-chained-receiver-host-global

Conversation

@colbymchenry

Copy link
Copy Markdown
Owner

Summary

Credit: @bompus authored the original fix in #1710; this PR rebases it onto latest main and verifies the Rust kernel on Linux.

Scope left open

this.map.get(k) and rows[0].text() still bare-name match — those need receiver typing (#1496 / #1691), not this host-global gate.

Test plan

  • Reproduced on Linux main: __tests__/ts-chained-receiver.test.ts2 failed / 1 passed on both kernel and CODEGRAPH_KERNEL=0 (wasm).
  • With this commit + scripts/build-kernel.sh: 3/3 pass on kernel and wasm.
  • Smoke: __tests__/nextjs.test.ts (36), __tests__/react-native-bridge.test.ts (24) pass.
  • Confirmed __tests__/object-literal-methods.test.ts failure is pre-existing on main, not introduced here.

Fixes #1707
Supersedes #1710

#1707)

`chrome.storage.local.get(key)` and `document.body.querySelector(s)` end in
a platform API, but the extractor emitted the bare method name for them. That
name then exact-matched whatever project symbol shared it: in a Chrome
extension every `chrome.storage.local.get/set` inside a storage wrapper bound
to the wrapper's own `get`/`set`, giving self-edges that are not in the
source (#1707).

A member chain whose root identifier is a host object the project never
declares now emits nothing — a silent miss instead of a wrong edge, the same
trade the literal-receiver gate makes (#1230). `window` is deliberately not a
host root: `window.MyNs.doThing()` reaches a project symbol. A chain rooted at
a project value keeps the bare name, so `store.getState().act()`, `ref.value
.m()` and `this.<field>.m()` are untouched.

The Rust kernel mirrors the same gate. Verified on Linux: fail→pass on both
kernel and wasm arms for `__tests__/ts-chained-receiver.test.ts` (2 fail / 1
pass on main → 3/3 with the fix).

Lands / rebases #1710 onto
current main.

Co-authored-by: Aaron Queen <bompus@users.noreply.github.com>
@colbymchenry
colbymchenry merged commit a7ea5ba into main Sep 8, 2026
@colbymchenry
colbymchenry deleted the fix/1707-chained-receiver-host-global branch September 8, 2026 12:47
bompus added a commit to bompus/codegraph that referenced this pull request Sep 8, 2026
Upstream re-landed four of the fork's changes under its own commits today
(colbymchenry#1697 directly; colbymchenry#1766, colbymchenry#1767, colbymchenry#1769 rebased from the closed colbymchenry#1710, colbymchenry#1706,
colbymchenry#1695), so the fork carried a second copy of each and the hourly sync stopped
with nine conflicts. Upstream's version wins wherever it now owns the change.

take upstream, drop the fork's duplicate:
  src/bin/codegraph.ts        capPromptHookInjection() supersedes the inline
                              MAX = 9000 the fork carried from colbymchenry#1695.
  src/extraction/tree-sitter.ts  CommonJS export assignment support (colbymchenry#1675);
                              the fork had no version of it.
  src/resolution/name-matcher.ts  comment-only conflict; upstream's text
                              already covers colbymchenry#1745, colbymchenry#1719, colbymchenry#1714, colbymchenry#1230,
                              colbymchenry#1708 and colbymchenry#1709.

keep the fork's version, upstream has none:
  src/mcp/tools.ts            the codegraph_sessions tool definition (colbymchenry#1702).
  README.md                   documents that alwaysLoad also covers
                              codegraph_sessions.
  __tests__/fixtures/kernel-parity/torture.tsx   markdown-path fixture.

union, upstream entry first:
  CHANGELOG.md                per UNION_MERGE_FILES.
  __tests__/fixtures/kernel-parity/torture.js    the fork's colbymchenry#693 initializer
                              walks and upstream's colbymchenry#1675 CommonJS exports are
                              different fixtures at the same point in the file.
  __tests__/fuzzy-lexical-reach.test.ts   add/add: both sides created it.
                              Upstream's C-nesting test plus the fork's two
                              sealed-module tests, with the one test both
                              sides wrote kept once.

Verified on Windows against a release build of the kernel: tsc --noEmit
clean, npm run build clean (engine, UI, 29 wasm grammars), full native suite
4438 passed of 4483. The single failure is a refresh-launcher timeout that
passes in 2.7s when the file is run on its own.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant