Repository navigation
feat: issue-refinement-loop に人間 Decision 検出分岐を追加する (#96) - #128
Conversation
anchor_comment_url(任意)入力と Step 0 コメント分類器(4分類)を追加し、 superseded_by_decision 分岐では gh issue close --reason "not planned" で 対象 Issue をクローズして代替 Issue 番号を close コメントへ記録する手順を明文化する。 これにより refinement loop が前提否決済み Issue を誤って approve へ磨かないようにする。 Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
squne121
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Mergeability
- mergeable=MERGEABLE, mergeStateStatus=CLEAN
Evidence Check
- AC coverage: 8/8 PASS、根拠あり(PR 本文 ## Verification Results で各 AC の PASS/FAIL 理由が明記されている)
- Allowed Paths: 遵守(変更ファイルは
.claude/skills/issue-refinement-loop/SKILL.mdのみ) - CI Verification: build/lint/python-test/test/typecheck 全 pass(https://github.com/squne121/loop-protocol/actions/runs/26219399153)
- 検証コマンド結果: PR 本文 ## Verification Results に pnpm typecheck/lint/test/build PASS、pytest 21/21 PASS 記載あり
AC 詳細照合
- AC1:
superseded_by_decisionが追加行に 7 箇所(LOOP_STATE.termination_reason 定義 + Step 5 テーブル含む) - AC2: 「人間 Decision シグナル」「人間 Decision」が追加行に 3 箇所
- AC3:
gh issue close/クローズが追加行に 6 箇所 - AC4:
issue-authorが Step 0c(Decision 分岐)の委譲先記述で確認 - AC5:
anchor_comment_urlが ## Inputs セクションに追加 - AC6:
feedback_update_required/reframe_in_placeが4分類テーブルに記載 - AC7:
gh issue close <issue_number> --reason "not planned"が明記 - AC8:
superseded_by_decisionが 2 箇所以上(7 箇所)
Blockers
なし
Non-blockers(任意改善)
- PR 本文で指摘されている
gh api repos/squne121/loop-protocol/...のリポジトリ名ハードコードは follow-up Issue 化が推奨されているが、今回のスコープ外の軽微な改善であり merge 非阻害
LOOP_VERDICT
verdict: APPROVE
blockers: []
mergeable: MERGEABLE
mergeStateStatus: CLEAN
reviewed_head_sha: f4f76984909db33d20171f3c73881e3390bc82dd
判定: REQUEST_CHANGES / No-Go as-isPR #128 は AC の文字列充足と CI は通っていますが、実運用の control-plane としてはまだ危険です。特に「コメント分類 → 主要 Blockers1.
|
B1: Step 0b を「暫定分類」に変更し superseded_by_decision の AND 条件を明記
B2: Step 1 / Step 4 への anchor_comment 入力契約テンプレートを追記
B3: LOOP_STATE.anchor_comment スキーマに preliminary/final_classification,
verified_claims, unresolved_claims, scope_impact, superseded_decision を追加
B4: Step 0a に comment の issue 所属検証コマンドを追加
B5: close + コメント投稿を gh issue close --comment 単一コマンドに統合
B6: Step 0c-0 に Idempotency preflight を追加(既存代替 Issue の再利用)
B7: ALTERNATIVE_ISSUE_DRAFT_V1 出力契約を定義し main thread による起票を明記
B8: Step 2 に stale approval 無効化条件(No-Go as-is 等)を追記
Verification Commands セクションに B3〜B7 の rg チェックを追加。
全品質ゲート (typecheck / lint / test / build / pytest) PASS。
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
squne121
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Mergeability
- mergeable=MERGEABLE, mergeStateStatus=CLEAN
Evidence Check
-
AC coverage: 8/8 PASS(diff 内追加行で全 AC を確認)
- AC1:
superseded_by_decisionが diff 追加行に 13 箇所(LOOP_STATE termination_reason 定義 + Step 5 テーブル他)PASS - AC2:
人間 Decision シグナル列ヘッダ、人間 Decision により Issue の前提が覆されている場合記述あり PASS - AC3:
gh issue close <issue_number> \ --reason "not planned" \ --comment ...コマンド、クローズ記述あり PASS - AC4:
issue-authorが Step 0c(行 116 付近)と Step 4 の両コンテキストで記述あり PASS - AC5:
anchor_comment_urlが## Inputsセクションに追加 PASS - AC6:
feedback_update_required/reframe_in_placeが4分類テーブルに存在 PASS - AC7:
--reason "not planned"記述あり PASS - AC8:
superseded_by_decisionが diff 追加行に 13 箇所(LOOP_STATE + Step 5 + ループ終了判定テーブル他)PASS
- AC1:
-
前回 REQUEST_CHANGES Blockers 解消確認(B1〜B8):
- B1: Step 0b が
preliminary classificationに変更され、AND 条件付きsuperseded_by_decision確定条件を明記。Step 1 後にfinal_classificationを確定する2段階フロー追加 PASS - B2: Step 1 inputs に
anchor_comment.url / snapshot / classification / required_checksフィールドを追加。Step 4 inputs にanchor_comment_feedback: { classification, required_edits }を追加 PASS - B3: LOOP_STATE に
preliminary_classification / final_classification / classification_reason / verified_claims / unresolved_claims / scope_impactおよびsuperseded_decisionサブスキーマ追加 PASS - B4:
comment_issue_number=$(echo "$comment_json" | jq -r '.issue_url | capture("/issues/(?<n>[0-9]+)$").n')で issue 所属検証を追加 PASS - B5:
gh issue close <issue_number> \ --reason "not planned" \ --comment "..."の単一コマンドに統合(close と close コメントが分離しない)PASS - B6: Step 0c-0 Idempotency preflight 追加(既存代替 Issue 検索・再利用)PASS
- B7:
ALTERNATIVE_ISSUE_DRAFT_V1YAML 出力契約(title / body / rationale / validation)定義追加 PASS - B8: Step 2 に
No-Go as-is / Revise before implementation / AC追加 / VC追加 / In Scope変更 / 本文に未反映 adversarial reviewの各条件でlast_verdict無効化とneeds-fix扱いへの切り替えロジックを追加 PASS
- B1: Step 0b が
-
Allowed Paths:
.claude/skills/issue-refinement-loop/SKILL.mdのみ変更 → 遵守 -
CI Verification: build / lint / python-test / test / typecheck 全 PASS(5/5)
-
検証コマンド結果: PR 本文の
## Verification Resultsに AC1〜AC8 および B3〜B7 拡張VC、pnpm 4コマンド、pytest 21/21 の結果が明記
Blockers
なし
Non-blockers(任意改善)
gh api repos/squne121/loop-protocol/issues/comments/$COMMENT_IDの OWNER/REPO が今も静的埋め込みになっている点は、PR 本文の「既存観察」に記録されており、follow-up Issue #127 に整理済みとの記載あり。このスコープでは non-blocker
LOOP_VERDICT
verdict: APPROVE
blockers: []
mergeable: MERGEABLE
mergeStateStatus: CLEAN
reviewed_head_sha: 6dfc1449c6a2ff9238abbf52fcc930d7c466bbd7
Summary
## Inputsにanchor_comment_url(任意)を追加し、Step 0a でコメント本文をgh apiで取得してLOOP_STATE.anchor_commentに格納する手順を追加superseded_by_decision/reframe_in_place/feedback_update_required/human_escalation)を追加superseded_by_decision分岐の4ステップ手順(issue-author ドラフト → create-issue →gh issue close --reason "not planned"→ close コメント記録)を追加LOOP_STATE.termination_reasonにsuperseded_by_decisionを追加、anchor_commentフィールドを追加superseded_by_decision行を追加Closes #96
Verification Results
VC(B3〜B7):
Allowed Paths Compliance
変更ファイル:
.claude/skills/issue-refinement-loop/SKILL.mdのみ(Allowed Paths 内)改善点・観察事項(REQUEST_CHANGES 対応後)
今回の REQUEST_CHANGES で気づいた設計上の改善点
superseded_by_decisionを即時確定していた設計は、コメントが事実主張を含む場合に誤クローズリスクがあった。preliminary → codebase/web 検証 → final という2段階にすることで、フロー制御の正確性が大幅に向上するpreliminary_classification/final_classification/scope_impactを State に持つことで、フロー途中でもループ状態が常に自己説明的になり、デバッグや人間レビューが容易になる実装中に判明した追加の観察事項
ALTERNATIVE_ISSUE_DRAFT_V1のような出力契約を定義することで、SubAgent の返答フォーマットが保証され、main thread がその後のcreate-issue呼び出しを確実に実行できる。出力契約なしでは呼び出し元が SubAgent の自由形式テキストをパースするリスクが生じるgh issue list+--searchで実装可能gh issue close --commentの単一コマンドにより、close と close コメントの間の「半クローズ状態」(close だけ実行されて comment が失敗するケース)が排除される。これはトランザクション的な一貫性の改善gh api repos/squne121/loop-protocol/...はリポジトリ名をハードコードしている。動的取得への改善は follow-up Issue が望ましい🤖 Generated with Claude Code