From 6fc7db46c94825bdd636e9b3fa74f30bf8b70e9d Mon Sep 17 00:00:00 2001 From: "hiraoku.shinichi" Date: Fri, 3 Jul 2026 08:52:04 +0900 Subject: [PATCH] Keep builder prompt out of git commits --- src/agents/prompt.ts | 2 +- test/agent.test.ts | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/agents/prompt.ts b/src/agents/prompt.ts index c1e5b9a..a9e084f 100644 --- a/src/agents/prompt.ts +++ b/src/agents/prompt.ts @@ -37,7 +37,7 @@ ${options.previousFailure ? `## Previous failure for attempt ${options.attempt}\ 5. Verify with: ${verify} 6. Respect existing project instructions such as AGENTS.md or CLAUDE.md. -7. Commit your changes with message: kaizen: (#${options.issue.number}) +7. Leave your file changes uncommitted in the workspace. kaizen-loop will commit, push, and open a pull request after verification. 8. Add regression tests when practical. 9. If you discover a separate Kaizen Agents bug or unrelated repository bug while working, do not file it yourself and do not expand this fix. Add it to "discoveredIssues" in the final JSON so kaizen-loop can route and file a follow-up issue. Set discoveredIssues[].repo to the repository where the bug should be fixed, not necessarily this source issue repository; for fleet or cross-repository failures, use the repository named by the failing checkout, workspace path, command, or log. diff --git a/test/agent.test.ts b/test/agent.test.ts index 201a8bc..4c13403 100644 --- a/test/agent.test.ts +++ b/test/agent.test.ts @@ -208,6 +208,35 @@ describe('buildFixPrompt', () => { expect(prompt).not.toContain('forbidden/protected path'); }); + it('keeps git commit ownership in the orchestrator', () => { + const config = configSchema.parse({ + version: 1, + commands: { + verify: ['npm test'] + } + }); + + const prompt = buildFixPrompt({ + repo: 'o/r', + config, + attempt: 1, + issue: { + number: 139, + title: 'Keep builder prompt scoped to file edits', + body: 'Builder should leave changed files for kaizen-loop orchestration.', + labels: [{ name: 'kaizen' }], + createdAt: '2026-06-13T00:00:00Z', + comments: [] + } + }); + + expect(prompt).toContain('Do not run git push, gh commands, or create pull requests.'); + expect(prompt).toContain('Leave your file changes uncommitted in the workspace.'); + expect(prompt).toContain('kaizen-loop will commit, push, and open a pull request after verification.'); + expect(prompt).not.toContain('Commit your changes'); + expect(prompt).not.toContain('git commit'); + }); + it('renders heredoc verification commands as runnable shell', () => { const heredoc = "python3 <<'PY'\nprint('ok')\nPY"; const config = configSchema.parse({