nx_galx_monitor.nx
buildroot/runtime/nx_galx_monitor.nx
about
nx_galx_monitor.nx -- SOVEREIGN media CONSISTENCY monitor (operator 2026-06-23: "the system still acts
odd ... new thumbnails in the old sort ... this type of stuff is the s class exceeds monitor see and
catch we want to get"). The s-class exceed = catch CORRECTNESS/CONSISTENCY drift that a liveness/uptime
probe is structurally BLIND to (SH0). Reads the LIVE NAS (mounted /mnt/nas_ai) + checks invariants;
each violation is CAUGHT + named. No sh; runs from WSL over the mount. license_tier: ORIGINAL
C1 VIDEO-CATALOG-CLEAN no #recycle (trash) paths in galx_vid_paths.tsv
C2 VIDEO-OFFSET-FRESH galx_vid_off.bin tsv_size == actual tsv size (else per-request full scan = slow)
C3 THUMB-COVERAGE deep (unbiased) sample of thumbs present (cold = full-res fallback = slow grid)
C4 IMAGE-INDEX-FRESH newest image date-dir on disk is reflected in the index (else new gens sort stale)
dependencies 1 imports · 0 importers
imports: nx_syscalls.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
| 12 | const MON_MAGIC_524288: i64 = 524288 |
| 13 | const MON_MAGIC_65536: i64 = 65536 |
| 14 | const MON_MAGIC_1048576: i64 = 1048576 |
| 16 | const MON_BIG: i64 = 8388608 // 8MB read window (vid_paths ~4.3MB) |
| 17 | const GX: *u8 = "/mnt/nas_ai/galx" |
| 18 | const VIDTSV: *u8 = "/mnt/nas_ai/galx/knowledge/status/galx_vid_paths.tsv" |
| 19 | const VIDOFF: *u8 = "/mnt/nas_ai/galx/knowledge/status/galx_vid_off.bin" |
| 20 | const CIDTSV: *u8 = "/mnt/nas_ai/galx/knowledge/status/galx_cid_paths.tsv" |
| 21 | const IMGDIR: *u8 = "/mnt/nas_ai/images" |
functions
| 23 | func mp(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 24 | func mn(v: i64) -> i64 { if v==0 { sys_write(1,"0" as *u8,1); return 0 } var m: i64=v; if m<0{sys_write(1,"-" as *u8,1);m=0-m} let d: *u8=sys_mmap(24); var k: i64=0; while m>0{d[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=k-1; while i>=0{let o: *u8=sys_mmap(1);o[0]=d[i];sys_write(1,o,1);i=i-1} return 0 } |
| 25 | func mcat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){dst[off+i]=s[i];i=i+1} return off+i } called by 1: main |
| 26 | func mfind(buf: *u8, lo: i64, hi: i64, pat: *u8, pl: i64) -> i64 { if pl==0{return 0-1} var i: i64=lo; while i+pl<=hi { var j: i64=0; while j<pl { if buf[i+j]!=pat[j]{j=pl+1}else{j=j+1} } if j==pl{return i} i=i+1 } return 0-1 } called by 1: main |
| 27 | func mexists(path: *u8) -> i64 { let fd: i64=sys_openat_rd(path); if fd<0{return 0} sys_close(fd); return 1 } |
| 28 | func mslen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } called by 1: main |
| 30 | func main() -> i64 |