Commit graph

2931 commits

Author SHA1 Message Date
rUv
ff4862b07d
fix: harden graph and postgres data integrity (#738)
Fix graph replication serialization, PostgreSQL HNSW concurrent-build safety and ef_search propagation, and SONA dimension/statistics correctness. Harden benchmark and CI execution, including cancellation of superseded runs.

Closes #727.
Closes #728.
Closes #729.
Closes #732.
2026-07-28 00:05:01 -04:00
OceanLi
11e237ca22
docs(ruvector-core): document the LatticeEmbedding provider (#733)
Document the native pure-Rust embedding provider, feature flag, MSRV, and asymmetric query behavior.
2026-07-27 23:57:49 -04:00
github-actions[bot]
bfd20f8ec1 chore: Update NAPI-RS binaries for all platforms
Built from commit 84539d0b73

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2026-07-28 02:54:57 +00:00
dependabot[bot]
84539d0b73
chore(deps): bump @hono/node-server and @modelcontextprotocol/sdk (#737)
Bumps [@hono/node-server](https://github.com/honojs/node-server) to 2.0.12 and updates ancestor dependency [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/typescript-sdk). These dependencies need to be updated together.


Updates `@hono/node-server` from 1.19.17 to 2.0.12
- [Release notes](https://github.com/honojs/node-server/releases)
- [Commits](https://github.com/honojs/node-server/compare/v1.19.17...v2.0.12)

Updates `@modelcontextprotocol/sdk` from 1.29.0 to 1.30.0
- [Release notes](https://github.com/modelcontextprotocol/typescript-sdk/releases)
- [Commits](https://github.com/modelcontextprotocol/typescript-sdk/compare/v1.29.0...1.30.0)

---
updated-dependencies:
- dependency-name: "@hono/node-server"
  dependency-version: 2.0.12
  dependency-type: indirect
- dependency-name: "@modelcontextprotocol/sdk"
  dependency-version: 1.30.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-27 19:44:59 -07:00
github-actions[bot]
2cf130f33b chore: Update NAPI-RS binaries for all platforms
Some checks are pending
regression-guard / no-npx-execSync-in-route-enhanced (push) Waiting to run
regression-guard / hnsw-recall-at-1 (push) Waiting to run
regression-guard / hnsw-insert-beam-no-m2-clamp (push) Waiting to run
regression-guard / hnsw-distance-based-neighbor-pruning (push) Waiting to run
regression-guard / vector-db-rebuilds-index-on-open (push) Waiting to run
regression-guard / npm-publish-pipeline (npm/packages/pi-brain) (push) Waiting to run
regression-guard / npm-publish-pipeline (npm/packages/ruvector) (push) Waiting to run
regression-guard / npm-publish-pipeline (npm/packages/rvf-wasm) (push) Waiting to run
regression-guard / shell-injection-in-mcp-server (push) Waiting to run
regression-guard / no-systemtime-in-wasm-crates (push) Waiting to run
regression-guard / no-hardcoded-workspaces-paths (push) Waiting to run
regression-guard / brain-hydration-counters-present (push) Waiting to run
regression-guard / optional-deps-resolvable-on-npm (push) Waiting to run
regression-guard / graph-condense-perception-tests (push) Waiting to run
regression-guard / mincut-pin-tracks-workspace-version (push) Waiting to run
ruvector npm — functional, learning, optimized, effective / Build (push) Waiting to run
ruvector npm — functional, learning, optimized, effective / Unit & CLI tests (push) Blocked by required conditions
ruvector npm — functional, learning, optimized, effective / Functional smoke (npx ruvector) (push) Blocked by required conditions
ruvector npm — functional, learning, optimized, effective / Learning check (HNSW activates) (push) Blocked by required conditions
ruvector npm — functional, learning, optimized, effective / Performance benchmark (≥2× speedup at N=5000) (push) Blocked by required conditions
ruvector npm — functional, learning, optimized, effective / Recall quality (recall@10 ≥ 0.88 at N=10k) (push) Blocked by required conditions
ruvector npm — functional, learning, optimized, effective / Tarball integrity (push) Blocked by required conditions
ruvector npm — functional, learning, optimized, effective / CI pass (push) Blocked by required conditions
supply-chain / dependency-review (PRs only) (push) Waiting to run
supply-chain / cargo audit (RustSec advisories) (push) Waiting to run
supply-chain / cargo deny (license + source + ban policy) (push) Waiting to run
supply-chain / npm audit (npm/ workspace) (push) Waiting to run
supply-chain / lockfile integrity (Cargo.lock) (push) Waiting to run
Validate Package Lock File / validate-lockfile (push) Waiting to run
WASM Dedup Check / check-wasm-dedup (push) Waiting to run
Built from commit cb6354c81f

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2026-07-28 00:28:44 +00:00
github-actions[bot]
ed9b6ff3b2 chore: Update NAPI-RS binaries for all platforms
Built from commit 9612e8e3ec

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2026-07-28 00:24:09 +00:00
rUv
cb6354c81f
fix(security): harden agentic integration subprocesses
Eliminate shell interpolation from all claude-flow hooks, remove unused vulnerable production dependencies, repair package exports/artifact generation, and prepare @ruvector/agentic-integration 1.0.2.
2026-07-27 17:15:23 -07:00
rUv
9612e8e3ec
fix(security): eliminate MCP shell command injection
Replace all shell-interpolated MCP subprocess calls with argument-vector execFileSync execution, add a regression guard, and prepare ruvector 0.2.39.
2026-07-27 17:10:00 -07:00
github-actions[bot]
918e096385 chore: Update NAPI-RS binaries for all platforms
Built from commit 2e5e65b3d3

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2026-07-27 23:37:53 +00:00
github-actions[bot]
6e18597de4 chore: Update NAPI-RS binaries for all platforms
Built from commit 8758ed4ab3

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2026-07-27 23:27:59 +00:00
github-actions[bot]
f7cb8e82d7 chore: Update NAPI-RS binaries for all platforms
Built from commit 512a03db6a

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2026-07-27 23:26:23 +00:00
github-actions[bot]
b2eef0f406 chore: Update NAPI-RS binaries for all platforms
Built from commit acd6805181

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2026-07-27 23:26:04 +00:00
github-actions[bot]
afc1c9e24a chore: Update NAPI-RS binaries for all platforms
Built from commit 180bd9f922

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2026-07-27 23:15:42 +00:00
github-actions[bot]
949147aab0 chore: Update NAPI-RS binaries for all platforms
Built from commit e0d3b6e2b1

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2026-07-27 23:12:30 +00:00
github-actions[bot]
e1c1e3f103 chore: Update NAPI-RS binaries for all platforms
Built from commit 3d897a66bb

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2026-07-27 22:47:19 +00:00
github-actions[bot]
77d360957a chore: Update NAPI-RS binaries for all platforms
Built from commit aa1e21f3a1

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2026-07-27 22:44:15 +00:00
github-actions[bot]
745be4c647 chore: Update NAPI-RS binaries for all platforms
Built from commit a4f9991d9d

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2026-07-27 22:42:42 +00:00
github-actions[bot]
7b826d1fc9 chore: Update NAPI-RS binaries for all platforms
Built from commit 9a31a37ca2

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2026-07-27 22:38:25 +00:00
github-actions[bot]
823f11ba9d chore: Update NAPI-RS binaries for all platforms
Built from commit e24813cd7b

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2026-07-27 21:35:36 +00:00
github-actions[bot]
e9a1277233 chore: Update NAPI-RS binaries for all platforms
Built from commit f0e53cf9e7

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2026-07-27 20:43:14 +00:00
github-actions[bot]
9b74a74399 chore: Update NAPI-RS binaries for all platforms
Built from commit e1784a2934

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2026-07-27 19:39:19 +00:00
rUv
2e5e65b3d3
Merge pull request #521 from shaal/claude/ruvector-turbovec-optimization-FhaDh
Some checks failed
regression-guard / npm-publish-pipeline (npm/packages/rvf-wasm) (push) Waiting to run
regression-guard / no-npx-execSync-in-route-enhanced (push) Waiting to run
regression-guard / shell-injection-in-mcp-server (push) Waiting to run
regression-guard / no-systemtime-in-wasm-crates (push) Waiting to run
regression-guard / no-hardcoded-workspaces-paths (push) Waiting to run
regression-guard / brain-hydration-counters-present (push) Waiting to run
regression-guard / optional-deps-resolvable-on-npm (push) Waiting to run
ruvector npm — functional, learning, optimized, effective / Unit & CLI tests (push) Blocked by required conditions
ruvector npm — functional, learning, optimized, effective / Functional smoke (npx ruvector) (push) Blocked by required conditions
regression-guard / graph-condense-perception-tests (push) Waiting to run
regression-guard / mincut-pin-tracks-workspace-version (push) Waiting to run
ruvector npm — functional, learning, optimized, effective / Build (push) Waiting to run
ruvector npm — functional, learning, optimized, effective / Learning check (HNSW activates) (push) Blocked by required conditions
ruvector npm — functional, learning, optimized, effective / Performance benchmark (≥2× speedup at N=5000) (push) Blocked by required conditions
ruvector npm — functional, learning, optimized, effective / Recall quality (recall@10 ≥ 0.88 at N=10k) (push) Blocked by required conditions
ruvector npm — functional, learning, optimized, effective / Tarball integrity (push) Blocked by required conditions
ruvector npm — functional, learning, optimized, effective / CI pass (push) Blocked by required conditions
supply-chain / dependency-review (PRs only) (push) Waiting to run
supply-chain / cargo audit (RustSec advisories) (push) Waiting to run
supply-chain / cargo deny (license + source + ban policy) (push) Waiting to run
supply-chain / npm audit (npm/ workspace) (push) Waiting to run
supply-chain / lockfile integrity (Cargo.lock) (push) Waiting to run
Validate Package Lock File / validate-lockfile (push) Waiting to run
WASM Dedup Check / check-wasm-dedup (push) Waiting to run
Build DiskANN Native Modules / Build DiskANN darwin-arm64 (push) Has been cancelled
Build DiskANN Native Modules / Build DiskANN darwin-x64 (push) Has been cancelled
Build DiskANN Native Modules / Build DiskANN linux-arm64-gnu (push) Has been cancelled
Build DiskANN Native Modules / Build DiskANN linux-x64-gnu (push) Has been cancelled
Build DiskANN Native Modules / Build DiskANN win32-x64-msvc (push) Has been cancelled
Build DiskANN Native Modules / Publish DiskANN Platform Packages (push) Has been cancelled
feat(turbovec): multi-bit TurboQuant FastScan ANN index (ADR-194 M1)
2026-07-27 11:06:48 -07:00
ruvnet
d5e2fc2d87 fix(turbovec): preserve padded geometry and harden inputs 2026-07-27 14:06:25 -04:00
Ofer Shaal
39137f7033 docs(adr): renumber turbovec ADR-194 → ADR-254 to resolve collision
ADR-194 is already taken on main (ruvector ONNX embedder API & throughput).
Renumber this PR's turbovec ADR to the next free number (254), matching the
canonical record on main. Keeps the fuller PR version (D1–D5 divergences table,
D3/D4 measured-milestone markers) and adds a numbering note. Updates the 13
in-crate ADR-194 references and two stray ADR-193 'future work' pointers so they
no longer resolve to the unrelated ONNX ADR.

Refs #520, #521
2026-07-27 14:01:42 -04:00
Ofer Shaal
8c7e35374b test(turbovec): distortion-bound oracle (ADR-194 D4)
Add quantizer_mse_within_paper_bound: draw 400k N(0,1) samples (Box–Muller,
no new deps), quantize via the real quantize_coord path, and assert the
per-coordinate MSE for every width stays under TurboQuant's distortion bound
D_mse ≤ (√3·π/2)·4^(−b) (arXiv:2504.19874) AND within 5% of the Max-1960
Lloyd–Max optimum. A corrupted centroid level trips this far more precisely
than the existing recall>0.5 threshold.

Marks D4 done in ADR-194; updates test count to 17. The full-pipeline
inner-product bound D_prod remains future work (tracked with D5).
2026-07-27 14:01:31 -04:00
Ofer Shaal
159d75466e style(turbovec): cargo fmt — wrap pre-existing >100col lines
Pure rustfmt normalization (rustfmt 1.8.0-stable) of lines that predated
this branch; no semantic change. Isolated from the feature commits so the
crate passes 'cargo fmt --check' cleanly for upstream CI.
2026-07-27 14:01:31 -04:00
Ofer Shaal
4afabb99d6 feat(turbovec): add 3-bit width (ADR-194 D3) — fills the 2↔4-bit recall cliff
Adds BitWidth::Three (8-level Max-1960 optimal N(0,1) reconstruction
levels). pack/unpack, calibration, scoring, and IdMap are width-generic,
so only the centroid table + the enum arms change.

Measured (cargo run --release -p ruvector-turbovec, n=5000 uniform-random,
dim=256, k=10, no rerank, vs exact L2):
  3-bit: recall@10 0.767, 112 B/vec, 9.8x compression, bias -0.0000
landing squarely between 2-bit (0.561) and 4-bit (0.879) — a useful
memory/recall midpoint (~22% smaller than 4-bit for ~0.11 recall).

Also refresh ADR-194: add the 3-bit Validation row, mark D3 done, widen
T2 to {2,3,4}, correct the test count to 16, and scope the provenance
note so the measured recall/compression/bias figures are called measured
while the FAISS-competitive claims stay attributed targets.

16 unit + 1 doc-test pass; clippy clean; new code is rustfmt-clean.
2026-07-27 14:01:31 -04:00
Ofer Shaal
e302958acb docs(adr-194): document divergences from the TurboQuant paper
Add an explicit 'Divergences from the TurboQuant paper (arXiv:2504.19874)'
section mapping where M1 departs from the paper, so the gaps are reviewable
and the follow-ups are paper-grounded:

- D1: M1 uses a heuristic per-vector c_x scale, not the paper's provably-
  unbiased two-stage MSE + 1-bit-QJL-residual estimator. Soften the T4 and
  Validation wording accordingly (empirically near-unbiased, not proven).
- D2: M1 quantizes against the N(0,1) limit + empirical TQ+ calibration, not
  the paper's exact d-aware Beta-optimal codebooks.
- D3: M1 ships 1/2/4-bit; paper highlights ~2.5/3.5 bpc sweet spots — add 3-bit.
- D4: assert measured distortion under the paper's closed-form bounds as a
  stronger test oracle than recall > 0.5.
- D5: estimator variance deferred.

Add milestones M5 (paper-grade QJL-residual estimator) and M6 (Beta-optimal
codebooks); note what M1 already matches (norm-based L2, online ingest,
full-precision query). No code change.
2026-07-27 14:01:31 -04:00
Ofer Shaal
c23d7a311e chore(turbovec): drop unused deps; attribute external benchmark claims
- Cargo.toml: remove unused rand_distr dependency and the redundant
  rand dev-dependency (rand is a normal dep for the demo bin + tests).
- Cargo.lock: drop rand_distr from ruvector-turbovec.
- ADR-194: attribute the FAISS-competitive figures to the upstream
  RyanCodrai/turbovec project rather than presenting them as this
  crate's measured results; point readers to the reproducible
  uniform-random Validation table instead.

No code changes; 16 unit + 1 doc-test still pass, clippy clean.
2026-07-27 14:01:30 -04:00
Claude
f40fc539fa fix(turbovec): address CodeRabbit review — validate inputs, propagate errors
- index: TurboVecIndex::add/search now return RabitqError::DimensionMismatch
  in release builds instead of silently accepting/masking wrong-length
  vectors (was debug_assert + unwrap_or_default).
- index: finalize() excludes zero vectors from calibration fit so they
  don't bias shift/scale toward zero.
- idmap: add_with_id validates dim up front and reports the real length
  (was hardcoded got: 0); add_with_ids rejects vectors/ids length
  mismatch with new TurboVecError::BatchLenMismatch instead of zip-truncating.
- quantize: pack/unpack document preconditions and debug_assert code-range
  and slice-length (proportionate to internal helpers; no Result churn).
- calibrate: fit debug_asserts every row has length dim.
- ADR-194 frontmatter status proposed -> accepted to match body.

Adds 4 tests (wrong-dim reject on add/search, zero-vector calibration
exclusion via self-retrieval, batch-len mismatch, idmap wrong-dim).
16 unit tests + 1 doc-test pass; clippy clean; demo unchanged.

https://claude.ai/code/session_012AzArCzBwxrJp8mUngUcH5
2026-07-27 14:01:30 -04:00
Claude
47dc8a49c0 chore: update Cargo.lock for ruvector-turbovec
https://claude.ai/code/session_012AzArCzBwxrJp8mUngUcH5
2026-07-27 14:01:30 -04:00
Claude
65b9b0c926 feat(turbovec): implement ADR-194 M1 multi-bit TurboQuant ANN index
New crate crates/ruvector-turbovec implementing the scalar-reference
milestone of ADR-194 — the 2/4-bit FastScan-style ANN regime ruvector
lacked (rabitq is 1-bit; ruvllm's TurboQuant is a KV-cache codec, not a
search index).

Pipeline: normalize -> randomized Hadamard rotation (reused from
ruvector-rabitq) -> TQ+ per-coordinate calibration -> Lloyd-Max 2/4-bit
scalar quantization -> per-vector length-renormalized unbiased scoring.
Implements the shared ruvector_rabitq::AnnIndex trait. Adds IdMapIndex
with O(1) delete and allowlist-filtered search.

Proof (cargo run --release -p ruvector-turbovec), n=5000 uniform-random
vectors, dim=256, k=10, no f32 rerank, vs exact brute-force L2:
  1-bit: recall@10 0.308, 25.6x compression, bias +0.0005
  2-bit: recall@10 0.561, 14.2x compression, bias +0.0001
  4-bit: recall@10 0.879,  7.5x compression, bias -0.0000
Recall rises monotonically with bit-width; mean cosine bias ~0 confirms
the unbiased estimator. Determinism + IdMap delete/filter verified.

12 unit tests + 1 doc-test pass; build green; clippy clean.
M2-M4 (FastScan nibble-LUT SIMD kernel, AVX-512, dispatcher) are future
milestones; the scalar scorer here is their determinism oracle.

https://claude.ai/code/session_012AzArCzBwxrJp8mUngUcH5
2026-07-27 14:01:30 -04:00
Claude
7689f1a9cf docs(adr): ADR-194 ruvector-turbovec multi-bit TurboQuant FastScan ANN index
Research and scope a new crate adapting TurboQuant techniques from
RyanCodrai/turbovec: 2/4-bit Lloyd-Max scalar quantization, TQ+
per-coordinate calibration, length-renormalized unbiased scoring, and a
nibble-LUT FastScan SIMD kernel (AVX-512BW/AVX2/NEON). Reuses
ruvector-rabitq's Hadamard rotation + AnnIndex/VectorKernel traits and
borrows ruvllm's MSE quantizer math, closing the missing 2-4-bit FastScan
ANN regime.

https://claude.ai/code/session_012AzArCzBwxrJp8mUngUcH5
2026-07-27 14:01:30 -04:00
rUv
1dccff727f
Merge pull request #670 from Charitablebusinessronin/feat/update-node-and-keyword-search
feat(graph): add update_node and keyword_search methods
2026-07-27 10:58:58 -07:00
ruvnet
5d6c8253c3 fix(graph): make node updates atomic and index-safe 2026-07-27 13:58:40 -04:00
ronin704
5688256b3c feat(graph): add update_node and keyword_search methods
## update_node

Adds  to GraphDB — the counterpart to .
Enables in-place property updates on existing nodes without delete+recreate.

This unblocks SUPERSEDES-style versioning where a prior node is marked
 without deleting it:

Returns  if the node was not found (no error),  if
updated. Persists to storage if the  feature is enabled.

Closes #666

## keyword_search

Adds  to GraphDB — wires the
existing  (bm25.rs) into the graph API. Returns top-k node IDs by
BM25 score over a text property for nodes with the given label.

This is the keyword arm of hybrid search — pair with vector ANN for
reciprocal rank fusion. Builds a transient index on each call (suitable
for small-to-medium graphs or one-shot queries).

Closes #667

## Tests

4 new tests, all passing:
- test_update_node — marks a node deprecated, verifies properties changed
- test_update_node_not_found — returns Ok(false) for missing node
- test_keyword_search — ranks relevant docs first, pasta doc doesn't lead
- test_keyword_search_empty_label — empty label returns empty results

Full suite: 21/21 pass (0.11s)

## Context

Filed by Allura (github.com/Allura-Ecosystem/Allura_Memory) during the
RuVector graph cutover (AD-49). Allura uses the graph adapter for governed
memory with SUPERSEDES versioning and hybrid search.
2026-07-27 13:55:52 -04:00
rUv
8758ed4ab3
Merge pull request #686 from ohdearquant/feat/wasm-simd128
feat(wasm): SIMD128 kernels for l2_squared/inner_product distance (#675)
2026-07-27 10:54:09 -07:00
ruvnet
b64a90d1ed Harden WASM SIMD dispatch and bounds safety 2026-07-27 13:53:52 -04:00
ruvnet
38657d6c67 Merge remote-tracking branch 'origin/main' into codex/pr686-hardening 2026-07-27 13:50:31 -04:00
rUv
512a03db6a
Merge pull request #683 from ohdearquant/perf/diskann-reusable-visited-set
perf(diskann): reuse VisitedSet across searches, add search_with and allocation regression test
2026-07-27 10:49:29 -07:00
ruvnet
8eee28caa4 Merge main and harden reusable DiskANN search state 2026-07-27 13:49:05 -04:00
rUv
acd6805181
Merge pull request #684 from ohdearquant/fix/diskann-delete-tombstones
fix(diskann): tombstone deletes with vector preservation, local graph repair, and delete_deferred escape hatch
2026-07-27 10:45:07 -07:00
ruvnet
cef45f4758 Merge main and harden DiskANN tombstone deletion 2026-07-27 13:44:24 -04:00
OceanLi
180bd9f922
fix(rvf-sdk): ergonomic query count arg + clear create-on-existing error (#657, #658) (#696)
#657: RvfDatabase.query() accepted only a positional numeric count; passing an
options object ({k}/{topK}/{limit}) put the object in the count slot and leaked a
low-level "Failed to convert napi value Object into rust type u32" error. query()
now accepts both forms and validates the count, throwing a clear InvalidArgument
(new SDK code) for a missing/non-positive-integer count before crossing N-API.

#658: NodeBackend.create() on a path that already held a file surfaced the native
FsyncFailed durability error, sending debugging the wrong way. It now checks for an
existing file first and throws a clear FileExists (new SDK code) pointing at open()
or { overwrite: true }; overwrite removes the old file and its .idmap.json sidecar
before creating.

dist/ regenerated via tsc. scripts/smoke-query-create.mjs verifies both against the
built output (11 checks, no native addon required for #657).

Co-authored-by: Leo <noreply@khive.ai>
Co-authored-by: ruvnet <ruv@ruv.net>
2026-07-27 10:33:29 -07:00
OceanLi
e0d3b6e2b1
fix(rvf-sdk): atomic id-map sidecar write + fail-loud on corrupt load (#635) (#697)
The .idmap.json sidecar is load-bearing: delete() resolves string ids through it
and silently drops unresolvable ones, so a lost/torn/corrupt sidecar causes silent
data loss or corruption with no signal. Two swallows made that easy to hit:

saveMappings() wrote the sidecar non-atomically and swallowed all errors. It now
writes to a temp file and renames over the sidecar (so a crash/ENOSPC mid-write
cannot leave partial JSON), and surfaces a failure as SidecarWriteFailed instead of
discarding it — delete()/ingest correctness depends on the map, so it is not
best-effort.

loadMappings() degraded a corrupt sidecar to empty maps, which reset nextLabel to 1
and made subsequent ingests assign labels colliding with existing vectors (silent
corruption), then overwrote the recoverable file on the next save. It now quarantines
the corrupt sidecar (renames it aside) and throws SidecarCorrupt so the caller learns
string-id operations are unsafe, rather than silently corrupting data.

Two new SDK error codes (0xff06/0xff07); 0xff04/0xff05 left reserved. dist/ regenerated
via tsc. scripts/smoke-idmap-durability.mjs verifies atomic write, state restoration on
reopen, and fail-loud+quarantine on corrupt load (3 checks) against the built output.

Co-authored-by: Leo <noreply@khive.ai>
Co-authored-by: ruvnet <ruv@ruv.net>
2026-07-27 10:30:12 -07:00
rUv
3d897a66bb
fix(mcp): validate live server version and release 0.2.38 (#730) 2026-07-27 10:00:16 -07:00
rUv
aa1e21f3a1
test(mcp): make mcp test prove the server answers, not just that files exist (#726)
`ruvector mcp test` reported "All checks passed / 97 tools registered"
against a server that never started. Every check was static: the file
exists, `node -c` parses it, the SDK resolves, and the TOOLS array is
grepped out of the source text. None of them launched the server, so a
transport that was never connected looked identical to a healthy one.

Add a live handshake as the final check: spawn `mcp start` the way a
client does, send `initialize`, and require a JSON-RPC reply. Also fail
when stdout carries anything that is not JSON-RPC, since stdio MCP
requires stdout to be exclusively newline-delimited JSON-RPC.

Add test/mcp-handshake.js covering the same ground in the suite, wired
into `npm test`. It drives bin/cli.js rather than bin/mcp-server.js on
purpose: run as main, mcp-server.js always worked, so a direct probe
would have passed throughout the outage.

Both the CLI check and the test drain stdout for a grace period after the
last reply instead of settling immediately. The loader's chatter is
written *after* the initialize response, and an early return raced past
the very output the check exists to catch — verified by reintroducing the
bug and watching the assertion pass before the drain was added.

Verified by reverting each fix independently:
  - launch bug restored  -> mcp test exits 1, handshake test 1/4 passed
  - stdout bug restored  -> handshake test 3/4, names the offending line
  - both fixes present   -> mcp test exits 0, suite 87 passed / 0 failed

Co-authored-by: Mark Tenenholtz <markt@heximal.com>
2026-07-27 09:58:19 -07:00
rUv
a4f9991d9d
feat: add k-scoped adaptive ANN calibration (#718)
* research: add nightly survey for adaptive-recall-ann

Identifies adaptive recall-targeted ANN as the 2026-07-23 nightly topic.
Connects vector search, agent memory, edge AI, MCP tool latency SLAs,
and ruFlo workflow recall budgets. No prior nightly covered this angle.

* feat: add ruvector-adaptive-ann Rust proof of concept

Implements RecallTargetedSearch trait with three variants:
- FixedEfSearch (baseline): constant ef=64, ignore recall target
- BinarySearchCalibrated: binary-search ef per query with ground truth
- TableCalibratedSearch: O(1) ef lookup from offline calibration table

Core insight: calibration queries must match production query distribution.
CalibrationTable is a monotone ef→recall mapping from 50-100 held-out queries.

Benchmark: N=3000×D=64, recall_target=0.90
- FixedEf(64): 0.778 recall, 9,497 QPS (misses target)
- BinarySearch: 0.902 recall, 738 QPS (oracle, 13x slower)
- TableCalibrated: 0.940 recall, 4,390 QPS (exceeds target, O(1) ef)

* test: add 7 integration tests for ruvector-adaptive-ann

- beam search at ef=N achieves near-perfect recall
- recall is monotone in ef
- FixedEf(128) achieves minimum recall threshold
- CalibrationTable returns valid ef
- TableCalibratedSearch achieves recall within distribution-mismatch tolerance
- BinarySearchCalibrated achieves per-query target on 12/15 queries
- effective_ef_for_target returns Some for Table, None for Fixed

All 7 tests pass.

* docs: add ADR-272 for adaptive-recall-ann

Documents the calibration table approach, distribution matching constraint,
three implementation variants, benchmark evidence, failure modes, security
considerations, and migration path for adopting recall-targeted search.

ADR-272 status: Proposed.

* bench: capture adaptive-recall-ann benchmark results

cargo run --release -p ruvector-adaptive-ann --bin benchmark
x86_64 Linux, release build, N=3000 D=64 300 queries

FixedEf(64): recall=0.778, mean=105.3µs, QPS=9497
BinarySearch: recall=0.902, mean=1355µs, QPS=738
TableCalibrated: recall=0.940, mean=227.8µs, QPS=4390
All acceptance tests PASSED.

* fix adaptive ANN calibration scope

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-27 09:57:49 -07:00
rUv
9a31a37ca2
feat: add threshold-driven ANN with empirical recall (#719)
* research: add nightly survey for recall-bounded-ann

Nightly 2026-07-24: Recall-Bounded Approximate Nearest-Neighbour Search.
Establishes the RecallBoundedIndex trait and three measured Rust variants
for quality-first agent memory retrieval (search_above_threshold instead
of top-k). All 8 tests pass; acceptance gate met at recall >= 0.80.

Co-Authored-By: claude-flow <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01GyrjFPrMZCH3knQuw8QgLk

* fix recall-bounded ANN ids and search budgets

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-27 09:57:00 -07:00
rUv
e24813cd7b
feat: add bounded RAG graph retrieval research (ADR-272) (#720)
* feat: add ruvector-bounded-rag MinCut context window retrieval crate

Three BoundedRetriever variants: TopK baseline, GraphBFS coherence expansion,
and MinCutBounded Edmonds-Karp max-flow partition. All 9 tests pass with
precision=1.000 acceptance on synthetic 2-cluster corpora.

Co-Authored-By: claude-flow <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_012eSJ4Y33PH9w8RCv73ugu5

* docs: add ADR-272 for bounded-rag-mincut

Documents decision to add MinCut-bounded RAG retrieval, benchmark evidence,
failure modes, security considerations, and Phase 2 production hardening plan.

Co-Authored-By: claude-flow <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_012eSJ4Y33PH9w8RCv73ugu5

* docs: add nightly research README and gist for bounded-rag-mincut

Full research document with SOTA survey, architecture diagrams, real benchmark
numbers, practical/exotic applications, and public SEO gist.

Co-Authored-By: claude-flow <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_012eSJ4Y33PH9w8RCv73ugu5

* chore: update Cargo.lock for ruvector-bounded-rag dependencies

Co-Authored-By: claude-flow <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_012eSJ4Y33PH9w8RCv73ugu5

* fix bounded RAG flow and input validation

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-27 09:55:59 -07:00