code wiki / _hdl_build / nx_gatebuilt_gate.nx
nx_gatebuilt_gate.nx
buildroot/runtime/_hdl_build/nx_gatebuilt_gate.nx
about
nx_gatebuilt_gate.nx -- THE UNBUILT-GATE CENSUS. For every authored *_gate.nx, does a promoted *_gate.elf
actually exist? A gate that lives only in source makes its subject PERMANENTLY UNVERIFIABLE, and nothing
in the ecosystem reports it.
WHY (found by accident 2026-07-30, id 1785472297): I tried to VERIFY the FD_CLOEXEC port-hostage fix before
eating three sev-9 rows that depend on it. `POST /api/gate_run target=nx_cloexec_gate` returned
**exit_code=127 verdict=NOT-FOUND bytes=0** -- a fully-written gate (T1 control proving the disease state is
reachable, T5 neg-control, T6 non-vacuity) that had NEVER BEEN COMPILED. Building it took one call and it
came back 6/6 GREEN. Until then, three sev-9 incidents rested on a fix nobody could prove.
A two-glob spot check then said the gap is systemic: ~2877 *_gate.nx sources vs ~187 *_gate.elf binaries.
WHY NOTHING ELSE CATCHES IT -- an unbuilt gate is invisible in EVERY direction:
nx_gate_rollup reads LOGS -> no binary means no log means the gate is ABSENT from the roster, not RED.
nx_wirecensus S3 counts promoted-but-unregistered -- never authored-but-unbuilt.
every debt row citing 'gate-proven' reads as evidence regardless.
It is the exact INVERSE of PROVEN_UNWIRED (4952 capabilities BUILT+GATED+never called): there the gate
exists and the capability is unused; here the capability is used and the gate does not exist.
BOTH SCORE AS DONE.
LAW: AN UNBUILT GATE IS INDISTINGUISHABLE FROM A PASSING ONE IN EVERY REPORT THAT MENTIONS IT.
ENVELOPE, declared in the output and never silent: FLAT scan of the two named dirs (no recursion, so the
_attic/_retired/_stage_local shadow trees are deliberately EXCLUDED and this counts LIVE gates only);
existence is probed with openat, not a read, so it is cheap and cannot be fooled by an empty file being
unreadable; the shown list is capped and the cap is printed.
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
dependencies 1 imports · 0 importers
imports: nx_syscalls.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
| 29 | const GB_DIR1: *u8 = "buildroot/runtime" as *u8 |
| 30 | const GB_DIR2: *u8 = "buildroot/runtime/_hdl_build" as *u8 |
| 31 | const GB_DIRBUF: i64 = 262144 |
| 32 | const GB_NAMEBUF: i64 = 512 |
| 33 | const GB_MAXSHOW: i64 = 25 |
| 34 | const GB_RECLEN_OFF: i64 = 16 |
| 35 | const GB_NAME_OFF: i64 = 19 |
functions
| 37 | func gb_puts(s: *u8) |
| 43 | func gb_puti(x: i64) |
| 70 | func gb_is_gate_src(nm: *u8, n: i64) -> i64 called by 1: gb_scan |
| 82 | func gb_exists(path: *u8) -> i64 |
| 90 | func gb_scan(dir: *u8, ctr: *i64) -> i64 |
| 140 | func main(argc: i64, argv: *i64) -> i64 |