code wiki / _hdl_build / nx_plane_repair_gate.nx
nx_plane_repair_gate.nx
buildroot/runtime/_hdl_build/nx_plane_repair_gate.nx
about
nx_plane_repair_gate.nx -- proves nx_plane_repair actually repairs, on a DELIBERATELY DAMAGED plane.
★WHY THIS GATE HAD TO EXIST BEFORE THE TOOL COULD BE TRUSTED. nx_plane_repair shipped with only its
NO-OP and REFUSAL paths exercised (a healthy plane declines correctly). The path that actually writes --
the one that permanently accepts data loss and rewrites the ecosystem's ledger -- was CODE-REVIEWED, NOT
MEASURED. This whole workstream exists to delete exactly that distinction, so leaving it would have been
the largest hypocrisy in it.
★THE FIXTURE IS THE HARD PART, and it is why this could not be tested earlier: `sts_seed` ALWAYS writes a
correct q:n, so the damage it repairs is unreachable through the normal writer. The gate therefore builds
the damaged plane from the RAW store primitives -- ss_add of 5 real rows, then a q:n that LIES and says 8.
That reproduces the exact live shape (declared > reachable) without waiting for a real outage.
It forks the REAL promoted elf rather than calling a library, so what is proven is the artifact that
actually runs. license_tier: ORIGINAL expect_exit: 0
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_store_seed_lib.nxnx_artifact_root.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 PG_FIXROWS: i64 = 5 |
| 21 | const PG_LIE: i64 = 8 |
functions
| 23 | 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 } |
| 24 | func wn(v: i64) -> i64 { let t: *u8=sys_mmap(28); var m: i64=v; var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} let b: *u8=sys_mmap(28); var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1} sys_write(1,b,k); return 0 } |
| 25 | func ck(pass: i64, label: *u8, fails: *i64) -> i64 |
| 32 | func pg_make_damaged(prefix: *u8, rows: i64, lie: i64) -> i64 |
| 55 | func pg_run(prefix: *u8, confirm: *u8) -> i64 |
| 83 | func main() -> i64 |