Back to Ruview

ADR-041: WASM Module Collection -- Curated Sensing Algorithm Registry

docs/adr/ADR-041-wasm-module-collection.md

0.7.0105.4 KB
Original Source

ADR-041: WASM Module Collection -- Curated Sensing Algorithm Registry

Status: Accepted (Phase 1 implemented, hardware-validated on RuView ESP32-S3) Date: 2026-03-02 Deciders: @ruvnet Supersedes: None Related: ADR-039 (Edge Intelligence), ADR-040 (WASM Programmable Sensing)

Context

ADR-040 established the Tier 3 WASM programmable sensing runtime: a WASM3 interpreter on ESP32-S3 that executes hot-loadable Rust-to-wasm32 modules with a 12-function Host API, RVF container format, Ed25519 signing, and adaptive budget control. Three flagship modules were defined (gesture, coherence, adversarial) as proof of capability.

A runtime without a library of modules is an empty platform. The difference between a product and a platform is the ecosystem -- and the ecosystem is the module collection. Three strategic dynamics make a curated collection essential:

1. Platform flywheel effect. Each new module increases the value of every deployed ESP32 node. A node purchased for sleep apnea monitoring becomes a fall detector, an intrusion sensor, and an occupancy counter -- all via OTA WASM uploads. This multiplies the addressable market without multiplying hardware SKUs.

2. Community velocity. WiFi CSI sensing is a research-active field with hundreds of labs publishing new algorithms annually. A well-defined module contract (Host API v1, RVF container, event type registry) lowers the barrier from "fork the firmware and cross-compile" to "write 50 lines of no_std Rust, compile to wasm32, submit a PR." The module collection is the contribution surface.

3. Vertical market expansion. The root README lists 12+ deployment scenarios spanning healthcare, retail, industrial safety, smart buildings, disaster response, and fitness. Each vertical requires domain-specific algorithms that share the same underlying CSI primitives. A module collection allows vertical specialists to build on a common sensing substrate without understanding RF engineering.

This ADR defines a curated collection of 60 modules across 13 categories, with event type registries, budget tiers, implementation priorities, and a community contribution workflow. 24 vendor-integrated modules leverage algorithms from three vendored libraries (ruvector, midstream, sublinear-time-solver) to extend the platform from pure-CSI threshold sensing into adaptive learning, quantum-inspired coherence, autonomous planning, and AI security at the edge.

Decision

Module Collection Overview

60 modules organized into 13 categories. Every module targets Host API v1 (ADR-040), ships as an RVF container, and declares its event type IDs, budget tier, and capability bitmask. Categories 1--6 are pure-CSI modules; Category 7 (subdivided into 7 sub-categories) integrates algorithms from vendored libraries for advanced edge computation.

Budget Tiers

TierLabelPer-frame budgetUse case
LLightweight< 2,000 us (2 ms)Simple threshold checks, single-value outputs
SStandard< 5,000 us (5 ms)Moderate DSP, windowed statistics
HHeavy< 10,000 us (10 ms)Complex pattern matching, multi-signal fusion

When multiple modules run concurrently, the adaptive budget controller (ADR-040 Appendix B) divides the total frame budget B across active modules. Heavy modules should generally run alone or paired only with lightweight ones.

Naming Convention

All modules follow the pattern wdp-{category}-{name}:

CategoryPrefixEvent ID range
Medical & Healthwdp-med-100--199
Security & Safetywdp-sec-200--299
Smart Buildingwdp-bld-300--399
Retail & Hospitalitywdp-ret-400--499
Industrial & Specializedwdp-ind-500--599
Exotic & Researchwdp-exo-600--699

Event type IDs 0--99 are reserved for the three ADR-040 flagship modules and future core system events.


Category 1: Medical & Health (Event IDs 100--199)

1.1 wdp-med-sleep-apnea

Description: Detects obstructive and central sleep apnea episodes by monitoring breathing rate cessation. When the breathing BPM drops below 4 BPM and remains there for more than 10 consecutive seconds, the module emits an apnea alert with duration. It also tracks apnea-hypopnea index (AHI) over a sleep session by counting events per hour.

Host API dependencies: csi_get_bpm_breathing, csi_get_presence, csi_get_variance, csi_get_timestamp, csi_emit_event, csi_log

Event types emitted:

Event IDNameValue semantics
100APNEA_STARTDuration threshold (seconds)
101APNEA_ENDEpisode duration (seconds)
102AHI_UPDATEEvents per hour (float)

Estimated .wasm size: 4 KB Budget tier: L (lightweight, < 2 ms) -- primarily threshold checks on Tier 2 vitals Difficulty: Easy


1.2 wdp-med-cardiac-arrhythmia

Description: Detects irregular heartbeat patterns from heart rate variability (HRV) extracted from the CSI phase signal. Monitors for tachycardia (>100 BPM sustained), bradycardia (<50 BPM sustained), and missed-beat patterns where the inter-beat interval suddenly doubles. Uses a sliding window of 30 seconds of heart rate samples to compute RMSSD (root mean square of successive differences) and flags anomalies when RMSSD exceeds 3 standard deviations from baseline.

Host API dependencies: csi_get_bpm_heartrate, csi_get_phase, csi_get_phase_history, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
110TACHYCARDIACurrent BPM
111BRADYCARDIACurrent BPM
112MISSED_BEATGap duration (ms)
113HRV_ANOMALYRMSSD value

Estimated .wasm size: 8 KB Budget tier: S (standard, < 5 ms) -- requires phase history windowing Difficulty: Hard


1.3 wdp-med-respiratory-distress

Description: Detects respiratory distress patterns including tachypnea (rapid shallow breathing > 25 BPM), labored breathing (high amplitude variance in the breathing band), and Cheyne-Stokes respiration (cyclical crescendo-decrescendo breathing pattern with apneic pauses). Cheyne-Stokes detection uses autocorrelation of the breathing amplitude envelope over a 60-second window to find the characteristic 30--90 second periodicity.

Host API dependencies: csi_get_bpm_breathing, csi_get_phase, csi_get_variance, csi_get_phase_history, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
120TACHYPNEACurrent breathing BPM
121LABORED_BREATHINGAmplitude variance ratio
122CHEYNE_STOKESCycle period (seconds)
123RESP_DISTRESS_LEVELSeverity 0.0--1.0

Estimated .wasm size: 10 KB Budget tier: H (heavy, < 10 ms) -- autocorrelation over 60 s window Difficulty: Hard


1.4 wdp-med-gait-analysis

Description: Analyzes walking patterns from CSI motion signatures to detect Parkinsonian gait (shuffling, reduced arm swing, festination), post-stroke asymmetric gait, and elevated fall risk. Extracts step cadence, step regularity, stride-to-stride variability, and bilateral asymmetry from phase variance periodicity. Outputs a composite fall-risk score (0--100) based on gait instability metrics published in clinical biomechanics literature.

Host API dependencies: csi_get_phase, csi_get_amplitude, csi_get_variance, csi_get_motion_energy, csi_get_phase_history, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
130STEP_CADENCESteps per minute
131GAIT_ASYMMETRYAsymmetry index 0.0--1.0
132FALL_RISK_SCORERisk score 0--100
133SHUFFLING_DETECTEDConfidence 0.0--1.0
134FESTINATIONAcceleration pattern flag

Estimated .wasm size: 12 KB Budget tier: H (heavy, < 10 ms) -- windowed periodicity analysis Difficulty: Hard


1.5 wdp-med-seizure-detect

Description: Detects tonic-clonic (grand mal) epileptic seizures via sudden onset of high-energy rhythmic motion in the 3--8 Hz band, distinct from normal voluntary movement. The tonic phase produces a sustained high-amplitude CSI disturbance; the clonic phase shows characteristic rhythmic oscillation at 3--5 Hz with decreasing frequency. Discriminates from falls (single impulse) and tremor (lower amplitude, continuous). Emits a graded alert: pre-ictal warning (motion pattern change), seizure onset, and post-ictal stillness.

Host API dependencies: csi_get_phase, csi_get_amplitude, csi_get_motion_energy, csi_get_phase_history, csi_get_presence, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
140SEIZURE_ONSETConfidence 0.0--1.0
141SEIZURE_TONICDuration (seconds)
142SEIZURE_CLONICOscillation frequency (Hz)
143POST_ICTALStillness duration (seconds)

Estimated .wasm size: 10 KB Budget tier: S (standard, < 5 ms) -- frequency analysis on motion energy Difficulty: Hard


1.6 wdp-med-vital-trend

Description: Long-term trending of breathing rate and heart rate over hours and days. Maintains exponentially weighted moving averages (EWMA) with multiple time constants (5 min, 1 hr, 4 hr) and detects gradual deterioration. Emits a NEWS2-inspired early warning score when vitals deviate from the patient's personal baseline by clinically significant margins. Designed for sepsis early warning, post-surgical monitoring, and chronic disease management. Stores trend state in module memory across on_timer calls.

Host API dependencies: csi_get_bpm_breathing, csi_get_bpm_heartrate, csi_get_presence, csi_get_timestamp, csi_emit_event, csi_log

Event types emitted:

Event IDNameValue semantics
150TREND_BREATHING_DELTA% deviation from 4-hr baseline
151TREND_HEARTRATE_DELTA% deviation from 4-hr baseline
152EARLY_WARNING_SCORENEWS2-style score 0--20
153BASELINE_ESTABLISHEDHours of data collected

Estimated .wasm size: 6 KB Budget tier: L (lightweight, < 2 ms) -- EWMA updates are O(1) Difficulty: Medium


Category 2: Security & Safety (Event IDs 200--299)

2.1 wdp-sec-intrusion-detect

Description: Detects unauthorized human entry into a secured zone during armed periods. Distinguishes human movement signatures (bipedal gait, 0.5--2.0 Hz periodicity in phase variance) from false alarm sources: HVAC airflow (broadband low-frequency), pets (lower amplitude, quadrupedal cadence), and environmental drift (monotonic phase change). Uses a two-stage classifier: a fast energy gate followed by a cadence discriminator on the top-K subcarriers.

Host API dependencies: csi_get_phase, csi_get_variance, csi_get_amplitude, csi_get_motion_energy, csi_get_presence, csi_get_n_persons, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
200INTRUSION_ALERTConfidence 0.0--1.0
201HUMAN_CONFIRMEDNumber of persons detected
202FALSE_ALARM_SOURCESource type (1=HVAC, 2=pet, 3=env)

Estimated .wasm size: 8 KB Budget tier: S (standard, < 5 ms) Difficulty: Medium


2.2 wdp-sec-perimeter-breach

Description: Multi-zone perimeter monitoring using phase gradient analysis across subcarrier groups. Determines direction of movement (approach vs departure) from the temporal ordering of phase disturbances across spatially diverse subcarriers. Divides the monitored space into configurable zones (up to 4) and tracks the progression of a moving target across zone boundaries. Emits zone-transition events with directional vectors.

