diff options
| author | Ben Sima <ben@bensima.com> | 2025-11-27 11:06:42 -0500 |
|---|---|---|
| committer | Ben Sima <ben@bensima.com> | 2025-11-27 11:06:42 -0500 |
| commit | 1d8553c5ffd7f2a063078840886acb24153e9854 (patch) | |
| tree | 50731a7d6fdb7702d8b8c5b62ca4bd574a7dd5ac /Omni/Task.hs | |
| parent | 83ff4b622be49762491dac216ab8df374b24cd74 (diff) | |
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
Diffstat (limited to 'Omni/Task.hs')
| -rw-r--r-- | Omni/Task.hs | 43 |
1 files changed, 40 insertions, 3 deletions
diff --git a/Omni/Task.hs b/Omni/Task.hs index 07883ac..8fb49be 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 |
