Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/agents/prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: <summary> (#${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.

Expand Down
29 changes: 29 additions & 0 deletions test/agent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down