Commit graph

2462 commits

Author SHA1 Message Date
rUv
1ab5240956 feat: ADR-119 historical crawl evolutionary comparison
Implement temporal knowledge evolution tracking across quarterly
Common Crawl snapshots (2020-2026). Includes:
- ADR-119 with architecture, cost model, acceptance criteria
- Historical crawl import script (14 quarterly snapshots, 5 domains)
- Evolutionary analysis module (drift detection, concept birth, similarity)
- Initial analysis report on existing brain content (71 memories)

Cost: ~$7-15 one-time for full 2020-2026 import.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-22 00:28:13 +00:00
rUv
a81c13514c feat: Common Crawl Phase 1 deployment script — medical domain scheduler jobs
Deploy CDX-targeted crawl for PubMed + dermatology domains via Cloud Scheduler.
Uses static Bearer auth (brain server API key) instead of OIDC since Cloud Run
allows unauthenticated access and brain's auth rejects long JWT tokens.

Jobs: brain-crawl-medical (daily 2AM, 100 pages), brain-crawl-derm (daily 3AM,
50 pages), brain-partition-cache (hourly graph rebuild).

Tested: 10 new memories injected from first run (1568->1578). CDX falls back to
Wayback API from Cloud Run. ADR-118 Phase 1 implementation.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-22 00:14:12 +00:00
rUv
25d311c902 fix(brain): make InjectRequest.source optional for batch inject
The batch endpoint falls back to BatchInjectRequest.source when items
don't have their own source field, but serde deserialization failed
before the handler could apply this logic (422). Adding #[serde(default)]
lets items omit source when using batch inject.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-22 00:14:00 +00:00
rUv
142ab2b348 docs: Common Crawl Phase 1 benchmark — pipeline validation results
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-22 00:09:19 +00:00
rUv
cc6bc949e7 docs: add pi.ruv.io brain guidance and project structure to CLAUDE.md
- When/how to use brain MCP tools during development
- Brain REST API fallback when MCP SSE is stale
- Google Cloud secrets and deployment reference
- Project directory structure quick reference
- Key rules: no PHI/secrets in brain, category taxonomy, stale session fix

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-22 00:02:25 +00:00
rUv
5a592fdf6b docs: ADR-115 cost-effective strategy + ADR-118 tiered crawl budget
Add Section 15 to ADR-115 with cost-effective implementation strategy:
- Three-phase budget model ($11-28/mo -> $73-108 -> $158-308)
- CostGuardrails Rust struct with per-phase presets
- Sparsifier-aware graph management (partition on sparse edges)
- Partition timeout fix via caching + background recompute
- Cloud Scheduler YAML for crawl jobs
- Anti-patterns and cost monitoring

Create ADR-118 as standalone cost strategy ADR with:
- Detailed per-phase cost breakdowns
- Guardrail enforcement points
- Partition caching strategy with request flow
- Acceptance criteria tied to cost targets

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-22 00:00:33 +00:00
rUv
55d55f152c docs: update links in README for self-learning, self-optimizing, embeddings, verified training, search, storage, PostgreSQL, graph, AI runtime, ML framework, coherence, domain models, hardware, kernel, coordination, packaging, routing, observability, safety, crypto, and lineage sections 2026-03-21 23:28:55 +00:00
rUv
60416d33f9 chore: update gitignore for nested .env files and Cargo.lock
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-21 23:20:46 +00:00
rUv
426f3bbda7 fix(ruvocal): MCP SSE auto-reconnect on stale session (404/connection errors)
- Widen isConnectionClosedError to catch 404, fetch failed, ECONNRESET
- Add transport readyState check in clientPool for dead connections
- Retry logic now triggers reconnection on stale SSE sessions

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-21 22:54:39 +00:00
rUv
53b567acd2 fix(ruvocal): fix icon 404 and FoundationBackground crash
- Manifest icon paths: /chat/chatui/ → /chatui/ (matches static dir)
- FoundationBackground: guard against undefined particles in connections

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-21 22:20:46 +00:00
rUv
66ed6b0b00 revert: restore ui/ruvocal to main state -- remove DrAgnes commingling
Remove all DrAgnes-related files, components, routes, and config from
ui/ruvocal/ so it matches the main branch exactly. DrAgnes now lives
as a standalone app in examples/dragnes/.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-21 22:15:57 +00:00
rUv
fde768f86d refactor(dragnes): move to standalone examples/dragnes/ app
Extract DrAgnes dermatology intelligence platform from ui/ruvocal/ into
a self-contained SvelteKit application under examples/dragnes/. Includes
all library modules, components, API routes, tests, deployment config,
PWA assets, and research documentation. Updated paths for standalone
routing (no /dragnes prefix), fixed static asset references, and
adjusted test imports.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-21 22:15:50 +00:00
rUv
48d1ae8e69 feat(dragnes): wire HAM10000 demographics into UI
- Add patient age/sex inputs in Capture tab
- Toggle for HAM10000 Bayesian adjustment
- Pass body location from DermCapture to classifyWithDemographics()
- Clinical recommendation banner in Results tab with color-coded
  risk levels (urgent_referral/biopsy/monitor/reassurance)
