Commit graph

2409 commits

Author SHA1 Message Date
ruv
65888ef432 chore(gnn): remove commented-out workspace ndarray line
The workspace pins ndarray 0.16 while ruvector-gnn needs 0.17.2.
Keep the explicit version pin and remove the stale comment to avoid
confusion. Other crates still use workspace ndarray (0.16) safely.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-04-20 13:49:31 -04:00
github-actions[bot]
8710ccc1d3 chore: Update NAPI-RS binaries for all platforms
Built from commit 0c28352e5c

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2026-04-20 17:25:10 +00:00
rUv
0c28352e5c feat(brain): DiskANN + AIDefence + geo-spatial brain capabilities (#363)
* feat(brain): DiskANN vector index, AIDefence, content resolution, geo-spatial support

Brain server updates for ruOS v1.1.0:
- DiskANN Vamana graph index (replaces brute-force at 2K+ vectors)
- AIDefence inline security scanning on POST /memories
- Content resolution from blob store on GET /memories/:id and search
- Search dedup by content_hash with over-fetch (k*8, min 40)
- Security scan endpoint: POST /security/scan, GET /security/status
- List pagination with offset parameter and total count
- Spatial memory categories: spatial-geo, spatial-observation, spatial-vitals
- Blob write on create_memory (was missing — content lost)

Validated: 3,954 memories, 100% vectorized, 23ms search, zero drift,
6/6 AIDefence tests, 0 errors over 3 days continuous operation.

Co-Authored-By: claude-flow <ruv@ruv.net>

* fix(brain): resolve merge conflict markers in Cargo.toml and Cargo.lock

Unresolved <<<<<<< / ======= / >>>>>>> markers blocked all CI
(cargo check, clippy, rustfmt, tests, security audit, native builds).

Keep both sides: ruvbrain-sse + ruvbrain-worker bins from upstream
and the new mcp-brain-server-local bin from this branch. Lock file
retains both ruvector-consciousness and rusqlite dependencies.

Co-Authored-By: claude-flow <ruv@ruv.net>

---------

Co-authored-by: ruvnet <ruvnet@gmail.com>
2026-04-20 13:18:21 -04:00
kiki-kanri
fc9c9cd37a feat(ruvector-graph): add has_edge(from, to, edge_type) for O(out_degree) existence check 2026-04-20 17:30:32 +08:00
Michael O'Boyle
a1a04a3570 bench: comprehensive quantization method comparison (8 methods, 3 datasets)
First benchmark comparing all ruvector-core quantization methods against
TurboQuant on standard vector search datasets. 8 configurations, 3 datasets
(GloVe d=200, SIFT d=128, PKM d=384), 3 trials per config with variance.

Key findings:
- Int4 beats TurboQuant MSE on recall at 8x compression (91.2% vs 89.6% R@1)
- QJL correction hurts recall for vector search (9-41% loss)
- PQ with 8 subspaces fails at d=200 (18.2% R@1)
- TurboQuant MSE 3-bit fills unserved 10.7x compression tier (82.0% R@1)
- QuantizedVector::distance() never called during HNSW search

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-19 21:37:14 -04:00
kiki-kanri
191275b262 chore(ruvector-graph): generalize delete_edges_batch to accept impl AsRef<str>
Matches delete_edge API symmetry. Allows &[String], &[&str], &[Box<str>] etc.
2026-04-19 13:32:17 +08:00
kiki-kanri
e04b780c66 feat(ruvector-graph): add delete_edges_batch for single-transaction edge deletion
GraphDB and GraphStorage: add delete_edges_batch(ids: &[EdgeId]) -> Result<usize>
- Single transaction for all deletes (vs N transactions in sequential delete_edge loop)
- Returns count of edges actually deleted (skips IDs not found)
- Updates edge_type_index and adjacency_index in single pass
- All 17 edge tests pass
2026-04-19 13:27:45 +08:00
kiki-kanri
9e08b74c1a feat(ruvector-graph): add PropertyValue::FloatArray for zero-overhead embedding storage
- Add FloatArray(Vec<f32>) variant to PropertyValue enum
- Add float_array() constructor and From<Vec<f32>> impl
- Update extract_embedding to prefer FloatArray (direct clone, no conversion)
- Fallback to legacy Array(Float/Integer) format for backward compat
- Add test_neo4j_float_array_property and test_float_array_constructor
- property_value_strategy proptest now covers FloatArray
- Remove dead property.rs (shadow PropertyValue with Bool/Int variants)
2026-04-19 13:09:43 +08:00
kiki-kanri
55c3804dbe feat(ruvector-graph): add get_edges_for_nodes with fused callback API
- AdjacencyIndex: add get_edges_for_nodes(node_ids) -> Vec<EdgeId>
- AdjacencyIndex: add for_each_outgoing_edge callback API (eliminates intermediate Vec<EdgeId> allocation for hot paths)
- Graph: get_edges_for_nodes uses for_each_outgoing_edge fused implementation (N string allocs eliminated)
- Add unit tests for both APIs (len=2/1/0/unknown cases)
- Add integration test in edge_tests.rs
2026-04-19 01:17:35 +08:00
kiki-kanri
f16530dc84 feat(ruvector-core): insert_batch accept impl AsRef<[VectorEntry]> for zero-copy borrows
- VectorDB::insert_batch now takes impl AsRef<[VectorEntry]> instead of Vec<VectorEntry>
- Enables zero-copy batch inserts when caller passes &vec reference
- Maintains backward compatibility with owned Vec<T> call sites
- Unblocks P3-26: eliminates clone hack in upsert_vectors.rs
2026-04-18 23:09:38 +08:00
kiki-kanri
2d0ce8bd9a feat(sona): add MicroLoRA set_weights for external persistence
- MicroLoRA::set_weights(down, up) -> Result<(), String> with dimension validation
- LoopCoordinator::get_micro_lora_weights() -> (Vec<f32>, Vec<f32>)
- LoopCoordinator::restore_micro_lora_weights(down, up) -> Result<(), String>
- 6 unit tests covering valid/wrong-dim set and coordinator roundtrip
2026-04-18 22:35:52 +08:00
kiki-kanri
f38a12369a chore(gnn): bump ndarray version 2026-04-18 19:51:30 +08:00
Ofer Shaal
241738c986 docs(adr): ADR-151 + PRD §6 — Phase 0 findings, revised perf targets, Grok review
Phase 0 implementation revealed that the original PRD §6 targets
(50 ns / 200 ns for is_prime_u64 worst case) were structurally
unachievable in safe Rust on Apple-silicon. Apples-to-apples competitor
benchmark in the same binary on the same machine measured num-prime
0.4.4 at 884 ns vs ours at 15.63 µs — ~17.7× headroom recoverable via
Montgomery reduction in Phase 0.1, but not the ~300× the original target
implied. The 50 ns figure was a pre-implementation estimate that did not
survive contact with measured hardware.

ADR-151 (docs/adr/ADR-151-miller-rabin-prime-optimizations.md)
- Status promoted from "Proposed" to "Accepted (Phase 0 landed
  2026-04-16; performance targets revised)".
