nx_nxa_texm_gate.nx
buildroot/runtime/nx_nxa_texm_gate.nx
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
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
structs
| none |
consts
| 28 | const TG_SUBJECT_DEFAULT: *u8 = "_offc/nx_nxa_texm.elf" |
| 40 | const TG_ASSET: *u8 = "/volume1/homes/elderwesto/nishihost/knowledge/bank/ref9d.nxa.pretexm-20260823" |
| 43 | const TG_EXIT_OK: i64 = 0 |
| 44 | const TG_EXIT_BAD: i64 = 3 |
| 45 | const TG_EXIT_NOSEC: i64 = 4 |
| 48 | const TG_HDR: i64 = 32 |
| 49 | const TG_TOCE: i64 = 32 |
| 50 | const TG_OFF_FIELD: i64 = 8 |
| 51 | const TG_LEN_FIELD: i64 = 16 |
| 52 | const TG_NSEC: i64 = 16 |
| 53 | const TG_TAGB: i64 = 4 |
| 54 | const TG_WORD: i64 = 8 |
| 55 | const TG_RADIX: i64 = 256 |
| 56 | const TG_MASK: i64 = 255 |
| 57 | const TG_NXA_VER: i64 = 1 |
| 73 | const TG_GATE_RES: *u8 = "128" |
| 74 | const TG_MIN_TEXM_WORDS: i64 = 8 // a TEXM smaller than its own header cannot carry a map |
| 76 | const TG_CAPCAP: i64 = 262144 |
| 77 | const TG_ARGVN: i64 = 8 |
| 78 | const TG_MODEDIR: i64 = 493 |
| 80 | const TG_DIR: *u8 = "/tmp/nx_nxa_texm_gate" |
| 81 | const TG_OUT1: *u8 = "/tmp/nx_nxa_texm_gate/o1.nxa" |
| 82 | const TG_OUT2: *u8 = "/tmp/nx_nxa_texm_gate/o2.nxa" |
| 83 | const TG_NOTEXC: *u8 = "/tmp/nx_nxa_texm_gate/notexc.nxa" |
| 84 | const TG_OUT3: *u8 = "/tmp/nx_nxa_texm_gate/o3.nxa" |
functions
| 86 | func tg_rd64(b: *u8, off: i64) -> i64 |
| 92 | func tg_wr64(b: *u8, off: i64, v: i64) -> i64 called by 1: tg_write_notexc |
| 98 | func tg_tageq(b: *u8, off: i64, t: *u8) -> i64 called by 1: tg_find_len |
| 104 | func tg_find_len(b: *u8, ns: i64, t: *u8) -> i64 |
| 113 | func tg_nsec(path: *u8, lenout: *i64) -> i64 |
| 121 | func tg_run(subject: *u8, a1: *u8, a2: *u8, a3: *u8, out: *u8, olen: *i64) -> i64 |
| 130 | func tg_exists(path: *u8) -> i64 |
| 138 | func tg_write_notexc(path: *u8) -> i64 |
| 172 | func main(argc: i64, argv: *i64) -> i64 |