code wiki / _hdl_build / nx_unified_conductor.nx
nx_unified_conductor.nx
buildroot/runtime/_hdl_build/nx_unified_conductor.nx
about
nx_unified_conductor.nx -- THE UNIFIED AUTONOMY-LOOP CONDUCTOR: warden-gated AND resource-governed AND
closing REPORT->LOG-NEXT, in ONE beat. Resolves the "two loop drivers" incoherence found by nx_loop_census:
nx_conductor_live (runtime/) = WARDEN-gated but FIXED cadence (ungoverned = the 20fps-hard-cap anti-pattern)
nx_governed_autoloop (_hdl_build/) = RESOURCE-governed but NOT warden-gated
This composes BOTH proven halves + my REPORT->LOG-NEXT bridge into one canonical cycle. Lives in _hdl_build/
because (empirically proven by nx_import_probe, Rule 2) a _hdl_build/ organ CAN import both _hdl_build/ organs
(the governor) AND runtime/ organs (the warden + eval-queue) -- so no governor is inline-duplicated (which
would be the copy-paste anti-pattern this project's own catalog forbids).
EACH BEAT: SENSE host (nx_sysload) -> GOVERN (nx_resource_governor: run only if the polite budget is free,
else AIMD back off) -> if free, WARDEN-gate the action (nx_warden_lib: ALLOW additive, DENY a source
overwrite -- proving the cardinal gate is live) -> if allowed, do a bounded REPORT->LOG-NEXT (queue an
evaluator gap via nx_eval_queue, additive to an isolated store). Journals each beat.
SAFE BY CONSTRUCTION: BOUNDED beats (UC_BEATS, testable -- NOT the unbounded daemon; that stays a deliberate
later flip), ADDITIVE only (writes an isolated eval-gaps queue + a journal, never a source file -- the warden
DENIES that), resource-POLITE (yields to live serving + backs off over the load ceiling), NO Claude in the
loop. Also demonstrates the BACK-OFF path at a simulated-busy load (politeness proven, not asserted).
license_tier: ORIGINAL genealogy_id: operator-2026-07-03-ultimate-loop + unify(nx_conductor_live, nx_governed_autoloop)
lineage_id: nishi_unified_conductor_v1 expect_exit: 0
dependencies 7 imports · 0 importers
imports: nx_syscalls.nxnx_sysload.nxnx_resource_governor.nxnx_warden_lib.nxnx_council_gate.nxnx_eval_queue.nxnx_win_ledger.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
| 28 | const UC_MAGIC_4096: i64 = 4096 |
| 30 | const UC_BEATS: i64 = 3 // bounded/testable; unbounded daemon = a deliberate later config flip |
| 31 | const UC_CEIL_MILLI: i64 = 800 // polite ceiling: back off when load > 0.8 core/cpu (HPA-style headroom) |
| 32 | const UC_MEM_FLOOR_MB: i64 = 256 |
| 33 | const UC_JOURNAL: *u8 = "knowledge/status/unified_conductor.log\x00" |
functions
| 35 | func uc_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 36 | func uc_putn(v: i64) -> i64 |
| 45 | func uc_file_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 } |
| 51 | func uc_fire_research(url: *u8, name: *u8) -> i64 |
| 70 | func uc_fire_god_cycle() -> i64 |
| 86 | func uc_budget(ncpu: i64, load: i64, freemb: i64, conns: i64) -> i64 |
| 93 | func main() -> i64 |