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(native): type map confidence-aware dedup for engine parity (#885)
* fix(native): type map confidence-aware dedup for engine parity
The native engine's type map used HashMap::collect() (last-wins) while
the JS engine used setTypeMapEntry (highest-confidence, first-wins on
tie). When the same variable name appeared in multiple function scopes
with different type annotations (e.g. `node: TreeSitterNode` and
`node: NodeRow` in cfg.ts), the engines disagreed on the resolved type,
producing different receiver/calls edges.
Additionally, the Rust JS extractor returned early after finding a type
annotation, skipping constructor inference — unlike the JS extractor
which lets constructors (confidence 1.0) override annotations (0.9).
Changes:
- Add `confidence` field to Rust TypeMapEntry and TypeMapInput structs
- Fix Rust edge builder to keep highest-confidence entry per name
- Remove early return in Rust JS extractor; emit both annotation and
constructor entries with appropriate confidence levels
- Add confidence values to all 12 Rust language extractors
- Add JS-side type map dedup in buildCallEdgesNative for immediate
parity without requiring a native addon rebuild
Verified: receiver edge counts now identical between engines (735=735),
cfg.ts correctly resolves to TreeSitterNode on both engines.
* feat(ci): gate release workflow on resolution precision/recall thresholds (#875)
Add resolution quality gates to the benchmark pipeline so regressions
are caught before publishing:
- benchmark.yml: run vitest resolution test after the benchmark script,
failing the workflow if any language drops below its threshold
- update-benchmark-report.ts: warn on precision >5pp or recall >10pp
drop per language between releases
- regression-guard.test.ts: hard-fail CI on precision/recall regressions
across releases, with KNOWN_REGRESSIONS exemption support
* style: fix biome formatting in regression guard
* fix: remove invalid #[napi(default = 0.9)] attributes causing Rust compile failure
napi-rs v3 does not support the `default` attribute on `#[napi(object)]`
struct fields — only on function parameters. The macro expansion failed,
preventing TypeMapEntry and TypeMapInput from being generated, which
cascaded into "not found in scope" errors across all extractors and the
build pipeline. Removing the attribute is safe because all call sites
(JS buildCallEdgesNative and Rust build_pipeline) always provide the
confidence value explicitly.
* fix: clarify dedup comment per review — no-op for Map path, needed for Array path (#885)
0 commit comments