Skip to content

実装: issue-author を issue-creator/issue-editor に分割し実行時に真である Skill 権限境界を実装する #1734

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: "v1"
issue_kind: implementation
parent_issue: 1732
goal_ref: "Agent/Skill の重複を削減し progressive disclosure へ移行する(親 #1732)における issue-author(Claude Code)の分割と実行時に真である権限境界の実装"
change_kind: workflow

Parent Issue

#1732

Parent Goal Ref

  • Goal: Agent 本文の重複を削減し、canonical Skill(create-issue/edit-issue)へ責務を戻す
  • Desired Destination: Issue 起票・修正の実行が、それぞれ単一の Skill だけを preload し Skill tool 自体を持たない専用 Agent に分離されている状態

Redesign 経緯(Stop Condition からの再開)

本 Issue は当初 .claude/agents/issue-author.md に Skill tool + skills: frontmatter を「実行時 allowlist」として追加する設計だった。PR #1961 のレビューで、Claude Code 公式ドキュメント(code.claude.com/docs/en/sub-agents.md)により skills: は preload 専用でありアクセス制御ではないことが確認され、当時の設計は破棄された(詳細: #1734 (comment) 、PR #1961 は close 済み)。

人間の決定により、issue-author を issue-creator(create-issue のみ preload)と issue-editor(edit-issue のみ preload)の2 Agent に分割する。両 Agent とも Skill tool 自体を持たない(tools: [Read, Bash] のみ)ことで、動的な第三 Skill 呼出を frontmatter の static 検証だけで技術的に証明可能 にする(preload allowlist という誤った主張には依存しない)。

raw gh issue create/edit/comment への到達防止については、Bash tool は agent 単位でサブコマンド粒度の制限ができない(settings.json 全体レベルのみ)ことが判明した。settings.json を狭めることは既存の GitHub ops allow 方針(Issue/PR 操作は AI とのインターフェースとして allow する)と衝突するため、技術的抠止は行わない。本 Issue の AC は「raw gh mutation が技術的に拒否される」という主張をせず、「controlled executor(create_issue_txn.py/edit_issue_txn.py)の使用が Agent 本文の手順として明記されている」という手続き的契約のみを検証する。

