code wiki / _hdl_build / nx_sreach_r2_register.nx
nx_sreach_r2_register.nx source
↩ module page · 51 lines · 4576 B
1// nx_sreach_r2_register.nx -- GOVERNED registration of SREACH R2 (bits-up facet
2// classifier + content-accessibility axis) and SREACH R4 (durable reach loop).
3// Engineer gate = the three elfs built THIS invocation (facet gate 46/46, reach
4// leaderboard exceed x2, reach pulse GREEN) all exit 0; Council admits; Librarian
5// allocs via cl_next_idx (never a manual idx -- the collision lesson) + dual-writes
6// live+journal. license_tier: ORIGINAL
7import "nx_cap_register.nx"
8import "nx_capreg_librarian.nx"
9import "nx_syscalls.nx"
10
11func srr_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 srr_run("/tmp/nx_facet_gate.sov.elf" as *u8) != 0 { allok = 0 }
28 if srr_run("/tmp/nx_diora_leaderboard.sov.elf" as *u8) != 0 { allok = 0 }
29 if srr_run("/tmp/nx_search_reach_pulse.sov.elf" as *u8) != 0 { allok = 0 }
30 cr_w(1, "ENGINEER: facet gate + reach leaderboard + reach pulse all-pass=" as *u8); cr_wn(1, allok); cr_w(1, "\n" as *u8)
31 let eng: i64 = ig_engineer(1, 1, 1, allok)
32 let dec: i64 = ig_decision(eng, ig_council(eng, 1, 1, 2), 1)
33 if dec != IG_INGEST { cr_w(1, "HELD\n" as *u8); sys_exit(1) }
34 if cr_can_register(5, 2, 6, dec) != 1 { cr_w(1, "REFUSED\n" as *u8); sys_exit(1) }
35 let lp: *u8 = "/tmp/nishi_cap_registry.log" as *u8
36 let jp: *u8 = "knowledge/status/cap_registry_durable.log" as *u8
37
38 let idx1: i64 = cl_next_idx(lp, jp)
39 let ok1: i64 = cl_register_dual(lp, jp, idx1, 5,
40 2, "GEN SREACH-R2 FACET-CLASSIFIER + CONTENT-ACCESSIBILITY AXIS (arc=SREACH). The oracle-from-gold facet leak is RETIRED: nx_facet_classify.nx derives the 7-facet label from URL/host/title signals alone (host-BOUNDED domain match -- gate caught people.com matching inside thefamouspeople.com, fixed generically; signal classes reuse the research-verified tier tables, zero per-doc rules) -- gate nx_facet_gate 46/46 permil=1000 (bar 900) -> search_facets.log. Ranking now fuses the operator's CONTENT-ACCESSIBILITY directive (engagement/media/info-density 'like Yandex prioritizes media sites, not first-hand alone'): nx_facet_content_value per-facet engagement table + media-richness title boost, weight 0.5 in nx_bench_nishi_rank. EVIDENCE-DRIVEN CATCH: first run floated commons.wikimedia Category:Diora_Baird (gold=N) to slot 10 = OffG 0.0999 regression; transparency top-10 print verified it is the media-richest page from OUR OWN R1+ crawl (106 term hits, suppressed by every mainstream engine) -> gold EXTENDED to 46 on crawl evidence (json+nx in sync, provenance documented), never score-driven. RESULT: reach gate GREEN with NO gold in ranking, nDCG 0.9467 MAP 0.9630 Alt 0.8733 ALL above pre-R2 baseline, Prim 0.7999 held, OffG 0.0000, Reach 0.2173 = 2x best incumbent, top-10 = 10/10 gold + all 7 facets + interviews #3 + 5 media slots" as *u8)
41 if ok1 != 1 { cr_w(1, "DUAL-WRITE-1 FAILED\n" as *u8); sys_exit(1) }
42 cr_w(1, "CAPREG idx=" as *u8); cr_wn(1, idx1); cr_w(1, " REGISTERED -- SREACH R2 facet classifier + content axis\n" as *u8)
43
44 let idx2: i64 = cl_next_idx(lp, jp)
45 let ok2: i64 = cl_register_dual(lp, jp, idx2, 4,
46 2, "CON SREACH-R4 DURABLE REACH LOOP (arc=SREACH; the team OWNS search reach). nx_search_reach_pulse = Conductor pulse step re-proving BOTH search gates every beat (facet gate + reach/exceed leaderboard, offline-deterministic; live-network crawls stay per-arc by design) -> appends SREACH-PULSE verdict row to search_reach.log (NTFS-durable); self-healing tp_run pattern (absent /tmp binary -> durable nx_sov_build_run rebuild, no exec-127 false reds). Wired: nx_team_pulse step 11 (beat proven 12 steps, SREACH OK) + examiner_arcs.conf row SREACH (Examiner grades GREEN from the LAST verdict row, proven live 11-arc table). Reach is now re-proven per-BEAT not per-session: any regression in ranking/facet/scoring turns the arc RED on the next pulse with zero human driving" as *u8)
47 if ok2 != 1 { cr_w(1, "DUAL-WRITE-2 FAILED\n" as *u8); sys_exit(1) }
48 cr_w(1, "CAPREG idx=" as *u8); cr_wn(1, idx2); cr_w(1, " REGISTERED -- SREACH R4 durable reach loop\n" as *u8)
49 sys_exit(0)
50 return 0
51}