nx_dms_catalog.nx
buildroot/runtime/nx_dms_catalog.nx
about
nx_dms_catalog.nx -- the consent-gated media catalog (DMS spine, rung 3).
A media asset is content-addressed (content_hash) and tagged with the
talent + use_scope it depicts/serves. THE property:
nx_dms_is_visible(cat, rights, asset, now) -> 1 only if the asset is
ACTIVE *and* its (talent, use) is CURRENTLY licensed in the rights
ledger.
So the catalog surfaces ONLY licensed media BY CONSTRUCTION -- revoke or
expire a performer's license and their assets stop surfacing the same
instant, with no separate sweep. Removal is soft (additive law #13: the
row is kept as history, never hard-deleted). Adds are idempotent on
content_hash (rule #10: same bytes catalogued twice = one row).
Composes nx_rights_ledger (the gate) + the shared NxUseScope enum.
RUNG 1 (this file): semantics, in-memory. Durability via nx_seg_store
snapshot (mirroring nx_rights_ledger_store) + per-asset canon_cid CID =
later rung (flagged, NOT a silent cap).
license_tier: ORIGINAL
dependencies 2 imports · 6 importers
imports: nx_syscalls.nxnx_rights_ledger.nx
imported by: nx_dms_catalog_gate.nxnx_dms_catalog_store.nxnx_dms_catalog_store_gate.nxnx_dms_search.nxnx_dms_search_gate.nxnx_dms_search_store_gate.nx
structs
| 38 | struct NxDmsAsset |
| 47 | struct NxDmsCatalog |
consts
| 27 | const NX_DMS_ACTIVE: nx_int = 0 |
| 28 | const NX_DMS_REMOVED: nx_int = 1 // soft-removed; row kept as history |
| 31 | const NX_DMS_OK: nx_int = 0 |
| 32 | const NX_DMS_ERR_BAD_USE: nx_int = 1 |
| 33 | const NX_DMS_ERR_FULL: nx_int = 2 |
| 34 | const NX_DMS_ERR_NOT_FOUND: nx_int = 3 |
| 35 | const NX_DMS_DUP: nx_int = 4 // content already catalogued (idempotent) |
| 53 | const NX_DMS_ASSET_BYTES: nx_size = 48 // 6 fields * 8 bytes |
functions
| 55 | func nx_dms_catalog_new(capacity: nx_size) -> *NxDmsCatalog |
| 64 | func _dms_at(c: *NxDmsCatalog, idx: nx_size) -> *NxDmsAsset |
| 68 | func _dms_find_hash(c: *NxDmsCatalog, content_hash: nx_size) -> nx_int |
| 78 | func _dms_find_id(c: *NxDmsCatalog, asset_id: nx_int) -> nx_int |
| 90 | func nx_dms_catalog_add(c: *NxDmsCatalog, |
| 112 | func nx_dms_catalog_remove(c: *NxDmsCatalog, asset_id: nx_int, now_us: nx_size) -> nx_int |
| 123 | func nx_dms_is_visible(c: *NxDmsCatalog, l: *NxRightsLedger, asset_id: nx_int, now_us: nx_size) -> nx_int |
| 132 | func nx_dms_count_visible(c: *NxDmsCatalog, l: *NxRightsLedger, now_us: nx_size) -> nx_int |
| 145 | func nx_dms_catalog_count(c: *NxDmsCatalog) -> nx_size |