code wiki / _hdl_build / nx_envelope_audit_gate.nx

nx_envelope_audit_gate.nx

buildroot/runtime/_hdl_build/nx_envelope_audit_gate.nx

17355 B306 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_envelope_audit_gate.nx -- TEETH FOR THE SILENT-CAP DETECTOR, because on 2026-08-20 it HAD ONE. WHY THIS GATE EXISTS. nx_envelope_audit is the estate's enforcer of the scale-law ("every tool DECLARES its envelope IN ITS OUTPUT -- silent capping is forbidden BY CONSTRUCTION"). It shipped for weeks with a row-cap gate wrapping its whole per-row body and a row counter that only incremented INSIDE that gate, so every allowlist row past the cap was dropped with no counter and no marker -- and its dogfood line then printed the cap as a HAND-TYPED literal, which reads as a population. Measured: it reported rows=512 against a tool_allowlist.conf whose true data-row count is over a thousand. ***THE ENFORCER COMMITTED THE DEFECT IT ENFORCES, AND ITS OWN OUTPUT WAS THE ALIBI.*** A green that never had a corresponding red is unverified, so every tooth below is paired with the input that must make it fail. HERMETIC BY CONSTRUCTION. The subject resolves its probe dirs (buildroot/runtime/_hdl_build, then buildroot/runtime) RELATIVE TO CWD, so this gate builds a complete throwaway probe tree under /tmp/nx_envelope_audit_gate/ and chdirs into it. Nothing here touches a production path, nothing shares a fixture with a beat, and the fixtures are rebuilt every run so the gate is idempotent -- a gate that is not idempotent reports on its first run and lies about every run after. The fixture SOURCES are assembled at RUNTIME, never stored as files in the tree, because a detector that scans source will otherwise find its own test fixture -- and writing the pattern in a comment re-arms that trap, since prose is source bytes too. SUBJECT: the DEPLOYED nx_envelope_audit elf (serving root, then _offc, then a local _build). If none resolves the gate SKIPs via gv_need -- "I could not look" is not "it is broken". license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_gatekit_lib.nx nx_envelope_audit_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_gatekit_lib.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 ↻ sys_mmap ↻ gk_exists sys_openat_rd sys_close gk_cat gv_need gv_puts ↻ gv_verdict gv_note_bare_rate gv_bare_rate gv_at gv_obj_has_n gv_at ↻ gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_puts ↻ gv_num ↻

structs

none

consts

29const EG_DIR: *u8 = "/tmp/nx_envelope_audit_gate"
30const EG_BR: *u8 = "/tmp/nx_envelope_audit_gate/buildroot"
31const EG_RT: *u8 = "/tmp/nx_envelope_audit_gate/buildroot/runtime"
32const EG_HDL: *u8 = "/tmp/nx_envelope_audit_gate/buildroot/runtime/_hdl_build"
33const EG_CONF: *u8 = "/tmp/nx_envelope_audit_gate/f.conf"
34const EG_SMALL: *u8 = "/tmp/nx_envelope_audit_gate/small.conf"
35const EG_HUGE: *u8 = "/tmp/nx_envelope_audit_gate/huge.conf"
36const EG_O1: *u8 = "/tmp/nx_envelope_audit_gate/o1.log"
37const EG_O2: *u8 = "/tmp/nx_envelope_audit_gate/o2.log"
38const EG_O3: *u8 = "/tmp/nx_envelope_audit_gate/o3.log"
40const EG_S1: *u8 = "/tmp/nx_envelope_audit_gate/buildroot/runtime/_hdl_build/egsilent.nx"
41const EG_S2: *u8 = "/tmp/nx_envelope_audit_gate/buildroot/runtime/_hdl_build/egdecl.nx"
42const EG_S3: *u8 = "/tmp/nx_envelope_audit_gate/buildroot/runtime/_hdl_build/egcmt.nx"
43const EG_S4: *u8 = "/tmp/nx_envelope_audit_gate/buildroot/runtime/_hdl_build/egplain.nx"
45const EG_SUBJ1: *u8 = "/volume1/homes/elderwesto/nishihost/nx_envelope_audit.elf"
46const EG_SUBJ2: *u8 = "/volume1/homes/elderwesto/nishihost/_offc/nx_envelope_audit.elf"
47const EG_SUBJ3: *u8 = "/mnt/c/Users/elder/nishi-core/nxc2/_build/nx_envelope_audit.sov.elf"
59const EG_N_SILENT: i64 = 1200
60const EG_N_DECL: i64 = 7
61const EG_N_CMT: i64 = 5
62const EG_N_PLAIN: i64 = 3
63const EG_N_MISS: i64 = 2
66const EG_N_SMALL: i64 = 2
68const EG_N_HUGE: i64 = 14000
70const EG_CAPBUF: i64 = 1048576
71const EG_CONFBUF: i64 = 2097152
72const EG_PATHB: i64 = 512
73const EG_TAB: i64 = 9
74const EG_NL: i64 = 10
75const EG_HASH: i64 = 35

functions

77func eg_wr(path: *u8, buf: *u8, n: i64) -> i64
87func eg_row(b: *u8, o: i64, nm: *u8, idx: i64, base: *u8) -> i64
called by 1: eg_rows calls 2: gk_catgk_catn
99func eg_rows(b: *u8, o: i64, nm: *u8, base: *u8, cnt: i64) -> i64
calls 1: eg_row
106func eg_hashrow(b: *u8, o: i64) -> i64
calls 1: gk_cat
116func eg_num_after(buf: *u8, n: i64, needle: *u8) -> i64
133func eg_last_line_is(buf: *u8, n: i64, want: *u8) -> i64
calls 1: gk_len
152func main(argc: i64, argv: *i64) -> i64