Commit graph

362 commits

Author SHA1 Message Date
rUv
221891295e feat: add formal verification layer with lean-agentic dependent types
Introduces ruvector-verified and ruvector-verified-wasm crates providing
proof-carrying vector operations with sub-microsecond overhead. Includes
ADR-045, 10 exotic application examples (weapons filter, medical diagnostics,
financial routing, agent contracts, sensor swarm, quantization proof,
verified memory, vector signatures, simulation integrity, legal forensics),
rvf-kernel-optimized example, CI workflow, and root README integration.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-25 03:45:18 +00:00
rUv
d2342d8af0 fix: migrate attention/dag/tiny-dancer to workspace versioning and fix all dep version specs
- ruvector-attention: 0.1.32 → version.workspace = true (2.0.4)
- ruvector-attention-wasm: 0.1.32 → workspace, dep 0.1.31 → 2.0
- ruvector-attention-node: 0.1.0 → workspace, dep already 2.0
- ruvector-dag: 0.1.0 → workspace, add version spec on ruvector-core dep
- ruvector-gnn-wasm: fix malformed Cargo.toml (metadata before version), add version spec
- ruvector-attention-unified-wasm: add version specs, fix category slug
- Update all consumers: ruvector-crv, ruvllm, ruvector-postgres, prime-radiant, rvdna, OSpipe

Published to crates.io:
  ruvector-attention@2.0.4, ruvector-dag@2.0.4, ruvector-tiny-dancer-core@2.0.4,
  ruvector-attention-wasm@2.0.4, ruvector-attention-node@2.0.4,
  ruvector-gnn-wasm@2.0.4, ruvector-gnn-node@2.0.4,
  ruvector-tiny-dancer-wasm@2.0.4, ruvector-tiny-dancer-node@2.0.4,
  ruvector-router-wasm@2.0.4, ruvector-router-ffi@2.0.4, ruvector-router-cli@2.0.4,
  ruvector-attention-unified-wasm@0.1.0

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-23 13:29:46 +00:00
rUv
2ae343967c chore: bump rvdna crate version to 0.3.0 for biomarker engine release
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-22 16:01:44 +00:00
Claude
579120c658
feat(rvdna): add npm biomarker engine with risk scoring, streaming, and benchmarks
ADR-015: Pure-JS biomarker engine mirroring Rust biomarker.rs and
biomarker_stream.rs exactly. Includes:

- src/biomarker.js: 20-SNP composite risk scoring, 6 gene-gene
  interactions, 64-dim L2-normalized profile vectors, synthetic
  population generation with Mulberry32 PRNG
- src/stream.js: RingBuffer, StreamProcessor with Welford online
  stats, CUSUM changepoint detection, z-score anomaly detection,
  linear regression trend analysis, batch reading generation
- tests/test-biomarker.js: 35 tests + 5 benchmarks covering all
  classification levels, risk scoring, vector encoding, population
  generation, streaming, anomaly/trend detection
- index.d.ts: Full TypeScript definitions for all biomarker APIs
- package.json: Bump to v0.3.0, add biomarker keywords

Benchmark results (Node.js):
  computeRiskScores: 7.33 us/op
  encodeProfileVector: 9.51 us/op
  RingBuffer push+iter: 3.32 us/op

https://claude.ai/code/session_014FpaYVohmyLH5dcBZTgmSY
2026-02-22 15:27:37 +00:00
Claude
324a37decb
docs(rvdna): update README for 20-SNP panel with LPA and PCSK9
Update all references from 17 SNPs to 20 SNPs reflecting the
addition of LPA rs10455872/rs3798220 and PCSK9 rs11591147.
Document new gene-biomarker correlations (LPA→Lp(a), PCSK9→LDL)
in synthetic population section. Update module table line counts.

https://claude.ai/code/session_014FpaYVohmyLH5dcBZTgmSY
2026-02-22 15:04:58 +00:00
Claude
d48b70a84b
feat(rvdna): add PCSK9 rs11591147 protective cardiovascular SNP
Add PCSK9 R46L loss-of-function variant (NEJM 2006: OR 0.77 CHD,
0.40 MI) as a protective cardiovascular SNP with negative weights.
Include PCSK9→LDL-C biomarker correlation (15-21% lower LDL in
carriers). Refactor gene-biomarker correlations from match to
additive if-chain so multiple gene effects can stack on the same
biomarker (e.g., APOE raises LDL while PCSK9 R46L lowers it).
Panel expanded to 20 SNPs.

https://claude.ai/code/session_014FpaYVohmyLH5dcBZTgmSY
2026-02-22 06:44:14 +00:00
Claude
366eae172f
feat(rvdna): add LPA cardiovascular SNPs from SOTA meta-analysis evidence
Add rs10455872 (OR 1.6-1.75/allele CHD) and rs3798220 (OR 1.49-1.54/allele)
from 2024 LPA meta-analyses. Include Lp(a) biomarker reference (0-75 nmol/L)
and gene-biomarker correlation in population model. Separate NUM_ONEHOT_SNPS
(17) from NUM_SNPS (19) to preserve 64-dim vector layout with LPA encoded
in summary dimension 63.

https://claude.ai/code/session_014FpaYVohmyLH5dcBZTgmSY
2026-02-22 06:41:06 +00:00
Claude
8b85624352
refactor(rvdna): consolidate SNP arrays, cache metadata, optimize streaming
Structural improvements from deep code review:

- Consolidate 5 parallel arrays (SNP_WEIGHTS, HOM_REF, HOM_ALT, HET,
  ALLELE_FREQS) into single SnpDef struct array — eliminates entire class
  of parallel-array misalignment bugs
- Cache category_meta() with LazyLock — avoids per-call Vec allocation
  (critical in generate_synthetic_population hot path)
- Hoist Normal::new out of inner loop in generate_readings — pre-compute
  distributions per biomarker instead of per-step*per-biomarker
