nx_tools_canary_gate.nx
buildroot/runtime/nx_tools_canary_gate.nx
about
nx_tools_canary_gate.nx -- CANARY for the tools daemon (debt seq1373). license_tier: ORIGINAL
WHY THIS EXISTS: nx_tools_api_serve.elf serves EVERY sovereign MCP tool, so it is the ONE service with no
sovereign recovery path -- if a promoted binary crash-loops, the session loses nx_mgmt and therefore cannot
call /api/rollback, because the rollback path runs THROUGH the thing being replaced. Promoting it on the
strength of a compile is restart-and-hope. This gate makes the proof mechanical instead (rule 26).
IT RUNS, IT DOES NOT MERELY COMPILE: it starts the STAGED binary on a throwaway port and then drives that
SAME binary's own plain-HTTP probe client against it over a real socket. A successful bind is NOT evidence;
a real GET /api/tools round-trip that returns the registry body is.
T1 is the NON-VACUITY tooth: the identical probe against a port where nothing listens MUST fail. Without it
a probe that silently returns 0 would report GREEN for a dead binary -- proving your 0 is the whole point.
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_gate.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
| 14 | const TC_STAGED: *u8 = "/volume1/homes/elderwesto/nishihost/nx_tools_api_serve.elf.new" as *u8 |
| 15 | const TC_PORT: *u8 = "18991" as *u8 |
| 16 | const TC_DEADPORT: *u8 = "18992" as *u8 |
| 17 | const TC_SRVLOG: *u8 = "/tmp/nx_tools_canary_srv.out" as *u8 |
| 18 | const TC_PROBELOG: *u8 = "/tmp/nx_tools_canary_probe.out" as *u8 |
functions
| 20 | func tc_slen(s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { i = i + 1 } return i } called by 1: tc_has |
| 21 | func tc_has(buf: *u8, n: i64, pat: *u8) -> i64 |
| 35 | func tc_spawn(elf: *u8, a1: *u8, a2: *u8, logf: *u8) -> i64 |
| 53 | func tc_probe(elf: *u8, port: *u8, path: *u8, logf: *u8) -> i64 |
| 80 | func tc_kill(pid: i64) -> i64 |
| 94 | func main() -> i64 |