mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-10-04 02:31:36 +00:00
* fix(ingestion): own generic Rust inherent-impl methods through the mod-qualified Impl node (#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> * fix(ingestion): qualify className for same-tail Rust generic impls + regen rust bench baseline (#1992) F3 follow-up to #1992: two same-tail generic inherent impls under sibling mods that ALSO share a method name (`mod a { impl Inner { fn m } }` + `mod b { impl Inner { fn m } }`) keyed the method node id `${className}.${name}` with the bare tail (`Inner.m`) and collapsed onto one Function node (graph addNode is first-write-wins), silently dropping the second. The owner Impl `classId` was already mod-qualified, masking the collision behind distinct HAS_METHOD sources. Qualify `className` (`a.Inner` / `b.Inner`) in the bare inherent-impl arm so the node id inherits the mod scope; symmetric with the call-resolution fallback, and the HAS_METHOD owner anchors on the unchanged qualified classId. New same-method-name fixture + sequential & worker-parity tests; holds on both legs. Also regenerate the rust scope-capture bench baseline: the new rust-nested-tail-collision-generic (#1992) + rust-generic-impl-same-method-name (F3) fixtures grow the rust-* corpus, so the order-independent fingerprint drifts (56ffc1c0 -> b00aea0f, fixture_count 127 -> 129). Pure fixture-corpus drift — no scope-extractor change; existing fixtures' captures byte-identical. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * test(rust): regenerate rust-captures golden for the F3 same-method-name fixture (#1992) The rust-* scope-capture corpus is fingerprinted by TWO gates: the bench baseline (bench/scope-capture/baselines.json, already updated) and the rust-captures-golden unit test (test/fixtures/rust-captures-golden/expected-captures.json). Adding the F3 fixture rust-generic-impl-same-method-name grew the corpus 128->129 entries, so the committed golden drifted too. Regenerated additively (UPDATE_GOLDEN=1) — only the new fixture's entry is added; existing fixtures' captures are byte-identical. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
30 lines
931 B
Rust
30 lines
931 B
Rust
// #1992: GENERIC inherent-impl ownership. Two same-tail `Inner<T>` types under
|
|
// sibling mods, each with a generic inherent impl `impl<T> Inner<T>`. Their
|
|
// methods must own through DISTINCT mod-qualified Impl nodes (`a.Inner` /
|
|
// `b.Inner`), not orphan to File.
|
|
pub mod a {
|
|
pub struct Inner<T> { v: T }
|
|
impl<T> Inner<T> {
|
|
pub fn fa(&self) {}
|
|
}
|
|
}
|
|
|
|
pub mod b {
|
|
pub struct Inner<T> { v: T }
|
|
impl<T> Inner<T> {
|
|
pub fn fb(&self) {}
|
|
}
|
|
}
|
|
|
|
// Scoped-generic inherent impl: `impl<T> crate::c::Scoped<T>` is a `generic_type`
|
|
// wrapping a `scoped_type_identifier`. tree-sitter-queries materializes NO
|
|
// @definition.impl node for this shape, so `fd` must stay orphaned (scoped-generic
|
|
// deferred, #1992) — the owner walk must NOT mint a phantom `c.Scoped` owner.
|
|
pub mod c {
|
|
pub struct Scoped<T> { v: T }
|
|
}
|
|
pub mod d {
|
|
impl<T> crate::c::Scoped<T> {
|
|
pub fn fd(&self) {}
|
|
}
|
|
}
|