fix: trashed backup before replace, byte-exact meta copy, partial rollback

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01At3V6SjwbMe6eMzVGW3Hs7
This commit is contained in:
2026-09-25 23:34:13 +02:00
co-authored by Claude Opus 5.5
parent 4fed69cf65
commit e183874ff7
7 changed files with 490 additions and 152 deletions
@@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
namespace LIT\MCP\Integrations\WordPress\Status;
use RuntimeException;
use Throwable;
/**
* Thrown by PostCloner::replace(). $parts lists the parts of the original replace()
* had started to write (post, meta, terms) – only those need to be restored.
*/
final class ReplaceFailed extends RuntimeException
{
/** @param list<string> $parts */
public function __construct(public readonly array $parts, Throwable $previous)
{
parent::__construct($previous->getMessage(), 0, $previous);
}
}