nx_daemon_supervisor_gate.nx
buildroot/runtime/nx_daemon_supervisor_gate.nx
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
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
structs
| none |
consts
| 16 | const GF_FIX_CAP: i64 = 4096 |
| 17 | const GF_NAS_COMMENT_LINES: i64 = 24 // enough copies of a ~90 B comment to pass 1 KB, the live conf's shape |
| 18 | const GF_HASH: i64 = 35 // the comment byte; the lexer forbids it inside string literals |
functions
| 20 | func 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 } |
| 21 | func gf_hline(buf: *u8, w: i64, s: *u8) -> i64 { buf[w] = GF_HASH as u8; return gf_line(buf, w + 1, s) } |
| 23 | func gf_has(hay: *u8, n: i64, needle: *u8) -> i64 |
| 29 | func main() -> i64 |