code wiki / _hdl_build / nx_sov_tree_audit.nx
nx_sov_tree_audit.nx
buildroot/runtime/_hdl_build/nx_sov_tree_audit.nx
about
nx_sov_tree_audit.nx -- WHOLE-TREE sovereignty census. Recursively walks a directory root (getdents64 +
newfstatat, so it works even where d_type is DT_UNKNOWN on DrvFs), and:
- every .nx file: scans for non-sovereign markers (exec-target string-literals "/bin/sh,"python,"qemu,... +
non-.nx imports) -> counts sovereign vs FLAGGED, lists the flagged organs (the program-path worklist)
- every non-.nx SOURCE file (.sh/.py/.java/.jar/.go/.js/.ts/.rb/.pl/.class/.c/.cpp): counts by extension
- vendored trees (node_modules/.git/.alelane) are recorded but NOT descended (bounded + honest)
This turns "do we have hidden python/sh/java anywhere" into a repeatable mechanical census. It does NOT use
sys_read_file (that reserves ~4GB/call -> OOM over thousands of files); it reads into ONE reused buffer.
nx_sov_tree_audit [root] (default ".")
license_tier: ORIGINAL
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 K_MAGIC_16384: i64 = 16384 |
| 13 | const K_MAGIC_65536: i64 = 65536 |
| 14 | const K_MAGIC_4194304: i64 = 4194304 |
functions
| 16 | func ta_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 17 | func ta_num(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" 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(1,bb,k); return 0 } |
| 18 | func ta_strlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 19 | func ta_eq(a: *u8, b: *u8) -> i64 { var i: i64=0; while a[i]!=(0 as u8){ if a[i]!=b[i]{return 0} i=i+1 } if b[i]!=(0 as u8){return 0} return 1 } called by 1: main |
| 21 | func ta_ends(path: *u8, pl: i64, ext: *u8) -> i64 |
| 25 | func ta_find(buf: *u8, n: i64, pat: *u8, start: i64) -> i64 |
| 32 | func ta_join(dst: *u8, dir: *u8, name: *u8) -> i64 called by 1: main |
| 40 | func ta_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 46 | func ta_getdents(fd: i64, buf: *u8, count: i64) -> i64 { return __syscall(217, fd, buf, count, 0, 0, 0) } called by 1: main |
| 48 | func ta_isdir(path: *u8, st: *u8) -> i64 called by 1: main |
| 57 | func ta_check_nx(path: *u8, buf: *u8, n: i64, M: *i64, mc: i64) -> i64 |
| 90 | func main(argc: i64, argv: *i64) -> i64 |