code wiki / _hdl_build / nx_discocensus.nx
nx_discocensus.nx
buildroot/runtime/_hdl_build/nx_discocensus.nx
about
nx_discocensus.nx -- DISCOVERABILITY CENSUS (2026-08-06). Measures, on every run, how much of the tool
registry is actually USABLE by an agent: does each tool carry a call contract, and is its safety profile
derived rather than fabricated?
WHY THIS ORGAN EXISTS -- the failure it is built to prevent, with a receipt. Debt 1784549913 filed the
missing-col8 gap when the estate had 111 MCP tools and 21 typed contracts. Nobody re-measured. By
2026-08-06 it was 749 of 869 -- the SAME defect, EIGHT TIMES LARGER, sitting open the whole time.
★★★★★★ AN OPEN DEBT WHOSE MEASURED SIZE GREW 8x WHILE NOBODY RE-MEASURED IT *IS* THE DRIVE-THE-PLAN
FAILURE. A number that is only ever measured by hand is measured once. This makes it a standing
instrument so the PM sees the trend without a human deciding to look.
Siblings, deliberately NOT duplicated: nx_adopt answers "which primitives has nobody adopted",
nx_wirecensus answers "registered but never called". This answers "discoverable ENOUGH TO CALL".
HONEST BY CONSTRUCTION: every figure is a COUNT of rows that exist on disk -- nothing is asserted, and a
missing input file is REFUSED, never silently treated as zero coverage (a zero you cannot distinguish
from an unreadable file is the bounded-read defect all over again). Floors live in a CONF, not in code
(rule 11); with no conf the verdict is UNKNOWN and the census still prints -- it will not invent a bar
to grade itself against.
nx_discocensus -> JSON census on stdout; exit 0 GREEN/UNKNOWN, 1 RED (a floor was breached)
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
dependencies 2 imports · 0 importers
imports: nx_mgmt_api.nxnx_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
| 23 | const DC_MAGIC_2048: i64 = 2048 |
| 24 | const DC_MAGIC_2047: i64 = 2047 |
| 26 | const DC_FCAP: i64 = 1 << 21 |
| 27 | const DC_NAMECAP: i64 = 128 |
| 28 | const DC_CONF: *u8 = "knowledge/discocensus.conf" as *u8 |
| 134 | const DC_QUOTE: i64 = 34 |
| 135 | const DC_COMMA: i64 = 44 |
| 136 | const DC_LIST_MULT: i64 = 3 |
functions
| 30 | func dcw(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 31 | func dcn(v: i64) -> i64 |
| 41 | func dc_field(buf: *u8, ls: i64, le: i64, idx: i64, out2: *i64) -> i64 called by 1: dc_row_has |
| 58 | func dc_row_has(buf: *u8, n: i64, name: *u8, nlen: i64, needcol: i64) -> i64 |
| 87 | func dc_slurp(path: *u8, szp: *i64) -> *u8 { return sys_read_file(path, szp) } |
| 89 | func dc_conf_int(buf: *u8, n: i64, key: *u8) -> i64 called by 1: main |
| 140 | func dc_app(dst: *u8, off: i64, cap: i64, nm: *u8, nl: i64, first: i64) -> i64 called by 1: main |
| 155 | func dc_emit_list(key: *u8, buf: *u8, off: i64, n: i64) -> i64 |
| 167 | func main() -> i64 |