- New "Phase 0 Findings (2026-04-16)" section documenting what landed,
  measurements vs original targets, num-prime competitor baseline, the
  revised target band, and Phase 0.1 scope (Montgomery only).
- Explicit rejection of swapping to the empirical 7-witness set:
  Sinclair-12 is theorem-proven across all u64; the 7-witness sets in
  the literature are empirically tested up to 2^64 but not proven, and
  swapping invalidates the A014233(11) canary in the pseudoprime test.

PRD §6 (docs/research/miller-rabin-optimizations/PRD.md)
- Revision header noting the relaxation.
- is_prime_u64(p) worst-case row updated to ≤ 1 µs (was 50 ns) M-series
  / ≤ 4 µs (was 200 ns) WASM.
- New §6.1 "Empirical findings (Phase 0)" with the measurement table
  and the num-prime baseline data.

GROK-REVIEW-REQUEST.md (new, 424 lines)
- Self-contained briefing used to obtain external Grok review of the
  Phase 0 design and Phase 0.1 plan: §1 binding context, §2 implementation
  embedded verbatim, §3 measurements + competitor baseline, §4 four-section
  ask (correctness, perf plan ranked, architecture, validation
  methodology), §5 response format. Constraints block forbids
  "just use num-prime" answers and pins the canary witness set.
2026-04-16 14:41:02 -04:00
Ofer Shaal
12bfcefb18 feat(collections): Phase 0 — Miller-Rabin primality kernel + prime tables (PIAL)
Lands the deterministic Sinclair-12 Miller-Rabin u64 kernel and build-time
prime tables under crates/ruvector-collections/, per ADR-151.

Implementation
- src/primality_kernel.rs: shared MR core (mulmod via u128, powmod, witness
  loop, prev/next prime). Single source of truth — include!d from both build.rs
  and src/primality.rs to keep the build script and runtime kernel byte-identical.
- src/primality.rs: public API — is_prime_u32/u64, prev/next_prime_u64,
  prev_prime_below_pow2(k), next_prime_above_pow2(k), ephemeral_prime(seed).
  Probabilistic is_prime_u128 gated behind --feature unstable-u128 with
  Russian-peasant mulmod, mod_add overflow-safe addition, and LCG-seeded
  witness selection.
- build.rs: emits PRIMES_BELOW_2K[57] / PRIMES_ABOVE_2K[57] for k ∈ [8, 64].
  ABOVE[64] is a 0 sentinel (no u64 prime > 2^64); k=64 BELOW special-cases
  via mr_prev_prime_u64(u64::MAX).

Tests (76 pass; cross-check 0.00s)
- tests/primality_pseudoprimes.rs: pinned A014233 strong pseudoprimes
  (entries 4, 5, 11) so any witness-set regression — including dropping
  base-37 — fails loudly. SPP_FIRST_11 = 3_825_123_056_546_413_051 is the
  canary for base-37 detection.
- tests/table_cross_check.rs: re-validates all 114 emitted table entries
  against MR + sweep_odds_strictly_between (iterates the prime gap, not the
  range — so even k=63 finishes instantly).
- Doc tests + 7 inline unit tests including u128 M_89 smoke.

Benches (criterion, M-series)
- is_prime_u64 worst case (u64::MAX − 58): 15.63 µs (3 runs ±2%)
- prev_prime_below_pow2 k=32 shard router: 7.48 ns
- next_prime_u64 ~1e9: 11.44 µs
- next_prime_u64 2^61 − 1 general path: 7.83 µs

