code wiki / _hdl_build / nx_adnet_view.nx

nx_adnet_view.nx

buildroot/runtime/_hdl_build/nx_adnet_view.nx

4732 B85 linesdepth 4pulls 4 transitivereach 2 importersview sourcekind librarytopic adnet
docsdependenciesstructsconstsfunctions

about

nx_adnet_view.nx -- LIB: MRC-compliant VIEWABLE-impression measurement for the sovereign ad slot. THE DEFECT THIS CLOSES (debt 1785512185): the served-impression counter fires when the slot HTML is INJECTED, before the browser has laid anything out. With a lazy-loaded creative that is frequently never fetched at all, an advertiser is billed for pixels no human ever saw. The 2026 MRC display standard is 50 percent of the creative's pixels in view for 1 CONTINUOUS second; a number weaker than that is not sellable to a paying client, and billing on it is the credibility rock for the whole ad network. PRIVACY BY CONSTRUCTION, UNCHANGED: the beacon carries the AD id and NOTHING ELSE -- no cookie, no visitor id, no dwell curve, no referrer, no timestamp from the client. The schema HAS NO VISITOR FIELD, exactly like nx_adnet_selfserve. First-party only: same-origin sendBeacon and an inline script (the live CSP is script-src 'self' 'unsafe-inline' and connect-src 'self'), zero third-party JS. FAIL-CLOSED: an id that is not a well-formed inventory id is DROPPED, never journalled -- a fabricated or replayed id must never be able to manufacture a billable viewable impression. license_tier: ORIGINAL

dependencies 2 imports · 2 importers

nx_syscalls.nx nx_adnet_slot.nx nx_adnet_view.nx nx_adnet_view_gate.nx nx_sites_daemon_v2.nx

imports: nx_syscalls.nxnx_adnet_slot.nx

imported by: nx_adnet_view_gate.nxnx_sites_daemon_v2.nx

structs

none

consts

21const AVIEW_RATIO_PCT: i64 = 50
22const AVIEW_DWELL_MS: i64 = 1000

functions

26func aview_putdec(out: *u8, off: i64, v: i64) -> i64
called by 1: aview_script calls 1: sys_mmap
42func aview_script(out: *u8, cap: i64, ad_id: *u8) -> i64
called by 2: mainmain calls 2: aslot_id_okaview_putdec
58func aview_is_path(path: *u8, pn: i64) -> i64
called by 2: aview_respmain calls 1: aslot_starts
67func aview_resp(path: *u8, pn: i64, out: *u8, cap: i64, idout: *u8) -> i64