code wiki / _hdl_build / nx_plane_repair_gate.nx

nx_plane_repair_gate.nx

buildroot/runtime/_hdl_build/nx_plane_repair_gate.nx

8474 B171 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind gate/prooftopic plane
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_store_seed_lib.nx nx_artifact_root.nx nx_plane_repair_gate.nx

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

main sys_mmap w sys_write pg_make_damaged ss_begin_cap sys_mmap ↻ sys_mmap ↻ sts_rowkey ss_catn sys_mmap ↻ ss_add ss_add2 ss_w32 ss_len ss_commit ss_segid_ok sys_mmap ↻ ss_cat ss_catn ↻ sys_write ↻ ss_write_seg ss_segid_ok ↻ sys_mmap ↻ ss_cat ↻ ss_catn ↻ sys_write ↻ ss_segname ss_cat ↻ ss_catn ↻ ss_writefile sys_openat_wr sys_write ↻ sys_close sys_fsync sys_renameat ss_build_keys sys_mmap ↻ ss_r32 ss_kcmp

structs

none

consts

20const PG_FIXROWS: i64 = 5
21const PG_LIE: i64 = 8

functions

23func w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 2: ckmain calls 1: sys_write
24func 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 }
called by 1: main calls 2: sys_mmapsys_write
25func ck(pass: i64, label: *u8, fails: *i64) -> i64
called by 1: main calls 1: w
32func pg_make_damaged(prefix: *u8, rows: i64, lie: i64) -> i64
55func pg_run(prefix: *u8, confirm: *u8) -> i64
83func main() -> i64