nx_asset_record.nx
buildroot/runtime/nx_asset_record.nx
about
nx_asset_record.nx -- UNIVERSAL ORGANIZATION TOOLING arc, R0.
THE unified, content-addressed ASSET RECORD: every artifact (a generated image, a downloaded
video, a doc, a dataset, an audio clip, a product) BECOMES one of these -- one model, all kinds
(org_research.tsv: unified-base-type, schema.org CreativeWork is the base, subtypes specialize).
Keyed by its CID (content-addressed-id): same bytes -> same id everywhere; any byte change ->
a different id (the inventory's self-proof of integrity).
THE BACKBONE NEEDS ZERO NEW STORAGE/IDENTITY/CRYPTO -- this organ is pure COMPOSITION:
* identity + canonical serialize -> nx_canon_cid (canon_encode / cid_of)
* tolerant decode -> nx_uxf_decode (canon_decode) [house-of-cards safe]
* self-describing profiled CID -> nx_uxf_cid (uxf_cid_profiled, codec=UXF_DATA)
* durable segmented KV store -> nx_seg_store (ss_begin/ss_add/ss_build_keys/ss_commit/
ss_open/ss_hget), key = the record's CID
A record is a SET OF (key,value) string fields fed to canon_encode -> exactly one canonical
byte string -> exactly one CID (insertion order is irrelevant by construction; canon_encode
key-sorts). Field ACCESS is by key name over a decoded (keys[],vals[]) pair -- never struct-field
aliasing (heap-mmap + buffer/offset idiom only, per the build rules).
RECORD MODEL (cited to org_research.tsv CONFIRMED claims):
type image|video|doc|dataset|audio|product (unified-base-type)
-- Dublin Core core spine (dublin-core-core): -----------------------------------------
title dc:title
creator dc:creator
date dc:date (created/issued, ISO-8601 string)
identifier dc:identifier (external/native id; CID is the PRIMARY id, this is a sidecar)
subject dc:subject (free-text subject line; tags[] is the keyword facet)
rights dc:rights
-- W3C PROV provenance class (provenance-class-three; entity<-activity<-agent shape): -----
prov_class human | machine | downloaded
prov_agent person name | software name | "external"
prov_tool (machine) the generating tool/app
prov_model (machine) the model id
prov_source (downloaded) the source URL
prov_date (downloaded) the fetch date
-- type-specific MEDIA block (schema-mediaobject; only meaningful for image/video/audio): --
width / height / duration / encoding_format
-- organization facets: ---------------------------------------------------------------
tags comma-joined keyword facet (faceted-findability)
location where the bytes live (path / NAS volume / URL)
dependencies 5 imports · 23 importers
diagram shows first 10 each side; +0 more imports, +13 more importers in the complete lists below.
imports: nx_syscalls.nxnx_canon_cid.nxnx_uxf_cid.nxnx_uxf_decode.nxnx_seg_store.nx
imported by: nx_asset_access.nxnx_asset_access_gate.nxnx_asset_catalog.nxnx_asset_catalog_gate.nxnx_asset_dashboard_gate.nxnx_asset_dashboard_lib.nxnx_asset_exceed_gate.nxnx_asset_ingest_lib.nxnx_asset_ingest_real_gate.nxnx_asset_merkle_gate.nxnx_asset_meta.nxnx_asset_meta_gate.nxnx_asset_record_gate.nxnx_asset_search.nxnx_asset_search_gate.nxnx_asset_signals.nxnx_asset_signals_gate.nxnx_asset_status.nxnx_asset_status_gate.nxnx_asset_visibility.nxnx_asset_visibility_gate.nxnx_doc_catalog.nxnx_doc_catalog_gate.nx
structs
| none |
consts
| none |
functions
| 57 | func ar_len(s: *u8) -> i64 |
| 63 | func ar_streq(a: *u8, b: *u8) -> i64 |
| 74 | func ar_present(v: *u8) -> i64 |
| 82 | func ar_addf(keys: *i64, vals: *i64, kv: *i64, key: *u8, val: *u8) -> i64 called by 6: am_enrich_imageam_enrich_docam_enrich_dcmainar_fieldsdc_catalog_doc calls 1: ar_present |
| 98 | func ar_encode(keys: *i64, vals: *i64, n: i64, out: *u8) -> i64 |
| 111 | func ar_fields(core: *i64, prov: *i64, media: *i64, org: *i64, keys: *i64, vals: *i64) -> i64 |
| 142 | func ar_cid(bytes: *u8, n: i64, cid: *u8) -> i64 |
| 148 | func ar_cid_profiled(bytes: *u8, n: i64, cid: *u8) -> i64 calls 1: uxf_cid_profiled |
| 155 | func ar_decode(bytes: *u8, n: i64, out_keys: *i64, out_vals: *i64, maxf: i64) -> i64 |
| 160 | func ar_get(keys: *i64, vals: *i64, nf: i64, key: *u8) -> *u8 |
| 174 | func ar_put(prefix: *u8, bytes: *u8, n: i64) -> i64 |
| 187 | func ar_get_by_cid(prefix: *u8, cid: *u8, ptrout: *i64, lenout: *i64) -> i64 |
| 206 | func ar_cpy(dst: *u8, src: *u8) -> *u8 |
| 214 | func ar_prov_human(person: *u8, out_class: *u8, out_agent: *u8) -> i64 |
| 222 | func ar_prov_machine(tool: *u8, model: *u8, out_class: *u8, out_agent: *u8, out_tool: *u8, out_model: *u8) -> i64 |
| 232 | func ar_prov_downloaded(source_url: *u8, fetch_date: *u8, out_class: *u8, out_agent: *u8, out_source: *u8, out_date: *u8) -> i64 |