Skip to content

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

Open
prk-Jr wants to merge 59 commits into
prfection/1669-creative-endpoint-gating-planfrom
feat/1599-ec-route-consent-script
Open

prk-Jr wants to merge 59 commits into
prfection/1669-creative-endpoint-gating-planfrom
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.

The discovery timer now checks for new API functions without repeatedly subscribing to a refused or throwing unchanged CMP. Resource load, DOMContentLoaded, visibilitychange and persisted pageshow can retry inactive capture. Active/pending capture stays quiet, warnings are bounded once per API function, and Sourcepoint retains its independent consent ownership and resource recovery. TCF failure paths share listener-scoped cleanup. Retired GPP calls cannot tear down a replacement, including pending registrations forwarded through the replacement API.

Consent queue ordering, request-local identity merging, later withdrawal delivery and stale-answer suppression remain covered. Browser and Rust tests now assert signal/request limits from the shared EC contract fixture, including inclusive and exact-one-byte-over boundaries. Only current definitive 400/413 validation rejections advance an invalid barrier; unspecified 422 remains uncertain and retries on a lifecycle trigger.

Import order and requested manual prose wrapping are corrected. The full native suite also exposed a test-only HTTP probe race: accepted nonblocking streams could receive a response before complete request headers. The fixture now waits for complete nonempty headers within its existing one-second read timeout and 4096-byte buffer; a fragmented-header control rejects the original helper. Production adapter behavior is unchanged.

Base and scope

Actual base branch: feat/1598-ec-route-fastly at 14749b9a6d67d549a49a44f77d8d81f7840cb336, independently confirmed from the Git ref (PR API base SHA can lag). This PR adds browser activation and consent reporting over the mounted shared route. Existing dependency history is retained; no merge, rebase, retarget or dependency-PR edit is included in this correction.

Part of #1599. Sourcepoint remains the sole consent writer when enabled, through /_ts/consent. The complete issue acceptance, real CMP/deployed qualification, Safari persistence and the separate #1592 requirement remain open.

Current correction verification

Correction: 1ad84731e, signed and GitHub Verified.

Local checks passed on the committed source: target-matched adapter tests and Clippy, CLI/codegen/native build-digest/parity checks, native and Fastly shared identity conformance, deadline fixtures on Fastly/Cloudflare/Spin, current-source staged and base-diff domain checks, required script controls, JavaScript/docs lint and formatting, docs build, and fresh production startup smokes on all four adapters. The final full JavaScript run passes 3,557 tests, with one skipped and no TypeScript errors. Actual-installation timer/recovery and shared capture tests pass; eight plausible incomplete changes to limits, lifecycle recovery or warning budgets are rejected by their controls.

The generated production Prebid shim is 67,843 characters / 67,845 bytes, below the unchanged 68,000-character guard (157 characters of headroom). SHA-256: e2d99caf31527941684f04909c47e5b869193fbe8792df8accaa840cbc08f7c6.

Initial Axum fixture and Fastly startup failures are retained as superseded evidence. Final full Axum test/lint and the original unchanged Fastly smoke pass. Fastly diagnostics captured Viceroy alive but not yet listening; compilation/load is the supported explanation, without a sampled stack proving the exact wait. No smoke timeout or assertion was relaxed.

New-head hosted CI is pending. Earlier green checks qualify older revisions, not this correction. Four new original-thread replies describe the changes; those threads remain open until relevant exact-head checks are confirmed. The 17 previously resolved threads are historical. Reviewer approval is the reviewer's decision, not a consequence of these replies.

Controlled CMP/fetch and local runtime fixtures do not qualify real CMP products, deployed Fastly/CloudFront behavior or Safari one-year persistence. The earlier Chrome, real-route and HTTPS observations below are historical and were not repeated in this cycle. No deployment is included.

Previous PR description — historical behavior and revision-specific evidence

