Replace `declare -A` (associative array, requires Bash 4+) with
a standard indexed array. macOS ships Bash 3.2 due to GPLv3
licensing, so `declare -A` fails with "invalid option".
Fixes#134
Co-Authored-By: claude-flow <ruv@ruv.net>
Replace unsafe `torch.load(path)` with `torch.load(path,
map_location=self.device, weights_only=True)` to prevent
pickle deserialization RCE (trailofbits.python.pickles-in-pytorch).
weights_only=True disables pickle entirely for model loading,
which is the PyTorch-recommended mitigation (available since 1.13).
Also adds map_location for correct CPU/GPU device mapping.
Closes#106
Co-Authored-By: claude-flow <ruv@ruv.net>
- Add intro explaining DDD purpose and bounded context overview table
- Add Edge Intelligence bounded context (#7) for on-device sensing
- Add ubiquitous language terms: Edge Tier, WASM Module
- Fix frame rate 20 Hz -> 28 Hz (measured on hardware)
- Link each context to its source files and ADRs
- Add NVS configuration table and invariants for edge processing
- Create docs/ddd/README.md introducing all 3 domain models
- Update main README docs table to link to DDD index
Co-Authored-By: claude-flow <ruv@ruv.net>
Explains why ADRs matter for AI-generated code (prevents drift,
provides constraints and rationale), how they work with DDD domain
models, and indexes all 44 ADRs by category.
Also fixes ADR count 43 -> 44 in main README.
Co-Authored-By: claude-flow <ruv@ruv.net>
The CSI callback fires for every WiFi frame in promiscuous mode
(100-500+ fps). Each call invoked sendto() synchronously, exhausting
lwIP packet buffers (errno 12 = ENOMEM). The rapid-fire failures
cascaded into a LoadProhibited guru meditation crash.
Two fixes:
1. csi_collector.c: Rate-limit UDP sends to 50 Hz (20ms interval).
CSI frames arriving between sends are dropped — the sensing
pipeline only needs 20-50 Hz.
2. stream_sender.c: When sendto fails with ENOMEM, suppress further
sends for 100ms to let lwIP reclaim buffers. Logs the backoff
event and resumes automatically.
Closes#127
The user guide and release notes document TDM and edge intelligence
provisioning flags but provision.py only accepted --ssid, --password,
--target-ip, --target-port, and --node-id.
Add all NVS keys the firmware actually reads:
- --tdm-slot / --tdm-total: TDM mesh slot assignment
- --edge-tier: edge processing tier (0=off, 1=stats, 2=vitals)
- --pres-thresh, --fall-thresh: detection thresholds
- --vital-win, --vital-int: vitals timing parameters
- --subk-count: top-K subcarrier selection
Also validates that --tdm-slot and --tdm-total are specified together
and that slot < total.
Closes#130
- CHANGELOG: add ADR-043 entries (14 new API endpoints, WebSocket fix,
mobile WS fix, 25 real mobile tests)
- README: update ADR count from 41 to 43
- CLAUDE.md: update ADR count from 32 to 43
- User guide: add 14 new REST endpoints to API reference table, note
that /ws/sensing is available on the HTTP port, update ADR count
The web UI had persistent 404 errors on model, recording, and training
endpoints, and the sensing WebSocket never connected on Dashboard/Live
Demo tabs because sensingService.start() was only called lazily on
Sensing tab visit.
Server (main.rs):
- Add 14 fully-functional Axum handlers: model CRUD (7), recording
lifecycle (4), training control (3)
- Scan data/models/ and data/recordings/ at startup
- Recording writes CSI frames to .jsonl via tokio background task
- Model load/unload lifecycle with state tracking
Web UI (app.js):
- Import and start sensingService early in initializeServices() so
Dashboard and Live Demo tabs connect to /ws/sensing immediately
Mobile (ws.service.ts):
- Fix WebSocket URL builder to use same-origin port instead of
hardcoded port 3001
Mobile (jest.config.js):
- Fix testPathIgnorePatterns that was ignoring the entire test directory
Mobile (25 test files):
- Replace all it.todo() placeholder tests with real implementations
covering components, services, stores, hooks, screens, and utils
ADR-043 documents all changes.
Replace 48 ADR-041 anchor links with direct links to the 12
category-specific documentation files in docs/edge-modules/.
Co-Authored-By: claude-flow <ruv@ruv.net>
The espressif/idf container requires `. $IDF_PATH/export.sh` to put
idf.py on PATH. GitHub Actions container: runs with plain sh which
skips the container entrypoint. Also downgrade from v5.4 to v5.2
which matches our local Docker build environment.
Co-Authored-By: claude-flow <ruv@ruv.net>
Add ruvnet/midstream (AIMDS real-time inference) and
ruvnet/sublinear-time-solver (sublinear optimization algorithms)
as vendored dependencies under vendor/.
- Move provision.py from release-only asset into firmware/esp32-csi-node/
- Fix user guide references from scripts/provision.py to correct path
- Update release link to v0.2.0-esp32
Co-Authored-By: claude-flow <ruv@ruv.net>
* feat: add MAC address filter for ESP32 CSI collection
In multi-AP environments, CSI frames from different access points get
mixed together, corrupting the sensing signal. Add transmitter MAC
filtering so only frames from a specified AP are processed.
Implementation:
- csi_collector: filter in wifi_csi_callback by comparing info->mac
against configured MAC; log transmitter MAC in periodic debug output
- csi_collector_set_filter_mac(): runtime API to enable/disable filter
- Kconfig: CSI_FILTER_MAC option (format "AA:BB:CC:DD:EE:FF")
- NVS: "filter_mac" 6-byte blob overrides Kconfig at runtime
- nvs_config: parse Kconfig MAC string at boot, load NVS override
- main: apply filter from config after csi_collector_init()
When no filter is configured (default), behavior is unchanged —
all transmitter MACs are accepted for backward compatibility.
Fixes#98
Co-Authored-By: claude-flow <ruv@ruv.net>
* chore: add CLAUDE.local.md to .gitignore
Local machine configuration (ESP-IDF paths, COM port, build
instructions) should not be committed to the repository.
Co-Authored-By: claude-flow <ruv@ruv.net>
GOAP-based planning system for dynamically prioritizing which ADRs to
implement next based on current project state, available hardware, user
goals, and resource constraints.
Key design decisions:
- 25 boolean feature flags + 5 hardware flags + 6 quality metrics
- ~80 actions mapped to ADR implementation phases
- Sublinear search via backward relevance pruning, hierarchical tier
decomposition, incremental replanning, and admissible heuristics
- PageRank-based priority when no specific goal is given
- Integration with claude-flow swarm for dispatching to agents
Co-Authored-By: claude-flow <ruv@ruv.net>
Replace dead URLs for MM-Fi and Wi-Pose datasets with working links:
- MM-Fi: https://ntu-aiot-lab.github.io/mm-fi + GitHub repo with download links
- Wi-Pose: https://github.com/NjtechCVLab/Wi-PoseDataset with Google Drive links
Also corrects Wi-Pose source attribution (Entropy 2023, 12 subjects).
Fixes#84
Co-Authored-By: claude-flow <ruv@ruv.net>
Four-phase approach: eigenvalue-based person count estimation, NMF signal
decomposition, multi-skeleton generation with Kalman tracking, and neural
multi-person model training via RVF pipeline.
Ref: #97
Co-Authored-By: claude-flow <ruv@ruv.net>
* feat: RVF training pipeline & UI integration (ADR-036)
Implement full model training, management, and inference pipeline:
Backend (Rust):
- recording.rs: CSI recording API (start/stop/list/download/delete)
- model_manager.rs: RVF model loading, LoRA profile switching, model library
- training_api.rs: Training API with WebSocket progress streaming, simulated
training mode with realistic loss curves, auto-RVF export on completion
- main.rs: Wire new modules, recording hooks in all CSI paths, data dirs
UI (new components):
- ModelPanel.js: Dark-mode model library with load/unload, LoRA dropdown
- TrainingPanel.js: Recording controls, training config, live Canvas charts
- model.service.js: Model REST API client with events
- training.service.js: Training + recording API client with WebSocket progress
UI (enhancements):
- LiveDemoTab: Model selector, LoRA profile switcher, A/B split view toggle,
training quick-panel with 60s recording shortcut
- SettingsPanel: Full dark mode conversion (issue #92), model configuration
(device, threads, auto-load), training configuration (epochs, LR, patience)
- PoseDetectionCanvas: 10-frame pose trail with ghost keypoints and motion
trajectory lines, cyan trail toggle button
- pose.service.js: Model-inference confidence thresholds
UI (plumbing):
- index.html: Training tab (8th tab)
- app.js: Panel initialization and tab routing
- style.css: ~250 lines of training/model panel dark-mode styles
191 Rust tests pass, 0 failures. Closes#92.
Refs: ADR-036, #93
Co-Authored-By: claude-flow <ruv@ruv.net>
* fix: real RuVector training pipeline + UI service fixes
Training pipeline (training_api.rs):
- Replace simulated training with real signal-based training loop
- Load actual CSI data from .csi.jsonl recordings or live frame history
- Extract 180 features per frame: subcarrier amplitudes, temporal variance,
Goertzel frequency analysis (9 bands), motion gradients, global stats
- Train calibrated linear CSI-to-pose mapping via mini-batch gradient descent
with L2 regularization (ridge regression), Xavier init, cosine LR decay
- Self-supervised: teacher targets from derive_pose_from_sensing() heuristics
- Real validation metrics: MSE and PCK@0.2 on 80/20 train/val split
- Export trained .rvf with real weights, feature normalization stats, witness
- Add infer_pose_from_model() for live inference from trained model
- 16 new tests covering features, training, inference, serialization
UI fixes:
- Fix double-URL bug in model.service.js and training.service.js
(buildApiUrl was called twice — once in service, once in apiService)
- Fix route paths to match Rust backend (/api/v1/train/*, /api/v1/recording/*)
- Fix request body formats (session_name, nested config object)
- Fix top-level await in LiveDemoTab.js blocking module graph
- Dynamic imports for ModelPanel/TrainingPanel in app.js
- Center nav tabs with flex-wrap for 8-tab layout
Co-Authored-By: claude-flow <ruv@ruv.net>
* fix: WebSocket onOpen race condition, data source indicators, auto-start pose detection
- Fix WebSocket onOpen race condition in websocket.service.js where
setupEventHandlers replaced onopen after socket was already open,
preventing pose service from receiving connection signal
- Add 4-state data source indicator (LIVE/SIMULATED/RECONNECTING/OFFLINE)
across Dashboard, Sensing, and Live Demo tabs via sensing.service.js
- Add hot-plug ESP32 auto-detection in sensing server (auto mode runs
both UDP listener and simulation, switches on ESP32_TIMEOUT)
- Auto-start pose detection when backend is reachable
- Hide duplicate PoseDetectionCanvas controls when enableControls=false
- Add standalone Demo button in LiveDemoTab for offline animated demo
- Add data source banner and status styling
Co-Authored-By: claude-flow <ruv@ruv.net>
- All buttons converted to dark translucent style with colored accents:
Start (green), Stop (red), Reconnect (blue), Demo (purple)
- Header, wrapper, status badge all use dark backgrounds
- Controls in single flat row (no wrapping)
- Mode select dropdown styled for dark theme
- HTML entity icons on all buttons
Co-Authored-By: claude-flow <ruv@ruv.net>
- Heatmap: Gaussian radial blobs per keypoint with per-person hue,
faint skeleton overlay at 25% opacity
- Dense: body region segmentation with colored filled polygons for
head, torso, arms, legs — thick strokes + joint circles
- Keypoints: now also renders bounding box and confidence
- Previously both heatmap and dense were stubs falling back to skeleton
Co-Authored-By: claude-flow <ruv@ruv.net>