code wiki / _hdl_build / nx_infomgmt_imar_register.nx
nx_infomgmt_imar_register.nx source
↩ module page · 41 lines · 3332 B
1// nx_infomgmt_imar_register.nx -- registers INFOMGMT IM-AR (archive time-travel
2// reader) via the Librarian (cl_next_idx allocation + dual-write). ENGINEER
3// evidence = the full INFOMGMT gate re-run here (/tmp/nx_infomgmt_gate.sov.elf,
4// 14 rows incl. the new archive-time-travel; instrument-tamper RED proven).
5// license_tier: ORIGINAL
6import "nx_cap_register.nx"
7import "nx_capreg_librarian.nx"
8import "nx_syscalls.nx"
9
10func iarr_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 iarr_run("/tmp/nx_infomgmt_gate.sov.elf" as *u8) != 0 { allok = 0 }
27 cr_w(1, "ENGINEER: INFOMGMT gate (14 rows incl archive-time-travel) 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-IM-AR ARCHIVE TIME-TRAVEL READER (the additive-history loop CLOSES: compaction retires segments without deleting them -- now they are READABLE again, not just preserved). ss_scan_all = every version of a key across ARCHIVED segments (manifest-archive.txt, chronological, src=0) then LIVE segments (src=1); the live fold-copy is reported honestly as its own row, never collapsed; built by factoring the proven walk into ss_manifest_file + ss_scan_seglist with ss_scan/ss_manifest as thin wrappers (existing 13 rows re-prove the refactor changed nothing). GATE row archive-time-travel: post-fold, cap:diora = archived v1+v2 BYTE-EXACT vs pre-fold history + live fold-copy w/ src labels 0/0/1; cap:search = archived put + archived TOMBSTONE + live TOMBSTONE (deletes preserved IN history); cap:fsync 2 rows; crash-written cap:ghost = 0 rows (never entered any manifest) -> INFOMGMT-GATE 14/14=1000; instrument-tamper (archive filename misdirect = history silently vanishes) RED 13/14 proven then reverted GREEN. nx_store_query grew histall <key> (ARCHIVED/LIVE labeled); LIVE census store: histall svc:gen-img = v0 ARCHIVED original + v1 LIVE fold-copy where hist showed only 1 version. EXCEED row vs SQL-class sharpened: not just history-never-destroyed but history-always-QUERYABLE across compaction. Composes CAPREG304 (IM2c) + CAPREG295 + CAPREG270-272. REMAINING named: IM7 EVAL/GENREC unification, bitpack/FST, tombstone-GC policy" 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 IM-AR archive time-travel)\n" as *u8)
39 sys_exit(0)
40 return 0
41}