code wiki / _hdl_build / nx_ad_meter_gate.nx

nx_ad_meter_gate.nx

buildroot/runtime/_hdl_build/nx_ad_meter_gate.nx

5182 B100 linesdepth 5pulls 8 transitivereach 0 importersview sourcekind gate/prooftopic ad
docsdependenciesstructsconstsfunctions

about

nx_ad_meter_gate.nx -- GATE (runnable) for ADS-007 the measurement keystone. Proves, on baked controls + the LIVE sovereign-store figures (operator go-live 2026-06-13), that the meter: (1) verdict boundaries are exact: UNDER < target <= PERFORM < target*mult <= EXCEED (2) COMPOSES the foundations from the store: a conversion result = consented, bot-filtered, k-anon-floored count (ADS-018/019); an impression result = bot-filtered valid count (3) k-anon suppression is honest: a campaign too small to clear the floor -> result 0 -> UNDER (4) BILLS LIVE off the store: reach target=10000/exceed_mult=2 -> 5000=UNDER, 10000=PERFORM, 20000=EXCEED -- real verdicts from real figures (5) STILL REFUSES honestly: a goal with NO figures (adgoal:nonexistent) -> UNMEASURABLE Cannot false-green: (4)/(5) read the real store; if a figure were missing or wrong they break. Evidence -> knowledge/status/ad_meter.log (METERGATE authored=organ ... verdict=GREEN). license_tier: ORIGINAL

dependencies 4 imports · 0 importers

nx_ad_meter.nx nx_ad_store.nx nx_ad_botfilter.nx nx_syscalls.nx nx_ad_meter_gate.nx

imports: nx_ad_meter.nxnx_ad_store.nxnx_ad_botfilter.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap ads_botrules sys_mmap ↻ ads_get ss_get sys_mmap ↻ ss_scan sys_mmap ↻ ss_manifest_dyn ss_manifest_file_dyn ss_scan_seglist ss_len sys_mmap ↻ ss_cat ss_readall ss_r32 bf_parse_rules sys_mmap ↻ bf_int am_verdict ads_kanon_k sys_mmap ↻ ads_get ↻ mg_set am_result_conversions cv_release cv_raw bf_invalid bf_field kn_release am_target_of sys_mmap ↻ ads_get ↻ am_field_int am_exceed_mult_of sys_mmap ↻ ads_get ↻ am_field_int ↻ mg_emit

structs

none

consts

19const MG_LOG: *u8 = "knowledge/status/ad_meter.log"

functions

21func mg_w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 }
called by 1: mg_emit calls 1: sys_write
22func mg_wn(fd: i64, v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64=v; if m<0 {m=0-m; sys_write(fd,"-" as *u8,1)}; let t: *u8 = sys_mmap(28); var k: i64=0; if m==0 {t[0]=48;k=1}; while m>0 {t[k]=(48+(m%10)) as u8; m=m/10; k=k+1}; var i: i64=0; while i<k {bb[i]=t[k-1-i]; i=i+1}; sys_write(fd, bb, k); return 0 }
called by 1: mg_emit calls 2: sys_mmapsys_write
24func mg_set(ev: *i64, b: i64, consent: i64, ctype: i64, ua: i64, src: i64, js: i64, n: i64) -> i64
called by 1: main
30func mg_emit(fd: i64, tgt: i64, mult: i64, vU: i64, vP: i64, vE: i64, convr: i64, vconv: i64, miss: i64, vmiss: i64, ok: i64) -> i64
called by 1: main calls 2: mg_wmg_wn
45func main() -> i64