Commit Graph

18 Commits

Author SHA1 Message Date
ruv
093be1f4b9 feat: 100% validated witness bundle with proof hash + generator script
- Regenerate Python proof hash for numpy 2.4.2 + scipy 1.17.1 (PASS)
- Update ADR-028 and WITNESS-LOG-028 with passing proof status
- Add scripts/generate-witness-bundle.sh — creates self-contained
  tar.gz with witness log, test results, proof verification,
  firmware hashes, crate manifest, and VERIFY.sh for recipients
- Bundle self-verifies: 7/7 checks PASS
- Attestation: 1,031 Rust tests passing, 0 failures

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-01 15:51:38 -05:00
ruv
e2320e8e4b feat(wifiscan): add Rust macOS + Linux adapters, fix Python byte counters
- Add MacosCoreWlanScanner (macOS): CoreWLAN Swift helper adapter with
  synthetic BSSID generation via FNV-1a hash for redacted MACs (ADR-025)
- Add LinuxIwScanner (Linux): parses `iw dev <iface> scan` output with
  freq-to-channel conversion and BSS stanza parsing
- Both adapters produce Vec<BssidObservation> compatible with the
  existing WindowsWifiPipeline 8-stage processing
- Platform-gate modules with #[cfg(target_os)] so each adapter only
  compiles on its target OS
- Fix Python MacosWifiCollector: remove synthetic byte counters that
  produced misleading tx_bytes/rx_bytes data (set to 0)
- Add compiled Swift binary (mac_wifi) to .gitignore

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-01 10:51:45 -05:00
zqyhimself
09f01d5ca6 feat(sensing): native macOS CoreWLAN WiFi sensing adapter
Add native macOS LiDAR / WiFi sensing support via CoreWLAN:
- mac_wifi.swift: Swift helper to poll RSSI/Noise at 10Hz
- MacosWifiCollector: Python adapter for the sensing pipeline
- Auto-detect Darwin platform in ws_server.py
2026-03-01 21:06:17 +08: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
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
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
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
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
Claude
5cc21987c5 fix: Complete ADR-011 mock elimination and fix all test stubs
Production code:
- pose_service.py: real uptime tracking (_start_time), real calibration
  state machine (_calibration_in_progress, _calibration_id), proper
  get_calibration_status() using elapsed time, uptime in health_check()
- health.py: _APP_START_TIME module constant for real uptime_seconds
- dependencies.py: remove TODO, document JWT config requirement clearly

ADR-017 status: Proposed → Accepted (all 7 integrations complete)

Test fixes (170 unit tests — 0 failures):
- Fix hardcoded /workspaces/wifi-densepose devcontainer paths in 4 files;
  replaced with os.path relative to __file__
- test_csi_extractor_tdd/standalone: update ESP32 fixture to provide
  correct 3×56 amplitude+phase values (was only 3 values)
- test_csi_standalone/tdd_complete: Atheros tests now expect
  CSIExtractionError (implementation raises it correctly)
- test_router_interface_tdd: register module in sys.modules so
  patch('src.hardware.router_interface...') resolves; fix
  test_should_parse_csi_response to expect RouterConnectionError
- test_csi_processor: rewrite to use actual preprocess_csi_data /
  extract_features API with proper CSIData fixtures; fix constructor
- test_phase_sanitizer: fix constructor (requires config), rename
  sanitize() → sanitize_phase(), fix empty-data fixture (use 2D array),
  fix phase data to stay within [-π, π] validation range

Proof bundle: PASS — SHA-256 hash matches, no random patterns in prod code

https://claude.ai/code/session_01BSBAQJ34SLkiJy4A8SoiL4
2026-02-28 16:59:34 +00:00
Claude
7afdad0723 security: Fix 10 vulnerabilities, remove 12 dead code instances
Critical fixes:
- Remove hardcoded admin/admin123 credentials from UserManager
- Enable JWT signature verification (was disabled for debugging)
- Redact secrets from /dev/config endpoint (was exposing os.environ)
- Remove hardcoded SSH admin/admin credentials from hardware service
- Add channel validation to prevent command injection in router interface

