code wiki / _hdl_build / nx_gateadjudicate.nx
nx_gateadjudicate.nx
buildroot/runtime/_hdl_build/nx_gateadjudicate.nx
about
nx_gateadjudicate.nx -- THE GATE ADJUDICATION CENSUS: every gate source in the compile corpus, its
adoption ladder (file facts), the execution surfaces that name it, and the ONE remedy bucket it
falls in. Built for campaign lane B (2026-08-18): "2,287 uninvoked gate sources wire-or-retire,
105 deployed-dark, 2,182 undeployed" -- numbers measured once on 2026-08-07 over ONE source
directory (2,317 gates) and later shown to understate the population by ~880 (nx_gatesubj on the
whole corpus: 3,194). A campaign that works a stale list re-investigates what is already fixed, so
step 0 of the lane is this instrument, re-runnable, full population, partition summed.
WHAT ALREADY EXISTED (asked first -- nx_spendgate/nx_capsearch, 2026-08-18):
nx_gatesubj every gate's SUBJECT from its own source (the population enumerator; composed here
through the same gk_corpus_scan so the denominator cannot disagree)
nx_catalog PER-NAME adoption ladder (SOURCE.BUILT.STAGED.PROMOTED.REGISTERED.AUTHORISED.INVOKED)
-- its INVOKED axis is the MCP actlog only, and gates are mostly run by beats, so a
gate reads DARK there while a clock row runs it nightly
nx_wirecensus registered-but-never-called over the MCP surface (S4)
nx_gate_rollup reads knowledge/gatereg.conf rows -> knowledge/status/<gate>.log verdicts
nx_gatebuilt_gate authored-vs-compiled census (prints a bounded list, no partition)
None joins the GATE population to the surfaces that CAUSE EXECUTION. That join is this organ.
THE EDGE DEFINITION IS THE QUESTION (measured 08-07: four definitions gave 75 / 0 / 2,043 / 30).
A gate counts as INVOKED only through a surface that runs it or collects its verdict:
CLOCK its own .elf is the organ of a clock row, OR its name appears in that row's ARGUMENTS
(clocksched- live, clockjobs- desired; measured: rows like `nx_sov_build_run.elf <gate>`
and `nx_law_warden.elf scan` carry args, so the organ column is split at its first space)
ROSTER its name is MENTIONED inside the source of an organ that IS on the clock (2-hop, e.g.
nx_estate_census_run -> nx_gatesubj.elf; nx_gfx_gates_beat -> "nx_gltf_load_gate"+".elf",
so the match is the identifier, not the .elf literal), or inside an organ listed in
knowledge/gateadjudicate_rosters.conf (off-host rosters such as the laptop's
nx_memplane_run, declared as DATA -- never a name baked in here)
GATES a knowledge/compare/*.gates row (the executed-evidence map nx_swcompare_evidence runs)
GATEREG a knowledge/gatereg.conf row (nx_gate_rollup collects its verdict)
GROSTER a knowledge/gateroster.conf row -- the data-driven roster nx_gate_roster_run runs on the
clock; counted as a surface ONLY while nx_gate_roster_run itself is a roster organ (on the
clock or in the rosters conf), otherwise the conf is a list nothing executes and is NOT
credited (printed as groster_inert=1 so the reader sees the missing clock row)
ACTLOG an MCP invocation on record in knowledge/status/actlog.jrnl (tail window, declared)
A mere MENTION of <gate>.elf in some other source is recorded as REF (something wants it) but is
NOT invocation -- report generators name their findings, and that class contaminated three
measurements in one hour on 08-07. ★ AN UNSTAMPED REPORT IS INDISTINGUISHABLE FROM A REGISTRY.
TRIAL the LATEST row for the gate in knowledge/status/gateroster.jrnl (nx_gate_roster_run's journal:
dependencies 3 imports · 0 importers
imports: nx_gatekit_lib.nxnx_estate_path.nxnx_clock_sched.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
| 108 | const GA_MAXF: i64 = 32768 // corpus files (gk_corpus_scan REFUSES past this, never truncates) |
| 109 | const GA_SLOT: i64 = 192 // bytes per corpus path slot |
| 110 | const GA_MAXG: i64 = 6144 // gates the table holds (REFUSE past it -- a silent cap is a smaller number that reads as better news) |
| 111 | const GA_GSLOT: i64 = 128 // bytes per gate name |
| 112 | const GA_MSG: i64 = 65536 |
| 113 | const GA_ROWCAP: i64 = 4194304 // rows artifact; refuse if exceeded |
| 114 | const GA_ACT_TAIL: i64 = 4194304 // actlog tail window (DECLARED: older invocations invisible) |
| 115 | const GA_STATBUF: i64 = 256 |
| 116 | const GA_MTIME_OFF: i64 = 88 // x86_64 struct stat: st_mtim.tv_sec |
| 117 | const GA_SEC_PER_DAY: i64 = 86400 |
| 118 | const GA_MAXCLK: i64 = 512 // clock/roster organ basenames (live + desired planes + conf) |
| 119 | const GA_MAXCLU: i64 = 4096 // distinct cluster keys (a full table prints FLOOR, never silently stops counting) |
| 120 | const GA_MAXLISTS: i64 = 8 // --list specs accepted per run (a clock row emits several worklists in one pass) |
| 121 | const GA_CLUSHOW: i64 = 60 // cluster lines printed (the rest are in the rows artifact; the count of hidden clusters is printed) |
| 122 | const GA_LOG: *u8 = "knowledge/status/gateadjudicate.log" |
| 123 | const GA_ROSTERS: *u8 = "knowledge/gateadjudicate_rosters.conf" |
| 124 | const GA_ALLOW: *u8 = "tool_allowlist.conf" |
| 125 | const GA_GATEREG: *u8 = "knowledge/gatereg.conf" |
| 126 | const GA_GROSTER: *u8 = "knowledge/gateroster.conf" |
| 127 | const GA_ROSTJRNL: *u8 = "knowledge/status/gateroster.jrnl" |
| 128 | const GA_BUILDJRNL: *u8 = "knowledge/status/gatebuild.jrnl" |
| 129 | const GA_BUILT_PREFIX: *u8 = "buildroot/_build/" |
| 130 | const GA_BUILT_SUFFIX: *u8 = ".sov" |
| 131 | const GA_ACTLOG: *u8 = "knowledge/status/actlog.jrnl" |
| 132 | const GA_STATUS: *u8 = "knowledge/status/" |
| 133 | const GA_CMP1: *u8 = "knowledge/compare/" |
| 134 | const GA_CMP2: *u8 = "buildroot/knowledge/compare/" |
| 135 | const GA_CLK_LIVE: *u8 = "knowledge/store/clocksched-" |
| 136 | const GA_CLK_WANT: *u8 = "knowledge/store/clockjobs-" |
functions
| 140 | func ga_isid(c: i64) -> i64 |
| 149 | func ga_endswith(s: *u8, suf: *u8) -> i64 |
| 159 | func ga_base(p: *u8) -> *u8 |
| 166 | func ga_gslot(g: *u8, i: i64) -> *u8 { return ((g as i64) + i * GA_GSLOT) as *u8 } |
| 167 | func ga_cslot(names: *u8, i: i64) -> *u8 { return ((names as i64) + i * GA_SLOT) as *u8 } |
| 170 | func ga_eqrun(s: *u8, p: *u8, n: i64) -> i64 |
| 179 | func ga_find(gn: *u8, ng: i64, p: *u8, n: i64) -> i64 |
| 186 | func ga_mtime(path: *u8, sb: *u8) -> i64 |
| 195 | func ga_appendline(path: *u8, line: *u8) -> i64 |
| 208 | func ga_scan_buf(buf: *u8, n: i64, gn: *u8, ng: i64, flag: *i64, cnt: *i64, first: *i64, refidx: i64, self: i64, want_elf: i64) -> i64 |
| 254 | func ga_stemoff(nm: *u8) -> i64 |
| 264 | func ga_eqrun_n(cb: *u8, off: i64, p: *u8, n: i64) -> i64 called by 1: ga_organ_exists |
| 271 | func ga_organ_exists(names: *u8, scanned: i64, p: *u8, n: i64) -> i64 |
| 286 | func ga_logmatch(gn: *u8, ng: i64, p: *u8, n: i64, flag: *i64, lastg: *i64, names: *u8, scanned: i64) -> i64 called by 2: ga_dirpassga_gateregpass calls 6: ga_gslotga_stemoffga_eqrunga_organ_existsgk_lenga_endswith |
| 324 | func ga_dirpass(dir: *u8, ext: *u8, mode: i64, gn: *u8, ng: i64, flag: *i64, age: *i64, now: i64, sb: *u8, ambig: *i64, names: *u8, scanned: i64) -> i64 |
| 383 | func ga_clockpass(prefix: *u8, gn: *u8, ng: i64, g_clock: *i64, ros: *u8, nros: *i64) -> i64 |
| 435 | func ga_rosterconf(path: *u8, ros: *u8, nros: *i64) -> i64 |
| 491 | func ga_jrnleq(b: *u8, rs: i64, re: i64, lit: *u8) -> i64 |
| 498 | func ga_jrnlpass(path: *u8, gn: *u8, ng: i64, trial: *i64) -> i64 |
| 556 | func ga_grosterpass(path: *u8, gn: *u8, ng: i64, flag: *i64) -> i64 |
| 600 | func ga_regpass(path: *u8, gn: *u8, ng: i64, g_reg: *i64) -> i64 |
| 629 | func ga_gateregpass(path: *u8, gn: *u8, ng: i64, flag: *i64, ambig: *i64, names: *u8, scanned: i64) -> i64 |
| 666 | func ga_actpass(path: *u8, gn: *u8, ng: i64, flag: *i64, winout: *i64) -> i64 |
| 687 | func ga_yn(msg: *u8, o: i64, v: i64) -> i64 |
| 692 | func main(argc: i64, argv: *i64) -> i64 |