- Shows melanoma + malignant probabilities and reasoning

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-21 22:10:17 +00:00
rUv
6243f2e3e0 feat(dragnes): integrate HAM10000 knowledge into classifier
Add classifyWithDemographics() method to DermClassifier that applies Bayesian
demographic adjustment after CNN classification. Returns both raw and adjusted
probabilities for transparency, plus clinical recommendations (biopsy, urgent
referral, monitor, or reassurance) based on HAM10000 evidence thresholds.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-21 22:06:57 +00:00
rUv
d493c57bb3 feat(dragnes): HAM10000 clinical knowledge module with demographic adjustment
Add ham10000-knowledge.ts encoding verified HAM10000 statistics as structured
data for Bayesian demographic adjustment. Includes per-class age/sex/location
risk multipliers, clinical decision thresholds (biopsy at P(mal)>30%, urgent
referral at P(mel)>50%), and adjustForDemographics() function implementing
posterior probability correction based on patient demographics.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-21 22:06:52 +00:00
rUv
2ab8f341da data(dragnes): HAM10000 metadata and analysis script
Add comprehensive analysis of the HAM10000 skin lesion dataset based on
published statistics from Tschandl et al. 2018. Generates class distribution,
demographic, localization, diagnostic method, and clinical risk pattern
analysis. Outputs both markdown report and JSON stats for the knowledge module.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-21 22:06:45 +00:00
rUv
b7a0ee8d76 fix(dragnes): require ≥2 concurrent evidence signals for melanoma
A uniformly dark spot was triggering melanoma at 74.5%. Now requires
at least 2 of: [dark >15%, blue-gray >3%, ≥3 colors, high variance]
to overcome the melanoma prior. Proven on 6 synthetic test cases:
0 false positives, 1/1 true melanoma detected at 91.3%.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-21 21:56:05 +00:00
rUv
304cd4f7ed fix(dragnes): reduce false positives with Bayesian-calibrated classifier
Apply HAM10000 class priors as Bayesian log-priors to demo classifier,
learned from pi.ruv.io brain specialist agent patterns:
- nv (66.95%) gets strong prior, reducing over-classification of rare types
- mel requires multiple simultaneous features (dark + blue + multicolor +
  high variance) to overcome its 11.11% prior
