You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/runtime-cloudflare/README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,15 +16,15 @@ The Worker forwards browser cookies directly to Playground and disables Playgrou
16
16
17
17
The bundled MDI source is pinned to immutable commit `2a8ee7f6a46e1d64b4606f1ee3c97e14032dc96c` from [MDI PR #139](https://github.com/Automattic/markdown-database-integration/pull/139). The bundle generator, worker provenance, and source-contract test use the same revision.
18
18
19
-
WordPress server files and browser assetsare separate deployment artifacts, never Worker-module imports. `generate:cloudflare-wordpress-runtime-corpus`downloads the pinned WordPress release once. It emits a deterministic server ZIP containing only `isWordPressRuntimeFile()` entries and one concatenated browser-asset blob containing the complete supported `wp-admin`, `wp-includes`, and bundled-theme surface. Checked-in manifests record the content-addressed R2 keys, hashes, budgets, and each browser asset's exact byte range. Cold boot validates and streams the server ZIP into PHP MEMFS. Browser requests use one bounded R2 range read, validate the selected bytes, and populate an immutable artifact-versioned Worker cache without fetching or decoding the WordPress release at request time.
19
+
WordPress server files, browser assets, and pinned runtime dependencies are separate deployment artifacts, never Worker-module imports. `generate:cloudflare-wordpress-runtime-corpus` emits a deterministic server ZIP containing only `isWordPressRuntimeFile()` entries, one concatenated browser-asset blob containing the complete supported `wp-admin`, `wp-includes`, and bundled-theme surface, and the pinned SQLite integration ZIP. Checked-in manifests record content-addressed R2 keys, hashes, budgets, provenance, and each browser asset's exact byte range. Cold boot validates and streams the server ZIP into PHP MEMFS while loading SQLite integration from R2. Browser requests use one bounded R2 range read, validate the selected bytes, and populate an immutable artifact-versioned Worker cache. Runtime requests never fetch WordPress or SQLite integration release archives from third-party origins.
20
20
21
21
Canonical Cloudflare boots patch only the assembled PHP MEMFS copy of `/wordpress/wp-settings.php` after the R2 WordPress corpus is materialized and before WordPress executes. The disabled-cron scheduling policy requires exactly one canonical `do_action( 'init' );` needle and fails closed otherwise. When `DISABLE_WP_CRON` is true, it removes only core's `wp_cron`, `wp_schedule_delete_old_privacy_export_files`, and `wp_schedule_update_checks` callbacks through public `remove_action()` before executing the original `init` call once. This prevents browser requests from recreating cron work that cannot execute in the PHP-WASM/MDI shutdown path. Durable cron execution belongs to a separate explicit queue or scheduled-Worker contract.
22
22
## Verification
23
23
24
24
1. Run `npm run generate:cloudflare-canonical-mdi-seed` and `npm run generate:cloudflare-wordpress-runtime-corpus` to regenerate deterministic runtime artifacts and manifests.
25
-
2. Run `npm run provision:cloudflare-wordpress-runtime-corpus -- --local --persist-to <directory>` to verify and upload both exact content-addressed artifacts into isolated local R2 storage. For an authorized deployment, run the provisioner with `--remote` and require both uploads to succeed before deploying the Worker that imports their manifests.
25
+
2. Run `npm run provision:cloudflare-wordpress-runtime-corpus -- --local --persist-to <directory>` to verify and upload all exact content-addressed artifacts into isolated local R2 storage. For an authorized deployment, run the provisioner with `--remote` and require every upload to succeed before deploying the Worker that imports their manifests.
26
26
3. Run `npm run test:cloudflare-runtime` for routing, canonical-state, artifact validation, source contract, and TypeScript coverage.
27
27
4. Run `npm run cloudflare:dry-run` to compile the Worker without creating Cloudflare resources.
28
-
5. Run `npm run cloudflare:local-gate` for isolated local workerd evidence. It generates and provisions both artifacts before workerd starts, then injects stable test-only admin-password and auth-secret values, verifies the login form, cookie-authenticated admin redirect, authenticated REST post publication, public rendering, representative frontend/admin/editor assets, PHP diagnostics, an existing authenticated cookie after cold restart, and a fresh login after restart.
28
+
5. Run `npm run cloudflare:local-gate` for isolated local workerd evidence. It generates and provisions all artifacts before workerd starts, then injects stable test-only admin-password and auth-secret values, verifies the login form, cookie-authenticated admin redirect, authenticated REST post publication, public rendering, representative frontend/admin/editor assets, PHP diagnostics, an existing authenticated cookie after cold restart, and a fresh login after restart.
29
29
30
30
This document describes local candidate verification only. It does not claim remote deployment.
if(manifest.schema!==RUNTIME_ARCHIVE_ARTIFACT_SCHEMA)thrownewError("Runtime archive artifact schema is invalid.")
20
+
if(manifest.key!==runtimeArchiveArtifactKey(manifest.name,manifest.archive.sha256))thrownewError("Runtime archive artifact key is not content addressed.")
21
+
if(!Number.isSafeInteger(manifest.archive.size)||manifest.archive.size<1||manifest.archive.size>RUNTIME_ARCHIVE_MAX_BYTES)thrownewError("Runtime archive artifact size is outside the allowed budget.")
22
+
if(!manifest.source.url.startsWith("https://"))thrownewError("Runtime archive artifact source URL is invalid.")
if(staticActual!==staticManifest.blob.sha256||staticBlob.byteLength!==staticManifest.blob.size||staticManifest.key!==`runtime/wordpress-static/${staticActual}.bin`)thrownewError("Local WordPress static artifact does not match its content-addressed manifest.")
if(sqliteActual!==sqliteManifest.archive.sha256||sqliteArchive.byteLength!==sqliteManifest.archive.size||sqliteManifest.key!==`runtime/archives/sqlite-database-integration/${sqliteActual}.zip`)thrownewError("Local SQLite integration artifact does not match its content-addressed manifest.")
0 commit comments