code wiki / (root) / nx_galx_media_census.nx

nx_galx_media_census.nx

buildroot/runtime/nx_galx_media_census.nx

7928 B153 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic galx
docsdependenciesstructsconstsfunctions

about

nx_galx_media_census.nx -- SOVEREIGN media-delivery census for the gallery (operator 2026-06-23: "most of the media wasnt working its not fast its not ai upscaling on demand ... dont use sh use our own nishi ecosystem"). Replaces the sh recon with a sovereign organ: reads the LIVE NAS state directly via syscalls (the NAS is mounted at /mnt/nas_ai = /volume1/ai on the box), samples coverage per media type, classifies WORKING/DEGRADED. No sh, no pipelines. license_tier: ORIGINAL IMAGE THUMBS : thumbs/<cid>.jpg present? (cold => /thumb falls back to full-res = slow grid) VIDEO POSTERS : <video>-poster.jpg present? (absent => /vidthumb 404 = blank video tile = "not working")

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_itoa_lib.nx nx_galx_media_census.nx

imports: nx_syscalls.nxnx_itoa_lib.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main mc_puts sys_write mc_strlen sys_mmap mc_read_prefix sys_openat_rd sys_read sys_close sys_exit mc_sample_thumbs sys_mmap ↻ mc_cat mc_exists sys_openat_rd ↻ sys_close ↻ mc_verd mc_pct mc_puts ↻ mc_putn nxi_out nxi_fd sys_mmap ↻ ccz_cat_num sys_write ↻ sys_munmap mc_pct ↻ mc_sample_posters mc_find sys_mmap ↻ mc_cat ↻ mc_exists ↻

structs

none

consts

11const MC_MAGIC_2048: i64 = 2048
13const MC_CAP: i64 = 524288 // 512KB bounded prefix (flaky-SMB tolerant; enough for the sample)
14const MC_SAMPLES: i64 = 60
15const MC_BASE: *u8 = "/mnt/nas_ai/galx"

functions

17func mc_strlen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: mc_puts
18func mc_puts(s: *u8) -> i64 { sys_write(1, s, mc_strlen(s)); return 0 }
called by 2: mc_verdmain calls 2: sys_writemc_strlen
23func mc_putn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
24func mc_cat(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 }
26func mc_find(buf: *u8, lo: i64, hi: i64, pat: *u8, pl: i64) -> i64
called by 1: mc_sample_posters
38func mc_read_prefix(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
45func mc_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 }
48func mc_sample_thumbs(buf: *u8, n: i64, out_tot: *i64) -> i64
called by 1: main calls 3: sys_mmapmc_catmc_exists
79func mc_sample_posters(buf: *u8, n: i64, out_tot: *i64) -> i64
called by 1: main calls 4: mc_findsys_mmapmc_catmc_exists
113func mc_pct(have: i64, tot: i64) -> i64 { if tot <= 0 { return 0 } return (have * 100) / tot }
called by 2: mc_verdmain
114func mc_verd(have: i64, tot: i64) -> i64
called by 1: main calls 2: mc_pctmc_puts
120func main() -> i64