nx_media_index_gate.nx
buildroot/runtime/nx_media_index_gate.nx
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
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
structs
| none |
consts
| 31 | const G_SCRATCH_DIR: *u8 = "/tmp/nx_media_index_gate" |
| 32 | const G_NOTPNG_PATH: *u8 = "/tmp/nx_media_index_gate/_notpng.bin" |
| 33 | const G_NOTPNG_BODY: *u8 = "hello not a png" |
| 34 | const G_MODE_755: i64 = 493 |
| 35 | const G_MODE_644: i64 = 420 |
| 36 | const G_PNG_W: i64 = 1024 |
| 37 | const G_PNG_H: i64 = 768 |
| 38 | const G_JPG_W: i64 = 250 |
| 39 | const G_JPG_H: i64 = 376 |
| 40 | const G_PNG_PATH: *u8 = "knowledge/staging/adnet/adnet_ha_library.png" |
| 41 | const G_JPG_PATH: *u8 = "knowledge/media/diora_baird/a5a3307c5482c87a34119ec185eb5fc53eb46bbdcdb1925c46d9f9f1b5e18a88.jpg" |
| 42 | const G_NOFILE_PATH: *u8 = "/tmp/nx_media_index_gate/_does_not_exist_xyz" |
functions
| 44 | func g_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: main |
| 46 | func g_report(label: *u8, o: *i64) -> i64 |
| 55 | func main() -> i64 |