code wiki / _hdl_build / nx_stackaudit_submit.nx
nx_stackaudit_submit.nx source
↩ module page · 26 lines · 1793 B
1// nx_stackaudit_submit.nx -- routes the stack-audit dashboard THROUGH THE PUBLISHER (the no-bypass
2// LAW intake), mirroring nx_ciq_submit. Dest = FAMILY-GATED /wiki/family/ (authz level>=2): the page
3// is an ops-internal surface (rung statuses + evidence-log paths) so it ships behind the family gate
4// by default; the operator can promote it public later. Policy "outward" => the governed loop HOLDS
5// at stage until the operator approval token exists (the publish checkpoint) -- no direct push, by
6// construction. Pre-req: nx_stackaudit_census run (emits web_assets/stack_audit.html, gate 8/8).
7// license_tier: ORIGINAL expect_exit: 0
8import "nx_syscalls.nx"
9import "nx_publisher.nx"
10
11func sw_(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
12func sn_(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 }
13
14func main() -> i64 {
15 sw_("=== nx_stackaudit_submit -- routing stack_audit.html through the publisher (family-gated wiki) ===\n" as *u8)
16 let r: i64 = pub_submit("web_assets/stack_audit.html" as *u8, "/wiki/family/stack_audit.html" as *u8, "nishifamily" as *u8, "ws_stackaudit" as *u8, "outward" as *u8)
17 sw_(" pub_submit web_assets/stack_audit.html -> /wiki/family/stack_audit.html rc=" as *u8); sn_(r)
18 if r == 1 {
19 sw_(" [QUEUED]\nSTACKAUDIT-SUBMIT verdict=GREEN (queued; governed loop holds at stage until the operator approval token)\n" as *u8)
20 sys_exit(0)
21 return 0
22 }
23 sw_(" [FAIL]\nSTACKAUDIT-SUBMIT verdict=RED\n" as *u8)
24 sys_exit(1)
25 return 1
26}