code wiki / _hdl_build / nx_arbiter_serve.nx
nx_arbiter_serve.nx
buildroot/runtime/_hdl_build/nx_arbiter_serve.nx
about
nx_arbiter_serve.nx -- SERVE-WRAPPER making the ARBITER role's capability an MCP-callable self-test (operator 2026-07-10:
"each role owns its raci capabilities and gets them to be mcp apis"). The library-role pattern: nx_arbiter is a LIBRARY
(fl_try/fl_acquire/fl_release, no main -> not fork-exec'able); this tiny wrapper IMPORTS it and EXERCISES the capability
(acquire a lock, prove a contending try is BLOCKED = mutual exclusion, release, prove re-acquire succeeds) -> clean exit 0 +
JSON verdict, so nishi_crew can dispatch `arbiter arbitrate`. Self-contained (flock on ~/.nishi/locks, no external data).
Import ONLY nx_arbiter.nx (it brings nx_syscalls transitively; a second direct import = the double-import rc=6 trap).
JSON trick: asv_w2 converts ' (39) -> " (34). license_tier: ORIGINAL expect_exit: 0
dependencies 1 imports · 0 importers
imports: nx_arbiter.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
| none |
functions
| 10 | func asv_raw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 11 | func asv_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 } called by 1: main |
| 12 | func asv_bit(b: i64) -> i64 { let d: *u8=sys_mmap(1); d[0]=(48+b) as u8; sys_write(1,d,1); return 0 } called by 1: main |
| 14 | func main() -> i64 |