Summary
Integrate @ruvector/rvf (and its WASM backend) into npx ruvector and rvlite packages per ADR-032 .
Key Invariants
Single writer rule -- One writer lease per store (file lock on Node, heartbeat on browser). Readers unlimited.
Crash ordering -- RVF is source of truth. IndexedDB is rebuildable cache. Epoch reconciliation on startup.
Backend selection -- Explicit --backend rvf never silently falls back. Fail loud with install hint.
Cross-platform compat -- WASM-written files readable by Node and vice versa for same RVF version.
Phase 1: npx ruvector
Add @ruvector/rvf as optional dependency
Create rvf-wrapper.ts matching existing core interface
Add rvf CLI command group (create, ingest, query, status, segments, derive, compact, export)
Add rvf examples and rvf download CLI commands (45 example files)
Add 10 RVF tools to main MCP server
Add hooks --backend rvf flag (explicit selection, no silent fallback)
Smoke test: 4 Rust integration tests (full lifecycle, cosine, multi-restart, metadata)
Error messages include install command for missing packages
Phase 1 Security Hardening
Phase 2: rvlite
Phase 3: Shared WASM
Test Results
Suite
Tests
Status
Rust storage (epoch + writer_lease + id_map)
55 passed + 2 doc
All pass
RVF smoke test
4 passed
All pass
RVF cross-platform compat
6 passed
All pass
RVF integration (lifecycle + lineage)
16 passed
All pass
TypeScript transpilation
2 files
Clean
JS syntax
3 files
Clean
Documentation
Failure Modes to Test
#
Scenario
Expected
1
Power loss during ingest
Last committed epoch consistent
2
Crash between RVF and metadata write
Epoch reconciliation self-heals
3
Two writers on same store
Second gets ELOCK error
4
Migration rerun
No-op, no duplication
5
Node write → browser read → browser write → Node read
Results match within 1e-6
6
Browser refresh during write
Lease expires, next open acquires fresh
Acceptance Test
Clean machine: create → ingest → query → restart twice → migrate rvlite store → open in browser → top-10 neighbors match Node results within 1e-6 tolerance.
Related
ADR-030: RVF Cognitive Container
ADR-031: RVCOW Branching
Branch: claude/ruvector-format-design-a8JSi
Summary
Integrate
@ruvector/rvf(and its WASM backend) intonpx ruvectorandrvlitepackages per ADR-032.Key Invariants
--backend rvfnever silently falls back. Fail loud with install hint.Phase 1: npx ruvector
@ruvector/rvfas optional dependencyrvf-wrapper.tsmatching existing core interfacervfCLI command group (create, ingest, query, status, segments, derive, compact, export)rvf examplesandrvf downloadCLI commands (45 example files)--backend rvfflag (explicit selection, no silent fallback)Phase 1 Security Hardening
rvf download(filename sanitization + containment)validateRvfPath)sanitizeShellArgon 25+ execSync handlers)parseIntwith defaults)Phase 2: rvlite
rvf-backendin Rust crate (default unchanged)storage/epoch.rs) — 23 tests,EpochTrackerwithAtomicU64, thread-safe@ruvector/rvf-wasmwithisRvfAvailable()/getStorageBackend()sanitizeCypher,validateRelationType)rvf-migrateCLI with--dry-runand--verifymodes (idempotent, 1e-6 tolerance)rvf-rebuildto reconstruct metadata from RVFWriterLeasewith file lock + PID stale detection (12 tests); JS:BrowserWriterLeasewith IndexedDB heartbeatIdMappingtrait,DirectIdMap(identity),OffsetIdMap(20 tests)createWithRvf(),saveToRvf(),loadFromRvf(),RvfFileEnvelopefallback formatPhase 3: Shared WASM
@ruvector/rvf-wasmas shared optional peer dependency in rvlitewasm-dedup-check.yml) fails if duplicate WASM artifacts detectedrvlite_sql,rvlite_cypher,rvlite_sparql) — read-only defaultTest Results
Documentation
@ruvector/rvfREADME: complete rewrite (342 lines) — platform matrix, segments, API, examplesruvectorREADME: +89 lines — RVF section with CLI commands and platform tablervliteREADME: +61 lines — RVF storage backend, epoch reconciliation, downloadsFailure Modes to Test
Acceptance Test
Clean machine: create → ingest → query → restart twice → migrate rvlite store → open in browser → top-10 neighbors match Node results within 1e-6 tolerance.
Related
claude/ruvector-format-design-a8JSi