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
3 changes: 2 additions & 1 deletion docs/04-nightly-pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ gh pr create --base <defaultBranch> --head kaizen/issue-<N>-<slug> \
codex exec --cd <workspace> "... skills/pr-guardian/SKILL.md ..."
```

- PR 本文: 修正サマリ、対象 Issue へのリンク(`Closes #N`)、変更概要、検証結果、verifier 有効時の `verifier: open_pr` / `verifier: open_pr_with_warning`、リスク判定または並列実行で PR になった理由
- PR 本文: 修正サマリ、対象 Issue へのリンク(`Closes #N`)、変更概要、検証結果、verifier 有効時の `verifier: open_pr` / `verifier: open_pr_with_warning`、証拠強度(`reported` / `executed` / `unverified` / `static`)、リスク判定または並列実行で PR になった理由
- 証拠強度では、builder-agent の自己申告は `reported`、Kaizen Loop が実行した verify / verifier は `executed`、未設定の verify / verifier は `unverified`、git diff 由来の変更ファイル・行数は `static` として表示する
- PR 作成直後、Kaizen Loop は Issue に PR リンクと「monitoring CI and review feedback」をコメントする
- `guardian.mode: sync` では、Kaizen Loop は vendored `skills/pr-guardian/SKILL.md` を設定済みの `guardian.command` で実行する。CI 監視、`gh run watch`、未解決の actionable review feedback 対応、mergeable 判定は `pr-guardian` skill の責務。TypeScript 側は各 pass 後に未解決・非 outdated の review thread を確認し、残っていれば `guardian.maxAttempts` まで再実行する。approval 不足は branch protection が明示要求している場合だけ blocker として扱う
- `guardian.mode: async` では、PR 作成後に `~/.kaizen/projects/<slug>/guardian/jobs/` へ job を保存して foreground run を終了する。job は repo、PR 番号、URL、branch、base branch、head SHA、retry budget、attempt count、status、last checked time、last blocker を持つ。`kaizen guardian watch` が pending job を再開し、`kaizen guardian run <pr>` は head SHA が変わっていれば新しい job として実行する
Expand Down
13 changes: 13 additions & 0 deletions src/orchestrator/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1072,6 +1072,16 @@ function buildPullRequestBody(
: '- Verification commands are not configured';
const notes = agentResult.notes.trim() ? `\n## Builder notes\n${agentResult.notes.trim()}\n` : '';
const verifier = verifierResult ? `\n## Verifier\nverifier: ${verifierResult.status}\nsummary: ${verifierResult.summary || '(none)'}${verifierResult.reason ? `\nreason: ${verifierResult.reason}` : ''}${verifierResult.notes.trim() ? `\nnotes: ${verifierResult.notes.trim()}` : ''}\n` : '';
const evidence = [
'- reported: builder summary and builder notes come from the builder-agent self-report.',
verifyResults.length > 0
? '- executed: Kaizen Loop ran the verification commands listed above.'
: '- unverified: no repository verification commands are configured.',
verifierResult
? '- executed: Kaizen Loop ran verifier and recorded the status below.'
: '- unverified: verifier was not run for this PR body.',
'- static: changed file and line counts come from git diff metadata.'
].join('\n');
return `Closes #${issue.number}

## Summary
Expand All @@ -1082,6 +1092,9 @@ ${notes}
${verify}
${verifier}

## Evidence strength
${evidence}

## Kaizen risk policy
${riskReason}

Expand Down
9 changes: 9 additions & 0 deletions test/integration/dry-run.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1800,6 +1800,11 @@ describe('runKaizen PR flow', () => {
expect(prBodies[0]).toContain('## Verifier');
expect(prBodies[0]).toContain('verifier: open_pr');
expect(prBodies[0]).toContain('summary: 確認した');
expect(prBodies[0]).toContain('## Evidence strength');
expect(prBodies[0]).toContain('reported: builder summary and builder notes come from the builder-agent self-report');
expect(prBodies[0]).toContain('executed: Kaizen Loop ran the verification commands listed above');
expect(prBodies[0]).toContain('executed: Kaizen Loop ran verifier and recorded the status below');
expect(prBodies[0]).toContain('static: changed file and line counts come from git diff metadata');
});

it('surfaces open_pr_with_warning verifier status in generated PR bodies', async () => {
Expand Down Expand Up @@ -1873,6 +1878,10 @@ describe('runKaizen PR flow', () => {
expect(prBody).toContain('summary: 確認したが注意あり');
expect(prBody).toContain('reason: low confidence');
expect(prBody).toContain('notes: human should double-check docs');
expect(prBody).toContain('## Evidence strength');
expect(prBody).toContain('reported: builder summary and builder notes come from the builder-agent self-report');
expect(prBody).toContain('executed: Kaizen Loop ran the verification commands listed above');
expect(prBody).toContain('executed: Kaizen Loop ran verifier and recorded the status below');
});

it('accepts legacy approved verifier payloads as open_pr', async () => {
Expand Down