summaryrefslogtreecommitdiff
path: root/Omni/Jr.hs
AgeCommit message (Collapse)Author
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-29Store agent review notes as task commentsBen Sima
The implementation is complete. Here's a summary of what was implemented **Changes to [Omni/Jr.hs](file:///home/ben/omni/Omni/Jr.hs):** 1. **`autoReview`** - Now adds a review comment with: - Commit SHA (short) - Test target (namespace) - Result (PASSED/FAILED) - Test output (truncated to 1000 chars) when tests fail 2. **`interactiveReview`** - Now adds a human review comment with: - Commit SHA (short) - Result (ACCEPTED/REJECTED) - Rejection reason (when rejected) 3. **`handleConflict`** - Now adds a merge conflict comment with: - Commit SHA (short) - Attempt number - List of conflicting files 4. **Helper functions added:** - `buildReviewComment` - Formats auto-review results - `buildHumanReviewComment` - Formats human review results - `buildConflictComment` - Formats merge conflict info - `truncateOutput` - Truncates long test output Task-Id: t-193.4
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-28Implement jr facts list/show/add/delete CLI commandsBen Sima
The build and tests pass. The hlint suggestions have been fixed: 1. Changed `Text.pack <$>` to `Text.pack </` on line 528 2. Replaced the case expression with `maybe Fact.getAllFacts Fact.getFac 3. Changed `Text.pack <$>` to `Text.pack </` on line 555 Task-Id: t-158.3
2025-11-27Auto-transition epic to Review status when all children reach DoneBen Sima
The implementation is complete. Summary of changes to [Omni/Jr.hs](file: 1. Added `checkEpicCompletion` function (lines 490-508) that: - Checks if the completed task has a parent - Finds the parent task and verifies it's an Epic - Checks if all children of that epic are Done - If so, transitions the epic to Review status 2. Updated `autoReview` to call `checkEpicCompletion` after marking a ta 3. Updated `interactiveReview` to: - Accept the task as a parameter (line 414) - Call `checkEpicCompletion` after marking a task Done (line 429) 4. Updated the call site at line 361 to pass the task to `interactiveRev Task-Id: t-155.1
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-27Make Omni/Jr.hs executableBen Sima
2025-11-26Jr: Gerrit-style conflict handling - kick back to coder with contextBen Sima
All tests pass and lint is clean. The implementation adds Gerrit-style c 1. **`gatherConflictContext`** - Creates rich context including: - The commit info (SHA, subject, body) - Current HEAD state (what branch moved to) - Per-file conflict details showing both your changes and recent chan 2. **`getFileConflictInfo`** - For each conflicting file, shows: - Your changes to that file (stat summary) - Recent changes by others (last 3 commits touching the file) 3. The context is stored in `retryReason` and passed to the worker via t Task-Id: t-1o2g8gudqlx
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-26Port task commands to jr taskBen Sima
All tests pass. The task is complete: - ✅ `jr task list` works - ✅ `jr task create` works - ✅ `jr task show` works - ✅ All Omni/Task commands accessible via `jr task` - ✅ Reuses Omni.Task logic - ✅ Added tests for task command parsing - ✅ `bild --test Omni/Jr.hs` passes Task-Id: t-1o2egbj8o0n.2
2025-11-26Improve worker prompt and fix output interleavingBen Sima
- More explicit prompt: MUST run bild --test, fix hlint issues - Add workerQuiet flag to disable ANSI status bar in loop mode - Loop mode uses simple putText, manual jr work keeps status bar
2025-11-26Reset stuck Review tasks to Open when no commit foundBen Sima
2025-11-26Improve jr loop logging and fix review race conditionBen Sima
- Reorder loop to check pending reviews before starting new work - Loop no longer exits on missing commit (skips instead) - Add [loop], [review], [worker] prefixes to all log messages - Worker leaves task in InProgress on amp failure (avoids retry loop)
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-26Fix auto-review to use full namespace pathBen Sima
Task-Id: t-1o2g8gugkr1
2025-11-26Add jr loop command for autonomous work+review cycleBen Sima
- jr review [<task-id>] [--auto]: auto-accepts if tests pass - jr review (no args): picks first task in Review status - jr loop [--delay=N]: runs work->review loop continuously - Auto-review runs bild --test on task namespace Task-Id: t-1o2g8gugkr1
2025-11-26Add jr web command with Servant skeletonBen Sima
Task-Id: t-1o2g8gugkr1.1
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-25fix(jr): review command git show argsBen Sima
Task-Id: t-1o2g8gu6p8o
2025-11-25jr: add review command, --try-opus, Task-Id trailerBen Sima
- jr review <task-id>: show diff, accept/reject/skip - Worker uses --try-opus for better code quality - Commit messages use Task-Id: trailer (Gerrit-style) Task-Id: t-1o2g8gu6p8o
2025-11-24deprecate(agent): move functionality to jrBen Sima
Moves the 'agent start' and 'agent merge-driver' commands to 'jr work' and 'jr merge-driver' respectively. Deletes Omni/Agent.hs as it is no longer the entry point. Amp-Thread-ID: https://ampcode.com/threads/T-ac41b9b6-d117-46de-9e4f-842887a22f1d Co-authored-by: Amp <amp@ampcode.com>
2025-11-24feat: implement t-1o2egbj8o0n.3Ben Sima
I have implemented the `jr work` command in `Omni/Jr.hs`. **Changes:** 1. **Modified `Omni/Jr.hs`**: * Added necessary imports (`Omni.Agent.Core`, `Omni.Agent.Worker`, `System.Directory`, `System.FilePath`, `Data.Text`). * Updated the Docopt usage to include `jr work [<task-id>]`. * Implemented the `work` command handler in the `move` function to initialize a `Worker` and call `Worker.start`, mirroring the logic in `Omni/Agent.hs`. * Added unit tests to verify parsing of the `work` command with and without a task ID. **Verification:** * Ran `bild --test Omni/Jr.hs` which passed, confirming the code compiles and tests pass. * Ran `lint Omni/Jr.hs` which passed. * Verified `_/bin/jr --help` shows the new command. I am now ready to exit.
2025-11-24Remove harvest command and documentationBen Sima
The 'harvest' functionality was tied to git-synced JSONL task files, which have been replaced by a local SQLite database. This commit removes the command from the CLI and updates documentation to reflect the new workflow. Amp-Thread-ID: https://ampcode.com/threads/T-ac41b9b6-d117-46de-9e4f-842887a22f1d Co-authored-by: Amp <amp@ampcode.com>
2025-11-24feat: implement t-1o2egbj8o0n.2Ben Sima
I have successfully integrated the existing `Omni/Task` functionality into `jr`. The `Omni/Jr.hs` file already had the logic to forward `task` commands to `Omni/Task.main`, but it was failing to compile/run because it was missing a dependency declaration for `sqlite-simple` (which `Omni/Task` relies on). I added the missing dependency to `Omni/Jr.hs`: ```haskell -- : dep sqlite-simple ``` I verified the fix by running: 1. `Omni/Ide/run.sh Omni/Jr.hs task list` - Verified it lists tasks correctly. 2. `Omni/Ide/run.sh Omni/Jr.hs task create "Test Task via Jr"` - Verified it creates tasks. 3. `Omni/Ide/run.sh Omni/Jr.hs task show <id>` - Verified it shows task details. 4. `Omni/Ide/run.sh Omni/Jr.hs task -h` - Verified it shows `task` specific help. 5. `Omni/Ide/run.sh Omni/Jr.hs task test` - Verified it runs the `Omni/Task` test suite. 6. `bild --test Omni/Jr.hs` - Verified `Omni/Jr.hs` itself builds and passes its own tests. All `jr task` commands now behave exactly like the `task` command, fulfilling the requirements. The existing `Omni/Task` logic is fully reused.
2025-11-24feat: implement t-1o2egbj8o0n.1Ben Sima
2025-11-24feat(jr): Create Omni/Jr.hs main entry pointBen Sima
Amp-Thread-ID: https://ampcode.com/threads/T-663b6704-a8b0-4983-a62f-0ef00c61410c Co-authored-by: Amp <amp@ampcode.com>