code wiki / _hdl_build / nx_wirecensus_lib.nx

nx_wirecensus_lib.nx

buildroot/runtime/_hdl_build/nx_wirecensus_lib.nx

24058 B538 linesdepth 2pulls 2 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_wirecensus_lib.nx nx_wirecensus.nx nx_wirecensus_gate.nx

imports: nx_syscalls.nx

imported by: nx_wirecensus.nxnx_wirecensus_gate.nx

structs

none

consts

26const WC_MAGIC_262144: i64 = 262144
27const WC_MAGIC_1048576: i64 = 1048576
29const WC_BUF: i64 = 4194304
30const WC_MAXT: i64 = 2048
31const WC_NAMEMAX: i64 = 64
32const WC_TAB: i64 = 9
33const WC_NL: i64 = 10
34const WC_HASH: i64 = 35
35const WC_COMMA: i64 = 44
36const WC_SP: i64 = 32

functions

38func wc_read(path: *u8, buf: *u8, cap: i64) -> i64
51func wc_name_ch(c: i64) -> i64
59func wc_has(names: *u8, lens: *i64, cnt: i64, p: *u8, l: i64) -> i64
called by 3: mainwc_addwc_dark
78func wc_elflen(p: *u8, l: i64) -> i64
87func wc_add(names: *u8, lens: *i64, cnt: i64, p: *u8, l: i64, trunc: *i64) -> i64
101func wc_parse_registered(buf: *u8, n: i64, names: *u8, lens: *i64, trunc: *i64) -> i64
called by 2: mainmain calls 1: wc_add
130func wc_parse_authorised(buf: *u8, n: i64, names: *u8, lens: *i64, trunc: *i64) -> i64
called by 2: mainmain calls 2: wc_name_chwc_add
163func wc_parse_invoked(buf: *u8, n: i64, names: *u8, lens: *i64, trunc: *i64) -> i64
called by 2: mainmain calls 1: wc_add
207func wc_parse_registered_elfs(buf: *u8, n: i64, names: *u8, lens: *i64, trunc: *i64) -> i64
called by 1: main calls 2: wc_addwc_elflen
243func wc_parse_nontools(buf: *u8, n: i64, names: *u8, lens: *i64, trunc: *i64) -> i64
called by 1: main calls 2: wc_addwc_elflen
278func wc_scan_elfs(dir: *u8, names: *u8, lens: *i64, trunc: *i64) -> i64
328func wc_suffix_is(p: *u8, l: i64, suf: *u8, sl: i64) -> i64
334func wc_looks_oracle(p: *u8, l: i64) -> i64
called by 1: main calls 1: wc_suffix_is
340func wc_looks_daemon(p: *u8, l: i64) -> i64
called by 1: main calls 1: wc_suffix_is
368func wc_strip_logsuffix(p: *u8, l: i64) -> i64
called by 1: wc_scan_logs calls 1: wc_suffix_is
383func wc_scan_logs(dir: *u8, names: *u8, lens: *i64, cnt0: i64, trunc: *i64) -> i64
424func wc_scan_plan_tools(dir: *u8, names: *u8, lens: *i64, cnt0: i64, trunc: *i64) -> i64
496func wc_contains_name(buf: *u8, n: i64, p: *u8, l: i64) -> i64
called by 1: main
518func wc_dark(rnames: *u8, rlens: *i64, rcnt: i64,
called by 2: mainmain calls 1: wc_has