feat(worker): record merge commit SHA and add revert_merge tool

Persists the merge commit SHA on WorktreeEntity for every successful
single-task and unit merge, and adds a TaskMergeService.RevertMergeAsync
+ revert_merge MCP tool that undoes a merged task's merge via
`git revert -m 1` (never reset/rewrite, since the target checkout is
shared). Rejects cleanly when there's no recorded SHA, the repo is
mid-merge/mid-revert, or the target has foreign uncommitted changes;
a conflicting revert aborts immediately. Also exposes the new
mergeCommit field via get_task_worktree.
This commit is contained in:
mika kuns
2026-08-05 11:46:51 +02:00
parent 6c5acd09b9
commit 10e561f336
14 changed files with 1452 additions and 14 deletions
@@ -16,6 +16,7 @@ public sealed class WorktreeEntity
public required string BaseCommit { get; set; }
public string? HeadCommit { get; set; }
public string? DiffStat { get; set; }
public string? MergeCommit { get; set; }
public WorktreeState State { get; set; } = WorktreeState.Active;
public required DateTime CreatedAt { get; init; }