diff --git a/src/loop/prompts.ts b/src/loop/prompts.ts index 3f65959..e54bf7d 100644 --- a/src/loop/prompts.ts +++ b/src/loop/prompts.ts @@ -1,6 +1,8 @@ import { REVIEW_FAIL, REVIEW_PASS } from "./constants"; const NEWLINE_RE = /\r?\n/; +const SPAWN_TEAM_WITH_WORKTREE_ISOLATION = + "Spawn a team of agents with worktree isolation."; const hasProofInTask = (task: string, proof: string): boolean => { const proofLines = proof @@ -47,7 +49,7 @@ export const buildWorkPrompt = ( } parts.push( - `Spawn a team of agents. When all work is verified and once you have a proof that the task is completed, append "${doneSignal}" on its own final line.` + `${SPAWN_TEAM_WITH_WORKTREE_ISOLATION} When all work is verified and once you have a proof that the task is completed, append "${doneSignal}" on its own final line.` ); return parts.join("\n\n"); }; @@ -71,7 +73,7 @@ export const buildReviewPrompt = ( `If the work is complete, end with "${REVIEW_PASS}" on its own final line.` ); parts.push( - `Spawn a team of agents. Do not use "${doneSignal}" in your final line.` + `${SPAWN_TEAM_WITH_WORKTREE_ISOLATION} Do not use "${doneSignal}" in your final line.` ); return parts.join("\n\n"); }; diff --git a/tests/loop/prompts.test.ts b/tests/loop/prompts.test.ts index 3888431..bcce0c5 100644 --- a/tests/loop/prompts.test.ts +++ b/tests/loop/prompts.test.ts @@ -28,6 +28,7 @@ test("buildWorkPrompt keeps task, optional sections, and done instruction", () = expect(prompt).toContain( 'append "DONE" on its own final line.' ); + expect(prompt).toContain("worktree isolation"); }); test("buildWorkPrompt does not duplicate proof when task already contains it", () => { @@ -52,5 +53,6 @@ test("buildReviewPrompt includes pass and fail instructions and verification", ( expect(prompt).toContain(`end with "${REVIEW_FAIL}" on its own final line`); expect(prompt).toContain(`end with "${REVIEW_PASS}" on its own final line`); expect(prompt).toContain("Proof requirements:\nmust pass ci"); + expect(prompt).toContain("worktree isolation"); expect(prompt).toContain('Do not use "" in your final line.'); });