Commit Graph

131 Commits

Author SHA1 Message Date
rUv
5124a07965 refactor(rust-port): remove unused once-cell crate (#58)
refactor(rust-port): remove unused `once-cell` crate
v0.1.0-esp32
2026-03-01 02:36:51 -05:00
Tuan Tran
0723af8f8a update cargo.lock 2026-03-01 14:30:12 +07:00
Tuan Tran
504875e608 remove unused once-cell package 2026-03-01 14:26:29 +07:00
ruv
ab76925864 docs: Comprehensive CHANGELOG update covering v1.0.0 through v3.0.0
Rewrites CHANGELOG.md with detailed entries for every significant
feature, fix, and security patch across all three major versions:

- v3.0.0: AETHER contrastive embedding model (ADR-024), Docker Hub
  images, UI port auto-detection fix, Mermaid architecture diagrams,
  33 use cases across 4 verticals
- v2.0.0: Rust sensing server, DensePose training pipeline (ADR-023),
  RuVector v2.0.4 integration (ADR-016/017), ESP32-S3 firmware
  (ADR-018), SOTA signal processing (ADR-014), vital sign detection
  (ADR-021), WiFi-Mat disaster module, 7 security patches, Python
  sensing pipeline, Three.js visualization
- v1.1.0: Python CSI system, API services, UI dark mode
- v1.0.0: Initial release with core pose estimation

All entries reference specific commit hashes for traceability.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-01 02:20:52 -05:00
ruv
a6382fb026 feat: Add macOS CoreWLAN WiFi sensing adapter and user guide
- Introduced ADR-025 documenting the implementation of a macOS CoreWLAN sensing adapter using a Swift helper binary and Rust integration.
- Added a new user guide detailing installation, usage, and hardware setup for WiFi DensePose, including Docker and source build instructions.
- Included sections on data sources, REST API reference, WebSocket streaming, and vital sign detection.
- Documented hardware requirements and troubleshooting steps for various setups.
2026-03-01 02:15:44 -05:00
ruv
3b72f35306 fix: UI auto-detects server port from page origin (#55)
The UI had hardcoded localhost:8080 for HTTP and localhost:8765 for
WebSocket, causing "Backend unavailable" when served from Docker
(port 3000) or any non-default port.

Changes:
- api.config.js: BASE_URL now uses window.location.origin instead
  of hardcoded localhost:8080
- api.config.js: buildWsUrl() uses window.location.host instead of
  hardcoded localhost:8080
- sensing.service.js: WebSocket URL derived from page origin instead
  of hardcoded localhost:8765
- main.rs: Added /ws/sensing route to the HTTP server so WebSocket
  and REST are reachable on a single port

Fixes #55

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-01 02:09:23 -05:00
ruv
a0b5506b8c docs: rename embedding section to Self-Learning WiFi AI
Reframe the ADR-024 section header to emphasize AI self-learning and
adaptive optimization rather than technical CSI embedding terminology.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-01 01:47:21 -05:00
rUv
9bbe95648c feat: ADR-024 Contrastive CSI Embedding Model — all 7 phases (#52)
Full implementation of Project AETHER — Contrastive CSI Embedding Model.

## Phases Delivered
1. ProjectionHead (64→128→128) + L2 normalization
2. CsiAugmenter (5 physically-motivated augmentations)
3. InfoNCE contrastive loss + SimCLR pretraining
4. FingerprintIndex (4 index types: env, activity, temporal, person)
5. RVF SEG_EMBED (0x0C) + CLI integration
6. Cross-modal alignment (PoseEncoder + InfoNCE)
7. Deep RuVector: MicroLoRA, EWC++, drift detection, hard-negative mining, SEG_LORA

## Stats
- 276 tests passing (191 lib + 51 bin + 16 rvf + 18 vitals)
- 3,342 additions across 8 files
- Zero unsafe/unwrap/panic/todo stubs
- ~55KB INT8 model for ESP32 edge deployment

Also fixes deprecated GitHub Actions (v3→v4) and adds feat/* branch CI triggers.

Closes #50
2026-03-01 01:44:38 -05:00
ruv
44b9c30dbc fix: Docker port mismatch — server now binds 3000/3001 as documented
The sensing server defaults to HTTP :8080 and WS :8765, but Docker
exposes :3000/:3001. Added --http-port 3000 --ws-port 3001 to CMD
in both Dockerfile.rust and docker-compose.yml.

Verified both images build and run:
- Rust: 133 MB, all endpoints responding (health, sensing/latest,
  vital-signs, pose/current, info, model/info, UI)
- Python: 569 MB, all packages importable (websockets, fastapi)
- RVF file: 13 KB, valid RVFS magic bytes

Also fixed README Quick Start endpoints to match actual routes:
- /api/v1/health → /health
- /api/v1/sensing → /api/v1/sensing/latest
- Added /api/v1/pose/current and /api/v1/info examples
- Added port mapping note for Docker vs local dev

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-01 00:56:41 -05:00
ruv
50f0fc955b docs: Replace ASCII architecture with Mermaid diagrams
Replace the single ASCII box diagram with 3 styled Mermaid diagrams:

1. End-to-End Pipeline — full data flow from WiFi routers through
   signal processing (6 stages with ruvector crate labels), neural
   pipeline (graph transformer + SONA), vital signs, to output layer
   (REST, WebSocket, Analytics, UI). Dark theme with color-coded
   subsystem groups.

2. Signal Processing Detail — zoomed-in CSI cleanup pipeline showing
   conjugate multiply, phase unwrap, Hampel filter, min-cut partition,
   attention gate, STFT, Fresnel, and BVP stages.

3. Deployment Topology — ESP32 mesh (edge) → Rust sensing server
   (3 ports) → clients (browser, mobile, dashboard, IoT).

Component table expanded from 7 to 11 entries with crate/module
column linking each component to its source.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-01 00:48:57 -05:00
ruv
0afd9c5434 docs: Expand Use Cases into visible intro + 4 collapsed verticals
Restructure Use Cases & Applications as a visible section with:
- Intro paragraph + scaling note (always visible)
- "Why WiFi wins" comparison table vs cameras/PIR (always visible)
- 4 collapsed tiers: Everyday (8 use cases), Specialized (9),
  Robotics & Industrial (8, new), Extreme (8)
- Each row now includes a Key Metric column
- New robotics section: cobots, AMR navigation, android spatial
  awareness, manufacturing, construction, agricultural, drones,
  clean rooms

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-01 00:45:21 -05:00
ruv
965a1ccef2 docs: Enrich Models & Training section with RuVector repo links
- ToC: Add ruvector GitHub link and integration point count
- RVF Container: Add deployment targets table (ESP32 0.7MB to server
  50MB), link to rvf crate family on GitHub
- Training: Add RuVector column to pipeline table showing which crate
  powers each phase, add SONA component breakdown table, link arXiv
- RuVector Crates: Split into 5 directly-used (with integration
  points mapped to exact .rs files) and 6 additional vendored, add
  crates.io and GitHub source links for all 11

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-01 00:41:05 -05:00
ruv
b5ca361f0e docs: Add use cases section and fix multi-person limit accuracy
Add collapsible Use Cases & Applications section organized from
practical (elderly care, hospitals, retail) to specialized (events,
warehouses) to extreme (search & rescue, through-wall). Includes
hardware requirements and scaling notes per category.

Fix multi-person description to reflect reality: no hard software
limit, practical ceiling is signal physics (~3-5 per AP at 56
subcarriers, linear scaling with multi-AP).

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-01 00:36:53 -05:00
ruv
e2ce250dba docs: Fix multi-person limit — configurable default, not hard cap
The 10-person limit is just the default setting (pose_max_persons=10).
The API accepts 1-50, docs show configs up to 50, and Rust uses Option<u8>.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-01 00:34:02 -05:00
ruv
50acbf7f0a docs: Move Installation and Quick Start above Table of Contents
Promotes Installation and Quick Start to top-level sections placed
between Key Features and Table of Contents for faster onboarding.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-01 00:31:59 -05:00
ruv
0ebd6be43f docs: Collapse Rust Implementation and Performance Metrics sections
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-01 00:27:50 -05:00
ruv
528b3948ab docs: Add CSI hardware requirement notice to README
Consumer WiFi does not expose Channel State Information — clarify that
pose estimation, vital signs, and through-wall sensing require ESP32-S3
or a research NIC. Added Full CSI column to hardware options table.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-01 00:27:20 -05:00
ruv
99ec9803ae docs: Collapse System Architecture into details element
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-01 00:25:46 -05:00
ruv
478d9647ac docs: Improve README sections with rich detail, emoji features, and collapsed groups
- Add emoji key features table above ToC in plain language
- Expand WiFi-Mat section: START triage table, deployment modes, safety guarantees, performance targets
- Expand SOTA Signal Processing: math formulas, why-it-matters explanations, processing pipeline order
- Expand RVF Container: ASCII structure diagram, 20+ segment types, size examples
- Expand Training: 8-phase pipeline table with line counts, best-epoch snapshotting, three-tier strategy table
- Collapse Architecture, Testing, Changelog, and Release History sections
- Fix date in Meta section (March 2025)
- All 22 anchor links and 27 file links verified

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-01 00:24:57 -05:00
ruv
e8e4bf6da9 fix: Update project development start date in README 2026-03-01 00:19:46 -05:00
ruv
3621baf290 docs: Reorganize README with collapsible ToC, ADR doc links, and verified anchors
- Improve introduction: bold tagline, capability summary table, updated badges
- Restructure ToC into 6 collapsible groups with introductions and ADR doc links
- Add explicit HTML anchors for <details> subsections (22 internal links verified)
- Remove dead doc links (api_reference.md, deployment.md, user_guide.md)
- Fix ADR-018 filename (esp32-csi-streaming → esp32-dev-implementation)
- Organize sections: Signal Processing, Models, Architecture, Install, Quick Start, CLI, Testing, Deployment, Performance, Contributing, Changelog
- Expand changelog entries with release context and feature details
- Net reduction of 109 lines (264 insertions, 373 deletions)

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-01 00:19:26 -05:00
rUv
3b90ff2a38 feat: End-to-end training pipeline with RuVector signal intelligence (#49)
feat: End-to-end training pipeline with RuVector signal intelligence
2026-03-01 00:10:26 -05:00
ruv
3e245ca8a4 Implement feature X to enhance user experience and optimize performance 2026-03-01 00:08:44 -05:00
ruv
45f0304d52 fix: Review fixes for end-to-end training pipeline
- Snapshot best-epoch weights during training and restore before
  checkpoint/RVF export (prevents exporting overfit final-epoch params)
- Add CsiToPoseTransformer::zeros() for fast zero-init when weights
  will be overwritten, avoiding wasteful Xavier init during gradient
  estimation (~2*param_count transformer constructions per batch)
- Deduplicate synthetic data generation in main.rs training mode

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-28 23:58:20 -05:00
ruv
4cabffa726 Implement feature X to enhance user experience and optimize performance 2026-02-28 23:51:23 -05:00
ruv
3e06970428 feat: Training mode, ADR docs, vitals and wifiscan crates
- Add --train CLI flag with dataset loading, graph transformer training,
  cosine-scheduled SGD, PCK/OKS validation, and checkpoint saving
- Refactor main.rs to import training modules from lib.rs instead of
  duplicating mod declarations
- Add ADR-021 (vital sign detection), ADR-022 (Windows WiFi enhanced
  fidelity), ADR-023 (trained DensePose pipeline) documentation
- Add wifi-densepose-vitals crate: breathing, heartrate, anomaly
  detection, preprocessor, and temporal store
- Add wifi-densepose-wifiscan crate: 8-stage signal intelligence
  pipeline with netsh/wlanapi adapters, multi-BSSID registry,
  attention weighting, spatial correlation, and breathing extraction

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-28 23:50:20 -05:00
ruv
add9f192aa feat: Docker images, RVF export, and README update
- Add docker/ folder with Dockerfile.rust (132MB), Dockerfile.python (569MB),
  and docker-compose.yml
- Remove stale root-level Dockerfile and docker-compose files
- Implement --export-rvf CLI flag for standalone RVF package generation
- Generate wifi-densepose-v1.rvf (13KB) with model weights, vital config,
  SONA profile, and training provenance
- Update README with Docker pull/run commands and RVF export instructions
- Update test count to 542+ and fix Docker port mappings
- Reply to issues #43, #44, #45 with Docker/RVF availability

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-28 23:44:30 -05:00
ruv
fc409dfd6a feat: ADR-023 full DensePose training pipeline (Phases 1-8)
Implement complete WiFi CSI-to-DensePose neural network pipeline:

Phase 1 - Dataset loaders: .npy/.mat v5 parsers, MM-Fi + Wi-Pose
  loaders, subcarrier resampling (114->56, 30->56), DataPipeline
Phase 2 - Graph transformer: COCO BodyGraph (17 kp, 16 edges),
  AntennaGraph, multi-head CrossAttention, GCN message passing,
  CsiToPoseTransformer full pipeline
Phase 4 - Training loop: 6-term composite loss (MSE, cross-entropy,
  UV regression, temporal consistency, bone length, symmetry),
  SGD+momentum, cosine+warmup scheduler, PCK/OKS metrics, checkpoints
Phase 5 - SONA adaptation: LoRA (rank-4, A*B delta), EWC++ Fisher
  regularization, EnvironmentDetector (3-sigma drift), temporal
  consistency loss
Phase 6 - Sparse inference: NeuronProfiler hot/cold partitioning,
  SparseLinear (skip cold rows), INT8/FP16 quantization with <0.01
  MSE, SparseModel engine, BenchmarkRunner
Phase 7 - RVF pipeline: 6 new segment types (Index, Overlay, Crypto,
  WASM, Dashboard, AggregateWeights), HNSW index, OverlayGraph,
  RvfModelBuilder, ProgressiveLoader (3-layer: A=instant, B=hot, C=full)
Phase 8 - Server integration: --model, --progressive CLI flags,
  4 new REST endpoints, WebSocket pose_keypoints + model_status

229 tests passing (147 unit + 48 bin + 34 integration)
Benchmark: 9,520 frames/sec (105μs/frame), 476x real-time at 20 Hz
7,832 lines of pure Rust, zero external ML dependencies

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-28 23:22:15 -05:00
ruv
1192de951a feat: ADR-021 vital sign detection + RVF container format (closes #45)
Implement WiFi CSI-based vital sign detection and RVF model container:

- Pure-Rust radix-2 DIT FFT with Hann windowing and parabolic interpolation
- FIR bandpass filter (windowed-sinc, Hamming) for breathing (0.1-0.5 Hz)
  and heartbeat (0.8-2.0 Hz) band isolation
- VitalSignDetector with rolling buffers (30s breathing, 15s heartbeat)
- RVF binary container with 64-byte SegmentHeader, CRC32 integrity,
  6 segment types (Vec, Manifest, Quant, Meta, Witness, Profile)
- RvfBuilder/RvfReader with file I/O and VitalSignConfig support
- Server integration: --benchmark, --load-rvf, --save-rvf CLI flags
- REST endpoint /api/v1/vital-signs and WebSocket vital_signs field
- 98 tests (32 unit + 16 RVF integration + 18 vital signs integration)
- Benchmark: 7,313 frames/sec (136μs/frame), 365x real-time at 20 Hz

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-28 22:52:19 -05:00
rUv
fd8dec5cab Merge pull request #42 from ruvnet/security/fix-critical-vulnerabilities
Security: Fix critical vulnerabilities (includes fr4iser90 PR #38 + fix)
2026-02-28 21:44:00 -05:00
ruv
e320bc95f0 fix: Remove process.env reference from browser ES module
process.env does not exist in vanilla browser ES modules (no bundler).
Use window.location.protocol check only for WSS detection.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-28 21:42:42 -05:00
rUv
dd419daa81 Merge pull request #40 from ruvnet/feat/rust-ruvector-sensing-ui
feat: Rust sensing server with full DensePose-compatible API
2026-02-28 21:37:23 -05:00
ruv
d956c30f9e feat: Rust sensing server with full DensePose-compatible API
Replace Python FastAPI + WebSocket servers with a single 2.1MB Rust binary
(wifi-densepose-sensing-server) that serves all UI endpoints:

- REST: /health/*, /api/v1/info, /api/v1/pose/current, /api/v1/pose/stats,
  /api/v1/pose/zones/summary, /api/v1/stream/status
- WebSocket: /api/v1/stream/pose (pose_data with 17 COCO keypoints),
  /ws/sensing (raw sensing_update stream on port 8765)
- Static: /ui/* with no-cache headers

WiFi-derived pose estimation: derive_pose_from_sensing() generates 17 COCO
keypoints from CSI/WiFi signal data with motion-driven animation.

Data sources: ESP32 CSI via UDP :5005, Windows WiFi via netsh, simulation
fallback. Auto-detection probes each in order.

UI changes:
- Point all endpoints to Rust server on :8080 (was Python :8000)
- Fix WebSocket sensing URL to include /ws/sensing path
- Remove sensingOnlyMode gating — all tabs init normally
- Remove api.service.js sensing-only short-circuit
- Fix clearPingInterval bug in websocket.service.js

Also removes obsolete k8s/ template manifests.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-28 21:29:45 -05:00
fr4iser
ab2e7b49ad security: Fix GitHub Actions shell injection vulnerability
- Use environment variables instead of direct interpolation
- Prevent shell injection through github context data
- Follow GitHub security best practices
2026-02-28 20:40:25 +01:00
fr4iser
ac094d4a97 security: Fix insecure WebSocket connections
- Use wss:// in production and non-localhost environments
- Only allow ws:// for localhost development
- Improve WebSocket security configuration
2026-02-28 20:40:19 +01:00
fr4iser
896c4fc520 security: Fix path traversal vulnerabilities
- Add filename validation to prevent path traversal
- Validate resolved paths are within expected directories
- Check for dangerous path characters (.., /, \)
2026-02-28 20:40:13 +01:00
fr4iser
4cb01fd482 security: Fix command injection vulnerability in statusline.cjs
- Add input validation for command parameter
- Check for dangerous shell metacharacters
- Allow only safe command patterns
2026-02-28 20:40:05 +01:00
fr4iser
5db55fdd70 security: Fix XSS vulnerabilities in UI components
- Replace innerHTML with textContent and createElement
- Use safe DOM manipulation methods
- Prevents XSS attacks through user-controlled data
2026-02-28 20:40:00 +01:00
fr4iser
f9d125dfd8 security: Fix SQL injection vulnerabilities in status command and migrations
- Add table name whitelist validation in status.py
- Use SQLAlchemy ORM instead of raw SQL queries
- Replace string formatting with parameterized queries in migrations
- Add input validation for table names in migration scripts
2026-02-28 20:39:54 +01:00
ruv
cd5943df23 Merge commit 'd803bfe2b1fe7f5e219e50ac20d6801a0a58ac75' as 'vendor/ruvector' 2026-02-28 14:39:40 -05:00
ruv
d803bfe2b1 Squashed 'vendor/ruvector/' content from commit b64c2172
git-subtree-dir: vendor/ruvector
git-subtree-split: b64c21726f2bb37286d9ee36a7869fef60cc6900
2026-02-28 14:39:40 -05:00
ruv
7885bf6278 fix: Restore project-specific CLAUDE.md
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-28 14:39:17 -05:00
ruv
b7e0f07e6e feat: Sensing-only UI mode with Gaussian splat visualization and Rust migration ADR
- Add Python WebSocket sensing server (ws_server.py) with ESP32 UDP CSI
  and Windows RSSI auto-detect collectors on port 8765
- Add Three.js Gaussian splat renderer with custom GLSL shaders for
  real-time WiFi signal field visualization (blue→green→red gradient)
- Add SensingTab component with RSSI sparkline, feature meters, and
  motion classification badge
- Add sensing.service.js WebSocket client with reconnect and simulation fallback
- Implement sensing-only mode: suppress all DensePose API calls when
  FastAPI backend (port 8000) is not running, clean console output
- ADR-019: Document sensing-only UI architecture and data flow
- ADR-020: Migrate AI/model inference to Rust with RuVector ONNX Runtime,
  replacing ~2.7GB Python stack with ~50MB static binary
- Add ruvnet/ruvector as upstream remote for RuVector crate ecosystem

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-28 14:37:29 -05:00
ruv
6e4cb0ad5b chore: Remove obsolete CI/CD and configuration files 2026-02-28 14:35:45 -05:00
rUv
696a72625f docs(readme): Add pre-built binary and NVS provisioning quick start
Update ESP32 section with download-flash-provision workflow that
requires no build toolchain. Links to release v0.1.0-esp32 and
tutorial issue #34.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-28 13:48:44 -05:00
rUv
9f1fbd646f docs(adr-012): Update ESP32 CSI sensor mesh ADR to reflect implementation
ADR-012 now reflects the actual working firmware: NVS runtime config,
Docker build workflow, pre-built binary release, and verified metrics
(20 Hz, zero frame loss). Status changed from Proposed to Accepted.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-28 13:48:06 -05:00
ruv
7872987ee6 fix(docker): Update Dockerfile paths from src/ to v1/src/
The source code was moved to v1/src/ but the Dockerfile still
referenced src/ directly, causing build failures. Updated all
COPY paths, uvicorn module paths, test paths, and bandit scan
paths. Also added missing v1/__init__.py for Python module
resolution.

Fixes #33

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-28 13:38:21 -05:00
rUv
f460097a2f fix(install): Update IoT profile instructions for aggregator CLI
The IoT profile now shows the actual Docker build + esptool flash +
aggregator binary workflow that was validated on real hardware.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-28 13:22:55 -05:00
rUv
92a5182dc3 feat(adr-018): ESP32-S3 firmware, Rust aggregator, and live CSI pipeline
Complete end-to-end WiFi CSI capture pipeline verified on real hardware:

- ESP32-S3 firmware: WiFi STA + promiscuous mode CSI collection,
  ADR-018 binary serialization, UDP streaming at ~20 Hz
- Rust aggregator CLI binary (clap): receives UDP frames, parses with
  Esp32CsiParser, prints per-frame summary (node, seq, rssi, amp)
- UDP aggregator module with per-node sequence tracking and drop detection
- CsiFrame bridge to detection pipeline (amplitude/phase/SNR conversion)
- Python ESP32 binary parser with UDP reader
- Presence detection confirmed: motion score 10/10 from live CSI variance

Hardware verified: ESP32-S3-DevKitC-1 (CP2102, MAC 3C:0F:02:EC:C2:28),
Docker ESP-IDF v5.2 build, esptool 5.1.0 flash, 20 Rust + 6 Python tests pass.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-02-28 13:22:04 -05:00
rUv
885627b0a4 Merge pull request #32 from ruvnet/claude/validate-code-quality-WNrNw 2026-02-28 12:12:49 -05:00