code wiki / (root) / nx_shelltool_gate.nx

nx_shelltool_gate.nx

buildroot/runtime/nx_shelltool_gate.nx

12098 B186 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_crashresume_census_core.nx nx_shelltool_gate.nx

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

main g_exists sys_openat_rd sys_close sys_mmap g_puts sys_write g_putn nxi_out nxi_fd sys_mmap ↻ ccz_cat_num sys_write ↻ sys_munmap g_write sys_openat_wr sys_write ↻ ccz_slen sys_close ↻ sys_mkdir g_run sys_mmap ↻ sys_pipe2 sys_fork sys_dup3 sys_close ↻ sys_execve sys_exit sys_read sys_wait4 g_bool g_puts ↻ g_putn ↻ g_has ccz_slen ↻ g_slurp sys_openat_rd ↻ sys_read ↻ sys_close ↻

structs

none

consts

13const G_OUTCAP: i64 = 65536 // captured-stdout buffer
14const G_TOTAL: i64 = 16 // 11 base + 1 anti-vacuity precondition + 4 out= teeth

functions

21func g_exists(p: *u8) -> i64 { let fd: i64 = sys_openat_rd(p); if fd < 0 { return 0 } sys_close(fd); return 1 }
called by 1: main calls 2: sys_openat_rdsys_close
22func g_slurp(p: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
33func 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 }
called by 2: g_boolmain calls 1: sys_write
34func g_putn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 2: g_boolmain calls 1: nxi_out
35func g_bool(name: *u8, got: i64, want: i64, passp: *i64) -> i64
called by 1: main calls 2: g_putsg_putn
40func 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 }
41func g_has(hay: *u8, hn: i64, needle: *u8) -> i64
called by 1: main calls 1: ccz_slen
49func g_run(elf: *u8, a1: *u8, a2: *u8, a3: *u8, a4: *u8, out: *u8, cap: i64) -> i64
78func main(argc: i64, argv: *i64) -> i64