@nbardy/oompa 0.4.8 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -225,14 +225,16 @@
|
|
|
225
225
|
(defn- run-reviewer!
|
|
226
226
|
"Run reviewer on worktree changes.
|
|
227
227
|
Returns {:verdict :approved|:needs-changes|:rejected, :comments [...]}"
|
|
228
|
-
[{:keys [review-harness review-model]} worktree-path]
|
|
228
|
+
[{:keys [id swarm-id review-harness review-model]} worktree-path]
|
|
229
229
|
(let [;; Get diff for context
|
|
230
230
|
diff-result (process/sh ["git" "diff" "main" "--stat"]
|
|
231
231
|
{:dir worktree-path :out :string :err :string})
|
|
232
232
|
diff-summary (:out diff-result)
|
|
233
233
|
|
|
234
|
-
;; Build review prompt
|
|
235
|
-
|
|
234
|
+
;; Build review prompt (tagged for claude-web-view worker detection)
|
|
235
|
+
swarm-id* (or swarm-id "unknown")
|
|
236
|
+
review-prompt (str "[oompa:" swarm-id* ":" id "] "
|
|
237
|
+
"Review the changes in this worktree.\n\n"
|
|
236
238
|
"Diff summary:\n" diff-summary "\n\n"
|
|
237
239
|
"Check for:\n"
|
|
238
240
|
"- Code correctness\n"
|
|
@@ -277,8 +279,10 @@
|
|
|
277
279
|
(defn- run-fix!
|
|
278
280
|
"Ask worker to fix issues based on reviewer feedback.
|
|
279
281
|
Returns {:output string, :exit int}"
|
|
280
|
-
[{:keys [harness model]} worktree-path feedback]
|
|
281
|
-
(let [
|
|
282
|
+
[{:keys [id swarm-id harness model]} worktree-path feedback]
|
|
283
|
+
(let [swarm-id* (or swarm-id "unknown")
|
|
284
|
+
fix-prompt (str "[oompa:" swarm-id* ":" id "] "
|
|
285
|
+
"The reviewer found issues with your changes:\n\n"
|
|
282
286
|
feedback "\n\n"
|
|
283
287
|
"Please fix these issues in the worktree.")
|
|
284
288
|
|
|
@@ -394,12 +398,19 @@
|
|
|
394
398
|
{:keys [output exit done?]} (run-agent! worker wt-path context)]
|
|
395
399
|
|
|
396
400
|
(cond
|
|
397
|
-
;; Agent signaled done
|
|
398
|
-
done
|
|
401
|
+
;; Agent signaled done — only honor for can_plan workers.
|
|
402
|
+
;; Executors (can_plan: false) can't decide work is done.
|
|
403
|
+
(and done? (:can-plan worker))
|
|
399
404
|
(do
|
|
400
405
|
(println (format "[%s] Received __DONE__ signal" worker-id))
|
|
401
406
|
{:status :done})
|
|
402
407
|
|
|
408
|
+
;; can_plan: false worker said __DONE__ — ignore it, treat as success
|
|
409
|
+
(and done? (not (:can-plan worker)))
|
|
410
|
+
(do
|
|
411
|
+
(println (format "[%s] Ignoring __DONE__ (executor cannot signal done)" worker-id))
|
|
412
|
+
{:status :continue})
|
|
413
|
+
|
|
403
414
|
;; Agent errored
|
|
404
415
|
(not (zero? exit))
|
|
405
416
|
(do
|
|
@@ -35,12 +35,22 @@ cat > ../tasks/pending/task-NNN.edn << 'EOF'
|
|
|
35
35
|
EOF
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
+
### Planning vs Executing
|
|
39
|
+
|
|
40
|
+
**WHEN PLANNING** (task queue is empty or nearly empty):
|
|
41
|
+
- Your FIRST priority is creating tasks for other workers. They are waiting.
|
|
42
|
+
- Read the project spec, identify gaps, and create 5-10 focused, well-detailed tasks.
|
|
43
|
+
- Do NOT execute tasks in the same iteration you create them.
|
|
44
|
+
- Commit the task files and finish your iteration so others can claim them immediately.
|
|
45
|
+
|
|
46
|
+
**WHEN EXECUTING** (tasks exist in pending):
|
|
47
|
+
- Claim one task, execute it end-to-end, complete it.
|
|
48
|
+
- If work emerges during execution, create new tasks in `../tasks/pending/`.
|
|
49
|
+
|
|
38
50
|
### Rules
|
|
39
51
|
|
|
40
52
|
- Before starting work: read the project spec and all tasks to understand scope.
|
|
41
|
-
-
|
|
53
|
+
- Claim your task by moving it to `../tasks/current/`.
|
|
42
54
|
- If the `mv` fails (another worker claimed it first), pick a different task.
|
|
43
55
|
- One task per commit (or a small, tightly-related set with overlapping files).
|
|
44
|
-
-
|
|
45
|
-
- If work emerges during execution: create new tasks in `../tasks/pending/`.
|
|
46
|
-
- When all tasks are complete and the spec is satisfied, output: __DONE__
|
|
56
|
+
- Only output __DONE__ if you have completed work AND no more tasks can be derived from the spec. Never __DONE__ on your first action.
|