code wiki / _hdl_build / nx_ad_meter.nx
nx_ad_meter.nx
buildroot/runtime/_hdl_build/nx_ad_meter.nx
about
nx_ad_meter.nx -- LIB: per-advertiser FIRST-PARTY outcome MEASUREMENT for the "Brought to you
by" performance ad engine (ADS-007, CALLOUT-004). The keystone that turns honest measurement
into a billable verdict. NO-FLOATING: composes the two DONE foundations -- conversions via
nx_ad_conversion (ADS-018: consent-gate -> bot-filter -> aggregate -> k-anon) and impressions
via nx_ad_botfilter (ADS-019) -- and reads the goal target + exceed multiple from the SOVEREIGN
STORE (ADS-006 schema: adgoal:/adpricing:), never TSV.
THE VERDICT (per campaign-period, measured against THEIR chosen goal target):
UNDER result < target -> downstream bill = $0
PERFORM target <= result < target*exceed_mult -> flat perform fee
EXCEED result >= target*exceed_mult -> flat fee + ONE flat capped bonus
HONEST-BILLING LAW MADE LOAD-BEARING: if the target or exceed_mult is not a real number yet
(PENDING-CENSUS / PENDING-COSPEC in the store -- figures are sponsor co-spec, ADS-005/ADS-001),
the meter returns UNMEASURABLE. "We cannot bill what we cannot measure" -- the default is no
charge, and a verdict requires real, store-resident figures. license_tier: ORIGINAL
dependencies 5 imports · 3 importers
imports: nx_ad_conversion.nxnx_ad_botfilter.nxnx_kanon.nxnx_ad_store.nxnx_syscalls.nx
imported by: nx_ad_bill.nxnx_ad_meter_gate.nxnx_ad_offering.nx
structs
| none |
consts
| 23 | const AM_UNMEASURABLE: i64 = 0 - 1 |
| 24 | const AM_UNDER: i64 = 0 |
| 25 | const AM_PERFORM: i64 = 1 |
| 26 | const AM_EXCEED: i64 = 2 |
functions
| 31 | func am_field_int(val: *u8, vlen: i64, fi: i64) -> i64 |
| 56 | func am_target_of(goal_key: *u8) -> i64 |
| 65 | func am_exceed_mult_of(price_key: *u8) -> i64 |
| 74 | func am_verdict(result: i64, target: i64, exceed_mult: i64) -> i64 called by 1: main |
| 85 | func am_result_conversions(ev: *i64, m: i64, rules: *i64, nrules: i64, k: i64) -> i64 |
| 92 | func am_result_impressions(ev: *i64, m: i64, rules: *i64, nrules: i64) -> i64 |