Problem
The MySQL content backend can make selected posts file-primary through WordPress lifecycle events, but full MDI primary semantics also cover options, users, comments, schemas, and arbitrary plugin tables. Those writes can bypass WordPress content hooks and require successful database-level mutation capture.
This is a later child of #57. It follows the MySQL content backend and does not block it.
Desired Capability
Add a delegating MySQL backend that captures successful mutations at the WordPress database boundary while preserving normal MySQL execution:
WordPress wpdb
-> MDI delegating backend
-> normal MySQL execution
-> normalized successful mutation events
-> canonical persistence core
The backend owns MySQL result normalization, transactions, schema introspection, affected-resource discovery, and mutation capture. The canonical core remains SQL- and database-neutral.
Required Design Evidence
Before implementation, verify the supported deployment boundary for stock WordPress, custom db.php, and managed hosts. The backend must define:
- which direct
$wpdb writes are captured;
- transaction and rollback timing;
- read-after-write behavior;
- schema DDL handling;
- auto-increment identity reconstruction;
- mixed captured/uncaptured deployment behavior;
- operational recovery when canonical persistence fails after MySQL succeeds.
Acceptance Criteria
- Direct plugin
$wpdb DML and DDL mutations produce normalized canonical persistence events after successful execution.
- Failed and rolled-back SQL produces no canonical state change.
- Options, users, comments, taxonomy state, and representative plugin schemas/tables reconstruct from canonical files into an empty supported MySQL database.
- Existing callers observe compatible
wpdb return values, errors, insert IDs, row counts, timing, and query logging.
- Mixed-version deployment behavior is documented and tested.
- Doctor distinguishes full-primary MySQL from content-primary MySQL using capabilities, not mode-name assumptions.
- Hosts that cannot install the required database boundary receive an explicit unsupported result and retain content-primary operation.
- SQLite compatibility remains unchanged.
AI Assistance
OpenAI GPT-5.6 Sol via OpenCode was used to inspect MDI's existing full-state persistence guarantees and draft this issue. Chris Huber directed the architecture and remains responsible for the proposed capability boundary.
Problem
The MySQL content backend can make selected posts file-primary through WordPress lifecycle events, but full MDI primary semantics also cover options, users, comments, schemas, and arbitrary plugin tables. Those writes can bypass WordPress content hooks and require successful database-level mutation capture.
This is a later child of #57. It follows the MySQL content backend and does not block it.
Desired Capability
Add a delegating MySQL backend that captures successful mutations at the WordPress database boundary while preserving normal MySQL execution:
The backend owns MySQL result normalization, transactions, schema introspection, affected-resource discovery, and mutation capture. The canonical core remains SQL- and database-neutral.
Required Design Evidence
Before implementation, verify the supported deployment boundary for stock WordPress, custom
db.php, and managed hosts. The backend must define:$wpdbwrites are captured;Acceptance Criteria
$wpdbDML and DDL mutations produce normalized canonical persistence events after successful execution.wpdbreturn values, errors, insert IDs, row counts, timing, and query logging.AI Assistance
OpenAI GPT-5.6 Sol via OpenCode was used to inspect MDI's existing full-state persistence guarantees and draft this issue. Chris Huber directed the architecture and remains responsible for the proposed capability boundary.