Problem
The custom content-layout move path stages the replacement, deletes the old canonical file, and only then renames the staged file into place. If the final rename fails, the old file has already been removed and the staged file is discarded, leaving no canonical copy.
Relevant implementation: WP_Markdown_Storage::write_profile_post() in inc/class-wp-markdown-storage.php, around lines 910-924.
This violates the canonical durability contract required by the database-independent engine in #232.
Required outcome
- Make custom-layout moves recoverable across the old-path and new-path publication boundary.
- Preserve at least one complete canonical copy when publication or cleanup fails.
- Bind staging and commit to the same verified destination directory identity.
- Keep path indexing and changed-path receipts consistent with the terminal filesystem state.
- Add deterministic failure injection around destination publication and old-path cleanup.
Acceptance criteria
- A failed destination rename leaves the original canonical post intact.
- A successful move leaves exactly one canonical post at the selected route and removes the stale route.
- Retry after an interrupted move converges without content loss or duplicate durable identities.
- Directory replacement between staging and commit fails closed.
AI assistance
GPT-5.6 Sol via OpenCode reviewed the custom-layout publication sequence, identified the delete-before-publish failure mode, and helped structure this issue and its acceptance criteria. Chris Huber directed the review and issue creation.
Problem
The custom content-layout move path stages the replacement, deletes the old canonical file, and only then renames the staged file into place. If the final rename fails, the old file has already been removed and the staged file is discarded, leaving no canonical copy.
Relevant implementation:
WP_Markdown_Storage::write_profile_post()ininc/class-wp-markdown-storage.php, around lines 910-924.This violates the canonical durability contract required by the database-independent engine in #232.
Required outcome
Acceptance criteria
AI assistance
GPT-5.6 Sol via OpenCode reviewed the custom-layout publication sequence, identified the delete-before-publish failure mode, and helped structure this issue and its acceptance criteria. Chris Huber directed the review and issue creation.