code wiki / (root) / nx_mgmt_gaterun_gate.nx

nx_mgmt_gaterun_gate.nx

buildroot/runtime/nx_mgmt_gaterun_gate.nx

18527 B304 linesdepth 18pulls 87 transitivereach 0 importersview sourcekind gate/prooftopic mgmt
docsdependenciesstructsconstsfunctions

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

nx_mgmt_api.nx nx_gate_verdict.nx nx_ccgate_lib.nx nx_mgmt_gaterun_gate.nx

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

main ccg_anchor_root sys_openat_rd sys_close sys_chdir sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ ccg_pid gj_name gv_cat gv_catn sys_mmap ↻ sys_munmap gv_cat ↻ gv_catn ↻ gj_write gv_ctr sys_mmap ↻ gv_head gv_puts sys_write ↻ ccg_path sys_mmap ↻ ccg_build ccg_compile sys_mmap ↻ sys_openat_wr

structs

none

consts

23const GJ_DIR: *u8 = "/tmp/nx_mgmt_gaterun_gate\x00" as *u8
24const GJ_SHORT_DEADLINE_MS: i64 = 1000 // == the handler's deadline floor; the slow fixture sleeps 2500 ms, so it is mid-run here
25const GJ_FIX_WINDOW_MS: i64 = 3000 // fixture edge_window.conf: window
26const GJ_FIX_RESERVE_MS: i64 = 500 // fixture edge_window.conf: reserve -> the handler must print window - reserve, src conf
27const GJ_OUTCAP: i64 = 65536
28const GJ_REQCAP: i64 = 4096

functions

30func gj_has(hay: *u8, n: i64, needle: *u8) -> i64
called by 1: main
45func gj_int_after(buf: *u8, n: i64, key: *u8) -> i64
called by 1: main
71func gj_write(path: *u8, s: *u8) -> i64
called by 1: main
81func gj_copy_exec(src: *u8, dst: *u8) -> i64
called by 1: main
92func gj_req(buf: *u8, route: *u8, body: *u8) -> i64
called by 1: main calls 1: gv_cat
101func gj_name(base: *u8, pfx: *u8, pid: i64, sfx: *u8) -> *u8
called by 1: main calls 2: gv_catgv_catn
110func gj_read_small(path: *u8, cap: i64, out: *u8) -> i64
121func main() -> i64