code wiki / _hdl_build / nx_gate_sentinel.nx
nx_gate_sentinel.nx
buildroot/runtime/_hdl_build/nx_gate_sentinel.nx
about
nx_gate_sentinel.nx -- TEAM-OWNED watchdog over nx_game_gate (operator:
"keep building the team to handle the ask"). Runs the gate, compares the
fails count against the recorded baseline, and reacts WITHOUT Claude:
fails > baseline -> REGRESSION: escalate to the PM review log (pm_gap)
fails < baseline -> IMPROVEMENT: record a deliverable line
fails == baseline -> STEADY: quiet (one SENTINEL line in the gate log)
Baseline auto-updates after every report so each CHANGE escalates exactly
once (no spam, no silent drift). This is the loop-monitor pattern from
[[project-self-running-loop-governed-ingest-2026-06-05]] applied to the
game-engine substrate: the gate produces evidence, the sentinel watches it,
the PM log receives the escalation -- grades stay LIVE with no LLM in the
loop.
Usage (from nxc2 repo root):
nx_gate_sentinel.elf # gate with default _offc compiler
nx_gate_sentinel.elf /path/to/nx_cc.elf # gate a candidate compiler
Exit: 0 steady/improvement/init, 1 regression, 2 gate-missing/crashed.
license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_pm_review_log.nxnx_syscalls.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
| none |
functions
| 23 | func gs_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } calls 1: sys_write |
| 24 | func gs_putn(v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64=v; if m<0 {m=0-m;sys_write(1,"-" as *u8,1)}; let t: *u8 = sys_mmap(28); var k: i64=0; if m==0 {t[0]=48;k=1}; while m>0 {t[k]=48+(m%10); m=m/10; k=k+1}; var i: i64=0; while i<k {bb[i]=t[k-1-i]; i=i+1}; sys_write(1, bb, k); return 0 } |
| 25 | func gs_cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { dst[off+i] = s[i]; i = i + 1 } return off + i } called by 1: gs_log |
| 26 | func gs_cat_n(dst: *u8, off: i64, v: i64) -> i64 |
| 40 | func gs_run_gate(path: *u8, arg1: *u8) -> i64 |
| 59 | func gs_read_baseline(path: *u8) -> i64 |
| 77 | func gs_write_baseline(path: *u8, v: i64) -> i64 |
| 89 | func gs_log(kind: *u8, fails: i64, baseline: i64, ts: i64) -> i64 |
| 107 | func main(argc: i64, argv: *i64) -> i64 |