Host API dependencies: csi_get_phase, csi_get_amplitude, csi_get_variance, csi_get_phase_history, csi_get_motion_energy, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
210PERIMETER_BREACHZone ID (0--3)
211APPROACH_DETECTEDApproach velocity proxy (0.0--1.0)
212DEPARTURE_DETECTEDDeparture velocity proxy (0.0--1.0)
213ZONE_TRANSITIONEncoded (from_zone << 4

Estimated .wasm size: 10 KB Budget tier: S (standard, < 5 ms) Difficulty: Medium


2.3 wdp-sec-weapon-detect

Description: Research-grade module for detecting concealed metallic objects (knives, firearms) based on differential CSI multipath signatures. Metallic objects have significantly higher RF reflectivity than biological tissue, creating distinctive amplitude spikes on specific subcarrier groups when a person carrying metal passes through the sensing field. The module computes a metal-presence index from the ratio of amplitude variance to phase variance -- pure tissue produces coupled amplitude/phase changes, while metallic reflectors produce disproportionate amplitude perturbation. Experimental: requires controlled environment calibration and should not be used as a sole security measure.

Host API dependencies: csi_get_phase, csi_get_amplitude, csi_get_variance, csi_get_motion_energy, csi_get_presence, csi_get_timestamp, csi_emit_event, csi_log

Event types emitted:

Event IDNameValue semantics
220METAL_ANOMALYMetal-presence index 0.0--1.0
221WEAPON_ALERTConfidence 0.0--1.0 (threshold: 0.7)
222CALIBRATION_NEEDEDDrift metric

Estimated .wasm size: 8 KB Budget tier: S (standard, < 5 ms) Difficulty: Hard


2.4 wdp-sec-tailgating

Description: Detects tailgating (piggybacking) at access-controlled doorways by identifying two or more people passing through a chokepoint in rapid succession. Uses temporal clustering of motion energy peaks: a single person produces one motion envelope; two people in quick succession produce a double-peaked or prolonged envelope. The inter-peak interval threshold is configurable (default: 3 seconds). Also detects side-by-side passage from broadened phase disturbance patterns.

Host API dependencies: csi_get_motion_energy, csi_get_presence, csi_get_n_persons, csi_get_variance, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
230TAILGATE_DETECTEDPerson count estimate
231SINGLE_PASSAGEPassage duration (ms)
232MULTI_PASSAGEInter-person gap (ms)

Estimated .wasm size: 6 KB Budget tier: L (lightweight, < 2 ms) Difficulty: Medium


2.5 wdp-sec-loitering

Description: Detects prolonged stationary presence in a designated zone beyond a configurable dwell threshold (default: 5 minutes). Uses sustained presence detection (Tier 2 presence flag) combined with low motion energy to distinguish loitering from active use of a space. Tracks dwell duration with a state machine: absent, entering, present, loitering. The loitering-to-absent transition requires sustained absence for a configurable cooldown (default: 30 seconds) to avoid flapping.

Host API dependencies: csi_get_presence, csi_get_motion_energy, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
240LOITERING_STARTDwell threshold exceeded (minutes)
241LOITERING_ONGOINGCurrent dwell duration (minutes)
242LOITERING_ENDTotal dwell duration (minutes)

Estimated .wasm size: 3 KB Budget tier: L (lightweight, < 2 ms) Difficulty: Easy


2.6 wdp-sec-panic-motion

Description: Detects erratic, high-energy movement patterns consistent with distress, struggle, or fleeing. Computes jerk (rate of change of motion energy) and motion entropy (randomness of phase variance across subcarriers). Normal walking produces low jerk and low entropy; panicked motion produces high jerk with high entropy (unpredictable direction changes). The module maintains a 5-second sliding window and triggers when both jerk and entropy exceed their respective thresholds simultaneously.

Host API dependencies: csi_get_motion_energy, csi_get_variance, csi_get_phase, csi_get_presence, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
250PANIC_DETECTEDSeverity 0.0--1.0
251STRUGGLE_PATTERNJerk magnitude
252FLEEING_DETECTEDMotion energy peak

Estimated .wasm size: 6 KB Budget tier: S (standard, < 5 ms) Difficulty: Medium


Category 3: Smart Building (Event IDs 300--399)

3.1 wdp-bld-occupancy-zones

Description: Divides the monitored room into a configurable grid of zones (default: 2x2 = 4 zones) and estimates per-zone occupancy from subcarrier group variance patterns. Each subcarrier group maps to a spatial zone based on initial calibration. The module outputs a zone occupancy vector on each frame where changes occur, enabling spatial heatmaps, desk-level presence detection, and room utilization analytics.

Host API dependencies: csi_get_variance, csi_get_amplitude, csi_get_presence, csi_get_n_persons, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
300ZONE_OCCUPIEDZone ID (0--15)
301ZONE_VACANTZone ID (0--15)
302TOTAL_OCCUPANCYTotal person count
303ZONE_MAP_UPDATEEncoded zone bitmap (u16)

Estimated .wasm size: 8 KB Budget tier: S (standard, < 5 ms) Difficulty: Medium


3.2 wdp-bld-hvac-presence

Description: Optimized for HVAC control integration with appropriate hysteresis to prevent rapid cycling of heating/cooling equipment. Reports presence with a configurable arrival debounce (default: 10 seconds) and a departure timeout (default: 5 minutes). The departure timeout ensures HVAC does not shut down during brief absences (bathroom break, coffee run). Also reports an activity level (sedentary/active) for adaptive comfort control -- sedentary occupants may prefer different temperature setpoints.

Host API dependencies: csi_get_presence, csi_get_motion_energy, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
310HVAC_OCCUPIED1 = occupied, 0 = vacant (with hysteresis)
311ACTIVITY_LEVEL0 = sedentary, 1 = active
312DEPARTURE_COUNTDOWNSeconds remaining until vacancy declared

Estimated .wasm size: 3 KB Budget tier: L (lightweight, < 2 ms) Difficulty: Easy


3.3 wdp-bld-lighting-zones

Description: Presence-triggered zone lighting control with occupancy- aware dimming. Maps to the same zone grid as occupancy-zones. Outputs lighting commands per zone: ON (occupied, active), DIM (occupied, sedentary for > 10 min), and OFF (vacant for > departure timeout). The dimming ramp is gradual (configurable 30-second fade) to avoid jarring transitions. Integrates with standard building automation protocols via the event stream.

Host API dependencies: csi_get_presence, csi_get_motion_energy, csi_get_variance, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
320LIGHT_ONZone ID
321LIGHT_DIMZone ID (dimming level as value 0.0--1.0)
322LIGHT_OFFZone ID

Estimated .wasm size: 4 KB Budget tier: L (lightweight, < 2 ms) Difficulty: Easy


3.4 wdp-bld-elevator-count

Description: Counts occupants in an elevator cab using confined-space CSI multipath analysis. In an elevator, the metal walls create a highly reflective RF cavity where each person creates a measurable perturbation in the standing wave pattern. The module uses amplitude variance decomposition to estimate person count (1--12) and detects door-open events from sudden multipath geometry changes. Supports weight-limit proxying: emits overload warning when count exceeds configurable threshold.

Host API dependencies: csi_get_amplitude, csi_get_variance, csi_get_phase, csi_get_motion_energy, csi_get_n_persons, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
330ELEVATOR_COUNTPerson count (0--12)
331DOOR_OPEN1.0
332DOOR_CLOSE1.0
333OVERLOAD_WARNINGCount above threshold

Estimated .wasm size: 8 KB Budget tier: S (standard, < 5 ms) Difficulty: Medium


3.5 wdp-bld-meeting-room

Description: Meeting room utilization tracking. Detects room state transitions (empty, pre-meeting gathering, active meeting, post-meeting departure) from occupancy patterns. Tracks meeting start time, end time, peak headcount, and actual vs booked utilization. Emits "room available" events for opportunistic booking systems. Distinguishes genuine meetings (sustained multi-person presence > 5 minutes) from transient occupancy (someone ducking in to grab a laptop).

Host API dependencies: csi_get_presence, csi_get_n_persons, csi_get_motion_energy, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
340MEETING_STARTHeadcount at start
341MEETING_ENDDuration (minutes)
342PEAK_HEADCOUNTMaximum persons detected
343ROOM_AVAILABLE1.0 (available for booking)

Estimated .wasm size: 5 KB Budget tier: L (lightweight, < 2 ms) Difficulty: Easy


3.6 wdp-bld-energy-audit

Description: Correlates occupancy patterns with time-of-day and day- of-week to build occupancy schedules for building energy optimization. Maintains hourly occupancy histograms (24 bins per day, 7 days) in module memory and emits daily schedule summaries via on_timer. Identifies consistently unoccupied periods where HVAC and lighting can be scheduled off. Also detects after-hours occupancy anomalies (someone working late on a normally vacant floor).

Host API dependencies: csi_get_presence, csi_get_n_persons, csi_get_timestamp, csi_emit_event, csi_log

Event types emitted:

Event IDNameValue semantics
350SCHEDULE_SUMMARYEncoded daily pattern (packed bits)
351AFTER_HOURS_ALERTHour of detection (0--23)
352UTILIZATION_RATE% of working hours occupied

Estimated .wasm size: 6 KB Budget tier: L (lightweight, < 2 ms) Difficulty: Medium


Category 4: Retail & Hospitality (Event IDs 400--499)

4.1 wdp-ret-queue-length

Description: Estimates queue length and wait time from sequential presence detection along a linear zone. Models the queue as an ordered sequence of occupied positions. Tracks join rate (new arrivals per minute), service rate (departures from the head), and estimates current wait time using Little's Law (L = lambda * W). Emits queue length at every change and wait-time estimates at configurable intervals. Designed for checkout lines, customer service counters, and bank branches.

Host API dependencies: csi_get_presence, csi_get_n_persons, csi_get_variance, csi_get_motion_energy, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
400QUEUE_LENGTHEstimated person count in queue
401WAIT_TIME_ESTIMATEEstimated wait (seconds)
402SERVICE_RATEPersons served per minute
403QUEUE_ALERTLength exceeds threshold

Estimated .wasm size: 6 KB Budget tier: L (lightweight, < 2 ms) Difficulty: Medium


4.2 wdp-ret-dwell-heatmap

Description: Tracks dwell time per spatial zone and generates a dwell- time heatmap for spatial engagement analysis. Divides the sensing area into a configurable grid (default 3x3) and accumulates dwell-seconds per zone. Emits per-zone dwell updates at configurable intervals (default: 30 seconds) and session summaries when the space empties. Designed for retail floor optimization, museum exhibit engagement, and trade show booth analytics.

Host API dependencies: csi_get_presence, csi_get_variance, csi_get_motion_energy, csi_get_n_persons, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
410DWELL_ZONE_UPDATEZone ID (high byte) + seconds (value)
411HOT_ZONEZone ID with highest dwell
412COLD_ZONEZone ID with lowest dwell
413SESSION_SUMMARYTotal dwell-seconds across all zones

Estimated .wasm size: 6 KB Budget tier: L (lightweight, < 2 ms) Difficulty: Medium


4.3 wdp-ret-customer-flow

Description: Directional foot traffic counting at entry/exit points and between departments. Uses asymmetric phase gradient analysis to determine movement direction. Maintains running counts of ingress and egress events and computes net occupancy (in - out). Handles simultaneous bidirectional traffic by decomposing the CSI disturbance into directional components. Emits count deltas and periodic summaries.

Host API dependencies: csi_get_phase, csi_get_amplitude, csi_get_variance, csi_get_phase_history, csi_get_motion_energy, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
420INGRESSCount (+1 per entry)
421EGRESSCount (+1 per exit)
422NET_OCCUPANCYCurrent in-out difference
423HOURLY_TRAFFICTotal passages in last hour

Estimated .wasm size: 8 KB Budget tier: S (standard, < 5 ms) -- phase gradient computation Difficulty: Medium


4.4 wdp-ret-table-turnover

Description: Restaurant table occupancy and turnover tracking. Detects table-level presence states: empty, seated (low motion, sustained presence), eating (moderate motion), and departing (rising motion followed by absence). Tracks seating duration and emits turnover events for waitlist management. Designed for a single-table sensing zone per node.

Host API dependencies: csi_get_presence, csi_get_motion_energy, csi_get_n_persons, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
430TABLE_SEATEDPerson count
431TABLE_VACATEDSeating duration (minutes)
432TABLE_AVAILABLE1.0 (ready for next party)
433TURNOVER_RATETables per hour (on_timer)

Estimated .wasm size: 4 KB Budget tier: L (lightweight, < 2 ms) Difficulty: Easy


4.5 wdp-ret-shelf-engagement

Description: Detects customer stopping near and interacting with retail shelving. A "shelf engagement" event fires when a person's presence is detected with low translational motion (not walking past) combined with localized high-frequency phase perturbation (reaching, picking up, examining products). Distinguishes browse (short stop, < 5 seconds), consider (5--30 seconds), and deep engagement (> 30 seconds). Provides product-interaction proxying without cameras.

Host API dependencies: csi_get_presence, csi_get_motion_energy, csi_get_variance, csi_get_phase, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
440SHELF_BROWSEDwell seconds
441SHELF_CONSIDERDwell seconds
442SHELF_ENGAGEDwell seconds
443REACH_DETECTEDConfidence 0.0--1.0

Estimated .wasm size: 6 KB Budget tier: S (standard, < 5 ms) Difficulty: Medium


Category 5: Industrial & Specialized (Event IDs 500--599)

5.1 wdp-ind-forklift-proximity

Description: Detects dangerous proximity between pedestrian workers and forklifts/AGVs in warehouse and factory environments. Forklifts produce a distinctive CSI signature: high-amplitude, low-frequency (< 0.3 Hz) phase modulation from the large metal body moving slowly, combined with engine/motor vibration harmonics. When this signature co-occurs with a human motion signature, a proximity alert fires. Priority: CRITICAL -- this is a life-safety module.

Host API dependencies: csi_get_phase, csi_get_amplitude, csi_get_variance, csi_get_motion_energy, csi_get_presence, csi_get_n_persons, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
500PROXIMITY_WARNINGEstimated distance category (0=critical, 1=warning, 2=caution)
501VEHICLE_DETECTEDConfidence 0.0--1.0
502HUMAN_NEAR_VEHICLE1.0 (co-presence confirmed)

Estimated .wasm size: 10 KB Budget tier: S (standard, < 5 ms) Difficulty: Hard


5.2 wdp-ind-confined-space

Description: Monitors worker presence and vital signs in confined spaces (tanks, silos, manholes, crawl spaces) where WiFi CSI excels due to strong multipath in enclosed metal environments. Tracks entry/exit events, continuous breathing confirmation (proof of life), and triggers emergency extraction alerts if breathing ceases for > 15 seconds or if all motion stops for > 60 seconds. Designed to satisfy OSHA confined space monitoring requirements (29 CFR 1910.146).

Host API dependencies: csi_get_presence, csi_get_bpm_breathing, csi_get_motion_energy, csi_get_variance, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
510WORKER_ENTRY1.0
511WORKER_EXITDuration inside (seconds)
512BREATHING_OKBreathing BPM (periodic heartbeat event)
513EXTRACTION_ALERTSeconds since last breathing detected
514IMMOBILE_ALERTSeconds of zero motion

Estimated .wasm size: 5 KB Budget tier: L (lightweight, < 2 ms) Difficulty: Medium


5.3 wdp-ind-clean-room

Description: Personnel count and movement tracking for cleanroom contamination control (ISO 14644). Cleanrooms require strict occupancy limits and controlled movement patterns. The module enforces maximum occupancy (configurable, default: 4 persons), detects rapid/turbulent movement that could disturb laminar airflow, and logs personnel dwell time for compliance reporting. Emits violations when occupancy exceeds the limit or movement energy exceeds the turbulence threshold.

Host API dependencies: csi_get_n_persons, csi_get_presence, csi_get_motion_energy, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
520OCCUPANCY_COUNTCurrent person count
521OCCUPANCY_VIOLATIONCount above maximum
522TURBULENT_MOTIONMotion energy above threshold
523COMPLIANCE_REPORTEncoded summary (on_timer)

Estimated .wasm size: 4 KB Budget tier: L (lightweight, < 2 ms) Difficulty: Easy


5.4 wdp-ind-livestock-monitor

Description: Detects animal presence, movement patterns, and breathing in agricultural settings (barns, stalls, coops). Animal CSI signatures differ from human signatures: quadrupedal gait has different periodicity, and livestock breathing rates are species- dependent (cattle: 12--30 BPM, sheep: 12--20, poultry: 15--30). The module detects abnormal stillness (potential illness), labored breathing, and escape events (sudden absence from a normally occupied stall). Configurable for species via initialization parameters.

Host API dependencies: csi_get_presence, csi_get_bpm_breathing, csi_get_motion_energy, csi_get_variance, csi_get_timestamp, csi_emit_event, csi_log

Event types emitted:

Event IDNameValue semantics
530ANIMAL_PRESENTCount estimate
531ABNORMAL_STILLNESSDuration (seconds)
532LABORED_BREATHINGDeviation from species baseline
533ESCAPE_ALERTStall vacancy detected

Estimated .wasm size: 6 KB Budget tier: L (lightweight, < 2 ms) Difficulty: Medium


5.5 wdp-ind-structural-vibration

Description: Uses CSI phase stability to detect building vibration, earthquake P-wave early arrival, and structural stress. In a static environment with no human presence, CSI phase should be stable to within the noise floor (~0.02 rad). Structural vibration causes coherent phase oscillation across all subcarriers simultaneously -- unlike human movement which affects subcarrier groups selectively. The module maintains a vibration spectral density estimate and alerts on: seismic activity (broadband > 1 Hz), mechanical resonance (narrowband harmonics from HVAC or machinery), and structural drift (slow monotonic phase change indicating settlement or thermal expansion).

Host API dependencies: csi_get_phase, csi_get_amplitude, csi_get_variance, csi_get_phase_history, csi_get_presence, csi_get_timestamp, csi_emit_event, csi_log

Event types emitted:

Event IDNameValue semantics
540SEISMIC_DETECTEDPeak acceleration proxy
541MECHANICAL_RESONANCEDominant frequency (Hz)
542STRUCTURAL_DRIFTPhase drift rate (rad/hour)
543VIBRATION_SPECTRUMEncoded spectral peaks

Estimated .wasm size: 10 KB Budget tier: H (heavy, < 10 ms) -- spectral density estimation Difficulty: Hard


Category 6: Exotic & Research (Event IDs 600--699)

These modules push WiFi CSI sensing into territory that sounds like science fiction -- but every one is grounded in published peer-reviewed research. WiFi signals at 2.4/5 GHz have wavelengths (12.5 cm / 6 cm) that interact with the human body at a resolution sufficient to detect chest wall displacement of 0.1 mm (breathing), wrist pulse of 0.01 mm (heartbeat), and even the micro-tremors of REM sleep eye movement. The following modules exploit these physical phenomena in ways that challenge assumptions about what contactless sensing can achieve.

6.1 wdp-exo-dream-stage

Description: Non-contact sleep stage classification from WiFi CSI alone. During sleep, the body cycles through distinct physiological states that produce measurable CSI signatures:

  • Awake: Frequent large body movements, irregular breathing, variable heart rate.
  • NREM Stage 1-2 (light sleep): Reduced movement, regular breathing (12--20 BPM), heart rate stabilizes.
  • NREM Stage 3 (deep/slow-wave sleep): Near-zero voluntary movement, slow deep breathing (8--14 BPM), minimal heart rate variability.
  • REM sleep: Body atonia (complete stillness of torso/limbs) combined with rapid irregular breathing, elevated heart rate variability, and micro-movements of the face/eyes that produce faint but detectable high-frequency CSI perturbations.

The module uses a state machine driven by breathing regularity, motion energy, heart rate variability (from phase signal), and a micro-movement spectral feature. Published research (Liu et al., MobiCom 2020; Niu et al., IEEE TMC 2022) has demonstrated >85% agreement with clinical polysomnography using WiFi CSI. The module emits sleep stage transitions and computes sleep quality metrics (sleep efficiency, REM percentage, deep sleep percentage).

This is non-contact polysomnography. No wearables, no electrodes, no cameras. Just WiFi signals reflecting off a sleeping body.

Host API dependencies: csi_get_bpm_breathing, csi_get_bpm_heartrate, csi_get_motion_energy, csi_get_phase, csi_get_variance, csi_get_phase_history, csi_get_presence, csi_get_timestamp, csi_emit_event, csi_log

Event types emitted:

Event IDNameValue semantics
600SLEEP_STAGEStage (0=awake, 1=NREM1-2, 2=NREM3, 3=REM)
601SLEEP_QUALITYSleep efficiency 0.0--1.0
602REM_EPISODEDuration (minutes)
603DEEP_SLEEP_RATIO% of total sleep

Estimated .wasm size: 14 KB Budget tier: H (heavy, < 10 ms) -- multi-feature state machine Difficulty: Hard


6.2 wdp-exo-emotion-detect

Description: Affect computing without cameras, microphones, or wearables. Emotional states produce involuntary physiological changes that alter CSI signatures:

  • Stress/anxiety: Elevated breathing rate, shallow breathing pattern, increased heart rate, elevated micro-movement jitter (fidgeting, restlessness), reduced breathing regularity.
  • Calm/relaxation: Slow deep breathing (6--10 BPM diaphragmatic pattern), low heart rate, minimal micro-movement, high breathing regularity.
  • Agitation/anger: Rapid irregular breathing, sharp sudden movements, elevated motion energy with high temporal variance.

The module computes a multi-dimensional stress vector from breathing pattern analysis (rate, depth, regularity), heart rate features (mean, variability), and motion features (energy, jerk, entropy). Published research (Zhao et al., UbiComp 2018; Yang et al., IEEE TAFFC 2021) has demonstrated >70% accuracy in classifying calm/stress/agitation states. The module outputs a continuous arousal-valence estimate rather than discrete emotion labels, acknowledging the complexity of emotional states.

Host API dependencies: csi_get_bpm_breathing, csi_get_bpm_heartrate, csi_get_motion_energy, csi_get_phase, csi_get_variance, csi_get_phase_history, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
610AROUSAL_LEVELLow(0.0) to high(1.0) arousal
611STRESS_INDEXComposite stress score 0.0--1.0
612CALM_DETECTEDConfidence 0.0--1.0
613AGITATION_DETECTEDConfidence 0.0--1.0

Estimated .wasm size: 10 KB Budget tier: H (heavy, < 10 ms) Difficulty: Hard


6.3 wdp-exo-gesture-language

Description: Sign language letter recognition from hand and arm movement CSI signatures. This extends the ADR-040 gesture module from simple hand swipes to the 26 letters of American Sign Language (ASL) fingerspelling. Each letter produces a distinctive sequence of phase disturbances across frequency-diverse subcarriers as the hand and fingers assume different configurations.

The module uses DTW (Dynamic Time Warping) template matching against a library of 26 reference signatures, with a decision threshold to reject non-letter movements. At 5 GHz (6 cm wavelength), finger-scale movements produce measurable phase shifts of 0.1--0.5 radians. Published research (Li et al., MobiCom 2019; Ma et al., NSDI 2019) has demonstrated per-letter recognition accuracy of >90% at distances up to 2 meters.

This is an accessibility breakthrough: a deaf person can fingerspell words in the air and have them recognized by WiFi -- no camera required, works through visual obstructions, and preserves privacy since no images are captured.

Host API dependencies: csi_get_phase, csi_get_amplitude, csi_get_variance, csi_get_phase_history, csi_get_motion_energy, csi_get_presence, csi_get_timestamp, csi_emit_event, csi_log

Event types emitted:

Event IDNameValue semantics
620LETTER_RECOGNIZEDASCII code of recognized letter
621LETTER_CONFIDENCERecognition confidence 0.0--1.0
622WORD_BOUNDARYPause duration (ms) between letters
623GESTURE_REJECTEDNon-letter movement detected

Estimated .wasm size: 18 KB (includes 26 DTW templates) Budget tier: H (heavy, < 10 ms) -- DTW matching against 26 templates Difficulty: Hard


6.4 wdp-exo-music-conductor

Description: Tracks conductor baton or hand movements to generate MIDI- compatible control signals. Extracts tempo (beats per minute from periodic arm movement), dynamics (forte/piano from motion amplitude), and basic gesture vocabulary (downbeat, upbeat, cutoff, fermata) from CSI phase patterns. The conducting pattern at 4/4 time produces a characteristic phase trajectory: strong downbeat, lateral second beat, higher third beat, rebounding fourth beat -- each with distinct subcarrier signatures.

The module outputs BPM, beat position (1-2-3-4), and dynamic level as events. A host application can map these to MIDI clock and CC messages for controlling synthesizers, lighting rigs, or interactive installations. This is an air instrument -- conduct an orchestra with WiFi.

Host API dependencies: csi_get_phase, csi_get_amplitude, csi_get_motion_energy, csi_get_phase_history, csi_get_variance, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
630CONDUCTOR_BPMDetected tempo (BPM)
631BEAT_POSITIONBeat number (1--4)
632DYNAMIC_LEVEL0.0 (pianissimo) to 1.0 (fortissimo)
633GESTURE_CUTOFF1.0 (stop gesture detected)
634GESTURE_FERMATA1.0 (hold gesture detected)

Estimated .wasm size: 10 KB Budget tier: S (standard, < 5 ms) Difficulty: Medium


6.5 wdp-exo-plant-growth

Description: Detects plant growth and leaf movement from micro-CSI changes accumulated over hours and days. Plants are not static: leaves undergo circadian nastic movements (opening/closing with light cycles), growing tips extend at rates measurable in mm/day, and water-stressed plants exhibit wilting that changes their RF cross-section.

The module operates on an extremely long time scale. It maintains multi-hour EWMA baselines of amplitude and phase per subcarrier and detects slow monotonic drift (growth), diurnal oscillation (circadian movement), and sudden change (wilting, pruning, watering). Requires a static environment with no human presence during measurement windows. The presence flag gates measurement: data is only accumulated when presence = 0.

This is botanical sensing through walls. Monitor your greenhouse from the next room using only WiFi reflections off leaves.

Host API dependencies: csi_get_amplitude, csi_get_phase, csi_get_variance, csi_get_presence, csi_get_timestamp, csi_emit_event, csi_log

Event types emitted:

Event IDNameValue semantics
640GROWTH_RATEAmplitude drift rate (dB/day)
641CIRCADIAN_PHASEEstimated circadian cycle phase (hours)
642WILT_DETECTEDAmplitude drop rate (sudden change)
643WATERING_EVENTRapid amplitude recovery detected

Estimated .wasm size: 6 KB Budget tier: L (lightweight, < 2 ms) -- only updates EWMA Difficulty: Medium


6.6 wdp-exo-ghost-hunter

Description: Environmental anomaly detector for CSI perturbations that occur when no humans are present. Marketed as a paranormal investigation tool (and genuinely used by ghost hunting communities), its actual utility is detecting:

  • Hidden persons: Someone concealed behind furniture or in a closet still displaces air and produces micro-CSI signatures from breathing.
  • Gas leaks: Air density changes from gas accumulation alter the RF propagation medium, producing slow phase drift.
  • Structural settling: Building creaks and shifts produce impulsive CSI disturbances.
  • Pest activity: Rodents and large insects produce faint but detectable motion signatures.
  • HVAC anomalies: Unusual airflow patterns from duct failures.
  • Electromagnetic interference: External RF sources that modulate the CSI channel.

The module requires presence = 0 (room declared empty) and monitors for any CSI perturbation above the noise floor. It classifies anomalies by temporal signature: impulsive (structural), periodic (mechanical/ biological), drift (environmental), and random (interference). Every anomaly is logged with timestamp and spectral fingerprint.

Whether you are looking for ghosts or gas leaks, this module watches the invisible.

Host API dependencies: csi_get_phase, csi_get_amplitude, csi_get_variance, csi_get_phase_history, csi_get_presence, csi_get_motion_energy, csi_get_timestamp, csi_emit_event, csi_log

Event types emitted:

Event IDNameValue semantics
650ANOMALY_DETECTEDAnomaly energy (dB above noise floor)
651ANOMALY_CLASSType (1=impulsive, 2=periodic, 3=drift, 4=random)
652HIDDEN_PRESENCEConfidence 0.0--1.0 (breathing-like signature)
653ENVIRONMENTAL_DRIFTPhase drift rate (rad/hour)

Estimated .wasm size: 8 KB Budget tier: S (standard, < 5 ms) Difficulty: Medium


6.7 wdp-exo-rain-detect

Description: Detects rain on windows and roofing from vibration-induced CSI micro-disturbances. Raindrops striking a surface produce broadband impulse vibrations that propagate through the building structure and modulate the CSI channel. The module detects rain onset, estimates intensity (light/moderate/heavy) from the aggregate vibration energy, and identifies cessation. Works because the ESP32 node is physically mounted to the building structure, coupling rainfall vibrations into the RF path.

This is weather sensing without any outdoor sensors -- the WiFi signal inside the building feels the rain on the roof.

Host API dependencies: csi_get_phase, csi_get_variance, csi_get_amplitude, csi_get_presence, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
660RAIN_ONSET1.0
661RAIN_INTENSITY0=none, 1=light, 2=moderate, 3=heavy
662RAIN_CESSATIONTotal duration (minutes)

Estimated .wasm size: 4 KB Budget tier: L (lightweight, < 2 ms) Difficulty: Easy


6.8 wdp-exo-breathing-sync

Description: Detects when multiple people's breathing patterns synchronize -- a real phenomenon observed in meditation groups, sleeping couples, and audience/performer interactions. When two or more people are in the same CSI field, their individual breathing signatures appear as superimposed periodic components in the phase signal. The module performs pairwise cross-correlation of breathing components (extracted via subcarrier group decomposition from Tier 2) and reports synchronization when the phase-locked value exceeds a threshold.

Published research (Adib et al., SIGCOMM 2015; Wang et al., MobiSys 2017) has demonstrated the ability to separate and correlate multiple people's breathing using WiFi CSI. Applications include:

  • Meditation quality assessment: Group coherence metric for mindfulness sessions.
  • Couple sleep monitoring: Detect when partners' breathing aligns during sleep (associated with deeper sleep quality).
  • Crowd resonance: Large-group breathing synchronization at concerts, sports events, or religious gatherings -- a measurable indicator of collective emotional engagement.
  • Therapeutic monitoring: Breathing synchronization between therapist and patient (rapport indicator).

The social coherence metric -- a number that quantifies how in-sync a group of humans is breathing -- is something that was unmeasurable before contactless sensing. WiFi CSI makes the invisible visible.

Host API dependencies: csi_get_bpm_breathing, csi_get_phase, csi_get_variance, csi_get_n_persons, csi_get_phase_history, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
670SYNC_DETECTEDPhase-locked value 0.0--1.0
671SYNC_PAIR_COUNTNumber of synchronized pairs
672GROUP_COHERENCEOverall group coherence index 0.0--1.0
673SYNC_LOSTDesynchronization event

Estimated .wasm size: 10 KB Budget tier: S (standard, < 5 ms) -- cross-correlation of breathing components Difficulty: Hard


Module Summary Table

#ModuleCategoryEvents.wasmBudgetDifficulty
1wdp-med-sleep-apneaMedical100--1024 KBLEasy
2wdp-med-cardiac-arrhythmiaMedical110--1138 KBSHard
3wdp-med-respiratory-distressMedical120--12310 KBHHard
4wdp-med-gait-analysisMedical130--13412 KBHHard
5wdp-med-seizure-detectMedical140--14310 KBSHard
6wdp-med-vital-trendMedical150--1536 KBLMedium
7wdp-sec-intrusion-detectSecurity200--2028 KBSMedium
8wdp-sec-perimeter-breachSecurity210--21310 KBSMedium
9wdp-sec-weapon-detectSecurity220--2228 KBSHard
10wdp-sec-tailgatingSecurity230--2326 KBLMedium
11wdp-sec-loiteringSecurity240--2423 KBLEasy
12wdp-sec-panic-motionSecurity250--2526 KBSMedium
13wdp-bld-occupancy-zonesBuilding300--3038 KBSMedium
14wdp-bld-hvac-presenceBuilding310--3123 KBLEasy
15wdp-bld-lighting-zonesBuilding320--3224 KBLEasy
16wdp-bld-elevator-countBuilding330--3338 KBSMedium
17wdp-bld-meeting-roomBuilding340--3435 KBLEasy
18wdp-bld-energy-auditBuilding350--3526 KBLMedium
19wdp-ret-queue-lengthRetail400--4036 KBLMedium
20wdp-ret-dwell-heatmapRetail410--4136 KBLMedium
21wdp-ret-customer-flowRetail420--4238 KBSMedium
22wdp-ret-table-turnoverRetail430--4334 KBLEasy
23wdp-ret-shelf-engagementRetail440--4436 KBSMedium
24wdp-ind-forklift-proximityIndustrial500--50210 KBSHard
25wdp-ind-confined-spaceIndustrial510--5145 KBLMedium
26wdp-ind-clean-roomIndustrial520--5234 KBLEasy
27wdp-ind-livestock-monitorIndustrial530--5336 KBLMedium
28wdp-ind-structural-vibrationIndustrial540--54310 KBHHard
29wdp-exo-dream-stageExotic600--60314 KBHHard
30wdp-exo-emotion-detectExotic610--61310 KBHHard
31wdp-exo-gesture-languageExotic620--62318 KBHHard
32wdp-exo-music-conductorExotic630--63410 KBSMedium
33wdp-exo-plant-growthExotic640--6436 KBLMedium
34wdp-exo-ghost-hunterExotic650--6538 KBSMedium
35wdp-exo-rain-detectExotic660--6624 KBLEasy
36wdp-exo-breathing-syncExotic670--67310 KBSHard

Totals: 37 modules, 133 event types, median size 6 KB, 15 easy / 12 medium / 11 hard.


Category 7: Vendor-Integrated Modules (Event IDs 700--899)

The following modules leverage algorithms from three vendored libraries to extend the WASM module collection from pure-CSI sensing into advanced computation at the edge. Each module wraps vendor functionality behind the standard Host API v1 contract, compiles to wasm32-unknown-unknown, and ships as an RVF container.

Vendor sources:

VendorPathKey capabilities
ruvectorvendor/ruvector/76 crates: attention mechanisms, min-cut graphs, sublinear solvers, temporal tensor compression, spiking neural networks, HNSW vector search, coherence gating
midstreamvendor/midstream/10 crates: DTW/LCS temporal comparison, nanosecond scheduling, attractor dynamics, LTL verification, meta-learning, AIMDS threat detection, QUIC multistream
sublinear-time-solvervendor/sublinear-time-solver/11 crates: O(log n) matrix solvers, PageRank, spectral sparsification, GOAP planning, psycho-symbolic reasoning, WASM-native neural inference

Budget Tier Note

Vendor-integrated modules tend to be computationally heavier than pure-threshold modules. Many require the S or H budget tier. When running vendor modules, prefer loading only one H-tier vendor module alongside L-tier core modules.

Naming Convention

CategoryPrefixEvent ID range
Signal Intelligencewdp-sig-700--729
Adaptive Learningwdp-lrn-730--759
Spatial Reasoningwdp-spt-760--789
Temporal Analysiswdp-tmp-790--819
Security Intelligencewdp-ais-820--849
Quantum-Inspiredwdp-qnt-850--879
Autonomous Systemswdp-aut-880--899

7.1 wdp-sig-flash-attention

Description: Applies Flash Attention (O(n) memory, tiled computation) to CSI subcarrier data for real-time spatial focus estimation. Instead of treating all 56 subcarriers equally, this module computes attention weights that identify which subcarrier groups carry the most motion information. The output is a per-frame "attention heatmap" across subcarrier bins that highlights the spatial regions of maximum perturbation. Enables downstream modules to focus computation on the most informative channels.

Vendor source: ruvector-attention (sparse/flash.rs)

Host API dependencies: csi_get_phase, csi_get_amplitude, csi_get_variance, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
700ATTENTION_PEAK_SCSubcarrier index with highest attention weight
701ATTENTION_SPREADEntropy of attention distribution (0=focused, 1=uniform)
702SPATIAL_FOCUS_ZONEEstimated zone ID from attention peak

Estimated .wasm size: 12 KB Budget tier: S (standard, < 5 ms) Difficulty: Medium


7.2 wdp-sig-temporal-compress

Description: Applies RuVector's temporal tensor compression to CSI phase history, achieving 4--10x compression with tiered quantization (Hot: 8-bit < 0.5% error, Warm: 5-bit < 3%, Cold: 3-bit archival). This enables the ESP32 to store hours of CSI history in limited PSRAM for long-term trend analysis. Modules like vital-trend and energy-audit benefit from compressed history extending from minutes to hours on-device.

Vendor source: ruvector-temporal-tensor (quantizer.rs, compressor.rs)

Host API dependencies: csi_get_phase, csi_get_amplitude, csi_get_phase_history, csi_get_timestamp, csi_emit_event, csi_log

Event types emitted:

Event IDNameValue semantics
705COMPRESSION_RATIOCurrent compression ratio (e.g., 6.4x)
706TIER_TRANSITIONNew tier (0=hot, 1=warm, 2=cold)
707HISTORY_DEPTH_HOURSHours of history stored in compressed buffer

Estimated .wasm size: 14 KB Budget tier: S (standard, < 5 ms) Difficulty: Medium


7.3 wdp-sig-coherence-gate

Description: Implements RuVector's coherence-gated attention switching. Computes a Z-score coherence metric across subcarrier phase phasors and uses hysteresis gating to decide whether the current CSI frame is trustworthy (Accept), marginal (PredictOnly), or corrupted (Reject/Recalibrate). Frames passing the gate feed downstream modules; rejected frames are suppressed to prevent false alarms from transient interference, co-channel transmitters, or hardware glitches.

Vendor source: ruvector-attn-mincut (hysteresis.rs), ruvector-coherence

Host API dependencies: csi_get_phase, csi_get_amplitude, csi_get_variance, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
710GATE_DECISION0=reject, 1=predict-only, 2=accept
711COHERENCE_SCOREZ-score coherence value (0.0--1.0)
712RECALIBRATE_NEEDEDDrift exceeds hysteresis threshold

Estimated .wasm size: 8 KB Budget tier: L (lightweight, < 2 ms) Difficulty: Medium


7.4 wdp-sig-sparse-recovery

Description: Uses RuVector's sublinear sparse solver to recover missing or corrupted subcarrier data. When the ESP32 receives CSI frames with null subcarriers (interference, hardware dropout), this module applies ISTA-like L1 sparse recovery to interpolate missing values from the remaining subcarriers' correlation structure. Recovers full 56-subcarrier frames from as few as 20 valid subcarriers using the known sparsity of indoor RF channels.

Vendor source: ruvector-solver (forward_push.rs, neumann.rs)

Host API dependencies: csi_get_phase, csi_get_amplitude, csi_get_variance, csi_get_timestamp, csi_emit_event, csi_log

Event types emitted:

Event IDNameValue semantics
715RECOVERY_COMPLETENumber of subcarriers recovered
716RECOVERY_ERRORReconstruction error norm
717DROPOUT_RATEFraction of null subcarriers (0.0--1.0)

Estimated .wasm size: 16 KB Budget tier: H (heavy, < 10 ms) Difficulty: Hard


7.5 wdp-sig-mincut-person-match

Description: Uses RuVector's dynamic min-cut algorithm for multi-person identity tracking across consecutive CSI frames. Models each person as a node in a bipartite assignment graph with edge weights derived from CSI signature similarity. The minimum cut partitions the graph into person-to- person correspondences across time, maintaining stable person IDs even when people cross paths or temporarily occlude each other.

Vendor source: ruvector-mincut (graph/mod.rs, algorithm/approximate.rs)

Host API dependencies: csi_get_phase, csi_get_variance, csi_get_n_persons, csi_get_motion_energy, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
720PERSON_ID_ASSIGNEDStable person ID (0--7)
721PERSON_ID_SWAPIDs swapped (encoded: old << 4
722MATCH_CONFIDENCEAssignment confidence (0.0--1.0)

Estimated .wasm size: 18 KB Budget tier: H (heavy, < 10 ms) Difficulty: Hard


7.6 wdp-lrn-dtw-gesture-learn

Description: Extends the ADR-040 gesture module with Midstream's Dynamic Time Warping engine, enabling users to teach the ESP32 new gestures by example. The user performs a gesture 3 times; the module extracts a DTW template from the phase trajectory and stores it in WASM linear memory. Subsequent frames are matched against all learned templates. Supports up to 16 custom gestures. Unlike the fixed 5-gesture ADR-040 module, this is a learning system.

Vendor source: midstream/temporal-compare (DTW, pattern matching)

Host API dependencies: csi_get_phase, csi_get_amplitude, csi_get_phase_history, csi_get_motion_energy, csi_get_presence, csi_get_timestamp, csi_emit_event, csi_log

Event types emitted:

Event IDNameValue semantics
730GESTURE_LEARNEDGesture slot ID (0--15)
731GESTURE_MATCHEDMatched gesture ID
732MATCH_DISTANCEDTW distance to best template
733TEMPLATE_COUNTNumber of stored templates

Estimated .wasm size: 14 KB Budget tier: H (heavy, < 10 ms) Difficulty: Medium


7.7 wdp-lrn-anomaly-attractor

Description: Uses Midstream's temporal attractor studio to characterize the "normal" dynamical behavior of a room's CSI signature as a phase-space attractor. Over the first hour, the module learns the attractor shape (point attractor for empty rooms, limit cycle for HVAC-only, strange attractor for occupied). Novel anomalies are detected as trajectories that leave the learned attractor basin. Computes Lyapunov exponents to quantify room stability. More principled than threshold-based anomaly detection.

Vendor source: midstream/temporal-attractor-studio (attractor analysis, Lyapunov)

Host API dependencies: csi_get_phase, csi_get_variance, csi_get_amplitude, csi_get_motion_energy, csi_get_presence, csi_get_timestamp, csi_emit_event, csi_log

Event types emitted:

Event IDNameValue semantics
735ATTRACTOR_TYPE0=point, 1=limit-cycle, 2=strange
736LYAPUNOV_EXPONENTLargest Lyapunov exponent (>0 = chaotic)
737BASIN_DEPARTURETrajectory distance from attractor (0.0--1.0)
738LEARNING_COMPLETE1.0 when attractor is characterized

Estimated .wasm size: 10 KB Budget tier: S (standard, < 5 ms) Difficulty: Hard


7.8 wdp-lrn-meta-adapt

Description: Uses Midstream's strange-loop meta-learning engine for on-device self-optimization of sensing parameters. The module observes which threshold settings produce the most accurate detections (via feedback from the host confirming/denying events) and adjusts thresholds across iterations. Implements safety-constrained self-modification: parameters can only change within bounded ranges, and a rollback mechanism reverts changes that increase false positives.

Vendor source: midstream/strange-loop (meta-learning, safety constraints)

Host API dependencies: csi_get_presence, csi_get_motion_energy, csi_get_variance, csi_get_timestamp, csi_emit_event, csi_log

Event types emitted:

Event IDNameValue semantics
740PARAM_ADJUSTEDParameter ID that was tuned
741ADAPTATION_SCORECurrent meta-learning score (0.0--1.0)
742ROLLBACK_TRIGGEREDParameter reverted due to degradation
743META_LEVELCurrent meta-learning recursion depth

Estimated .wasm size: 10 KB Budget tier: S (standard, < 5 ms) Difficulty: Hard


7.9 wdp-spt-pagerank-influence

Description: Applies the sublinear-time-solver's PageRank algorithm to model influence propagation in multi-person sensing fields. Each detected person is a node; edge weights represent CSI cross-correlation between person-associated subcarrier groups. PageRank scores identify the "dominant mover" -- the person whose motion most affects the CSI channel. Useful for multi-person scenarios where you need to track the primary actor (e.g., a nurse in a patient room, a presenter in a meeting).

Vendor source: sublinear-time-solver (forward_push, PageRank)

Host API dependencies: csi_get_phase, csi_get_variance, csi_get_n_persons, csi_get_motion_energy, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
760DOMINANT_PERSONPerson ID with highest PageRank
761INFLUENCE_SCOREPageRank score of dominant person (0.0--1.0)
762INFLUENCE_CHANGEPerson ID whose rank changed most

Estimated .wasm size: 12 KB Budget tier: S (standard, < 5 ms) Difficulty: Medium


7.10 wdp-spt-micro-hnsw

Description: Deploys RuVector's micro-HNSW (11.8 KB WASM footprint) for on-device vector similarity search against a library of reference CSI fingerprints. The ESP32 stores up to 256 reference vectors representing known room states, person locations, or activity patterns. Each new CSI frame is encoded as a vector and nearest-neighbor searched against the library. Returns the closest match with distance. Enables location fingerprinting, activity recognition, and environment classification without server roundtrips.

Vendor source: ruvector/micro-hnsw-wasm (neuromorphic HNSW, 11.8 KB)

Host API dependencies: csi_get_phase, csi_get_amplitude, csi_get_variance, csi_get_timestamp, csi_emit_event, csi_log

Event types emitted:

Event IDNameValue semantics
765NEAREST_MATCH_IDIndex of closest reference vector (0--255)
766MATCH_DISTANCECosine distance to nearest match (0.0--2.0)
767CLASSIFICATIONSemantic label ID of matched reference
768LIBRARY_SIZECurrent number of stored reference vectors

Estimated .wasm size: 12 KB (micro-HNSW is 11.8 KB) Budget tier: S (standard, < 5 ms) Difficulty: Medium


7.11 wdp-spt-spiking-tracker

Description: Replaces the traditional Kalman filter with RuVector's bio-inspired spiking neural network for person tracking. LIF (Leaky Integrate-and-Fire) neurons process CSI phase changes as spike trains; STDP (Spike-Timing-Dependent Plasticity) learns temporal correlations between subcarrier activations. The network self-organizes to track person movement trajectories. More adaptive than Kalman to non-linear motion and automatically handles multi-person scenarios through winner-take-all competition between neuron populations.

Vendor source: ruvector-nervous-system (LIF neurons, STDP, winner-take-all)

Host API dependencies: csi_get_phase, csi_get_amplitude, csi_get_variance, csi_get_motion_energy, csi_get_n_persons, csi_get_phase_history, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
770TRACK_UPDATEPerson ID (high nibble) + zone (low nibble)
771TRACK_VELOCITYEstimated velocity proxy (0.0--1.0)
772SPIKE_RATENetwork firing rate (Hz, proxy for motion complexity)
773TRACK_LOSTPerson ID whose track was lost

Estimated .wasm size: 16 KB Budget tier: H (heavy, < 10 ms) Difficulty: Hard


7.12 wdp-tmp-pattern-sequence

Description: Uses Midstream's temporal-compare engine to detect recurring temporal patterns in CSI data: daily routines, periodic activities, and behavioral sequences. Computes Longest Common Subsequence (LCS) across time windows to find repeating motion signatures. After a week of operation, the module can predict "person arrives at kitchen at 7:15 AM" or "office empties at 6 PM on weekdays." Outputs pattern confidence scores and deviation alerts when the routine breaks.

Vendor source: midstream/temporal-compare (LCS, edit distance, pattern detection)

Host API dependencies: csi_get_presence, csi_get_motion_energy, csi_get_n_persons, csi_get_timestamp, csi_emit_event, csi_log

Event types emitted:

Event IDNameValue semantics
790PATTERN_DETECTEDPattern ID (0--31)
791PATTERN_CONFIDENCEConfidence (0.0--1.0)
792ROUTINE_DEVIATIONDeviation from expected (minutes)
793PREDICTION_NEXTPredicted next activity pattern ID

Estimated .wasm size: 10 KB Budget tier: S (standard, < 5 ms) Difficulty: Medium


7.13 wdp-tmp-temporal-logic-guard

Description: Uses Midstream's temporal neural solver to enforce safety invariants on sensing outputs using Linear Temporal Logic (LTL). Example rules: "Globally(presence=0 implies no fall_alert)" prevents false fall alarms in empty rooms. "Finally(intrusion implies alert within 10s)" ensures alerts are timely. The module monitors the event stream from other modules and flags LTL violations -- detecting impossible event combinations that indicate sensor malfunction or adversarial tampering.

Vendor source: midstream/temporal-neural-solver (LTL verification)

Host API dependencies: csi_get_presence, csi_get_motion_energy, csi_get_timestamp, csi_emit_event, csi_log

Event types emitted:

Event IDNameValue semantics
795LTL_VIOLATIONViolated rule ID
796LTL_SATISFACTIONAll rules satisfied (periodic heartbeat)
797COUNTEREXAMPLEFrame index of first violation

Estimated .wasm size: 12 KB Budget tier: S (standard, < 5 ms) Difficulty: Hard


7.14 wdp-tmp-goap-autonomy

Description: Uses the sublinear-time-solver's Goal-Oriented Action Planning (GOAP) engine to make the ESP32 node autonomously decide which sensing modules to activate based on context. When presence is detected, the planner activates fall detection; when room is empty, it activates intrusion detection; when multiple people are present, it activates occupancy counting. The module dynamically loads/unloads WASM modules to optimize the limited 4-slot runtime. The ESP32 becomes self-directing.

Vendor source: sublinear-time-solver (temporal_consciousness_goap.rs, A* planning)

Host API dependencies: csi_get_presence, csi_get_n_persons, csi_get_motion_energy, csi_get_timestamp, csi_emit_event, csi_log

Event types emitted:

Event IDNameValue semantics
800GOAL_SELECTEDGoal ID (e.g., 1=monitor, 2=secure, 3=track)
801MODULE_ACTIVATEDModule slot ID activated
802MODULE_DEACTIVATEDModule slot ID freed
803PLAN_COSTEstimated plan cost (lower is better)

Estimated .wasm size: 14 KB Budget tier: S (standard, < 5 ms) Difficulty: Hard


7.15 wdp-ais-prompt-shield

Description: Adapts Midstream's AIMDS (AI Manipulation Defense System) pattern matcher for CSI event stream integrity. Detects adversarial manipulation of CSI signals designed to trigger false events -- e.g., a replay attack that plays back recorded CSI to fake "empty room" while someone is present. The module compares incoming CSI statistical fingerprints against known attack patterns (replay, injection, jamming) using regex-like signature matching on temporal sequences.

Vendor source: midstream/aimds-detection (pattern_matcher.rs, sanitizer.rs)

Host API dependencies: csi_get_phase, csi_get_amplitude, csi_get_variance, csi_get_phase_history, csi_get_timestamp, csi_emit_event, csi_log

Event types emitted:

Event IDNameValue semantics
820REPLAY_ATTACKConfidence (0.0--1.0)
821INJECTION_DETECTEDAnomalous subcarrier count
822JAMMING_DETECTEDSNR degradation (dB)
823SIGNAL_INTEGRITYOverall integrity score (0.0--1.0)

Estimated .wasm size: 10 KB Budget tier: S (standard, < 5 ms) Difficulty: Medium


7.16 wdp-ais-behavioral-profiler

Description: Uses Midstream's behavioral analyzer (attractor-based anomaly detection with Mahalanobis scoring) to build a behavioral profile of the monitored space. Over days, the module learns the space's "normal" multivariate behavior (motion patterns, occupancy rhythms, presence durations). Deviations exceeding 3 sigma trigger anomaly alerts with severity scoring. Detects novel threats that pattern-matching cannot: an unfamiliar gait pattern, unusual occupancy at an unexpected hour, or motion in a direction never seen before.

Vendor source: midstream/aimds-analysis (behavioral.rs, anomaly scoring)

Host API dependencies: csi_get_presence, csi_get_motion_energy, csi_get_variance, csi_get_n_persons, csi_get_timestamp, csi_emit_event, csi_log

Event types emitted:

Event IDNameValue semantics
825BEHAVIOR_ANOMALYAnomaly score (0.0--1.0, >0.7 = alert)
826PROFILE_DEVIATIONMahalanobis distance from baseline
827NOVEL_PATTERN1.0 when a never-seen pattern occurs
828PROFILE_MATURITYDays of profiling data (0 = learning)

Estimated .wasm size: 12 KB Budget tier: S (standard, < 5 ms) Difficulty: Hard


7.17 wdp-qnt-quantum-coherence

Description: Applies RuVector's quantum circuit simulator to model CSI phase coherence as a quantum-inspired state. Each subcarrier's phase is mapped to a qubit on the Bloch sphere; multi-subcarrier coherence is quantified via entanglement entropy. Decoherence events (sudden loss of inter-subcarrier phase correlation) are detected as "wave function collapse." This provides a mathematically rigorous coherence metric that is more sensitive than classical correlation measures for detecting subtle environmental changes.

Vendor source: ruvector/ruqu-core (state-vector simulation, noise models)

Host API dependencies: csi_get_phase, csi_get_amplitude, csi_get_variance, csi_get_phase_history, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
850ENTANGLEMENT_ENTROPYVon Neumann entropy (0.0 = coherent, 1.0 = decoherent)
851DECOHERENCE_EVENTEntropy jump magnitude
852BLOCH_DRIFTAggregate Bloch vector drift rate

Estimated .wasm size: 16 KB Budget tier: H (heavy, < 10 ms) Difficulty: Hard


Description: Uses quantum-inspired interference patterns (from RuVector's ruqu-exotic) to perform multi-hypothesis search over possible room configurations. Each hypothesis (e.g., "1 person in zone A", "2 people in zones A+C") is modeled as an amplitude in a quantum-inspired superposition. CSI evidence constructively interferes with correct hypotheses and destructively cancels incorrect ones. After sufficient frames, the surviving hypothesis is the most likely room state. Grover-inspired quadratic speedup over exhaustive search.

Vendor source: ruvector/ruqu-exotic (interference search, Grover-inspired)

Host API dependencies: csi_get_phase, csi_get_amplitude, csi_get_variance, csi_get_n_persons, csi_get_presence, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
855HYPOTHESIS_WINNERWinning configuration ID
856HYPOTHESIS_AMPLITUDEProbability amplitude (0.0--1.0)
857SEARCH_ITERATIONSFrames used for convergence

Estimated .wasm size: 14 KB Budget tier: H (heavy, < 10 ms) Difficulty: Hard


7.19 wdp-aut-psycho-symbolic

Description: Adapts the sublinear-time-solver's psycho-symbolic reasoning engine for context-aware CSI interpretation. The module maintains a knowledge graph of sensing rules: "IF presence AND high_motion AND time=night THEN possible_intruder" with confidence propagation. Rules are inferred from patterns, not hardcoded. The reasoner can detect emotional context (stressed movement patterns from the emotion module) and adjust security sensitivity accordingly. Supports 14+ reasoning styles including abductive, analogical, and counterfactual.

Vendor source: sublinear-time-solver/psycho-symbolic-reasoner (graph_reasoner, extractors)

Host API dependencies: csi_get_presence, csi_get_motion_energy, csi_get_variance, csi_get_n_persons, csi_get_timestamp, csi_emit_event, csi_log

Event types emitted:

Event IDNameValue semantics
880INFERENCE_RESULTConcluded state ID
881INFERENCE_CONFIDENCEReasoning confidence (0.0--1.0)
882RULE_FIREDRule ID that triggered
883CONTRADICTION1.0 when conflicting evidence detected

Estimated .wasm size: 16 KB Budget tier: H (heavy, < 10 ms) Difficulty: Hard


7.20 wdp-aut-self-healing-mesh

Description: Uses RuVector's min-cut self-healing network algorithms for multi-node ESP32 mesh resilience. In a deployment with multiple ESP32 nodes, this module monitors inter-node CSI cross-correlation to detect node failures, interference, or physical obstruction. When a node's contribution degrades, the module recomputes the mesh topology via min-cut to identify the optimal remaining node subset that maintains sensing coverage. Emits reconfiguration events for the mesh coordinator.

Vendor source: ruvector-mincut (dynamic min-cut, self-healing network)

Host API dependencies: csi_get_phase, csi_get_amplitude, csi_get_variance, csi_get_timestamp, csi_emit_event, csi_log

Event types emitted:

Event IDNameValue semantics
885NODE_DEGRADEDNode ID with degraded CSI quality
886MESH_RECONFIGURENew optimal node count
887COVERAGE_SCORESensing coverage quality (0.0--1.0)
888HEALING_COMPLETE1.0 when mesh has stabilized

Estimated .wasm size: 14 KB Budget tier: S (standard, < 5 ms) Difficulty: Hard


7.21 wdp-sig-optimal-transport

Description: Uses RuVector's sliced Wasserstein distance (optimal transport) to measure the "earth mover distance" between consecutive CSI frame distributions. Unlike variance-based motion detection that loses spatial information, optimal transport preserves the geometry of how energy moves across subcarriers between frames. Detects subtle motions (hand gestures, typing) that variance-based methods miss because the total variance doesn't change -- only the distribution shifts.

Vendor source: ruvector-math (transport/sliced_wasserstein.rs)

Host API dependencies: csi_get_phase, csi_get_amplitude, csi_get_variance, csi_get_phase_history, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
725WASSERSTEIN_DISTANCEEarth mover distance between frames
726DISTRIBUTION_SHIFTShift direction (subcarrier region)
727SUBTLE_MOTION1.0 when transport > threshold but variance < threshold

Estimated .wasm size: 12 KB Budget tier: S (standard, < 5 ms) Difficulty: Hard


7.22 wdp-lrn-ewc-lifelong

Description: Implements Elastic Weight Consolidation (EWC++) from RuVector's SONA for lifelong on-device learning that doesn't forget. When the module learns new activity patterns (via dtw-gesture-learn or anomaly-attractor), EWC prevents catastrophic forgetting of previously learned patterns by penalizing changes to important weights. The ESP32 can learn continuously over months without degrading early knowledge. Fisher Information matrix diagonal approximation keeps memory footprint under 4 KB.

Vendor source: ruvector/sona (EWC++ implementation), ruvector-gnn (EWC)

Host API dependencies: csi_get_timestamp, csi_emit_event, csi_log

Event types emitted:

Event IDNameValue semantics
745KNOWLEDGE_RETAINEDRetention score (0.0--1.0)
746NEW_TASK_LEARNEDTask ID learned without forgetting
747FISHER_UPDATEFisher diagonal updated (periodic)
748FORGETTING_RISKRisk of forgetting old patterns (0.0--1.0)

Estimated .wasm size: 8 KB Budget tier: L (lightweight, < 2 ms) Difficulty: Hard


7.23 wdp-exo-time-crystal

Description: Uses RuVector's time crystal pattern recognition to detect periodic temporal structures in CSI data that are invisible to standard spectral analysis. Time crystals are discrete temporal symmetry-breaking patterns: repeating structures whose period is a multiple of the driving frequency. In CSI terms, this detects phenomena like a person's breathing-motion interference pattern (breath rate * gait rate modulation) that creates "sub-harmonic" signatures. Detects multi-person temporal interference patterns that indicate coordinated activity.

Vendor source: ruvector-mincut/snn (time_crystal.rs)

Host API dependencies: csi_get_phase, csi_get_variance, csi_get_phase_history, csi_get_motion_energy, csi_get_presence, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
680CRYSTAL_DETECTEDPeriod multiplier (e.g., 2 = period doubling)
681CRYSTAL_STABILITYStability score (0.0--1.0)
682COORDINATION_INDEXMulti-person coordination (0.0--1.0)

Estimated .wasm size: 12 KB Budget tier: H (heavy, < 10 ms) Difficulty: Hard


7.24 wdp-exo-hyperbolic-space

Description: Uses RuVector's Poincare ball model to embed CSI fingerprints in hyperbolic space, where hierarchical relationships (room > zone > spot) are naturally represented by distance from the origin. Points near the Poincare disk center represent room-level features; points near the boundary represent fine-grained location features. Hierarchical location classification becomes a radial distance check rather than a multi-stage classifier. Provably better than Euclidean embedding for tree-structured spatial hierarchies.

Vendor source: ruvector-hyperbolic-hnsw (Poincare ball), ruvector-attention/hyperbolic

Host API dependencies: csi_get_phase, csi_get_amplitude, csi_get_variance, csi_get_timestamp, csi_emit_event

Event types emitted:

Event IDNameValue semantics
685HIERARCHY_LEVELDepth in location tree (0=room, 1=zone, 2=spot)
686HYPERBOLIC_RADIUSDistance from Poincare origin (specificity)
687LOCATION_LABELBest-match location ID from hierarchy

Estimated .wasm size: 12 KB Budget tier: S (standard, < 5 ms) Difficulty: Hard


Updated Module Summary Table (Vendor-Integrated)

#ModuleCategoryEvents.wasmBudgetVendorDifficulty
37wdp-sig-flash-attentionSignal700--70212 KBSruvectorMedium
38wdp-sig-temporal-compressSignal705--70714 KBSruvectorMedium
39wdp-sig-coherence-gateSignal710--7128 KBLruvectorMedium
40wdp-sig-sparse-recoverySignal715--71716 KBHruvectorHard
41wdp-sig-mincut-person-matchSignal720--72218 KBHruvectorHard
42wdp-sig-optimal-transportSignal725--72712 KBSruvectorHard
43wdp-lrn-dtw-gesture-learnLearning730--73314 KBHmidstreamMedium
44wdp-lrn-anomaly-attractorLearning735--73810 KBSmidstreamHard
45wdp-lrn-meta-adaptLearning740--74310 KBSmidstreamHard
46wdp-lrn-ewc-lifelongLearning745--7488 KBLruvectorHard
47wdp-spt-pagerank-influenceSpatial760--76212 KBSsublinearMedium
48wdp-spt-micro-hnswSpatial765--76812 KBSruvectorMedium
49wdp-spt-spiking-trackerSpatial770--77316 KBHruvectorHard
50wdp-tmp-pattern-sequenceTemporal790--79310 KBSmidstreamMedium
51wdp-tmp-temporal-logic-guardTemporal795--79712 KBSmidstreamHard
52wdp-tmp-goap-autonomyTemporal800--80314 KBSsublinearHard
53wdp-ais-prompt-shieldAI Security820--82310 KBSmidstreamMedium
54wdp-ais-behavioral-profilerAI Security825--82812 KBSmidstreamHard
55wdp-qnt-quantum-coherenceQuantum850--85216 KBHruvectorHard
56wdp-qnt-interference-searchQuantum855--85714 KBHruvectorHard
57wdp-aut-psycho-symbolicAutonomous880--88316 KBHsublinearHard
58wdp-aut-self-healing-meshAutonomous885--88814 KBSruvectorHard
59wdp-exo-time-crystalExotic680--68212 KBHruvectorHard
60wdp-exo-hyperbolic-spaceExotic685--68712 KBSruvectorHard

Grand Totals: 60 modules, 224 event types, 13 vendor categories.

Combined Collection Statistics

MetricOriginal (1--36)Vendor (37--60)Total
Modules362460
Event types13391224
Median .wasm size6 KB12 KB8 KB
Lightweight (L)13316
Standard (S)131427
Heavy (H)10717
Easy808
Medium12820
Hard161632

Vendor Module Implementation Priority

Phase 2a -- Vendor Quick Wins (Q2--Q3 2026)

Modules that wrap existing, well-tested vendor algorithms with minimal adaptation. These deliver advanced capabilities with low implementation risk.

ModuleVendorRationale
wdp-sig-coherence-gateruvectorAlready implemented in firmware Tier 2; wrap for WASM composability
wdp-sig-temporal-compressruvectorExtends on-device history from minutes to hours; high utility
wdp-lrn-dtw-gesture-learnmidstreamNatural extension of ADR-040 gesture module; user-facing feature
wdp-ais-prompt-shieldmidstreamSecurity hardening; pattern matcher is battle-tested
wdp-spt-micro-hnswruvectorSmallest WASM footprint (11.8 KB); enables on-device fingerprinting
wdp-tmp-pattern-sequencemidstreamLCS/DTW are mature algorithms; high user value for routine detection

Phase 2b -- Vendor Advanced (Q3--Q4 2026)

ModuleVendorRationale
wdp-sig-flash-attentionruvectorEnables smart subcarrier selection; multiplier for all modules
wdp-sig-mincut-person-matchruvectorSolves the multi-person tracking identity problem
wdp-lrn-anomaly-attractormidstreamPrincipled anomaly detection; replaces ad-hoc thresholds
wdp-tmp-goap-autonomysublinearMakes nodes self-directing; significant differentiation
wdp-spt-pagerank-influencesublinearNovel approach to multi-person scene understanding
wdp-ais-behavioral-profilermidstreamLong-term security through learned baselines

Phase 3 -- Vendor Frontier (2027+)

ModuleVendorRationale
wdp-qnt-quantum-coherenceruvectorNovel coherence metric; needs validation dataset
wdp-qnt-interference-searchruvectorQuadratic speedup for configuration search; theoretical
wdp-aut-psycho-symbolicsublinearContext-aware interpretation; requires knowledge base curation
wdp-spt-spiking-trackerruvectorBio-inspired tracking; needs extensive comparison with Kalman
wdp-exo-time-crystalruvectorTemporal symmetry breaking; novel research direction
wdp-exo-hyperbolic-spaceruvectorHierarchical embedding; needs spatial ground truth data
wdp-lrn-meta-adaptmidstreamSelf-modifying thresholds; safety constraints critical
wdp-lrn-ewc-lifelongruvectorLifelong learning; needs months of longitudinal testing
wdp-sig-sparse-recoveryruvectorSubcarrier recovery; needs controlled dropout experiments
wdp-sig-optimal-transportruvectorGeometric motion detection; needs comparison study
wdp-tmp-temporal-logic-guardmidstreamFormal safety verification; needs LTL rule library
wdp-aut-self-healing-meshruvectorMulti-node resilience; needs mesh deployment hardware

Module Manifest Convention

RVF Manifest Fields

Every module ships as an RVF container (ADR-040 Appendix C) with these standardized manifest fields:

FieldConvention
module_namewdp-{category}-{name}, max 32 chars
required_host_api1 (all modules target Host API v1)
capabilitiesBitmask of required host functions (ADR-040 C.4)
max_frame_usBudget tier: L=2000, S=5000, H=10000
max_events_per_secTypical: 10 for lightweight, 20 for standard, 5 for heavy
memory_limit_kbModule-specific, default 32 KB
event_schema_version1 for all initial modules
min_subcarriersMinimum required (8 for most, 32 for exotic)
authorContributor handle, max 10 chars

TOML Manifest (Human-Readable)

Each module includes a .toml companion for human review and tooling:

toml
[module]
name = "wdp-med-sleep-apnea"
version = "1.0.0"
description = "Detects breathing cessation during sleep"
author = "ruvnet"
license = "MIT"
category = "medical"
difficulty = "easy"

[api]
host_api_version = 1
capabilities = ["READ_VITALS", "EMIT_EVENTS", "LOG"]

[budget]
tier = "lightweight"
max_frame_us = 2000
max_events_per_sec = 10
memory_limit_kb = 16

[events]
100 = { name = "APNEA_START", unit = "seconds" }
101 = { name = "APNEA_END", unit = "seconds" }
102 = { name = "AHI_UPDATE", unit = "events_per_hour" }

[build]
target = "wasm32-unknown-unknown"
profile = "release"
min_subcarriers = 8

Event Type ID Registry

RangeCategoryAllocation
0--99Core / ADR-040 flagshipReserved for system and flagship modules
100--199Medical & Health6 modules, ~24 event types allocated
200--299Security & Safety6 modules, ~18 event types allocated
300--399Smart Building6 modules, ~20 event types allocated
400--499Retail & Hospitality5 modules, ~16 event types allocated
500--599Industrial & Specialized5 modules, ~16 event types allocated
600--699Exotic & Research10 modules, ~36 event types allocated
700--729Signal Intelligence (vendor)6 modules, ~18 event types (ruvector)
730--759Adaptive Learning (vendor)4 modules, ~16 event types (midstream, ruvector)
760--789Spatial Reasoning (vendor)3 modules, ~12 event types (ruvector, sublinear)
790--819Temporal Analysis (vendor)3 modules, ~12 event types (midstream, sublinear)
820--849Security Intelligence (vendor)2 modules, ~8 event types (midstream)
850--879Quantum-Inspired (vendor)2 modules, ~6 event types (ruvector)
880--899Autonomous Systems (vendor)2 modules, ~8 event types (sublinear, ruvector)
900--999Community / third-partyOpen allocation via registry PR

Within each range, modules are assigned 10-ID blocks (e.g., sleep-apnea gets 100--109, cardiac-arrhythmia gets 110--119). This leaves room for future event types within each module without reallocating.


Registry Structure

modules/
  registry.toml              # Master index of all modules with versions
  README.md                  # Auto-generated catalog with descriptions
  medical/
    sleep-apnea/
      wdp-med-sleep-apnea.rvf         # Signed RVF container
      wdp-med-sleep-apnea.toml        # Human-readable manifest
      wdp-med-sleep-apnea.wasm        # Raw WASM (for dev/debug)
      src/
        lib.rs                         # Module source code
        Cargo.toml                     # Crate manifest
      tests/
        integration.rs                 # Test against mock host API
      CHANGELOG.md
    cardiac-arrhythmia/
      ...
    respiratory-distress/
      ...
  security/
    intrusion-detect/
      wdp-sec-intrusion-detect.rvf
      wdp-sec-intrusion-detect.toml
      src/
        lib.rs
        Cargo.toml
      tests/
        integration.rs
      CHANGELOG.md
    perimeter-breach/
      ...
  building/
    occupancy-zones/
      ...
    hvac-presence/
      ...
  retail/
    queue-length/
      ...
    dwell-heatmap/
      ...
  industrial/
    forklift-proximity/
      ...
    confined-space/
      ...
  exotic/
    dream-stage/
      ...
    emotion-detect/
      ...
    ghost-hunter/
      ...
    time-crystal/
      ...
    hyperbolic-space/
      ...
  vendor-signal/
    flash-attention/
      wdp-sig-flash-attention.rvf
      wdp-sig-flash-attention.toml
      src/
        lib.rs
        Cargo.toml
      VENDOR_SOURCE.md              # Documents vendor crate origin
    temporal-compress/
      ...
    coherence-gate/
      ...
    sparse-recovery/
      ...
    mincut-person-match/
      ...
    optimal-transport/
      ...
  vendor-learning/
    dtw-gesture-learn/
      ...
    anomaly-attractor/
      ...
    meta-adapt/
      ...
    ewc-lifelong/
      ...
  vendor-spatial/
    pagerank-influence/
      ...
    micro-hnsw/
      ...
    spiking-tracker/
      ...
  vendor-temporal/
    pattern-sequence/
      ...
    temporal-logic-guard/
      ...
    goap-autonomy/
      ...
  vendor-security/
    prompt-shield/
      ...
    behavioral-profiler/
      ...
  vendor-quantum/
    quantum-coherence/
      ...
    interference-search/
      ...
  vendor-autonomous/
    psycho-symbolic/
      ...
    self-healing-mesh/
      ...

registry.toml Format

toml
[registry]
version = "2.0.0"
host_api_version = 1
total_modules = 60

[[modules]]
name = "wdp-med-sleep-apnea"
version = "1.0.0"
category = "medical"
event_range = [100, 102]
wasm_size_kb = 4
budget_tier = "lightweight"
status = "stable"      # stable | beta | experimental | deprecated
sha256 = "abc123..."

[[modules]]
name = "wdp-exo-dream-stage"
version = "0.1.0"
category = "exotic"
event_range = [600, 603]
wasm_size_kb = 14
budget_tier = "heavy"
status = "experimental"
sha256 = "def456..."

Consequences

Positive

  1. Market multiplier: A single $8 ESP32-S3 node becomes a multi-purpose sensing platform. A hospital buys one SKU and deploys sleep apnea detection in the ICU, fall detection in geriatrics, and queue management in the ER -- all via WASM module uploads. No hardware changes, no reflashing. With vendor-integrated modules, the same node gains adaptive learning, autonomous planning, and quantum-inspired analysis.

  2. Community velocity: The module contract (12 host functions, RVF container, TOML manifest) is simple enough for a graduate student to implement a new sensing algorithm in a weekend. The 15 "easy" difficulty modules are specifically designed as on-ramps for first-time contributors.

  3. Research platform: The exotic modules provide a credible, reproducible platform for WiFi sensing research. Instead of each lab building their own CSI collection and processing pipeline, researchers can focus on their algorithm and package it as a WASM module that runs on any WiFi-DensePose deployment.

  4. Vertical expansion: Each category targets a different market segment with its own buyers, compliance requirements, and ROI models. Medical modules sell to hospitals and eldercare. Security modules sell to commercial real estate. Retail modules sell to chains. Industrial modules sell to manufacturing. This diversifies the addressable market by 10x without diversifying the hardware.

  5. Regulatory pathway: Medical modules can pursue FDA 510(k) clearance independently of the base firmware. The WASM isolation boundary provides a natural regulatory decomposition: the firmware is the platform (Class I), individual medical modules pursue device classification independently.

  6. Graceful degradation: Every module is optional. A node runs with zero modules (Tier 0-2 only) or any combination. If a module faults, the runtime auto-stops it and the rest continue. There is no single point of failure in the module collection.

  7. Vendor algorithm leverage: The 24 vendor-integrated modules bring algorithms that would take years to develop from scratch -- sublinear solvers, attention mechanisms, temporal logic verification, spiking neural networks, quantum-inspired search. By wrapping existing battle-tested code behind the Host API, we convert library value into edge deployment value without duplicating research effort.

  8. Practical-to-exotic spectrum: The catalog spans from immediately deployable modules (HVAC presence, queue counting) through advanced ML (attractor-based anomaly detection, lifelong learning) to frontier research (quantum coherence, time crystals, psycho-symbolic reasoning). Users can start practical and grow exotic as comfort increases.

Negative

  1. Event type sprawl: 133 event types across 37 modules create a large surface area for the receiving application to handle. Consumers must filter by event type range and can safely ignore unknown types, but documentation and SDK effort scales with the collection size.

  2. Quality assurance burden: Each module needs testing, documentation, and ongoing maintenance. Community-contributed modules may have inconsistent quality. The curated registry model (PR-based submission with review) adds editorial overhead.

  3. Accuracy expectations: Medical and security modules carry liability risk if accuracy claims are overstated. Every medical module must carry a disclaimer that it is not a medical device unless separately cleared. Every security module must state it supplements but does not replace physical security.

  4. Module interaction: Running multiple modules concurrently may produce conflicting events (e.g., intrusion-detect and ghost-hunter both fire on the same CSI anomaly). Consumers must handle event deduplication. The event type ID system makes this tractable but not automatic.

  5. WASM size growth: The exotic and vendor modules (gesture-language at 18 KB, mincut-person-match at 18 KB, quantum-coherence at 16 KB) approach the PSRAM arena limit. Only 2-3 heavy modules can coexist in the 4-slot runtime. Module authors must optimize aggressively for size. Vendor modules average 12 KB vs 6 KB for core modules.

  6. Vendor dependency management: Vendor-integrated modules depend on code in vendor/. Changes to vendor source require rebuilding affected WASM modules. Vendor updates must be manually pulled and tested. The VENDOR_SOURCE.md file in each module directory documents the exact crate, file, and commit used.

  7. Calibration requirements: Many modules (occupancy-zones, perimeter- breach, gait-analysis) require environment-specific calibration. A standardized calibration protocol and tooling are needed but are outside the scope of this ADR.


Implementation Priority

Phase 1 -- Ship First (Q2 2026)

These modules deliver immediate value with low implementation risk. They form the "launch collection" for the WASM module marketplace.

ModuleStatusRationale
wdp-bld-occupancy-zonesImplemented (occupancy.rs)Most requested feature; direct revenue from smart building contracts
wdp-sec-intrusion-detectImplemented (intrusion.rs)Security is the #1 use case after occupancy; differentiator vs PIR
wdp-med-sleep-apneaPlannedHigh-impact medical use case; simple to implement on Tier 2 vitals
wdp-ret-queue-lengthPlannedRetail deployments already in pipeline; queue analytics requested
wdp-med-vital-trendImplemented (vital_trend.rs)Leverages existing vitals data; needed for clinical pilot

Phase 2 -- Community (Q3-Q4 2026)

These modules are medium-difficulty and designed for community contribution. Each has a well-defined scope and clear test criteria.

ModuleRationale
wdp-med-gait-analysisHigh clinical value; active research community
wdp-ret-dwell-heatmapBuilds on occupancy-zones; clear commercial demand
wdp-bld-meeting-roomExtends occupancy for workplace analytics market
wdp-bld-hvac-presenceLow effort (wraps presence with hysteresis); BMS integration
wdp-sec-loiteringSimple state machine; good first contribution
wdp-ind-confined-spaceOSHA compliance driver; clear acceptance criteria
wdp-exo-ghost-hunterCommunity enthusiasm driver; good PR and engagement
wdp-exo-rain-detectSimple and delightful; demonstrates CSI versatility

Phase 3 -- Research Frontier (2027+)

These modules push the boundaries of WiFi CSI sensing and require specialized expertise, larger datasets, and possibly new Host API extensions.

ModuleRationale
wdp-exo-dream-stageHighest novelty; needs sleep lab validation dataset
wdp-exo-emotion-detectRequires controlled study; IRB considerations
wdp-exo-gesture-languageNeeds ASL template library; accessibility impact
wdp-sec-weapon-detectResearch-grade only; security implications require careful positioning
wdp-ind-structural-vibrationNeeds civil engineering domain expertise
wdp-med-cardiac-arrhythmiaNeeds clinical validation; potential regulatory pathway
wdp-med-seizure-detectNeeds neurology collaboration; high clinical impact
wdp-exo-breathing-syncNeeds multi-person datasets; novel social metric

Community Contribution Guide

How to Write a Module

1. Set up the development environment.

bash
# Clone the repo and navigate to the module template
git clone https://github.com/ruvnet/wifi-densepose.git
cd wifi-densepose/modules

# Copy the template
cp -r _template/ exotic/my-module/
cd exotic/my-module/src/

2. Write the module in Rust (no_std).

Every module implements three exported functions:

rust
#![no_std]
#![no_main]

// Host API imports (provided by the WASM3 runtime)
extern "C" {
    fn csi_get_phase(sc: i32) -> f32;
    fn csi_get_amplitude(sc: i32) -> f32;
    fn csi_get_variance(sc: i32) -> f32;
    fn csi_get_bpm_breathing() -> f32;
    fn csi_get_bpm_heartrate() -> f32;
    fn csi_get_presence() -> i32;
    fn csi_get_motion_energy() -> f32;
    fn csi_get_n_persons() -> i32;
    fn csi_get_timestamp() -> i32;
    fn csi_emit_event(event_type: i32, value: f32);
    fn csi_log(ptr: i32, len: i32);
    fn csi_get_phase_history(buf: i32, max: i32) -> i32;
}

// Module state (lives in WASM linear memory)
static mut STATE: ModuleState = ModuleState::new();

struct ModuleState {
    // Your state fields here
    initialized: bool,
}

impl ModuleState {
    const fn new() -> Self {
        Self { initialized: false }
    }
}

#[no_mangle]
pub extern "C" fn on_init() {
    unsafe {
        STATE = ModuleState::new();
        STATE.initialized = true;
    }
}

#[no_mangle]
pub extern "C" fn on_frame(n_subcarriers: i32) {
    unsafe {
        if !STATE.initialized { return; }

        // Your per-frame logic here
        // Call csi_get_* functions to read sensor data
        // Call csi_emit_event(EVENT_TYPE, value) to emit results
    }
}

#[no_mangle]
pub extern "C" fn on_timer() {
    // Periodic tasks (called at configurable interval)
}

// Panic handler required for no_std
#[panic_handler]
fn panic(_info: &core::panic::PanicInfo) -> ! {
    loop {}
}

3. Build to WASM.

bash
# Install the wasm32 target
rustup target add wasm32-unknown-unknown

# Build in release mode (optimized for size)
cargo build --target wasm32-unknown-unknown --release

# Strip debug symbols
wasm-strip target/wasm32-unknown-unknown/release/my_module.wasm

# Verify size (should be < 128 KB, ideally < 20 KB)
ls -la target/wasm32-unknown-unknown/release/my_module.wasm

4. Write the TOML manifest.

toml
[module]
name = "wdp-exo-my-module"
version = "0.1.0"
description = "Brief description of what it detects"
author = "your-handle"
license = "MIT"
category = "exotic"
difficulty = "medium"

[api]
host_api_version = 1
capabilities = ["READ_PHASE", "READ_VARIANCE", "EMIT_EVENTS"]

[budget]
tier = "standard"
max_frame_us = 5000
max_events_per_sec = 10
memory_limit_kb = 32

[events]
900 = { name = "MY_EVENT", unit = "score" }
901 = { name = "MY_OTHER_EVENT", unit = "confidence" }

5. Test locally.

The repository provides a mock Host API for desktop testing:

bash
# Run against the mock host with synthetic CSI data
cargo test --target x86_64-unknown-linux-gnu

# Run against recorded CSI data (if available)
cargo run --example replay -- --input ../../data/recordings/test.csv

6. Package as RVF.

bash
# Build the RVF container (requires the wasm-edge CLI tool)
cargo run -p wifi-densepose-wasm-edge --features std -- \
  rvf pack \
  --wasm target/wasm32-unknown-unknown/release/my_module.wasm \
  --manifest wdp-exo-my-module.toml \
  --output wdp-exo-my-module.rvf

7. Submit a PR.

modules/exotic/my-module/
  wdp-exo-my-module.rvf
  wdp-exo-my-module.toml
  wdp-exo-my-module.wasm
  src/
    lib.rs
    Cargo.toml
  tests/
    integration.rs
  CHANGELOG.md

PR checklist:

  • Module name follows wdp-{category}-{name} convention
  • Event type IDs are within the correct category range
  • TOML manifest is complete and valid
  • WASM binary is < 128 KB (< 20 KB preferred)
  • Budget tier is appropriate (verified by benchmark)
  • Integration tests pass against mock Host API
  • No std dependencies (pure no_std)
  • CHANGELOG.md describes the module
  • Code is formatted with rustfmt
  • No unsafe code beyond the Host API FFI bindings

Signing for Release

Community modules are unsigned during development. For inclusion in the official registry, a project maintainer signs the RVF with the project Ed25519 key:

bash
# Maintainer-only: sign and publish
wifi-densepose-wasm-edge rvf sign \
  --input wdp-exo-my-module.rvf \
  --key keys/signing.ed25519 \
  --output wdp-exo-my-module.signed.rvf

Unsigned modules can still be loaded on nodes with wasm_verify=0 (development mode). Production nodes require signed RVF containers.

Event Type ID Allocation

  • Categories 100--599: Allocated by this ADR. New modules in existing categories use the next available 10-ID block.
  • Category 600--699 (Exotic): Allocated by this ADR. New exotic modules use the next available 10-ID block starting at 680.
  • Range 900--999: Open for community/third-party modules. Claim a 10-ID block by adding an entry to modules/registry.toml in your PR.
  • Conflicts are resolved during PR review on a first-come basis.

References

  • ADR-039: ESP32-S3 Edge Intelligence Pipeline
  • ADR-040: WASM Programmable Sensing (Tier 3)
  • vendor/ruvector/ -- 76 crates: attention, min-cut, solvers, temporal tensor, spiking networks, HNSW, quantum circuits, coherence gating
  • vendor/midstream/ -- 10 crates: AIMDS threat detection, DTW/LCS temporal comparison, attractor dynamics, LTL verification, meta-learning
  • vendor/sublinear-time-solver/ -- 11 crates: O(log n) solvers, PageRank, GOAP planning, psycho-symbolic reasoning, WASM neural inference
  • Liu et al., "Monitoring Vital Signs and Postures During Sleep Using WiFi Signals," MobiCom 2020
  • Niu et al., "WiFi-Based Sleep Stage Monitoring," IEEE TMC 2022
  • Zhao et al., "Emotion Recognition Using Wireless Signals," UbiComp 2018
  • Yang et al., "WiFi-Based Emotion Detection," IEEE TAFFC 2021
  • Li et al., "Sign Language Recognition via WiFi," MobiCom 2019
  • Ma et al., "WiFi Sensing with Channel State Information," NSDI 2019
  • Adib et al., "Smart Homes that Monitor Breathing and Heart Rate," SIGCOMM 2015
  • Wang et al., "Human Respiration Detection with Commodity WiFi Devices," MobiSys 2017
  • Halperin et al., "Tool Release: Gathering 802.11n Traces with Channel State Information," ACM CCR 2011