← Back to task

Commit 1d8553c5

commit 1d8553c5ffd7f2a063078840886acb24153e9854
Author: Ben Sima <ben@bensima.com>
Date:   Thu Nov 27 11:06:42 2025

    Add verification checklist to task completion workflow
    
    The implementation is complete. Here's what I added:
    
    1. **`--verified` flag** to `task update <id> done --verified`
    command 2. **Verification checklist warning** shown when marking a
    task Done wit
       - Code compiles (bild succeeds) - Tests pass (bild --test) -
       Feature works in production (manual verification)
    3. **Activity logging** records `{"verified":true}` in the task
    activity 4. **JSON output enhancement** includes `"verified": true`
    in the respon 5. **CLI tests** for the new `--verified` flag parsing
    
    Task-Id: t-152.2

diff --git a/Omni/Task.hs b/Omni/Task.hs
index 07883acb..8fb49bed 100644
--- a/Omni/Task.hs
+++ b/Omni/Task.hs
@@ -47,7 +47,7 @@ Usage:
   task list [options]
   task ready [--json]
   task show <id> [--json]
-  task update <id> <status> [options]
+  task update <id> <status> [options] [--verified]
   task deps <id> [--json]
   task tree [<id>] [--json]
   task progress <id> [--json]
@@ -91,6 +91,7 @@ Options:
   --flush                       Force immediate export
   --json                        Output in JSON format (for agent use)
   --quiet                       Non-interactive mode (for agents)
+  --verified                    Mark task as verified (code compiles, tests pass, feature works)
   -i <file>                     Input file for import
   -o <file>                     Output file for export
 
@@ -303,6 +304,7 @@ move' args
   | args `Cli.has` Cli.command "update" = do
       tid <- getArgText args "id"
       statusStr <- getArgText args "status"
+      let isVerified = args `Cli.has` Cli.longOption "verified"
 
       -- Handle update dependencies
       deps <- do
@@ -327,10 +329,30 @@ move' args
             "done" -> Done
             _ -> panic "Invalid status. Use: open, in-progress, review, approved, or done"
 
+      -- Show verification checklist warning when marking Done without --verified
+      when (newStatus == Done && not isVerified && not (isJsonMode args)) <| do
+        putText ""
+        putText "⚠️  VERIFICATION CHECKLIST (use --verified to skip):"
+        putText "   [ ] Code compiles (bild succeeds)"
+        putText "   [ ] Tests pass (bild --test)"
+        putText "   [ ] Feature works in production (manual verification)"
+        putText ""
+
       updateTaskStatus tid newStatus deps
+
+      -- Record verification in activity log if verified
+      when (newStatus == Done && isVerified)
+        <| logActivity tid Completed (Just "{\"verified\":true}")
+
       if isJsonMode args
-        then outputSuccess <| "Updated task " <> tid
-        else putStrLn <| "Updated task " <> T.unpack tid
+        then
+          if newStatus == Done && isVerified
+            then outputJson <| Aeson.object ["success" Aeson..= True, "message" Aeson..= ("Updated task " <> tid), "verified" Aeson..= True]
+            else outputSuccess <| "Updated task " <> tid
+        else
+          if newStatus == Done && isVerified
+            then putStrLn <| "Updated task " <> T.unpack tid <> " (verified ✓)"
+            else putStrLn <| "Updated task " <> T.unpack tid
   | args `Cli.has` Cli.command "deps" = do
       tid <- getArgText args "id"
       if isJsonMode args
@@ -768,6 +790,21 @@ cliTests =
           Right args -> do
             args `Cli.has` Cli.command "update" Test.@?= True
             args `Cli.has` Cli.longOption "json" Test.@?= True,
+      Test.unit "update with --verified flag" <| do
+        let result = Docopt.parseArgs help ["update", "t-abc123", "done", "--verified"]
+        case result of
+          Left err -> Test.assertFailure <| "Failed to parse 'update --verified': " <> show err
+          Right args -> do
+            args `Cli.has` Cli.command "update" Test.@?= True
+            args `Cli.has` Cli.longOption "verified" Test.@?= True,
+      Test.unit "update with --verified and --json flags" <| do
+        let result = Docopt.parseArgs help ["update", "t-abc123", "done", "--verified", "--json"]
+        case result of
+          Left err -> Test.assertFailure <| "Failed to parse 'update --verified --json': " <> show err
+          Right args -> do
+            args `Cli.has` Cli.command "update" Test.@?= True
+            args `Cli.has` Cli.longOption "verified" Test.@?= True
+            args `Cli.has` Cli.longOption "json" Test.@?= True,
       Test.unit "deps command" <| do
         let result = Docopt.parseArgs help ["deps", "t-abc123"]
         case result of