nx_behaveprobe_gate.nx
buildroot/runtime/nx_behaveprobe_gate.nx
about
nx_behaveprobe_gate.nx -- THE REFEREE FOR THE PROMOTE RULER'S SUFFICIENCY HALF: A LIVE PROBE MUST READ A SIGNAL
DEATH AS A SIGNAL DEATH, AND A PLAIN EXIT CODE AS ITSELF.
WHY (2026-09-05, measured on the promote path). nx_behaveprobe reported rc=0 for a gate the crash guard
had killed with SIGSEGV -- twice -- and that receipt cleared a crashing gate for promote. The rule was
not missing: wait_status_rc (2026-08-25) reads a signal death as 128+signal, nx_waitrc_gate proves it,
and nx_tool_run composes it. The SERVED probe was simply older than the rule, and nothing in the estate
ever asked the live ruler the question. A STALE COPY OF A CORRECT INSTRUMENT IS INDISTINGUISHABLE FROM
A BROKEN ONE, and the only cure that survives a promote is a referee that forks the LIVE binary against
a subject that really dies by signal. That subject is nx_sigfixture (registered, dies by the named signal
on itself; `exit <code>` is its control arm), and the probe's `self` mode compares live against itself
so no stage slot is touched.
SUBJECT = the DEPLOYED probe at its absolute nishihost path, forked in its own directory (the 08-22
lesson: a relative subject and a runner's cwd read as failing teeth about a correct binary).
license_tier: ORIGINAL expect_exit: 0
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.nxnx_tool_run.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
| 20 | const BPG_PROBE: *u8 = "/volume1/homes/elderwesto/nishihost/nx_behaveprobe.elf" |
| 21 | const BPG_FIXTURE: *u8 = "nx_sigfixture" |
| 22 | const BPG_SIG_BASE: i64 = 128 // wait_status_rc: a signal death reads 128+signal |
| 23 | const BPG_SIGTERM: i64 = 15 // no guard catches it: a TRUE signal death |
| 24 | const BPG_SIGTERM_ARG: *u8 = "15" |
| 25 | const BPG_CTRL_CODE: i64 = 7 // the control arm: a plain exit code must pass through unchanged |
| 26 | const BPG_CTRL_ARG: *u8 = "7" |
| 27 | const BPG_CAPTURE_CAP: i64 = 65536 |
| 28 | const BPG_ARGV_SLOTS: i64 = 8 |
| 29 | const BPG_WORD_BYTES: i64 = 8 |
| 30 | const BPG_CWD_CAP: i64 = 4096 |
| 31 | const BPG_NO_TIMEOUT: i64 = 0 |
| 32 | const BPG_SLASH: i64 = 47 |
| 33 | const BPG_DIGIT_ZERO: i64 = 48 |
| 34 | const BPG_DIGIT_NINE: i64 = 57 |
| 35 | const BPG_DEC_BASE: i64 = 10 |
| 36 | const BPG_MINUS: i64 = 45 |
| 37 | const BPG_ABSENT: i64 = 0 - 999999 // a key the capture does not carry: never a plausible rc |
| 107 | const BPG_FIXTURE_ELF: *u8 = "/volume1/homes/elderwesto/nishihost/nx_sigfixture.elf" |
functions
| 39 | func hw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 40 | func pn(v: i64) -> i64 { let t: *u8=sys_mmap(24); var m: i64=v; if m<0{sys_write(1,"-" as *u8,1);m=0-m} var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} let b: *u8=sys_mmap(24); var j: i64=0; while j<k{b[j]=t[k-1-j];j=j+1} sys_write(1,b,k); return 0 } |
| 42 | func bpg_find(b: *u8, n: i64, lit: *u8) -> i64 |
| 56 | func bpg_has(b: *u8, n: i64, lit: *u8) -> i64 { if bpg_find(b, n, lit) >= 0 { return 1 } return 0 } |
| 58 | func bpg_json_int(b: *u8, n: i64, key: *u8) -> i64 |
| 80 | func bpg_dirname(path: *u8, out: *u8) -> i64 |
| 91 | func bpg_probe(a3: *u8, a4: *u8, out: *u8, olen: *i64) -> i64 |
| 108 | func bpg_fixture(a1: *u8, a2: *u8, out: *u8, olen: *i64) -> i64 |
| 118 | func main() -> i64 |