code wiki / _hdl_build / nx_wiredclaim_lib.nx

nx_wiredclaim_lib.nx

buildroot/runtime/_hdl_build/nx_wiredclaim_lib.nx

5409 B117 linesdepth 3pulls 3 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_wiredclaim_lib.nx -- IS AN ORGAN ACTUALLY CALLED, OR ONLY CLAIMED TO BE? NO main() ON PURPOSE. THE CLASS THIS EXISTS FOR is the ecosystem's most-repeated defect: a capability that is BUILT, GATED, and DESCRIBED AS WIRED, but has no production call site -- so it is, in effect, the baseline it was meant to beat. Banked instances: public registration open while gate-proven ls_signup_allowed sat unwired (1785445704); the pre-deploy gate computed, published and structurally unreachable from the act it guards (1785453118); and F881, where nx_magicratchet is asserted "wired into /api/build" in FOUR comments while grep finds ZERO call sites in the source AND ZERO in the deployed mgmt binary, and a two-build experiment shows the enforcement does not fire (1785530277). METHOD, AND WHY IT IS DELIBERATELY NOT AN LLM: the 2026 literature on code/comment inconsistency reports that plain LLM judging yields unacceptably high false positives, because a model reads the normal gap between high-level prose and detailed code as a defect (DocPrism). The sound technique is CASCADE-style DOCUMENT TESTING: turn the claim into something executable and run it. This organ is the STATIC half of that -- it decides, over a corpus grep, whether every mention of an organ is PROSE. A claim with no call site is not proof of absence, it is the trigger to run the behavioural test. INPUT is the output of `nx_shelltool grep <organ> <dir> nx out=<f>.out` -- lines of `path:lineno:text`. Composing the grep rather than walking keeps this organ free of a corpus cap it would have to be honest about, and reuses the ONE canonical search path. u26a0DECLARED ENVELOPE (L011): line-shape heuristics, not a parser. A call written across a line break, or dispatched through a runtime-assembled path (the way a builder may exec `_offc/<name>.elf`), reads as NO CALL SITE. That is why the verdict for zero-calls-plus-claims is CLAIMED-UNWIRED -- a REVIEW TRIGGER naming the behavioural test to run -- and never "proven absent". license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 1 imports · 1 importers

nx_gatedry_lib.nx nx_wiredclaim_lib.nx nx_wiredclaim.nx

imports: nx_gatedry_lib.nx

imported by: nx_wiredclaim.nx

structs

none

consts

29const WC_WIRED: i64 = 0 // at least one non-comment, non-self mention: a real call site candidate
30const WC_CLAIMED: i64 = 1 // zero call sites, but prose mentions it -- the F881 shape
31const WC_NOEVIDENCE: i64 = 2 // no mentions at all
32const WC_UNREADABLE: i64 = 3
34const WC_SLASH: i64 = 47
35const WC_SPACE: i64 = 32
36const WC_TAB: i64 = 9
37const WC_NL: i64 = 10

functions

40func wc_is_comment(buf: *u8, s: i64, e: i64) -> i64
called by 1: wc_scan
55func wc_is_self(buf: *u8, s: i64, e: i64, organ: *u8) -> i64
called by 1: wc_scan calls 1: gd_len
73func wc_scan(buf: *u8, n: i64, organ: *u8, cnt: *i64) -> i64
called by 1: main calls 2: wc_is_commentwc_is_self
105func wc_verdict(cnt: *i64) -> i64
called by 1: main
112func wc_name(v: i64) -> *u8
called by 1: main