Skip to content

fix(server): close silent auto→simulated fallback path (sibling of #937)#979

Merged
ruvnet merged 1 commit into
mainfrom
fix/silent-simulate-fallback-937
Jun 8, 2026
Merged

fix(server): close silent auto→simulated fallback path (sibling of #937)#979
ruvnet merged 1 commit into
mainfrom
fix/silent-simulate-fallback-937

Conversation

@ruvnet
Copy link
Copy Markdown
Owner

@ruvnet ruvnet commented Jun 8, 2026

Summary

Issue #937 in the cognitum-v0 appliance flagged that cognitum-csi-capture shipped --simulate by default. A grep across this tree found the same anti-pattern: CSI_SOURCE=auto (the Docker default) silently fell back to synthetic CSI when no ESP32 or Windows WiFi was detected, and the only signal was a single info! log line at startup. Downstream consumers of /api/v1/sensing/latest and /ws/sensing had no in-band way to know they were being served fake data.

Fix

auto now refuses to fall back. When no real source is detected the server logs a clear error! with two explicit ways to proceed, then exits 78 (EX_CONFIG):

error: No real CSI source detected. Auto-detection refuses to silently fall back
       to synthetic data because that would expose downstream consumers
       (/api/v1/sensing/latest, /ws/sensing) to fake telemetry tagged as
       production. To run with synthetic data, set the source explicitly:
       --source simulated (or CSI_SOURCE=simulated in Docker). To use real
       hardware: provision an ESP32 to emit CSI on UDP :5005 or install the
       Windows WiFi capture driver. See https://github.com/ruvnet/RuView/issues/937
       for context.

Existing operators who explicitly set --source simulated (or the legacy simulate alias) are unaffected — the alias is preserved for back-compat.

What changed

File Change
wifi-densepose-sensing-server/src/main.rs auto no longer falls back; exits 78 with actionable error. simulatesimulated alias preserved.
docker/docker-entrypoint.sh CSI_SOURCE help text rewritten to reflect fail-loud auto.
docker/docker-compose.yml Comment for CSI_SOURCE=auto corrected.
wifi-densepose-desktop/src/commands/server.rs Default passed downstream is now the explicit simulated (not auto), so the server tags the data correctly. Desktop app keeps demo-mode default — it's an explicit demo product.

Test plan

  • cargo build -p wifi-densepose-sensing-server --no-default-features --bin sensing-server → clean (existing pre-fix warnings unchanged).
  • cargo test -p wifi-densepose-sensing-server --no-default-features --bin sensing-server122 / 122 pass (no regressions in the existing test suite).
  • HW: not strictly needed — the code path is match args.source.as_str() arm replacement; CI build covers it. An end-to-end Docker smoke test (build image, run with no ESP32, expect exit 78) would be nice-to-have.

Deployment

Breaking change for unattended deployments that relied on the auto → simulated silent fallback. That's exactly the failure mode this PR closes: pretending to serve real sensing data when the source is fake. Three escape hatches printed in the error message:

docker run -e CSI_SOURCE=simulated ruvnet/wifi-densepose:latest   # opt in to demo mode
docker run -e CSI_SOURCE=esp32     ruvnet/wifi-densepose:latest   # require real ESP32 on :5005
docker run -e CSI_SOURCE=wifi      ruvnet/wifi-densepose:latest   # use host WiFi capture

🤖 Generated with claude-flow

Background

Issue #937 in the cognitum-v0 appliance repo flagged that the
`cognitum-csi-capture` systemd unit shipped `--simulate` by default,
silently serving synthetic CSI tagged as production telemetry on
`/api/v1/sensor/stream`. That's a textbook trust-eroding pattern — the
single most-cited "where's the real data?" evidence external reviewers
(#943, #934) point at when they call the project AI-slop.

A grep across THIS tree surfaced the exact same anti-pattern in three
places:

  docker/docker-compose.yml:27        # auto (default) — probe ESP32, fall back to simulation
  docker/docker-entrypoint.sh:14      # CSI_SOURCE — data source: auto (default), ...
  main.rs:6435                        info!("No hardware detected, using simulation"); "simulate"

The sensing-server's `auto` source resolver at main.rs:6425-6440
silently fell back to synthetic with only an `info!` log line as the
signal. Downstream consumers calling `/api/v1/sensing/latest` or
`/ws/sensing` had no in-band way to know they were being served fake
data.

Fix

`auto` now refuses to fall back. When neither ESP32 UDP nor host WiFi
is detected, the server logs a clear `error!` explaining the situation
and exits 78 (EX_CONFIG). The error message names the two ways to
proceed: provision real hardware, or set `--source simulated` /
`CSI_SOURCE=simulated` explicitly. Existing operators who already use
`--source simulated` (or its legacy `simulate` alias) are unaffected —
the alias is preserved for back-compat.

Docker entrypoint comment, docker-compose comment, and the Tauri
desktop app's source-default path also updated to reflect the new
posture. The desktop app keeps its `simulated` default because it's
an explicit demo product — the value passed downstream is the
*explicit* `simulated`, not `auto`, so the server tags it correctly
and never lies about its data source.

Validation

  cargo build  -p wifi-densepose-sensing-server --no-default-features
  cargo test   -p wifi-densepose-sensing-server --no-default-features
  → 122 / 122 pass, build clean (existing pre-fix warnings unchanged).

Deployment

⚠ Breaking change for unattended deployments that relied on the
`auto → simulated` silent fallback. That is exactly the failure mode
this PR fixes: pretending to serve real sensing data when the source
is fake. Operators who genuinely want demo mode set
`CSI_SOURCE=simulated` explicitly; the error message and the
docker-compose comment both point them there.

Co-Authored-By: claude-flow <ruv@ruv.net>
@ruvnet ruvnet merged commit b6420ac into main Jun 8, 2026
20 checks passed
@ruvnet ruvnet deleted the fix/silent-simulate-fallback-937 branch June 8, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant