Skip to content

実装: issue-refinement-loop の preflight.run が受理する LOOP_PLANNED_OPERATIONS_JSON の operation 語彙を skill 文書へ明記する #2937

Open

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "issue-refinement-loop を skill 文書だけで実行する agent が、preflight.run の operation 語彙を推測せず repository contract 由来でない human_judgment_required 停止を避けられるようにする"
change_kind: docs

Parent Issue

none

Parent Goal Ref

Current Validated Scope

  • .claude/skills/issue-refinement-loop/references/planned-operations-vocabulary.md を新規追加し、LOOP_PLANNED_OPERATIONS_JSON の operation 語彙(scripts/claude-gpt/workflow_capability_preflight.py の _KNOWN_OPERATION_ROUTES と同一集合)と phase / actor_role / requires_mutation の最小例を 1 箇所だけ記載する
  • .claude/skills/issue-refinement-loop/references/index.md に当該 reference の 1 行を追加し、.claude/skills/issue-refinement-loop/SKILL.md に当該 reference への 1 行の導線を追加する
  • .claude/skills/issue-refinement-loop/tests/test_planned_operations_vocabulary_doc.py を新規追加し、文書記載の operation 名集合が _KNOWN_OPERATION_ROUTES と完全一致することを検証する

Remaining Parent Gaps

なし(単独改善)

Background

preflight.run(scripts/agent-guards/skill_runtime_exec.py --command-id preflight.run)は、環境変数 LOOP_PLANNED_OPERATIONS_JSON の各 operation の operation 値を scripts/claude-gpt/workflow_capability_preflight.py の _KNOWN_OPERATION_ROUTES(issue_comment / issue_edit / issue_create / pr_comment / pr_create / pr_edit / pr_update_branch)に限って受理する。一方 .claude/skills/issue-refinement-loop/SKILL.md と references/*.md にはこの語彙の案内が無く、実行する agent が operation 名を推測で作る。

観測(再現あり): Claude-GPT(Claude Code 2.1.289、claude-code-proxy 0.1.42、main 940ede55)で issue-refinement-loop を #2889 に対して実行したところ、agent が controlled_issue_edit / controlled_issue_comment_publish という名前を作り、STATUS: blocked / NEXT_ACTION: human_judgment_required、github:operation_route_unavailable:controlled_issue_edit: no implemented native GitHub route for phase=rewrite actor_role=issue-editor で planner・調査・review・termination publish へ進めず停止した。語彙のヒント(_KNOWN_OPERATION_ROUTES の名前を使うこと)を 1 文足した同条件の再実行では preflight が通り、planner 実行・codebase-investigator SubAgent 起動・canonical termination publish まで到達した。原因は launcher や model 能力ではなく、語彙の文書化欠落である(Native Claude でも同じ推測を要する)。

影響: skill 文書だけを頼りに実行する agent(特に Claude-GPT)が repository contract 由来ではない human_judgment_required で停止し、loop の可用性を下げる。launcher の実運用 trial(#2925 AC7)の failure 分類も汚染する。

比較した方針: 運用(実行指示ごとに語彙ヒントを足す)は実行者依存で再発するため採らず、skill 文書へ 1 箇所の正本案内を置く決定論的な是正を採用する。語彙の正本は _KNOWN_OPERATION_ROUTES のままとする。

Outcome

.claude/skills/issue-refinement-loop/references/planned-operations-vocabulary.md が _KNOWN_OPERATION_ROUTES と同一の operation 語彙と最小例を記載し、その集合一致を検証する .claude/skills/issue-refinement-loop/tests/test_planned_operations_vocabulary_doc.py が uv run --locked pytest で PASS している状態になる。

Runtime Verification Applicability

  • decision: not_applicable
  • reason: 文書追加と静的な drift 検出 pytest のみで完結し、runtime 挙動は変更しないため

In Scope

  • LOOP_PLANNED_OPERATIONS_JSON の operation 語彙(_KNOWN_OPERATION_ROUTES と同一集合)と phase / actor_role / requires_mutation の最小例を、新規 reference に 1 箇所だけ記載する
  • references/index.md への 1 行追加と SKILL.md への導線 1 行の追加
  • 文書記載の operation 名集合と _KNOWN_OPERATION_ROUTES の完全一致を確認する focused pytest 1 本の追加

Out of Scope

  • preflight の判定ロジック変更
  • operation 語彙の追加・変更
  • scripts/claude-gpt/workflow_capability_preflight.py の挙動変更
  • launcher の変更
  • 新しい registry / schema / daemon / approval layer の作成

Acceptance Criteria

  • AC1: references/planned-operations-vocabulary.md が存在し、_KNOWN_OPERATION_ROUTES の 7 operation 名をすべて記載している
  • AC2: 同 reference に phase / actor_role / requires_mutation を含む LOOP_PLANNED_OPERATIONS_JSON の最小例が記載されている
  • AC3: references/index.md と SKILL.md が当該 reference を参照している
  • AC4: focused pytest が、文書記載の operation 名集合と _KNOWN_OPERATION_ROUTES の完全一致を検証し PASS する
  • AC5: workflow_capability_preflight.py に差分がない

Verification Commands

# AC1
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_planned_operations_vocabulary_doc.py
# AC2
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_planned_operations_vocabulary_doc.py
# AC3
$ rg -n "planned-operations-vocabulary" .claude/skills/issue-refinement-loop/references/index.md
$ rg -n "planned-operations-vocabulary" .claude/skills/issue-refinement-loop/SKILL.md
# AC4
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_planned_operations_vocabulary_doc.py
# AC5
$ git diff --exit-code origin/main -- scripts/claude-gpt/workflow_capability_preflight.py

Allowed Paths

  • .claude/skills/issue-refinement-loop/SKILL.md
  • .claude/skills/issue-refinement-loop/references/planned-operations-vocabulary.md
  • .claude/skills/issue-refinement-loop/references/index.md
  • .claude/skills/issue-refinement-loop/tests/test_planned_operations_vocabulary_doc.py

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合

Required Skills

なし

Required Design References

  • scripts/claude-gpt/workflow_capability_preflight.py(_KNOWN_OPERATION_ROUTES が語彙の正本)
  • docs/dev/agent-skill-boundaries.md

Scope Delta(任意)

N/A

Delivery Rule

1 Issue = 1 PR、専用 worktree で作業し、Draft PR を既定とする。

Notes for Reviewer

Activity

  1. added
    phase/implementation
    agent/implementer
    enhancement
    on Oct 4, 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/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions