code wiki / _hdl_build / nx_gateadjudicate.nx

nx_gateadjudicate.nx

buildroot/runtime/_hdl_build/nx_gateadjudicate.nx

70748 B1329 linesdepth 6pulls 14 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

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

nx_gatekit_lib.nx nx_estate_path.nx nx_clock_sched.nx nx_gateadjudicate.nx

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

main gk_streq gk_cat gk_say gk_write_all sys_write ep_anchor sys_openat_rd sys_close sys_chdir 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 ↻ gk_corpus_scan sys_mmap ↻ gk_corpus_root sys_mmap ↻ gk_cat ↻ gk_exists sys_openat_rd ↻ sys_close ↻ gk_corpus_hdl gk_corpus_root ↻ gk_len gk_cat ↻ gk_dirscan gk_dirscan_ext sys_openat_rd ↻

structs

none

consts

108const GA_MAXF: i64 = 32768 // corpus files (gk_corpus_scan REFUSES past this, never truncates)
109const GA_SLOT: i64 = 192 // bytes per corpus path slot
110const GA_MAXG: i64 = 6144 // gates the table holds (REFUSE past it -- a silent cap is a smaller number that reads as better news)
111const GA_GSLOT: i64 = 128 // bytes per gate name
112const GA_MSG: i64 = 65536
113const GA_ROWCAP: i64 = 4194304 // rows artifact; refuse if exceeded
114const GA_ACT_TAIL: i64 = 4194304 // actlog tail window (DECLARED: older invocations invisible)
115const GA_STATBUF: i64 = 256
116const GA_MTIME_OFF: i64 = 88 // x86_64 struct stat: st_mtim.tv_sec
117const GA_SEC_PER_DAY: i64 = 86400
118const GA_MAXCLK: i64 = 512 // clock/roster organ basenames (live + desired planes + conf)
119const GA_MAXCLU: i64 = 4096 // distinct cluster keys (a full table prints FLOOR, never silently stops counting)
120const GA_MAXLISTS: i64 = 8 // --list specs accepted per run (a clock row emits several worklists in one pass)
121const GA_CLUSHOW: i64 = 60 // cluster lines printed (the rest are in the rows artifact; the count of hidden clusters is printed)
122const GA_LOG: *u8 = "knowledge/status/gateadjudicate.log"
123const GA_ROSTERS: *u8 = "knowledge/gateadjudicate_rosters.conf"
124const GA_ALLOW: *u8 = "tool_allowlist.conf"
125const GA_GATEREG: *u8 = "knowledge/gatereg.conf"
126const GA_GROSTER: *u8 = "knowledge/gateroster.conf"
127const GA_ROSTJRNL: *u8 = "knowledge/status/gateroster.jrnl"
128const GA_BUILDJRNL: *u8 = "knowledge/status/gatebuild.jrnl"
129const GA_BUILT_PREFIX: *u8 = "buildroot/_build/"
130const GA_BUILT_SUFFIX: *u8 = ".sov"
131const GA_ACTLOG: *u8 = "knowledge/status/actlog.jrnl"
132const GA_STATUS: *u8 = "knowledge/status/"
133const GA_CMP1: *u8 = "knowledge/compare/"
134const GA_CMP2: *u8 = "buildroot/knowledge/compare/"
135const GA_CLK_LIVE: *u8 = "knowledge/store/clocksched-"
136const GA_CLK_WANT: *u8 = "knowledge/store/clockjobs-"

functions

140func ga_isid(c: i64) -> i64
149func ga_endswith(s: *u8, suf: *u8) -> i64
159func ga_base(p: *u8) -> *u8
166func ga_gslot(g: *u8, i: i64) -> *u8 { return ((g as i64) + i * GA_GSLOT) as *u8 }
167func ga_cslot(names: *u8, i: i64) -> *u8 { return ((names as i64) + i * GA_SLOT) as *u8 }
called by 2: ga_organ_existsmain
170func ga_eqrun(s: *u8, p: *u8, n: i64) -> i64
179func ga_find(gn: *u8, ng: i64, p: *u8, n: i64) -> i64
186func ga_mtime(path: *u8, sb: *u8) -> i64
called by 2: ga_dirpassmain
195func ga_appendline(path: *u8, line: *u8) -> i64
called by 1: main calls 2: gk_lengk_write_all
208func 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
254func ga_stemoff(nm: *u8) -> i64
called by 2: ga_logmatchmain
264func ga_eqrun_n(cb: *u8, off: i64, p: *u8, n: i64) -> i64
called by 1: ga_organ_exists
271func ga_organ_exists(names: *u8, scanned: i64, p: *u8, n: i64) -> i64
286func ga_logmatch(gn: *u8, ng: i64, p: *u8, n: i64, flag: *i64, lastg: *i64, names: *u8, scanned: i64) -> i64
324func 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
383func ga_clockpass(prefix: *u8, gn: *u8, ng: i64, g_clock: *i64, ros: *u8, nros: *i64) -> i64
435func ga_rosterconf(path: *u8, ros: *u8, nros: *i64) -> i64
called by 1: main calls 3: gk_eolga_isidga_gslot
491func ga_jrnleq(b: *u8, rs: i64, re: i64, lit: *u8) -> i64
called by 1: ga_jrnlpass calls 1: gk_len
498func ga_jrnlpass(path: *u8, gn: *u8, ng: i64, trial: *i64) -> i64
called by 1: main calls 3: gk_eolga_findga_jrnleq
556func ga_grosterpass(path: *u8, gn: *u8, ng: i64, flag: *i64) -> i64
called by 1: main calls 2: gk_eolga_find
600func ga_regpass(path: *u8, gn: *u8, ng: i64, g_reg: *i64) -> i64
called by 1: main calls 2: gk_eolga_find
629func ga_gateregpass(path: *u8, gn: *u8, ng: i64, flag: *i64, ambig: *i64, names: *u8, scanned: i64) -> i64
called by 1: main calls 2: gk_eolga_logmatch
666func ga_actpass(path: *u8, gn: *u8, ng: i64, flag: *i64, winout: *i64) -> i64
called by 1: main calls 1: ga_scan_buf
687func ga_yn(msg: *u8, o: i64, v: i64) -> i64
called by 1: main calls 1: gk_cat
692func main(argc: i64, argv: *i64) -> i64