All revision, base, bundle-size, readiness and verification claims below belong to their named earlier revisions. Current correction evidence is stated above.

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
PR #1489's new head brings #1506's move of the five auction endpoint test requests from test-publisher.com to publisher.example.com, for the URL-host lint. The merge is clean.
PR #1662's new head brings #1506's move of the five auction endpoint test requests from test-publisher.com to publisher.example.com, for the URL-host lint. The merge is clean.
PR #1620's new head brings #1506's move of the five auction endpoint test requests from test-publisher.com to publisher.example.com, for the URL-host lint. The merge is clean.
aram356 added a commit that referenced this pull request Dec 2, 2026
It brings #1622's cascade merge of #1506's auction endpoint test host fix.
prk-Jr and others added 7 commits December 2, 2026 21:33
PR #1489's new head brings #1506's repin of EdgeZero to rc/identity ef5cbf30, which renames Fastly backends to ez_b31v2_* and moves the yanked pin-project-lite, chacha20 and spin. The merge is clean. Cargo.lock changes only the EdgeZero package sources (now ef5cbf30) and the yanked pin-project-lite, chacha20 and spin; the codegen crate's nested Cargo.lock is unchanged.
PR #1622 moves from PR #1662's branch onto PR #1675's branch, prfection/1669-creative-endpoint-gating-plan, which sits on PR #1662. PR #1675's head (e16189e) brings the creative and auction endpoint switches and PR #1662's latest head (14749b9).

crates/trusted-server-js/lib/src/integrations/prebid/index.ts: #1622 added the server-owned Prebid mode, in which identity mode installs no auction hooks. #1675 added the injected auctionEnabled flag, with which auction mode drops the trustedServer bid and builds no /auction request while the auction is off. Both rewrote the header comment and both added a field at the end of the injected config. The resolution keeps both settings: identity mode still returns before it installs any auction hook, whatever auctionEnabled says, and auction mode honors auctionEnabled. The header comment keeps both descriptions, and the injected config keeps ecRoute, then auctionEnabled.

crates/trusted-server-js/lib/test/prebid-artifact-integration.test.mjs: each side rewrote the shim size guard for its own additions, #1622 to 68 KB and #1675 to 53 KB. The combined shim measures 67,930 characters, so #1622's 68 KB guard stays and its comment names #1675's addition.

crates/trusted-server-js/lib/test/integrations/prebid/identity.test.ts: two cases pin how the settings combine. With the auction off, identity mode registers no bid adapter, leaves GPT refresh alone and keeps a trustedServer bid in place, while auction mode drops that bid. selfInitialize takes extra injected config for them.
…tches

PR #1675's new head (20bf514) joins its third review (7c08e50) with its move onto the identity chain. The third review adds a test that each creative endpoint works while only its own switch is on, rewords the cached-page notes to cover open tabs, documents that rewrite_clicks applies only where rewriting runs, and moves assert_turned_off_log below assert_endpoint_turned_off. The merge is clean.

The third review changes no JS, so the Prebid shim and its 68 KB size guard are unchanged.
PR #1675's new head (54969a7) merges PR #1662's new head (20f849f), which merges PR #1661's head (a3c937f). It brings EdgeZero ef5cbf308, which includes EdgeZero #524 and names Fastly backends with the ez_b31v2_ prefix, and pin-project-lite 0.2.19 from PR #1506. It also brings PR #1626's mirror changes (mirror_provider_policy_denied, SharedIdWriteBackTime), the two smoke-test fixes in PR #1627 and PR #1537, and PR #1535's change that skips re-posting an unchanged Sourcepoint consent mirror.

crates/trusted-server-js/lib/test/integrations/sourcepoint/gpp_capture.test.ts: #1622 deleted this file and moved its cookie bridge tests to gpp_cookie_bridge.test.ts, and #1535's Sourcepoint change edited two of those tests and added four. The resolution keeps the deletion and makes the same edits and additions in gpp_cookie_bridge.test.ts, whose tests share the cmp and ready helpers from test/helpers/gpp_cmp.ts.

