Skip to content

fix(sensing-server): make multistatic guard interval configurable (closes #1049)#1104

Open
ruvnet wants to merge 1 commit into
mainfrom
fix/issue-1049-configurable-guard
Open

fix(sensing-server): make multistatic guard interval configurable (closes #1049)#1104
ruvnet wants to merge 1 commit into
mainfrom
fix/issue-1049-configurable-guard

Conversation

@ruvnet

@ruvnet ruvnet commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Fixes #1049 — permanent trust demotion with WiFi-synced ESP32 nodes

Reporter's symptom (2× ESP32-S3, firmware v0.7.0, ruvnet/wifi-densepose:latest): the governed-trust cycle permanently demotes to Restricted and suppresses all pose output because the inter-node timestamp spread (measured 10–150 ms, ~70 ms typical) exceeds the guard interval. Error counter hits 200k+; the only workaround is restarting the container (which re-demotes within minutes).

Root cause: ESP-NOW sync (100 ms beacons + WiFi-MAC jitter) cannot hold two independently-clocked boards within the published 60 ms default guard, and there was no runtime/env way to raise it without knowing the exact TDM schedule. (Note: the hardcoded 5000 µs the issue cites was already raised to 60_000 µs in a prior change — but 60 ms still < the reporter's ~70 ms spread.)

Fix

A direct WDP_GUARD_INTERVAL_US override (+ optional WDP_SOFT_GUARD_US), the issue's option 1/2. A deployment just sets WDP_GUARD_INTERVAL_US=200000 to lift the guard past its measured spread — no schedule math needed.

  • Precedence (most-specific wins): direct WDP_GUARD_INTERVAL_USWDP_TDM_SLOTS+WDP_TDM_SLOT_US schedule-derived → 60 ms/20 ms default. The override applies on top of whichever base is selected.
  • Safe: soft band always clamped strictly below the hard guard; a malformed/zero value is ignored (falls back to the base — never breaks fusion).
  • Observable: the effective guard is now logged at startup.

Honest scope

This is the configurability fix (the issue's title + root cause). The reporter also suggested a POST /api/v1/trust/reset endpoint (option 4) — deferred as a separate, larger change; with a correctly-sized guard the demotion no longer occurs, so the restart-to-reset need goes away. The default stays 60 ms (validated for TDM hardware); WiFi deployments opt into a larger value.

Validation

  • 6 new pinning tests (multistatic_guard_config_tests): direct-override-wins · beats-TDM-derived · soft-clamped-below-hard · lowering-hard-pulls-soft-down · malformed/zero-falls-back · default-when-unset
  • wifi-densepose-sensing-server bin tests 449 → 455, 0 failed
  • python archive/v1/data/proof/verify.pyPASS, hash unchanged (off the signal proof path)

🤖 Generated with claude-flow

…rable (#1049)

Two ESP32-S3 nodes on WiFi/ESP-NOW sync drift 10-150 ms (~70 ms typ.), exceeding
the 60 ms default guard → permanent trust demotion to Restricted, all pose output
suppressed, 200k+ errors, no escape but a container restart.

Add a direct WDP_GUARD_INTERVAL_US override (+ optional WDP_SOFT_GUARD_US) to
multistatic_guard_config_from_env. Precedence (most-specific wins): direct
override > WDP_TDM_SLOTS+WDP_TDM_SLOT_US schedule-derived > 60ms/20ms default.
Soft band always clamped strictly below hard; malformed/zero ignored (falls back,
never breaks fusion). Effective guard logged at startup.

Pinned by 6 tests (multistatic_guard_config_tests). sensing-server bin tests
449 -> 455, 0 failed. Python proof PASS, hash unchanged (off signal path).

Closes #1049.

Co-Authored-By: claude-flow <ruv@ruv.net>
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.

Make multistatic guard_interval_us configurable (hardcoded 5000 µs causes permanent trust demotion with 2 ESP32-S3 nodes)

1 participant