code wiki / (root) / nx_behaveprobe_gate.nx

nx_behaveprobe_gate.nx

buildroot/runtime/nx_behaveprobe_gate.nx

10721 B165 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic behaveprobe
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_gate_verdict.nx nx_tool_run.nx nx_behaveprobe_gate.nx

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

main gv_ctr 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 ↻ gv_head gv_puts sys_write ↻ sys_mmap ↻ bpg_probe sys_mmap ↻ bpg_dirname tr_run_capture_cwd tr_run_capture_core tr_run_capture_core_owned tr_run_capture_core_eviden sys_mmap_shared tr_clock_ms sys_munmap sys_pipe2 sys_fork sys_close sys_default_signal sys_bind_parent_lifetime sys_exit ↻ sys_setpgid tr_capture_redirect sys_chdir

structs

none

consts

20const BPG_PROBE: *u8 = "/volume1/homes/elderwesto/nishihost/nx_behaveprobe.elf"
21const BPG_FIXTURE: *u8 = "nx_sigfixture"
22const BPG_SIG_BASE: i64 = 128 // wait_status_rc: a signal death reads 128+signal
23const BPG_SIGTERM: i64 = 15 // no guard catches it: a TRUE signal death
24const BPG_SIGTERM_ARG: *u8 = "15"
25const BPG_CTRL_CODE: i64 = 7 // the control arm: a plain exit code must pass through unchanged
26const BPG_CTRL_ARG: *u8 = "7"
27const BPG_CAPTURE_CAP: i64 = 65536
28const BPG_ARGV_SLOTS: i64 = 8
29const BPG_WORD_BYTES: i64 = 8
30const BPG_CWD_CAP: i64 = 4096
31const BPG_NO_TIMEOUT: i64 = 0
32const BPG_SLASH: i64 = 47
33const BPG_DIGIT_ZERO: i64 = 48
34const BPG_DIGIT_NINE: i64 = 57
35const BPG_DEC_BASE: i64 = 10
36const BPG_MINUS: i64 = 45
37const BPG_ABSENT: i64 = 0 - 999999 // a key the capture does not carry: never a plausible rc
107const BPG_FIXTURE_ELF: *u8 = "/volume1/homes/elderwesto/nishihost/nx_sigfixture.elf"

functions

39func hw(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
40func 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 }
called by 1: main calls 2: sys_mmapsys_write
42func bpg_find(b: *u8, n: i64, lit: *u8) -> i64
called by 2: bpg_hasbpg_json_int
56func bpg_has(b: *u8, n: i64, lit: *u8) -> i64 { if bpg_find(b, n, lit) >= 0 { return 1 } return 0 }
called by 1: main calls 1: bpg_find
58func bpg_json_int(b: *u8, n: i64, key: *u8) -> i64
called by 1: main calls 1: bpg_find
80func bpg_dirname(path: *u8, out: *u8) -> i64
91func bpg_probe(a3: *u8, a4: *u8, out: *u8, olen: *i64) -> i64
108func bpg_fixture(a1: *u8, a2: *u8, out: *u8, olen: *i64) -> i64
118func main() -> i64