- Added color variance analysis as asymmetry proxy
- Added dermoscopic color count for multi-color detection
- Platt-calibrated feature weights from brain melanoma specialist

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-21 21:51:21 +00:00
rUv
986c5b05ba fix(dragnes): use @vite-ignore for optional @ruvector/cnn import
Prevents Vite dev server from failing on the optional WASM dependency
by using /* @vite-ignore */ comment and variable-based import path.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-21 21:44:47 +00:00
rUv
79a8be8974 feat(dragnes): benchmarks, dataset metadata, federated learning, deployment runbook
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-21 21:40:09 +00:00
rUv
45a8b2bf94 feat(dragnes): app integration, health endpoint, build validation
- Add DrAgnes nav link to sidebar NavMenu
- Create /api/dragnes/health endpoint with config status
- Add config module exporting DRAGNES_CONFIG
- Update DrAgnes page with loading state & error boundaries
- All 37 tests pass, production build succeeds

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-21 21:37:52 +00:00
rUv
1607e3585e fix(dragnes): resolve build errors by externalizing @ruvector/cnn
Mark @ruvector/cnn as external in Rollup/SSR config so the dynamic
import in the classifier does not break the production build.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-21 21:37:46 +00:00
rUv
05e813be28 feat(dragnes): CNN classification pipeline with ABCDE scoring and privacy layer
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-21 21:28:03 +00:00
rUv
c0e6d02a20 feat(dragnes): brain integration — pi.ruv.io client, offline queue, witness chains, API routes
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-21 21:26:52 +00:00
rUv
d2a401d469 docs(dragnes): user-facing documentation and clinical guide
Add comprehensive DrAgnes documentation covering:
- Getting started and PWA installation
- DermLite device integration instructions
- HAM10000 classification taxonomy and result interpretation
- ABCDE dermoscopy scoring methodology
- Privacy architecture (DP, k-anonymity, witness hashing)
- Offline mode and background sync behavior
- Troubleshooting guide
- Clinical disclaimer and regulatory status

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-21 21:25:53 +00:00
rUv
63630a2259 feat(dragnes): deployment config — Dockerfile, Cloud Run, PWA manifest, service worker
Add production deployment infrastructure for DrAgnes:
- Multi-stage Dockerfile with Node 20 Alpine and non-root user
- Cloud Run knative service YAML (1-10 instances, 2 vCPU, 2 GiB)
- GCP deploy script with rollback support and secrets integration
- PWA manifest with SVG icons (192x192, 512x512)
- Service worker with offline WASM caching and background sync
- TypeScript configuration module with CNN, privacy, and brain settings

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-21 21:25:47 +00:00
rUv
2a361c2443 docs: ADR-117 DrAgnes dermatology intelligence platform
Proposes DrAgnes as an AI-powered dermatology platform built on
RuVector's CNN, brain, and WASM infrastructure. Covers architecture,
data model, API design, HIPAA/FDA compliance strategy, 4-phase
implementation plan (2026-2051), cost model showing $3.89/practice
at scale, and acceptance criteria targeting >95% melanoma sensitivity
with offline-first WASM inference in <200ms.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-21 21:09:55 +00:00
rUv
a91dee96c5 docs: DrAgnes competitive analysis and deployment plan research
Competitive analysis covers SkinVision, MoleMap, MetaOptima, Canfield,
Google Health, 3Derm, and MelaFind with feature matrix comparison.
Deployment plan details Google Cloud architecture with Cloud Run
services, Firestore/GCS data storage, Pub/Sub events, multi-region
strategy, security configuration, cost projections ($3.89/practice at
1000-practice scale), and disaster recovery procedures.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-21 21:08:15 +00:00
rUv
1168492e74 docs: DrAgnes DermLite integration and 25-year future vision research
DermLite integration covers HUD/DL5/DL4/DL200 device capabilities,
image capture via MediaStream API, ABCDE criteria automation, 7-point
checklist, Menzies method, and pattern analysis modules. Future vision
spans AR-guided biopsy (2028), continuous monitoring wearables (2040),
genomic fusion (2035), BCI clinical gestalt (2045), and global
elimination of late-stage melanoma detection by 2050.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-21 21:05:05 +00:00
rUv
e049280420 docs: DrAgnes HIPAA compliance strategy and data sources research
Comprehensive HIPAA/FDA compliance framework covering PHI handling,
PII stripping pipeline, differential privacy, witness chain auditing,
BAA requirements, and risk analysis. Data sources document catalogs
18 training datasets, medical literature sources, and real-world data
streams including HAM10000, ISIC Archive, and Fitzpatrick17k.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-21 21:01:41 +00:00
rUv
977da904d4 docs: DrAgnes project overview and system architecture research
Establishes the DrAgnes AI-powered dermatology intelligence platform
research initiative with comprehensive system architecture covering
DermLite integration, CNN classification pipeline, brain collective
learning, offline-first PWA design, and 25-year evolution roadmap.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-21 20:58:43 +00:00
rUv
3e554c9b56 fix: patch manhattan_distance SIMD call in Docker build
The Dockerfile comments out the simd_intrinsics module but distance.rs
still referenced it. Replace with pure Rust fallback for Cloud Run build.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-20 15:38:27 +00:00
github-actions[bot]
2e51931006 chore: Update NAPI-RS binaries for all platforms
Built from commit 61164d9b13

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

  🤖 Generated by GitHub Actions