crates/trusted-server-adapter-axum/src/after_response_drain_tests.rs (merged clean, failed to compile): #1622 and #1662 each added read_probe_headers and a probe_waits_for_complete_fragmented_headers test for the same probe fix, so both definitions landed twice. Their call site and mpsc import already match. The resolution keeps #1662's copies, whose test also checks that the partial request reached the socket, and drops #1622's, so the file equals #1675's.
PR #1620's head (98a56e8) adds 827f0e3, which renames syncPrebidEidsCookie's nativeOnly parameter to identityCapture. The rename changes no behavior: identity mode still calls it with true and auction mode with no argument, and the shim's mode and auctionEnabled handling are unchanged. The merge is clean.
@aram356
aram356 removed this pull request from stack #1665 December 3, 2026 11:34
aram356 added a commit that referenced this pull request Dec 3, 2026
PR #1503 at 1d51b78: Add ts ec show and ts ec eids admin diagnostic commands
PR #1653 at f217902: Clarify and verify the Axum local config handoff
PR #1654 at e4e68bb: Verify pending record writes drain within shutdown grace
PR #1655 at 7d0cdb2: Configure EC lifetime and renew it on eligible visits (DEC-13)
PR #1659 at bd707f2: Verify geo consent paths on Axum and Fastly
PR #1660 at 87c52cd: Retry an after-response write that loses its CAS
PR #1666 at b1d7062: Verify identity gates and provider deadlines on Axum
PR #1710 at 3d33359: Apply pull-sync consent checks to identify
PR #1557 at 3982143: Carry Sourcepoint TCF consent to Trusted Server
PR #1667 at f9ac6bb: Present a client certificate on auction providers that set mtls
PR #1607 at b3a0b09: Send the resolved client IP to the publisher origin
PR #1709 at 635f06a: Keep the EC out of bid request IDs and gate user.id on EID consent
PR #1713 at e5f4d05: Apply consent rules to first-party click redirects
PR #1622 at dd2ee39: Report CMP consent to the EC route and merge its answer into Prebid
@aram356
aram356 changed the base branch from feat/1598-ec-route-fastly to prfection/1669-creative-endpoint-gating-plan December 3, 2026 11:35
@aram356
aram356 added this pull request to stack #1731 December 3, 2026 11:35
@aram356

aram356 commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Round 15 identity realignment: rc/identity is now at 391a08578, and EdgeZero is pinned to its rc/identity at ef5cbf308. This branch fast-forwarded from 1ad84731e to dd2ee392a:

The base is now prfection/1669-creative-endpoint-gating-plan (#1675). The Prebid shim keeps both this PR's mode and #1675's auctionEnabled. Identity mode still returns before it installs any auction hook, and auction mode drops the trustedServer bid when the auction is off. One vitest case covers each. This round also merges #1620's new head, moves #1535's new Sourcepoint test edits into gpp_cookie_bridge.test.ts, and keeps the trunk's copy of read_probe_headers. The combined shim is 67,930 characters, 70 under the 68,000 guard.

Each merge message says what it carries and how any conflict was resolved.

prk-Jr and others added 2 commits December 3, 2026 19:20
Carries #1533's Axum startup-test port fix (779e446) and nothing
else. Owner commits pushed to other chain PRs since round 15 come in
with the next round.
@aram356

aram356 commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Cascade of #1533's Axum startup-test port fix (779e44673): 5eb4392db merges it into this PR. There were no conflicts and nothing else changed. The fix moves free_loopback_port in crates/trusted-server-adapter-axum/tests/routes.rs below the ephemeral port range, and #1533's note has the details. Owner commits pushed to other chain PRs since round 15 come in with the next round. rc/identity is now 62f8e41e2.

@aram356

aram356 commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Merged #1627's runtime KV removal (7c2b84f45) into this branch as 348f06d0f, on top of 5eb4392db.

At the maintainer's request, that commit removes the generic runtime KV store trusted_server_runtime_kv. Nothing reads or writes it, and the managed Fastly deploy made every service provision and pay for it. edgezero.toml and the Fastly Hooks::stores() now declare only trusted_server_kv, and RuntimeServices::kv_store() is unavailable on every adapter.

Only that commit was merged, not the base branch's new head. Conflicts were resolved in edgezero.toml, the Fastly Hooks::stores() in app.rs, fastly.toml, the Viceroy template, the integration tests' config.rs, trusted-server.example.toml, docs/guide/architecture.md and docs/guide/edgezero.md. Only trusted_server_kv stays declared, this branch's record-store comment and local seeds are kept, and the runtime-KV lines are dropped. The Axum README and docs/guide/axum-dev.md keep this branch's Axum wording. CHANGELOG.md keeps this branch's entry and drops the runtime-KV one.

Checks on this head: no reference to the removed store remains and cargo fmt --check passes; clippy-fastly, clippy-axum, clippy-cloudflare and clippy-spin-native pass. rc/identity (b9dc3153e) passed the full CI gate list with the removal.

PR #1489's new head brings #1487's change that strips `ts-eids` from publisher-origin requests unless the operator opts in. The merge is clean.
PR #1675's new head brings #1487's change that strips `ts-eids` from publisher-origin requests unless the operator opts in and #1646's fix that preserves filter headers through identity finalization. The merge is clean.
PR #1620's new head brings its deduplication of mirrored and native EIDs before bidder delivery.

crates/trusted-server-js/lib/src/integrations/prebid/index.ts: #1622
imports the EC route client and `readMirror` beside `mergeIdentityMirror`,
and #1620 adds the `identity_dedup` import for its bidder and PBS EID
deduplication hooks. The resolution keeps all three imports.

crates/trusted-server-js/lib/test/prebid-artifact-integration.test.mjs:
#1622 raises the shim size guard to 68 KB for EC route consent reporting
and the auction-off skips, and #1620 raises it from 56 KB to 58 KB for the
deduplication hooks. The resolution keeps both increments, 70 KB, with the
wording rc/identity already uses for the same union, so the RC merge stays
clean. The separate Prebid runtime (above 200 KB) still fails the guard.
aram356 added a commit that referenced this pull request Dec 3, 2026
PR #1503 at 6a8797e: Add ts ec show and ts ec eids admin diagnostic commands
PR #1557 at a435778: Carry Sourcepoint TCF consent to Trusted Server
PR #1607 at 07086f2: Send the resolved client IP to the publisher origin
PR #1627 at 5b7fc3d: Wire declared stores and document unsupported Axum KV
PR #1636 at d838931: Drain Axum after-response identity tasks on SIGTERM
PR #1653 at 5b86d9b: Clarify and verify the Axum local config handoff
PR #1654 at be495b3: Verify pending record writes drain within shutdown grace
PR #1655 at 888c5f1: Configure EC lifetime and renew it on eligible visits (DEC-13)
PR #1659 at 7b1d4a7: Verify geo consent paths on Axum and Fastly
PR #1660 at 64a1baa: Retry an after-response write that loses its CAS
PR #1667 at 1359722: Present a client certificate on auction providers that set mtls
PR #1709 at bc43a3e: Keep the EC out of bid request IDs and gate user.id on EID consent
PR #1710 at dc728a1: Apply pull-sync consent checks to identify
PR #1713 at ffa7597: Apply consent rules to first-party click redirects
PR #1722 at 070e2b0: Use applicable GPP sections from the CMP instead of header sections

PR #1666 at 4720b0b (Verify identity gates and provider deadlines on Axum) arrives through #1659, and PR #1622 at c878e6e (Report CMP consent to the EC route and merge its answer into Prebid) arrives through #1722. Every other chain PR arrives through the tips above. The tree is the conflict-free union of these tips and carries no resolution of its own.
@aram356

aram356 commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Round 17 identity realignment: rc/identity is now at 0ed862633, and EdgeZero stays pinned to its rc/identity at ef5cbf308. This branch fast-forwarded from 348f06d0f to c878e6e6d:

This round's link keeps all three prebid/index.ts imports and both shim-size increments (70 KB, with the wording rc/identity uses). #1722 is now based on this branch and merges it, so rc/identity takes this PR through #1722. That link widens the shared isApplicableGppSection to -1..=65535 and changes this PR's capture test so a ready [-1] reading is a decision that no GPP section applies, as the GPP CMP API defines it. The note on #1722 has the details.

Each merge message says what it carries and how any conflict was resolved.

@aram356

aram356 commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator

Merged #1614's /_ts/ local answers (48930c270) into this branch as 0d5de86d3, on top of c878e6e6d.

Trusted Server owns the /_ts/ namespace (#1740). A request for /_ts or any /_ts/ path that no route handles now gets a local 404 on Fastly, Axum, Cloudflare and Spin, and never reaches the publisher origin. The path is matched after percent-decoding. Paths outside the namespace, such as /_tsx or /articles/_ts/x, still go to the publisher origin, and every routed /_ts/ path answers as before.

This merge takes #1675's new head (d3f76b07b), which carries 48930c270 and nothing else new to this branch. It was clean.

Checks on this head: no conflict markers; cargo fmt --all -- --check passes; the merge adds exactly #1614's change to this branch's files; it merges cleanly with every lower head in its stack; clippy-fastly, clippy-axum, clippy-cloudflare and clippy-spin-native pass. rc/identity (e72407155) passed the full CI gate list with the change.

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