code wiki / _hdl_build / nx_wirecensus_lib.nx
nx_wirecensus_lib.nx
buildroot/runtime/_hdl_build/nx_wirecensus_lib.nx
about
nx_wirecensus_lib.nx -- S4 OF THE WIRING CENSUS: REGISTERED BUT NEVER CALLED.
WHY THIS AND NOT MORE CALL-GRAPH (July-2026 external SOTA, debt id=1785451391): the field's largest
dead-surface win came from RUNTIME evidence, not static analysis -- an Express codebase shed 16,000
lines (35 pct) by cross-referencing ACCESS LOGS against REGISTERED ROUTES, and the write-up states
plainly that static tools "only detect unreachable code, not the absence of live traffic".
nx_adopt already answers the static question (S1: defined, zero external callers). It structurally
CANNOT see a tool that is registered, callable, advertised -- and that nobody has ever invoked.
That tool is worse than dead code: it occupies the capability surface and reads as a feature.
THE TWO WITNESSES, and why one is strong and one is weak (stated so the verdict is not oversold):
W1 cap_consent.log "CAPMINT ... allow=<csv> ..." -- STRONG. A capability is MANDATORY to invoke
a tool over /mcp, so a tool that never appears in any allow= list was never callable in
practice. Absence here is close to proof.
W2 actlog.jrnl TAB field 2 = the tool actually invoked -- WEAK BUT POSITIVE. Seats log
VOLUNTARILY, so absence proves nothing; PRESENCE proves use. Used only to rescue tools from
the dark list, never to condemn them.
A tool is DARK only if BOTH witnesses are silent. Union, not intersection -- the conservative side.
KNOWN BLIND SPOT, REPORTED NOT HIDDEN: caps minted before this log existed, or minted with the
root nx_cap_mint on the NAS rather than POST /api/cap/mint, never reach cap_consent.log. So DARK is
an UPPER BOUND on unused surface, exactly as nx_adopt's raw count was an upper bound before the
public/local split. Anyone quoting this number must quote the bound with it.
license_tier: ORIGINAL Read-only. No hw writes (Rule 26).
dependencies 1 imports · 2 importers
imports: nx_syscalls.nx
imported by: nx_wirecensus.nxnx_wirecensus_gate.nx
structs
| none |
consts
| 26 | const WC_MAGIC_262144: i64 = 262144 |
| 27 | const WC_MAGIC_1048576: i64 = 1048576 |
| 29 | const WC_BUF: i64 = 4194304 |
| 30 | const WC_MAXT: i64 = 2048 |
| 31 | const WC_NAMEMAX: i64 = 64 |
| 32 | const WC_TAB: i64 = 9 |
| 33 | const WC_NL: i64 = 10 |
| 34 | const WC_HASH: i64 = 35 |
| 35 | const WC_COMMA: i64 = 44 |
| 36 | const WC_SP: i64 = 32 |
functions
| 38 | func wc_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 51 | func wc_name_ch(c: i64) -> i64 |
| 59 | func wc_has(names: *u8, lens: *i64, cnt: i64, p: *u8, l: i64) -> i64 |
| 78 | func wc_elflen(p: *u8, l: i64) -> i64 |
| 87 | func wc_add(names: *u8, lens: *i64, cnt: i64, p: *u8, l: i64, trunc: *i64) -> i64 |
| 101 | func wc_parse_registered(buf: *u8, n: i64, names: *u8, lens: *i64, trunc: *i64) -> i64 |
| 130 | func wc_parse_authorised(buf: *u8, n: i64, names: *u8, lens: *i64, trunc: *i64) -> i64 |
| 163 | func wc_parse_invoked(buf: *u8, n: i64, names: *u8, lens: *i64, trunc: *i64) -> i64 |
| 207 | func wc_parse_registered_elfs(buf: *u8, n: i64, names: *u8, lens: *i64, trunc: *i64) -> i64 |
| 243 | func wc_parse_nontools(buf: *u8, n: i64, names: *u8, lens: *i64, trunc: *i64) -> i64 |
| 278 | func wc_scan_elfs(dir: *u8, names: *u8, lens: *i64, trunc: *i64) -> i64 |
| 328 | func wc_suffix_is(p: *u8, l: i64, suf: *u8, sl: i64) -> i64 |
| 334 | func wc_looks_oracle(p: *u8, l: i64) -> i64 |
| 340 | func wc_looks_daemon(p: *u8, l: i64) -> i64 |
| 368 | func wc_strip_logsuffix(p: *u8, l: i64) -> i64 |
| 383 | func wc_scan_logs(dir: *u8, names: *u8, lens: *i64, cnt0: i64, trunc: *i64) -> i64 called by 1: main calls 8: sys_mmapsys_getdents64dirent_reclendirent_typedirent_namewc_strip_logsuffix+2 |
| 424 | func wc_scan_plan_tools(dir: *u8, names: *u8, lens: *i64, cnt0: i64, trunc: *i64) -> i64 |
| 496 | func wc_contains_name(buf: *u8, n: i64, p: *u8, l: i64) -> i64 called by 1: main |
| 518 | func wc_dark(rnames: *u8, rlens: *i64, rcnt: i64, |