nx_asset_meta_gate.nx
buildroot/runtime/nx_asset_meta_gate.nx
about
nx_asset_meta_gate.nx -- KAT + TEETH for nx_asset_meta + nx_asset_autotag (R3 of the universal
organization-tooling arc). ONE gate, both organs.
PROVES the catalog can know WHAT each asset IS and WHICH media are NEAR-duplicates:
(a) METADATA (KAT, REAL extraction):
- a REAL PNG byte buffer (signature + IHDR, width=320 height=200) -> am_enrich_image populates
width="320" / height="200" / encoding_format="image/png" extracted FROM THE BYTES;
- those fields ROUND-TRIP through R0's ar_encode -> ar_decode -> ar_get byte-faithfully;
- a DOC record -> am_enrich_doc populates dc:title + dc:subject, round-tripping the same way;
- TEETH: non-PNG bytes -> am_enrich_image refuses (AM_NOT_PNG), inventing NO dimensions.
(b) NEAR-DUP via perceptual hash:
- two NEAR-identical grayscale images (a small perturbation) -> at_neardup GROUPS them
(Hamming < threshold);
- two CLEARLY-DIFFERENT images -> NOT grouped (TEETH: no false-merge);
- identical bytes -> Hamming 0 AND same CID (ar_cid).
(c) THE WHOLE POINT -- perceptual hash catches a near-dup that exact-CID does NOT:
a 1-pixel-changed image has a DIFFERENT CID (ar_cid differs) but a near-zero Hamming distance
-> grouped. Both asserted (CID differs AND phash groups).
Verdict logged to knowledge/status/asset_meta_gate.log (append-only; ADDITIVE law #13).
expect_exit: 0 license_tier: ORIGINAL
dependencies 5 imports · 0 importers
imports: nx_syscalls.nxnx_asset_record.nxnx_asset_meta.nxnx_asset_autotag.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
| none |
functions
| 33 | func g_puts(logfd: i64, s: *u8) -> i64 |
| 40 | func g_putn(logfd: i64, v: i64) -> i64 |
| 54 | func g_streq(a: *u8, b: *u8) -> i64 called by 1: main |
| 64 | func E() -> *u8 { return "\x00" as *u8 } |
| 69 | func gate_make_png(raw: *u8, w: i64, h: i64) -> i64 called by 1: main |
| 88 | func gate_fill_gradient(g: *u8, w: i64, h: i64) -> i64 called by 1: main |
| 101 | func gate_memcpy(dst: *u8, src: *u8, n: i64) -> i64 called by 1: main |
| 107 | func main() -> i64 |