2026-03-20 15:35:42 +00:00
rUv
61164d9b13
feat: integrate ruvector-sparsifier into pi.ruv.io brain server (ADR-116)
* feat: integrate ruvector-sparsifier into brain server (ADR-116)

- Add ruvector-sparsifier dependency to mcp-brain-server
- KnowledgeGraph now maintains an AdaptiveGeoSpar alongside full graph
- Sparsifier updates incrementally on add_memory / remove_memory
- Lazy initialization: sparsifier builds on first access or startup hydration
- rebuild_graph optimization action also rebuilds the sparsifier
- StatusResponse exposes sparsifier_compression and sparsifier_edges
- Full graph preserved for exact lookups — sparsifier is additive only

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

* build: add ruvector-sparsifier to Docker build context

- Add COPY for ruvector-sparsifier crate
- Add to workspace members in Cargo.workspace.toml
- Strip bench/example sections from sparsifier Cargo.toml in Docker

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-20 11:31:16 -04:00
github-actions[bot]
ada82c54eb chore: Update NAPI-RS binaries for all platforms
Built from commit 9679411f33

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

  🤖 Generated by GitHub Actions
2026-03-20 15:20:10 +00:00
github-actions[bot]
92ffe22cf8 chore: Update NAPI-RS binaries for all platforms
Built from commit 881e57e5b9

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

  🤖 Generated by GitHub Actions
2026-03-20 15:19:12 +00:00
rUv
9679411f33 chore: move ADR-116 to docs/adr/
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-20 15:15:39 +00:00
rUv
881e57e5b9 docs: ADR-116 spectral sparsifier integration with pi.ruv.io
Describes how ruvector-sparsifier integrates into the brain server's
KnowledgeGraph for O(n log n) analytics instead of O(n²).

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-20 15:14:54 +00:00
github-actions[bot]
45ea86ef18 chore: Update NAPI-RS binaries for all platforms
Built from commit 4737167184

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

  🤖 Generated by GitHub Actions
2026-03-20 14:51:05 +00:00
rUv
4737167184 docs: add ruvector-sparsifier to root README
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-20 14:46:29 +00:00
github-actions[bot]
08d9a54506 chore: Update NAPI-RS binaries for all platforms
Built from commit 3b0cfaad05

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

  🤖 Generated by GitHub Actions
2026-03-20 14:43:23 +00:00
github-actions[bot]
4631f9c33a chore: Update NAPI-RS binaries for all platforms
Built from commit 1d60bf0a28

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

  🤖 Generated by GitHub Actions
2026-03-20 14:42:42 +00:00
rUv
3b0cfaad05 fix: shorten keywords for crates.io 20-char limit
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-20 14:38:05 +00:00
rUv
1d60bf0a28
feat: add ruvector-sparsifier — dynamic spectral graph sparsification
* feat: add ruvector-sparsifier crate — dynamic spectral graph sparsification

Implements AdaptiveGeoSpar, a dynamic spectral sparsifier that maintains
a compressed shadow graph preserving Laplacian energy within (1±ε).

Core crate (ruvector-sparsifier):
- SparseGraph with dynamic edge operations and Laplacian QF
- Backbone spanning forest via union-find for connectivity
- Random walk effective resistance estimation for importance scoring
- Spectral sampling proportional to weight × importance × log(n)/ε²
- SpectralAuditor with quadratic form, cut, and conductance probes
- Pluggable traits: Sparsifier, ImportanceScorer, BackboneStrategy
- 49 tests (31 unit + 17 integration + 1 doc-test), all passing
- Benchmarks: build 161µs, insert 81µs, audit 39µs (n=100)

