code wiki / _hdl_build / nx_build_role_gate.nx

nx_build_role_gate.nx

buildroot/runtime/_hdl_build/nx_build_role_gate.nx

4951 B93 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind gate/prooftopic build
docsdependenciesstructsconstsfunctions

about

nx_build_role_gate.nx -- R3 of BACKEND-BUILD GOVERNANCE: the ROLE-SPLIT ENFORCEMENT gate. Encodes the operator's PM+Librarian split as a DATA-DRIVEN authorization policy (mirrors nx_access_lib's ag_allow): every governance responsibility CLASS has a required owning ROLE, and role_ok(class, owner) ALLOWS only the correct pairing -- so a responsibility claimed by the WRONG role is DENIED. This is what keeps the R0-census owner column honest going forward. LIB (catalog/SSOT) owns: CATALOG, LIVE_VIEW, DEDUP PM (control-plane) owns: SUBMIT, STATE, OWNERSHIP, AUDIT, NOBYPASS, POLICY P+L (shared) owns: ROLE_ASSIGN (PM or LIB both acceptable) GATE w/ NEGATIVE CONTROLS: correct pairings ALLOW; cross-role claims DENY. GREEN iff every case matches its expected verdict (so the deny cases are load-bearing, not decorative). Sovereign: imports only nx_syscalls. license_tier: ORIGINAL expect_exit: 0

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_build_role_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 rg_p rg_len sys_write sys_mmap check role_ok required_role rg_streq rg_streq ↻ rg_p ↻ rg_pn sys_mmap ↻ sys_write ↻ rg_pn ↻ sys_exit

structs

none

consts

none

functions

14func rg_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: rg_p
15func rg_p(s: *u8) -> i64 { let n: i64 = rg_len(s); sys_write(1, s, n); return 0 }
called by 2: checkmain calls 2: rg_lensys_write
16func rg_pn(v: i64) -> i64
called by 2: checkmain calls 2: sys_mmapsys_write
25func rg_streq(a: *u8, b: *u8) -> i64
33func required_role(cls: *u8) -> *u8
called by 1: role_ok calls 1: rg_streq
47func role_ok(cls: *u8, owner: *u8) -> i64
called by 1: check calls 2: required_rolerg_streq
61func check(cls: *u8, owner: *u8, expect: i64, st: *i64) -> i64
called by 1: main calls 3: role_okrg_prg_pn
69func main() -> i64