Files
ruvnet--RuView/v2/docs/ddd/domain-model.md
T
rUv f49c722764 chore(repo): rename rust-port/wifi-densepose-rs → v2/ (flatten to one level) (#427)
The Rust port lived two directories deep (rust-port/wifi-densepose-rs/)
without any sibling under rust-port/ that warranted the extra level.
Move the whole workspace up to v2/ to match v1/ (Python) at the same
depth and shorten every cd / build command across the repo.

git mv preserves history for all tracked files. 60 files updated for
path references (CI workflows, ADRs, docs, scripts, READMEs, internal
.claude-flow state). Two manual fixes for relative-cd paths in
CLAUDE.md and ADR-043 that became wrong after the depth change
(cd ../.. → cd ..).

Validated:
- cargo check --workspace --no-default-features → clean (after target/
  nuke; the gitignored target/ was carried by the OS rename and had
  hard-coded old paths in build scripts)
- cargo test --workspace --no-default-features → 1,539 passed, 0 failed,
  8 ignored (same totals as pre-rename)
- ESP32-S3 on COM7 → still streaming live CSI (cb #40300, RSSI -64 dBm)

After-merge follow-up: contributors should `rm -rf v2/target` once and
let cargo regenerate from the new path.
2026-04-25 21:28:13 -04:00

5.0 KiB

Domain-Driven Design: WiFi-DensePose Domain Model

Bounded Contexts

1. Signal Domain

Purpose: Raw CSI data acquisition and preprocessing

Aggregates:

  • CsiFrame: Raw CSI measurement from WiFi hardware
  • ProcessedSignal: Cleaned and feature-extracted signal

Value Objects:

  • Amplitude: Signal strength measurements
  • Phase: Phase angle measurements
  • SubcarrierData: Per-subcarrier information
  • Timestamp: Measurement timing

Domain Services:

  • CsiProcessor: Preprocesses raw CSI data
  • PhaseSanitizer: Unwraps and cleans phase data
  • FeatureExtractor: Extracts signal features

2. Pose Domain

Purpose: Human pose estimation from processed signals

Aggregates:

  • PoseEstimate: Complete DensePose output
  • InferenceSession: Neural network session state

Value Objects:

  • BodyPart: Labeled body segment (torso, arms, legs, etc.)
  • UVCoordinate: Surface mapping coordinate
  • Keypoint: Body joint position
  • Confidence: Prediction confidence score

Domain Services:

  • ModalityTranslator: CSI → visual feature translation
  • DensePoseHead: Body part segmentation and UV regression

3. Streaming Domain

Purpose: Real-time data delivery to clients

Aggregates:

  • Session: Client connection with history
  • StreamConfig: Client streaming preferences

Value Objects:

  • WebSocketMessage: Typed message payload
  • ConnectionState: Active/idle/disconnected

Domain Services:

  • StreamManager: Manages client connections
  • BroadcastService: Pushes updates to subscribers

4. Storage Domain

Purpose: Persistence and retrieval

Aggregates:

  • Recording: Captured CSI session
  • ModelArtifact: Neural network weights

Repositories:

  • SessionRepository: Session CRUD operations
  • RecordingRepository: Recording storage
  • ModelRepository: Model management

5. Hardware Domain

Purpose: Physical device management

Aggregates:

  • Device: WiFi router/receiver
  • Antenna: Individual antenna configuration

Domain Services:

  • DeviceManager: Device discovery and control
  • CsiExtractor: Raw CSI extraction

Context Map

┌─────────────────────────────────────────────────────────────┐
│                      WiFi-DensePose                         │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│  ┌──────────────┐     ┌──────────────┐     ┌─────────────┐ │
│  │   Hardware   │────▶│    Signal    │────▶│    Pose     │ │
│  │   Domain     │     │    Domain    │     │   Domain    │ │
│  └──────────────┘     └──────────────┘     └─────────────┘ │
│         │                    │                    │        │
│         │                    │                    │        │
│         ▼                    ▼                    ▼        │
│  ┌──────────────────────────────────────────────────────┐  │
│  │                   Storage Domain                      │  │
│  └──────────────────────────────────────────────────────┘  │
│         │                    │                    │        │
│         ▼                    ▼                    ▼        │
│  ┌──────────────────────────────────────────────────────┐  │
│  │                  Streaming Domain                     │  │
│  └──────────────────────────────────────────────────────┘  │
│                                                             │
└─────────────────────────────────────────────────────────────┘

Ubiquitous Language

Term Definition
CSI Channel State Information - WiFi signal properties
Subcarrier Individual frequency component in OFDM
Phase Unwrapping Correcting 2π phase discontinuities
DensePose Dense human pose estimation with UV mapping
Modality Translation Converting CSI features to visual features
Body Part One of 15 labeled human body segments
UV Mapping 2D surface parameterization of 3D body