From aebb26fcf7ff9869b1039cdbac8811f83b346f9d Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Thu, 20 Nov 2025 21:40:04 -0500 Subject: docs: update Agent design with git robustness learnings --- Omni/Agent/DESIGN.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'Omni') diff --git a/Omni/Agent/DESIGN.md b/Omni/Agent/DESIGN.md index c3fa792..bbdbe15 100644 --- a/Omni/Agent/DESIGN.md +++ b/Omni/Agent/DESIGN.md @@ -52,12 +52,13 @@ The Haskell implementation should replicate the logic of `start-worker.sh` but w 1. **Setup**: Ensure worktree exists (or create it). 2. **Loop**: - - `Git.syncWithLive` + - `Git.syncWithLive` (Rebase-based to preserve local history) - `Task.sync` - `task <- Task.findReady` - If `task`: - `Task.claim task` - - `Git.checkoutTaskBranch task` + - `baseBranch <- Git.determineBaseBranch task` (Check dependencies) + - `Git.checkoutTaskBranch task baseBranch` (Force checkout to clean untracked files) - `Amp.execute prompt` - `Git.commit` - `Git.checkoutBase` @@ -79,6 +80,13 @@ The Haskell implementation should replicate the logic of `start-worker.sh` but w - For each worker, extract `.tasks/tasks.jsonl` via `git show`. - Run `Task.import`. +### 4.5 Git Robustness (Learnings) +- **Force Checkout**: The worker must use `git checkout -f` (or equivalent) when switching to task branches to ensure untracked files (like `.tasks/counters.jsonl`) don't block the switch. +- **Base Branch Logic**: + - If the task depends on another task that is *not* yet in `live` (e.g., in `Review`), the worker should branch off the dependency's branch (`task/`). + - Otherwise, branch off `live` (via the worker's base branch). +- **Clean State**: The worker should ensure the workspace is clean (no uncommitted changes) before starting a new loop iteration. + ## 5. Migration Strategy 1. **Parallel Existence**: Keep bash scripts while developing Haskell version. -- cgit v1.2.3