nx_shelltool_gate.nx
buildroot/runtime/nx_shelltool_gate.nx
about
nx_shelltool_gate.nx -- liar-killed GATE for the MCP-ready shell-tool CLI. Forks the REAL built
elf against a /tmp fixture tree and captures stdout via a pipe, proving grep/glob/find each return
the RIGHT hits and NOT the wrong ones (the neg-controls: a non-matching file must NOT appear, an
ext filter must EXCLUDE, a glob must reject a non-match). Composes nx_grep so the canonical match
is exercised end-to-end through the invocable surface. usage: nx_shelltool_gate [elf] Exit 0 on 11/11.
SEQ1292 teeth (2026-07-30): the scan budget BITES (tiny max_bytes -> BUDGET-EXCEEDED partial) and is
ABSENT at defaults (the non-vacuous control pair). ⚠the gate's CWD is part of its contract: it writes
shelltool_budget.conf in CWD (scratch dirs only, per the exec-gate clobber law).
license_tier: ORIGINAL expect_exit: 0
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_crashresume_census_core.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
| 13 | const G_OUTCAP: i64 = 65536 // captured-stdout buffer |
| 14 | const G_TOTAL: i64 = 16 // 11 base + 1 anti-vacuity precondition + 4 out= teeth |
functions
| 21 | func g_exists(p: *u8) -> i64 { let fd: i64 = sys_openat_rd(p); if fd < 0 { return 0 } sys_close(fd); return 1 } |
| 22 | func g_slurp(p: *u8, buf: *u8, cap: i64) -> i64 |
| 33 | func g_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 34 | func g_putn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 35 | func g_bool(name: *u8, got: i64, want: i64, passp: *i64) -> i64 |
| 40 | func g_write(path: *u8, s: *u8) -> i64 { let fd: i64 = sys_openat_wr(path, 420); if fd < 0 { return 0 - 1 } sys_write(fd, s, ccz_slen(s)); sys_close(fd); return 0 } |
| 41 | func g_has(hay: *u8, hn: i64, needle: *u8) -> i64 |
| 49 | func g_run(elf: *u8, a1: *u8, a2: *u8, a3: *u8, a4: *u8, out: *u8, cap: i64) -> i64 |
| 78 | func main(argc: i64, argv: *i64) -> i64 |