code wiki / _hdl_build / nx_infomgmt_im2c_register.nx

nx_infomgmt_im2c_register.nx source

↩ module page · 41 lines · 3504 B

1// nx_infomgmt_im2c_register.nx -- registers INFOMGMT IM2c (multi-term AND search) 2// via the Librarian (cl_next_idx allocation + dual-write). ENGINEER evidence = 3// the full INFOMGMT gate re-run here (/tmp/nx_infomgmt_gate.sov.elf, 13 rows 4// incl. the new multi-term-and-oracle; instrument-tamper RED proven this session). 5// license_tier: ORIGINAL 6import "nx_cap_register.nx" 7import "nx_capreg_librarian.nx" 8import "nx_syscalls.nx" 9 10func i2cr_run(path: *u8) -> i64 { 11 let pid: i64 = sys_fork() 12 if pid == 0 { 13 let dn: i64 = sys_openat_wr("/dev/null" as *u8, 0x1a4) 14 if dn >= 0 { sys_dup3(dn, 1, 0); sys_dup3(dn, 2, 0) } 15 let argv: *i64 = sys_mmap(32) as *i64; argv[0] = path as i64; argv[1] = 0 16 let envp: *i64 = sys_mmap(16) as *i64; envp[0] = 0 17 sys_execve(path, argv, envp); sys_exit(127) 18 } 19 let st: *i64 = sys_mmap(16) as *i64 20 sys_wait4(pid, st, 0) 21 return st[0] 22} 23 24func main() -> i64 { 25 var allok: i64 = 1 26 if i2cr_run("/tmp/nx_infomgmt_gate.sov.elf" as *u8) != 0 { allok = 0 } 27 cr_w(1, "ENGINEER: INFOMGMT gate (13 rows incl multi-term-and-oracle) pass=" as *u8); cr_wn(1, allok); cr_w(1, "\n" as *u8) 28 let eng: i64 = ig_engineer(1, 1, 1, allok) 29 let dec: i64 = ig_decision(eng, ig_council(eng, 1, 1, 2), 1) 30 if dec != IG_INGEST { cr_w(1, "HELD\n" as *u8); sys_exit(1) } 31 if cr_can_register(6, 2, 7, dec) != 1 { cr_w(1, "REFUSED\n" as *u8); sys_exit(1) } 32 let lp: *u8 = "/tmp/nishi_cap_registry.log" as *u8 33 let jp: *u8 = "knowledge/status/cap_registry_durable.log" as *u8 34 let idx: i64 = cl_next_idx(lp, jp) 35 let ok: i64 = cl_register_dual(lp, jp, idx, 6, 36 2, "GEN INFOMGMT-IM2c MULTI-TERM-AND (the store's search surface grows from one word to compound questions, NO SQL) -- ss_term_and: every term resolves through the per-segment .terms/.post postings index with the SAME current-state semantics as ss_term (stale versions + tombstones never answer; -2 fail-LOUD propagated on any old-format segment, never a silent partial answer); intersection by key bytes; per-term cap documented (size max >= live keys). GATE row multi-term-and-oracle: ORACLE = full scan ss_hget+ss_tok_has ALL terms per key (one tokenizer); 4 queries exercise tombstone exclusion (diora+production excludes tombstoned cap:search), CURRENCY (diora+functional: v1 had both, current v2 lost functional -> stale version must NOT answer), empty intersection, 3-term; teeth pin expected counts 1/1/0/1; membership re-verified per returned key; single-term AND == ss_term; compaction-equivalence row re-proves 3 AND answers across the fold -> INFOMGMT-GATE 13/13=1000; instrument-tamper (intersection -> keep-all) flipped BOTH rows RED 11/13 then reverted GREEN. nx_store_query front door grew: and <w1>..<w8> command; LIVE on census store: and gen img = exactly svc:gen-img, and gen vid = svc:gen-vid, and svc elder = 88 (every svc-* record is kind=elder-service = ground-truth cross-check), and svc zzznope = 0; REAL FIND fixed: term CLI cap 64 silently clipped term svc (true count 88) -> caps raised to 256 above the 149 live keys. Composes CAPREG295 (IM2b postings) + CAPREG270-272. REMAINING named: IM7 EVAL/GENREC unification, bitpack 128-blocks + FST dict, tombstone-GC, archive time-travel reader" as *u8) 37 if ok != 1 { cr_w(1, "DUAL-WRITE FAILED\n" as *u8); sys_exit(1) } 38 cr_w(1, "CAPREG idx=" as *u8); cr_wn(1, idx); cr_w(1, " REGISTERED (INFOMGMT IM2c multi-term AND)\n" as *u8) 39 sys_exit(0) 40 return 0 41}