code wiki / (root) / nx_adversarial_list.nx

nx_adversarial_list.nx source

↩ module page · 27 lines · 1489 B

1// nx_adversarial_list.nx -- introspect the ADVERSARIAL GATE SUITE straight from the sovereign store 2// (knowledge/store/adversarial). READER-ONLY: no migrate, never touches the .conf -- so running this with the 3// migrate-source .conf ABSENT and still getting the full suite is the proof the STORE is the SSOT (store-law). 4// A tiny tool surface: `nx_adversarial_list` -> the gate names + count, one per line. license_tier: ORIGINAL 5import "nx_adversarial_sov.nx" 6import "nx_syscalls.nx" 7const K_MAGIC_65536: i64 = 65536 8 9func lp(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } 10func ln(v: i64) -> i64 { 11 let t: *u8=sys_mmap(24); var m: i64=v; var k: i64=0 12 if m==0 { t[0]=48 as u8; k=1 } 13 while m>0 { t[k]=(48+(m%10)) as u8; m=m/10; k=k+1 } 14 let o: *u8=sys_mmap(24); var i: i64=0; while i<k { o[i]=t[k-1-i]; i=i+1 } sys_write(1,o,k); return 0 15} 16 17func main() -> i64 { 18 lp("=== nx_adversarial_list: adversarial gate suite FROM knowledge/store/adversarial (sovereign SSOT) ===\n" as *u8) 19 let cnt: i64 = ag_count() 20 let buf: *u8 = sys_mmap(K_MAGIC_65536) 21 let n: i64 = ag_read_all(buf, K_MAGIC_65536) 22 if n > 0 { sys_write(1, buf, n) } 23 lp("--- " as *u8); ln(cnt); lp(" gates (read from the store; independent of the .conf migrate-source) ---\n" as *u8) 24 if cnt <= 0 { lp("EMPTY store -> re-seed via nx_adversarial_sov_gate (migrates from the .conf)\n" as *u8); sys_exit(1); return 1 } 25 sys_exit(0) 26 return 0 27}