- Add clinically meaningful lower bounds: LDL normal_low 0→50 mg/dL
  (critical_low 25), Triglycerides normal_low 0→35 mg/dL (critical_low 20)
- Optimize RingBuffer::clear from O(capacity) to O(1) — head/len reset
  is sufficient since push overwrites before read
- Use NUM_SNPS const for vector encoding bounds instead of magic number 51

All 172 tests pass, zero clippy warnings for rvdna.

https://claude.ai/code/session_014FpaYVohmyLH5dcBZTgmSY
2026-02-22 06:31:44 +00:00
Claude
b4c230f4b5
docs: update rvDNA and root READMEs with health biomarker engine
- Add Health Biomarker Engine section to rvDNA README with usage examples
  for composite risk scoring, streaming processing, and synthetic populations
- Add biomarker.rs and biomarker_stream.rs to Modules table
- Update test count from 102 to 172 (added biomarker tests)
- Add biomarker benchmark results to Speed table
- Add Welford, CUSUM, and PRS to Published Algorithms table
- Update root README Genomics & Health capabilities (49 → 51 features)
- Add health biomarker engine and streaming biomarkers to root feature table
- Update rvDNA details section with risk scoring and streaming capabilities

https://claude.ai/code/session_014FpaYVohmyLH5dcBZTgmSY
2026-02-22 06:13:12 +00:00
Claude
ad27974f6c
feat(rvdna): add gene-biomarker correlations, CUSUM changepoint detection, and interaction tests
- Add gene→biomarker correlations in synthetic population: APOE e4→lower HDL/higher
  triglycerides, MTHFR→lower B12, NQO1 null→higher CRP
- Add CUSUM changepoint detection algorithm to StreamProcessor for detecting
  sustained biomarker shifts beyond simple anomaly detection
- Add 4 new integration tests: MTHFR×COMT interaction, DRD2×COMT interaction,
  APOE→HDL population correlation, CUSUM changepoint detection
- Remove unused variant_categories import
- All 172 tests pass, all ADR-014 performance targets exceeded

https://claude.ai/code/session_014FpaYVohmyLH5dcBZTgmSY
2026-02-22 06:08:41 +00:00
Claude
3f8eb9b890
refine(rvdna): calibrate SNP weights from SOTA clinical meta-analyses
Evidence-based refinements from peer-reviewed clinical research:

- TP53 rs1042522 (Pro72Arg): hom_ref 0.10→0.00 — CC/Pro/Pro is not
  independently risk-associated; prior non-zero baseline was unjustified
- BRCA2 rs11571833 (K3326X): het 0.25→0.20 — aligned with iCOGS
  meta-analysis OR 1.28 for breast cancer (Meeks et al., JNCI 2016,
  76,637 cases / 83,796 controls)
- NQO1 rs1800566 (Pro187Ser): het 0.20→0.15, hom_alt 0.45→0.30 —
  aligned with comprehensive meta-analysis OR 1.18 for TT vs CC
  (Lajin & Alachkar, Br J Cancer 2013, 92 studies, 21,178 cases);
  larger 2022 meta-analysis (43,736 cases) found no overall association

Validated unchanged weights against SOTA evidence:
- APOE rs429358: OR 3-4x het, 8-15x hom (Belloy JAMA Neurology 2023)
- SLCO1B1 rs4363657: OR 4.5/allele, 16.9 hom (SEARCH/NEJM; CPIC 2022)
- COMT×OPRM1 interaction: confirmed p=0.037 (orthopedic trauma study)

All 48 tests pass (33 unit + 15 integration).

https://claude.ai/code/session_014FpaYVohmyLH5dcBZTgmSY
2026-02-22 05:53:16 +00:00
Claude
22dc2686fa
refine(rvdna): calibrate biomarker weights and ranges from Genetic Lifehacks clinical data
Evidence-based adjustments from geneticlifehacks.com research articles:

- MTHFR C677T (rs1801133): het weight 0.30→0.35 to match documented
  40% enzyme activity decrease
- MTHFR A1298C (rs1801131): het 0.15→0.10, hom_alt 0.35→0.25 to
  match documented ~20% enzyme decrease
- Homocysteine reference range: 4-12→5-15 μmol/L (clinical consensus),
  critical_high 50→30 (moderate hyperhomocysteinemia threshold)
- Add MTHFR A1298C × COMT interaction (1.25x Neurological): A1298C
  homozygous + COMT slow = amplified depression risk
- Add DRD2/ANKK1 × COMT interaction (1.2x Neurological): rs1800497 ×
  Val158Met working memory interaction
- Guard vector encoding with .take(4) so expanded interaction table
  (now 6 entries) doesn't overflow dims 56-59

Sources:
- geneticlifehacks.com/mthfr/ (enzyme activity percentages)
- geneticlifehacks.com/mthfr-c677t/ (MTHFR-COMT depression data)
- geneticlifehacks.com/understanding-homocysteine-levels/ (ref ranges)
- geneticlifehacks.com/dopamine-receptor-genes/ (DRD2×COMT interaction)

All 48 tests pass (33 unit + 15 integration), benchmark compiles.

https://claude.ai/code/session_014FpaYVohmyLH5dcBZTgmSY
2026-02-22 05:49:22 +00:00
Claude
c96d226357
perf(rvdna): optimize biomarker engine — fix bug, reduce allocations, halve ring buffer memory
- Fix snp_idx silent fallback: unwrap_or(0) masked missing SNPs with
  incorrect index-0 lookups; now returns Option<usize>
- RingBuffer: eliminate Option<T> wrapper, halving per-slot memory
  for f64 (8 bytes vs 16); use T::Default instead
- window_mean_std: replace two-pass sum+variance with single-pass
  Welford's online algorithm (2x fewer cache misses)
