Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "issue-refinement-loop の routine operation において、ユーザーが明示した human-approval 不要の意図を loop state routing に反映し、不要な human escalation を排除する"
change_kind: workflowParent Issue
none(単独改善)
Parent Goal Ref
- Goal: issue-refinement-loop における routine refinement operation を、ユーザーの autonomy 指定に応じて human escalation なしで進められるようにする
- Desired Destination: N/A(単独改善)
Current Validated Scope
LOOP_STATE_V1にautonomy_modeフィールドを追加するdecide_next_loop_action.pyがautonomy_modeを参照して routing を決定するrun_refinement_preflight.pyが初期プロンプトからautonomy_modeを抽出し artifact に記録する- 対応するテストを追加する
Remaining Parent Gaps
なし
Outcome
LOOP_STATE_V1 に autonomy_mode フィールドが追加され、ユーザーが「人間承認不要」を指定した場合に no_human_approval_for_routine_loop_ops が preflight artifact に記録され、decide_next_loop_action.py が routine operation を human escalation なしでルーティングし、uv run pytest .claude/skills/issue-refinement-loop/tests -q -x が PASS している状態。
Background
issue-refinement-loop の loop_iteration_approval_gate.default_required は既に false だが、これは「iteration 継続承認」の話であり、scope guard / unsafe mutation / Claude Code permission mode とは直交する。SKILL.md も permission mode とは別概念だと明記している。
実運用では、ユーザーが「人間承認不要」と明示しても、その意図が loop state に残らない。このため scope_signal_guard が新しい Allowed Paths 層を検出すると、anchor reframe で除外されていない限り human escalation が発生し、ユーザーの意図に反した停止が起きる。
decide_next_loop_action.py は scope_signal_guard.triggered == true かつ excluded_by_anchor_reframe == false なら必ず human_escalation を返す設計であり、autonomy_mode の概念を持っていない。
In Scope
LOOP_STATE_V1スキーマにautonomy_modeフィールドを追加する(値:default | no_human_approval_for_routine_loop_ops)run_refinement_preflight.pyで初期ユーザープロンプトから「人間承認不要」等のキーワードを検出し、autonomy_modeを preflight artifact に記録するdecide_next_loop_action.pyがautonomy_mode: no_human_approval_for_routine_loop_opsを参照し、以下の routine operation を human escalation なしで継続する:- issue body rewrite
- review iteration continuation(
needs-fixでの Step 4 継続) - trusted anchor comment の
feedback_update_required反映
loop_state.schema.jsonを更新してautonomy_modeを定義する- 対応するユニットテストを追加する
Out of Scope
- scope guard そのものの廃止・緩和(unsafe mutation / secrets / protected path は autonomy mode でも停止する)
- Claude Code の
--permission-modeや hooks の承認方式への変更 assets//LICENSES/編集の許可- untrusted / ambiguous scope amendment の自動承認
- external paid service / privilege escalation の自動承認
- trusted anchor comment による scope amendment の処理(別 Issue #XXXX で対応)
Acceptance Criteria
- AC1: 初期ユーザープロンプトに「人間承認不要」が含まれる場合、preflight artifact に
autonomy_mode: no_human_approval_for_routine_loop_opsが記録される - AC2:
needs-fixiteration は上限内で追加 human confirmation なしに Step 4 へ進む(decide_next_loop_action.pyがautonomy_mode: no_human_approval_for_routine_loop_opsを参照してcontinue_to_step_4相当のルートを返す) - AC3:
autonomy_mode: no_human_approval_for_routine_loop_opsであっても、state/needs-human/ unsafe mutation /assets//LICENSES/編集が必要な場合は human escalation する - AC4:
autonomy_mode: defaultの場合は従来の routing 挙動を変えない(既存テストが PASS する) - AC5:
loop_state.schema.jsonにautonomy_modeフィールドが定義され、schema validation が通る
Verification Commands
# AC1
rg "autonomy_mode" .claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py
# AC2
rg "no_human_approval_for_routine_loop_ops" .claude/skills/issue-refinement-loop/scripts/decide_next_loop_action.py
# AC3
uv run pytest .claude/skills/issue-refinement-loop/tests -q -x -k "unsafe or protected or needs_human"
# AC4
uv run pytest .claude/skills/issue-refinement-loop/tests -q -x
# AC5
rg "autonomy_mode" .claude/skills/issue-refinement-loop/schemas/loop_state.schema.jsonAllowed Paths
.claude/skills/issue-refinement-loop/SKILL.md.claude/skills/issue-refinement-loop/references/termination-policy.md.claude/skills/issue-refinement-loop/references/loop-state.md.claude/skills/issue-refinement-loop/schemas/loop_state.schema.json.claude/skills/issue-refinement-loop/scripts/decide_next_loop_action.py.claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py.claude/skills/issue-refinement-loop/tests/**docs/dev/workflow.md
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
Required Skills
- Python / JSON Schema
Scope Delta(任意)
N/A
Delivery Rule
1 Issue = 1 PR- worktree を作成して実装する
- Draft PR を既定として起票する
Activity