code wiki / _hdl_build / nx_registrymine.nx
nx_registrymine.nx
buildroot/runtime/_hdl_build/nx_registrymine.nx
about
nx_registrymine.nx -- REGISTRY-PLANE MINER (miner-sota MS06d, 2026-07-23) closing the census's last
two uncovered classes in ONE organ: MC07 capabilities (bigrock-) and MC11 residual-catalog (minergap-).
Both share the canonical registry row shape, so this is deliberately GENERIC (raci-, commontask-,
work- fit it too) rather than two near-identical organs -- rule-15 applied BEFORE the duplication.
It answers the question a registry cannot answer about itself: WHO OWNS WHAT, and what is ORPHANED.
UNOWNED = owner is "-" or empty (a capability nobody is accountable for -- the real find)
UNSCOPED = scope is "-" or empty (a row that cannot be routed to a lane)
plus per-owner load (total + open), status distribution, severity distribution, owned_permil.
Source is a seg-store plane via the ALLOWLIST-RESOLVED loader, or a FILE when loader is "-"
(deterministic gate fixtures). Composes nx_sovjson_lib (sj_*). Read-only. No hw writes (Rule 26).
mine <source> [loader|-] [minsup] -> JSON: totals, by_owner ranked, by_status, sev, gaps
selftest <scratch-prefix> -> gate T1..T8
row cols: id TAB title TAB sev TAB status TAB owner TAB scope TAB note
license_tier: ORIGINAL
dependencies 4 imports · 0 importers
imports: nx_sovjson_lib.nxnx_syscalls.nxnx_gate_verdict.nxnx_tool_run.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
| 19 | const RM_MAGIC_4088: i64 = 4088 |
| 21 | const RM_CAP: i64 = 1048576 |
| 22 | const RM_OUT: i64 = 65536 |
| 23 | const RM_PATH: i64 = 512 |
| 24 | const RM_SLOTS: i64 = 256 |
| 25 | const RM_TOPN: i64 = 20 |
| 26 | const RM_ALLOW: i64 = 131072 |
| 27 | const RM_PERMIL: i64 = 1000 |
| 28 | const RM_SEVN: i64 = 12 |
| 29 | const RM_NAME_MAX: i64 = 120 |
| 30 | const RM_MODE_644: i64 = 420 |
| 407 | const RM_LS_SLASH: i64 = 47 // ASCII '/' |
| 408 | const RM_LS_DOT: i64 = 46 // ASCII '.' |
| 409 | const RM_LS_QUOTE: i64 = 34 // ASCII '"' |
| 410 | const RM_LS_NL: i64 = 10 // ASCII newline (a bare-newline string literal is lexer-ambiguous) |
| 411 | const RM_LS_CH_M: i64 = 109 // ASCII 'm' -- first byte after the quote of "mcpMeta" |
| 412 | const RM_LS_CH_T: i64 = 116 // ASCII 't' -- first byte after the quote of "type"/"tool_use_id"/"timestamp" |
| 413 | const RM_LS_DT_DIR: i64 = 4 // linux dirent d_type DT_DIR |
| 414 | const RM_LS_DT_UNKNOWN: i64 = 0 // linux dirent d_type DT_UNKNOWN -- probed, never assumed |
| 415 | const RM_LS_DIRBUF: i64 = 65536 // getdents64 batch -- LOOPED until 0; ONE CALL IS NOT A LISTING |
| 416 | const RM_LS_PATH: i64 = 1024 // one path cell (longest measured transcript path ~130 B) |
| 417 | const RM_LS_MAXDIRS: i64 = 8192 // directory stack; overflow REFUSES loudly |
| 418 | const RM_LS_MAXFILES: i64 = 32768 // transcript table (899 measured 2026-08-20); overflow REFUSES loudly |
| 419 | const RM_LS_MAXTOOLS: i64 = 8192 // distinct tool names (1,187 registered); overflow REFUSES loudly |
| 420 | const RM_LS_NAMECELL: i64 = 128 // one interned tool-name cell |
| 421 | const RM_LS_TSCELL: i64 = 32 // one ISO-8601 cell ("2026-08-19T21:59:59.999Z" = 24 measured) |
| 422 | const RM_LS_IDSLOTS: i64 = 262144 // per-file tool_use-id map slots, power of two (open addressing) |
| 423 | const RM_LS_GIDSLOTS: i64 = 1048576 // global counted-result id set slots, power of two |
| 424 | const RM_LS_GIDMAX: i64 = 524288 // counted results (32,122 in-window measured); overflow REFUSES loudly |
| 425 | const RM_LS_IDCELL: i64 = 48 // one tool_use id cell ("toolu_" + 24 = 30 measured) |
| 426 | const RM_LS_SCAN: i64 = 512 // bounded forward scan inside ONE tool_use object, newline-stopped |
| 427 | const RM_LS_DENYSCAN: i64 = 4096 // bounded refusal-marker scan; a MISS falls to UNKNOWN, never to OK |
| 428 | const RM_LS_OUT: i64 = 4194304 // report buffer (full worklist, never a top-N) |
| 429 | const RM_LS_HASH_MUL: i64 = 131 // odd multiplier, classic polynomial string hash |
| 430 | const RM_LS_HASH_MOD: i64 = 1000000007 // large prime modulus keeps the accumulator inside i64 |
| 431 | const RM_LS_CX: i64 = 16 // caller-visible counter slots |
| 432 | const RM_LS_CX_LOST: i64 = 0 |
| 433 | const RM_LS_CX_EXECT: i64 = 1 |
| 434 | const RM_LS_CX_CAPS: i64 = 2 |
functions
| 32 | func rm_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 41 | func rm_find(q: *u8, n: i64, lit: *u8) -> i64 |
| 55 | func rm_allow_path(name: *u8, outp: *u8) -> i64 { return sj_allow_path(name, outp) } |
| 56 | func rm_key(d: *u8, o: i64, name: *u8) -> i64 |
| 67 | func rm_absent(q: *u8, s: i64, e: i64) -> i64 called by 1: rm_mine_json |
| 84 | func rm_placeholder(q: *u8, s: i64, e: i64) -> i64 |
| 101 | func rm_intern(q: *u8, cs: i64, ce: i64, ss: *i64, se: *i64, np: *i64) -> i64 called by 1: rm_mine_json |
| 118 | func rm_load(src: *u8, loader: *u8, buf: *u8, lcx: *i64) -> i64 |
| 139 | func rm_mine_json(src: *u8, loader: *u8, minsup: i64, d: *u8) -> i64 |
| 321 | func rm_selftest(prefix: *u8) -> i64 |
| 436 | func rm_ls_cell(base: *u8, idx: i64, cell: i64) -> *u8 { return ((base as i64) + idx * cell) as *u8 } |
| 439 | func rm_ls_at(q: *u8, i: i64, endlim: i64, lit: *u8) -> i64 |
| 449 | func rm_ls_find_nl(q: *u8, from: i64, endlim: i64, lit: *u8) -> i64 |
| 464 | func rm_ls_ends(name: *u8, sfx: *u8) -> i64 |
| 473 | func rm_ls_hash(q: *u8, s: i64, e: i64) -> i64 |
| 480 | func rm_ls_probe(q: *u8, s: i64, e: i64, off: *i64, ln: *i64, gn: *i64, gen: i64) -> i64 |
| 505 | func rm_ls_gid_add(q: *u8, s: i64, e: i64, ar: *u8, gsl: *i64, ng: *i64) -> i64 |
| 541 | func rm_ls_tintern(q: *u8, s: i64, e: i64, ar: *u8, toff: *i64, tlen: *i64, nt: *i64) -> i64 called by 1: rm_lostset |
| 567 | func rm_ls_ts_ge(q: *u8, s: i64, e: i64, since: *u8) -> i64 |
| 584 | func rm_ls_rowstate(cb: *u8, cn: i64, ar: *u8, off: i64, ln: i64, sp: *i64) -> i64 |
| 605 | func rm_ls_isdir(path: *u8, pbuf: *u8) -> i64 |
| 616 | func rm_ls_walk(root: *u8, parena: *u8, wcx: *i64) -> i64 |
| 689 | func rm_ls_row(d: *u8, p: i64, tag: *u8, ar: *u8, off: i64, ln: i64) -> i64 |
| 699 | func rm_lostset(tdir: *u8, conf: *u8, since: *u8, d: *u8, cx: *i64) -> i64 |
| 1018 | func main(argc: i64, argv: *i64) -> i64 |