- compute_risk_scores: pre-compute category max scores via
  category_meta() to avoid re-scanning SNP_WEIGHTS per call;
  use &str keys in intermediate HashMap to reduce String allocations
- HashMap capacity hints throughout (StreamProcessor, genotypes,
  biomarker_values, cat_scores) to eliminate rehashing
- generate_synthetic_population: hoist APOE lookup out of inner loop,
  reserve biomarker_values capacity upfront
- All 48 tests pass (33 unit + 15 integration), benchmark compiles

https://claude.ai/code/session_014FpaYVohmyLH5dcBZTgmSY
2026-02-22 05:37:52 +00:00
Claude
65d671dcea
style(rvdna): apply linter formatting to biomarker module
https://claude.ai/code/session_014FpaYVohmyLH5dcBZTgmSY
2026-02-22 05:20:54 +00:00
Claude
db237d3d4d
feat(rvdna): add health biomarker analysis engine with streaming simulation
Implement ADR-014 Health Biomarker Analysis Architecture:
- biomarker.rs: Composite risk scoring engine with 17-SNP weight matrix,
  gene-gene interaction modifiers (COMT×OPRM1, MTHFR compound, BRCA1×TP53),
  64-dim HNSW-aligned profile vectors, clinical reference ranges for 12
  biomarkers, and deterministic synthetic population generation
- biomarker_stream.rs: Streaming biomarker simulator with generic RingBuffer,
  configurable noise/drift/anomaly injection, z-score anomaly detection,
  linear regression trend analysis, and exponential moving averages
- 35 unit tests + 15 integration tests (168 total, 0 failures)
- Criterion benchmark suite targeting ADR-014 performance budgets

https://claude.ai/code/session_014FpaYVohmyLH5dcBZTgmSY
2026-02-22 05:19:23 +00:00
rUv
d102bb87ab fix: apply cargo fmt across workspace and fix CI issues
- Run cargo fmt --all to fix formatting in 362 files across the entire workspace
- Add PGDG repository for PostgreSQL 17 in CI test-all-features and benchmark jobs
- Add missing rvf dependency crates to standalone Dockerfile for domain-expansion
- Add sona-learning and domain-expansion features to standalone Dockerfile build
- Create npu.rs stub for ruvector-sparse-inference (fixes rustfmt resolution error)

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-21 20:56:38 +00:00
rUv
62436a4a7b fix(security): harden intelligence providers — type-safe enums, input validation, file size limits
Security hardening for ADR-043 intelligence module:
- Replace String outcome/verdict with Outcome and HumanVerdict enums (type safety)
- Add MAX_SIGNAL_FILE_SIZE (10 MiB) and MAX_SIGNALS_PER_FILE (10,000) limits
- BufReader streaming parse instead of read_to_string (prevent double allocation)
- Validate quality_score range (finite, 0.0-1.0) on load
- NaN protection in calibration_bias()
- TypeScript: top-level imports, runtime validation, file size checks, score clamping
- Bump workspace to 2.0.4, @ruvector/ruvllm to 2.5.1
- Published ruvllm@2.0.4 to crates.io, @ruvector/ruvllm@2.5.1 to npm

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-21 18:29:33 +00:00
rUv
55a968aabe feat(security): Security Hardened RVF v3.0 — 30 capabilities verified
Upgrade from 22 to 30 capabilities exercising every major RVF API:
- KernelBinding anti-tamper (manifest_root + policy_hash binding)
- Dual WASM modules (Interpreter + Microkernel, self-bootstrapping)
- DASHBOARD_SEG embedded security monitoring UI
- Scalar quantization (int8, 4x compression) via rvf-quant
- Binary quantization (1-bit, 32x compression) + Hamming distance
- Filter deletion + compaction lifecycle
- QEMU requirements check via rvf-launch
- Freeze/seal permanent immutability
- Additional kernel flags: VIRTIO_NET, VSOCK, INGEST_API
- RvfOptions: signing=true, profile=3, m=32, ef_construction=400

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-21 17:39:58 +00:00
rUv
4625ac7ac2 feat(security): add security_hardened.rvf to examples/ root
Copy the 2.1 MB sealed RVF artifact to examples/ for easier discovery.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-21 16:41:40 +00:00
rUv
c0bb84e948 feat(security): Security Hardened RVF v2.0 — One File To Rule Them All
Include the generated 2.1 MB .rvf binary artifact in repo alongside
the v2.0 optimized example (22 capabilities, zero warnings, Paranoid
policy, audited queries, COW branching, SSN/encoding detection).

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-21 16:31:43 +00:00
rUv
98b2d332f2 feat(security): ADR-042 Security RVF — AIDefence + TEE hardened container
6-layer defense-in-depth in a single sealed RVF file:
  1. TEE attestation (SGX, SEV-SNP, TDX, ARM CCA) with bound keys
  2. Hardened Linux microkernel (16 security configs, REQUIRES_TEE)
  3. eBPF packet filter (XDP) + syscall enforcer (Seccomp)
  4. AIDefence WASM engine (injection, jailbreak, PII, behavioral)
  5. Ed25519 signing + SHAKE-256 content hashes + Paranoid policy
  6. 6-role RBAC + Coherence Gate authorization

20 capabilities verified, 10/10 AIDefence tests, 3/3 tamper rejections,
30-entry witness chain, 1000 threat signatures (512-dim), 3 tenant stores.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-21 00:45:25 +00:00
rUv
4ef45dbde3 feat(rvdna): native 23andMe genotyping pipeline v0.2.0
Replaces the Python rvdna-bridge with a pure Rust implementation:
- 7-stage pipeline: parse, QC, classification, pharma, health, compound, report
- CYP2D6/CYP2C19 diplotype calling with confidence gating (Strong/Moderate/Weak/Unsupported)
- 17 health variant interpretations (APOE, BRCA1/2, TP53, MTHFR, COMT, OPRM1, etc.)
- Genotype normalization (case/strand insensitive, allele-sorted)
- CPIC drug recommendations gated on Moderate+ confidence
- Panel QC signatures with het rate metrics
- MTHFR compound analysis and pain sensitivity profiling
- 91 tests passing (79 lib + 12 security)

