summaryrefslogtreecommitdiff
path: root/Omni/Agent
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2025-11-20 21:40:04 -0500
committerBen Sima <ben@bsima.me>2025-11-20 21:40:04 -0500
commitaebb26fcf7ff9869b1039cdbac8811f83b346f9d (patch)
treec17fc2a4207bb6199460a9927b10740fee32fab2 /Omni/Agent
parentec6719be2c7a4d51331fcc5ed7f5982bbbe3ac80 (diff)
docs: update Agent design with git robustness learnings
Diffstat (limited to 'Omni/Agent')
-rw-r--r--Omni/Agent/DESIGN.md12
1 files changed, 10 insertions, 2 deletions
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/<dep-id>`).
+ - 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.