Commit graph

1971 commits

Author SHA1 Message Date
Claude
bdadbbd690 feat: update ADR-093 + add deploy_trainer.sh for Cloud Run scheduling
https://claude.ai/code/session_01UWE22wnsZRSHKhT4h4Axby
2026-03-16 23:14:43 -04:00
Claude
63c23a623f feat: discovery data from 4 domains + trainer Dockerfile
Live discoveries from NASA, USGS, NOAA, arXiv, OpenAlex, World Bank,
CoinGecko across space, earth, academic, and economics domains.
Dockerfile for the daily brain training Cloud Run job.

https://claude.ai/code/session_01UWE22wnsZRSHKhT4h4Axby
2026-03-16 23:14:43 -04:00
Claude
915fff80c5 feat: ADR-093 daily discovery brain training + cloudbuild config
Adds architecture decision record for the daily discovery & brain training
program and Cloud Build configuration for the trainer job container.

https://claude.ai/code/session_01UWE22wnsZRSHKhT4h4Axby
2026-03-16 23:14:43 -04:00
Claude
78558f547e feat: add brain training and status scripts for pi.ruv.io
Scripts to push discovery findings to the shared brain API and check status.

https://claude.ai/code/session_01UWE22wnsZRSHKhT4h4Axby
2026-03-16 23:14:43 -04:00
Claude
9983d09283 feat: deep discovery analyses + brain MCP training integration
Add 4 new graph-cut examples analyzing real public datasets:
- seismic_risk.rs: Gutenberg-Richter b-value anomaly detection per grid cell
- climate_tipping.rs: multi-resolution cross-scale regime change detection
- habitability_bias.rs: exoplanet habitability scoring + discovery-method bias
- brain_training_integration.rs: feeds discoveries into π.ruv.io SONA training

Fix brain MCP server: wire 7 missing AGI tool dispatches (brain_train,
brain_agi_status, brain_sona_stats, brain_temporal, brain_explore,
brain_midstream, brain_flags) into handle_mcp_tool_call.

https://claude.ai/code/session_01UWE22wnsZRSHKhT4h4Axby
2026-03-16 23:14:43 -04:00
Claude
f36bfade5a feat: real-data discovery pipeline across 3 public datasets
Analyze real NASA, USGS, and NOAA data using graph-cut anomaly detection:
- Exoplanets: flagged VHS J1256b (5085 Mearth direct-imaging outlier),
  CFHTWIR-Oph 98b (wide-orbit giant), Kepler-1704b (e=0.92 eccentric)
- Earthquakes: detected Tonga deep swarm (51 events, avg depth 546km),
  M7.1 Malaysia deep quake (620km), M6.0 Italy deep event (382km)
- Climate: 2010-2026 warming rate +0.385C/decade (2x faster than 1970-1990),
  2025 is warmest year at +1.31C anomaly

https://claude.ai/code/session_01UWE22wnsZRSHKhT4h4Axby
2026-03-16 23:14:43 -04:00
Claude
1b09c44a9b feat: QAOA quantum graph-cut solver via ruQu
New example qaoa_graphcut.rs demonstrates quantum-classical hybrid
graph-cut solving using ruQu's QAOA MaxCut implementation as an
alternative to the classical Edmonds-Karp mincut solver.

- 3 test cases: 1D chains (8, 10 nodes) and 2D grid (3x4)
- Encodes graph-cut as MaxCut with source/sink auxiliary nodes
- Compares QAOA vs classical: energy, quality ratio, F1
- Convergence analysis sweeping QAOA depth p=1-5
- 340 lines, self-contained

https://claude.ai/code/session_01UWE22wnsZRSHKhT4h4Axby
2026-03-16 23:14:43 -04:00
Claude
0c5e9d9ffc docs: update ADR-040/040b with recent enhancements
ADR-040: Add implementation status table covering QAOA solver,
Kepler's law, log BLS grid, multi-duration search, iterative
refinement, and OGLE/MOA manifest. 499 lines.

ADR-040b: Add QAOA cross-domain enhancement reference.

https://claude.ai/code/session_01UWE22wnsZRSHKhT4h4Axby
2026-03-16 23:14:43 -04:00
Claude
7397abdac9 feat: Kepler's 3rd law, seeded orbits, log BLS grid, multi-duration search
PlanetDashboard: semi-major axis uses a=P^(2/3) instead of P/30,
orbit eccentricity/inclination derived from candidate name hash
for deterministic reproducibility.

planet_detection: 400 log-spaced trial periods for uniform sensitivity,
5 trial transit durations (0.01-0.035) instead of single 0.02 duty cycle.

https://claude.ai/code/session_01UWE22wnsZRSHKhT4h4Axby
2026-03-16 23:14:43 -04:00
Claude
6295b3fa20 refactor: trim ADR-040 to 493 lines, enhance real_microlensing adapter
ADR-040: Replace extracted dashboard and microlensing sections with
cross-references to ADR-040a and ADR-040b. Condense data model,
adapters, and constructs. Core pipeline content preserved.

real_microlensing: Add download manifest with 12 real OGLE/MOA events
(8 confirmed planets), cross-survey normalization, enhanced MOA parser,
simulated download from published parameters.

https://claude.ai/code/session_01UWE22wnsZRSHKhT4h4Axby
2026-03-16 23:14:43 -04:00
Claude
847ca8fdc9 docs: ADR-040 sub-splits and real_microlensing doc cleanup
- Split ADR-040 into sub-ADRs: 040a (dashboard), 040b (microlensing/cross-domain)
- Clean up real_microlensing.rs documentation header

https://claude.ai/code/session_01UWE22wnsZRSHKhT4h4Axby
2026-03-16 23:14:43 -04:00
Claude
fd2e160e88 fix: XSS sanitization, sort comparator, iterative cut refinement
- PlanetDashboard: add escapeHtml() for API data in innerHTML (XSS fix),
  extend string column set for proper sort ordering
- exomoon_graphcut: 3-iteration mincut with lambda boost/decay
  (F1 improved 0.261 → 0.308, +18%)
- planet_detection: document synthetic embedding limitation

https://claude.ai/code/session_01UWE22wnsZRSHKhT4h4Axby
2026-03-16 23:14:43 -04:00
Claude
32b442c822 feat: benchmark-driven optimization, missing dashboard components, ADR update
Benchmark results and optimizations:
- Medical: Dice 0.559-0.750 vs threshold 0.316-0.461 (+41-77%)
- Genomic: WGS sens=0.951/spec=1.000, all 4 drivers detected
- Climate: F1=0.513 vs 0.333 (+54%), precision 0.833
- Cyber: recall 0.762 vs 0.375, F1=0.400 vs 0.377
- Supply chain: precision 0.890, FPR 0.007 vs 0.014
- Financial: recall 0.800, FPR -40% vs threshold
- Exomoon: F1=0.261 (perturbative SNR limit)

Missing dashboard components (ADR-040 spec):
- MoleculeMatrix.ts: heatmap of molecule confidence for V4 Life
- CausalFlow.ts: animated particles along causal edges for V1 Atlas
- LODController.ts: boundary/topk/full level-of-detail for atlas
- DownloadProgress.ts: tier progress bars for V5 Status

ADR-040 additions:
- Microlensing pipeline (M0-M3) with MRF/mincut formulation
- Cross-domain graph-cut applications (6 verticals)
- Measured results section with benchmark data
- Rust crate structure documentation
- Additional data sources (OGLE, MOA, TCGA, CICIDS2017, etc.)

https://claude.ai/code/session_01UWE22wnsZRSHKhT4h4Axby
2026-03-16 23:14:43 -04:00
Claude
19ccb40362 fix: finalize climate_graphcut.rs from background agent
https://claude.ai/code/session_01UWE22wnsZRSHKhT4h4Axby
2026-03-16 23:14:43 -04:00
Claude
7fa36fc834 feat: add fintech, cybersecurity, and climate graph-cut examples
- Financial fraud: credit card fraud detection with 5 attack types
  (card-not-present, account takeover, card clone, synthetic, refund),
  log-normal transaction amounts, temporal chain + merchant edges
- Cybersecurity: network threat detection with 6 attack types
  (port scan, brute force, exfiltration, C2 beacon, DDoS, lateral
  movement), flow-level features, source/destination graph edges
- Climate: environmental anomaly detection on 30x40 station grid
  with 6 event types (heat wave, pollution spike, drought, ocean
  warming, cold snap, sensor fault), spatial adjacency + gradient
  weighted edges

All examples use Edmonds-Karp mincut, RVF witness chains, filtered
queries, and lineage derivation.

https://claude.ai/code/session_01UWE22wnsZRSHKhT4h4Axby
2026-03-16 23:14:43 -04:00
Claude
028f7e2cdb feat: optimize graph-cut pipelines, add supply chain anomaly detection
- Medical: adaptive local thresholding (7x7 neighborhood), 8-connected
  grid with Gaussian gradient-weighted edges
- Genomic: platform-adaptive thresholds, GC-content bias correction,
  skip-2 segment smoothing edges
- Exomoon: finer bump-fit grid (16x8 vs 11x5) for better perturbation
  sensitivity
- New: supply chain anomaly detection (logistics vertical) with 6
  disruption types, multi-tier network graph, RVF witness chain

https://claude.ai/code/session_01UWE22wnsZRSHKhT4h4Axby
2026-03-16 23:14:43 -04:00
Claude
2f93a95945 refine: streamline medical and genomic graph cut examples
Reduce both examples to under 500 lines per CLAUDE.md guidelines.
Preserve all functionality: graph cut segmentation, RVF integration,
witness chains, evaluation metrics, and cancer driver gene detection.

https://claude.ai/code/session_01UWE22wnsZRSHKhT4h4Axby
2026-03-16 23:14:43 -04:00
Claude
b735559f7a feat: add real microlensing, medical imaging, and genomic graph cut pipelines
Three new examples extending the graph cut / MRF optimization framework:

1. real_microlensing.rs — Real data analysis pipeline
   - Simulates events with parameters from published OGLE/MOA discoveries
   - OGLE-2005-BLG-390 (first cool super-Earth), MOA-2011-BLG-262 (rogue+moon candidate)
   - OGLE-2016-BLG-1195 (ice planet), MOA-2009-BLG-387 (massive planet)
   - OGLE EWS format parser for future real data ingestion
   - Correctly identifies 2 planet candidates + 1 moon candidate
   - Cross-event similarity search via RVF embeddings

2. medical_graphcut.rs — Medical imaging lesion segmentation
   - Synthetic 2D tissue with injected tumors (T1-MRI, T2-MRI, CT modalities)
   - Per-voxel feature extraction: intensity, texture, multi-scale statistics
   - Graph cut with spatial adjacency + gradient-weighted edges
   - Outperforms simple thresholding: Dice 0.44-0.59 vs 0.32-0.46
   - RVF storage with modality-filtered similarity search

3. genomic_graphcut.rs — DNA copy number variant detection
   - Synthetic chromosomes with CNV gains, losses, LOH, mutation hotspots
   - WGS (30x), WES (100x), targeted panel (500x) sequencing platforms
   - Graph cut segmentation: linear chain + RuVector similarity edges
   - Cancer driver genes (TP53, BRCA1, EGFR, MYC) detected across all platforms
   - Sensitivity 91-95%, specificity 66-97% depending on platform

All examples include RVF integration (embeddings, filtered queries, lineage,
witness chains) and demonstrate the graph cut framework's versatility across
astrophysics, medical imaging, and genomics domains.

https://claude.ai/code/session_01UWE22wnsZRSHKhT4h4Axby
2026-03-16 23:14:43 -04:00
Claude
e57d5135ff refine: improve exomoon graph cut pipeline detection quality
Key improvements to the exomoon detection pipeline:

PSPL Fitting:
- Extract pspl_chi2_at() helper for reuse
- Add fine refinement pass (±1 unit, 0.2 step) around coarse grid best
- Better parameter recovery for all geometric parameters

Lambda Computation:
- Three complementary statistics: excess chi2, runs test coherence, Gaussian bump fit
- Excess chi2 normalized against event's global reduced chi2 (not theoretical)
- Differential lambda: compare each window to its tau-neighbors, producing
  z-scores that are ~0 for uniform fit quality and positive for localized anomalies
- This key change prevents the cut from labeling entire peak regions as moon

Detection Criteria:
- J-score from lambda_sum with per-window penalty (replacing BIC formalism)
- Fragility bootstrap for support stability
- Support fraction bounded (2-50%) for localization

Embeddings:
- Fixed residual computation to use fitted F_s * A(u) + F_b model
- Injection bank labels based on positive local evidence (not just geometry)
- Bank size increased to 60 events for better prior calibration

Current metrics: P=25%, R=25%, F1=0.25 on 30 synthetic events.
Detection quality is limited by the perturbative Chang-Refsdal
approximation — production requires a full polynomial lens solver,
as noted in the user's formulation.

https://claude.ai/code/session_01UWE22wnsZRSHKhT4h4Axby
2026-03-16 23:14:43 -04:00
Claude
69a318e375 feat: add exomoon detection via graph cut / MRF optimization
Implements full s-t mincut pipeline for exomoon detection:
- Binary lens (Chang-Refsdal perturbation) magnification model
- PSPL grid search with linear F_s/F_b regression
- Per-window lambda_i scoring with Occam penalty
- RuVector retrieval prior from injection bank
- Temporal chain + kNN pairwise edges for MRF graph
- Edmonds-Karp BFS max-flow / min-cut solver
- Global BIC + fragility J-score decision rule
- MOA-II and OGLE-IV survey cadence adapters
- RVF integration with witness chains and metadata

https://claude.ai/code/session_01UWE22wnsZRSHKhT4h4Axby
2026-03-16 23:14:43 -04:00
Claude
b08514bf58 fix: correct metadata field_id type to u16, register microlensing example
- Change FIELD_* constants from u32 to u16 to match MetadataEntry.field_id type
- Add microlensing_detection example to Cargo.toml

https://claude.ai/code/session_01UWE22wnsZRSHKhT4h4Axby
2026-03-16 23:14:43 -04:00
Claude
538755765c fix: planet finder review fixes + add microlensing detection pipeline
Review fixes:
- Fix XSS vulnerability in PlanetDashboard.ts (sanitize innerHTML with API data)
- Fix SNR variance calculation in planet_detection.rs (use out-of-transit only)
- Fix sort comparator for string columns in PlanetDashboard.ts
- Fix material/texture memory leaks in PlanetSystem3D.ts (dispose on clearSystem/destroy)
- Fix camera auto-rotate drift by storing intended radius
- Use Kepler's third law for semi-major axis calculation
- Seed orbit eccentricity/inclination from candidate ID for reproducibility
- Add metadata field constants (replace magic numbers)
- Document synthetic embedding limitation
- Fix ADR-040 typo ("two-machinevisu" → "two-machine")

New feature:
- Add microlensing_detection.rs example with M0-M3 pipeline for rogue planet
  and exomoon candidate detection using synthetic OGLE/MOA-style light curves
  with Paczynski PSPL fitting, residual anomaly detection, and coherence gating

https://claude.ai/code/session_01UWE22wnsZRSHKhT4h4Axby
2026-03-16 23:14:42 -04:00
github-actions[bot]
dd8f7570ec chore: Update NAPI-RS binaries for all platforms
Built from commit f4a6aae523

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

  🤖 Generated by GitHub Actions
