Skip to content

Retry an after-response write that loses its CAS - #1660

Open
dhruv8sh wants to merge 41 commits into
feat/1598-ec-route-fastlyfrom
fix/1553-after-response-cas-retry
Open

dhruv8sh wants to merge 41 commits into
feat/1598-ec-route-fastlyfrom
fix/1553-after-response-cas-retry

Conversation

@dhruv8sh

@dhruv8sh dhruv8sh commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Changes

File Change
Cargo.toml, crates/trusted-server-adapter-axum/Cargo.toml, Cargo.lock EdgeZero rev 9d02d7b3 → e9a22a70 (#536 merged onto it).
crates/trusted-server-core/src/ec/kv_backend.rs EcKvStore::update (default Unsupported) with EcKvReplacement, EcKvPlan, EcKvUpdate, EcKvUpdateOutcome and EcKvUpdateError. Test support: RecordBackedEcKv runs EdgeZero's real RecordHandle::update over any test double through a record KvStore bridge; ConflictInjectingEcKv moves here with a race closure; WriteFailingEcKv counts inserts.
crates/trusted-server-core/src/ec/record_backend.rs RecordEcKvStore::update and LazyRecordEcKvStore::update over RecordHandle::update; EdgeZero Unsupported maps to EcKvUpdateError::Unsupported.
crates/trusted-server-core/src/ec/kv.rs commit_after_response spends the permit, makes one EcKvStore::update with MAX_AFTER_RESPONSE_ATTEMPTS = 2 and maps its outcome; on Unsupported it overwrites last-write-wins. Test constructors build graphs with the record update.
crates/trusted-server-core/src/ec/page_load.rs AfterResponseRejection: Skipped, Conflict, StaleRead, StoreFailed, WriteFailed.
crates/trusted-server-core/src/ec/after_response.rs Plans against each snapshot EdgeZero reads and maps the result to an outcome. Logs After-response lookups: write outcome=<outcome> conflicts=<n>. Tests: retry against a fresh read, second conflict gives up, opt-out supersedes, withdrawn row not revived, stale re-read, missing re-read, failed re-read, failed first read, store error not retried, last-write-wins fallback writes and still skips a withdrawn row; each asserts the conflict count.
crates/trusted-server-adapter-fastly/src/post_delivery.rs Removes the duplicate outcome log, which now lives in core.
docs/guide/edgezero.md, docs/guide/native-rc-demo.md The new pin.
docs/superpowers/specs/2026-10-30-s2s-eid-collection-design.md §5.2.1, §9.1, §9.2 and scenario 23 describe the retry, where its loop lives, the fallback, the stale-read and failed outcomes, and the conflict count.
CHANGELOG.md Unreleased entry.

Closes

Closes #1553

Depends on IABTechLab/edgezero#536.

Spec

Spec: not a new feature. It is the follow-up the s2s EID collection spec deferred to #1553, and that spec is updated.

Test plan

  • cargo test-fastly && cargo test-fastly-reuse (4451 passed) and cargo test-axum && cargo test-cloudflare && cargo test-spin
  • cargo clippy-fastly && cargo clippy-axum && cargo clippy-cloudflare && cargo clippy-cloudflare-wasm && cargo clippy-spin-native && cargo clippy-spin-wasm && cargo clippy-cli && cargo clippy-codegen
  • cargo fmt --all -- --check
  • cargo test --manifest-path crates/trusted-server-integration-tests/Cargo.toml --test parity
  • CLI tests, native build-digest test and lint, scripts/lint-wasm-clock.sh
  • JS tests and format: no JS changes
  • Docs format: Prettier check on the changed docs, spec and CHANGELOG.md
  • Manual testing via fastly compute serve
  • Other: mutation checks. Removing the last-write-wins fallback, or reporting stale_read as conflict, fails named tests. EdgeZero's own tests cover the loop (KV identity graph #536).

Notes for review

  • Only Conflict retries. Store errors report failed and drop the results; the source stays due, so the next navigation asks again. Read and write failures inside the update are no longer told apart in the log, since EdgeZero returns one error.
  • The last-write-wins fallback is reachable only for an EcKvStore without update; every production store is RecordEcKvStore, which has it. Its overwrite can replace a withdrawal tombstone written between its read and its write.
  • Two tests that handed the graph a plan built from an older read than the one EdgeZero guards the write with were removed: that cannot happen now, because the guard is always the generation of the row the planner saw. Their scenarios stay covered by the racing-store tests.
  • The write outcome is still log-only; the s2s spec's §12.2 "metrics" is not added here.
  • Stays a draft until Add a bounded re-read and re-plan update for records edgezero#536 merges and the pin can move to rc/identity.

Checklist

  • Feature PRs: spec linked above, ending in a review log of two or more agent review rounds (not a feature)
  • Changes follow AGENTS.md conventions
  • No unwrap() in production code — use expect("should ...")
  • Uses log macros (not println!)
  • New code has tests
  • No secrets or credentials committed

prk-Jr and others added 6 commits November 23, 2026 14:55
On a conflict, the follow-up write now re-reads the row and re-plans
against it once instead of dropping its results. The re-plan sees every
write since, so lookups superseded by a newer opt-out are discarded and a
withdrawn row is never revived.

A conflicting write lands nothing, so commit_after_response hands the
AfterResponseWrite permit back on Conflict only. At most one follow-up
write lands per navigation.

The outcome log line moves into core and adds conflicts=<n> so the
conflict rate can be measured.

Closes #1553
PR #1532 now reads the native Geo profile path from
TRUSTED_SERVER__NATIVE_GEO_PROFILE_FILE instead of TS_NATIVE_GEO_PROFILE_FILE. No file in this PR
uses the old name after the merge, so the merge only takes the rename from
PR #1646. The merge had no conflicts.
The permit for the follow-up write used to leave KvIdentityGraph on a
conflict, inside a rejection whose Option field said whether a retry was
allowed. KvIdentityGraph::commit_after_response now spends the permit once
and runs the bounded retry itself: it reads the row, asks a re-plan closure
for the update, and after a conflict reads and re-plans again, for at most
MAX_AFTER_RESPONSE_ATTEMPTS attempts. At most one write lands. The
rejection is now an enum (Skipped, Conflict, ReadFailed, WriteFailed), so
a conflict cannot be mistaken for a store failure.

Fastly KV is eventually consistent, so a re-read can return the generation
that just lost the CAS. That re-read now ends with outcome conflict and no
second write. A failed read of the row now reports failed instead of
no_row, so no_row means only a missing or withdrawn row.

ConflictInjectingEcKv moves to kv_backend::test_support. Its race closure
writes through serialize_entry, so the raced row carries real metadata.
kv.rs and after_response.rs both use it, and RacingEcKv is removed. The
retry tests now assert the conflict count, and new tests cover a stale
re-read, failed reads and an unretried store error.

The CHANGELOG and spec no longer say the retry honours every withdrawal
recorded since dispatch. A row withdrawn and given consent again before
the read is not detected, which is now tracked in #1664.

Refs #1553
A lost CAS proves the row exists at a newer generation, so a re-read that
returns the generation that just lost, or no row at all, is a stale read
of an eventually consistent store. Reporting it as `conflict` hid it among
real second-attempt conflicts, and a stale Missing row was reported as
`no_row`. Both now stop without a second write as `stale_read`, so the two
can be measured apart and `no_row` keeps meaning a missing or withdrawn
row. Fastly generations are unique but not ordered, so an older generation
cannot be detected and is not faked.

Also describe the permit as spent before the first read, run the scenario
23 tombstone test through the real planner with an exact outcome, and keep
MAX_AFTER_RESPONSE_ATTEMPTS and serialize_entry from widening production
visibility (a cfg(test) accessor serves the test stores).

Refs #1553
@dhruv8sh
dhruv8sh marked this pull request as ready for review November 24, 2026 14:20
EcKvStore gains update, which RecordEcKvStore implements with EdgeZero's RecordHandle::update (IABTechLab/edgezero#536). KvIdentityGraph keeps the permit and the identity plan and makes one bounded update; a store without it reports Unsupported and the write falls back to last-write-wins. EdgeZero is pinned to the rc/identity commit 9d02d7b3 with #536 merged.

Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
@aram356
aram356 marked this pull request as ready for review November 25, 2026 17:02
This brings in 1f054c6 from #1488, which forwards ortb2.user.ext.eids
from the Prebid config into the auction EIDs, and a99dd66, a62601b,
d1eb75f and 394892b from #1489, which cap mirrored UID expiry at 30
days from the UTC day start and pass the request time into finalize. They
arrive through the chain's merges into #1639, #1640, #1612, #1628, #1623,
#1531, #1532, #1533, #1534, #1536, #1535, #1537, #1539, #1538, #1540,
#1566, #1624, #1641, #1642 and #1646, with #1646's move of the request
time into IdentityApp::finalize. It also brings d5276ee, which publishes
the native AWS runtime files without GNU mv -T, and Christian's merge
5597d3e of #1538 into #1540, through #1566's merge.

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

The merge also brings the 12 #1646 commits this PR lacked, from 48a43ae
to 461aa0d: dhruv8sh's page-phase lookup and /auction EID work
(48a43ae, 82fe088, 1d0a74f, 838586e and his chain merges a061c01,
ecf16e8, e1d23a0, edcf4c5 and 9a020e1), the merge 9cad928 of
#1641 into #1642, and prk-Jr's "Merge providers-awaited into shared
identity" (4ffbaf8) and "Restore Fastly auction browser gating"
(461aa0d).

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

The base now also carries #1506's repin of EdgeZero to rc/identity at
d063a8e7 and its merge of main's Fastly SDK 0.13.3 upgrade (#1671): fastly
0.13.3, url 2.5.9 and Viceroy 0.22.0.

The base now also carries #1627's 4d0c1a2, which renames the generic
runtime KV store to trusted_server_runtime_kv, #1488's a610152 and
9104fd3, which add hashed-email intake for the LiveRamp and ID5
identity providers, and #1646's aa31559, which gates identity writes for
rejected clients.

This PR's head moves to 8478372, which releases every paused
request-time write during drain, through be48eef, its clean merge of
#1646's aa31559. Taken as the change from the old head b8addd3, the
new head would replay #1646 commits the base already carries in rebuilt
form and conflicts in six files. be48eef is a clean merge of
aa31559, which the base has, so the merge takes the change from
be48eef: 8478372's scripts/test-native-ec-image.mjs edit, which
applies cleanly.

The base now also carries #1646's 4f4c036, which expects the failure
router in the native container startup test, and #1488's f063a76,
which lets the hashed-email status call use POST, a body and extra
headers.

scripts/test-native-container.mjs conflicts in the invalid-input check:
4f4c036 lets readiness follow the initialization failure, since the
process keeps serving the failure router, and asserts each input's own
diagnostic, while this PR asserts the missing-secret store message and
matches only a lifecycle ready event. The merge keeps 4f4c036's
diagnostic and ordering checks and this PR's missing-secret check, and the
ordering check finds the ready event with this PR's lifecycle pattern.
#1646's new head 9f648f6 brings #1537's b181544, "Accept any Fastly EC
store link name at startup", which #1537's owner merged up through #1539,
#1538 and #1540. The merge is clean.
Takes #1646's new head 9333826, which carries #1506's repin of EdgeZero to
rc/identity at 459bd27d (42e0c46): PR 275 at 0e2a58ae, the stack's test
fixes and EdgeZero 536's bounded record update, RecordHandle::update.

The merge is clean.
This PR now stacks on #1662 instead of #1641, so rc/identity can take both
as plain merges. #1662's new head (9df0101) sits on #1661, #1656, #1626, #1636,
#1646 and #1642, which sit on #1641, so the merge brings #1642 (awaited
identity lookups and /auction body EIDs), #1646 (Axum identity through the
shared application), #1636 (Axum's after-response drain on #1646's runner),
#1626 (provider opt-outs and legacy EID expiry), #1656 (the configurable
Edge Cookie browser gate), #1661 (refusing EC creation when a trusted JA4
contradicts the User-Agent) and #1662 (EC route acceptance on Fastly and
the mirrored expiry cap), and the identity chain below #1641.

EdgeZero pin: this PR pinned e9a22a70, a preview that merges EdgeZero 536
(RecordHandle::update) into the older rc/identity commit 9d02d7b3. The base
carries #1506's repin to rc/identity at 459bd27d (42e0c46), which merges
EdgeZero 536 itself, so the workspace and Axum manifests, Cargo.lock, the
EdgeZero guide and the native RC guide take the base's pin and text. This
PR's CHANGELOG entry keeps its description of the retry and names the
459bd27d pin.

After-response write: #1646 moved the after-response lookup run from the
Fastly adapter into core's IdentityApp::run_after_response_lookups, so
post_delivery.rs takes the base's call into the identity app. The shared
runner calls this PR's commit_after_response_lookups without logging the
outcome itself, since this PR moves that log line into
commit_after_response_lookups, where it also reports the conflict count.
Each follow-up write still logs one outcome line.

Core test support: #1613 compiles kv_backend's test_support module for the
test-utils feature as well as tests, with each test-only store gated
#[cfg(test)]. This PR's EcKvRecords, RecordBackedEcKv and
ConflictInjectingEcKv doubles, its Race type and the imports only they use
are gated the same way, since test-utils builds lack
KvIdentityGraph::serialize_entry_for_test and use none of them.

Axum drain tests: #1636's after_response_drain_tests fixture store
implements insert but not update. This PR sends the follow-up write through
EcKvStore::update, so the fixture's write fell back to last-write-wins,
skipped the guarded insert that records and holds the write, and four
drain tests failed. The fixture now implements update over its own lookup
and insert with EdgeZero's RecordHandle::update contract: read, plan,
write under the read generation, and re-read after a lost precondition,
ending as StaleRead when the re-read returns the rejected generation or no
row. The follow-up write is guarded again and the drain tests pass.

EC KV store: the imports take this PR's AfterResponseCommit and
AfterResponseRejection and the base's PartnerRegistry and write plan;
Generation is no longer used there.

Page-load write docs: the module comment keeps this PR's sentence that the
graph spends the follow-up permit once, so at most one follow-up update
lands, and #1646's sentence on the auction body EID update.

CHANGELOG: this PR's compare-and-swap retry entry stays first under
Changed, followed by #1661's JA4 entry, #1617's health and readiness entry
and #1506's pin entry.

S2S design logging: this PR adds the `stale_read` outcome and the
`conflicts` count to the after-response write log, and #1488 adds that the
hashed-email call logs one debug line with the reply status or transport
error only. The paragraph keeps both.
@aram356

aram356 commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Round 12 identity realignment: rc/identity is now at db7dce634, and EdgeZero is pinned to its rc/identity at 8a73c097. This branch fast-forwarded from ac73237ff to c1a05d736:

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

PR #1646's new head brings #1535's owner fix that keeps mirrored GPP consent through transient CMP not-ready states (#1678), #1535's move of the consent-update test host to publisher.example.com for the URL-host lint and #1540's allow-domain marks on the deployment guide's reference links. The merge is clean.
PR #1662's new head brings #1535's owner fix that keeps mirrored GPP consent through transient CMP not-ready states (#1678), #1535's move of the consent-update test host to publisher.example.com for the URL-host lint and #1540's allow-domain marks on the deployment guide's reference links. The merge is clean.
aram356 added a commit that referenced this pull request Dec 2, 2026
It brings #1535's owner fix that keeps mirrored GPP consent through transient CMP not-ready states (#1678), #1535's and #1540's URL-host lint fixes, and #1622's move of the new GPP bridge tests into its split test file, carried up to every tip: #1653, #1654, #1655, #1622, #1660, #1666, #1659, #1709, #1710, #1713 and #1557. #1503 is already contained. The octopus tree is the conflict-free union of the tips.
PR #1646'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.
aram356 added a commit that referenced this pull request Dec 2, 2026
It brings #1660's cascade merge of #1506's auction endpoint test host fix.

@prk-Jr prk-Jr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Summary

The bounded retry is correct and well protected. EdgeZero's RecordHandle::update at the pinned 8a73c097 reads, plans, writes under the read generation, and re-reads after a lost precondition. The graph's planner runs against each snapshot, and the permit is spent once. Forcing MAX_AFTER_RESPONSE_ATTEMPTS to 1 fails seven of the new retry tests. Approving. R1 and R2 are real, but this PR's retry does not cause them; details below.

Non-blocking

🤔 thinking

  • The spec says a newer opt-out always supersedes the results. A server opt-out that clears nothing does not. See inline at docs/superpowers/specs/2026-10-30-s2s-eid-collection-design.md:231.

Cross-cutting / body-level findings

  • 📝 R1 and R2 are planner behaviour that predates this PR. The retry only adds the short gap between its read and its CAS. write_plan.rs and the coordinator are unchanged here. Before this PR, the follow-up write already read the row only after the lookups finished. A competing write that lands while the lookups are in flight, which is the long window, is read and merged by the single plan with no conflict at all.
    • R1 without any race: I ran a probe at 33c7a7ab. The row already holds a server opt-out remembered for example-provider with no revocation. The after-response lookup for that provider carries OptOutMemory::Forget and a found UID. write_lookups returns written conflicts=0, stores the UID and removes the opt-out memory. The racing variant gives the same row with conflicts=1.
    • R2: apply_lookups inserts each found record unconditionally (write_plan.rs:184-188). A server refresh that lands during dispatch is therefore overwritten on the first plan as well.
    • Where the fix goes: the fix Christian asks for belongs in plan_write, where it covers both the first plan and the retry. Its tests should include the no-race ordering, where the competing write lands before the first read. A test that only injects the competing write at the CAS would pass while the longer window stays open.
    • Merge condition: I don't think this PR needs to carry that fix. A tracked follow-up is enough, or it can land here if you prefer.
  • 📝 R3 (fallback overwrite) cannot be reached from a built-in adapter. Every production EcKvStore is RecordEcKvStore or LazyRecordEcKvStore. Each maps EdgeZero's KvError::Unsupported to EcKvUpdateError::Unsupported, and EdgeZero returns that only when the record binding is absent, as at edgezero-adapter-axum/src/key_value_store_records.rs:40. Without a binding, the fallback's own read_snapshot fails the same way, so the outcome is failed with no overwrite. I agree it is a trait-contract concern for third-party stores and is non-blocking.
  • 📝 The PR description is out of date with the head.
    • It says EdgeZero is pinned to e9a22a70 and lists Cargo.toml, post_delivery.rs and the EdgeZero guides as changed. At this head the pin comes from the base (8a73c097), and none of those files differ from feat/1598-ec-route-fastly.
    • It still says "Stacked on #1641" and "Stays a draft until IABTechLab/edgezero#536 merges". The CHANGELOG entry is already correct.

CI Status

At 33c7a7ab: 32 checks pass, including cargo test, cargo test (axum native), cargo test (cross-adapter parity), cargo fmt and format-docs. Two are pending: integration tests and integration tests (Fastly EC lifecycle). None fail.

conflict the results are dropped; the source stays due and is retried on the
next navigation.
conflict the row is read again and the update re-planned against it once,
never resending the stale plan: results superseded by a provider opt-out

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤔 thinking: "results superseded by a provider opt-out recorded since dispatch are discarded" holds only for an opt-out that records a revocation. A server opt-out that cleared no UID only installs opt-out memory (write_plan.rs:192-210). A lookup carrying OptOutMemory::Forget then passes both the opted-out check and the revocation check, and it removes that memory.

I reproduced this with no race at all: written conflicts=0, the UID is stored and the opt-out is forgotten. So it is not specific to the retry; see the review body.

Once the planner records a revocation for a newly installed opt-out (Christian's R1), this sentence becomes true. Until then, it and the matching CHANGELOG sentence overstate the guarantee.

PR #1646'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, #1625's shared Wrangler installer for CI, #1639's pull reserve boundary check and wording, #1613's conformance doc alignment, #1616's certificate policy and pull-sync fixture corrections, #1617's preserved startup diagnostics and hardened runtime checks, #1635's complete startup evidence in native fixtures, #1637's shared readable non-Unicode Geo fixture, #1627's Spin store reads and retained runtime coverage and #1535's Sourcepoint consent mirror deduplication and consent update coverage. 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 #1662's new head brings #1662's consent-string comment on the EC route fixture, plus #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, #1625's shared Wrangler installer for CI, #1639's pull reserve boundary check and wording, #1613's conformance doc alignment, #1616's certificate policy and pull-sync fixture corrections, #1617's preserved startup diagnostics and hardened runtime checks, #1635's complete startup evidence in native fixtures, #1637's shared readable non-Unicode Geo fixture, #1627's Spin store reads and retained runtime coverage, #1535's Sourcepoint consent mirror deduplication and consent update coverage, #1636's stronger after-response body and drain checks, #1626's enforcement of stored and carried provider opt-outs, #1656's strict browser gate wording and #1661's grouped QUIC JA4 fixture.

CHANGELOG.md: #1506's repin moved the EdgeZero pin entry to ef5cbf30 with EdgeZero pull request 275 at a3c5f3dd, and #1660 added its after-response retry entry after that line. The resolution keeps #1506's pin entry followed by #1660's entry, whose note that the pinned rc/identity commit carries EdgeZero pull request 536 now names ef5cbf30, which still contains it, in place of 8a73c097.

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.
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 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 33c7a7ab9 to 87c52cd43:

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

prk-Jr and others added 3 commits December 3, 2026 19:34
Require the existing application completion log during drain so a durable
row cannot conceal a lost SDK acknowledgement. Centralize payload, UID
and deadline checks and align startup documentation with the accepted
failure-router policy.

Refs #1579
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.
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): bde4e604c 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 e72905af1, on top of bde4e604c.

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.

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 #1646's new head brings its fix that preserves filter headers through identity finalization, plus #1487's change that strips `ts-eids` from publisher-origin requests unless the operator opts in. The merge is clean.
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 is clean.
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 e72905af1 to 64a1baae3:

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

The head of #1654 brings its record-write drain proof, which also requires the application's INFO after-response write completion between the native draining and stopped lifecycle records. #1660 merges it directly because the two PRs only meet in rc/identity, and the release candidate never carries a fix of its own. The merge is clean.

Semantic fix: #1660 moves the after-response outcome log into commit_after_response_lookups, so the line now comes from trusted_server_core::ec::after_response and reads "After-response lookups: write outcome=written conflicts=<n>". #1654's verifier still expected the ec::app::lookups target and the message without the conflict count, so rc/identity's native container check failed with "after-response application must report INFO written completion during drain". scripts/native-record-verification.mjs now matches the moved line, its unit test fixture uses it, and docs/guide/native-container.md quotes it. The verifier still rejects a failed or no-op write, a wrong target and a wrong level.
aram356 added a commit that referenced this pull request Dec 4, 2026
PR #1660 at 3693ce9 now merges #1654 and points #1654's native record drain verifier at the after-response outcome line #1660 moved into ec::after_response. At 0ed8626 the native container check failed with "after-response application must report INFO written completion during drain". The merge is clean.
@aram356

aram356 commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator

Round 17 follow-up: rc/identity's native container check failed at 0ed862633 with after-response application must report INFO written completion during drain. #1654's new drain proof looks for the after-response outcome line from trusted_server_core::ec::app::lookups with the exact message After-response lookups: write outcome=written. This PR moves that line into commit_after_response_lookups, so it now comes from trusted_server_core::ec::after_response and ends with conflicts=<n>. The two PRs only meet in rc/identity.

This branch fast-forwarded from 64a1baae3 to 3693ce95d:

The merge is clean apart from the fix: scripts/native-record-verification.mjs now matches the moved line, its unit test fixture uses it, and docs/guide/native-container.md quotes it. The verifier still rejects a failed or no-op write, a wrong target and a wrong level. Because of the merge, this PR's diff also shows #1654's scripts and docs until #1654 lands.

@aram356

aram356 commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator

Merged #1614's /_ts/ local answers (48930c270) into this branch as 3b60a8603, on top of 3693ce95d.

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.

Retry an after-response write that loses its CAS

4 participants