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
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,38 @@ scope 外だが記録価値のある改善候補を見つけた場合は、別 I
- closed issue の reopen は自動実行しない
- 起票またはスキップ結果は終了報告に列挙する

## Step 5 Result Block

Step 5(終了コメント)では、起票結果を `FOLLOW_UP_MATERIALIZATION_RESULT_V1` として報告する。`issue-refinement-loop` は thin orchestrator として raw context を保持せず、routing・reporting のみを担う。

```yaml
FOLLOW_UP_MATERIALIZATION_RESULT_V1:
schema_version: 1
materialized_by: issue-refinement-loop
follow_up_issues:
- request_dedupe_key: "follow-up:<repo>:<source-url-or-pr>:<note-id>"
status: created | reused_open | skipped_closed_duplicate | skipped_closed_not_planned | skipped_closed_completed
issue:
number: 123
url: "https://github.com/..."
reason: null
note_only_observations:
- dedupe_key: "follow-up:<repo>:<source-url-or-pr>:<note-id>"
source_url: "<観察元の URL>"
source_note_id: "<note_id>"
summary: "<観察内容の要約>"
```

空の場合(`follow_up_issues: []` / `note_only_observations: []` は省略禁止):

```yaml
FOLLOW_UP_MATERIALIZATION_RESULT_V1:
schema_version: 1
materialized_by: issue-refinement-loop
follow_up_issues: []
note_only_observations: []
```

## Must not

- title の類似検索だけで dedupe を済ませない
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,17 @@

- `approve` 以外を success 扱いして silently finish しない
- `max_iterations` を超えて自動ループしない

## Termination Comment(全 termination reason 共通)

すべての termination reason(`approved` / `needs_second_pass` / `human_escalation` / `superseded_by_decision`)で、終了コメントに `FOLLOW_UP_MATERIALIZATION_RESULT_V1` を含める。follow-up が存在しない場合も空配列で出力する(`follow_up_issues: []` / `note_only_observations: []`)。

```yaml
FOLLOW_UP_MATERIALIZATION_RESULT_V1:
schema_version: 1
materialized_by: issue-refinement-loop
follow_up_issues: [] # 起票済み / reuse / skip 結果。空の場合も省略しない
note_only_observations: [] # 起票せず記録のみ。空の場合も省略しない
```

詳細 schema は `docs/dev/agent-skill-boundaries.md` の `FOLLOW_UP_MATERIALIZATION_RESULT_V1` を参照。`issue-refinement-loop` は thin orchestrator として raw context を保持せず、materialization 結果のみを報告する(`docs/dev/agent-skill-boundaries.md` の `ORCHESTRATOR_IO_BOUNDARY_V1` 参照)。
8 changes: 6 additions & 2 deletions .claude/skills/post-merge-cleanup/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,15 @@ for each request in follow_up_issue_requests:

```yaml
FOLLOW_UP_MATERIALIZATION_RESULT_V1:
schema_version: 1
materialized_by: post-merge-cleanup
follow_up_issues:
- request_dedupe_key: "..."
issue_number: 123
issue_url: "https://github.com/..."
status: created | reused_open | skipped_closed_duplicate | skipped_closed_not_planned | skipped_closed_completed
issue:
number: 123
url: "https://github.com/..."
reason: null

note_only_observations:
- dedupe_key: "..."
Expand Down
12 changes: 12 additions & 0 deletions .claude/skills/pr-review-judge/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,18 @@ follow_up_issue_requests:
2. コメント本文全体で `reviewed_head_sha:` 行は 1 つだけ(複数だと parse が最初の行のみ採用)
3. コードフェンス(` ``` `)は `\` でエスケープしない(heredoc 内でもそのまま書く)
4. `follow_up_issue_requests` は non-blocker observations を構造化したフィールド。pr-review-judge は **起票を実行しない**。起票責務は impl-review-loop Step 5 等の main thread が担う(詳細は `docs/dev/agent-skill-boundaries.md` の `FOLLOW_UP_ISSUE_REQUEST_V1` を参照)。
5. **negative rule**: pr-review-judge は `follow_up_issues`(materialize 結果フィールド)を出力してはならない。`LOOP_VERDICT` に出力するのは `follow_up_issue_requests`(起票前候補)のみ。`follow_up_issues` は Issue 起票後の materialize 結果であり、起票を行わない pr-review-judge が正しく埋めることはできない。

```yaml
# INVALID — LOOP_VERDICT に follow_up_issues を出してはならない
follow_up_issues:
- issue_number: 123

