Skip to content

実装: agent-retrospective を optional plugin distribution として配布可能にする #2240

Closed

Description

@squne121

Parent Issue

#2192

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "#2192"
goal_ref: "#2192 の Child 7: agent-retrospective を self-contained な local plugin(plugins/agent-retrospective/)として、.claude/ を持たない別 repository でも claude --plugin-dir 経由で実行可能にする(Marketplace 対応・manual semver 管理・rollback machinery は Out of Scope)。低優先度 follow-up。"
change_kind: mixed

Parent Goal Ref

Current Validated Scope

  • plugins/agent-retrospective/ を plugin root とし、Skill・Agent・script・schema・Python dependency から成る runtime closure を bundled asset(${CLAUDE_PLUGIN_ROOT})と解析対象 repository(${CLAUDE_PROJECT_DIR})の解決だけで完結させた self-contained local plugin として構築する
  • claude plugin validate plugins/agent-retrospective と claude --plugin-dir plugins/agent-retrospective による clean install smoke で実行可能性を確認する
  • Marketplace 経由の配布・審査対応、manual semver 運用、update/rollback machinery、committed smoke receipt は本 Issue のスコープに含めない(後続需要が実際に生じた時点で別 Issue とする)

Remaining Parent Gaps

Outcome

plugins/agent-retrospective/ を正規の Claude Code plugin root として新規構築する(.claude-plugin/plugin.json を plugin root 直下に置き、その兄弟に skills/・agents/・pyproject.toml・uv.lock・README.md を配置し、実行に必要な runtime closure 全体を plugin root 内に閉じる)。plugin 内の Skill/script は bundled asset を ${CLAUDE_PLUGIN_ROOT}、解析対象 repository を ${CLAUDE_PROJECT_DIR} から解決し、project Skill 版が前提としていた .claude/skills/agent-retrospective/... の project-relative invocation や Path(__file__).resolve().parents[4] 決め打ちの repository root 解決には依存しない。

Plugin Skill から Python スクリプトへ plugin_root(${CLAUDE_PLUGIN_ROOT} の値)を明示的に渡し、内側で新規 spawn する全ての claude -p --agent <name> subprocess の argv にも --plugin-dir <plugin_root> を再指定する(--plugin-dir はセッション duration 限定で自動継承されないため)。内側 subprocess の agent 名は bare name(例: codebase-investigator)ではなく scoped identifier(例: agent-retrospective:codebase-investigator)を使う。Plugin Skill 自体の起動は uv run --project "${CLAUDE_PLUGIN_ROOT}" --locked python3 "${CLAUDE_PLUGIN_ROOT}/skills/run/scripts/run_retrospective.py" --repo-root "${CLAUDE_PROJECT_DIR}" ... という形にする(--project は project root のみを変更し、cwd は解析対象 ${CLAUDE_PROJECT_DIR} のまま維持される)。

plugin-shipped Agent frontmatter では hooks / mcpServers / permissionMode がサポート対象外であることを静的に確認し、agent-retrospective の proposal-only mutation boundary(Child 1 ADR で確定済み)がこれら unsupported フィールドに依存していないことを README に明記する(新規 security/permission harness は追加しない)。claude plugin validate plugins/agent-retrospective が通り、.claude/ を持たない一時 Git repository から claude --plugin-dir plugins/agent-retrospective で skill を明示起動し、実 retrospective が 1 回完走することを確認し、実行ログを PR 本文へ要約する。project Skill 本体(.claude/skills/agent-retrospective/)は本 Issue では変更しない。

plugin 内の base SHA 解決は、project Skill 側の _base_sha_resolver() が git rev-parse main を決め打ちする実装をそのまま持ち込まない。plugin 版では HEAD を snapshot authority として使うか、呼び出し側が明示 --base-ref を指定できる設計にし、default branch 名を main に固定しない。

本 Issue でいう「self-contained runtime closure」は、#2387/#2392 以降に project Skill 側へ追加された AGY role adapter(cross-skill evidence verifier を含む)、Latitude CLI enrichment、Claude-GPT transport_log.py、validate_repo_evidence_ref.py 等の project-only runtime dependency を、plugin 版 codebase-investigator・web-researcher・evaluator へ一切持ち込まないことを意味する。これらは portable core の対象外とし、plugin 版は Read/Grep/Glob・native WebSearch/WebFetch・deterministic enrichment のみに依存する軽量実装として再設計する。

Runtime Verification Applicability

decision: immediate
reason: >-
  plugin の validate・起動・実行は実際の Claude Code CLI 上でしか確認できないため、
  本 Issue 範囲内で claude plugin validate と一時 Git repository への
  clean install smoke を実施し、実行ログを PR に添付する
applicable_acs:
  - AC4
  - AC5
execution_environment: >-
  ローカル環境に Claude Code CLI(claude、plugin support を含む 2.1.245 以降)が
  インストールされていること。追加の第三者サービス認証は不要。ネットワークアクセスは
  uv run --locked 等でキャッシュ済み依存の解決に限定され、新規外部サービスへの
  認証・アクセスは発生しない。clean install smoke 用に .claude/ を持たない
  一時 Git repository をローカルに作成する
skip_conditions: >-
  claude CLI が PATH 上に存在しない、または claude plugin validate /
  --plugin-dir サブコマンドが現行バージョンで未サポートの場合は exit 77 で
  SKIP を宣言し、stdout 先頭に SKIP: プレフィックス付きで理由を出力する
fallback_policy: >-
  モック化された claude 呼び出しやスタブ応答経由での「成功」は PASS として
  扱わない。結果に _smoke_fallback: true 等の fallback フィールドが含まれる
  場合は FAIL として扱う
artifact_requirements: >-
  claude plugin validate の実行ログ(コマンド・exit code・stdout/stderr 要約)と
  clean install smoke の実行ログ(一時 repository 作成手順・claude --plugin-dir
  起動コマンド・retrospective run の exit code・出力要約)を PR 本文の
  Runtime Verification Evidence セクションへ inline 引用する。committed receipt
  file の commit は AC として要求しない

