code wiki / _hdl_build / nx_routeguard.nx

nx_routeguard.nx

buildroot/runtime/_hdl_build/nx_routeguard.nx

5154 B109 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_routeguard.nx -- THIN ORGAN: run the deploy-contract check between two binaries. nx_routeguard <live-artifact> <candidate-artifact> Answers ONE question: does the candidate still serve every /api/ route the live one does? exit 0 GREEN (superset -- safe on this axis) | exit 3 RED (routes vanished) | exit 2 REFUSED. USE IT BEFORE EVERY mgmt DEPLOY. The 2026-07-30 regression (5th occurrence) happened because a 528323-byte artifact was promoted over a 575195-byte one and nothing compared their surfaces -- the deploy reported success while /api/gate_run and /api/proc_kill silently vanished, and the sovereign process-kill verb was gone exactly when a runaway process needed killing. REFUSES RATHER THAN BLESSES: if the LIVE image yields zero routes, this exits 2, because "0 missing" computed from an empty expectation reads as SAFE while guaranteeing nothing. A guard that cannot see its subject must say so, not pass it. license_tier: ORIGINAL Read-only -- it never promotes, deletes or writes. (Rule 26) expect_exit: 0

dependencies 1 imports · 0 importers

nx_routeguard_lib.nx nx_routeguard.nx

imports: nx_routeguard_lib.nx

imported by: nobody (leaf or entry point)

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

main rgo_cat rg_read sys_openat_rd sys_read sys_close rg_extract rg_isroute_ch rg_seen rg_missing rg_contains rg_isroute_ch ↻ rgo_num

structs

none

consts

19const RGO_OUT: i64 = 65536

functions

21func rgo_cat(o: *u8, at: i64, s: *u8) -> i64
called by 1: main
27func rgo_num(o: *u8, at: i64, v: i64) -> i64
called by 1: main
38func main(argc: i64, argv: *i64) -> i64