refactor: rename for intent (L3)

PostChangeResult is PostSaveFollowUp (the after-save pipeline, not a
result); DiviChange::changed() is record() (moved nodes are recorded but
not touched). cleanValue/withoutControls were renamed in wave 2.

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:32:18 +02:00
co-authored by Claude Opus 5.5
parent d2c5e82d63
commit 9ed5d9d2fa
20 changed files with 39 additions and 39 deletions
@@ -9,7 +9,7 @@ use LIT\MCP\Abilities\Errors;
use LIT\MCP\Abilities\Rev;
use LIT\MCP\Abilities\ToolResult;
use LIT\MCP\ChangeLog\ChangeLog;
use LIT\MCP\Integrations\WordPress\PostChangeResult;
use LIT\MCP\Integrations\WordPress\PostSaveFollowUp;
use LIT\MCP\Integrations\WordPress\PostGuard;
use LIT\MCP\Integrations\WordPress\Schema\ContentSchema;
use Throwable;
@@ -216,7 +216,7 @@ final class ContentCreateAbility implements Ability
private function result(int $postId, string $postType, array $input, array $warnings, ?string $outline): array
{
// The draft is saved – failures from here on are logged and reported as warnings only.
$change = (new PostChangeResult($this->name(), $this->log, $postId, 'der Entwurf', $warnings))
$change = (new PostSaveFollowUp($this->name(), $this->log, $postId, 'der Entwurf', $warnings))
->afterSave($input);
$post = $change->reread();
$title = $post instanceof WP_Post ? (string) $post->post_title : (string) $input['title'];
@@ -11,7 +11,7 @@ use LIT\MCP\Abilities\Rollback;
use LIT\MCP\Abilities\ToolResult;
use LIT\MCP\Abilities\WriteFailed;
use LIT\MCP\ChangeLog\ChangeLog;
use LIT\MCP\Integrations\WordPress\PostChangeResult;
use LIT\MCP\Integrations\WordPress\PostSaveFollowUp;
use LIT\MCP\Integrations\WordPress\PostGuard;
use LIT\MCP\Integrations\WordPress\PostRow;
use LIT\MCP\Integrations\WordPress\RevisionPoint;
@@ -179,7 +179,7 @@ final class ContentUpdateAbility implements Ability
$postType = (string) $post->post_type;
// The change is saved – failures from here on are logged and reported as warnings only.
$change = (new PostChangeResult($this->name(), $this->log, $postId, 'die Änderung', $warnings))
$change = (new PostSaveFollowUp($this->name(), $this->log, $postId, 'die Änderung', $warnings))
->afterSave($input);
$updated = $change->reread($post) ?? $post;
$changedKeys = array_keys(array_intersect_key($input, array_flip(self::CHANGE_KEYS)));
@@ -16,7 +16,7 @@ use WP_Post;
* failure must not turn the saved change into an error – listener and log failures are
* logged and reported as warnings ("… ist gespeichert").
*/
final class PostChangeResult
final class PostSaveFollowUp
{
/** @var list<string> */
private array $warnings;
@@ -9,7 +9,7 @@ use LIT\MCP\Abilities\Errors;
use LIT\MCP\Abilities\Rev;
use LIT\MCP\Abilities\ToolResult;
use LIT\MCP\ChangeLog\ChangeLog;
use LIT\MCP\Integrations\WordPress\PostChangeResult;
use LIT\MCP\Integrations\WordPress\PostSaveFollowUp;
use LIT\MCP\Integrations\WordPress\PostGuard;
use LIT\MCP\Integrations\WordPress\RevisionPoint;
use LIT\MCP\Integrations\WordPress\Schema\ContentSchema;
@@ -129,7 +129,7 @@ final class RevisionRestoreAbility implements Ability
}
// The restore is saved – failures from here on are logged and reported as warnings only.
$change = (new PostChangeResult($this->name(), $this->log, $postId))->afterSave($input, 'Wiederherstellen');
$change = (new PostSaveFollowUp($this->name(), $this->log, $postId))->afterSave($input, 'Wiederherstellen');
$updated = $change->reread($post) ?? $post;
$summary = sprintf('"%s" auf Stand vom %s zurückgesetzt', $updated->post_title, $revision->post_date);
$postType = (string) $post->post_type;
@@ -7,7 +7,7 @@ namespace LIT\MCP\Integrations\WordPress\Status;
use LIT\MCP\Abilities\Ability;
use LIT\MCP\Abilities\ToolResult;
use LIT\MCP\ChangeLog\ChangeLog;
use LIT\MCP\Integrations\WordPress\PostChangeResult;
use LIT\MCP\Integrations\WordPress\PostSaveFollowUp;
use LIT\MCP\Integrations\WordPress\PostGuard;
use LIT\MCP\Integrations\WordPress\Schema\ContentSchema;
use WP_Error;
@@ -87,7 +87,7 @@ final class PostDuplicateAbility implements Ability
$copyId = $this->cloner->duplicate($original);
// The copy is saved – failures from here on are logged and reported as warnings only.
$change = (new PostChangeResult($this->name(), $this->log, $copyId, 'die Kopie'))
$change = (new PostSaveFollowUp($this->name(), $this->log, $copyId, 'die Kopie'))
->afterSave($input, 'Anlegen der Kopie');
$copy = $change->reread();
$copyTitle = $copy instanceof WP_Post ? (string) $copy->post_title : '';
@@ -9,7 +9,7 @@ use LIT\MCP\Abilities\Errors;
use LIT\MCP\Abilities\Rev;
use LIT\MCP\Abilities\ToolResult;
use LIT\MCP\ChangeLog\ChangeLog;
use LIT\MCP\Integrations\WordPress\PostChangeResult;
use LIT\MCP\Integrations\WordPress\PostSaveFollowUp;
use LIT\MCP\Integrations\WordPress\PostGuard;
use LIT\MCP\Integrations\WordPress\Schema\ContentSchema;
use WP_Error;
@@ -120,7 +120,7 @@ final class PostPublishAbility implements Ability
}
// The status change is saved – failures from here on are logged and reported as warnings only.
$change = (new PostChangeResult($this->name(), $this->log, $postId))->afterSave($input, 'Veröffentlichen');
$change = (new PostSaveFollowUp($this->name(), $this->log, $postId))->afterSave($input, 'Veröffentlichen');
$change->log((string) $post->post_type, sprintf('"%s" veröffentlicht', $title));
return $change->result(sprintf('"%s" ist jetzt veröffentlicht.', $title), $change->reread($post))
@@ -11,7 +11,7 @@ use LIT\MCP\Abilities\Rev;
use LIT\MCP\Abilities\ToolResult;
use LIT\MCP\Abilities\WriteFailed;
use LIT\MCP\ChangeLog\ChangeLog;
use LIT\MCP\Integrations\WordPress\PostChangeResult;
use LIT\MCP\Integrations\WordPress\PostSaveFollowUp;
use LIT\MCP\Integrations\WordPress\PostGuard;
use LIT\MCP\Integrations\WordPress\RevisionPoint;
use LIT\MCP\Integrations\WordPress\Schema\ContentSchema;
@@ -222,7 +222,7 @@ final class PostReplaceWithCopyAbility implements Ability
$warnings[] = $trashWarning;
}
$change = (new PostChangeResult($this->name(), $this->log, $originalId, 'die Änderung', $warnings))
$change = (new PostSaveFollowUp($this->name(), $this->log, $originalId, 'die Änderung', $warnings))
->afterSave($input);
$title = PostCloner::withoutSuffix((string) $copy->post_title);
$summary = sprintf('Kopie ID %d in "%s" (ID %d) übernommen', $copyId, $title, $originalId);
@@ -10,7 +10,7 @@ use LIT\MCP\Abilities\Ability;
use LIT\MCP\Abilities\Errors;
use LIT\MCP\Abilities\ToolResult;
use LIT\MCP\ChangeLog\ChangeLog;
use LIT\MCP\Integrations\WordPress\PostChangeResult;
use LIT\MCP\Integrations\WordPress\PostSaveFollowUp;
use LIT\MCP\Integrations\WordPress\PostGuard;
use LIT\MCP\Integrations\WordPress\Schema\ContentSchema;
use WP_Error;
@@ -142,7 +142,7 @@ final class PostScheduleAbility implements Ability
$raw
)]
: [];
$change = (new PostChangeResult($this->name(), $this->log, $postId, 'die Änderung', $warnings))
$change = (new PostSaveFollowUp($this->name(), $this->log, $postId, 'die Änderung', $warnings))
->afterSave($input, 'Planen');
$title = (string) $post->post_title;
$summary = sprintf('"%s" geplant für %s', $title, $raw)
@@ -9,7 +9,7 @@ use LIT\MCP\Abilities\Errors;
use LIT\MCP\Abilities\Rev;
use LIT\MCP\Abilities\ToolResult;
use LIT\MCP\ChangeLog\ChangeLog;
use LIT\MCP\Integrations\WordPress\PostChangeResult;
use LIT\MCP\Integrations\WordPress\PostSaveFollowUp;
use LIT\MCP\Integrations\WordPress\PostGuard;
use LIT\MCP\Integrations\WordPress\Schema\ContentSchema;
use WP_Error;
@@ -137,7 +137,7 @@ final class PostTrashAbility implements Ability
}
// The change is saved – a failure of the change log from here on is a warning only.
$change = (new PostChangeResult($this->name(), $this->log, $postId, 'die Änderung', $impact))
$change = (new PostSaveFollowUp($this->name(), $this->log, $postId, 'die Änderung', $impact))
->log((string) $post->post_type, sprintf('"%s" in den Papierkorb gelegt', $title));
$summary = sprintf('"%s" liegt im Papierkorb und ist dort wiederherstellbar.', $title);
@@ -9,7 +9,7 @@ use LIT\MCP\Abilities\Errors;
use LIT\MCP\Abilities\Rev;
use LIT\MCP\Abilities\ToolResult;
use LIT\MCP\ChangeLog\ChangeLog;
use LIT\MCP\Integrations\WordPress\PostChangeResult;
use LIT\MCP\Integrations\WordPress\PostSaveFollowUp;
use LIT\MCP\Integrations\WordPress\PostGuard;
use LIT\MCP\Integrations\WordPress\Schema\ContentSchema;
use WP_Error;
@@ -103,7 +103,7 @@ final class PostUnpublishAbility implements Ability
}
// The status change is saved – failures from here on are logged and reported as warnings only.
$change = (new PostChangeResult($this->name(), $this->log, $postId))->afterSave($input, 'Zurückziehen');
$change = (new PostSaveFollowUp($this->name(), $this->log, $postId))->afterSave($input, 'Zurückziehen');
$summary = sprintf('"%s" zurückgezogen (vorher %s, jetzt Entwurf)', $title, $post->post_status);
$change->log((string) $post->post_type, $summary);
$updated = $change->reread($post) ?? $post;