2026-03-16 15:51:55 +00:00
rUv
f4a6aae523 feat(ruvector-core): add OnnxEmbedding for real semantic embeddings (#265)
Add native ONNX Runtime integration for production-ready semantic embeddings.

## New Features
- `OnnxEmbedding` struct with `from_pretrained()` and `from_files()` methods
- Feature flag: `onnx-embeddings` (optional, not default)
- Auto-downloads models from HuggingFace Hub (~90MB for all-MiniLM-L6-v2)
- Supports sentence-transformers, BGE, E5 model families
- Thread-safe inference via RwLock<Session>
- Mean pooling and L2 normalization for sentence transformers

## Dependencies (optional)
- ort 2.0.0-rc.9 (ONNX Runtime)
- tokenizers 0.20 (HuggingFace tokenizers)
- hf-hub 0.3 (model downloads)

## Documentation
- Updated ADR-114 with implementation details
- Updated lib.rs deprecation warning to reference OnnxEmbedding

Closes #263

Co-authored-by: Reuven <cohen@ruv-mac-mini.local>
2026-03-16 11:46:47 -04:00
github-actions[bot]
c88c785097 chore: Update NAPI-RS binaries for all platforms
Built from commit aaea9ee242

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

  🤖 Generated by GitHub Actions
2026-03-16 14:09:06 +00:00
rUv
aaea9ee242 feat(rvAgent): Complete DeepAgents Rust Conversion (ADR-093 → ADR-103) (#262)
* feat: ADR-093 through ADR-102 — DeepAgents complete Rust conversion planning

10 Architecture Decision Records for 100% fidelity port of
langchain-ai/deepagents (Python) to Rust within the RuVector workspace:

- ADR-093: Master overview and architecture mapping
- ADR-094: Backend protocol traits and 5 implementations
- ADR-095: Middleware pipeline with 9 middleware types
- ADR-096: Tool system with 8 tool implementations
- ADR-097: SubAgent orchestration and state isolation
- ADR-098: Memory, Skills & Summarization middleware
- ADR-099: CLI (ratatui) & ACP server (axum) conversion
- ADR-100: RVF integration and 9-crate workspace structure
- ADR-101: Testing strategy with 80+ test file mappings
- ADR-102: 10-phase, 20-week implementation roadmap (~26k LoC)

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* feat: ADR-103 review amendments + security audit for DeepAgents conversion

Synthesizes findings from three parallel review agents:
- Performance: 25 findings (7 P0) — typed AgentState, parallel tools, arena allocators
- RVF Capability: 17 integration points — witness chains, SONA, HNSW, COW state
- Security: 30 findings (5 Critical) — TOCTOU, shell hardening, prompt injection

Key amendments: typed AgentState replaces HashMap<String,Value>, parallel tool
execution via JoinSet, atomic path resolution, env sanitization, ACP auth,
witness chain middleware, resource budget enforcement, SONA adaptive learning.

Timeline extended from 20 to 22 weeks with new Phase 11 (Adaptive).

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* feat: rvAgent scaffold — 8 crates with initial source files (swarm WIP)

Rebrand DeepAgents to rvAgent under crates/rvAgent/ subfolder.
15-agent swarm implementing in parallel:
- rvagent-core: typed AgentState, config, models, graph, messages
- rvagent-backends: protocol, filesystem, shell, composite, state, unicode security
- rvagent-middleware: pipeline with 11 middlewares
- rvagent-tools: 9 tools with enum dispatch
- rvagent-subagents: spec, builder, orchestration
- rvagent-cli: TUI terminal agent
- rvagent-acp: ACP server with auth
- rvagent-wasm: WASM bindings

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* feat(rvAgent): 82 source files from 15-agent swarm — core + backends + middleware + tools + CLI + ACP + WASM

Swarm progress:
- rvagent-core: 12 src files (state, config, graph, messages, models, arena, parallel, metrics, string_pool, prompt, error)
- rvagent-backends: 8 src files (protocol, filesystem, shell, composite, state, utils, unicode_security, security)
- rvagent-middleware: 12 src files (lib, todolist, filesystem, subagents, summarization, memory, skills, patch_tool_calls, prompt_caching, hitl, tool_sanitizer, witness, utils)
- rvagent-tools: 10 src files (lib, ls, read_file, write_file, edit_file, glob, grep, execute, write_todos, task)
- rvagent-subagents: 5 src files (lib, builder, prompts, orchestrator, validator)
- rvagent-cli: 6 src files (main, app, session, tui, display, mcp)
- rvagent-acp: 6 src files (main, server, auth, agent, types, lib)
- rvagent-wasm: 4 src files (lib, backends, tools, bridge)
- Tests: 14 test files across crates
- Benchmarks: 4 criterion bench files

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* feat(rvAgent): additional files from swarm agents — store backend, model fixes, bench updates

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* feat(rvAgent): test suites + security tests + tool refinements from swarm

- 38 unit/integration tests for core+backends (all passing)
- Security test suite for backends
- Tool bench and lib refinements

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* fix(rvAgent): agent refinements — ACP server, backend bench, lib exports

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* feat(rvAgent): core crate finalized (83 tests), tool refinements, middleware bench

- rvagent-core: 83 tests passing, typed AgentState with Arc, SystemPromptBuilder
- Tool implementations refined (ls, read, write, edit, grep, execute)
- Middleware bench updated
- ACP server refinements

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* fix(rvAgent): swarm agent refinements — auth, filesystem, prompt caching

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* feat(rvAgent): integration tests (23 passing) + agent refinements

- Core integration: 8 tests (graph flow, tool calls, parallel, COW state)
- Subagents integration: 8 tests (spawn, isolation, rate limits, parallel)
- ACP integration: 7 tests (health, auth, session lifecycle)
- CLI integration: 9 tests (help, version, session roundtrip)
- Refinements to ACP agent/types, composite backend, HITL, WASM

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* feat(rvAgent): subagents finalized (55 tests), witness middleware, composite fixes

- Subagent orchestrator with JoinSet parallel execution
- Prompt injection detector with 25 patterns across 5 categories
- Result validator with configurable limits (ADR-103 C8)
- Witness middleware, ACP server, composite backend refinements

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* feat(rvAgent): middleware tests, tool sanitizer, ACP lib, utils refinements

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* feat(rvAgent): criterion benchmarks finalized, backend lib + CLI TUI refinements

- 4 criterion benchmark suites (state, backends, tools, middleware)
- Benchmarks cover: Arc clone vs deep clone, line formatting, grep perf,
  unicode detection, tool dispatch, parallel vs sequential, middleware pipeline
- Backend lib.rs and CLI TUI refinements from remaining agents

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* feat(rvAgent): security tests, tool tests, middleware filesystem, TUI updates

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* feat(rvAgent): ACP server finalized (65 tests), tool tests, middleware subagents

- ACP: auth middleware, rate limiter, session management, 6 routes
- New read_file test suite
- Middleware subagents and CLI TUI refinements

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* feat(rvAgent): edit_file tests, CLI display + TUI refinements

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* feat(rvAgent): backends finalized (123 tests), grep/execute tests, summarization

- Backends: 94 unit + 29 integration tests, all passing
- Full security hardening: O_NOFOLLOW, env sanitization, virtual_mode=true
- Unicode security with 36 confusable pairs, BiDi detection
- New grep and execute test suites
- Summarization middleware refinements

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* fix(rvAgent): CLI TUI + tools lib refinements from agents

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* feat(rvAgent): security hardening finalized (77 tests), memory + ls refinements

- Security module: env sanitization, path validation, injection detection,
  YAML bomb protection, rate tracking, heredoc safety, tool call ID validation
- 42 backend security tests + 25 middleware security tests
- All SEC-001 through SEC-022 findings addressed
- Memory middleware and ls tool refinements

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* feat(rvAgent): middleware pipeline tests, write_file refinements

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* feat(rvAgent): CLI finalized (39 tests), edit_file refinements

- CLI: clap args, TUI with ratatui, session management with encryption
- MCP client integration stubs
- Display with markdown rendering, tool call formatting
- 11-middleware pipeline ordering per ADR-103

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* feat(rvAgent): documentation, execute tool refinement, glob_tool cleanup

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* feat(rvAgent): documentation complete, tool + middleware refinements

- README, architecture, security, API reference, getting started guides
- All docs derived from ADR-093 through ADR-103 and source code
- Middleware bench, execute tool, grep tool refinements

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* feat(rvAgent): build verified — 679 tests passing across all 8 crates

All crates compile cleanly, all tests pass:
- rvagent-core: 105 tests (state, config, graph, messages, models, arena, parallel, metrics)
- rvagent-backends: 132 tests (filesystem, shell, composite, state, store, unicode, security)
- rvagent-middleware: 55 tests (pipeline, security, summarization)
- rvagent-tools: 25 tests (dispatch, ls, read, edit, grep, execute)
- rvagent-subagents: 30 tests (compile, isolation, orchestrator, validator)
- rvagent-cli: 39 tests (args, session, display, MCP, TUI)
- rvagent-acp: 65 tests (auth, rate limit, sessions, types)
- rvagent-wasm: 34 tests (agent, backends, tools, bridge)

Fixed subagent integration test state isolation expectations.

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* feat(rvAgent): summarization middleware tests from late agent completion

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* feat(rvAgent): final test suites — orchestrator, security, summarization tests

All 15 swarm agents complete. Final integration tests:
- Orchestrator: compile, isolation, validation, injection detection, parallel spawn
- Security middleware: sanitizer, witness, skill validation, memory trust
- Summarization: compaction triggers, UUID filenames, permissions

688+ tests passing, 0 failures across all 8 crates.

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* perf(rvAgent): deep review — eliminate warnings, optimize hot paths

- Fix 19 compiler warnings across rvagent-cli and rvagent-subagents
  (dead code annotations, unused imports, unused variables)
- Optimize witness hash: pre-allocated hex buffer (no 32 intermediate Strings)
- Optimize injection detection: pre-lowercased markers (no per-call allocation)
- Add #[inline] to hot-path functions: Message::content, has_tool_calls,
  AgentState::message_count, is_image_file
- Zero warnings, 688+ tests passing across all 8 crates

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* perf(rvagent-middleware): optimize SHA3-256 hex encoding

Use pre-allocated buffer with fmt::Write instead of 32 intermediate
String allocations via iterator map/collect.

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* feat(rvAgent): add MCP tools/resources, topology routing, skills bridge

New rvagent-mcp crate (9th crate) with full MCP implementation:
- McpToolRegistry: exposes all 9 built-in tools as MCP tools
- McpResourceProvider: agent state, skills catalog, topology as resources
- TopologyRouter: hierarchical, mesh, adaptive, standalone strategies
- SkillsBridge: cross-platform skills (Claude Code + Codex compatibility)
- McpServer: JSON-RPC 2.0 request dispatch
- Transport layer: stdio, SSE, memory transports

MCP bridge middleware in rvagent-middleware for pipeline integration.

ADR-104: Architecture for MCP tools, resources, and topology routing
ADR-105: Implementation details and protocol specification

893 tests passing across all 9 crates (up from 235).
60+ new MCP/topology/stress tests including:
- Topology routing across all 4 strategies
- 100-node stress tests with churn patterns
- Property-based serde roundtrip validation
- Cross-architecture consistency tests

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* test(rvagent-mcp): update stress tests with topology and skills coverage

Add topology scaling, skills roundtrip, and resource stress tests
alongside the existing registry and protocol stress tests.

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* test(rvagent-mcp): add 96 integration tests across all topologies

Deep integration tests covering MCP protocol, topology routing
(hierarchical, mesh, adaptive, standalone), skills bridge, transport,
and cross-architecture consistency.

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* feat(rvagent-middleware): add McpToolCallOrigin for transport tracking

Adds origin tracking struct to MCP bridge middleware for identifying
which transport and client initiated each tool call.

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* Add ADR-106: RuVix kernel integration with RVF

Documents the current uni-directional dependency between ruvix and rvf,
identifies type divergence and duplicate implementations, and proposes a
shared-types bridge architecture with feature-gated integration layers.

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* feat(rvAgent): deep ADR-106 RuVix/RVF integration across all layers

Implements the shared-types bridge architecture from ADR-106:

Layer 1 (rvagent-core/rvf_bridge.rs):
- Shared wire types: RvfMountHandle, RvfComponentId, RvfVerifyStatus, WitTypeId
- RVF witness header with 64-byte wire-format serialization
- RvfManifest/RvfManifestEntry for package discovery
- MountTable for tracking mounted RVF packages
- RvfBridgeConfig integrated into RvAgentConfig

Layer 2 (rvagent-middleware/rvf_manifest.rs):
- RvfManifestMiddleware for package discovery and tool injection
- Manifest-driven tool registration (rvf:<tool_name> namespace)
- Package state injection into agent extensions
- Signature verification delegation point (rvf-crypto ready)

Layer 3 (rvagent-backends/rvf_store.rs):
- RvfStoreBackend wrapping any Backend with rvf:// path routing
- Read-only RVF package access via mount table
- Shared mount table across backend instances
- Fallthrough to inner backend for non-RVF operations

Phase 4 (rvagent-middleware/witness.rs):
- WitnessBuilder.with_rvf() for RVF wire-format witness bundles
- add_rvf_tool_call() with latency, policy check, cost tracking
- build_rvf_header() producing rvf-types-compatible WitnessHeader
- to_rvf_entries() converting to RvfToolCallEntry format
- Full backward compatibility with existing witness chain

53 new tests, all 160 tests passing.

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* perf(rvAgent): benchmark suite and optimizations for ADR-106 integration

Add Criterion benchmarks for rvf_bridge (witness header serialization,
mount table operations, manifest filtering, tool call entry serde) and
witness middleware (hash computation, builder throughput, RVF entry
conversion).

Optimizations:
- MountTable: O(1) lookups via HashMap indices by handle ID and package
  name (was O(n) linear scan). New get_by_name() method.
- compute_arguments_hash: LUT-based hex encoding (eliminates 32 write!
  calls per hash invocation)
- truncate_hash_to_8: zero-allocation inline hex decoder (was allocating
  intermediate Vec)
- RvfStoreBackend: ls_info/read_file use O(1) get_by_name instead of
  linear scan through mount table entries
- all_tools: filter entries inline instead of calling manifest.tools()
  which allocates an intermediate Vec

Benchmark results:
- Witness header wire-format roundtrip: 6.5ns (215x faster than serde JSON)
- MountTable get by handle: 12ns (O(1))
- MountTable find by name: 2.8ns (O(1))
- Hash computation (small args): 511ns
- 50 RVF entries + header build: 155µs

All 348 tests pass across rvagent-core, rvagent-backends, rvagent-middleware.

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* feat(rvAgent): implement all critical improvements — 825 tests passing

Major improvements across all 8 crates:

1. Anthropic LLM backend (rvagent-backends/src/anthropic.rs)
   - Real HTTP client calling Anthropic Messages API via reqwest
   - Message conversion between rvAgent types and API format
   - Retry with exponential backoff (3 retries on 429/500/502/503)
   - API key resolution from env vars or files

2. CLI real agent execution (rvagent-cli/src/app.rs)
   - invoke_agent() now uses AgentGraph with real model calls
   - CliToolExecutor dispatches to rvagent-tools
   - Falls back to StubModel when no API key is configured
   - System prompt integration

3. MCP stdio transport (rvagent-cli/src/mcp.rs)
   - Real subprocess spawning via tokio::process::Command
   - JSON-RPC initialize handshake and tools/list discovery
   - Real tool call execution via JSON-RPC

4. Re-enabled disabled dependencies
   - rvagent-subagents now links backends, middleware, tools
   - rvagent-acp now links all sister crates

5. AES-256-GCM session encryption (rvagent-cli/src/session.rs)
   - Real encryption replacing plaintext stub
   - V1 format backward compatibility
   - Key derivation from RVAGENT_SESSION_KEY env var

6. ACP server real prompt handling (rvagent-acp/src/agent.rs)
   - Wired to AgentGraph for real execution

7. Retry middleware (rvagent-middleware/src/retry.rs)
   - Exponential backoff with configurable retries
   - Integrates into middleware pipeline

8. Streaming support (rvagent-core/src/models.rs)
   - StreamChunk, StreamUsage types
   - StreamingChatModel trait

9. Error handling fixes
   - Poisoned mutex handling in auth.rs
   - Witness policy_hash computed from governance mode

10. Test coverage: 148 → 825 tests (+677)
    - New test files for WriteFile, WriteTodos, Glob tools
    - New tests for MCP bridge, prompt caching, HITL middleware
    - Anthropic client mock server tests

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* test(rvAgent): add live Anthropic API integration test

Skips automatically when ANTHROPIC_API_KEY is not set.
Run with: ANTHROPIC_API_KEY=sk-... cargo test -p rvagent-backends --test live_anthropic_test

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* Add RuVector V2 research series: 50-year forward vision from Cognitum.one

8 research documents exploring how the existing RuVector/rvAgent stack
extends from coherence-gated AI agents to planetary-scale infrastructure:

- 00: Master vision — the Cognitum thesis (coherence > intelligence)
- 01: Cognitive infrastructure — planetary nervous system
- 02: Autonomous systems — robotics to deep space
- 03: Scientific discovery — materials, medicine, physics
- 04: Economic systems — finance, supply chains, governance
- 05: Human augmentation — BCI, prosthetics, education
- 06: Planetary defense — climate, security, resilience
- 07: Implementation roadmap — 12-month sprint to 2075

Every claim traces to existing crates: prime-radiant, cognitum-gate-kernel,
ruvector-nervous-system, ruvector-hyperbolic-hnsw, ruvector-gnn, rvAgent,
ruqu-core, ruvector-mincut, and 90+ others.

https://claude.ai/code/session_014KXn8m21w3WDih3xpTY1Tr

* fix(ruvllm-cli): add PiQ3/PiQ2 memory estimate support

Add missing match arms for PiQ3 and PiQ2 quantization formats in
print_memory_estimates function. These pi-constant quantization formats
from ADR-090 were missing in the TargetFormat match statement.

- PiQ3: 3.0625 bits/weight (~75% of Q4_K_M storage)
- PiQ2: 2.0625 bits/weight (~50% of Q4_K_M storage)
- Add MemoryEstimate import for explicit type annotation

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

* docs: add collapsed sections to ruvllm and mcp-brain READMEs

- ruvllm: Wrap Performance, ANE, mistral-rs, LoRA, and Evaluation sections in <details>
- mcp-brain: Wrap REST API, Feature Flags, and Deployment sections in <details>
- mcp-brain: Add Quick Start section with npx ruvector brain examples

Matches root README style with progressive disclosure.

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

* feat(rvAgent): add .ruv RVF-integrated agent framework

- Add 4 specialized agent templates (queen, coder, tester, security)
- Add RVF manifest with cognitive container configuration
- Add hooks integration (pre-task, post-task, security-scan)
- Add manifest loader script for environment initialization
- Configure 3-tier model routing (WASM → Haiku → Sonnet/Opus)
- Enable SONA learning with 0.05ms adaptation threshold
- All 725 rvAgent tests passing

Agent capabilities:
- rvagent-queen: Swarm orchestration, consensus, resource allocation
- rvagent-coder: Code generation, refactoring, witness attestation
- rvagent-tester: TDD London School, coverage analysis, mock generation
- rvagent-security: AIMD threat detection, PII scanning, CVE auditing

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

* feat(rvAgent): wire AnthropicClient and enable live API calls

- Add CliModel enum to support multiple model backends (Stub, Anthropic)
- Wire AnthropicClient in app.rs for real API calls when key is available
- Add native-tls feature to reqwest for HTTPS support
- Fix request body serialization with explicit JSON stringify
- Add example demo scripts for coder, tester, security agents

Verified working:
- Code generation (Fibonacci with memoization)
- TDD test generation
- Security audit with vulnerability detection
- Architecture design

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

* feat: RuVocal UI thinking blocks + MCP brain delta fixes + rvAgent security

UI/RuVocal:
- Add thinking block collapse regex (THINK_BLOCK_REGEX) to ChatMessage.svelte
- Integrate FoundationBackground animated canvas
- Default to dark mode across app
- Update mcpExamples to RuVector/π Brain focused queries

MCP Brain Server:
- Fix brain_page_delta: add witness_hash field with server-side fallback
- Fix evidence_links: transform simple strings to EvidenceLink structs
- Add voice.rs, optimizer.rs, symbolic.rs modules
- Deploy to Cloud Run (ruvbrain-00092-npp)

rvAgent:
- Enhanced sandbox path security and restrictions
- Add unicode_security middleware
- Add CRDT merge and result validator
- Add AGI container, budget, session crypto modules
- Add swarm examples and Gemini backend
- Security tests and validation

Docs:
- ADR-107 through ADR-111
- Security docs (sandbox, session encryption)
- Implementation summaries

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

* feat(ruvocal): add WASM MCP tools with server-side virtual filesystem

- Add default WASM file tools (read_file, write_file, list_files, delete_file, edit_file)
  that are always available without client-side WASM setup
- Implement server-side in-memory virtual filesystem for tool execution
- Update toolInvocation.ts to actually execute WASM tools instead of returning placeholder
- Add hasActiveToolsSelection check for WASM tools in toolsRoute.ts
- Force MCP flow when WASM tools are present regardless of router decision
- Add WASM MCP server store with IndexedDB persistence
- Add GalleryPanel component for RVF template selection
- Clean up excessive debug logging

The WASM file tools now execute on an in-memory virtual filesystem
on the server, enabling file operations within conversations without
requiring any client-side WASM module setup.

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

* feat(ruvocal): implement complete rvAgent WASM MCP toolset

- Add full rvAgent implementation with 15 server-side tools:
  - File operations (5): read, write, list, delete, edit
  - Search tools (2): grep, glob
  - Task management (3): todo_add, todo_list, todo_complete
  - Memory tools (2): memory_store, memory_search (HNSW-indexed)
  - Witness chain (2): witness_log, witness_verify (cryptographic audit)
  - RVF Gallery (3): gallery_list, gallery_load, gallery_search

- Enhance wasm/index.ts with 8 comprehensive agent templates:
  - Development Agent: Full-featured with 8 tools and 4 skills
  - Research Agent: Memory-enhanced with HNSW search
  - Security Agent: 15 built-in security controls
  - Multi-Agent Orchestrator: CRDT-based state merging
  - SONA Learning Agent: 3-loop self-improvement
  - AGI Container Builder: SHA3-256 verified packages
  - Witness Chain Auditor: Cryptographic compliance
  - Minimal Agent: Lightweight file operations

- Each template includes tools, prompts, skills, MCP tools, and capabilities
- Witness chain provides immutable audit trail for all tool calls
- Server-side state persists across conversation turns

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

* feat(ruvocal): enhance MCP tool descriptions and sidebar sorting

- Improve all 15 WASM MCP tool descriptions with comprehensive guidance
  - Add WHEN TO USE sections for clear usage context
  - Add detailed PARAMETERS documentation with examples
  - Add RETURNS section documenting output format
  - Add EXAMPLES showing typical usage patterns
  - Add IMPORTANT notes and TIPS for edge cases

- Fix NavMenu sidebar conversation sorting
  - Sort conversations by newest first within each group (today/week/month/older)
  - Apply sorting to paginated results when loading more conversations

- Add comprehensive test suite (48 tests)
  - File operations: read, write, list, delete, edit
  - Search tools: grep, glob with pattern matching
  - Task management: todo_add, todo_list, todo_complete
  - Memory tools: memory_store, memory_search with tags
  - Witness chain: witness_log, witness_verify with hash verification
  - RVF gallery: gallery_list, gallery_load, gallery_search

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

* fix(ruvocal): improve WASM MCP tool descriptions for LLM guidance

- Add REQUIRED/OPTIONAL labels to all parameters
- Include concrete examples for every tool
- Clear parameter descriptions with expected formats
- Better guidance on when to use each tool

Tools updated:
- File ops: read_file, write_file, list_files, delete_file, edit_file
- Search: grep, glob
- Tasks: todo_add, todo_list, todo_complete
- Memory: memory_store, memory_search
- Audit: witness_log, witness_verify
- Gallery: gallery_list, gallery_load, gallery_search

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

* fix(ruvocal): add explicit parameter guidance to prevent empty tool calls

- Add TOOL PARAMETERS guidance to system prompt
  - NEVER call tools with empty {} if parameters required
  - Check inputSchema for required fields
  - Use example values as guidance

- Improve error messages with examples
  - Every validation error now includes correct usage example
  - File not found errors show available files
  - Template not found errors list available options
  - Task not found errors show available task IDs

- Updated all 15 WASM tools:
  - read_file, write_file, delete_file, edit_file
  - grep, glob
  - todo_add, todo_complete
  - memory_store, memory_search
  - witness_log
  - gallery_load, gallery_search

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

* fix(ruvocal): intercept empty tool args and auto-fill sensible defaults

- Add autoFillMissingParams() to intercept empty {} requests
- Auto-fill gallery_load with "development-agent" when id missing
- Auto-fill read_file with first available file when path missing
- Auto-fill todo_complete with first incomplete task when id missing
- Auto-fill memory_search with "*" wildcard for empty queries
- Simplify tool descriptions to ultra-concise copyable examples
- Add enum constraints for gallery template IDs
- Add additionalProperties: false to all schemas

This prevents LLM from failing on empty argument calls by providing
reasonable defaults based on available context.

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

* fix(ruvocal): add auto-fill feedback to teach LLM proper arg passing

When parameters are auto-filled, include feedback in the result:
"[AUTO-FILLED: id="development-agent". Next time pass your own values,
 e.g. gallery_load({id: "development-agent"})]"

This teaches the LLM to pass arguments correctly on subsequent calls.

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

* fix(ruvocal): use function signature format for tool descriptions

Change tool descriptions to function signature style that models
understand better:

  gallery_search(query: string) → Search templates by keyword.
  Arguments: {"query": "search_term"}
  Example: {"query": "security"}

This format:
- Shows parameter names and types in signature
- Labels the arguments JSON clearly
- Provides concrete example
- Removes verbose instructions

Also adds feedback notice when parameters are auto-filled so model
learns correct format from results.

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

* feat(ruvocal): add rvf_help guidance tool and RVF context

- Add rvf_help() tool that explains the RVF agent environment
- Supports topic filter: files, memory, tasks, witness, gallery
- Add RVF context to system prompt when WASM tools present
- Explains what "run in RVF" means
- Lists available gallery templates with descriptions

Model can now call rvf_help() first to understand capabilities.

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

* feat(ruvocal): add comprehensive system_guidance tool for all MCP tools

- Rename rvf_help to system_guidance (kept alias for compatibility)
- Documents ALL available tools including π Brain and search tools
- Filter by category: files, memory, tasks, witness, gallery, brain, search
- Get specific tool help: system_guidance({"tool": "brain_search"})
- Shows exact JSON format examples for each tool
- Includes tips on proper parameter passing

Model should call system_guidance() first when unsure about capabilities.

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

* feat(ruvocal): add system_guidance tool to WASM UI panel

- Add system_guidance as first tool in tools/list response
- Shows 🔮 emoji to make it prominent
- Supports tool and category filters
- Add handler with comprehensive documentation for all tools
- Groups by category: files, memory, tasks, gallery, witness, brain

Now visible in Available Tools panel for user guidance.

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

* feat(ruvocal): add anti-repetition rules and comprehensive tool examples

- Add CRITICAL RULES - AVOID REPETITION section to system prompt
- Add TOOL SEQUENCING patterns (list_files → read_file → analyze)
- Add AVOID THESE PATTERNS with explicit  examples
- Expand system_guidance with practical/advanced/exotic examples for each tool
- Add workflows category showing multi-tool patterns
- Improve tool documentation with required/optional parameter clarity

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

* feat(rvAgent): MCP server, WASM gallery, and RVF tools integration

rvagent-mcp:
- Add groups.rs for tool group management
- Add main.rs for standalone MCP server binary
- Update transport and integration tests

rvagent-wasm:
- Add gallery.rs for RVF app gallery support
- Add mcp.rs for MCP tool handlers
- Add rvf.rs for RuVector Format operations
- Update backends for WASM compatibility

Documentation:
- Update ADR-107 through ADR-111
- Add ADR-112: rvAgent MCP Server
- Add ADR-113: RVF App Gallery (RuVix Applications)
- Add ADR-114: RuVector Core Hash Placeholders

RuVocal:
- Add compiled WASM artifacts for browser integration

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

* fix(ruvocal): add wasmTools and autopilotMaxSteps to MessageUpdateRequestOptions

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-03-16 09:52:32 -04:00
github-actions[bot]
0d516f832e chore: Update NAPI-RS binaries for all platforms
Built from commit c88039734a

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

  🤖 Generated by GitHub Actions
2026-03-14 20:29:34 +00:00
rUv
c88039734a feat(ruvix): implement CLI, kernel shell, and PBFT consensus (#261)
* feat(ruvix): implement ADR-087 RuVix Cognition Kernel Phase A

Implements the complete Phase A (Linux-hosted) RuVix Cognition Kernel
with 9 crates, 760 tests, and comprehensive documentation.

## Core Crates (9)
- ruvix-types: 6 kernel primitives (Task, Capability, Region, Queue, Timer, Proof)
- ruvix-cap: seL4-inspired capability management with derivation trees
- ruvix-region: Memory regions (Immutable, AppendOnly, Slab policies)
- ruvix-queue: io_uring-style lock-free IPC with zero-copy semantics
- ruvix-proof: 3-tier proof engine (Reflex <100ns, Standard <100us, Deep <10ms)
- ruvix-sched: Coherence-aware scheduler with priority computation
- ruvix-boot: 5-stage RVF boot loader with ML-DSA-65 signatures
- ruvix-vecgraph: Kernel-resident vector/graph stores with HNSW
- ruvix-nucleus: Unified kernel entry point with 12 syscalls

## Security (SEC-001, SEC-002)
- Boot signature failure: PANIC immediately, no fallback path
- Proof cache: 100ms TTL, single-use nonces, max 64 entries
- Capability delegation depth: max 8 levels with audit warnings

## Architecture
- no_std compatible for Phase B bare metal port
- Proof-gated mutation: every state change requires cryptographic proof
- Capability-based access control: no syscall without valid capability
- Zero-copy IPC via region descriptors (TOCTOU protected)

## Documentation
- Main README with architecture diagrams
- Individual crate READMEs with usage examples
- Architecture decision records

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

* docs: update ADR-087 status and add RuVix to root README

- Update ADR-087 status from Proposed to Accepted (Phase A Implemented)
- Add implementation status table with all 9 crates and 760 tests
- Document security invariants implemented (SEC-001 through SEC-004)
- Add collapsed RuVix section to root README with architecture diagram

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

* chore: update ruvector-coherence dependency to 2.0.4 for crates.io publish

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

* feat(ruvix): implement ADR-087 Phase B bare metal AArch64 support

Phase B adds bare metal AArch64 support for the RuVix Cognition Kernel:

New crates:
- ruvix-hal: Hardware Abstraction Layer traits (~500 lines)
  - Console, InterruptController, Timer, Mmu, PowerManagement traits
  - Platform-agnostic design for ARM64/RISC-V/x86_64
  - 15 unit tests passing

- ruvix-aarch64: AArch64 boot and MMU support (~2,000 lines)
  - _start assembly entry, exception vectors
  - 4-level page tables with capability metadata
  - System register accessors (SCTLR_EL1, TCR_EL1, TTBR0/1)
  - Implements ruvix_hal::Mmu trait

- ruvix-drivers: Device drivers for QEMU virt (~1,500 lines)
  - PL011 UART driver (115200 8N1, FIFO, interrupts)
  - GIC-400 interrupt controller (256 IRQs, 16 priorities)
  - ARM Generic Timer (deadline scheduling)
  - Volatile MMIO with memory barriers (DMB, DSB, ISB)

Build infrastructure:
- aarch64-boot/ with linker script and custom Rust target
- QEMU virt runner integration (Cortex-A72, 128MB RAM)
- Makefile with build/run/debug targets

ADR-087 updated with:
- Phase B objectives and new crate specifications
- QEMU virt memory map (128MB RAM at 0x40000000)
- 5-stage boot sequence documentation
- Security enhancements and testing strategy
- Raspberry Pi 4/5 platform differences

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

* feat(ruvix): implement Phases C/D/E and QEMU swarm simulation

This adds full bare metal OS capabilities to the RuVix Cognition Kernel:

## Phase C: Multi-Core & DMA Support
- ruvix-smp: Symmetric multi-processing (256 cores, spinlocks, IPIs)
- ruvix-dma: DMA controller with scatter-gather
- ruvix-dtb: Device tree blob parser
- ruvix-physmem: Buddy allocator for physical memory

## Phase D: Raspberry Pi 4/5 Support
- ruvix-bcm2711: BCM2711/2712 SoC drivers (GPIO, mailbox, UART)
- ruvix-rpi-boot: RPi boot support (spin table, early UART)

## Phase E: Networking & Filesystem
- ruvix-net: Full network stack (Ethernet/ARP/IPv4/UDP/ICMP)
- ruvix-fs: Filesystem layer (VFS, FAT32, RamFS)

## QEMU Swarm Simulation
- qemu-swarm: Multi-QEMU cluster for distributed testing
- Network topologies: mesh, ring, star, tree
- Fault injection and chaos testing scenarios

## Summary
- 10 new crates, ~27,000 lines of code
- 400+ new tests passing
- ADR-087 updated with Phases C/D/E documentation
- Main README updated with all phases

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

* fix(ruvix): address critical security vulnerabilities CVE-001 through CVE-005

Security fixes applied from deep review audit:

- CVE-001 (CRITICAL): Add compile-time protection preventing
  `disable-boot-verify` feature in release builds. This closes
  a boot signature bypass vulnerability.

- CVE-002 (HIGH): Add MMIO address validation to GIC driver.
  `Gic::new()` now returns `Result<Self, GicError>` and validates
  addresses against known platform ranges. Added `new_unchecked()`
  for trusted callers.

- CVE-003 (HIGH): Add integer overflow protection in DTB parser.
  All offset calculations now use `checked_add()` to prevent
  buffer overflow via crafted DTB files.

- CVE-005 (HIGH): Add IPv4 header validation ensuring
  `total_length >= header_len` per RFC 791.

Also includes test fixes:
- Mark hardware-dependent tests as `#[ignore]` (MMIO, ARM timer)
- Fix swap32 test assertion in rpi-boot
- Update doctests for new GIC API

All 259 tests pass across affected crates.

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

* feat(ruvix): implement CLI, kernel shell, and PBFT consensus

Implements Phase F features for the RuVix Cognition Kernel:

CLI (ruvix-cli):
- build: Cross-compile kernel for AArch64 targets
- config: Manage kernel configuration files
- dtb: Device tree blob operations (validate, dump, compile, compare, search)
- flash: UART/serial flash operations with progress reporting
- keys: Ed25519 key management with secure storage
- monitor: Real-time kernel metrics dashboard
- security: Security audit and vulnerability scanning

Kernel Shell (ruvix-shell):
- Interactive command parser with history support
- Commands: help, info, mem, tasks, caps, vectors, witness, proofs,
  queues, perf, cpu, trace, reboot
- Configurable prompt with trace mode indication
- Shell backend integration with nucleus kernel

PBFT Consensus (qemu-swarm):
- Full PBFT implementation (pre-prepare, prepare, commit phases)
- View change protocol for leader recovery
- Checkpoint mechanism for state synchronization
- Custom serde wrappers for fixed-size byte arrays (Signature, HashDigest)
- Byzantine fault tolerance (f < n/3)

Additional:
- Example RVF swarm consensus demo
- Nucleus shell backend for kernel introspection
- Fixed chrono DateTime type annotation in keys.rs

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

* chore(ruvix): add version specs for crates.io publishing

- Add version = "0.1.0" to ruvix-dtb dependency in CLI
- Add README.md for ruvix-shell crate

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

---------

Co-authored-by: Reuven <cohen@ruv-mac-mini.local>
2026-03-14 16:25:03 -04:00
github-actions[bot]
6c95e75177 chore: Update NAPI-RS binaries for all platforms
Built from commit 2606f6fb3f

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

  🤖 Generated by GitHub Actions
2026-03-13 17:26:47 +00:00
rUv
2606f6fb3f Merge pull request #260 from ruvnet/feat/ruvllm-deep-optimization
perf(ruvllm): Deep optimization for MoE routing and benchmark analysis
2026-03-13 13:22:07 -04:00
Reuven
383ff5e99f perf(ruvllm): optimize MoE routing with buffer reuse and optional metrics
P0: Router buffer reuse optimization
- Add pre-allocated result_buffer to MemoryAwareRouter
- Eliminate collect() allocation in select_top_k_buffered()
- Use std::mem::take for zero-copy buffer handoff
- Expected savings: 1-2µs per routing call

P1: Optional routing metrics feature flag
- Add 'routing-metrics' feature (enabled by default)
- Conditionally compile Instant::now() and metrics tracking
- Allows production builds to avoid syscall overhead (~0.04-0.08µs)

Performance Analysis Documentation:
- MoE routing optimization analysis report
- Comprehensive architecture review (5 documents)
- Identifies 8 additional optimization opportunities

ADR-092 targets: <10µs routing latency, 70%+ cache hit rate
All 26 MoE router tests pass.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-12 23:27:00 -04:00
github-actions[bot]
a9526ff18c chore: Update RVF NAPI-RS binaries for all platforms
Built from commit b4d6753258

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

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-13 01:44:04 +00:00
github-actions[bot]
c3f59d745e chore: Update NAPI-RS binaries for all platforms
Built from commit b4d6753258

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

  🤖 Generated by GitHub Actions
2026-03-13 01:27:48 +00:00
rUv
b4d6753258 Merge pull request #259 from ruvnet/feat/adr-092-moe-memory-aware-routing
feat(adr-090-092): Pi-Quantization, INT8 CNN, MoE Memory-Aware Routing
2026-03-12 21:18:25 -04:00
Reuven
7d54bcc521 fix(ruvllm): use const for AVX-512 roundscale parameter
The _mm512_roundscale_ps intrinsic requires a compile-time constant
for the rounding mode parameter. Changed from runtime let binding
to const to fix CI compilation on AVX-512 systems.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-12 21:10:51 -04:00
Reuven
cf542ca29c style: apply cargo fmt formatting
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-12 20:57:18 -04:00
Reuven
aff4394e2c chore(release): bump workspace to v2.0.6 with ADR-090-092 updates
- Bump workspace version from 2.0.5 to 2.0.6
- Update README with ADR-090 (Pi-Quantization) features
- Update README with ADR-091 (INT8 CNN Quantization) features
- Update README with ADR-092 (MoE Memory-Aware Routing) features
- Published ruvllm v2.0.6 and ruvector-cnn v2.0.6 to crates.io

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-12 20:55:13 -04:00
Reuven
5e4f3e9da6 bench(ruvllm): add P1-P4 optimization benchmarks for MoE router
Add comprehensive benchmarks for memory-aware router optimizations:

- bench_memory_aware_router: Tests MemoryAwareRouter performance
  - route_top2: P4 unrolled top-2 selection benchmark
  - route_batch_8: P2 batch routing with buffer reuse
  - cache_mask_check_64/128: P1 bitmask lookup performance
  - select_top2_vs_sort: Compare unrolled vs sorted selection
  - select_top4_partial_sort: Partial sort for larger K

- bench_simd_affinity_decay: Tests SIMD decay performance
  - decay_all: P1 SIMD-optimized decay across expert counts
  - update_with_activation: Combined decay + boost performance

Validates ADR-092 targets:
- Routing overhead <= 15 us
- Cache hit rate >= 70%

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-12 20:10:22 -04:00
Reuven
d009f2ba35 perf(ruvllm): implement P2-P4 MoE routing optimizations
P2: Buffer reuse optimizations
- Add reusable score_buffer and index_buffer to avoid hot-path allocations
- Add route_into_buffer() using pre-allocated buffers
- Add apply_cache_bonus_inplace_buffer() for in-place operations
- Add select_top_k_buffered() using pre-allocated index buffer
- Add route_batch() for efficient batch token routing
- Add bulk metric recording methods (record_cache_hits/record_cache_misses)

P3: Branch hints for hot paths
- Add #[inline] attributes to all hot path methods
- route(), route_into_buffer(), apply_cache_bonus_inplace_buffer()
- select_top_k_buffered(), select_top_2_unrolled(), is_set(), set()

P4: Loop unrolling for small arrays
- Add select_top_2_unrolled() for common top-2 MoE configuration
- Single pass through scores to find best and second-best
- Avoids sorting overhead for the most common case

Performance impact:
- P2: Eliminates Vec allocations in hot routing path
- P3: Reduces function call overhead via inlining
- P4: 2x faster top-2 selection vs full sort

All 93 MoE tests pass.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-12 16:45:58 -04:00
Reuven
e59ef2873e perf(ruvllm): implement P1 optimizations for MoE routing
SIMD decay optimization (affinity.rs):
- Add decay_scores_simd() with platform-specific implementations
- NEON intrinsics for ARM64 (4-wide vectorization)
- AVX2 intrinsics for x86_64 (8-wide vectorization)
- Scalar fallback for other platforms
- Handles non-aligned sizes with remainder loop

Bitmask cache residency (router.rs):
- Replace Vec<bool> with CacheMask bitmask structure
- u64 for ≤64 experts (single word, cache-friendly)
- Vec<u64> bitvector for >64 experts (larger models)
- Efficient popcount for resident_list()
- O(1) is_set/set operations via bitwise ops

Edge case tests added:
- Non-aligned SIMD sizes (1, 3, 5, 7, 9, 15, 17, 33, 65 experts)
- Large expert counts (256 experts)
- SIMD vs scalar correctness verification
- CacheMask with >64 experts (128 experts)
- Out-of-bounds handling
- Empty cache state

All 92 unit tests + 19 integration tests pass.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-12 16:19:56 -04:00
Reuven
bcecd1d904 fix(ruvllm): apply security and performance optimizations to MoE routing
HIGH severity security fixes:
- router: Change new() from panic to Result<Self, &'static str>
- router: Change with_default_affinity() to return Result
- precision_allocator: Change new() to return Result, add new_unchecked()
- sram_mapper: Change assign_tier() from assert! to returning bool

MEDIUM severity security fixes:
- router: Add NaN/Inf validation in apply_cache_bonus_inplace()
- router: Handle NaN in select_top_k(), treat as NEG_INFINITY
- affinity: Add NaN handling in top_k_by_affinity() with deterministic tie-breaking
- affinity: Add NaN handling in least_affinity() for eviction decisions
- sram_mapper: Fix division by zero in priority_score() when last_access=0

P0 performance optimizations:
- router: Add apply_cache_bonus_inplace() to avoid allocation in hot path
- router: Use select_nth_unstable_by for partial sort when k << n (O(n) vs O(n log n))

All 103 tests pass (84 unit + 19 integration).

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-12 15:25:36 -04:00
Reuven
830fa5c4ed feat(ruvllm): implement ADR-092 MoE Memory-Aware Routing
Implements memory-aware expert routing with cache residency bonus:

## New moe/ Module (5 files, ~4,300 lines)
- router.rs: MemoryAwareRouter with cache bonus (0.15 default)
  - INV-6 compliant (deterministic tie-breaking)
  - PagingRequest generation for non-resident experts
- affinity.rs: EMA-based expert affinity tracking
  - INV-2 compliant (monotonic decay without activation)
  - top_k_by_affinity() for prefetch predictions
- precision_allocator.rs: Hot/warm/cold precision assignment
  - Frequency-based percentile thresholds
  - GGUF format mapping (Q4_K_M, Q3_K, Q2_K)
- sram_mapper.rs: Hardware memory hierarchy config
  - Presets: RPi5, Mobile, Desktop, WasmBrowser
  - Tier assignment (SRAM/DRAM/Storage)
- metrics.rs: MoE routing metrics tracking
  - Cache hit rate, paging latency, prefetch accuracy

## Extended bitnet/expert_cache.rs
- suggest_eviction_with_affinity(): Combined LRU/LFU + affinity
- prefetch_by_affinity(): Affinity-based expert prefetching
- hot_experts(): List currently cached experts

## Tests (131 total)
- 86 MoE unit tests
- 19 integration tests (GATE-1 through GATE-4 validation)
- 26 ExpertCache tests

## Benchmarks (9 suites)
- Routing overhead: ~22 ns (target: ≤15 μs) 
- Cache hit rate simulation
- Affinity update, precision allocation

Target: ≥70% cache hit rate vs 34% baseline

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-12 15:00:59 -04:00
github-actions[bot]
be4808b707 chore: Update NAPI-RS binaries for all platforms
Built from commit 9f80f7298f

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

  🤖 Generated by GitHub Actions
2026-03-12 18:51:26 +00:00
Reuven
9f80f7298f feat(ruvector-cnn): implement ADR-091 INT8 CNN quantization
Complete implementation of INT8 quantization for ruvector-cnn:

Phase 1 - Core Infrastructure:
- QuantizationParams, QuantizationScheme, QuantizationMode
- QuantizedTensor<i8> with quantize/dequantize methods
- CalibrationMethod (MinMax, Percentile, MSE, Entropy)
- 34 unit tests passing

Phase 2 - INT8 Kernels:
- Scalar reference: conv2d, depthwise_conv2d, matmul, requantize
- AVX2 SIMD: _mm256_maddubs_epi16 for 2-4x speedup
- ARM NEON: vmull_s8, vpadalq_s16 for 2-3x speedup
- WASM SIMD128: i8x16 operations for 1.5-2x speedup

Phase 3 - Graph Rewrite Passes:
- GR-1: BatchNorm fusion into Conv weights
- GR-2: Zero-point correction pre-computation
- GR-3: Q/DQ node insertion at FP32/INT8 boundaries
- GR-4: ReLU/HardSwish fusion with LUT

Phase 4 - Quantized Layers:
- QuantizedConv2d with per-channel quantization
- QuantizedDepthwiseConv2d for MobileNet
- QuantizedLinear for FC layers
- QuantizedMaxPool2d/AvgPool2d
- QuantizedResidualAdd with scale alignment

Phase 6 - Tests & Benchmarks:
- quality_validation.rs: cosine similarity ≥0.995
- acceptance_gates.rs: 7 ADR-091 gates
- kernel_equivalence.rs: SIMD vs scalar validation
- int8_bench.rs: Criterion benchmarks

Performance targets:
- 2.5x latency improvement (MobileNetV3)
- 4x memory reduction
- <1% accuracy degradation

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-12 14:45:52 -04:00
github-actions[bot]
b376344cff chore: Update NAPI-RS binaries for all platforms
Built from commit e9f32ff9a8

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

  🤖 Generated by GitHub Actions
2026-03-12 18:11:09 +00:00
Reuven
e9f32ff9a8 Merge branch 'feat/adr-090-ultra-low-bit-qat' 2026-03-12 14:04:51 -04:00
Reuven
f7942f91c1 refactor(ruvllm): remove unused NEON helper function
Remove neon_process_4_groups_ultra() which was superseded by the
optimized 8-group batching implementation with prefetching.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-12 13:59:16 -04:00
Reuven
9a7d458d81 perf(ruvllm): optimize pi-quantization SIMD kernels
- Add AVX-512 dequantization kernel (16-wide SIMD, target >12 GB/s)
- Add AVX2 quantization kernel (8-wide SIMD) for forward pass
- Add AVX2 2-bit quantization kernel
- Optimize NEON kernel with prefetching and 8-group batching
- Add inline assembly prefetch (prfm pldl1keep)
- Update benchmarks with new throughput tests
- All 77 tests pass (pi_quant: 35, simd_equivalence: 19, hadamard: 23)

Performance optimizations target ADR-090 requirements:
- Quantize throughput: >1 GB/s (was 467 MiB/s)
- NEON dequant: >10 GB/s (was 2.54 GiB/s)
- AVX-512 dequant: >12 GB/s (new)

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-12 13:57:04 -04:00
Reuven
8403d563df feat(ruvllm): implement ADR-090 Ultra-Low-Bit QAT & Pi-Quantization
Phase 1-4 implementation of ADR-090 with 114 tests passing.

## Core Quantization (src/quantize/)
- pi_quant.rs: PiQuantizer with π/k step sizes, Pi3BitBlock, Pi2BitBlock
- pi_quant_simd.rs: NEON/AVX2/scalar dequantization kernels (2.1x speedup)
- hadamard.rs: Fast Walsh-Hadamard O(n log n), INV-4 orthogonality verified
- incoherence.rs: IncoherenceTransform for QuIP-style decorrelation
- quip.rs: Q2_QuIP variant combining incoherence + 2-bit K-quant
- security.rs: WeightIntegrity, GGUF validation, bounds checking

## QAT Infrastructure (src/qat/)
- config.rs: QatConfig, SteVariant, QuantGranularity with builder pattern
- ste.rs: Straight-through estimator (Standard, Clipped, LSQ, EWGS)
- differentiable_quant.rs: DifferentiableQuantizer trait, PiQuantDifferentiable
- calibration.rs: CalibrationEngine with mixed-domain support
- distillation.rs: Teacher-student composite loss (L_task + L_KD + L_reasoning)
- reasoning_loss.rs: Chain-of-thought fidelity preservation
- training_loop.rs: QatTrainer orchestrator with checkpointing
- lora_qat.rs: Memory-efficient LoRA-QAT (50 MB vs 114 GB for full QAT)

## WASM Integration (ruvllm-wasm/)
- pi_quant_wasm.rs: PiQuantWasm with SIMD128 kernel, JSON serialization
- quant_bench_wasm.rs: QuantBenchWasm for in-browser benchmarking
- Feature flags: pi-quant, qat

## Tests (114 passing)
- pi_quant_tests.rs (35): Round-trip, block packing, bounds checking
- hadamard_tests.rs (23): Orthogonality, invertibility, energy preservation
- ste_tests.rs (24): Gradient correctness, PyTorch reference comparison
- simd_equivalence_tests.rs (19): SIMD ≈ scalar within 1 ULP (INV-8)
- acceptance_gates.rs (13): G1-G5 quality and security gates

## Benchmarks (benches/pi_quant_bench.rs)
- Hadamard 4096: 5.3 μs (target <50 μs) ✓
- NEON dequant: 2.54 GiB/s (2.1x over scalar)
- QAT backward: 7.3 Gelem/s

## Invariants Verified
- INV-1: STE gradient flow
- INV-2: Scale positivity (α > 0)
- INV-3: Step size constraint (π/k)
- INV-4: Hadamard orthogonality
- INV-5: Calibration provenance
- INV-8: SIMD ≈ scalar (≤1 ULP)

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-12 12:36:36 -04:00
github-actions[bot]
1745d9054d chore: Update NAPI-RS binaries for all platforms
Built from commit f091d45575

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

  🤖 Generated by GitHub Actions
2026-03-12 14:53:46 +00:00