nx_autofix_localfix.nx
buildroot/runtime/nx_autofix_localfix.nx
about
nx_autofix_localfix.nx -- THE LOCAL MAKER TAKES STAGE 4 (2026-07-16). The proven autofix loop
(nx_autofix_gate, 6/6) has ONE Claude-authored piece left: the corrected line in stage [4 FIX].
This organ runs the SAME episode -- identify -> flag -> backup -> fix -> verify -> revert -- but the
fix CONTENT is GENERATED BY THE LOCAL 1.5B no-float model (i8 light init, greedy). The independent
grader (fresh compile+run, CGR=<pass>) remains the ONLY judge; a model echo or a broken line simply
fails [5 VERIFY] and the episode records an honest MAKER-MISS (curriculum), never a fake green.
HONEST SCOPE: bug LOCALIZATION is not attempted here -- the buggy line is the known seeded one (same
as the gate); what goes local in this rung is the fix GENERATION. Prompting is few-shot (two worked
examples of one-line function repairs); the max2 correction itself is the model's own completion.
On MAKER-GREEN it appends `CGB ts=<ts> generator=15b-autofix-localfix tasks=1 localpass=1` to the
codegen bench ledger -- the autograde target `local-codegen-green` (ge 1) then grades MET from a real
machine-verified artifact. Green-only: a miss writes the episode row but never a localpass row.
The loop itself must stay sound either way: backup before mutation, revert proven exact at the end.
exit: 0 = loop sound (maker green OR honest miss) | 1 = loop unsound (backup/revert/harness failure)
license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_tool_run.nxnx_propose_verify_lib.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
| 20 | const K_MAGIC_131072: i64 = 131072 |
| 21 | const K_MAGIC_262144: i64 = 262144 |
| 22 | const K_MAGIC_4000: i64 = 4000 |
| 23 | const K_MAGIC_1048576: i64 = 1048576 |
| 24 | const K_MAGIC_4096: i64 = 4096 |
functions
| 26 | 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 } |
| 27 | func wn(v: i64) -> i64 |
| 40 | func slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 42 | func find_first(hay: *u8, hn: i64, needle: *u8, from: i64) -> i64 |
| 55 | func find_last(hay: *u8, hn: i64, needle: *u8) -> i64 |
| 69 | func digit_at(hay: *u8, hn: i64, p: i64) -> i64 called by 1: build_run |
| 75 | func bcat(b: *u8, off: i64, s: *u8) -> i64 called by 1: main |
| 81 | func bcatn(b: *u8, off: i64, v: i64) -> i64 called by 1: main |
| 94 | func build_run(name: *u8, out: *u8, cap: i64) -> i64 |
| 108 | func copyfile(srcp: *u8, dstp: *u8) -> i64 |
| 119 | func apply_fix(path: *u8, finds: *u8, repls: *u8) -> i64 |
| 143 | func append_line(path: *u8, line: *u8, ln: i64) -> i64 |
| 159 | func lf_gen(pb: *u8, plen: i64, tx: *u8, mt: *i64, max_new: i64) -> i64 |
| 177 | func main(argc: i64, argv: *i64) -> i64 |