code wiki / _hdl_build / nx_codec_provenance_gate.nx
nx_codec_provenance_gate.nx
buildroot/runtime/_hdl_build/nx_codec_provenance_gate.nx
about
nx_codec_provenance_gate.nx -- the BULLETPROOF patent-provenance LIAR-KILL over the WHOLE codec tool graph.
Operator law 2026-06-20: "we cant have any patent or other fallback -- the codec has to be bulletproof, S-class
exceed, NO legal issues." So this organ enforces, MECHANICALLY (never asserted as a promise -- cf. the never-brick
rule #26), that EVERY tool the codec uses is provably clean: EXPIRED patent / PUBLIC-DOMAIN / UNPATENTABLE-MATH /
OUR-OWN-NOVEL-CLEAN-ROOM. CRUCIAL STRICTNESS for "zero risk": UNKNOWN provenance counts as UNSAFE (not assumed
clean) and turns the verdict RED -- bulletproof means nothing ships on a maybe. NOVEL-clean-room tools are allowed
in the graph but FLAGGED counsel-required (this gate is provenance-by-construction EVIDENCE for the human lawyer's
FTO opinion; it does NOT itself render legal advice). Neg-controls prove it catches a patented tool (CABAC /
hyperprior) and an unknown one. GREEN iff 6/6. knowledge/status/codec_provenance_gate.log. license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_gate_emit_lib.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
| 13 | const PV_UNKNOWN: i64 = 0 // provenance not established -> UNSAFE |
| 14 | const PV_EXPIRED: i64 = 1 // patent expired (cite #/expiry) |
| 15 | const PV_PD: i64 = 2 // public domain (cite dedication/rejection) |
| 16 | const PV_UNPAT: i64 = 3 // unpatentable foundational math (>far past, or not patentable subject matter) |
| 17 | const PV_NOVEL: i64 = 4 // our own clean-room novel design (allowed, but counsel-required) |
| 18 | const PV_ACTIVE: i64 = 5 // active third-party patent -> FORBIDDEN |
functions
| 20 | func g_num(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 } |
| 21 | func g_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 } |
| 22 | func g_wn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; 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(fd,bb,k); return 0 } |
| 23 | func g_check(label: *u8, ok: i64) -> i64 { g_puts(label); if ok==1 { g_puts(" PASS\n" as *u8); return 1 } g_puts(" FAIL\n" as *u8); return 0 } |
| 25 | func is_clean(p: i64) -> i64 { if p>=1 { if p<=4 { return 1 } } return 0 } |
| 26 | func g_prov(p: i64) -> i64 |
| 32 | func tool(name: *u8, p: i64) -> i64 { g_puts(" - " as *u8); g_puts(name); g_puts(" : " as *u8); g_prov(p); g_puts("\n" as *u8); if is_clean(p)==1 { return 0 } return 1 } |
| 34 | func violations(prov: *i64, n: i64) -> i64 { var v: i64=0; var i: i64=0; while i<n { if is_clean(prov[i])==0 { v=v+1 } i=i+1 } return v } |
| 35 | func count_active(prov: *i64, n: i64) -> i64 { var a: i64=0; var i: i64=0; while i<n { if prov[i]==PV_ACTIVE { a=a+1 } i=i+1 } return a } called by 1: main |
| 36 | func count_novel(prov: *i64, n: i64) -> i64 { var a: i64=0; var i: i64=0; while i<n { if prov[i]==PV_NOVEL { a=a+1 } i=i+1 } return a } called by 1: main |
| 38 | func main() -> i64 |