code wiki / _hdl_build / nx_fixflywheel.nx
nx_fixflywheel.nx
buildroot/runtime/_hdl_build/nx_fixflywheel.nx
about
nx_fixflywheel.nx -- THE HEREDITY RATCHET (bugforge-swe-scale, 2026-07-24). Evolution needs the
genome to GROW across generations: every machine-verified green becomes teaching data for the next.
This organ harvests verified (buggy->fixed) pairs and folds them into bf_fixcorpus ADDITIVELY,
de-duped, so generation N+1 always inherits from a LARGER survivor pool than generation N.
SOURCE = a MINED manifest (name|path rows) whose instances the maker resolved GREEN. For each row
it reads the emitted candidate's header (// src=<origpath> op=<label>), recovers the buggy fn (the
candidate's own mutant, under its real name) and the ORACLE fixed fn (the original at src), and
appends `buggy TAB fixed` (multi-line via the 0x01 sentinel, matching nx_fixshot_lib). CONTRACT:
only append a pair that fsl_shots would accept (fixed != buggy) AND that is not already present
(exact-row de-dup) -- the ratchet is monotone + idempotent (re-run adds nothing new). This is the
same additive+preload+dedup discipline the seq756 wipe taught (never REPLACE a live genome).
verbs: harvest <manifest> <ledger> | selftest
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 2 imports · 0 importers
imports: nx_tool_run.nxnx_syscalls.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
| 19 | const FW_FCAP: i64 = 262144 |
| 20 | const FW_CORCAP: i64 = 524288 |
| 21 | const FW_TCAP: i64 = 4096 |
| 22 | const FW_ZERO: i64 = 48 |
| 23 | const FW_MODE: i64 = 420 |
functions
| 25 | 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 } |
| 26 | func wn(v: i64) -> i64 |
| 39 | func slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 40 | func sfind(hay: *u8, hn: i64, needle: *u8, from: i64) -> i64 |
| 53 | func fw_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 66 | func fw_write(path: *u8, buf: *u8, n: i64) -> i64 |
| 74 | func fw_extract(src: *u8, n: i64, name: *u8, dst: *u8) -> i64 |
| 107 | func fw_green(led: *u8, ln: i64, cand: *u8) -> i64 |
| 136 | func fw_oplen(inst: *u8, n: i64) -> i64 |
| 156 | func fw_one(iname: *u8, ipath: *u8) -> i64 |
| 215 | func fw_harvest(manp: *u8, ledp: *u8) -> i64 |
| 278 | func fw_selftest() -> i64 |
| 306 | func main(argc: i64, argv: *i64) -> i64 |