code wiki / (root) / nx_daemon_supervisor_gate.nx

nx_daemon_supervisor_gate.nx

buildroot/runtime/nx_daemon_supervisor_gate.nx

6285 B103 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/prooftopic daemon
docsdependenciesstructsconstsfunctions

about

nx_daemon_supervisor_gate.nx -- the fleet supervisor's PURE helpers (nx_dsup_lib), driven in-process: the bounded-life conf parser, the /proc/<pid>/stat parser behind the status child's PARENT PROBE, and the progress trailer the supervisor publishes after every row. WHY (2026-09-02): the conf parser that lived inside nx_daemon_supervisor spun forever on the NAS conf (a cursor sentinel `k = 99` read past its 12-byte key literal), so every supervisor generation sat at state=R wchan=0 before its first probe -- the fleet went unsupervised for a day and the only symptom was a /status page that never moved. A laptop control never spun because the laptop has no conf. T2 below is that conf's SHAPE (over 1 KB of comment lines, one of which mentions the key, then the row): a parser that spins there never returns and the gate reads RED by its deadline; a parser that takes the comment's mention reads 0 and fails T2b. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_dsup_lib.nx nx_gate_verdict.nx nx_daemon_supervisor_gate.nx

imports: nx_syscalls.nxnx_dsup_lib.nxnx_gate_verdict.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 ↻ gf_line ds_sappend gv_check gv_puts ↻ ds_conf_int ds_klen ds_key_at ds_atoi_at gf_hline gf_line ↻ ds_sappend ↻ ds_stat_ppid ds_stat_state_at ds_atoi_at ↻ ds_stat_state_at ↻ ds_trailer ds_sappend ↻ ds_decw ds_clamp0

structs

none

consts

16const GF_FIX_CAP: i64 = 4096
17const GF_NAS_COMMENT_LINES: i64 = 24 // enough copies of a ~90 B comment to pass 1 KB, the live conf's shape
18const GF_HASH: i64 = 35 // the comment byte; the lexer forbids it inside string literals

functions

20func gf_line(buf: *u8, w: i64, s: *u8) -> i64 { var o: i64 = ds_sappend(buf, w, s); buf[o] = 10 as u8; return o + 1 }
called by 2: gf_hlinemain calls 1: ds_sappend
21func gf_hline(buf: *u8, w: i64, s: *u8) -> i64 { buf[w] = GF_HASH as u8; return gf_line(buf, w + 1, s) }
called by 1: main calls 1: gf_line
23func gf_has(hay: *u8, n: i64, needle: *u8) -> i64
called by 1: main calls 1: ds_key_at
29func main() -> i64