fix: content-create names the Divi layout when its write fails (S50)

A failing Divi layout write discarded the draft with the fields/terms
message (REASON_EXTRAS); it now passes NewDraft::REASON_LAYOUT (ledger T9).

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-26 18:35:59 +02:00
co-authored by Claude Opus 5.5
parent 267e5d2076
commit d5a9774241
3 changed files with 6 additions and 1 deletions
@@ -13,6 +13,7 @@ use LIT\MCP\Integrations\Divi\Pages\DiviContentComposer;
use LIT\MCP\Integrations\Divi\Pages\DiviSaver;
use LIT\MCP\Integrations\WordPress\Content\ContentComposer;
use LIT\MCP\Integrations\WordPress\Content\ContentCreateAbility;
use LIT\MCP\Integrations\WordPress\Content\NewDraft;
use LIT\MCP\Integrations\WordPress\Content\PostWriter;
use LIT\MCP\Integrations\WordPress\Schema\ContentSchema;
use LIT\MCP\Tests\Support\DiviWriterFixture;
@@ -168,6 +169,9 @@ final class ContentCreateDiviTest extends TestCase
self::fail('WriteFailed expected');
} catch (WriteFailed $e) {
self::assertTrue($e->rolledBack);
// Ruling S50 / ledger T9: the client reads about the layout, not about fields or terms.
self::assertSame(NewDraft::REASON_LAYOUT, $e->reason);
self::assertStringContainsString('Divi-Layout', $e->reason);
}
}