fix(ingestion): own generic Rust inherent-impl methods through the mod-qualified Impl node (#1992)#1997
Closed
magyargergo wants to merge 2 commits into
Closed
Conversation
…d-qualified Impl node (abhigyanpatwari#1992) A generic inherent-impl target (`impl<T> Inner<T>`) is a `generic_type` node, which the inherent-impl owner walk (findEnclosingClassInfo) did not match — so the walk returned null and the method got `File -> DEFINES` with NO HAS_METHOD edge (orphaned, and invisible to findDanglingEdges). The Impl node was already correctly mod-qualified (the @name capture drills into the inner type_identifier, tree-sitter-queries.ts), so this is an owner-walk-only fix: drill into the generic base and mirror the node gate so the owner id == the node id byte-for-byte. A scoped-generic target (`impl<T> a::Inner<T>`) materializes no Impl node and is left orphaned (deferred) rather than minting a phantom owner. The owner walk is shared by the sequential and worker paths. New fixture + tests assert positive HAS_METHOD ownership through distinct `a.Inner` / `b.Inner` nodes on both resolver legs and the worker path, plus a negative scoped-generic guard. rust-captures-golden regenerated additively for the new fixture. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@magyargergo is attempting to deploy a commit to the NexusCore Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
CI Report❌ Some checks failed Pipeline Status
Test Results
✅ All 11044 tests passed 16 test(s) skipped — expand for details
Code CoverageTests
📋 View full run · Generated by CI |
Collaborator
Author
|
Superseded by same-repo stacked PR #2003 (rebased into a 5-PR stack for conflict-free one-by-one merge with auto-retarget). |
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
Follow-up to #1981 / #1982.
bc4a560dmod-qualified the unscoped bareimpl Innertarget; a generic inherent-impl target (impl<T> Inner<T>) was not.The Impl node was already correctly mod-qualified for generic impls (the
@namecapture drills into the innertype_identifier,tree-sitter-queries.ts:1226). The defect was in the owner walk (findEnclosingClassInfo): its inherent-impl arm matched onlytype_identifier/scoped_type_identifier, so ageneric_typetarget fell through, the walk returnednull, and the method gotFile → DEFINESwith noHAS_METHODedge — orphaned, and invisible tofindDanglingEdges.Fix
Single site in
findEnclosingClassInfo: match ageneric_typetarget, drill into its base (childForFieldName('type')), and qualify a baretype_identifierbase via the samequalifyRustImplTargetByModScopethe node side uses → owner id == node id byte-for-byte (a.Inner/b.Inner). A scoped-generic base (impl<T> a::Inner<T>) materializes no@definition.implnode, so it falls through with no owner (orphaned, deferred) rather than minting a phantom owner. Node-typed and Rust-impl-gated — no other language reaches theimpl_itemarm; no shared-walker change for other languages.Tests
New
rust-nested-tail-collision-genericfixture + tests:fa/fbown through distinct mod-qualified Impl nodes (a.Inner/b.Inner) — fails pre-fix (methods orphan toFile).fdis not owned through a phantom node (deferred scope-out).usedWorkerPool === true).Verification
rustresolver suite: registry-primary leg 174/174, legacy leg 172 + 2 by-design skips — both green, including the worker path.tsc --noEmitclean; prettier clean.rust-captures-goldenregenerated additively (4 insertions — the new fixture only); scope-capture tripwire unaffected.Closes #1992.
🤖 Generated with Claude Code