From 028bbda4282515b95a7555209d397aaf22d32244 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Thu, 20 Nov 2025 18:07:12 -0500 Subject: feat: implement t-PpYZt2 --- Omni/Task.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Omni/Task.hs') diff --git a/Omni/Task.hs b/Omni/Task.hs index d1e672a..10136c9 100644 --- a/Omni/Task.hs +++ b/Omni/Task.hs @@ -312,7 +312,13 @@ unitTests = ready <- getReadyTasks -- Both should be ready since Related doesn't block (taskId task1 `elem` map taskId ready) Test.@?= True - (taskId task2 `elem` map taskId ready) Test.@?= True + (taskId task2 `elem` map taskId ready) Test.@?= True, + Test.unit "child task gets sequential ID" <| do + parent <- createTask "Parent" Epic Nothing Nothing P2 [] + child1 <- createTask "Child 1" WorkTask (Just (taskId parent)) Nothing P2 [] + child2 <- createTask "Child 2" WorkTask (Just (taskId parent)) Nothing P2 [] + taskId child1 Test.@?= taskId parent <> ".1" + taskId child2 Test.@?= taskId parent <> ".2" ] -- | Test CLI argument parsing to ensure docopt string matches actual usage -- cgit v1.2.3 From cb37c2632cf945c1993d8b338abb1ce35899d5de Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Thu, 20 Nov 2025 18:15:16 -0500 Subject: feat: implement t-PpYZt2 --- Omni/Task.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Omni/Task.hs') diff --git a/Omni/Task.hs b/Omni/Task.hs index 10136c9..9b89a1d 100644 --- a/Omni/Task.hs +++ b/Omni/Task.hs @@ -318,7 +318,12 @@ unitTests = child1 <- createTask "Child 1" WorkTask (Just (taskId parent)) Nothing P2 [] child2 <- createTask "Child 2" WorkTask (Just (taskId parent)) Nothing P2 [] taskId child1 Test.@?= taskId parent <> ".1" - taskId child2 Test.@?= taskId parent <> ".2" + taskId child2 Test.@?= taskId parent <> ".2", + Test.unit "grandchild task gets sequential ID" <| do + parent <- createTask "Grandparent" Epic Nothing Nothing P2 [] + child <- createTask "Parent" Epic (Just (taskId parent)) Nothing P2 [] + grandchild <- createTask "Grandchild" WorkTask (Just (taskId child)) Nothing P2 [] + taskId grandchild Test.@?= taskId parent <> ".1.1" ] -- | Test CLI argument parsing to ensure docopt string matches actual usage -- cgit v1.2.3 From 9a256f5c8232713ee99cb78093434a32c304e192 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Thu, 20 Nov 2025 19:12:52 -0500 Subject: feat: implement t-PpYZt2 --- Omni/Task.hs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Omni/Task.hs') diff --git a/Omni/Task.hs b/Omni/Task.hs index 9b89a1d..6624b31 100644 --- a/Omni/Task.hs +++ b/Omni/Task.hs @@ -323,7 +323,14 @@ unitTests = parent <- createTask "Grandparent" Epic Nothing Nothing P2 [] child <- createTask "Parent" Epic (Just (taskId parent)) Nothing P2 [] grandchild <- createTask "Grandchild" WorkTask (Just (taskId child)) Nothing P2 [] - taskId grandchild Test.@?= taskId parent <> ".1.1" + taskId grandchild Test.@?= taskId parent <> ".1.1", + Test.unit "siblings of grandchild task get sequential ID" <| do + parent <- createTask "Grandparent" Epic Nothing Nothing P2 [] + child <- createTask "Parent" Epic (Just (taskId parent)) Nothing P2 [] + grandchild1 <- createTask "Grandchild 1" WorkTask (Just (taskId child)) Nothing P2 [] + grandchild2 <- createTask "Grandchild 2" WorkTask (Just (taskId child)) Nothing P2 [] + taskId grandchild1 Test.@?= taskId parent <> ".1.1" + taskId grandchild2 Test.@?= taskId parent <> ".1.2" ] -- | Test CLI argument parsing to ensure docopt string matches actual usage -- cgit v1.2.3 From 946ebcfbb2b19e7469c9519c231736563a6b6fb6 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Thu, 20 Nov 2025 19:15:41 -0500 Subject: feat: implement t-PpYZt2 --- Omni/Task.hs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'Omni/Task.hs') diff --git a/Omni/Task.hs b/Omni/Task.hs index 6624b31..24e528b 100644 --- a/Omni/Task.hs +++ b/Omni/Task.hs @@ -330,7 +330,29 @@ unitTests = grandchild1 <- createTask "Grandchild 1" WorkTask (Just (taskId child)) Nothing P2 [] grandchild2 <- createTask "Grandchild 2" WorkTask (Just (taskId child)) Nothing P2 [] taskId grandchild1 Test.@?= taskId parent <> ".1.1" - taskId grandchild2 Test.@?= taskId parent <> ".1.2" + taskId grandchild2 Test.@?= taskId parent <> ".1.2", + Test.unit "child ID generation skips gaps" <| do + parent <- createTask "Parent with gaps" Epic Nothing Nothing P2 [] + child1 <- createTask "Child 1" WorkTask (Just (taskId parent)) Nothing P2 [] + -- Manually create a task with .3 suffix to simulate a gap (or deleted task) + let child3Id = taskId parent <> ".3" + child3 = Task + { taskId = child3Id, + taskTitle = "Child 3", + taskType = WorkTask, + taskParent = Just (taskId parent), + taskNamespace = Nothing, + taskStatus = Open, + taskPriority = P2, + taskDependencies = [], + taskCreatedAt = taskCreatedAt child1, + taskUpdatedAt = taskUpdatedAt child1 + } + saveTask child3 + + -- Create a new child, it should get .4, not .2 + child4 <- createTask "Child 4" WorkTask (Just (taskId parent)) Nothing P2 [] + taskId child4 Test.@?= taskId parent <> ".4" ] -- | Test CLI argument parsing to ensure docopt string matches actual usage -- cgit v1.2.3