code wiki / _hdl_build / nx_gate_sentinel.nx

nx_gate_sentinel.nx

buildroot/runtime/_hdl_build/nx_gate_sentinel.nx

6655 B151 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic gate
docsdependenciesstructsconstsfunctions

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

nx_pm_review_log.nx nx_syscalls.nx nx_gate_sentinel.nx

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

main sys_now_realtime_sec sys_mmap sys_clock_gettime_real gs_run_gate sys_fork sys_openat_wr sys_dup3 sys_mmap ↻ sys_execve sys_exit sys_wait4 gs_log sys_openat_append sys_mmap ↻ gs_cat gs_cat_n sys_mmap ↻ sys_write sys_close pm_open sys_openat_append ↻ pm_gap pm_flag pm_w sys_write ↻ pm_cstr_len sys_close ↻ gs_read_baseline sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close ↻ gs_write_baseline sys_openat_wr ↻ sys_mmap ↻ gs_cat_n ↻

structs

none

consts

none

functions

23func 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
24func 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 }
25func 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
26func gs_cat_n(dst: *u8, off: i64, v: i64) -> i64
called by 2: gs_write_baselinegs_log calls 1: sys_mmap
40func gs_run_gate(path: *u8, arg1: *u8) -> i64
59func gs_read_baseline(path: *u8) -> i64
called by 1: main calls 2: sys_mmapsys_read_file
77func gs_write_baseline(path: *u8, v: i64) -> i64
89func gs_log(kind: *u8, fails: i64, baseline: i64, ts: i64) -> i64
107func main(argc: i64, argv: *i64) -> i64