Published as rvdna v0.2.0 on crates.io.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-20 20:40:51 +00:00
rUv
9304568753 fix: publish-readiness for 6 solver crates + npm package
- Remove duplicate workspace members (solver/solver-wasm/solver-node)
- Add ruvector-attn-mincut to workspace members
- Switch ruvector-solver and ruvector-solver-wasm to workspace version/metadata
- Add version pin on ruvector-solver dep for solver-wasm and solver-node
- Remove stale version pins in examples/dna and examples/prime-radiant
- Fix unused assignment and unused mut warnings in neumann.rs
- Remove publish = false from ruvector-profiler, add keywords/categories
- Bump @ruvector/rvf-solver to 0.1.4
- Add Publishing section to CLAUDE.md

Published to crates.io: ruvector-solver, ruvector-solver-wasm,
ruvector-solver-node, ruvector-coherence, ruvector-attn-mincut,
ruvector-profiler (all v2.0.3)
Published to npm: @ruvector/rvf-solver v0.1.4

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-20 19:02:50 +00:00
rUv
c21542bf13 merge: resolve examples/rvf/Cargo.toml conflict with main
Keep both solver examples (solver_witness, sparse_matrix_store,
solver_benchmark) and causal atlas examples from main.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-20 18:10:40 +00:00
rUv
3ad28b2031 merge: resolve conflicts with main
Accept main's updated binaries and npm packages, keep our solver
fixes (evaluate-before-train, conservative Thompson, noise injection)
and dashboard/desktop additions.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-20 18:05:55 +00:00
rUv
8750b59944 feat(rvf): add Causal Atlas dashboard, solver fixes, and desktop app
ADR-040 Causal Atlas implementation with full Three.js dashboard:
- Planet detection, life candidate scoring, Dyson sphere 3D views
- WASM solver with fixed acceptance test (evaluate-before-train,
  conservative Thompson sampling, non-contradictory noise injection)
- wry-based desktop app embedding the full dashboard (1.6 MB binary)
- WebSocket live updates, docs view, download page, status dashboard
- 10/10 seed acceptance pass rate (was ~40% before fixes)

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-20 18:01:09 +00:00
Claude
6c7b1495bd
feat: integrate ruvector-solver into DNA and quantum components
DNA crate (rvdna):
- Add ruvector-solver dependency with forward-push feature
- New kmer_pagerank module: KmerGraphRanker uses Forward Push PPR to
  rank sequences by structural centrality in k-mer overlap graphs
- New solver_bench benchmark suite with 3 groups:
  A) Localized relevance via Forward Push PPR (20-200x speedup)
  B) Laplacian solve for denoising via Neumann/CG (10-80x speedup)
  C) Cohort-scale label propagation via CG solver
- README: add DNA Solver Benchmarks section with dataset citations
  (GIAB, NA12878, 1000 Genomes), graph construction docs, benchmark
  tables, and reproducibility instructions

Quantum crate (prime-radiant-category):
- Add ruvector-solver dependency with neumann/cg features
- SparseMatrix: replace O(nnz) COO Vec with O(1) HashMap entries,
  add to_csr_f64() and spmv_f64() using solver CsrMatrix
- ComplexMatrix: add Jacobi eigenvalue algorithm for real-symmetric
  matrices (much more stable than power iteration + deflation),
  add to_csr_real() and is_real_valued() helper methods
- DensityMatrix: add SpectralDecomposition cache, purity_fast() via
  Frobenius norm O(n²) vs O(n³), static eigenvalue helpers
- SimplicialComplex: add graph_laplacian_csr() for spectral analysis
- SolverBackedOperator: sparse quantum operator using CsrMatrix SpMV
  for 40-60 effective qubit scaling (vs ~33 with dense matrices)
- New quantum_solver_bench: SpMV scaling, eigenvalue convergence,
  memory scaling benchmarks from 10 to 30 qubits

All 362 tests pass (81 quantum + 102 DNA + 179 solver).

https://claude.ai/code/session_01TiqLbr2DaNAntQHaVeLfiR
2026-02-20 13:37:24 +00:00
Claude
1abc5919ef
feat: Add solver RVF examples and update Cargo.toml entries
- solver_benchmark.rs: Store benchmark results in RVF for analysis
- Updated solver_witness.rs with refinements
- Updated examples/rvf/Cargo.toml with 3 new [[example]] entries
- Updated examples/rvf/src/lib.rs with new example documentation
- Refined AGI sublinear optimization review

https://claude.ai/code/session_01TiqLbr2DaNAntQHaVeLfiR
2026-02-20 07:12:09 +00:00
Claude
c3e90d68a5
docs: Polish crate READMEs with badges, comparison tables, and collapsed tutorials
- ruvector-solver: Added comparison table vs dense solvers, tutorials
- ruvector-attn-mincut: Added softmax vs min-cut comparison, end-to-end tutorial
- ruvector-coherence: Added metrics summary table, evaluation pipeline tutorial
- ruvector-profiler: Added dimension table, benchmark tutorial with output structure
- Added sparse_matrix_store.rs RVF example

https://claude.ai/code/session_01TiqLbr2DaNAntQHaVeLfiR
2026-02-20 07:10:14 +00:00
Claude
08f57d5e84
docs: Add crate READMEs, AGI optimization review, and root README update
- ruvector-solver README with algorithm table, performance optimizations
- ruvector-attn-mincut README with min-cut gating architecture
- ruvector-coherence README with metrics and comparison docs
- ruvector-profiler README with profiling hooks documentation
- AGI sublinear optimization review (18-agi-sublinear-optimization.md)
- Root README updated with sublinear solver section
- Enhanced solver_witness RVF example

