nx_toolreg_reap.nx
buildroot/runtime/nx_toolreg_reap.nx
about
nx_toolreg_reap.nx -- REMOVE named scaffold rows from tool_allowlist.conf. The counterpart the registry
never had: nx_toolreg_reconcile only ever ADDS (rows=830 registered=0 already=815), /api has a
tools/register route and NO unregister, and nx_fs_write refuses the allowlist by construction -- correctly,
since a tool that can EDIT the capability allowlist can GRANT ITSELF ANYTHING. So scaffold registrations
accumulated forever with no sanctioned way to clear them (debt 1785976684).
WHY THIS IS SAFE TO EXIST AT ALL, and why it is a separate organ rather than a verb on the registrar:
this organ can ONLY REMOVE, never add and never rewrite a target. Removal is strictly DE-privileging --
the worst case is a tool stops being callable, which is a recoverable annoyance, whereas an organ that
could add or repoint a row would be a privilege-granting oracle. Single responsibility is the security
property here, not a style preference.
FAIL-CLOSED PREDICATE: a row is reapable ONLY if its elf path ends in ".new" -- the staged-artifact shape
that scaffold aliases have. A row pointing at a promoted ".elf" is REFUSED and reported, so a fat-fingered
name can never unregister a live tool. Names are EXPLICIT: there is no wildcard sweep, because rows like
nx_meshmerge_staged and nx_ccingest_r7 also point at .new and other seats depend on them.
nx_toolreg_reap <name> [<name>...] | nx_toolreg_reap --list (show reapable rows, change nothing)
license_tier: ORIGINAL expect_exit: 0
dependencies 1 imports · 0 importers
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
structs
| none |
consts
| 21 | const TR_CONF: *u8 = "tool_allowlist.conf" |
| 22 | const TR_TMP: *u8 = "tool_allowlist.conf.reaptmp" |
| 23 | const TR_CAP: i64 = 1048576 |
| 24 | const TR_MODE: i64 = 0x1a4 |
| 25 | const TR_MAXNAME: i64 = 128 |
functions
| 27 | func tr_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 28 | func tr_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } called by 1: tr_name_is |
| 29 | func tr_wn(v: i64) -> i64 |
| 37 | func tr_name_is(buf: *u8, ls: i64, le: i64, nm: *u8) -> i64 |
| 47 | func tr_row_staged(buf: *u8, ls: i64, le: i64) -> i64 called by 1: main |
| 64 | func tr_emit_field1(buf: *u8, ls: i64, le: i64) -> i64 |
| 76 | func main(argc: i64, argv: *i64) -> i64 |