Commit Graph

85 Commits

Author SHA1 Message Date
mika kuns
b9896399fa feat(worker): add PlanningMergeOrchestrator.AbortAsync 2026-04-24 18:18:49 +02:00
mika kuns
7d87c03cfa feat(worker): add PlanningMergeOrchestrator.ContinueAsync to resume merge after conflict
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 18:15:19 +02:00
mika kuns
3142ba203f feat(worker): add PlanningMergeOrchestrator happy path with merge event broadcasts
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 18:08:58 +02:00
mika kuns
389d9045d5 feat(worker): add PlanningAggregator.CleanupIntegrationBranchAsync
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 16:34:25 +02:00
mika kuns
9d04d1d9f6 fix(worker): reorder PlanningAggregator checkout/delete and kill git on cancel
Also stub new IWorkerClient planning members in FakeWorkerClient to restore build.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 16:24:24 +02:00
mika kuns
2cab33d708 feat(worker): add PlanningAggregator.BuildIntegrationBranchAsync 2026-04-24 16:18:45 +02:00
mika kuns
a1727b647c feat(worker): add PlanningAggregator.GetAggregatedDiffAsync
Returns per-subtask diff entries (title, branch, base/head commit, DiffStat, unified diff) for all children of a Planning task in SortOrder order.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 16:08:56 +02:00
mika kuns
bc0f1e3122 feat(worker): add AbortMergeAsync to cancel a conflicted merge 2026-04-24 15:42:15 +02:00
mika kuns
62106ff644 feat(worker): add ContinueMergeAsync to resume a conflicted merge
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 15:17:57 +02:00
mika kuns
e77ba35b0e feat(worker): add leaveConflictsInTree option to TaskMergeService.MergeAsync
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 15:06:33 +02:00
mika kuns
5a03dc8430 feat(worker): broadcast child TaskUpdated events on planning CRUD
So the UI refreshes individual child rows alongside the parent during
create/update/delete/finalize from the planning MCP service.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 14:54:46 +02:00
mika kuns
a5ebfd12f8 test(worker): clean up non-git test tmp dir and assert self-heal setup exit code
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 12:24:01 +02:00
mika kuns
2262ab0e13 test(worker): cover planning worktree lifecycle and self-heal
Adds four tests to PlanningSessionManagerTests: worktree removal on
discard, error on non-git working dir, self-heal when branch already
exists, and resume returning the correct token and session id.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 12:20:29 +02:00
mika kuns
0da527dbbc test(worker): adapt planning tests to git-backed worktree flow
Update constructor calls (6-arg), seed AppSettings with sibling strategy,
git-init working dirs via GitRepoFixture.InitRepoWithInitialCommit, and
replace McpConfigPath assertions with worktree-path / .mcp.json checks.
Also fixes PlanningHubTests which had the same 3-arg constructor.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 12:14:46 +02:00
mika kuns
b7c60f5838 feat(ui): live task updates from worker events + planning polish
Wire TasksIslandViewModel to TaskUpdated/WorktreeUpdated/TaskMessage worker
events so rows refresh without a full reload; add ForegroundHelper to permit
wt.exe to take foreground on planning launch; misc UI polish on lists, task
rows and settings modal.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 11:12:27 +02:00
mika kuns
0782ba574b test(worker): planning session end-to-end 2026-04-23 23:31:01 +02:00
mika kuns
7b67e35720 feat(worker): SignalR hub endpoints for planning sessions 2026-04-23 23:26:12 +02:00
mika kuns
6cb20a9213 feat(worker): map MCP HTTP endpoint and broadcast TaskUpdated
- Add PlanningMcpContextAccessor (Option A) to read PlanningMcpContext
  from HttpContext.Items set by PlanningTokenAuthMiddleware
- Annotate PlanningMcpService with [McpServerToolType]/[McpServerTool]
  and remove PlanningMcpContext ctx parameter from all tool methods
- Broadcast TaskUpdated(parentTaskId) via HubBroadcaster after every
  mutation in PlanningMcpService
- Refactor PlanningSessionManager to accept IDbContextFactory for
  singleton-safe use in DI; keep direct-repo ctor for tests
- Register PlanningSessionManager (singleton), IPlanningTerminalLauncher,
  PlanningMcpContextAccessor, PlanningMcpService, and MCP server in
  Program.cs; wire PlanningTokenAuthMiddleware and MapMcp("/mcp")
- Update PlanningMcpServiceTests with fake HttpContext accessor and
  no-op HubBroadcaster (avoids Moq dependency)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 23:12:24 +02:00
mika kuns
99c6a71e4c feat(worker): MCP tools update_planning_task and finalize 2026-04-23 23:03:42 +02:00
mika kuns
0088d6e0e0 feat(worker): MCP tools for child-task CRUD 2026-04-23 22:57:27 +02:00
mika kuns
43a3740980 feat(worker): WindowsTerminalPlanningLauncher with pre-flight checks 2026-04-23 21:08:15 +02:00
mika kuns
d28164caf4 feat(worker): PlanningSessionManager.GetPendingDraftCountAsync 2026-04-23 21:04:06 +02:00
mika kuns
77f7cf1423 feat(worker): PlanningSessionManager.FinalizeAsync 2026-04-23 21:01:22 +02:00
mika kuns
84e6c2d5fc feat(worker): PlanningSessionManager.DiscardAsync 2026-04-23 20:58:55 +02:00
mika kuns
84b0ba8670 feat(worker): PlanningSessionManager.ResumeAsync 2026-04-23 20:55:01 +02:00
mika kuns
b6bec1e63c feat(worker): PlanningSessionManager.StartAsync
Add PlanningSessionFiles, PlanningSessionStartContext/ResumeContext DTOs,
PlanningSessionManager.StartAsync (file scaffolding + status transition),
and integration tests. Also fix migration discovery by adding [DbContext]
attribute to all migration classes and switch DbFixture to EnsureCreated.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 20:49:41 +02:00
mika kuns
47b49743c0 feat(ui): unfinished planning session dialog
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 19:19:16 +02:00
mika kuns
309f84b388 feat(ui): planning commands and expand/collapse in TasksIslandViewModel
- Add IWorkerClient interface; WorkerClient implements it
- TasksIslandViewModel accepts IWorkerClient? and gains OpenPlanningSession,
  ResumePlanningSession, DiscardPlanningSession, FinalizePlanningSession,
  and ToggleExpand commands
- Regroup() is hierarchy-aware: children of collapsed planning parents are hidden
- InternalsVisibleTo ClaudeDo.Worker.Tests for Regroup()
- 4 new unit tests covering collapse/expand and guard logic

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 18:51:22 +02:00
mika kuns
229d4bbb2b feat(ui): TaskRowViewModel gains planning hierarchy flags
Adds ParentTaskId, IsExpanded, IsChild, IsPlanningParent, IsDraft, and
PlanningBadge to TaskRowViewModel with property-changed notifications.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 18:39:44 +02:00
mika kuns
d4a46420c9 feat(worker): hook TryCompleteParentAsync after MarkDone/MarkFailed
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 18:18:50 +02:00
mika kuns
f704244b84 test(data): parent delete with children is restricted 2026-04-23 18:15:12 +02:00
mika kuns
19bf032a2e test(data): queue skips Planning/Planned/Draft 2026-04-23 18:09:29 +02:00
mika kuns
b7464c9a11 feat(data): TaskRepository.TryCompleteParentAsync 2026-04-23 18:08:14 +02:00
mika kuns
524aaf85af feat(data): TaskRepository.DiscardPlanningAsync 2026-04-23 18:04:40 +02:00
mika kuns
a9e7479326 feat(data): TaskRepository.FinalizePlanningAsync 2026-04-23 18:03:10 +02:00
mika kuns
2e80cc606e feat(data): TaskRepository.FindByPlanningTokenAsync 2026-04-23 17:59:42 +02:00
mika kuns
d099138487 feat(data): TaskRepository.UpdatePlanningSessionIdAsync 2026-04-23 17:58:28 +02:00
mika kuns
2278d97b7e feat(data): TaskRepository.SetPlanningStartedAsync 2026-04-23 17:56:19 +02:00
mika kuns
74255ddc82 feat(data): TaskRepository.CreateChildAsync 2026-04-23 17:54:43 +02:00
mika kuns
b466246c1b feat(data): TaskRepository.GetChildrenAsync 2026-04-23 17:52:51 +02:00
mika kuns
1a10e6fa09 feat(worker): expose RestoreDefaultAgents hub method 2026-04-23 12:18:49 +02:00
mika kuns
990be09bd7 feat(worker): add DefaultAgentSeeder for first-launch agent seeding
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 12:12:55 +02:00
Mika Kuns
a4e313dbad improve Frontend 2026-04-22 17:09:00 +02:00
Mika Kuns
7c312161bb feat(worker): add hub methods for list and task agent settings
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 13:16:46 +02:00
Mika Kuns
480eb0817a feat(data): add TaskRepository.UpdateAgentSettingsAsync 2026-04-22 13:10:21 +02:00
Mika Kuns
1b94fa5c44 feat(data): add ListRepository.DeleteConfigAsync 2026-04-22 13:09:03 +02:00
Mika Kuns
953d93179d fix(worker): honour targetBranch in MergeAsync by checking out before merge
Add GitService.CheckoutBranchAsync; compare targetBranch to current HEAD
before MergeNoFfAsync and switch when they differ. Returns Blocked if the
branch does not exist. Add three new tests (two service, one GitService).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 10:25:35 +02:00
Mika Kuns
1c20d8f846 feat(worker): scaffold TaskMergeService with pre-flight checks 2026-04-22 09:36:16 +02:00
Mika Kuns
77a1460e3a feat(git): add ListConflictedFilesAsync 2026-04-22 09:31:36 +02:00
Mika Kuns
21a1870fd7 feat(git): add MergeAbortAsync 2026-04-22 09:29:24 +02:00