code wiki / (root) / nx_dms_catalog.nx

nx_dms_catalog.nx

buildroot/runtime/nx_dms_catalog.nx

5364 B147 linesdepth 3pulls 3 transitivereach 7 importersview sourcekind librarytopic dms
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_rights_ledger.nx nx_dms_catalog.nx nx_dms_catalog_gate.nx nx_dms_catalog_store.nx nx_dms_catalog_store_gate.nx nx_dms_search.nx nx_dms_search_gate.nx nx_dms_search_store_gate.nx

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

38struct NxDmsAsset
47struct NxDmsCatalog

consts

27const NX_DMS_ACTIVE: nx_int = 0
28const NX_DMS_REMOVED: nx_int = 1 // soft-removed; row kept as history
31const NX_DMS_OK: nx_int = 0
32const NX_DMS_ERR_BAD_USE: nx_int = 1
33const NX_DMS_ERR_FULL: nx_int = 2
34const NX_DMS_ERR_NOT_FOUND: nx_int = 3
35const NX_DMS_DUP: nx_int = 4 // content already catalogued (idempotent)
53const NX_DMS_ASSET_BYTES: nx_size = 48 // 6 fields * 8 bytes

functions

55func nx_dms_catalog_new(capacity: nx_size) -> *NxDmsCatalog
64func _dms_at(c: *NxDmsCatalog, idx: nx_size) -> *NxDmsAsset
68func _dms_find_hash(c: *NxDmsCatalog, content_hash: nx_size) -> nx_int
called by 1: nx_dms_catalog_add calls 1: _dms_at
78func _dms_find_id(c: *NxDmsCatalog, asset_id: nx_int) -> nx_int
90func nx_dms_catalog_add(c: *NxDmsCatalog,
112func nx_dms_catalog_remove(c: *NxDmsCatalog, asset_id: nx_int, now_us: nx_size) -> nx_int
called by 2: mainmain calls 2: _dms_find_id_dms_at
123func nx_dms_is_visible(c: *NxDmsCatalog, l: *NxRightsLedger, asset_id: nx_int, now_us: nx_size) -> nx_int
132func nx_dms_count_visible(c: *NxDmsCatalog, l: *NxRightsLedger, now_us: nx_size) -> nx_int
145func nx_dms_catalog_count(c: *NxDmsCatalog) -> nx_size
called by 2: mainmain