code wiki / _hdl_build / nx_secret_scan_gate.nx

nx_secret_scan_gate.nx

buildroot/runtime/_hdl_build/nx_secret_scan_gate.nx

9331 B221 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind gate/prooftopic secret
docsdependenciesstructsconstsfunctions

about

nx_secret_scan_gate.nx -- re-runnable GATE for nx_secret_scan + the self-manage closure. (Engineer verb: VERIFY. Team-built, hardware up -- replaces a bash gate, per operator law: no sh/py; capabilities are built INTO the team.) KATs (fixture work uses an ALT issues log in /tmp so the production signal stream the sentinel watches is never polluted by plants): K1 clean tree -> scan(alt) exit 0 K2 planted PW-literal fixture -> scan(alt) exit 1 K3 alt issues log NAMES the planted file with the PLAINTEXT-SECRET marker K4 fixture removed -> scan(alt2) exit 0 again (returns-to-green, tree left clean) K5 planted EMPTY literal (PW="" shred idiom) -> exit 0 (intelligence: hygiene != leak) Then the SELF-MANAGE closure: P1 production scan (real issues log). GREEN posture required for gate green. P2 if prod is green and the issues-log count grew past the last SENTINEL-RESOLVE mark, append "SENTINEL-RESOLVE key=PLAINTEXT-SECRET at=<count>" (idempotent: only when count > mark) -- the Engineer's verify IS the resolve evidence. P3 re-run the security sentinel to refresh posture (its verdict is its own; reported). Exit 0 = 4/4 KATs + prod GREEN. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_secret_scan_gate.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 _p sys_write gg_unlink gg_run sys_fork sys_mmap sys_execve sys_exit sys_wait4 _pn sys_mmap ↻ sys_write ↻ sys_mmap ↻ gg_cat gg_write sys_openat_wr sys_write ↻ gg_slen sys_close gg_read sys_openat_rd sys_read sys_close ↻ gg_count gg_slen ↻ gg_max_marked gg_slen ↻ sys_openat_append sys_write ↻ sys_close ↻ sys_exit ↻

structs

none

consts

21const GG_BUF_MAX: i64 = 4194304
22const AT_FDCWD: i64 = 0 - 100

functions

24func _p(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 1: main calls 1: sys_write
25func _pn(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;k=1}; while m>0{t[k]=48+(m%10);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: main calls 2: sys_mmapsys_write
26func gg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
27func gg_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 }
called by 1: main
30func gg_read(path: *u8, buf: *u8) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
45func gg_count(buf: *u8, n: i64, pat: *u8) -> i64
called by 1: main calls 1: gg_slen
62func gg_max_marked(buf: *u8, n: i64, prefix: *u8) -> i64
called by 1: main calls 1: gg_slen
96func gg_run(path: *u8, a1: *u8) -> i64
116func gg_write(path: *u8, content: *u8) -> i64
124func main() -> i64