Repository navigation
call resolver (ts/js): only a binding is bare-callable; signatures are never targets (#3757, #3758, #3759) - #3767
Merged
Conversation
…e never targets (#3757, #3758, #3759) The detector now records what each typescript/javascript definition is, as function_data.def_shape: binding `function f`, `const/let/var f = ...` -- the only shape a bare call can reach member object-literal method, object property, `x.f = () => ...` signature interface member, `abstract` method, overload signature (the terminator scan's bodyless `;`/#2278 case) Other languages leave it NULL. The recorder persists it (plus a heal for old DBs); the rehydrator already carries every column, so delta scans see it. The resolver: - drops signatures from the definition index: no code runs there (#3757); an overloaded function now reaches its implementation; - keeps members out of the bare-call (`free`) set: `import { clone }` no longer loses to an object-literal `clone(def, params) {}` in a namespace-imported module (#3758); - among several same-file bindings in ts/js, a bare call takes the nearest one written before it, else the last (hoisting) -- `const Node = ...` per test callback (#3759). Python is left alone: a module-level redefinition is legal there and the last one wins at runtime. zod (TypeScript Level 2 gate): confident wrong 6 -> 1 (the one left is #3756), precision 99.6% -> 99.9%, unmapped 216 -> 10, recall 57.2% -> 57.1% (within tolerance). Calls that used to land on signatures are now ambiguous `receiver` rows, not edges: ambiguous precision 54.5% -> 32.1% (reported, not gated). Baseline regenerated. Python gate unchanged (99.8% / 51.6% / 97.5%). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01AbvXUJpva5XxxbssoKG9Jt
Contributor
This was referenced Sep 26, 2026
Closed
Call resolver: explain one link (rung, candidates, qualifier) without reading call_resolver.py
#3776
Closed
Java: confident links to bodyless interface / abstract methods (#3757's pattern outside TS/JS)
#3836
Closed
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
Fixes #3757, fixes #3758, fixes #3759.
The three issues share a root cause. In TypeScript and JavaScript, only a declaration binds a name that a bare call can reach. The resolver couldn't tell a declaration from the other things the detector extracts as functions:
import { clone }vsimport * as schemas) #3758:import { clone }resolved to an object-literal methodclone(def, params) {}in a namespace-imported module.const Node = …per test) all resolve to one of them, not the enclosing scope's #3759: a scoping rule forconst Node = …per test callback couldn't work while object-literal methods (optional() { return optional(this); }) counted as candidates. A first attempt without this fix netted zero on zod: 3 links fixed, 3 broken.abstractmethods, which run no code, were confident call targets.Detector:
def_shape(typescript/javascript only)_slice_by_bracesrecords one of three values on each TS/JS function:def_shapebindingfunction f,const/let/var f = …memberf() {}, propertyf: () => …,x.f = () => …, class methodsignatureabstractmethod, overload signature;before any body, or [TypeScript] Same-name overload signatures collapse to one — detector.py drops 6 of 7 bodylesspipeableoverloads #2278's no-terminator case, marks a signature.function/const/let/var/classkeyword in the statement segment before the name, i.e. after the last{ ; , (on the name's line, makes it a binding.Recorder
function_data.def_shape(TEXT, NULL outside TS/JS), plus a_heal_columnfor existing DBs.function_datacolumn into the rehydrated function, so a delta scan resolves exactly as a fresh one does. There's a new test for that.Resolver (
core/call_resolver.py)nonerather than a confident edge to code that never runs.import { clone }vsimport * as schemas) #3758:memberdefinitions are kept out ofbucket.free, the set a bare call can reach. Receiver calls are unchanged.const Node = …per test) all resolve to one of them, not the enclosing scope's #3759: new_BLOCK_SCOPED_LANGS(typescript, javascript). When a bare call lands on one of several same-file bindings, it takes the nearest one written before the call. If none precedes the call, it takes the last one, because function declarations are hoisted. Python is excluded on purpose: a module-level redefinition is legal there and the last one wins at runtime. A test pins that.Measured
zod, TypeScript Level 2 gate:
ctx.addIssue)The ambiguous precision drop is expected. Calls that used to land confidently on an interface or
abstractsignature now fall through to the ambiguousreceiverstep. The real target is dynamic dispatch, which a heuristic can't know. Ambiguous rows are never graph edges, so no edge got worse.The
const Nodecases,withChecks → cloneandnullish/optional → optionalnow all agree with the checker.Python pyan3 gate: unchanged, at 99.8% (1,806 judged) / 51.6% / 97.5%.
Type of change
gitgalaxy/core/detector.py,language_standards.py,prism.py, or a per-language rule)CI checklist
ruff_audit.py --ci,dead_key_audit.py --ci: OK.ruff format(0.16.0) is clean on every touched file.mypy_audit.py --cishows only the four findings present onmain, from missing stubs in this environment, none in touched files.numpy/pandas/xgboostmissing from the local interpreter. After installing them,test_security_auditor.pypasses 15/15.test_call_resolver.py: 5, one per issue plus the Python guard and hoisting.test_detector.py:def_shapeclassification for TS and JS; unset for C.test_fcall_data.py:def_shapepersists and rehydrates.crucible_check.py --mode zero: PASS, no golden-master drift. Full-precision can't run in this environment, because the network policy blocks tiktoken'scl100k_basedownload. CI'scrucible-audit (full-precision)is the check for that half.tree_sitter_accuracy_audit.py --ci --all: all OK, 30 languages.call_graph_resolution.py typescript --regenerate, which locks in the improvement, andpython --ci, which is OK.def_shapeis a DB column only.Differential Scan target
https://github.com/colinhacks/zod (pinned in
tests/import_graph_corpus.json)Verification
🤖 Generated with Claude Code
https://claude.ai/code/session_01AbvXUJpva5XxxbssoKG9Jt
Generated by Claude Code