https://claude.ai/code/session_01TiqLbr2DaNAntQHaVeLfiR
2026-02-20 07:07:37 +00:00
Claude
53a1cb02b0
docs: Update ADR-STS-001 through 010 to Accepted status with implementation notes
- All 10 ADR-STS documents updated from Proposed to Accepted
- Added implementation status sections reflecting delivered solver crate
- Updated SOTA research analysis to v3.0 with implementation realization
- Updated optimization guide to v2.0 with realized optimizations
- Updated executive summary, performance, algorithm, and testing docs
- Added solver_witness.rs RVF example

https://claude.ai/code/session_01TiqLbr2DaNAntQHaVeLfiR
2026-02-20 07:05:54 +00:00
rUv
81e38b50c2 feat(rvf): add platform-specific scripts for Linux, Windows, Node, browser, Docker
- rvf-quickstart.sh / .ps1 — 7-step RVF workflow (create, ingest, query, branch, verify)
- rvf-claude-appliance.sh / .ps1 — build & boot the 5.1 MB Claude Code Appliance
- rvf-mcp-server.sh / .ps1 — start stdio or SSE MCP server for AI agents
- rvf-node-example.mjs — full Node.js API walkthrough
- rvf-browser.html — browser WASM vector search demo
- rvf-docker.sh — containerized RVF CLI for CI/CD

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-16 14:55:15 +00:00
rUv
3a89681bf2 feat(rvf): add platform-specific scripts for Linux, Windows, Node, browser, Docker
- rvf-quickstart.sh / .ps1 — 7-step RVF workflow (create, ingest, query, branch, verify)
- rvf-claude-appliance.sh / .ps1 — build & boot the 5.1 MB Claude Code Appliance
- rvf-mcp-server.sh / .ps1 — start stdio or SSE MCP server for AI agents
- rvf-node-example.mjs — full Node.js API walkthrough
- rvf-browser.html — browser WASM vector search demo
- rvf-docker.sh — containerized RVF CLI for CI/CD

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-16 14:55:15 +00:00
rUv
bd9d4f5834 docs: update READMEs with self-booting instructions, bump npm versions
- Add Claude Code Appliance walkthrough and 5.1 MB self-boot line to
  crate, examples, npm, and root READMEs
- Add missing live_boot_proof example to table (45→46 examples)
- Update segment count references from 20→24
- Improve rvf-node npm README with full API reference
- Expand AGI Cognitive Container documentation
- Bump npm packages: rvf-node 0.1.3, rvf-wasm 0.1.3,
  rvf-mcp-server 0.1.3, rvf 0.1.5
- Include verified claude_code_appliance output files

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-16 14:43:04 +00:00
rUv
ab7d1e78fc docs: update READMEs with self-booting instructions, bump npm versions
- Add Claude Code Appliance walkthrough and 5.1 MB self-boot line to
  crate, examples, npm, and root READMEs
- Add missing live_boot_proof example to table (45→46 examples)
- Update segment count references from 20→24
- Improve rvf-node npm README with full API reference
- Expand AGI Cognitive Container documentation
- Bump npm packages: rvf-node 0.1.3, rvf-wasm 0.1.3,
  rvf-mcp-server 0.1.3, rvf 0.1.5
- Include verified claude_code_appliance output files

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-16 14:43:04 +00:00
Claude
608179d2b1 feat(rvf): rvf-solver-wasm — self-learning AGI engine compiled to WASM
Compiles the complete three-loop adaptive solver to wasm32-unknown-unknown
(160 KB, no_std + alloc). Preserves all AGI capabilities:

- Thompson Sampling two-signal model (safety Beta + cost EMA)
- 18 context buckets with per-arm bandit stats
- Speculative dual-path execution
- KnowledgeCompiler with signature-based pattern cache
- Three-loop architecture (fast/medium/slow)
- SHAKE-256 witness chain via rvf-crypto

12 WASM exports: create/destroy/train/acceptance/result/policy/witness.
Handle-based API supports 8 concurrent solver instances.

ADR-039 documents the integration architecture.
Benchmark binary validates WASM against native solver.

https://claude.ai/code/session_01RnwD4x5cbpB7FPvoyYQz8G
2026-02-16 00:43:12 +00:00
Claude
e2a3f1a6e4
feat(rvf): rvf-solver-wasm — self-learning AGI engine compiled to WASM
Compiles the complete three-loop adaptive solver to wasm32-unknown-unknown
(160 KB, no_std + alloc). Preserves all AGI capabilities:

- Thompson Sampling two-signal model (safety Beta + cost EMA)
- 18 context buckets with per-arm bandit stats
- Speculative dual-path execution
- KnowledgeCompiler with signature-based pattern cache
- Three-loop architecture (fast/medium/slow)
- SHAKE-256 witness chain via rvf-crypto

12 WASM exports: create/destroy/train/acceptance/result/policy/witness.
Handle-based API supports 8 concurrent solver instances.

ADR-039 documents the integration architecture.
Benchmark binary validates WASM against native solver.

https://claude.ai/code/session_01RnwD4x5cbpB7FPvoyYQz8G
2026-02-16 00:43:12 +00:00
Claude
e83ed7eb8d feat(rvf): integrate publishable acceptance test with native SHAKE-256 witness chain
Replace standalone SHA-256 chain with rvf-crypto SHAKE-256, add native .rvf
binary output (WITNESS_SEG + META_SEG), and wire witness verification into
rvf-wasm microkernel.

