Repository navigation
Close resolution gaps and port missing dynamic-dispatch passes - #11
Merged
Merged
Conversation
Resolution, for the supported languages: - Go: embedded standard-library types join interface satisfaction (method table ported from upstream) and other outside embeds are opaque; a project embed the kernel writes without its package binds through the qualifier. - TS/JS: calls through `const x = y`, `export const alias = impl` and object-literal members reach the real function; ES5 constructors type their instances through prototype members and util.inherits / Object.create; `declare module 'x'` blocks in .d.ts files bind imports. - Rust: generic parameters resolve through trait bounds (an unbounded one never matches a same-named project type); impl Deref targets, type aliases and Mutex/RwLock guards are looked through; self.field chains are evaluated. - Python: branched factories are typed by their common base, self.x = self.make() types fields across methods, pytest fixture parameters take the fixture's return type. Synthesis passes: go-func-field, go-grpc-stub-impl, gin-middleware-chain, const-alias, redux-thunk, rtk-query, test-request (Spring MockMvc, WebTestClient, TestRestTemplate, RestAssured), kotlin-expect-actual, tauri-command and rn-native-module. All are recomputed whole on sync. Incremental sync re-resolves on Deref, type-alias and fixture changes (a changed conftest re-resolves the Python files below it). Engine rule version 7; segment format unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Compared with upstream CodeGraph on the languages cgr supports, calls were left unresolved (or resolved to the wrong symbol) in several recurring shapes: Go interfaces that embed standard-library types, calls through Go struct fields holding functions, JS/TS aliases and ES5 prototypes, Rust generics,
Derefand type aliases, and Python factories, cross-method fields and pytest fixtures. Ten upstream dynamic-dispatch synthesis passes relevant to these languages had no cgr counterpart.Changes
Resolution
go-stdlib-methods.ts); other outside embeds are opaque, so only a type embedding the same one satisfies the interface. A project embed the kernel writes without its package (sandbox.Manager→Manager) now binds through the written qualifier. This also removes a false positive: a type with onlyCloseno longer implements an interface embeddingio.Reader.const x = y,export const alias = impland object-literal members (api.run()) reach the real function (upstreamalias-binding). ES5 constructors type their instances through prototype members, withutil.inherits/Object.create/setPrototypeOfinheritance recorded asextends.declare module 'x' { … }blocks in script.d.tsfiles bind TypeScript imports ofx.whereclauses included), and an unbounded parameter never matches a same-named project type. Member lookup looks throughimpl Dereftargets,type X = Yaliases andMutex/RwLocklock guards.self.fieldcall chains are evaluated.self.x = self.make()types a field across methods; pytest fixture parameters (same file or aconftest.pyabove) take the fixture's return type.Synthesis passes (all recomputed whole on sync)
go-func-field,go-grpc-stub-impl,gin-middleware-chain,const-alias,redux-thunk,rtk-query,test-request(Spring MockMvc / WebTestClient / TestRestTemplate / RestAssured → routes),kotlin-expect-actual,tauri-command(registered commands only, looked up per app) andrn-native-module(NativeModules.X.m()→ Java/Kotlin@ReactMethod).Incremental sync:
Deref, type-alias and fixture facts take part in invalidation; a changed fixture re-resolves the Python files of itsconftest.pydirectory, since pytest injects fixtures without an import.Engine rule version 7, so existing indexes rebuild on the next sync. Segment format unchanged. Both READMEs list the new rules and what remains uncovered.
Validation
13 focused resolver tests (
crates/cg-resolve/tests/gap_closure.rs), each with positive cases and links that must not be made.An incremental test (
crates/cg-sync/tests/gap_closure.rs) edits both sides of every new link over 11 steps. Each step must equal a fresh full index without falling back to a full rebuild.CGR_SYNC_SEQUENCES=6 CGR_SYNC_STEPS=100 cargo test --workspace --locked: 192 passed, 1 existing ignored.cargo +1.99.0 clippy --workspace --exclude cg-kernel --all-targets -- -D warnings,cargo +1.89.0 check --locked, the CI rustfmt package list andscripts/smoke.shall pass.Real repositories, main vs this branch (edge sets diffed, added edges spot-checked against source):
The one opencode removal is a precision gain:
Notifications.tui()moved from a type member to the real implementation. These comparisons caught two regressions before commit, both now covered by tests: qualified project embeds treated as opaque, and Rust type aliases blocking member lookup.Notes for reviewers
🤖 Generated with Claude Code