code wiki / _hdl_build / nx_rungrade_register.nx

nx_rungrade_register.nx source

↩ module page · 40 lines · 2941 B

1// nx_rungrade_register.nx -- registers the B0 rung-grade instrument + queue 2// health via the Librarian. Evidence = both organs re-run live. 3// license_tier: ORIGINAL 4import "nx_cap_register.nx" 5import "nx_capreg_librarian.nx" 6import "nx_syscalls.nx" 7 8func rgr_run(path: *u8) -> i64 { 9 let pid: i64 = sys_fork() 10 if pid == 0 { 11 let dn: i64 = sys_openat_wr("/dev/null" as *u8, 0x1a4) 12 if dn >= 0 { sys_dup3(dn, 1, 0); sys_dup3(dn, 2, 0) } 13 let argv: *i64 = sys_mmap(32) as *i64; argv[0] = path as i64; argv[1] = 0 14 let envp: *i64 = sys_mmap(16) as *i64; envp[0] = 0 15 sys_execve(path, argv, envp); sys_exit(127) 16 } 17 let st: *i64 = sys_mmap(16) as *i64 18 sys_wait4(pid, st, 0) 19 return st[0] 20} 21 22func main() -> i64 { 23 var allok: i64 = 1 24 if rgr_run("/tmp/nx_rung_grade.sov.elf" as *u8) != 0 { allok = 0 } 25 if rgr_run("/tmp/nx_queue_health.sov.elf" as *u8) != 0 { allok = 0 } 26 cr_w(1, "ENGINEER: rung-grade + queue-health live re-run pass=" as *u8); cr_wn(1, allok); cr_w(1, "\n" as *u8) 27 let eng: i64 = ig_engineer(1, 1, 1, allok) 28 let dec: i64 = ig_decision(eng, ig_council(eng, 1, 1, 2), 1) 29 if dec != IG_INGEST { cr_w(1, "HELD\n" as *u8); sys_exit(1) } 30 if cr_can_register(5, 2, 6, dec) != 1 { cr_w(1, "REFUSED\n" as *u8); sys_exit(1) } 31 let lp: *u8 = "/tmp/nishi_cap_registry.log" as *u8 32 let jp: *u8 = "knowledge/status/cap_registry_durable.log" as *u8 33 let idx: i64 = cl_next_idx(lp, jp) 34 let ok: i64 = cl_register_dual(lp, jp, idx, 5, 35 2, "GEN B0 RUNG-GRADE INSTRUMENT + QUEUE HEALTH -- the S-class-exceed ladder GRADES ITSELF from evidence (the program's keystone card, was prose until now): nx_rung_grade reads knowledge/specs/rung_gates.tsv (examiner_arcs grammar reused: rung/gatelog/anchor/green-pattern; every seeded row verified against a LIVE log first) and derives one dated RUNGGRADE row per rung from the LAST anchor line -- FIRST ROWS IN HISTORY: R1/R4/R5/R6/R7/R8 GREEN, R3 RED (browser, in-flight named owner), R0/R2 ABSENT (the craters said aloud); all three grade kinds proven on REAL evidence first run, matching the hand assessment that seeded the program; bench=/feat= NONE until P-panels (no-overclaim). Reporter-exit=0 by the examiner circular-latch lesson (a red RUNG is evidence for owners, not a grading failure that wedges the pulse). Pulse step 23 = the whole hardware-up ladder re-graded every 30 minutes. nx_queue_health: 119-row queue audited per beat (status counts + DEP-DRIFT detector for unresolvable dep ids = the silently-never-unblocks class), GREEN. Queue rows X-B0-001/002 X-Q-002/002b/004 flipped DONE on their gate markers; sequencer advanced to X-B0-003. Composes CAPREG388/389" as *u8) 36 if ok != 1 { cr_w(1, "DUAL-WRITE FAILED\n" as *u8); sys_exit(1) } 37 cr_w(1, "CAPREG idx=" as *u8); cr_wn(1, idx); cr_w(1, " REGISTERED (B0 rung-grade + queue health)\n" as *u8) 38 sys_exit(0) 39 return 0 40}