nx_uxf_cid.nx
buildroot/runtime/nx_uxf_cid.nx
about
nx_uxf_cid.nx -- UXF arc R1c: the SELF-DESCRIBING multicodec/profile CID, built ON TOP
of nx_canon_cid (do NOT touch the foundation -- Rule 19 additive, Rule 3 no patch cascade).
The substrate spec (knowledge/specs/2026-06-09-tutoring-storage-substrate-rung1.md) defines
CID = multihash + a multicodec(record-type) tag, but the shipped cid_of() omits the
multicodec. This adds it. The profiled CID carries a PROFILE/codec id that is:
(a) FOLDED INTO the hash -> same bytes under different profiles => different CID
(no cross-profile collision; still fully content-addressed within a profile), AND
(b) READABLE from the CID string -> an endpoint can pick the right view WITHOUT any
out-of-band schema = Law-1 endpoint-adaptive ; new profiles = new codec ids with
NO format change = Law-4 extensible (Rule 25: add an id, never a new format).
Profiled CID: "nxc1-" <2hex codec> "-" <64hex sha256(codec_byte || canon_bytes)> NUL (len 72)
No hardware/persistent writes (Rule 26). license_tier: ORIGINAL
dependencies 3 imports · 23 importers
diagram shows first 10 each side; +0 more imports, +13 more importers in the complete lists below.
imports: nx_syscalls.nxnx_sha256.nxnx_canon_cid.nx
imported by: nx_asset_record.nxnx_audio_gate.nxnx_benchmark_ref.nxnx_fb2_book_gate.nxnx_lib_uxf_ingest.nxnx_library_exceed.nxnx_m4b_gate.nxnx_nmz.nxnx_nmz_author.nxnx_nmz_comic_gate.nxnx_nmz_gate.nxnx_nmz_index.nxnx_nmz_native_gate.nxnx_nmz_pack.nxnx_uxf_cid_test.nxnx_uxf_config_test.nxnx_uxf_corpus_migrate.nxnx_uxf_corpus_persist.nxnx_uxf_decode_test.nxnx_uxf_media_asset_test.nxnx_uxf_tsv_migrate.nxnx_uxf_tsv_persist.nxnx_uxf_wms_bridge_test.nx
structs
| none |
consts
| 20 | const UXF_DATA: i64 = 1 |
| 21 | const UXF_DOC: i64 = 2 |
| 22 | const UXF_MEDIA: i64 = 3 |
| 23 | const UXF_CONFIG: i64 = 4 |
| 24 | const UXF_ARCHIVE: i64 = 5 |
functions
| 26 | func uxf_nib_hex(v: i64) -> i64 called by 1: uxf_cid_profiled |
| 31 | func uxf_hex_nib(b: i64) -> i64 called by 1: uxf_codec_of_cid |
| 39 | func uxf_cid_profiled(codec: i64, canon: *u8, n: i64, cid: *u8) -> i64 called by 24: ar_cid_profiledmainregister_refverify_refmainiu_record+18 calls 3: sys_mmapsha256_digestuxf_nib_hex |
| 62 | func uxf_codec_of_cid(cid: *u8) -> i64 |