Files
proffesor-for-testing__agen…/docs/plans/rvf-phase0-gate-report.md
Dragan Spiridonov bd938c5597 release: v3.6.8 — MCP auto-init, experience persistence, DB isolation (#263)
* fix(kernel): resolve relative dbPath to prevent split-brain dual-database writes

UnifiedPersistenceManager and HybridMemoryBackend pass static relative path
'.agentic-qe/memory.db' to UnifiedMemoryManager, which overrides the resolved
absolute path in the constructor via spread. When CWD differs from project root
(e.g. tests running from v3/), this creates a duplicate database at
v3/.agentic-qe/memory.db, splitting dream/concept data from patterns/KV data.

Fix: resolve any relative dbPath through findProjectRoot() in the constructor,
ensuring all callers converge on the single project-root database.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* release(v3.6.8): fix MCP auto-init, experience persistence, DB isolation, and missing deps

- Fleet auto-initializes on MCP server startup (no manual fleet_init needed)
- ExperienceReplay unified to read from captured_experiences table
- Data migrator writes to captured_experiences instead of removed experiences table
- Added fast-json-patch and jose to root package.json (fixes #262)
- Wrapped MinCut dispose saveSnapshot in try/catch for test resilience
- Kernel initializes UnifiedPersistence with temp DB for in-memory backend
- All 6 MCP handler test files use memoryBackend:'memory' and resetUnifiedPersistence()
- domain-handlers and wrapped-domain-handlers use beforeAll to prevent OOM

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: add RVF integration plan, ADRs, and benchmark script

- RVF integration implementation plan and Six Hats analyses
- Phase 0 gate report for RVF integration readiness
- ADR-065: RVF integration hybrid architecture
- ADR-066: RVF pattern store progressive HNSW
- ADR-067: Agent memory branching with RVF copy-on-write
- AQE baseline benchmark script

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(tests): restore fleet after dispose in wrapped-domain-handlers beforeAll tests

The "not initialized" tests call disposeFleet() but with beforeAll the
fleet is only initialized once. Subsequent tests failed because the
fleet was never re-initialized. Add handleFleetInit() after each
dispose-based test to restore state for later tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 08:20:10 +01:00

11 KiB

Phase 0 Gate Report — RVF Vision Validation

Date: 2026-02-15 SDK Versions: @ruvector/rvf v0.1.4, @ruvector/rvf-node v0.1.2, @ruvector/rvf-wasm v0.1.2, @ruvector/core v0.1.29, ruvector CLI v0.1.99 Platform: linux arm64, Node v24.13.0 Rust Source: github.com/ruvnet/ruvector (main branch, cloned to /tmp/ruvector-src)


Executive Summary

Gate Decision: CONDITIONAL PROCEED via Bridge Strategy

The RVF vision is validated by Rust source code — the implementation is real and comprehensive. However, the npm SDK is not yet functional for the full RVF format. The critical gap is that @ruvector/rvf-node and @ruvector/rvf-wasm are published stubs (package.json + README only, no native binaries or WASM).

However, @ruvector/core (the existing in-memory vector engine) and @ruvector/gnn (HNSW) are fully functional and already integrated into AQE. This gives us a viable bridge strategy: use the working JS engine now, and swap to full RVF when binaries ship.


Feature Matrix: Vision vs. Reality

Tier 1: Working NOW (npm packages functional)

Feature Package Status Evidence
In-memory vector DB @ruvector/core v0.1.29 WORKING VectorDb class, insertBatch, search, CollectionManager
HNSW search @ruvector/gnn WORKING Already in AQE PatternStore (ADR-048)
Distance metrics @ruvector/core WORKING cosine, euclidean, dot product
Collection management @ruvector/core WORKING createCollection, listCollections, aliases, stats
CLI operations ruvector v0.1.99 PARTIAL benchmark, info, doctor work; create has field-name bug

Tier 2: Implemented in Rust, NOT Available via npm

Feature Rust Crate Source Status npm Status
RVF file format (create/open) rvf-runtime Complete (~2150 LOC) Stub — no .node binary
Progressive HNSW (3-layer) rvf-index Complete (~530 LOC) Not wired into runtime query path
COW branching (RVCOW) rvf-runtime Complete (branch/derive) Stub
Witness chains (audit trail) rvf-runtime Complete (append_witness) Stub
Metadata filtering rvf-runtime Complete (FilterExpr) Stub
Scalar/Product quantization rvf-quant Implemented Stub
Cryptographic signing rvf-crypto Implemented Stub
N-API bindings (19 methods) rvf-node Complete (~850 LOC) No prebuilt .node file
WASM bindings (29 exports) rvf-wasm Complete No .wasm binary
AgentDB adapter rvf-adapters/agentdb Complete Not published
SONA adapter rvf-adapters/sona Complete Not published

Tier 3: Implemented in Rust, Advanced/Experimental

Feature Rust Crate Source Status Notes
KERNEL_SEG embedding rvf-kernel Complete (5 source files) QEMU microVM support confirmed
eBPF embedding rvf-ebpf Complete (1 source file)
HTTP server rvf-server Complete axum/Router found in source
Self-booting runtime rvf-launch Partial (5 files) No FUSE/mount, no unikernel yet

Tier 4: Vision Only (Not Found in Source)

Feature Claimed Source Evidence
POSIX mount (auto-ingest) "mount as disk, POSIX folder" No FUSE code found in rvf-launch
Network-native interface "speaks directly over wire" rvf-server has HTTP, no raw protocol
QR-code deployment "embed in QR code" No QR code implementation
Battery-powered edge "tile-scale, AA batteries" Architecture supports it, no edge runtime
Unikernel boot "no OS required" No unikernel references in source

Performance Comparison: AQE Baseline vs @ruvector/core

Metric AQE (SQLite+better-sqlite3) @ruvector/core (in-memory) Delta
Insert 100 3.6ms (27K ops/s) 0.2ms (458K ops/s) 17x faster
Insert 1000 12ms (83K ops/s) 1.5ms (668K ops/s) 8x faster
Insert 5000 65ms (77K ops/s) 7.7ms (651K ops/s) 8.5x faster
Search 100 (p50) 0.27ms 0.003ms 90x faster
Search 1000 (p50) 3.6ms 0.005ms 720x faster
Search 5000 (p50) 21.8ms 0.005ms 4360x faster
Cold start 11.3ms ~0ms (in-memory) N/A (different paradigm)
Persistence Yes (SQLite) No (in-memory only) AQE has durability
HNSW Via @ruvector/gnn Built-in Comparable

Notes:

  • @ruvector/core is in-memory only — no persistence. The massive search speedup (720-4360x) is expected: it avoids SQLite BLOB deserialization entirely.
  • AQE's SQLite baseline includes persistence, ACID transactions, and crash recovery — features @ruvector/core doesn't provide.
  • Fair comparison requires RVF file format (rvf-node) which would add I/O overhead but gain progressive search + persistence.

Critical Findings

1. The Runtime Query is Brute-Force

rvf-runtime/src/store.rs lines 312-361: the query() method does a linear scan across all vectors. The ProgressiveIndex (3-layer HNSW) exists in rvf-index but is NOT called from the runtime. This means even if rvf-node binaries shipped today, search performance would be O(n), not O(log n).

2. N-API Bindings Are Complete Code, Just Not Built

rvf-node/src/lib.rs has 850 lines of complete napi-rs bindings. The gap is purely a build/release pipeline issue — no prebuilt .node files are published. Building from source requires Rust toolchain (not available in Codespace).

3. The Vision Components Exist at Different Maturity Levels

  • Production-ready: Vector storage, COW branching, witness chains, metadata filtering
  • Implemented but not integrated: Progressive HNSW, adapters
  • Experimental: KERNEL_SEG, eBPF, HTTP server
  • Not implemented: POSIX mount, unikernel, QR deployment

4. @ruvector/core is Already Delivering Value

AQE already uses @ruvector/gnn for HNSW. The @ruvector/core VectorDb with CollectionManager could replace SQLite BLOB storage for vectors TODAY, with 8-4000x speedup. The tradeoff is losing persistence (in-memory only).


Gate Decision Matrix

Gate Criterion Result Recommendation
Can RVF file self-boot in WASM? NO — wasm package is stub Wait for binary
Can RVF file self-boot in Node? NO — node package is stub Wait for binary
Does POSIX mount work? NO — not implemented Vision only
Does network-native interface work? PARTIAL — HTTP server in Rust Not available via npm
Can we embed custom logic? API exists (embedKernel, embedEbpf) Not testable without backend
Progressive HNSW cold-start? NOT WIRED into runtime Even if built, would use brute-force
Feature matrix documented? YES — this document Complete

Original Gate Criteria Assessment

Gate: If self-booting and progressive HNSW work → proceed to Phase 1 If only storage features work → fall back to V1's hybrid plan

Neither gate condition is met. Self-booting doesn't work (stub packages). Progressive HNSW isn't wired into the runtime.


Revised Recommendation: Bridge Strategy

Instead of blocking on the full RVF vision, proceed with what works NOW:

Phase 0.5 — Bridge Layer (1-2 weeks)

  1. Replace SQLite BLOB vector storage with @ruvector/core VectorDb

    • Keep SQLite for KV store, Q-values, GOAP state (relational data)
    • Use VectorDb for pattern embeddings (8-4000x search speedup)
    • Add persistence wrapper: serialize/deserialize VectorDb state to SQLite on shutdown/startup
  2. Add CollectionManager for domain isolation

    • Each AQE domain gets its own collection: test-generation, defect-intelligence, etc.
    • Maps cleanly to future RVF cognitive units
  3. Keep @ruvector/gnn for HNSW (already integrated)

  4. Prepare RVF adapter interface

    • Define VectorBackend interface matching RvfDatabase API shape
    • Implement CoreVectorBackend wrapping @ruvector/core
    • When rvf-node ships, implement RvfFileBackend — swap with feature flag

When to Re-evaluate Full RVF

  • When @ruvector/rvf-node ships with prebuilt binaries (check npm view @ruvector/rvf-node weekly)
  • When progressive HNSW is wired into rvf-runtime's query path
  • When RVF file format benchmarks are available

What NOT to Do

  • Don't wait for the full vision — the bridge delivers value immediately
  • Don't build Rust from source in CI — fragile and slow
  • Don't replace SQLite for relational data — VectorDb is vector-only
  • Don't invest in KERNEL_SEG/eBPF/self-boot until npm SDK is functional

Appendix: Detailed Check Results

✅ PASS (14):
  - sdk-exports: RvfError, RvfErrorCode, NodeBackend, WasmBackend, resolveBackend, RvfDatabase
  - rvf-database-class: 20 methods including derive, embedKernel, extractKernel, embedEbpf, extractEbpf, segments
  - cow-branching-api: derive() exists on RvfDatabase prototype
  - kernel-embedding-api: embedKernel, extractKernel, embedEbpf, extractEbpf
  - segments-api: segments() method available
  - core-import: VectorDb, CollectionManager, hello, version, getHealth, getMetrics
  - cli-benchmark, cli-install-extensions
  - progressive-hnsw-rust: All 3 layers (centroid, partial, full) implemented
  - launch-crate: 5 source files
  - rvf-server-http: HTTP server with Router
  - kernel-seg-crate: 5 source files, QEMU microVM support
  - ebpf-seg-crate: 1 source file
  - self-boot-qemu: QEMU references confirmed

🟡 PARTIAL (1):
  - witness-chains-api: No explicit methods in prototype (automatic via WitnessConfig)

❌ FAIL (13):
  - sdk-import: package.json not exported
  - node-backend-import: Stub — no native bindings
  - wasm-backend-import: Stub — no WASM binary
  - rvf-database-create: No backend available
  - core-create: RuVectorDB constructor changed to VectorDb
  - gnn-import: Missing platform-specific binary (arm64)
  - mcp-server-package: package.json not exported
  - cli-server: timeout
  - progressive-hnsw-runtime-wired: Brute-force in runtime
  - progressive-hnsw-napi: N-API wraps brute-force store
  - posix-mount-rust: No FUSE code
  - network-interface-rust: No raw network protocol
  - self-boot-unikernel: No unikernel references

Generated by Phase 0 validation — 2026-02-15