You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(parity): resolve C# same-class bare static calls + confidence filter for static receiver fallback (#1417)
* fix(resolver): apply confidence filter to static receiver fallback in resolveByMethodOrGlobal
Every other lookup.byName() path in this function applies computeConfidence >= 0.5
before returning candidates. The direct static receiver fallback (added in #1395) was
the only exception, risking false-positive edges across distant directories. All same-
directory static calls (e.g. C# fixture) still resolve at confidence 0.7.
Closes#1398
* fix(parity): resolve C# same-class static bare calls in WASM and native (closes#1416)
Both WASM and native engines were missing call edges for bare static method
calls within the same C# class — e.g. `IsValidEmail()` inside
`Validators.ValidateUser` should resolve to `Validators.IsValidEmail`, but
neither engine had a same-class fallback for no-receiver calls.
Three-part fix:
1. WASM (`build-edges.ts`): after the `this.method()` same-class fallback,
add a parallel fallback for no-receiver calls: when `targets` is empty
and the call has no receiver, try `CallerClass.callName` in the same file.
Only fires after the global exact lookup already failed, so module-level
functions always win.
2. Native Rust (`edge_builder.rs`): mirror the WASM fallback in step 5
of `resolve_call_targets` — when `call.receiver.is_none()` and the
global exact lookup returns nothing, try `CallerClass.callName` scoped
to the same file.
3. Role parity (`native-orchestrator.ts`): the Rust pipeline classifies
roles before JS CHA/this-dispatch post-passes add edges, giving stale
fan-out medians. When those post-passes insert new edges, run a full
role re-classification so the final roles see the complete graph.
Result: C# same-file static recall improves from 0/2 (0%) to 2/2 (100%).
Build-parity test: 8/8 pass (nodes, edges, roles, ast_nodes identical).
docs check acknowledged
* refactor(native-orchestrator): remove redundant partial role re-classifications
The full classifyNodeRoles(null) pass added in this PR already subsumes
both the CHA-only and thisDispatch-only file-scoped partial passes that
preceded it. Remove the two partial passes to avoid running the classifier
twice on thisDispatch-only builds.
* fix(build-edges): use lastIndexOf for namespace-aware class extraction in same-class fallbacks
Both the this.method() fallback and the bare-call same-class fallback were
using indexOf('.') which takes the first dot segment. For a caller named
MyNS.Validators.ValidateUser this yields MyNS instead of Validators, causing
the sibling edge lookup to miss. Align with call-resolver.ts which uses
lastIndexOf + prevDot to isolate only the segment immediately before the
method name.
* feat(resolver): infer C# var-declared instance types from new-expression initializers
When a local variable is declared with `var` and initialized via `new
ClassName(...)`, seed the typeMap with the constructor type at
confidence 1.0 so that subsequent method calls on that variable resolve
correctly. Fixes 0/4 recall on the csharp receiver-typed benchmark.
The C# tree-sitter grammar uses `implicit_type` (not `var_keyword`) for
`var` declarations, and the `object_creation_expression` sits as a
direct child of `variable_declarator` with no `equals_value_clause`
wrapper. Applied to both the WASM (TypeScript) and native (Rust)
extractors to maintain engine parity.
Closes#1402
0 commit comments