Skip to content

Report CMP consent to the EC route and merge its answer into Prebid - #1622

Open
prk-Jr wants to merge 32 commits into
feat/1598-ec-route-fastlyfrom
feat/1599-ec-route-consent-script
Open

prk-Jr wants to merge 32 commits into
feat/1598-ec-route-fastlyfrom
feat/1599-ec-route-consent-script

Conversation

@prk-Jr

@prk-Jr prk-Jr commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Report publisher CMP decisions to the mounted shared EC route and merge its returned identity into request-local Prebid auctions. Identity mode with a bound record store and no enabled Sourcepoint integration receives ecRoute; auction mode, missing storage and Sourcepoint-owned consent pages omit it.

Consent reports use the validated absolute same-origin URL, including documents with an external base. Every first applicable CMP reading is an unverified possible withdrawal, so navigation IDs wait for confirmation even when a CMP has already written the matching consent cookie. Queue barriers preserve order. Known 8 KiB signal and 16 KiB whole-request limits are checked before fetch, rejecting the entire oversized report without lifting suppression or losing later decisions. Definitive request-validation rejection discards the invalid report while retaining suppression and allowing later valid decisions through; uncertain delivery still retries on a lifecycle trigger. Overtaken answers cannot return through their newly written mirror cookies: suppression starts at queue time, including headers-before-body and truncated-body timing. Grant coalescing remains intact. Repeated A/B/A readings update the exact pending queue entry, and uncertain delivery invalidates prior confirmation so a fresh earlier choice is reported again.

The browser accepts mirrored EIDs and the separate writeback-only sharedId, merging the latter as pubcid.org with the normal opt-out and deduplication rules. These IDs never enter global Prebid configuration or native identity capture. SharedID opt-out follows the server's cookie-presence rule, including empty cookies, and both source aliases case-insensitively; localStorage keeps Prebid's existing truthy-value/expiry rule.

CMP recovery retries inactive capture even if the API function is unchanged. Accepting-API TCF listener cleanup is shared while continuous reporting and managed-ID one-shot policies remain separate. GPP types/section validation and fake-CMP test fixtures are shared without changing Sourcepoint's independent consent ownership.

Base and scope

Live base: #1662, feat/1598-ec-route-fastly (faaf573e0cc53c7c292216314fe39f722ae29077). It already mounts the EC route, originally introduced by #1646. This PR adds browser activation and consent reporting. #1620 supplies the identity-mode browser dependency; its earlier merged history is retained.

Part of #1599. Sourcepoint remains the sole consent writer when enabled, using /_ts/consent; those pages retain capture and navigation-mirror merging without gaining current-page minting from Prebid. A future Sourcepoint migration needs coordinated queue ownership and explicit null-clear semantics.

Verification

Correction revision: 6baabe0ed, signed and GitHub Verified. All 31 main and 13 supplementary local validation steps pass on its exact source tree, including target-matched Rust tests/Clippy, native parity/build-digest tests, deadline runtime fixtures, release builds and all four startup smokes. Core docs build with the same existing warnings. All 33 hosted checks across seven workflows pass on this revision, including the browser, trace acceptance, Fastly EC lifecycle, all adapter tests and production startup suites. All 17 received inline review threads have fix/evidence replies and are resolved. The reviewer’s submitted verdict remains unchanged. The final JavaScript candidate passes all 3,510 tests, scoped TypeScript checks, lint, and formatting. The Prebid shim is 66,995 bytes, below the unchanged 67,000-byte guard. A real Chrome client/fetch probe confirms oversized keepalive is rejected before HTTP and a later valid withdrawal is delivered; an HTTP-only incomplete control fails. Its HTTP responder is controlled, so this does not qualify a deployed EC route or a real CMP. Earlier CI, bundle measurements, browser runs and readiness reports in the original description apply to older revisions and must not be read as evidence for these corrections.

Controlled CMP/fetch tests exercise the actual Prebid installation and request wrapper. Real CMP products, deployed Fastly/CloudFront behavior and Safari one-year persistence remain unverified by this response cycle. The complete #1599 acceptance remains open, including its independent #1592 requirement. No deployment or dependency-PR edit is included.

Current design: EC route consent reporting.

Historical PR description — superseded revision evidence

The following description is retained as historical context. Its revision, base, behavior, measurements and verification statements are superseded by the current sections above.

Summary

Report publisher CMP decisions to the real shared EC route and merge its mirrored IDs into identity-mode Prebid auctions. A consent grant can establish identity on the current page; ordered withdrawal reports clear browser identity and suppress the IDs supplied by Trusted Server while newer consent is pending.

  • Inject window.__tsjs_prebid.ecRoute = "/_ts/api/v1/ec" through the existing Prebid head injector only in identity mode with a bound record store and no enabled Sourcepoint integration. Auction mode, absent identity storage and apps whose route returns 501 omit it. The capability follows the actual mounted identity app, including Axum's later store binding and Fastly's lazy record handle; it also works with prepared/cached Prebid head inserts.
  • Check exact queue and fetch request bodies against the same test/fixtures/ec-route-contract.json used by the real Axum/Fastly routes. Match the server's 32-entry applicable-section limit.
  • Share src/shared/gpp_capture.ts between Prebid and Sourcepoint; move common API tests with it and retain Sourcepoint's cookie-bridge tests. Sourcepoint continues reporting to /_ts/consent. When enabled, it is the page's sole consent writer: Prebid receives no EC route, even with SDK rewriting off or a CMP that loads later. Identity capture and navigation-mirror merging remain enabled.
  • Keep TCF listener cleanup scoped to the API that accepted it. Independent CMPs may reuse a listener ID; a queued callback from the old API must not delete the replacement's subscription or hide its later withdrawal. Reader and full Prebid-integration regressions fail before this correction and pass afterward.
  • Preserve request-local mirror merging, one EC call in flight, non-replaceable withdrawal barriers, stale-answer suppression and the localStorage _pubcid_optout cookie bridge.

