code wiki / _hdl_build / nx_hr_sheriff.nx
nx_hr_sheriff.nx
buildroot/runtime/_hdl_build/nx_hr_sheriff.nx
about
nx_hr_sheriff.nx -- NISHI HR, the SHERIFF: behavioral compliance monitor for the AUTONOMOUS Nishi team. Partner
to the PM (the PM owns the RACI/plan; the sheriff audits that the team's ACTIONS follow the PROCEDURES). Watches
a team-action log and flags violations of the standing procedures:
R1 GATE-BEFORE-DEPLOY : a release-class action (deploy/publish) MUST have a GREEN gate first.
R2 PUBLISH-VIA-PUBLISHER: a release-class action MUST go through the coordinated publisher (the lease) -- the
"workstreams stop crashing everything" rule; a raw push is a violation.
R3 IN-YOUR-LANE (RACI) : the actor's role must be Responsible or Accountable for the area it's acting on
(cross-checked against the PM's RACI). Acting outside your lane is a violation.
Behavioral, not punitive-by-default: it COUNTS per-actor violations so a repeat offender (a pattern) is flagged,
not just a one-off. Composes the RACI (nx_hr_team) + nx_hr helpers. license_tier: ORIGINAL
dependencies 2 imports · 1 importers
imports: nx_hr.nxnx_syscalls.nx
imported by: nx_hr_sheriff_gate.nx
structs
| none |
consts
| 13 | const SH_MAGIC_262144: i64 = 262144 |
| 15 | const SH_OK: i64 = 0 |
| 16 | const SH_NO_GATE: i64 = 1 // deploy/publish without a green gate |
| 17 | const SH_NO_PUBLISHER: i64 = 2 // release not routed through the publisher (raw push) |
| 18 | const SH_RACI_UNAUTH: i64 = 3 // actor's role is not R/A for the area (out of lane) |
| 20 | const SH_R: i64 = 82 // 'R' |
| 21 | const SH_A: i64 = 65 // 'A' |
functions
| 23 | func sh_eq(s: *u8, slen: i64, lit: *u8, litlen: i64) -> i64 { if slen != litlen { return 0 } var k: i64=0; while k<slen { if s[k]!=lit[k] { return 0 } k=k+1 } return 1 } called by 1: sh_is_release |
| 24 | func sh_atoi(buf: *u8, s: i64, e: i64) -> i64 { var v: i64=0; var i: i64=s; while i<e { let c: i64=buf[i] as i64; if c>=48 { if c<=57 { v=v*10+(c-48); i=i+1 } else {i=e} } else {i=e} } return v } |
| 26 | func sh_is_release(action: *u8, alen: i64) -> i64 { if sh_eq(action, alen, "deploy" as *u8, 6)==1 { return 1 } if sh_eq(action, alen, "publish" as *u8, 7)==1 { return 1 } return 0 } |
| 29 | func sh_raci_authorized(raci_path: *u8, area: *u8, arealen: i64, actor: *u8, actorlen: i64) -> i64 |
| 48 | func sheriff_check_event(actor: *u8, actorlen: i64, action: *u8, actionlen: i64, area: *u8, arealen: i64, gate_green: i64, via_publisher: i64, raci_path: *u8) -> i64 |
| 58 | func sheriff_sweep(log_path: *u8, raci_path: *u8, report_path: *u8) -> i64 |
| 89 | func sheriff_actor_violations(log_path: *u8, raci_path: *u8, actor_q: *u8, actor_qlen: i64) -> i64 |