code wiki / _hdl_build / nx_library.nx
nx_library.nx
buildroot/runtime/_hdl_build/nx_library.nx
about
nx_library.nx -- the SOVEREIGN NISHI LIBRARY: a content-addressed corpus of ingested external documents
(science-body papers/tables/pages) so we OWN the bytes and NEVER suffer link rot. Each document is stored
by its CID (nx_canon_cid via nx_asset_catalog -> dedup + a running index for free), with a metadata record
(source URL, title, fetch date, size) in a parallel seg_store. Retrieval is by CID, so it works forever even
after the external source disappears -- that IS the no-link-rot guarantee, by construction.
Reuses (DRY): nx_asset_catalog (cat_ingest_cid = store-by-CID + dedup + index; cat_get; cat_count; cat_list)
+ nx_seg_store + nx_canon_cid. Pairs with nx_ingest_foundation (each doc is also CID+ed25519-provenance+
lineage-to-god). No main -- library. license_tier: ORIGINAL
dependencies 5 imports · 12 importers
diagram shows first 10 each side; +0 more imports, +2 more importers in the complete lists below.
imports: nx_syscalls.nxnx_asset_catalog.nxnx_seg_store.nxnx_canon_cid.nxnx_uxf_decode.nx
imported by: nx_library_consume.nxnx_library_foundation.nxnx_library_foundation_gate.nxnx_library_gate.nxnx_research_deliver.nxnx_research_discover_gate.nxnx_research_discover_matmul_gate.nxnx_research_phys_gate.nxnx_research_query.nxnx_research_sim_gate.nxnx_scilib_build.nxnx_scilib_page.nx
structs
| none |
consts
| 15 | const K_MAGIC_4194304: i64 = 4194304 |
| 16 | const K_MAGIC_2048: i64 = 2048 |
| 18 | const LIB: *u8 = "knowledge/store/scilib-" |
| 19 | const LIBMETA: *u8 = "knowledge/store/scilib-meta-" |
functions
| 21 | func lib_itoa(v: i64, dst: *u8) -> i64 { var m: i64=v; let t: *u8=sys_mmap(24); var k: i64=0; if m==0{t[0]=48 as u8;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{dst[i]=t[k-1-i];i=i+1} dst[k]=0 as u8; return k } |
| 23 | func lib_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 34 | func lib_ingest(raw_path: *u8, source: *u8, title: *u8, date: *u8, cidout: *u8) -> i64 called by 4: cons_onelf_onemainsb_ingest calls 10: sys_mmaplib_readcat_ingest_cidCAT_NEWlib_itoacanon_encode+4 |
| 57 | func lib_get(cid: *u8, ptrout: *i64, lenout: *i64) -> i64 { return cat_get(LIB, cid, ptrout, lenout) } called by 7: rd_researchrs_lib_containsrs_lib_containsrs_lib_containsrq_searchrs_lib_contains+1 calls 1: cat_get |
| 60 | func lib_count() -> i64 { return cat_count(LIB) } |
| 63 | func lib_list(out_cids: *i64, cap: i64) -> i64 { return cat_list(LIB, out_cids, cap) } called by 7: rd_researchrs_lib_containsrs_lib_containsrs_lib_containsrq_searchrs_lib_contains+1 calls 1: cat_list |
| 66 | func lib_meta(cid: *u8, key: *u8, out: *u8, cap: i64) -> i64 |