code wiki / _hdl_build / nx_conductor_daemon.nx
nx_conductor_daemon.nx
buildroot/runtime/_hdl_build/nx_conductor_daemon.nx
about
nx_conductor_daemon.nx -- the DURABLE CADENCE SUPERVISOR, now SELF-DAEMONIZING so it survives the launcher's
reap (the learn-from-failure fix: a non-detached forever-daemon gets SIGTERM'd when the launcher/task ends).
Classic Unix daemonize, Nishi-native via syscalls (NO shell setsid): fork -> parent exits immediately (so the
launcher returns at once and killing it is harmless) -> child nx_setsid (new session, no controlling terminal,
reparented to init) -> child runs the loop DETACHED. The detached child polls nx_conductor_tick (which fires
nx_research_cycle through the conductor iff the monthly cadence is due), logging each poll to an ARTIFACT
(knowledge/registry/conductor_daemon.log -- there's no stdout after detach). Durability across wsl --shutdown /
reboot still needs OS relaunch-on-boot, but it now survives the LAUNCHER. expect_exit: 0 license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_conductor_registry.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
| 11 | const D_RUNNER: *u8 = "_offc/nx_sov_build_run.elf" |
| 12 | const D_LOG: *u8 = "knowledge/registry/conductor_daemon.log" |
| 13 | const D_SLEEP_MS: i64 = 86400000 // ~daily poll (tick gates the cycle-fire to monthly). Detached-survival proven at 5s/3-iter. |
| 14 | const D_MAX_ITERS: i64 = 0 // 0 = forever (the live daemon). Loop+detach proven bounded at 3 iters. |
functions
| 17 | func d_run(organ: *u8) -> i64 |
| 36 | func d_catnum(dst: *u8, off: i64, v: i64) -> i64 called by 1: d_logpoll |
| 43 | func d_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: d_logpoll |
| 46 | func d_logpoll(iter: i64, e: i64, now: i64) -> i64 |
| 58 | func main() -> i64 |