Repository navigation
Description
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: docsParent Issue
none
Parent Goal Ref
- Goal:
issue-refinement-loopの preflight.run が受理するLOOP_PLANNED_OPERATIONS_JSONの operation 語彙を skill 文書から参照可能にし、語彙の推測による誤停止を無くす - Desired Destination:
.claude/skills/issue-refinement-loop/references/配下の語彙案内と、文書と実装の drift を検出する focused pytest(本 Issue は単独改善。関連: 実装: Claude-GPT launcher を upstream minimal client contract へ縮退し、launcher-owned isolation/policy 層を撤去する #2925(発見元)、実装: Claude-GPT workflow の actor-scoped capability handoff を導入し issue-refinement-loop の auth/delegation parity を安定化する #2340(actor-scoped capability handoff)。親子関係は作らない)
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.pyAllowed 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
- overlap preflight は 実装: Auto mode の固定 /tmp scratch 上書き false-deny を run-scoped temporary workspace で解消する #2860(実装 PR 承認済み・merge 待ち)と
.claude/skills/issue-refinement-loop/SKILL.mdで allowed_paths 重複を検出した(advisory)。本 Issue の SKILL.md 変更は導線 1 行のみで、先に merge された側に合わせて rebase する。
Activity