diff --git a/docs/superpowers/plans/2026-06-09-unify-parent-task-model-plan.md b/docs/superpowers/plans/2026-06-09-unify-parent-task-model-plan.md index 4cd24b9..f67caf7 100644 --- a/docs/superpowers/plans/2026-06-09-unify-parent-task-model-plan.md +++ b/docs/superpowers/plans/2026-06-09-unify-parent-task-model-plan.md @@ -37,16 +37,37 @@ Build with `-c Release` per project. Commit per task (Conventional Commits). ## Task 4 — Approve merges the whole unit -- `WorkerHub.ApproveReview` (+ MCP `ReviewTask` approve): if the task has children, - invoke `PlanningMergeOrchestrator` (parent worktree if `Active` + each `Done` child - in order) then transition parent → `Done`; on child conflict keep `WaitingForReview` - and surface the conflicting child. If no children, keep the existing - `TaskMergeService.ApproveAndMergeAsync` path. -- Retire `WorkerHub.MergeAllPlanning` + its UI button/command and any now-dead - orchestrator entry that only `MergeAllPlanning` used (keep the orchestrator itself). -- Sync test fakes for `IWorkerClient`/`WorkerHub` if signatures changed. -- Tests: approving a parent with two `Done` children merges both then sets `Done`; - a conflicting second child keeps the parent in `WaitingForReview`. +**Decision: full UX consolidation.** Approve becomes the single entry for reviewing +*and* merging any task; the separate planning-merge views are folded into the review +panel. The `PlanningMergeOrchestrator` (which already merges the unit + sets the +parent `Done` for both planning and improvement, with conflict continue/abort) is +reused as the engine; only its *entry/UI* moves. + +Backend: +- `WorkerHub.ApproveReview`: for a parent that **has children**, drive + `PlanningMergeOrchestrator.StartAsync` (event-based: `PlanningMergeStarted` / + `PlanningSubtaskMerged` / `PlanningMergeConflict` / `PlanningMergeAborted` / + `PlanningCompleted`) instead of the one-shot `ApproveAndMergeAsync`. Childless tasks + keep `ApproveAndMergeAsync`. Conflict resolution still goes through + `ContinuePlanningMerge` / `AbortPlanningMerge`. +- Keep the orchestrator, `ContinuePlanningMerge`, `AbortPlanningMerge`, + `GetPlanningAggregate`, `BuildPlanningIntegrationBranch`. Remove the now-redundant + standalone `MergeAllPlanning` hub method (approve is the entry). +- (Optional cleanup) route the orchestrator's `FinalizeParentDoneAsync` through + `TaskStateService` so `Status` writes stay centralized; low priority. + +UI (Avalonia, MVVM — visual-verification gaps, flag for user): +- The review panel (`DetailsIslandViewModel` / its view) is the single approve+merge + surface. For a child-bearing parent in `WaitingForReview`, approve shows the + unit-merge progress + per-subtask state, the aggregate/integration diff preview, and + conflict continue/abort — all inline in the review panel. +- Remove the separate planning-merge view(s)/commands and the standalone "Merge all" + button; re-wire their `PlanningMerge*` event handlers into the review panel VM. +- Sync `IWorkerClient` + hand-rolled test fakes in both UI/Worker test projects. + +Tests: approving a parent with two `Done` children merges both then sets `Done`; a +conflicting second child surfaces the conflict and pauses (continue/abort) without +losing the parent's `WaitingForReview`/merge state. ## Task 5 — Cancellable `WaitingForChildren` parent diff --git a/docs/superpowers/specs/2026-06-09-unify-parent-task-model-design.md b/docs/superpowers/specs/2026-06-09-unify-parent-task-model-design.md index 7ca3199..858faa8 100644 --- a/docs/superpowers/specs/2026-06-09-unify-parent-task-model-design.md +++ b/docs/superpowers/specs/2026-06-09-unify-parent-task-model-design.md @@ -39,9 +39,12 @@ UX is explicitly out of scope. - **All parents get review.** A planning parent now surfaces in `WaitingForReview` after its children finish, instead of auto-completing to `Done`. -- **Approve merges the whole unit.** Approving a parent merges the parent worktree - (if any) + all `Done` children in order, reusing `PlanningMergeOrchestrator`. The - standalone `MergeAllPlanning` button is retired (folded into approve). +- **Approve merges the whole unit — full UX consolidation.** Approve is the single + entry for reviewing *and* merging any task. For a parent with children it drives the + existing `PlanningMergeOrchestrator` (unit merge + parent→`Done` + conflict + continue/abort, all already implemented); the standalone "Merge All" button is + removed and the orchestrator's conflict dialog + combined-diff preview are reused + in-place. Childless tasks keep `ApproveAndMergeAsync`. - **Scope = state model + code paths.** Internal refactor; authoring UX and child base-commit resolution are unchanged.