code wiki / _hdl_build / nx_sheriff.nx

nx_sheriff.nx

buildroot/runtime/_hdl_build/nx_sheriff.nx

32519 B640 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_sheriff.nx -- THE UAT/ACCEPTANCE SHERIFF (operator 2026-07-19: "workstreams say complete and in compare there are massive gaps... a sheriff or guard as part of the pm/team capabilities to make sure the work is truly user accepted"). DONE-ness is DERIVED FROM EVIDENCE, never asserted (the same law as the conductor's phase derivation) -- applied to CLAIMED-COMPLETE work: 1) every /compare registry domain: coverage score vs the acceptance floor; a sub-floor domain WITHOUT filed frontier rungs on its published surface = REJECTED-UNFILED-GAP (the less-than-SOTA-is-never-design law, mechanized); WITH filed rungs = ACCEPTED-FILED-CLIMB (the climb is the design). 2) every ws_sync DONE frame: open debt rows whose scope matches the ws = lane-local unfinished work declared over = REJECTED-DONE-OVER-DEBT (scope-match-only, NOT the global sev floor, so the verdict names the lane's OWN mess, not the tree's). Rejections emit ready-to-file debt rows (proposed_debts) for nx_store_put -- the R2a scoped debt gate then mechanically blocks new WORK in that lane until the last mile lands. READ-ONLY organ: it proposes, never writes (provenance stays with the filer). Fail-closed: unreadable registry = exit 1; unreadable debt store = REJECTED verdict, never a silent accept. Envelope DECLARED in every output (scale law: no silent windowing/capping). nx_sheriff seed [uatprefix] (CONFIG rows, idempotent) nx_sheriff audit [registry] [journal] [debtprefix] [uatprefix] (JSON verdicts) nx_sheriff page [registry] [journal] [debtprefix] [uatprefix] (HTML board) license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 3 imports · 0 importers

nx_store_seed_lib.nx nx_seg_store.nx nx_syscalls.nx nx_sheriff.nx

imports: nx_store_seed_lib.nxnx_seg_store.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main shf_werr sys_write sys_exit shf_lit_eq shf_vlen shf_seed sys_mmap shf_cat sts_seed ss_begin_cap sys_mmap ↻ sts_mm sys_mmap ↻ sts_werr sys_write ↻ sys_exit ↻ sts_rowkey ss_catn sys_mmap ↻ ss_add ss_add2 ss_w32 ss_len ss_catn ↻ ss_commit ss_segid_ok sys_mmap ↻ ss_cat ss_catn ↻ sys_write ↻ ss_write_seg ss_segid_ok ↻ sys_mmap ↻ ss_cat ↻ ss_catn ↻ sys_write ↻ ss_segname ss_cat ↻ ss_catn ↻

structs

none

consts

24const SHF_MAGIC_4096: i64 = 4096
26const SHF_CAP: i64 = 1048576
27const SHF_SPAN: i64 = 16
28const SHF_ROWCAP: i64 = 512
29const SHF_WSCAP: i64 = 256
30const SHF_TAB: i64 = 9
31const SHF_NL: i64 = 10
32const SHF_PIPE: i64 = 124
33const SHF_HASH: i64 = 35
34const SHF_STDERR: i64 = 2
35const SHF_SEEK_SET: i64 = 0
36const SHF_SEEK_END: i64 = 2
37const SHF_EXIT_USAGE: i64 = 2
38const SHF_DEF_FLOOR: i64 = 700
41const SHF_DEF_SEV: i64 = 5

functions

43func shf_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
calls 1: sys_write
44func shf_werr(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(SHF_STDERR, s, n); return 0 }
called by 2: shf_seedmain calls 1: sys_write
45func shf_vlen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: main
46func shf_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { d[o] = s[i]; o = o + 1; i = i + 1 } return o }
48func shf_catn(d: *u8, o: i64, v: i64) -> i64
called by 2: shf_seedmain calls 1: sys_mmap
63func shf_cat_esc_html(d: *u8, o: i64, q: *u8, s: i64, e: i64) -> i64
called by 1: main calls 1: shf_cat
75func shf_cat_esc(d: *u8, o: i64, q: *u8, s: i64, e: i64) -> i64
called by 1: main
89func shf_read(path: *u8, buf: *u8, cap: i64, sizep: *i64) -> i64
116func shf_le(q: *u8, i: i64, n: i64) -> i64 { var e: i64 = i; var s: i64 = 1; while s == 1 { if e >= n { s = 0 } else { if q[e] == (SHF_NL as u8) { s = 0 } else { e = e + 1 } } } return e }
118func shf_colsep(q: *u8, ls: i64, le: i64, c: i64, sep: i64, out: *i64) -> i64
called by 2: shf_colpshf_colt
134func shf_colp(q: *u8, ls: i64, le: i64, c: i64, out: *i64) -> i64 { return shf_colsep(q, ls, le, c, SHF_PIPE, out) }
called by 1: main calls 1: shf_colsep
135func shf_colt(q: *u8, ls: i64, le: i64, c: i64, out: *i64) -> i64 { return shf_colsep(q, ls, le, c, SHF_TAB, out) }
136func shf_lit_eq(q: *u8, s: i64, e: i64, lit: *u8) -> i64
142func shf_span_eq(q: *u8, s1: i64, e1: i64, s2: i64, e2: i64) -> i64
148func shf_atoi_span(q: *u8, s: i64, e: i64) -> i64 { var v: i64 = 0; var i: i64 = s; while i < e { let c: i64 = q[i] as i64; if c >= 48 { if c <= 57 { v = v * 10 + (c - 48) } } i = i + 1 } return v }
called by 2: shf_scoreshf_cfg
149func shf_isdig(c: i64) -> i64 { if c >= 48 { if c <= 57 { return 1 } } return 0 }
151func shf_score(q: *u8, s: i64, e: i64) -> i64
called by 1: main calls 2: shf_isdigshf_atoi_span
190func shf_filed(q: *u8, s: i64, e: i64) -> i64
called by 1: main calls 1: shf_isdig
200func shf_verdict(score: i64, filed: i64, floor: i64) -> i64
called by 1: main
206func shf_verdict_str(v: i64) -> *u8
called by 1: main
213func shf_slug(q: *u8, s: i64, e: i64, dst: *u8, cap: i64) -> i64
called by 1: main
233func shf_cfg(uprefix: *u8, key: *u8, defv: i64) -> i64
253func shf_row_legacy(q: *u8, ls: i64, le: i64, c0: *i64) -> i64
260func shf_scope_hits_ws(q: *u8, s: i64, e: i64, ws: *u8) -> i64
called by 1: shf_debts_count_ws calls 1: shf_lit_eq
293func shf_debts_load(dprefix: *u8, buf: *u8) -> i64
called by 1: main calls 3: sys_mmapshf_readsts_load
303func shf_debts_count_ws(buf: *u8, n: i64, ws: *u8) -> i64
321func shf_has(q: *u8, n: i64, verb: *u8, ws_s: i64, ws_e: i64) -> i64
334func shf_first_kick(q: *u8, upto: i64, ws_s: i64, ws_e: i64) -> i64
347func shf_seed(prefix: *u8) -> i64
362func main(argc: i64, argv: *i64) -> i64