code wiki / (root) / nx_media_index_gate.nx

nx_media_index_gate.nx

buildroot/runtime/nx_media_index_gate.nx

7362 B133 linesdepth 10pulls 36 transitivereach 0 importersview sourcekind gate/prooftopic media
docsdependenciesstructsconstsfunctions

about

nx_media_index_gate.nx -- REFEREE for EXPOSURE rung X1 (nx_media_index). Calls nx_mindex_tag_path on REAL inputs and asserts the pipeline: a real gallery PNG decodes and tags (proving decode + presence run INSIDE the indexer on a real file), a non-PNG is rejected cleanly, a missing path is handled, and a real JPEG person-photo decodes at its known dimensions. The presence VERDICT on the real photo is REPORTED, never asserted to a fixed value -- the content is unknown, and the presence MATH is already gated by nx_presence_gate. license_tier: ORIGINAL D001 MIGRATION 2026-09-01 (/compare/mediaingest). This gate had no elf: /api/promote refuses a gate that rolls its own verdict, so it could never become an artifact and this domain's evidence base carried its NAME without its RESULT. Three things changed, and only the third is cosmetic: 1. EIGHT CONJUNCTS BECAME EIGHT TEETH. The old main() ANDed eight assertions into one `ok` boolean and printed a single verdict. A ONE-STATE JUDGE CANNOT SAY WHICH CONJUNCT FAILED -- it reports RED and the reader re-derives the whole thing by hand. Worse, a tooth that silently stops running lowers nothing, because there was no denominator. gv_ctr/gv_check make declared == executed by construction and name the failure. 2. THE ABSENT-FIXTURE CASE NOW ABSTAINS INSTEAD OF FAILING. Two teeth read specific files from the live library. If one of those is moved or reaped, the old gate went RED -- indistinguishable from the INDEXER being broken, which is the alarming misreading of a healthy system. gv_need degrades those to SKIP and says so. An axis that cannot see must abstain, never acquit AND never convict. 3. THE SCRATCH FILE MOVED OUT OF THE SHARED TREE. The old gate wrote its NOTPNG fixture into knowledge/staging/media/, which a production beat also walks -- a gate must not share its fixture with production, or its RED tracks the fixture rather than the code. It now writes /tmp/<gate>/, created at SETUP (a teardown does not run when a run crashes).

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_media_index.nx nx_gate_verdict.nx nx_media_index_gate.nx

imports: nx_syscalls.nxnx_media_index.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main gv_head gv_puts sys_write 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 ↻ sys_mkdir sys_openat_wr sys_write ↻ g_len sys_close sys_mmap ↻ nx_mindex_tag_path sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close ↻ nx_png_decode sys_mmap ↻ _png_check_signature _png_read_u32_be nx_crc32

structs

none

consts

31const G_SCRATCH_DIR: *u8 = "/tmp/nx_media_index_gate"
32const G_NOTPNG_PATH: *u8 = "/tmp/nx_media_index_gate/_notpng.bin"
33const G_NOTPNG_BODY: *u8 = "hello not a png"
34const G_MODE_755: i64 = 493
35const G_MODE_644: i64 = 420
36const G_PNG_W: i64 = 1024
37const G_PNG_H: i64 = 768
38const G_JPG_W: i64 = 250
39const G_JPG_H: i64 = 376
40const G_PNG_PATH: *u8 = "knowledge/staging/adnet/adnet_ha_library.png"
41const G_JPG_PATH: *u8 = "knowledge/media/diora_baird/a5a3307c5482c87a34119ec185eb5fc53eb46bbdcdb1925c46d9f9f1b5e18a88.jpg"
42const G_NOFILE_PATH: *u8 = "/tmp/nx_media_index_gate/_does_not_exist_xyz"

functions

44func g_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: main
46func g_report(label: *u8, o: *i64) -> i64
called by 1: main calls 2: gv_putsgv_num
55func main() -> i64