refactor: PostChangeResult for the after-save block of the post tools

after_save hook, re-read, change log and ToolResult (rev, log_id, warnings)
were repeated in nine post abilities; they now share one helper. Behaviour
and warning texts are unchanged.

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 01:22:34 +02:00
co-authored by Claude Opus 5.5
parent d831cf59ca
commit e57b53d0e5
15 changed files with 231 additions and 191 deletions
@@ -96,7 +96,7 @@ final class ContentCreateAbilityTest extends TestCase
Actions\expectDone('lit_mcp_after_save')->once()->with(42, 'lit/content-create', $input);
$post = $this->stubResultLinks();
$log = Mockery::mock(ChangeLog::class);
$log->expects('record')->with('lit/content-create', 'lit_person', '42', 'Entwurf "Anna" angelegt')->andReturn(7);
$log->expects('record')->with('lit/content-create', 'lit_person', '42', 'Entwurf "Anna" angelegt', null)->andReturn(7);
$result = (new ContentCreateAbility($schema, $writer, $log))->execute($input);