code wiki / _hdl_build / nx_classifier_sync_register.nx
nx_classifier_sync_register.nx source
↩ module page · 42 lines · 3133 B
1// nx_classifier_sync_register.nx -- records the drift gate + the census sync it forced. Engineer
2// gate = sync GREEN + library 5/5 + classifier 20/20 + warden 7/7. Registered via Librarian alloc +
3// dual-write. license_tier: ORIGINAL
4import "nx_cap_register.nx"
5import "nx_capreg_librarian.nx"
6import "nx_syscalls.nx"
7
8func csr_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 csr_run("/tmp/_css.elf" as *u8) != 0 { allok = 0 }
25 if csr_run("/tmp/_plt.elf" as *u8) != 0 { allok = 0 }
26 if csr_run("/tmp/_plc.sov.elf" as *u8) != 0 { allok = 0 }
27 if csr_run("/tmp/_wbt.sov.elf" as *u8) != 0 { allok = 0 }
28 cr_w(1, "ENGINEER: sync gate + library + classifier + 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 idx: i64 = cl_next_idx(lp, jp)
36 let ok: i64 = cl_register_dual(lp, jp, idx, 5,
37 2, "VER CLASSIFIER-SYNC (pattern-census drift gate + the 14-shape sync it forced) -- the library grows from MULTIPLE concurrent arcs and the census/classifier silently fell behind (emitters at shape 14, census stuck at 10). nx_classifier_sync scans nx_pattern_emit*.nx headers for their '(shape N' claims (emitters = ground truth) and FAILS unless pl_n_patterns AND plc_max_covered cover the max claim; durable verdict knowledge/status/classifier_sync.log; pulse-able. PROVEN evidence-driven: first run RED(14/10/10) on the REAL drift -> Builder synced (library consts 11-14 MATH_KERNEL/WIRE_TLV/STRUCT_WALK/IO_CONTRACT + classifier traits IN_COEFFS/IN_FRAMED + 4 ordered rows) -> re-run GREEN(14/14/14); library 5/5, classifier 20/20. BONUS: Warden dispatch wired for WIRE_TLV+STRUCT_WALK (warden gate 7/7: _wb_ext TLS-ext walker + _wb_walk ClientHello field-sequence ADMITTED-HANDS-OFF one-command, autonomy 833 over 6-spec batch; pe8 refusal rail correctly rejected the first malformed table = cross-arc rails work). NAMED DEBT: MATH_KERNEL/IO_CONTRACT bespoke author contracts -> WB_DISPATCH_DEBT verdict keeps the gap visible. Composes classify(268)/warden_build(275)/emit6-9 (concurrent arcs)" 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 -- census drift now self-detecting\n" as *u8)
40 sys_exit(0)
41 return 0
42}