nx_mgmt_gaterun_gate.nx
buildroot/runtime/nx_mgmt_gaterun_gate.nx
about
nx_mgmt_gaterun_gate.nx -- GATE for the control plane's two lane-J fixes (2026-08-23):
D1 /api/gate_run PROMOTES a gate that outruns its deadline onto the job lane (JOB-STARTED + .claim +
.out, the worker kept ALIVE and reaped by the handler for its REAL exit code) instead of SIGKILLing
it and answering verdict=TIMEOUT -- the absence of a verdict dressed as one. Measured 2026-08-23:
nx_chkarith_gate / nx_boundscheck_gate read TIMEOUT under load while nx_job_run of the same
binaries returned 17/17 and 11/11 GREEN.
D2 /api/promote refuses ONE CONJUNCT AT A TIME, by name (NOTHING-STAGED with the path it looked at;
UNDECLARED-KIND with the conf to edit; DECLARED-DAEMON with the deploy call), where one 400 text
used to cover all of them and a consumed stage read as "undeclared kind" (lane F, same day).
SHAPE: the incumbent nx_mgmt_api_gate's -- SOVEREIGN and IN-PROCESS. It imports the daemon's own
source and drives the HANDLER FUNCTIONS (ma_do_gate_run / ma_do_promote / ma_promote_refuse /
ma_gate_run_finish) with crafted request bytes: TEST THE SUBJECT, NOT THE ROUTE THAT HAPPENS TO REACH
IT (a synthetic session has level 0 in production and every privileged route 403s before its handler).
FIXTURES never touch a production plane: the daemon's seam ma_gr_set_fixture points the elf root at
_build/nxgr_<pid>/ (runnable: NAS /tmp is noexec), the jobs dir and the window conf at /tmp/<gate>/.
ONE fixture organ (runtime/nx_gaterun_fixture_test.nx) is compiled once and copied under four names;
it keys on its own name because gate_run passes no argv.
license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_mgmt_api.nxnx_gate_verdict.nxnx_ccgate_lib.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
| 23 | const GJ_DIR: *u8 = "/tmp/nx_mgmt_gaterun_gate\x00" as *u8 |
| 24 | const GJ_SHORT_DEADLINE_MS: i64 = 1000 // == the handler's deadline floor; the slow fixture sleeps 2500 ms, so it is mid-run here |
| 25 | const GJ_FIX_WINDOW_MS: i64 = 3000 // fixture edge_window.conf: window |
| 26 | const GJ_FIX_RESERVE_MS: i64 = 500 // fixture edge_window.conf: reserve -> the handler must print window - reserve, src conf |
| 27 | const GJ_OUTCAP: i64 = 65536 |
| 28 | const GJ_REQCAP: i64 = 4096 |
functions
| 30 | func gj_has(hay: *u8, n: i64, needle: *u8) -> i64 called by 1: main |
| 45 | func gj_int_after(buf: *u8, n: i64, key: *u8) -> i64 called by 1: main |
| 71 | func gj_write(path: *u8, s: *u8) -> i64 called by 1: main |
| 81 | func gj_copy_exec(src: *u8, dst: *u8) -> i64 called by 1: main |
| 92 | func gj_req(buf: *u8, route: *u8, body: *u8) -> i64 |
| 101 | func gj_name(base: *u8, pfx: *u8, pid: i64, sfx: *u8) -> *u8 |
| 110 | func gj_read_small(path: *u8, cap: i64, out: *u8) -> i64 |
| 121 | func main() -> i64 |