code wiki / _hdl_build / nx_gate_rollup.nx

nx_gate_rollup.nx

buildroot/runtime/_hdl_build/nx_gate_rollup.nx

9348 B171 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind tooltopic gate
docsdependenciesstructsconstsfunctions

about

nx_gate_rollup.nx -- ONE ANSWER TO "ARE ALL THE GATES GREEN?" (eats debt seq986). WHY THIS EXISTS (measured 2026-07-25): the tickless clock daemon dispatches gate jobs on schedule, but clk_dispatch_run counts a job as dispatched whenever it merely RAN -- it never distinguishes exit 0 from exit 1 and discards the child's stdout. So each gate now appends its own verdict to knowledge/status/ <gate>.log. That made a RED DURABLE, but durable is not the same as SURFACED: a line in a file nobody reads still fails silently. This organ is the reader. SURVEYED FIRST (operator standing instruction, don't duplicate): nx_ecosystem_maturity_rollup exists but answers a DIFFERENT question from a DIFFERENT source (maturity depth x breadth from the ecomat seg_store + autonomy ledger). nx_deploy_ready is a pre-deploy safety gate. Neither reads gate verdict logs. There are 91 knowledge/status/*.log files and nothing rolls up their verdicts -- this is genuinely net-new. DATA-DRIVEN (rule 11): the roster lives in the plane `knowledge/store/gatereg-` as id | gate-banner | log-path so registering a new gate is a STORE ROW, not a rebuild of this organ. FAIL-CLOSED: a log that is MISSING, EMPTY, or whose newest line carries no verdict= is reported as UNKNOWN and counted RED. "I could not tell" must never read as "fine" -- that is the whole failure mode this organ exists to remove. D001: emits a `verdict=` anchor. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 3 imports · 0 importers

nx_gate_lib.nx nx_gate_verdict_lib.nx nx_syscalls.nx nx_gate_rollup.nx

imports: nx_gate_lib.nxnx_gate_verdict_lib.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 gv_slurp sys_openat_rd sys_read sys_close gl_puts sys_write gl_slen sys_exit gv_last_line gv_is_pass gv_contains gv_len gl_bcat gl_log sys_openat_append sys_mmap ↻ gl_bcatn sys_mmap ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real gl_bcat ↻ sys_write ↻ sys_close ↻ tr_run_capture sys_mmap ↻ sys_pipe2 sys_fork sys_close ↻ sys_dup3 sys_execve_clean sys_close ↻ sys_execve sys_exit ↻ sys_read ↻ sys_wait4 wait_exit_code gl_putn

structs

none

consts

26const GR_MAGIC_65536: i64 = 65536
27const GR_MAGIC_4096: i64 = 4096
28const GR_MAGIC_1024: i64 = 1024
30const GR_CONF: *u8 = "knowledge/gatereg.conf"
31const GR_LOGCAP: i64 = 262144
32const GR_EXIT_RED: i64 = 1

functions

41func main(argc: i64, argv: *i64) -> i64