code wiki / (root) / nx_asset_ingest_lib.nx

nx_asset_ingest_lib.nx

buildroot/runtime/nx_asset_ingest_lib.nx

8039 B154 linesdepth 9pulls 13 transitivereach 2 importersview sourcekind librarytopic asset
docsdependenciesstructsconstsfunctions

about

nx_asset_ingest_lib.nx -- shared ingest CORES for the production catalog populator (R5). Factored out of nx_asset_ingest_real so BOTH the runnable populator (nx_asset_ingest_real, keeps main() + the slug list) AND its gate (nx_asset_ingest_real_gate) drive the SAME real read -> record -> dedup pipeline (DRY #15; mirrors _pdf_reflow_lib shared by the reader + its gate). The *_at cores take an ARBITRARY catalog prefix + an ARBITRARY full path so a gate can exercise them against fixtures + a fresh /tmp catalog (never the production store). NO main(). license_tier: ORIGINAL

dependencies 4 imports · 2 importers

nx_syscalls.nx nx_asset_record.nx nx_asset_catalog.nx nx_asset_meta.nx nx_asset_ingest_lib.nx nx_asset_ingest_real.nx nx_asset_ingest_real_gate.nx

imports: nx_syscalls.nxnx_asset_record.nxnx_asset_catalog.nxnx_asset_meta.nx

imported by: nx_asset_ingest_real.nxnx_asset_ingest_real_gate.nx

structs

none

consts

12const K_MAGIC_4194304: i64 = 4194304
13const K_MAGIC_8192: i64 = 8192
14const K_MAGIC_2097152: i64 = 2097152

functions

18func ai_prefix() -> *u8 { return "knowledge/store/asset-catalog-\x00" as *u8 }
23func ai_w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
24func ai_num(v: i64) -> i64
32func ai_cat(dst: *u8, off: i64, src: *u8) -> i64 { var i: i64 = 0; while src[i] != (0 as u8) { dst[off + i] = src[i]; i = i + 1 } dst[off + i] = 0 as u8; return off + i }
33func E() -> *u8 { return "\x00" as *u8 }
34func sset(a: *i64, i: i64, s: *u8) -> i64 { a[i] = s as i64; return 0 }
39func ai_read_cap(path: *u8, cap: i64, out_len: *i64) -> *u8
59func ai_mk_rec(core: *i64, prov: *i64, media: *i64, org: *i64, out: *u8) -> i64
69func ai_ingest_doc_at(cat_prefix: *u8, path: *u8, slug: *u8, title: *u8, date: *u8, tags: *u8, builder: *u8) -> i64
100func ai_ingest_doc(slug: *u8, file_rel: *u8, title: *u8, date: *u8, tags: *u8, builder: *u8) -> i64
110func ai_ingest_image_at(cat_prefix: *u8, path: *u8, fname: *u8, title: *u8, date: *u8, tags: *u8) -> i64
149func ai_ingest_image(fname: *u8, title: *u8, date: *u8, tags: *u8) -> i64