summaryrefslogtreecommitdiff
path: root/Omni/Task/Core.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2025-11-20 16:43:14 -0500
committerBen Sima <ben@bsima.me>2025-11-20 16:43:14 -0500
commit01a6ed7b7bc217c5774f5665a946c1bd3898b52e (patch)
tree4f201a875c4425edeb833aca9a35f1cfcccecd7a /Omni/Task/Core.hs
parent8e2b5b0aeb00d74727237a0f3c37901b4335c2d7 (diff)
chore: task breakdown and cleanup
- Updated Omni/Task/Core.hs to filter parent tasks from 'task ready' - Broke down 'PodcastItLater: Path to Paid Product' into 5 subtasks - Broke down 'General Code Quality Refactor' into 3 subtasks - Broke down 'Complete comprehensive test suite' into 2 subtasks - Fixed namespace naming in tasks.jsonl
Diffstat (limited to 'Omni/Task/Core.hs')
-rw-r--r--Omni/Task/Core.hs11
1 files changed, 9 insertions, 2 deletions
diff --git a/Omni/Task/Core.hs b/Omni/Task/Core.hs
index af105de..f7b7915 100644
--- a/Omni/Task/Core.hs
+++ b/Omni/Task/Core.hs
@@ -246,15 +246,22 @@ listTasks maybeType maybeParent maybeStatus maybeNamespace = do
filterByNamespace Nothing ts = ts
filterByNamespace (Just ns) ts = filter (\t -> taskNamespace t == Just ns) ts
--- Get ready tasks (not blocked by dependencies)
+-- Get ready tasks (not blocked by dependencies and not a parent)
getReadyTasks :: IO [Task]
getReadyTasks = do
allTasks <- loadTasks
let openTasks = filter (\t -> taskStatus t /= Done) allTasks
doneIds = map taskId <| filter (\t -> taskStatus t == Done) allTasks
+
+ -- Find all tasks that act as parents
+ parentIds = mapMaybe taskParent allTasks
+ isParent tid = tid `elem` parentIds
+
-- Only Blocks and ParentChild dependencies block ready work
blockingDepIds task = [depId dep | dep <- taskDependencies task, depType dep `elem` [Blocks, ParentChild]]
- isReady task = all (`elem` doneIds) (blockingDepIds task)
+ isReady task =
+ not (isParent (taskId task))
+ && all (`elem` doneIds) (blockingDepIds task)
pure <| filter isReady openTasks
-- Get dependency tree for a task (returns tasks)