code wiki / _hdl_build / nx_kanon_gate.nx

nx_kanon_gate.nx

buildroot/runtime/_hdl_build/nx_kanon_gate.nx

3004 B67 linesdepth 4pulls 6 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_kanon_gate.nx -- GATE (runnable) proving the k-anonymity floor primitive (nx_kanon). The foundation under ADS-018 + W-AN-CHARTER-002 / W-CLI-C6. K is read FROM THE SOVEREIGN STORE (adcfg:kanon_k -- pure Nishi, no conf file). Controls are parametrized by the configured K, and the load-bearing control proves the VIOLATION DETECTOR fires (anti-false-green): release: count==K and count>K and count==0 are releasable; count==K-1 and count==1 suppressed apply : over [K, K-1, 0, K+5] exactly ONE cell (K-1) is suppressed; released set has 0 leaks DETECT : a wrongly-"released" set containing K-1 makes kn_count_below FIRE (==1) -> proves the checker catches a leak; stuck-at-0 would RED-fail this control. Evidence -> knowledge/status/kanon_gate.log (KANON authored=organ cells_below_k=0 ... verdict=GREEN). license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_ad_store.nx nx_kanon.nx nx_syscalls.nx nx_kanon_gate.nx

imports: nx_ad_store.nxnx_kanon.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main ads_kanon_k sys_mmap ads_get ss_get sys_mmap ↻ ss_scan sys_mmap ↻ ss_manifest_dyn ss_manifest_file_dyn ss_scan_seglist ss_len sys_mmap ↻ ss_cat ss_readall ss_r32 kn_release sys_mmap ↻ kn_apply kn_release ↻ kn_count_below kg_emit kg_w sys_write kg_wn sys_mmap ↻ sys_write ↻ sys_openat_append sys_close

structs

none

consts

17const KG_LOG: *u8 = "knowledge/status/kanon_gate.log"

functions

19func kg_w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 }
called by 1: kg_emit calls 1: sys_write
20func kg_wn(fd: i64, v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64=v; if m<0 {m=0-m; sys_write(fd,"-" 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)) 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(fd, bb, k); return 0 }
called by 1: kg_emit calls 2: sys_mmapsys_write
22func kg_emit(fd: i64, k: i64, sup: i64, below: i64, fired: i64, ok: i64) -> i64
called by 1: main calls 2: kg_wkg_wn
31func main() -> i64