Empirical floor finding: re-running with num-prime 0.4.4 in the same binary
on the same hardware measured num_prime::is_prime64(u64::MAX − 58) at 884 ns
vs ours at 15.63 µs — confirming the 50 ns PRD target was structurally
unachievable in safe Rust (~17.7× headroom recoverable via Montgomery in
Phase 0.1, but not 300×). PRD §6 and ADR-151 amended in a follow-up commit.
2026-04-16 14:40:37 -04:00
Ofer Shaal
6c0daaf018 docs(adr): ADR-151 + PRD — Miller-Rabin prime optimizations (PIAL)
Adds the binding ADR and full PRD for the Prime-Indexed Acceleration
Layer (PIAL): a single ~250-LoC Miller-Rabin primality utility in
crates/ruvector-collections that unblocks five independent prime-aware
optimizations across hashing, sharding, sketching, and the pi-brain
witness chain.

Use cases:
  * Shard-router prime modulus  — closes ADR-058 finding #6
  * HNSW prime-bucket adjacency — micro-hnsw-wasm, hyperbolic-hnsw
  * Certified-prime LSH modulus — sparsifier, attn-mincut
  * Witness-chain ephemeral primes — pi-brain brain_share payload
  * Anti-aliasing prime strides — sparsifier sampler

Generation strategy combines a compile-time table of primes near 2^k
(fast path, ~1ns) with a Miller-Rabin descent fallback (~250ns). The
table is generated by build.rs from the MR implementation and
cross-checked against MR in CI, so MR remains the source of truth.

Includes HANDOFF.md with Phase 0 deliverables for the next session.
ADR and PRD pin acceptance criteria, performance targets, and a
six-phase rollout (each phase ships as a separate PR).
2026-04-16 12:34:47 -04:00
Sebastian Ricaldoni
e973346ba5 fix(docs): correct ADR cross-references in ADR-006 Related field
The Related field incorrectly referenced ADR-003 as KV Cache and
ADR-005 as LoRA Adapter Loading. In the actual repo:
- ADR-003 is SIMD Optimization Strategy
- ADR-004 is KV Cache Management (correct target)
- ADR-005 is WASM Runtime Integration (correct name)

No LoRA Adapter Loading ADR exists; ADR-005 (WASM) is the genuine
related decision for memory management concerns.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 13:20:47 -03:00
github-actions[bot]
b02635cd25 chore: Update NAPI-RS binaries for all platforms
Built from commit 358a04f8d2

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2026-04-14 22:20:12 +00:00
Reuven
358a04f8d2 fix(brain): rebuild graph after Firestore hydration completes
Root cause: Firestore hydration runs in background tokio::spawn but
the initial graph rebuild runs synchronously on the EMPTY memory vec
before hydration finishes. Result: 0 nodes/edges until next 6h cron.

Fix: Chain graph rebuild to the hydration task using Arc<RwLock<Graph>>.
After deploy: graph should show 1M+ edges within ~30s of startup.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-04-14 18:16:00 -04:00
github-actions[bot]
968d3525f8 chore: Update NAPI-RS binaries for all platforms
Built from commit 660be0466f

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2026-04-14 21:52:02 +00:00
github-actions[bot]
b03fcebb65 chore: Update NAPI-RS binaries for all platforms
Built from commit 7ded427ec9

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2026-04-14 21:48:07 +00:00
Reuven
660be0466f docs(adr): ADR-150 π Brain + RuvLtra via Tailscale — semantic embedding upgrade
Offload embedding from Cloud Run HashEmbedder (128-dim, hash-based) to
local RuvLtra Q4 transformer (896-dim, ANE-optimized, with SONA learning).

Architecture:
- Mac Mini runs new ruvltra-embed-server binary on :8090
- Tailscale mesh VPN connects Cloud Run brain to Mac Mini
- TailscaleEmbedder variant added to brain embedder chain
- HashEmbedder fallback on unreachable endpoint
- 3-week migration plan for 10K existing memories

Expected: 7x semantic info per embedding, NDCG@10 0.3→0.85,
$0/month cost (Tailscale free, Mac Mini already on), 50ms per embed
(acceptable on write path).

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-04-14 17:47:44 -04:00
Reuven
7ded427ec9 Merge branch 'main' of https://github.com/ruvnet/RuVector 2026-04-14 17:43:46 -04:00
Reuven
56b664ac3b fix(brain): disable early-exit heuristic — broken for normalized vectors
After L2 pre-normalization, the partial-dot early-exit rejected nearly
every edge (graph collapsed from 38M to 81 edges at 10K memories).

The early-exit assumed partial_dot_32 >= threshold_0.5 for real matches,
but for unit-normalized 128-dim vectors, partial dot on 25% of dims
contributes only ~25% of the full cosine, not ~50%.

The full cosine (4x unrolled, auto-vectorized) is fast enough — the
early-exit saved little compute and broke graph connectivity.

Restoring expected graph edge count.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-04-14 17:43:39 -04:00
github-actions[bot]
9ba85b5704 chore: Update NAPI-RS binaries for all platforms
Built from commit dae7a4aa4c

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2026-04-13 22:42:56 +00:00
Reuven
dae7a4aa4c Merge branch 'main' of https://github.com/ruvnet/RuVector 2026-04-13 18:38:23 -04:00
Reuven
ff70a98ec6 perf(brain): pre-normalized embeddings + gzip compression
Search-path optimization:
- normalize_embedding() L2-normalizes on write and on Firestore ingest
- cosine_similarity_normalized() is pure dot product (no norm computation)
- search_memories() normalizes query once, uses fast dot for all comparisons
- Stored memories migrated in-place during hydration

