docs(edge): clarify Raft vs Gossip+CRDT consensus modes

Raft assumes stable membership and trusted nodes - not suitable for
wild browser swarms. Updated docs to:

- Position Raft for "trusted cohorts" (teams, enterprise, private relays)
- Add Gossip + CRDT for "open swarms" (public, high-churn, adversarial)
- Explain when to use each mode with code examples
- Update capability tables to reflect both consensus strategies

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
rUv 2025-12-31 21:09:49 +00:00
parent 7febf16ebf
commit 4a28bbd64a
2 changed files with 37 additions and 12 deletions

View file

@ -45,7 +45,8 @@ This library gives you everything you need to build distributed AI systems: cryp
| **Encryption** | AES-256-GCM | 1 GB/sec |
| **Vector Search** | HNSW index | 150x faster than brute force |
| **Task Routing** | Semantic LSH | Sub-millisecond |
| **Consensus** | Raft protocol | 1-2 round-trip election |
| **Trusted Consensus** | Raft protocol | For stable cohorts (teams, rooms) |
| **Open Swarm** | Gossip + CRDT | High-churn, Byzantine-tolerant |
| **Post-Quantum** | Hybrid signatures | Future-proof |
| **Neural Networks** | Spiking + STDP | Bio-inspired learning |
| **Compression** | Adaptive 4-32x | Network-aware |
@ -78,16 +79,17 @@ RuVector provides a complete edge AI platform. This package (`@ruvector/edge`) i
│ ✓ AES-256-GCM Encryption │
│ ✓ HNSW Vector Search ✓ Graph DB (288KB) │
│ ✓ Semantic Task Routing Neo4j-style API, Cypher queries │
│ ✓ Raft Consensus Relationship modeling, traversals │
│ ✓ Post-Quantum Crypto │
│ ✓ Spiking Neural Networks ✓ RVLite Vector DB (260KB) │
│ ✓ Adaptive Compression SQL + SPARQL + Cypher queries │
│ IndexedDB persistence │
│ Best for: │
│ • Lightweight P2P apps ✓ SONA Neural Router (238KB) │
│ • Secure messaging Self-learning with LoRA │
│ • Simple agent swarms EWC++ continual learning │
│ • Mobile/embedded ReasoningBank experience replay │
│ ✓ Raft (trusted cohorts) Relationship modeling, traversals │
│ ✓ Gossip + CRDT (open swarms) │
│ ✓ Post-Quantum Crypto ✓ RVLite Vector DB (260KB) │
│ ✓ Spiking Neural Networks SQL + SPARQL + Cypher queries │
│ ✓ Adaptive Compression IndexedDB persistence │
│ │
│ Best for: ✓ SONA Neural Router (238KB) │
│ • Lightweight P2P apps Self-learning with LoRA │
│ • Secure messaging EWC++ continual learning │
│ • Trusted team swarms ReasoningBank experience replay │
│ • Mobile/embedded │
│ │
│ ✓ DAG Workflows (132KB) │
│ Task orchestration │
@ -131,6 +133,29 @@ import onnxInit from '@ruvector/edge-full/onnx';
---
### Consensus Modes: Trusted vs Open
RuVector provides two coordination strategies for different deployment scenarios:
| Mode | Protocol | When to Use |
|------|----------|-------------|
| **Trusted Cohort** | Raft | Private teams, enterprise LANs, known membership, low churn |
| **Open Swarm** | Gossip + CRDT | Public networks, anonymous browsers, high churn, adversarial environments |
```javascript
// Trusted cohort (Raft) - stable team of 3-7 nodes
const raftNode = new WasmRaftNode('node-1', ['node-1', 'node-2', 'node-3']);
raftNode.start_election(); // Leader election for consistent state
// Open swarm (Gossip + CRDT) - dynamic browser mesh
const gossipNode = new WasmGossipNode(identity);
gossipNode.join_swarm(relayUrl); // Eventually consistent, Byzantine-tolerant
```
**Why two modes?** Raft assumes known membership and trusted nodes - perfect for your dev team or enterprise deployment. But a public browser swarm has nodes joining/leaving constantly and can't trust everyone. Gossip protocols with CRDTs handle this gracefully: no leader election, no membership tracking, eventual consistency that converges even with malicious actors.
---
### Quick Start
```bash

View file

@ -1,6 +1,6 @@
{
"name": "@ruvector/edge",
"version": "0.1.7",
"version": "0.1.8",
"type": "module",
"description": "Free edge-based AI swarms in the browser - P2P, crypto, vector search, neural networks. Install @ruvector/edge-full for graph DB, SQL, ONNX embeddings.",
"main": "ruvector_edge.js",