code wiki / (root) / nx_nxa_texm_gate.nx

nx_nxa_texm_gate.nx

buildroot/runtime/nx_nxa_texm_gate.nx

15578 B342 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic nxa
docsdependenciesstructsconstsfunctions

about

nx_nxa_texm_gate.nx -- THE GATE FOR THE TEXM WRITER. SUBJECT: the nx_nxa_texm ELF, forked for real. The organ's contract is an EXIT CODE plus an ADDITIVE container rewrite, and /api/gate_run derives its verdict from the exit code -- so a gate that only read stdout would test the least load-bearing half. Every tooth asserts either an exit code or a byte read back out of the rewritten container. THE DANGEROUS FAILURE THIS GATE EXISTS TO CATCH is not "TEXM missing". It is TEXM PRESENT AND A PRE-EXISTING SECTION GONE. The floor score would RISE while the asset silently lost its rig, garments or hair -- a regression wearing a win, and exactly what an unverified section-append produces. T3 therefore enumerates ALL THIRTEEN pre-existing tags by name rather than spot- checking, and asserts the section count arithmetic closes. FIXTURES AT RUNTIME, IN /tmp/nx_nxa_texm_gate/, and every subject-created output is UNLINKED at SETUP. A gate that is not idempotent reports on its first run and lies about every run after -- a sibling gate hit exactly that today, where a conf left by an earlier run made correct behaviour read as FAIL. Setup also asserts the unlink WORKED before anything is measured. THE REAL ASSET IS READ, NEVER WRITTEN. Input is the shipped character; every output goes to /tmp. The organ never modifies its input, which is what makes an end-to-end gate on production data safe here. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_tool_run.nx nx_nxa_texm_gate.nx

imports: nx_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 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 ↻ gv_puts ↻ sys_mkdir sys_unlinkat tg_exists sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close gv_check gv_puts ↻ sys_mmap ↻ tg_nsec sys_mmap ↻ sys_read_file ↻ tg_rd64 gv_num

structs

none

consts

28const TG_SUBJECT_DEFAULT: *u8 = "_offc/nx_nxa_texm.elf"
40const TG_ASSET: *u8 = "/volume1/homes/elderwesto/nishihost/knowledge/bank/ref9d.nxa.pretexm-20260823"
43const TG_EXIT_OK: i64 = 0
44const TG_EXIT_BAD: i64 = 3
45const TG_EXIT_NOSEC: i64 = 4
48const TG_HDR: i64 = 32
49const TG_TOCE: i64 = 32
50const TG_OFF_FIELD: i64 = 8
51const TG_LEN_FIELD: i64 = 16
52const TG_NSEC: i64 = 16
53const TG_TAGB: i64 = 4
54const TG_WORD: i64 = 8
55const TG_RADIX: i64 = 256
56const TG_MASK: i64 = 255
57const TG_NXA_VER: i64 = 1
73const TG_GATE_RES: *u8 = "128"
74const TG_MIN_TEXM_WORDS: i64 = 8 // a TEXM smaller than its own header cannot carry a map
76const TG_CAPCAP: i64 = 262144
77const TG_ARGVN: i64 = 8
78const TG_MODEDIR: i64 = 493
80const TG_DIR: *u8 = "/tmp/nx_nxa_texm_gate"
81const TG_OUT1: *u8 = "/tmp/nx_nxa_texm_gate/o1.nxa"
82const TG_OUT2: *u8 = "/tmp/nx_nxa_texm_gate/o2.nxa"
83const TG_NOTEXC: *u8 = "/tmp/nx_nxa_texm_gate/notexc.nxa"
84const TG_OUT3: *u8 = "/tmp/nx_nxa_texm_gate/o3.nxa"

functions

86func tg_rd64(b: *u8, off: i64) -> i64
92func tg_wr64(b: *u8, off: i64, v: i64) -> i64
called by 1: tg_write_notexc
98func tg_tageq(b: *u8, off: i64, t: *u8) -> i64
called by 1: tg_find_len
104func tg_find_len(b: *u8, ns: i64, t: *u8) -> i64
called by 1: main calls 2: tg_tageqtg_rd64
113func tg_nsec(path: *u8, lenout: *i64) -> i64
called by 1: main calls 3: sys_mmapsys_read_filetg_rd64
121func tg_run(subject: *u8, a1: *u8, a2: *u8, a3: *u8, out: *u8, olen: *i64) -> i64
called by 1: main calls 2: sys_mmaptr_run_capture
130func tg_exists(path: *u8) -> i64
called by 1: main calls 2: sys_mmapsys_read_file
138func tg_write_notexc(path: *u8) -> i64
172func main(argc: i64, argv: *i64) -> i64