Make Cloudflare publication and coordination composable#1952
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
worker-do.tsworker-d1.tsprofile whose D1 table stores only pointer, version, lease, base revision, and expiry metadatawp-content, and cron behavior unchangedPublication boundary
POST ?phase=operator-publishvalidates already-rendered anonymous routes at one canonical revision, writes an immutable publication descriptor, and promotes one strongly consistent R2 pointer. Published cache hits and R2 reads occur before coordinator construction. Authenticated, preview, admin, REST, and unpublished routes continue through WordPress.Coordinator profiles
packages/runtime-cloudflare/wrangler.jsoncpackages/runtime-cloudflare/wrangler.d1.jsoncThe D1 profile contains no Durable Object binding or migration. Its database is coordination metadata, not the WordPress database. The implementation selects the adapter explicitly at its entrypoint; the runtime does not inspect ambient bindings.
Verification
npm run test:cloudflare-runtimenpm run cloudflare:dry-runnpm run cloudflare:dry-run:d1npm run cloudflare:local-gatenpm run cloudflare:local-gate:d1Both complete local gates prove bootstrap, concurrent canonical writes, login/editor, posts/media, plugin installation, restart recovery, coordinator-free publication reads, scheduled callbacks, and duplicate suppression through their selected coordinator. The D1 database ID in the checked-in profile is intentionally a local/dry-run placeholder; the deploying implementation supplies its provisioned binding.