nx_crew_capability_gate.nx
buildroot/runtime/nx_crew_capability_gate.nx
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
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
structs
| none |
consts
| 10 | const CW_CAP: i64 = 262144 |
| 11 | const CW_MAXT: i64 = 128 |
| 12 | const CW_STR: i64 = 64 |
functions
| 14 | func 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 } |
| 15 | func 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 } |
| 16 | func cw_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 22 | func 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 } |
| 24 | func cw_fieldn(line: *u8, len: i64, n: i64, out: *u8, outcap: i64) -> i64 |
| 32 | func 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 } |
| 34 | func cw_load_set(path: *u8, set: *u8, maxn: i64) -> i64 |
| 57 | func 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 |
| 58 | func cw_contains(hay: *u8, needle: *u8) -> i64 called by 1: main |
| 67 | func cw_run(a1: *u8, a2: *u8, out: *u8, outcap: i64) -> i64 |
| 84 | func main() -> i64 |