code wiki / _hdl_build / nx_wb_dispatch_register.nx
nx_wb_dispatch_register.nx source
↩ module page · 42 lines · 3177 B
1// nx_wb_dispatch_register.nx -- GOVERNED registration of the Warden dispatch-debt
2// closure. Engineer evidence = the four gate elfs built THIS invocation exit 0.
3// license_tier: ORIGINAL
4import "nx_cap_register.nx"
5import "nx_capreg_librarian.nx"
6import "nx_syscalls.nx"
7
8func wdr_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 wdr_run("/tmp/nx_pattern_library_test.elf" as *u8) != 0 { allok = 0 }
25 if wdr_run("/tmp/nx_pattern_classify_test.elf" as *u8) != 0 { allok = 0 }
26 if wdr_run("/tmp/nx_classifier_sync.elf" as *u8) != 0 { allok = 0 }
27 if wdr_run("/tmp/nx_warden_build_test.elf" as *u8) != 0 { allok = 0 }
28 cr_w(1, "ENGINEER: library + classifier + sync + warden all-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 idx1: i64 = cl_next_idx(lp, jp)
36 let ok1: i64 = cl_register_dual(lp, jp, idx1, 5,
37 2, "SELF WARDEN-DISPATCH-DEBT-PAID: MATH_KERNEL + TEMPLATE_TABLE now ONE-COMMAND (autonomy 875->900 measured). Found while wiring: shape 17 (emit12, parallel session) fell through wb_author to BP_REJECTED -- a lying verdict (route absent, not spec bad); wired pe12_author_template_table (p=rows-ptr,nrows; mid=NULL single-slot landmine respected). MATH_KERNEL's bespoke modfile arg PROVEN DERIVABLE (= the authored module's own file name) -> pe6_author_logf64 wired (p=oracle-spec-ptr,ncoef): the team authored a WORKING f64 NATURAL LOG from the real _pm_log_spec (mpmath@60dps) through wb_build, Engineer-verified, ADMITTED-HANDS-OFF (_wb_mathk). _wb_tmpl (escaped-p + raw-b rows) ADMITTED. Honest remainder: IO_CONTRACT (no module+test pair for wb_verify) + SCAFFOLD stay DISPATCH-DEBT verdicts. ALSO: library census test moved to the BOUNDARY LAW (pl_covered(census)==1, census+1==0) -- the hardcoded count went stale at EVERY growth (15 broke at emit11, 16 at emit12); classify test got the same treatment from the parallel session (cross-session convergence on the same lesson). Gates ALL GREEN: library 5/5, classifier 24/24, sync 17/17/17, warden 11/11 (9 ADMITTED + 1 honest NEEDS_TUTOR = autonomy 900). bash _wb_dispatch_run" as *u8)
38 if ok1 != 1 { cr_w(1, "DUAL-WRITE FAILED\n" as *u8); sys_exit(1) }
39 cr_w(1, "CAPREG idx=" as *u8); cr_wn(1, idx1); cr_w(1, " REGISTERED -- warden dispatch debts paid\n" as *u8)
40 sys_exit(0)
41 return 0
42}