Rust fixes:
- Replace partial_cmp().unwrap() with .unwrap_or(Equal) to prevent
  NaN panics in 6 locations across core, signal, nn, mat crates
- Replace .expect()/.unwrap() with safe fallbacks in utils, csi_receiver
- Replace SystemTime unwrap with unwrap_or_default

Dead code removed:
- Duplicate imports (CORSMiddleware, os, Path, ABC, subprocess)
- Unused AdaptiveRateLimit/RateLimitStorage/RedisRateLimitStorage (~110 lines)
- Unused _log_authentication_event method
- Unused Confidence::new_unchecked in Rust
- Fix bare except: clause to except Exception:

https://claude.ai/code/session_01Ki7pvEZtJDvqJkmyn6B714
2026-02-28 07:04:22 +00:00
Claude
32c75c8eec perf: 5.7x Doppler extraction speedup, trust kill switch, fix NN benchmark
Optimization:
- Cache mean phase per frame in ring buffer for O(1) Doppler access
- Sliding window (last 64 frames) instead of full history traversal
- Doppler FFT: 253.9us -> 44.9us per frame (5.7x faster)
- Full pipeline: 719.2us -> 254.2us per frame (2.8x faster)

Trust kill switch:
- ./verify: one-command proof replay with SHA-256 hash verification
- Enhanced verify.py with source provenance, feature inspection, --audit
- Makefile with verify/verify-verbose/verify-audit targets
- New hash: 0b82bd45e836e5a99db0494cda7795832dda0bb0a88dac65a2bab0e949950ee0

Benchmark fix:
- NN inference_bench.rs uses MockBackend instead of calling forward()
  which now correctly errors when no weights are loaded

https://claude.ai/code/session_01Ki7pvEZtJDvqJkmyn6B714
2026-02-28 06:48:41 +00:00
Claude
b3916386a3 feat: Add commodity sensing unit tests and fix feature extractor bugs
Add comprehensive test suite (36 tests) for the ADR-013 commodity sensing
module covering all components: RingBuffer, SimulatedCollector determinism,
feature extraction (time-domain stats, FFT spectral analysis, band power
isolation), CUSUM change-point detection, presence/motion classification,
and end-to-end CommodityBackend pipeline.

Fix feature_extractor.py: add missing _trim_to_window method that caused
AttributeError on the WifiSample extraction path, add post-trim sample
count guard, and handle constant-signal edge case in skewness/kurtosis
computation to prevent scipy RuntimeWarning.

https://claude.ai/code/session_01Ki7pvEZtJDvqJkmyn6B714
2026-02-28 06:24:10 +00:00
Claude
5210ef4baa fix: Update configure_csi_collection to use MockCSIGenerator from testing module
The configure_csi_collection method was still referencing the old
mock_data_generator dict directly instead of delegating to the
MockCSIGenerator instance from the testing module. This completes the
ADR-011 mock isolation by ensuring all mock CSI configuration flows
through v1/src/testing/mock_csi_generator.py.

https://claude.ai/code/session_01Ki7pvEZtJDvqJkmyn6B714
2026-02-28 06:21:53 +00:00
Claude
4b2e7bfecf feat: CI pipeline verification, 3D body model, auth fixes, requirements lock
- .github/workflows/verify-pipeline.yml: CI that verifies pipeline
  determinism and checks for np.random in production code
- ui/components/body-model.js: Three.js 3D human body model with
  24 DensePose body parts mapped to 3D geometry
- v1/requirements-lock.txt: Minimal pinned dependencies for verification
- v1/src/api/dependencies.py: Fix mock auth returns with proper errors
- v1/src/core/router_interface.py: Additional mock mode cleanup
- v1/src/services/pose_service.py: Further mock elimination in service

https://claude.ai/code/session_01Ki7pvEZtJDvqJkmyn6B714
2026-02-28 06:20:08 +00:00
Claude
2199174cac feat: Add commodity sensing, proof bundle, Three.js viz, mock isolation
Commodity Sensing Module (ADR-013):
- sensing/rssi_collector.py: Real Linux WiFi RSSI collection from
  /proc/net/wireless and iw commands, with SimulatedCollector for testing
