ruvector/crates/ruvector-router-ffi/src
rUv e359e53230 fix(router): 7 bugs in @ruvector/router — broken wrapper, score inversion, DB crashes (#333)
* fix(router): 7 bugs — broken wrapper, score inversion, DB crashes

Fixes #332

Critical:
- router-wrapper.ts: `dimensions` → `dimension` (constructor always threw)
- router-wrapper.ts: align with actual SemanticRouter API (addIntent,
  route, routeWithEmbedding, removeIntent)

High:
- index.js: convert native distance scores to similarity (0→1 scale)
- storage.rs: handle TableDoesNotExist on fresh DB reads
- lib.rs (FFI): unique temp DB path per instance (no lock conflicts)

Medium:
- index.js: addIntentAsync throws on missing embedder+embedding
- index.js: load() validates dimension mismatch
- package.json: align all platform deps to 0.1.28

CI:
- build-router.yml: --cargo-cwd → --manifest-path for newer napi-rs

Co-Authored-By: claude-flow <ruv@ruv.net>

* fix(ci): revert to --cargo-cwd for napi-rs/cli v2.x

The CI devDependency @napi-rs/cli ^2.18.0 uses --cargo-cwd.
--manifest-path is v3.x only.

Co-Authored-By: claude-flow <ruv@ruv.net>

---------

Co-authored-by: Reuven <cohen@ruv-mac-mini.local>
2026-04-06 16:27:46 -04:00
..
lib.rs fix(router): 7 bugs in @ruvector/router — broken wrapper, score inversion, DB crashes (#333) 2026-04-06 16:27:46 -04:00