code wiki / _hdl_build / nx_rungrun_register.nx

nx_rungrun_register.nx source

↩ module page · 42 lines · 3322 B

1// nx_rungrun_register.nx -- registers the MATH-ARC AUTORUN organ via the 2// Librarian. ENGINEER evidence = a full LIVE re-run of the runner itself 3// (which rebuilds and re-gates every rung from source, tamper proofs included) 4// -- the most expensive register in the arc, and exactly the point: the grade 5// IS the re-run. 6// license_tier: ORIGINAL 7import "nx_cap_register.nx" 8import "nx_capreg_librarian.nx" 9import "nx_syscalls.nx" 10 11func rrr_run(path: *u8) -> i64 { 12 let pid: i64 = sys_fork() 13 if pid == 0 { 14 let dn: i64 = sys_openat_wr("/dev/null" as *u8, 0x1a4) 15 if dn >= 0 { sys_dup3(dn, 1, 0); sys_dup3(dn, 2, 0) } 16 let argv: *i64 = sys_mmap(32) as *i64; argv[0] = path as i64; argv[1] = 0 17 let envp: *i64 = sys_mmap(16) as *i64; envp[0] = 0 18 sys_execve(path, argv, envp); sys_exit(127) 19 } 20 let st: *i64 = sys_mmap(16) as *i64 21 sys_wait4(pid, st, 0) 22 return st[0] 23} 24 25func main() -> i64 { 26 var allok: i64 = 1 27 if rrr_run("/tmp/nx_math_rung_run.sov.elf" as *u8) != 0 { allok = 0 } 28 cr_w(1, "ENGINEER: full autonomous re-verify of all math rungs pass=" as *u8); cr_wn(1, allok); cr_w(1, "\n" as *u8) 29 let eng: i64 = ig_engineer(1, 1, 1, allok) 30 let dec: i64 = ig_decision(eng, ig_council(eng, 1, 1, 2), 1) 31 if dec != IG_INGEST { cr_w(1, "HELD\n" as *u8); sys_exit(1) } 32 if cr_can_register(5, 2, 6, dec) != 1 { cr_w(1, "REFUSED\n" as *u8); sys_exit(1) } 33 let lp: *u8 = "/tmp/nishi_cap_registry.log" as *u8 34 let jp: *u8 = "knowledge/status/cap_registry_durable.log" as *u8 35 let idx: i64 = cl_next_idx(lp, jp) 36 let ok: i64 = cl_register_dual(lp, jp, idx, 5, 37 2, "GEN MATH-ARC AUTORUN ORGAN -- the math engine now RE-PROVES ITSELF hands-off (autonomy rung: what Claude hand-drove all session is a team organ): nx_math_rung_run reads the DATA table knowledge/specs/math_rungs.tsv (rule 11: new rung = new ROW -- gamma/erf land by adding a line, zero new orchestration) and per rung runs spec-emitter -> kernel-emitter -> invariant test -> oracle self-anchor gate -> live-oracle ULP gate -> MECHANICAL tamper proof (nx_tamper_lit flips the MIDDLE digit of the rung's load-bearing literal = 2^-32 relative, guaranteed multi-thousand-ulp; per-rung litskip column encodes the weak-tamper lesson: quantization-only constants like 2/pi and 1/ln2 are skipped because their corruption hides except within 2^-23 of rounding boundaries) -> gate must go RED -> regenerate from the emitter -> gate must return GREEN; ends with evidence-derived scorecard refresh + AUTORUN row appended to math_engine.log. PROVEN LIVE: 5 rungs (sincos/atan/pow/tan/sinhcosh) x 8 sovereign-lane builds = 41 compiles, all stages ok, tamper-proofs 5/5 RED-then-GREEN, scorecard ch4=1000 overall=588 re-derived. Register evidence = a SECOND full re-run. NEXT autonomy rung NAMED: MATH_GATE emitter (GATE_AUTHORING shape) -- all 3 defects this session were in HAND-WRITTEN gates (unmasked >>63, flat identity bars, raw-literal slips); an emitter with the proven helper templates baked in retires that bug class. Composes CAPREG276/307/335/360/368" as *u8) 38 if ok != 1 { cr_w(1, "DUAL-WRITE FAILED\n" as *u8); sys_exit(1) } 39 cr_w(1, "CAPREG idx=" as *u8); cr_wn(1, idx); cr_w(1, " REGISTERED (math-arc autorun organ)\n" as *u8) 40 sys_exit(0) 41 return 0 42}