Repository navigation
feat: implementation-worker に IMPLEMENTATION_WORKER_REQUEST_V2 mode を追加し PR repair executor として機能させる (#631) - #638
Conversation
…#631) Extends implementation-worker to handle PR repair actions (update_pr_body_hygiene, update_branch, apply_pr_review_fix_delta) via IMPLEMENTATION_WORKER_REQUEST_V2 schema. Changes: - .claude/agents/implementation-worker.md: V2 request/result schemas, kind→mode routing table, wrapper-only body update rule, update_branch REST semantics, new SubAgent addition prohibition - .claude/skills/implement-issue/SKILL.md: V2 reference section for update_pr_body_hygiene and update_branch modes - .claude/skills/implement-issue/tests/test_implementation_worker_request_v2_contract.py: 38 deterministic pytest tests verifying all AC Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
squne121
left a comment
There was a problem hiding this comment.
判定: APPROVE
本 PR は Issue #631 の実装要件をすべて満たしており、APPROVE と判定しました。ただし、PR 本文に GitHub 公式クローズキーワード(Closes #631 等)が存在しないため、ensure_closing_keyword アクションが必要です。
マージ可能性
mergeable=MERGEABLE, merge_state_status=CLEAN
証跡確認
変更ファイルはすべて Allowed Paths 内に収まっています。CI の必須チェックはすべて PASS しています。AC5 の不在確認として、pr-hygiene-fixer.md および branch-syncer.md が .claude/agents/ ディレクトリに存在しないことをファイルシステム上で確認しました。
クローズキーワードについては、PR 本文に「Refs #626」という記載と「Issue #631」の散文的な言及はありますが、GitHub 公式クローズキーワード(Closes/Fixes/Resolves #631 等)が存在しないため、ensure_closing_keyword の required_auto_action を追加します。
AC カバレッジ
すべての受け入れ条件が満たされていることを確認しました。AC1(スキーマフィールド)、AC2(ルーティングテーブル)、AC3(wrapper 強制ルール)、AC4(update_branch セマンティクス)、AC5(新規 SubAgent 不在)、AC6(38 件の pytest テスト)がすべて PASS です。
ブロッカー
なし
非ブロッカー
なし
LOOP_VERDICT_V2
verdict: APPROVE
reviewed_head_sha: f700ef9d5bf95e66a55bd6f966b1eac2dbd83806
merge_ready: false
mergeability:
mergeable: MERGEABLE
merge_state_status: CLEAN
blockers: []
required_auto_actions:
- kind: ensure_closing_keyword
executor: implementation-worker
blocking_merge_ready: true
mechanical: true
auto_fix_applied: []
follow_up_issue_requests: []
判定: REQUEST_CHANGESPR #638 は、Issue #631 / 親 Issue #626 の意図に近い方向へ文書を足していますが、現状は 契約不整合・実行分岐の曖昧さ・安全制御の弱さ・テストの形骸化 が残っています。Draft PR でもあり、レビューコメント上も 致命的:
|
…review_fix_delta input fields, and 6 additional tests Addresses REQUEST_CHANGES blockers from PR #638 review: - Add V2/V1 dispatcher boundary section to implementation-worker.md clarifying that V2 repair modes skip issue-contract-review preflight and worktree creation (update_pr_body_hygiene: no worktree; update_branch: no worktree; apply_pr_review_fix_delta: uses existing worktree) - Add reason_code field to IMPLEMENTATION_WORKER_RESULT_V2 for update_branch error classification (expected_head_sha_mismatch / secondary_rate_limit / validation_failed / permission_denied / unknown); status: blocked preserved for 422 per AC4 - Expand REQUEST_V2 schema with apply_pr_review_fix_delta additional fields: review_artifact_ref, reviewed_head_sha, expected_branch_head_sha, allowed_paths_snapshot, delta_summary, max_files, max_lines_changed, commit_message_policy - Expand RESULT_V2 with apply_pr_review_fix_delta output fields: commit_sha, changed_files, pushed_branch; rerun_required changed to verification | pr_review | none enum - Add 6 new pytest tests: test_v2_mode_enum_exact_set, test_update_branch_result_preserves_reason_codes, test_422_blocked_status_preserved, test_apply_pr_review_fix_delta_has_required_fields, test_apply_pr_review_fix_delta_result_fields, test_v2_does_not_require_contract_snapshot_url_for_repair_modes - All 44 tests pass (38 existing + 6 new) Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
squne121
left a comment
There was a problem hiding this comment.
判定: REQUEST_CHANGES
マージ可能性
- マージ可能: MERGEABLE、merge state は CLEAN
証跡確認
- Allowed Paths 遵守: 遵守済み — すべての変更ファイルが Allowed Paths 内にある
- CI 確認: python-test / test / build / lint / typecheck / e2e の全ジョブが conclusion=success であり、head_sha が PR と一致する
- クロージングキーワード: PR 本文に Closes #631 を確認済み
AC 別判定
- AC1: pass — IMPLEMENTATION_WORKER_REQUEST_V2 と IMPLEMENTATION_WORKER_RESULT_V2 のスキーマ定義が implementation-worker.md に存在し、必須フィールドがすべて記載されていることを確認した
- AC2: pass — ルーティングテーブル(ensure_closing_keyword / update_pr_body_hygiene / update_branch / apply_pr_review_fix_delta / unknown kind=blocked)が定義されている
- AC3: pass — update_pr.py wrapper 経由を必須とし、direct 呼び出しを禁止する旨が明記されている
- AC4: pass — expected_head_sha 必須・202/422/403 ステータス別分岐・before/after head SHA 記録・rerun 必須がドキュメントに記載されている
- AC5: pass — pr-hygiene-fixer.md および branch-syncer.md が存在しないことを確認した(新規 SubAgent 追加禁止を遵守)
- AC6: partial — テスト関数は 44 件存在するが、
.claude/skills/implement-issue/tests/が CI workflow の pytest 対象パスに含まれていないため CI_CHECK_RUN_SCOPED 証跡がない
追加確認事項(人間レビュー指摘対応)
## 振る舞い(Dispatcher)セクションが implementation-worker.md に存在し、V1/V2 dispatch テーブルが確認済み- reason_code フィールドが RESULT_V2 に記載されており、値列挙(null / expected_head_sha_mismatch / secondary_rate_limit / validation_failed / permission_denied / unknown)が存在する
- apply_pr_review_fix_delta の追加フィールド(review_artifact_ref / allowed_paths_snapshot / delta_summary / commit_sha / pushed_branch)が REQUEST_V2 と RESULT_V2 に記載されている
- implement_issue の V2 mode 不在と PreToolUse hook 非実装は #631 の Out of Scope として確認した(ブロッカーとしない)
ブロッカー
B1: Schema Change Applicability セクション不在(APPROVE 禁止)
本 PR は新規スキーマ IMPLEMENTATION_WORKER_REQUEST_V2 / IMPLEMENTATION_WORKER_RESULT_V2 を追加する。これらは implementation-worker(producer)と impl-review-loop(consumer)の境界をまたぐ machine-readable contract であり、schema-governance.md の定義上 schema_change に該当する。PR テンプレートで必須の Schema Change Applicability セクションが PR 本文に存在しない。not_schema_change を明示するか、または schema_change として Schema Consumer Inventory を合わせて記載する必要がある。
B2: Safety Claim Matrix セクション不在(APPROVE 禁止)
変更パスに .claude/agents/implementation-worker.md と .claude/skills/implement-issue/SKILL.md が含まれており、safety-sensitive 判定基準(changed path が .claude/skills/** に一致)に該当する。PR テンプレートの Safety Claim Matrix セクションが PR 本文に存在しない。N/A と非該当理由を明記しない限り APPROVE 禁止。
B3: AC6 の CI 未対象(APPROVE 禁止)
.claude/skills/implement-issue/tests/test_implementation_worker_request_v2_contract.py が ci.yml の pytest 対象パスに含まれていない。python-test ジョブが同 head_sha で成功しているが、このテストファイルを実行していないため CI_CHECK_RUN_SCOPED 証跡がない。PR body self-report のみでは APPROVE 不可。修正方法:(a)ci.yml に implement-issue/tests/ のステップを追加する、または(b)このテストが他の CI ステップに含まれていることを示す証跡を提示する。
非ブロッカー(任意改善)
- rerun_required が RESULT_V2 本体と apply_pr_review_fix_delta 追加フィールドコメントで重複定義されているが、機能上の問題はない。
LOOP_VERDICT_V2
LOOP_VERDICT_V2:
verdict: REQUEST_CHANGES
reviewed_head_sha: "8343256336c7587a311def64f2622be3c52696bf"
merge_ready: false
mergeability:
mergeable: MERGEABLE
merge_state_status: CLEAN
blockers:
- id: schema_change_applicability_missing
description: "PR が新規スキーマを追加しているが Schema Change Applicability セクションおよび Schema Consumer Inventory セクションが PR 本文に存在しない"
severity: APPROVE_PROHIBITED
mechanical: false
- id: safety_claim_matrix_missing
description: "変更パスが .claude/skills/** に一致し safety-sensitive PR と判定されるが Safety Claim Matrix セクションが PR 本文に存在しない"
severity: APPROVE_PROHIBITED
mechanical: false
- id: ac6_ci_gap
description: "test_implementation_worker_request_v2_contract.py が CI workflow の pytest 対象に含まれておらず CI_CHECK_RUN_SCOPED 証跡なし"
severity: APPROVE_PROHIBITED
mechanical: false
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests:
- title: "CI に .claude/skills/implement-issue/tests/ の pytest ステップを追加する"
issue_kind: implementation
severity: mandatory_follow_up
blocking_merge_ready: false
source:
kind: pr_review
url: "https://github.com/squne121/loop-protocol/pull/638"
note_id: "1"
dedupe_key: "follow-up:squne121/loop-protocol:pr/638:1"
desired_destination: "CI が implement-issue/tests/ を自動実行し、AC6 の CI_CHECK_RUN_SCOPED 証跡が取得可能になった状態"
validated_scope_delta: ".github/workflows/ci.yml に implement-issue/tests/ の pytest ステップを追加する"
origin_skill: pr-review-judge
labels:
- triage-required
initial_label_profile: implementation
materialization: pending
ac_coverage:
AC1: pass
AC2: pass
AC3: pass
AC4: pass
AC5: pass
AC6: partial
squne121
left a comment
There was a problem hiding this comment.
判定: REQUEST_CHANGES
マージ可能性
- mergeable=MERGEABLE, merge_state_status=UNSTABLE
- UNSTABLE は「PR Body Japanese Check」の失敗によるが、このチェックは必須ステータスチェックに含まれない(必須: typecheck/lint/test/build/python-test/validate-generated-artifact — すべて PASS)。UNSTABLE のみでは REQUEST_CHANGES の根拠にならない。
証跡確認
- AC カバレッジ: AC1〜AC5 は pass、AC6 は partial(テストファイルは存在しローカルで動作するが CI 対象外)
- Allowed Paths 遵守: 変更 3 ファイルすべてが Allowed Paths 内 — 遵守
- CI 検証: python-test / lint / test / build / typecheck / validate-generated-artifact が head_sha f751cc8 で conclusion=success。e2e も success。Japanese check は失敗だが必須チェック外。
- Schema Change Applicability セクション: 存在 — decision: schema_change, backward_compatible — PASS
- Safety Claim Matrix セクション: 構造は存在。必須列あり。ただしブロッカー B1 参照。
- クローズキーワード: 「Closes #631」が PR 本文に存在し closingIssuesReferences API で確認済み — PASS
ブロッカー
B1: Safety Claim Matrix — partial 行の Follow-up に open issue 番号の参照がない(APPROVE 禁止)
update_pr_body_hygiene クレーム行の Not controlled 列に「実行時 hook による強制なし(prose のみ)」が記載されており(非空)、Follow-up 列は「hook 実装は別 Issue 推奨」とするが、具体的な open issue 番号を参照していない。SKILL.md § 4.6 の判定ルール「Not controlled 列が非空なのに、Follow-up 列に open な follow-up Issue の参照がない → APPROVE 禁止」に抵触する。
修正方法: hook 実装用の follow-up issue を起票し、その番号を Safety Claim Matrix の Follow-up 列に記載する。
B2: AC6 — CI_CHECK_RUN_SCOPED 証跡なし(APPROVE 禁止)
.claude/skills/implement-issue/tests/test_implementation_worker_request_v2_contract.py は CI の python-test ジョブ(head_sha 一致・conclusion=success)が対象とするパスに含まれていない。AC6 の Verification Command に対応する CI_CHECK_RUN_SCOPED 証跡が存在しない。PR 本文の自己申告のみでは PR_BODY_SELF_REPORT_ONLY_APPROVE_PROHIBITED により APPROVE 不可。
PR Notes で Stop Condition(Allowed Paths 外)として正しく文書化されている点は評価できる。ただし VC の PASS 証跡として以下のいずれかが必要:
- orchestrator が
uv run pytest .claude/skills/implement-issue/tests/test_implementation_worker_request_v2_contract.py -vを実行して TEST_VERDICT_MACHINE コメントを投稿する - Issue contract 上で AC6 を deferred 扱いとして明示的に waiver を記録する
非ブロッカー(任意改善)
- Japanese Check 失敗(必須チェック外): Safety Claim Matrix のテーブル行に英語のみの prose block が含まれ日本語比率チェックに失敗している。必須ステータスチェックではないためマージブロックにならないが、今後の PR では注意が必要。
- RESULT_V2 の rerun_required フィールドが boolean から enum(verification | pr_review | none)に変更された点は、PR 本文説明の「38 件」と「44/44 PASS」の件数差(第 2 コミットで 6 件追加)と合わせて整合している。機能上の問題なし。
LOOP_VERDICT_V2(機械可読判定ブロック)
LOOP_VERDICT_V2:
verdict: REQUEST_CHANGES
reviewed_head_sha: "f751cc8981e4a336ccf84058bde7c57c52af465e"
merge_ready: false
mergeability:
mergeable: MERGEABLE
merge_state_status: UNSTABLE
blockers:
- id: safety_claim_matrix_follow_up_missing
description: "update_pr_body_hygiene 行の Not controlled 非空だが Follow-up に open issue 番号の参照がない (APPROVE 禁止: Safety Claim Matrix §4.6)"
severity: APPROVE_PROHIBITED
mechanical: false
- id: ac6_ci_scoped_evidence_missing
description: "test_implementation_worker_request_v2_contract.py が CI python-test ジョブ対象外のため CI_CHECK_RUN_SCOPED 証跡なし。PR body self-report のみでは APPROVE 不可 (PR_BODY_SELF_REPORT_ONLY_APPROVE_PROHIBITED)"
severity: APPROVE_PROHIBITED
mechanical: false
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests:
- title: "PreToolUse hook による update_pr_body_hygiene wrapper 実行時強制を実装する"
issue_kind: implementation
severity: mandatory_follow_up
blocking_merge_ready: false
source:
kind: pr_review
url: "https://github.com/squne121/loop-protocol/pull/638"
note_id: "1"
dedupe_key: "follow-up:squne121/loop-protocol:pr/638:1"
desired_destination: "update_pr_body_hygiene mode が runtime hook によって update_pr.py wrapper 経由実行を強制される状態"
validated_scope_delta: "PreToolUse hook を実装し、implementation-worker が update_pr_body_hygiene 実行時に update_pr.py 以外の gh pr edit 呼び出しをブロックする"
origin_skill: pr-review-judge
labels:
- triage-required
initial_label_profile: implementation
materialization: pending
- title: "CI python-test ジョブに .claude/skills/implement-issue/tests/ を追加する"
issue_kind: implementation
severity: mandatory_follow_up
blocking_merge_ready: false
source:
kind: pr_review
url: "https://github.com/squne121/loop-protocol/pull/638"
note_id: "2"
dedupe_key: "follow-up:squne121/loop-protocol:pr/638:2"
desired_destination: ".github/workflows/ci.yml の python-test ジョブが implement-issue/tests/ を実行し AC6 の CI_CHECK_RUN_SCOPED 証跡が取得可能になった状態"
validated_scope_delta: ".github/workflows/ci.yml に uv run pytest .claude/skills/implement-issue/tests/ のステップを追加する"
origin_skill: pr-review-judge
labels:
- triage-required
initial_label_profile: implementation
materialization: pending
TEST_VERDICT_MACHINEAC6 の pytest テストを orchestrator が直接実行し、機械可読証跡として記録します。 TEST_VERDICT_MACHINE_V1:
generated_at: "2026-06-03T12:05:30Z"
generated_by: impl-review-loop/orchestrator
pr_url: https://github.com/squne121/loop-protocol/pull/638
head_sha: "8343256336c7587a311def64f2622be3c52696bf"
test_file: ".claude/skills/implement-issue/tests/test_implementation_worker_request_v2_contract.py"
runner: "uv run pytest"
status: pass
summary:
passed: 44
failed: 0
errors: 0
note: "ci.yml への追加は .github/workflows/ci.yml が Allowed Paths 外のため #631 Stop Condition 該当。follow-up: #639"詳細実行結果: 44 tests / 0 failures(全クラス PASS)
|
squne121
left a comment
There was a problem hiding this comment.
判定: REQUEST_CHANGES
マージ可能性
- mergeable=MERGEABLE、merge_state_status=UNSTABLE
証跡確認
AC カバレッジ: AC1-AC5 は PR 本文の rg 結果と差分が整合。AC6 は TEST_VERDICT_MACHINE コメントが存在するが SHA 不一致のため証跡無効(後述 B1)。
Allowed Paths 遵守: 変更ファイル 3 件(implementation-worker.md、SKILL.md、テストファイル)はすべて Allowed Paths 内に収まっている。
CI 状況: PR Body Japanese Check(run 26883609880)が現 head SHA で conclusion=failure。ci ワークフロー(build/test/lint/typecheck/python-test/e2e)は全件 PASS。
Schema Change Applicability: decision: schema_change が存在する。
Safety Claim Matrix: セクション存在。partial 行の Follow-up 列に #639 参照あり。
Closes #631: PR 本文に記載あり。
ブロッカー
B1: TEST_VERDICT_MACHINE の head_sha が現 PR と不一致(APPROVE 禁止)
適用ルール: PR_REVIEW_JUDGE_APPROVE_PROHIBITION_SKIP_FALLBACK
TEST_VERDICT_MACHINE に記録された head_sha は 8343256336c7587a311def64f2622be3c52696bf だが、現在の PR head_sha は f751cc8981e4a336ccf84058bde7c57c52af465e であり一致しない。古い SHA の TEST_VERDICT_MACHINE は AC6 の証跡として無効であり APPROVE 禁止条件に該当する。現 head_sha に対して TEST_VERDICT_MACHINE を再取得する必要がある。
B2: CI チェック PR Body Japanese Check が現 head SHA で失敗
run 26883609880(workflowName: Check Japanese Content、headSha: f751cc8981...、conclusion: failure)。ログ要約: aggregate_ratio=0.375、failed_blocks=5。PR 本文の一部 prose block が日本語比率閾値(0.1)を満たしていない。CI fail は merge blocker。
非ブロッカー
なし
LOOP_VERDICT_V2
LOOP_VERDICT_V2:
verdict: REQUEST_CHANGES
reviewed_head_sha: f751cc8981e4a336ccf84058bde7c57c52af465e
merge_ready: false
mergeability:
mergeable: MERGEABLE
merge_state_status: UNSTABLE
blockers:
- id: B1
rule: PR_REVIEW_JUDGE_APPROVE_PROHIBITION_SKIP_FALLBACK
description: "TEST_VERDICT_MACHINE head_sha (8343256336c7587a311def64f2622be3c52696bf) が現 PR head_sha (f751cc8981e4a336ccf84058bde7c57c52af465e) と不一致。stale 証跡のため APPROVE 禁止。"
mechanical: false
- id: B2
rule: CI_FAIL_BLOCKER
description: "PR Body Japanese Check (run 26883609880) が現 head SHA f751cc8981... で conclusion=failure。aggregate_ratio=0.375、failed_blocks=5。"
mechanical: false
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests: []
TEST_VERDICT_MACHINE(AC6 pytest 実行証跡)AC6 の pytest テストを orchestrator が現在の head SHA で実行しました。 背景: 実行コマンド: 結果: 44 件 PASS / 0 件 FAIL TEST_VERDICT_MACHINE_V1:
generated_at: "2026-06-03T12:11:23Z"
generated_by: impl-review-loop/orchestrator
pr_url: https://github.com/squne121/loop-protocol/pull/638
head_sha: "f751cc8981e4a336ccf84058bde7c57c52af465e"
test_file: ".claude/skills/implement-issue/tests/test_implementation_worker_request_v2_contract.py"
runner: "uv run pytest"
status: pass
summary:
passed: 44
failed: 0
errors: 0
ci_yml_gap: true
ci_gap_followup: "#639" |
squne121
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Mergeability
- mergeable=MERGEABLE, merge_state_status=CLEAN
Evidence Check
- AC coverage: AC1-AC6 all described in PR body with specific rg evidence. AC5 pre-checked in Issue. AC6 pytest 44/44 PASS confirmed in TEST_VERDICT_MACHINE_V1 comment (head_sha: f751cc8, matches PR head).
- Allowed Paths: All 3 changed files within Allowed Paths (implementation-worker.md, SKILL.md, test file). No out-of-scope changes detected.
- CI Verification: All required checks pass — PR Body Japanese Check (pass), build/lint/test/typecheck/python-test/e2e/validate-generated-artifact all pass.
- Schema Change Applicability: decision: schema_change with Consumer Inventory (additive, backward_compatible), Compatibility Decision present.
- Safety Claim Matrix: Present. update_pr_body_hygiene row: Not controlled = runtime hook enforcement, Follow-up = #639. Bounded claim — docs-level prohibition only, consistent with issue Stop Conditions. No overclaim detected.
- Runtime Verification Applicability: decision: deferred, destination #634 (from Issue #631 contract). PR body references #639 for ci.yml gap follow-up.
- Closes #631: Present in PR body.
Blockers
なし
Non-blockers(任意改善)
- TEST_VERDICT_MACHINE comment uses
TEST_VERDICT_MACHINE_V1:YAML marker rather than<!-- TEST_VERDICT_MACHINE v1 -->HTML comment. Functionally equivalent for this review, but SKILL.md expects the HTML comment format. Alignment can be tracked in a follow-up.
LOOP_VERDICT_V2
LOOP_VERDICT_V2:
verdict: APPROVE
reviewed_head_sha: f751cc8981e4a336ccf84058bde7c57c52af465e
merge_ready: true
mergeability:
mergeable: MERGEABLE
merge_state_status: CLEAN
blockers: []
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests:
- title: "TEST_VERDICT_MACHINE comment format: HTML marker vs YAML marker alignment"
issue_kind: implementation
severity: optional_follow_up
blocking_merge_ready: false
source:
kind: pr_review
url: "https://github.com/squne121/loop-protocol/pull/638"
note_id: "1"
dedupe_key: "follow-up:squne121/loop-protocol:https://github.com/squne121/loop-protocol/pull/638:1"
desired_destination: "TEST_VERDICT_MACHINE comment consistently uses the HTML comment marker expected by SKILL.md"
validated_scope_delta: "Align TEST_VERDICT_MACHINE comment format to use <!-- TEST_VERDICT_MACHINE v1 --> HTML marker"
origin_skill: pr-review-judge
labels:
- triage-required
initial_label_profile: note_only
materialization: optional…step-5 - B1: required_auto_actions を array-of-objects schema として明示(string-list 扱い禁止) - kind/executor/blocking_merge_ready/expected_head_sha 必須フィールドとunknown→human_escalation を記載 - B2: fenced YAML 抽出方針を更新 — 「最初の```yaml block」依存禁止、 LOOP_VERDICT_V2含むブロック列挙・最新採用、prose中無視、malformed→human_escalation - B3: draft_pr_ready と github_merge_ready を分離 - DRAFT→github_merge_ready:false、HAS_HOOKS→github_merge_ready:true を routing table に追加 - B4: worker result status union 拡張 — stale_verdict/forbidden/validation_failed/ timeout/ok_rerun_required_true を routing table に追加(#631/#638 alignment) - B5: behavior fixture matrix テスト追加(7 fixture × routing logic 検証)、 AC10 の approved vs human_escalation 排他性チェックを強化 - B6: bidi 文字チェックテスト追加(既にクリーン、regression guard として) Refs #632 Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…tions == [] に統一 (#632) (#640) * feat(#632): impl-review-loop 終了条件を APPROVE && merge_ready && required_auto_actions == [] に統一 - step-5-feedback-and-termination.md: APPROVE 即終了ブロックを三段 gate 付き終了条件に変更 - required_auto_action_result_routing テーブルを追加(update_branch / body-only 分岐) - worker 失敗 (failed/blocked/permission_blocked) は human_escalation へ routing - IMPL_REVIEW_LOOP_RESULT_V1 (status: draft_pr_ready, merge_ready: true) emit を記述 - step-5-mergeability-handling.md: LOOP_VERDICT_V2 fenced YAML parse 方針を追加 - C5 vs C6 競合解消: APPROVE + BEHIND で termination_reason: approved を立てない注釈を追加 - required_auto_actions 列を routing テーブルに追加 - SKILL.md: 終了条件を APPROVE && merge_ready == true && required_auto_actions == [] に更新 - tests/test_termination_gate.py: AC1-AC12 に対応する 32 fixture テストを追加(全 PASS) Refs #626 Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(#632): iteration 2 — B1-B6 blockers resolved in impl-review-loop step-5 - B1: required_auto_actions を array-of-objects schema として明示(string-list 扱い禁止) - kind/executor/blocking_merge_ready/expected_head_sha 必須フィールドとunknown→human_escalation を記載 - B2: fenced YAML 抽出方針を更新 — 「最初の```yaml block」依存禁止、 LOOP_VERDICT_V2含むブロック列挙・最新採用、prose中無視、malformed→human_escalation - B3: draft_pr_ready と github_merge_ready を分離 - DRAFT→github_merge_ready:false、HAS_HOOKS→github_merge_ready:true を routing table に追加 - B4: worker result status union 拡張 — stale_verdict/forbidden/validation_failed/ timeout/ok_rerun_required_true を routing table に追加(#631/#638 alignment) - B5: behavior fixture matrix テスト追加(7 fixture × routing logic 検証)、 AC10 の approved vs human_escalation 排他性チェックを強化 - B6: bidi 文字チェックテスト追加(既にクリーン、regression guard として) Refs #632 Co-Authored-By: Claude Sonnet 4.6 <[email protected]> --------- Co-authored-by: Claude Sonnet 4.6 <[email protected]>
概要
本 PR は
implementation-workerにIMPLEMENTATION_WORKER_REQUEST_V2モードを追加し、PR repair executor として機能させます(Issue #631、親 Issue #626 の child-4)。主な変更内容は以下の通りです:
implementation-worker.mdにIMPLEMENTATION_WORKER_REQUEST_V2およびIMPLEMENTATION_WORKER_RESULT_V2スキーマを追加。PR repair executor モード(update_pr_body_hygiene、update_branch、apply_pr_review_fix_delta)を定義します。required_auto_actions.kind → worker modeルーティングテーブルを定義。既知の 4 種類の kind と、不明 kind に対する決定論的 blocked ルールを記述しています。open-pr/scripts/update_pr.pywrapper 経由を必須とし、worker や SKILL.md から直接gh pr edit --body-fileを呼び出すことを明示的に禁止します。update_branchモードの GitHub REST API セマンティクスを文書化。expected_head_sha必須、202/422/403 ステータス別分岐、before/after head SHA の記録、成功後の rerun 必須などを明記します。pr-hygiene-fixer.md、branch-syncer.md等の新規ファイル作成は Stop Condition として明記します。.claude/skills/implement-issue/tests/test_implementation_worker_request_v2_contract.pyに 38 件の決定論的 pytest テストを追加します。親 Issue #626 を参照。Closes #631、Refs #626。
検証結果
各 AC の検証コマンドはすべて PASS しました。
rg "IMPLEMENTATION_WORKER_REQUEST_V2"4 件、rg "IMPLEMENTATION_WORKER_RESULT_V2"6 件いずれも確認済みrg "ensure_closing_keyword"でルーティングテーブル行への記載を確認rg "update_pr\.py"で wrapper 強制ルール 8 箇所への記載を確認rg "expected_head_sha"4 件、SKILL.md への V2 参照も確認pr-hygiene-fixer.mdおよびbranch-syncer.mdの不在を確認(PASS)uv run pytestで 38 件全件 PASS を確認品質ゲート
標準品質ゲートはすべて PASS しました。
pnpm typecheck— PASS(型エラーなし)pnpm lint— PASS(ESLint エラーなし)pnpm test— PASS(339 件の Vitest テストが全件通過)pnpm build— PASS(vite build 成功)Allowed Paths 遵守
Allowed Paths 外のファイルは変更していません。変更したファイルは以下の通りです。
.claude/agents/implementation-worker.md— 変更(V2 スキーマ追加).claude/skills/implement-issue/SKILL.md— 追記のみ(V2 参照セクション).claude/skills/implement-issue/tests/test_implementation_worker_request_v2_contract.py— 新規追加(38 件のテスト)Schema Change Applicability(スキーマ変更適用性)
本 PR が machine-readable contract を変更するかどうかを宣言します。
schema_changeIMPLEMENTATION_WORKER_REQUEST_V2およびIMPLEMENTATION_WORKER_RESULT_V2を新規追加。既存スキーマへの非破壊的追加(additive)。現時点では他ファイルからの参照なし(将来の consumer はimpl-review-loopの Step 5 dispatch、対応スコープは 導入: issue-refinement-loop → impl-review-loop 遷移の自動化(スキル間 handoff contract 欠落の統合修正) #626/実装: impl-review-loop の終了条件を APPROVE && merge_ready && required_auto_actions == [] に統一し終了 gate を実装する #632)。Schema Consumer Inventory(スキーマ利用者一覧)
変更対象スキーマの利用者を列挙し、互換性を確認します。
変更対象 schema:
IMPLEMENTATION_WORKER_REQUEST_V2/IMPLEMENTATION_WORKER_RESULT_V2before/after 差分:
Consumer 列挙(rg コマンド例と結果):
現時点でスキーマを実際に consume するコード・skill は存在しない。将来の consumer は
impl-review-loopStep 5(#626/#632 スコープ)。Consumer 更新状況:
.claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.mdimpl-review-loop全体Compatibility Decision(互換性判定)
additivebackward_compatiblenoIMPLEMENT_RESULT_V1)を変更せず新規スキーマを追加。既存のimplement_issueフロー(V1)は変更なし。Safety Claim Matrix(安全性主張マトリクス)
安全境界・権限・実行時制御に関する主張を記録します。
本 PR は
.claude/agents/implementation-worker.mdのpermissionMode: acceptEditsを変更しない(docs 追記のみ)。update_pr_body_hygienemode がopen-pr/scripts/update_pr.pywrapper 経由を必須とすることで、worker からの直接gh pr edit --body-fileを禁止している(docs レベルの制御)。update_pr_body_hygieneはupdate_pr.pywrapper 経由のみrg "update_pr\.py" .claude/agents/implementation-worker.md→ 8 件update_branchは GitHub REST API に限定rg "expected_head_sha" .claude/agents/implementation-worker.md→ 5 件apply_pr_review_fix_deltaは Allowed Paths 内のみrg "allowed_paths_snapshot" .claude/agents/implementation-worker.mdtest ! -e .claude/agents/pr-hygiene-fixer.mdPASS / pytest 44/44 PASSpermissionMode: acceptEditsは変更しないgit diff main HEAD .claude/agents/implementation-worker.md | grep permissionMode→ 変更なしNot controlled 非空の理由:
update_pr_body_hygieneの wrapper-only 制限は本 PR では docs レベルの prohibition に留まる。実行時強制(PreToolUse hook 等)は #631 Out of Scope(Stop Condition: 外部サービス利用・権限昇格・既存テスト大規模改変に相当)。後続 Issue で対応予定。Notes(補足)
test_implementation_worker_request_v2_contract.py) の ci.yml 追加は Allowed Paths 外(.github/workflows/ci.yml)のため Stop Condition 該当。follow-up Issue で対応