wifi-densepose/rust-port/wifi-densepose-rs/crates/wifi-densepose-core
eriirfos-eng ec37ab1674 feat(types): add optional trit_signal() on Confidence via ternlang feature
Adds a `trit_signal()` method to `Confidence` that maps a scalar
confidence score to a ternary trit value:
  - >= 0.65 → Affirm  (high confidence — act)
  - 0.35..0.65 → Tend (uncertain — defer to human review)
  - < 0.35  → Reject  (low confidence — discard / retry)

The Tend state is the key addition: it provides an explicit
"I need more data" signal rather than forcing a binary yes/no
when confidence is genuinely ambiguous. This maps naturally to
EU AI Act Article 14 human oversight requirements.

This is a purely additive change:
- `Confidence(f32)` and all existing API surface are unchanged
- `trit_signal()` is gated behind `features = ["ternlang"]`
- Dependency: `ternlang-core = "0.3"` (crates.io), optional
- No breaking changes, no existing tests affected
2026-04-11 05:25:45 +00:00
..
src feat(types): add optional trit_signal() on Confidence via ternlang feature 2026-04-11 05:25:45 +00:00
Cargo.toml feat(types): add optional trit_signal() on Confidence via ternlang feature 2026-04-11 05:25:45 +00:00
README.md feat: ADR-024 Contrastive CSI Embedding Model — all 7 phases (#52) 2026-03-01 01:44:38 -05:00

README.md

wifi-densepose-core

Crates.io Documentation License

Core types, traits, and utilities for the WiFi-DensePose pose estimation system.

Overview

wifi-densepose-core is the foundation crate for the WiFi-DensePose workspace. It defines the shared data structures, error types, and trait contracts used by every other crate in the ecosystem. The crate is no_std-compatible (with the std feature disabled) and forbids all unsafe code.

Features

  • Core data types -- CsiFrame, ProcessedSignal, PoseEstimate, PersonPose, Keypoint, KeypointType, BoundingBox, Confidence, Timestamp, and more.
  • Trait abstractions -- SignalProcessor, NeuralInference, and DataStore define the contracts for signal processing, neural network inference, and data persistence respectively.
  • Error hierarchy -- CoreError, SignalError, InferenceError, and StorageError provide typed error handling across subsystem boundaries.
  • no_std support -- Disable the default std feature for embedded or WASM targets.
  • Constants -- MAX_KEYPOINTS (17, COCO format), MAX_SUBCARRIERS (256), DEFAULT_CONFIDENCE_THRESHOLD (0.5).

Feature flags

Flag Default Description
std yes Enable standard library support
serde no Serialization via serde (+ ndarray serde)
async no Async trait definitions via async-trait

Quick Start

use wifi_densepose_core::{CsiFrame, Keypoint, KeypointType, Confidence};

// Create a keypoint with high confidence
let keypoint = Keypoint::new(
    KeypointType::Nose,
    0.5,
    0.3,
    Confidence::new(0.95).unwrap(),
);

assert!(keypoint.is_visible());

Or use the prelude for convenient bulk imports:

use wifi_densepose_core::prelude::*;

Architecture

wifi-densepose-core/src/
  lib.rs          -- Re-exports, constants, prelude
  types.rs        -- CsiFrame, PoseEstimate, Keypoint, etc.
  traits.rs       -- SignalProcessor, NeuralInference, DataStore
  error.rs        -- CoreError, SignalError, InferenceError, StorageError
  utils.rs        -- Shared helper functions
Crate Role
wifi-densepose-signal CSI signal processing algorithms
wifi-densepose-nn Neural network inference backends
wifi-densepose-train Training pipeline with ruvector
wifi-densepose-mat Disaster detection (MAT)
wifi-densepose-hardware Hardware sensor interfaces
wifi-densepose-vitals Vital sign extraction
wifi-densepose-wifiscan Multi-BSSID WiFi scanning

License

MIT OR Apache-2.0