code wiki / (root) / nx_crew_selfheal.nx

nx_crew_selfheal.nx

buildroot/runtime/nx_crew_selfheal.nx

4862 B109 linesdepth 3pulls 4 transitivereach 1 importersview sourcekind tooltopic crew
docsdependenciesstructsconstsfunctions

about

nx_crew_selfheal.nx -- the SAFE-ACT loop: the crew doesn't just SEE a problem, it FIXES it, bounded by the Warden. The full cycle, collaborating: 1. DETECT (Engineer) -- measure the compiler-health car (nx_run_timeout) 2. AUTHORIZE(Warden) -- warden_authorize() against the cardinals 3. HEAL (Doctor) -- swap the pinned known-good over the poisoned binary 4. VERIFY (Engineer) -- re-measure; the fix is real or it isn't This is the literal mechanism of a one-step autonomous fix -- and it's SAFE because step 2 gates step 3. Proven on a SANDBOX copy of the compiler (no collision with the live shared binary a concurrent session is improving); pointing it at the live compiler is one const + the operator's call. Composes nx_run_timeout (measure) + nx_warden_lib (authorize). Sovereign. license_tier: ORIGINAL

dependencies 2 imports · 1 importers

nx_run_timeout.nx nx_warden_lib.nx nx_crew_selfheal.nx nx_conductor_heal.nx

imports: nx_run_timeout.nxnx_warden_lib.nx

imported by: nx_conductor_heal.nx

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

main sh_puts sh_measure nx_run_timeout sys_now_ms sys_mmap sys_clock_gettime_mono sys_fork sys_openat_wr sys_dup3 nx_rt_alarm sys_execve sys_exit sys_mmap ↻ sys_wait4 wait_exit_code sh_putn warden_authorize warden_check w_is_build_artifact w_contains w_audit sys_openat_append w_wstr sys_write w_kind_name sys_close sh_copy sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close ↻ sys_openat_wr ↻ sh_write_all

structs

none

consts

19const SH_KG: *u8 = "/mnt/c/Users/elder/nishi-core/nxc2/_offc/nx_cc_known_good.elf"
20const SH_SANDBOX: *u8 = "/mnt/c/Users/elder/nishi-core/nxc2/_offc/_sandbox_cc.elf"
21const SH_CANARY: *u8 = "/mnt/c/Users/elder/nishi-core/nxc2/runtime/nx_slice_contour.nx"
22const SH_TIMEOUT_MS: i64 = 8000
23const SH_MODE_EXEC: i64 = 493

functions

25func sh_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != 0 as u8 { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: mainmain
26func sh_putn(n: i64) -> i64
called by 2: mainmain
36func sh_measure(compiler: *u8, elapsed_out: *i64) -> i64
called by 2: mainmain calls 1: nx_run_timeout
43func sh_write_all(fd: i64, buf: *u8, len: i64) -> i64
called by 1: sh_copy
54func sh_copy(from: *u8, to: *u8) -> i64
68func main() -> i64