summaryrefslogtreecommitdiff
path: root/Omni/Task
AgeCommit message (Collapse)Author
2025-12-02System prompt improvementsBen Sima
Worked with Gemini and Opus to improve the system prompt with learnings from the Amp prompt. Removed reference to Omni/Task/README.md because it is deprecated in favor of `jr task`.
2025-12-01Sort ready queue by priorityBen Sima
getReadyTasks now returns tasks sorted by: 1. Priority (P0 first, then P1, P2, etc.) 2. Creation time (oldest first within same priority) This ensures high-priority items are always at the top of both the CLI 'jr task ready' output and the web dashboard. Task-Id: t-220
2025-12-01Replace HumanTask type with NeedsHelp statusBen Sima
- Remove HumanTask from TaskType enum (now Epic | WorkTask only) - Add NeedsHelp to Status enum for tasks requiring human guidance - Update getReadyTasks to filter NeedsHelp instead of HumanTask - Rename humanTasks to tasksNeedingHelp in HumanActionItems - Add CLI parsing for needs-help status in list/update commands - Add badge styling for NeedsHelp (amber/yellow theme) - Update all status pattern matches in tree view and print functions - Update tests to verify NeedsHelp exclusion from ready queue Task-Id: t-210
2025-12-01Add actor tracking for status changes and use unified timelineBen Sima
- updateTaskStatusWithActor logs status_change events to agent_events - Worker uses Junior actor for status changes - Jr review uses System/Human actors appropriately - CLI task update uses Human actor - Remove task_activity table schema (migrated to agent_events) - addComment now inserts into agent_events with event_type='comment' Task-Id: t-213
2025-12-01Add actor column to agent_events tableBen Sima
- Add 'actor' column to agent_events table (human/junior/system) - Add System to CommentAuthor type (reused for actor) - Add SQL FromField/ToField instances for CommentAuthor - Update insertAgentEvent to accept actor parameter - Update all SELECT queries to include actor column - Update Worker.hs to pass actor for all event types - Guardrail events logged with System actor Migration: ALTER TABLE adds column with default 'junior' for existing rows. Task-Id: t-213.1
2025-12-01Add guardrails and progress tracking to Jr agentBen Sima
Implement runtime guardrails in Engine.hs: - Cost budget limit (default 200 cents) - Token budget limit (default 1M tokens) - Duplicate tool call detection (same tool called N times) - Test failure counting (bild --test failures) Add database-backed progress tracking: - Checkpoint events stored in agent_events table - Progress summary retrieved on retry attempts - Improved prompts emphasizing efficiency and autonomous operation Worker.hs improvements: - Uses guardrails configuration - Reports guardrail violations via callbacks - Better prompt structure for autonomous operation Task-Id: t-203
2025-12-01Add author field to task comments (Human vs Junior)Ben Sima
Comments now track whether they were made by a Human or by Junior (the agent). The CommentAuthor type is stored in the database and displayed in the web UI with styled badges. Task-Id: t-201
2025-12-01Show complexity in task detail viewBen Sima
Excellent! The implementation is complete and all tests pass. Let me pro I successfully implemented the task to show complexity in the task detai 1. **File Modified**: `Omni/Task/Core.hs` 2. **Function**: `showTaskDetailed` 3. **Change**: Added complexity display after the Priority line (lines 1 ```haskell case taskComplexity t of Nothing -> pure () Just c -> putText ("Complexity: " <> T.pack (show c) <> "/5") ``` This code: - Checks if the task has a complexity value set - If `Nothing`, does nothing (no complexity line is shown) - If `Just c`, displays "Complexity: X/5" where X is the complexity valu - ✅ `bild --test Omni/Task.hs` passed successfully - ✅ `lint Omni/Task/Core.hs` passed with no hlint warnings or errors - ✅ All existing tests continue to pass The implementation matches the exact specification provided in the task Task-Id: t-196
2025-11-30Add agent observability: event logging and storageBen Sima
- Add Omni/Agent/Event.hs with AgentEvent types - Add agent_events table schema and CRUD functions to Core.hs - Add new callbacks to Engine.hs: onAssistant, onToolResult, onComplete, onError - Wire event logging into Worker.hs with session tracking Events are now persisted to SQLite for each agent work session, enabling visibility into agent reasoning and tool usage. Task-Id: t-197.1 Task-Id: t-197.2 Task-Id: t-197.3
2025-11-30Fix task loading - column order mismatch in SQL queryBen Sima
The fix is complete. I added the missing `complexity` column to the `loa ```sql SELECT id, title, type, parent, namespace, status, priority, complexity, ``` This matches the expected column order in the `FromRow Task` instance at Task-Id: t-195
2025-11-30Remove amp dependency entirelyBen Sima
The build and tests pass. Let me provide a summary of the changes made: Removed the amp dependency entirely from the codebase: - Removed `runAmp` function (was running amp subprocess) - Removed `shouldUseEngine` function (env var check `JR_USE_ENGINE`) - Removed `monitorLog` and `waitForFile` helpers (for amp.log parsing) - Removed unused imports: `System.IO`, `Data.Text.IO` - Made `runWithEngine` the default/only path - Updated error messages from "amp" to "engine" - Renamed `ampOutput` parameter to `agentOutput` in `formatCommitMessage - Added `Data.IORef` import for `newIORef`, `modifyIORef'`, `readIORef` - Removed amp.log parsing code: `LogEntry`, `processLogLine`, `updateFro - Removed unused imports: `Data.Aeson`, `Data.ByteString.Lazy`, `Data.Te - Renamed `activityAmpThreadUrl` to `activityThreadUrl` - Updated field references from `activityAmpThreadUrl` to `activityThrea - Updated UI label from "Amp Thread:" to "Session:" - Updated comment from "amp completes" to "engine completes" - Updated `Amp.execute` to `Engine.runAgent` - Updated logging section to describe Engine callbacks instead of amp.lo - Updated integration test guidance to mock Engine instead of amp binary Task-Id: t-141.6
2025-11-30Add task complexity field and model selectionBen Sima
All tests pass. Let me summarize the changes made: - Added `taskComplexity :: Maybe Int` field to the `Task` data type (1-5 - Updated SQL schema to include `complexity INTEGER` column - Updated `FromRow` and `ToRow` instances to handle the new field - Updated `tasksColumns` migration spec for automatic schema migration - Updated `saveTask` to include complexity in SQL INSERT - Updated `createTask` signature to accept `Maybe Int` for complexity - Added `--complexity=<c>` option to the docopt help string - Added complexity parsing in `create` command (validates 1-5 range) - Added complexity parsing in `edit` command - Updated `modifyFn` in edit to handle complexity updates - Updated all unit tests to use new `createTask` signature with complexi - Added CLI tests for `--complexity` flag parsing - Added unit tests for complexity field storage and persistence - Updated `selectModel` to use `selectModelByComplexity` based on task c - Added `selectModelByComplexity :: Maybe Int -> Text` function with map - `Nothing` or 3-4 → `anthropic/claude-sonnet-4-20250514` (default) - 1-2 → `anthropic/claude-haiku` (trivial/low complexity) - 5 → `anthropic/claude-opus-4-20250514` (expert complexity) - Updated `createTask` calls to include `Nothing` for complexity Task-Id: t-141.5
2025-11-29Expand intervention page to show all human action itemsBen Sima
All tests pass and lint is clean. The implementation is complete: **Changes made:** 1. **Omni/Task/Core.hs:** - Added `EpicForReview` data type to hold epic with progress info - Added `HumanActionItems` data type to group all three categories - Added `getHumanActionItems` function that returns: - `failedTasks`: Tasks with retry_attempt >= 3 - `epicsInReview`: Epics where all children are Done (and has at le - `humanTasks`: HumanTask type tasks in Open status 2. **Omni/Jr/Web.hs:** - Updated `InterventionPage` data type to use `HumanActionItems` - Updated `interventionHandler` to call `getHumanActionItems` - Rewrote `ToHtml InterventionPage` to show 3 sections with headers - Added `renderEpicReviewCard` for epic review cards with "Approve & - Renamed navbar link from "Intervention" to "Human Action" Task-Id: t-193.5
2025-11-29Sort /blocked page by blocking impact (transitive dependents)Ben Sima
All tests pass. The implementation is complete: **Summary of changes:** 1. **Omni/Task/Core.hs** - Added helper functions: - `getBlockingImpact`: Counts how many tasks are transitively blocked - `getTransitiveDependents`: Gets all tasks that depend on a task (di - `dependsOnTask`: Helper to check if a task depends on a given ID wi 2. **Omni/Jr/Web.hs** - Updated blocked page: - Changed `BlockedPage` type to include blocking impact: `[(TaskCore. - Updated `blockedHandler` to compute blocking impact and sort by it - Added `renderBlockedTaskCard` to display tasks with their blocking - Updated the info message to explain the sorting 3. **Omni/Jr/Web/Style.hs** - Added CSS: - `.blocking-impact` badge style (light mode) - `.blocking-impact` dark mode style Task-Id: t-189
2025-11-29Add time range filter to homepage Task Status sectionBen Sima
The build and tests pass with no errors. The time range filter feature f **Implementation summary:** - Route accepts `?range=today|week|month|all` query param - `TimeRange` type with `Today`, `Week`, `Month`, `AllTime` variants - `homeHandler` filters both tasks and activities by time range - Toggle buttons rendered with `timeFilterBtn` helper - Full CSS styling in `timeFilterStyles` with dark mode support - Default selection: "All Time" Task-Id: t-180
2025-11-29Add cost and duration metrics to homepage Task Status sectionBen Sima
The implementation is complete. The build passed with `bild --test Omni/ **Summary of changes:** 1. **Omni/Task/Core.hs**: Added `getGlobalAggregatedMetrics :: IO Aggreg 2. **Omni/Jr/Web.hs**: - Updated `HomePage` data type to include `AggregatedMetrics` paramet - Updated `homeHandler` to fetch global metrics via `getGlobalAggrega - Updated `ToHtml HomePage` instance to add two new cards: "Cost" (fo - Added helper functions `metricCard`, `formatCost`, and `formatDurat 3. **Omni/Jr/Web/Style.hs**: Added `badge-neutral` CSS styling (gray bor Task-Id: t-179
2025-11-29Fix nullable SQL fieldBen Sima
2025-11-28Add comments field to tasks for providing extra contextBen Sima
All tests pass. Here's a summary of the changes I made: 1. **Added `Comment` data type** in `Omni/Task/Core.hs` with `commentTex 2. **Added `taskComments` field** to the `Task` type to store a list of 3. **Updated database schema** with a `comments TEXT` column (stored as 4. **Added SQL instances** for `[Comment]` to serialize/deserialize 5. **Added `addComment` function** to add timestamped comments to tasks 6. **Added CLI command** `task comment <id> <message> [--json]` 7. **Updated `showTaskDetailed`** to display comments in the detailed vi 8. **Added unit tests** for comments functionality 9. **Added CLI tests** for the comment command 10. **Fixed dependent files** (`Omni/Agent/Worker.hs` and `Omni/Jr/Web.h Task-Id: t-167
2025-11-28Make task description a required field on createBen Sima
All tests pass. The changes are complete: **Summary of changes:** 1. **Omni/Task/Core.hs**: Changed `taskDescription` from `Maybe Text` to 2. **Omni/Task.hs**: Made `--description` required on CLI `create` (pani 3. **Omni/Task/RaceTest.hs**: Updated test to provide descriptions Task-Id: t-165
2025-11-28Fix llm tool installation - update nixpkgs hash in Biz/Bild.nixBen Sima
The build passed. The task was to update nixpkgs hash in Biz/Bild.nix, b Task-Id: t-163
2025-11-28Fix web UI bug in search filterBen Sima
This allows Servant's QueryParam Maybe to treat Left as "parameter not provided", so the 'All' filter option (which sends empty string value) now works correctly instead of causing an "Invalid priority" error. Task-Id: t-146
2025-11-27Add Draft status for tasks not ready for jr to pickupBen Sima
All changes are in place. The build and tests pass. The implementation i 1. **Added `Draft` to Status enum** - First in sequence: `Draft | Open | 2. **Excluded Draft from getReadyTasks** - Uses `taskStatus t `elem` [Op 3. **CLI support** - `task update <id> draft` works, `task list --status 4. **Display coloring** - Draft shows in gray with `[.]` indicator in tr 5. **TaskStats** - Added `draftTasks` field and display in stats output 6. **Tests** - Added unit test for draft exclusion from ready tasks and Task-Id: t-166
2025-11-27Add Omni/Fact.hs core module with CRUD operationsBen Sima
The Omni/Fact.hs module is complete with CRUD operations: - **createFact**: Create a new fact with project, content, related files - **getFact**: Retrieve a fact by ID - **getAllFacts**: Get all facts from the database - **getFactsByProject**: Get facts filtered by project - **getFactsByFile**: Get facts related to a specific file - **updateFact**: Update an existing fact's content, related files, and - **deleteFact**: Delete a fact by ID The module properly re-exports the `Fact` data type from `Omni.Task.Core Task-Id: t-158.2
2025-11-27Exclude tasks with retry >= 3 from ready queueBen Sima
Tasks that have failed 3 or more times need human intervention and should not appear in the ready queue. This prevents infinite retry loops. Task-Id: t-164 Amp-Thread-ID: https://ampcode.com/threads/T-4c8bc88f-f8f9-4921-96e5-3b68552c0bc0 Co-authored-by: Amp <amp@ampcode.com>
2025-11-27Change task detail labels to inline format (ID: t-123 on same line)Ben Sima
Both tests pass. The change converts the task detail display from: ``` Task: t-123 Title: Some title ``` To the inline format: ``` Title: Some title (ID: t-123) ``` Task-Id: t-156.1
2025-11-27Fix SQL query and add simple migration testBen Sima
2025-11-27Add human notes field for intervention tasksBen Sima
All tests pass. Let me summarize the implementation: I've added a human notes field for intervention tasks with the following 1. **Omni/Task/Core.hs**: - Added `retryNotes :: Maybe Text` field to `RetryContext` data type - Added `notes` column to `retryContextColumns` for schema migration - Updated `getRetryContext` to fetch the notes field from DB - Updated `setRetryContext` to save the notes field to DB - Updated `getAllRetryContexts` to include notes - Added `updateRetryNotes :: Text -> Text -> IO ()` function to updat 2. **Omni/Jr/Web.hs**: - Added new API endpoint: `POST /tasks/:id/notes` - Added `NotesForm` type and `FromForm` instance - Added `taskNotesHandler` to save notes - Updated `renderRetryContextBanner` to accept task ID and display: - Notes textarea form when max retries exceeded (intervention tasks - Existing notes display for non-critical retry banners 3. **Omni/Agent/Worker.hs**: - Updated worker prompt to include human notes/guidance in the retry - Preserved existing notes when setting new retry context 4. **Omni/Jr.hs**: - Updated all `RetryContext` creations to preserve existing notes Task-Id: t-153.5
2025-11-27Implement proper schema migrations for ALTER TABLEBen Sima
All tests pass. The implementation adds: 1. **`runMigrations`** - Called at the end of `initTaskDb` to run migrat 2. **`migrateTable`** - Compares expected columns against existing colum 3. **`getTableColumns`** - Uses `PRAGMA table_info` to get existing colu 4. **`addColumn`** - Runs `ALTER TABLE ADD COLUMN` for missing columns 5. **Column definitions** - Lists of expected columns for `task_activity When new columns are added to the schema in the future, you just add the Task-Id: t-152.3
2025-11-27Display worker metrics on task detail pageBen Sima
All tests pass. Let me summarize what was implemented: - Extended `TaskActivity` type with new fields: - `activityAmpThreadUrl` - Link to amp thread - `activityStartedAt` - Work start timestamp - `activityCompletedAt` - Work completion timestamp - `activityCostCents` - API cost in cents - `activityTokensUsed` - Token usage count - Updated `SQL.FromRow` and `SQL.ToRow` instances for the new fields - Updated schema to include new columns in `task_activity` table - Added `logActivityWithMetrics` function to log activities with all met - Added `updateActivityMetrics` function to update metrics on existing a - Added `getLatestRunningActivity` helper function - Captures execution timing (start/end timestamps) - Retrieves amp thread URL from `AgentLog.getStatus` - Converts credits to cents and logs to activity record - Uses `logActivityWithMetrics` and `updateActivityMetrics` for tracking - Added `getStatus` function to retrieve current status (thread URL, cre - Added `TaskMetricsPartial` type for HTMX auto-refresh - Extended `TaskDetailPage` to include `RetryContext` - Added Execution Details section on task detail page showing: - Amp Thread URL (clickable link) - Duration (formatted as "Xm Ys") - Cost (formatted as "$X.XX") - Retry Attempt count (if applicable) - Last Activity timestamp - Added `/partials/task/:id/metrics` endpoint for HTMX auto-refresh - Auto-refresh enabled while task is InProgress (every 5s) - Added `renderExecutionDetails` helper function - Added `executionDetailsStyles` for metric rows and execution section - Added dark mode support for execution details section Task-Id: t-148.4
2025-11-27Add views for blocked and needs-intervention tasksBen Sima
The build passes with no errors. The implementation was already in place Task-Id: t-149.6
2025-11-27Fix filter dropdowns returning empty string for All optionBen Sima
The build passes. The fix I implemented: 1. **Changed the API type** in `Omni/Jr/Web.hs` to use `QueryParam "stat 2. **Added manual parsing** in `taskListHandler` with `parseStatus` and 3. **Applied `emptyToNothing`** to both status and priority params befor This ensures that when "All" is selected (empty string), it's treated as I also fixed two pre-existing issues that were blocking the build: - Type annotation for `show stage` in `Omni/Task/Core.hs` - `AesonKey.fromText` conversion in `Omni/Agent/Worker.hs` Task-Id: t-149.1
2025-11-27Show activity timeline on task detail page in web UIBen Sima
All builds pass. Here's a summary of the changes I made: **Omni/Task/Core.hs:** - Added `getActivitiesForTask` function to query task_activity table for **Omni/Jr/Web.hs:** - Added `Data.Time` import for timestamp formatting - Updated `TaskDetailPage` type to include `[TaskCore.TaskActivity]` - Updated `taskDetailHandler` to fetch activities for the task - Added activity timeline rendering in `toHtml` instance for InProgress - Added helper functions: `renderActivity`, `stageClass`, `stageIcon`, ` **Omni/Jr/Web/Style.hs:** - Added `activityTimelineStyles` function with vertical timeline CSS - Added stage-specific colors (claiming=blue, running=yellow, reviewing= - Added dark mode styles for the activity timeline Task-Id: t-148.3
2025-11-27Add logActivity helper and integrate into Worker.hsBen Sima
Implementation complete. The task is done: 1. **Created `logActivity` helper** in `Omni/Task/Core.hs` that writes t 2. **Integrated into Worker.hs** at all key points: - `Claiming` - when claiming task - `Running` - when starting amp - `Reviewing` - when amp completes successfully - `Retrying` - on retry (includes attempt count in metadata) - `Completed` - on success (includes result type in metadata) - `Failed` - on failure (includes exit code or reason in metadata) Task-Id: t-148.2
2025-11-27Add task_activity table schemaBen Sima
All components are in place: - `ActivityStage` enum with stages: Claiming, Running, Reviewing, Retryi - `TaskActivity` data type with all required fields - JSON instances (ToJSON/FromJSON) - SQLite instances (FromField/ToField for ActivityStage, FromRow/ToRow f - `task_activity` table in `initTaskDb` Build passes with no errors. Task-Id: t-148.1
2025-11-27jr: Fix empty query param parsing and use XDG for db pathBen Sima
- FromHttpApiData instances return Left for empty strings (Servant treats as missing param for QueryParam Maybe) - getTasksDbPath now uses ~/.local/share/jr/jr.db via XDG - Remove standalone task binary output - Add tests for parseQueryParam on Priority/Status Task-Id: t-145, t-146 Amp-Thread-ID: https://ampcode.com/threads/T-2ad5310f-b7f5-451d-ad9b-35aa17c58774 Co-authored-by: Amp <amp@ampcode.com>
2025-11-26Jr: Sequential task IDsBen Sima
All tests pass. The implementation is complete: **Summary of changes:** 1. Removed sqids dependency from `Omni/Task/Core.hs`, `Omni/Task.hs`, an 2. Changed `generateId` in `Omni/Task/Core.hs` to produce simple sequent 3. Removed the now-unused `sqidsOptions` configuration and `Web.Sqids` i Task-Id: t-1o2g8gu9y2z
2025-11-26Move test database to _/tmp (cabdir)Ben Sima
- Document _/ directory structure in AGENTS.md - Change test database path from .tasks/ to _/tmp/ - Update all references in tests and docs
2025-11-26Add task delete commandBen Sima
2025-11-26Fix test database isolation: TASK_TEST_MODE takes precedenceBen Sima
Tests were polluting production database because TASK_DB_PATH took precedence over TASK_TEST_MODE. Now test mode always uses .tasks/tasks-test.db regardless of TASK_DB_PATH setting.
2025-11-26Add task list filters (status, priority, namespace)Ben Sima
The build passes. Let me also verify that the filter functionality is co 1. **API endpoint with query params** (lines 46-49): ✅ Already has `Quer 2. **Handler** (lines 776-781): ✅ Already receives and applies filters 3. **Filter form in HTML** (lines 295-330): ✅ Already has form with drop 4. **Filter logic** (lines 787-807): ✅ Already applies AND-combined filt The implementation is complete and the hlint suggestions have been addre Task-Id: t-1o2g8gugkr1.8
2025-11-26Remove git-tracked task references from hooks and docsBen Sima
- Remove task sync from pre-commit hook - Remove task import from post-merge and post-checkout hooks - Remove merge driver config from post-checkout - Remove merge-driver command from jr - Update Task README for SQLite storage - Delete outdated WORKER_AGENT_GUIDE.md Amp-Thread-ID: https://ampcode.com/threads/T-f2358f5a-2d4a-47e7-a895-6647474d8311 Co-authored-by: Amp <amp@ampcode.com>
2025-11-26Remove task sync command and git-tracked tasksBen Sima
Tasks are now stored in SQLite at ~/.cache/omni/tasks/tasks.db. No need to sync to git anymore. Deleted 51 test cruft tasks.
2025-11-25jr: implement Gerrit-style conflict handlingBen Sima
- Add RetryContext to track failed attempts (merge conflicts, rejections) - jr review checks for clean cherry-pick before showing diff - If conflict detected, kicks back to coder with context - Worker prompt includes retry context (attempt count, conflict files, reason) - After 3 failed attempts, marks task for human intervention Task-Id: t-1o2g8gudqlx
2025-11-25task: use sqids for uniform-length IDsBen Sima
8-char lowercase IDs using sqids with sequential counter. Task-Id: t-1o2g8gu9y2z Amp-Thread-ID: https://ampcode.com/threads/T-7d88c849-530f-4703-9f90-cbc86d608e3c Co-authored-by: Amp <amp@ampcode.com>
2025-11-24fix(task): ensure thread safety and isolate testsBen Sima
Re-introduces MVar locking in Task Core to prevent race conditions during Read-Modify-Write cycles (e.g. ID generation). Updates tests to use isolated SQLite databases instead of the production DB or JSONL files. Removes legacy test artifacts. Amp-Thread-ID: https://ampcode.com/threads/T-ac41b9b6-d117-46de-9e4f-842887a22f1d Co-authored-by: Amp <amp@ampcode.com>
2025-11-24task: migrate storage from jsonl to sqliteBen Sima
Removes .tasks/tasks.jsonl and replaces it with a local SQLite database (.tasks/tasks.db). Adds --db flag to CLI. Removes sync command. Amp-Thread-ID: https://ampcode.com/threads/T-ac41b9b6-d117-46de-9e4f-842887a22f1d Co-authored-by: Amp <amp@ampcode.com>
2025-11-22task: complete t-1o2c9vazf64 (Merge)Ben Sima
Amp-Thread-ID: https://ampcode.com/threads/T-ca3b086b-5a85-422a-b13d-256784c04221 Co-authored-by: Amp <amp@ampcode.com>
2025-11-22feat: implement t-1o2c9vazf64Ben Sima
2025-11-22fix: cleanup test artifact in Omni/Task/RaceTest.hsBen Sima
Amp-Thread-ID: https://ampcode.com/threads/T-ca3b086b-5a85-422a-b13d-256784c04221 Co-authored-by: Amp <amp@ampcode.com>
2025-11-22Merge branch 'review/t-1o2bxd3kezj' into liveBen Sima