code wiki / _hdl_build / nx_conductor_daemon.nx

nx_conductor_daemon.nx

buildroot/runtime/_hdl_build/nx_conductor_daemon.nx

3888 B75 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind servicetopic conductor
docsdependenciesstructsconstsfunctions

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

nx_conductor_registry.nx nx_conductor_daemon.nx

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

main sys_fork nx_setsid d_run sys_fork ↻ sys_openat_wr sys_dup3 sys_execve sys_wait4 d_logpoll sys_openat_append d_cat d_catnum sys_now_realtime_sec sys_mmap sys_clock_gettime_real sys_sleep_ms sys_mmap ↻ sys_munmap

structs

none

consts

11const D_RUNNER: *u8 = "_offc/nx_sov_build_run.elf"
12const D_LOG: *u8 = "knowledge/registry/conductor_daemon.log"
13const D_SLEEP_MS: i64 = 86400000 // ~daily poll (tick gates the cycle-fire to monthly). Detached-survival proven at 5s/3-iter.
14const D_MAX_ITERS: i64 = 0 // 0 = forever (the live daemon). Loop+detach proven bounded at 3 iters.

functions

17func d_run(organ: *u8) -> i64
36func d_catnum(dst: *u8, off: i64, v: i64) -> i64
called by 1: d_logpoll
43func 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
46func d_logpoll(iter: i64, e: i64, now: i64) -> i64
called by 1: main calls 3: sys_openat_appendd_catd_catnum
58func main() -> i64