code wiki / _hdl_build / nx_ciq_sclass_gate.nx
nx_ciq_sclass_gate.nx
buildroot/runtime/_hdl_build/nx_ciq_sclass_gate.nx
about
nx_ciq_sclass_gate.nx -- "check if it hits s class exceed" (operator). Grades the 3-modality CIQ publish
bundle (human/ai/machine) for S-CLASS EXCEED on READABILITY + INTEGRITY, measured not asserted:
1. MODALITY COVERAGE: all 3 artifacts exist + non-empty (human html, ai md, machine records).
2. FAITHFULNESS (the integrity core): parse EVERY machine record and cross-check its execute/vision
against the SOVEREIGN seg_store (ss_get the independent score record). 100% must match -- a single
hallucinated/drifted number fails the gate. This is the anti-overclaim guarantee BY CONSTRUCTION.
3. HUMAN guard-readiness: epoch= freshness stamp present, NO placeholder (TODO/PLACEHOLDER/lorem).
4. AI structure: every market named + machine-parseable claim lines.
S-CLASS EXCEED vs the analyst baseline (1 modality = human PDF, unverifiable numbers, 3rd-party format):
ours = 3 modalities + faithfulness-VERIFIED + sovereign format. EXCEED on >=1 axis with parity on the
rest = S-class (mirrors nx_wiki_exceed's honest parity+exceed rule). Honest BEHIND + worklist otherwise.
100% sovereign. license_tier: ORIGINAL expect_exit: 0
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_canon_cid.nxnx_seg_store.nxnx_uxf_decode.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
| 18 | const SG_STORE: *u8 = "knowledge/store/ciq-" |
| 19 | const SG_HUMAN: *u8 = "knowledge/staging/ciq_report.html" |
| 20 | const SG_AI: *u8 = "knowledge/staging/ciq_report_ai.md" |
| 21 | const SG_MACHINE: *u8 = "knowledge/staging/ciq_report_machine.nxr" |
functions
| 23 | func sw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 24 | func 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 } |
| 25 | func g_streq(a: *u8, b: *u8) -> i64 { var i: i64=0; while a[i]!=(0 as u8){ if a[i]!=b[i]{return 0} i=i+1 } if b[i]!=(0 as u8){return 0} return 1 } called by 1: g_field |
| 26 | func g_pint(s: *u8) -> i64 { var v: i64=0; var i: i64=0; var go: i64=1; while go==1 { let c: i64=s[i]; if c>=48 { if c<=57 { v=v*10+(c-48); i=i+1 } else { go=0 } } else { go=0 } } return v } called by 1: main |
| 27 | func g_field(dk: *i64, dv: *i64, nf: i64, name: *u8) -> *u8 { var f: i64=0; while f<nf { if g_streq(dk[f] as *u8, name)==1 { return dv[f] as *u8 } f=f+1 } return 0 as *u8 } |
| 28 | func g_read(path: *u8, buf: *u8, cap: i64) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 - 1 } var n: i64 = 0; var r: i64 = 1; while r > 0 { r = sys_read(fd, ((buf as i64)+n) as *u8, cap - n); if r > 0 { n = n + r } } sys_close(fd); buf[n] = 0 as u8; return n } |
| 29 | func g_contains(hay: *u8, n: i64, needle: *u8) -> i64 { var nl: i64=0; while needle[nl]!=(0 as u8){ nl=nl+1 } if nl==0 { return 1 } var i: i64=0; while i + nl <= n { var j: i64=0; var ok: i64=1; while j < nl { if hay[i+j] != needle[j] { ok=0; j=nl } else { j=j+1 } } if ok==1 { return 1 } i=i+1 } return 0 } called by 1: main |
| 33 | func g_sval(line: *u8, p: i64, key: *u8, out: *u8) -> i64 called by 1: main |
| 59 | func g_isrec(line: *u8, p: i64) -> i64 { if line[p]!=(114 as u8){return 0} if line[p+1]!=(101 as u8){return 0} if line[p+2]!=(99 as u8){return 0} if line[p+3]!=(32 as u8){return 0} return 1 } called by 1: main |
| 61 | func main() -> i64 |