fix_delta 3(PR #1974 REQUEST_CHANGES 対応)

PR #1974 のレビューで、以下5件の技術的欠陥が公式ドキュメント・実リポジトリ照合により確認され、本 Issue 本文を修正した(詳細は Issue コメント参照)。

  1. AC7 の runtime smoke が issue-editor を実際の Agent persona として起動していなかった(claude --agent <name> を使っていない)
  2. AC9・disposition matrix feat(agent-ops): issue-contract-fixer SubAgent を追加し、LLM rewrite 前に deterministic contract repair を完了させる #998 行が「nested SubAgent invocation は妨げない」と誤って主張していた(実際は disallowedTools: [Agent] により nested SubAgent invocation も構造的に不可能)
  3. .claude/skills/issue-refinement-loop/references/follow-up-materialization.md が child materialization の委譲先として deprecated stub issue-author を参照したままだった
  4. scripts/agent_ops_inventory.py の issue-refinement/issue-refinement-ops-review エントリが分割後の新 Agent でなく .claude/agents/issue-author.md を must-read としていた
  5. exact-set frontmatter テストが set() 比較のみで、重複要素があっても PASS してしまう検証不足だった

Current Validated Scope

Remaining Parent Gaps

  • Agent 本文の重複(create/edit の schema・validation・procedure 詳細)が未解消。
  • issue-author を呼び出す3箇所(issue-refinement-loop Step 4、post-merge-cleanup、impl-review-loop Step 5)が単一 Agent 前提のままで、分割後の routing が未実装。

Outcome

.claude/agents/issue-author.md を薄い deprecated stub(frontmatter name: issue-author を保持し、create/edit の手順本文は含まない)に変換し、.claude/agents/issue-creator.md(create-issue skill のみを skills: で preload、tools: [Read, Bash]、Skill tool 非保持)と .claude/agents/issue-editor.md(edit-issue skill のみを skills: で preload、同じ tool 構成)の2 Agent を新設する。両 Agent とも Skill tool を持たないため、動的な第三 Skill 呼出は frontmatter の strict parser 検証だけで「不可能である」ことを静的に証明できる(実行時 runtime smoke に依存しない技術的境界)。

issue-author を直接起動していた3箇所——.claude/skills/issue-refinement-loop/SKILL.md(Step 4 Rewrite。既存Issue本文の書き換えのみを行うため issue-editor へ routing)、.claude/skills/post-merge-cleanup/SKILL.md(follow-up Issue 起票のため issue-creator へ routing)、.claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md(follow-up Issue 起票のため issue-creator へ routing)——を新 Agent 名に repoint する。同様に、Step 4.5 の SSOT である .claude/skills/issue-refinement-loop/references/follow-up-materialization.md の child materialization 委譲先記述、および scripts/agent_ops_inventory.py の issue-refinement/issue-refinement-ops-review must-read エントリも、分割後の issue-creator/issue-editor を参照するよう更新する。

raw gh issue create/edit/comment の technical denial は主張しない。Agent 本文には「mutation は必ず controlled executor(create_issue_txn.py/edit_issue_txn.py)経由で行う」という procedural contract を明記するに留め、Bash tool レベルでの技術的強制は本 Issue のスコープ外とする(既存の GitHub ops allow 方針を維持するため)。

In Scope

  • .claude/agents/issue-creator.md(新設)
  • .claude/agents/issue-editor.md(新設)
  • .claude/agents/issue-author.md(薄い deprecated stub へ変換。frontmatter name: issue-author を保持し、create/edit の手順本文を除去。完全な物理削除は 実装: Codex issue-creator / issue-editor を分離し controlled mutation route を検証する #1952 マージ後の follow-up とする)
  • .claude/agents/tests/(新 Agent の frontmatter/tool set を検証するテスト)
  • .claude/skills/issue-refinement-loop/SKILL.md(Step 4 の invoke_issue_author / invoke_issue_author_with_readiness_result を invoke_issue_editor / invoke_issue_editor_with_readiness_result へ改名し routing する)
  • .claude/skills/issue-refinement-loop/references/follow-up-materialization.md(Step 4.5 の child materialization 委譲先を issue-author から issue-creator へ更新する。Scope Delta: PR feat(agents): issue-author を issue-creator/issue-editor に分割する #1974 レビューで確認された実行経路の破損修正)
  • .claude/skills/post-merge-cleanup/SKILL.md(follow-up Issue 起票の委譲先を issue-creator に更新)
  • .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md(follow-up Issue 起票の委譲先を issue-creator に更新)
  • docs/dev/agent-skill-boundaries.md(Agent 一覧表の issue-author 行を issue-creator/issue-editor の2行に置換)
  • tests/fixtures/agent-parity/ok-claude-issue-author.md(ok-claude-issue-creator.md/ok-claude-issue-editor.md へ分割)
  • scripts/agent_ops_inventory.py(issue-refinement/issue-refinement-ops-review の must-read エントリを .claude/agents/issue-author.md から .claude/agents/issue-creator.md/.claude/agents/issue-editor.md へ更新する。Scope Delta: PR feat(agents): issue-author を issue-creator/issue-editor に分割する #1974 レビューで確認された inventory 起動不備の修正)
  • scripts/agent-ops/run_worktree_agent_runtime_smoke.py(後方互換の追加専用フラグ、例: --claude-agent-name <name> を新設し、指定時のみ run_structured_claude() の argv に --agent <name> を挿入する。既存呼び出し(引数省略時)の挙動は変更しない。Scope Delta: PR feat(agents): issue-author を issue-creator/issue-editor に分割する #1974 レビューで確認された AC7 runtime smoke の persona 未束縛の修正)

Out of Scope

関連 Issue との関係(disposition matrix)

Issue 状態 関係 決定
#1952 OPEN Sibling Child(Codex側の同等対応) 本 Issue の分割方針(issue-creator/issue-editor)を踏まえ、Codex 側でも同様の分割が必要か #1952 側で再評価が必要。本 Issue は Codex 側ファイルを変更しない
#1909 OPEN 現行では .claude/agents/issue-author.md を Allowed Paths に含み context_bundle_path 等を追加する計画 本 Issue マージ後、対象ファイルが issue-creator.md/issue-editor.md に変わるため #1909 側で Allowed Paths を rebase する必要がある
#998 OPEN issue-contract-fixer SubAgent の nested 呼び出しを issue-author に追加する計画。「nested Skill invocation 禁止」との意味的衝突懸念 新設 issue-creator/issue-editor はどちらも disallowedTools: [Agent, ...] を持つため、nested Skill invocation と nested SubAgent invocation(issue-contract-fixer 等)の両方が構造的に不可能である。#998 を実現する場合、issue-editor 自身から nested 呼び出しすることはできず、呼び出し元(issue-refinement-loop 等の main thread)が issue-contract-fixer → issue-editor の順で明示的に sequential chain する設計にする必要がある(nested delegation ではなく main-thread orchestration)。#998 の Outcome/Allowed Paths への影響は #998 側で別途検討する
#995 OPEN FAIL_CLOSED_REWRITE_CONSTRAINTS_V1 の issue-author への強制転送契約 issue-editor(本文書き換えを担う後継)へ同等の input/output contract を引き継ぐ。issue-creator は本文書き換えを行わないため対象外
#1745 CLOSED Skill配下canonical referencesの読込権限(Read(**/.claude/**) deny)との衝突懸念 CLOSED済みだが、現行 .claude/settings.json に該当 deny が引き続き存在することを確認済み。両新 Agent の runtime smoke で、Skill 実行コンテキストからの references 読込が実際に成功することを証拠として残す

Runtime Verification Applicability

decision: immediate
applicable_acs:
  - AC7
execution_environment:
  cli_tools:
    - claude
    - python3
    - uv
  auth_required: false
  network_required: false
skip_conditions:
  - "linked worktree・Claude Code CLI・capability 不足時は SKIP(exit 77)とし、PASS へ昇格しない"
fallback_policy:
  fallback_success_is_pass: false
  notes: "runtime unavailable は blocked として扱い、fallback 経由の成功を PASS に変換しない。前回 Issue #1734 実装(PR #1961)で claude CLI 2.1.220 が --max-turns 未対応のため実際に SKIP(exit 77) した実績があり、同じ制約が再現しうる(follow-up #1960 が追跡中)"
artifact_requirements:
  - "worktree-agent-runtime-smoke summary.md(PR へ引用、AC7 が該当する場合のみ)"
  - "pytest output(AC1-AC6, AC8-AC14 の静的検証分)"

Acceptance Criteria

  • AC1: .claude/agents/issue-creator.md の YAML frontmatter を strict parser で読み、tools が Read/Bash の exact set であり Skill を含まないことを検証する(exact-set 判定は sorted(tools) == sorted([...]) かつ len(tools) == len(set(tools)) で行い、重複要素があっても PASS してしまう bare set() 比較は使わない)
  • AC2: .claude/agents/issue-editor.md の YAML frontmatter を strict parser で読み、tools が Read/Bash の exact set であり Skill を含まないことを検証する(exact-set 判定は sorted(tools) == sorted([...]) かつ len(tools) == len(set(tools)) で行い、重複要素があっても PASS してしまう bare set() 比較は使わない)
  • AC3: .claude/agents/issue-creator.md の skills: frontmatter が [create-issue] の exact set であることを検証する(exact-set 判定は sorted(skills) == sorted([...]) かつ len(skills) == len(set(skills)) で行い、bare set() 比較は使わない)
  • AC4: .claude/agents/issue-editor.md の skills: frontmatter が [edit-issue] の exact set であることを検証する(exact-set 判定は sorted(skills) == sorted([...]) かつ len(skills) == len(set(skills)) で行い、bare set() 比較は使わない)
  • AC5: .claude/agents/issue-author.md が薄い deprecated stub(frontmatter name: issue-author 保持、create/edit 手順本文を含まない)になっており、いずれの caller からも起動されていないことを検証する
  • AC6: .claude/skills/issue-refinement-loop/SKILL.md の Step 4 が invoke_issue_editor / invoke_issue_editor_with_readiness_result の action 名を使い、invoke_issue_author という文字列を含まないことを検証する
  • AC7: scripts/agent-ops/run_worktree_agent_runtime_smoke.py に後方互換の追加専用フラグ(例: --claude-agent-name <name>、デフォルト None・既存呼び出しの挙動を変更しない)を追加し、指定時のみ run_structured_claude() の argv に --agent <name> を挿入するよう拡張したうえで、claude --agent issue-editor -p ...(issue-editor を実際の active session persona として起動する実 CLI 呼び出し)を用いて .claude/skills/edit-issue/SKILL.md とその参照ファイルの実読込に成功したことを runtime smoke で証拠として残す(static fixture の存在確認だけを PASS にしない。--agent-type 引数は static declaration 比較用ラベルに留まり、これ単独では実 CLI へ persona を束縛しないため PASS の根拠にしない)
  • AC8: .claude/agents/issue-creator.md と .claude/agents/issue-editor.md の本文に、mutation は controlled executor(create_issue_txn.py/edit_issue_txn.py)経由で行う procedural contract が明記されており、raw gh issue create/edit/comment を Bash tool レベルで技術的に拒否するとは主張していないことを検証する
  • AC9: .claude/agents/issue-creator.md と .claude/agents/issue-editor.md の本文に、両 Agent が disallowedTools: [Agent, ...] を持つため「nested Skill invocation」と「nested SubAgent invocation(例: issue-contract-fixer)」の両方が構造的に不可能であることが明記されていることを検証する(「nested SubAgent invocation とは別概念であり妨げない」という主張は不採用とする)
  • AC10: .claude/agents/issue-editor.md の本文が 実装: fail_closed rewrite constraints を issue-author へ強制転送し、template-derived required sections を初回修復する #995(FAIL_CLOSED_REWRITE_CONSTRAINTS_V1)と 実装: SubAgent 発火前に bounded local context bundle を生成し Claude/Codex の両 loop で consume する #1909(context_bundle_path 等)由来の input/output contract を保持していることを検証する
  • AC11: .claude/skills/post-merge-cleanup/SKILL.md と .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md が follow-up Issue 起票の委譲先として issue-creator を参照し、issue-author という文字列を含まないことを検証する
  • AC12: docs/dev/agent-skill-boundaries.md の Agent 一覧表が issue-creator/issue-editor の2行を含み、issue-author という行を含まないことを検証する
  • AC13: scripts/agent_ops_inventory.py の issue-refinement/issue-refinement-ops-review エントリが .claude/agents/issue-author.md を参照せず、.claude/agents/issue-creator.md/.claude/agents/issue-editor.md を参照することを検証する
  • AC14: .claude/skills/issue-refinement-loop/references/follow-up-materialization.md が child materialization の委譲先として issue-creator を参照し、issue-author という文字列を含まないことを検証する

Verification Commands

# AC1
$ uv run --locked pytest .claude/agents/tests/test_issue_creator_issue_editor_split.py::test_issue_creator_frontmatter_tools_exact_set -q
# AC2
$ uv run --locked pytest .claude/agents/tests/test_issue_creator_issue_editor_split.py::test_issue_editor_frontmatter_tools_exact_set -q
# AC3
$ uv run --locked pytest .claude/agents/tests/test_issue_creator_issue_editor_split.py::test_issue_creator_skills_exact_set -q
# AC4
$ uv run --locked pytest .claude/agents/tests/test_issue_creator_issue_editor_split.py::test_issue_editor_skills_exact_set -q
# AC5
$ test -f .claude/agents/issue-author.md
$ rg -n "^name: issue-author$" .claude/agents/issue-author.md
$ rg -n "issue-creator" .claude/agents/issue-author.md
$ rg -n "issue-editor" .claude/agents/issue-author.md
$ ! rg -n "ISSUE_EDIT_TXN_INPUT_V1" .claude/agents/issue-author.md
# AC6
$ rg -n "invoke_issue_editor" .claude/skills/issue-refinement-loop/SKILL.md
$ ! rg -n "invoke_issue_author" .claude/skills/issue-refinement-loop/SKILL.md
# AC7
$ uv run --locked pytest .claude/agents/tests/test_issue_editor_runtime_smoke.py::test_canonical_skill_read_smoke -q
# AC8
$ uv run --locked pytest .claude/agents/tests/test_issue_creator_issue_editor_split.py::test_both_agents_document_controlled_executor_procedural_contract -q
# AC9
$ uv run --locked pytest .claude/agents/tests/test_issue_creator_issue_editor_split.py::test_both_agents_document_nested_invocation_distinction -q
# AC10
$ uv run --locked pytest .claude/agents/tests/test_issue_creator_issue_editor_split.py::test_issue_editor_retains_fail_closed_rewrite_and_context_bundle_contracts -q
# AC11
$ rg -n "issue-creator" .claude/skills/post-merge-cleanup/SKILL.md .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md
$ ! rg -n "issue-author" .claude/skills/post-merge-cleanup/SKILL.md .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md
# AC12
$ rg -n "issue-creator" docs/dev/agent-skill-boundaries.md
$ rg -n "issue-editor" docs/dev/agent-skill-boundaries.md
$ ! rg -n "\`issue-author\`" docs/dev/agent-skill-boundaries.md
# AC13
$ rg -n "issue-creator.md" scripts/agent_ops_inventory.py
$ rg -n "issue-editor.md" scripts/agent_ops_inventory.py
$ ! rg -n "agents/issue-author.md" scripts/agent_ops_inventory.py
# AC14
$ rg -n "issue-creator" .claude/skills/issue-refinement-loop/references/follow-up-materialization.md
$ ! rg -n "issue-author" .claude/skills/issue-refinement-loop/references/follow-up-materialization.md

Allowed Paths

Stop Conditions

実装中にこれらの状況が発生したら直ちに作業を停止し、Issue comment に状況を記録して人間の判断を待つ。

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
  • .claude/settings.json の permission 変更が必要と判明した場合(本 Issue では明示的に対象外としたため)
  • scripts/agent-ops/run_worktree_agent_runtime_smoke.py への追加専用フラグ以外の変更(既存呼び出しのデフォルト挙動変更)が必要と判明した場合

Required Skills

  • Python(strict YAML frontmatter parsing)
  • Claude Code Agent/Skill 設計(skills: preload と tools: grant の正確な意味論、disallowedTools による nested Skill/SubAgent invocation の遮断、worktree-agent-runtime-smoke を用いた fresh session runtime smoke)

Required Design References

Activity

  1. squne121 commented on Aug 2, 2026

    @squne121
    OwnerAuthor

    .codex/agents/issue-author.toml にも同等のスキル選択使用能力を与えてね。

  2. squne121 commented on Aug 2, 2026

    @squne121
    OwnerAuthor

    結論

    判定: REQUEST_CHANGES。現行の #1734 は、そのままでは実装開始不可です。

    指定コメントによって対象が Claude Code の issue-author だけでなく Codex CLI の .codex/agents/issue-author.toml に拡張されましたが、Issue 本文の Allowed Paths、Acceptance Criteria、runtime verification、既存の mutation 制御基盤が追随していません。特に「2つの Skill だけを deterministic に許可する」という中心要件は、現在記載されている tools: [Bash, Read, Skill] と grep ベースの検証では成立しません。

    P0 — 実装前に解消すべき問題

    P0-1. Claude の Skill 追加は allowlist にならない

    Issue は次の構成を要求しています。

    tools:
      - Bash
      - Read
      - Skill
    

    しかし、Claude Code では Skill tool を許可すると、原則として model-invocable な Skill 全体が呼び出し候補になります。skills: frontmatter は起動時の preload であり、「その Skill だけを呼べる」という allowlist ではありません。逆に、Skill tool を省けば追加の Skill 呼び出しを止められます。(Claude)

    したがって、次の AC は現在の設計では証明できません。

    • AC2: create/edit だけが許可される

    • AC3: 未許可 Skill が deterministic に拒否される

    • AC8: unknown Skill、nested invocation が拒否される

    rg "Skill\(create-issue\)" は文字列の存在しか検証せず、能力境界とは無関係です。

    必要な修正

    単一 issue-author を維持するなら、次の構成が妥当です。

    1. Skill tool は残す。

    2. Agent-local PreToolUse hook または同等の deterministic dispatcher を追加する。

    3. 実際の Skill tool payload を runtime fixture で取得する。

    4. create-issue と edit-issue の完全一致だけを許可する。

    5. それ以外を hook の deny 判定で拒否する。

    6. bypass permissions 相当の実行でも拒否されることを live smoke で確認する。

    Claude Code の component-local hook は、Agent/Skill が有効な間だけ適用でき、PreToolUse で tool call を拒否できます。prose ではなく、この実行経路を production authority にする必要があります。(Claude)

    より強い最小権限を求めるなら、issue-creator と issue-editor に分割し、それぞれ1つだけ preload して Skill tool を持たせない方式が優れます。ただし、これは #1734 のスコープを超える構造変更です。


    P0-2. 指定コメントによる Codex 対応が Allowed Paths 外

    コメントは .codex/agents/issue-author.toml にも同等能力を要求していますが、現在の Allowed Paths は Claude 側と docs しか許可していません。

    Codex 側で最低限必要になる可能性が高い資産は次です。

    • .codex/agents/issue-author.toml

    • .agents/skills/create-issue/SKILL.md

    • .agents/skills/edit-issue/SKILL.md

    • tests/fixtures/codex-agent-config/expected-runtime-contract.json

    • scripts/check_codex_agent_config.py

    • scripts/check-codex-agents.mjs

    • scripts/check_claude_codex_agent_parity.py

    • runtime smoke と関連 tests

    現行 fixture はすでに create-issue|edit-issue と2つの discovery surface を宣言しています。しかし、これは route とファイル存在の静的契約であり、実行中の Codex agent が canonical Skill 本文を選択・読了し、他 Skill を呼ばないことの証拠ではありません。

    PR #807 でも .agents/skills は discovery 用 thin bridge で、canonical body は .claude/skills に残ると明記されています。runtime instruction body の全面移植や実読込証明は行われていません。

    必要な修正

    Codex については「Claude と同じ primitive がある」と扱わず、次の意味的同等性を定義すべきです。

    • create 要求は canonical create-issue body に到達する。

    • edit 要求は canonical edit-issue body に到達する。

    • 第三の route は mutation 前に拒否される。

    • canonical body と bridge の drift を検出する。

    • runtime evidence がない場合は blocked とする。

    Codex Skills は repo 内では .agents/skills から discovery され、明示・暗黙の選択が可能です。一方、公開されている設定には Claude の Skill(name) と同型の per-agent permission primitive は確認できません。したがって、Codex 側は exact dispatcher または限定された launch contract による制御が必要です。これは公式仕様から導く実装上の推奨です。(OpenAI Developers)


    P0-3. Codex の edit-issue bridge が canonical policy と矛盾している

    .agents/skills/edit-issue/SKILL.md の description は、現在も gh issue edit で本文を書き戻すと説明しています。

    一方、canonical edit-issue は production body/comment mutation を controlled executor に集約し、raw mutation を正規経路としていません。

    この状態で「Codex に同等能力を与えた」と判定すると、Codex は古い raw CLI 手順を選択し得ます。

    修正必須

    • bridge の description から gh issue edit を除去する。

    • controlled executor を authority として明記する。

    • bridge と canonical Skill の semantic drift test を追加する。

    • description に mutation 手順を複製せず、canonical body への参照だけに縮退する。


    P0-4. raw gh issue create/edit の拒否を Agent-local test で証明しようとしている

    .claude/settings.json には現在、raw gh issue create、gh issue edit、gh issue comment、gh api の Bash allow entry が存在します。この設定ファイルだけでは raw mutation の拒否を証明できません。

    実際の fail-closed authority は、#1284/PR #1295 等で導入された controlled executor と PreToolUse hook 経路です。そこでは入力 schema、stale-write 防止、readback、command ID、raw gh の拒否が扱われています。

    したがって、test_issue_author_skill_gate.py::test_rejects_raw_gh_mutation のような Agent-local fixture だけでは不十分です。単に Agent 本文に禁止文があることを確認するテストになれば、実際の shell call は防げません。

    正しい責務分担

    • Skill selector gate: 呼び出せる Skill の種類を制限する。

    • controlled mutation policy: raw GitHub mutation を拒否する。

    • Skill validator: title/body/schema を検証する。

    • executor: mutation、readback、stale-write protection を担当する。

    #1734 で新たな raw-gh blocker を並列実装してはいけません。既存 hookchain の integration test を呼び出すべきです。


    P0-5. references/ の読込権限が未解決

    create-issue は references/body-authoring.md や Issue template を参照する progressive disclosure 前提の Skill です。

    しかし現在の .claude/settings.json には Read(**/.claude/**) deny があり、Skill 配下の canonical references 読込と衝突します。

    この問題は #1745 が、binding manifest、strict validator、fresh-session permission smoke、active/pending 判定とともに扱っています。runtime unavailable を PASS にしない契約も #1745 にあります。

    依存関係を明示すべきです。


    P0-6. 並行 Issue と同一ファイルで衝突している

    少なくとも次の open Issue が issue-author の契約を変更します。

    特に「nested Skill invocation」と「nested SubAgent invocation」は別概念です。#1734 の禁止対象が曖昧なままだと、#998 を意図せず不可能にします。

    本文に disposition matrix が必要です。

    Issue | 関係 | 必要な決定 -- | -- | -- #1909 | 両 agent ファイルで直接衝突 | predecessor または後続 rebase #998 | nested Agent と責務分割で衝突 | nested Skill とは別であると明文化 #995 | 入力・mutation gate 契約 | thin agent に残す input/failure contract として保持 #1745 | permission/runtime 基盤 | hard predecessor または共有基盤を利用

    P1 — 品質上の問題

    P1-1. Verification Commands が自己充足的

    現在の VC には次の問題があります。

    • AC1: Skill という行があることしか確認しない。

    • AC2: create-issue だけを grep し、edit-issue や余分な Skill を検査しない。

    • AC5: 禁止したい schema 名を grep するが、期待 exit code が定義されていない。

    • AC6: routing という一般語の存在しか確認しない。

    • AC9: “smoke” と称しているが runtime 条件、CLI version、候補 SHA、実際の GitHub mutation mock/fixture 境界がない。

    これでは、実装者がテスト名に合わせて文字列検査を書くだけで全 AC を通せます。

    必要な検証

    • YAML frontmatter を実 parser で読む。

    • exact tool set を比較する。

    • exact allowed skill set を比較する。

    • production hook/dispatcher path が存在し、実際に呼ばれることを検証する。

    • 未許可 Skill の実 call が deny される live smoke。

    • create/edit の canonical body/reference が読まれた証跡。

    • raw gh は実 PreToolUse hookchain で deny。

    • controlled executor は同条件で allow。

    • baseline 失敗/candidate 成功を candidate SHA に束縛する。


    P1-2. Runtime Verification Applicability がない

    本変更は単なる Markdown 整理ではなく、tool capability、permission、Skill discovery、GitHub mutation 経路を変えます。static pytest だけでは不十分です。

    親 #1732 も、strict validator と fresh-session smoke を要求する方向へ整理されています。

    最低限、次を Issue 本文へ追加すべきです。

    runtime_verification:
      required: true
      mode: immediate
      runtimes:
        - claude-code
        - codex-cli
      unavailable_result: blocked
      fallback_success_is_pass: false
      evidence:
        - candidate_commit_sha
        - cli_version
        - agent_definition_sha256
        - canonical_skill_sha256
        - selected_route
        - decision
      prohibited:
        - raw_transcript
        - credentials
        - static_fixture_as_runtime_pass
    

    P1-3. Agent thin 化の「削除条件」が不十分

    現行 .claude/agents/issue-author.md は、Skill が正本であると述べながら、transaction schema、validation、retry、failure routing、artifact schema を大量に再掲しています。

    ただし、単に schema 名を削除すればよいわけではありません。次は Agent に残す必要があります。

    一方、以下は Skill または executor 側へ移すべきです。

    • Issue template/schema の詳細

    • validator command の詳細

    • retry 手順

    • mutation request schema

    • controlled executor argv

    • readback procedure

    これを ownership table として AC 化すべきです。単一キーワードの非存在では semantic preservation を証明できません。

    推奨する Issue 分割

    指定コメントは単なる1ファイル追加ではなく、runtime model の異なる2系統を同時に扱う変更です。Claude と Codex を別 child Issue に分ける方が安全です。

    Child A: Claude issue-author の thin binding と exact Skill gate

    主な対象:

    • .claude/agents/issue-author.md

    • Agent-local hook または deterministic gate

    • binding manifest/strict validator

    • runtime smoke runner

    • tests

    • docs/dev/agent-skill-boundaries.md

    主要 AC:

    1. Agent frontmatter が strict parser で検証される。

    2. create/edit の2つだけが runtime で許可される。

    3. 第三の Skill が fresh session で拒否される。

    4. create/edit が canonical Skill と必要な reference を実際に読む。

    5. raw gh は既存 hookchain で拒否される。

    6. controlled executor は許可される。

    7. Agent 本文から procedure/schema 重複が除去される。

    8. 実装: fail_closed rewrite constraints を issue-author へ強制転送し、template-derived required sections を初回修復する #995/実装: SubAgent 発火前に bounded local context bundle を生成し Claude/Codex の両 loop で consume する #1909 の input/output contract を失わない。

    9. runtime unavailable は blocked。

    Child B: Codex issue-author の semantic parity

    主な対象:

    • .codex/agents/issue-author.toml

    • .agents/skills/create-issue/SKILL.md

    • .agents/skills/edit-issue/SKILL.md

    • runtime fixture

    • Codex validators

    • Claude/Codex parity validator

    • live smoke

    主要 AC:

    1. route は create/edit の exact 2値。

    2. 未知 route は mutation 前に拒否される。

    3. bridge が canonical body に到達する。

    4. edit-issue の raw gh issue edit 記述を除去する。

    5. bridge/canonical semantic drift を検出する。

    6. runtime で canonical body の読込を証明する。

    7. static discovery surface の存在だけを PASS にしない。

    8. Codex の native primitive以上の「セキュリティ境界」を主張しない。

    配布方式について

    この機能は現状、loop-protocol リポジトリ内の custom agent workflow です。Codex 公式の構成上、repo-local Skill は .agents/skills が適切です。複数リポジトリへインストール可能な配布物にする場合のみ .codex-plugin/plugin.json と skills/ を持つ plugin 化を検討すべきです。(OpenAI Developers)

    したがって #1734 では、次を Out of Scope に明記するのが妥当です。

    • Codex plugin packaging

    • public skill distribution

    • cross-repository installation lifecycle

    • marketplace/plugin directory 登録

    最終評価

    #1734 の意図自体、すなわち「Agent 本文の重複を減らし、canonical Skill に責務を戻す」方向は正しいです。しかし現在の契約には、次の4つが混同されています。

    1. Skill discovery

    2. Skill selection

    3. Skill authorization

    4. GitHub mutation authorization

    これらを別レイヤーとして設計し直す必要があります。

    最初に行うべき修正は、指定コメントを正式な Scope Delta として本文へ反映し、Claude child と Codex child に分割した上で、#1745・#1909・#998・#995 との依存/衝突関係を固定することです。 現行 AC/VC のまま実装すると、文字列上は PASS でも実 runtime では任意 Skill 呼出または stale な raw mutation 手順が残る可能性があります。

    # 結論

    判定: REQUEST_CHANGES。現行の #1734 は、そのままでは実装開始不可です。

    指定コメントによって対象が Claude Code の issue-author だけでなく Codex CLI の .codex/agents/issue-author.toml に拡張されましたが、Issue 本文の Allowed Paths、Acceptance Criteria、runtime verification、既存の mutation 制御基盤が追随していません。特に「2つの Skill だけを deterministic に許可する」という中心要件は、現在記載されている tools: [Bash, Read, Skill] と grep ベースの検証では成立しません。

    P0 — 実装前に解消すべき問題

    P0-1. Claude の Skill 追加は allowlist にならない

    Issue は次の構成を要求しています。

    tools:
      - Bash
      - Read
      - Skill

    しかし、Claude Code では Skill tool を許可すると、原則として model-invocable な Skill 全体が呼び出し候補になります。skills: frontmatter は起動時の preload であり、「その Skill だけを呼べる」という allowlist ではありません。逆に、Skill tool を省けば追加の Skill 呼び出しを止められます。([Claude]1)

    したがって、次の AC は現在の設計では証明できません。

    • AC2: create/edit だけが許可される
    • AC3: 未許可 Skill が deterministic に拒否される
    • AC8: unknown Skill、nested invocation が拒否される

    rg "Skill\(create-issue\)" は文字列の存在しか検証せず、能力境界とは無関係です。

    必要な修正

    単一 issue-author を維持するなら、次の構成が妥当です。

    1. Skill tool は残す。
    2. Agent-local PreToolUse hook または同等の deterministic dispatcher を追加する。
    3. 実際の Skill tool payload を runtime fixture で取得する。
    4. create-issue と edit-issue の完全一致だけを許可する。
    5. それ以外を hook の deny 判定で拒否する。
    6. bypass permissions 相当の実行でも拒否されることを live smoke で確認する。

    Claude Code の component-local hook は、Agent/Skill が有効な間だけ適用でき、PreToolUse で tool call を拒否できます。prose ではなく、この実行経路を production authority にする必要があります。([Claude]2)

    より強い最小権限を求めるなら、issue-creator と issue-editor に分割し、それぞれ1つだけ preload して Skill tool を持たせない方式が優れます。ただし、これは #1734 のスコープを超える構造変更です。


    P0-2. 指定コメントによる Codex 対応が Allowed Paths 外

    コメントは .codex/agents/issue-author.toml にも同等能力を要求していますが、現在の Allowed Paths は Claude 側と docs しか許可していません。

    Codex 側で最低限必要になる可能性が高い資産は次です。

    • .codex/agents/issue-author.toml
    • .agents/skills/create-issue/SKILL.md
    • .agents/skills/edit-issue/SKILL.md
    • tests/fixtures/codex-agent-config/expected-runtime-contract.json
    • scripts/check_codex_agent_config.py
    • scripts/check-codex-agents.mjs
    • scripts/check_claude_codex_agent_parity.py
    • runtime smoke と関連 tests

    現行 fixture はすでに create-issue|edit-issue と2つの discovery surface を宣言しています。しかし、これは route とファイル存在の静的契約であり、実行中の Codex agent が canonical Skill 本文を選択・読了し、他 Skill を呼ばないことの証拠ではありません。

    PR #807 でも .agents/skills は discovery 用 thin bridge で、canonical body は .claude/skills に残ると明記されています。runtime instruction body の全面移植や実読込証明は行われていません。

    必要な修正

    Codex については「Claude と同じ primitive がある」と扱わず、次の意味的同等性を定義すべきです。

    • create 要求は canonical create-issue body に到達する。
    • edit 要求は canonical edit-issue body に到達する。
    • 第三の route は mutation 前に拒否される。
    • canonical body と bridge の drift を検出する。
    • runtime evidence がない場合は blocked とする。

    Codex Skills は repo 内では .agents/skills から discovery され、明示・暗黙の選択が可能です。一方、公開されている設定には Claude の Skill(name) と同型の per-agent permission primitive は確認できません。したがって、Codex 側は exact dispatcher または限定された launch contract による制御が必要です。これは公式仕様から導く実装上の推奨です。([OpenAI Developers]3)


    P0-3. Codex の edit-issue bridge が canonical policy と矛盾している

    .agents/skills/edit-issue/SKILL.md の description は、現在も gh issue edit で本文を書き戻すと説明しています。

    一方、canonical edit-issue は production body/comment mutation を controlled executor に集約し、raw mutation を正規経路としていません。

    この状態で「Codex に同等能力を与えた」と判定すると、Codex は古い raw CLI 手順を選択し得ます。

    修正必須

    • bridge の description から gh issue edit を除去する。
    • controlled executor を authority として明記する。
    • bridge と canonical Skill の semantic drift test を追加する。
    • description に mutation 手順を複製せず、canonical body への参照だけに縮退する。

    P0-4. raw gh issue create/edit の拒否を Agent-local test で証明しようとしている

    .claude/settings.json には現在、raw gh issue create、gh issue edit、gh issue comment、gh api の Bash allow entry が存在します。この設定ファイルだけでは raw mutation の拒否を証明できません。

    実際の fail-closed authority は、#1284/PR #1295 等で導入された controlled executor と PreToolUse hook 経路です。そこでは入力 schema、stale-write 防止、readback、command ID、raw gh の拒否が扱われています。

    したがって、test_issue_author_skill_gate.py::test_rejects_raw_gh_mutation のような Agent-local fixture だけでは不十分です。単に Agent 本文に禁止文があることを確認するテストになれば、実際の shell call は防げません。

    正しい責務分担

    • Skill selector gate: 呼び出せる Skill の種類を制限する。
    • controlled mutation policy: raw GitHub mutation を拒否する。
    • Skill validator: title/body/schema を検証する。
    • executor: mutation、readback、stale-write protection を担当する。

    #1734 で新たな raw-gh blocker を並列実装してはいけません。既存 hookchain の integration test を呼び出すべきです。


    P0-5. references/ の読込権限が未解決

    create-issue は references/body-authoring.md や Issue template を参照する progressive disclosure 前提の Skill です。

    しかし現在の .claude/settings.json には Read(**/.claude/**) deny があり、Skill 配下の canonical references 読込と衝突します。

    この問題は #1745 が、binding manifest、strict validator、fresh-session permission smoke、active/pending 判定とともに扱っています。runtime unavailable を PASS にしない契約も #1745 にあります。

    依存関係を明示すべきです。


    P0-6. 並行 Issue と同一ファイルで衝突している

    少なくとも次の open Issue が issue-author の契約を変更します。

    特に「nested Skill invocation」と「nested SubAgent invocation」は別概念です。#1734 の禁止対象が曖昧なままだと、#998 を意図せず不可能にします。

    本文に disposition matrix が必要です。

    Issue 関係 必要な決定
    #1909 両 agent ファイルで直接衝突 predecessor または後続 rebase
    #998 nested Agent と責務分割で衝突 nested Skill とは別であると明文化
    #995 入力・mutation gate 契約 thin agent に残す input/failure contract として保持
    #1745 permission/runtime 基盤 hard predecessor または共有基盤を利用

    P1 — 品質上の問題

    P1-1. Verification Commands が自己充足的

    現在の VC には次の問題があります。

    • AC1: Skill という行があることしか確認しない。
    • AC2: create-issue だけを grep し、edit-issue や余分な Skill を検査しない。
    • AC5: 禁止したい schema 名を grep するが、期待 exit code が定義されていない。
    • AC6: routing という一般語の存在しか確認しない。
    • AC9: “smoke” と称しているが runtime 条件、CLI version、候補 SHA、実際の GitHub mutation mock/fixture 境界がない。

    これでは、実装者がテスト名に合わせて文字列検査を書くだけで全 AC を通せます。

    必要な検証

    • YAML frontmatter を実 parser で読む。
    • exact tool set を比較する。
    • exact allowed skill set を比較する。
    • production hook/dispatcher path が存在し、実際に呼ばれることを検証する。
    • 未許可 Skill の実 call が deny される live smoke。
    • create/edit の canonical body/reference が読まれた証跡。
    • raw gh は実 PreToolUse hookchain で deny。
    • controlled executor は同条件で allow。
    • baseline 失敗/candidate 成功を candidate SHA に束縛する。

    P1-2. Runtime Verification Applicability がない

    本変更は単なる Markdown 整理ではなく、tool capability、permission、Skill discovery、GitHub mutation 経路を変えます。static pytest だけでは不十分です。

    親 #1732 も、strict validator と fresh-session smoke を要求する方向へ整理されています。

    最低限、次を Issue 本文へ追加すべきです。

    runtime_verification:
      required: true
      mode: immediate
      runtimes:
        - claude-code
        - codex-cli
      unavailable_result: blocked
      fallback_success_is_pass: false
      evidence:
        - candidate_commit_sha
        - cli_version
        - agent_definition_sha256
        - canonical_skill_sha256
        - selected_route
        - decision
      prohibited:
        - raw_transcript
        - credentials
        - static_fixture_as_runtime_pass

    P1-3. Agent thin 化の「削除条件」が不十分

    現行 .claude/agents/issue-author.md は、Skill が正本であると述べながら、transaction schema、validation、retry、failure routing、artifact schema を大量に再掲しています。

    ただし、単に schema 名を削除すればよいわけではありません。次は Agent に残す必要があります。

    一方、以下は Skill または executor 側へ移すべきです。

    • Issue template/schema の詳細
    • validator command の詳細
    • retry 手順
    • mutation request schema
    • controlled executor argv
    • readback procedure

    これを ownership table として AC 化すべきです。単一キーワードの非存在では semantic preservation を証明できません。

    推奨する Issue 分割

    指定コメントは単なる1ファイル追加ではなく、runtime model の異なる2系統を同時に扱う変更です。Claude と Codex を別 child Issue に分ける方が安全です。

    Child A: Claude issue-author の thin binding と exact Skill gate

    主な対象:

    • .claude/agents/issue-author.md
    • Agent-local hook または deterministic gate
    • binding manifest/strict validator
    • runtime smoke runner
    • tests
    • docs/dev/agent-skill-boundaries.md

    主要 AC:

    1. Agent frontmatter が strict parser で検証される。
    2. create/edit の2つだけが runtime で許可される。
    3. 第三の Skill が fresh session で拒否される。
    4. create/edit が canonical Skill と必要な reference を実際に読む。
    5. raw gh は既存 hookchain で拒否される。
    6. controlled executor は許可される。
    7. Agent 本文から procedure/schema 重複が除去される。
    8. 実装: fail_closed rewrite constraints を issue-author へ強制転送し、template-derived required sections を初回修復する #995/実装: SubAgent 発火前に bounded local context bundle を生成し Claude/Codex の両 loop で consume する #1909 の input/output contract を失わない。
    9. runtime unavailable は blocked。

    Child B: Codex issue-author の semantic parity

    主な対象:

    • .codex/agents/issue-author.toml
    • .agents/skills/create-issue/SKILL.md
    • .agents/skills/edit-issue/SKILL.md
    • runtime fixture
    • Codex validators
    • Claude/Codex parity validator
    • live smoke

    主要 AC:

    1. route は create/edit の exact 2値。
    2. 未知 route は mutation 前に拒否される。
    3. bridge が canonical body に到達する。
    4. edit-issue の raw gh issue edit 記述を除去する。
    5. bridge/canonical semantic drift を検出する。
    6. runtime で canonical body の読込を証明する。
    7. static discovery surface の存在だけを PASS にしない。
    8. Codex の native primitive以上の「セキュリティ境界」を主張しない。

    配布方式について

    この機能は現状、loop-protocol リポジトリ内の custom agent workflow です。Codex 公式の構成上、repo-local Skill は .agents/skills が適切です。複数リポジトリへインストール可能な配布物にする場合のみ .codex-plugin/plugin.json と skills/ を持つ plugin 化を検討すべきです。([OpenAI Developers]3)

    したがって #1734 では、次を Out of Scope に明記するのが妥当です。

    • Codex plugin packaging
    • public skill distribution
    • cross-repository installation lifecycle
    • marketplace/plugin directory 登録

    最終評価

    #1734 の意図自体、すなわち「Agent 本文の重複を減らし、canonical Skill に責務を戻す」方向は正しいです。しかし現在の契約には、次の4つが混同されています。

    1. Skill discovery
    2. Skill selection
    3. Skill authorization
    4. GitHub mutation authorization

    これらを別レイヤーとして設計し直す必要があります。

    最初に行うべき修正は、指定コメントを正式な Scope Delta として本文へ反映し、Claude child と Codex child に分割した上で、#1745・#1909・#998・#995 との依存/衝突関係を固定することです。 現行 AC/VC のまま実装すると、文字列上は PASS でも実 runtime では任意 Skill 呼出または stale な raw mutation 手順が残る可能性があります。

  3. squne121 commented on Aug 2, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop 終了報告(human_judgment_required)

    対象コメント: #1734 (comment)

    判定

    termination_cause: human_judgment_required

    経緯

    Step 0f の preflight(run_refinement_preflight.py)が、指定 anchor comment を処理する前段階で fail-closed(STATUS: blocked) となりました。

    なぜ人間承認不要では override できないか

    FAIL_CLOSED_REWRITE_CONSTRAINTS_V1.override_policy 上、missing_required_section は override 可能な reason code に含まれていますが(overridable_in_current_result: ["missing_required_section"])、override が許可される条件(references/refinement-loop-plan-output.md の human_decision_reframe override contract)は次の3点をすべて要求します。

    1. fail_closed.reason_codes が allowed_reason_codes のみで構成されている(✅ 満たす)
    2. 人間の anchor comment が、不足 section や不足 key を明示的に認識している(❌ 満たさない)
    3. rewrite が rewrite_constraints に制約されている(未達、条件2不成立のため到達せず)

    指定された anchor comment(issuecomment-5154592070)は、Machine-Readable Contract / Outcome セクション欠落について一切言及しておらず、別の論点(Claude/Codex 両対応化、Skill capability の allowlist 化、Issue 分割提案、#1745/#1909/#998/#995 との依存関係整理)を扱う実装前レビュー(REQUEST_CHANGES)です。したがって override 条件2が満たされず、loop_iteration_approval_gate(loop 継続の承認不要方針)とは別の理由で、構造的 fail-closed を自動 override できません。

    anchor comment の要旨(人間判断のためのサマリ)

    判定: REQUEST_CHANGES。#1734 は現状のまま実装開始不可、として以下を指摘:

    人間に必要な判断

    以下は、書き直し(rewrite)だけでは解決できず、人間の意思決定が必要です。

    1. Machine-Readable Contract / Outcome セクションの追加自体は機械的に修復可能ですが、それとは独立に、anchor comment が提起する Issue 分割(Child A / Child B)を採用するかどうか の意思決定が必要です。
    2. 分割する場合、Codex 対応(Child B)を別 Issue にするか、実装: issue-author を issue-creator/issue-editor に分割し実行時に真である Skill 権限境界を実装する #1734 のスコープを Claude 専用に戻すかの判断が必要です。
    3. 実装: Skill references/ の read permission と Agent/Skill 契約 strict validator を追加する #1745/実装: SubAgent 発火前に bounded local context bundle を生成し Claude/Codex の両 loop で consume する #1909/feat(agent-ops): issue-contract-fixer SubAgent を追加し、LLM rewrite 前に deterministic contract repair を完了させる #998/実装: fail_closed rewrite constraints を issue-author へ強制転送し、template-derived required sections を初回修復する #995 との依存関係(predecessor 化するか、明文化で共存させるか)の決定が必要です。

    上記の意思決定を経て、structural rewrite(不足セクション追加)と scope 反映を明示的に指示いただければ、loop を再実行します。

  4. changed the title [-]issue-author に create-issue/edit-issue Skill capability を限定付与する[/-] [+]実装: issue-author に create-issue/edit-issue Skill capability を限定付与する[/+] on Aug 2, 2026
  5. squne121 commented on Aug 2, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了 (2026-08-02T03:07:26Z)

  6. squne121 commented on Aug 2, 2026

    @squne121
    OwnerAuthor

    Scope Delta: Allowed Paths への .github/ci/python-test-plan.json 追加

    PR #1961(コミット f67dcf89)にて、本 Issue が当初宣言した Allowed Paths(.claude/agents/issue-author.md / .claude/agents/tests/ / docs/dev/agent-skill-boundaries.md)に加えて、.github/ci/python-test-plan.json を追加で変更した。

    変更内容

    targets 配列に .claude/agents/tests/ を1行追加する登録のみの変更である(新規ロジック・新規 schema field の追加ではない)。

         ".claude/skills/create-issue/scripts/tests/",
         ".claude/skills/ssot-discovery/tests/",
         ".claude/hooks/tests/",
    +    ".claude/agents/tests/",
         "tests/agent_guards/",
         ".claude/skills/issue-contract-review/scripts/tests/",
         ".claude/skills/ci-test-performance/scripts/tests/",

    理由

    本 Issue の AC1/AC2/AC5/AC6/AC8/AC10/AC11 を検証する新規テストファイル .claude/agents/tests/test_issue_author_skill_gate.py を追加したが、CI の node-backed-hook-tests job にある uncovered_changed_test_files gate は、新規テストディレクトリが .github/ci/python-test-plan.json の targets に登録されていない場合 fail する仕様である。この登録を行わないと、新規追加した AC 検証テストが CI required job の対象集合に含まれず、CI による恒常的な回帰防止が成立しない。

    Scope Delta の宣言

    以上の理由により、本 Issue の Allowed Paths を .github/ci/python-test-plan.json まで拡張する(この1行の registration-only な追加に限定したスコープ拡張であり、他フィールド・他ターゲットへの変更は含まない)。

    参照: PR #1961 #1961 、コミット f67dcf89

  7. squne121 commented on Aug 2, 2026

    @squne121
    OwnerAuthor

    Stop Condition 発動: In Scope の固定契約変更が必要

    PR #1961 のコメント(https://github.com/squne121/loop-protocol/pull/1961#issuecomment-5155523686)で提起された敵対的レビュー指摘のうち、以下2点を独立に検証し、**両方とも事実であることを確認**しました。

    確認1: skills: frontmatter は allowlist ではない(P0-1)

    Claude Code 公式ドキュメント(code.claude.com/docs/en/sub-agents.md の "Preload skills into subagents" 節)を確認した結果:

    This field controls which skills are preloaded, not which skills the subagent can access: without it, the subagent can still discover and invoke project, user, and plugin skills through the Skill tool during execution.

    skills: フィールドは起動時の preload(コンテキスト注入)専用であり、tools: [Skill] を持つ限り未列挙の Skill も実行時に呼び出し可能です。実際の access control primitive は .claude/settings.json の Skill(specific-skill-name) permission rule のみであり、subagent frontmatter 内には存在しません。

    → 本 Issue の Outcome・AC2・AC3・AC8 が前提とする「skills: が Agent-local deterministic dispatcher として機能する」という中心設計は技術的に誤りです。

    確認2: raw gh issue mutation は現在の hookchain で拒否されない(P0-2)

    現在の .claude/settings.json(head d43d1eb8)を直接確認した結果:

    • PreToolUse hooks には local_main_branch_guard / worktree_scope_guard が登録されていません(登録されているのは secret guard・advisory 系のみ)。
    • permissions.allow に Bash(gh issue edit *) / Bash(gh issue create *) / Bash(gh issue comment *) / Bash(gh api *) が明示的に許可されています。

    AC4 の実装テスト(test_shared_classifier_allows_executor_and_denies_raw_title_edit)は local_main_branch_guard.evaluate() を隔離した一時 git repo + 偽装 CLAUDE_PROJECT_DIR で直接呼び出しているだけで、実際の Claude Code PreToolUse hookchain を経由していません。

    → 本リポジトリの現状設定では、Bash を持つ issue-author は raw gh issue create/edit/comment に到達可能であり、AC4 の「既存 hookchain で拒否される」という主張は現状の repo runtime に対して偽です。

    判断

    これは本 Issue の Stop Conditions「In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合」に該当します。PR #1961 は Draft のまま保持し、Closes #1734 の解決はこの設計不備の是正後に限定します。

    再設計の方向性(hook 再配線はしない前提)について、人間の判断を仰ぎます。

  8. changed the title [-]実装: issue-author に create-issue/edit-issue Skill capability を限定付与する[/-] [+]実装: issue-author を issue-creator/issue-editor に分割し実行時に真である Skill 権限境界を実装する[/+] on Aug 2, 2026
  9. squne121 commented on Aug 2, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop 終了報告(approved)

    判定: approve(issue-reviewer、body_sha256 sha256:9ffd5308889c61e66db362f291a8919516addaba62be9258b9b4b162359707e9)。iteration 2 で AC7 の VC preflight allowlist blocker を解消。

    経緯: 当初の .claude/agents/issue-author.md への Skill tool + skills: allowlist 方式は、Claude Code 公式ドキュメントにより preload 専用でありアクセス制御でないことが判明し破棄(PR #1961 close、詳細は #1734 (comment) )。人間の決定により issue-creator/issue-editor への分割へ再設計した。

    • iteration 0: 全面書き換え(旧設計→分割設計)。1 blocker(AC7 の VC が preflight allowlist 非対応)
    • iteration 1: AC7 の VC を pytest ラップ形式へ修正 → approve

    タイトルもあわせて更新: 新スコープ(issue-creator/issue-editor 分割)を反映。

    次は impl-review-loop への handoff。

    LOOP_HANDOFF_RESULT_V1:
      status: impl_ready
      routing_action: run_impl_review_loop
      contract_review:
        status: blocked
        gate_result: missing_go
        latest_comment_url: ""
        generated_at: ""
        body_sha256: "sha256:9ffd5308889c61e66db362f291a8919516addaba62be9258b9b4b162359707e9"
      metadata:
        title_prefix_ready: true
        phase_label_ready: true
      auto_fixes:
        result: auto_fixed
        required:
          - kind: template_hygiene
            executor: implementation-worker
            result: applied
            evidence:
              before: "sha256:3af4c97c2c3983b97804e2532ae2d1119d9aba0b344d74207f3eafb89a27e13e"
              after: "sha256:9ffd5308889c61e66db362f291a8919516addaba62be9258b9b4b162359707e9"
              comment_url: ""
        skipped: []
      blockers: []
      permissions:
        unavailable: []
      generated_at: "2026-08-02T05:37:00Z"
      checked_body_sha256: "sha256:9ffd5308889c61e66db362f291a8919516addaba62be9258b9b4b162359707e9"
      checker_exit_code: 0
      missing_sections: []
      missing_contract_keys: []
  10. squne121 commented on Aug 2, 2026

    @squne121
    OwnerAuthor

    implement-issue: Stop Condition — Allowed Paths 外の変更が必要と判明

    worktree を作成し実装に着手する前段階で、既存 CI required test との衝突を検出したため、Allowed Paths 内では安全に AC5 を満たせないと判明しました。作業を停止し、人間の判断を仰ぎます。

    検出内容

    AC5(.claude/agents/issue-author.md の削除)を実施すると、tests/test_agent_parity.py::TestB4RealRepoParity::test_real_repo_parity(.github/ci/python-test-plan.json に登録済みの CI required test)が回帰します。

    • 原因: tests/fixtures/codex-agent-config/expected-runtime-contract.json の required_agents.issue-author エントリが claude_agent_path: .claude/agents/issue-author.md を必須参照している
    • .claude/agents/issue-author.md が存在しなくなると scripts/check_claude_codex_agent_parity.py が missing claude agent file: .claude/agents/issue-author.md を failures に追加し、test_real_repo_parity の assert data["failures"] == [] が fail する
    • baseline 確認済み: 変更前の uv run --locked pytest tests/test_agent_parity.py::TestB4RealRepoParity -q は 1 passed

    なぜ Allowed Paths 内で解消できないか

    tests/fixtures/codex-agent-config/expected-runtime-contract.json は本 Issue の Allowed Paths に含まれていません(tests/fixtures/agent-parity/ のみが Allowed Paths 内で、tests/fixtures/codex-agent-config/ は別ディレクトリです)。この JSON の issue-author エントリを issue-creator/issue-editor の2エントリへ更新しない限り、AC5 実施後に CI required test が壊れます。

    関連 Issue との整合

    Out of Scope に列挙されている「Codex CLI(.codex/agents/issue-author.toml)側の対応は Sibling Child #1952」という記述と、この expected-runtime-contract.json(Claude↔Codex parity 契約)は密接に関連しています。#1952 側で Codex agent を分割するまでは、この parity 契約ファイルを整合させる余地がない可能性があります。

    提案(人間判断が必要)

    1. 本 Issue の Allowed Paths に tests/fixtures/codex-agent-config/expected-runtime-contract.json を追加する Scope Delta を承認する(required_agents.issue-author を issue-creator/issue-editor の2エントリに置換。Codex 側 .toml ファイル自体は 実装: Codex issue-creator / issue-editor を分離し controlled mutation route を検証する #1952 で新設されるまで存在しないため、暫定的な扱い方針の指示が必要)
    2. または、本 Issue のスコープを「Claude 側のみ」に確定させたまま、expected-runtime-contract.json 更新を本 Issue の必須成果物として明示的に追加指示する
    3. または、実装: Codex issue-creator / issue-editor を分離し controlled mutation route を検証する #1952 と本 Issue の順序を入れ替え、Codex 側の分割を先行させてから本 Issue を実施する

    作業は着手前の状態(worktree 作成のみ、コード変更なし)で停止しています。worktree-issue-1734-issue-creator-editor-split は次回再開時にそのまま利用可能です。

  11. squne121 commented on Aug 2, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了

    • PR: feat(agents): issue-author を issue-creator/issue-editor に分割する #1974
    • Worktree: .claude/worktrees/issue-1734-issue-creator-editor-split
    • Branch: worktree-issue-1734-issue-creator-editor-split
    • head: dfaa321b910e00cc4aa80a16a97a00dbc11d8332
    • Verification: pnpm typecheck / pnpm lint / pnpm test(106 files, 1815 tests)/ pnpm build 全 PASS。AC1-AC12 の Verification Commands 個別実行済み(AC7 は runtime smoke SKIP exit 77、fallback PASS 変換なし)。tests/test_agent_parity.py::TestB4RealRepoParity 継続 green(expected-runtime-contract.json 無改修)。
    • Scope Delta: issue-author.md の内容移動に伴い破損した Allowed Paths 外の既存テスト 3 本を同一 skill ディレクトリ内で追従修正(詳細は PR 本文 Notes 参照)
    • 後続: PR レビュー(pr-review-judge)→ マージ → post-merge-cleanup
  12. added a commit that references this issue on Aug 2, 2026
  13. squne121 commented on Aug 2, 2026

    @squne121
    OwnerAuthor

    Scope Delta: Allowed Paths への 4 ファイル追加(PR #1974 fix_delta)

    PR #1974(head 152586bfc787ee2fe3c292922ac4c231a50c2fef)にて、本 Issue が当初宣言した Allowed Paths に加えて、以下 4 ファイルを追加で変更した。Issue 本文の ## Allowed Paths セクションは既にこの Scope Delta を反映済み(本コメントは経緯の記録)。

    変更内容と理由

    1. .claude/skills/issue-refinement-loop/tests/test_readiness_forwarding_contract.py

    2. .claude/skills/issue-refinement-loop/tests/test_fail_closed_override_rewrite.py

    3. .claude/skills/edit-issue/tests/test_edit_issue_txn.py

      上記 3 ファイルは、本 Issue の中心変更(issue-author.md の内容を issue-editor.md へ移動し、.claude/agents/issue-author.md を薄い deprecated stub に変換する)に伴い、.claude/agents/issue-author.md の exact content/action 名に結合していた既存テストのアサーションが破壊されたため、機械的な rename 追従修正(issue_author → issue_editor/issue_creator の参照名変更)を行ったものである。いずれも本 Issue が既に Allowed Paths に含む同一 skill ディレクトリ(.claude/skills/issue-refinement-loop/、.claude/skills/edit-issue/)配下の tests/ サブディレクトリであり、設計判断の変更は含まない。

    4. .github/ci/python-test-plan.json

           ".claude/skills/create-issue/scripts/tests/",
           ".claude/skills/ssot-discovery/tests/",
           ".claude/hooks/tests/",
      +    ".claude/agents/tests/",
           "tests/agent_guards/",

      本 Issue で新規追加した .claude/agents/tests/ を CI の node-backed-hook-tests job の uncovered_changed_test_files gate の対象にするための registration-only な追加である。PR feat(agents): issue-author に create-issue/edit-issue Skill capability を限定付与する #1961 サイクルで確立済みの同種 Scope Delta(当時のコメント参照: 実装: issue-author を issue-creator/issue-editor に分割し実行時に真である Skill 権限境界を実装する #1734 (comment) 、PR feat(agents): issue-author に create-issue/edit-issue Skill capability を限定付与する #1961 コミット f67dcf89)と同一パターンであり、新規ロジック・新規 schema field の追加ではない。

    Scope Delta の宣言

    以上の理由により、本 Issue の Allowed Paths を上記 4 ファイルまで拡張する。Issue 本文の ## Allowed Paths セクションは本コメント投稿と合わせて edit-issue controlled executor(edit_issue_txn.py)経由で更新済み。

    参照: PR #1974 #1974

  14. squne121 commented on Aug 2, 2026

    @squne121
    OwnerAuthor

    Scope Delta: scripts/check_post_merge_cleanup_boundary.py を Allowed Paths に追加

    PR #1974(本 Issue の実装)で main とのマージコンフリクトを解消する過程で、Git のコンフリクトとは別に、以下の retest-time regression を発見した。

    修正コミット: febae7d7670989acf70dcde1e335378cfe4e6392(PR #1974 内)

    この変更は、本 Issue の履歴で既に承認されている Scope Delta(.claude/skills/edit-issue/tests/test_edit_issue_txn.py 等 4 ファイル)と同種の「他ファイルの内容移動・改名に伴う機械的追従修正」であり、In Scope の固定契約や AC の意味を変更するものではない。

    Allowed Paths に scripts/check_post_merge_cleanup_boundary.py を追加する。

  15. squne121 commented on Aug 2, 2026

    @squne121
    OwnerAuthor

    fix_delta 3(PR #1974 REQUEST_CHANGES 対応)

    PR #1974 のレビューで、以下5件の技術的欠陥が公式ドキュメント・実リポジトリ照合により独立検証され、本 Issue 本文を修正しました。

    1. AC7: run_worktree_agent_runtime_smoke.py の runtime smoke が issue-editor を実際の Agent persona として起動していなかった問題を修正。claude --agent <name>(公式サポート済み)を実 CLI 呼び出しへ渡す後方互換の追加専用フラグ(--claude-agent-name 等)をランナーに新設するよう AC7 を書き換え、既存呼び出しの挙動は変更しない方針を明記しました。
    2. AC9 / disposition matrix feat(agent-ops): issue-contract-fixer SubAgent を追加し、LLM rewrite 前に deterministic contract repair を完了させる #998 行: 「nested SubAgent invocation とは別概念であり妨げない」という誤った記述を撤回。issue-creator/issue-editor はどちらも disallowedTools: [Agent] を持つため、nested SubAgent invocation も構造的に不可能である旨に訂正しました。feat(agent-ops): issue-contract-fixer SubAgent を追加し、LLM rewrite 前に deterministic contract repair を完了させる #998 の実現は main thread による sequential chaining(issue-contract-fixer → issue-editor)で行う設計へ明記しました。
    3. AC14(新規): .claude/skills/issue-refinement-loop/references/follow-up-materialization.md が child materialization の委譲先として deprecated stub issue-author を参照したままだった実行経路破損を修正対象に追加しました。
    4. AC13(新規): scripts/agent_ops_inventory.py の issue-refinement/issue-refinement-ops-review エントリが .claude/agents/issue-author.md を must-read としていた不備を修正対象に追加しました。
    5. AC1-AC4: exact-set frontmatter テストの検証記述を、重複要素を見逃す bare set() 比較から sorted(...) == sorted([...]) かつ len(...) == len(set(...)) の厳密比較へ強化しました。

    Allowed Paths に上記3ファイルの Scope Delta を追加済みです。

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

    phase/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions