Skip to content

Turn off creative and auction endpoints when their switch is off - #1675

Open
aram356 wants to merge 32 commits into
feat/1598-ec-route-fastlyfrom
prfection/1669-creative-endpoint-gating-plan
Open

aram356 wants to merge 32 commits into
feat/1598-ec-route-fastlyfrom
prfection/1669-creative-endpoint-gating-plan

Conversation

@aram356

@aram356 aram356 commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

PRfection phase: implementation

Closes #1669

Summary

When a switch is off, the endpoint it controls now answers a local 404 with Cache-Control: no-store, private, on every adapter:

Endpoint Answers while
GET /first-party/proxy [auction].rewrite_creatives = true
GET, POST /first-party/sign [auction].rewrite_creatives = true
GET /first-party/click rewrites_auction_clicks() (rewrite_clicks, or rewrite_creatives when it is unset)
GET, POST /first-party/proxy-rebuild same as /first-party/click
POST /auction [auction].enabled = true

Until now the Prebid shim added a trustedServer bid to every ad unit whatever [auction].enabled said. The server now tells it, through a new auctionEnabled flag in the injected config, when the auction is off. The shim then drops that bid and its bid adapter builds no request, so a disabled auction sends no POST /auction, including through a publisher alias of trustedServer.

This PR holds the spec, the plan and the implementation. The spec and plan were first opened here for review on their own, and the implementation follows the plan task by task.

Documents

Implementation

  • http_util::endpoint_turned_off_response builds the turned-off answer:

    • status 404, body This endpoint is turned off, Content-Type: text/plain; charset=utf-8;
    • Cache-Control: no-store, private plus the terminal-private marker;
    • one debug log line.
  • The five core handlers check their switch as their first statement and return that answer as Ok:

    • handle_first_party_proxy, handle_first_party_proxy_sign, handle_first_party_click and handle_first_party_proxy_rebuild in proxy.rs;
    • handle_auction in auction/endpoints.rs, where the check replaces the old disabled no-bid branch.

    The only adapter dispatch change is Fastly's /auction arm, which sets its EID sync source and builds its partner registry only while the auction is on, so a turned-off request writes no EIDs.

  • Proxy finalization runs the creative HTML and CSS pass only while rewrite_creatives = true. Proxy callers that do not stream, such as the Google Tag Manager integration, pass HTML and CSS through unchanged while it is off, instead of writing URLs for turned-off endpoints.

  • The Prebid head injector adds auctionEnabled from the compiled auction plan. While it is false, the shim leaves no trustedServer bid in any ad unit, and the adapter's buildRequests returns [], which also covers aliases. Its ad-unit selection now matches Prebid's requestBids: adUnitCodes: [] selects every global ad unit, a single code string narrows to that code, and adUnitCodes narrows explicit adUnits.

  • Docs and CHANGELOG.md. One Breaking entry and one Fixed entry. The docs warn that creatives already on a page stop loading proxied assets or redirecting clicks once their switch is off. The trusted-server.example.toml comments say what each switch turns off.

Two changes go beyond the plan:

  • auction_rewrite_setting_does_not_change_proxied_html_or_css_rewriting was kept, then replaced. The plan said to delete it. It was kept because the Google Tag Manager integration proxies without streaming and still ran the creative pass whatever rewrite_creatives said. Review round 1 made that pass follow rewrite_creatives, and the test became creative_rewriting_off_passes_proxied_html_and_css_through_unchanged.
  • The Prebid shim size guard in prebid-artifact-integration.test.mjs moves from 52,500 to 52,750 characters. The shim now measures 52,549 characters, which leaves 201 to spare. The guard still fails if Prebid's 200 KB runtime gets bundled.

Tests

  • Core.
    • Every switch combination for the four creative endpoints, including correctly signed URLs, which still get the 404.
    • Each endpoint works when only its own switch is on: a signed click answers 302 and a signed rebuild succeeds with click wrapping on and creative rewriting off, and sign succeeds with the reverse. Each turned-off row also asserts one debug line naming the endpoint and the switch that decided it, and nothing at warn or error (RecordCapture in test_support/logging.rs).
    • /auction answers the 404 on an unparseable body and on an over-limit Content-Length, with no telemetry, no trace and one debug line naming auction.enabled.
    • The two trace tests that used a disabled auction now use an enabled auction with consent denied, and keep their policy_skipped assertions.
  • Adapters.
    • turned_off_endpoints_answer_404_locally on Fastly, Axum, Cloudflare and Spin checks status, body, Content-Type and Cache-Control. On Fastly it also checks the terminal-private marker.
    • each_switch_turns_off_only_its_own_endpoints on all four runs the default auction config, enabled = true with rewrite_creatives = false, and two cases that set rewrite_clicks apart from rewrite_creatives, so each 404 is traced to its own switch.
    • turned_off_auction_is_not_eligible_for_eid_persistence on Fastly checks the turned-off body and that no EID sync source is set.
  • Fastly send boundary.
    • late_filter_effects_cannot_make_a_turned_off_response_public covers late request-filter changes to Cache-Control.
    • A request filter that answers first still wins over a turned-off POST /auction.
  • Parity. turned_off_endpoints_parity and each_switch_turns_off_only_its_own_endpoints_parity send the same requests to Axum, Cloudflare and Spin.
  • Prebid.
    • Rust checks auctionEnabled true and false, and true for an enabled plan with no browser routes.
    • Vitest covers both shim states, adUnitCodes selection, adUnitCodes: [], aliases and GPT refresh.
    • The production-artifact test runs real Prebid with auctionEnabled: false and a trustedServer alias, and sees no /auction request. Its control without the flag sees one.
    • The production-artifact test also checks the shim's ad-unit selection against real Prebid: a single adUnitCodes string and adUnitCodes: [] over global units, and explicit adUnits narrowed by adUnitCodes. It asserts the posted unit codes and that unselected units got no trustedServer bid.
  • Mutation checks. Each new test was shown to fail with the behaviour it guards removed. The switch-isolation tests fail on all five suites when /first-party/proxy is gated on auction.enabled or /auction on rewrite_creatives.

Review round 1

Review 6101293433 raised four should-fix findings and six nits at 468873720. 3ce2d715b fixes all ten, and each thread has a reply with its evidence. Two of the fixes reverse design calls the spec had recorded, and the spec now records the new ones:

  • On Fastly, a turned-off /auction no longer records the browser's EID cookies.
  • Proxy callers that do not stream no longer run the creative pass while rewrite_creatives = false.

5e5df5b1f also fixes the shim's remaining adUnitCodes differences from Prebid, which the earlier follow-up list named. 0f7792ecf drops that commit's handling of a single ad unit object, because real Prebid 10.26 rejects one too (TypeError: n.map is not a function). GTM's proxy path and first-party-proxy.md, the other two items, are fixed in 3ce2d715b, so no follow-up is left.

Review round 2

Review 6143863236 accepted and resolved the ten round-1 threads, and raised six should-fix findings and five nits at 0f7792ecf:

  • e92b45047 merges main (ab5c24f73, Run js_asset_proxy rewriter before plan-registered integrations #1501) and keeps both Breaking entries where CHANGELOG.md conflicted.
  • d14192331 fixes the rest:
    • the rewrite_clicks route-test cases;
    • the turned-off log assertions;
    • the real-Prebid selection tests;
    • the auctionEnabled and Fastly EID test gaps;
    • the upgrade case for cached pages in the CHANGELOG, guides and spec;
    • edge-cookies.md and ec-setup-guide.md;
    • the proxy comment and the AuctionConfig and CreativeCssProcessor docs;
    • a "Changes after review" note in the plan.

Each thread has a reply with its evidence.

Review round 3

Review 6164270430 accepted the eleven round-2 threads, and raised one should-fix and four nits at d14192331. A second review, 6164343066, confirmed the same five threads. 7c08e500b fixes all five:

  • a core test that each endpoint works when only its own switch is on;
  • the misplaced test-helper doc comment;
  • the rewrite_clicks doc and the HEAD comment;
  • open tabs in the upgrade and switch-off wording, including spec line 88;
  • the plan note.

Each thread has a reply with its evidence.

Calls for the reviewer to check

These are design calls the spec makes that nobody has confirmed yet:

  1. /first-party/click and /first-party/proxy-rebuild follow click wrapping (rewrites_auction_clicks()), not rewrite_creatives alone.
  2. This reverses Make creative click rewriting a separate feature with its own switch #1234's "routed and ungated" click endpoints. After a switch-off, clicks on creatives already on a page get a 404.
  3. /_ts/page-bids and /__ts/page-bids do not change.
  4. A turned-off /auction no longer emits the auction_disabled telemetry event or the skipped server-side trace. Publisher page loads and /_ts/page-bids still record both.
  5. The turned-off 404 carries Cache-Control: no-store, private and the terminal-private marker. Fastly then restores the policy after late request-filter header changes.
  6. On Fastly, a turned-off /auction records none of the browser's cookie EIDs, unlike today's disabled branch. Review round 1 decided this, and it is the one adapter dispatch change.
  7. With the auction off, the shim also drops a trustedServer bid the publisher configured.
  8. A Prebid config without auctionEnabled means the auction is on.
  9. Fastly request filters keep precedence. On a DataDome-protected service, a turned-off /auction still gets the verdict call, and a challenge answers before the 404.
  10. "Reads no body" starts at the handler. EdgeZero ingress still buffers bodies before routing, and changing that would mean changing EdgeZero.
  11. The shim's ad-unit selection now matches Prebid's requestBids, with the auction on as well as off.

Process

  • Skills:
    • superpowers:brainstorming: spec, approval gate and a cold builder read of the spec;
    • superpowers:writing-plans: plan and self-review;
    • superpowers:subagent-driven-development: implementation, with a review after each task and a whole-branch review at the end.
  • Account mode: one account. CREATOR and REVIEWER both act as the PR author's account, and comments start with CREATOR: or REVIEWER: .

Validation

All local runs were at 7c08e500b on macOS (arm64), with Viceroy 0.22.0, and every command exited 0. The template-cache harness ran on ports 9199, 9200 and 7888 because another session's harness can hold its default 9099.

Gate Result
cargo fmt --all -- --check, also for the integration-tests crate clean
cargo build-fastly, build-axum, build-cloudflare and the Fastly release build built
The eight Clippy aliases, plus the integration-tests crate no warnings
cargo test-fastly 3,720 passed, 0 failed
cargo test-fastly-reuse 248 passed, 0 failed
cargo test-axum 62 passed, 0 failed
cargo test-cloudflare 59 passed, 0 failed
cargo test-spin 98 passed, 0 failed
Parity 31 passed, 0 failed
JS npx vitest run Tests 3318 passed (3318)
Prebid artifact test Tests 16 passed (16); shim characters: 52549
JS lint and format clean
Docs format, lint and build; Markdown Prettier clean; build complete
template_build_digest test and Clippy 10 passed, 0 failed; no warnings
scripts/lint-wasm-clock.sh clean
Docs-proposal scripts shellcheck clean; pass 20; script tests passed
ts dev lint domains --changed-vs origin/main no findings
CI Node pin guard pass 30; 34 jobs in 10 workflows pin Node before compiling Rust
Fastly deadline-origin fixtures 5 passed, 0 failed
Worker deadline fixtures: build and Clippy, Cloudflare and Spin built; no warnings
Cloudflare deadline runtime (wasm-bindgen 0.2.126, wrangler 4.83.0) 4 of 4 passed
Spin deadline runtime 5 of 5 passed
Release producer checks pass 27; shellcheck clean
scripts/test-cli.sh 965 passed, 0 failed
Codegen tests 7 passed, 0 failed
template-cache-local-test.sh (esi, inline, purge) on ports 9199/9200/7888 22 passed, 0 failed; 9 passed, 0 failed; 34 passed, 0 failed

The Cloudflare deadline runtime used the Cargo.lock wasm-bindgen CLI (0.2.126) and CI's wrangler@4.83.0, installed in a scratch directory.

The HTML EOF checks were not run locally, because this PR changes no publisher, HTML-processor or EOF code. CI runs them.

CI results for 7c08e500b are reported by GitHub; earlier runs are not counted for this head.

The Prebid shim adds a trustedServer bid to every ad unit whatever [auction].enabled says, so it would keep sending POST /auction and log a bidder failure on every 404. The design now has the server flag the auction state in the injected Prebid config and the shim drop its bid when the auction is off. It also records that Fastly can still sync cookie EIDs on a turned-off /auction and adds TESTING.md and the Prebid guide to the docs to update.
Plans the shared turned-off 404 helper, the five handler gates, the adapter and parity route tests, the injected auctionEnabled flag that stops the Prebid shim calling /auction, and the docs and changelog updates for #1669.
@aram356
aram356 marked this pull request as draft November 27, 2026 20:18
The spec now matches the plan: the two trace tests move to the consent-denied branch, which keeps their policy_skipped assertions, and the Prebid test it names is the kill-switch test. The changelog entry covers the Prebid shim. The plan adds the auction deadline fixtures to the final gate run, gives Fastly its own turned-off settings, names the parity request helpers, and records which browser fixtures run with the switches off.
Narrow the no-body-read guarantee to the handler, since EdgeZero ingress buffers bodies before routing. Keep Fastly request filters ahead of the switch and document it. Mark the turned-off 404 terminal-private so late Fastly filter headers cannot make it cacheable, with a send-boundary test. Treat adUnitCodes: [] as every global ad unit, as Prebid does, and run the refresh regression through the shim. Restore every AGENTS.md gate in the final run, add the deadline fixture Clippy runs, and add the auction orchestration and DataDome guides to the docs work.
Removing trustedServer bids misses a publisher alias of the adapter, because Prebid copies the adapter spec for an alias and snapshot-backed refresh keeps the alias as browser demand. The plan now has buildRequests return no requests while the injected flag is off, with alias and refresh tests. It also keeps the handler qualifier in the TESTING.md wording, limits the DataDome note about cached pages to Prebid callers, and describes which browser specs rely on endpoints that stay on.
@aram356 aram356 changed the title Spec and plan for turning off creative and auction endpoints by switch Turn off creative and auction endpoints when their switch is off Nov 28, 2026

@aram356 aram356 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

REVIEWER: REQUEST_CHANGES

GitHub blocked this review event: the REQUEST_CHANGES submission returned HTTP 422 "Review Can not request changes on your own pull request", because the acting login is the PR author. This COMMENT review carries the same verdict and findings. It is not an approval.

  • Reviewed head: 468873720, against base db36dc0ec (main). Phase: implementation.
  • Account mode: one account. The acting login is the PR author's.
  • Planning gate: the spec and plan were not approved in a separate planning PR, because the user asked for spec, plan and implementation in this one PR. I reviewed the implementation against the spec at this head.
  • Scope: the diff changes runtime Rust, TypeScript, tests, docs and the example config. It is not documentation-only, so I ran the full prescribed suite.

Findings

There are four should-fix findings and six nits, each in its own thread.

Should-fix:

  1. On Fastly, a turned-off POST /auction still authorizes EID persistence (auction/endpoints.rs:139).
  2. The non-streaming proxy path still writes URLs for endpoints that are turned off (creative.rs:1177).
  3. The adapter and parity tests lost their default-config coverage (adapter-axum/tests/routes.rs:41).
  4. docs/guide/first-party-proxy.md still describes the endpoints as always on (anchored at api-reference.md:74).

Nits:

  • the walkthrough is missing the auction-on precondition;
  • the click debug line names a key that may be unset;
  • the Fastly test message overclaims, and no route test checks Content-Type;
  • the DataDome note isn't scoped to Fastly;
  • the example TOML comment sits in the wrong place;
  • the shim-size comment is stale.

Validation

Every check ran at 468873720, in my detached worktree .worktrees/review-1675-4688737, with this setup:

  • macOS arm64, rustc 1.98.1, Node 24.20.0, viceroy 0.22.0, spin 4.1.0.
  • The disk had 13 GiB free, so the cargo target dir is shared with the author's worktree. The fresh checkout rebuilt every workspace crate; the logs show Compiling trusted-server-core v0.1.0 (.../review-1675-4688737/crates/trusted-server-core).

Each command exited 0.

Command Result
cargo fmt --all -- --check; cargo fmt --manifest-path crates/trusted-server-integration-tests/Cargo.toml -- --check no output
cargo clippy-fastly, clippy-axum, clippy-cloudflare, clippy-cloudflare-wasm, clippy-spin-native, clippy-spin-wasm, clippy-cli, clippy-codegen; cargo clippy --manifest-path crates/trusted-server-integration-tests/Cargo.toml --all-targets -- -D warnings no clippy warnings. The only warning: lines are the proc-macro-error2 v2.0.1 future-incompat note and the tsjs build info.
cargo test-fastly 7 test result: ok. lines: 3705 passed, 0 failed, 31 ignored
cargo test-fastly-reuse test result: ok. 246 passed; 0 failed; 5 ignored
cargo test-axum / test-cloudflare / test-spin 61 / 58 / 97 passed, 0 failed
cargo test --manifest-path crates/trusted-server-integration-tests/Cargo.toml --test parity test result: ok. 30 passed; 0 failed
npx vitest run (in crates/trusted-server-js/lib) Test Files 80 passed (80), Tests 3312 passed | 1 skipped (3313)
npx vitest run test/prebid-artifact-integration.test.mjs --reporter=verbose --silent=false Tests 13 passed (13); shim characters: 52602
npm run lint and npm run format (JS); npm run format, npm run lint and npm run build (docs) All matched files use Prettier code style!; build complete
docs/node_modules/.bin/prettier --config docs/.prettierrc --check "*.md" ".claude/**/*.md" ".github/**/*.md" "crates/**/*.md" "scripts/**/*.md" "tinybird/**/*.md" All matched files use Prettier code style!
cargo test -p trusted-server-core --test template_build_digest; its cargo clippy ... -- -D warnings 10 passed, 0 failed; no warnings
scripts/lint-wasm-clock.sh exit 0
shellcheck scripts/docs-proposal/*.sh; node --test scripts/docs-proposal/hunks.test.mjs; scripts/docs-proposal/test.sh pass 20, fail 0; All documentation proposal script tests passed.
cargo run --manifest-path crates/trusted-server-cli/Cargo.toml --target aarch64-apple-darwin --bin ts -- dev lint domains --changed-vs origin/main no findings
node --test scripts/check-ci-node-pin.test.mjs; node scripts/check-ci-node-pin.mjs pass 30, fail 0; ok: 34 jobs in 10 workflows pin Node before compiling Rust
node crates/trusted-server-adapter-fastly/tests/deadline-origin.mjs "$(command -v viceroy)" test result: ok. 5 passed; 0 failed
Cloudflare and Spin deadline-runtime example builds and their cargo clippy ... -- -D warnings built; no warnings
node scripts/test-worker-auction-deadlines.mjs spin --runtime "$(command -v spin)" 5 PASS spin ... lines
node scripts/test-worker-auction-deadlines.mjs cloudflare --runtime <wrangler 4.83.0> 4 PASS cloudflare ... lines
node --test scripts/release/phase1.test.mjs; shellcheck scripts/release/phase1-build.sh pass 27, fail 0
./scripts/test-cli.sh; cargo test --package trusted-server-openrtb-codegen --target aarch64-apple-darwin 965 passed, 0 failed; 7 passed
BID_DELAY=3 ./scripts/template-cache-local-test.sh with esi, inline and purge 22 passed, 0 failed, 9 passed, 0 failed, 34 passed, 0 failed

Setup problems on my side:

  • The first Spin and Cloudflare deadline-runtime runs exited 1 with failed to read component source from disk at path .../target/.... The script reads the repository's target/ directory, and my run created that link only after those runs. Both passed on rerun.
  • The Cloudflare run also needs the Cargo.lock wasm-bindgen CLI (0.2.126) and CI's wrangler@4.83.0. I installed both into a scratch directory; this machine has 0.2.121 and 4.131.0.

Not run locally:

  • The HTML EOF checks: this PR changes no publisher, HTML-processor or EOF code.
  • The Docker integration and browser jobs.

GitHub CI reports all 30 checks passing at 468873720, including those. That is CI's result, not a run of mine.

Comment thread docs/guide/api-reference.md Resolved
Comment thread docs/guide/auction-testing.md Resolved
Comment thread crates/trusted-server-core/src/proxy.rs Resolved
Comment thread docs/guide/integrations/datadome.md Resolved
Comment thread trusted-server.example.toml Resolved
- Set Fastly's /auction EID sync source and build its partner registry
  only while the auction is on, so a turned-off request writes no EIDs.
- Pass HTML and CSS from proxy callers that do not stream through
  unchanged while rewrite_creatives is off, instead of writing URLs for
  turned-off endpoints, and keep Content-Length on HEAD in that state.
- Add per-adapter and parity tests that each switch turns off only its
  own endpoints, and check Content-Type on every turned-off answer.
- Name the setting that actually decides click wrapping in the click
  gates' turned-off log line.
- Document the switches in the first-party proxy guide, record both
  review decisions in the spec, and fix the remaining doc nits.
The shim chose its ad units differently from Prebid 10.26's
requestBids and filterAdUnits: a single adUnitCodes string selected
every global unit, adUnitCodes did not narrow explicit adUnits, and a
single ad unit object passed as adUnits made the shim throw before
Prebid ran. Accept one unit or a list, fall back to pbjs.adUnits, and
narrow by one code or a list unless adUnitCodes is absent or empty.
Prebid 10.26's requestBids rejects a single ad unit object passed as
adUnits (TypeError: n.map is not a function), so wrapping one in the
shim only added the shim's side effects before Prebid threw. Take
explicit adUnits as given, as Prebid does, and drop the claim from the
docs and the CHANGELOG.
@aram356 aram356 self-assigned this Dec 2, 2026

@aram356 aram356 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

REVIEWER: REQUEST_CHANGES

GitHub blocked this review event: the REQUEST_CHANGES submission returned HTTP 422 Review Can not request changes on your own pull request, because the acting login is the PR author's. This COMMENT review carries the same verdict and findings.

  • Reviewed head: 0f7792ecf, round 2, against base db36dc0ec. main is now ab5c24f73. Phase: implementation.
  • Account mode: one account. The acting login, aram356, is the PR author's.
  • Scope: the diff changes runtime Rust, TypeScript, tests, docs and the example config. It is not documentation-only, so I ran the full prescribed suite again in a fresh detached worktree at this head, .worktrees/review-1675-0f7792e.

Round-1 findings

All ten round-1 threads are accepted and resolved. Each has a reply with the evidence:

  • what I read at the head;
  • the suite result;
  • where it applies, a mutation of the fix that the new test catches.

Round-2 findings

Should-fix:

  1. CHANGELOG.md conflicts with main (ab5c24f73, #1501). The PR can't merge as it stands (CHANGELOG.md:16).
  2. No route test sets rewrite_clicks, yet spec criterion :158 says the route tests cover each switch on its own.
  3. Nothing tests "nothing is logged at error level", or the switch name in the turned-off line. Both mutations pass every test (http_util.rs:530).
  4. The docs miss the upgrade case: pages cached before the upgrade, with the auction already off, now get 404s (integrations/prebid.md:174).
  5. edge-cookies.md and ec-setup-guide.md, which this PR doesn't touch, now contradict it (anchored at api-reference.md:202).
  6. The claim that the shim matches Prebid's ad-unit selection is tested only against a mocked requestBids (index.ts:2518).

Nits:

  • the proxy.rs comment about the click switch;
  • the CreativeCssProcessor and AuctionConfig docs;
  • the auctionEnabled test case without browser routes;
  • the status-only precondition in the Fastly EID test;
  • the plan contradicting the delivered code.

I checked several other leads and set them aside:

  • Selection parity: probed in JSDOM against real Prebid 10.26.0, and it matches today.
  • /auction with the flag off: no path still sends it, including aliases, refresh, late units and stale requestBids references.
  • /auction arms on Axum, Cloudflare and Spin: they build the EC context before the gate, but with no KV access or outbound call, which the spec's "the guarantee starts at the handler" allows.

Validation

Every command ran at 0f7792ecf through my worktree's prf_run:

  • macOS arm64, rustc 1.98.1, Node 24.20.0, viceroy 0.22.0, spin 4.1.0;
  • for the Cloudflare runtime, wasm-bindgen 0.2.126 and wrangler 4.83.0.

The cargo target dir is shared with the author's worktree at the same commit. The logs show the crates compiled from this checkout: Compiling trusted-server-core v0.1.0 (.../review-1675-0f7792e/crates/trusted-server-core).

Command Result
npm ci (JS lib and docs) exit 0
cargo fmt --all -- --check, also for the integration-tests crate exit 0
cargo build-fastly, build-axum, build-cloudflare; Fastly release build exit 0
The eight Clippy aliases, plus cargo clippy --manifest-path crates/trusted-server-integration-tests/Cargo.toml --all-targets -- -D warnings exit 0, no warnings
cargo test-fastly 7 test result: ok. lines: 3708 passed, 0 failed, 31 ignored
cargo test-fastly-reuse 248 passed, 0 failed, 5 ignored
cargo test-axum / test-cloudflare / test-spin 62 / 59 / 98 passed, 0 failed
cargo test --manifest-path crates/trusted-server-integration-tests/Cargo.toml --test parity 31 passed, 0 failed
npx vitest run Test Files 80 passed (80), Tests 3314 passed | 1 skipped (3315)
npx vitest run test/prebid-artifact-integration.test.mjs --reporter=verbose --silent=false Tests 13 passed (13); shim characters: 52549
JS npm run lint and npm run format; docs npm run format, lint and build; Markdown Prettier outside docs/ exit 0; build complete in 5.86s.
cargo test -p trusted-server-core --test template_build_digest and its Clippy 10 passed, 0 failed; exit 0
scripts/lint-wasm-clock.sh exit 0
Docs-proposal shellcheck, hunks.test.mjs, test.sh exit 0; pass 20, fail 0
ts dev lint domains --changed-vs origin/main exit 0, no findings
CI Node pin guard pass 30, fail 0; ok: 34 jobs in 10 workflows pin Node before compiling Rust
node crates/trusted-server-adapter-fastly/tests/deadline-origin.mjs "$(command -v viceroy)" 5 passed, 0 failed
Cloudflare and Spin deadline-runtime builds and Clippy exit 0
Cloudflare and Spin deadline runtimes 4 and 5 PASS lines
node --test scripts/release/phase1.test.mjs; shellcheck scripts/release/phase1-build.sh pass 27, fail 0; exit 0
./scripts/test-cli.sh; codegen tests 965 passed, 0 failed; 7 passed
BID_DELAY=3 ./scripts/template-cache-local-test.sh esi / inline / purge see below: 22 / 9 / 34 passed, 0 failed

The first template-cache runs exited 1 with Port 9099 is already in use: another session's harness origin held the port. The retries on ORIGIN_PORT=9199 BID_PORT=9200 TS_PORT=7888 passed.

Mutations. Each ran in my worktree and was restored, with the working diff checked identical afterwards.

Mutation Result
Fastly /auction arm if state.orchestrator.is_enabled() → if true caught: turned_off_auction_is_not_eligible_for_eid_persistence exit 134
proxy.rs:668 creative pass ignores rewrite_creatives caught: creative_rewriting_off_passes_proxied_html_and_css_through_unchanged exit 134
/first-party/proxy gate on auction.enabled caught on all five suites (101 ×4, 134)
turned-off Content-Type → text/html caught on all five suites (101 ×4, 134)
shim: string adUnitCodes ignored; explicit adUnits not narrowed each caught by its new Vitest case
turned-off line at error level survives: core lib and Axum exit 0
click gate logs the old auction.rewrite_clicks literal survives: core proxy:: exit 0
auctionEnabled derived from browser routes survives: core integrations::prebid exit 0

Merge with main. In a separate detached worktree I merged ab5c24f73 without committing, kept both CHANGELOG entries, and ran: cargo clippy-fastly, exit 0; cargo test-fastly, exit 0 with 3719 passed, 0 failed; cargo clippy-axum, exit 0; cargo test-axum, exit 0 with 62 passed, 0 failed. The probe worktree is removed.

Not run locally: the HTML EOF checks and the Docker integration and browser jobs. GitHub CI reports 30 of 30 checks passing at 0f7792ecf. That is CI's result, not a run of mine.

Comment thread CHANGELOG.md Resolved
Comment thread docs/guide/integrations/prebid.md Resolved
Comment thread docs/guide/api-reference.md Resolved
Comment thread crates/trusted-server-core/src/proxy.rs Resolved
Keep both Breaking entries where the CHANGELOG conflicted with #1501.
- Cover rewrite_clicks in every adapter and parity switch-isolation test.
- Capture debug-to-error log lines in core tests and assert that a
  turned-off endpoint logs one debug line naming the switch that decided
  it, and nothing at warn or error.
- Test the shim's ad-unit selection against real Prebid in the artifact
  suite, including units Prebid does not auction.
- Keep auctionEnabled on for an enabled plan without browser routes, and
  check the turned-off body in the Fastly EID test.
- Document the upgrade case for cached pages, the auction-on condition
  in the edge cookie and EC setup guides, the endpoint switches on the
  AuctionConfig and CreativeCssProcessor docs, and the plan's changes
  after review.
@aram356
aram356 marked this pull request as ready for review December 3, 2026 04:45

@aram356 aram356 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

REVIEWER: REQUEST_CHANGES

GitHub blocked this review event: the REQUEST_CHANGES submission returned HTTP 422 Review Can not request changes on your own pull request, because the acting login is the PR author's. This COMMENT review carries the same verdict and findings.

  • Reviewed head: d14192331, round 3, against base ab5c24f73 (current main, which is also the merge base). Phase: implementation.
  • Account mode: one account. The acting login, aram356, is the PR author's.
  • Scope: the diff changes runtime Rust, TypeScript, tests, docs and the example config. It is not documentation-only, so I ran the full prescribed suite again in a fresh detached worktree at this head, .worktrees/review-1675-d141923.

Round-2 findings

All eleven round-2 dispositions are accepted. Each thread has a reply with what I read at the head, the suite result and, where it applies, a mutation of the fix that its test catches. At the user's instruction for this self-review, I've left every thread open, so none is resolved.

Round-3 findings

Should-fix:

  1. Criteria 2 and 3 say the click endpoints and sign work in their configurations, but the tests only prove those requests pass the gate. A mutation that makes every signed click fail while rewrite_creatives is off passes every suite (proxy.rs:3556).

Nits:

  • assert_endpoint_turned_off's doc comment now sits on assert_turned_off_log (test_support.rs:115).
  • The rewrite_clicks doc overclaims and has a 116-character line, and the related HEAD comment is stale (auction_config_types.rs:72).
  • The spec's line 88 kept "before the switch-off", and the new cached-page wording misses tabs that were already open.
  • The plan note names Task 5 instead of Task 4, and implies route tests assert the log line.

I set these leads aside after checking them:

  • Fastly and a non-ASCII Cookie header: the hypothesis was that it answers a turned-off route with a 400 before the gate. I ran a temporary probe test at this head that routes GET /first-party/proxy with rewrite_creatives = false and Cookie: a=\xc3\xa9. Its assert_eq!(status, StatusCode::NOT_FOUND) passed: test result: ok. 1 passed; 0 failed. The BAD_REQUEST variant failed (exit 134). The file was restored and the diff checked identical. Withdrawn.
  • Prerendering: while a page prerenders, Prebid picks its ad units on activation, but the buildRequests guard still blocks the post.
  • The empty-loop guard in the new artifact test: the posted-codes assertion already requires both units, and the over-selection mutation below fails that loop.
  • No # Examples on endpoint_turned_off_response: only 2 of the 13 functions in http_util.rs have that section.

Validation

Every command ran at d14192331 through my worktree's prf_run, with:

  • macOS arm64, rustc 1.98.1, Node 24.20.0, viceroy 0.22.0, spin 4.1.0;
  • for the Cloudflare runtime, wasm-bindgen 0.2.126 and wrangler 4.83.0.

The cargo target dir is shared with the author's worktree, but the logs show Compiling trusted-server-core v0.1.0 (.../review-1675-d141923/crates/trusted-server-core).

All 55 gates exited 0.

Command Result
npm ci (JS lib and docs); cargo fmt --all -- --check, also for the integration-tests crate exit 0
cargo build-fastly, build-axum, build-cloudflare; the Fastly release build exit 0
The eight Clippy aliases, plus the integration-tests crate with -D warnings exit 0
cargo test-fastly 7 test result: ok. lines: 3719 passed, 0 failed, 31 ignored
cargo test-fastly-reuse 248 passed, 0 failed, 5 ignored
cargo test-axum / test-cloudflare / test-spin 62 / 59 / 98 passed, 0 failed
cargo test --manifest-path crates/trusted-server-integration-tests/Cargo.toml --test parity 31 passed, 0 failed
npx vitest run Test Files 80 passed (80), Tests 3317 passed | 1 skipped (3318)
npx vitest run test/prebid-artifact-integration.test.mjs --reporter=verbose --silent=false Tests 16 passed (16); shim characters: 52549
JS npm run lint and npm run format; docs npm run format, lint and build; Markdown Prettier outside docs/ exit 0; build complete in 6.13s.
template_build_digest test and Clippy 10 passed, 0 failed; exit 0
scripts/lint-wasm-clock.sh; docs-proposal scripts; ts dev lint domains --changed-vs origin/main; CI Node pin guard; release producer checks all exit 0
node crates/trusted-server-adapter-fastly/tests/deadline-origin.mjs "$(command -v viceroy)" 5 passed, 0 failed
Cloudflare and Spin deadline-runtime builds and Clippy; their runtimes exit 0; 4 and 5 PASS lines
./scripts/test-cli.sh; codegen tests 965 passed, 0 failed; 7 passed
BID_DELAY=3 ORIGIN_PORT=9199 BID_PORT=9200 TS_PORT=7888 ./scripts/template-cache-local-test.sh esi / inline / purge 22 / 9 / 34 passed, 0 failed

Mutations. Each ran in my worktree and was restored, with the working diff checked identical afterwards.

Mutation Result
/first-party/click gate on rewrite_creatives caught by the new rewrite_clicks cases on all five suites (101 ×4, 134)
turned-off line at error level caught by assert_turned_off_log (exit 134)
click gate logs the old auction.rewrite_clicks literal caught (exit 134)
auctionEnabled derived from browser routes caught by the new routeless case (exit 134)
shim treats a code string as "no filter"; explicit units not narrowed each failed only its own real-Prebid case (exit 1), under a broader -t as filter caused by a quoting slip in my script
signed click and rebuild fail while rewrite_creatives is off survives: every suite exit 0 (should-fix 1)

Not run locally: the HTML EOF checks and the Docker integration and browser jobs. GitHub CI reports 30 of 30 checks passing at d14192331; that is CI's result, not a run of mine. git merge-tree --write-tree origin/main d14192331 exits 0, and GitHub reports the PR MERGEABLE.

Comment on lines +3556 to +3561
if answers {
let result = call_creative_endpoint(&settings, req).await;
assert!(
result.is_err(),
"{label}: should pass the gate, got {result:?}"
);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

REVIEWER: should-fix Spec criteria 2 and 3 say the endpoints work in two cases:

  • the click endpoints, with rewrite_creatives = false and rewrite_clicks = true;
  • proxy and sign, with rewrite_creatives = true and rewrite_clicks = false.

The tests prove only that those requests pass the gate.

Evidence:

  • Here, an answering row asserts only result.is_err() ("should pass the gate"), and any error satisfies that.
  • The adapter and parity each_switch_turns_off_only_its_own_endpoints tests assert only that the body isn't ENDPOINT_TURNED_OFF_BODY.
  • I ran a mutation in my worktree at d14192331, then restored the file, and the working diff checked identical afterwards.
    • The edit: at the top of reconstruct_and_validate_signed_target (proxy.rs:2231), return Err(TrustedServerError::Proxy { .. }) while !settings.auction.rewrite_creatives.
    • That breaks every signed click and rebuild in exactly the criterion-2 configuration.
    • Every suite still passed, each with 0 failed:
      • cargo test -p trusted-server-core --target wasm32-wasip1 --lib: 3393 passed;
      • cargo test-axum / test-cloudflare / test-spin: 62 / 59 / 98 passed;
      • parity: 31 passed;
      • cargo test -p trusted-server-adapter-fastly --target wasm32-wasip1 --bin trusted-server-adapter-fastly: 248 passed.

Correction: add positive core cases for the two working configurations.

  • With rewrite_creatives = false and rewrite_clicks = Some(true):
    • a correctly signed /first-party/click answers its 302 to the target;
    • a signed /first-party/proxy-rebuild answers its normal success response.
  • With rewrite_creatives = true and rewrite_clicks = Some(false), /first-party/sign succeeds.

turned_off_creative_endpoints_ignore_valid_signatures already builds signed URLs you can reuse.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

CREATOR: fixed in 7c08e500b.

  • New creative_endpoints_work_when_only_their_own_switch_is_on (proxy.rs) checks both working configurations:
    • With rewrite_creatives = false and rewrite_clicks = Some(true), a signed /first-party/click answers 302 with Location: https://cdn.example/landing.html?x=1, and a signed POST /first-party/proxy-rebuild answers 200 with a re-signed click URL.
    • With rewrite_creatives = true and rewrite_clicks = Some(false), GET and POST /first-party/sign each answer 200 with a signed /first-party/proxy URL.
  • Mutation, run in my worktree and then restored, with the working diff checked identical afterwardss, against cargo test -p trusted-server-core --target wasm32-wasip1 --lib -- creative_endpoints_work_when_only_their_own_switch_is_on:
    • your mutation, an early Err while !settings.auction.rewrite_creatives at the top of reconstruct_and_validate_signed_target (proxy.rs:2232), exited 134;
    • the mirror case, an early Err while !settings.auction.rewrites_auction_clicks() right after the /first-party/sign gate (proxy.rs:1769), exited 134.

At head 7c08e500b: cargo test-fastly exited 0: 7 test result: ok. lines, 3720 passed, 0 failed, with creative_endpoints_work_when_only_their_own_switch_is_on ... ok.

Comment on lines +115 to +116
/// Assert that a turned-off endpoint logged exactly one `debug` line naming
/// `path` and `switch`, and nothing at `warn` or `error`.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

REVIEWER: nit Moving assert_turned_off_log here put it between assert_endpoint_turned_off's doc comment (:104-114) and that function (:138).

  • rustdoc now attaches both doc blocks to assert_turned_off_log: "Asserts that response is the local 404…", including its # Panics.
  • assert_endpoint_turned_off is left with no doc.

Correction: move the new helper, with its own doc comment, below assert_endpoint_turned_off, or above the old doc block.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

CREATOR: fixed in 7c08e500b. assert_turned_off_log now comes after assert_endpoint_turned_off, so each doc comment sits directly on its own function.

At head 7c08e500b:

  • cargo doc -p trusted-server-core --no-deps exited 0;
  • cargo fmt --all -- --check exited 0; cargo clippy-fastly exited 0;
  • cargo test-fastly exited 0: 7 test result: ok. lines, 3720 passed, 0 failed.

Comment on lines +72 to +74
/// `/first-party/proxy` keeps wrapping. An explicit value applies to every
/// path. Unset is omitted from serialized config blobs, so older binaries
/// path. [`Self::rewrites_auction_clicks`] also turns `/first-party/click`
/// and `/first-party/proxy-rebuild` on or off. Unset is omitted from serialized config blobs, so older binaries

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

REVIEWER: nit Two slips in this paragraph, both from round 3:

  • "An explicit value applies to every path" overclaims. While rewrite_creatives = false, proxy finalization runs no creative pass (proxy.rs:667-668), so rewrite_clicks = true wraps no proxied HTML.
  • Line 74 is 116 characters. The edit joined the new sentence to the following one ("Unset is omitted from serialized config blobs…") on one line.

Related: the HEAD comment at proxy.rs:672-675 still says "the GET path rewrites HTML and CSS and drops the upstream length, so drop it here too". That now holds only when rewrites_body.

Correction:

  • Say an explicit value applies to every path where rewriting runs.
  • Rewrap the paragraph.
  • Make the HEAD comment conditional on the creative pass running.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

CREATOR: fixed in 7c08e500b.

  • The rewrite_clicks doc now says an explicit value applies to every path where rewriting runs, and that proxied HTML is rewritten only while rewrite_creatives is on. It is rewrapped.
  • The HEAD comment in finalize_proxied_response now says "when the GET path rewrites HTML or CSS it drops the upstream length".
  • No line this PR adds to auction_config_types.rs or test_support.rs is over 100 characters. Checked with git diff origin/main -- <files> | grep '^+' | awk 'length>101', which printed nothing.

At head 7c08e500b: cargo fmt --all -- --check exited 0; cargo clippy-fastly exited 0; cargo doc -p trusted-server-core --no-deps exited 0.

- The filter decides for every protected path before any route is chosen.
- Moving the switch check ahead of the filters would need Fastly dispatch code.

So on a DataDome-protected Fastly service, a turned-off `/auction` can still cost one verdict call per request. Prebid on freshly served pages sends no such request. Pages cached before the switch-off still do, and so does any publisher code that calls `tsjs.requestAds`, which this design leaves unchanged. `/first-party/` is excluded from DataDome by default. This is a design call, open to review.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

REVIEWER: nit Round 3 updated the cached-page wording in CHANGELOG.md, both guides and the spec's consequences, but missed this line: "Pages cached before the switch-off still do".

The new wording everywhere also covers cached pages but not tabs that were already open:

  • The flag lives in the page's inline window.__tsjs_prebid={config_json} (prebid.rs:1503).
  • The shim reads it on each call (index.ts:248-250, :2428, :2560).

So a tab opened before the upgrade, or before the switch-off, keeps calling POST /auction on refresh auctions until it is reloaded.

Correction:

  • Here, say "pages cached before this upgrade or the switch-off".
  • In the round-3 sentences, say "pages loaded or cached before …".

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

CREATOR: fixed in 7c08e500b.

  • Spec :88 now reads "Open tabs and cached copies of pages served before this upgrade or the switch-off still do".
  • The round-3 sentences now cover open tabs too: CHANGELOG.md, integrations/prebid.md, configuration.md, and the spec's consequences (:102 and the /auction consequence).
    • They say "open tabs and cached copies of pages served before this upgrade, or before the auction was turned off", lasting "until they are reloaded or the cache expires".
    • The same applies to the turn-on case.
  • Spec :102 adds why: the injected config is inline in the page, and the shim reads it on each call.

At head 7c08e500b: cd docs && npm run format exited 0; npm run lint exited 0; npm run build exited 0 (build complete in 6.18s.); Markdown Prettier outside docs/ exited 0.

Comment on lines +20 to +21
- **Shim ad-unit selection matches Prebid's `requestBids`.** A single `adUnitCodes` string narrows to that code, and `adUnitCodes` narrows explicit `adUnits`. Task 5 kept "today's string filter".
- **Route tests cover each switch on its own,** including `rewrite_clicks`. The turned-off log line is asserted, nothing at `warn` or `error` included.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

REVIEWER: nit Two slips in the new "Changes after review" note:

  • "today's string filter" is in Task 4 (line 402, under ### Task 4 at :314), not Task 5.
  • "The turned-off log line is asserted" sits under the route-tests bullet, but only the core tests assert it (proxy.rs:3573, auction/endpoints.rs:1145).

Correction: write "Task 4", and say that the core tests assert the log line.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

CREATOR: fixed in 7c08e500b. The plan note now:

  • says "Task 4 kept 'today's string filter'";
  • gives the log assertion its own bullet: "Core tests assert the turned-off log line, and nothing at warn or error";
  • adds that core tests now prove each endpoint works when only its own switch is on.

At head 7c08e500b: cd docs && npm run format exited 0; npm run lint exited 0; npm run build exited 0 (build complete in 6.18s.); Markdown Prettier outside docs/ exited 0.

@aram356 aram356 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

REVIEWER: REQUEST_CHANGES — GitHub rejected the formal event: Review Can not request changes on your own pull request.

This COMMENT review records the same verdict and existing findings under the one-account workflow.

Implementation re-review at d14192331a77b2786b418e21db8e8235c63581c5, against actual base ab5c24f73f84bd226fe3c16cfe215a86f56d9b5b.

All 11 previous round-2 corrections are independently verified and resolved. The earlier 10 resolved findings remain corrected. A fresh pre-publication read found five new threads posted by the concurrent self-review; I inspected and confirmed their concerns. They remain open pending CREATOR disposition. This pass adds no duplicate inline threads. All 35 changed files and relevant surrounding paths were covered across core, adapters, Prebid, build/cache behavior and documentation.

The revised Fastly EID eligibility and non-streaming proxy behavior agree with the final specification. No additional runtime defect was found. The remaining should-fix is success-path regression coverage; four smaller documentation corrections remain.

Outstanding existing findings

Severity Existing thread
should-fix Add successful signed-request cases for the mixed switch configurations
nit Restore the response assertion helper doc comment to its function
nit Scope and wrap the click-setting docs; update the HEAD comment
nit Cover already-open tabs and finish the upgrade wording
nit Correct the plan task number and log-assertion attribution

Independent source verification: git show d14192331:crates/trusted-server-core/src/proxy.rs shows the mixed-switch matrix accepts result.is_err() at lines 3556-3561. The positive click, rebuild and signing tests at lines 3228, 3300 and 2665 use the default switch settings. Read-only inspection of the core handler tests in proxy.rs found no successful signed-request case under these mixed settings. Add a valid click 302 and successful rebuild with assets off/clicks on, and successful signing with assets on/clicks off.

I also read the affected doc blocks and plan/spec passages. The misplaced helper doc comment, overbroad click-setting sentence and stale HEAD comment, omitted already-loaded-tab case, and Task 5/core-vs-route attribution slips are present. The concurrent reviewer's mutation logs belong to that runner; this pass did not rerun those mutations.

Next actor: CREATOR, to address or provide supported dispositions for these five threads. Approval waits for their acceptance and a new current-head review.

Previous findings resolved

Thread Verified correction
Main merge and both breaking changelog entries Accepted fixed after source inspection and independent current-head verification.
Click-switch route/parity isolation Accepted fixed after source inspection and independent current-head verification.
Debug/error log assertions and effective switch names Accepted fixed after source inspection and independent current-head verification.
Pre-upgrade and re-enable cached pages Accepted fixed after source inspection and independent current-head verification.
EC persistence and setup guides Accepted fixed after source inspection and independent current-head verification.
Real-Prebid selection artifact cases Accepted fixed after source inspection and independent current-head verification.
Proxy switch comment Accepted fixed after source inspection and independent current-head verification.
CSS and AuctionConfig API documentation Accepted fixed after source inspection and independent current-head verification.
Enabled plan with no browser routes Accepted fixed after source inspection and independent current-head verification.
Exact disabled body in Fastly EID test Accepted fixed after source inspection and independent current-head verification.
Implementation-plan amendments Accepted fixed after source inspection and independent current-head verification.

Independent validation

Every command below ran in my uniquely named detached worktree, through its ownership wrapper, using clean dependencies and a separate Cargo target directory. No CREATOR or concurrent self-review worktree was used. Supplied CREATOR mutation logs are not counted as my execution.

Tools: macOS arm64; Rust 1.98.1; Node 24.20.0; Viceroy 0.22.0; Spin 4.1.0; Wrangler 4.83.0; wasm-bindgen 0.2.126. The Fastly Cargo runner was explicitly pinned to Viceroy 0.22.0. Template-cache controls used ORIGIN_PORT=23167, BID_PORT=23168, TS_PORT=23169 and BID_DELAY=3.

Exact command Directory Exit Verbatim result lines, when emitted
npm ci --no-audit --no-fund /crates/trusted-server-js/lib 0 No summary line emitted.
npm ci --no-audit --no-fund /docs 0 No summary line emitted.
cargo fmt --manifest-path crates/trusted-server-integration-tests/Cargo.toml -- --check / 0 No summary line emitted.
cargo clippy --manifest-path crates/trusted-server-integration-tests/Cargo.toml --all-targets -- -D warnings / 0 Finished dev profile [unoptimized + debuginfo] target(s) in 1m 42s
cargo fmt --all -- --check / 0 No summary line emitted.
cargo clippy-fastly / 0 Finished dev profile [unoptimized + debuginfo] target(s) in 1m 16s
cargo clippy-axum / 0 Finished dev profile [unoptimized + debuginfo] target(s) in 32.11s
cargo clippy-cloudflare / 0 Finished dev profile [unoptimized + debuginfo] target(s) in 38.51s
cargo clippy-cloudflare-wasm / 0 Finished dev profile [unoptimized + debuginfo] target(s) in 39.28s
cargo clippy-spin-native / 0 Finished dev profile [unoptimized + debuginfo] target(s) in 3.17s
cargo clippy-spin-wasm / 0 Finished dev profile [unoptimized + debuginfo] target(s) in 32.82s
cargo clippy-cli / 0 Finished dev profile [unoptimized + debuginfo] target(s) in 1m 26s
cargo clippy-codegen / 0 Finished dev profile [unoptimized + debuginfo] target(s) in 4.36s
cargo test-fastly / 0 test result: ok. 248 passed; 0 failed; 5 ignored; 0 measured; 0 filtered out; finished in 0.96s
test result: ok. 3395 passed; 0 failed; 6 ignored; 0 measured; 0 filtered out; finished in 60.85s
test result: ok. 14 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 11 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.04s
test result: ok. 21 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 30 passed; 0 failed; 20 ignored; 0 measured; 0 filtered out; finished in 0.05s
cargo test-fastly-reuse / 0 test result: ok. 248 passed; 0 failed; 5 ignored; 0 measured; 0 filtered out; finished in 2.69s
cargo test-axum / 0 test result: ok. 25 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.58s
test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.04s
test result: ok. 33 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.12s
test result: ok. 0 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.01s
cargo test-cloudflare / 0 test result: ok. 32 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.09s
test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 25 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s
test result: ok. 0 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.00s
cargo test-spin / 0 test result: ok. 58 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.07s
test result: ok. 40 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.08s
test result: ok. 0 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.02s
cargo test --manifest-path crates/trusted-server-integration-tests/Cargo.toml --test parity / 0 test result: ok. 31 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.09s
cargo test -p trusted-server-core --test template_build_digest / 0 test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.19s
cargo clippy -p trusted-server-core --test template_build_digest -- -D warnings / 0 Finished dev profile [unoptimized + debuginfo] target(s) in 21.10s
scripts/lint-wasm-clock.sh / 0 Finished dev profile [unoptimized + debuginfo] target(s) in 15.52s
cargo run --manifest-path crates/trusted-server-cli/Cargo.toml --target aarch64-apple-darwin --bin ts -- dev lint domains --changed-vs ab5c24f73f84bd226fe3c16cfe215a86f56d9b5b / 0 Finished dev profile [unoptimized + debuginfo] target(s) in 2m 03s
cargo doc -p trusted-server-core --target wasm32-wasip1 --no-deps --all-features / 0 Finished dev profile [unoptimized + debuginfo] target(s) in 12.71s
./scripts/test-cli.sh / 0 test result: ok. 766 passed; 0 failed; 9 ignored; 0 measured; 0 filtered out; finished in 0.61s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 1 passed; 0 failed; 3 ignored; 0 measured; 0 filtered out; finished in 1.76s
test result: ok. 9 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.11s
test result: ok. 18 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.46s
test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.10s
test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.42s
test result: ok. 35 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.25s
test result: ok. 54 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.85s
test result: ok. 9 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 2.09s
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.05s
test result: ok. 42 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.24s
test result: ok. 1 passed; 0 failed; 6 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.15s
test result: ok. 4 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.22s
test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.34s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 772 filtered out; finished in 10.67s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 4 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 9 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 18 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 5 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 4 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 35 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 54 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 9 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 42 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 7 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 5 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 3 filtered out; finished in 0.00s
test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 769 filtered out; finished in 30.40s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 4 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 9 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 18 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 5 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 4 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 35 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 54 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 9 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 42 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 7 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 5 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 3 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 775 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 2 filtered out; finished in 5.49s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 9 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 18 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 5 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 4 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 35 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 54 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 9 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 42 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 7 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 5 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 3 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 775 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 3 filtered out; finished in 3.27s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 9 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 18 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 5 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 4 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 35 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 54 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 9 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 42 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 7 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 5 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 3 filtered out; finished in 0.00s
cargo test -p trusted-server-openrtb-codegen --target aarch64-apple-darwin / 0 test result: ok. 7 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s
node build-all.mjs /crates/trusted-server-js/lib 0 No summary line emitted.
npx vitest run /crates/trusted-server-js/lib 0 Test Files 80 passed (80)
Tests 3318 passed (3318)
npx vitest run test/prebid-artifact-integration.test.mjs --reporter=verbose --silent=false /crates/trusted-server-js/lib 0 [trace-prebid-artifact] shim characters: 52549
Test Files 1 passed (1)
Tests 16 passed (16)
npm run format /crates/trusted-server-js/lib 0 All matched files use Prettier code style!
npm run lint /crates/trusted-server-js/lib 0 No summary line emitted.
npm run format /docs 0 All matched files use Prettier code style!
npm run lint /docs 0 No summary line emitted.
npm run build /docs 0 build complete in 12.64s.
docs/node_modules/.bin/prettier --config docs/.prettierrc --check '*.md' '.claude/**/*.md' '.github/**/*.md' 'crates/**/*.md' 'scripts/**/*.md' 'tinybird/**/*.md' / 0 All matched files use Prettier code style!
bash -c 'shellcheck scripts/docs-proposal/*.sh' / 0 No summary line emitted.
node --test scripts/docs-proposal/hunks.test.mjs / 0 No summary line emitted.
scripts/docs-proposal/test.sh / 0 All documentation proposal script tests passed.
node --test scripts/check-ci-node-pin.test.mjs / 0 No summary line emitted.
node scripts/check-ci-node-pin.mjs / 0 ok: 34 jobs in 10 workflows pin Node before compiling Rust
node --test scripts/release/phase1.test.mjs / 0 No summary line emitted.
shellcheck scripts/release/phase1-build.sh / 0 No summary line emitted.
cargo build-fastly / 0 Finished dev profile [unoptimized + debuginfo] target(s) in 49.10s
cargo build-axum / 0 Finished dev profile [unoptimized + debuginfo] target(s) in 44.43s
cargo build-cloudflare / 0 Finished dev profile [unoptimized + debuginfo] target(s) in 1m 17s
cargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1 / 0 Finished release profile [optimized + debuginfo] target(s) in 6m 13s
cargo build --package trusted-server-adapter-spin --target wasm32-wasip1 --features spin --release / 0 Finished release profile [optimized + debuginfo] target(s) in 3m 18s
node crates/trusted-server-js/lib/build-all.mjs --out-dir /private/tmp/pr1675-codex-review-d141923-8e3c9b/prebuilt-bundles / 0 No summary line emitted.
env TSJS_PREBUILT_DIR=/private/tmp/pr1675-codex-review-d141923-8e3c9b/prebuilt-bundles cargo check-axum --locked / 0 Finished dev profile [unoptimized + debuginfo] target(s) in 51.46s
node crates/trusted-server-adapter-fastly/tests/deadline-origin.mjs /private/tmp/pr1675-review-tools/bin/viceroy / 0 test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 248 filtered out; finished in 0.42s
cargo build --locked -p trusted-server-adapter-cloudflare --example deadline-runtime --target wasm32-unknown-unknown --features cloudflare / 0 Finished dev profile [unoptimized + debuginfo] target(s) in 1m 08s
cargo clippy --locked -p trusted-server-adapter-cloudflare --example deadline-runtime --target wasm32-unknown-unknown --features cloudflare -- -D warnings / 0 Finished dev profile [unoptimized + debuginfo] target(s) in 48.36s
node scripts/test-worker-auction-deadlines.mjs cloudflare --runtime /private/tmp/pr1675-review-tools/bin/wrangler --wasm-bindgen /private/tmp/pr1675-review-tools/bin/wasm-bindgen --target-dir /private/tmp/pr1675-codex-review-d141923-8e3c9b/target / 0 PASS cloudflare /fast budget=80 origin=200: complete:209
PASS cloudflare /headers budget=80 origin=0: timeout:83
PASS cloudflare /body budget=80 origin=0: timeout:83
PASS cloudflare /headers budget=80 origin=200: timeout:201
cargo build --locked -p trusted-server-adapter-spin --example deadline-runtime --target wasm32-wasip1 --features spin / 0 Finished dev profile [unoptimized + debuginfo] target(s) in 1m 19s
cargo clippy --locked -p trusted-server-adapter-spin --example deadline-runtime --target wasm32-wasip1 --features spin -- -D warnings / 0 Finished dev profile [unoptimized + debuginfo] target(s) in 23.65s
node scripts/test-worker-auction-deadlines.mjs spin --runtime /opt/homebrew/bin/spin --target-dir /private/tmp/pr1675-codex-review-d141923-8e3c9b/target / 0 PASS spin /fast budget=80 origin=200: complete:203
PASS spin /headers budget=80 origin=0: timeout:81
PASS spin /body budget=80 origin=0: timeout:80
PASS spin /headers budget=80 origin=200: timeout:201
PASS spin /large budget=2000 origin=0: oversized:8
cargo test -p trusted-server-core --target aarch64-apple-darwin --lib trace_document_skipped_emitted_script_leaves_ad_state_untouched -- --ignored / 0 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 3403 filtered out; finished in 1.35s
cargo test -p trusted-server-core --target aarch64-apple-darwin --lib trace_document_emitted_script_deep_freezes_owned_context_in_node -- --ignored / 0 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 3403 filtered out; finished in 0.15s
env ORIGIN_PORT=23167 BID_PORT=23168 TS_PORT=23169 BID_DELAY=3 ./scripts/template-cache-local-test.sh esi / 0 22 passed, 0 failed
env ORIGIN_PORT=23167 BID_PORT=23168 TS_PORT=23169 BID_DELAY=3 ./scripts/template-cache-local-test.sh inline / 0 9 passed, 0 failed
env ORIGIN_PORT=23167 BID_PORT=23168 TS_PORT=23169 BID_DELAY=3 ./scripts/template-cache-local-test.sh purge / 0 34 passed, 0 failed

Initial attempts

The first ./scripts/test-cli.sh run exited 101: collects_lazy_gpt_slot_only_when_scroll_is_enabled failed at browser_collector.rs:2207 with should collect with scrolling: "timed out waiting for browser process to exit after audit"; its browser group reported test result: FAILED. 5 passed; 1 failed. The unchanged complete command was rerun after the other validation work finished; the table records that final run. The initial cause remains unconfirmed. No source, test, assertion or timeout was changed. The initial Fastly network fixture also exited 1 after its WASM process aborted with exit 134 at deadline.rs:916 (should finish before deadline). That exact fixture command was rerun after the other checks finished too; its original and rerun logs are retained. The cause of that initial timeout is also unconfirmed.

Limits and CI evidence

GitHub reports all 30 checks passing at this SHA, including integration, browser, EC lifecycle, trace and HTML EOF jobs. Those are GitHub-run results, separate from the 61 local commands above.

Local HTML EOF harnesses were not applicable under the repository's conditional instruction: this PR modifies no publisher, HTML-processor or EOF code. Docker/browser jobs were monitored on CI as the implementation validation plan prescribes.

Rustdoc completed with 31 source warnings. I mapped every reported location against the complete PR diff: none is on a PR-added line. Cargo also prints a dependency future-incompatibility notice for proc-macro-error2 v2.0.1. Both are recorded in the logs.

Account mode is one account: acting login and PR author are both aram356. This review is not a merge operation.

- Prove each creative endpoint works when only its own switch is on: a
  signed click redirects and a signed rebuild succeeds with click
  wrapping on and creative rewriting off, and sign succeeds with the
  reverse.
- Put the turned-off log helper after assert_endpoint_turned_off so each
  doc comment sits on its own function.
- Scope the rewrite_clicks doc to paths where rewriting runs, and make
  the HEAD comment conditional on the creative pass.
- Cover open tabs in the upgrade and switch-off wording, including spec
  line 88, and correct the plan's task number and log-assertion note.
@aram356

aram356 commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

CREATOR: Ready for re-review at 7c08e500b.

The five round-3 threads from review 6164270430 are each answered fixed in 7c08e500b. Review 6164343066 confirmed the same five threads. None is resolved; REVIEWER owns that.

  • should-fix, success paths: creative_endpoints_work_when_only_their_own_switch_is_on.
    • With click wrapping on and creative rewriting off, a signed click answers 302 and a signed rebuild answers 200.
    • With the reverse, GET and POST /first-party/sign answer 200.
    • The reviewer's surviving mutation and its sign-side mirror now both fail it.
  • nits:
    • each test-helper doc comment is back on its own function;
    • the rewrite_clicks doc and the HEAD comment are corrected;
    • open tabs are covered in the upgrade and switch-off wording, including spec line 88;
    • the plan note is corrected.

The full local suite passed at 7c08e500b: 53 gates, every one exit 0. That includes 3,720 passed in cargo test-fastly, 62 / 59 / 98 in the Axum, Cloudflare and Spin tests, 31 in parity and 3,318 in Vitest. The PR body's validation table has the details. The head merges into main at ab5c24f73 without conflict.

Account mode is one account: CREATOR acts as aram356, the PR author. The branch is prfection/1669-creative-endpoint-gating-plan, in worktree .worktrees/prfection/1669-creative-endpoint-gating-plan.

PR #1675 moves from main onto PR #1662's branch, feat/1598-ec-route-fastly, the top of the identity chain trunk. PR #1662's head (round 14, 7bbe9bb) brings the identity integration chain: the shared identity app and its read and finalize flow, the AuctionIdentity record service in handle_auction, EdgeZero's bounded body reads, the TCP route and parity harnesses, and LogCapture. Every switch keeps its behavior: the four creative handlers and handle_auction still check their switch first and answer the turned-off 404, proxy finalization still rewrites HTML and CSS only while rewrite_creatives is on, the Prebid config still carries auctionEnabled, and the shim still drops trustedServer demand while it is off.

crates/trusted-server-core/src/auction/endpoints.rs: #1675 put the auction switch first in handle_auction and deleted the disabled no-bid branch. The chain moved the size check into read_request_body, added the AuctionIdentity record service, and persists body EIDs before that disabled branch. The resolution keeps the chain's handler and puts #1675's switch check before the identity destructure and the body read, so a turned-off /auction reads no body, persists nothing and records no trace or telemetry; the chain's disabled branch is dropped as unreachable. The tests take the chain's module with #1675's changes ported to AuctionIdentity, orchestrator_with and a forbidding outbound client: the disabled-branch telemetry test becomes #1675's two turned-off tests, and the two trace tests move to an enabled auction with consent denied. Three chain tests used a disabled auction only to reach the body or a no-bid answer: auction_rejects_oversized_body now turns the auction on, and the body-read tests (auction_reads_a_streamed_body, auction_body_read_failures_map_to_statuses) use an enabled orchestrator whose unknown-jurisdiction consent answers the consent gate's 200 no-bid. A fourth pinned a chain decision that #1675, written on main, never weighed: fa805a4 (first in #1646) saves auction body EIDs for a live record even with bidding disabled, and its design doc says so. #1675's check-first rule reverses that, and the owners chose that rule on 2026-12-02: a turned-off /auction answers 404 before it reads the body and saves no EIDs. So auction_disabled_still_persists_consented_body_eids becomes turned_off_auction_persists_no_body_eids, which expects the turned-off 404 and no persisted body EID.

crates/trusted-server-core/src/http_util.rs: #1675 added the turned-off response helpers next to enforce_max_body_size, which the chain removed. The resolution keeps the removal and the helpers, and imports HeaderMap and HeaderValue.

crates/trusted-server-core/src/proxy.rs: both sides changed imports. The resolution keeps the chain's body-read and scripted-client imports and adds #1675's turned-off helpers and RecordCapture. call_creative_endpoint passes an empty EcContext to the chain's handle_first_party_proxy, which now takes one.

crates/trusted-server-core/src/test_support/logging.rs: #1675 split the test logger into WarningCapture and a debug-level RecordCapture. The chain replaced WarningCapture with LogCapture, which keeps warn and error records. The resolution keeps the chain's LogCapture and adds #1675's RecordCapture, with the shared logger enabled at debug and LogCapture still keeping only warn and error records; a test pins that.

crates/trusted-server-core/src/test_support.rs: both sides added test imports. The resolution keeps both.

crates/trusted-server-adapter-fastly/src/app.rs: #1675 tags /auction for EID syncing and builds the partner registry only while the auction is on. The chain takes the registry from the identity app. The resolution keeps the chain's registry source under #1675's condition, and adds the TerminalPrivateResponse import to the chain's test imports.

crates/trusted-server-adapter-fastly/src/main.rs: both sides added a test at the same place. The resolution keeps both.

crates/trusted-server-adapter-axum/tests/routes.rs, crates/trusted-server-adapter-cloudflare/tests/routes.rs, crates/trusted-server-adapter-spin/tests/routes.rs: both sides added imports, and the chain added a Cloudflare signing test and reworded the settings doc where #1675 turned the auction on. The resolution keeps the chain's imports, doc and test, #1675's auction-on settings and its turned-off route tests. On Axum, those tests are ported from EdgeZeroAxumService to the chain's TCP TestServer and also assert that nothing reaches the outbound client.

crates/trusted-server-integration-tests/tests/parity.rs: #1675 built per-settings routers and in-process senders. The chain replaced those with a TCP harness built from the shared settings. The resolution keeps the chain's harness, adds send_with so a test can choose the settings, turns the auction on in the shared settings as #1675 does, and ports turned_off_endpoints_parity and each_switch_turns_off_only_its_own_endpoints_parity to it.

crates/trusted-server-js/lib/test/prebid-artifact-integration.test.mjs: each side raised the shim size guard for its own additions, #1675 to 52.75 KB and the chain to 53 KB. On the chain the shim measures 52,641 characters, and #1675's change adds 87 (52,728), so the chain's 53 KB guard stays and the comment names both changes.

docs/guide/api-reference.md: #1675 set the route table's predicates for the five switched endpoints. The chain added columns and rows to the same table. The resolution keeps the chain's table with #1675's five predicates.

docs/guide/error-reference.md: #1675 added the turned-off case to the 404 row. The chain added rows and narrowed the table. The resolution keeps the chain's table with #1675's 404 row.

docs/guide/edge-cookies.md: #1675 qualified the /auction cookie-persistence text with the auction switch. The chain rewrote that diagram and paragraph around navigations and EC POSTs. The resolution keeps the chain's text, which no longer names /auction.

crates/trusted-server-core/src/integrations/prebid.rs (merged clean, failed to compile): #1675's routeless-plan test builds a ProviderConfig without the chain's allow_insecure_http. The resolution adds allow_insecure_http: false.

crates/trusted-server-core/src/test_support/identity_conformance.rs (merged clean, failed): the shared identity conformance run by Fastly and Axum expected a disabled /auction to answer 200 and save its body EIDs, the same fa805a4 decision. Under #1675's rule it now expects the turned-off 404 and no saved body EID.

crates/trusted-server-adapter-axum/tests/native_acceptance.rs (merged clean, failed): managed_post_bodies_reach_buffered_api_handlers_and_keep_their_limits posted to /auction under the fixture's disabled auction to prove the body reaches the handler. It now turns the auction on, since a turned-off /auction answers before it reads the body.

crates/trusted-server-adapter-axum/tests/startup.rs (merged clean, failed under the geo-cloudfront feature): admitted_body_error_keeps_managed_geo_without_losing_framework_status posted an oversized body to /auction under the startup fixture's disabled auction to prove the 413 keeps managed Geo. It now turns the auction on, since a turned-off /auction answers before it reads the body.

crates/trusted-server-integration-tests/tests/integration.rs (merged clean, fails in the runtime integration jobs): the chain's ingress cases post_auction_with_json_body_reaches_handler, chunked_post_auction_over_cap_returns_413 and spin_runtime_post_auction_with_json_body posted to /auction under the shared integration config, whose auction is off, and expected the chain's 200 no-bid or the 413 body limit. They now serve the integration config with the auction on and no providers, through OriginRuntime::serve_with_auction, so /auction reads the body and answers as before.
PR #1662's new head (14749b9) keeps the consent-string comment on the EC route fixture in identity_conformance.rs. The merge is clean.
On the identity chain, /auction saved body EIDs into a live record even with
bidding disabled. This PR checks the auction switch first, so a turned-off
/auction answers 404 before it reads the body and saves nothing. The Prebid
guide's two descriptions of body EID saving now say they apply only while
[auction].enabled is on. The two dated specs keep their text and gain a dated
update note. In handle_auction, the comments on body persistence no longer say
it runs whatever the auction switch says.
This merge joins PR #1675's third review (7c08e50) with the three commits that move the PR onto PR #1662's branch, feat/1598-ec-route-fastly. The first (8e3d85f) merges PR #1662's round 14 head and ports the switches onto the identity integration chain. The second (a1966f9) merges PR #1662's current head (14749b9). The third (e16189e) documents that a turned-off /auction answers 404 before it reads the body and saves no body EIDs. The third review rewords the cached-page wording to cover open tabs, documents that rewrite_clicks only applies where rewriting runs, adds a test that each creative endpoint works while only its own switch is on, and moves assert_turned_off_log below assert_endpoint_turned_off. Git merged every file without a conflict.

crates/trusted-server-core/src/proxy.rs: the third review's creative_endpoints_work_when_only_their_own_switch_is_on calls the endpoints through call_creative_endpoint, which on the chain passes an empty EcContext to handle_first_party_proxy. It needs no change.

crates/trusted-server-core/src/test_support.rs: the third review moved assert_turned_off_log below assert_endpoint_turned_off, so the turned-off 404 doc comment sits on its own function again. The chain's helpers stay as they were, and each helper appears once.

CHANGELOG.md, docs/guide/configuration.md, docs/guide/integrations/prebid.md: the third review's open-tab wording sits apart from the chain's changes and the body EID notes, so both are kept.
PR #1662's new head (20f849f) 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.

CHANGELOG.md: #1675 added its endpoint-switch entry at the top of Changed, and #1662 added its runtime KV entry at the same place. The resolution keeps both, #1662's first.
@aram356
aram356 changed the base branch from main to feat/1598-ec-route-fastly December 3, 2026 11:34
@aram356
aram356 added this pull request to stack #1731 December 3, 2026 11:35
aram356 added a commit that referenced this pull request Dec 3, 2026
PR #1675's new head brings #1675's switches that turn off POST /auction while the auction is disabled and the first-party creative endpoints while creative rewriting is off, together with the identity chain between #1646 and #1675 that #1667 did not carry yet: #1636's Axum after-response drain on SIGTERM, #1626's provider opt-outs and legacy EID expiry on Fastly and Axum, #1656's configurable Edge Cookie browser gate, #1661's refusal of EC creation when a trusted JA4 contradicts the User-Agent, and #1662's Fastly EC route acceptance and capped mirrored expiry.

docs/guide/configuration.md: #1675 reworded the enabled row of the [auction] table to say that it also turns on POST /auction, and #1667 added the mtls_slot row, which widened the table. The resolution keeps #1675's enabled text and #1667's mtls_slot row, with the table reformatted by Prettier.

Semantic break in crates/trusted-server-core/src/integrations/prebid.rs: #1675's owner commit d141923 added a test plan with no browser routes, whose ProviderConfig and AuctionPlanConfig literals predate #1667's 0985d67, which added the mtls provider field, and eaa2b3e, which added the mtls_slot plan field. The merge applies cleanly but the core tests no longer compile. The fix belongs in this link because it is where the two changes first meet. The literal gains mtls: false and mtls_slot: Default::default(), as #1667 wrote in the neighboring prebid.rs literals.

Cargo.lock is unchanged.
@aram356

aram356 commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

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 7c08e500b to 54969a7b8:

The base is now feat/1598-ec-route-fastly (#1662), so the endpoint switches sit on the identity chain, and #1622, #1709, #1713 and #1667 now sit on this branch. A turned-off /auction answers 404 before it reads the body, so it saves no body EIDs. Chain tests that call /auction now turn the auction on: one Axum startup test under geo-cloudfront, and the Axum and Spin ingress cases through OriginRuntime::serve_with_auction. Two dated specs gained update notes, and two auction/endpoints.rs comments were corrected.

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

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 Author

Cascade of #1533's Axum startup-test port fix (779e44673): 23e04ff6f 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 Author

Merged #1627's runtime KV removal (7c2b84f45) into this branch as 88572d472, on top of 23e04ff6f.

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 #1662'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 has no textual conflicts.

Semantic fix in crates/trusted-server-adapter-fastly/src/main.rs: #1646
(through #1662) drops the request-filter argument from
`apply_terminal_response_effects`, because filter effects now apply before
identity finalization, and rewrites its own late-effects tests to apply
the effects first. #1675's new
`late_filter_effects_cannot_make_a_turned_off_response_public` test still
passed `Some(&effects)`. It now applies the effects and then the terminal
effects, the same pattern, so it still proves that late filter headers
cannot make a turned-off response public.
@aram356

aram356 commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

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 88572d472 to bbbd23407:

#1646 removed the filter argument from apply_terminal_response_effects. This PR's late_filter_effects_cannot_make_a_turned_off_response_public test now applies the filter effects and then the terminal effects, so it still proves that late filter headers cannot make a turned-off response public.

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

@aram356

aram356 commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator Author

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

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 #1662's new head (1e8c9997f), 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.

Turn off first-party creative endpoints and POST /auction when their switch is off

1 participant