Part of #1599. Safari lifetime, real-CMP/deployed qualification and the ID-7 dependency keep the complete issue open.

Base and merge history

Base: feat/1574-axum-shared-identity (#1646), current head 6bc15305fdf340f0a38fd79423047f2ecfdf119f. The historical correction used base 7648537f7d41607e7dd6a9097ce8174453fbd143; signed merge 4288abf1657fe82bc8d6660538892893df3d94a3 incorporates the current base. This is the appropriate dependency because it supplies the shared EC route and aligned browser/server contract. #1620 (4de68646d115569d5894925ec06b3f95fc5fc728) is the other merged dependency, supplying identity-only tsjs. #1646's own dependency stack remains unchanged. Whenever #1646 advances, merge its new head here and revalidate the affected behavior. Current trial merges conflict with #1636 in the lifecycle/post-delivery files, #1627 in store documentation/configuration, #1616 in post-delivery tests, and #1617/#1615 in startup/health/finalization; their resolutions are not covered by individual PR CI.

Signed merge Source Resolution
8e13da0d6 #1620 Clean automatic merge; no conflicts.
10026f0f6 #1646 initial head Clean automatic merge, including Prebid Rust/JS and its guide; no manual conflict resolutions.
19e1ef6da #1646 then-current head 7648537f7 Clean automatic refresh; includes consent-aware GET SharedID restoration and the expanded eight-case shared contract. No conflicts.
4288abf16 #1646 current head 6bc15305f Incorporate the current shared-identity history; no file-tree change from 19e1ef6da.

Historical metadata-operation report (the native-stack event receipt is not linked and is independently unverifiable): native stack #1648 was dissolved using GitHub's metadata-only unstack API, then only #1622 was retargeted. No new native stack was created. Before/after checks confirm #1620 remains identical: head 4de68646d115569d5894925ec06b3f95fc5fc728, base feat/s2s-eid-collection-providers, draft false, requested reviewers aram356, ChristianPavilonis, dhruv8sh. Its branch, title, state, labels and description are unchanged too. No rebases, force-pushes or dependency branch edits.

Design: EC route consent script; implementation plan.

T19 / #1598 scope

This PR supplies the server-side ecRoute activation from #1598 (T19) needed by #1599. #1646 already supplies the mounted route, posted-consent reconciliation, record/provider lifecycle, withdrawal tombstones, mirror JSON and SharedID writeback. The browser and server now use a shared request contract; the route exists in this stack.

Remaining #1598 work/qualification: complete its server-owned acceptance checklist against the deployed target environments, including Safari's one-year lifetime on Fastly and Axum behind CloudFront; complete the trusted JA4/User-Agent contradiction rule owned by #1592; retain any provider/deployment qualification limits below. This PR does not implement EdgeZero work or change #1646.

One consent writer on Sourcepoint pages

GPP changes previously reached both Sourcepoint's /_ts/consent publisher and Prebid's EC consent queue when both integrations were enabled. The server now omits ecRoute whenever Sourcepoint is enabled. Sourcepoint initializes consent synchronization independently of rewrite_sdk and CMP arrival, so this conservative ownership rule has no load-order or in-flight handoff race. Disabled or absent Sourcepoint leaves Prebid reporting enabled under the normal identity/store gates.

Sourcepoint retains its existing GPP grant and null-clear payloads. Its TCF bridge continues updating its cookie without a TCF POST. These pages keep identity capture and navigation-mirror merging but do not gain current-page EC minting from Prebid; a TCF-only server reconciliation may wait for the next eligible navigation. Sourcepoint's reporting destination and transport are unchanged.

Follow-up

Recommend a coordinated migration of Sourcepoint to the single EC route queue, without opening a new issue here. Define when Sourcepoint pages should mint identity/run providers (the current endpoint is nonminting), translate its gppString: null clear payload into explicit EC-route clearing semantics, and route TCF/GPP changes through one ordered queue with one owner across integration load order, late CMPs and SDK rewriting settings. A URL-only switch breaks null-clear handling; running both endpoints independently reintroduces competing writes.

Bundle size

Historical bundle measurements at 19e1ef6da33c4560909c273c937be20171d41c76 follow; original built bytes are not linked.

Served IIFE After dependency merges This change Delta
Prebid shim 66,406 bytes 66,341 bytes -65
Sourcepoint 16,718 bytes 16,706 bytes -12

The existing Prebid guard remains 66,500 bytes, and the production-artifact test passes. Sharing source removes maintenance duplication; independently served IIFEs still each embed the capture they need. The final listener cleanup and shared capture produce a combined 77-byte reduction from the merged baseline, including the 32-entry validation.

Acceptance evidence for #1599

Historical runtime evidence at 19e1ef6da33c4560909c273c937be20171d41c76 follows. Source/test definitions are inspectable; original private browser traces and runtime receipts are not linked and remain independently unverifiable. All stated qualification limits remain.

Criterion Evidence and ownership
Consented same-origin POST without EC creates a record and sets EC/SharedID on Fastly and Axum Real Chrome through the publisher proxy on Axum release and Fastly release/Viceroy 0.21.0: grant POST returns EC/SharedID cookies and an admin lookup confirms the live record (49 identity assertions per adapter).
JSON omits nonmirrored, vendor-denied and expired IDs #1646's identity_conformance::identity_conformance_axum and identity_conformance::identity_conformance_fastly, verify_http_contract mirror-only controls; browser transport does not expose additional record fields.
Withdrawal while first grant/providers are pending leaves no cookies, live record or Prebid ID Fastly/Viceroy and Linux Axum production release: actual supported ID5 provider held at a controlled local HTTPS origin; A returns the provider ID, B clears cookies and an actual admin lookup confirms A is tombstoned. The fixture bidder executes during the delay and after B with empty EIDs; publisher-sentinel controls prove Prebid's permission filters cannot conceal a stale TS merge. The Linux Axum probe passes 23 assertions with exact head/version verification, and the Fastly probe passes 22.
A/B/C order; B expires/tombstones A; C starts without EC Chrome on both adapters: exactly one EC call in flight, actual A/B/C request bodies in order, B deletion cookies, A tombstone remains after C, C request has no EC and creates its own live record; EcRouteClient > withdraws while a grant is in flight: clears, suppresses and orders A, B, C.
Cross-site Origin, GET and ID-7 refused client mint nothing/call no provider Route controls owned by #1646: HTTP conformance and ec_route_refused_client_with_existing_identity_never_calls_page_provider. Full trusted JA4/User-Agent family contradiction remains #1592; no claim of deployed ID-7 qualification.
Unchanged returning reader gets no Set-Cookie Chrome on both adapters: identical returning-reader POST produces zero Set-Cookie headers; #1646 HTTP conformance returning-cookie controls.
Safari keeps route EC/SharedID one-year Max-Age on both deployment targets Not yet verified: no Safari persistence or deployed CloudFront/Fastly lifetime qualification.
Identity mode delivers mirrored IDs to Prebid, adds no Trusted Server bidder Chrome on both adapters: a real Prebid 10.26 bid adapter receives the returned SharedID in request EIDs; no trustedServer bidder is added. With B pending and later consent C granted, the same bidder executes with empty EIDs, providing a positive reach control; production-artifact identity tests and identity-mode integration suite.
_pubcid_optout, including localStorage-only opt-out, stops SharedID Chrome on both adapters: localStorage opt-out is copied before the next route call; that request carries _pubcid_optout=1, route JSON and the actual Prebid bidder omit SharedID, no SharedID cookie is created and the inspected live record stores none; pubcid_optout.test.ts, identity integration tests and #1646 SharedID server controls.

Verification

Historical author-reported local results below are for 19e1ef6da33c4560909c273c937be20171d41c76, against base 7648537f7d41607e7dd6a9097ce8174453fbd143; original local execution logs are not linked. All checks below were reported passing with Rust 1.98.1 and Node 24.20.0. Viceroy is 0.21.0.

Local gate Result
Vitest 90 files, 3,467 tests pass, no type errors; includes production-artifact size guard
JS build, format, ESLint Pass; shim 66,341 < 66,500 bytes
Rust format Pass
Five adapter test aliases Pass: Fastly/default, Fastly/reusable, Axum, Cloudflare, Spin
Eight Clippy aliases Pass: Fastly, Axum, Cloudflare/native+WASM, Spin/native+WASM, CLI, codegen
Real Axum/Fastly identity conformance Both pass, including the shared JSON fixture
Adapter identity guard 9 pass
#1637 runtime-environment guard 52 compiler fixtures pass; production lint passes every target and both Fastly modes
Adapter parity 33 pass
Native core build-digest tests and lint Pass
Ordinary host CLI tests Pass; additional ignored browser helpers were not selected
Fastly deadline network fixtures 6 pass
Cloudflare and Spin deadline fixtures Both build/lint pass; Cloudflare passes four runtime cases and Spin five
Wasm clock guard Pass
Node-pin tests and guard Pass
Documentation proposal shellcheck, hunk tests and integration script Pass
Release helper tests and shellcheck Pass
Native-provider helper tests Pass
Fastly response-diff helper tests Pass
Rust docs Pass; inherited warnings remain in unchanged dependency-base files, no new warning sites
Docs and outside-docs Markdown formatting Pass
Added URL-host lint Pass against then-current #1646 base 7648537f7
Production-entry Axum/CLI and Axum/Fastly release builds Pass; Axum runtime release includes documented geo-cloudfront feature

The initial Axum listener failure was a sandbox infrastructure restriction; it passed after enabling loopback access. Local Clippy commands initially placed --locked after alias lint arguments and were rejected before execution; the exact documented aliases all pass. These were local setup/invocation corrections, not product-test failures or hosted CI reruns.

Runtime scope and limits

This is the historical runtime report for 19e1ef6da33c4560909c273c937be20171d41c76, not a rerun on current head 4288abf16. Both adapters ran their release artifacts with Rust 1.98.1, Node 24.20.0 and pinned Viceroy 0.21.0. Chrome uses the actual CLI publisher proxy and HTTPS publisher origin, isolated profiles, prepared application config and real local record-store bindings. Axum uses a local persistent record directory; Viceroy uses its in-memory local KV record binding. Browser probes verify records across requests, without claiming Fastly restart durability. The served unified core/creative script and deferred Prebid shim are byte-identical to freshly built JS. Each adapter passes 49 identity-flow assertions, seven auction-mode assertions and eight no-storage/501 assertions. The actual delayed-provider probes pass 22 assertions on Fastly and 23 on Linux Axum production, with a process-local fixture CA and no system trust changes. Fresh exact-head GPP-only US/CA probes pass 28 assertions on each adapter, including no TCF API/cookie, GPP grant, GPP opt-out overriding a legacy US Privacy grant, denied GPC GET and positive SharedID restoration without record mutation. Exact-head identity and replacement-CMP probes also pass. Additional checks pass 51 assertions per adapter with an executing unfiltered fixture bidder, 12 per adapter for colliding TCF API listener IDs, and 19 for each of four Sourcepoint coexistence configurations (both adapters, SDK rewriting on/off).

Historical correction-head probes verify x-ts-version: 19e1ef6da33c4560909c273c937be20171d41c76. Release artifact SHA-256: native geo Axum 570c176327054e8b50d6f0813a936e4c880bb7d50e63a63b6e88b4406a47de77; Fastly WASM 577a212ed70d166bf39a0695696dfbe1ae3090f04a709693580c2191fe449df6. The Linux delayed-provider probe uses the stock production Dockerfile and an archive of that exact Git revision, with no operator files included.

Controlled fixtures: publisher HTML; existing-CMP API stubs for TCF/GPP; a coherent synthetic TCF grant derived from the shared fixture with Purpose 2/vendor 123 added for the controlled bidder; the shared GPP signal; a generated real Prebid 10.26 asset delivered by browser interception; additional suppression controls use the package's optional allowActivities module with overrides scoped only to a fictional consumer bidder, plus publisher sentinels that prove Prebid cannot mask stale Trusted Server IDs; synthetic protected-loopback DE/US-CA Geo on native Axum and corresponding Viceroy Geo on Fastly. EC responses, store operations, cookie handling and TSJS injection are the real application paths, without an EC responder stub. A/B/C holds A before forwarding it to the real app; separate Fastly and Linux Axum tests hold an actual supported provider HTTPS response.

Not verified: Safari one-year persistence, real CMP products and deployed Fastly/CloudFront behavior. The native HTTPS-delay scenario was verified on Linux production after macOS's platform verifier could not select a process-local fixture root; no machine trust changes were made. #1592's complete trusted JA4/User-Agent family contradiction rule remains separate. No further #1646 correction is requested: its latest consent-aware SharedID GET fix is merged and covered by both adapter conformance and Chrome controls.

No operator trusted-server.toml, .env, .env.*.local or VS Code setup was edited. The initial sandbox listener failure and incorrect local Clippy argument placement were corrected without product code changes. The default Rust override was bypassed per process, preserving user configuration.

Hosted CI

Current head: 4288abf1657fe82bc8d6660538892893df3d94a3, base 6bc15305fdf340f0a38fd79423047f2ecfdf119f: all 29 current-head checks pass. The following linked receipt is historical, for head 19e1ef6da33c4560909c273c937be20171d41c76, base 7648537f7d41607e7dd6a9097ce8174453fbd143. All 29 hosted checks passed across all six applicable workflows, with no pending, failed, skipped or canceled checks and no manual reruns. All five newly created commits (three merges and two implementation commits) are signed and GitHub Verified.

The native AWS example workflow did not run because this PR adds no paths in its workflow filter after retargeting; this is an untriggered workflow, not a skipped or failed check. Its earlier-head result is historical and is not counted here.

Workflow Check Result
Worker auction deadline runtime regressions worker-deadlines (cloudflare) success
Worker auction deadline runtime regressions worker-deadlines (spin) success
Stock celld record integration stock-celld-records success
Native RC container record-provider-image success
Native RC container local-provider-image success
Run Format cargo fmt success
Run Format docs-proposal scripts success
Run Format Fastly response diff script success
Run Format Native provider acceptance script success
Run Format CLAUDE.md symlink guard success
Run Format format-docs success
Run Format format-typescript success
Run Format release scripts success
Run Format CI Node pin guard success
Run Tests HTML EOF runtime (Fastly) success
Run Tests cargo check (cloudflare native + wasm32-unknown-unknown) success
Run Tests cargo check/build/test (spin native + wasm32-wasip1) success
Run Tests cargo test success
Run Tests cargo test (ts CLI, native) (macos-latest) success
Run Tests ts dev lint domains (changed lines) success
Run Tests cargo test (axum native) success
Run Tests cargo test (ts CLI, native) (ubuntu-latest) success
Run Tests cargo test (cross-adapter parity) success
Run Tests vitest success
Integration Tests prepare integration artifacts success
Integration Tests integration tests success
Integration Tests trace runtime and browser acceptance success
Integration Tests integration tests (Fastly EC lifecycle) success
Integration Tests browser integration tests success

Independent review

Historical review report for 19e1ef6da33c4560909c273c937be20171d41c76 (private review transcripts are not linked): the first independent review found a TCF replacement-listener collision: a late old callback could remove the new CMP listener with the same API-local ID, losing subsequent withdrawal reports. Accepting-API-only cleanup fixes it; unit/integration regressions fail before the correction and pass afterward, and real Chrome replacement-CMP probes pass on both adapters. Runtime probes now also require an executing bidder and sentinel sensitivity controls rather than relying on empty observation arrays. Two independent reviewers inspected the complete effective PR diff and affected unchanged paths against the current base, separately checked the dependency refresh, and found no remaining code defects. Browser review independently reran 144 tests. Both reviewers rechecked live head/base and the published evidence after all 29 hosted checks finished and classify this revision READY TO REQUEST REVIEW. Draft state is unchanged; this readiness does not close the remaining #1599 qualification items.

Define the browser half of the EC route: consent capture from the
publisher's TCF and GPP CMPs, the request contract the server route must
accept, in-order delivery that never drops or reorders a withdrawal,
merging route answers into identity-mode auctions and copying a
localStorage SharedID opt-out into its cookie. The server route (#1598)
injects the route path that turns this on.
The Prebid integration observes the publisher's TCF and GPP CMPs and
posts each decision to the injected same-origin EC route, one call at a
time and in order. A newer grant replaces a waiting grant, but a possible
withdrawal is never replaced or dropped, so it reaches the server after
any grant in flight and before any later grant. In identity mode the
route's answer is merged into publisher auctions while the mirror cookie
is unchanged, and nothing is merged while a possible withdrawal is
pending. Reporting stays off until the server injects the route path.

In both modes a localStorage SharedID opt-out is copied into the
_pubcid_optout cookie the server honors, using Prebid's own rule.

GPP capture moves in from the Sourcepoint consent extraction (#1535) with
its tests. The served shim grows by 11 KB, so its size guard rises.
@prk-Jr prk-Jr self-assigned this Nov 18, 2026
A known TCF withdrawal whose TC string cannot be sent queues nothing, so
the grant already in flight lifted suppression when it was answered and
its late mirror reached the next auction. Such a withdrawal now fences
suppression: only an answer to a call queued after it lifts it. A repeated
withdrawal that is already queued does not fence, so its own answer still
lifts suppression.

Also remove two members only tests used and make the no-route
preservation test cover auction mode too.
A known withdrawal with an unsendable TC string but a valid GPP reading
was sent without its TCF part, so the server answered from the stale
euconsent-v2 cookie and that answer lifted suppression. Fence whenever
the withdrawal's TCF reading cannot be sent, stamping its own call
before the fence. After a fence, a reading equal to the last call is
sent again, so an unchanged later reading can still lift suppression.
A grant sent after a fence that then failed left the older answered state
deduplicating the next identical reading, so merging stayed suppressed
for the rest of the page view. A fence now forgets the last answered
state instead of flagging repeats, and an identical fenced withdrawal
that is already pending or answered no longer re-fences and resends.
The spec's contract, ordering and merging sections state the fence rules.
Skipping the fence for a withdrawal whose GPP-only body matched an
earlier call let that call's answer, built from the stale euconsent-v2
cookie, lift suppression. A known TCF withdrawal with an unsendable TC
string now makes no call at all and only fences, so there is no
cookie-based answer to trust and no repeat rule to get wrong.
When an unchanged reading followed an unsendable withdrawal while the
identical call was still waiting or in flight, the reading was
deduplicated without a new stamp, so that call's answer could not lift
suppression for the rest of the page view. Re-stamp the pending call:
its answer reflects the current reading.
@prk-Jr prk-Jr linked an issue Nov 18, 2026 that may be closed by this pull request
9 tasks
The merge applied without conflicts. The Prebid integration config keeps
this pull request's mode field next to the base's changes, and the
example config, the Prebid guide and the tsjs Prebid sources take both
sides unchanged. The server mirror cookie the identity mode reads is the
same name and envelope in the base, so no code needed to change.
Takes #1489's new head e4ae9ca, which brings #1506's repin of
EdgeZero to rc/identity at 9d02d7b3. The merge is clean, and this PR's tree
changes only by that repin.
Takes #1489's new head 8623c4e. The merge is clean, and this PR's tree
changes only by the commits #1489 and the PRs below it added since
e4ae9ca.
@prk-Jr
prk-Jr added this pull request to stack #1648 November 20, 2026 09:28
@prk-Jr
prk-Jr removed this pull request from stack #1648 November 20, 2026 13:03
@prk-Jr
prk-Jr changed the base branch from feat/1594-identity-only-tsjs to feat/1574-axum-shared-identity November 20, 2026 13:03
@prk-Jr
prk-Jr marked this pull request as ready for review November 20, 2026 14:41
This brings in 1f054c6 from #1488, which forwards ortb2.user.ext.eids
from the Prebid config into the auction EIDs, and a99dd66, a62601b,
d1eb75f and 394892b from #1489, which cap mirrored UID expiry at 30
days from the UTC day start and pass the request time into finalize. They
arrive through the chain's merges into #1639, #1640, #1612, #1628, #1623,
#1531, #1532, #1533, #1534, #1536, #1535, #1537, #1539, #1538, #1540,
#1566, #1624, #1641, #1642, #1646, #1626, #1656, #1661 and #1662, with
#1646's move of the request time into IdentityApp::finalize. It also
brings d5276ee, which publishes the native AWS runtime files without
GNU mv -T, and Christian's merge 5597d3e of #1538 into #1540, through
#1566's merge.

The base now also carries the Axum serving line (#1613, #1616, #1617, #1615,
#1635, #1637 and #1627), which #1533 merged, and #1627's b958107, which
decodes the Spin discovery document with Response::json, and #1627's merge
of #1625 (006b45e), which pins Wrangler for the Cloudflare smoke and CI.

Prebid shim: syncPrebidEidsCookie keeps this PR's single path, where no
EIDs and an empty fitted payload both clear a stale cookie, with
change-only writes and stale-capture clearing. The base still has the
older `if (!eids)` early return, into which #1488 moved its stale-cookie
comment when it dropped the getUserIdsAsEids guard above it; the merge
does not take that early return back. #1488's collectAuctionEids, which
now also reads ortb2.user.ext.eids without the User ID Module, and its
doc comment on syncPrebidEidsCookie merged cleanly. Identity mode still
writes mirrored IDs only into the request-local ortb2, so they never
reach the global Prebid config or the ts-eids capture.

Shim size guard: the shim measures 66,339 characters at this PR's head
f912b2e and 66,572 after the merge. The 233 added characters are
#1488's ortb2 EID merge, the only source change the merge brings into the
shim, so this PR's 66.5 KB guard fails. The guard rises to 67 KB, as
#1488 raised its own guard for the same code, and its comment names that
addition and records the measured size, 428 characters below the guard.

It also brings b2d4bfd from #1488, which records the known UID hashes
on lookup results with a setter, so the provider IDs the write planner
logs are not derived from them.

The base now also carries #1506's repin of EdgeZero to rc/identity at
d063a8e7 and its merge of main's Fastly SDK 0.13.3 upgrade (#1671): fastly
0.13.3, url 2.5.9 and Viceroy 0.22.0.
This brings in 1f054c6 from #1488, which forwards ortb2.user.ext.eids
from the Prebid config into the auction EIDs, and a99dd66, a62601b,
d1eb75f and 394892b from #1489, which cap mirrored UID expiry at 30
days from the UTC day start and pass the request time into finalize.

Prebid shim: syncPrebidEidsCookie keeps this PR's single payload check
with change-only writes and stale-capture clearing, since both sides
already removed the getUserIdsAsEids guard. collectAuctionEids now reads
ortb2.user.ext.eids from the global Prebid config in both modes. Identity
mode still writes mirrored IDs only into the request-local ortb2, so they
never reach the global config or the ts-eids capture.

Artifact test: the merged shim measures 55,336 characters, so the size
guard keeps this PR's 55.5 KB limit, and its comment now names the
ortb2.user.ext.eids forwarding.

It also brings b2d4bfd from #1488, which records the known UID hashes
on lookup results with a setter, so the provider IDs the write planner
logs are not derived from them.

The base now also carries #1506's repin of EdgeZero to rc/identity at
d063a8e7 and its merge of main's Fastly SDK 0.13.3 upgrade (#1671): fastly
0.13.3, url 2.5.9 and Viceroy 0.22.0.
This PR carries #1620's identity-only Prebid commits. #1620's round-6 head
4361233 merged #1489 and the Fastly SDK upgrade, and resolved the Prebid
shim size guard on its own. Taking that head here lets rc/identity take both
PRs as plain merges.

The tree is unchanged. The shim size guard keeps this PR's 67 KB limit and
comment, which already count #1488's ortb2.user.ext.eids forwarding, in
place of #1620's 55.5 KB guard.

#1620's rebuilt head now also carries #1488's a610152 and 9104fd3,
which add hashed-email intake for the LiveRamp and ID5 identity providers,
through #1489's rebuilt merge 2765111, which this PR's base already
has. A plain merge of the two heads conflicts only in the shim size guard,
which keeps this PR's 67 KB limit as before, so the tree is still this
PR's.
aram356 added a commit that referenced this pull request Nov 25, 2026
…1622 into rc/identity

#1622 (244ca26) now carries the whole chain, each PR merging the one below
it:

- #1506 (c197404) repins EdgeZero to rc/identity at d063a8e7, which
  carries EdgeZero main's Fastly SDK 0.13.3 upgrade through every EdgeZero PR
  here, and merges Trusted Server main's upgrade (#1671): fastly 0.13.3, url
  2.5.9 and Viceroy 0.22.0.
- #1614, #1525, #1526, #1487 and #1488 take it in turn. #1488 also adds
  b2d4bfd, which records known UID hashes with a setter.
- #1489, the identity spine (#1639, #1640, #1612, #1628 and #1623), #1531 and
  #1532.
- The Axum serving line: #1613, #1616, #1617, #1615, #1635, #1637 and #1627,
  chained, with #1627's b958107 decoding the Spin discovery document with
  Response::json and #1627's merge of #1625, which brings #1625's Wrangler pin
  into the chain.
- The held line on #1627: #1533, #1534, #1536, #1535, #1537, #1539, #1538,
  #1540, #1566, #1624, #1641, #1642 and #1646. #1646 keeps its own shared
  after-response runner in ec::app::lookups.
- #1636 (72096cd) on #1646 (b5a5f62), draining Axum
  after-response identity tasks on SIGTERM through #1646's shared runner.
- The EC route line on #1636: #1626 (067531e), which merges #1636, the
  draft #1656, #1661, #1662 and #1622, and through #1622's merge of it,
  #1620's round-6 head.

Each conflict was resolved in the PR that sits higher. This merge is clean.

Since the last update the chain also takes #1488's hashed-email intake
(a610152 and 9104fd3) and its POST, body and header options for the
status call (f063a76), #1627's split of the generic runtime KV store into
trusted_server_runtime_kv (4d0c1a2), #1646's gate on identity writes for
rejected clients (aa31559) its native container test of the failure router
(4f4c036) and that test's header check on an ordinary route (71a573a),
#1626's withholding of a mirrored UID while another source owner is opted
out (d07f789), and #1617's description of the Axum startup failure router
(6d174a8) and of the startup failures that still exit before listening
(4c07cad). #1636 no longer sits in the Axum serving line; it arrives
through #1626, which merges it on top of #1646. Its new head adopts #1646's
after-response runner in place of the one rc/identity took with cf1102c.

Cloudflare guide: #1627's merge of #1625 now keeps both #1625's tool version
clause and #1627's TRUSTED_SERVER_RUNTIME_KV binding in the smoke paragraph,
and fixes #1625's smoke script test for #1617's Python floor and Worker
build, and #1537's merge fixes its ts stub for #1537's storage template
step, so this merge needs no resolution.
aram356 added a commit that referenced this pull request Nov 25, 2026
#1625 (006b45e) merges #1506's new head, which carries the Fastly SDK
0.13.3 upgrade. #1627 now merges #1625 too, so its content is already here
through #1622's chain. The merge is clean.
@aram356

aram356 commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed a49cdaa87 and 244ca2621.

#1662's new head 2b013cd brings #1537's b181544, "Accept any Fastly EC
store link name at startup", which #1537's owner merged up through #1539,
#1538 and #1540. The merge is clean.
aram356 added a commit that referenced this pull request Nov 26, 2026
#1622 (592b249) carries #1537's b181544, "Accept any Fastly EC store link
name at startup", through the chain below it. The merge is clean.
@aram356

aram356 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed 592b24953, a merge of #1662's new head 2b013cd5c. It brings #1537's b181544a0, "Accept any Fastly EC store link name at startup", which #1537's owner merged up through #1539, #1538 and #1540. The merge had no conflicts.

Takes #1489's new head 8e5642b, which carries #1506's repin of EdgeZero to
rc/identity at 459bd27d (42e0c46): PR 275 at 0e2a58ae, the stack's test
fixes and EdgeZero 536's bounded record update, RecordHandle::update.

The merge is clean.
Takes #1662's new head 9df0101, which carries #1506's repin of EdgeZero to
rc/identity at 459bd27d (42e0c46): PR 275 at 0e2a58ae, the stack's test
fixes and EdgeZero 536's bounded record update, RecordHandle::update.

The merge is clean.
Takes #1620's new head abbf63f, which carries #1506's repin of EdgeZero to
rc/identity at 459bd27d (42e0c46): PR 275 at 0e2a58ae, the stack's test
fixes and EdgeZero 536's bounded record update, RecordHandle::update.

The merge is clean.
aram356 added a commit that referenced this pull request Nov 26, 2026
#1622 (c72b7c6) carries #1506's repin of EdgeZero to rc/identity at
459bd27d (42e0c46), with PR 275 at 0e2a58ae, the stack's test fixes and
EdgeZero 536's bounded record update, RecordHandle::update, through the
chain below it. The merge is clean.
@aram356

aram356 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed 6f0224381 and c72b7c602. 6f0224381 merges #1662's new head 9df010122, which brings #1506's repin of EdgeZero to rc/identity at 459bd27d (42e0c46c7): EdgeZero #275 at 0e2a58ae, the EdgeZero stack's test fixes and EdgeZero #536's bounded record update, RecordHandle::update. c72b7c602 then merges #1620's new head abbf63f15, which carries the same repin, so rc/identity takes both PRs as plain merges. Neither merge had conflicts.

#1662's new head 9a1e6b1 brings #1539's cf4e815, "Expect the failure router in the native container test", and #1646's a18abf4, "Compare undeclared Axum KV stores with assert_eq". The merge is clean.
aram356 added a commit that referenced this pull request Nov 26, 2026
…dentity

#1622 (7621b11) carries #1539's cf4e815, "Expect the failure router in the native container test", and #1646's a18abf4, "Compare undeclared Axum KV stores with assert_eq". The merge is clean.
@aram356

aram356 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed 7621b11da, a merge of #1662's new head 9a1e6b1f1, which brings #1539's cf4e815d4, the native container test's failure-router expectation, and #1646's a18abf428, the reworked KV check in the store metadata test. The only change to this PR's tree is that store test. The merge had no conflicts.

@dhruv8sh dhruv8sh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

This PR adds a Prebid mode setting: auction by default, or identity. The integration registry now records whether the identity app has a bound record store. When the store is bound, Sourcepoint is off and the mode is identity, the server injects window.__tsjs_prebid.ecRoute between the config script and the bundle tag. In the browser, a TCF/GPP consent queue reports consent to the EC route in order. Mirrored EIDs are merged into request-local ortb2 only. A localStorage SharedID opt-out is copied into the cookie, and native IDs are sampled while the page is active. Identity mode skips the auction hooks and the GPT refresh handler.

Nothing needs to change before merge. No text in the change tries to steer the review, and no files are hidden behind binary diffs.

Cross-cutting / body-level findings

  • 👍 Both adapters set route availability once the record store is known. Fastly opens its store lazily, but identity_graph() is still Some at build time, so the route is correctly reported as available.
  • 👍 The client only accepts a same-origin route path and caps the response body size.
  • 👍 The consent queue keeps reports in order and is safe. Only one call is in flight at a time, and barriers (possible withdrawals) are never replaced while they wait. Mirrored EIDs go into request-local ortb2 only, so publisher data is not changed.
  • 👍 A known withdrawal is handled safely. It expires the mirror cookie and suppresses mirrored IDs until the server answers a call queued after the withdrawal.
  • 👍 Failures are handled. Cookie or storage errors either leave state untouched or treat the reader as opted out. A failed barrier waits for the next trigger instead of retrying in a loop. A failed grant is dropped so it doesn't block what's queued behind it.
  • 👍 Good test coverage. Tests cover the injection matrix (both modes, Sourcepoint on/off, store bound or not) and mode parsing.

CI Status

  • integration tests (Fastly EC lifecycle): PASS
  • integration tests: PASS
  • CI Node pin guard: PASS
  • cargo check (cloudflare native + wasm32-unknown-unknown): PASS
  • ts dev lint domains (changed lines): PASS
  • vitest: PASS
  • docs-proposal scripts: PASS
  • trace runtime and browser acceptance: PASS
  • Fastly response diff script: PASS
  • HTML EOF runtime (Fastly): PASS
  • local-provider-image: PASS
  • cargo test (axum native): PASS
  • record-provider-image: PASS
  • browser integration tests: PASS
  • format-docs: PASS
  • cargo test: PASS
  • CLAUDE.md symlink guard: PASS
  • health-startup (spin): PASS
  • cargo check/build/test (spin native + wasm32-wasip1): PASS
  • cargo fmt: PASS
  • health-startup (axum): PASS
  • health-startup (fastly): PASS
  • health-startup (cloudflare): PASS
  • Native provider acceptance script: PASS
  • cargo test (ts CLI, native) (ubuntu-latest): PASS
  • format-typescript: PASS
  • worker-deadlines (cloudflare): PASS
  • stock-celld-records: PASS
  • cargo test (cross-adapter parity): PASS
  • worker-deadlines (spin): PASS
  • cargo test (ts CLI, native) (macos-latest): PASS
  • prepare integration artifacts: PASS
  • release scripts: PASS

Takes #1662's new head faaf573, which carries #1506's repin of EdgeZero to
rc/identity at 1619078a (8edc50e), a revert that removes EdgeZero 522
(portable Fastly record providers) and 524 (outbound mTLS client
identities).

The merge is clean.
aram356 added a commit that referenced this pull request Nov 27, 2026
#1622 (000f373) carries #1506's repin of EdgeZero to rc/identity at
1619078a (8edc50e), a revert that removes EdgeZero 522 (portable Fastly
record providers) and 524 (outbound mTLS client identities), through the
chain below it. The merge is clean.
@aram356

aram356 commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed 000f3733b.

Takes #1662's new head faaf573, which carries #1506's repin of EdgeZero to rc/identity at 1619078a (8edc50e), a revert that removes IABTechLab/edgezero#522 (portable Fastly record providers) and IABTechLab/edgezero#524 (outbound mTLS client identities).

The merge is clean.

This round does not take #1620's new commit c3b0c8410: merging it here conflicts in crates/trusted-server-js/lib/src/integrations/prebid/index.ts, where this PR's EC-route setup sits just above the if (merged.mode === 'identity') line that c3b0c8410 changes to injected?.mode. The resolution keeps both, and belongs in this PR's merge of #1620.

@ChristianPavilonis ChristianPavilonis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 000f3733b against live base faaf573e0 (#1662). The GitHub diff includes the identity-only mode, native capture, and navigation-mirror work from #1620. The findings are about #1622's route activation, CMP reporting, consent queue, and response merging.

I would block on R1–R3: send consent to the validated same-origin URL, suppress stale IDs on an unverified first withdrawal, and make sure a permanently rejected report cannot block a later valid withdrawal. R8 is a contract question, and R9–R17 are nonblocking.

The seven focused Vitest suites passed all 117 tests. Separate probes against the client reproduced the ordering and suppression cases noted inline. Live CMPs, deployed adapters, and Safari cookie lifetime were not verified in this review.

Comment thread docs/guide/integrations/prebid.md Resolved
@prk-Jr
prk-Jr marked this pull request as draft December 1, 2026 10:27
Send the checked absolute route URL and keep uncertain or superseded
consent states from supplying IDs. Reject oversized reports before
keepalive, recover CMP subscriptions, and merge writeback SharedID
under the server's opt-out rules.

Share listener and validation mechanics, and align tests and docs
with the live route contract.
@prk-Jr
prk-Jr marked this pull request as ready for review December 1, 2026 13:26

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Injected script calls the EC route on consent and merges the IDs into Prebid

4 participants