code wiki / (root) / nx_conductor.nx

nx_conductor.nx

buildroot/runtime/nx_conductor.nx

5161 B119 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic conductor
docsdependenciesstructsconstsfunctions

about

nx_conductor.nx -- the Nishi CONDUCTOR: the autonomic HEARTBEAT (sovereign). The role the come-alive gap implied: it makes the crew RUN itself. Each BEAT it measures the car grid (hang-safe, via nx_run_timeout), prints the pulse, and appends each verdict to the event-bus log (the blackboard seed) -- then sleeps the cadence. This is the tick that flips the crew from "a charter a human pokes" to ALIVE. v1 is OBSERVE-ONLY: it measures + journals, it does NOT auto-heal or auto-commit. Autonomous ACTION (Doctor-heal, Builder-commit) is deliberately withheld until the WARDEN bounds it (capability-trust + cardinal enforcement). Live, but safe. Beats are bounded (not an infinite daemon) so it is testable; v2 = unbounded daemon once the Warden is in. Composes runtime/nx_run_timeout.nx. Sovereign: raw syscalls, zero deps. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_run_timeout.nx nx_conductor.nx

imports: nx_run_timeout.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main c_wstr sys_now_ms sys_mmap sys_clock_gettime_mono c_wnum c_measure nx_run_timeout sys_now_ms ↻ sys_fork sys_openat_wr sys_dup3 nx_rt_alarm sys_execve sys_exit sys_mmap ↻ sys_wait4 wait_exit_code c_event sys_openat_append c_wstr ↻ c_wnum ↻ sys_sleep_ms sys_mmap ↻ sys_munmap

structs

none

consts

19const C_MAGIC_10000: i64 = 10000
21const C_ACTIVE: *u8 = "/mnt/c/Users/elder/nishi-core/nxc2/_offc/nx_compile_x86_native.elf"
22const C_EVENTLOG: *u8 = "/mnt/c/Users/elder/nishi-core/nxc2/_offc/nx_crew_events.log"
23const C_BEAT_TIMEOUT_MS: i64 = 6000 // known-good does any car <1s; >6s = poisoned
24const C_CADENCE_MS: i64 = 1000 // sleep between beats (short for the demo)
25const C_BEATS: i64 = 3 // bounded (v2 = unbounded daemon, post-Warden)
26const C_MODE_FILE: i64 = 420 // 0o644

functions

28func c_wstr(fd: i64, s: *u8) -> i64
called by 2: c_eventmain
34func c_wnum(fd: i64, n: i64) -> i64
called by 2: c_eventmain
47func c_measure(canary: *u8, elapsed_out: *i64) -> i64
called by 1: main calls 1: nx_run_timeout
58func c_event(beat: i64, car: *u8, verdict: *u8, ms: i64) -> i64
called by 1: main calls 3: sys_openat_appendc_wstrc_wnum
70func main() -> i64