From 09173c65af5b6491d813d2dcc50cd99658584e3f Mon Sep 17 00:00:00 2001 From: Qingxin Wu Date: Tue, 27 Jun 2023 19:58:36 -0400 Subject: [PATCH 1/7] Add webIDL dictionaries for reporting browser signals. --- spec.bs | 274 ++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 187 insertions(+), 87 deletions(-) diff --git a/spec.bs b/spec.bs index 93d19b59c..98a1f7bb8 100644 --- a/spec.bs +++ b/spec.bs @@ -41,6 +41,9 @@ spec: WebAssembly; urlPrefix: https://webassembly.github.io/spec/core/ spec: WebAssembly-js-api; urlPrefix: https://webassembly.github.io/spec/js-api/ type: dfn text: compiling a WebAssembly module; url: #compile-a-webassembly-module +spec: WebIDL; urlPrefix: https://webidl.spec.whatwg.org/ + type: dfn + text: convert a Web IDL arguments list to an ECMAScript arguments list; url: #web-idl-arguments-list-converting spec: Fenced Frame; urlPrefix: https://wicg.github.io/fenced-frame/ type: dfn for: browsing context @@ -825,7 +828,7 @@ an [=interest group=] |ig|, and a [=moment=] |auctionStartTime|: 1. Let |prevWins| be a new [=sequence=]<{{PreviousWin}}>. 1. [=list/For each] |prevWin| of |ig|'s [=interest group/previous wins=] for all days within the the last 30 days: - 1. Let |timeDelta| be |auctionStartTime| minus |prevWin|[=previous win/time=]. + 1. Let |timeDelta| be |auctionStartTime| minus |prevWin|'s [=previous win/time=]. 1. Set |timeDelta| to 0 if |timeDelta| is negative, |timeDelta|'s nearest second (rounding down) otherwise. 1. Let |prevWinIDL| be a new {{PreviousWin}}. @@ -1493,6 +1496,7 @@ To round a value given a {{double}} |value|: +
To report result given a [=leading bid info=] |leadingBidInfo| and [=auction config=] or null |winningComponentConfig|: 1. Let |config| be |leadingBidInfo|'s [=leading bid info/auction config=]. @@ -1507,116 +1511,123 @@ null |winningComponentConfig|: 1. Set |bidCurrency| to the result of [=looking up per-buyer currency=] with |config| and |leadingBidInfo|'s [=leading bid info/leading bid=]'s [=generated bid/interest group=]'s [=interest group/owner=]. - 1. Let |browserSignals| be an [=ordered map=] whose [=map/keys=] are [=strings=] and whose - [=map/values=] are {{any}}. - 1. [=map/Set=] |browserSignals|["`topWindowHostname`"] to [=this=]'s - [=relevant settings object=]'s [=environment/top-level origin=]'s [=origin/host=]. 1. Let |winner| be |leadingBidInfo|'s [=leading bid info/leading bid=]. - 1. [=map/Set=] |browserSignals|["`interestGroupOwner`"] to |winner|'s - [=generated bid/interest group=]'s [=interest group/owner=]. - 1. [=map/Set=] |browserSignals|["`renderURL`"] to |winner|'s [=generated bid/ad descriptor=]'s - [=ad descriptor/url=]. - 1. Let |sellerCurrency| be |leadingBidInfo|'s [=leading bid info/auction config=]'s [=auction config/seller currency=]. - 1. [=map/Set=] |browserSignals|["`desirability`"] to |leadingBidInfo|'s - [=leading bid info/top score=]. - 1. [=map/Set=] |browserSignals|["`bid`"] to the result of [=rounding a value=] given - |winner|'s [=generated bid/bid=]'s [=bid with currency/value=]. - 1. [=map/Set=] |browserSignals|["`bidCurrency`"] to the result of [=serializing a currency tag=] - with |bidCurrency|. - + 1. Let |sellerCurrency| be |leadingBidInfo|'s [=leading bid info/auction config=]'s + [=auction config/seller currency=]. + 1. Let |highestScoringOtherBid| be |leadingBidInfo|'s + [=leading bid info/highest scoring other bid=]'s [=generated bid/bid in seller currency=] (or + 0 if encountered a null). 1. If |sellerCurrency| is null: - 1. [=map/Set=] |browserSignals|["`highestScoringOtherBid`"] to |leadingBidInfo|'s + 1. Set |highestScoringOtherBid| to |leadingBidInfo|'s [=leading bid info/highest scoring other bid=]'s [=generated bid/bid=]'s [=bid with currency/value=] (or 0 if encountered a null). - 1. [=map/Set=] |browserSignals|["`highestScoringOtherBidCurrency`"] to "`???`". - 1. Otherwise: - 1. [=map/Set=] |browserSignals|["`highestScoringOtherBid`"] to |leadingBidInfo|'s - [=leading bid info/highest scoring other bid=]'s [=generated bid/bid in seller currency=] (or - 0 if encountered a null). - 1. [=map/Set=] |browserSignals|["`highestScoringOtherBidCurrency`"] to |sellerCurrency|. - 1. If |leadingBidInfo|'s [=leading bid info/scoring data version=] is not null, [=map/Set=] - |browserSignals|["`dataVersion`"] to it. - 1. If |leadingBidInfo|'s [=leading bid info/top level seller=] is not null, [=map/set=] - |browserSignals|["`topLevelSeller`"] to it. - 1. If |leadingBidInfo|'s [=leading bid info/top level seller signals=] is not null, [=map/set=] - |browserSignals|["`topLevelSellerSignals`"] to it. - 1. If |leadingBidInfo|'s [=leading bid info/component seller=] is not null: - 1. [=map/Set=] |browserSignals|["`componentSeller`"] to |leadingBidInfo|'s - [=leading bid info/component seller=]. - 1. If |winner|'s [=generated bid/modified bid=] is not null, [=map/set=] - |browserSignals|["`bid`"] to it. - 1. Otherwise, if |winner|'s [=generated bid/modified bid=] is not null, [=map/set=] - |browserSignals|["`modifiedBid`"] to it. - 1. Set |config| to |leadingBidInfo|'s [=leading bid info/auction config=]. + 1. Let |bid| be |winner|'s [=generated bid/bid=]'s [=bid with currency/value=]. + 1. Let |modifiedBid| be null. + 1. If |winner|'s [=generated bid/modified bid=] is not null: + 1. If |leadingBidInfo|'s [=leading bid info/component seller=] is not null: + 1. Set |bid| to |winner|'s [=generated bid/modified bid=]. + 1. Otherwise: + 1. Set |modifiedBid| to |winner|'s [=generated bid/modified bid=]. + 1. Let |browserSignals| be a {{ReportResultBrowserSignals}} with the following fields: +
+
{{ReportingBrowserSignals/topWindowHostname}} +
The result of running the host serializer on |[=this=]'s + [=relevant settings object=]'s [=environment/top-level origin=]'s [=origin/host=]. +
{{ReportingBrowserSignals/interestGroupOwner}} +
[=serialization of an origin|Serialized=] |winner|'s [=generated bid/interest group=]'s + [=interest group/owner=]. +
{{ReportingBrowserSignals/renderURL}} +
[=URL serializer|Serialized=] |winner|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=] +
{{ReportResultBrowserSignals/desirability}} +
[=round a value|Rounded=] |leadingBidInfo|'s [=leading bid info/top score=] +
{{ReportingBrowserSignals/bid}} +
[=round a value|Rounded=] |bid| +
{{ReportingBrowserSignals/bidCurrency}} +
The result of [=serializing a currency tag=] with |bidCurrency| +
{{ReportingBrowserSignals/highestScoringOtherBid}} +
|highestScoringOtherBid| +
{{ReportingBrowserSignals/highestScoringOtherBidCurrency}} +
|sellerCurrency| if it is not null, "`???`" otherwise +
{{ReportingBrowserSignals/dataVersion}} +
|leadingBidInfo|'s [=leading bid info/scoring data version=] if it is not null, + {{undefined}} otherwise +
{{ReportingBrowserSignals/topLevelSeller}} +
|leadingBidInfo|'s [=leading bid info/top level seller=] if it is not null, {{undefined}} + otherwise +
{{ReportResultBrowserSignals/topLevelSellerSignals}} +
|leadingBidInfo|'s [=leading bid info/top level seller signals=] if it is not null, + {{undefined}} otherwise +
{{ReportingBrowserSignals/componentSeller}} +
|leadingBidInfo|'s [=leading bid info/component seller=] if it is not null, {{undefined}} + otherwise +
{{ReportResultBrowserSignals/modifiedBid}} +
[=round a value|Rounded=] |modifiedBid| if it is not null, {{undefined}} otherwise +
1. Let |sellerReportingScript| be the result of [=fetching script=] with |config|'s [=auction config/decision logic url=]. 1. Let « |sellerSignals|, |reportUrl|, |reportingBeaconMap| » be the result of [=evaluating a reporting script=] with |sellerReportingScript|, "`reportResult`", and - « |config|, |browserSignals|». + « |config|'s [=auction config/config idl=], |browserSignals| ». + 1. [=map/Remove=] |browserSignals|["`desirability`"]. 1. [=map/Remove=] |browserSignals|["`dataVersion`"]. 1. [=map/Remove=] |browserSignals|["`modifiedBid`"]. 1. [=map/Remove=] |browserSignals|["`topLevelSellerSignals`"]. + + Note: Remove fields specific to {{ReportResultBrowserSignals}} so that they are not passed to + [=report win=]. + 1. TODO: Store |reportUrl| and |reportingBeaconMap| in [=fenced frame config=] as appropriate. 1. Return « |sellerSignals|, |browserSignals| ».
-To report win given a [=leading bid info=] |leadingBidInfo|, a [=string=] -|sellerSignals| and an [=ordered map=] |browserSignals| whose [=map/keys=] are [=strings=] and whose -[=map/values=] are {{any}}: +To report win given a [=leading bid info=] |leadingBidInfo|, a [=string=] |sellerSignals| +and a {{ReportResultBrowserSignals}} |browserSignals|: 1. Let |config| be |leadingBidInfo|'s [=leading bid info/auction config=]. 1. Let |winner| be |leadingBidInfo|'s [=leading bid info/leading bid=]. 1. Let |perBuyerSignals| be |config|'s [=auction config/per buyer signals=]. 1. Let |buyer| be |winner|'s [=generated bid/interest group=]'s [=interest group/owner=]. - 1. Let |sellerCurrency| be |config|'s [=auction config/seller currency=]. - 1. Let |perBuyerCurrency| be result of [=looking up per-buyer currency=] with |config| and |buyer|. - 1. Let |serializedPerBuyerCurrency| be the result of [=serializing a currency tag=] applied to |perBuyerCurrency|. 1. Let |perBuyerSignalsForBuyer| be |perBuyerSignals|[|buyer|] if that member [=map/exists=], and null otherwise. - 1. [=map/Remove=] |browserSignals|["`desirability`"]. - 1. If the result of [=query reporting ID k-anonymity count=] given |winner|'s [=generated bid/interest group=] - - and |winner|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=] is true: - - 1. [=map/Set=] |browserSignals|["`interestGroupName`"] to |winner|'s - [=generated bid/interest group=] [=interest group/name=]. - 1. [=map/Set=] |browserSignals|["`bid`"] to the result of [=rounding a value=] - given |winner|'s [=generated bid/bid=]'s [=bid with currency/value=]. - 1. [=map/Set=] |browserSignals|["`bidCurrency`"] to |serializedPerBuyerCurrency|. - 1. [=map/Set=] |browserSignals|["`madeHighestScoringOtherBid`"] to false. - 1. Let |highestScoringOtherBidOwner| be |leadingBidInfo|'s - [=leading bid info/highest scoring other bid owner=]. - 1. If |highestScoringOtherBidOwner| is not null, and |buyer| is [=same origin=] with - |highestScoringOtherBidOwner|: - 1. [=map/Set=] |browserSignals|["`madeHighestScoringOtherBid`"] to true. - 1. If |sellerCurrency| is null: - 1. [=map/Set=] |browserSignals|["`highestScoringOtherBid`"] to the result of [=rounding a value=] - given |leadingBidInfo|'s [=leading bid info/highest scoring other bid=]'s [=generated bid/bid=]'s - [=bid with currency/value=] (or 0 if encountered a null). - 1. [=map/Set=] |browserSignals|["`highestScoringOtherBidCurrency`"] to "`???`". - 1. Otherwise: - 1. [=map/Set=] |browserSignals|["`highestScoringOtherBid`"] to |leadingBidInfo|'s - [=leading bid info/highest scoring other bid=]'s [=generated bid/bid in seller currency=] (or - 0 if encountered a null). (TODO: This get rounded). - 1. [=map/Set=] |browserSignals|["`highestScoringOtherBidCurrency`"] to |sellerCurrency|. - 1. If |leadingBidInfo|'s [=leading bid info/bidding data version=] is not null: - 1. [=map/Set=] |browserSignals|["`dataVersion`"] to |leadingBidInfo|'s - [=leading bid info/bidding data version=]. - 1. [=map/Set=] |browserSignals|["`adCost`"] to |winner|'s [=generated bid/ad cost=]. - 1. [=map/Set=] |browserSignals|["`seller`"] to |config|'s [=auction config/seller=]. - 1. If |leadingBidInfo|'s [=leading bid info/top level seller=] is not null: - 1. [=map/Set=] |browserSignals|["`topLevelSeller`"] to |leadingBidInfo|'s - [=leading bid info/top level seller=]. - 1. If |winner|'s [=generated bid/modeling signals=] is not null: - 1. [=map/Set=] |browserSignals|["`modelingSignals`"] to |winner|'s - [=generated bid/modeling signals=]. + 1. Let |reportWinBrowserSignals| be a {{ReportWinBrowserSignals}}. + 1. [=map/For each=] |key| -> |value| of |browserSignals|: + 1. [=map/Set=] |reportWinBrowserSignals|[|key|] to |value|. + + Note: Fields specific to {{ReportResultBrowserSignals}} have been removed from |browserSignals|, + so it only contains {{ReportingBrowserSignals}}'s fields. + + 1. Let |interestGroupName| be null. + 1. If the result of [=query reporting ID k-anonymity count=] given |winner|'s + [=generated bid/interest group=] and |winner|'s [=generated bid/ad descriptor=]'s + [=ad descriptor/url=] is true: + 1. Set |interestGroupName| to |winner|'s [=generated bid/interest group=] [=interest group/name=]. + 1. Add the following fields to |reportWinBrowserSignals|: +
+
{{ReportingBrowserSignals/dataVersion}} +
|leadingBidInfo|'s [=leading bid info/bidding data version=] if it is not null, + {{undefined}} otherwise. +
{{ReportWinBrowserSignals/adCost}} +
[=Round a value|Rounded=] |winner|’s [=generated bid/ad cost=] +
{{ReportWinBrowserSignals/seller}} +
[=serialization of an origin|Serialized=] |config|'s [=auction config/seller=] +
{{ReportWinBrowserSignals/madeHighestScoringOtherBid}} +
Set to true if |leadingBidInfo|'s [=leading bid info/highest scoring other bid owner=] is + not null, and |buyer| is [=same origin=] with |leadingBidInfo|'s + [=leading bid info/highest scoring other bid owner=], false otherwise +
{{ReportWinBrowserSignals/interestGroupName}} +
|interestGroupName| if it is not null, {{undefined}} otherwise +
{{ReportWinBrowserSignals/modelingSignals}} +
|winner|'s [=generated bid/modeling signals=] if it is not null, {{undefined}} otherwise + (TODO: noise and bucket this signal) +
1. Let |buyerReportingScript| be the result of [=fetching script=] with |winner|'s [=generated bid/interest group=]'s [=interest group/bidding url=]. 1. Let « ignored, |resultUrl|, |reportingBeaconMap| » be the result of [=evaluating a - reporting script=] with |buyerReportingScript|, "`reportWin`", and « |leadingBidInfo|'s - [=leading bid info/auction config=]'s [=auction config/auction signals=], - |perBuyerSignalsForBuyer|, |sellerSignals|, |browserSignals| ». + reporting script=] with |buyerReportingScript|, "`reportWin`", and + « |leadingBidInfo|'s [=leading bid info/auction config=]'s [=auction config/config idl=]'s + {{AuctionAdConfig/auctionSignals}}, |perBuyerSignalsForBuyer|, |sellerSignals|, + |reportWinBrowserSignals| ». 1. TODO: Store |resultUrl| and |reportingBeaconMap| in [=fenced frame config=] as appropriate.
@@ -1928,8 +1939,11 @@ of the following global objects: 1. Let |realm| be the result of [=creating a new script runner realm=] given {{InterestGroupReportingScriptRunnerGlobalScope}}. 1. Let |global| be |realm|'s [=realm/global object=]. + 1. Let |argumentsJS| be the result of [=converting a Web IDL arguments list to an ECMAScript + arguments list|converting=] |arguments| to an ECMAScript arguments list. If this + [=exception/throws=] an exception, return « "null", null, null ». 1. Let |result| be the result of [=evaluating a script=] with |realm|, |script|, - |functionName|, |arguments|, and 50 milliseconds. + |functionName|, |argumentsJS|, and 50 milliseconds. 1. If |result| is an [=ECMAScript/abrupt completion=], return « "null", null, null ». 1. Let |resultJSON| be "null". 1. If |functionName| is "`reportResult`", then set |resultJSON| to the result of @@ -2544,6 +2558,92 @@ Note: {{ScoringBrowserSignals}}'s {{ScoringBrowserSignals/adComponents}} is {{un [=generated bid/ad component descriptors=] is null or [=list/is empty|an empty list=]. It cannot be an [=list/is empty|empty list=]. + + +dictionary ReportingBrowserSignals { + required DOMString topWindowHostname; + required USVString interestGroupOwner; + required USVString renderURL; + required double bid; + required DOMString bidCurrency; + required double highestScoringOtherBid; + required DOMString highestScoringOtherBidCurrency; + + unsigned long dataVersion; + USVString topLevelSeller; + USVString componentSeller; +}; + + +{{ReportingBrowserSignals}} includes browser signals both `reportResult()` and `reportWin()` get. +
+ The meanings and notes of some fields: +
{{ReportingBrowserSignals/renderURL}} +
The render URL returned by "`generateBid()`". It is + [=query reporting ID k-anonymity count|k-anonymous=] +
{{ReportingBrowserSignals/bid}} +
The [=round a value|rounded value=] of the winning bid. This is always in the bidder's own + currency. +
{{ReportingBrowserSignals/highestScoringOtherBid}} +
The [=round a value|rounded value=] of the the bid that got the second highest score, or 0 if + it's not available This is always in the bidder's own currency. +
+ + + +dictionary ReportResultBrowserSignals : ReportingBrowserSignals { + required double desirability; + + DOMString topLevelSellerSignals; + double modifiedBid; +}; + + +
+ The meanings and notes of some fields: +
{{ReportResultBrowserSignals/desirability}} +
The [=round a value|rounded value=] of the score returned by "`scoreAd()`" for the winning bid. +
{{ReportResultBrowserSignals/topLevelSellerSignals}} +
Metadata returned by the top-level seller's "`reportResult()`", as JSON. +
{{ReportResultBrowserSignals/modifiedBid}} +
The [=round a value|rounded value=] of the bid value returned by the component seller's + "`scoreAd()`" method +
{{ReportingBrowserSignals/dataVersion}} +
Only set if the Data-Version header was provided in the response headers from the trusted + scoring signals server. +
+ + + +dictionary ReportWinBrowserSignals : ReportingBrowserSignals { + double adCost; + USVString seller; + boolean madeHighestScoringOtherBid; + DOMString interestGroupName; + unsigned short modelingSignals; +}; + + +
+ The meanings and notes of some fields: +
{{ReportWinBrowserSignals/adCost}} +
Advertiser click or conversion cost passed from `generateBid()` to `reportWin()`. Non-negative + and only the lowest 8 bits will be passed +
{{ReportWinBrowserSignals/seller}} +
The [=serialization of an origin|serialized=] origin of the seller running the ad auction +
{{ReportWinBrowserSignals/madeHighestScoringOtherBid}} +
Being true if the interest group owner was the only bidder that made bids with the second + highest score +
{{ReportWinBrowserSignals/interestGroupName}} +
Only set if the tuple of interest group owner, name, bidding script URL and ad creative URL + were [=query reporting ID k-anonymity count|jointly k-anonymous=] +
{{ReportWinBrowserSignals/modelingSignals}} +
A 0-4095 integer (12-bits) passed to `reportWin()`, with noising +
{{ReportingBrowserSignals/dataVersion}} +
Only set if the Data-Version header was provided in the response headers from the trusted + bidding signals server +
+

Interest group

An interest group is a [=struct=] with the following [=struct/items=]: @@ -2862,7 +2962,7 @@ the seller. : ad cost :: Null or a {{double}}. Advertiser click or conversion cost passed from `generateBid()` to `reportWin()`. Invalid values, such as negative, infinite, and NaN values, will be ignored and not - passed. Only the lowest 12 bits will be passed. + passed. Only the lowest 8 bits will be passed. : modeling signals :: Null or an {{unsigned short}}. A 0-4095 integer (12-bits) passed to `reportWin()`, with noising. : interest group From 1348d8beccaa0e99feeadb154c38b1b423f08e55 Mon Sep 17 00:00:00 2001 From: Qingxin Wu Date: Tue, 27 Jun 2023 22:02:12 -0400 Subject: [PATCH 2/7] Fix build error --- spec.bs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec.bs b/spec.bs index 113fd7c32..644a7eb52 100644 --- a/spec.bs +++ b/spec.bs @@ -2575,8 +2575,8 @@ dictionary ReportingBrowserSignals { {{ReportingBrowserSignals}} includes browser signals both `reportResult()` and `reportWin()` get. +The meanings and notes of some fields:
- The meanings and notes of some fields:
{{ReportingBrowserSignals/renderURL}}
The render URL returned by "`generateBid()`". It is [=query reporting ID k-anonymity count|k-anonymous=] @@ -2598,8 +2598,8 @@ dictionary ReportResultBrowserSignals : ReportingBrowserSignals { }; +The meanings and notes of some fields:
- The meanings and notes of some fields:
{{ReportResultBrowserSignals/desirability}}
The [=round a value|rounded value=] of the score returned by "`scoreAd()`" for the winning bid.
{{ReportResultBrowserSignals/topLevelSellerSignals}} @@ -2623,8 +2623,8 @@ dictionary ReportWinBrowserSignals : ReportingBrowserSignals { }; +The meanings and notes of some fields:
- The meanings and notes of some fields:
{{ReportWinBrowserSignals/adCost}}
Advertiser click or conversion cost passed from `generateBid()` to `reportWin()`. Non-negative and only the lowest 8 bits will be passed From 67ea28018de86ccb8c4163d514f370cdf009b259 Mon Sep 17 00:00:00 2001 From: qingxinwu <6334674+qingxinwu@users.noreply.github.com> Date: Fri, 7 Jul 2023 00:34:37 -0400 Subject: [PATCH 3/7] Apply suggestions from code review Co-authored-by: Jeffrey Yasskin --- spec.bs | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/spec.bs b/spec.bs index 1e88b90de..75366936a 100644 --- a/spec.bs +++ b/spec.bs @@ -1795,9 +1795,9 @@ null |winningComponentConfig|: 1. Otherwise: 1. Set |modifiedBid| to |winner|'s [=generated bid/modified bid=]. 1. Let |browserSignals| be a {{ReportResultBrowserSignals}} with the following fields: -
-
{{ReportingBrowserSignals/topWindowHostname}} -
The result of running the host serializer on |[=this=]'s +
+
{{topWindowHostname}} +
The result of running the host serializer on [=this=]'s [=relevant settings object=]'s [=environment/top-level origin=]'s [=origin/host=].
{{ReportingBrowserSignals/interestGroupOwner}}
[=serialization of an origin|Serialized=] |winner|'s [=generated bid/interest group=]'s @@ -1867,14 +1867,9 @@ and a {{ReportResultBrowserSignals}} |browserSignals|: 1. Let |buyer| be |winner|'s [=generated bid/interest group=]'s [=interest group/owner=]. 1. Let |perBuyerSignalsForBuyer| be |perBuyerSignals|[|buyer|] if that member [=map/exists=], and null otherwise. - 1. Let |reportWinBrowserSignals| be a {{ReportWinBrowserSignals}}. - 1. [=map/For each=] |key| -> |value| of |browserSignals|: - 1. [=map/Set=] |reportWinBrowserSignals|[|key|] to |value|. - - Note: Fields specific to {{ReportResultBrowserSignals}} have been removed from |browserSignals|, - so it only contains {{ReportingBrowserSignals}}'s fields. - - 1. Let |interestGroupName| be null. + 1. Let |reportWinBrowserSignals| be a {{ReportWinBrowserSignals}} with the members that + are declared on {{ReportingBrowserSignals}} initialized to their values in |browserSignals|. + 1. Let |interestGroupName| be {{undefined}}. 1. If the result of [=query reporting ID k-anonymity count=] given |winner|'s [=generated bid/interest group=] and |winner|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=] is true: @@ -2859,7 +2854,6 @@ dictionary ReportingBrowserSignals { {{ReportingBrowserSignals}} includes browser signals both `reportResult()` and `reportWin()` get. -The meanings and notes of some fields:
{{ReportingBrowserSignals/renderURL}}
The render URL returned by "`generateBid()`". It is @@ -2882,7 +2876,6 @@ dictionary ReportResultBrowserSignals : ReportingBrowserSignals { }; -The meanings and notes of some fields:
{{ReportResultBrowserSignals/desirability}}
The [=round a value|rounded value=] of the score returned by "`scoreAd()`" for the winning bid. @@ -2907,7 +2900,6 @@ dictionary ReportWinBrowserSignals : ReportingBrowserSignals { }; -The meanings and notes of some fields:
{{ReportWinBrowserSignals/adCost}}
Advertiser click or conversion cost passed from `generateBid()` to `reportWin()`. Non-negative @@ -2915,7 +2907,7 @@ The meanings and notes of some fields:
{{ReportWinBrowserSignals/seller}}
The [=serialization of an origin|serialized=] origin of the seller running the ad auction
{{ReportWinBrowserSignals/madeHighestScoringOtherBid}} -
Being true if the interest group owner was the only bidder that made bids with the second +
True if the interest group owner was the only bidder that made bids with the second highest score
{{ReportWinBrowserSignals/interestGroupName}}
Only set if the tuple of interest group owner, name, bidding script URL and ad creative URL From f2dc43ea2235a430ffbf17d1fb7b5de389e4eb97 Mon Sep 17 00:00:00 2001 From: Qingxin Wu Date: Fri, 7 Jul 2023 13:38:51 -0400 Subject: [PATCH 4/7] Address some comments --- spec.bs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/spec.bs b/spec.bs index d10721bd7..b6957107c 100644 --- a/spec.bs +++ b/spec.bs @@ -1378,7 +1378,7 @@ To score and rank a bid given an [=auction config=] |auctionConfig|,
{{ScoringBrowserSignals/interestGroupOwner}}
[=serialization of an origin|Serialized=] |owner|
{{ScoringBrowserSignals/renderURL}} -
[=URL serializer|Serialized=] |generatedBid|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=] +
The result of running the [=URL serializer=] on |generatedBid|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=]
{{ScoringBrowserSignals/biddingDurationMsec}}
|generatedBid|'s [=generated bid/bid duration=]
{{ScoringBrowserSignals/bidCurrency}} @@ -1813,12 +1813,14 @@ null |winningComponentConfig|: 1. Otherwise, set |leadingBidInfo|'s [=leading bid info/seller reporting result=] to |reportingResult|. 1. [=map/Remove=] |browserSignals|["`desirability`"]. - 1. [=map/Remove=] |browserSignals|["`dataVersion`"]. 1. [=map/Remove=] |browserSignals|["`modifiedBid`"]. 1. [=map/Remove=] |browserSignals|["`topLevelSellerSignals`"]. + 1. [=map/Remove=] |browserSignals|["`dataVersion`"]. - Note: Remove fields specific to {{ReportResultBrowserSignals}} so that they are not passed to - [=report win=]. + Note: Remove fields specific to {{ReportResultBrowserSignals}} which only sellers can learn about, + so that they are not passed to "`reportWin()`". `dataVersion` is also removed because + "`reportWin()`"'s data version is from the trusted bidding signals response header, but + "`reportResult()`"'s is from trusted scoring signals response header. 1. TODO: Store |reportUrl| and |reportingBeaconMap| in [=fenced frame config=] as appropriate. 1. Return « |sellerSignals|, |browserSignals| ». From 11111319614ff3eb189e14d129b1615efe0be1be Mon Sep 17 00:00:00 2001 From: Qingxin Wu Date: Tue, 11 Jul 2023 01:15:15 -0400 Subject: [PATCH 5/7] address comments --- spec.bs | 95 ++++++++++++++++++++++++++++++++------------------------- 1 file changed, 53 insertions(+), 42 deletions(-) diff --git a/spec.bs b/spec.bs index 9cb2c5a23..69431f585 100644 --- a/spec.bs +++ b/spec.bs @@ -1763,35 +1763,35 @@ null |winningComponentConfig|:
{{topWindowHostname}}
The result of running the host serializer on [=this=]'s [=relevant settings object=]'s [=environment/top-level origin=]'s [=origin/host=]. -
{{ReportingBrowserSignals/interestGroupOwner}} +
{{interestGroupOwner}}
[=serialization of an origin|Serialized=] |winner|'s [=generated bid/interest group=]'s [=interest group/owner=]. -
{{ReportingBrowserSignals/renderURL}} +
{{renderURL}}
[=URL serializer|Serialized=] |winner|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=] -
{{ReportResultBrowserSignals/desirability}} -
[=round a value|Rounded=] |leadingBidInfo|'s [=leading bid info/top score=] -
{{ReportingBrowserSignals/bid}} -
[=round a value|Rounded=] |bid| -
{{ReportingBrowserSignals/bidCurrency}} +
{{bid}} +
[=round a value|Stochastically rounded=] |bid| +
{{bidCurrency}}
The result of [=serializing a currency tag=] with |bidCurrency| -
{{ReportingBrowserSignals/highestScoringOtherBid}} +
{{highestScoringOtherBid}}
|highestScoringOtherBid| -
{{ReportingBrowserSignals/highestScoringOtherBidCurrency}} +
{{highestScoringOtherBidCurrency}}
|sellerCurrency| if it is not null, "`???`" otherwise -
{{ReportingBrowserSignals/dataVersion}} -
|leadingBidInfo|'s [=leading bid info/scoring data version=] if it is not null, - {{undefined}} otherwise -
{{ReportingBrowserSignals/topLevelSeller}} +
{{topLevelSeller}}
|leadingBidInfo|'s [=leading bid info/top level seller=] if it is not null, {{undefined}} otherwise +
{{componentSeller}} +
|leadingBidInfo|'s [=leading bid info/component seller=] if it is not null, {{undefined}} + otherwise +
{{ReportResultBrowserSignals/desirability}} +
[=round a value|Stochastically rounded=] |leadingBidInfo|'s [=leading bid info/top score=]
{{ReportResultBrowserSignals/topLevelSellerSignals}}
|leadingBidInfo|'s [=leading bid info/top level seller signals=] if it is not null, {{undefined}} otherwise -
{{ReportingBrowserSignals/componentSeller}} -
|leadingBidInfo|'s [=leading bid info/component seller=] if it is not null, {{undefined}} - otherwise
{{ReportResultBrowserSignals/modifiedBid}} -
[=round a value|Rounded=] |modifiedBid| if it is not null, {{undefined}} otherwise +
[=round a value|Stochastically rounded=] |modifiedBid| if it is not null, {{undefined}} otherwise +
{{ReportResultBrowserSignals/dataVersion}} +
|leadingBidInfo|'s [=leading bid info/scoring data version=] if it is not null, + {{undefined}} otherwise
1. Let |sellerReportingScript| be the result of [=fetching script=] with |config|'s [=auction config/decision logic url=]. @@ -1815,9 +1815,7 @@ null |winningComponentConfig|: 1. [=map/Remove=] |browserSignals|["`dataVersion`"]. Note: Remove fields specific to {{ReportResultBrowserSignals}} which only sellers can learn about, - so that they are not passed to "`reportWin()`". `dataVersion` is also removed because - "`reportWin()`"'s data version is from the trusted bidding signals response header, but - "`reportResult()`"'s is from trusted scoring signals response header. + so that they are not passed to "`reportWin()`". 1. TODO: Store |reportUrl| and |reportingBeaconMap| in [=fenced frame config=] as appropriate. 1. Return « |sellerSignals|, |browserSignals| ». @@ -1842,7 +1840,7 @@ and a {{ReportResultBrowserSignals}} |browserSignals|: 1. Set |interestGroupName| to |winner|'s [=generated bid/interest group=] [=interest group/name=]. 1. Add the following fields to |reportWinBrowserSignals|:
-
{{ReportingBrowserSignals/dataVersion}} +
{{ReportWinBrowserSignals/dataVersion}}
|leadingBidInfo|'s [=leading bid info/bidding data version=] if it is not null, {{undefined}} otherwise.
{{ReportWinBrowserSignals/adCost}} @@ -2809,11 +2807,10 @@ dictionary ReportingBrowserSignals { required USVString interestGroupOwner; required USVString renderURL; required double bid; - required DOMString bidCurrency; required double highestScoringOtherBid; - required DOMString highestScoringOtherBidCurrency; - unsigned long dataVersion; + DOMString bidCurrency; + DOMString highestScoringOtherBidCurrency; USVString topLevelSeller; USVString componentSeller; }; @@ -2821,15 +2818,27 @@ dictionary ReportingBrowserSignals { {{ReportingBrowserSignals}} includes browser signals both `reportResult()` and `reportWin()` get.
+
{{ReportingBrowserSignals/topWindowHostname}} +
[=environment/Top-level origin=]'s [=origin/host=] +
{{ReportingBrowserSignals/interestGroupOwner}} +
The winning [=interest group=]'s [=interest group/owner=].
{{ReportingBrowserSignals/renderURL}}
The render URL returned by "`generateBid()`". It is [=query reporting ID k-anonymity count|k-anonymous=]
{{ReportingBrowserSignals/bid}} -
The [=round a value|rounded value=] of the winning bid. This is always in the bidder's own - currency. +
[=round a value|Stochastically rounded=] winning bid. This is always in the bidder's own + currency
{{ReportingBrowserSignals/highestScoringOtherBid}} -
The [=round a value|rounded value=] of the the bid that got the second highest score, or 0 if - it's not available This is always in the bidder's own currency. +
The [=round a value|rounded value=] of the bid that got the second highest score, or 0 if it's + not available. 0 for top-level auctions with components +
{{ReportingBrowserSignals/bidCurrency}} +
The currency the {{ReportingBrowserSignals/bid}} is in +
{{ReportingBrowserSignals/highestScoringOtherBidCurrency}} +
The currency the {{ReportingBrowserSignals/highestScoringOtherBid}} is in +
{{ReportingBrowserSignals/topLevelSeller}} +
Copied from [=leading bid info/top level seller=] +
{{ReportingBrowserSignals/componentSeller}} +
Copied from [=leading bid info/component seller=]
@@ -2839,20 +2848,22 @@ dictionary ReportResultBrowserSignals : ReportingBrowserSignals { DOMString topLevelSellerSignals; double modifiedBid; + unsigned long dataVersion; };
{{ReportResultBrowserSignals/desirability}} -
The [=round a value|rounded value=] of the score returned by "`scoreAd()`" for the winning bid. +
The [=round a value|stochastically rounded value=] of the score returned by "`scoreAd()`" for + the winning bid
{{ReportResultBrowserSignals/topLevelSellerSignals}} -
Metadata returned by the top-level seller's "`reportResult()`", as JSON. +
Metadata returned by the top-level seller's "`reportResult()`", as JSON
{{ReportResultBrowserSignals/modifiedBid}} -
The [=round a value|rounded value=] of the bid value returned by the component seller's - "`scoreAd()`" method -
{{ReportingBrowserSignals/dataVersion}} +
The [=round a value|stochastically rounded value=] of the bid value returned by the component + seller's "`scoreAd()`" method +
{{ReportResultBrowserSignals/dataVersion}}
Only set if the Data-Version header was provided in the response headers from the trusted - scoring signals server. + scoring signals server
@@ -2863,24 +2874,24 @@ dictionary ReportWinBrowserSignals : ReportingBrowserSignals { boolean madeHighestScoringOtherBid; DOMString interestGroupName; unsigned short modelingSignals; + unsigned long dataVersion; };
{{ReportWinBrowserSignals/adCost}} -
Advertiser click or conversion cost passed from `generateBid()` to `reportWin()`. Non-negative - and only the lowest 8 bits will be passed +
[=round a value|Stochastically rounded=] winner's [=generated bid/ad cost=].
{{ReportWinBrowserSignals/seller}} -
The [=serialization of an origin|serialized=] origin of the seller running the ad auction +
The origin of the seller running the ad auction
{{ReportWinBrowserSignals/madeHighestScoringOtherBid}} -
True if the interest group owner was the only bidder that made bids with the second - highest score +
True if the interest group owner was the only bidder that made bids with the second highest + score
{{ReportWinBrowserSignals/interestGroupName}}
Only set if the tuple of interest group owner, name, bidding script URL and ad creative URL were [=query reporting ID k-anonymity count|jointly k-anonymous=]
{{ReportWinBrowserSignals/modelingSignals}}
A 0-4095 integer (12-bits) passed to `reportWin()`, with noising -
{{ReportingBrowserSignals/dataVersion}} +
{{ReportWinBrowserSignals/dataVersion}}
Only set if the Data-Version header was provided in the response headers from the trusted bidding signals server
@@ -3231,8 +3242,8 @@ the seller. [=interest group/ad components=] field. : ad cost :: Null or a {{double}}. Advertiser click or conversion cost passed from `generateBid()` to - `reportWin()`. Invalid values, such as negative, infinite, and NaN values, will be ignored and not - passed. Only the lowest 8 bits will be passed. + `reportWin()`. Negative values will be ignored and not passed. Will be + [=round a value|stochastically rounded=] when passed. : modeling signals :: Null or an {{unsigned short}}. A 0-4095 integer (12-bits) passed to `reportWin()`, with noising. : interest group From faa3cc02f8c214ba814e7aabf0617a6f3ede2e73 Mon Sep 17 00:00:00 2001 From: qingxinwu <6334674+qingxinwu@users.noreply.github.com> Date: Tue, 11 Jul 2023 19:22:17 -0400 Subject: [PATCH 6/7] Apply suggestions from code review Co-authored-by: Jeffrey Yasskin --- spec.bs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/spec.bs b/spec.bs index 69431f585..d1c1b29b5 100644 --- a/spec.bs +++ b/spec.bs @@ -1823,7 +1823,7 @@ null |winningComponentConfig|:
To report win given a [=leading bid info=] |leadingBidInfo|, a [=string=] |sellerSignals| -and a {{ReportResultBrowserSignals}} |browserSignals|: +and a {{ReportingBrowserSignals}} |browserSignals|: 1. Let |config| be |leadingBidInfo|'s [=leading bid info/auction config=]. 1. Let |winner| be |leadingBidInfo|'s [=leading bid info/leading bid=]. @@ -2829,7 +2829,8 @@ dictionary ReportingBrowserSignals {
[=round a value|Stochastically rounded=] winning bid. This is always in the bidder's own currency
{{ReportingBrowserSignals/highestScoringOtherBid}} -
The [=round a value|rounded value=] of the bid that got the second highest score, or 0 if it's +
The [=round a value|stochastically rounded value=] of the bid that got the second highest score, or 0 if it's + not available. 0 for top-level auctions with components
{{ReportingBrowserSignals/bidCurrency}}
The currency the {{ReportingBrowserSignals/bid}} is in @@ -2862,8 +2863,8 @@ dictionary ReportResultBrowserSignals : ReportingBrowserSignals {
The [=round a value|stochastically rounded value=] of the bid value returned by the component seller's "`scoreAd()`" method
{{ReportResultBrowserSignals/dataVersion}} -
Only set if the Data-Version header was provided in the response headers from the trusted - scoring signals server +
Set to the value of the [:Data-Version:] header from the trusted + scoring signals server, if any.
From 3d700f88313bee34a747ada0d991dee7698ae8fd Mon Sep 17 00:00:00 2001 From: Qingxin Wu <qingxinwu@google.com> Date: Tue, 11 Jul 2023 19:23:01 -0400 Subject: [PATCH 7/7] Add a todo to set interest group name for reporting --- spec.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.bs b/spec.bs index d1c1b29b5..8d29de814 100644 --- a/spec.bs +++ b/spec.bs @@ -1852,7 +1852,7 @@ and a {{ReportingBrowserSignals}} |browserSignals|: not null, and |buyer| is [=same origin=] with |leadingBidInfo|'s [=leading bid info/highest scoring other bid owner=], false otherwise <dt>{{ReportWinBrowserSignals/interestGroupName}} - <dd>|interestGroupName| if it is not null, {{undefined}} otherwise + <dd>TODO: set this. <dt>{{ReportWinBrowserSignals/modelingSignals}} <dd>|winner|'s [=generated bid/modeling signals=] if it is not null, {{undefined}} otherwise (TODO: noise and bucket this signal)