code wiki / (root) / nx_autofix_gate.nx

nx_autofix_gate.nx

buildroot/runtime/nx_autofix_gate.nx

12998 B249 linesdepth 5pulls 8 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 3 imports · 0 importers

nx_tool_run.nx nx_gate_verdict.nx nx_stage_path.nx nx_autofix_gate.nx

imports: nx_tool_run.nxnx_gate_verdict.nxnx_stage_path.nx

imported by: nobody (leaf or entry point)

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

main sp_skip_unless sp_present sys_openat_rd sys_close sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sp_root sp_resolve_root sp_env sys_openat_rd ↻ sys_mmap ↻ sys_read sys_close ↻ sp_match sp_take_value sp_slen sp_conf ep_open_rd sys_openat_rd ↻ sys_mmap ↻ ep_join sys_mmap ↻ sys_read ↻ sys_close ↻ sp_match ↻ sp_take_value ↻

structs

none

consts

none

functions

23func 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
24func wn(v: i64) -> i64
called by 1: main calls 1: w
37func slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
40func find_first(hay: *u8, hn: i64, needle: *u8, from: i64) -> i64
called by 1: apply_fix calls 1: slen
54func find_last(hay: *u8, hn: i64, needle: *u8) -> i64
called by 1: build_run calls 1: slen
69func digit_at(hay: *u8, hn: i64, p: i64) -> i64
called by 1: build_run
77func build_run(name: *u8, out: *u8, cap: i64) -> i64
92func copyfile(srcp: *u8, dstp: *u8) -> i64
called by 1: main
104func apply_fix(path: *u8, finds: *u8, repls: *u8) -> i64
called by 1: main calls 2: slenfind_first
127func main() -> i64