code wiki / _hdl_build / nx_sov_guard.nx
nx_sov_guard.nx
buildroot/runtime/_hdl_build/nx_sov_guard.nx
about
nx_sov_guard.nx -- SOVEREIGNTY / NO-NEW-TSV guard (hardware-rung-up). Enumerates a data dir with its OWN
getdents64 (no find/ls/grep = no non-nishi tooling) and flags every *.tsv file NOT in the allowlist
(knowledge/registry/tsv_allow.list -- grandfathered legacy/other-ws stores, owner-noted). Enforces "stop the
creation of new tsv": a NEW non-allowlisted .tsv -> VIOLATION -> RED. As a workstream migrates its tsv ->
sovereign seg-store, it removes that line. The sovereign seg-store (knowledge/store/<ns>-*) is the preferred
store; this guard is the ratchet that keeps it the default.
usage: nx_sov_guard [dir=knowledge/status] [allowlist=knowledge/registry/tsv_allow.list]
exit 0 GREEN (no new tsv) / 1 RED (a new unallowlisted tsv) / 2 ERROR (dir unopenable)
license_tier: ORIGINAL
dependencies 2 imports · 1 importers
imports: nx_syscalls.nxnx_itoa_lib.nx
imported by: nx_sov_guard_gate.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 12 | const SG_MAGIC_262144: i64 = 262144 |
| 13 | const SG_MAGIC_65536: i64 = 65536 |
| 15 | const SG_DIR_DEF: *u8 = "knowledge/status" |
| 16 | const SG_ALLOW_DEF: *u8 = "knowledge/registry/tsv_allow.list" |
functions
| 18 | func sg_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 23 | func sg_wn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 24 | func sg_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 25 | func sg_ends(name: *u8, suf: *u8) -> i64 |
| 29 | func sg_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 36 | func sg_line_in(buf: *u8, n: i64, name: *u8) -> i64 |
| 54 | func sg_scan(dir: *u8, allowpath: *u8) -> i64 |
| 82 | func main(argc: i64, argv: *i64) -> i64 |