Key changes:
- Feature-gate ed25519 in rvf-crypto for WASM compatibility (sha3 no_std)
- Rewrite WitnessChainBuilder to use shake256_256 + parallel rvf_crypto::WitnessEntry
- Add export_rvf_binary() with WITNESS_SEG (0x0A) + META_SEG (0x07) segments
- Add rvf_witness_verify/rvf_witness_count exports to rvf-wasm
- Add verify-rvf subcommand to acceptance-rvf CLI
- Write ADR-037 documenting architecture and AGI benchmark integration
- Update rvf-crypto, rvf-wasm, and rvf READMEs

86 tests pass (66 lib + 20 integration). rvf-crypto 49 tests pass.

https://claude.ai/code/session_01RnwD4x5cbpB7FPvoyYQz8G
2026-02-16 00:13:44 +00:00
Claude
aca7f6b197
feat(rvf): integrate publishable acceptance test with native SHAKE-256 witness chain
Replace standalone SHA-256 chain with rvf-crypto SHAKE-256, add native .rvf
binary output (WITNESS_SEG + META_SEG), and wire witness verification into
rvf-wasm microkernel.

Key changes:
- Feature-gate ed25519 in rvf-crypto for WASM compatibility (sha3 no_std)
- Rewrite WitnessChainBuilder to use shake256_256 + parallel rvf_crypto::WitnessEntry
- Add export_rvf_binary() with WITNESS_SEG (0x0A) + META_SEG (0x07) segments
- Add rvf_witness_verify/rvf_witness_count exports to rvf-wasm
- Add verify-rvf subcommand to acceptance-rvf CLI
- Write ADR-037 documenting architecture and AGI benchmark integration
- Update rvf-crypto, rvf-wasm, and rvf READMEs

86 tests pass (66 lib + 20 integration). rvf-crypto 49 tests pass.

https://claude.ai/code/session_01RnwD4x5cbpB7FPvoyYQz8G
2026-02-16 00:13:44 +00:00
Claude
6d10d428c9 feat(ablation): publishable RVF acceptance test with SHA-256 witness chain
Add self-contained acceptance test artifact that external developers can
run offline and reproduce identical graded outcomes:

- SHA-256-linked witness chain: every puzzle decision (skip_mode,
  context_bucket, steps, correct) hashed into a tamper-evident chain.
  Changing any single bit invalidates everything downstream.

- Deterministic replay: frozen seeds → identical puzzles → identical
  solve paths → identical chain_root_hash. Two runs with the same
  config produce the same hash, proven by test.

- JSON manifest: config, per-mode scorecards (A/B/C), all six ablation
  assertions with measured values, full witness chain, chain root hash.

- Verifier: re-runs with same config, recomputes chain, compares root
  hash. Mismatch means non-identical outcomes.

- CLI binary: `acceptance-rvf generate -o manifest.json` to produce,
  `acceptance-rvf verify -i manifest.json` to verify.

66 lib tests + 20 integration tests pass.

https://claude.ai/code/session_01RnwD4x5cbpB7FPvoyYQz8G
2026-02-15 23:51:04 +00:00
Claude
ccfc386ac3
feat(ablation): publishable RVF acceptance test with SHA-256 witness chain
Add self-contained acceptance test artifact that external developers can
run offline and reproduce identical graded outcomes:

- SHA-256-linked witness chain: every puzzle decision (skip_mode,
  context_bucket, steps, correct) hashed into a tamper-evident chain.
  Changing any single bit invalidates everything downstream.

- Deterministic replay: frozen seeds → identical puzzles → identical
  solve paths → identical chain_root_hash. Two runs with the same
  config produce the same hash, proven by test.

- JSON manifest: config, per-mode scorecards (A/B/C), all six ablation
  assertions with measured values, full witness chain, chain root hash.

- Verifier: re-runs with same config, recomputes chain, compares root
  hash. Mismatch means non-identical outcomes.

- CLI binary: `acceptance-rvf generate -o manifest.json` to produce,
  `acceptance-rvf verify -i manifest.json` to verify.

66 lib tests + 20 integration tests pass.

https://claude.ai/code/session_01RnwD4x5cbpB7FPvoyYQz8G
2026-02-15 23:51:04 +00:00
Claude
70e022319c feat(ablation): Thompson Sampling two-signal model, speculative dual-path, constraint propagation
Replace epsilon-greedy with two-signal Thompson Sampling (safety Beta
posterior + cost EMA) for Mode C learned policy. Score = safety_sample
- lambda * cost_ema provides principled exploration-exploitation.

Add speculative dual-path for Mode C only: when Beta variance > 0.02
and top-2 arms within delta 0.15, run both arms (60/40 budget split)
to resolve uncertainty faster while keeping Mode A/B ablation clean.

Add constraint propagation pre-pass as PolicyKernel-controlled mode
(Off/Light/Full, defaults to Off). Light handles InMonth+DayOfMonth
direct solves; Full adds DayOfWeek pruning for ranges ≤60 days.
PrepassMetrics tracks pruned_candidates, prepass_steps, scan_steps_saved.

Beta sampling via Marsaglia-Tsang Gamma method + Box-Muller normal.

https://claude.ai/code/session_01RnwD4x5cbpB7FPvoyYQz8G
2026-02-15 23:40:05 +00:00
Claude
2ed3dce655
feat(ablation): Thompson Sampling two-signal model, speculative dual-path, constraint propagation
Replace epsilon-greedy with two-signal Thompson Sampling (safety Beta
posterior + cost EMA) for Mode C learned policy. Score = safety_sample
- lambda * cost_ema provides principled exploration-exploitation.

Add speculative dual-path for Mode C only: when Beta variance > 0.02
and top-2 arms within delta 0.15, run both arms (60/40 budget split)
to resolve uncertainty faster while keeping Mode A/B ablation clean.

Add constraint propagation pre-pass as PolicyKernel-controlled mode
(Off/Light/Full, defaults to Off). Light handles InMonth+DayOfMonth
direct solves; Full adds DayOfWeek pruning for ranges ≤60 days.
PrepassMetrics tracks pruned_candidates, prepass_steps, scan_steps_saved.