WASM crate (ruvector-sparsifier-wasm):
- Full wasm-bindgen bindings via WasmSparsifier and WasmSparseGraph
- JSON-based API for browser/edge deployment
- Compiles cleanly on native target

Research (docs/research/spectral-sparsification/):
- 00: Executive summary and impact projections
- 01: SOTA survey (ADKKP 2016 → STACS 2026)
- 02: Rust crate design and API
- 03: RuVector integration architecture (4-tier control plane)
- 04: Companion systems (conformal drift, attributed ANN)

https://claude.ai/code/session_01A6YKtTrSPeV36Xamz9hRCb

* perf: ultra optimizations across core distance, SIMD, and sparsifier hot paths

Core distance.rs:
- Manhattan distance now delegates to SIMD (was pure scalar)
- Cosine fallback uses single-pass computation (was 3 separate passes)
- Euclidean fallback uses 4x loop unrolling for better ILP

SIMD intrinsics:
- Add AVX2 manhattan distance (was only AVX-512 or scalar fallback)
- 2x loop unrolling with dual accumulators for AVX2 manhattan
- Sign-bit mask absolute value for branchless abs diff

Sparsifier (O(m) -> O(1) per insert):
- Cache total importance to avoid iterating ALL edges per insert
- Parallel edge scoring via rayon for graphs >100 edges
- Pre-sized HashMap adjacency lists (4 neighbors avg)
- Inline annotations on hot-path graph query methods

https://claude.ai/code/session_01A6YKtTrSPeV36Xamz9hRCb

* fix: resolve clippy warnings in ruvector-sparsifier

- Replace map_or(false, ...) with is_some_and(...) in graph.rs
- Derive Default instead of manual impl for LocalImportanceScorer
- Fix inner/outer attribute conflict on prelude module

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-03-20 10:37:39 -04:00
github-actions[bot]
47c7c67759 chore: Update NAPI-RS binaries for all platforms
Built from commit 1268423d57

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

  🤖 Generated by GitHub Actions
2026-03-18 14:39:14 +00:00
rUv
1268423d57
Merge pull request #268 from ruvnet/fix/wasm-mincut-time-panic-267
fix: WasmMinCut Node.js panic from std::time (fixes #267)
2026-03-18 10:34:08 -04:00
Reuven
a8969348a1 chore: update agent configs, helpers, and ruvector package
Update Claude agent definitions, streamline statusline helper,
improve hook handler routing, and fix native worker compatibility.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-18 10:33:41 -04:00
Reuven
02210c6be9 fix: WasmMinCut Node.js panic from std::time (fixes #267)
The WASM build was panicking in Node.js because std::time::Instant
is not supported on wasm32-unknown-unknown target. This fix:

- Adds time_compat module with PortableInstant/PortableTimestamp
- Uses monotonic counter in WASM mode (sufficient for ordering/stats)
- Uses std::time::Instant on native platforms (accurate timing)
- Updates algorithm, canonical, certificate, optimization, subpolynomial modules

The fix uses conditional compilation via the existing `wasm` feature flag.

Closes #267

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-18 08:02:35 -04:00
github-actions[bot]
5b95c99632 chore: Update NAPI-RS binaries for all platforms
Built from commit 593ad1a099

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

  🤖 Generated by GitHub Actions
2026-03-17 21:02:06 +00:00
Reuven
593ad1a099 fix: HNSW index out-of-bounds and ONNX routing fallback
HNSW fix (ruvllm-wasm v2.0.2):
- Fixed panic at 12+ patterns caused by entry_point referencing
  non-existent index before pattern was pushed to array
- Added bounds checking in search_layer() as defensive measure

ONNX routing fix (ruvector v0.2.14):
- Fixed IntelligenceEngine.route() using sync embed() instead of
  async embedAsync(), causing fallback to hash embeddings
- Route now correctly uses ONNX 384-dim semantic embeddings

π.ruv.io hooks integration:
- Added SessionStart hook to sync LoRA weights from π.ruv.io
- Added Stop hook to share session summary
- Added PostToolUse[Task] hook to share successful completions
- Generated Pi key for authentication

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-17 16:57:50 -04:00