- sensing/feature_extractor.py: FFT-based spectral analysis, CUSUM
  change-point detection, breathing/motion band power extraction
- sensing/classifier.py: Rule-based presence/motion classification
  with confidence scoring and multi-receiver agreement
- sensing/backend.py: Common SensingBackend protocol with honest
  capability reporting (PRESENCE + MOTION only for commodity)

Proof of Reality Bundle (ADR-011):
- data/proof/generate_reference_signal.py: Deterministic synthetic CSI
  with known breathing (0.3 Hz) and walking (1.2 Hz) signals
- data/proof/sample_csi_data.json: Generated reference signal
- data/proof/verify.py: One-command pipeline verification with SHA-256
- data/proof/expected_features.sha256: Expected output hash

Three.js Visualization:
- ui/components/scene.js: 3D scene setup with OrbitControls

Mock Isolation:
- testing/mock_pose_generator.py: Mock pose generation moved out of
  production pose_service.py
- services/pose_service.py: Cleaned mock paths

https://claude.ai/code/session_01Ki7pvEZtJDvqJkmyn6B714
2026-02-28 06:18:58 +00:00
Claude
e3f0c7a3fa fix: Eliminate remaining mock data paths, isolate test infrastructure
- core/router_interface.py: Replace placeholder _collect_real_csi_data()
  with explicit RuntimeError directing users to hardware setup docs
- hardware/router_interface.py: Replace np.random.rand() in
  _parse_csi_response() with RouterConnectionError requiring real parser
- testing/: New isolated module for mock data generation (moved out of
  production code paths per ADR-011)
- sensing/: Initialize commodity sensing module (ADR-013)

No production code path returns random data. Mock mode requires explicit
opt-in via WIFI_DENSEPOSE_MOCK=true environment variable.

https://claude.ai/code/session_01Ki7pvEZtJDvqJkmyn6B714
2026-02-28 06:16:45 +00:00
Claude
fd493e5103 fix: Replace mock/placeholder code with real implementations (ADR-011)
- csi_processor.py: Replace np.random.rand(10) Doppler placeholder with
  real temporal phase-difference FFT extraction from CSI history buffer.
  Returns zeros (not random) when insufficient history frames available.

- csi_extractor.py: Replace np.random.rand() fallbacks in ESP32 and
  Atheros parsers with proper data parsing (ESP32) and explicit error
  raising (Atheros). Add CSIExtractionError for clear failure reporting
  instead of silent random data substitution.

These are the two most critical mock eliminations identified in ADR-011.

https://claude.ai/code/session_01Ki7pvEZtJDvqJkmyn6B714
2026-02-28 06:15:55 +00:00
Claude
6ed69a3d48 feat: Complete Rust port of WiFi-DensePose with modular crates
Major changes:
- Organized Python v1 implementation into v1/ subdirectory
- Created Rust workspace with 9 modular crates:
  - wifi-densepose-core: Core types, traits, errors
  - wifi-densepose-signal: CSI processing, phase sanitization, FFT
  - wifi-densepose-nn: Neural network inference (ONNX/Candle/tch)
  - wifi-densepose-api: Axum-based REST/WebSocket API
  - wifi-densepose-db: SQLx database layer
  - wifi-densepose-config: Configuration management
  - wifi-densepose-hardware: Hardware abstraction
  - wifi-densepose-wasm: WebAssembly bindings
  - wifi-densepose-cli: Command-line interface

Documentation:
- ADR-001: Workspace structure
- ADR-002: Signal processing library selection
- ADR-003: Neural network inference strategy
- DDD domain model with bounded contexts

Testing:
- 69 tests passing across all crates
- Signal processing: 45 tests
- Neural networks: 21 tests
- Core: 3 doc tests

Performance targets:
- 10x faster CSI processing (~0.5ms vs ~5ms)
- 5x lower memory usage (~100MB vs ~500MB)
- WASM support for browser deployment
2026-01-13 03:11:16 +00:00