code wiki / _hdl_build / nx_discocensus.nx

nx_discocensus.nx

buildroot/runtime/_hdl_build/nx_discocensus.nx

18901 B319 linesdepth 18pulls 85 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

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

nx_mgmt_api.nx nx_syscalls.nx nx_discocensus.nx

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

main 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 ↻ dc_slurp sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close dcw sys_write ↻ sys_exit ↻ sys_openat_rd ↻ dc_app sys_close ↻ dc_row_has sys_mmap ↻ dc_field dc_conf_int dcn sys_mmap ↻ sys_write ↻ dc_emit_list dcw ↻ sys_write ↻

structs

none

consts

23const DC_MAGIC_2048: i64 = 2048
24const DC_MAGIC_2047: i64 = 2047
26const DC_FCAP: i64 = 1 << 21
27const DC_NAMECAP: i64 = 128
28const DC_CONF: *u8 = "knowledge/discocensus.conf" as *u8
134const DC_QUOTE: i64 = 34
135const DC_COMMA: i64 = 44
136const DC_LIST_MULT: i64 = 3

functions

30func dcw(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: dc_emit_listmain calls 1: sys_write
31func dcn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
41func dc_field(buf: *u8, ls: i64, le: i64, idx: i64, out2: *i64) -> i64
called by 1: dc_row_has
58func dc_row_has(buf: *u8, n: i64, name: *u8, nlen: i64, needcol: i64) -> i64
called by 1: main calls 2: sys_mmapdc_field
87func dc_slurp(path: *u8, szp: *i64) -> *u8 { return sys_read_file(path, szp) }
called by 1: main calls 1: sys_read_file
89func dc_conf_int(buf: *u8, n: i64, key: *u8) -> i64
called by 1: main
140func dc_app(dst: *u8, off: i64, cap: i64, nm: *u8, nl: i64, first: i64) -> i64
called by 1: main
155func dc_emit_list(key: *u8, buf: *u8, off: i64, n: i64) -> i64
called by 1: main calls 2: dcwsys_write
167func main() -> i64