code wiki / _hdl_build / nx_compare_registry_assemble.nx
nx_compare_registry_assemble.nx
buildroot/runtime/_hdl_build/nx_compare_registry_assemble.nx
about
nx_compare_registry_assemble.nx -- SOTA durability: the /compare registry SELF-ASSEMBLES from ground truth so
the multi-session-contention staleness bug (a stale local subset regenerates a hub that DROPS other sessions'
cards) CANNOT recur (operator 2026-07-10: "do sota"). Reconciles against the LIVE hub (fetched over sovereign
TLS = the real 41-card ground truth), extracting every card back into a registry line (title|kind|href|radar|
stat), then UNIONs any local *.matrix domain not already present. The result can only GROW. LIAR-KILL: the
assembled registry MUST carry >= the live hub's card count (a regression aborts, never writes). Writes
knowledge/compare/registry_full (candidate SSOT). Downstream: regen hub FROM it, verify >= live, publish w/
rollback. license_tier: ORIGINAL expect_exit: 0
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_x509_trust_store.nxnx_trust_store_load_from_certdata.nxnx_https_fetch_follow.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 13 | const K_MAGIC_4194304: i64 = 4194304 |
| 14 | const K_MAGIC_262144: i64 = 262144 |
| 15 | const K_MAGIC_4096: i64 = 4096 |
| 16 | const K_MAGIC_8192: i64 = 8192 |
| 17 | const K_MAGIC_16384: i64 = 16384 |
functions
| 19 | func w(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 } |
| 20 | func wn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(fd,"-" as *u8,1)} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1} sys_write(fd,bb,k); return 0 } |
| 21 | func slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } called by 1: findf |
| 23 | func findf(hay: *u8, from: i64, n: i64, needle: *u8) -> i64 |
| 29 | func count_in(hay: *u8, n: i64, needle: *u8) -> i64 { var c: i64=0; var p: i64=0; var q: i64=findf(hay,p,n,needle); while q>=0 { c=c+1; q=findf(hay,q+1,n,needle) } return c } calls 1: findf |
| 31 | func app(dst: *u8, off: i64, src: *u8, s: i64, len: i64) -> i64 { var i: i64=0; while i<len { dst[off+i]=src[s+i]; i=i+1 } return off+len } |
| 32 | func apstr(dst: *u8, off: i64, str: *u8) -> i64 { var i: i64=0; while str[i]!=(0 as u8){dst[off+i]=str[i];i=i+1} return off+i } |
| 33 | func write_file(path: *u8, buf: *u8, n: i64) -> i64 { let fd: i64=sys_openat_wr(path,420); if fd<0{return 0-1} sys_write(fd,buf,n); sys_close(fd); return n } |
| 34 | func read_file(path: *u8, buf: *u8, cap: i64) -> i64 { let fd: i64=sys_openat_rd(path); if fd<0{return 0-1} var tot: i64=0; while tot<cap { let r: i64=sys_read(fd,(buf as i64+tot) as *u8,cap-tot); if r<=0{break} tot=tot+r } sys_close(fd); return tot } |
| 36 | func main() -> i64 |