Beta sampling via Marsaglia-Tsang Gamma method + Box-Muller normal.

https://claude.ai/code/session_01RnwD4x5cbpB7FPvoyYQz8G
2026-02-15 23:40:05 +00:00
Claude
e199312e3b refine(ablation): flip sign, wire penalty, expand buckets
Fixed policy sign flip (Mode A):
  risk_score = R - 30*D (was R + 30*D)
  Distractors now reduce effective range, making Mode A conservative
  under distractors. This is the defensible control arm: a rational
  fixed agent should be more cautious when distractors are present.
  Mode C must learn to outperform this baseline.

EarlyCommitPenalty wired into bandit reward:
  SkipModeStats now tracks early_commit_penalty_sum per arm.
  reward() includes robustness_penalty = 0.2 * avg_penalty.
  This means Mode C can actually learn to avoid early wrong commits
  in distractor-heavy contexts. Previously the penalty was only
  printed, not optimized.

Context buckets expanded to 18:
  3 range (small/medium/large) × 3 distractor (clean/some/heavy)
  × 2 noise (clean/noisy) = 18 buckets.
  Previous: 4 range × 2 distractor = 8 (too coarse for bandit).
  Noise flag now flows through AdaptiveSolver.noisy_hint.

New ablation assertion:
  c_penalty_better_than_b: Mode C EarlyCommitPenalty must be ≤90%
  of Mode B penalty. Proves robustness improvement is explicit,
  not just noise_accuracy-based.

Acceptance test noise plumbing:
  solver.noisy_hint set to true for noisy puzzles in both training
  and holdout evaluation. Context buckets now correctly distinguish
  clean vs noisy conditions.

81 tests passing (61 lib + 20 integration).

https://claude.ai/code/session_01RnwD4x5cbpB7FPvoyYQz8G
2026-02-15 23:19:43 +00:00
Claude
aab38ed45b
refine(ablation): flip sign, wire penalty, expand buckets
Fixed policy sign flip (Mode A):
  risk_score = R - 30*D (was R + 30*D)
  Distractors now reduce effective range, making Mode A conservative
  under distractors. This is the defensible control arm: a rational
  fixed agent should be more cautious when distractors are present.
  Mode C must learn to outperform this baseline.

EarlyCommitPenalty wired into bandit reward:
  SkipModeStats now tracks early_commit_penalty_sum per arm.
  reward() includes robustness_penalty = 0.2 * avg_penalty.
  This means Mode C can actually learn to avoid early wrong commits
  in distractor-heavy contexts. Previously the penalty was only
  printed, not optimized.

Context buckets expanded to 18:
  3 range (small/medium/large) × 3 distractor (clean/some/heavy)
  × 2 noise (clean/noisy) = 18 buckets.
  Previous: 4 range × 2 distractor = 8 (too coarse for bandit).
  Noise flag now flows through AdaptiveSolver.noisy_hint.

New ablation assertion:
  c_penalty_better_than_b: Mode C EarlyCommitPenalty must be ≤90%
  of Mode B penalty. Proves robustness improvement is explicit,
  not just noise_accuracy-based.

Acceptance test noise plumbing:
  solver.noisy_hint set to true for noisy puzzles in both training
  and holdout evaluation. Context buckets now correctly distinguish
  clean vs noisy conditions.

81 tests passing (61 lib + 20 integration).

https://claude.ai/code/session_01RnwD4x5cbpB7FPvoyYQz8G
2026-02-15 23:19:43 +00:00
Claude
161f97178a refine(ablation): risk_score policy, normalized penalty, witness log
PolicyKernel refinements:
- Fixed policy (Mode A): risk_score = R + k*D, k=30, T=140
  Fixed constants (not learned) — Mode A is the control arm.
  One distractor raises perceived risk by ~30 range-days.
  Weekday only when range is large AND distractor-free.
- Normalized EarlyCommitPenalty: (remaining/initial) * scale
  Committing at 5% scan = cheap (0.05), at 90% = expensive (0.90).
  Only charged on wrong commits.
- Hybrid minimum evidence: stop_after_first disabled in Hybrid mode
  so solver checks all matching weekdays before committing.

Witness log:
- SolutionAttempt now carries skip_mode and context_bucket strings
- record_attempt_witnessed() for full policy audit trail
- Every trajectory records which skip mode was chosen and why

Observability:
- Puzzle tags now include distractor_count and has_dow (deterministic)
- count_distractors() made public for generator to tag puzzles

Ablation assertions (two new):
- a_skip_nonzero: Mode A uses skip at least sometimes (proves not hobbled)
- c_multi_mode: Mode C uses different skip modes across contexts (proves learning)
- Skip-mode distribution table printed per context bucket for Mode C

posterior_target monotonicity verified: 2→4→8→12→18→25→35→50→70→100
(never shrinks with difficulty)

81 tests passing (61 lib + 20 integration).

https://claude.ai/code/session_01RnwD4x5cbpB7FPvoyYQz8G
2026-02-15 23:08:02 +00:00
Claude
38228a9a6d
refine(ablation): risk_score policy, normalized penalty, witness log
PolicyKernel refinements:
- Fixed policy (Mode A): risk_score = R + k*D, k=30, T=140
  Fixed constants (not learned) — Mode A is the control arm.
  One distractor raises perceived risk by ~30 range-days.
  Weekday only when range is large AND distractor-free.
- Normalized EarlyCommitPenalty: (remaining/initial) * scale
  Committing at 5% scan = cheap (0.05), at 90% = expensive (0.90).
  Only charged on wrong commits.
- Hybrid minimum evidence: stop_after_first disabled in Hybrid mode
  so solver checks all matching weekdays before committing.

Witness log:
- SolutionAttempt now carries skip_mode and context_bucket strings
- record_attempt_witnessed() for full policy audit trail
- Every trajectory records which skip mode was chosen and why

