Problem
MDI primary mode can reconstruct WordPress from portable Markdown/JSON, but constrained and serverless runtimes currently need to reach into internal classes and rely on PHP shutdown to discover persisted changes. A Cloudflare Workers integration proved canonical Markdown cold restoration, but normal SQL interception and full bootstrap cannot yet be orchestrated through a bounded, explicit runtime contract.
Proposed contract
Add generic primary-runtime APIs that:
- bootstrap MDI in storage-only mode without CLI, recovery, migration, or abilities machinery;
- accept a caller-provided disposable SQLite index cache and identify the canonical manifest/hash it represents;
- explicitly flush pending writes without requiring process shutdown;
- return exact canonical paths created, changed, and deleted;
- support writing a canonical post/option mutation through public MDI APIs;
- keep object-store and Cloudflare concerns outside MDI.
Acceptance criteria
- A fixture canonical root builds or hydrates a disposable SQLite index.
- A normal WordPress post and option mutation can be explicitly flushed.
- The flush result reports deterministic changed/deleted relative paths.
- Destroying SQLite and reopening from the resulting Markdown/JSON reconstructs the mutation.
- Tests prove SQLite is cache machinery and canonical files are sufficient.
- Existing mirror and primary behavior remains compatible.
Context
This is the owning-layer primitive needed by serverless runtimes, offline editing, object-store revision systems, and agent sandboxes. Callers will stage a synchronous filesystem and replicate returned paths themselves.
Problem
MDI primary mode can reconstruct WordPress from portable Markdown/JSON, but constrained and serverless runtimes currently need to reach into internal classes and rely on PHP shutdown to discover persisted changes. A Cloudflare Workers integration proved canonical Markdown cold restoration, but normal SQL interception and full bootstrap cannot yet be orchestrated through a bounded, explicit runtime contract.
Proposed contract
Add generic primary-runtime APIs that:
Acceptance criteria
Context
This is the owning-layer primitive needed by serverless runtimes, offline editing, object-store revision systems, and agent sandboxes. Callers will stage a synchronous filesystem and replicate returned paths themselves.