In Scope

  • 正規 plugin root plugins/agent-retrospective/.claude-plugin/plugin.json の新規追加と、その兄弟としての skills/・agents/・pyproject.toml・uv.lock・README.md の新規構築(実行に必要な Skill・Agent・script・schema・Python dependency をすべて plugin root 内に収める)
  • plugin 内 Skill/script の path resolution を ${CLAUDE_PLUGIN_ROOT}(bundled asset)/${CLAUDE_PROJECT_DIR}(解析対象 repository)ベースに書き換え、loop-protocol 固有の .claude/... project-relative path や parents[4] 決め打ちに依存しない形にする
  • Plugin Skill 側から内側 subprocess(claude -p --agent <name>)へ --plugin-dir <plugin_root> を明示的に再指定する実装、および内側 subprocess の agent 起動名を scoped identifier(agent-retrospective:<agent-name>)にする実装
  • plugin 版 codebase-investigator を、Read/Grep/Glob 等で解析対象 ${CLAUDE_PROJECT_DIR} を直接調査する軽量版として新規設計する(project 版が必須化している .claude/skills/gemini-cli-headless-delegation/** への委譲には依存しない)
  • plugin 版 web-researcher を、native WebSearch/WebFetch を直接使用する軽量版として新規設計する(同上、AGY delegation には依存しない)
  • 上記 2 Agent の出力スキーマは observer_result/v1(OBSERVER_RESULT_V1)専用の leaf として設計し、project 版の WEB_RESEARCH_RESULT_V1 等の異なるスキーマ名を持ち込まない
  • plugin-shipped Agent frontmatter からは hooks / mcpServers / permissionMode の 3 フィールド自体を含めない(コピー元にこれらが存在する場合は除去する)。README には unsupported である旨の説明も記載する(新規 security harness は作らない)
  • claude plugin validate plugins/agent-retrospective の実行
  • .claude/ を持たない一時 Git repository から claude --plugin-dir plugins/agent-retrospective で skill を明示起動し、実 retrospective を 1 回完走させる clean install smoke(対象は loop-protocol 自身ではなく一時 repository)
  • plugin 版 codebase-investigator・web-researcher・evaluator は、feat: agent-retrospective の codebase-investigator observer を role adapter で base_sha-bound OBSERVER_RESULT_V1 へ正規化する #2387/feat: agent-retrospective に Latitude CLI の bounded runtime evidence 収集/検証/enrichment を追加する #2392 以降に project Skill 側へ追加された AGY role adapter(cross-skill evidence verifier を含む)、Latitude CLI enrichment、Claude-GPT transport_log.py、validate_repo_evidence_ref.py に一切依存しない(plugin runtime closure から明示的に除外する)
  • 任意 repository で /agent-retrospective:run を起動する際の入力契約を固定する: --repository-id は git remote(origin の URL)から自動導出し明示指定時のみ上書き可能とする、--request-id・--idempotency-key は未指定時に決定論的または UUID ベースで自動生成する、--target-issue が存在しない/未指定の場合は issue-less run として扱い canonical candidate の issue 参照フィールドを null 許容にする
  • plugin 側 Agent の権限制御は公式 frontmatter の tools / disallowedTools(例: codebase-investigator は Read/Grep/Glob のみ、web-researcher は WebSearch/WebFetch のみ、evaluator は tools なし)だけに委ね、project Skill 側が持つ独自 Bash argv allowlist 再構築・AWS credential 等の明示除去を行う custom permission/env harness は plugin root へ移植しない
  • AC5 の live smoke は cross-repo で plugin/agents/schema が解決され PublishRequest まで到達する packaging correctness のみを検証対象とし、non-empty canonical candidate(model-quality の保証)は feat: agent-retrospective evaluator に identity.value 決定論的算出の deterministic enrichment phase を追加する #2367 で確立済みの deterministic fixture/test 側の責務とする(本 Issue では新規の model-quality アサーションを追加しない)

Out of Scope

  • project Skill 本体(.claude/skills/agent-retrospective/)の変更・削除(Child 1〜6 で完結済み。plugin root 内は project Skill とは独立した runtime closure として新規構築する)
  • Marketplace への実際の公開申請・審査対応
  • 明示的な semver version フィールドの必須化・version bump 運用手順の docs 化(plugin manifest の version は Claude Code 仕様上 optional であり、本 Issue では要求しない)
  • update/rollback 手順の docs 化(rollback が必要になった場合は「既知の正常 commit SHA に pin して再インストール」で足りるため、専用 machinery は作らない)
  • committed clean_install_smoke_receipt.json 等の証跡ファイルの commit(PR 本文への実行ログ要約で代替する)
  • plugin-specific permission degradation に対する新規 security/permission harness の設計
  • project Skill 側の独自 permission/env harness(nested claude 実行環境の allowlist 再構築、AWS credential 等の明示除去スクリプト)の plugin root への移植
  • 恒久的な Claude-live CI の新設

Acceptance Criteria

  • AC1: plugins/agent-retrospective/.claude-plugin/plugin.json が存在し、有効な JSON である。plugin root の兄弟として skills/・agents/・pyproject.toml・uv.lock・README.md が存在する
  • AC2: plugin 内の Skill 実行 script が bundled asset の path 解決に ${CLAUDE_PLUGIN_ROOT} を使用しており、loop-protocol 固有の .claude/... project-relative path や Path(__file__).resolve().parents[4] 決め打ちの repository root 解決に依存しない。加えて、plugins/agent-retrospective/skills/run/scripts/ 配下すべての script が、feat: agent-retrospective の codebase-investigator observer を role adapter で base_sha-bound OBSERVER_RESULT_V1 へ正規化する #2387/feat: agent-retrospective に Latitude CLI の bounded runtime evidence 収集/検証/enrichment を追加する #2392 以降に project Skill 側へ追加された .claude/skills/ project-relative import、scripts/claude-gpt/ import、gemini-cli-headless-delegation への依存を一切含まないことを確認する
  • AC3: README が、plugin-shipped Agent frontmatter で hooks / mcpServers / permissionMode がサポート対象外であることの正確な範囲(plugin 自体は hooks/hooks.json や .mcp.json を持てること、agent frontmatter の当該 3 フィールドのみが対象であること)を明記し、mutation protection がこれらに依存していないことを確認している。加えて、plugin 内の agent frontmatter コピー自体がこれら 3 フィールドを含まないことを条件とする
  • AC4: claude plugin validate plugins/agent-retrospective --strict が exit 0 で成功する
  • AC5: 絶対 plugin path を保持したまま git init -b portability-smoke(main 以外のブランチ名で 1 commit 作成)した .claude/ を持たない一時 Git repository から、--state-backend fixture を明示指定して canonical /agent-retrospective:run(namespaced invocation)で skill を明示起動し、cross-repo で plugin/agents/schema が解決され PublishRequest まで実 CLI で到達することを PASS 条件とする(packaging correctness のみを対象とし、live model が substantive な finding を返すことの保証は求めない。model-quality の保証は feat: agent-retrospective evaluator に identity.value 決定論的算出の deterministic enrichment phase を追加する #2367 で確立済みの deterministic fixture/test 側の責務とする)。findings: [] の empty-output であっても candidate_records の canonical schema validation は必ず実行され、skip や silent pass にせず schema/構造が壊れている場合は red になることを確認する。plugin 側の base SHA 解決は _base_sha_resolver() の git rev-parse main 決め打ちを持ち込まず、HEAD を snapshot authority として使うか明示 --base-ref 引数を受け取る設計にし、本 smoke を main 以外のブランチ名で実施することでこの portability defect を隠さないことを確認する。実行ログ(起動コマンド・exit code・出力要約)が PR 本文の ## Runtime Verification Evidence セクションへ要約されている

Verification Commands

# AC1
# baseline-expect: fail
$ test -f plugins/agent-retrospective/.claude-plugin/plugin.json
# AC2
# baseline-expect: fail
$ rg -q "CLAUDE_PLUGIN_ROOT" plugins/agent-retrospective/skills/run/scripts/run_retrospective.py
# AC2
# baseline-expect: fail
$ rg -q -e "parents\[4\]" -e "\.claude/skills/agent-retrospective" plugins/agent-retrospective/skills/run/scripts/run_retrospective.py
# AC2
# baseline-expect: fail
$ rg -q -e "parents\[" -e "\.claude/skills/" -e "scripts/claude-gpt/" -e "gemini-cli-headless-delegation" plugins/agent-retrospective/skills/run/scripts
# AC3
# baseline-expect: fail
$ rg -q "permissionMode" plugins/agent-retrospective/README.md
# AC3
# baseline-expect: fail
$ rg -q -e "^hooks:" -e "^mcpServers:" -e "^permissionMode:" plugins/agent-retrospective/agents/retrospective-runtime-observer.md plugins/agent-retrospective/agents/retrospective-evaluator.md plugins/agent-retrospective/agents/codebase-investigator.md plugins/agent-retrospective/agents/web-researcher.md
# AC4
# baseline-expect: fail
# preflight-scope: runtime_only
$ claude plugin validate plugins/agent-retrospective --strict
# AC5
# baseline-expect: fail
# preflight-scope: runtime_only
$ bash plugins/agent-retrospective/skills/run/scripts/clean_install_smoke.sh

Allowed Paths

  • plugins/agent-retrospective/.claude-plugin/plugin.json
  • plugins/agent-retrospective/skills/run/SKILL.md
  • plugins/agent-retrospective/skills/run/references/
  • plugins/agent-retrospective/skills/run/schemas/
  • plugins/agent-retrospective/skills/run/scripts/
  • plugins/agent-retrospective/agents/retrospective-runtime-observer.md
  • plugins/agent-retrospective/agents/retrospective-evaluator.md
  • plugins/agent-retrospective/agents/codebase-investigator.md
  • plugins/agent-retrospective/agents/web-researcher.md
  • plugins/agent-retrospective/pyproject.toml
  • plugins/agent-retrospective/uv.lock
  • plugins/agent-retrospective/README.md
  • .github/ci/python-test-plan.json

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
  • (satisfied, 2026-08-29)project Skill 側の prerequisite Issue 実装: agent-retrospective evaluator の identity.value 決定論的算出を分離する deterministic enrichment phase を追加する #2362(evaluator の deterministic enrichment phase 追加)は PR feat: agent-retrospective evaluator に identity.value 決定論的算出の deterministic enrichment phase を追加する #2367 でマージ済みであり、observer → evaluator → deterministic enrichment → canonical candidate → PublishRequest の full pipeline が実 Claude CLI で 3 回連続 PASS していることを OWNER レビューで確認済み。この着手前提条件は解消済みであり、以降は active blocker として扱わない
  • 優先度は他 6 件(Child 1〜6)より低く、それらの安定運用開始前に着手が求められた場合は停止し、着手順序を人間に確認する

Required Skills

なし

Required Design References

Scope Delta(任意)

Source

Delivery Rule

1 Issue = 1 PR。専用 worktree で作業し、Draft PR を既定とする。#2237(Child 4)は既にマージ・クローズ済みのため依存関係は解消済み。優先度は他 6 件より低く、MVP project Skill の本番 invocation が安定した後に着手する。着手条件だった #2362 のマージと live run 確認(run_cli() が evaluator → non-empty candidate → PublishRequest まで実 CLI で最低1回成功すること)は、PR #2367 のマージと 3 回連続 PASS の live run により満たされたことを記録する(2026-08-29 時点で satisfied、以降は active blocker として扱わない)。

Activity

  1. added
    phase/implementation
    agent/implementer
    enhancement
    on Aug 17, 2026
  2. squne121 commented on Aug 25, 2026

    @squne121
    OwnerAuthor

    結論

    verdict: REQUEST_CHANGES
    implementation_readiness: blocked
    recommended_disposition: reframe_in_place
    priority: low

    #2240 は現状のまま実装開始すべきではありません。単なる manifest 追加 Issue になっていますが、現在の agent-retrospective は project Skill のファイル配置・依存解決・repository root 解決にかなり強く依存しており、Claude Code plugin として自己完結していません。しかも #2237 本文自身が、現行 Claude Code の plugin layout と #2240 が不整合なので「Child 7 着手前に reframe が必要」と既に明記しています。

    #2240 自体は2026年8月17日の起票後ほぼ更新されておらず、コメントも0件です。つまり Child 4〜6 の実装・レビューで判明した事実が契約へフィードバックされていません。

    P0-1 — plugin の配置契約が Claude Code 現行仕様と違う

    #2240 は .claude/skills/agent-retrospective/plugin/plugin.json を想定していますが、現行 Claude Code の正規構成は、独立した plugin root の .claude-plugin/plugin.json と、その兄弟に skills/、agents/、bin/ 等を配置する形です。.claude-plugin/ の下へコンポーネントを入れるのは公式 docs が明示的に「common mistake」としています。 ([Claude]1)

    さらに Marketplace 経由でインストールした plugin はローカル cache にコピーされ、plugin root の外側を ../ などで参照できません。したがって現在の Allowed Paths 3ファイルだけでは、動く plugin を構築すること自体が不可能です。([Claude]2)

    想定すべき形は例えばこれです。

    plugins/agent-retrospective/
    ├── .claude-plugin/
    │   └── plugin.json
    ├── skills/
    │   └── run/
    │       ├── SKILL.md
    │       ├── references/
    │       ├── schemas/
    │       └── scripts/
    ├── agents/
    │   ├── retrospective-runtime-observer.md
    │   ├── retrospective-evaluator.md
    │   ├── codebase-investigator.md
    │   └── web-researcher.md
    ├── pyproject.toml
    ├── uv.lock
    └── README.md
    

    少なくとも「manifestだけ足す」のではなく、runtime closure 全体を plugin root 内に閉じることが Outcome であるべきです。

    P0-2 — 現在の project Skill はそのまま plugin にコピーしても動かない

    現行 SKILL.md は

    uv run --locked python3 .claude/skills/agent-retrospective/scripts/run_retrospective.py

    という project-relative invocation を前提にしています。

    さらに run_retrospective.py は _REPO_ROOT = Path(__file__).resolve().parents[4] を既定 repository root としており、jsonschema を repo-level Python dependency として import しています。repo root の pyproject.toml は Python 3.12、pyyaml、jsonschema、固定した uv toolchain を前提にしています。

    plugin cache に移動すると parents[4] はユーザーが解析したい repository ではなく plugin 側のファイル階層になります。また対象 repository に loop-protocol の pyproject.toml がある保証もありません。

    公式には bundled asset には ${CLAUDE_PLUGIN_ROOT}、対象 project には ${CLAUDE_PROJECT_DIR} を利用できます。plugin root は update ごとに変わる一方、永続データ用には ${CLAUDE_PLUGIN_DATA} があります。([Claude]2)

    したがって #2240 の「project Skill 本体の機能変更は Out of Scope」は成立しません。最低でも path resolution と依存解決を plugin-aware にする必要があります。

    P0-3 — 「MVP が安定した後」という着手条件を、現在まだ満たしていない

    #2240 自身が「MVP project Skill が安定運用に入る前なら停止」と定義しています。

    ところが直近の Draft PR #2342 は、実環境の Claude Code 2.1.245 で、observer に空 prompt が渡ると claude -p が入力なしとして exit 1 になる問題を検出しています。この問題自体は #2342 のスコープ外として未修正です。

    これは現在の production path と一致します。build_observer_requests() は prompt 不在時に prompts.get(..., "") を渡し、--prompts-file は optional です。また run_cli() が production で構築している collector は現時点で repository collector のみです。

    PR #2331 では Claude Code smoke は PASS したものの Claude-GPT 側は launcher preflight 不可で SKIP(77) でした。したがって「Child 1〜6 で runtime は確定済みなので packaging だけ行う」という前提にも注意が必要です。

    ここは security harness を増やす話ではありません。実際に価値を出す本番 invocation を一本通すことを plugin packaging より先に直すべきです。

    P0-4 — hooks / mcpServers / permissionMode の説明が広すぎる

    #2240 は「plugin 環境下では hooks / mcpServers / permissionMode が無効化される」と書いています。

    現行仕様はもっと限定的です。plugin-shipped Agent の frontmatter ではこの3フィールドがサポートされない、という仕様です。plugin 自体は hooks/hooks.json や .mcp.json を普通に持てます。([Claude]2)

    現在の retrospective-runtime-observer は tools: [] と disallowedTools でも write/Agent/Skill/Bash 等を抑制しており、こちらは plugin agent でもサポート対象です。

    したがって「plugin-specific permission degradation に対する安全境界の再設計」は過剰です。個人趣味開発なら、unsupported field に安全性を依存していないことだけ確認するので十分です。新たな permission harness を作る必要はありません。

    P1 — version / update / rollback 契約も重い

    AC2 は manifest の version を必須にしていますが、Claude Code では version は optional です。明示 version は、値を bump しない限り新しい commit を push しても update 対象になりません。公式 docs は、安定した公開 plugin には explicit semver、内部・開発中 plugin には version を省略して git commit SHA を version とする方式を推奨しています。([Claude]2)

    また公式 plugin/marketplace docs には first-class な rollback コマンドは確認できません。([Claude]3)

    個人開発で毎回 semver bump、update docs、rollback docs を管理するのは費用対効果が悪いです。rollback が必要なら「既知の正常 commit SHA に pin して再インストール」で十分です。

    P1 — clean_install_smoke_receipt.json は品質保証として弱い

    AC5 は committed clean_install_smoke_receipt.json の存在しか確認しません。これは手書きでき、Claude Code が更新された瞬間に stale になります。今回 #2342 がまさに runtime drift を検出していることからも、この方式は逆効果です。

    公式には claude --plugin-dir ./my-plugin で install 不要の実 plugin をロードでき、claude plugin validate ./your-plugin も提供されています。([Claude]1)

    ここは「receiptをcommitする」のではなく、PR 時点で実コマンドを1本通してログを PR 本文へ要約すれば十分です。security/eval harness をこれ以上増やさない方が、このプロジェクトには合っています。

    P1 — Parent #2192 の「optional」と closure rule が矛盾している

    #2192 は closure_mode: child-complete で「7 Child がすべてマージされたら close」としています。一方 #2240 は一貫して「optional」「低優先度 follow-up」です。つまり名前だけ optional で、Parent を close するには必須になっています。

    これは contract 上の矛盾です。

    個人開発としては、project Skill が期待する retrospective を実際に実行できれば #2192 の本来の価値は達成されています。plugin 化を Parent closure の blocker にする必要はありません。

    推奨する #2240 の再定義

    Marketplace 対応 Issue ではなく、まず 「agent-retrospective を self-contained な local plugin として別 repository でも実行可能にする」 Issue に縮めるのが妥当です。Claude Code 公式も、standalone .claude/ は personal/project workflow 向け、plugin は共有・再利用・versioned distribution 向けと位置付けています。ローカル開発は --plugin-dir、さらに個人用なら ~/.claude/skills/<plugin>/ に置く skills-directory plugin なら marketplace/install 自体不要です。([Claude]1)

    最小ACは次の程度で十分です。

    1. 正規 plugin root(plugins/agent-retrospective/.claude-plugin/plugin.json)と、実行に必要な Skill・Agent・script・schema・Python dependency がすべて plugin root 内に収まる。
    2. bundled file は ${CLAUDE_PLUGIN_ROOT}、解析対象 repo は ${CLAUDE_PROJECT_DIR} から解決し、loop-protocol 固有の .claude/... path や parents[4] に依存しない。
    3. plugin agent で unsupported な hooks / mcpServers / permissionMode に mutation protection を依存していないことだけ静的確認する。新規 security harness は作らない。
    4. claude plugin validate plugins/agent-retrospective が通る。
    5. .claude/ を持たない一時 Git repository から claude --plugin-dir ... で skill を明示起動し、実 retrospective が1回完走する。既存 project-local Agent の shadowing を避けるため、loop-protocol 自身を clean-install smoke の target にしない。
    6. Marketplace、manual semver、update/rollback machinery、committed smoke receipt は後続需要が実際に生じるまで Out of Scope とする。

    この形なら、#2240 を価値の低い配布ハーネス Issue にせず、「この Skill は本当に別プロジェクトへ持ち出して動くのか」だけを検証する portability Issue になります。

    現時点の着手順は、#2342 で露出した production invocation の問題を解消 → #2240 を reframe → local --plugin-dir clean smoke → 実際に複数projectで使う需要が出たら Marketplace/versioning を追加、が最も効率的です。セキュリティ境界は既存の proposal-only と tool restriction を維持し、それ以上の plugin 専用ハーネスは増やさない方がよいです。

  3. squne121 commented on Aug 25, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop 終了報告(#2240)

    • anchor comment: 実装: agent-retrospective を optional plugin distribution として配布可能にする #2240 (comment)
    • Step 0f preflight(preflight.run.with_human_context)結果: STATUS: needs_fix / NEXT_ACTION: apply_deterministic_repair
    • deterministic_body_author_fix_available(disposition: auto_apply_safe)を検出。Verification Commands 5箇所(L5, L10, L15, L20, L25)に # baseline-expect: fail annotation が欠落しているとの repair 候補。
    • 本 orchestrator(issue-refinement-loop)は現時点で apply_deterministic_repair の auto-apply consumer を持たないため、STATUS: blocked と同様の human 判断待ち informational route として扱い、実際の Issue 本文 mutation は行っていません。
    • termination_cause: human_judgment_required
    • 参照 artifact:
      • repair_diagnostics: .claude/artifacts/issue-refinement-loop/2240/repair_diagnostics.json
      • repair_candidate_body: .claude/artifacts/issue-refinement-loop/2240/repaired_issue_body.md
      • original_body_sha256: sha256:d792a0adfff387e652eb3d6c0394489818efc95c7b12ef1693d243c0d0a4f213
      • repaired_body_sha256: sha256:88c382b16cbc08b7c99027d68bc70ef2acab651fc3bbf43162fec3b56fe68e32

    人間による repair 候補の確認・適用可否判断をお願いします。

  4. squne121 commented on Aug 25, 2026

    @squne121
    OwnerAuthor

    推奨は、5箇所の annotation を人間が手動承認するのではなく、既に実装済みの repair_action.apply で #2240 を復旧し、そのまま fresh preflight → refinement loop を再開することです。

    根拠は明確です。#2039 は repair_action.disposition: auto_apply_safe を controlled Issue transaction へ自動適用する repair_action.apply を実装する Issue で、すでに closed です。現行リポジトリにも command registry・runtime policy・executor・result schema が存在します。

    一方、現在の issue-refinement-loop/SKILL.md には「apply_deterministic_repair の consumer を持たないため human 判断待ちにする」という #2039 実装前の記述が残っています。今回の Claude Code の停止は、この実装と orchestration 文書の不整合による false block と見るのが妥当です。 今回の実行報告も、実際に auto_apply_safe の5件だけを理由として停止しています。

    また、#2237 自体が「現行の公式 plugin layout と #2240 の契約が不整合なので Child 7 着手前に #2240 を reframe する必要がある」と既に記録しています。したがって repair 後は単に旧本文を通過させるのではなく、アンカーコメントを反映した reframe_in_place まで refinement を進めるべきです。 PR #2342 は現在も open/draft なので、Issue refinement の完了とplugin実装着手可能は分けて判定させるのが適切です。

    恒久対策としての SKILL.md routing 修正は #2240 の Allowed Paths に混ぜず、dedupe 後に別 Issue/PR とするのがよいです。

    対象リポジトリ: squne121/loop-protocol

    対象:

    今回の目的は、前回 issue-refinement-loop が NEXT_ACTION: apply_deterministic_repair で誤って human 判断待ちになった状態から復旧し、既存の controlled repair consumer を使って Issue #2240 の refinement を最後まで進めることです。

    #2240 の plugin 実装自体には着手しないでください。
    今回行うのは control-plane 上の deterministic repair と Issue contract refinement までです。

    必須: 最初に SubAgent を使う

    作業開始直後、read-only の codebase-investigator 相当 SubAgent を1体起動してください。

    SubAgent には以下を独立確認させてください。

    SubAgent は read-only・leaf とし、nested SubAgent delegation は禁止してください。

    メインセッションは、この SubAgent が完了して結果を返すまで必ず待ってください。
    SubAgent の完了前に Issue mutation、repair apply、本文編集、commit、PR作成を開始しないでください。

    以後 issue-refinement-loop 自身が起動する SubAgent についても、結果を consume する前に必ずその SubAgent の完了を待ってください。

    既知事項。ただし current main で再検証すること

    以下は前提として盲信せず、上記 SubAgent とメイン双方で current main に対して確認してください。

    Phase 1: #2240 の deterministic repair を復旧する

    前回 artifact をそのまま信用せず、まず Issue #2240 の live body / updatedAt を readback してください。

    前回 artifact が current body と完全に provenance-bound していることを canonical consumer 自身が証明できる場合のみ再利用可能です。少しでも stale の可能性があれば、同じ human-context anchor を使って fresh preflight を生成してください。

    fresh preflight が再び

    • STATUS: needs_fix
    • NEXT_ACTION: apply_deterministic_repair
    • repair_action.disposition: auto_apply_safe

    を返した場合、これを human approval 待ちへ downgrade しないでください。

    ISSUE_REFINEMENT_COMMAND_REGISTRY_V1 から current main の exact command specification を取得し、手書き shell string を作らず、canonical privileged executor 経由で repair_action.apply を実行してください。

    以下は禁止です。

    • raw gh issue edit
    • candidate body の手動コピー&ペースト
    • direct GitHub API による本文上書き
    • provenance / stale guard の回避
    • repair artifact の書き換え
    • auto_apply_safe 以外を勝手に safe 扱いすること

    repair_action.apply の結果を schema に従って評価してください。

    • applied → authoritative readback 後、fresh preflight
    • no_change → authoritative readback 後、fresh preflight
    • unknown → blind retry 禁止。停止して bounded report
    • provenance failure / stale failure / fresh validation failure → bypass 禁止
    • human_review_required / invalid_payload → auto-apply 禁止

    5箇所の annotation が適用されたことだけで refinement 完了とはしないでください。

    Phase 2: 同じ anchor で issue-refinement-loop を再開する

    repair 後の最新 Issue body を対象に、

    https://github.com/squne121/loop-protocol/issues/2240#issuecomment-5411141300

    を human-context anchor として issue-refinement-loop を最初から fresh に再実行してください。

    通常の loop iteration について人間承認は要求せず、repository の
    loop_iteration_approval_gate.default_required: false
    に従って自動継続してください。

    investigation → review → semantic review(applicable の場合)→ rewrite → fresh review を、各 canonical router の結果に従って進めてください。

    アンカーコメントは、古い #2240 契約に対して REQUEST_CHANGES / reframe_in_place を要求する human context として扱ってください。

    特に次を current repository / current Claude Code plugin contract と照合してください。

    • plugin root は独立した plugin directory とすること
    • .claude-plugin/plugin.json と sibling の skills/ / agents/ 等という layout
    • bundled asset は ${CLAUDE_PLUGIN_ROOT} を基準に解決すること
    • plugin を適用する対象 repository は ${CLAUDE_PROJECT_DIR} を基準にすること
    • loop-protocol 固有 relative path や parents[4] 等に依存しないこと
    • clean smoke は loop-protocol 自身ではなく、.claude/ を持たない一時 git repository を target にすること
    • claude plugin validate と --plugin-dir を使う local plugin validation を中心とすること
    • marketplace/manual publishing、過剰な semver/update/rollback machinery、committed smoke receipt は必要性を再評価すること
    • plugin 自体の hooks / MCP capability と、agent frontmatter の capability restriction を混同しないこと
    • 新規 security harness を目的化しないこと

    これらは人間が指定した結論をそのままコピペするのではなく、current repository assets と current contract を調査した上で issue-reviewer / semantic reviewer の結果から reframe してください。

    Phase 3: 実装 readiness を独立判定する

    Issue refinement が approve まで収束しても、plugin implementation を自動的に開始しないでください。

    PR #2342 および agent-retrospective の current runtime state を確認し、アンカーコメントが指摘した production invocation / live smoke の前提が現在解消済みかを fresh に判定してください。

    未解消なら、#2240 の本文自体は refinement 済みにして構いませんが、

    • refinement status: complete / approved
    • implementation readiness: blocked by prerequisite

    を区別してください。

    「Issue本文を改善できた」ことを「plugin を今すぐ実装可能」の根拠にしないでください。

    #2192 の
    「Child 7 は optional / low priority」
    と
    closure_mode: child-complete
    の整合性問題も確認してください。

    ただし #2240 refinement の権限だけで #2192 を勝手に編集しないでください。parent mutation が必要なら scope-rollup / canonical authority に従って別 finding として明示してください。

    Phase 4: stale orchestration 文書の恒久対策を分離する

    今回の #2240 の Allowed Paths を利用して issue-refinement-loop のコードや SKILL.md を変更してはいけません。

    #2240 復旧後、以下の regression を dedupe 検索してください。

    repair_action.apply controlled consumer は current repository に実装済みなのに、issue-refinement-loop/SKILL.md が NEXT_ACTION: apply_deterministic_repair を「consumer 不在」として human judgment route に落としている。

    同じ未解決 Issue が既に存在する場合は、その Issue を参照してください。

    存在しない場合は、repository の通常の create-issue workflow が許可する範囲で、この control-plane regression 専用の Issue を別途起票してください。

    その Issue では最低限、

    • NEXT_ACTION: apply_deterministic_repair
    • repair_action.disposition: auto_apply_safe

    を受信した main orchestrator が既存 repair_action.apply を consume すること、
    unsafe disposition は従来どおり fail-closed であること、
    fresh readback/preflight まで一続きに到達する integration regression test

    を要求してください。

    この恒久修正を #2240 の plugin PR に混載しないでください。

    停止条件

    人間承認を求めるだけの approval gate では停止しないでください。

    ただし、以下は bypass せず停止してください。

    • canonical router が真正に human_judgment_required を返した
    • repair_action.disposition が auto_apply_safe ではない
    • mutation outcome が unknown
    • authoritative readback が確定しない
    • provenance / digest / updatedAt / Issue binding が一致しない
    • environment failure
    • secret / credential の取得・露出が必要
    • destructive operation が必要
    • canonical guard / permission / controlled executor を弱める必要がある
    • 実装: agent-retrospective を optional plugin distribution として配布可能にする #2240 の scope を超える repository code implementation が必要

    停止時も「承認してください」だけで終わらず、reason code、到達 phase、mutation attempted の有無、readback 状態、再開条件を bounded report にしてください。

    終了条件

    次をすべて確認してから終了してください。

    1. 最初に起動した SubAgent が完了し、その結果を main が確認済み。
    2. 実装: agent-retrospective を optional plugin distribution として配布可能にする #2240 の deterministic repair が canonical repair_action.apply 経由で処理済み、または fresh preflight 上で不要になっている。
    3. repair 後の authoritative Issue body readback 済み。
    4. 同じ human-context anchor から fresh issue-refinement-loop を再実行済み。
    5. deterministic review と、applicable なら semantic design review が fresh body に対して完了済み。
    6. 実装: agent-retrospective を optional plugin distribution として配布可能にする #2240 の final refinement verdict を取得済み。
    7. implementation readiness を refinement verdict と別に判定済み。
    8. 過去の「human approval required」コメントは historical evidence として削除・改変せず、final report で superseded であることを説明する。
    9. stale SKILL.md routing regression の dedupe 結果を記録済み。
    10. 実装: agent-retrospective を optional plugin distribution として配布可能にする #2240 の plugin実装コードには着手していない。

    最後に、以下を簡潔に報告してください。

    このプロンプトなら、今の #2240 を先に復旧しつつ、SKILL.md の恒久バグを #2240 に混載しない構成になります。

  5. squne121 commented on Aug 25, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop 最終報告(#2240)

    1. 事前調査(read-only SubAgent)

    着手前に read-only の codebase-investigator SubAgent を起動し、完了を待ってから作業を開始しました。repair_action.apply の実在性・production reachability・SKILL.md 記述の新旧を独立検証済みです。

    2. false block の原因

    前回セッションで「apply_deterministic_repair の auto-apply consumer が存在しない」として human 判断待ちに倒しましたが、これは誤りでした。実際には Issue #2039(PR #2202、2026-08-16マージ)で repair_action.apply という controlled consumer が実装済み・production reachable でした。SKILL.md に残っていた古い記述(「auto-apply consumer を持たない」)が原因の false block regression です。

    3〜5. Deterministic repair の試行結果

    • 使用した canonical command: repair_action.apply(skill_runtime_exec.py 経由、.claude/worktrees/issue-2240-contract-repair の active-issue binding を作成した上で canonical main root から実行)
    • 結果: mutation_outcome: not_attempted(transaction_execute_error)。原因は今回の deterministic repair(baseline-expect annotation 5件挿入)自体とは無関係な、既存の readiness gap(Runtime Verification Applicability セクションの applicable_acs/execution_environment/skip_conditions/fallback_policy/artifact_requirements 必須フィールド欠落、RVA001/EXTSURF001)でした。mutation は未試行のため body は無傷(partial/unknown state なし)。
    • body identity: 元 body sha256 d792a0adfff387e652eb3d6c0394489818efc95c7b12ef1693d243c0d0a4f213(repair_action.apply 試行時点、readback で fresh 確認済み)

    6〜7. Refinement の経緯と reframe 内容

    repair_action.apply 単体では解決できない(本質的に広範な reframe が必要な)事案と判断し、通常の Step 2(review)→ Step 4(rewrite)サイクルに移行しました。

    • Step 2 (1回目): VERDICT: needs-fix(13 blockers: RVA必須フィールド欠落・EXTSURF001・baseline-expect欠落5件・decision-tagタグ不整合)
    • Step 4 (1回目 rewrite, issue-editor): OWNER anchor comment(実装: agent-retrospective を optional plugin distribution として配布可能にする #2240 (comment) 、verdict: REQUEST_CHANGES / recommended_disposition: reframe_in_place)の P0-1〜P0-4・P1 指摘に基づき全面 reframe。
      • plugin root を .claude/skills/agent-retrospective/plugin/ から独立 plugin root plugins/agent-retrospective/(.claude-plugin/plugin.json + sibling skills//agents//pyproject.toml/uv.lock/README.md)へ変更
      • path resolution を ${CLAUDE_PLUGIN_ROOT}/${CLAUDE_PROJECT_DIR} 前提に修正し parents[4] 依存を排除
      • version 必須化・rollback docs 必須化を削除(optional化・SHA pin方式)
      • committed clean_install_smoke_receipt.json の存在確認 AC を PR本文への実行ログ要約に置換
      • hooks/mcpServers/permissionMode の記述を「plugin-shipped Agent frontmatter でのみ非サポート」という正確な範囲に縮小、過剰な新規 security harness 要求を削除
      • clean install smoke の対象を loop-protocol 自身ではなく .claude/ を持たない一時 Git repository に変更
      • RVA を decision: immediate のまま5必須フィールドを具体化し AC4/AC5 に <!-- runtime-verification: true --> タグ付与
      • body_sha256: 498e1e5130889fee1e1267a9cec6cd10e19e32078021007037494b2d65366ff6
    • Step 2 (2回目): VERDICT: needs-fix(1 blocker: Allowed Paths の /** glob 表記が baseline_vc_preflight.py の literal-prefix containment 判定と非互換で AC2 の rg VC が broad path 誤判定)
    • Step 4 (2回目 rewrite, issue-editor): Allowed Paths 3行の /** サフィックスを除去(ディレクトリパス表記に変更、スコープ範囲は不変)。body_sha256: 2f836454cdd31a9dd3f21981b1a49cd2dd01933f036ff387da949d7e409519a5
    • Step 2 (3回目・final): VERDICT: approve(blockers: 0)。gate-final-review: final_review_allowed: true
    • Step 2.5(semantic design review, issue-design-reviewer): semantic_review_applicable: true(severity_tagged_anchor_findings: P0-1〜P0-4 がトリガー)。結果: assessment: findings、medium severity 1件(下記9参照)。join_review_results → effective_verdict: approve(medium は route_high_open_to_rewrite ポリシー上 warning 扱いで rewrite 対象外)

    最終 refinement verdict: approved(deterministic + semantic 両方)。

    8. Implementation readiness

    Issue 本文の refinement は approved ですが、implementation readiness は blocked by prerequisite です。理由: OWNER anchor comment の P0-3 指摘どおり、Draft PR #2342(fix: agent-retrospective の observer wave 失敗を診断可能にし regression coverage gap を解消する)が現時点でも Open/Draft のままであり、production invocation の前提問題(observer への空 prompt 起因の claude -p exit 1 事象)が未解消です。この事実は #2240 本文の Stop Conditions にも明記しました:「MVP project Skill の本番 invocation が安定するまで着手せず停止する」。したがって本 Issue の実装(impl-review-loop 等への handoff)は自動開始していません。PR #2342 の解消を待って着手可否を再評価してください。

    9. #2192 Parent consistency finding(medium, requires_owner_choice)

    Semantic design review が、Parent #2192 の closure_mode: child-complete(7 Child 全マージで close)と、#2240 が一貫して「optional / 低優先度 follow-up」と位置付けていることの契約上の矛盾が reframe 後も未解消であると指摘しました。#2240 単体の Allowed Paths では #2192 本文を編集できないため、以下いずれかを Owner に選択いただく必要があります。

    #2192 本文は今回編集していません。

    10. Stale orchestration regression の dedupe / follow-up

    既存 Issue に同一 regression を追跡するものはありませんでした(dedupe 検索済み)。新規 follow-up Issue #2346 を起票しました: #2346
    (.claude/skills/issue-refinement-loop/SKILL.md の apply_deterministic_repair 節を repair_action.apply(#2039) 実装後の現行挙動へ更新する Issue。#2240 の plugin PR には混載していません)

    11. 投稿 Issue comment

    本コメント自体が該当します(#2240)。

    12. Repository code への変更

    なし。今回変更したのは Issue #2240 本文(controlled edit_issue_txn.py transaction 経由、2回)と、issue-2240-contract-repair という git worktree(未使用のまま。repo-tracked ファイルへの変更はありません)、および新規 follow-up Issue #2346 の起票のみです。issue-refinement-loop/SKILL.md を含むリポジトリのコード・スクリプト・docs は一切変更していません。


    過去の「human approval required」終了コメント(本 Issue 冒頭)は、上記の通り false block regression に基づくものであり、本コメントの内容によって superseded されます。

  6. squne121 commented on Aug 25, 2026

    @squne121
    OwnerAuthor

    推奨順序は #2240 をまだ実装せず、#2342 → #2345 → #2240 の runtime dependency を先に閉じる です。

    PR #2342 は現在 open・non-draft・mergeable で、OWNER の REQUEST_CHANGES に対する fix_delta も反映済みです。最新 head では粒度の細かい reason_code、live regression の hard fail 化、非独立テストの置換、#2345 の起票まで対応されています。 ただし、確認時点では最新 CI が1本 in_progress なので、まず current head を再レビューして checks green を確認するのが先です。

    その後の本質的 blocker は #2345 です。これはまだ open で、claude -p に空 prompt が渡って nonzero_exit になる production/live-smoke 経路を直接扱っています。#2240 の refinement report が「#2342 待ち」と書いた後に #2345 が切り出されたため、現在の readiness 条件は実質的には 「#2342 が確定し、#2345 が解消され、main 上の実 live smoke が成立すること」 に読み替えるべきです。

    #2346 は docs-only の false-block regression 修正で、#2240 の runtime blocker ではありません。ただし同じ誤停止を再発させるので、#2240 の次回 orchestration 前までには直す価値があります。現在 open かつ triage-required です。

    また #2192 は現在も closure_mode: child-complete で「7 Child 全マージ」を closure 条件にしている一方、#2240 は optional / low priority のままです。ここは parent 側を正本として Child 1〜6 を MVP closure、#2240 を non-blocking optional follow-up とする方向を推奨します。ただし repository に既存の表現形式・enum があるならそれに合わせ、未定義の closure_mode を勝手に発明しない方がよいです。

    #2240 の reframe 自体は現在の Claude Code 公式仕様にも合っています。plugin component は .claude-plugin/ 内ではなく plugin root に置き、--plugin-dir でローカル検証できます。${CLAUDE_PLUGIN_ROOT} と ${CLAUDE_PROJECT_DIR} も現行の公式 path substitution です。また hooks / mcpServers / permissionMode の非対応は plugin 全体ではなく plugin-shipped agent frontmatter に限定されています。([Claude]1)

    Claude Code には次を渡すのがよいです。

    squne121/loop-protocol で、Issue #2240 の実装 prerequisite を解消し、実装開始可能かを再判定してください。

    最初に必ず SubAgent を使用してください。
    SubAgent に現在の GitHub / repository 状態の独立調査を委譲し、SubAgent の作業完了を待ってから main session の判断・mutation に進んでください。

    対象:

    目的

    #2240 は refinement 自体は approved だが、plugin implementation readiness は prerequisite により blocked と判定されている。

    古い final report の「PR #2342 待ち」という文字列だけを機械的に使わず、現在の dependency graph を fresh に再構築すること。

    特に、#2342 から Issue #2345 が切り出されているため、以下を独立に確認すること。

    1. PR fix: agent-retrospective の observer wave 失敗を診断可能にし regression coverage gap を解消する #2342 の current head が OWNER REQUEST_CHANGES をすべて解消しているか
    2. PR fix: agent-retrospective の observer wave 失敗を診断可能にし regression coverage gap を解消する #2342 の current checks / CI / unresolved review findings
    3. Issue 実装: claude -p の空文字列 prompt 拒否 regression に対する agent-retrospective live smoke 検知経路の修正 #2345 が現在も claude -p empty-prompt / nonzero_exit 問題の正規 owner か
    4. current main の production invocation / Claude Code live smoke が実際に正常化しているか
    5. 実装: issue-refinement-loop/SKILL.md の apply_deterministic_repair 記述を repair_action.apply(#2039) 実装後の現行挙動へ更新する #2346 の stale issue-refinement-loop/SKILL.md regression が 実装: agent-retrospective を optional plugin distribution として配布可能にする #2240 実装の blocker なのか、単なる non-blocking operational follow-up なのか
    6. 導入: Claude-GPT運用ログの継続的レトロスペクティブと改善提案を行う agent-retrospective Skill を確立する #2192 の child-complete と 実装: agent-retrospective を optional plugin distribution として配布可能にする #2240 の optional / low-priority の契約矛盾が現在も残るか

    推測ではなく、GitHub Issue/PR/comments/checks と current repository asset を authority とすること。


    Phase 1 — SubAgent independent verification

    read-only SubAgent を起動し、以下を調査させる。

    SubAgent には mutation をさせない。

    SubAgent の完了を必ず待つこと。

    main session 自身でも重要事項を再確認し、SubAgent の主張を無検証で採用しない。


    Phase 2 — PR #2342 を先に確定する

    #2342 がまだ open の場合、current head に対して fresh adversarial review を実施する。

    OWNER REQUEST_CHANGES で挙げられた少なくとも以下が current head で解消されていることを確認する。

    • generic ObserverWaveFailed allowlist が残っていない
    • benign として許容する failure が必要最小限の granular reason code に限定されている
    • base_sha / manifest corruption 等が allowlist に入っていない
    • missing_structured_output live regression が実行時に hard FAIL になる
    • verifier と同じ allowlist を再利用するだけの偽の independent oracle が残っていない
    • empty prompt の実測挙動について stale な説明が残っていない
    • follow-up Issue 実装: claude -p の空文字列 prompt 拒否 regression に対する agent-retrospective live smoke 検知経路の修正 #2345 が実際に存在する

    current CI/checks が進行中なら結果まで確認する。

    REQUEST_CHANGES が全て解消され、tests/checks が green で、fresh adversarial review が approve なら #2342 を merge-ready と判定する。

    dependency chain を進めるため repository policy 上 merge が許容される場合は通常の controlled merge path を使用してよい。
    merge しない運用なら、以後の作業を stale main に対して実施せず、#2342 の head/base dependency を明示すること。

    未解消 blocker があれば #2345 / #2240 へ進まず、#2342 の fix_delta を先に完了する。


    Phase 3 — Issue #2345 を production blocker として処理する

    #2342 の変更が確定した後、Issue #2345 を fresh に確認する。

    #2345 が現在も open で未実装なら、これを #2240 より優先する direct prerequisite と扱う。

    Issue contract が implementation-ready なら impl-review-loop を使用して、

    • implementation
    • relevant hermetic tests
    • actual Claude Code live verification
    • adversarial review
    • fix_delta
    • final re-review

    を行う。

    特に次を証明すること。

    verify_agent_retrospective_live_smoke.py --runtime-profile claude_code --repo-root .

    相当の canonical live verification が、empty prompt 起因の

    reason_code="nonzero_exit"

    を未処理のまま返して失敗する状態ではないこと。

    単に nonzero_exit を benign allowlist に追加して緑化することを既定解にしない。
    production invocation に有意味な非空 prompt を渡して本来の retrospective path を成立させる案を優先して評価する。

    ただし Issue #2345 の authoritative contract / review が別の設計を要求している場合はそちらを優先する。

    SKIP / fallback / xfail を PASS の代替にしない。


    Phase 4 — #2346 を処理する

    Issue #2346 は #2240 の runtime prerequisite とは分離して扱う。

    ただし issue-refinement-loop が実装済み repair_action.apply consumer を「存在しない」と誤認する false-block regression は operational quality を直接悪化させるため、未解決なら #2240 の次回 orchestration 前に修正することを推奨する。

    #2346 の contract が current main と一致していることを確認し、docs-only scope のまま実装可能なら、専用 worktree で小さく完了させる。

    repair_action.apply 本体や他 skill へ不要な変更を広げない。

    #2345 とファイル競合しない場合でも、複数 scope を1 PRへ混載しない。


    Phase 5 — Parent #2192 consistency を解消する

    #2192 の authoritative body を確認する。

    現在、

    という矛盾が残っているなら解消する。

    推奨ポリシー:

    MVP project Skill の closure は Child 1〜6 で成立させ、#2240 plugin distribution は non-blocking optional follow-up とする。

    ただし、既存 schema / checker / repository convention に存在しない closure_mode 値を発明してはならない。

    まず repository 内の parent issue contract、schema、checker、既存 Issue を調査する。

    既存 vocabulary で表現可能なら controlled Issue edit を行う。
    新しい contract semantics が必要なら、#2192 本文を ad-hoc に壊さず、dedupe 後に narrowly-scoped follow-up Issue として切り出す。

    #2240 側だけに例外文を書き足して parent の authoritative closure rule と二重正本にする案は避ける。


    Phase 6 — #2240 implementation readiness を fresh に再判定する

    以下が全て成立してから #2240 の実装を検討する。

    この gate が PASS した場合のみ #2240 を impl-review-loop に handoff する。


    Phase 7 — #2240 を実装する場合

    current Issue #2240 を authority とし、self-contained local plugin portability に限定する。

    現行 Claude Code 公式仕様も fresh に Web 確認すること。特に以下を再検証する。

    • plugin root / .claude-plugin/plugin.json
    • skills/ / agents/ 等は .claude-plugin/ の兄弟
    • ${CLAUDE_PLUGIN_ROOT}
    • ${CLAUDE_PROJECT_DIR}
    • claude plugin validate
    • claude --plugin-dir
    • plugin-shipped agent frontmatter で unsupported な fields の正確な範囲

    Marketplace、manual semver、update/rollback machinery、committed smoke receipt、新規 permission/security harness を勝手に scope へ戻さない。

    clean-install smoke は loop-protocol 自身ではなく、.claude/ を持たない一時 Git repository で行う。

    plugin skill は plugin namespace を含む正規 invocation 名で明示起動し、実 retrospective を1回完走させる。

    runtime evidence は PR 本文へ bounded summary として残す。
    credential、secret、不要な absolute local path、raw transcript は投稿しない。


    実行原則

    • 1 Issue = 1 PR
    • dedicated worktree を使用
    • unrelated changes を混載しない
    • current GitHub/repository state を毎 Phase の authority とする
    • historical comment は削除・改変しない
    • stale report を current truth とみなさない
    • tests を green にするためだけの broad allowlist / skip / fallback を追加しない
    • security/harness は実利用を妨げる新規機構を不用意に増築しない
    • destructive operation、credential/secret の露出、想定外の権限昇格は停止する
    • Stop Condition に該当しない通常の investigation / implementation / test / review / fix_delta は継続する

    最後に以下を報告する。

    1. SubAgent の独立調査結果
    2. fix: agent-retrospective の observer wave 失敗を診断可能にし regression coverage gap を解消する #2342 current verdict / checks / disposition
    3. 実装: claude -p の空文字列 prompt 拒否 regression に対する agent-retrospective live smoke 検知経路の修正 #2345 の disposition と live verification evidence
    4. 実装: issue-refinement-loop/SKILL.md の apply_deterministic_repair 記述を repair_action.apply(#2039) 実装後の現行挙動へ更新する #2346 の disposition
    5. 導入: Claude-GPT運用ログの継続的レトロスペクティブと改善提案を行う agent-retrospective Skill を確立する #2192 consistency の解消方法
    6. 実装: agent-retrospective を optional plugin distribution として配布可能にする #2240 implementation readiness の fresh verdict
    7. 実装: agent-retrospective を optional plugin distribution として配布可能にする #2240 実装へ進んだ場合は PR URL・head SHA・tests・runtime evidence・review verdict
    8. 残存 blocker
    9. repository / Issue / PR に実際に加えた mutation

    この順序なら、packaging を直してから runtime が動かないことに気付くという逆順を避けられます。特に #2345 の解消を #2240 の明示 prerequisite に昇格させるのが今回の重要点です。

  7. squne121 commented on Aug 25, 2026

    @squne121
    OwnerAuthor

    #2240 implementation readiness 再判定 最終報告

    1. SubAgent 独立調査

    着手前に read-only codebase-investigator SubAgent を起動し完了を待った。その後の主張(PR #2342 merge-ready、#2345/#2346 の disposition 等)はすべて control-plane が gh / repository ファイルで独立に再検証した(SubAgent 報告時点で PR #2342 の state を「OPEN」としていたのは stale だったため、gh pr view で MERGED を直接確認して補正)。

    2. PR #2342 の verdict

    MERGED(2026-08-25T19:40:06Z、merge commit 0d0fad66e8fcb29187d8894f5cfcfb3636832bb3、現在の origin/main tip の祖先であることを git merge-base --is-ancestor で確認)。OWNER REQUEST_CHANGES(AC2 allowlist の粒度不足)は fix_delta で解消済み(_ALLOWLISTED_OBSERVER_WAVE_FAILED_REASON_CODES を observer_run_id_mismatch のみに縮小したことをソース上で直接確認)。CI 全 green。

    3. #2345 の disposition と live verification evidence

    Machine-Readable Contract 完備(runtime-verification: true)。VC annotation 不備(invalid_baseline_expect_annotation、command_not_allowed、unexpected_pass)を2周の issue-editor 修正で解消し status: go。impl-review-loop で実装(_default_observer_prompt() による非空 prompt 化、option 1採用)→ 独立 test-runner 検証(実 Claude CLI 2.1.245、reason_code: observer_run_id_mismatch, exit 0、pytest 432 passed)→ pr-reviewer APPROVE → merge_state_status: BEHIND 検出 → update_branch(head b255063b→e3b8ae14)→ 新 head で再検証・再レビューし再度 APPROVE/blockers なし/CI green。
    PR #2347(Closes #2345): draft_pr_ready、APPROVE、head e3b8ae1447856e89c7e9883910ec85b7196f1e46。未マージ。

    4. #2346 の disposition

    readiness blocker(Required Design References 欠落、EXTSURF001 decision不整合、AC1/AC4/AC6 annotation欠落)を3周の issue-editor 修正で解消し status: go。impl-review-loop で実装(SKILL.md 該当節の stale 記述を実装済み repair_action.apply consumer の正確な記述へ更新)→ 独立 test-runner 検証(AC1-6 全PASS、wc -l≤500行、test_thin_entrypoint.py 10/10)→ pr-reviewer APPROVE。
    PR #2351(Closes #2346): draft_pr_ready、APPROVE、head 1bc1831ce2fcc4a9040500fa21c3f9a47bdcc3c1。未マージ。

    5. #2192 consistency の解消方法

    closure_mode の許容値は docs/dev/github-ops.md により parent_mode: delivery-rollup の場合 child-complete のみ(新規値の発明は不可)。既存語彙内で解決可能と判断し、closure_mode 値自体は変更せず、Desired Destination / Parent Closure Rule / Child Issues の Child 7 行の prose を「closure に必須なのは Child 1〜6(#2234-#2239)であり、Child 7(#2240)は低優先度 optional follow-up で closure 必須条件に含めない」旨へ明確化する形で修正した(body_sha256: 6ae20b3be425efd1b41550439d1152da33aa397820b10951d61c592714805bf8)。

    6. #2240 implementation readiness の fresh verdict

    依然 blocked(ただし理由が変化)。

    current origin/main(tip c8a68a45)を直接検査したところ、PR #2347(#2345 の修正、_default_observer_prompt())は main に未反映(grep -c "_default_observer_prompt" origin/main:run_retrospective.py = 0)。つまり技術的な修正・検証・APPROVE はすべて完了しているが、現在の main 上で実行すれば verify_agent_retrospective_live_smoke.py は依然 nonzero_exit で FAIL する状態のままであり、Phase 6 gate の「current main で actual Claude Code live smoke が PASS」は未充足。

    これは技術的な未解決課題ではなく、Draft PR を人間がマージするのを待っている状態(本セッションを通じて一貫して採用してきた「PR は人間がマージ判断」の原則どおり、#2347/#2351 とも control-plane からは merge していない)。

    7. 実装へ進んだ場合

    #2240 自体の plugin implementation には着手していない(Phase 6 gate 不成立のため)。

    8. 残存 blocker

    9. Repository / Issue / PR への実際の mutation

    人間による PR #2347(必須)・PR #2351(推奨)のマージ後、#2240 の implementation readiness を再度 fresh 判定してください。

  8. squne121 commented on Aug 27, 2026

    @squne121
    OwnerAuthor

    判定

    REQUEST_CHANGES / implementation_readiness: blocked です。

    #2240 の現在の方向性――正規 plugin root、.claude-plugin/plugin.json、${CLAUDE_PLUGIN_ROOT} / ${CLAUDE_PROJECT_DIR}、Marketplace・semver・rollback を後回し、巨大な security harness を追加しない――は概ね妥当です。Claude Code 公式仕様とも一致しています。Plugin のコンポーネントは .claude-plugin/ の外、plugin root 直下に置き、Skill は /plugin-name:skill-name で namespaced invocation されます。version も optional です。(Claude)

    ただし、今の契約のまま実装を始めるべきではありません。過去の empty-prompt 系 blocker はかなり解消されていますが、現在はそれより本質的な runtime blocker と plugin portability blocker が見えています。

    敵対的レビュー findings

    Priority | Finding | 判定 -- | -- | -- P0 | project Skill の full production run がまだ成立していない | PR #2358 は merged で、3 observer の実 CLI smoke までは成功しています。しかし同じ検証で run_cli() を evaluator まで2回通したところ、両方とも finding_contract.identity.key に不正な追加フィールドが生成され、candidate_schema_invalid で失敗しています。#2240 自身が「MVP project Skill の本番 invocation が安定するまで停止」を Stop Condition にしているので、現時点ではその条件を満たしません。 P0 | evaluator failure は単なる prompt wording の問題より深い | EvaluatorRequest が evaluator に渡すのは run_id/base_sha/source_set_digest/finding_sets だけで、repository_id はありません。一方 canonical finding_contract.identity.key は repository_id/claim_class/subject_ref/rule_id を必須とし、identity.value はその key の JCS + SHA-256 から決定論的に算出され、validator が再計算して一致を要求します。しかも evaluator は tools: [] です。つまり「repository_id を知らない・SHA-256 を計算する道具もない LLM」に canonical identity を完成させています。 P0 | outer --plugin-dir が inner claude --agent へ伝播しない | 現行 run_retrospective.py は observer/evaluator ごとに新しい claude -p --agent subprocess を起動しますが、その argv に --plugin-dir はありません。Claude Code の --plugin-dir は「その session の duration」だけ有効です。したがって .claude/ のない別 repo で外側の Skill が起動できても、内側の fresh Claude process は plugin agents を見つけられません。 (Claude) P0 | 「self-contained runtime closure」が現行 reused Agents と矛盾する | 現行 codebase-investigator は実調査を .claude/skills/gemini-cli-headless-delegation/... に委譲することを必須化しています。web-researcher も同じ project-relative AGY machinery を primary route にしています。これらは #2240 の plugin root に含まれません。また web-researcher は最終出力を WEB_RESEARCH_RESULT_V1 と明示しており、retrospective 側が要求する OBSERVER_RESULT_V1 と system-prompt-level で競合します。単純コピーでは self-contained ではありません。 P1 | bare agent name は portable plugin として不安定 | 現行 subprocess は --agent codebase-investigator 等の bare name です。Plugin agent は plugin scope が最下位 priority なので project/user agent に同名があればそちらが優先されます。公式には scoped identifier (agent-retrospective:codebase-investigator) があり、これを使えば distribution asset を確実に選べます。(Claude) (Claude) P1 | Python dependency の隔離方法が AC にない | current project は root pyproject.toml の pyyaml/jsonschema に依存しています。Plugin に pyproject.toml / uv.lock を置くだけでは、target repo を cwd にして uv run --locked python3 した場合に plugin project を使う保証として弱いです。uv run --project "$PLUGIN_ROOT" --locked ... にすべきです。--project は project root だけ変更し cwd は維持するので、解析対象 repo を cwd のまま保てます。 (Astral Docs) P1 | AC5 が empty-output false-green を許す | 現行 default prompt は evidence がない場合 findings: [] を明示するので、clean-install smoke が「何も発見しない retrospective」で exit 0 になれば packaging だけ緑にできます。現在壊れているのはまさに non-empty candidate → evaluator の経路なので、AC5 は最低1件の substantive finding を流して canonical candidate が生成されるところまで見る必要があります。 P1 | clean smoke の auth 契約が曖昧 | main() の既定 backend は issue-comments で、gh auth がなければ fail-closed です。一方 #2240 は追加 auth 不要としています。Plugin 自体の portability smoke は --state-backend fixture を明示すべきです。ただし Claude Code 自身は公式 prerequisite として authenticated である必要があります。 (Claude) P2 | AC2 の rg CLAUDE_PLUGIN_ROOT は証明にならない | 文字列がコメントに1個入るだけでも PASS します。parents[4] や .claude/... が実 path に残っていても検出できません。現在の実装には実際に _REPO_ROOT = Path(__file__).resolve().parents[4] があります。 P2 | parent 関係の prose が一部 stale | #2192 側は現在「Child 1〜6 で parent closure、#2240 は optional」と明確化されており、以前の blocker は解消しています。一方 #2240 の Parent Goal Ref はまだ「7件すべてがマージ」を Desired Destination としていて stale です。コード blocker ではありませんが、実装前に直すべきです。

    最大の問題は evaluator

    PR #2358 で観測された candidate_schema_invalid は偶発的な Claude の formatting glitch として処理しない方がよいです。

    現在の evaluator prompt は identity.key を {"...": "..."} と例示していますが、実 schema は exact 4-key object です。さらに identity.value は deterministic SHA-256 であり、validator は実際に再計算します。run_evaluation() は model output を受け取った直後に canonical candidate validator へ通しており、deterministic enrichment phase は存在しません。

    ここは「prompt をもっと厳しくする」だけではなく、model judgment と deterministic derivation を分離するのが適切です。Evaluator には title/description、claim classification、subject、rule など判断が必要な値だけを返させ、repository_id、source_run_ref、timestamp、特に finding_contract.identity.value の SHA-256 は Python で組み立てる方が安定します。これは security harness ではなく、LLM に不得意な決定論処理をさせないための機能品質改善です。

    この prerequisite は project Skill 側の変更になるため、#2240 に混ぜるべきではありません。PR #2358 自身も別 Issue での追跡を推奨しています。

    Plugin 側は「コピー」より軽量化した方がよい

    #2240 では codebase-investigator.md と web-researcher.md を plugin に入れる予定ですが、project 版をそのままコピーする設計には反対です。

    個人利用の optional distribution なら、plugin 版 codebase-investigator は Read/Grep/Glob 等で解析対象 ${CLAUDE_PROJECT_DIR} を直接調査、plugin 版 web-researcher は native WebSearch/WebFetch を直接使用、両方とも最初から OBSERVER_RESULT_V1 専用 leaf にした方が有用です。AGY/Gemini delegation framework まで runtime closure に抱えると、配布物の大半が loop-protocol 内部インフラ依存になり、本 Issue の目的と逆行します。現在の reused Agent が持つ AGY 経路は project Skill 内では意味がありますが、portable plugin には不要です。

    また plugin-shipped Agent では hooks / mcpServers / permissionMode は公式に unsupported です。README で「無視される」と説明するだけでなく、plugin copy からその3フィールド自体を削除した方が誤解がありません。tools / disallowedTools はサポートされているので、既存の proposal-only 方針を守るために新しい permission harness を追加する必要はありません。(Claude)

    #2240 に入れるべき最小修正

    1. 実装開始 prerequisite を更新し、empty-prompt 問題ではなく「current main の substantive full run_cli() が evaluator → canonical non-empty candidate → PublishRequest まで実 CLI で1回成功」を条件にする。専用 CI は不要で、merge 前の live run 1回で十分です。

    2. plugin runtime transport を契約化する。Plugin Skill から Python へ plugin_root を明示的に渡し、内側の全 Claude subprocess でも --plugin-dir <plugin_root> を再指定する。agent 名は agent-retrospective:retrospective-runtime-observer 等の scoped name を使う。--plugin-dir が session scoped である以上、ここは必須です。(Claude)

    3. reused Agent の単純コピーをやめる。Plugin copy は retrospective 専用に軽量化し、loop-protocol の .claude/skills/gemini-cli-headless-delegation/** へ依存させない。

    4. Plugin Skill の起動は概ね uv run --project "${CLAUDE_PLUGIN_ROOT}" --locked python3 "${CLAUDE_PLUGIN_ROOT}/skills/run/scripts/run_retrospective.py" --repo-root "${CLAUDE_PROJECT_DIR}" ... という境界にする。${CLAUDE_PLUGIN_ROOT} は bundled assets、${CLAUDE_PROJECT_DIR} は解析対象、という現在の設計分離は正しいです。公式にも両変数がその用途で定義されています。(Claude)

    5. AC5 を具体化する。絶対 plugin path を保持したうえで git init -b main した .claude/ 無しの temp repo を使い、--state-backend fixture、canonical /agent-retrospective:run invocation、substantive nonce/finding を与え、最終 candidate_records が non-empty かつ canonical validation を通ることを PASS 条件にする。Plugin Skill は必ず namespaced になるのが公式仕様です。(Claude)

    6. 増やさないものを明記する。Marketplace publish、manual semver、rollback machinery、plugin-specific security harness、恒久的な Claude-live CI は引き続き Out of Scope でよいです。今回必要なのは portability correctness と1回の実動作確認であって、ガードレールの増築ではありません。

    推奨 disposition

    reframe_in_place + prerequisite follow-up 1件 が適切です。

    まず project Skill の evaluator/canonical-candidate 境界を直して substantive full run を成功させる。その後 #2240 本文へ child --plugin-dir propagation、scoped agent IDs、plugin専用 observer、uv --project、non-empty clean smoke を追加してから実装する、という順序です。

    逆に、今すぐ #2240 を実装すると、「plugin validate は通る」「Skill も起動する」「observer wave も通る」が、実際に改善候補を1件生成すると evaluator で落ちるという、かなり質の悪い false-green package を作る可能性が高いです。現在の Stop Condition はまさにこれを防ぐために残す価値があります。

    ## 判定

    REQUEST_CHANGES / implementation_readiness: blocked です。

    #2240 の現在の方向性――正規 plugin root、.claude-plugin/plugin.json、${CLAUDE_PLUGIN_ROOT} / ${CLAUDE_PROJECT_DIR}、Marketplace・semver・rollback を後回し、巨大な security harness を追加しない――は概ね妥当です。Claude Code 公式仕様とも一致しています。Plugin のコンポーネントは .claude-plugin/ の外、plugin root 直下に置き、Skill は /plugin-name:skill-name で namespaced invocation されます。version も optional です。([Claude]1)

    ただし、今の契約のまま実装を始めるべきではありません。過去の empty-prompt 系 blocker はかなり解消されていますが、現在はそれより本質的な runtime blocker と plugin portability blocker が見えています。

    敵対的レビュー findings

    Priority Finding 判定
    P0 project Skill の full production run がまだ成立していない PR #2358 は merged で、3 observer の実 CLI smoke までは成功しています。しかし同じ検証で run_cli() を evaluator まで2回通したところ、両方とも finding_contract.identity.key に不正な追加フィールドが生成され、candidate_schema_invalid で失敗しています。#2240 自身が「MVP project Skill の本番 invocation が安定するまで停止」を Stop Condition にしているので、現時点ではその条件を満たしません。
    P0 evaluator failure は単なる prompt wording の問題より深い EvaluatorRequest が evaluator に渡すのは run_id/base_sha/source_set_digest/finding_sets だけで、repository_id はありません。一方 canonical finding_contract.identity.key は repository_id/claim_class/subject_ref/rule_id を必須とし、identity.value はその key の JCS + SHA-256 から決定論的に算出され、validator が再計算して一致を要求します。しかも evaluator は tools: [] です。つまり「repository_id を知らない・SHA-256 を計算する道具もない LLM」に canonical identity を完成させています。
    P0 outer --plugin-dir が inner claude --agent へ伝播しない 現行 run_retrospective.py は observer/evaluator ごとに新しい claude -p --agent <name> subprocess を起動しますが、その argv に --plugin-dir はありません。Claude Code の --plugin-dir は「その session の duration」だけ有効です。したがって .claude/ のない別 repo で外側の Skill が起動できても、内側の fresh Claude process は plugin agents を見つけられません。 (Claude)
    P0 「self-contained runtime closure」が現行 reused Agents と矛盾する 現行 codebase-investigator は実調査を .claude/skills/gemini-cli-headless-delegation/... に委譲することを必須化しています。web-researcher も同じ project-relative AGY machinery を primary route にしています。これらは #2240 の plugin root に含まれません。また web-researcher は最終出力を WEB_RESEARCH_RESULT_V1 と明示しており、retrospective 側が要求する OBSERVER_RESULT_V1 と system-prompt-level で競合します。単純コピーでは self-contained ではありません。
    P1 bare agent name は portable plugin として不安定 現行 subprocess は --agent codebase-investigator 等の bare name です。Plugin agent は plugin scope が最下位 priority なので project/user agent に同名があればそちらが優先されます。公式には scoped identifier (agent-retrospective:codebase-investigator) があり、これを使えば distribution asset を確実に選べます。([Claude]3) ([Claude]3)
    P1 Python dependency の隔離方法が AC にない current project は root pyproject.toml の pyyaml/jsonschema に依存しています。Plugin に pyproject.toml / uv.lock を置くだけでは、target repo を cwd にして uv run --locked python3 <plugin script> した場合に plugin project を使う保証として弱いです。uv run --project "$PLUGIN_ROOT" --locked ... にすべきです。--project は project root だけ変更し cwd は維持するので、解析対象 repo を cwd のまま保てます。 ([Astral Docs]4)
    P1 AC5 が empty-output false-green を許す 現行 default prompt は evidence がない場合 findings: [] を明示するので、clean-install smoke が「何も発見しない retrospective」で exit 0 になれば packaging だけ緑にできます。現在壊れているのはまさに non-empty candidate → evaluator の経路なので、AC5 は最低1件の substantive finding を流して canonical candidate が生成されるところまで見る必要があります。
    P1 clean smoke の auth 契約が曖昧 main() の既定 backend は issue-comments で、gh auth がなければ fail-closed です。一方 #2240 は追加 auth 不要としています。Plugin 自体の portability smoke は --state-backend fixture を明示すべきです。ただし Claude Code 自身は公式 prerequisite として authenticated である必要があります。 (Claude)
    P2 AC2 の rg CLAUDE_PLUGIN_ROOT は証明にならない 文字列がコメントに1個入るだけでも PASS します。parents[4] や .claude/... が実 path に残っていても検出できません。現在の実装には実際に _REPO_ROOT = Path(__file__).resolve().parents[4] があります。
    P2 parent 関係の prose が一部 stale #2192 側は現在「Child 1〜6 で parent closure、#2240 は optional」と明確化されており、以前の blocker は解消しています。一方 #2240 の Parent Goal Ref はまだ「7件すべてがマージ」を Desired Destination としていて stale です。コード blocker ではありませんが、実装前に直すべきです。

    最大の問題は evaluator

    PR #2358 で観測された candidate_schema_invalid は偶発的な Claude の formatting glitch として処理しない方がよいです。

    現在の evaluator prompt は identity.key を {"...": "..."} と例示していますが、実 schema は exact 4-key object です。さらに identity.value は deterministic SHA-256 であり、validator は実際に再計算します。run_evaluation() は model output を受け取った直後に canonical candidate validator へ通しており、deterministic enrichment phase は存在しません。

    ここは「prompt をもっと厳しくする」だけではなく、model judgment と deterministic derivation を分離するのが適切です。Evaluator には title/description、claim classification、subject、rule など判断が必要な値だけを返させ、repository_id、source_run_ref、timestamp、特に finding_contract.identity.value の SHA-256 は Python で組み立てる方が安定します。これは security harness ではなく、LLM に不得意な決定論処理をさせないための機能品質改善です。

    この prerequisite は project Skill 側の変更になるため、#2240 に混ぜるべきではありません。PR #2358 自身も別 Issue での追跡を推奨しています。

    Plugin 側は「コピー」より軽量化した方がよい

    #2240 では codebase-investigator.md と web-researcher.md を plugin に入れる予定ですが、project 版をそのままコピーする設計には反対です。

    個人利用の optional distribution なら、plugin 版 codebase-investigator は Read/Grep/Glob 等で解析対象 ${CLAUDE_PROJECT_DIR} を直接調査、plugin 版 web-researcher は native WebSearch/WebFetch を直接使用、両方とも最初から OBSERVER_RESULT_V1 専用 leaf にした方が有用です。AGY/Gemini delegation framework まで runtime closure に抱えると、配布物の大半が loop-protocol 内部インフラ依存になり、本 Issue の目的と逆行します。現在の reused Agent が持つ AGY 経路は project Skill 内では意味がありますが、portable plugin には不要です。

    また plugin-shipped Agent では hooks / mcpServers / permissionMode は公式に unsupported です。README で「無視される」と説明するだけでなく、plugin copy からその3フィールド自体を削除した方が誤解がありません。tools / disallowedTools はサポートされているので、既存の proposal-only 方針を守るために新しい permission harness を追加する必要はありません。([Claude]2)

    #2240 に入れるべき最小修正

    1. 実装開始 prerequisite を更新し、empty-prompt 問題ではなく「current main の substantive full run_cli() が evaluator → canonical non-empty candidate → PublishRequest まで実 CLI で1回成功」を条件にする。専用 CI は不要で、merge 前の live run 1回で十分です。
    2. plugin runtime transport を契約化する。Plugin Skill から Python へ plugin_root を明示的に渡し、内側の全 Claude subprocess でも --plugin-dir <plugin_root> を再指定する。agent 名は agent-retrospective:retrospective-runtime-observer 等の scoped name を使う。--plugin-dir が session scoped である以上、ここは必須です。([Claude]2)
    3. reused Agent の単純コピーをやめる。Plugin copy は retrospective 専用に軽量化し、loop-protocol の .claude/skills/gemini-cli-headless-delegation/** へ依存させない。
    4. Plugin Skill の起動は概ね uv run --project "${CLAUDE_PLUGIN_ROOT}" --locked python3 "${CLAUDE_PLUGIN_ROOT}/skills/run/scripts/run_retrospective.py" --repo-root "${CLAUDE_PROJECT_DIR}" ... という境界にする。${CLAUDE_PLUGIN_ROOT} は bundled assets、${CLAUDE_PROJECT_DIR} は解析対象、という現在の設計分離は正しいです。公式にも両変数がその用途で定義されています。([Claude]2)
    5. AC5 を具体化する。絶対 plugin path を保持したうえで git init -b main した .claude/ 無しの temp repo を使い、--state-backend fixture、canonical /agent-retrospective:run invocation、substantive nonce/finding を与え、最終 candidate_records が non-empty かつ canonical validation を通ることを PASS 条件にする。Plugin Skill は必ず namespaced になるのが公式仕様です。([Claude]1)
    6. 増やさないものを明記する。Marketplace publish、manual semver、rollback machinery、plugin-specific security harness、恒久的な Claude-live CI は引き続き Out of Scope でよいです。今回必要なのは portability correctness と1回の実動作確認であって、ガードレールの増築ではありません。

    推奨 disposition

    reframe_in_place + prerequisite follow-up 1件 が適切です。

    まず project Skill の evaluator/canonical-candidate 境界を直して substantive full run を成功させる。その後 #2240 本文へ child --plugin-dir propagation、scoped agent IDs、plugin専用 observer、uv --project、non-empty clean smoke を追加してから実装する、という順序です。

    逆に、今すぐ #2240 を実装すると、「plugin validate は通る」「Skill も起動する」「observer wave も通る」が、実際に改善候補を1件生成すると evaluator で落ちるという、かなり質の悪い false-green package を作る可能性が高いです。現在の Stop Condition はまさにこれを防ぐために残す価値があります。

  9. squne121 commented on Aug 27, 2026

    @squne121
    OwnerAuthor

    Follow-up 起票: #2362

    OWNER レビュー(issuecomment-5440967843)で指摘された agent-retrospective evaluator 側の identity 決定論化バグ(run_evaluation() が evaluator LLM 出力を identity.key/identity.value 決定論的算出なしにそのまま canonical candidate validator へ通す設計)を、project Skill 側の独立 follow-up Issue として起票しました。

  10. squne121 commented on Aug 27, 2026

    @squne121
    OwnerAuthor

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

    decide_next_loop_action.py の判定により max_iterations(既定3)を超過したため停止します。

    これまでの反復

    1. OWNER の anchor comment(issuecomment-5440967843、REQUEST_CHANGES / reframe_in_place 推奨)に基づき、prerequisite follow-up Issue 実装: agent-retrospective evaluator の identity.value 決定論的算出を分離する deterministic enrichment phase を追加する #2362(agent-retrospective evaluator の deterministic enrichment phase 追加)を新規起票しました。
    2. 実装: agent-retrospective を optional plugin distribution として配布可能にする #2240 本文を OWNER 指摘に沿って書き換えました(Parent Goal Ref の stale 修正、Stop Conditions の prerequisite を 実装: agent-retrospective evaluator の identity.value 決定論的算出を分離する deterministic enrichment phase を追加する #2362 ベースへ更新、plugin runtime transport contract の追加、reused Agent コピー方針の変更、AC2/AC3/AC5 の強化、Required Design References への 実装: agent-retrospective evaluator の identity.value 決定論的算出を分離する deterministic enrichment phase を追加する #2362 追加)。
    3. review pipeline が # baseline-expect: go という無効な annotation を検出(2 blockers)→ # baseline-expect: fail に修正。
    4. 再レビューで新たに VCP_BROAD_SEARCH_PATH_UN blocker を検出(AC3 の追加 Verification Command が glob plugins/agent-retrospective/agents/*.md を使っており、checker が「broad search path」として fail-closed)。

    残存 Blocker(未解消)

    • VCP_BROAD_SEARCH_PATH_UN: AC3 の Verification Command
      $ rg -q -e "^hooks:" -e "^mcpServers:" -e "^permissionMode:" plugins/agent-retrospective/agents/*.md
      
      の *.md glob が checker に "broad search path" と判定されています。推奨修正: Allowed Paths に列挙済みの4ファイルを個別に列挙する形(例: plugins/agent-retrospective/agents/retrospective-runtime-observer.md plugins/agent-retrospective/agents/retrospective-evaluator.md plugins/agent-retrospective/agents/codebase-investigator.md plugins/agent-retrospective/agents/web-researcher.md)へ書き換える。

    この修正自体は機械的で低リスクですが、issue-refinement-loop の loop_iteration_approval_gate(max_iterations 到達時は無条件で human_escalation)に従い、これ以上の自動反復は行いません。

    非blocking な既存所見

    次のアクション(人間判断待ち)

    1. 上記 VC の glob を個別ファイル列挙に修正する(簡易 fix)。
    2. 修正後、issue-refinement-loop を再実行して残り blocker がないことを確認する。
    3. 実装: agent-retrospective evaluator の identity.value 決定論的算出を分離する deterministic enrichment phase を追加する #2362(prerequisite)のマージと live run 確認が完了するまで、実装: agent-retrospective を optional plugin distribution として配布可能にする #2240 自体の実装は Stop Condition により着手しない。

    現在の body_sha256: sha256:94ad1e50548758827cb6b8a0bb2acf3fe6d142827415a72b00dbdfada904b21e

  11. squne121 commented on Aug 27, 2026

    @squne121
    OwnerAuthor

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

    review pipeline が VERDICT: approve / BLOCKERS: 0 を返しました(body_sha256: sha256:89e08f99012443350df6e51c6514c11663824b09cd3fe816dd7095260c4281a6)。

    反映内容サマリ

    1. OWNER の anchor comment(issuecomment-5440967843、REQUEST_CHANGES / reframe_in_place 推奨)を fact-check(codebase-investigator / web-researcher、ほぼ全主張が実コード・公式ドキュメントと一致)。
    2. prerequisite follow-up Issue 実装: agent-retrospective evaluator の identity.value 決定論的算出を分離する deterministic enrichment phase を追加する #2362(agent-retrospective evaluator の deterministic enrichment phase 追加)を新規起票。
    3. 実装: agent-retrospective を optional plugin distribution として配布可能にする #2240 本文を全面改訂:
    4. 3回の反復修正(VC annotation 誤り2箇所、AC3 glob path の broad-search-path 修正)を経て VERDICT: approve を達成。

    Final Gate(実装着手ゲート)について

    issue-refinement-loop は Issue 本文の品質改善のみを担当し、impl-review-loop への自動 handoff は意図的に実行していません。理由: 本 Issue の ## Stop Conditions に以下が明記されており、これは refinement loop の対象外である business-level な着手条件です。

    これらの条件は現時点で満たされていないため、LOOP_HANDOFF_RESULT_V1 marker は出力せず、impl-review-loop の起動は行いません(root_entry_router.py の live invocation も意図的に実行していません)。

    次のアクション(人間判断)

    1. 実装: agent-retrospective evaluator の identity.value 決定論的算出を分離する deterministic enrichment phase を追加する #2362(prerequisite)の実装・マージ・live run 確認
    2. 導入: Claude-GPT運用ログの継続的レトロスペクティブと改善提案を行う agent-retrospective Skill を確立する #2192 の Child 1〜6 の安定運用開始状況を踏まえた着手順序の確認
    3. 上記が整った時点で、人間または別セッションが impl-review-loop を明示的に起動する

    現在の body_sha256: sha256:89e08f99012443350df6e51c6514c11663824b09cd3fe816dd7095260c4281a6

  12. 1 remaining item

  13. squne121 commented on Aug 29, 2026

    @squne121
    OwnerAuthor

    結論

    今回の #2240 停止については、モデルの性格より Claude-GPT のハーネス/control-plane 側を主因として調査するのが妥当です。

    ログ上、最初の human-context preflight 自体は通っています。その後の capability preflight が github:auth_unavailable で deterministic に停止しています。 さらに gh auth login 後は認証ブロッカーを越えたものの、今度は #2240 と無関係な tmp/issue_2397_txn_input.json を unauthorized_write_path として検出して停止しています。 これは少なくとも、この2回の停止そのものが「GPTモデルが慎重だから止まった」という種類ではありません。

    しかも認証にはかなり怪しい境界があります。現行 launch.sh は、isolated HOME に切り替える前の native GH_CONFIG_DIR を保存し、GitHub auth だけは native Claude Code と同等に共有するという明示設計です。 一方、現行 skill_runtime_exec.py の環境サニタイズでは、GH_CONFIG_DIR を allowlist に加えるのが preflight.run.fixture.with_human_context に限定されているコードが存在します。 workflow_capability_preflight.py 自体は GH_CONFIG_DIR / token carrier を残すよう改修されているので、launcher → privileged executor → capability preflight の途中で credential carrier が欠落している可能性はかなり具体的な調査仮説です。

    もう一つ重要なのは、write-path guard です。現在の skill_runtime_exec.py 自身が「並行セッション等による書込みを child の書込みと区別できない」ことを認め、そのたびに .claude/worktrees、issue-refinement artifacts、session manifest、.pytest_cache などを race-tolerant exception として積み上げています。 したがって今回も tmp/ を丸ごと allowlist するのではなく、tmp/issue_2397_txn_input.json が本当に実行前から不変だったのか、preflight 中に別プロセスが変更したのかを stat/digest/trace で実証してから直すべきです。

    推奨する進め方

    1. 実装: agent-retrospective を optional plugin distribution として配布可能にする #2240 の再開と Claude-GPT 改善調査を分離する。 実装: agent-retrospective を optional plugin distribution として配布可能にする #2240 はまず native Claude Code を主経路にし、canonical main root から再開する。ただし tmp/issue_2397_txn_input.json は削除を先にせず、mtime・inode・SHA・生成元・参照元を採取してから stale artifact なら安全に整理します。issue-refinement-loop の mutation control-plane は canonical main root/default branch 前提なので、実際の 実装: agent-retrospective を optional plugin distribution として配布可能にする #2240 更新を診断用 worktree に移すのは避けます。

    2. 診断は dedicated worktree で A/B 比較する。 同一 HEAD、同一 Claude Code binary、同一 prompt、同一 GitHub account、同程度の clean state で native Claude Code と Claude-GPT launcher を比較します。既に 実装: worktree-agent-runtime-smoke の Claude-GPT launcher 経由 live causal-evidence 検証を実施し native Claude Code との比較 receipt を記録する #2231 / worktree-agent-runtime-smoke に native vs Claude-GPT の live causal-evidence 比較基盤があるため、新しい比較ハーネスを作らない方がよいです。

    3. 認証を最優先 P0 とする。 HOME / XDG_CONFIG_HOME / GH_CONFIG_DIR / GH_TOKEN/GITHUB_TOKEN の「値」ではなく、presence・設定ディレクトリの identity・gh auth status・gh api user` の結果だけを native / launcher / privileged child の3境界で比較します。実装: Claude-GPT の GitHub access を compatibility-first に切り替え既存 workflow を安定化する #2299/実装: Claude-GPT workflow の actor-scoped capability handoff を導入し issue-refinement-loop の auth/delegation parity を安定化する #2340 の既存 ownership と照合し、既存修正の regression なら新しい仕組みを足さずそこを直します。

    4. guard は「さらに例外を足す」のではなく attribution を直す。 pre-existing untracked/ignored file が不変なら成功、child または同時実行による create/update/delete だけを検出する、という baseline-delta semantics を実機で確認します。今回のファイルが実際には並行 実装: route_canonical_step2_result() に verified failure_class ベースの operator intervention route を追加する #2397 セッションに変更されていたなら guard は正しく、その場合は workflow ごとの一時ファイル配置を active issue artifact root / worktree-local state へ移す方が正解です。tmp/** 全許可や自動削除は避けます。

    5. retrospective は集計器として使い、そこ自体を新しいブロッカーにしない。 現行 agent-retrospective は Claude Code / Claude-GPT session evidence、repository、GitHub、Web 等を observer wave → evaluator で統合する用途なので今回に適しています。 ただし retrospective 自体の live structured-output 系には既知の問題領域があるため、typed failure したら全調査を止めず、raw runtime evidence と各 SubAgent の独立調査を正本にします。

    特に改善価値が高いのは、preflight.run.with_human_context が pass した後にモデルが planned_operations の仕様をコード検索して手組みしている部分です。現行 SKILL は bare preflight.run に invocation-scoped LOOP_PLANNED_OPERATIONS_JSON が必須だとしています。 ここは「モデルが賢く読み解く」ことを要求せず、前段が次に実行すべき command + env request を完全な machine-readable form で返すべきです。これは Claude と GPT の挙動差をかなり減らせます。

    以下のプロンプトなら、#2240 の作業再開と根本原因調査を一度に進めつつ、雑にガードを弱める方向へ流れにくいです。

    あなたは /home/squne/projects/LOOP_PROTOCOL の repository owner から委任された Claude Code operator として作業してください。

    今回の目的は2つあります。

    第一に、Issue #2240 の issue-refinement-loop を安全に再開し、anchor comment
    https://github.com/squne121/loop-protocol/issues/2240#issuecomment-5462271966
    を対象として、現在の main / Issue / comment / repository contract に従って refinement を完了可能なところまで進めること。

    第二に、Claude Code native では比較的スムーズに既存 workflow が完走する一方、Claude-GPT launcher 経由では GitHub 再認証、capability preflight、unauthorized_write_path 等で頻繁に停止する問題について、モデル特性と harness/control-plane defect を切り分け、再発防止策を具体化することです。

    このタスクでは「ガードを増やすこと」や「fail-close を増やすこと」を品質とはみなしません。個人趣味開発であり、優先順位は以下です。

    workflow の安定完走性・有用性 > correctness/readback > 最小限の安全境界 > 追加 hardening

    既存の branch protection、GitHub server-side protection、CI、pre/post readback で十分担保できるものについて、新しい generic broker、MCP、PreToolUse enforcement、permission gate、永続 ledger、schema を安易に追加しないでください。

    また、既存 guard を回避するために --dangerously-skip-permissions 等を利用したり、tmp/** のような broad allowlist を追加したり、正体不明の既存ファイルを自動削除したりしないでください。

    既知の今回の事象

    Issue #2240 に対し human-context preflight:

    preflight.run.with_human_context

    は STATUS: pass / NEXT_ACTION: proceed まで成功した。

    その後、bare workflow capability preflight を

    LOOP_PLANNED_OPERATIONS_JSON=... skill_runtime_exec.py --command-id preflight.run ...

    として実行したところ、

    • github:auth_unavailable
    • controlled_github_read failure

    で停止した。

    その session 内で gh auth login を実行すると認証自体は成功した。

    その後、同じ #2240 preflight を再実行すると、

    SKILL_RUNTIME_FAIL: reason_code=unauthorized_write_path target_issue=2240 unauthorized write path=tmp/issue_2397_txn_input.json

    で停止した。

    tmp/issue_2397_txn_input.json は #2240 ではなく #2397 系 workflow の一時ファイルと思われるが、「preflight 開始前から存在して不変だった」のか、「preflight 実行中に別 process/session によって create/update された」のかはまだ証明されていない。

    この違いを推測で処理しないこと。

    最重要: SubAgent を使うこと

    まず root/main agent 自身は証拠採取と orchestration に集中し、以下の独立調査を SubAgent に fan-out してください。

    可能なら5系統、最低でも4系統に分けてください。

    SubAgent A — runtime / retrospective forensics

    直近の Claude Code / Claude-GPT workflow evidence を調査する。

    対象には最低限:

    を含める。

    .claude/skills/agent-retrospective/ の SKILL.md と実装を読み、canonical agent-retrospective が今回の分析に有効なら利用する。

    retrospective は proposal-only evidence synthesis として使用する。
    retrospective 自体が typed operational failure / structured-output failure になった場合、それを今回の workflow 全体の停止理由にはしない。その failure 自体を evidence として保存し、manual/runtime evidence investigation を継続する。

    過去の全セッションを無差別に読むのではなく、今回の failure class と比較可能な recent runs に絞る。

    成果:

    • repeated failure taxonomy
    • Claude Code only / Claude-GPT only / 共通 failure の分類
    • recurrence evidence
    • harness/model/environment の暫定 attribution

    SubAgent B — GitHub auth / environment parity

    以下の境界をコードと実機で比較する。

    1. native shell
    2. native Claude Code
    3. scripts/claude-gpt/launch.sh child
    4. scripts/agent-guards/skill_runtime_exec.py child
    5. workflow_capability_preflight.py の root probe
    6. controlled_github_read 相当 environment

    特に確認:

    現行 launcher は native GitHub credential を compatibility-first で共有する設計のはずなので、
    GH_CONFIG_DIR / GH_TOKEN / GITHUB_TOKEN がどの boundary で落ちるかを実証する。

    credential の値は絶対にログへ出さない。
    比較してよいものは:

    • env key の presence/absence
    • config directory の canonical path identity
    • gh auth status exit/status
    • gh api user --jq .login 等の identity
    • sanitized hash / boolean
    • exit code / reason code

    だけとする。

    特に skill_runtime_exec.py::_sanitize_env() が production preflight.run に GH_CONFIG_DIR を渡しているか、fixture と production の挙動差を source + runtime の双方で検証する。

    「launch.sh では共有しているから問題ない」で終了しないこと。
    end-to-end で consumer まで到達していることを証明する。

    SubAgent C — unauthorized_write_path / filesystem attribution

    tmp/issue_2397_txn_input.json の provenance を調査する。

    最初に canonical checkout を変更せず以下を取得する:

    削除、truncate、移動は evidence 採取完了まで禁止。

    次に skill_runtime_exec.py の repository before/after snapshot、_git_status_paths()、unauthorized path 判定を読み、

    • pre-existing + unchanged
    • pre-existing + concurrent update
    • child create
    • child update
    • child delete
    • peer process create/update

    がどう分類されるかを current main で明らかにする。

    可能なら dedicated diagnostic worktree / fixture repo で reproduction test を行う。

    strace 等が既に利用可能なら、追加インストールなしの read-only diagnostic として bounded に利用してよい。
    利用不可なら無理に導入しない。

    重要:
    今回のファイルが本当に pre-existing unchanged だった場合は、なぜ unauthorized_write_path に含まれたかを call graph まで追う。

    逆に preflight 中に #2397 の peer process が更新していた場合は、guard failure 自体を false positive と断定しない。
    その場合は「同じ canonical checkout を複数 workflow が共有する設計」または「transaction temp file の配置場所」を改善対象として評価する。

    既存の .pytest_cache、shadow-log、session-manifest 等の race-tolerant special case の歴史も確認し、path-specific exception が増殖していないか評価する。

    新しい tmp/** broad exception は提案しない。

    SubAgent D — native Claude Code vs Claude-GPT controlled comparison

    Issue #2231 / worktree-agent-runtime-smoke 等、既存の native vs Claude-GPT comparison infrastructure をまず調査し、再利用する。

    新しい parity harness を作る前に既存 runner で足りるか確認する。

    同一条件を可能な限り固定する:

    • same repository HEAD SHA
    • same Claude Code executable/version
    • same task/prompt
    • same agent definition
    • same clean worktree baseline
    • same GitHub identity
    • same relevant environment presence
    • same runtime evidence collection
    • only runtime adapter/model route differs

    最低限、以下を別々に比較する。

    A. model をほぼ介さない deterministic capability/preflight invocation
    B. SubAgent spawn / tool execution
    C. issue-refinement-loop の最初の planning/routing
    D. 可能なら #2240 と同型の read-only/canary scenario

    判定ルール:

    • 同一 low-level command が native / Claude-GPT の両方で同じように失敗
      → repository harness/control-plane defect

    • launcher 経由だけで model response 前に env/auth/capability probe が失敗
      → Claude-GPT launcher/harness defect

    • capability は同一なのに Claude-GPT だけ別の非canonical command を選ぶ、必要な next action を消費しない
      → model/procedural-compliance 差の疑い

    • --json-schema / structured output 等、model generation 後に一方だけ schema failure
      → model / Claude Code CLI adapter / structured-output interaction を別 bucket として扱う

    「GPTだから」でまとめないこと。

    SubAgent E — #2240 current contract / safe resume

    Issue #2240、anchor comment、関連 Issue / PR / comments、current main の repository asset を読み直し、
    #2240 自体の refinement に現在必要な修正を整理する。

    特に anchor comment で指摘済みの P0/P1 が current main / current Issue body で未解決かを再検証する。

    #2240 の目的でない Claude-GPT harness defect を #2240 本文に混ぜない。

    #2240 refinement と runtime/harness improvement の ownership を分離する。

    SubAgent completion invariant

    全 SubAgent を開始したら、root は途中結果だけで最終結論を作らないこと。

    全 SubAgent が terminal state
    completed / failed / timed_out / cancelled
    のいずれかになるまで待つ。

    正常に完了していない SubAgent がある場合は、原因が transient なら1回だけ bounded retry してよい。

    それでも完了しない場合は、
    「どの調査が未完了か」
    を明示してから synthesis する。

    全 Agent の終了確認前に「調査完了」と報告してはならない。

    leaf SubAgent からさらに無制限に nested SubAgent を spawn させない。

    Root agent が直接行う独立検証

    SubAgent の報告をそのまま採用しない。

    root 自身で最低限以下を直接確認する。

    SubAgent claim と source/runtime evidence が矛盾したら root の独立再現を優先し、矛盾を報告する。

    dedicated worktree での実機検証

    実 Issue mutation 用 control-plane と diagnostic runtime を混ぜない。

    issue-refinement-loop の canonical mutation phase が canonical main root/default branch を要求する場合、その契約を守る。

    一方、

    • auth parity
    • guard attribution
    • native vs Claude-GPT comparison
    • regression reproduction
    • smoke tests

    は専用 diagnostic worktree / temporary fixture repository で実施し、既存 main checkout の incidental state をできるだけ排除する。

    診断 worktree では current main と exact SHA を記録する。

    今回特に検証する仮説

    仮説1:
    launch.sh は native GH_CONFIG_DIR を Claude-GPT に渡しているが、skill_runtime_exec.py の production _sanitize_env() がそれを落とし、workflow capability preflight が credential を見失っている。

    仮説2:
    tmp/issue_2397_txn_input.json は unrelated pre-existing state なのに、repo-wide guard が child write と誤帰属している。

    仮説3:
    仮説2は誤りで、実際には #2397 の別 process/session が #2240 preflight 中にこのファイルを更新しており、現在の single-checkout concurrency と temp-file ownership が問題である。

    仮説4:
    preflight.run.with_human_context → next canonical command の handoff が self-contained ではなく、model に planned_operations の手組みを要求しているため Claude と GPT で recovery 行動に差が出ている。

    仮説5:
    Claude-GPT固有 model behavior は一部に存在するが、今回観測した auth failure / unauthorized_write_path は model inference の前後にある deterministic harness failure であり、別 bucket である。

    各仮説を
    confirmed / rejected / inconclusive
    で判定し、根拠を付ける。

    #2240 の再開

    forensics に必要な initial evidence を確保した後、#2240 を再開する。

    ただし tmp/issue_2397_txn_input.json は以下の場合だけ整理してよい。

    削除が必要なら、破壊的操作に該当するため勝手に削除せず停止する。
    安全な「生成元 workflow が提供する cleanup command」が存在する場合は、その canonical cleanup を優先する。

    単なる stale disposable temp file で、repository policy 上安全な cleanup command が既に存在する場合のみその既存手順を使用する。

    その後、#2240 の canonical human-context lane を fresh に実行する。

    同じ blocker が再発した場合は retry loop にせず、今回の diagnostic evidence と結合する。

    #2240 の refinement contract が修正可能なら、人間の iteration approval を要求せず current loop policy の上限まで進める。

    Issue本文変更、review、readback、fresh review まで canonical skill procedure に従う。

    改善案の設計原則

    今回の結果から implementation follow-up が必要なら、まず既存 Issue ownership と dedupe する。

    特に:

    を確認する。

    既存 Issue が同じ defect を所有しているなら重複 Issue を作らず、その Issue の regression / follow-up として扱う。

    別 defect なら最小の implementation Issue に分割する。

    優先順位の候補は以下。

    P0:
    GitHub auth propagation が launcher → skill_runtime_exec → capability preflight → controlled consumer まで end-to-end で保持されること。

    P0:
    unrelated/pre-existing repository state が child の unauthorized write と誤帰属されないこと。
    ただし実際の concurrent write は検出を維持する。

    P1:
    preflight.run.with_human_context が次 command に必要な capability request / planned operations を machine-readable に完全に引き渡し、モデルが source を grep して env JSON を手組みしなくてよいこと。

    P1:
    native Claude Code / Claude-GPT parity smoke を既存 #2231 infrastructure に追加または再利用して、auth/preflight regression を継続検知できること。

    P1:
    workflow restartability。
    auth fix 等の環境修復後に最初から曖昧に再実行するのではなく、canonical artifacts/readback に基づき最後の safe phase から再開できること。
    ただし新しい永続 state machine を作る前に、既存 artifact で十分かを確認する。

    避ける修正

    以下は原則採用しない。

    • tmp/** の broad allowlist
    • repo-wide dirty state の一律無視
    • unauthorized_write_path 全体の warning 化
    • arbitrary temp file の自動削除
    • 毎回 gh auth login させる運用 workaround
    • host HOME 全体の共有
    • credential 値の artifact 保存
    • 新規 generic GitHub broker
    • 新規 enforcing PreToolUse hook
    • 重複する capability registry
    • model が正しい command を推測することを前提にした contract
    • harness defect を「GPTモデルの性格」で片付けること
    • upstream/model差を証明せず harness だけを全面撤去すること

    実装について

    このタスクの主目的は investigation + #2240 refinement resume + remediation plan である。

    ただし調査中に、
    「current existing Issue が既にこの defect を所有し、修正方法が明確で、Allowed Paths / AC も既に揃っている」
    ことが判明した場合は、その Issue の current contract に従った実装着手可否まで推奨してよい。

    新規 repository code をその場で大量変更しない。

    新しい defect について implementation が必要なら、まず既存 ownership と overlap を確認し、Issue scope を作成/提案する。

    Issue mutation は canonical repository skill が存在する場合それを使う。

    停止条件

    以下だけは停止して人間へ報告する。

    • secret/token 本体を扱う必要が生じた
    • credential の再発行・失効が必要
    • root checkout の正体不明ファイルを破壊的に削除する必要がある
    • force push / history rewrite / destructive git operation が必要
    • GitHub repository 権限変更が必要
    • current owner decision を supersede しないと解決不能
    • 実装: agent-retrospective を optional plugin distribution として配布可能にする #2240 と無関係な active workflow の状態を破壊しないと進めない

    通常の read-only investigation、テスト、dedicated worktree 作成、SubAgent 起動、retrospective、GitHub read、Issue refinement loop の既存 canonical mutation は人間承認待ちにしない。

    最終報告

    最後に以下を明確に分けて報告する。

    1. #2240

    • tested HEAD
    • anchor
    • refinement の最終状態
    • Issue本文が変更されたか
    • remaining blockers
    • next action

    2. Claude-GPT friction root causes

    各 failure を

    • harness/control-plane
    • Claude-GPT launcher
    • shared repository workflow design
    • Claude Code CLI/upstream
    • model/procedural behavior
    • inconclusive

    のいずれかへ分類する。

    3. Auth parity

    native → launcher → executor → controlled consumer の各境界で何が維持/欠落していたか。

    4. unauthorized_write_path

    tmp/issue_2397_txn_input.json が

    • pre-existing unchanged
    • concurrent peer mutation
    • child mutation
    • unknown

    のどれだったか。
    証拠を示す。

    5. native vs Claude-GPT comparison

    同一条件の comparison matrix と、差が model 起因か environment/harness 起因か。

    6. retrospective findings

    recurrent / regressed / new の候補。
    retrospective 自体が失敗した場合はその failure も記録する。

    7. 推奨改善

    P0 / P1 / P2 に優先度分けし、

    • existing Issue owner
    • 新規 follow-up が必要か
    • expected change
    • regression test
    • runtime verification
      を記載する。

    8. 「今すぐやるべき次の1手」

    複数案を並べるだけで終わらず、最も workflow friction を減らす次のアクションを1つ選ぶ。

    最後まで、全 SubAgent が terminal completion したことを確認してから報告してください。

    このプロンプトで重要なのは、#2240 を再開すること自体を Claude-GPT の修理完了待ちにしない一方、今回の停止証拠は消さずに parity 調査へ流用する点です。

    現時点で私なら最優先にするのは、GH_CONFIG_DIR の end-to-end propagation の実機確認です。そこが実際に欠落していれば、既に #2299 で「native と同等にする」と決めているにもかかわらず下流 executor がそれを打ち消していることになり、セキュリティ強化ではなく純粋な compatibility regressionとして小さく直せます。その次に tmp/issue_2397_txn_input.json の before/after attribution を詰める順番がよいです。

  14. squne121 commented on Aug 29, 2026

    @squne121
    OwnerAuthor

    root-owned entry router audit

    route: invoke_impl_review_loop
    reason: fresh_review_go_live_equality

  15. squne121 commented on Aug 29, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop 終了報告(#2240)

    経緯

    1. Step 0f preflight: STATUS: pass。structural repair 不要(disposition_summary: no_missing_fields_detected)。過去コメント(issuecomment-5411157252)にあった apply_deterministic_repair の human-judgment-route 扱いは、現行 .claude/skills/issue-refinement-loop/SKILL.md および repair_action.apply controlled consumer(実装: repair_action candidate を controlled Issue transaction へ自動適用する main control-plane consumer を追加する #2039 / PR 実装: repair_action.apply の controlled Issue transaction consumer を追加する #2202、直近の 実装: template-derived structural_repair_action を controlled consumer へ接続し、blocked precedence deadlock を解消する #2396 でさらに接続済み)で解消済みであることを codebase-investigator が独立確認した(stale 記述なし)。
    2. Step 1 / Step 1b: codebase-investigator / web-researcher を並列起動し、anchor comment の技術的主張(P0×2, P1×5, P2×2)を current main(実コード・git log・Claude Code 公式ドキュメント)に照らして fact-check。ほぼ全項目 confirmed。
    3. Step 2: deterministic checker(run_root_review_pipeline.py produce)は VERDICT: approve(C1–C13 全 pass)。ただし anchor comment は architecture/design 判断を含む REQUEST_CHANGES であったため、Step 2.5 semantic design review の applicability 判定(semantic_review_trigger.py)で semantic_review_applicable: true(signals: user_requested / semantic_rewrite_requested / cross_contract_change.orchestration)。
    4. Step 2.5(1周目): issue-design-reviewer が anchor feedback 7点+派生の medium/low 2点、計9件の finding(blocker×2, high×3, medium×1, low×3)を検出。join_review_results.py → effective_verdict: needs-fix(rewrite_lane: semantic)。
    5. Step 4(rewrite・1周目): issue-editor が9件全てを本文へ反映(controlled executor lane、edit_issue_txn.py)。body_sha256: 89e08f99... → 69b8e52b...(readback確認)。
    6. Final review gate 再実行: 新 body に対する fresh Step 2 で VERDICT: needs-fix/blocker「Unable to automatically classify exit code」を検出。原因は追加した AC2 の新規 VC コマンドが対象ディレクトリを末尾スラッシュ付きで指定していたため、baseline_vc_preflight.py の _normalize_repo_relative_path_strict() が空 segment を検出して new_file_missing_expected 分類条件を満たせず human_judgment/unknown に落ちる、という control-plane 側の分類バグ(VC command 表記の問題)と特定。
    7. Step 4(rewrite・2周目、mechanical fix): issue-editor で該当 VC コマンドの末尾スラッシュ1文字のみを削除。body_sha256: 69b8e52b... → 0549989a...(readback確認)。
    8. Final review gate 再々実行: fresh Step 2 → VERDICT: approve(blocking_issues: 0)。Step 2.5 再実行 → issue-design-reviewer が残存 gap を1件のみ検出(low, requires_owner_choice: false: Required Design References の 実装: agent-retrospective evaluator の identity.value 決定論的算出を分離する deterministic enrichment phase を追加する #2362 記述が Stop Conditions/Delivery Rule の更新と非同期)。join_review_results.py → effective_verdict: approve(low finding は warning として記録、rewrite不要)。

    最終 Verdict

    • refinement status: approved
    • reviewed_body_sha256: sha256:0549989ae2280626ca860fe6b4eb0bec230eee17b40eeaf0da8e5b0f12d671a0
    • anchor feedback が明示した「この7点を直せば GO / implementation_ready に切り替えてよい」の7点(+派生2点)はすべて本文へ反映済み。

    実装 readiness(refinement verdict とは別軸で判定)

    anchor feedback 基準では implementation_ready 相当だが、Issue #2240 自身の Stop Conditions(本文 L186)に「優先度は他6件(Child 1〜6)より低く、それらの安定運用開始前に着手が求められた場合は停止し、着手順序を人間に確認する」という standing 条件が今回の refinement 後も残存している。この条件は今回の anchor feedback の対象外(feedback は設計内容のみを指摘、優先順位には触れていない)であり、issue-refinement-loop の範囲では変更していない。

    root_entry_router.py(run_root_transition())は body/base SHA の freshness 一致のみで route: invoke_impl_review_loop / invoked: true を機械的に返したが、この判定は Stop Condition の意味内容(Child 1〜6 の安定運用状況・着手順序の人間確認要否)を評価していない。今回のユーザー指示は issue-refinement-loop の実行に限定されていたため、この Stop Condition を理由に impl-review-loop への自動 handoff は行わなかった。

    Child 1〜6(#2237等)の安定運用状況・着手順序については、実装着手前に人間の確認を推奨する。

    #2192 parent consistency

    #2192 は closure_mode: child-complete だが #2240 は一貫して「optional / 低優先度」。この整合性問題は anchor comment 自身も指摘しているが、#2240 refinement の権限では #2192 本文を変更していない(parent mutation が必要なら別途 scope-rollup 判断が必要)。

    repository code への変更

    なし(Issue 本文のみ2回 mutation。plugins/agent-retrospective/ 配下の実装コードには着手していない)。

  16. squne121 commented on Aug 29, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了 (2026-08-29T23:01:07Z)

    • PR: feat: agent-retrospective を optional plugin distribution として配布可能にする #2411
    • Worktree: .claude/worktrees/issue-2240-agent-retrospective-plugin
    • Branch: worktree-issue-2240-agent-retrospective-plugin
    • Verification: pnpm typecheck/lint/test/build 4/4 PASS、agent-retrospective model_routing pytest 24/24 PASS
    • Runtime Verification (immediate, AC4/AC5): 実 claude CLI 2.1.251 で claude plugin validate --strict exit 0、clean_install_smoke.sh(.claude/ なし・portability-smoke ブランチの一時 repository)で PublishRequest(publish_request/v1)到達を確認。詳細ログは PR 本文の Runtime Verification Evidence 参照
    • 後続: PR レビュー(pr-review-judge)→ マージ → post-merge-cleanup
  17. squne121 commented on Aug 29, 2026

    @squne121
    OwnerAuthor

    impl-review-loop: 完了 (2026-08-30T00:00:00Z)

    IMPL_REVIEW_LOOP_RESULT_V1:
      schema_version: 1
      status: draft_pr_ready
      pr_url: "https://github.com/squne121/loop-protocol/pull/2411"
      head_sha: "5ee2fd750bab674fc8091e6e84fc6253ae497a50"
      issue_number: 2240
      termination_reason: approved
      merge_ready: true
      iteration: 2
  18. self-assigned this
    on Aug 29, 2026
  19. squne121 commented on Aug 30, 2026

    @squne121
    OwnerAuthor

    impl-review-loop: 完了 (2026-08-30T01:50:00Z)

    IMPL_REVIEW_LOOP_RESULT_V1:
      schema_version: 1
      status: draft_pr_ready
      pr_url: "https://github.com/squne121/loop-protocol/pull/2411"
      head_sha: "60926cc926dac80ef72d279005d7daf7eafe5425"
      issue_number: 2240
      termination_reason: approved
      merge_ready: true
      iteration: 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent/implementerenhancementphase/implementation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions