nx_conductor_live.nx
buildroot/runtime/nx_conductor_live.nx
about
nx_conductor_live.nx -- the Nishi CONDUCTOR, v3: the LIVE, WARDEN-GATED tick
that ticks the INVENTION ORGANS via the SOVEREIGN code path (NO .sh).
v1 (nx_conductor.nx) was OBSERVE-ONLY (measure canaries + journal, no Warden,
no action). v2 was LIVE+Warden-gated but dispatched each gate by fork+exec'ing
a .sh WRAPPER via /bin/bash -- the LAST non-sovereign part. v3 REMOVES that:
the beat now runs the invention organs (AUTHOR + VERIFY-BY-PROOF) directly via
the gr_gate shape ported INTO the Conductor (cl_run/cl_gate): fork+exec the
PINNED known-good compiler -> as -> ld -> nx_run_timeout, exit-code = verdict.
No /bin/bash, no .sh anywhere on the dispatch path -- argv[0] is the known-good
ELF / as / ld, never a shell. (Operator cardinal: sovereign NishiLang only.)
Each BEAT it (1) asks the WARDEN to authorize the additive verify/author-to-
memory action, then (2) ticks the two invention organs hang-safe (each stage,
including cc/as/ld, runs under a self-SIGALRM deadline so a looping build-
oracle or organ kills itself -- it cannot wedge the beat), and (3) journals the
verdict to the event bus -- on cadence, UNATTENDED. This flips the build->
verify->invent loop from "a human runs it" to "the crew ticks itself."
The Warden GATES, it does not rubber-stamp: each beat we show it ALLOW the
safe (additive, read-only) verify/author-to-MEMORY tick AND DENY a forbidden
source overwrite -- proving the cardinal gate is live in the loop (#13
additive-only). The author organ EMITs to MEMORY only; an EMIT-to-SOURCE would
be a W_OVERWRITE_SRC -> DENIED. The exit code itself proves the deny fired on
every beat (warden_denies must == CL_BEATS).
Composes nx_run_timeout (hang-safety + nx_rt_alarm) + nx_warden_lib (the
cardinal gate). Sovereign: raw syscalls, zero deps, ZERO shell. Bounded beats
(testable); the unbounded daemon is a config flip once this is trusted.
license_tier: ORIGINAL
dependencies 4 imports · 0 importers
imports: nx_run_timeout.nxnx_warden_lib.nxnx_win_ledger.nxnx_framed_append.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
| 37 | const CL_EVENTLOG: *u8 = "/mnt/c/Users/elder/nishi-core/nxc2/_offc/nx_crew_events.log" |
| 38 | const CL_GATE_TIMEOUT_MS: i64 = 12000 // per-organ RUN hang bound |
| 39 | const CL_BUILD_TIMEOUT_MS: i64 = 60000 // per cc/as/ld stage hang bound (compiler can loop) |
| 40 | const CL_CADENCE_MS: i64 = 500 // sleep between beats (short for the demo) |
| 41 | const CL_BEATS: i64 = 3 // bounded; unbounded daemon = config flip |
| 42 | const CL_MODE_FILE: i64 = 420 |
| 43 | const CL_NGATES: i64 = 2 // the two invention organs (author + verify-by-proof) |
| 47 | const CL_CC: *u8 = "/mnt/c/Users/elder/nishi-core/nxc2/_offc/nx_cc_known_good.elf" |
| 48 | const CL_AS: *u8 = "/usr/bin/as" |
| 49 | const CL_LD: *u8 = "/usr/bin/ld" |
| 51 | const CL_S: *u8 = "/tmp/nx_cl.s" |
| 52 | const CL_O: *u8 = "/tmp/nx_cl.o" |
| 53 | const CL_ELF: *u8 = "/tmp/nx_cl.elf" |
| 55 | const CL_REC_CAP: i64 = 256 // bounded event/heartbeat record (matches WMS-R0 RECCAP) |
| 56 | const CL_HB_CHANNEL: *u8 = "/mnt/c/Users/elder/nishi-core/nxc2/knowledge/status/wms_heartbeat.log" |
| 57 | const CL_CONDUCTOR_WS: i64 = 1 // the conductor's own workstream id in the heartbeat channel |
functions
| 59 | func cl_wstr(fd: i64, s: *u8) -> i64 called by 1: main |
| 65 | func cl_wnum(fd: i64, n: i64) -> i64 called by 1: main |
| 80 | func cl_hb_beat(seq: i64) -> i64 |
| 103 | func cl_run(path: *u8, argv: *i64, envp: *i64, out_path: *u8, timeout_ms: i64) -> i64 |
| 135 | func cl_gate(testnx: *u8, elapsed_out: *i64) -> i64 |
| 160 | func cl_event(beat: i64, label: *u8, verdict: *u8, ms: i64) -> i64 |
| 180 | func cl_journal_win(L: *NxWinLedger, repro_gate: *u8) -> i64 |
| 198 | func main() -> i64 |