code wiki / _hdl_build / nx_ready_census.nx

nx_ready_census.nx

buildroot/runtime/_hdl_build/nx_ready_census.nx

5976 B108 linesdepth 6pulls 7 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_ready_census.nx -- LIVENESS-vs-READINESS CENSUS across the whole supervised fleet (seq1314 oracle). WHY: on 2026-07-29 nx_tools_api_serve was PROCESS-ALIVE with its LISTEN SOCKET GONE; every liveness-only guard read it as healthy and the agent-facing MCP surface stayed dark for an hour. seq1299 fixed the detector and wired it into ONE guard. This organ answers the fleet-wide question that fix raised: "which OTHER services are currently claiming UP while nothing is listening?" METHOD: mgmt_snap.json is the supervisor's OWN per-poll claim (SVC <name> <port> <state> ...). We take each claim and CONNECT to the port -- connect-only, never writing a byte, so this can never disturb a working daemon (the retired /healthz serving-probe crash-looped redirect.elf by writing to it). A DISAGREEMENT (claim=UP, socket=REFUSED) is the exact 07-29 wound, caught by measurement. ★It is ALSO the empirical port oracle for seq1314: the supervisor's guard CALL-SITE COMMENTS are stale (they say the docportal admin daemon is :8456; it is really :18456 -- wiring a guard from the comment would kill a HEALTHY daemon every poll). mgmt_snap.json agrees with the live listen table; comments do not. nx_ready_census [snapfile] exit 0 = all claims honest · 3 = disagreement · 2 = snapshot unreadable license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 3 imports · 0 importers

nx_health_probe.nx nx_itoa_lib.nx nx_syscalls.nx nx_ready_census.nx

imports: nx_health_probe.nxnx_itoa_lib.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_openat_rd rc_w sys_write sys_exit sys_mmap sys_read sys_close hp_listening sys_socket sys_set_socket_timeout sys_mmap ↻ sys_setsockopt sys_munmap sys_mmap ↻ hp_sockaddr nx_connect_bounded nx_fcntl sys_connect sys_mmap ↻ sys_poll sys_close ↻ sys_munmap ↻ hp_socket_dead hp_listening ↻ sys_sleep_ms sys_mmap ↻ sys_munmap ↻ sys_write ↻ rc_n nxi_out nxi_fd sys_mmap ↻ ccz_cat_num sys_write ↻ sys_munmap ↻

structs

none

consts

20const RC_CAP: i64 = 65536
22const RC_NAMECAP: i64 = 128

functions

24func rc_w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
29func rc_n(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
31func main(argc: i64, argv: *i64) -> i64