* fix(security): RUSTSEC advisories + clippy hardening in RuVector - Replace all bare `partial_cmp().unwrap()` calls on f32/f64 with `.unwrap_or(Ordering::Equal)` to prevent panics on NaN values in sorting/max-by operations across ruvllm, ruvector-dag, prime-radiant, and rvagent-wasm (12 sites in production code). - Add input validation guards to the HTTP search endpoint: reject k=0, k > 10_000, empty vectors, and vectors exceeding 65_536 dimensions, preventing memory exhaustion via unbounded allocations. - Harden LocalFsBackend::execute in rvagent-cli with env_clear() + safe-env allowlist (SEC-005), deadline-based timeout enforcement, and 1 MB output truncation, matching the security posture of LocalShellBackend. - Remove 129 occurrences of the deprecated `unused_unit = "allow"` lint and 3 occurrences of the removed `clippy::match_on_vec_items` lint from Cargo.toml files workspace-wide; both are no-ops in current Rust/Clippy. - All 653+ tests across ruvector-core, ruvector-server, ruvector-dag, rvagent-cli, and prime-radiant pass with zero failures. Note: `bytes` is already at 1.11.1 (>= 1.10.0); `paste` 1.0.15 is a transitive dependency with no semver fix available upstream; `cargo audit` returns clean. Co-Authored-By: claude-flow <ruv@ruv.net> * fix(ci): cargo fmt + restore workspace unused_unit lint allow - Run cargo fmt --all across all 9 files that drifted from rustfmt style (prime-radiant/energy.rs, ruvector-dag/bottleneck.rs+reasoning_bank.rs, ruvector-server/points.rs, ruvllm/pretrain_pipeline.rs+report.rs+registry.rs, rvagent-cli/app.rs, rvagent-wasm/gallery.rs) - Add [workspace.lints.clippy] unused_unit = "allow" to root Cargo.toml; the per-crate entries removed in the security commit were still needed — moving to workspace-level is cleaner and restores -D warnings CI pass Co-Authored-By: claude-flow <ruv@ruv.net> * fix(ci): remove unneeded unit return type in ruvix bench Removes `-> ()` from the Fn bound in run_benchmark_with_kernel (crates/ruvix/benches/src/ruvix.rs:50) — triggers clippy::unused_unit under -D warnings. Clippy prefers `Fn(&mut Kernel)` without explicit unit return. Co-Authored-By: claude-flow <ruv@ruv.net> * fix(ci): resolve rustfmt and clippy unused_unit failures - Run cargo fmt --all to fix long closure formatting in 9 files (energy.rs, bottleneck.rs, reasoning_bank.rs, points.rs, pretrain_pipeline.rs, report.rs, registry.rs, app.rs, gallery.rs) - Add unused_unit = "allow" to [lints.clippy] in ruvix-bench and ruvector-mincut Cargo.toml files to suppress the unused_unit lint that was previously suppressed globally and now fires on two Fn(&mut T) -> () and FnMut() -> () function bounds Co-Authored-By: claude-flow <ruv@ruv.net> |
||
|---|---|---|
| .. | ||
| docs | ||
| examples | ||
| src | ||
| tests | ||
| build.rs | ||
| Cargo.toml | ||
| README.md | ||
RvLite - Standalone Vector Database
Status: Proof of Concept (v0.1.0)
RvLite is a lightweight, standalone vector database that runs entirely in WebAssembly. It provides SQL, SPARQL, and Cypher query interfaces, along with graph neural networks and self-learning capabilities.
🎯 Vision
A complete vector database that runs anywhere JavaScript runs:
- ✅ Browsers (Chrome, Firefox, Safari, Edge)
- ✅ Node.js
- ✅ Deno
- ✅ Bun
- ✅ Cloudflare Workers
- ✅ Vercel Edge Functions
🏗️ Architecture
RvLite is a thin orchestration layer over battle-tested WASM crates:
┌─────────────────────────────────────────┐
│ RvLite (Orchestration) │
│ ├─ SQL executor │
│ ├─ SPARQL executor │
│ ├─ Storage adapter │
│ └─ Unified WASM API │
└──────────────┬──────────────────────────┘
│ depends on (100% reuse)
▼
┌──────────────────────────────────────────┐
│ Existing WASM Crates │
├──────────────────────────────────────────┤
│ • ruvector-core (vectors, SIMD) │
│ • ruvector-wasm (storage, indexing) │
│ • ruvector-graph-wasm (Cypher) │
│ • ruvector-gnn-wasm (GNN layers) │
│ • sona (ReasoningBank learning) │
│ • micro-hnsw-wasm (ultra-fast HNSW) │
└──────────────────────────────────────────┘
🚀 Quick Start (Future)
import { RvLite } from '@rvlite/wasm';
// Create database
const db = await RvLite.create();
// SQL with vector search
await db.sql(`
CREATE TABLE docs (
id SERIAL PRIMARY KEY,
content TEXT,
embedding VECTOR(384)
)
`);
await db.sql(`
SELECT id, content, embedding <=> $1 AS distance
FROM docs
ORDER BY distance
LIMIT 10
`, [queryVector]);
// Cypher graph queries
await db.cypher(`
CREATE (a:Person {name: 'Alice'})-[:KNOWS]->(b:Person {name: 'Bob'})
`);
// SPARQL RDF queries
await db.sparql(`
SELECT ?name WHERE {
?person foaf:name ?name .
}
`);
// GNN embeddings
const embeddings = await db.gnn.computeEmbeddings('social_network', [
db.gnn.createLayer('gcn', { inputDim: 128, outputDim: 64 })
]);
// Self-learning with ReasoningBank
await db.learning.recordTrajectory({ state: [0.1], action: 2, reward: 1.0 });
await db.learning.train({ algorithm: 'q-learning', iterations: 1000 });
📦 Current Status (v0.1.0 - POC)
This is a proof of concept to validate:
- ✅ Basic WASM compilation with ruvector-core
- ✅ WASM bindings setup (wasm-bindgen)
- ⏳ Integration with other WASM crates (pending)
- ⏳ Bundle size measurement (pending)
- ⏳ Performance benchmarks (pending)
🛠️ Development
Build
# Install wasm-pack
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
# Build for web
cd crates/rvlite
wasm-pack build --target web --release
# Build for Node.js
wasm-pack build --target nodejs --release
Test
# Run Rust unit tests
cargo test
# Run WASM tests (requires Chrome/Firefox)
wasm-pack test --headless --chrome
wasm-pack test --headless --firefox
Size Analysis
# Build optimized
wasm-pack build --release
# Check size
ls -lh pkg/*.wasm
du -sh pkg/
📖 Documentation
See /crates/rvlite/docs/ for comprehensive documentation:
00_EXISTING_WASM_ANALYSIS.md- Analysis of existing WASM infrastructure01_SPECIFICATION.md- Complete requirements specification02_API_SPECIFICATION.md- TypeScript API design03_IMPLEMENTATION_ROADMAP.md- Original 5-week timeline04_REVISED_ARCHITECTURE_MAX_REUSE.md- Optimized 2-3 week plan05_ARCHITECTURE_REVIEW_AND_VALIDATION.md- Architecture validationSPARC_OVERVIEW.md- SPARC methodology overview
🎯 Roadmap
Phase 1: Proof of Concept (Current)
- Create rvlite crate structure
- Set up WASM bindings
- Basic compilation test
- Measure bundle size
- Integration with ruvector-wasm
- Integration with ruvector-graph-wasm
Phase 2: Core Integration (Week 1)
- Storage adapter implementation
- SPARQL extraction from ruvector-postgres
- SQL parser integration (sqlparser-rs)
- Basic query routing
Phase 3: Full Features (Week 2)
- GNN layer integration
- ReasoningBank integration
- Hyperbolic embeddings
- Comprehensive testing
Phase 4: Production Release (Week 3)
- Documentation
- Examples (browser, Node.js, Deno)
- Performance benchmarks
- NPM package publication
📊 Size Budget
Target: < 3MB gzipped
Expected breakdown:
- ruvector-core: ~500KB
- SQL parser: ~200KB
- SPARQL executor: ~300KB
- Cypher (ruvector-graph-wasm): ~600KB
- GNN layers: ~300KB
- ReasoningBank (sona): ~300KB
- Orchestration: ~100KB
Total estimated: ~2.3MB gzipped ✅
🤝 Contributing
This project reuses existing battle-tested WASM crates. Contributions should focus on:
- Integration and orchestration
- SQL/SPARQL/Cypher query routing
- Storage adapter implementation
- Testing and benchmarks
- Documentation and examples
📄 License
MIT OR Apache-2.0
🙏 Acknowledgments
RvLite is built on the shoulders of:
ruvector-core- Vector operations and SIMDruvector-wasm- WASM vector databaseruvector-graph- Cypher and graph databaseruvector-gnn- Graph neural networkssona- Self-learning and ReasoningBankmicro-hnsw-wasm- Ultra-lightweight HNSW
Status: Proof of Concept - Architecture Validated ✅ Next Step: Build and measure bundle size