code wiki / (root) / nx_galx_monitor.nx

nx_galx_monitor.nx

buildroot/runtime/nx_galx_monitor.nx

9428 B146 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic galx
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_galx_monitor.nx

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

main mp sys_write sys_mmap sys_openat_rd sys_read sys_close mfind mn sys_write ↻ sys_mmap ↻ sys_lseek mcat mexists sys_openat_rd ↻ sys_close ↻ sys_getdents64 dirent_reclen dirent_name mslen sys_exit

structs

none

consts

12const MON_MAGIC_524288: i64 = 524288
13const MON_MAGIC_65536: i64 = 65536
14const MON_MAGIC_1048576: i64 = 1048576
16const MON_BIG: i64 = 8388608 // 8MB read window (vid_paths ~4.3MB)
17const GX: *u8 = "/mnt/nas_ai/galx"
18const VIDTSV: *u8 = "/mnt/nas_ai/galx/knowledge/status/galx_vid_paths.tsv"
19const VIDOFF: *u8 = "/mnt/nas_ai/galx/knowledge/status/galx_vid_off.bin"
20const CIDTSV: *u8 = "/mnt/nas_ai/galx/knowledge/status/galx_cid_paths.tsv"
21const IMGDIR: *u8 = "/mnt/nas_ai/images"

functions

23func mp(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main calls 1: sys_write
24func 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 }
called by 1: main calls 2: sys_writesys_mmap
25func 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
26func 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
27func mexists(path: *u8) -> i64 { let fd: i64=sys_openat_rd(path); if fd<0{return 0} sys_close(fd); return 1 }
called by 1: main calls 2: sys_openat_rdsys_close
28func mslen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: main
30func main() -> i64