diff --git a/CHANGELOG.md b/CHANGELOG.md index 68303a59..a66d9a39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Removed +- **Stub crates `wifi-densepose-api`, `wifi-densepose-db`, `wifi-densepose-config`** (closes #578). + Each was a single-line doc-comment placeholder with an empty `[dependencies]` + section and zero references from any source file or `Cargo.toml`. The names + were reserved early for an envisioned REST/database/config split that never + materialised; the functionality they would provide is covered today by + `wifi-densepose-sensing-server` (Axum REST/WS), per-crate config + CLI args, + and the project's real-time-only (no-persistent-state) posture. Removing them + from the workspace prevents `cargo` from listing dead crates and shipping + empty published artifacts. If any of these names is needed in the future, + they can be reintroduced with a real implementation. + ### Added - **Real-time CSI introspection / low-latency tap on `wifi-densepose-sensing-server` (ADR-099).** New `wifi_densepose_sensing_server::introspection` module wires diff --git a/CLAUDE.md b/CLAUDE.md index 2fb50430..05f3bf63 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -14,9 +14,6 @@ Dual codebase: Python v1 (`v1/`) and Rust port (`v2/`). | `wifi-densepose-mat` | Mass Casualty Assessment Tool — disaster survivor detection | | `wifi-densepose-hardware` | ESP32 aggregator, TDM protocol, channel hopping firmware | | `wifi-densepose-ruvector` | RuVector v2.0.4 integration + cross-viewpoint fusion (5 modules) | -| `wifi-densepose-api` | REST API (Axum) | -| `wifi-densepose-db` | Database layer (Postgres, SQLite, Redis) | -| `wifi-densepose-config` | Configuration management | | `wifi-densepose-wasm` | WebAssembly bindings for browser deployment | | `wifi-densepose-cli` | CLI tool (`wifi-densepose` binary) | | `wifi-densepose-sensing-server` | Lightweight Axum server for WiFi sensing UI | @@ -135,17 +132,14 @@ Crates must be published in dependency order: 2. `wifi-densepose-vitals` (no internal deps) 3. `wifi-densepose-wifiscan` (no internal deps) 4. `wifi-densepose-hardware` (no internal deps) -5. `wifi-densepose-config` (no internal deps) -6. `wifi-densepose-db` (no internal deps) -7. `wifi-densepose-signal` (depends on core) -8. `wifi-densepose-nn` (no internal deps, workspace only) -9. `wifi-densepose-ruvector` (no internal deps, workspace only) -10. `wifi-densepose-train` (depends on signal, nn) -11. `wifi-densepose-mat` (depends on core, signal, nn) -12. `wifi-densepose-api` (no internal deps) -13. `wifi-densepose-wasm` (depends on mat) -14. `wifi-densepose-sensing-server` (depends on wifiscan) -15. `wifi-densepose-cli` (depends on mat) +5. `wifi-densepose-signal` (depends on core) +6. `wifi-densepose-nn` (no internal deps, workspace only) +7. `wifi-densepose-ruvector` (no internal deps, workspace only) +8. `wifi-densepose-train` (depends on signal, nn) +9. `wifi-densepose-mat` (depends on core, signal, nn) +10. `wifi-densepose-wasm` (depends on mat) +11. `wifi-densepose-sensing-server` (depends on wifiscan) +12. `wifi-densepose-cli` (depends on mat) ### Validation & Witness Verification (ADR-028) diff --git a/v2/Cargo.lock b/v2/Cargo.lock index 2d537e71..0d2466b8 100644 --- a/v2/Cargo.lock +++ b/v2/Cargo.lock @@ -921,7 +921,7 @@ checksum = "d64e8af5551369d19cf50138de61f1c42074ab970f74e99be916646777f8fc87" dependencies = [ "encode_unicode", "libc", - "unicode-width 0.2.2", + "unicode-width", "windows-sys 0.61.2", ] @@ -8353,10 +8353,6 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72069c3113ab32ab29e5584db3c6ec55d416895e60715417b5b883a357c3e471" -[[package]] -name = "wifi-densepose-api" -version = "0.3.0" - [[package]] name = "wifi-densepose-cli" version = "0.3.0" @@ -8382,10 +8378,6 @@ dependencies = [ "wifi-densepose-mat", ] -[[package]] -name = "wifi-densepose-config" -version = "0.3.0" - [[package]] name = "wifi-densepose-core" version = "0.3.0" @@ -8402,10 +8394,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "wifi-densepose-db" -version = "0.3.0" - [[package]] name = "wifi-densepose-desktop" version = "0.3.0" diff --git a/v2/Cargo.toml b/v2/Cargo.toml index db94c11c..b5174269 100644 --- a/v2/Cargo.toml +++ b/v2/Cargo.toml @@ -4,9 +4,16 @@ members = [ "crates/wifi-densepose-core", "crates/wifi-densepose-signal", "crates/wifi-densepose-nn", - "crates/wifi-densepose-api", - "crates/wifi-densepose-db", - "crates/wifi-densepose-config", + # wifi-densepose-api / -db / -config: removed in #578. + # The crate names were reserved early for an envisioned REST/database/config + # split, but no implementation followed and no code referenced them. The + # functionality they would provide is covered today by: + # - REST/WS: `wifi-densepose-sensing-server` (Axum) + # - Config: per-crate config + CLI args in `wifi-densepose-sensing-server` + # and `wifi-densepose-desktop` + # - DB: no persistent state; system is real-time + # If we ever need any of these as a published surface, they can be + # reintroduced with a real implementation. "crates/wifi-densepose-hardware", "crates/wifi-densepose-wasm", "crates/wifi-densepose-cli", diff --git a/v2/crates/wifi-densepose-api/Cargo.toml b/v2/crates/wifi-densepose-api/Cargo.toml deleted file mode 100644 index 5010b1e5..00000000 --- a/v2/crates/wifi-densepose-api/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "wifi-densepose-api" -version.workspace = true -edition.workspace = true -description = "REST API for WiFi-DensePose" -license.workspace = true -authors = ["rUv ", "WiFi-DensePose Contributors"] -repository.workspace = true -documentation.workspace = true -keywords = ["wifi", "api", "rest", "densepose", "websocket"] -categories = ["web-programming::http-server", "science"] -readme = "README.md" - -[dependencies] diff --git a/v2/crates/wifi-densepose-api/README.md b/v2/crates/wifi-densepose-api/README.md deleted file mode 100644 index b1837c24..00000000 --- a/v2/crates/wifi-densepose-api/README.md +++ /dev/null @@ -1,71 +0,0 @@ -# wifi-densepose-api - -[![Crates.io](https://img.shields.io/crates/v/wifi-densepose-api.svg)](https://crates.io/crates/wifi-densepose-api) -[![Documentation](https://docs.rs/wifi-densepose-api/badge.svg)](https://docs.rs/wifi-densepose-api) -[![License](https://img.shields.io/crates/l/wifi-densepose-api.svg)](LICENSE) - -REST and WebSocket API layer for the WiFi-DensePose pose estimation system. - -## Overview - -`wifi-densepose-api` provides the HTTP service boundary for WiFi-DensePose. Built on -[axum](https://github.com/tokio-rs/axum), it exposes REST endpoints for pose queries, CSI frame -ingestion, and model management, plus a WebSocket feed for real-time pose streaming to frontend -clients. - -> **Status:** This crate is currently a stub. The intended API surface is documented below. - -## Planned Features - -- **REST endpoints** -- CRUD for scan zones, pose queries, model configuration, and health checks. -- **WebSocket streaming** -- Real-time pose estimate broadcasts with per-client subscription filters. -- **Authentication** -- Token-based auth middleware via `tower` layers. -- **Rate limiting** -- Configurable per-route limits to protect hardware-constrained deployments. -- **OpenAPI spec** -- Auto-generated documentation via `utoipa`. -- **CORS** -- Configurable cross-origin support for browser-based dashboards. -- **Graceful shutdown** -- Clean connection draining on SIGTERM. - -## Quick Start - -```rust -// Intended usage (not yet implemented) -use wifi_densepose_api::Server; - -#[tokio::main] -async fn main() -> anyhow::Result<()> { - let server = Server::builder() - .bind("0.0.0.0:3000") - .with_websocket("/ws/poses") - .build() - .await?; - - server.run().await -} -``` - -## Planned Endpoints - -| Method | Path | Description | -|--------|------|-------------| -| `GET` | `/api/v1/health` | Liveness and readiness probes | -| `GET` | `/api/v1/poses` | Latest pose estimates | -| `POST` | `/api/v1/csi` | Ingest raw CSI frames | -| `GET` | `/api/v1/zones` | List scan zones | -| `POST` | `/api/v1/zones` | Create a scan zone | -| `WS` | `/ws/poses` | Real-time pose stream | -| `WS` | `/ws/vitals` | Real-time vital sign stream | - -## Related Crates - -| Crate | Role | -|-------|------| -| [`wifi-densepose-core`](../wifi-densepose-core) | Shared types and traits | -| [`wifi-densepose-config`](../wifi-densepose-config) | Configuration loading | -| [`wifi-densepose-db`](../wifi-densepose-db) | Database persistence | -| [`wifi-densepose-nn`](../wifi-densepose-nn) | Neural network inference | -| [`wifi-densepose-signal`](../wifi-densepose-signal) | CSI signal processing | -| [`wifi-densepose-sensing-server`](../wifi-densepose-sensing-server) | Lightweight sensing UI server | - -## License - -MIT OR Apache-2.0 diff --git a/v2/crates/wifi-densepose-api/src/lib.rs b/v2/crates/wifi-densepose-api/src/lib.rs deleted file mode 100644 index 5feeeae8..00000000 --- a/v2/crates/wifi-densepose-api/src/lib.rs +++ /dev/null @@ -1 +0,0 @@ -//! WiFi-DensePose REST API (stub) diff --git a/v2/crates/wifi-densepose-config/Cargo.toml b/v2/crates/wifi-densepose-config/Cargo.toml deleted file mode 100644 index 75da7e17..00000000 --- a/v2/crates/wifi-densepose-config/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "wifi-densepose-config" -version.workspace = true -edition.workspace = true -description = "Configuration management for WiFi-DensePose" -license.workspace = true -authors = ["rUv ", "WiFi-DensePose Contributors"] -repository.workspace = true -documentation.workspace = true -keywords = ["wifi", "configuration", "densepose", "settings", "toml"] -categories = ["config", "science"] -readme = "README.md" - -[dependencies] diff --git a/v2/crates/wifi-densepose-config/README.md b/v2/crates/wifi-densepose-config/README.md deleted file mode 100644 index ffcfd5c7..00000000 --- a/v2/crates/wifi-densepose-config/README.md +++ /dev/null @@ -1,89 +0,0 @@ -# wifi-densepose-config - -[![Crates.io](https://img.shields.io/crates/v/wifi-densepose-config.svg)](https://crates.io/crates/wifi-densepose-config) -[![Documentation](https://docs.rs/wifi-densepose-config/badge.svg)](https://docs.rs/wifi-densepose-config) -[![License](https://img.shields.io/crates/l/wifi-densepose-config.svg)](LICENSE) - -Configuration management for the WiFi-DensePose pose estimation system. - -## Overview - -`wifi-densepose-config` provides a unified configuration layer that merges values from environment -variables, TOML/YAML files, and CLI overrides into strongly-typed Rust structs. Built on the -[config](https://docs.rs/config), [dotenvy](https://docs.rs/dotenvy), and -[envy](https://docs.rs/envy) ecosystem from the workspace. - -> **Status:** This crate is currently a stub. The intended API surface is documented below. - -## Planned Features - -- **Multi-source loading** -- Merge configuration from `.env`, TOML files, YAML files, and - environment variables with well-defined precedence. -- **Typed configuration** -- Strongly-typed structs for server, signal processing, neural network, - hardware, and database settings. -- **Validation** -- Schema validation with human-readable error messages on startup. -- **Hot reload** -- Watch configuration files for changes and notify dependent services. -- **Profile support** -- Named profiles (`development`, `production`, `testing`) with per-profile - overrides. -- **Secret filtering** -- Redact sensitive values (API keys, database passwords) in logs and debug - output. - -## Quick Start - -```rust -// Intended usage (not yet implemented) -use wifi_densepose_config::AppConfig; - -fn main() -> anyhow::Result<()> { - // Loads from env, config.toml, and CLI overrides - let config = AppConfig::load()?; - - println!("Server bind: {}", config.server.bind_address); - println!("CSI sample rate: {} Hz", config.signal.sample_rate); - println!("Model path: {}", config.nn.model_path.display()); - - Ok(()) -} -``` - -## Planned Configuration Structure - -```toml -# config.toml - -[server] -bind_address = "0.0.0.0:3000" -websocket_path = "/ws/poses" - -[signal] -sample_rate = 100 -subcarrier_count = 56 -hampel_window = 5 - -[nn] -model_path = "./models/densepose.rvf" -backend = "ort" # ort | candle | tch -batch_size = 8 - -[hardware] -esp32_udp_port = 5005 -serial_baud = 921600 - -[database] -url = "sqlite://data/wifi-densepose.db" -max_connections = 5 -``` - -## Related Crates - -| Crate | Role | -|-------|------| -| [`wifi-densepose-core`](../wifi-densepose-core) | Shared types and traits | -| [`wifi-densepose-api`](../wifi-densepose-api) | REST API (consumer) | -| [`wifi-densepose-db`](../wifi-densepose-db) | Database layer (consumer) | -| [`wifi-densepose-cli`](../wifi-densepose-cli) | CLI (consumer) | -| [`wifi-densepose-sensing-server`](../wifi-densepose-sensing-server) | Sensing server (consumer) | - -## License - -MIT OR Apache-2.0 diff --git a/v2/crates/wifi-densepose-config/src/lib.rs b/v2/crates/wifi-densepose-config/src/lib.rs deleted file mode 100644 index 6040ea45..00000000 --- a/v2/crates/wifi-densepose-config/src/lib.rs +++ /dev/null @@ -1 +0,0 @@ -//! WiFi-DensePose configuration (stub) diff --git a/v2/crates/wifi-densepose-db/Cargo.toml b/v2/crates/wifi-densepose-db/Cargo.toml deleted file mode 100644 index 5edb52d7..00000000 --- a/v2/crates/wifi-densepose-db/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "wifi-densepose-db" -version.workspace = true -edition.workspace = true -description = "Database layer for WiFi-DensePose" -license.workspace = true -authors = ["rUv ", "WiFi-DensePose Contributors"] -repository.workspace = true -documentation.workspace = true -keywords = ["wifi", "database", "storage", "densepose", "persistence"] -categories = ["database", "science"] -readme = "README.md" - -[dependencies] diff --git a/v2/crates/wifi-densepose-db/README.md b/v2/crates/wifi-densepose-db/README.md deleted file mode 100644 index 0fc8b66a..00000000 --- a/v2/crates/wifi-densepose-db/README.md +++ /dev/null @@ -1,106 +0,0 @@ -# wifi-densepose-db - -[![Crates.io](https://img.shields.io/crates/v/wifi-densepose-db.svg)](https://crates.io/crates/wifi-densepose-db) -[![Documentation](https://docs.rs/wifi-densepose-db/badge.svg)](https://docs.rs/wifi-densepose-db) -[![License](https://img.shields.io/crates/l/wifi-densepose-db.svg)](LICENSE) - -Database persistence layer for the WiFi-DensePose pose estimation system. - -## Overview - -`wifi-densepose-db` implements the `DataStore` trait defined in `wifi-densepose-core`, providing -persistent storage for CSI frames, pose estimates, scan sessions, and alert history. The intended -backends are [SQLx](https://docs.rs/sqlx) for relational storage (PostgreSQL and SQLite) and -[Redis](https://docs.rs/redis) for real-time caching and pub/sub. - -> **Status:** This crate is currently a stub. The intended API surface is documented below. - -## Planned Features - -- **Dual backend** -- PostgreSQL for production deployments, SQLite for single-node and embedded - use. Selectable at compile time via feature flags. -- **Redis caching** -- Connection-pooled Redis for low-latency pose estimate lookups, session - state, and pub/sub event distribution. -- **Migrations** -- Embedded SQL migrations managed by SQLx, applied automatically on startup. -- **Repository pattern** -- Typed repository structs (`PoseRepository`, `SessionRepository`, - `AlertRepository`) implementing the core `DataStore` trait. -- **Connection pooling** -- Configurable pool sizes via `sqlx::PgPool` / `sqlx::SqlitePool`. -- **Transaction support** -- Scoped transactions for multi-table writes (e.g., survivor detection - plus alert creation). -- **Time-series optimisation** -- Partitioned tables and retention policies for high-frequency CSI - frame storage. - -### Planned feature flags - -| Flag | Default | Description | -|------------|---------|-------------| -| `postgres` | no | Enable PostgreSQL backend | -| `sqlite` | yes | Enable SQLite backend | -| `redis` | no | Enable Redis caching layer | - -## Quick Start - -```rust -// Intended usage (not yet implemented) -use wifi_densepose_db::{Database, PoseRepository}; -use wifi_densepose_core::PoseEstimate; - -#[tokio::main] -async fn main() -> anyhow::Result<()> { - let db = Database::connect("sqlite://data/wifi-densepose.db").await?; - db.run_migrations().await?; - - let repo = PoseRepository::new(db.pool()); - - // Store a pose estimate - repo.insert(&pose_estimate).await?; - - // Query recent poses - let recent = repo.find_recent(10).await?; - println!("Last 10 poses: {:?}", recent); - - Ok(()) -} -``` - -## Planned Schema - -```sql --- Core tables -CREATE TABLE csi_frames ( - id UUID PRIMARY KEY, - session_id UUID NOT NULL, - timestamp TIMESTAMPTZ NOT NULL, - subcarriers BYTEA NOT NULL, - antenna_id INTEGER NOT NULL -); - -CREATE TABLE pose_estimates ( - id UUID PRIMARY KEY, - frame_id UUID REFERENCES csi_frames(id), - timestamp TIMESTAMPTZ NOT NULL, - keypoints JSONB NOT NULL, - confidence REAL NOT NULL -); - -CREATE TABLE scan_sessions ( - id UUID PRIMARY KEY, - started_at TIMESTAMPTZ NOT NULL, - ended_at TIMESTAMPTZ, - config JSONB NOT NULL -); -``` - -## Related Crates - -| Crate | Role | -|-------|------| -| [`wifi-densepose-core`](../wifi-densepose-core) | `DataStore` trait definition | -| [`wifi-densepose-config`](../wifi-densepose-config) | Database connection configuration | -| [`wifi-densepose-api`](../wifi-densepose-api) | REST API (consumer) | -| [`wifi-densepose-mat`](../wifi-densepose-mat) | Disaster detection (consumer) | -| [`wifi-densepose-signal`](../wifi-densepose-signal) | CSI signal processing | - -## License - -MIT OR Apache-2.0 diff --git a/v2/crates/wifi-densepose-db/src/lib.rs b/v2/crates/wifi-densepose-db/src/lib.rs deleted file mode 100644 index eaa4c7c9..00000000 --- a/v2/crates/wifi-densepose-db/src/lib.rs +++ /dev/null @@ -1 +0,0 @@ -//! WiFi-DensePose database layer (stub)