code wiki / _hdl_build / nx_hr_sheriff.nx

nx_hr_sheriff.nx

buildroot/runtime/_hdl_build/nx_hr_sheriff.nx

6475 B110 linesdepth 11pulls 18 transitivereach 1 importersview sourcekind librarytopic hr
docsdependenciesstructsconstsfunctions

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

nx_hr.nx nx_syscalls.nx nx_hr_sheriff.nx nx_hr_sheriff_gate.nx

imports: nx_hr.nxnx_syscalls.nx

imported by: nx_hr_sheriff_gate.nx

structs

none

consts

13const SH_MAGIC_262144: i64 = 262144
15const SH_OK: i64 = 0
16const SH_NO_GATE: i64 = 1 // deploy/publish without a green gate
17const SH_NO_PUBLISHER: i64 = 2 // release not routed through the publisher (raw push)
18const SH_RACI_UNAUTH: i64 = 3 // actor's role is not R/A for the area (out of lane)
20const SH_R: i64 = 82 // 'R'
21const SH_A: i64 = 65 // 'A'

functions

23func 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
24func 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 }
26func 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 }
called by 1: sheriff_check_event calls 1: sh_eq
29func sh_raci_authorized(raci_path: *u8, area: *u8, arealen: i64, actor: *u8, actorlen: i64) -> i64
48func 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
58func sheriff_sweep(log_path: *u8, raci_path: *u8, report_path: *u8) -> i64
89func sheriff_actor_violations(log_path: *u8, raci_path: *u8, actor_q: *u8, actor_qlen: i64) -> i64