Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: none
goal_ref: impl-review-loop の TEST_VERDICT / LOOP_VERDICT / Step 2 / Step 5 が MERGEABLE+BEHIND を CONFLICTING/DIRTY/BLOCKED 扱いせず Step 4 / approved へ進める
change_kind: docs
related:
- "#56: merge_state_status / mergeStateStatus の key 統一は別 Issue"
- "#67: Step 5 BEHIND 分岐 + update-branch 自動化を扱う Issue(本 PR #439 で schema 拡張部分を absorb、#67 は update-branch 自動化のみ残る予定)"
scope_expanded_at: "2026-05-27T22:55:00Z"
scope_expansion_reason: "PR #439 への REQUEST_CHANGES (https://github.com/squne121/loop-protocol/pull/439#issuecomment-4559243138) により、Step 2 のみ修正は schema producer/consumer 不整合を生むことが判明。test-runner / pr-review-judge / Step 5 を同時修正する scope 拡張を人間承認"Parent Issue
なし(単独改善)
Parent Goal Ref
- Goal:
impl-review-loopの TEST_VERDICT producer (test-runner)、LOOP_VERDICT consumer (pr-review-judge)、Step 2 routing、Step 5 mergeability handling のすべてがmergeable=MERGEABLEかつmerge_state_status=BEHINDの PR を CONFLICTING/DIRTY/BLOCKED と同列視せず、PR Review 継続および APPROVE 経路に載せる状態 - Desired Destination:
TEST_VERDICT.merge_state_status/LOOP_VERDICT.mergeStateStatusenum と Step 2 / Step 5 判定表の双方でBEHINDが mergeable-but-out-of-date 状態として一貫して扱われている状態
Current Validated Scope
.claude/skills/impl-review-loop/steps/step-2-verification.md:TEST_VERDICT.merge_state_statusenum にBEHIND追加、判定表にPASS + MERGEABLE + BEHIND => Step 4行追加、CONFLICTING/DIRTY/BLOCKED 非同一視注記、Step 2 内 update-branch/rebase 非対応 + Step 5/実装: impl-review-loop Step 5 に BEHIND 分岐と auto update-branch を追加し schema を拡張する #67 委譲注記.claude/agents/test-runner.md:TEST_VERDICT.merge_state_statusenum にBEHIND追加、BEHIND検出時の FAIL 化を行わない(PASS 経路へ通す)旨を明記.claude/skills/pr-review-judge/SKILL.md:LOOP_VERDICT.mergeStateStatusenum と「pass 条件」にBEHIND追加、BEHINDを Conflict blocker / Merge blocker として REQUEST_CHANGES しない旨を明記.claude/skills/impl-review-loop/steps/step-5-mergeability-handling.md: 判定表にAPPROVE + MERGEABLE + BEHIND => approved行追加(update-branch 自動化は 実装: impl-review-loop Step 5 に BEHIND 分岐と auto update-branch を追加し schema を拡張する #67 に分離).claude/agents/pr-reviewer-lite.md:mergeStateStatusenum にBEHIND追加.claude/skills/impl-review-loop/steps/step-4-pr-review.md:mergeStateStatusenum にBEHIND追加
Remaining Parent Gaps
#67: Step 5 / Step 2 のBEHIND列挙値追加部分は本 PR で absorb 済み。#67の残責務はgh pr update-branch自動化とbranch_behind_mainschema 等の 挙動拡張 のみDRAFT/HAS_HOOKSの Step 2 / Step 5 における扱いは out-of-scope(follow-up Issue で扱う)
Outcome
下記 4 ファイル変更が main にマージされ、BEHIND を含む決定論的 grep がすべて pass する状態:
.claude/skills/impl-review-loop/steps/step-2-verification.md.claude/agents/test-runner.md.claude/skills/pr-review-judge/SKILL.md.claude/skills/impl-review-loop/steps/step-5-mergeability-handling.md.claude/agents/pr-reviewer-lite.md.claude/skills/impl-review-loop/steps/step-4-pr-review.md
In Scope
- 上記 4 ファイルの
BEHIND追加(enum + 判定表 + 注記) - PR description に Schema Consumer Inventory(
TEST_VERDICT/LOOP_VERDICTの producer / consumer 影響)を明記 - PR description に Safety Claim Matrix(
.claude/skills/**配下変更につき safety-sensitive=true 扱い)を明記 - Step 2 / Step 5 の文書で
BEHINDをCONFLICTING / DIRTY / BLOCKEDと同一視しない旨を明記 - update-branch / rebase 自動化は本 PR では実装せず
#67の責務として参照のみ
Out of Scope
gh pr update-branchの自動実行・rebase 自動化(→ 実装: impl-review-loop Step 5 に BEHIND 分岐と auto update-branch を追加し schema を拡張する #67 の残責務)mergeStateStatus/merge_state_statusの key 命名統一(→ 実装: LOOP_VERDICT / TEST_VERDICT_MACHINE の YAML キー名を snake_case に統一する #56 の責務)DRAFT/HAS_HOOKS等 GitHub MergeStateStatus enum の網羅化(→ follow-up Issue)BLOCKED状態の取り扱い変更(既存のまま)branch_behind_main等 実装: impl-review-loop Step 5 に BEHIND 分岐と auto update-branch を追加し schema を拡張する #67 で扱う schema 拡張フィールド(本 PR は enum 追加のみ)
Acceptance Criteria
- AC1:
step-2-verification.mdのTEST_VERDICT.merge_state_statusenum にBEHINDが含まれる - AC2:
step-2-verification.mdの判定表にPASS + MERGEABLE + BEHINDの行が存在し Step 4 へ進む旨を示す - AC3:
step-2-verification.mdにBEHINDをCONFLICTING / DIRTY / BLOCKEDと同一視しない旨が明記されている - AC4:
step-2-verification.mdで Step 2 がupdate-branch/rebaseを扱わず#67/ Step 5 に分離する旨が明記されている - AC5:
test-runner.mdのTEST_VERDICT.merge_state_statusenum にBEHINDが含まれる - AC6:
pr-review-judge/SKILL.mdのLOOP_VERDICT.mergeStateStatusenum にBEHINDが含まれる - AC7:
pr-review-judge/SKILL.mdでmergeStateStatus=BEHINDが REQUEST_CHANGES の Conflict/Merge blocker に該当しない旨が明記されている - AC8:
step-5-mergeability-handling.mdの判定表にAPPROVE + MERGEABLE + BEHIND => approvedの行が存在する - AC9:
pr-reviewer-lite.mdのmergeStateStatusenum にBEHINDが含まれる - AC10:
step-4-pr-review.mdのmergeStateStatusenum にBEHINDが含まれる
Verification Commands
# AC1
$ rg -n 'merge_state_status:.*BEHIND' .claude/skills/impl-review-loop/steps/step-2-verification.md
# AC2
$ rg -n 'PASS.*MERGEABLE.*BEHIND.*Step 4' .claude/skills/impl-review-loop/steps/step-2-verification.md
# AC3
$ rg -n 'BEHIND.*(CONFLICTING|DIRTY|BLOCKED).*(同一視|該当しない|ではない)' .claude/skills/impl-review-loop/steps/step-2-verification.md
# AC4
$ rg -n '(update-branch|rebase).*(#67|Step 5)' .claude/skills/impl-review-loop/steps/step-2-verification.md
# AC5
$ rg -n 'merge_state_status:.*BEHIND' .claude/agents/test-runner.md
# AC6
$ rg -n 'mergeStateStatus:.*BEHIND' .claude/skills/pr-review-judge/SKILL.md
# AC7
$ rg -n 'BEHIND.*(blocker.*該当しない|REQUEST_CHANGES.*しない|conflict.*ではない)' .claude/skills/pr-review-judge/SKILL.md
# AC8
$ rg -n 'APPROVE.*MERGEABLE.*BEHIND.*approved' .claude/skills/impl-review-loop/steps/step-5-mergeability-handling.md
# AC9
$ rg -n 'mergeStateStatus:.*BEHIND' .claude/agents/pr-reviewer-lite.md
# AC10
$ rg -n 'mergeStateStatus:.*BEHIND' .claude/skills/impl-review-loop/steps/step-4-pr-review.mdbaseline 期待: AC1〜AC4 は PR #439 既にマージ済(worktree 上)。AC5〜AC8 は main では未反映 → baseline fail。
Runtime Verification Applicability
decision: not_applicable
reason: docs-only change to .claude/skills/** and .claude/agents/test-runner.md. AC1-AC8 are deterministic rg-based text checks. No UI / runtime behavior / process startup affected.
policy_ref: docs/dev/runtime-verification-policy.mdAllowed Paths
.claude/skills/impl-review-loop/steps/step-2-verification.md.claude/agents/test-runner.md.claude/skills/pr-review-judge/SKILL.md.claude/skills/impl-review-loop/steps/step-5-mergeability-handling.md.claude/agents/pr-reviewer-lite.md.claude/skills/impl-review-loop/steps/step-4-pr-review.md
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(enum 値集合・判定表構造)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
Required Skills
なし
Delivery Rule
1 Issue = 1 PR。Draft PR (#439) を継続使用し、AC 検証後に Ready for Review へ移行する。
Background
PR #49 観測で mergeable: MERGEABLE かつ mergeStateStatus: BEHIND の状態でも実装は妥当であることが確認された。
GitHub GraphQL MergeStateStatus.BEHIND は「head ref が base branch より古い」状態であり、MergeableState.MERGEABLE と両立するため CONFLICTING / DIRTY と同列視は意味論的に誤り(GitHub Docs)。
PR #439 初版は Allowed Paths を step-2-verification.md のみに絞ったが、TEST_VERDICT.merge_state_status enum を変更したため schema producer (test-runner.md) / consumer (pr-review-judge/SKILL.md, step-5-mergeability-handling.md) との不整合を生じる REQUEST_CHANGES(https://github.com/squne121/loop-protocol/pull/439#issuecomment-4559243138)を受けた。本 Issue は scope を上記 4 ファイルに拡張し、docs/dev/schema-governance.md の Consumer Inventory 要件と pr-review-judge の Safety Claim Gate に対応する。
責務境界の確認:
#67の残責務:gh pr update-branch自動化、branch_behind_main等の 挙動拡張 schema フィールド(本 PR は enum 値追加のみで absorb 済み)#56の責務:merge_state_status/mergeStateStatusの key 命名統一implement-issueは producer 側手順であり対象外
branch protection 注記: "Require branches to be up to date before merging" が有効な場合、BEHIND は最終 merge 前に update が必要だが、それは Step 5 / #67 の責務であり、Step 2 / Step 4 ではレビュー継続を妨げない。
source: PR #49 post-merge follow-up, observation memo G, Issue #52 anchor comment (#52 (comment)), PR #439 REQUEST_CHANGES (#439 (comment))
Activity
squne121 commentedon May 27, 2026
人間からのコメントです。
「.claude/skills/impl-review-loop/steps/step-2-verification.md」ではなく .claude/skills/implement-issue や .claude/skills/pr-review-judge や .claude/agents/test-runner.md で検知すべきでは?
squne121 commentedon May 27, 2026
結論: その人間コメントは概ね正しいです。ただし「
step-2-verification.mdではなく」ではなく、「step-2-verification.mdだけに閉じるのが誤り」が正確です。#52 は現在、Allowed Paths を
.claude/skills/impl-review-loop/steps/step-2-verification.mdだけに限定し、他ステップ変更も Out of Scope にしています。(GitHub) しかし実際の責務境界を見ると、impl-review-loopは「実装→検証→PRレビュー」を束ねる orchestrator で、Step 2 はtest-runnerに検証を委譲し、Step 4 はpr-reviewer / pr-review-judgeに委譲します。(GitHub)採るべき責務分担
場所 | 役割 | #52での扱い -- | -- | -- .claude/agents/test-runner.md | mergeable / mergeStateStatus の一次検知・TEST_VERDICT 生成 | 修正必須 .claude/skills/pr-review-judge/SKILL.md | APPROVE / REQUEST_CHANGES の最終判定ゲート | 修正必須 .claude/skills/impl-review-loop/steps/step-2-verification.md | test-runner の結果を読んで loop routing するだけ | 追従修正は必要 .claude/skills/implement-issue/SKILL.md | 実装、VC実行、PR作成まで | 原則ここではないtest-runnerはすでにgh pr view <PR番号> --json mergeable,mergeStateStatusを実行する設計で、説明にも「mergeable 状態の検知も担当」とあります。(GitHub) ただし現在のTEST_VERDICTschema はmerge_state_status: CLEAN | DIRTY | BLOCKED | UNSTABLE | UNKNOWNで、BEHINDが抜けています。(GitHub) ここが一次バグです。pr-review-judge側も同様に、TEST_VERDICT_MACHINEからmergeableとmerge_state_statusを読む設計なのに、判定ではMERGEABLE + CLEAN|UNSTABLEだけを通過条件にしています。(GitHub) つまりBEHINDを test-runner が正しく出しても、review gate が通さない可能性があります。GitHub公式の GraphQL enum では、
BEHINDは「head ref が out of date」、DIRTYは「merge commit を clean に作れない」、MERGEABLEは「PR can be merged」、CONFLICTINGは「merge conflicts により merge できない」と定義されています。したがってMERGEABLE + BEHINDをCONFLICTING / DIRTYと同列に扱うのは意味論的に誤りです。(GitHub Docs)Issue #52 への敵対的判断
現在の #52 は REQUEST_CHANGES 相当です。
理由は、問題の発生源を
impl-review-loop Step 2 の表現不足として過小定義しているためです。PR #49 の観測メモでは「MERGEABLEだがBEHIND」「CLEAN/UNSTABLE のみ APPROVE 可と読める」とされ、改善先をstep-2-verification.mdに限定しています。(GitHub) しかし現行実装ではtest-runnerの出力 schema とpr-review-judgeの判定表にも同じ欠落があります。step-2だけ直すと、orchestrator 文書だけが正しくなり、実際の検知・最終判定は壊れたまま残ります。推奨する人間コメント案
最小修正方針
#52 は閉じずに直すなら、タイトルを次のように変えるのが妥当です。
Allowed Paths は最低限これです。
.claude/skills/pr-review-judge/SKILL.md.claude/skills/impl-review-loop/steps/step-2-verification.md
([[Past chat](https://chatgpt.com/c/6a0f1710-fa30-83e8-ad41-24c10af2c392)][1])([[Past chat](https://chatgpt.com/c/6a127f0e-11a4-83e8-bd0a-03d487df6673)][2])([[Past chat](https://chatgpt.com/c/6a110213-865c-83e8-a78f-62698736b910)][3])([[Past chat](https://chatgpt.com/c/6a162dab-542c-83e8-8523-dc97a17a0b6c)][4])([[Past chat](https://chatgpt.com/c/6a0f7c47-1174-83e9-9a9b-48bb113f5ac7)][5])([[Past chat](https://chatgpt.com/c/6a110223-2cc4-83e8-ac17-9a8a3022451a)][6])([[Past chat](https://chatgpt.com/c/6a174a67-5d5c-83e8-b44c-bcabc9a27727)][7])([[Past chat](https://chatgpt.com/c/6a16f963-f978-83e8-866c-a8b3d8130fad)][8])([[Past chat](https://chatgpt.com/c/6a110f2e-9f80-83e8-832a-8f476804b98d)][9])([[Past chat](https://chatgpt.com/c/6a125253-a148-83e8-8f7c-3b0286e440a8)][10])([[Past chat](https://chatgpt.com/c/6a12dea9-6b94-83e8-a014-34317f8fd915)][11])([[Past chat](https://chatgpt.com/c/6a118f70-5578-83e8-9124-7247cc445b95)][12])([[Past chat](https://chatgpt.com/c/6a126619-7c28-83e8-a344-c494f126a9b4)][13])([[Past chat](https://chatgpt.com/c/6a1265fa-6694-83e9-beea-1c280d7bfd74)][14])([[Past chat](https://chatgpt.com/c/6a129c23-71d4-83e8-ba76-3116286aa8c4)][15])([[Past chat](https://chatgpt.com/c/6a0ee4e2-8e20-83e9-b9df-32e83c1bac3c)][16])([[Past chat](https://chatgpt.com/c/6a114ffe-35c8-83e8-b0e9-de8e2a387c6d)][17])([[Past chat](https://chatgpt.com/c/6a10f60b-5724-83e8-88d0-ada6f99e256c)][18])([[Past chat](https://chatgpt.com/c/6a161b59-d5bc-83e9-91e3-2532dbdfa277)][19])([[Past chat](https://chatgpt.com/c/6a126abf-4e50-83e9-be92-84fadb9d9680)][20])([[Past chat](https://chatgpt.com/c/6a0f1f8f-64d0-83e8-8310-df073f256444)][21])([[Past chat](https://chatgpt.com/c/6a11935d-52f4-83e8-8332-9d1879f175c5)][22])([[Past chat](https://chatgpt.com/c/6a115c7e-d60c-83e8-bf8a-33446c77bec1)][23])([[Past chat](https://chatgpt.com/c/6a1264b1-9eec-83e8-a0e4-b10745a6971b)][24])([[Past chat](https://chatgpt.com/c/6a12a215-c848-83e8-be71-5ef3365556fe)][25])([[Past chat](https://chatgpt.com/c/6a0db1c7-e9a4-83e9-bc52-877e772f6b68)][26])([[Past chat](https://chatgpt.com/c/6a127aaf-1ae0-83e8-819f-baf78a2a9b36)][27])([[Past chat](https://chatgpt.com/c/6a1753bd-95ec-83e9-918f-770bd34aa224)][28])([[Past chat](https://chatgpt.com/c/6a09b66e-3ca4-83e8-be68-83d9594d9ce6)][29])([[Past chat](https://chatgpt.com/c/6a0e3816-8880-83e8-90a6-030935f2e749)][30])([[Gmail](https://mail.google.com/mail/#all/19d8949a7b5f318c)][31])([[Gmail](https://mail.google.com/mail/#all/19d8949a7703207b)][32])([[Gmail](https://mail.google.com/mail/#all/19e4050db3652270)][33])([[Gmail](https://mail.google.com/mail/#all/19e4054a978e315e)][34])([[Gmail](https://mail.google.com/mail/#all/19e405c2a872231a)][35])([[Gmail](https://mail.google.com/mail/#all/19e40c640fc80e0d)][36])([[Gmail](https://mail.google.com/mail/#all/19e41a5d603e4e66)][37])([[Gmail](https://mail.google.com/mail/#all/19d89419ae7ce12f)][38])([[Gmail](https://mail.google.com/mail/#all/19d893c88c31f8a8)][39])([[Gmail](https://mail.google.com/mail/#all/19d893c874df5b8a)][40])([[Gmail](https://mail.google.com/mail/#all/19d893c865829e6d)][41])([[Gmail](https://mail.google.com/mail/#all/19d893c852cc18eb)][42])([[Files](file://my_files/file_00000000d5d472069c2cc8cf0cacf1b4)][43])([[Files](file://my_files/file_00000000278072069781cc69a065e297)][44])([[Files](file://my_files/file_0000000022107207982a0b9798058548)][45])([[Files](file://my_files/file_00000000d7287206ac522b5f35dbe137)][46])([[Files](file://my_files/file_00000000f5987209aacfee825fc17d1d)][47])implement-issueは今回は外してよいです。ここに入れると「PR状態の検知」と「実装作業」が混ざり、責務境界が悪化します。結論: その人間コメントは概ね正しいです。ただし「
step-2-verification.mdではなく」ではなく、「step-2-verification.mdだけに閉じるのが誤り」が正確です。#52 は現在、Allowed Paths を
.claude/skills/impl-review-loop/steps/step-2-verification.mdだけに限定し、他ステップ変更も Out of Scope にしています。([GitHub]48) しかし実際の責務境界を見ると、impl-review-loopは「実装→検証→PRレビュー」を束ねる orchestrator で、Step 2 はtest-runnerに検証を委譲し、Step 4 はpr-reviewer / pr-review-judgeに委譲します。([GitHub]49)採るべき責務分担
.claude/agents/test-runner.md.claude/skills/pr-review-judge/SKILL.md.claude/skills/impl-review-loop/steps/step-2-verification.md.claude/skills/implement-issue/SKILL.mdtest-runnerはすでにgh pr view <PR番号> --json mergeable,mergeStateStatusを実行する設計で、説明にも「mergeable 状態の検知も担当」とあります。([GitHub]50) ただし現在のTEST_VERDICTschema はmerge_state_status: CLEAN | DIRTY | BLOCKED | UNSTABLE | UNKNOWNで、BEHINDが抜けています。([GitHub]50) ここが一次バグです。pr-review-judge側も同様に、TEST_VERDICT_MACHINEからmergeableとmerge_state_statusを読む設計なのに、判定ではMERGEABLE + CLEAN|UNSTABLEだけを通過条件にしています。([GitHub]51) つまりBEHINDを test-runner が正しく出しても、review gate が通さない可能性があります。GitHub公式の GraphQL enum では、
BEHINDは「head ref が out of date」、DIRTYは「merge commit を clean に作れない」、MERGEABLEは「PR can be merged」、CONFLICTINGは「merge conflicts により merge できない」と定義されています。したがってMERGEABLE + BEHINDをCONFLICTING / DIRTYと同列に扱うのは意味論的に誤りです。([GitHub Docs]52)Issue #52 への敵対的判断
現在の #52 は REQUEST_CHANGES 相当です。
理由は、問題の発生源を
impl-review-loop Step 2 の表現不足として過小定義しているためです。PR #49 の観測メモでは「MERGEABLEだがBEHIND」「CLEAN/UNSTABLE のみ APPROVE 可と読める」とされ、改善先をstep-2-verification.mdに限定しています。([GitHub]53) しかし現行実装ではtest-runnerの出力 schema とpr-review-judgeの判定表にも同じ欠落があります。step-2だけ直すと、orchestrator 文書だけが正しくなり、実際の検知・最終判定は壊れたまま残ります。推奨する人間コメント案
最小修正方針
#52 は閉じずに直すなら、タイトルを次のように変えるのが妥当です。
Allowed Paths は最低限これです。
implement-issueは今回は外してよいです。ここに入れると「PR状態の検知」と「実装作業」が混ざり、責務境界が悪化します。squne121 commentedon May 27, 2026
判定: REQUEST_CHANGES
Issue #52 の問題意識は正しいです。PR #49 で実際に
mergeable: MERGEABLEかつmergeStateStatus: BEHINDの状態でも全 AC が通り、レビュアーは APPROVE していました。一方で、現行 Step 2 の判定表はCLEAN/UNSTABLEしか APPROVE 経路に載せておらず、BEHINDが欠落しています。これは Issue #52 の主張どおり補正すべきです。([GitHub]1)ただし、Issue #52 の現在のスコープと AC のまま実装すると、仕様の一貫性が壊れる可能性が高いです。Step 2 の表だけに
BEHIND行を足すのでは不足です。ブロッカー
1. Step 2 の schema enum が
BEHINDを許していないIssue #52 は「Step 2 判定表に
MERGEABLE + BEHINDを追加」としていますが、現行のstep-2-verification.mdはTEST_VERDICTのmerge_state_statusをCLEAN | UNSTABLE | DIRTY | BLOCKED | UNKNOWNと定義しており、BEHINDが enum に入っていません。つまり、表にBEHIND行を足しても、同じ文書内の schema と矛盾します。([GitHub]2)修正要求: Issue #52 の In Scope に「Step 2 の
TEST_VERDICT.merge_state_statusenum にBEHINDを追加する」を明記してください。表だけでは不十分です。2. AC3 / VC3 が現在の baseline でも通る弱い検証になっている
Issue #52 の AC3 は「
BEHINDはCONFLICTINGではない、runbook 発動条件ではない」とする意図ですが、提示されている verification はgrep -q "CONFLICTING"に近く、現行 Step 2 には既にCONFLICTING / DIRTY行があるため、実装前から通る false positive になります。([GitHub]3)修正要求:
BEHINDとCONFLICTING/DIRTY/Runbookの関係を同じ近傍で検証する grep に変えてください。例:
3.
BEHINDを「merge 時に自動解決される」と言い切るのは危険GitHub GraphQL の
MergeStateStatus.BEHINDは「head ref が out of date」という状態であり、MergeableState.MERGEABLEとは別軸です。MERGEABLE + BEHINDはコンフリクトを直接意味しませんが、branch protection で「merge 前に base branch へ追随していること」が要求されている場合、更新・rebase・再チェックが必要になります。([GitHub Docs]4)修正要求: Step 2 の文言は「Step 4 へ進める / review 可能」に留めるべきです。
「merge 時に自動解決」「rebase 不要」と読める文言は避けてください。
BEHINDの更新処理は Step 5 / Issue #67 の責務に分離するのが妥当です。4. #52 は #67 と #56 への依存関係を明記しないと破綻する
関連 Issue #67 は、まさに Step 5 側で
BEHIND分岐、gh pr update-branch、branch_behind_main、reviewer recommendations を扱う設計です。さらに #67 は #52 の merge 後に進める前提になっています。([GitHub]5)また #56 は
mergeStateStatusとmerge_state_statusの key 混在を直す Issue です。PR #49 の観測でも、TEST_VERDICTは snake_case、LOOP_VERDICTは camelCase、Step 5 grep は camelCase という不一致が確認されています。([GitHub]1)修正要求: Issue #52 に以下を明記してください。
5. 「SubAgent が PR mergeability を誤判定しない」はスコープ過大
Issue #52 の目的は Step 2 の判定表補正ですが、実際には
test-runner.md、pr-review-judge/SKILL.md、Step 4、Step 5 の schema もBEHINDを完全には扱えていません。特にpr-review-judgeはMERGEABLE + CLEAN/UNSTABLEのみを通常経路としており、Step 5 もCLEAN/UNSTABLEしか approve exit にしていません。([GitHub]6)修正要求: #52 のゴールを狭めてください。
悪い例:
良い例:
推奨する Issue #52 の修正版スコープ
推奨 AC / VC
AC2: MERGEABLE + BEHIND は Step 4 へ進む
判定表に
PASS + MERGEABLE + BEHIND => Step 4が存在する。Verification:
grep -nE 'PASS.*MERGEABLE.*BEHIND.*Step 4' .claude/skills/impl-review-loop/steps/step-2-verification.mdAC3: BEHIND は conflict runbook 条件ではない
BEHINDをCONFLICTING/DIRTY/BLOCKEDと同一視しない注記がある。Verification:
grep -nE 'BEHIND.*(CONFLICTING|DIRTY|BLOCKED).*ではない|BEHIND.*Runbook.*発動条件.*該当しない' .claude/skills/impl-review-loop/steps/step-2-verification.mdAC4: update-branch は Step 2 で扱わない
Step 2 は review へ進めるだけで、branch update / rebase / merge automation を実行しない。
Verification:
grep -nE 'update-branch|rebase|Step 5|#67' .claude/skills/impl-review-loop/steps/step-2-verification.mdsqune121 commentedon May 27, 2026
issue-refinement-loop result
Applied changes
anchor comment の REQUEST_CHANGES 指摘に従って Issue 本文を以下のとおり書き換えました。
TEST_VERDICT.merge_state_statusenum へのBEHIND追加、判定表行追加、CONFLICTING/DIRTY/BLOCKED 非同一視の注記、update-branch/rebaseは#67に分離を追記test-runner.md/pr-review-judge/SKILL.mdの修正は#67の責務、key 命名統一は#56の責務に明示分離rgベースの決定論的 grep に統一。AC3 は baseline で fail することを担保(旧 VC は CONFLICTING の単純 grep で false positive だった指摘を反映)#56/#67への依存関係をMachine-Readable Contract.relatedに明記decision: not_applicable(docs-only / 決定論的 rg 検証)を追加BEHINDを「merge 時に自動解決」と言い切る記述は削除し、MergeStateStatus.BEHINDの意味論と責務境界を明確化Deterministic checks (check_issue_contract.py)
C1〜C13 すべて
pass/n/a、blocking_issues なし。Allowed Paths
.claude/skills/impl-review-loop/steps/step-2-verification.mdのみ(anchor comment の最終結論どおり狭く維持し、test-runner/pr-review-judgeへの波及は#67へ escalate)。Next
issue-contract-reviewskill で go 判定を取得後、implementation に着手可能。squne121 commentedon May 27, 2026
Contract Snapshot (2026-05-27T22:01:11Z)
.claude/skills/impl-review-loop/steps/step-2-verification.mdに enum 追加・判定表行・非同一視注記・update-branch 分離が main にマージされているrg検証.claude/skills/impl-review-loop/steps/step-2-verification.md.claude/worktrees/issue-52-step-2-mergeable-behindworktree-issue-52-step-2-mergeable-behindsqune121 commentedon May 27, 2026
implement-issue: 実装完了 (2026-05-27T22:03:48Z)
.claude/worktrees/issue-52-step-2-mergeable-behindworktree-issue-52-step-2-mergeable-behindfeat(#52): BEHIND enum を schema consumer 全体に伝播し producer/consumer 整合を…
squne121 commentedon May 27, 2026
PR #439 拡張完了 — AC1-8 全 PASS
人間承認によるスコープ拡張(AC5-8 + Allowed Paths 追加)を実装し、PR #439 を更新しました。
AC 達成状況
merge_state_statusenum に BEHINDPASS + MERGEABLE + BEHIND => Step 4行merge_state_statusenum に BEHIND 追加mergeStateStatusenum に BEHIND 追加mergeStateStatus=BEHINDは Conflict/Merge blocker 非該当APPROVE + MERGEABLE + BEHIND => approved行追加Regression Gate
pnpm typecheck / lint / test / build、uv run pytest test_model_routing.py — 全 PASS
Producer/Consumer 整合
Schema Consumer Inventory を PR 本文に追記。TEST_VERDICT producer(test-runner.md)と全 consumer(step-2, step-5, pr-review-judge)を同一 PR 内で同期済み。
PR: #439
fix(#52): add BEHIND to mergeStateStatus enum in pr-reviewer-lite and…
squne121 commentedon May 27, 2026
AC1-10 全 PASS 報告(scope 2nd 拡張完了)
PR #439 に 2 ファイル追加修正を commit・push しました。
追加修正ファイル
.claude/agents/pr-reviewer-lite.md—mergeStateStatusenum にBEHINDを追加(AC9).claude/skills/impl-review-loop/steps/step-4-pr-review.md—mergeStateStatusenum にBEHINDを追加(AC10)VC PASS 確認
rg -n 'mergeStateStatus:.*BEHIND' .claude/agents/pr-reviewer-lite.md→ L195)rg -n 'mergeStateStatus:.*BEHIND' .claude/skills/impl-review-loop/steps/step-4-pr-review.md→ L25)Regression Gate
pnpm typecheckpnpm lintpnpm testpnpm builduv run pytest test_model_routing.pyPR body の
## Schema Consumer Inventoryにrg実行結果を追加済み(全 consumer がBEHINDを含むことを確認)。PR: #439
docs: Step 2 判定表に MERGEABLE+BEHIND の取り扱いを明文化 (#439)