fix(resolution): link imported Go and Dart values#1257
Draft
Adam0120 wants to merge 1 commit into
Draft
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.
Summary
Link Go and Dart readers to imported top-level constants and variables so
codegraph_node, callers, and impact analysis include value consumers outside the definition file.This adds an internal
value_refreference kind that resolves only through explicit import/package mappings and persists as a normalreferencesedge withmetadata.valueRef. It does not change search ranking or add fuzzy matching.Reproduction and root cause
Value-reference extraction currently builds edges only when the reader and file-scope value share one AST. Cross-file values produce no unresolved reference, so the resolver never sees them.
Two real examples:
realtime.DefaultSessionStoreis read fromp2p/service.goanduserapi/consumers/roomserver.go, but its impact radius previously contained only the definition.agentBridgePresenceProvideris read by several pages and tests, but its impact radius previously contained only the provider declaration.Precision boundary
package:<pubspec name>/...URI. Prefixed imports are supported.value_refnever falls through to the name matcher.Incremental sync
The original reference kind and name are stored in edge metadata. If the imported target disappears during sync, the edge is dropped; when the target returns, the unchanged reader is re-resolved and the edge is restored.
Validation
npm run build__tests__/value-reference-edges.test.ts: 32/32 passed__tests__/sync.test.ts: 31/31 passed__tests__/extraction.test.ts: 579/579 passed__tests__/resolution.test.ts: 165/169 passed; the four failures are the pre-existing WindowsEBUSYcleanup failures in C/C++ and PHP end-to-end fixturesDefaultSessionStorenow reports both direct readers and a 7-symbol transitive impact radiusagentBridgePresenceProvidernow reports four production reader methods plus three test entry points and a 46-symbol transitive impact radiusdirextalk_matrix_events.dirextalkAgentStatusEventTyperesolves to its source constantBehavior boundary
This intentionally does not evaluate dynamic imports, Dart conditional/show/hide combinators, external packages, re-export barrels, or ambiguous imported names. Missing uncertain edges are preferred over incorrect ones.