code wiki / _hdl_build / nx_referee_serve.nx

nx_referee_serve.nx

buildroot/runtime/_hdl_build/nx_referee_serve.nx

3411 B40 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind servicetopic referee
docsdependenciesstructsconstsfunctions

about

nx_referee_serve.nx -- SERVE-WRAPPER making the REFEREE role's capability MCP-callable (operator 2026-07-10: "each role owns its raci capabilities and gets them to be mcp apis"). Library-role pattern (5th): nx_referee is a PURE-LOGIC lib (ref_score/ref_verdict/fairness gates, no main). Referee's NEW owned activity = ADJUDICATE (cheat-proof scoring of a head-to-head; it previously owned NO activity -- only Consulted -- a real RACI defect). Self-test exercises the three pillars: (1) GROUND-TRUTH scoring vs an oracle (never self-assessed), (2) the SEPARATION gate -- a scorer who IS a competitor invalidates the head-to-head, (3) DECISIVENESS -- a winner ONLY when the margin clears the noise threshold, else an honest TIE (no overclaim). Clean exit 0 + JSON so nishi_crew dispatches `referee adjudicate`. Import ONLY nx_referee.nx (brings nx_syscalls; 2nd direct import = double-import trap). REF_TIE=0 REF_A_WINS=1 REF_B_WINS=2. license_tier: ORIGINAL expect_exit: 0

dependencies 1 imports · 0 importers

nx_referee.nx nx_referee_serve.nx

imports: nx_referee.nx

imported by: nobody (leaf or entry point)

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

main ref_score ref_test_valid ref_no_self_grade ref_hidden ref_verdict ref_decisive ref_abs rsv_w2 rsv_bit

structs

none

consts

none

functions

12func rsv_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
13func rsv_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
15func main() -> i64