Files
ruvnet--RuView/v2/crates/wifi-densepose-sensing-server/src
ruv c54753f293 fix(sensing-server): classification.presence contradicting motion_level (#1442)
The multi-node vitals path derived `presence` directly from `vitals.presence`
independently of the `motion_level` label it computed in the same block, so
a frame with motion=true, presence=false produced
`{"motion_level": "present_moving", "presence": false}` — internally
contradictory, and since every UI gates rendering on `classification.presence`,
a moving person could render as an empty room at confidence 1.0 (the
multi-node confidence boost applies regardless of the presence flag).

Every other classification site in this codebase already derives `presence`
from the label instead (main.rs's per-node path: `!matches!(label, "absent")`;
csi.rs: `label != "absent"`) — this was the one outlier. Extracted the
motion_level + ClassificationInfo assembly into a small pure `classify_vitals`
function so the invariant (motion implies presence) is enforced in one place
and is unit-testable, with a test pinning the exact contradictory frame from
the report.

Reported with an exact root-cause analysis and suggested fix by @mattanapol.

Fixes #1442

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-07-27 10:23:06 -04:00
..