Observability:
- Puzzle tags now include distractor_count and has_dow (deterministic)
- count_distractors() made public for generator to tag puzzles

Ablation assertions (two new):
- a_skip_nonzero: Mode A uses skip at least sometimes (proves not hobbled)
- c_multi_mode: Mode C uses different skip modes across contexts (proves learning)
- Skip-mode distribution table printed per context bucket for Mode C

posterior_target monotonicity verified: 2→4→8→12→18→25→35→50→70→100
(never shrinks with difficulty)

81 tests passing (61 lib + 20 integration).

https://claude.ai/code/session_01RnwD4x5cbpB7FPvoyYQz8G
2026-02-15 23:08:02 +00:00
Claude
8bc077aeff feat(ablation): PolicyKernel, DifficultyVector, fair mode comparison
All modes now share the same solver capabilities. What differs is
the policy mechanism that decides *when* to use them:

- Mode A: fixed heuristic (posterior_range + distractor_count)
- Mode B: compiler-suggested skip_mode from constraint signatures
- Mode C: learned PolicyKernel (contextual bandit over skip modes)

Key changes:

PolicyKernel (temporal.rs):
- SkipMode enum: None | Weekday | Hybrid
- fixed_policy(): if DayOfWeek AND range>30 AND no distractors → Weekday
- compiled_policy(): uses CompiledSolveConfig.compiled_skip_mode
- learned_policy(): epsilon-greedy over per-context SkipModeStats
- EarlyCommitPenalty: tracks solved-but-wrong from aggressive skipping
- Hybrid mode: weekday skip + ±7 day refinement pass for safety

DifficultyVector (timepuzzles.rs):
- Replaces single-axis difficulty with (range_size, posterior_target,
  distractor_rate, noise_rate, ambiguity_count)
- Flipped relationship: higher difficulty = wider range + more ambiguity
  (not tighter posterior)
- Distractor DayOfWeek (difficulty 6+): DayOfWeek present but paired
  with wider Between that makes unconditional skipping risky

Ablation fairness (acceptance_test.rs):
- Removed feature gating: skip_weekday no longer forbidden for Mode A
- All modes access same solver knobs, differ only by policy
- AblationResult tracks PolicyKernel metrics (early_commit_rate, etc)
- Comparison print shows policy differences explicitly

81 tests passing (61 lib + 20 integration).

https://claude.ai/code/session_01RnwD4x5cbpB7FPvoyYQz8G
2026-02-15 22:54:28 +00:00
Claude
fa69d5e247
feat(ablation): PolicyKernel, DifficultyVector, fair mode comparison
All modes now share the same solver capabilities. What differs is
the policy mechanism that decides *when* to use them:

- Mode A: fixed heuristic (posterior_range + distractor_count)
- Mode B: compiler-suggested skip_mode from constraint signatures
- Mode C: learned PolicyKernel (contextual bandit over skip modes)

Key changes:

PolicyKernel (temporal.rs):
- SkipMode enum: None | Weekday | Hybrid
- fixed_policy(): if DayOfWeek AND range>30 AND no distractors → Weekday
- compiled_policy(): uses CompiledSolveConfig.compiled_skip_mode
- learned_policy(): epsilon-greedy over per-context SkipModeStats
- EarlyCommitPenalty: tracks solved-but-wrong from aggressive skipping
- Hybrid mode: weekday skip + ±7 day refinement pass for safety

DifficultyVector (timepuzzles.rs):
- Replaces single-axis difficulty with (range_size, posterior_target,
  distractor_rate, noise_rate, ambiguity_count)
- Flipped relationship: higher difficulty = wider range + more ambiguity
  (not tighter posterior)
- Distractor DayOfWeek (difficulty 6+): DayOfWeek present but paired
  with wider Between that makes unconditional skipping risky

Ablation fairness (acceptance_test.rs):
- Removed feature gating: skip_weekday no longer forbidden for Mode A
- All modes access same solver knobs, differ only by policy
- AblationResult tracks PolicyKernel metrics (early_commit_rate, etc)
- Comparison print shows policy differences explicitly

81 tests passing (61 lib + 20 integration).

https://claude.ai/code/session_01RnwD4x5cbpB7FPvoyYQz8G
2026-02-15 22:54:28 +00:00
Claude
2474d3296d feat(generator): posterior-targeting puzzle generation, weekday skipping PolicyKernel
Generator hardening:
- Rewrite puzzle generator with difficulty-based posterior targeting (30-365 day ranges)
- Remove InMonth/DayRange over-constraining from low difficulties
- DayOfWeek constraint (difficulty 3+) creates 7x cost surface for solver optimization
- Distractor injection at difficulty 5+ (redundant constraints that don't narrow search)
- target_posterior() scales 300→20 across difficulty 1→10

Solver PolicyKernel:
- Add skip_weekday: Option<Weekday> to TemporalSolver
- Weekday skipping advances by 7 days instead of 1 when DayOfWeek constraint detected
- Wire into AdaptiveSolver for compiler/router modes (B and C)
- Mode A (baseline) scans linearly, Mode B/C skip to matching weekdays

Correctness:
- Relax correctness check: "every expected solution found" (not "only expected found")
- Wide posteriors have many valid dates; only target inclusion matters
- Integration test step budget increased to 400 for wider ranges

Ablation results:
- Mode A: 195.96 cost/solve (full linear scan)
- Mode B: 68.80 cost/solve (65% reduction via weekday skipping)
- Mode C: 68.80 cost/solve (65% reduction, same as B)
- B beats A on cost: PASS (65% > 15% threshold)
- Compiler false-hit rate: PASS (<5%)
- 81 tests passing (61 unit + 20 integration)

https://claude.ai/code/session_01RnwD4x5cbpB7FPvoyYQz8G
2026-02-15 22:31:12 +00:00