code wiki / _hdl_build / nx_sovereign_format_census.nx
nx_sovereign_format_census.nx
buildroot/runtime/_hdl_build/nx_sovereign_format_census.nx
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
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
structs
| none |
consts
| 26 | const K_MAGIC_16384: i64 = 16384 |
| 27 | const K_MAGIC_1024: i64 = 1024 |
| 28 | const K_MAGIC_1048576: i64 = 1048576 |
functions
| 30 | func w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 31 | func 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 } |
| 32 | func 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 |
| 33 | func fc_lc(c: i64) -> i64 { if c>=65 { if c<=90 { return c+32 } } return c } called by 1: has_ci |
| 34 | func fc_pct(a: i64, b: i64) -> i64 { if b<=0 { return 0 } return (100*a)/b } |
| 36 | func 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 } |
| 39 | func has_ci(buf: *u8, len: i64, ndl: *u8) -> i64 |
| 52 | func has_write(buf: *u8, len: i64) -> i64 |
| 57 | func has_flat(buf: *u8, len: i64) -> i64 |
| 64 | func has_sov(buf: *u8, len: i64) -> i64 |
| 72 | func has_interop(buf: *u8, len: i64) -> i64 calls 1: has_ci |
| 78 | func is_violation(buf: *u8, len: i64) -> i64 |
| 85 | func read_gate(path: *u8, buf: *u8, cap: i64) -> i64 |
| 98 | func ends_nx(name: *u8, len: i64) -> i64 |
| 106 | func main() -> i64 calls 1: w |