Skip to content

Commit 8b050e8

Browse files
committed
feat(sensing-server): ADR-084 Pass 3.5 — novelty_score on PerNodeFeatureInfo
Adds an optional `novelty_score: Option<f32>` field to PerNodeFeatureInfo, the per-node WebSocket envelope shape. Mirrored on both struct definitions (types.rs canonical + main.rs's refactoring-leftover duplicate) so the schema is consistent. `#[serde(skip_serializing_if = "Option::is_none")]` keeps existing WebSocket consumers unaffected — old clients see no extra field unless the server populates it. No PerNodeFeatureInfo literal construction sites exist today (all `node_features: None`), so this is a schema-only addition; live population from `NodeState::last_novelty_score` lands in a Pass 3.6 follow-up that also wires `node_features: Some(...)` at the per-node ESP32 frame emit path. Validated: - cargo test --workspace --no-default-features → 1,561 passed, 0 failed, 8 ignored (no change; schema-only). - ESP32-S3 on COM7 streaming live CSI (cb #2100, fresh boot). Co-Authored-By: claude-flow <ruv@ruv.net>
1 parent 5152bff commit 8b050e8

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

v2/crates/wifi-densepose-sensing-server/src/main.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,13 @@ struct PerNodeFeatureInfo {
476476
last_seen_ms: u64,
477477
frame_rate_hz: f64,
478478
stale: bool,
479+
/// ADR-084 Pass 3 cluster-Pi novelty score in `[0.0, 1.0]`.
480+
/// `0.0` = exact-match-in-bank, `1.0` = no overlap with recent
481+
/// per-node frame history. `None` until the first
482+
/// `update_novelty()` call. Consumers (model-wake gate, anomaly
483+
/// emit, UI heatmap) read this to decide whether to escalate.
484+
#[serde(skip_serializing_if = "Option::is_none")]
485+
novelty_score: Option<f32>,
479486
}
480487

481488
/// Shared application state

v2/crates/wifi-densepose-sensing-server/src/types.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,11 @@ pub struct PerNodeFeatureInfo {
203203
pub rssi_dbm: f64,
204204
pub last_seen_ms: u64,
205205
pub frame_rate_hz: f64,
206+
/// ADR-084 Pass 3 cluster-Pi novelty score in `[0.0, 1.0]`.
207+
/// `0.0` = exact-match-in-bank, `1.0` = no overlap with recent
208+
/// per-node frame history. `None` until first `update_novelty()`.
209+
#[serde(skip_serializing_if = "Option::is_none")]
210+
pub novelty_score: Option<f32>,
206211
pub stale: bool,
207212
}
208213

0 commit comments

Comments
 (0)