code wiki / (root) / nx_capreach.nx

nx_capreach.nx

buildroot/runtime/nx_capreach.nx

7795 B141 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_capreach.nx -- WHEN A TOOL IS DENIED, WHAT ELSE REACHES ITS FUNCTION? (2026-09-04) THE DEFECT THIS CLOSES, measured FIVE TIMES IN ONE SESSION BY ONE SEAT. A capability denial names a TOOL. It does not name the FUNCTION that tool performs, and in this estate the function is almost always reachable another way -- but a denial message ends the search, because it reads like a wall and offers only "mint a cap". Measured instances, all 2026-09-04: nx_capsearch denied, reachable because nx_spendgate FORKS it; nx_sov_build_run denied, reachable because nx_stale_check forks it; the deploy lane denied, reachable through nx_restage; nx_sota_status denied, its VERDICT readable because the organ runs on a beat and PERSISTS it to knowledge/status/sota_board.ledger. Each time a blocker was published before the reach was enumerated, and each time the reach existed. A FALSE I-AM-BLOCKED IS SELF-CONFIRMING, because nothing afterwards tests it. TWO RELATIONS, AND THEY ARE THE TWO THAT ACTUALLY WORKED -- not the one that was easiest to write. A SHARED-ELF detector was considered and REJECTED: tool_allowlist.conf does map several names onto one elf (nx_status and nx_torstat both point at nx_hostctl), so it is trivially implementable, but NONE of the five measured cases had that shape. Shipping it would have been a detector that cannot fire on the cases that motivated it -- a different detector wearing the name of the problem. ARTIFACT the target's own persisted output, which carries its verdict when the organ cannot be called. *** SHIPPED IN THIS LEG. *** FORK a source that names the target and is itself a registered tool: a callable composer. *** NOT IMPLEMENTED IN THIS LEG, AND SAID SO HERE RATHER THAN LEFT IMPLIED. *** It needs a whole-corpus scan and therefore its own cost envelope, so it is a NAMED NEXT LEG. This paragraph exists because the first draft described BOTH relations as if both shipped -- the exact overclaiming-prose defect that nx_board_contract_gate's prose axis was built THE SAME DAY to catch. A header is not a measurement, and an organ whose own comment oversells it is the cheapest possible place for that defect to start. PUBLISHES A LIST, NEVER A VERDICT. The estate has measured that a ranker whose top hit is not the answer must print evidence and let a human decide (nx_spendgate ships with no threshold for exactly this reason). A composer that merely NAMES the target may not expose it; this organ says so rather than scoring it. exit: 0 candidates printed . 2 usage . 3 no allowlist readable license_tier: ORIGINAL No hw writes.

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_capreach.nx

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

main cr_w sys_write cr_slen sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ cr_read sys_openat_rd sys_read sys_close cr_is_tool cr_find cr_slen ↻ cr_slen ↻ cr_cat cr_exists sys_openat_rd ↻ sys_close ↻

structs

none

consts

36const CR_PATH: i64 = 1024
37const CR_CAP: i64 = 1048576
38const CR_NL: i64 = 10
39const CR_TAB: i64 = 9
40const CR_NAMECAP: i64 = 128

functions

42func cr_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
43func cr_w(s: *u8) -> i64 { sys_write(1, s, cr_slen(s)); return 0 }
called by 1: main calls 2: sys_writecr_slen
44func cr_cat(dst: *u8, off: i64, s: *u8) -> i64 { var o: i64 = off; var i: i64 = 0; while s[i] != (0 as u8) { dst[o] = s[i]; o = o + 1; i = i + 1 } dst[o] = 0 as u8; return o }
called by 1: main
45func cr_find(buf: *u8, n: i64, needle: *u8, from: i64) -> i64
called by 1: cr_is_tool calls 1: cr_slen
58func cr_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
73func cr_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 }
called by 1: main calls 2: sys_openat_rdsys_close
77func cr_is_tool(al: *u8, n: i64, name: *u8) -> i64
called by 1: main calls 2: cr_findcr_slen
92func main(argc: i64, argv: *i64) -> i64