nx_cc_guardian.nx
buildroot/runtime/nx_cc_guardian.nx
about
nx_cc_guardian.nx -- SOVEREIGN AUTONOMOUS compiler-health guardian.
A Nishi role-program (like nx_doctor), NOT a Claude actor. It owns its loop:
ENGINEER-measures -- compile a high-register-pressure CANARY with the active
compiler under a deadline (nx_run_timeout). known-good
does it in <1s; >10s == poisoned (loop/pathological).
DOCTOR-heals -- if active is poisoned AND the pinned known-good is
healthy, autonomously swap known-good -> active
(sovereign file copy, raw syscalls).
ENGINEER-verifies -- re-measure the active; confirm it is now healthy.
journals -- append the verdict (the regression-guard's honest trail).
This is the "Claude moves away from being the hands" step: the ecosystem keeps
its own substrate (the compiler) sound, autonomously. The durable root-fix of
the homing slowdown remains a Builder improvement; this is the standing
self-heal that keeps every Nishi project building meanwhile.
Composes runtime/nx_run_timeout.nx (the hang-detector). Sovereign: zero deps.
license_tier: ORIGINAL
dependencies 1 imports · 0 importers
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
structs
| none |
consts
| 23 | const G_ACTIVE: *u8 = "/mnt/c/Users/elder/nishi-core/nxc2/_offc/nx_compile_x86_native.elf" |
| 24 | const G_KNOWN_GOOD: *u8 = "/mnt/c/Users/elder/nishi-core/nxc2/_offc/nx_cc_known_good.elf" |
| 25 | const G_CANARY: *u8 = "/mnt/c/Users/elder/nishi-core/nxc2/runtime/nx_slice_contour.nx" |
| 26 | const G_JOURNAL: *u8 = "/mnt/c/Users/elder/nishi-core/nxc2/_offc/nx_cc_guardian_journal.tsv" |
| 27 | const G_CANARY_TIMEOUT_MS: i64 = 10000 // known-good <1s; >10s = poisoned |
| 28 | const G_MODE_EXEC: i64 = 493 // 0o755 |
| 29 | const G_MODE_FILE: i64 = 420 // 0o644 |
functions
| 31 | func g_puts(s: *u8) -> i64 called by 1: main |
| 37 | func g_putn(n: i64) -> i64 called by 1: main |
| 49 | func g_journal(status: *u8) -> i64 |
| 62 | func g_measure(compiler: *u8, elapsed_out: *i64) -> i64 |
| 73 | func g_write_all(fd: i64, buf: *u8, len: i64) -> i64 called by 1: g_heal |
| 85 | func g_heal() -> i64 |
| 100 | func main() -> i64 |