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