code wiki / (root) / nx_crew_roster_gate.nx

nx_crew_roster_gate.nx

buildroot/runtime/nx_crew_roster_gate.nx

8916 B120 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind gate/prooftopic crew
docsdependenciesstructsconstsfunctions

about

nx_crew_roster_gate.nx -- THE CREW-COMPLETENESS GUARD (operator 2026-07-10: "are you sure you have them all"). The canonical roster (knowledge/registry/crew_roster.tsv) and the machine RACI (knowledge/registry/nishi_raci.tsv) MUST name the EXACT SAME SET of roles -- so a crew member can never again be RACI'd-but-off-roster or on-roster-but-un-RACI'd (the drift that lost Analyst/Examiner/Auditor/Critic/Scribe/Arbiter until the operator caught it). Reads both, extracts role = field 0 of every non-comment line, computes the symmetric difference, and FAILS if either direction is non-empty. NEG-CONTROL with teeth: injects a synthetic role into each set and confirms the detector's missing-count rises by exactly 1. NOTE: no '#'/'!' in string literals (nx_cc lexer trap). license_tier: ORIGINAL expect_exit: 0

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_crew_roster_gate.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main cr_w sys_write sys_mmap cr_parse sys_mmap ↻ cr_read sys_openat_rd sys_read sys_close cr_field0 cr_has cr_streq sys_exit cr_wn sys_mmap ↻ sys_write ↻ cr_count_missing cr_has ↻ cr_w ↻ cr_setadd_ghost cr_disk_scan sys_mmap ↻ cr_scopy cr_organ_exists cr_scopy ↻ sys_openat_rd ↻ sys_close ↻ cr_has ↻ cr_w ↻

structs

none

consts

11const CR_CAP: i64 = 262144
12const CR_MAXR: i64 = 256
13const CR_STR: i64 = 48

functions

15func cr_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
16func cr_wn(v: i64) -> i64 { var m: i64=v; let t: *u8=sys_mmap(24); 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} let o: *u8=sys_mmap(24); var w: i64=0; var q: i64=k-1; while q>=0{o[w]=t[q];w=w+1;q=q-1} sys_write(1,o,w); return 0 }
called by 1: main calls 2: sys_mmapsys_write
17func cr_read(path: *u8, buf: *u8, cap: i64) -> i64
23func cr_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: cr_has
25func cr_field0(line: *u8, len: i64, out: *u8, outcap: i64) -> i64
called by 1: cr_parse
30func cr_has(set: *u8, n: i64, name: *u8) -> i64 { var i: i64=0; while i<n { let off: i64=i*CR_STR; if cr_streq((set as i64 + off) as *u8, name)==1 {return 1} i=i+1 } return 0 }
32func cr_parse(path: *u8, set: *u8, maxr: i64) -> i64
called by 1: main calls 4: sys_mmapcr_readcr_field0cr_has
57func cr_count_missing(A: *u8, na: i64, B: *u8, nb: i64, label: *u8, verbose: i64) -> i64
called by 1: main calls 2: cr_hascr_w
64func cr_setadd_ghost(set: *u8, n: i64, name: *u8) -> i64 { let off: i64=n*CR_STR; var k: i64=0; while name[k]!=(0 as u8){ let d: *u8=(set as i64 + off + k) as *u8; d[0]=name[k]; k=k+1 } let z: *u8=(set as i64 + off + k) as *u8; z[0]=0 as u8; return n+1 }
called by 1: main
65func cr_scopy(dst: *u8, off: i64, src: *u8) -> i64 { var i: i64=0; while src[i]!=(0 as u8){ let d: *u8=(dst as i64 + off + i) as *u8; d[0]=src[i]; i=i+1 } return off+i }
67func cr_organ_exists(noun: *u8, pathbuf: *u8) -> i64
76func cr_disk_scan(rset: *u8, rn: i64) -> i64
92func main() -> i64