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:
@@ -175,7 +175,8 @@ public class DetailsIslandPlanningTests : IDisposable
|
||||
ctx.Tasks.Add(new TaskEntity
|
||||
{
|
||||
Id = parentId, ListId = listId, Title = "Parent",
|
||||
Status = TaskStatus.Planning, CreatedAt = DateTime.UtcNow,
|
||||
Status = TaskStatus.Idle, PlanningPhase = PlanningPhase.Active,
|
||||
CreatedAt = DateTime.UtcNow,
|
||||
});
|
||||
ctx.Tasks.Add(new TaskEntity
|
||||
{
|
||||
@@ -199,7 +200,8 @@ public class DetailsIslandPlanningTests : IDisposable
|
||||
|
||||
// Bind triggers BindAsync → LoadPlanningChildrenAsync → GetMergeTargetsAsync
|
||||
var parentRow = new TaskRowViewModel { Id = parentId };
|
||||
parentRow.Status = TaskStatus.Planning;
|
||||
parentRow.Status = TaskStatus.Idle;
|
||||
parentRow.PlanningPhase = PlanningPhase.Active;
|
||||
vm.Bind(parentRow);
|
||||
|
||||
// Wait for the background load to settle
|
||||
|
||||
@@ -49,7 +49,8 @@ public class TasksIslandRegroupTests : IDisposable
|
||||
TaskStatus parentStatus,
|
||||
TaskStatus childStatus,
|
||||
string parentId = "p1",
|
||||
string childId = "c1")
|
||||
string childId = "c1",
|
||||
PlanningPhase parentPhase = PlanningPhase.None)
|
||||
{
|
||||
await using var db = NewContext();
|
||||
var list = new ListEntity
|
||||
@@ -67,6 +68,7 @@ public class TasksIslandRegroupTests : IDisposable
|
||||
Title = "Parent",
|
||||
CreatedAt = DateTime.UtcNow,
|
||||
Status = parentStatus,
|
||||
PlanningPhase = parentPhase,
|
||||
SortOrder = 0,
|
||||
});
|
||||
db.Tasks.Add(new TaskEntity
|
||||
@@ -110,7 +112,7 @@ public class TasksIslandRegroupTests : IDisposable
|
||||
public async Task VirtualQueued_QueuedChildOfPlanningParent_IsNotStandaloneRow()
|
||||
{
|
||||
await SeedPlanningWithChildAsync(
|
||||
parentStatus: TaskStatus.Planning,
|
||||
parentStatus: TaskStatus.Idle, parentPhase: PlanningPhase.Active,
|
||||
childStatus: TaskStatus.Queued,
|
||||
parentId: "p1",
|
||||
childId: "c1");
|
||||
@@ -126,7 +128,7 @@ public class TasksIslandRegroupTests : IDisposable
|
||||
public async Task VirtualQueued_PlannedParentWithQueuedChild_ParentIsStandaloneRow_ChildIsNot()
|
||||
{
|
||||
await SeedPlanningWithChildAsync(
|
||||
parentStatus: TaskStatus.Planned,
|
||||
parentStatus: TaskStatus.Idle, parentPhase: PlanningPhase.Finalized,
|
||||
childStatus: TaskStatus.Queued,
|
||||
parentId: "p1",
|
||||
childId: "c1");
|
||||
@@ -142,7 +144,7 @@ public class TasksIslandRegroupTests : IDisposable
|
||||
public async Task VirtualRunning_RunningChildOfPlanningParent_IsNotStandaloneRow()
|
||||
{
|
||||
await SeedPlanningWithChildAsync(
|
||||
parentStatus: TaskStatus.Planning,
|
||||
parentStatus: TaskStatus.Idle, parentPhase: PlanningPhase.Active,
|
||||
childStatus: TaskStatus.Running,
|
||||
parentId: "p1",
|
||||
childId: "c1");
|
||||
@@ -158,7 +160,7 @@ public class TasksIslandRegroupTests : IDisposable
|
||||
public async Task Done_ChildOfOpenPlanningParent_StaysNestedUnderParent()
|
||||
{
|
||||
await SeedPlanningWithChildAsync(
|
||||
parentStatus: TaskStatus.Planning,
|
||||
parentStatus: TaskStatus.Idle, parentPhase: PlanningPhase.Active,
|
||||
childStatus: TaskStatus.Done,
|
||||
parentId: "p1",
|
||||
childId: "c1");
|
||||
|
||||
Reference in New Issue
Block a user