code wiki / (root) / nx_offer_ledger.nx

nx_offer_ledger.nx

buildroot/runtime/nx_offer_ledger.nx

4725 B146 linesdepth 2pulls 2 transitivereach 3 importersview sourcekind librarytopic offer
docsdependenciesstructsconstsfunctions

about

nx_offer_ledger.nx -- licensing outreach / offer tracker. For each TO_ACQUIRE target (a person/host we want to license), record the agent/contact and track the offer through a state machine: open -> PENDING --send--> SENT --accept--> ACCEPTED \----------------decline---> DECLINED On ACCEPTED the caller closes the loop: reclassify the host OWNED (nx_fetch_rights) + mint a grant (nx_rights_ledger) so the talent becomes product-usable. Respectful + legal: nothing is product-usable until a real accepted offer + license exists. Mirrors the nx_rights_ledger pattern. contact_ref is an id into a contacts store (name/email/agent details = a later rung); here it just carries the link. license_tier: ORIGINAL

dependencies 2 imports · 3 importers

nx_syscalls.nx nx_tier.nx nx_offer_ledger.nx nx_offer_ledger_gate.nx nx_offer_ledger_store.nx nx_offer_ledger_store_gate.nx

imports: nx_syscalls.nxnx_tier.nx

imported by: nx_offer_ledger_gate.nxnx_offer_ledger_store.nxnx_offer_ledger_store_gate.nx

structs

31struct NxOffer
40struct NxOfferLedger

consts

20const NX_OF_PENDING: nx_int = 0
21const NX_OF_SENT: nx_int = 1
22const NX_OF_ACCEPTED: nx_int = 2
23const NX_OF_DECLINED: nx_int = 3
24const NX_OF_N: nx_int = 4
26const NX_OF_OK: nx_int = 0
27const NX_OF_ERR_FULL: nx_int = 1
28const NX_OF_ERR_NOT_FOUND: nx_int = 2
29const NX_OF_ERR_BAD_TRANSITION: nx_int = 3
46const NX_OF_BYTES: nx_size = 48

functions

48func nx_offer_ledger_new(capacity: nx_size) -> *NxOfferLedger
called by 3: mainnx_offer_loadmain calls 1: sys_mmap
56func _of_at(l: *NxOfferLedger, idx: nx_size) -> *NxOffer
60func _of_find(l: *NxOfferLedger, offer_id: nx_int) -> nx_int
71func nx_offer_open(l: *NxOfferLedger, offer_id: nx_int, target_bk: nx_int, contact_ref: nx_int, now_us: nx_size) -> nx_int
called by 2: mainmain calls 1: _of_at
85func nx_offer_send(l: *NxOfferLedger, offer_id: nx_int, now_us: nx_size) -> nx_int
called by 2: mainmain calls 2: _of_find_of_at
95func nx_offer_accept(l: *NxOfferLedger, offer_id: nx_int, now_us: nx_size) -> nx_int
called by 2: mainmain calls 2: _of_find_of_at
106func nx_offer_decline(l: *NxOfferLedger, offer_id: nx_int, now_us: nx_size) -> nx_int
called by 2: mainmain calls 2: _of_find_of_at
117func nx_offer_state(l: *NxOfferLedger, offer_id: nx_int) -> nx_int
called by 2: mainmain calls 2: _of_find_of_at
125func nx_offer_is_accepted(l: *NxOfferLedger, target_bk: nx_int) -> nx_int
called by 2: mainmain calls 1: _of_at
137func nx_offer_count_by_state(l: *NxOfferLedger, state: nx_int) -> nx_int
called by 2: mainmain calls 1: _of_at