code wiki / (root) / nx_iot_anchor_test.nx

nx_iot_anchor_test.nx

buildroot/runtime/nx_iot_anchor_test.nx

8808 B164 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/prooftopic iot
docsdependenciesstructsconstsfunctions

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

nx_syscalls_x86_64.nx nx_iot_anchor.nx nx_iot_anchor_test.nx

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

main nx_iot_vendor_is_valid nx_iot_anchor_verdict_is_v nx_iot_anchor_init nx_iot_anchor_adopt nx_iot_vendor_is_valid ↻ nx_iot_anchor_find nx_iot_anchor_hwid_eq nx_iot_anchor_hwid_base nx_iot_anchor_meta_ptr nx_iot_anchor_store_hwid nx_iot_anchor_hwid_base ↻ nx_iot_anchor_count nx_iot_anchor_naive_adopts nx_iot_anchor_logical_adop nx_iot_anchor_slot_by_logi nx_iot_anchor_meta_ptr ↻ nx_iot_anchor_meta_ptr ↻ nx_iot_anchor_logical_is_c nx_iot_anchor_slot_by_logi ↻ nx_iot_anchor_meta_ptr ↻ nx_iot_anchor_logical_vend nx_iot_anchor_slot_by_logi ↻ nx_iot_anchor_meta_ptr ↻ nx_iot_anchor_logical_ip nx_iot_anchor_slot_by_logi ↻ nx_iot_anchor_meta_ptr ↻ nx_iot_anchor_slot_by_logi ↻ nx_iot_anchor_meta_ptr ↻ nx_iot_anchor_duplicates_p nx_iot_anchor_set_name nx_iot_anchor_slot_by_logi ↻ nx_iot_anchor_name_base nx_iot_anchor_meta_ptr ↻ nx_iot_anchor_name_base ↻ nx_iot_anchor_mark_unreach nx_iot_anchor_slot_by_logi ↻ nx_iot_anchor_meta_ptr ↻ nx_iot_anchor_count_curren nx_iot_anchor_meta_ptr ↻

structs

none

consts

none

functions

36func main() -> i64