Skip to content

Make Cloudflare publication and coordination composable#1952

Merged
chubes4 merged 2 commits into
mainfrom
feat/cloudflare-published-reader
Jul 22, 2026
Merged

Make Cloudflare publication and coordination composable#1952
chubes4 merged 2 commits into
mainfrom
feat/cloudflare-published-reader

Conversation

@chubes4

@chubes4 chubes4 commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • serve explicitly promoted anonymous WordPress routes from immutable edge/R2 publication state before constructing a coordinator or booting PHP
  • inject a typed revision-coordinator contract into the shared Worker runtime
  • preserve the existing Durable Object implementation through worker-do.ts
  • add a ChatGPT Sites-compatible worker-d1.ts profile whose D1 table stores only pointer, version, lease, base revision, and expiry metadata
  • keep MDI, disposable SQLite, canonical R2 revisions, uploads, mutable wp-content, and cron behavior unchanged

Publication boundary

POST ?phase=operator-publish validates 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

  • Durable Object: packages/runtime-cloudflare/wrangler.jsonc
  • D1: packages/runtime-cloudflare/wrangler.d1.jsonc

The 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-runtime
  • npm run cloudflare:dry-run
  • npm run cloudflare:dry-run:d1
  • npm run cloudflare:local-gate
  • npm run cloudflare:local-gate:d1

Both 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.

@chubes4
chubes4 merged commit 483353a into main Jul 22, 2026
4 checks passed
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.

1 participant