Skip to content

Commit 36a89d8

Browse files
[Spec] Fix minor bugs. (#1392)
* Fix minor bugs in spec.bs In particular: * Make fetch trusted signals always return 3 values. It was sometimes returning only two. * Make "score and rank a bid" take a policy container, and pass it to "fetch and decode trusted scoring signals", which requires one as an argument. * Pass a policyContainer to "score and rank a bid" calls. * Fix one "score and rank a bid" call, which wasn't being passed a realTimeContributionsMap. * Update spec.bs Co-authored-by: qingxinwu <[email protected]> * Update spec.bs * Update spec.bs Co-authored-by: qingxinwu <[email protected]> * Update spec.bs * Update spec.bs * Update spec.bs Co-authored-by: qingxinwu <[email protected]> --------- Co-authored-by: qingxinwu <[email protected]>
1 parent b3808be commit 36a89d8

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

spec.bs

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1846,6 +1846,7 @@ To <dfn>generate and score bids</dfn> given an [=auction config=] |auctionConfig
18461846
and a [=real time reporting contributions map=] |realTimeContributionsMap|:
18471847
1. [=Assert=] that these steps are running [=in parallel=].
18481848
1. Let |settings| be |global|'s [=relevant settings object=].
1849+
1. Let |policyContainer| be |settings|'s [=environment settings object/policy container=].
18491850
1. Let |topLevelOrigin| be |settings|'s [=environment/top-level origin=].
18501851
1. Let |seller| be |auctionConfig|'s [=auction config/seller=].
18511852
1. Let |auctionStartTime| be the [=current coarsened wall time=].
@@ -1887,13 +1888,13 @@ and a [=real time reporting contributions map=] |realTimeContributionsMap|:
18871888
[=score and rank a bid=] with |auctionConfig|, |reportingContextMap|[|auctionConfig|],
18881889
|compWinnerInfo|'s [=leading bid info/leading bid=], |leadingBidInfo|,
18891890
|decisionLogicFetcher|, |trustedScoringSignalsBatcher|, null, "top-level-auction", null,
1890-
and |topLevelOrigin|.
1891+
|topLevelOrigin|, |realTimeContributionsMap|, and |policyContainer|.
18911892
1. If |compWinnerInfo|'s [=leading bid info/leading non-k-anon-enforced bid=]
18921893
is not null, then run [=score and rank a bid=] with |auctionConfig|, |reportingContextMap|[
18931894
|auctionConfig|], |compWinnerInfo|'s [=leading bid info/leading non-k-anon-enforced bid=],
18941895
|leadingBidInfo|, |decisionLogicFetcher|, |trustedScoringSignalsBatcher|,
18951896
|topLevelDirectFromSellerSignalsForSeller|, null, "top-level-auction", null, |topLevelOrigin|,
1896-
and |realTimeContributionsMap|.
1897+
|realTimeContributionsMap|, and |policyContainer|.
18971898
1. Decrement |pendingComponentAuctions| by 1.
18981899
1. Wait until |pendingComponentAuctions| is 0.
18991900
1. If |auctionConfig|'s [=auction config/aborted=] is true, return failure.
@@ -1971,7 +1972,8 @@ and a [=real time reporting contributions map=] |realTimeContributionsMap|:
19711972
1. [=Score and rank a bid=] with |auctionConfig|, |reportingContext|
19721973
|additionalBid|'s [=decoded additional bid/bid=], |leadingBidInfo|, |decisionLogicFetcher|,
19731974
|trustedScoringSignalsBatcher|, |directFromSellerSignalsForSeller|, null, |auctionLevel|,
1974-
|componentAuctionExpectedCurrency|, |topLevelOrigin|, and |realTimeContributionsMap|.
1975+
|componentAuctionExpectedCurrency|, |topLevelOrigin|, |realTimeContributionsMap|, and
1976+
|policyContainer|.
19751977
1. Decrement |pendingAdditionalBids| by 1.
19761978
1. [=map/For each=] |buyer| → |perBuyerGenerator| of |bidGenerators|,
19771979
[=parallel queue/enqueue steps|enqueue the following steps=] to |queue|:
@@ -2035,7 +2037,7 @@ and a [=real time reporting contributions map=] |realTimeContributionsMap|:
20352037
1. [=list/For each=] |ig| of |groups|:
20362038
1. [=Batch or fetch trusted bidding signals=] given |trustedBiddingSignalsBatcher|,
20372039
|ig|, |signalsUrl|, |buyerExperimentGroupId|, |topLevelOrigin|, |slotSizeQueryParam|,
2038-
and |settings|'s [=environment settings object/policy container=].
2040+
and |policyContainer|.
20392041
1. [=Fetch the current outstanding trusted signals batch=] given |trustedBiddingSignalsBatcher|,
20402042
|signalsUrl|, |buyer|, |buyerExperimentGroupId|, |topLevelOrigin|, and |slotSizeQueryParam|.
20412043
1. [=Fetch the trusted key value signals batch=] given |trustedBiddingSignalsBatcher|,
@@ -2150,7 +2152,8 @@ and a [=real time reporting contributions map=] |realTimeContributionsMap|:
21502152
1. [=Score and rank a bid=] with |auctionConfig|, |reportingContext|, |bidToScore|,
21512153
|leadingBidInfo|, |decisionLogicFetcher|, |trustedScoringSignalsBatcher|,
21522154
|directFromSellerSignalsForSeller|, |dataVersion|, |auctionLevel|,
2153-
|componentAuctionExpectedCurrency|, |topLevelOrigin|, and |realTimeContributionsMap|.
2155+
|componentAuctionExpectedCurrency|, |topLevelOrigin|, |realTimeContributionsMap|,
2156+
and |policyContainer|.
21542157
1. [=Update cumulative buyer time metrics=] given |metrics| and |cumulativeTimeoutTracker|.
21552158
1. Decrement |pendingBuyers| by 1.
21562159
1. Wait until both |pendingBuyers| and |pendingAdditionalBids| are 0.
@@ -2357,12 +2360,14 @@ a [=trusted scoring signals batcher=] |trustedScoringSignalsBatcher|
23572360
a {{DirectFromSellerSignalsForSeller}} |directFromSellerSignalsForSeller|, an {{unsigned long}}-or-null
23582361
|biddingDataVersion|, an enum |auctionLevel|, which is "single-level-auction", "top-level-auction",
23592362
or "component-auction", a [=currency tag=] |componentAuctionExpectedCurrency|, an [=origin=]
2360-
|topLevelOrigin|, and a [=real time reporting contributions map=] |realTimeContributionsMap|:
2363+
|topLevelOrigin|, a [=real time reporting contributions map=] |realTimeContributionsMap|, and
2364+
a [=policy container=] |policyContainer|:
23612365

23622366
1. Let «|trustedScoringSignalsAreCrossOrigin|, |sameOriginTrustedScoringSignals|,
23632367
|crossOriginTrustedScoringSignals|, |scoringDataVersion|» be the result of [=fetch and
23642368
decode trusted scoring signals=] given |trustedScoringSignalsBatcher|, |auctionConfig|,
2365-
|generatedBid|, |decisionLogicFetcher|, |topLevelOrigin|, and |realTimeContributionsMap|.
2369+
|generatedBid|, |decisionLogicFetcher|, |topLevelOrigin|, |realTimeContributionsMap|,
2370+
and |policyContainer|.
23662371
1. Let |adMetadata| be |generatedBid|'s [=generated bid/ad=].
23672372
1. Let |bidValue| be |generatedBid|'s [=generated bid/bid=].
23682373
1. If |generatedBid|'s [=generated bid/modified bid=] is not null, then set |bidValue| to
@@ -2663,7 +2668,8 @@ is a [=structured header=] whose value must be an [=structured header/integer=].
26632668

26642669
<div algorithm>
26652670
To <dfn>fetch trusted signals</dfn> given a [=URL=] |url|, an [=origin=] |scriptOrigin|, a
2666-
[=policy container=] |policyContainer|, and a [=boolean=] |isBiddingSignal|:
2671+
[=policy container=] |policyContainer|, and a [=boolean=] |isBiddingSignal|. They return a
2672+
[=tuple=] consisting of ([=ordered map=] or null, [=ordered map=] or null, integer or null):
26672673

26682674
1. Let |request| be a new [=request=] with the following properties:
26692675
: [=request/URL=]
@@ -2709,19 +2715,19 @@ To <dfn>fetch trusted signals</dfn> given a [=URL=] |url|, an [=origin=] |script
27092715
[:X-fledge-bidding-signals-format-version:] and "`item`" from |headers|.
27102716
1. Set |signals| to the result of [=parsing JSON bytes to an Infra value=] |responseBody|.
27112717
1. Wait for |signals| to be set.
2712-
1. If |signals| is a parsing exception, or if |signals| is not an [=ordered map=], return « null,
2713-
null, null ».
2718+
1. If |signals| is a parsing exception, or if |signals| is not an [=ordered map=], return a
2719+
[=tuple=] (null, null, null).
27142720
1. If |formatVersion| is 2:
2715-
1. If |signals|["`keys`"] does not [=map/exist=], return « null, null ».
2721+
1. If |signals|["`keys`"] does not [=map/exist=], [=tuple=] (null, null, null ).
27162722
1. Set |signals| to |signals|["`keys`"].
2717-
1. If |signals| is not an [=ordered map=], return « null, null ».
2723+
1. If |signals| is not an [=ordered map=], return a [=tuple=] (null, null, null).
27182724
1. If |signals|["`perInterestGroupData`"] [=map/exists=] and is an [=ordered map=]:
27192725
1. [=Assert=] |isBiddingSignal| is true.
27202726
1. Let |perInterestGroupData| be |signals|["`perInterestGroupData`"].
27212727
1. [=map/For each=] |key| → |value| of |signals|:
27222728
1. [=map/Set=] |signals|[|key|] to the result of [=serializing an Infra value to a JSON string=]
27232729
given |value|.
2724-
1. Return « |signals|, |perInterestGroupData|, |dataVersion| ».
2730+
1. Return a [=tuple=] (|signals|, |perInterestGroupData|, |dataVersion|).
27252731
</div>
27262732

27272733
<div algorithm>

0 commit comments

Comments
 (0)