nx_iot_anchor_test.nx
buildroot/runtime/nx_iot_anchor_test.nx
about
nx_iot_anchor_test.nx -- gate for the stable device-identity anchor.
Proves the duplicate-on-repair failure mode is closed BY CONSTRUCTION
and measures the phantom devices a naive (incumbent-app) controller
would have accrued over the same pairing events.
Grounded in the live fleet: device A's hardware id is the REAL BSSID
of the operator's TP-Link Kasa HS210 switch found in pairing mode on
2026-06-18 (SSID TP-LINK_HS210_C209, BSSID d8:0d:17:a1:c2:09).
Coverage:
- vendor + adopt-verdict sealed-enum validity gates
- init writes a coherent registry
- adopt new device -> NEW + fresh logical id
- RE-ADOPT same device (the blink/re-pair) -> READOPTED, SAME
logical id, NO new row, volatile fields refreshed, write-once
fields (logical_id, first_seen) preserved
- a second device gets its own logical id
- MEASURED EXCEED: duplicates_prevented == naive_adopts - count
- friendly name set + survives, miss -> NOT_FOUND
- soft-delete is additive (row kept, count unchanged, current drops)
- re-adopt revives a soft-deleted device on the same anchor
- negative controls: bad hwid_n / oversize hwid_n / invalid vendor
-> BAD_ARG with NO state change
- capacity guard: 3rd distinct device at cap=2 -> FULL; re-adopt at
cap still succeeds
- lookup misses return -1
expect_exit: 0
license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls_x86_64.nxnx_iot_anchor.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 36 | func main() -> i64 |