ad-presentation §14 and stitched-presentation §12: a verifier applies six invalid-traffic rules to the impressions it states, each a comparison of signed bytes or integers with no score or model: one impression presented twice, a span past its creative or a media time in two claims, a claim with no attestation where the terms require one, more sessions under one device key than the policy's cap, an address in a pinned list of ranges, and a user agent holding a token of a pinned list of declared crawlers. New records: the traffic policy (WTP1), the session origin an edge signs (WSO1), the device binding a device key and the session key sign (WDB1), and the two lists pinned by digest with their source (WAL1, WUL1). Each impression is valid, invalid with every rule and the records it rests on, or undecided where a turned-on rule had no record; invalid impressions that counted are excluded and counted, undecided ones withheld, and the valid spend is what remains (by currency for a stream). No claim's verdict or record changes. live_ads::traffic and stitched_presentation::traffic read a finished verification; live_ads::verify and stitched_presentation::verify are unchanged. Corpus live-conformance/ad-traffic/ (wai_ad_traffic_vectors), tests/ad_traffic.rs, and the second implementation ad_traffic_verify.py; a verifier with any one rule off is caught by the vectors in both. Decision D5 records what is and is not a rule here. Co-Authored-By: Claude <[email protected]>
4.3 KiB
live-conformance/ad-traffic — invalid-traffic rules
The corpus of extensions/ad-presentation.md §14 and
extensions/stitched-presentation.md §12: the
rules a verifier applies to the impressions it states, each decided from signed records by
comparing bytes and integers.
rooms.jsonholdsrooms, each a room the ad-presentation verifier accepts, in the form of../presentation/README.mdwith everything that verifier states; andvectors, each naming itsroom.stitched.jsonholds onestream: themanifests(their text),recordsandclaimsthe stitched verifier is given, with therecord_facts,claim_factsandspendit states (../stitched/README.md); andvectorsover it.
Both hold the creatives, issuers (and signers) their verifiers hold; lists, the two
pinned lists with their bytes, digests, sources and entries as text; and keys, the public
keys of the corpus's edges, attesters, devices and session keys, for a reader. Every address is
a documentation address and every crawler token names a crawler that does not exist.
A vector gives a verifier, beside its room or the stream: traffic_policy (WTP1, or
null for none), origins (WSO1), bindings (WDB1) and lists (the lists it holds),
each hexadecimal. origin_about and binding_about say what each record is, and are not
checked. Its traffic is what a conforming verifier states (ad-presentation §14.7):
outcomerefusewith itsreason, when the policy does not read, verify or bind, or a list is not held or does not read; otherwiseaccept, and:policy, its digest ornull;origin_factsandbinding_facts, each record'sdigestandplayer(nullwhen it does not read) and itsverdict,acceptedor a reason;devices, each device key with itssessionsand the indices of thebindingsthat give them, in ascending order of the key;impressions, each with where it is (receiptandslot; institched.jsonrecord,slotand its ownclaim), itsprice_micros, whether the base verificationcountsit, itstrafficverdict (valid,invalid,undecided), therulesthat refuse it, each with itscodeand what it rests on (claims,originandbindingby index among those given,entryby index in its list,deviceandsessions), and itsundecidedmarks;rules, for each rule itsimpressions, and of those the ones that counted,excluded, withexcluded_micros;undecided, for each mark itsimpressions,withheldandwithheld_micros;totals:impressions,counted,valid,invalid,undecided,excluded,withheld, andpresented_spend_micros,excluded_micros,withheld_microsandvalid_spend_micros; and each receipt's or record's valid spend (receipt_valid_spend_micros,record_valid_spend_micros).
A sum of prices is a number in rooms.json and an object by currency in stitched.json. In
every vector the presented spend is the excluded, the withheld and the valid spend together,
and every impression is in exactly one of valid, invalid and undecided: an impression a rule
refuses is counted as excluded, never left out.
A verifier that states anything else of a vector does not conform. One that leaves out a rule
states another traffic for some vector: without the duplicate rule, session 42's second
claim of one impression passes in room_no_policy, and the vector refuses that verifier.
cd wai-rs && cargo run --features stitched_presentation --bin wai_ad_traffic_vectors -- verify ../live-conformance/ad-traffic
python3 -I live-conformance/ad_traffic_verify.py live-conformance/ad-traffic
The first is the reference: it regenerates both files from their fixed seeds and requires them
byte for byte, gives every vector its statement, and turns each rule off in turn.
wai_ad_traffic_vectors gen writes the files. The second is the second implementation,
written from the extensions' text and sharing no code with wai-rs: it verifies the rooms
and the stream with the ad-presentation and stitched corpora's second implementations, judges
every vector itself, mutates copies of the corpus and requires each to fail, and drops each
rule and each of its checks in turn.