code wiki / (root) / nx_forge_repair.nx

nx_forge_repair.nx

buildroot/runtime/nx_forge_repair.nx

8587 B226 linesdepth 10pulls 24 transitivereach 0 importersview sourcekind tooltopic forge
docsdependenciesstructsconstsfunctions

about

nx_forge_repair.nx -- the REPAIR CYCLE for the local coder (2026-07-16): take the best failed candidate (compiled+ran but wrong bytes = the closest miss), feed back ONLY what the MACHINE knows -- the program, the verdict "ran but wrong output", and the exact required output -- and ask the local 1.5B for a corrected program. Judged by the same byte-exact lane; a ledger record (localpass=) is written ONLY on green. Honesty: zero Claude-authored diagnosis in the prompt (no "you used undefined variables" hints); the model gets the same feedback a CI system would give. Rides the disk KV snapshot (minipack prefix cached; only the task+candidate+feedback suffix prefills). This is the autofix stage-4 shape: error -> regenerate. argv: [1]=candidate path (default knowledge/forge/fix/cand_mpT1.nx) [2]=maxnew (default 300) license_tier: ORIGINAL expect_exit: 0 (measurement organ)

dependencies 2 imports · 0 importers

nx_nofloat_serve_core.nx nx_forge.nx nx_forge_repair.nx

imports: nx_nofloat_serve_core.nxnx_forge.nx

imported by: nobody (leaf or entry point)

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

main std_putln std_puts std_slen sys_write rp_read sys_read rp_cat std_puts ↻ std_pdec sys_mmap std_itoa sys_mmap ↻ sys_write ↻ nsv_init_i8 nsv_init sys_now_ms sys_mmap ↻ sys_clock_gettime_mono nsv_log sys_write ↻ nf_pool nx_pool_new nx_hw_worker_count nx_hw_cpu_count sys_mmap ↻ nx_chan_new sys_mmap ↻ _nx_chan_cell sys_thread_create nx_thread_spawn nx_thread_spawn_fn sys_mmap ↻ sys_mmap ↻ nsv_load_meta sys_mmap ↻ nsv_log ↻ sys_read_file sys_openat_rd sys_lseek

structs

none

consts

12const K_MAGIC_65536: i64 = 65536
13const K_MAGIC_32768: i64 = 32768
14const K_MAGIC_16384: i64 = 16384
15const K_MAGIC_16000: i64 = 16000
16const K_MAGIC_30000: i64 = 30000

functions

18func rp_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 1: sys_read
35func rp_cat(buf: *u8, o: i64, s: *u8) -> i64
called by 1: main
43func rp_strip(src: *u8, n: i64, out: *u8) -> i64
called by 1: main
86func rp_write(path: *u8, buf: *u8, n: i64) -> i64
called by 1: main calls 1: sys_openat_wr
100func main(argc: i64, argv: *i64) -> i64