Repository navigation
Fix JavaScript and TypeScript graph resolution gaps - #12
Merged
Merged
Conversation
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.
Problem
The six-repository investigation found that tracked-but-ignored package manifests caused Zod workspace imports to be treated as external, and that JS/TS calls could target a same-named interface, a function from another closure, or a method on an unrelated receiver. Namespace imports forwarded through local exports were also lost, and the pinned TypeScript grammar reported errors for valid
in/outvariance annotations.Changes
this/superin JS/TS call references. Avoid a unique-name guess for an unknown JS receiver. Restore a same-objectthiscall only when its nearest function and the assigned target have matching object evidence; ordinary nested callbacks do not inherit it.merge-descriptorsfactory pattern when the factory, returned object, exported application object, and assigned method agree. Reassignments, overrides, early exits and methods belonging to a different object stop the inference.Validation
cargo test --workspace --lockedwithCGR_SYNC_SEQUENCES=6 CGR_SYNC_STEPS=100passed locally.cargo +1.99.0 clippy --workspace --exclude cg-kernel --all-targets --locked -- -D warnings, the CI formatting check, the end-to-end smoke script, and re-vendoring the pinned kernel plus its patches and comparing the result.this/super, nested callbacks, and unrelated receivers; proven Express applications versus reassignment, early return, method override, different objects, and replaced exports; and incremental versus fresh rebuilds after manifest, factory, member, and re-export edits.examples/auth/index.js:21still resolvesapp.usetolib/application.js::use;lib/application.js:222no longer resolvesrouter.useto it;examples/resource/index.js:14,15,21no longer resolvethis.getto an unrelated example. In Django'sinlines.js, calls at lines 421–423 resolve to the functions at lines 382, 362 and 370 respectively.The following is strict edge/site agreement with upstream codegraph
d2e0389, not precision/recall against human-verified ground truth. Both versions saw the same indexed source paths and bytes (Express 142 files, Zod 523, Django 2,984). The Zod before/after runs also used the same Git checkout. The baseline is latest main2e83569; its strict graphs for these three repositories are identical to the prioredb403ebenchmark graphs. These are diagnostic graph comparisons, not a new performance benchmark.Zod's four TypeScript parse-error files dropped to zero in this snapshot. The lower Express agreement recall reflects the more conservative receiver rules; an upstream-only edge is not necessarily correct. Kotlin error-tree recovery and Go composite-literal calls identified separately in the investigation are outside this JS/TS-focused change.