code wiki / _hdl_build / nx_ad_botfilter.nx

nx_ad_botfilter.nx

buildroot/runtime/_hdl_build/nx_ad_botfilter.nx

3918 B100 linesdepth 2pulls 2 transitivereach 24 importersview sourcekind librarytopic ad
docsdependenciesstructsconstsfunctions

about

nx_ad_botfilter.nx -- LIB (PURE, no I/O): aggregate INVALID-TRAFFIC / bot classifier for the "Brought to you by" performance ad engine (ADS-019, CALLOUT-004). Applied BEFORE counting so HONEST billing never charges for bot traffic (nx_ad_meter ADS-007 applies it; nx_ad_conversion ADS-018 reuses it -- DRY rule 15). PRIVACY BY CONSTRUCTION: inputs are AGGREGATE CLASS-BUCKET counts only -- each bucket = (ua_class, src_class, js_class, n). No visitor id / IP / fingerprint exists in the data model, so "filter bots" can never become "track people". PURE: this lib does NO file/store I/O. Rules arrive as a parsed pair-array. The SOURCE of rules is the sovereign store (nx_ad_store -> adcfg:botrules), NOT a TSV file -- "pure Nishi ecosystem", no flat-file registries. `bf_parse_rules` turns store bytes into rules; the store read lives in nx_ad_store so this classifier stays a pure leaf. license_tier: ORIGINAL

dependencies 1 imports · 9 importers

nx_syscalls.nx nx_ad_botfilter.nx nx_ad_botfilter_gate.nx nx_ad_conversion.nx nx_ad_conversion_gate.nx nx_ad_exceed.nx nx_ad_ivt.nx nx_ad_meter.nx nx_ad_meter_gate.nx nx_ad_reach.nx nx_ad_store.nx

imports: nx_syscalls.nx

imported by: nx_ad_botfilter_gate.nxnx_ad_conversion.nxnx_ad_conversion_gate.nxnx_ad_exceed.nxnx_ad_ivt.nxnx_ad_meter.nxnx_ad_meter_gate.nxnx_ad_reach.nxnx_ad_store.nx

structs

none

consts

16const BF_MAXRULES: i64 = 32

functions

20func bf_int(buf: *u8, p: i64, n: i64, out: *i64) -> i64
called by 1: bf_parse_rules
37func bf_parse_rules(buf: *u8, n: i64, rules: *i64, maxr: i64) -> i64
65func bf_field(ua: i64, src: i64, js: i64, field: i64) -> i64
called by 1: bf_invalid
72func bf_invalid(ua: i64, src: i64, js: i64, rules: *i64, nrules: i64) -> i64
85func bf_tally(ev: *i64, m: i64, rules: *i64, nrules: i64, ov: *i64, oi: *i64) -> i64