code wiki / (root) / nx_torrent_access_gate.nx

nx_torrent_access_gate.nx

buildroot/runtime/nx_torrent_access_gate.nx

4948 B68 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic torrent
docsdependenciesstructsconstsfunctions

about

nx_torrent_access_gate.nx -- referee for the torrent download/stream AREA access policy. PROVES the operator's rule as a deny-by-default / fail-closed decision matrix: AREA_SFW ("media", required FAMILY 1): owner(3) ALLOW, family(1) ALLOW, anon(0) DENY, junk DENY AREA_NSFW ("gallery", required OWNER 3): owner(3) ALLOW, family(1) DENY <-- the leak-check, anon DENY UNKNOWN area: DENY even for owner (no download to a bogus destination) GREEN iff every row matches (liar-kill: a single family->NSFW ALLOW = an NSFW LEAK to a normal user = RED). Prints verdict=GREEN to STDOUT *and* returns the exit code (0=pass) -- so a stdout sweep never reads "empty". Durable verdict -> knowledge/status/torrent_access_gate.log. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_torrent_access.nx nx_torrent_access_gate.nx

imports: nx_torrent_access.nx

imported by: nobody (leaf or entry point)

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

main g_puts chk g_puts ↻ g_num nx_taccess_required_level nx_taccess_allow nx_taccess_required_level ↻ g_num ↻ sys_openat_append g_w g_wn

structs

none

consts

none

functions

11func g_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: chkmain
12func g_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 }
called by 2: chkmain
13func g_w(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 }
called by 1: main
14func g_wn(fd: i64, 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(fd,bb,k); return 0 }
called by 1: main
17func chk(got: i64, want: i64, label: *u8) -> i64
called by 1: main calls 2: g_putsg_num
23func main() -> i64