Replaces the route subcommand (which used Router.route's 5-feature engineering —
a different model contract) with 'score', backed by tiny-dancer's score() raw
forward pass that matches trainRouter models. Also fixes the earlier Float32Array
issue by removing the Router.route path entirely.
Co-Authored-By: claude-flow <ruv@ruv.net>
score(modelPath, embedding) loads a trainRouter .safetensors and runs the
FastGRNN directly on the raw embedding (the inference path that matches how
trainRouter trains — Router.route's 5-feature engineering is a different model
contract). Validated easy=1.0/hard=0.0 on a freshly built binary.
Co-Authored-By: claude-flow <ruv@ruv.net>
Adds trainRouter/DracoRowJs/TrainRouterOptions/TrainRouterResult to the
hand-written index.d.ts and bumps to 0.1.21 (8 optionalDependencies lock-stepped)
so the native train_router export ships typed across all environments.
Co-Authored-By: claude-flow <ruv@ruv.net>
Extends the build/publish workflow from 5 to 8 environments:
- linux-x64-musl, linux-arm64-musl (Alpine/Docker) via napi --use-napi-cross
- win32-arm64-msvc (Windows on ARM) via rustup target cross-compile
index.js now detects musl vs glibc at load time (process.report glibc header)
and routes to the correct binary; adds win32-arm64. package.json bumped to
0.1.20 with all 8 optionalDependencies lock-stepped.
Co-Authored-By: claude-flow <ruv@ruv.net>
Root cause of version drift: build-tiny-dancer.yml hard-coded VERSION="0.1.15",
so every publish shipped stale platform binaries while the main package advanced
(npm 0.1.18 was loading 0.1.15-era .node files).
- workflow: derive VERSION from package.json; rewrite main optionalDependencies
to pin that exact version before publishing, so binaries and JS can never skew.
- package.json: bump to 0.1.19, pin all 5 optionalDependencies to 0.1.19,
remove dead `publish:platforms` script (scripts/publish-platforms.js absent).
- crate Cargo.toml: remove [profile.release] (Cargo ignores non-root profiles;
release opt is already opt-level=3/lto=fat/codegen-units=1/strip at root).
Co-Authored-By: claude-flow <ruv@ruv.net>
* feat(ruvector-npm): ADR-210 wave 1 — default-on semantic embeddings contract (D0/D1/D4/D5)
D0: embedding-provenance invariant {embedderKind, modelId, dimension,
normalize, prefixPolicy} stamped on hooks intelligence stores and .db
sidecars; mixed-provenance inserts refused naming both sides; legacy
stores derive hash-provenance and open read-only for vector writes until
hooks reembed (new command, --dry-run/--drop-missing; memories retain
content so re-embedding is real). Reads on mismatched stores warn once
per process instead of returning silently meaningless similarity.
D1: IntelligenceEngine enableOnnx defaults true with lazy init;
stats().embedderKind = onnx-minilm | hash-fallback | hash; exactly one
stderr warning per process on first fallback use; ambient hooks
(post-edit/post-command) use best-effort writes so a locked store never
fails them.
D4: model registry gains prefixPolicy/queryPrefix/passagePrefix per the
model cards (MiniLM none, e5-small-v2 required, bge-small-en-v1.5
query-recommended); embedQuery/embedPassage apply prefixes before
tokenization and the cache key; MiniLM output stays byte-identical.
D5: RUVECTOR_EMBEDDER=auto|minilm|hash (minilm hard-requires, no
fallback) > RUVECTOR_ONNX=0|1; RUVECTOR_REEMBED=refuse|warn|auto
enforced at vector-op time (open-time cannot know the embedder before
lazy init — documented judgment call).
Acceptance gates 1-7 pass with the model loaded (tests/
adr-210-acceptance.test.mjs + embedding-provenance.test.mjs); npm test
69+7 green; sona-drift harness passes with zero fingerprint shift.
Wave 2 (D2 text-corpus recall benchmark, D3 int8 bulk ingest, gate 8,
mcp-server.js D0 bypass) follows.
Co-Authored-By: claude-flow <ruv@ruv.net>
* feat(ruvector-npm): ADR-210 wave 2 — text-corpus recall gate, parallel bulk ingest, D0 bypass closure, security pass
D2/gate 8: deterministic text fixture (600 docs + 60 held-out queries,
seeded PRNG, generator committed with byte-reproducibility test) embedded
with MiniLM and measured against exact brute-force cosine: recall@10 =
1.0 on the default VectorDB search path across the full efSearch sweep;
gate asserts >= 0.9. Rust-side RaBitQ/ef floor re-tuning is out of npm
reach and documented as the follow-up, not faked.
D3: int8 is a verified honest gap — the bundled WASM runtime rejects
both available quantized MiniLM exports (graph-analyzer failures on
Unsqueeze nodes), so parallel-fp32 bulk is the default per the ADR
contingency. The actual bulk-embed path in this package is hooks reembed
(insert/import only ever carry pre-computed vectors); it now batches
>= 32 memories through the bundled pool, which gained bounded-chunk
work-stealing dispatch (the old one-giant-shard-per-worker design blew
the 30s request timeout on bulk loads). Measured: 8.9 vs 3.9 texts/s
(~2.3x, 4 workers); 48-memory store reembeds in 8.7s with provenance
stamped.
D0 bypass closure: bin/mcp-server.js now enforces the shared provenance
module on hooks_remember, hooks_recall (once-per-process degraded-recall
warning), and a second bypass found in hooks_import (vector-bearing
merges gated); stats reports embedderKind.
Security pass, all test-locked: prototype-pollution in three registry
lookups (own-property checks); sanitizeProvenance/sanitizeDimension on
every untrusted disk read (malformed sidecars and intelligence.json no
longer crash or mis-refuse; dimension capped); corrupted-store shape
checks in both binaries; reembed tolerates null/missing-content entries
with --drop-missing; env-flag junk values fall back safely; prefix
application is pure concatenation (no injection surface).
Suites: npm test green, gates 1-8 + 10 wave-2 tests pass with the model
loaded, drift harness passes with zero fingerprint shift, build clean.
Co-Authored-By: claude-flow <ruv@ruv.net>
* fix(ruvector-npm): register signal handlers before transport connect
The sigterm-cleanup suite was flaky on CI — SIGTERM and SIGINT failed
alternately (main fails SIGTERM, PR runs fail SIGINT) because handlers
were registered at the end of main(), after the async transport connect:
a signal landing during startup hit the default handler and exited
non-zero. Handlers now register first; stdin-end stays post-connect.
Co-Authored-By: claude-flow <ruv@ruv.net>
* fix(ruvector-npm): un-stale the smart-loader assertion (broken on main)
test/standalone-test.js grepped dist/index.js for @ruvector/wasm, but the
loader fallback chain moved to @ruvector/rvf in the #523-era rework — the
assertion has failed on every CI run of the Unit & CLI tests job since
(one of the four perpetually-red jobs in the ruvector npm workflow).
Assertion now matches the real chain: @ruvector/core native ->
@ruvector/rvf.
Co-Authored-By: claude-flow <ruv@ruv.net>
---------
Co-authored-by: ruv <ruvnet@users.noreply.github.com>
* chore(rvf): sync Cargo.lock with rvf-wire deps (sha3, subtle)
https://claude.ai/code/session_01C83hbozEXPgoz9iJN5Smhp
* fix(rvf-runtime): deterministic tie-breaking in query result ordering
Equal-distance vectors were selected and ordered by HashMap iteration
order, which changes across process restarts and made query results
non-reproducible (flaky smoke_rvlite_adapter_persistence). Break ties
by vector id in both the top-k heap eviction and the final sort, in
query() and query_with_envelope().
https://claude.ai/code/session_01C83hbozEXPgoz9iJN5Smhp
* perf(rvf): optimize index/runtime hot paths, fix quant codec and manifest discovery
rvf-index:
- Cache SIMD distance-kernel dispatch in a OnceLock function-pointer
table instead of re-running is_x86_feature_detected! on every call
- Rewrite HNSW search_layer with BinaryHeap min/max-heaps (was sorted
Vec + O(n) mid-inserts) and a dense Vec<bool> visited bitmap (was a
per-call SipHash HashSet); deterministic (distance, id) tie-breaking
rvf-runtime:
- Replace per-bit CRC32 loops with crc32fast (same IEEE polynomial,
byte-identical hashes, ~100x faster) on segment write and verify
- Hoist cosine query-norm computation out of the per-vector scan loop
- Safety-net scan: single pass with HashSet membership (was
O(k*N*neighbors) with Vec::contains)
- Bulk little-endian f32 serialization in write_vec_seg (one memcpy
per vector instead of per-element appends)
- Progressively widen the manifest tail scan (64KB -> 1MB -> 16MB ->
whole file): stores with large segment directories were becoming
unreadable once the latest manifest fell outside the fixed 64KB
window; with regression test
rvf-quant:
- encode_quant_seg now emits fully decodable payloads (delegates to
the real scalar/product encoders; placeholders removed)
- decode_quant_seg returns Result instead of panicking on malformed
or unknown-type payloads; round-trip and malformed-input tests
https://claude.ai/code/session_01C83hbozEXPgoz9iJN5Smhp
* fix(rvm): bind witness chain to record content; optimize coherence, cap, sched hot paths
rvm-witness (security-critical):
- The chain hash covered only (prev_hash, sequence) — record content
(action, actor, target, payload, timestamp) was never hashed, so
verify_chain accepted arbitrarily rewritten history. record_hash is
now computed over the 44 content bytes (as its doc always claimed)
and the chain binds it: H(prev || seq || record_hash). verify_chain
recomputes content hashes; tamper-regression tests added.
- HMAC signer keys the Mac template once at construction instead of
re-running the key schedule per record (fixed-vector test pins
signature bytes)
- Witness ring overflow is now observable: total_overwritten counter
and needs_drain() accessor
rvm-cap:
- Nonce replay window: colliding nonces (A + k*4096) could evict and
re-admit nonce A. Replaced the two 32KB arrays with one 32KB
open-addressed table (8-probe bounded); eviction raises the
watermark so it fails closed. Regression test included.
rvm-coherence:
- internal_weight: O(MAX_EDGES) self-loop scan replaced with O(1)
adj_matrix[i][i] read (invariant verified across all mutation paths)
- Skip ticks return a cached CoherenceDecision instead of re-running
the O(n^2) merge-pair pass over stale data; zero-weight pairs skipped
- Mincut: scratch buffers moved into the long-lived bridge (~17KB less
stack per call), in-place Stoer-Wagner (no working copy), bitmask
membership, column-scan in-neighbors
- Compile-time guard: CoherenceGraph MAX_NODES > ADJ_DIM now fails to
compile instead of panicking at the 33rd node; u64 weight deltas
clamped at the engine boundary
rvm-coherence/rvm-partition:
- Single-slot hash indexes (id_to_node, edge_index) degraded to
permanent O(N) scans after any collision; both now use bounded
linear probing with tombstones and probe-proven absence
rvm-sched:
- enqueue() rejects the HYPERVISOR sentinel id, which previously
wedged a run-queue slot permanently; defensive cleanup in
switch_next
Tests: 733 workspace + 67 rvm-kernel lib pass (baseline 712); 23 new
tests including tamper-evidence and collision regressions.
https://claude.ai/code/session_01C83hbozEXPgoz9iJN5Smhp
* feat(rvf): wire HNSW index into the runtime query path (~14x speedup)
RvfStore::query was a brute-force O(N*dim) scan; the rvf-index crate was
unused by production queries and QualityEnvelope.evidence fabricated
layer_a=true. The index is now built lazily on first eligible query,
maintained incrementally on ingest, persisted on close() via the existing
INDEX_SEG codec (with a versioned, backward-readable trailer for the
sparse-id mapping), and validated-or-rebuilt on open. Exact scan remains
for small stores (<1024), filtered/COW/membership queries, >25% deleted,
and force_exact; deterministic (distance, id) tie-breaking preserved on
both paths. evidence.layer_a is now set only when the index served the
query.
Measured: 21.7ms -> 1.51ms per query at 100k x 64-dim (criterion,
release), recall@10 = 0.968 at the ef_search=256 floor (>=0.95 gated by
test). +15 tests (recall, index persistence round-trip, evidence honesty,
fallback routing, compaction/overwrite invalidation).
Co-Authored-By: claude-flow <ruv@ruv.net>
* feat(rvm): witness v2 — keyed-BLAKE3 chain with 128-bit links + Merkle sealing
v1 records folded chain links to 32 bits and left the head unanchorable.
The 96-byte v2 record embeds the predecessor MAC full-width and chains via
one keyed-BLAKE3 compression per append (~112ns measured, 9x under the 1us
target); keyed MACs detect last-record tampering and unkeyed forgery,
which v1 could not. Segment sealing accumulates record MACs into a
domain-separated Merkle tree (256/segment) sealed with one signature via
the existing signer infra (HMAC/dual-HMAC/Ed25519/TEE), with inclusion
proofs — expensive crypto moves off the per-record path and roots are
externally anchorable.
v1 logs still verify (version-byte dispatch; v1 only as prefix, head
anchored into the first v2 record); v1 writing is frozen. blake3 added as
pure-Rust no_std. +46 tests covering content/reorder/truncation/wrong-key
/forgery tamper modes, v1 compat, proofs, seals, and mixed logs.
Co-Authored-By: claude-flow <ruv@ruv.net>
* feat(rvm): wire mincut into split decisions; honest partition-switch claim
execute_split previously created an empty child and ignored the computed
cut. It now resolves the boundary from a cached epoch SplitPlan (or
computes on demand) and re-homes move-side neighbors to the child with
their edge weights. Two-tier decisions: exact Stoer-Wagner mincut runs as
a pressure-triggered epoch task; a new Fennel placer (O(degree),
fixed-point gamma=1.5, no_std) handles hot-path placement. Split policy
combines pressure and cut quality: mid-band (8000-9500bp) splits only on
a cut with conductance <= 5000bp; critical pressure stays an
unconditional safety valve.
The sub-10us partition-switch claim was a stub certified by a no-op bench
(~6ns) reported as 1600x faster than target. The real path needs EL2
assembly the crate forbids; instead the measurable register save/restore
lower bound is implemented and benchmarked, the bench is renamed
partition_switch_validation_stub with an honesty gate, a canary test
fails if HARDWARE_SWITCH_IMPLEMENTED flips without revisiting the claim,
and the README row now reads: not validated. +30 tests.
Co-Authored-By: claude-flow <ruv@ruv.net>
* feat(rvf): RaBitQ binary quantization + Vamana alpha-pruning (opt-in)
rvf-quant gains a RaBitQ-style codec: global-centroid centering, 3-round
seeded randomized-Hadamard rotation (orthonormal, reproducible from a
stored u64 seed), 1-bit sign codes with per-vector norm/dot-correction
scalars, and an asymmetric full-precision-query estimator. QUANT_SEG adds
versioned type tag 4 (legacy payloads byte-frozen and still decode;
unknown versions rejected; decode stays panic-free on untrusted bytes).
Query path: opt-in two-stage search (QueryOptions::rabitq, default off) —
estimator scan with oversampling (640-candidate floor) then exact f32
rescore; deterministic (distance, id) tie-breaking; falls back to default
routing for filtered/COW/IP/cosine queries. Measured recall@10 = 0.972 vs
exact on 10k x 128 (gate >= 0.95, test-enforced); code-only compression
exactly 32x.
rvf-index: Vamana-style robust prune (alpha = 1.2, occluded backfill) at
insert and prune time; recall@10 at ef=30 improved 0.986 -> 0.996;
construction determinism preserved. +42 tests (1254 passing, no new
failures).
Co-Authored-By: claude-flow <ruv@ruv.net>
* fix(rvf): harden untrusted decode paths against crafted-file DoS
An adversarial audit confirmed a crafted .rvf could panic or OOM the
process on RvfStore::open(): unvalidated length fields drove
Vec::with_capacity before any byte-availability check. decode_payload now
bounds id_count by available delta bytes (u64 compare before the usize
cast, so 32-bit truncation cannot bypass it); decode_index_seg bounds
restart_count/layer_count/neighbor_count by remaining bytes and rejects
truncated restart padding (was a reachable slice panic); decode_sketch_seg
converts from assert-and-panic to Result with width/depth validated via
checked_mul (closes the width=0 + depth=u32::MAX bypass); decode_product
size products use checked u64 arithmetic so 32-bit (wasm32) targets cannot
wrap usize and read out of bounds. +8 adversarial regression tests.
Co-Authored-By: claude-flow <ruv@ruv.net>
* perf(rvf): contiguous vector slab, non-blocking index rebuild, unified hashing
Vector storage moves from HashMap<u64, Vec<f32>> to a contiguous row-major
slab (id->ordinal map, tombstoned deletes, slot reuse only via compaction);
HNSW/RaBitQ paths read rows as zero-copy slices and iteration is ordinal-
ordered (deterministic across restarts). Brute-force query at 100k x 64:
24.5ms -> 3.8ms (~6.4x). boot() pre-sizes the slab and bulk-copies VEC_SEG
payloads (no per-vector allocs): cold open 257ms -> 202ms (-21.5%). mmap
deferred (CRC verify touches all bytes anyway; memmap2 not in this
workspace) and documented as follow-up.
Audit finding 5: index/RaBitQ lazy builds now run with no lock held behind
an AtomicBool gate (panic-safe clear-on-drop); concurrent queries fall
back to exact scan and keep serving through the entire O(N log N) build.
Overwrite still invalidates and unlinks the stale INDEX_SEG.
Hashing: the two identical bespoke CRC32-rotation implementations in
write_path/read_path now delegate to one source of truth
(hashing::legacy_content_hash); on-disk bytes unchanged. Full rvf-wire
checksum-registry conformance (XXH3-128 + format-version bump +
dual-accept reader) documented as the remaining delta. read_path.rs also
carries the audit''s checked vec-seg size arithmetic. +11 tests; suite
1271 passing, no new failures (one pre-existing wall-clock bench
assertion flakes under load, passes in isolation).
Co-Authored-By: claude-flow <ruv@ruv.net>
* chore(release): prepare rvf 0.2.1/0.2.0/0.3.0 crate bumps, npm 0.2.2/0.1.7, measured-benchmark READMEs
- rvf-types 0.2.0 -> 0.2.1 (QuantType::RaBitQ format extension)
- rvf-index 0.1.0 -> 0.2.0 (Vamana alpha-pruning, hardened INDEX_SEG codec)
- rvf-quant 0.1.0 -> 0.2.0 (RaBitQ codec; decode_sketch_seg now returns Result)
- rvf-runtime 0.2.0 -> 0.3.0 (HNSW query path, INDEX_SEG trailer, QueryOptions::rabitq, vector slab)
- dependent path-dep version reqs updated (cli, import, launch, node, server)
- @ruvector/rvf 0.2.0 -> 0.2.2, @ruvector/rvf-wasm 0.1.6 -> 0.1.7 (rebuilt wasm artifact, 1.89 toolchain + wasm-opt -Oz)
- READMEs: HNSW/RaBitQ/slab docs with measured numbers (Windows x64, criterion release, 100k x 64-dim); rvm witness v2 bench rows
Co-Authored-By: claude-flow <ruv@ruv.net>
* fix(robotics): bump rvf-runtime requirement to 0.3 after release bump
The rvf-runtime 0.2 -> 0.3.0 version bump updated dependents inside the
rvf workspace but missed the root-workspace consumer: ruvector-robotics
pins version 0.2 alongside its path dep, which fails cargo resolution
against the bumped crate (PR #555 CI: failed to select a version for the
requirement rvf-runtime ^0.2). Root Cargo.lock refreshed.
Co-Authored-By: claude-flow <ruv@ruv.net>
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: ruv <ruvnet@users.noreply.github.com>
The #508 bug (stats/search/insert calling phantom VectorDB APIs) shipped
for multiple releases because the CLI test suite only exercised help text
and flag parsing — no test ever opened a database. New test/db-workflow.js
runs the real user workflow against the real implementation in a temp dir:
demo -> stats (asserts count AND dimension) -> search (asserts the correct
nearest neighbor) -> insert into existing and NEW databases (asserts
sidecar dimension derivation) -> export must fail honestly without writing
a fake backup -> missing-db errors must be clean, with an explicit assert
that no is-not-a-function phantom-API error ever resurfaces. Wired into
npm test, so the existing Unit & CLI tests CI job runs it on every change;
skips gracefully where no vector implementation is available.
Co-Authored-By: claude-flow <ruv@ruv.net>
stats/search/insert called db.load(), db.save(), and db.stats() — none of
which exist on VectorDB (real API: insert/insertBatch/search/get/delete/
len/isEmpty; persistence is via the storagePath constructor option). All
three commands now use the real async API. Two deeper gaps fixed so the
issue reproduction actually works end to end: demo --basic now creates an
explicit ./demo.db with a .meta.json sidecar (it previously wrote an
accidental default-path file with no dimension metadata, so stats/search
opened it at the wrong dimension and saw 0 vectors), and insert writes
the sidecar when creating a new database.
export/import were hollow stubs (export wrote vectors: [], import
restored nothing): VectorDB has no enumeration API, so export now fails
honestly with guidance (the .db + sidecar are the portable artifact) and
import accepts the real JSON vector format that insert uses, refusing
legacy empty _export.json files instead of fabricating a database.
Validated from a clean registry install of 0.2.30: demo -> stats (count
4, dim 4) -> search (correct nearest) -> insert (count 5) all exit 0.
Co-Authored-By: claude-flow <ruv@ruv.net>
Also syncs the MCP server declared version, which had drifted to a stale
0.2.0. Published and validated from a clean registry install: ONNX
contract APIs honest (#523), force-learn exit 0 with the real engine
(#529), and hooks route returns learned-from-past-success with rising
confidence after a trajectory loop (#517). sonaEnabled:true confirms the
repaired @ruvector/sona 0.1.7 loads (#516).
Co-Authored-By: claude-flow <ruv@ruv.net>
The TypeScript SONA coordinator (the implementation actually published to
npm) had the same no-op stub fixed in the Rust crate for #519:
processInstantLearning did nothing, so learn-from-feedback never changed a
weight and consumers saw deltaNorm 0.000000 forever.
A rank-2 micro-LoRA adapter (dim 64, matching the hash embedder) now
receives a REINFORCE-style update on every signal: reward = quality - 0.5,
gradient pushes the adapter toward the signal embedding for positive
reward and away for negative. The quality >= 0.8 gate is removed so
negative feedback unlearns instead of being dropped. New public API:
applyMicroLora(input), microLoraDeltaNorm(), and stats().microLora
{updates, deltaNorm} so downstream (ruflo statusline) can surface a real
adaptation signal. 6 regression tests; the 4 pre-existing native-binding
test failures are unchanged (verified on pristine tree).
Co-Authored-By: claude-flow <ruv@ruv.net>
The publish guard caught a second failure mode: CI installs @napi-rs/cli
v3 (unpinned), which does not emit the v2-style index.js loader at all
(the js-bindings artifact contained one 0-byte index.d.ts). Commit the
locally generated index.js/index.d.ts instead and drop CI-side codegen.
The committed .d.ts is verified current: crates/sona compiles
napi_simple.rs (lib.rs:67); src/napi.rs with saveState/loadState is dead
code, so the binding surface is unchanged since 0.1.5.
Publish job: rename bundled sona.*.node to the index.*.node names the
loader checks (after platform packages are created from the sona.* names),
and hard-fail on missing platform binaries instead of silently skipping.
Co-Authored-By: claude-flow <ruv@ruv.net>
* fix(sona): wire WASM learn-to-inference loop; single-step gradient fallback (#519)
start_trajectory/record_step/end_trajectory now drive real TrajectoryBuilders
through SonaEngine instead of console.log stubs; learn_from_feedback
synthesizes a one-step trajectory and flushes so a single feedback call
updates MicroLoRA weights. LearningSignal::estimate_gradient falls back to
baseline-free REINFORCE only when the baselined gradient is exactly zero
(single-step / constant-reward trajectories), leaving multi-step
varying-reward behavior unchanged. 3 regression tests added.
Co-Authored-By: claude-flow <ruv@ruv.net>
* fix(ruvector): force-learn crash and learned-route namespace mismatch (#529, #517)
force-learn: stop calling intel.tick() on the engine-less Intelligence
wrapper (TypeError); use the native engine forceLearn()/tick() like the MCP
handler does, degrade to success:false + exit 0 when the engine is
unavailable, never throw (#529).
route learning: Q-patterns were written as command/edit outcome episodes
under state keys route() never queries, so routing always returned default
mapping. Add recordRouteOutcome() writing agent outcomes under the exact
getState() key route() reads; trajectory-end now closes the loop (and
trajectory-begin gains --file); Intelligence.load() preserves
activeTrajectories so cross-process trajectories survive; sync route() uses
the canonical state key and includes learned agents in candidates (#517).
New test suite tests/hooks-route-learning.test.mjs.
Co-Authored-By: claude-flow <ruv@ruv.net>
* fix(sona-npm): guard publish against missing build output; bump to 0.1.7 (#516)
0.1.6 shipped with only README + package.json because index.js/index.d.ts
are napi build artifacts absent at publish time and npm silently skips
missing `files` entries. Add a prepublishOnly check that hard-fails without
build output; bump platform optionalDependencies 0.1.4 -> 0.1.5 (latest
published for all 7 targets). CI had the same latent gap: sona-napi.yml only
staged .node artifacts for publish — now uploads index.js/index.d.ts as a
js-bindings artifact and verifies presence before npm publish.
Co-Authored-By: claude-flow <ruv@ruv.net>
* style(sona): rustfmt the #519 regression tests
Co-Authored-By: claude-flow <ruv@ruv.net>
---------
Co-authored-by: ruv <ruvnet@users.noreply.github.com>
* fix(ruvector): remove dead external parallel-worker import (#531)
The ONNX embedder dynamically imported `ruvector-onnx-embeddings-wasm/parallel`
in two places — a package that was never published, never declared in
package.json, and explicitly rejected in ADR-194. Both import sites resolved
into catch blocks, so the external multi-core path was dead code while
`detectParallelAvailable()` reported availability based on the missing package.
- onnx-embedder.ts: drop both `import('ruvector-onnx-embeddings-wasm/parallel')`
sites; `tryInitParallel()` now goes straight to the bundled, zero-dependency
worker pool (`onnx/bundled-parallel.mjs`) — the only parallel implementation.
- `detectParallelAvailable()` now probes the bundled pool file instead of the
unpublished external package, so the capability signal is correct.
- Runtime behavior is preserved: the old external attempt always threw, and
'auto'/false already fell through to return false.
- CI: add a guard step to ruvector-npm-ci that fails the build if any source
re-introduces an import/require/from of the dead package (doc comments OK).
- Bump 0.2.27 → 0.2.28.
Validated: tsc clean, `node --test tests/*.test.mjs` 8/8 pass (incl. worker-pool
cosine-equivalence), guard verified to fire on a reintroduced import.
Closes#531
Co-Authored-By: claude-flow <ruv@ruv.net>
* fix(ci): ruvector smoke uses --dimension (CLI flag is singular, not --dimensions)
The functional-smoke job called `create --dimensions 64` but the CLI option
is `-d, --dimension`. Pre-existing failure on main, surfaced while shipping #531.
Co-Authored-By: claude-flow <ruv@ruv.net>
---------
Co-authored-by: ruvnet <ruvnet@gmail.com>
Resolves the four API-contract defects in the bundled ONNX embedder plus a
latent packaging bug, adds a zero-dependency worker pool for batch throughput,
and proves quantization is backend-blocked.
#523 fixes:
- isOnnxAvailable() documented as capability-only; add isOnnxInitialized()
post-init gate (distinct from WASM-core isInitialized to avoid barrel clash)
- AdaptiveEmbedder.isReady() returns a real boolean (was undefined)
- remove misleading 'Using FP16 quantized model' log + dead modelUrl in
onnx-optimized.ts (loader never applied it)
- ModelLoader: in-memory memo + on-disk cache (~/.ruvector/models) so the
model is not re-downloaded per process (Node has no Cache API)
Packaging: build now copies the whole src/core/onnx/ dir into dist/ (loader.js
was being dropped, shipping a broken embedder); add {"type":"module"} marker
to silence MODULE_TYPELESS_PACKAGE_JSON; remove 90 stale tracked compile
artifacts under src/core/.
Throughput: self-contained worker_threads pool (bundled-parallel.mjs +
embed-worker.mjs) over the bundled WASM, SharedArrayBuffer model bytes, batch
sharding — 12-14x at min cosine = 1.000000 (bit-identical, zero quality drift).
Memory-bandwidth bound at ~73 eps; quantization (the only further lever) fails
on tract-onnx 0.21 (FP16/INT8 'AddDims' optimize error) — documented blocked.
Tests: 6 contract + 2 pool regression tests (tests/), full suite 69+2 green.
CI: merge guards into ruvector-npm-ci.yml (run tests/, tarball onnx/stale-artifact
assertions); add ruvector-publish.yml with version-clobber guard.
Docs: ADR-194 (decisions), ADR-195 (unification plan).
Co-authored-by: ruvnet <ruvnet@gmail.com>