Network optimization:
- tower-http compression-gzip feature enabled
- CompressionLayer applied to all responses
- JSON compresses 5-10x, saves ~100-200ms on return path

Expected: search 771ms → ~475ms (38% improvement)
Server compute: ~67ms → ~25ms (3x via pre-normalization)
Network: ~600ms → ~450ms (25% via gzip)

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-04-13 18:38:13 -04:00
github-actions[bot]
0e612f17a0 chore: Update NAPI-RS binaries for all platforms
Built from commit 297b7278df

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2026-04-13 21:53:24 +00:00
Reuven
297b7278df fix(brain): inline cosine similarity — Docker strips simd_intrinsics
Cloud Build Dockerfile (line 85) disables ruvector-core::simd_intrinsics
for cross-compilation compatibility. Replace ruvector-core dependency
with inlined 4x unrolled cosine that auto-vectorizes to SSE/AVX/NEON.
voice.rs and symbolic.rs delegate to graph.rs single implementation.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-04-13 17:49:20 -04:00
github-actions[bot]
5071a4da54 chore: Update NAPI-RS binaries for all platforms
Built from commit 3e40ae1fa0

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2026-04-13 21:33:29 +00:00
rUv
3e40ae1fa0 perf(brain): P1-P4 optimizations — SIMD search, quality gate, batch graph, incremental LoRA (#350)
ADR-149 implementation: four independent performance optimizations
for the pi.ruv.io brain server.

P1: SIMD cosine similarity (2.5x search speedup)
  - Wire ruvector-core::simd_intrinsics::cosine_similarity_simd
    into graph.rs, voice.rs, symbolic.rs
  - NEON (Apple Silicon), AVX2/AVX-512 (Cloud Run) auto-detected
  - Add ruvector-core as dependency (default-features=false)

P2: Quality-gated search (1.7x + cleaner results)
  - Default min_quality=0.01 in search API (skip noise)
  - Add quality field to GraphNode, skip low-quality in edge building
  - Backward compatible: min_quality=0 returns everything

P3: Batch graph rebuild (10-20x faster cold start)
  - New rebuild_from_batch() processes all memories in single pass
  - Cache-friendly contiguous embedding iteration
  - Early-exit heuristic: partial dot product on first 25% of dims
  - Wired into Firestore hydration + rebuild_graph scheduler action

P4: Incremental LoRA training (143x less computation)
  - last_enhanced_trained_at watermark in PipelineState
  - Only process memories created since last training cycle
  - force_full parameter for periodic full retrains (24h)
  - Skip entirely when no new memories (most cycles)

Combined: 5x faster search, 10-20x faster startup, 143x less training.

Co-authored-by: Reuven <cohen@ruv-mac-mini.local>
2026-04-13 17:28:19 -04:00
github-actions[bot]
7fbbc51fd6 chore: Update NAPI-RS binaries for all platforms
Built from commit 793175fc5f

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2026-04-13 21:16:56 +00:00
Reuven
793175fc5f Merge branch 'main' of https://github.com/ruvnet/RuVector 2026-04-13 17:12:41 -04:00
Reuven
0e5f20b6e8 docs(adr): ADR-149 brain performance optimizations — SIMD + quality gate + batch graph + incremental LoRA
Four independent optimizations for the pi.ruv.io brain:
P1: SIMD cosine search (2.5x, 1 hour) — wire ruvector-core SIMD into brain
P2: Quality-gated search (1.7x, 30 min) — skip noise in search path
P3: Batch graph rebuild (10-20x, 1 day) — parallel construction on cold start
P4: Incremental LoRA (143x, 1 week) — only retrain on new memories

Combined: 5x faster search, 10-20x faster startup, 143x less training compute.
DiskANN deferred to 100K+ memories per ADR-148.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-04-13 17:11:20 -04:00
github-actions[bot]
ddbfee4c87 chore: Update NAPI-RS binaries for all platforms
Built from commit ee1e0b6508

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2026-04-13 20:09:40 +00:00
rUv
ee1e0b6508 feat(brain): autonomous discovery pipeline + daily gist publishing + email improvements (#349)
* docs(adr): ADR-148 brain hypothesis engine — Gemini + DiskANN + auto-experimentation

Proposes four additive capabilities for the pi.ruv.io brain:
1. Hypothesis generation via Gemini 2.5 Flash on cross-domain edges
2. Quality scoring via DiskANN + PageRank (ForwardPush sublinear)
3. Noise filtering (ingestion gate + meta-mincut on knowledge graph)
4. Self-improvement tracking (50-query benchmark suite + auto-rollback)

All feature-gated. No changes to running brain. Separate Cloud Run service
for hypothesis engine. DiskANN is fallback-only (HNSW stays primary <50K).

5-week phased implementation. ~$0.03/day Gemini cost.

Co-Authored-By: claude-flow <ruv@ruv.net>

* fix(brain): improve daily digest email — filter noise, better formatting

The daily digest was showing 10 identical "Self-reflection: training
cycle" debug entries. Now:

1. Filters out debug category memories entirely
2. Filters known noise patterns (training cycles, IEEE events, DailyMed)
3. Skips content < 50 chars (scraping artifacts)
4. Category emojis for visual scanning
5. Cleaner layout with sentence-boundary truncation
6. Better subject line: "[pi brain] 5 new discoveries today"
7. Updated header: "What the Brain Learned Today"
8. Filters auto-generated tags from display

Co-Authored-By: claude-flow <ruv@ruv.net>

* fix(brain): tune gist publishing thresholds + improve daily email

Gist publishing was never firing because thresholds were too aggressive
(set when brain had 3K memories; now has 10K+):
- MIN_NEW_INFERENCES: 10 → 3
- MIN_EVIDENCE: 1000 → 100
- MIN_STRANGE_LOOP_SCORE: 0.1 → 0.01
- MIN_PROPOSITIONS: 20 → 5
- MIN_PARETO_GROWTH: 3 → 1
- MIN_INFERENCE_CONFIDENCE: 0.70 → 0.60
- MIN_UNIQUE_CATEGORIES: 4 → 2
- strong_inferences: >= 3 → >= 1
- strong_propositions: >= 5 → >= 2
- min_interval: 3 days → 1 day

Daily email improvements:
- Filter debug/training-cycle entries from digest
- Filter known noise patterns (IEEE events, DailyMed, etc.)
- Skip content < 50 chars (scraping artifacts)
- Category emojis for visual scanning
- Cleaner subject: "[pi brain] N new discoveries today"
- Better header: "What the Brain Learned Today"
- Sentence-boundary truncation for content previews
- System font instead of monospace for readability

Co-Authored-By: claude-flow <ruv@ruv.net>

---------

Co-authored-by: Reuven <cohen@ruv-mac-mini.local>
2026-04-13 16:05:38 -04:00
github-actions[bot]
2f059c0e61 chore: Update NAPI-RS binaries for all platforms
Built from commit 876f231777

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2026-04-13 19:08:16 +00:00
rUv
876f231777 docs: add boundary-first discovery examples to README (#348)
* research(boundary-first): 17 experiments proving boundary-first detection across 11 domains

Boundary-first detection finds hidden structure changes by analyzing WHERE
correlations between measurements shift — not WHERE individual measurements
cross thresholds. This gives days-to-minutes of early warning where
traditional methods give zero.

SIMD/GPU improvements (3 crates):
- ruvector-consciousness: NEON FMA for dense matvec, KL, entropy, pairwise MI
- ruvector-solver: NEON SpMV f32/f64, wired into CsrMatrix::spmv_unchecked() hot path
- ruvector-coherence: NEON spectral spmv + dot product for Fiedler estimation

17 working experiments (all `cargo run -p <name>`):
- boundary-discovery: phase transition proof (z=-3.90)
- temporal-attractor-discovery: 3/3 regimes (z=-6.83)
- weather-boundary-discovery: 20 days before thermometer (z=-10.85)
- health-boundary-discovery: 13 days before clinical (z=-3.90)
- market-boundary-discovery: 42 days before crash (z=-3.90)
- music-boundary-discovery: genre boundaries (z=-13.01)
- brain-boundary-discovery: seizure detection 45s early (z=-32.62)
- seizure-therapeutic-sim: entrainment delays seizure 60s, alpha +252%
- seizure-clinical-report: detailed clinical output + CSV
- real-eeg-analysis: REAL CHB-MIT EEG, 235s warning (z=-2.23 optimized)
- real-eeg-multi-seizure: ALL 7 seizures detected (100%), mean 225s warning
- seti-boundary-discovery: 6/6 sub-noise signals found
- seti-exotic-signals: traditional 0/6, boundary 6/6 (z=-8.19)
- frb/cmb/void/earthquake/pandemic/infrastructure experiments

Research documents:
- docs/research/exotic-structure-discovery/ (8 documents, published to gist)
- docs/research/seizure-prediction/ (7 documents, published to dedicated gist)

Gists:
- Main: https://gist.github.com/ruvnet/1efd1af92b2d6ecd4b27c3ef8551a208
- Seizure: https://gist.github.com/ruvnet/10596316f4e29107b296568f1ff57045

Co-Authored-By: claude-flow <ruv@ruv.net>

* docs: add boundary-first discovery examples to README

17 experiments across 11 domains including real EEG seizure detection
(7/7 CHB-MIT seizures, 225s mean warning, z=-2.23 to -32.62).

Co-Authored-By: claude-flow <ruv@ruv.net>

---------

Co-authored-by: Reuven <cohen@ruv-mac-mini.local>
2026-04-13 15:03:57 -04:00
github-actions[bot]
8b096ea25d chore: Update NAPI-RS binaries for all platforms
Built from commit 325d0e8cde

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2026-04-13 16:06:50 +00:00
rUv
325d0e8cde research(boundary-first): 17 experiments proving boundary-first detection across 11 domains (#347)
Boundary-first detection finds hidden structure changes by analyzing WHERE
correlations between measurements shift — not WHERE individual measurements
cross thresholds. This gives days-to-minutes of early warning where
traditional methods give zero.

SIMD/GPU improvements (3 crates):
- ruvector-consciousness: NEON FMA for dense matvec, KL, entropy, pairwise MI
- ruvector-solver: NEON SpMV f32/f64, wired into CsrMatrix::spmv_unchecked() hot path
- ruvector-coherence: NEON spectral spmv + dot product for Fiedler estimation

17 working experiments (all `cargo run -p <name>`):
- boundary-discovery: phase transition proof (z=-3.90)
- temporal-attractor-discovery: 3/3 regimes (z=-6.83)
- weather-boundary-discovery: 20 days before thermometer (z=-10.85)
- health-boundary-discovery: 13 days before clinical (z=-3.90)
- market-boundary-discovery: 42 days before crash (z=-3.90)
- music-boundary-discovery: genre boundaries (z=-13.01)
- brain-boundary-discovery: seizure detection 45s early (z=-32.62)
- seizure-therapeutic-sim: entrainment delays seizure 60s, alpha +252%
- seizure-clinical-report: detailed clinical output + CSV
- real-eeg-analysis: REAL CHB-MIT EEG, 235s warning (z=-2.23 optimized)
- real-eeg-multi-seizure: ALL 7 seizures detected (100%), mean 225s warning
- seti-boundary-discovery: 6/6 sub-noise signals found
- seti-exotic-signals: traditional 0/6, boundary 6/6 (z=-8.19)
- frb/cmb/void/earthquake/pandemic/infrastructure experiments

Research documents:
- docs/research/exotic-structure-discovery/ (8 documents, published to gist)
- docs/research/seizure-prediction/ (7 documents, published to dedicated gist)

Gists:
- Main: https://gist.github.com/ruvnet/1efd1af92b2d6ecd4b27c3ef8551a208
- Seizure: https://gist.github.com/ruvnet/10596316f4e29107b296568f1ff57045

Co-authored-by: Reuven <cohen@ruv-mac-mini.local>
2026-04-13 12:01:47 -04:00
BAS-More
c6579f6eed security: add npm overrides for vulnerable transitive dependencies
Pins node-forge>=1.4.0, flatted>=3.3.3, picomatch>=4.0.3,
lodash>=4.17.22, brace-expansion>=2.0.2 via package.json overrides
to resolve Dependabot alerts downstream in BAS-More/RuView.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-04-13 15:42:02 +10:00
JLMA-Agentic-Ai
2861f4651e fix(esm): add .js extensions to dist module specifiers for Node.js ESM compatibility
Node.js ESM resolution requires explicit file extensions in relative imports.
The bare `./index`, `./dag`, and `./storage` specifiers in src/index.ts and
src/node.ts cause ERR_MODULE_NOT_FOUND when the package is consumed from an
ESM context with `"type": "module"`.

Fixes: https://github.com/ruvnet/ruvector/issues (reported via @nwj patch-package workaround)
2026-04-10 16:39:45 +00:00
github-actions[bot]
608704fde8 chore: Update NAPI-RS binaries for all platforms
Built from commit 76679927c8

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2026-04-08 18:33:55 +00:00
rUv
76679927c8 research(kv-cache): TriAttention + TurboQuant stacked compression analysis (#342)
Add deep research into three-axis KV cache compression:
- TriAttention (arXiv:2604.04921): trigonometric RoPE-based token sparsity, 10.7x
- Stacked compression: TriAttention × TurboQuant for ~50x KV reduction
- ADR-147: formal architecture decision with GOAP implementation plan

No published work combines these orthogonal methods. First-mover opportunity
for ruvLLM edge inference (128K context in 175MB on Pi 5).

Co-authored-by: Reuven <cohen@ruv-mac-mini.local>
2026-04-08 13:29:16 -05:00
github-actions[bot]
7f547676a0 chore: Update NAPI-RS binaries for all platforms
Built from commit 23684ed1b9

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2026-04-08 17:28:26 +00:00
rUv
23684ed1b9 feat(musica): structure-first audio separation via dynamic mincut (#337)
* feat(musica): structure-first audio separation via dynamic mincut

Complete audio source separation system using graph partitioning instead
of traditional frequency-first DSP. 34 tests pass, all benchmarks validated.

Modules:
- stft: Zero-dep radix-2 FFT with Hann window and overlap-add ISTFT
- lanczos: SIMD-optimized sparse Lanczos eigensolver for graph Laplacians
- audio_graph: Weighted graph construction (spectral, temporal, harmonic, phase edges)
- separator: Spectral clustering via Fiedler vector + mincut refinement
- hearing_aid: Binaural streaming enhancer (<0.13ms latency, <8ms budget PASS)
- multitrack: 6-stem separator (vocals/bass/drums/guitar/piano/other)
- crowd: Distributed speaker identity tracker (hierarchical sensor fusion)
- wav: 16/24-bit PCM WAV I/O with binaural test generation
- benchmark: SDR/SIR/SAR evaluation with comparison baselines

Key results:
- Hearing aid: 0.09ms avg latency (87x margin under 8ms budget)
- Lanczos: Clean Fiedler cluster split in 4 iterations (16us)
- Multitrack: Perfect mask normalization (0.0000 sum error)
- WAV roundtrip: 0.000046 max quantization error

https://claude.ai/code/session_015KxNFsV5GQjQn6u9HbS9MK

* refactor(musica/crowd): use DynamicGraph for local + global graphs

Agent-improved crowd tracker using Gaussian-kernel similarity edges,
dense Laplacian spectral bipartition, and exponential moving average
embedding merging. All 34 tests pass.

https://claude.ai/code/session_015KxNFsV5GQjQn6u9HbS9MK

* enhance(musica/lanczos): add batch_lanczos with cross-frame alignment

Adds batch processing mode for computing eigenpairs across multiple
STFT windows with automatic Procrustes sign alignment between frames.

https://claude.ai/code/session_015KxNFsV5GQjQn6u9HbS9MK

* enhance(musica/hearing_aid): improve binaural pipeline with mincut refinement

Agent-enhanced hearing aid module adds dynamic mincut boundary refinement
via MinCutBuilder, temporal coherence bias, and improved speech scoring.

https://claude.ai/code/session_015KxNFsV5GQjQn6u9HbS9MK

* docs(musica): comprehensive README with benchmarks and competitive analysis

Detailed documentation covering all 9 modules, usage examples, benchmark
results, competitive positioning vs SOTA, and improvement roadmap.

https://claude.ai/code/session_015KxNFsV5GQjQn6u9HbS9MK

* feat(musica): add 6 enhancement modules — 55 tests passing

New modules:
- multi_res: Multi-resolution STFT (short/medium/long windows per band)
- phase: Griffin-Lim iterative phase estimation
- neural_refine: Tiny 2-layer MLP mask refinement (<100K params)
- adaptive: Grid/random/Bayesian graph parameter optimization
- streaming_multi: Frame-by-frame streaming 6-stem separation
- wasm_bridge: C-FFI WASM interface for browser deployment

https://claude.ai/code/session_015KxNFsV5GQjQn6u9HbS9MK

* feat(musica/wasm): add browser demo with drag-and-drop separation UI

Self-contained HTML+CSS+JS demo for WASM-based audio separation.
Dark theme, waveform visualization, Web Audio playback.

https://claude.ai/code/session_015KxNFsV5GQjQn6u9HbS9MK

* feat(musica): HEARmusica — Rust hearing aid DSP framework (Tympan port)

Complete hearing aid processing pipeline with 10 DSP blocks:
- BiquadFilter: 8 filter types (LP/HP/BP/notch/allpass/peaking/shelves)
- WDRCompressor: Multi-band WDRC with soft knee + attack/release
- FeedbackCanceller: NLMS adaptive filter
- GainProcessor: Audiogram fitting + NAL-R prescription
- GraphSeparatorBlock: Fiedler vector + dynamic mincut (novel)
- DelayLine: Sample-accurate circular buffer
- Limiter: Brick-wall output protection
- Mixer: Weighted signal combination
- Pipeline: Sequential block runner with latency tracking
- 4 preset configs: standard, speech-in-noise, music, max-clarity

ADR-143 documents architecture decisions.
87 tests passing.

https://claude.ai/code/session_015KxNFsV5GQjQn6u9HbS9MK

* feat(musica): 8-part benchmark suite + HEARmusica pipeline benchmarks

Part 7: HEARmusica pipeline — 4 presets benchmarked (0.01-0.75ms per block)
Part 8: Streaming 6-stem separation (0.35ms avg, 0.68ms max)
Updated README with benchmark results and 87-test / 11K-line stats.

https://claude.ai/code/session_015KxNFsV5GQjQn6u9HbS9MK

* feat(musica): add enhanced separator, evaluation module, and adaptive tuning

Complete the remaining optimization modules:
- enhanced_separator.rs: multi-res STFT + neural mask refinement pipeline with comparison report
- evaluation.rs: realistic audio signal generation (speech, drums, bass, noise) and full BSS metrics (SDR/SIR/SAR)
- Adaptive parameter tuning benchmark (Part 9) with random search
- Enhanced separator comparison (Part 10) across 4 modes
- Real audio evaluation (Part 11) across 4 scenarios
- WASM build verification script

100 tests passing, 11-part benchmark suite validated.

https://claude.ai/code/session_015KxNFsV5GQjQn6u9HbS9MK

* feat(musica): add candle-whisper transcription integration (ADR-144)

Pure-Rust speech transcription pipeline using candle-whisper:
- ADR-144: documents candle-whisper choice over whisper-rs (pure Rust, no C++ deps)
- transcriber.rs: Whisper pipeline with feature-gated candle deps, simulated
  transcriber for offline benchmarking, SNR-based WER estimation, resampling
- Part 12 benchmark: before/after separation quality for transcription
  across 3 scenarios (two speakers, speech+noise, cocktail party)
- 109 tests passing, 12-part benchmark suite validated

Enable with: cargo build --features transcribe

https://claude.ai/code/session_015KxNFsV5GQjQn6u9HbS9MK

* feat(musica): add real audio evaluation with public domain WAV files

- real_audio.rs: loads ESC-50, Signalogic speech, SampleLib music WAVs
- 6 real-world separation scenarios: speech+rain, male+female,
  music+crowd, birds+bells, speech+dog, speech+music
- Automatic resampling, mono mixing, SNR-controlled signal mixing
- Part 13 benchmark with per-scenario SDR measurement
- Download script (scripts/download_test_audio.sh) for test audio
- .gitignore for test_audio/ binary files
- 115 tests passing, 13-part benchmark suite

https://claude.ai/code/session_015KxNFsV5GQjQn6u9HbS9MK

* perf(musica): optimize critical hot loops across 5 modules

Profiler-guided optimizations targeting 2-3x cumulative speedup:
- stft.rs: reuse FFT buffers across frames (eliminates per-frame allocation)
- audio_graph.rs: cache frame base indices, precompute harmonic bounds
- separator.rs: K-means early stopping on convergence (saves ~15 iterations)
- lanczos.rs: selective reorthogonalization (full every 5 iters, partial otherwise)
- neural_refine.rs: manual loop for auto-vectorizable matrix multiply

115 tests passing.

https://claude.ai/code/session_015KxNFsV5GQjQn6u9HbS9MK

* feat(musica): add advanced SOTA separator with Wiener filtering, cascaded refinement, and multi-resolution fusion

Implements three techniques to push separation quality toward SOTA:
- Wiener filter mask refinement (M_s = |S_s|^p / sum_k |S_k|^p)
- Cascaded separation with iterative residual re-separation and decaying alpha blend
- Multi-resolution graph fusion across 256/512/1024 STFT windows
Part 14 benchmark compares basic vs advanced on 3 scenarios.

https://claude.ai/code/session_015KxNFsV5GQjQn6u9HbS9MK

* fix(musica): adaptive quality selection in advanced separator

Add permutation-invariant SDR evaluation, source alignment via
cross-correlation for multi-resolution fusion, and composite quality
metric (independence + reconstruction accuracy) for adaptive pipeline
selection. Advanced now consistently matches or beats basic: +3.0 dB
on well-separated, +1.5 dB on harmonic+noise.

https://claude.ai/code/session_015KxNFsV5GQjQn6u9HbS9MK

* feat(musica): add instantaneous frequency graph edges for close-tone separation

Add IF-based temporal edge weighting and cross-frequency IF edges.
Instantaneous frequency = phase advance rate across STFT frames.
Bins tracking the same sinusoidal component get stronger edges,
improving separation of close tones (400Hz+600Hz: +0.3 → +2.3 dB).

https://claude.ai/code/session_015KxNFsV5GQjQn6u9HbS9MK

* refactor(musica): best-of-resolutions strategy replaces lossy mask interpolation

Instead of interpolating masks between STFT resolutions (which
introduces artifacts), try each window size independently with
Wiener refinement, then pick the best by composite quality score.
Well-separated tones: +4.7 → +18.1 dB (+13.4 dB improvement).

https://claude.ai/code/session_015KxNFsV5GQjQn6u9HbS9MK

* feat(musica): multi-exponent Wiener search and energy-balanced quality metric

Try Wiener exponents 1.5/2.0/3.0 per resolution for broader search.
Add energy balance to quality score (penalizes degenerate partitions).
Close tones: consistently +1.4-1.8 dB over basic. 121 tests pass.

https://claude.ai/code/session_015KxNFsV5GQjQn6u9HbS9MK

* feat(musica): SOTA push — 8 major improvements across all modules

Quick wins:
- 8-bit and 32-bit WAV support in wav.rs (ESC-50 noise files now load)
- SDR variance reduction: seeded Fiedler init with 100 iterations

Core separation improvements:
- Multi-eigenvector spectral embedding: Lanczos k>2 eigenvectors
  with spectral k-means for multi-source separation
- Onset/transient detection edges: spectral flux onset detector
  groups co-onset bins for better drum/percussion separation
- Spatial covariance model: IPD/ILD-based stereo separation
  with far-field spatial model for binaural hearing aids

Research & benchmarking:
- Learned graph weights via Nelder-Mead simplex optimization
- MUSDB18 SOTA comparison framework with published results
  (Open-Unmix, Demucs, HTDemucs, BSRNN)
- Longer signal benchmarks (2-5s realistic duration)

Parts 15-17 added to benchmark suite. 131 tests pass.

https://claude.ai/code/session_015KxNFsV5GQjQn6u9HbS9MK

* feat(musica): terminal visualizer, weight optimization, multi-source separation

Add Part 18-20 to benchmark suite:
- Terminal audio visualizer (waveform, spectrum, masks, Lissajous, separation comparison)
  using ANSI escape codes and Unicode block characters, zero dependencies
- Nelder-Mead weight optimization benchmark with 3 training scenarios
- Multi-source (3+4 source) separation benchmark with permutation-invariant SDR
- Public evaluate_params wrapper for learned_weights module

276 tests passing (139 lib + 137 bin).

https://claude.ai/code/session_015KxNFsV5GQjQn6u9HbS9MK

* feat(musica): STFT padding, Lanczos batch improvements, WASM bridge cleanup

Improve STFT module with proper zero-padding and power-of-two FFT sizing.
Refactor Lanczos resampler batch processing and WASM bridge for clarity.
Clean up react_memo_cache_sentinel research files.

Co-Authored-By: claude-flow <ruv@ruv.net>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Reuven <cohen@ruv-mac-mini.local>
2026-04-08 12:23:48 -05:00
github-actions[bot]
f24e6de568 chore: Update NAPI-RS binaries for all platforms
Built from commit d6083e98b7

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2026-04-07 02:25:46 +00:00
github-actions[bot]
d1520a71d9 chore: Update NAPI-RS binaries for all platforms
Built from commit 849356378a

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2026-04-07 02:22:47 +00:00
Reuven
d6083e98b7 docs(adr): ADR-144 DiskANN/Vamana implementation design + benchmarks
Algorithm details, optimization rationale, package architecture,
performance results (55µs search, 0.998 recall), and HNSW comparison.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-04-06 22:18:43 -04:00
Reuven
849356378a feat(ruvector): integrate @ruvector/diskann as optional peerDep
- diskann-wrapper.ts: lazy-load wrapper with type conversion
- Re-export DiskAnnIndex from core/index.ts
- Add @ruvector/diskann as optional peerDependency
- Update ADR-143: DiskANN fully implemented (not removed)

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-04-06 22:16:06 -04:00
github-actions[bot]
37e05ee4bf chore: Update attention NAPI-RS binaries for all platforms
Built from commit 54f56e3216

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc
  - wasm

  🤖 Generated by GitHub Actions
2026-04-07 01:54:23 +00:00