From 5f29e393a6696c6f1e5ef2394bddd58aab7f8eda Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Sun, 9 Nov 2025 08:24:03 -0500 Subject: Fix task auto-commit with pre-commit hook Implemented proper pre-commit hook that: - Calls 'task export --flush' to consolidate tasks - Auto-stages .tasks/tasks.jsonl if modified - Runs before every commit Added reminder message after 'task update' to inform users that task changes will be committed on next git commit. Updated AGENTS.md to document the auto-commit behavior. This fixes the bug where task status updates (e.g., marking tasks as Done) were not being committed to git. --- .tasks/tasks.jsonl | 2 +- AGENTS.md | 2 ++ Omni/Task.hs | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.tasks/tasks.jsonl b/.tasks/tasks.jsonl index 592d363..8df2508 100644 --- a/.tasks/tasks.jsonl +++ b/.tasks/tasks.jsonl @@ -2,7 +2,7 @@ {"taskCreatedAt":"2025-11-08T20:03:53.429072631Z","taskDependencies":[],"taskId":"t-d4e5f6","taskNamespace":null,"taskParent":null,"taskStatus":"Done","taskTitle":"Move dev instructions from README.md to AGENTS.md","taskType":"WorkTask","taskUpdatedAt":"2025-11-08T20:06:22.732392229Z"} {"taskCreatedAt":"2025-11-08T20:06:27.395834401Z","taskDependencies":[],"taskId":"t-g7h8i9","taskNamespace":null,"taskParent":null,"taskStatus":"Done","taskTitle":"Task ids should be shorter. Use the sqids package in haskell to generate ids","taskType":"WorkTask","taskUpdatedAt":"2025-11-08T21:00:37.311865046Z"} {"taskCreatedAt":"2025-11-08T20:09:35.590622249Z","taskDependencies":[],"taskId":"t-j0k1L2","taskNamespace":null,"taskParent":null,"taskStatus":"Done","taskTitle":"Tasks should have an optional namespace associated with them. Namespaces are first class citizens in this monorepo","taskType":"WorkTask","taskUpdatedAt":"2025-11-09T13:14:05.775741617Z"} -{"taskCreatedAt":"2025-11-08T20:10:09.944217463Z","taskDependencies":[],"taskId":"t-m3n4o5","taskNamespace":null,"taskParent":null,"taskStatus":"Open","taskTitle":"There should be a command to list all projects.","taskType":"WorkTask","taskUpdatedAt":"2025-11-08T20:10:09.944217463Z"} +{"taskCreatedAt":"2025-11-08T20:10:09.944217463Z","taskDependencies":[],"taskId":"t-m3n4o5","taskNamespace":null,"taskParent":null,"taskStatus":"InProgress","taskTitle":"There should be a command to list all projects.","taskType":"WorkTask","taskUpdatedAt":"2025-11-09T13:23:47.847692999Z"} {"taskCreatedAt":"2025-11-08T20:20:38.785442739Z","taskDependencies":[],"taskId":"t-p6q7r8","taskNamespace":null,"taskParent":null,"taskStatus":"Done","taskTitle":"Instruct agents too use git-branchless and a patch based workflow rather than traditional git commands if and when they need to record things in git.","taskType":"WorkTask","taskUpdatedAt":"2025-11-08T21:09:06.854871964Z"} {"taskCreatedAt":"2025-11-08T20:22:20.116289616Z","taskDependencies":[],"taskId":"t-s9T0u1","taskNamespace":null,"taskParent":null,"taskStatus":"Done","taskTitle":"instruct agents to include tests with all new features and bug fixes","taskType":"WorkTask","taskUpdatedAt":"2025-11-08T21:24:54.004658966Z"} {"taskCreatedAt":"2025-11-08T20:45:12.764939794Z","taskDependencies":[],"taskId":"t-v2w3x4","taskNamespace":null,"taskParent":null,"taskStatus":"Done","taskTitle":"instruct agents to run 'bild --test' and 'lint' for whatever namespace(s) they are working on after completing a task and fix any reported errors","taskType":"WorkTask","taskUpdatedAt":"2025-11-08T21:25:10.756670871Z"} diff --git a/AGENTS.md b/AGENTS.md index 3cd9aa7..c07d8ed 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -88,6 +88,8 @@ task update t-20241108120000 in-progress task update t-20241108120000 done ``` +**Note**: Task updates modify `.tasks/tasks.jsonl` but don't auto-commit. The pre-commit hook will automatically export and stage task changes on your next `git commit`. + ### View Dependencies ```bash task deps diff --git a/Omni/Task.hs b/Omni/Task.hs index ae854a7..0aca674 100644 --- a/Omni/Task.hs +++ b/Omni/Task.hs @@ -153,6 +153,8 @@ move args _ -> panic "Invalid status. Use: open, in-progress, or done" updateTaskStatus tid newStatus putStrLn <| "Updated task " <> T.unpack tid + -- Remind user to commit changes (pre-commit hook will auto-export) + putText "Note: Task changes will be committed automatically on your next git commit." | args `Cli.has` Cli.command "deps" = do tid <- getArgText args "id" showDependencyTree tid -- cgit v1.2.3