code wiki / _hdl_build / nx_sovereign_format_census.nx

nx_sovereign_format_census.nx

buildroot/runtime/_hdl_build/nx_sovereign_format_census.nx

11415 B221 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind tooltopic sovereign
docsdependenciesstructsconstsfunctions

about

nx_sovereign_format_census.nx -- the ENFORCEMENT SENSOR for the sovereign-information-management law ([[feedback-no-tsv-sovereign-seg-store]] / [[feedback-pure-nishi-infomgmt-no-sql]]): why do organs keep writing .tsv/.log/.txt internal state instead of nx_seg_store? Because NOTHING MEASURES IT. This closes that gap the same way the sensor-gap program closes gate blindness: walk runtime/_hdl_build, classify each organ's DATA PERSISTENCE, print the live debt, and GATE on no-backslide (a NEW flat-file writer = RED). CLASSIFY (per organ, from source): writes-flat-internal = (openat_wr | openat_append) AND (.tsv | .csv | .log | .txt) [almost never interop] sovereign = ss_commit | ss_add( | nx_seg_store | sov_put | nx_sov_ledger [the store] interop-boundary = writes .html | .json [served output = LEGIT] => VIOLATION = writes-flat-internal AND NOT sovereign (the pure debt: flat state, no sovereign path) PARTIAL = writes-flat-internal AND sovereign (mid-migration) SOVEREIGN = sovereign AND NOT writes-flat-internal CONSERVATIVE by design: .html/.json are NOT counted as violations (that is the legitimate interop boundary Nishi OS keeps for reading/serving the world's data) -- so the printed debt is a FLOOR, real debt is >=. SELF-LIAR-KILLED: a .tsv-writer fixture must classify VIOLATION; an ss_commit fixture SOVEREIGN; a served .html fixture must NOT be a violation (interop, not debt); determinism; unreadable file = counted, never fabricated. REGRESSION GATE stores its baseline SOVEREIGNLY via nx_sov_ledger (dogfoods the fix, NO .tsv): violations may not exceed baseline -> a new flat-file writer trips RED. Prints the debt regardless. Sovereign nx_cc->nxasm; CWD=nxc2 root. expect_exit: 0 license_tier: ORIGINAL

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_dirent.nx nx_fcntl.nx nx_sov_ledger.nx nx_sovereign_format_census.nx

imports: nx_syscalls.nxnx_dirent.nxnx_fcntl.nxnx_sov_ledger.nx

imported by: nobody (leaf or entry point)

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

main w sys_write

structs

none

consts

26const K_MAGIC_16384: i64 = 16384
27const K_MAGIC_1024: i64 = 1024
28const K_MAGIC_1048576: i64 = 1048576

functions

30func w(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
31func wn(v: i64) -> i64 { let b: *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{b[i]=t[k-1-i];i=i+1}; sys_write(1,b,k); return 0 }
32func fc_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: has_ci
33func fc_lc(c: i64) -> i64 { if c>=65 { if c<=90 { return c+32 } } return c }
called by 1: has_ci
34func fc_pct(a: i64, b: i64) -> i64 { if b<=0 { return 0 } return (100*a)/b }
36func byte_copy(dst: *u8, src: *u8, n: i64) -> i64 { var i: i64=0; while i<n { dst[i]=src[i]; i=i+1 } return 0 }
39func has_ci(buf: *u8, len: i64, ndl: *u8) -> i64
52func has_write(buf: *u8, len: i64) -> i64
called by 1: is_violation calls 1: has_ci
57func has_flat(buf: *u8, len: i64) -> i64
called by 1: is_violation calls 1: has_ci
64func has_sov(buf: *u8, len: i64) -> i64
called by 1: is_violation calls 1: has_ci
72func has_interop(buf: *u8, len: i64) -> i64
calls 1: has_ci
78func is_violation(buf: *u8, len: i64) -> i64
85func read_gate(path: *u8, buf: *u8, cap: i64) -> i64
98func ends_nx(name: *u8, len: i64) -> i64
106func main() -> i64
calls 1: w