code wiki / _hdl_build / nx_sov_import_lint.nx

nx_sov_import_lint.nx

buildroot/runtime/_hdl_build/nx_sov_import_lint.nx

4332 B81 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic sov
docsdependenciesstructsconstsfunctions

about

nx_sovereignty_audit.nx -- MECHANICAL "no python/sh/java/qemu on the program path" checker. Given a list of .nx source files, it reads each and flags two kinds of sovereignty leaks: (1) any import whose target is NOT a .nx module (a non-sovereign dependency) (2) any exec-target STRING LITERAL naming a third-party interpreter/tool -- "/bin/sh, "/bin/bash, "python, "qemu, "perl, "node, "ruby, "javac, ".jar, "/usr/bin/env (anchored on the opening quote so prose / comments mentioning incumbents do NOT false-positive; only actual string literals are caught) Exit 0 iff EVERY file is sovereign; 1 if any is flagged. This turns "we don't ship non-sovereign deps" from a promise into a repeatable gate (the gate's neg-control proves it actually detects a real leak = liar-kill). nx_sovereignty_audit <file1.nx> [file2.nx ...] license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_sov_import_lint.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 sa_puts sys_write sys_exit sa_audit sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close sa_puts ↻ sa_find sa_strlen sa_num sys_mmap ↻ sys_write ↻

structs

none

consts

none

functions

13func sa_puts(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 2: sa_auditmain calls 1: sys_write
14func sa_strlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: sa_find
15func sa_num(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m}; 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 }
called by 1: sa_audit calls 2: sys_mmapsys_write
16func sa_find(buf: *u8, n: i64, pat: *u8, start: i64) -> i64
called by 1: sa_audit calls 1: sa_strlen
24func sa_audit(path: *u8) -> i64
70func main(argc: i64, argv: *i64) -> i64