# VALID — LOOP_VERDICT には follow_up_issue_requests のみを出す
follow_up_issue_requests:
- title: "..."
severity: optional_follow_up
```

## Stop Conditions

Expand Down
19 changes: 14 additions & 5 deletions docs/dev/agent-skill-boundaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,25 +348,34 @@ for each request:

```yaml
FOLLOW_UP_MATERIALIZATION_RESULT_V1:
schema_version: 1
materialized_by: post-merge-cleanup | issue-refinement-loop | impl-review-loop
follow_up_issues:
- request_dedupe_key: "follow-up:<repo>:<source-url-or-pr>:<note-id>"
issue_number: 123 | null
issue_url: "https://github.com/..." | null
status: created | reused_open | skipped_closed_duplicate | skipped_closed_not_planned | skipped_closed_completed
issue:
number: 123 # status=created/reused_open の場合
url: "https://github.com/..."
# status=skipped_* の場合は issue: null
reason: null # skipped 時は理由を記載
note_only_observations:
- dedupe_key: "follow-up:<repo>:<source-url-or-pr>:<note-id>"
source_url: "<観察元の URL>"
source_note_id: "<note_id>"
summary: "<観察内容の要約>"
```

> 必須: `follow_up_issues` / `note_only_observations` は空の場合も `[]` で出力すること(省略禁止)。`schema_version: 1` は常に付与すること。

各 skill(`impl-review-loop` Step 5 / `post-merge-cleanup` / `issue-refinement-loop`)の終了コメントは本スキーマを参照して `follow_up_issues` と `note_only_observations` を報告する。

**責務境界**:

- `pr-review-judge`: non-blocker observations を `FOLLOW_UP_ISSUE_REQUEST_V1` として `LOOP_VERDICT.follow_up_issue_requests` に出力する。**Issue 起票は行わない**。
- `post-merge-cleanup-worker`: `follow_up_issue_requests` を `FOLLOW_UP_ISSUE_REQUEST_V1[]` として列挙して返す。**Issue 起票は行わない**。
- main thread(impl-review-loop Step 5 / post-merge-cleanup Delegation): リクエストを受け取り、dedupe_key で dedupe チェック後に `issue-author` / `create-issue` 経由で起票する。
- `pr-review-judge`: non-blocker observations を `FOLLOW_UP_ISSUE_REQUEST_V1` として `LOOP_VERDICT.follow_up_issue_requests` に出力する。**Issue 起票は行わない**。`follow_up_issues` フィールドを `LOOP_VERDICT` に出力してはならない(**negative rule**)。
- `post-merge-cleanup-worker`: `FOLLOW_UP_ISSUE_REQUEST_V1[]` を列挙して main thread に返す。**`gh issue create` / `issue-author` / `create-issue` を直接呼び出してはならない**。Issue の実際の作成は必ず main thread が担う。
- `post-merge-cleanup`(main thread cleanup phase): `post-merge-cleanup-worker` から受け取ったリクエストを dedupe 後に `issue-author` / `create-issue` 経由で materialize する **terminal materializer**(terminal materialization coordinator)。follow-up の raw context を保持・判断する context owner ではなく、PR / impl-review-loop 由来の蓄積済み `FOLLOW_UP_ISSUE_REQUEST_V1[]` を終端で materialize・report する。
- `issue-refinement-loop`: scope split / out-of-scope discovery / child materialization の出口を持つ **thin orchestrator**。review-issue 由来の観察を routing するだけで、follow-up の raw context を保持・再解釈しない。終了コメントには materialization 結果(`FOLLOW_UP_MATERIALIZATION_RESULT_V1`)のみを出す。
- main thread(impl-review-loop Step 5 / post-merge-cleanup): リクエストを受け取り、dedupe_key で dedupe チェック後に `issue-author` / `create-issue` 経由で起票する。

## CHILD_MATERIALIZATION_PLAN_V2

Expand Down
Loading