code wiki / (root) / nx_asset_meta.nx

nx_asset_meta.nx

buildroot/runtime/nx_asset_meta.nx

5946 B99 linesdepth 8pulls 11 transitivereach 4 importersview sourcekind librarytopic asset
docsdependenciesstructsconstsfunctions

about

nx_asset_meta.nx -- METADATA ENRICHMENT (R3 of the universal organization-tooling arc). Makes the catalog know WHAT each asset IS: it populates the type-specific metadata block plus the Dublin Core core spine ON an asset record, so downstream search/dedup/dashboard can answer "show me 1920x1080 PNGs" or "docs about taxes" without re-opening the bytes (org_research.tsv CONFIRMED: schema-mediaobject = width/height/duration/encodingFormat; dublin-core-core = title/creator/date/ subject; iptc-image-embedded = read intrinsic image facts from the bytes). ZERO NEW STORAGE/IDENTITY -- pure COMPOSITION over what already exists: * record field model + canonical encode/decode + CID -> nx_asset_record (ar_fields/ar_addf/ ar_encode/ar_decode/ar_get/ar_cid/ar_cpy) * REAL image header extraction (width/height/format) -> nx_png_header (png_check_sig / png_parse_ihdr / PngIhdr) [iptc-image-embedded] HONEST EXTRACTION BOUNDARY: * IMAGE (PNG): width / height / encoding_format are REAL-EXTRACTED from the actual bytes via the in-tree PNG header decoder (signature + IHDR). No PNG signature -> not a PNG; we do NOT fabricate dimensions (am_enrich_image returns AM_NOT_PNG and writes nothing -- deny-by-default honesty). * DOC / DATASET: there is no universal binary header carrying a title; the title/subject are PROVIDED (Dublin Core descriptive metadata is authored, not intrinsic). The model + API is the deliverable; real per-format extraction (e.g. JPEG/EXIF, MP4 boxes) wires in exactly here as new am_enrich_* paths, each reusing the same ar_addf record-extension idiom (#19 / #25). Pure/deterministic; no hardware/persistent-firmware writes (Rule 26). license_tier: ORIGINAL

dependencies 3 imports · 2 importers

nx_syscalls.nx nx_asset_record.nx nx_png_header.nx nx_asset_meta.nx nx_asset_ingest_lib.nx nx_asset_meta_gate.nx

imports: nx_syscalls.nxnx_asset_record.nxnx_png_header.nx

imported by: nx_asset_ingest_lib.nxnx_asset_meta_gate.nx

structs

none

consts

30const AM_NOT_PNG: i64 = 0 - 1 // bytes carry no PNG signature -> we refuse to invent dimensions

functions

35func am_itoa(v: i64, out: *u8) -> i64
called by 1: am_extract_image calls 1: sys_mmap
52func am_extract_image(bytes: *u8, len: i64, w_out: *u8, h_out: *u8, fmt_out: *u8) -> i64
69func am_enrich_image(bytes: *u8, len: i64, keys: *i64, vals: *i64, kv: *i64,
called by 1: main calls 2: am_extract_imagear_addf
83func am_enrich_doc(title: *u8, subject: *u8, keys: *i64, vals: *i64, kv: *i64) -> i64
called by 1: main calls 1: ar_addf
92func am_enrich_dc(title: *u8, creator: *u8, date: *u8, subject: *u8,
calls 1: ar_addf