Skip to content

Reduce Cloudflare SSI runtime memory#2013

Open
chubes4 wants to merge 5 commits into
mainfrom
ops/bottomless-wordpress-production
Open

Reduce Cloudflare SSI runtime memory#2013
chubes4 wants to merge 5 commits into
mainfrom
ops/bottomless-wordpress-production

Conversation

@chubes4

@chubes4 chubes4 commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • generate a deterministic Cloudflare website-import runtime from pinned Static Site Importer 1.3.4
  • retain SSI, normal website dependencies, and Blocks Engine PHP transformer runtime
  • exclude Figma-only sources, fixtures, tests, tools, docs, and duplicate package trees
  • remove whole-archive copies during SHA-256 verification and ZIP decoding
  • publish cache-safe permanent WordPress redirects alongside HTML responses
  • drive importer source, package profile, WordPress bootstrap, ability aliases, limits, and persistence exclusions from a generic runtime component descriptor

Production root cause

Worker version aa0c5b5c-db2c-4859-9d8a-8fcf858fc26a repeatedly terminated operation ccea2c23-8f80-4bc4-a37a-dcb5a21049a9 at booting-runtime with Cloudflare outcome: exceededMemory. The pinned SSI release ZIP was 13,056,371 bytes and expanded to 46,814,537 bytes, including two large Figma/fixture package trees not used by the website-artifact API.

The generated runtime is 1,739,484 bytes and expands to 5,754,679 bytes. It remains content-addressed and records the exact pinned release URL, version, commit identity, and source archive digest.

Worker version e3a7bf29-e350-4fd6-b4f4-4bd6ef194a50, deployed from 1926925d, recovered the same operation without replacing its canonical input. Attempt 5 completed SSI, created five editable pages with zero quality violations, and committed canonical revision 62603de9-3a25-4e1e-9592-6e10f9a51c71 at coordinator version 37.

Publication then exposed a second owning-layer gap: WordPress rendered /website/ as a permanent redirect, while the incremental compiler accepted only 200 text/html. Commit 7eab0401 aligns compilation with the persisted publication schema by accepting only cache-safe 301/308 responses with Location; cookie-bearing responses, temporary redirects, and non-HTML success responses remain rejected.

Addresses the production blocker in #1975.
Fixes #2039.

Verification

  • npm run test:cloudflare-runtime
  • npm run cloudflare:dry-run:d1
  • npm run cloudflare:local-gate:d1

The complete D1 gate passes SSI import, zero fallback/core HTML/freeform/invalid blocks, Gutenberg editability, canonical MDI persistence, immutable R2 publication, cold restart, and two-site isolation with the filtered runtime. The runtime test directly covers accepted HTML, 301, and 308 responses and rejects JSON, 302, missing-location, and cookie-bearing responses.

Runtime core, Worker code, corpus generation, provisioning, and canonical persistence contain no SSI names or paths. The deployment descriptor selects SSI through its public package profile and ability. The descriptor-driven corpus remains byte-identical at 1,739,484 bytes with SHA-256 c5aa5c2ef67503ed94c7b249b2bf102630f279f985ece44245df83169fa75e27.

Homeboy deployed exact pushed revision 7eab0401b72434141d2b1529c27016024687fcfb as Worker version 2dc9d0ba-9a24-4534-afe6-40b254fcaa2d; health, D1 state, and existing-publication gates passed. The previously stalled job advanced through /website/ and promoted publication revision 9c712153-bc56-4cd3-ba1c-8f484a8a95c8. Operation ccea2c23-8f80-4bc4-a37a-dcb5a21049a9 is now succeeded at 100%, proving the memory and permanent-redirect recovery paths in production.

The imported learner is not final acceptance evidence yet: the published root is the API document instead of the declared overview entrypoint, and nested pages redirect under /index/website/. Direct transformer reproduction identified the separate upstream cause in Automattic/blocks-engine#691: inferred entry roles promote every nested */index.html document to an entrypoint. WP Codebox publication recovery is complete; exact learner routing remains tracked upstream rather than being hidden with an artifact-shape workaround.

AI assistance

OpenAI gpt-5.6-sol via OpenCode generated the architecture learner corpus, diagnosed the production Worker memory termination and publication redirect failure, implemented the filtered runtime, copy removal, and redirect policy, and ran deterministic local and production verification with Chris Huber. Chris remains responsible for the submitted changes.

@chubes4

chubes4 commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator Author

Upstream package ownership is now separated from the Cloudflare consumer.

SSI now declares a deployment-neutral static-site-importer/runtime-package-manifest/v1 with a website-artifact-import profile and exposes the same contract through static-site-importer/get-runtime-package-manifest. WP Codebox's reusable selector accepts any owner-namespaced */runtime-package-manifest/v1; only this corpus generator chooses SSI's named profile.

The pinned SSI 1.3.4 source predates the manifest, so its existing selector is retained only behind the exact source SHA-256. Any other manifest-free archive fails closed. Once a release containing PR #722 is pinned, that migration branch can be removed.

Verification after the consumer change:

  • npm run test:cloudflare-runtime
  • npm run cloudflare:dry-run:d1
  • npm run cloudflare:local-gate:d1
  • Real corpus generation reproduced the deployed SSI archive exactly: 1,739,484 bytes, SHA-256 c5aa5c2ef67503ed94c7b249b2bf102630f279f985ece44245df83169fa75e27.
  • D1 local gate imported two editable pages with zero fallback, core/html, freeform, or invalid blocks and completed publication plus two-site isolation.

No deployment was performed.

@chubes4

chubes4 commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator Author

Nested index route repair is now merged upstream:

The downstream release chain remains explicit: publish a PHP transformer release containing that commit, update/release Static Site Importer against it, then pin that SSI release here and rerun the five-route learner acceptance. No production deployment is implied.

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.

Drive Cloudflare runtime components from generic descriptors

1 participant