refactor(data): retire legacy TaskStatus values and backfill existing rows
Slice 6 of the worker state and queue consolidation refactor. * Drop Manual, Planning, Planned, Draft, Waiting from the TaskStatus enum and from the EF value converter; only the lifecycle values remain (Idle, Queued, Running, Done, Failed, Cancelled). * Add migration RetireLegacyTaskStatus that rewrites existing rows: manual/draft -> idle, planning -> idle+planning_phase=active, planned -> idle+planning_phase=finalized, waiting -> queued+blocked_by derived from sort_order via a CTE with LAG(). * Reroute every call site that compared/set legacy values to the new three-field model (Status + PlanningPhase + BlockedByTaskId), including the planning repo helpers, MCP services, the planning chain coordinator, and the UI view-models. TaskRowViewModel now exposes PlanningPhase to drive the planning badge. * Refresh Worker/CLAUDE.md and Data/CLAUDE.md, the docs/plan.md status section, and the planning verification notes in docs/open.md.
This commit is contained in:
@@ -219,10 +219,11 @@ Requires Plan B (worker hub endpoints) merged. Until then, only the UI structure
|
||||
3. Ask Claude to create two child tasks via `mcp__claudedo__create_child_task`.
|
||||
4. Watch the UI: drafts appear indented under the parent, italic, reduced opacity, with a `DRAFT` badge.
|
||||
5. The parent shows a `PLANNING` badge. Click the chevron → children collapse; click again → children expand.
|
||||
6. Ask Claude to `finalize` — drafts flip to Manual/Queued children; parent flips to `PLANNED` badge.
|
||||
6. Ask Claude to `finalize` — children move to `Queued` (first) and `Queued + BlockedBy` (rest); parent's `PlanningPhase` flips from `Active` to `Finalized` (`PLANNED` badge). The first child must reach `Running` automatically — no manual `WakeQueue` needed (regression-tested in `PlanningEndToEndTests`).
|
||||
7. In a new planning task, close the terminal without finalize. Right-click the Planning task → the unfinished-session modal opens with Resume / Finalize now / Discard.
|
||||
8. Attempt to delete a parent with children via the details panel — confirm the friendly error dialog appears and the task is NOT deleted.
|
||||
|
||||
**Known followups (non-blocking):**
|
||||
- `Border.badge.planned` style (blue) is defined in `IslandStyles.axaml` but never applied — `TaskRowView` keeps the `planning` class for both Planning and Planned, so Planned gets the amber badge. Either make the view swap `Classes.planned` when status is Planned, or remove the unused style + brush.
|
||||
- `Border.badge.planned` style (blue) is defined in `IslandStyles.axaml` but never applied — `TaskRowView` keeps the `planning` class for both `PlanningPhase=Active` and `Finalized`, so a finalized parent gets the amber badge. Either make the view swap `Classes.planned` when `PlanningPhase` is `Finalized`, or remove the unused style + brush.
|
||||
- Dead `Instance` statics on `BoolToItalicConverter` and `BoolToDraftOpacityConverter` — App.axaml registers instances via the resource dictionary; the static members can be removed.
|
||||
- `Ui.Tests` `IWorkerClient` fakes (`DetailsIslandPlanningTests`, `PlanningDiffViewModelTests`, `ConflictResolutionViewModelTests`) miss `OpenInteractiveTerminalAsync` and `QueuePlanningSubtasksAsync` — pre-existing constructor-drift; rebase fakes onto a shared abstract base.
|
||||
|
||||
@@ -49,7 +49,9 @@ Schema in 3NF. Keine Mehrwert-Felder (z.B. JSON-Arrays), keine transitiven Abhä
|
||||
- `list_id` TEXT NOT NULL REFERENCES `lists(id)` ON DELETE CASCADE
|
||||
- `title` TEXT NOT NULL
|
||||
- `description` TEXT NULL
|
||||
- `status` TEXT NOT NULL — `manual` | `queued` | `running` | `done` | `failed` (`running` bleibt persistiert für Crash-Recovery: stale `running`-Tasks werden beim Worker-Start auf `failed` gesetzt)
|
||||
- `status` TEXT NOT NULL — Lifecycle-only: `idle` | `queued` | `running` | `done` | `failed` | `cancelled` (`running` bleibt persistiert für Crash-Recovery: stale `running`-Tasks werden beim Worker-Start auf `failed` gesetzt). Planungs-Hierarchie und Chain-Blocking laufen über zwei separate Felder.
|
||||
- `planning_phase` TEXT NOT NULL DEFAULT `'none'` — Parent-only Marker: `none` | `active` (Planung läuft) | `finalized` (Plan committed, Children existieren). Ein Parent kann `status='idle'` sein und gleichzeitig `planning_phase='finalized'` (für Re-Runs).
|
||||
- `blocked_by_task_id` TEXT NULL REFERENCES `tasks(id)` ON DELETE SET NULL — Vorgänger in einem sequenziellen Subtask-Chain. Ein `queued`-Row mit `blocked_by_task_id IS NOT NULL` wird vom Picker übersprungen.
|
||||
- `scheduled_for` TIMESTAMP NULL — "nicht vor"
|
||||
- `result` TEXT NULL (Markdown)
|
||||
- `log_path` TEXT NULL — Pfad zur ndjson-Log-Datei
|
||||
|
||||
Reference in New Issue
Block a user