Repository navigation
fix(resolve): bind imported members, cross-module Go calls and initializers - #215
Merged
Merged
Conversation
…lizers Eight independent surface defects, batched because each is small and none shares a design with another. An explicit Python import was ignored. `from pkg.mod import real_target` resolved to a same-named function in an unrelated module, and the `as aliased` form produced no edge at all — a false edge and a missing one from the same cause: the import's dotted source was never mapped to a path, and the fallback required an `is_exported` flag our Python extractor never sets, so the reference fell through to name matching. Go calls across module boundaries produced nothing, because a module was identified by path without knowing which directory it lived in. Modules are now located by walking each file's ancestors for a `go.mod`, and the longest matching module path wins, so `ex/abc` is not mistaken for a child of `ex/a`. A call in a declaration initializer was attributed to the file rather than the declarator, so `callers` answered with a filename. It now names the constant. A mutating command that retargets an ancestor index says so; previously `index .` inside a subdirectory rebuilt the parent silently. `callers`, `callees` and `impact` accept `--file` to disambiguate same-named definitions, and an unmatched filter is an error listing the defining files rather than an empty result that would read as "this symbol is dead". The explore note no longer states a call budget nothing enforces, which made agents stop early; it now says there is no limit. MCP instructions list the languages we actually support, generated from the language registry rather than copied prose, which is the one golden this change regenerates. The installer gains VS Code, Copilot CLI and JetBrains targets.
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## main #215 +/- ##
==========================================
+ Coverage 95.25% 95.30% +0.04%
==========================================
Files 137 139 +2
Lines 74928 76041 +1113
==========================================
+ Hits 71375 72473 +1098
- Misses 3553 3568 +15
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
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.
Tier 6 of the post-
v1.5.0upstream sync — eight independent surface defects, batched because each is small and none shares a design with another. Every one was reproduced on a real index before the fix.An explicit Python import was ignored (#1518)
Worse than upstream's framing, which blames line-wrapped parenthesized import lists — the single-line form fails identically, and produces a false edge plus a missing one from the same cause:
Root cause is neither of upstream's: the import's dotted source was never mapped to a path, and the fallback gated on an
is_exportedflag our Python extractor never sets. Both halves failed, so the reference fell through to name matching. The fix is gated narrowly soreference/golden/python/'sfunction-refedges are untouched.Go calls across module boundaries (#1521)
Two modules,
ex/brequiringex/a: 0callsedges before,Use -> Helper@a/lib.goafter. A module was identified by path without knowing its directory; modules are now located by walking each file's ancestors for ago.mod, and the longest matching path wins soex/abcis not mistaken for a child ofex/a. Pinned by a file-order-independence test and that segment negative.Declaration initializers (#1510, upstream PR #1511)
export const value = target();attributed the call to the file, socallers targetanswered with a filename:Controls pin that function-local initializers stay attributed to the function, and that a multi-declarator statement attributes per declarator.
The rest
index .inside a subdirectory rebuilt the parent index silently, reporting files the user did not ask about. It now warns, onsync/uninit/unlocktoo.callers/callees/impactaccept--file. Matching is segment-aligned, soother.tsnever selectsmy_other.ts, and an unmatched filter is an error listing the defining files rather than an empty result that would read as "this symbol is dead".Languageregistry rather than copied prose. This is the one golden this change regenerates (mcp/initialize.json, one field appended), verified against the live server.--print-configassertion did not catch a brokeninstall, so it now reads the written file instead.Verification
make cigreen: 132 suites / 3304 passed / 0 failed (baseline 129 / 3231).CURRENT_EXTRACTION_VERSIONstill 7; no schema,NodeKindorEdgeKindchange;crates/codegraph-resolve/src/frameworks/untouched.reference/movement is onlymcp/initialize.json.reference/golden/erlang/edges.jsonstill holds its 2 legitimate recursivecallsself-edges.Self-index delta — controlled, same source, old vs new binary
Exactly two edges, both intended.
file:sample.astro → method:fetchbecameconstant:posts@sample.astro → method:fetch— #1510 working. And a new edgeRunCheckoutFlow@…/e2e/flow.go → Double@…/math.go: that fixture has ago.modnested undercrates/codegraph-cli/tests/fixtures/go_test_convention/with none at the repo root, so this repository's own tree was a latent instance of #1521.One finding worth separate attention
The
codegraph-benchgolden suite writes JSON from the committedcolby.dband compares it to the committed JSON — so it guards database↔JSON consistency but never re-runs the extractor, and therefore cannot detect an extraction change on its own. I confirmed both halves: corruptingcolby.dbdoes fail the suite, and no test in that crate invokes the extractor. Real byte-stability requires regenerating from the corpora, which is what the tiers that changed extraction did. Regenerating also surfaces three diffs (godot/schema.sql,mini/refs.json,mini/schema.sql) that are pre-existing on cleanmainand unrelated to this change;mini/refs.jsongaining athis.valuefunction_refrow looks like content drift rather than ordering noise and deserves its own look.