Add survivor tracking and RuVector integration (ADR-026, ADR-017) #66

Merged
ruvnet merged 5 commits from claude/analyze-repo-structure-aOtgs into main 2026-03-02 00:02:53 +08:00
ruvnet commented 2026-03-02 00:00:16 +08:00 (Migrated from github.com)

Summary

This PR implements two major architectural decisions:

  1. ADR-026: Survivor Track Lifecycle Management — A new tracking bounded context within the MAT crate that orchestrates Kalman filtering, data association, CSI fingerprint re-identification, and track lifecycle state management for disaster survivors.

  2. ADR-017: RuVector v2.0.4 Integration — A new wifi-densepose-ruvector crate that wraps seven RuVector integration points for signal processing and multi-AP triage.

Key Changes

Tracking Module (wifi-densepose-mat/src/tracking/)

  • tracker.rs (815 lines): SurvivorTracker aggregate root implementing the main per-tick update algorithm:

    • Kalman prediction for all non-terminal tracks
    • Mahalanobis-gated data association (Hungarian or greedy assignment)
    • Vital-sign-only matching for observations without position
    • CSI fingerprint-based re-identification of Lost tracks
    • Birth of new Tentative tracks from unmatched observations
    • Lifecycle transitions and terminal track cleanup
  • kalman.rs (487 lines): Constant-velocity 3-D Kalman filter with:

    • State vector [px, py, pz, vx, vy, vz] (position + velocity)
    • Mahalanobis distance gating for data association
    • Process noise σ_a = 0.1 m/s², measurement noise σ_obs = 1.5 m
  • fingerprint.rs (329 lines): CSI-based biometric fingerprint for re-ID:

    • Features: breathing rate (40%), breathing amplitude (25%), heartbeat (20%), location (15%)
    • Exponential moving-average updates
    • Weighted Euclidean distance matching
  • lifecycle.rs (297 lines): Track state machine:

    • States: Tentative → Active → Lost → Terminated/Rescued
    • Configurable birth hits, miss thresholds, re-ID window
    • Automatic transitions based on observation hits/misses
  • mod.rs: Module exports and documentation

RuVector Integration (wifi-densepose-ruvector/)

New crate with seven integration points:

Signal Processing (signal/):

  • subcarrier.rs: Graph min-cut partitioning of subcarriers into sensitive/insensitive groups
  • spectrogram.rs: Attention-mincut gating to suppress noise frames
  • bvp.rs: Scaled dot-product attention aggregation of per-subcarrier STFT rows
  • fresnel.rs: Sparse regularized solver for TX-body and body-RX distance estimation

Multi-AP Triage (mat/):

  • triangulation.rs: TDoA-based survivor localization via Neumann series solver
  • breathing.rs: Tiered compressed breathing buffer (hot/warm/cold tiers)
  • heartbeat.rs: Tiered compressed heartbeat spectrogram

Domain Events

Extended domain/events.rs with TrackingEvent enum to emit events for:

  • Track birth, confirmation, loss, re-identification, rescue, termination
  • Lifecycle state transitions

Configuration & Cleanup

  • Added #![allow(unexpected_cfgs)] to ML modules for conditional compilation
  • Removed unused imports from csi_receiver.rs
  • Updated workspace Cargo.toml to include new wifi-densepose-ruvector crate
  • Updated main README.md with links to ADR-026 and ADR-017

Implementation Highlights

  • Mahalanobis gating prevents physically impossible track-observation associations
  • Fingerprint re-ID recovers survivor identity across signal dropouts, reducing duplicate entries
  • Lifecycle state machine automatically manages track confirmation, loss, and cleanup
  • Tiered compression reduces breathing/heartbeat storage from 13.4 MB

https://claude.ai/code/session_0164UZu6rG6gA15HmVyLZAmU

## Summary This PR implements two major architectural decisions: 1. **ADR-026: Survivor Track Lifecycle Management** — A new `tracking` bounded context within the MAT crate that orchestrates Kalman filtering, data association, CSI fingerprint re-identification, and track lifecycle state management for disaster survivors. 2. **ADR-017: RuVector v2.0.4 Integration** — A new `wifi-densepose-ruvector` crate that wraps seven RuVector integration points for signal processing and multi-AP triage. ## Key Changes ### Tracking Module (`wifi-densepose-mat/src/tracking/`) - **`tracker.rs`** (815 lines): `SurvivorTracker` aggregate root implementing the main per-tick update algorithm: - Kalman prediction for all non-terminal tracks - Mahalanobis-gated data association (Hungarian or greedy assignment) - Vital-sign-only matching for observations without position - CSI fingerprint-based re-identification of Lost tracks - Birth of new Tentative tracks from unmatched observations - Lifecycle transitions and terminal track cleanup - **`kalman.rs`** (487 lines): Constant-velocity 3-D Kalman filter with: - State vector `[px, py, pz, vx, vy, vz]` (position + velocity) - Mahalanobis distance gating for data association - Process noise σ_a = 0.1 m/s², measurement noise σ_obs = 1.5 m - **`fingerprint.rs`** (329 lines): CSI-based biometric fingerprint for re-ID: - Features: breathing rate (40%), breathing amplitude (25%), heartbeat (20%), location (15%) - Exponential moving-average updates - Weighted Euclidean distance matching - **`lifecycle.rs`** (297 lines): Track state machine: - States: Tentative → Active → Lost → Terminated/Rescued - Configurable birth hits, miss thresholds, re-ID window - Automatic transitions based on observation hits/misses - **`mod.rs`**: Module exports and documentation ### RuVector Integration (`wifi-densepose-ruvector/`) New crate with seven integration points: **Signal Processing (`signal/`)**: - **`subcarrier.rs`**: Graph min-cut partitioning of subcarriers into sensitive/insensitive groups - **`spectrogram.rs`**: Attention-mincut gating to suppress noise frames - **`bvp.rs`**: Scaled dot-product attention aggregation of per-subcarrier STFT rows - **`fresnel.rs`**: Sparse regularized solver for TX-body and body-RX distance estimation **Multi-AP Triage (`mat/`)**: - **`triangulation.rs`**: TDoA-based survivor localization via Neumann series solver - **`breathing.rs`**: Tiered compressed breathing buffer (hot/warm/cold tiers) - **`heartbeat.rs`**: Tiered compressed heartbeat spectrogram ### Domain Events Extended `domain/events.rs` with `TrackingEvent` enum to emit events for: - Track birth, confirmation, loss, re-identification, rescue, termination - Lifecycle state transitions ### Configuration & Cleanup - Added `#![allow(unexpected_cfgs)]` to ML modules for conditional compilation - Removed unused imports from `csi_receiver.rs` - Updated workspace `Cargo.toml` to include new `wifi-densepose-ruvector` crate - Updated main `README.md` with links to ADR-026 and ADR-017 ## Implementation Highlights - **Mahalanobis gating** prevents physically impossible track-observation associations - **Fingerprint re-ID** recovers survivor identity across signal dropouts, reducing duplicate entries - **Lifecycle state machine** automatically manages track confirmation, loss, and cleanup - **Tiered compression** reduces breathing/heartbeat storage from 13.4 MB https://claude.ai/code/session_0164UZu6rG6gA15HmVyLZAmU
Sign in to join this conversation.