Skip to content

実装: fix(issue-refinement-loop): no-human-approval autonomy mode を loop state routing に明示する #1007

Open

Description

@squne121

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: workflow

Parent 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-fix iteration は上限内で追加 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.json

Allowed 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

  1. added
    enhancement
    phase/implementation
    triage-required
    agent/implementer
    on Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/implementerenhancementphase/implementationtriage-required

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions