Persist functional WordPress state in Cloudflare#1886
Conversation
|
Cloudflare deployment orchestration is tracked in Extra-Chill/homeboy-extensions#2303. This PR is the first consumer: exact-revision deploy, login/publish/assets gate, same-revision redeploy, and MDI/R2 reconstruction proof. |
|
Remote deployment evidence for exact commit
Root cause: first boot converts the SQLite seed to canonical MDI files and then starts the canonical runtime inside one Durable Object isolate. The fix is to package a prebuilt canonical MDI seed so cold bootstrap creates only one PHP-WASM runtime from canonical files; SQLite remains disposable. Remote durability claims remain blocked until login/publish/redeploy passes. |
|
Follow-up remote evidence for exact commit
The remaining architectural issue is hosting PHP-WASM inside the Durable Object. The next correction keeps PHP-WASM in the entry Worker and restores the DO to a lightweight global lease/current-pointer CAS coordinator. Canonical MDI/R2 state and the prebuilt seed remain unchanged. |
|
Remote evidence for exact commit
The remaining memory source is the selected WordPress filesystem: the predicate currently includes every file under |
|
Remote evidence for exact commit
MEMFS overhead plus PHP-WASM still makes 53.7 MB too large. The next boundary keeps only server-executed PHP/templates/metadata in PHP MEMFS and serves individual static CSS/JS/font/image requests by exact bounded Range extraction from the WordPress archive. WordPress script concatenation will be disabled so browser assets do not need to live in PHP memory. |
|
Remote evidence for exact commit
The boot-critical dependency is now external multi-range assembly of 1,810 WordPress files. The correction moves the filtered server corpus into a deterministic deployment artifact stored in R2. Worker boot will stream one R2 object into MEMFS; browser assets remain lazy exact-range/cache requests. |
Final verification updateThe diagnostic-free head
Two independent infrastructure/tooling gaps remain tracked:
No diagnostic routes or R2 stage artifacts from the investigation remain in the final Worker. |
|
Dev-rig and corpus repair pushed in What changed
Verification
No production deployment was performed. |
…ounded-browser # Conflicts: # package-lock.json
Production deployment evidenceExact head
One login-form request during cold reconstruction returned a transient |
Summary
Run a functional WordPress site in a Cloudflare Worker with PHP-WASM in the entry Worker, a lightweight Durable Object lease/CAS coordinator, canonical Markdown/JSON state in R2, and disposable reconstructed SQLite.
The runtime supports WordPress login,
wp-admin, the block editor, authenticated publishing, public rendering, browser assets, serialized concurrent mutations, and cold reconstruction.What changed
WordPressStateCoordinatorExact-head verification
Verified after merging current
mainat05b9ba19:npm installand workspace build: passednpm run test:cloudflare-runtime: 18 passednpm run test:cloudflare-wordpress-archive-corpus: passed against the real WordPress archivenpm run test:runtime-php-snippets: passednpm run test:agent-task-contracts: passednpm run cloudflare:dry-run: passed; 22,574.94 KiB / gzip 8,212.79 KiBkimaki tunnel --port 8792 -- npm run cloudflare:local-gate: passed under Wrangler/workerdThe full gate proves login, authenticated dashboard, real block editor, two serialized concurrent canonical mutations, authenticated REST publication, public post rendering, frontend/admin/editor CSS and JavaScript, static response semantics, Worker stop/start, persisted post recovery, and authenticated-session recovery.
The exact head is deployed at https://wp-codebox-cloudflare-runtime.chubes.workers.dev/. Live validation proved login, dashboard, editor, authenticated publication, public rendering, bounded browser assets, and recovery of the newly published post across two additional exact-revision deployments.
Architecture
Compatibility
Cloudflare runtime state changes from isolate-local mutable state to serialized canonical MDI revisions in R2. Existing health, state, synthetic mutation, and bounded boot-probe routes remain. The token-protected operator reset route is additive. No public package API is removed.
Source relationships
AI assistance
openai/gpt-5.6-sol