code wiki / (root) / nx_crew_capability_gate.nx

nx_crew_capability_gate.nx

buildroot/runtime/nx_crew_capability_gate.nx

9919 B143 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind gate/prooftopic crew
docsdependenciesstructsconstsfunctions

about

nx_crew_capability_gate.nx -- does each RACI role OWN its accountable capability, and is it an MCP API? (operator 2026-07-10: "each of these roles needs to own their raci capabilities and get their capabilities to be mcp apis"). Reads knowledge/registry/crew_capabilities.data (role|activity|organ|mcp_tool|status) + knowledge/registry/mcp_tools_live.txt (the LIVE /api/tools snapshot). LIAR-KILL: every row that CLAIMS status=mcp must name a tool that is ACTUALLY in the live snapshot -- a role cannot claim an MCP API it does not have. Reports MCP-exposure coverage (mcp roles / non-human roles) and lists the organ-only roles = the drive-to-100 work queue. NEG-CONTROL: a synthetic ghost tool must be detected as NOT live. 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_capability_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 cw_w sys_write sys_mmap cw_load_set sys_mmap ↻ cw_read sys_openat_rd sys_read sys_close cw_fieldn cw_has cw_streq sys_exit cw_wn sys_mmap ↻ sys_write ↻ cw_read ↻ cw_fieldn ↻ cw_streq ↻ cw_has ↻ cw_run sys_mmap ↻ sys_pipe2 sys_fork sys_dup3 sys_close ↻ sys_execve sys_exit ↻ sys_read ↻ sys_wait4 cw_scopy cw_contains

structs

none

consts

10const CW_CAP: i64 = 262144
11const CW_MAXT: i64 = 128
12const CW_STR: i64 = 64

functions

14func cw_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main calls 1: sys_write
15func cw_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
16func cw_read(path: *u8, buf: *u8, cap: i64) -> i64
22func cw_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 2: cw_hasmain
24func cw_fieldn(line: *u8, len: i64, n: i64, out: *u8, outcap: i64) -> i64
called by 2: cw_load_setmain
32func cw_has(set: *u8, n: i64, name: *u8) -> i64 { var i: i64=0; while i<n { let off: i64=i*CW_STR; if cw_streq((set as i64 + off) as *u8, name)==1 {return 1} i=i+1 } return 0 }
called by 2: cw_load_setmain calls 1: cw_streq
34func cw_load_set(path: *u8, set: *u8, maxn: i64) -> i64
called by 1: main calls 4: sys_mmapcw_readcw_fieldncw_has
57func cw_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 }
called by 1: main
58func cw_contains(hay: *u8, needle: *u8) -> i64
called by 1: main
67func cw_run(a1: *u8, a2: *u8, out: *u8, outcap: i64) -> i64
84func main() -> i64