code wiki / (root) / nx_gate_run.nx

nx_gate_run.nx

buildroot/runtime/nx_gate_run.nx

4584 B101 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic gate
docsdependenciesstructsconstsfunctions

about

nx_gate_run.nx -- SOVEREIGN gate runner: build an organ through the sovereign lane, run it, and check its output/exit -- with NO shell and NO .sh wrapper. Retires the simple bench/gate_*.sh pattern (which does compile-via-nx_compile_x86_native + as + ld + run + grep, all under a /bin/bash script) by composing a single fork+exec of _offc/nx_sov_build_run.elf <organ> (itself the sovereign compile+assemble+run) plus a substring check on the captured output. This is the enabling primitive for migrating nx_engineer's gates off /bin/bash (the agent-sovereignty debt: nx_engineer.nx runs its 7 gate scripts via a shell; nx_conductor_live already went sovereign). Run from the nxc2 root so the relative organ paths + the installed runner resolve. Usage: nx_gate_run <organ> [expect-substring] PASS (exit 0) iff the build+run did not crash AND (an expect string was given AND the captured output contains it) OR (no expect string AND the run exited 0). FAIL (exit 1) otherwise. Sovereign (syscalls only). license_tier: ORIGINAL expect_exit: 0

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_gate_run.nx

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

main gr_puts sys_write sys_exit sys_fork sys_openat_wr sys_dup3 sys_mmap sys_execve sys_wait4 gr_read_file sys_openat_rd sys_read sys_close gr_putn sys_write ↻ sys_mmap ↻ gr_contains

structs

none

consts

14const K_MAGIC_1048576: i64 = 1048576

functions

16func gr_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
17func gr_putn(v: i64) -> i64
called by 1: main calls 2: sys_writesys_mmap
28func gr_read_file(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
42func gr_contains(buf: *u8, n: i64, pat: *u8) -> i64
called by 1: main
55func main(argc: i64, argv: *i64) -> i64