ruvector/docs/architecture/decisions
rUv a2326c0449
feat: ADR-280/281/282 — durable RVF metadata, role-aware embeddings, nightly research quality gate (#774)
Three ADRs implemented and hardened across five rounds of adversarial review, plus the fixes that review surfaced.

**ADR-280 — durable RVF metadata.** Delta-encoded generations with a snapshot every 32. The first implementation wrote a full snapshot per commit and replayed every one at open: 600 commits produced a 725 MiB file that could no longer be opened, with no repair path. Now 241 KB of META payload for the same workload, opening in ~4 ms. Review also closed: derive-children that could not be reopened, an 80-byte file driving a 512 MiB allocation, delete() rollback leaving in-memory tombstones that bricked the artifact, ten BufWriter sites discarding flush errors before sync_all, corrupt mid-chain deltas made unopenable (now recovers the longest valid prefix), and an ordering bug where recovery pruning committed without its re-anchoring snapshot so `rvf ingest` printed a repair warning and then destroyed the file.

**ADR-281 — role-aware embeddings.** Query/passage routing with an attested embedding-space identity. Review found the space id hashed CARGO_PKG_VERSION, so a routine version bump would have rejected every persisted corpus and invalidated every cache key — with the test suite structurally blind to it. Now keyed on a dedicated format revision with a golden-id test. Also: three constructors that failed unconditionally with ten unmigrated callers, prompt templates applied from the attested identity rather than hardcoded strings, and ApiEmbedding no longer bypassing templating.

**ADR-282 — nightly research quality gate.** Review found the gate had never completed a single run: the candidate checkout was shallow so its git diff always failed, and a jq quoting bug made the override path dead code. Check-run queries were unpaginated — on a real main commit 8 of 22 failures were invisible, so a red base could be certified green. Schemas are now load-bearing with a hashed dependency closure.

**CI note.** The two red checks are both pre-existing on main, not regressions from this branch: `Tests (core-and-rest)` routinely exceeds its 4-hour window, and `Hooks CI` has failed on main since 2026-08-02 (and in May) on `cp -r node_modules $GITHUB_WORKSPACE/npm/packages/cli/` in hooks-ci.yml — this branch's one-line version sync merely re-triggered its path filter. 72 checks pass.

Follow-ups filed and not blocking: #770, #771, #772.

🤖 Generated with [claude-flow](https://github.com/ruvnet/claude-flow)
2026-08-03 14:13:37 -03:00
..
ADR-001-core-simd-strategy.md feat(ruvix): implement CLI, kernel shell, and PBFT consensus (#261) 2026-03-14 16:25:03 -04:00
ADR-001-simd-first-vector-operations.md feat(ruvix): implement CLI, kernel shell, and PBFT consensus (#261) 2026-03-14 16:25:03 -04:00
ADR-002-hyperbolic-embeddings.md feat(ruvix): implement CLI, kernel shell, and PBFT consensus (#261) 2026-03-14 16:25:03 -04:00
ADR-003-flash-attention.md feat(ruvix): implement CLI, kernel shell, and PBFT consensus (#261) 2026-03-14 16:25:03 -04:00
ADR-003-mcp-protocol.md feat(ruvix): implement CLI, kernel shell, and PBFT consensus (#261) 2026-03-14 16:25:03 -04:00
ADR-004-hnsw-ann.md feat(ruvix): implement CLI, kernel shell, and PBFT consensus (#261) 2026-03-14 16:25:03 -04:00
ADR-004-rvf-format.md docs+feat(rvf): ADR-009 — RVF v1 wire contract, exact magic bytes, golden vectors, CI gate (#769) 2026-08-02 18:24:24 -03:00
ADR-005-cross-platform-bindings.md feat(ruvix): implement CLI, kernel shell, and PBFT consensus (#261) 2026-03-14 16:25:03 -04:00
ADR-005-rvf-cognitive-container.md docs+feat(rvf): ADR-009 — RVF v1 wire contract, exact magic bytes, golden vectors, CI gate (#769) 2026-08-02 18:24:24 -03:00
ADR-006-sona-adaptation.md feat(ruvix): implement CLI, kernel shell, and PBFT consensus (#261) 2026-03-14 16:25:03 -04:00
ADR-006-sona-self-optimization.md feat(ruvix): implement CLI, kernel shell, and PBFT consensus (#261) 2026-03-14 16:25:03 -04:00
ADR-007-differential-privacy.md feat(ruvix): implement CLI, kernel shell, and PBFT consensus (#261) 2026-03-14 16:25:03 -04:00
ADR-008-flash-attention.md feat(ruvix): implement CLI, kernel shell, and PBFT consensus (#261) 2026-03-14 16:25:03 -04:00
ADR-008-wasm-first-strategy.md feat(ruvix): implement CLI, kernel shell, and PBFT consensus (#261) 2026-03-14 16:25:03 -04:00
ADR-009-rvf-v1-wire-contract.md feat: ADR-280/281/282 — durable RVF metadata, role-aware embeddings, nightly research quality gate (#774) 2026-08-03 14:13:37 -03:00
README.md feat(ruvix): implement CLI, kernel shell, and PBFT consensus (#261) 2026-03-14 16:25:03 -04:00

Architecture Decision Records

This directory contains Architecture Decision Records (ADRs) for ruvector's core technical decisions.

Decision Index

ADR Title Status Summary
ADR-001 Core SIMD Optimization Strategy Accepted AVX-512/AVX2/NEON with runtime detection for 2.5x-18x speedup
ADR-002 Hyperbolic Embeddings for Hierarchical Data Accepted Poincare ball model for low-distortion tree embeddings
ADR-003 MCP Server Architecture and Transport Accepted JSON-RPC 2.0 over stdio/SSE/WebSocket for AI agent integration
ADR-004 RVF Cognitive Container Format Accepted Self-describing vector format with WASM kernels
ADR-005 Cross-Platform Bindings (WASM + NAPI-RS) Accepted WASM-first with native acceleration via NAPI-RS
ADR-006 SONA Self-Optimizing Architecture Accepted Online learning for automatic parameter tuning
ADR-007 Differential Privacy and Epsilon-Budget Accepted Privacy budget management for collective learning
ADR-008 Flash Attention Implementation Accepted Memory-efficient O(N) attention with block-sparse patterns

ADR Template

When creating new ADRs, use this structure:

# ADR-XXX: Title

| Field | Value |
|-------|-------|
| **Status** | Proposed / Accepted / Deprecated / Superseded |
| **Date** | YYYY-MM-DD |
| **Authors** | Names |
| **Reviewers** | Names |
| **Supersedes** | ADR-XXX (if applicable) |
| **Related** | ADR-XXX, ADR-YYY |

## 1. Context
[Problem statement and background]

## 2. Decision
[The decision and its justification]

## 3. Rationale
[Why this decision over alternatives]

## 4. Consequences
[Benefits, costs, and tradeoffs]

## 5. Implementation
[Key implementation details]

## 6. Related Decisions
[Links to related ADRs]

## 7. References
[External references]

## 8. Revision History
[Change log]

Decision Categories

Core Performance

  • ADR-001: SIMD optimization strategy (AVX-512/AVX2/NEON)
  • ADR-008: Flash Attention for LLM inference

Data Representation

  • ADR-002: Hyperbolic embeddings (Poincare ball model)
  • ADR-004: RVF cognitive container format

System Architecture

  • ADR-003: MCP protocol and transport choices
  • ADR-005: Cross-platform bindings (WASM + NAPI-RS)
  • ADR-006: SONA self-optimization
  • ADR-007: Differential privacy architecture

Quick Reference

Topic ADR Key Decision
Vector distance ADR-001 Hand-optimized SIMD for 2.5-18x speedup
Hierarchical data ADR-002 Poincare ball embeddings with c=1.0 default
AI agent protocol ADR-003 MCP with stdio (local) and SSE (remote)
File format ADR-004 RVF with 15 segment types, ML-DSA-65 signatures
Node.js bindings ADR-005 NAPI-RS native with WASM fallback
Self-optimization ADR-006 Temperature tracking, pattern learning, adaptive ef
Privacy ADR-007 Gaussian mechanism, epsilon-budget, PII stripping
Long context ADR-008 Flash Attention with 128K+ support

For more detailed ADRs, see the main /docs/adr/ directory which contains:

  • ADR-001 through ADR-088+ covering specific implementation decisions
  • Coherence Engine ADRs in /docs/adr/coherence-engine/
  • Project-specific ADRs in various crate directories

Status Definitions

Status Meaning
Proposed Under discussion, not yet implemented
Accepted Decision made, implementation in progress or complete
Deprecated No longer recommended, retained for history
Superseded Replaced by a newer ADR

Implementation Status

ADR Crate Status
ADR-001 ruvector-core Complete
ADR-002 ruvector-core, ruvector-hyperbolic-hnsw Complete
ADR-003 mcp-brain, ruvector-cli Complete
ADR-004 rvf, rvf-kernel Complete
ADR-005 ruvector-wasm, ruvector-node Complete
ADR-006 ruvector-core Complete
ADR-007 pi-brain Complete
ADR-008 ruvllm Complete