code wiki / (root) / nx_autofix_gate.nx

nx_autofix_gate.nx

buildroot/runtime/nx_autofix_gate.nx

12875 B247 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/prooftopic autofix
docsdependenciesstructsconstsfunctions

about

nx_autofix_gate.nx -- THE AUTONOMOUS PROACTIVE FIX LOOP (operator 2026-07-15: "that was the point of all these lanes"): identify a bug ON ITS OWN proactively -> FLAG for operator review+approval -> go all the way to FIX -> with a REVERT capability -> and GRADED objectively by an INDEPENDENT system (the machine that compiles+runs the code), NOT by Claude's opinion. This is the backbone of "how good we are" until the nishi coach takes over more and more. The loop, every stage grade coming from the MACHINE (compile+run), never from Claude: 1 IDENTIFY fork-build+run the candidate, the objective grader reports pass<full => a real bug (proactive) 2 FLAG write the finding to an APPROVAL QUEUE -- NOT auto-applied; the operator approves via MCP/API 3 BACKUP copy the source to .bak -- the REVERT capability, established BEFORE any mutation 4 FIX targeted patch (buggy line -> correct line), applied to the real source 5 VERIFY fork-build+run again; the SAME independent grader must now report full pass (fix confirmed) 6 REVERT restore the .bak; grader must report the ORIGINAL score again (revert proven exact) Teeth (all machine-checked, not asserted): T1 IDENTIFY found the bug (grader pass0 < 3) T2 FLAGGED to approval queue BEFORE any file mutation T3 FIX verified by the independent grader (pass1 == 3) T4 REVERT restores exactly (pass2 == pass0) T5 the loop NEVER trusted Claude for a verdict (every gate = a fresh compile+run) T6 episode persisted (living) expect_exit: 0 license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_tool_run.nx nx_gate_verdict.nx nx_autofix_gate.nx

imports: nx_tool_run.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

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

main w sys_now_realtime_sec sys_mmap sys_clock_gettime_real build_run tr_run_capture sys_mmap ↻ sys_pipe2 sys_fork sys_close sys_dup3 sys_execve_clean sys_close ↻ sys_execve sys_exit sys_read sys_wait4 wait_exit_code find_last slen digit_at wn w ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read ↻ sys_close ↻ sys_openat_wr copyfile sys_read_file ↻ sys_openat_wr ↻ apply_fix sys_read_file ↻ slen ↻ find_first slen ↻ sys_openat_wr ↻

structs

none

consts

none

functions

22func w(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: wnmain
23func wn(v: i64) -> i64
called by 1: main calls 1: w
36func slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
39func find_first(hay: *u8, hn: i64, needle: *u8, from: i64) -> i64
called by 1: apply_fix calls 1: slen
53func find_last(hay: *u8, hn: i64, needle: *u8) -> i64
called by 1: build_run calls 1: slen
68func digit_at(hay: *u8, hn: i64, p: i64) -> i64
called by 1: build_run
76func build_run(name: *u8, out: *u8, cap: i64) -> i64
91func copyfile(srcp: *u8, dstp: *u8) -> i64
called by 1: main calls 2: sys_read_filesys_openat_wr
103func apply_fix(path: *u8, finds: *u8, repls: *u8) -> i64
126func main() -> i64