summaryrefslogtreecommitdiff
path: root/Omni/Task
diff options
context:
space:
mode:
authorBen Sima <ben@bensima.com>2025-11-22 16:20:56 -0500
committerBen Sima <ben@bensima.com>2025-11-22 16:20:56 -0500
commit5213e86447768b5a17cae3c8dfba71771ce2a0cb (patch)
treeb798602496ba0c3b66d7a4de6bcc1362d2569128 /Omni/Task
parent6f4b2c97a24967508f3970b46999052fd1f44e67 (diff)
feat: implement t-1o2bxcq7999.2
The task "Add Approved status to Omni/Task" has been implemented. **Changes made:** 1. **`Omni/Task/Core.hs`**: * Updated `Status` enum to include `Approved`. * Updated `TaskStats` record to include `approvedTasks` count. * Updated `getTaskStats` to count `Approved` tasks. * Updated `showTaskStats` to display the count. * Updated `printTreeNode'` and `printTask` to visualize `Approved` status with `[+]` symbol and green color. 2. **`Omni/Task.hs`**: * Updated `help` documentation to list `approved` as a valid status. * Updated `list` command to support filtering by `--status=approved`. * Updated `update` command to support setting status to `approved`. * Added unit tests for the new CLI functionality. **Verification:** * Ran `bild --test Omni/Task.hs` (with `CODEROOT` explicitly set to current directory to bypass build caching issue) and all tests passed. * Manually verified creating a task, updating it to `approved`, showing it, viewing the tree, and viewing stats using the compiled binary. **Note on Build Environment:** * I encountered an issue where `bild` would not rebuild because `CODEROOT` was pointing to `/home/ben/omni` instead of the worker workspace `/home/ben/omni-worker-3`. I temporarily set `export CODEROOT=$(pwd)` to successfully build and verify the changes. The `Approved` status is now fully supported in the Task core and CLI, enabling the review workflow described in the plan.
Diffstat (limited to 'Omni/Task')
-rw-r--r--Omni/Task/Core.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/Omni/Task/Core.hs b/Omni/Task/Core.hs
index bab1912..c52f9bf 100644
--- a/Omni/Task/Core.hs
+++ b/Omni/Task/Core.hs
@@ -42,7 +42,7 @@ data Task = Task
data TaskType = Epic | WorkTask
deriving (Show, Eq, Generic)
-data Status = Open | InProgress | Review | Done
+data Status = Open | InProgress | Review | Approved | Done
deriving (Show, Eq, Generic)
-- Priority levels (matching beads convention)
@@ -518,6 +518,7 @@ showTaskTree maybeId = do
Open -> "[ ]"
InProgress -> "[~]"
Review -> "[?]"
+ Approved -> "[+]"
Done -> "[✓]"
coloredStatusStr = case taskType task of
@@ -526,6 +527,7 @@ showTaskTree maybeId = do
Open -> bold statusStr
InProgress -> yellow statusStr
Review -> magenta statusStr
+ Approved -> green statusStr
Done -> green statusStr
nsStr = case taskNamespace task of
@@ -585,6 +587,7 @@ printTask t = do
Open -> bold s
InProgress -> yellow s
Review -> magenta s
+ Approved -> green s
Done -> green s
coloredTitle = if taskType t == Epic then bold (taskTitle t) else taskTitle t
@@ -695,6 +698,7 @@ data TaskStats = TaskStats
openTasks :: Int,
inProgressTasks :: Int,
reviewTasks :: Int,
+ approvedTasks :: Int,
doneTasks :: Int,
totalEpics :: Int,
readyTasks :: Int,
@@ -730,6 +734,7 @@ getTaskStats maybeEpicId = do
open = length <| filter (\t -> taskStatus t == Open) tasks
inProg = length <| filter (\t -> taskStatus t == InProgress) tasks
review = length <| filter (\t -> taskStatus t == Review) tasks
+ approved = length <| filter (\t -> taskStatus t == Approved) tasks
done = length <| filter (\t -> taskStatus t == Done) tasks
epics = length <| filter (\t -> taskType t == Epic) tasks
readyCount' = readyCount
@@ -752,6 +757,7 @@ getTaskStats maybeEpicId = do
openTasks = open,
inProgressTasks = inProg,
reviewTasks = review,
+ approvedTasks = approved,
doneTasks = done,
totalEpics = epics,
readyTasks = readyCount',
@@ -779,6 +785,7 @@ showTaskStats maybeEpicId = do
putText <| " Open: " <> T.pack (show (openTasks stats))
putText <| " In Progress: " <> T.pack (show (inProgressTasks stats))
putText <| " Review: " <> T.pack (show (reviewTasks stats))
+ putText <| " Approved: " <> T.pack (show (approvedTasks stats))
putText <| " Done: " <> T.pack (show (doneTasks stats))
putText ""
putText <| "Epics: " <> T.pack (show (totalEpics stats))