nx_crew_serve.nx
buildroot/runtime/nx_crew_serve.nx
about
nx_crew_serve.nx -- the ONE consolidated crew-capabilities MCP backend (operator 2026-07-10: "each role owns its raci
capabilities and gets them to be mcp apis"). No-tool-proliferation: ONE nishi_crew tool serves the whole crew.
nishi_crew -> the full crew directory (36 roles) + MCP-exposure coverage.
nishi_crew <role> -> that role's capability record + its RACI cell (who is A/R/C/I for the activity it OWNS).
nishi_crew <role> <activity> -> DISPATCH: RACI-GATE (the role MUST be Accountable for the activity -- no self-escalation),
then fork-exec the role's organ and RETURN its output+exit; honest "not deployed" if the
organ is not on this host (never faked). This makes a role's capability CALLABLE over MCP.
Data-driven from crew_capabilities.data + nishi_raci.tsv. JSON trick: cs_w2() converts ' (39) -> " (34); no '#'/'!'/'"' in
string literals (nx_cc lexer traps). Dispatch mirrors nx_ccheck (pipe2 + fork + dup3 + wait4). license_tier: ORIGINAL expect_exit: 0
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_itoa_lib.nxnx_raci_sov.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 CS_MAGIC_2026: i64 = 2026 |
| 15 | const CS_CAP: i64 = 262144 |
| 16 | const CS_OUT: i64 = 8192 |
functions
| 18 | func cs_raw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 19 | func cs_w2(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){ if s[n]==(39 as u8) { let q: *u8=sys_mmap(1); q[0]=34 as u8; sys_write(1,q,1) } else { sys_write(1, (s as i64 + n) as *u8, 1) } n=n+1 } return 0 } |
| 20 | func cs_byte(b: i64) -> i64 { let q: *u8=sys_mmap(1); q[0]=b as u8; sys_write(1,q,1); return 0 } |
| 25 | func cs_wn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 26 | func cs_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 32 | func cs_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 } |
| 33 | func cs_field_raw(line: *u8, len: i64, n: i64, delim: i64) -> i64 |
| 38 | func cs_field_cp(line: *u8, len: i64, n: i64, delim: i64, out: *u8, outcap: i64) -> i64 |
| 44 | func cs_jesc(s: *u8) -> i64 |
| 52 | func cs_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: cs_organ_resolve |
| 55 | func cs_is_accountable(role: *u8, activity: *u8) -> i64 |
| 76 | func cs_lookup_organ(role: *u8, organ_out: *u8, act_out: *u8) -> i64 |
| 93 | func cs_organ_resolve(name: *u8, pathout: *u8) -> i64 |
| 101 | func cs_dispatch(organ_path: *u8, out: *u8, outcap: i64) -> i64 |
| 117 | func main(argc: i64, argv: *i64) -> i64 |
| 216 | func cs_emit_raci_inline(activity: *u8) -> i64 |