code wiki / _hdl_build / nx_registrymine.nx

nx_registrymine.nx

buildroot/runtime/_hdl_build/nx_registrymine.nx

52793 B1063 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

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

nx_sovjson_lib.nx nx_syscalls.nx nx_gate_verdict.nx nx_tool_run.nx nx_registrymine.nx

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

main sj_puts sys_write sys_exit sj_vlen sj_lit_eq rm_selftest gv_ctr 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 ↻ gv_head gv_puts sys_write ↻ sys_mmap ↻ sj_cat sj_catn sys_mmap ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real sys_openat_wr sys_write ↻ sys_close rm_mine_json sys_mmap ↻ rm_load sj_lit_eq ↻

structs

none

consts

19const RM_MAGIC_4088: i64 = 4088
21const RM_CAP: i64 = 1048576
22const RM_OUT: i64 = 65536
23const RM_PATH: i64 = 512
24const RM_SLOTS: i64 = 256
25const RM_TOPN: i64 = 20
26const RM_ALLOW: i64 = 131072
27const RM_PERMIL: i64 = 1000
28const RM_SEVN: i64 = 12
29const RM_NAME_MAX: i64 = 120
30const RM_MODE_644: i64 = 420
407const RM_LS_SLASH: i64 = 47 // ASCII '/'
408const RM_LS_DOT: i64 = 46 // ASCII '.'
409const RM_LS_QUOTE: i64 = 34 // ASCII '"'
410const RM_LS_NL: i64 = 10 // ASCII newline (a bare-newline string literal is lexer-ambiguous)
411const RM_LS_CH_M: i64 = 109 // ASCII 'm' -- first byte after the quote of "mcpMeta"
412const RM_LS_CH_T: i64 = 116 // ASCII 't' -- first byte after the quote of "type"/"tool_use_id"/"timestamp"
413const RM_LS_DT_DIR: i64 = 4 // linux dirent d_type DT_DIR
414const RM_LS_DT_UNKNOWN: i64 = 0 // linux dirent d_type DT_UNKNOWN -- probed, never assumed
415const RM_LS_DIRBUF: i64 = 65536 // getdents64 batch -- LOOPED until 0; ONE CALL IS NOT A LISTING
416const RM_LS_PATH: i64 = 1024 // one path cell (longest measured transcript path ~130 B)
417const RM_LS_MAXDIRS: i64 = 8192 // directory stack; overflow REFUSES loudly
418const RM_LS_MAXFILES: i64 = 32768 // transcript table (899 measured 2026-08-20); overflow REFUSES loudly
419const RM_LS_MAXTOOLS: i64 = 8192 // distinct tool names (1,187 registered); overflow REFUSES loudly
420const RM_LS_NAMECELL: i64 = 128 // one interned tool-name cell
421const RM_LS_TSCELL: i64 = 32 // one ISO-8601 cell ("2026-08-19T21:59:59.999Z" = 24 measured)
422const RM_LS_IDSLOTS: i64 = 262144 // per-file tool_use-id map slots, power of two (open addressing)
423const RM_LS_GIDSLOTS: i64 = 1048576 // global counted-result id set slots, power of two
424const RM_LS_GIDMAX: i64 = 524288 // counted results (32,122 in-window measured); overflow REFUSES loudly
425const RM_LS_IDCELL: i64 = 48 // one tool_use id cell ("toolu_" + 24 = 30 measured)
426const RM_LS_SCAN: i64 = 512 // bounded forward scan inside ONE tool_use object, newline-stopped
427const RM_LS_DENYSCAN: i64 = 4096 // bounded refusal-marker scan; a MISS falls to UNKNOWN, never to OK
428const RM_LS_OUT: i64 = 4194304 // report buffer (full worklist, never a top-N)
429const RM_LS_HASH_MUL: i64 = 131 // odd multiplier, classic polynomial string hash
430const RM_LS_HASH_MOD: i64 = 1000000007 // large prime modulus keeps the accumulator inside i64
431const RM_LS_CX: i64 = 16 // caller-visible counter slots
432const RM_LS_CX_LOST: i64 = 0
433const RM_LS_CX_EXECT: i64 = 1
434const RM_LS_CX_CAPS: i64 = 2

functions

32func rm_read(path: *u8, buf: *u8, cap: i64) -> i64
41func rm_find(q: *u8, n: i64, lit: *u8) -> i64
called by 1: rm_selftest calls 1: sj_vlen
55func rm_allow_path(name: *u8, outp: *u8) -> i64 { return sj_allow_path(name, outp) }
called by 1: rm_load calls 1: sj_allow_path
56func rm_key(d: *u8, o: i64, name: *u8) -> i64
called by 1: rm_mine_json calls 1: sj_cat
67func rm_absent(q: *u8, s: i64, e: i64) -> i64
called by 1: rm_mine_json
84func rm_placeholder(q: *u8, s: i64, e: i64) -> i64
called by 1: rm_mine_json calls 1: sj_lit_eq
101func rm_intern(q: *u8, cs: i64, ce: i64, ss: *i64, se: *i64, np: *i64) -> i64
called by 1: rm_mine_json
118func rm_load(src: *u8, loader: *u8, buf: *u8, lcx: *i64) -> i64
139func rm_mine_json(src: *u8, loader: *u8, minsup: i64, d: *u8) -> i64
321func rm_selftest(prefix: *u8) -> i64
436func rm_ls_cell(base: *u8, idx: i64, cell: i64) -> *u8 { return ((base as i64) + idx * cell) as *u8 }
439func rm_ls_at(q: *u8, i: i64, endlim: i64, lit: *u8) -> i64
called by 2: rm_ls_find_nlrm_lostset calls 1: sj_vlen
449func rm_ls_find_nl(q: *u8, from: i64, endlim: i64, lit: *u8) -> i64
called by 1: rm_lostset calls 2: sj_vlenrm_ls_at
464func rm_ls_ends(name: *u8, sfx: *u8) -> i64
called by 1: rm_ls_walk calls 1: sj_vlen
473func rm_ls_hash(q: *u8, s: i64, e: i64) -> i64
480func rm_ls_probe(q: *u8, s: i64, e: i64, off: *i64, ln: *i64, gn: *i64, gen: i64) -> i64
called by 1: rm_lostset calls 1: rm_ls_hash
505func rm_ls_gid_add(q: *u8, s: i64, e: i64, ar: *u8, gsl: *i64, ng: *i64) -> i64
called by 1: rm_lostset calls 1: rm_ls_hash
541func rm_ls_tintern(q: *u8, s: i64, e: i64, ar: *u8, toff: *i64, tlen: *i64, nt: *i64) -> i64
called by 1: rm_lostset
567func rm_ls_ts_ge(q: *u8, s: i64, e: i64, since: *u8) -> i64
called by 1: rm_lostset calls 1: sj_vlen
584func rm_ls_rowstate(cb: *u8, cn: i64, ar: *u8, off: i64, ln: i64, sp: *i64) -> i64
called by 1: rm_lostset calls 3: sj_lesj_colsj_lit_eq
605func rm_ls_isdir(path: *u8, pbuf: *u8) -> i64
616func rm_ls_walk(root: *u8, parena: *u8, wcx: *i64) -> i64
689func rm_ls_row(d: *u8, p: i64, tag: *u8, ar: *u8, off: i64, ln: i64) -> i64
called by 1: rm_lostset calls 1: sj_cat
699func rm_lostset(tdir: *u8, conf: *u8, since: *u8, d: *u8, cx: *i64) -> i64
1018func main(argc: i64, argv: *i64) -> i64