code wiki / _hdl_build / nx_adnet_invoice.nx

nx_adnet_invoice.nx

buildroot/runtime/_hdl_build/nx_adnet_invoice.nx

9250 B183 linesdepth 4pulls 5 transitivereach 19 importersview sourcekind librarytopic adnet
docsdependenciesstructsconstsfunctions

about

nx_adnet_invoice.nx -- LIB: the BILLING PIPELINE for the sovereign ad network (debt 1785513943). THE GAP IT CLOSED: nx_adnet_bill held correct CPM/CPC math that NOTHING ever called -- grep found zero production callers, only its own gate. The network served slots and journalled served/viewable/click events, but no organ ever read those journals, applied a rate, or produced an invoice, so no advertiser could be charged at all. Correct math nobody calls is not a billing system. This COMPOSES (rule 22) the already-gated parts rather than re-implementing them: ad_event_count for the per-AD counts, anb_invoice_line_v for the viewable-basis money math. It adds exactly one thing -- the RATE CARD, and the loop that joins rates to measured events. RATES ARE DATA, NEVER CODE (rule 11): knowledge/status/adnet_rates.conf, one row per ad: <ad_id>\t<cpm_milli>\t<cpc_milli>\t<cap_milli> ('#' comment rows ignored) DELIBERATELY NOT under sites/ -- a rate card is commercially sensitive and /synth/ is publicly served. HONEST-BILLING LAW: an ad with NO rate row is REFUSED, never defaulted to zero and never guessed. A missing price and a price of zero are different facts and must not collapse into the same invoice line. license_tier: ORIGINAL

dependencies 3 imports · 5 importers

nx_syscalls.nx nx_adnet_slot.nx nx_adnet_bill.nx nx_adnet_invoice.nx nx_adnet_advreport.nx nx_adnet_invoice_gate.nx nx_adnet_ops.nx nx_adnet_reconcile.nx nx_mgmt_data.nx

imports: nx_syscalls.nxnx_adnet_slot.nxnx_adnet_bill.nx

imported by: nx_adnet_advreport.nxnx_adnet_invoice_gate.nxnx_adnet_ops.nxnx_adnet_reconcile.nxnx_mgmt_data.nx

structs

none

consts

none

functions

23func ainv_num(s: *u8) -> i64
called by 1: ainv_rate
42func ainv_rate(rates: *u8, rlen: i64, ad_id: *u8, idx: i64) -> i64
77func ainv_spent_milli(rates: *u8, rlen: i64, servedlog: *u8, slen: i64, viewlog: *u8, vlen: i64, clklog: *u8, clen: i64, ad_id: *u8) -> i64
97func ainv_line_for(rates: *u8, rlen: i64, servedlog: *u8, slen: i64, viewlog: *u8, vlen: i64, clklog: *u8, clen: i64, ad_id: *u8, out: *u8, cap: i64) -> i64
120func ainv_report(inv: *u8, ilen: i64, rates: *u8, rlen: i64, servedlog: *u8, slen: i64, viewlog: *u8, vlen: i64, clklog: *u8, clen: i64, out: *u8, cap: i64) -> i64
157func ainv_report_for_advertiser(camps: *u8, clen: i64, adv_bk: *u8, rates: *u8, rlen: i64, servedlog: *u8, slen: i64, viewlog: *u8, vlen: i64, clklog: *u8, cllen: i64, out: *u8, cap: i64) -> i64