Repository navigation
Closed
Labels
agent/implementerAI implementer agentdocumentationImprovements or additions to documentationphase/implementationImplementation phase
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "agent-retrospective plugin の README / SKILL.md に、run identity provenance(base_sha / source_set_digest)と codebase-investigator が実際に読む live working tree との境界を正確に明示する"
change_kind: docsParent Issue
none
Parent Goal Ref
- Goal: なし(単独改善。実装: agent-retrospective を optional plugin distribution として配布可能にする #2240 / PR feat: agent-retrospective を optional plugin distribution として配布可能にする #2411 の post-merge-cleanup で human reviewer が P2-1 non-blocking として指摘した follow-up)
- Desired Destination: なし(単独 documentation follow-up のため parent tracker なし)
Current Validated Scope
plugins/agent-retrospective/README.mdとplugins/agent-retrospective/skills/run/SKILL.mdの記述更新のみ(docs-only、コード変更なし)
Remaining Parent Gaps
なし
Outcome
plugins/agent-retrospective/README.md と plugins/agent-retrospective/skills/run/SKILL.md の両方に、## Run Identity Provenance Boundary という見出しの専用セクションが追加され、コミットされた状態。各セクションには少なくとも次の4点が説明として成立していること。
base_sha(40桁 commit SHA)はcollect_snapshot.pyがgit ls-tree -r -z --full-tree <base_sha>で読む immutable な commit-tree snapshot の anchor である。codebase-investigatorobserver(Read/Grep/Glob)は実行時の live${CLAUDE_PROJECT_DIR}working tree を参照するため、staged / unstaged / untracked な変更を反映しうる。したがってbase_shaは run の repository anchor ではあるが、その run のすべての code finding がbase_shaの内容だけから得られたことを証明する provenance attestation ではない。source_set_digestは commit-tree や working tree の content digest ではなく、collector が生成したsource_observationsに対する deterministic sha256 digest である(validate_retrospective_schema.py準拠)。source_set_digestの主用途は(repo, base_sha, source_set_digest, scope)による idempotency / 重複抑制(ADR 0007 Decision 5)であり、optimistic-concurrency token でもない。
Runtime Verification Applicability
- decision: not_applicable
- reason: 静的な docs 記述追加のみで完結するため
In Scope
plugins/agent-retrospective/README.mdとplugins/agent-retrospective/skills/run/SKILL.mdの両方に## Run Identity Provenance Boundaryセクションを追加し、上記 Outcome の4点を明示する- 既存の
base_sha resolution(README)や wire contract 記述(SKILL.md)と矛盾しないよう、必要なら新セクションから既存箇所への相互参照(見出しへのリンクや一言参照)を追加する
Out of Scope
- コード変更全般(
collect_snapshot.py/run_retrospective.py/validate_retrospective_schema.py等への変更は行わない。読解のみ許可) - machine-readable provenance の厳密化(tool trace から実読込ファイル hash を構築する、observer の読み取り集合を
base_shaに一致させる等) - observer behavior の変更(Read/Grep/Glob の対象や挙動を変えない)
- dirty tree rejection の追加(hobby-project の使い勝手を損なうため明示的に非採用)
- working-tree 全内容の hash 計算・run identity output への
workspace_dirtyフラグやchanged-paths digest の追加(本 Issue のスコープではこれらの実装は行わない。過去の選択肢(a)は削除済み) - 永続化 / state-tracking の新機能追加
- dedicated sandbox・permission hook・追加の live E2E test infrastructure の導入
collectorのbase_sha解決ロジック自体の変更(現状の immutable snapshot 契約は維持する)- machine-readable provenance hardening 用の新規 Issue の起票(実需要が発生した場合の future concern として本 Issue の Out of Scope に留め、speculative な派生 Issue は起票しない)
Acceptance Criteria
- AC1:
plugins/agent-retrospective/README.mdに見出し## Run Identity Provenance Boundaryの専用セクションが新規追加され、そのセクション内(次の##見出しより前)にbase_sha・working tree・source_set_digest・content digest(否定文脈での言及)・idempotencyのすべてが出現している - AC2:
plugins/agent-retrospective/skills/run/SKILL.mdに見出し## Run Identity Provenance Boundaryの専用セクションが新規追加され、そのセクション内(次の##見出しより前)にbase_sha・working tree・source_set_digest・content digest(否定文脈での言及)・idempotencyのすべてが出現している
Verification Commands
# AC1
$ rg -U -P "(?s)## Run Identity Provenance Boundary(?=(?:(?!\n## ).)*?base_sha)(?=(?:(?!\n## ).)*?working tree)(?=(?:(?!\n## ).)*?source_set_digest)(?=(?:(?!\n## ).)*?content digest)(?=(?:(?!\n## ).)*?idempotency)" plugins/agent-retrospective/README.md# AC2
$ rg -U -P "(?s)## Run Identity Provenance Boundary(?=(?:(?!\n## ).)*?base_sha)(?=(?:(?!\n## ).)*?working tree)(?=(?:(?!\n## ).)*?source_set_digest)(?=(?:(?!\n## ).)*?content digest)(?=(?:(?!\n## ).)*?idempotency)" plugins/agent-retrospective/skills/run/SKILL.md補足: 上記 rg -U -P(PCRE2 / multiline-dotall)は、新設見出し ## Run Identity Provenance Boundary から次の ## 見出しまでの範囲に5概念すべてが揃っていることを単一コマンドの exit code で検証する。現状の main には該当見出しが存在しないため両方とも fail する(false positive 対策済み。他セクションの既存 idempotency/working tree 等の無関係な出現はこの正規表現のスコープ外)。日本語で「重複抑制」の語を使う場合でも、実装者は必ず英語表記 idempotency を併記すること(VC が英語表記でのみ検証するため)。
Allowed Paths
- plugins/agent-retrospective/README.md
- plugins/agent-retrospective/skills/run/SKILL.md
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- dirty tree を reject する挙動・run identity output へのフラグ/digest 追加・永続化機能の追加が必要と判断された場合(Out of Scope のため即座に停止し follow-up 化する)
- machine-readable provenance hardening(observer 読み取り集合と base_sha の一致等)が必要と判断された場合(Out of Scope のため即座に停止し follow-up 化する)
Required Skills
なし
Required Design References
- docs/adr/0007-agent-retrospective-boundaries.md(base_sha immutable snapshot、
(repo, base_sha, source_set_digest, scope)idempotency key の設計根拠) - plugins/agent-retrospective/agents/codebase-investigator.md(observer が live
${CLAUDE_PROJECT_DIR}working tree を Read/Grep/Glob で参照する契約) - plugins/agent-retrospective/skills/run/scripts/collect_snapshot.py(
base_shaを anchor としたgit ls-treeによるcollector実装。読解のみ、コード変更は行わない) - plugins/agent-retrospective/skills/run/scripts/validate_retrospective_schema.py(
source_set_digestの deterministic sha256 digest 定義。読解のみ、コード変更は行わない) - plugins/agent-retrospective/skills/run/references/wire-contract.md(既存の base_sha / source_set_digest フィールド契約記述)
- plugins/agent-retrospective/skills/run/scripts/run_retrospective.py(collector→observation→
source_set_digest算出の呼び出し順序。読解のみ) - docs/dev/agent-skill-boundaries.md(オーケストレーター境界の一般設計原則)
Scope Delta(任意)
N/A
Notes for Reviewer
- 起票背景: PR feat: agent-retrospective を optional plugin distribution として配布可能にする #2411(Closes 実装: agent-retrospective を optional plugin distribution として配布可能にする #2240, "agent-retrospective を optional plugin distribution として配布可能にする")の post-merge-cleanup 中に発見。human reviewer が「P2-1, non-blocking」として指摘し、hobby-project の使い勝手を損なうため dirty tree reject は意図的に非採用、低優先度の follow-up として本 Issue に切り出した。
- 2026-09-03 時点で本 Issue は anchor comment(issuecomment-5531418832, OWNER)の指摘に基づき reframe された: (1)
source_set_digestを commit-tree content digest と誤認する記述を排除しsource_observationsに対する idempotency 用 digest として正確化、(2) run identity output へのworkspace_dirty/ changed-paths digest 追加案(旧選択肢 (a))を削除し完全 docs-only に固定、(3) Allowed Paths を README.md / SKILL.md の2ファイルへ縮小(collect_snapshot.pyは design reference のみ)、(4) AC/VC を## Run Identity Provenance Boundaryという dedicated section anchor に紐付け、既存の無関係な occurrence による false positive を回避、(5) machine-readable provenance hardening を明示的に Out of Scope とし、speculative follow-up Issue の起票も見送り。 - sibling 実装: agent-retrospective plugin の README/SKILL.md 説明を現状実装スコープに合わせて狭める #2420 の実装 PR docs: agent-retrospective plugin の README/SKILL.md を実装スコープに合わせて狭める #2487(2026-09-03 merge済み)は plugin distribution packaging(README/SKILL.md の配布関連記述の narrowing)のみを扱い、本 Issue のスコープ(base_sha / source_set_digest / working tree provenance の説明)には触れていない。したがって本 Issue は PR docs: agent-retrospective plugin の README/SKILL.md を実装スコープに合わせて狭める #2487 merge 後の current main を baseline として進める。
- dedupe_key:
follow-up:squne121/loop-protocol:pr/2411:workspace_dirty_documentation - 実装者は README.md と SKILL.md の両方に
## Run Identity Provenance Boundaryセクションを追加する。文言は自由だが、AC1-4 の Verification Commands をそのまま満たすこと。
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentdocumentationImprovements or additions to documentationphase/implementationImplementation phase
Activity
squne121 commentedon Aug 30, 2026
create-issue transaction partial-failure
Issue: #2418
Failure stage: label-apply
Message: label-apply failed
Requested:
Completed steps: create
Failure context: command=gh issue edit --repo squne121/loop-protocol 2418 --add-label documentation,phase/implementation,agent/implementer,priority/low
output=failed to update #2418: 'priority/low' not found
failed to update 1 issue
matching_issue_numbers=[2418]
issue_number=2418
Recovery hint: stage 'label-apply' encountered an unexpected failure.
Generic guidance: verify the issue state manually and re-run the transaction if safe.
gh issue view 2418 --repo squne121/loop-protocol --json number,title,labels,state
idempotent re-run: depends on the specific failure
Please recover deterministically before re-running the create issue transaction.
squne121 commentedon Sep 3, 2026
判定
REQUEST_CHANGES— reframe in place を推奨します。#2418 の問題意識そのものは正しいです。実際、repository collector は
base_shaを固定してgit ls-tree -r -z --full-tree <base_sha>を読む一方、plugin のcodebase-investigatorは${CLAUDE_PROJECT_DIR}をRead/Grep/Globで直接調査します。つまり、未commit変更を含む live working tree と commit snapshot は実際に乖離し得ます。 Git 自身の仕様でも、git ls-treeは tree object の内容を列挙するのに対し、working tree は HEAD の tree にローカル変更を加えた実ファイル群です。(Git)ただし、現行Issueには事実誤認と契約矛盾があり、このまま実装すると「誤解を直すためのIssueで別の誤解を文書化する」可能性があります。
Blocker / adversarial findings
P0 —
source_set_digestの説明が事実と違います。実装: agent-retrospective plugin の base_sha と live working tree の乖離を明示する #2418 は
base_shaとsource_set_digestをまとめて「git ls-tree <base_sha>によるコミット済みツリーのスナップショット」と説明しています。 しかし実装上、source_set_digestはsource_observationsをソート・JSON化して SHA-256 した値で、コードにも idempotency use only と明記されています。 正本schemaも「source_observationsの digest」「duplicate suppression 用」と定義しています。git ls-treeから作られる mode/type/blob SHA/path の inventory は別途private_evidence.evidence_digestに入っています。したがって Outcome / In Scope から「
source_set_digestがcommit treeを表す」という記述を削除するのが必須です。P0 — 選択肢 (a) はIssue自身の契約と衝突しています。
change_kind: docs、Current Validated Scope はREADME/SKILLの記述更新なのに、(a) はworkspace_dirtyと changed-paths digest を run identity output に追加するとしています。しかも Allowed Paths にrun_retrospective.pyがありません。 現在のPublishRequest.run_identityはまさにrun_retrospective.pyで組み立てられています。さらに Stop Conditions は固定契約のキー集合・schema・型変更が必要なら停止するとしています。つまり「outputにキーを増やしてよい」と「キー集合変更なら停止」が同居しています。(a) は削除し、実装: agent-retrospective plugin の base_sha と live working tree の乖離を明示する #2418 を本当に docs-only に固定するのが最も整合的です。
P1 — 根本には docs より深い machine-readable provenance の不整合があります。
ADR 0007 は
code_contentの authoritative source を repository (base_sha時点) と明記しています。 一方、plugincodebase-investigatorは live project directory を直接読み、finding の既定claim_classはcode_contentです。さらに現在の deterministic enrichment は repository observer の evidence を
repository_blobとして扱います。 つまり dirty tree 上で見つけた内容でも、candidate 側ではsource_run_ref.base_shaと repository evidence が付く構造です。これは 実装: agent-retrospective plugin の base_sha と live working tree の乖離を明示する #2418 だけで直すには大きすぎます。今回のIssueでは修正せず、「docsでこの制約を明示するが、machine-readable provenance自体をbase_sha snapshotへ一致させるものではない」と Out of Scope に明記する程度が妥当です。自動consumerでこのplugin出力を強く信用する段階になったら別Issueにすべきです。
P1 —
workspace_dirty + changed-paths digestは費用の割に証明力が弱いです。pathだけのdigestでは、同じファイルを別内容に変更しても同じidentityになり得ます。また Git status は staged / unstaged / untracked を扱えますが、ignored files は
--ignoredなしでは出ません。(Git)codebase-investigatorは project root のファイルを Read/Grep/Glob で調査する設計なので、Git status と「agent が実際に読める集合」も完全には一致しません。Claude Code plugin の${CLAUDE_PROJECT_DIR}はproject rootを指し、subagentもmain conversationのworking directoryから開始します。(Claude)さらに observer 実行中にファイルが変わる TOCTOU も残ります。正確にやるなら「実際に読んだファイル内容のhash」をtool traceから作る必要がありますが、趣味開発には明らかに重いです。この用途ならメタデータを増やさず、docs warningだけが費用対効果最大です。
P1 — Acceptance Criteria / Verification Commands が現状のmainでもかなり通ってしまいます。
AC1 の
rg -n "base_sha"はSKILLに既に多数のbase_sha記述があるので新規説明を検証していません。 AC2 のrg -c "working tree"も現在のpluginにすでに「current working tree」という表現があります。つまり極端には ほぼ何も変更せず verification が成功し得ます。新しく追加すべき意味そのものをassertする必要があります。
P2 — Required Design Reference がずれています。
実装: agent-retrospective plugin の base_sha と live working tree の乖離を明示する #2418 は
docs/dev/agent-skill-boundaries.mdだけをRequired Design Referenceにしていますが、これは主にAgent/Skillの責務・permission境界の資料です。 今回の核心である run boundary / source authority の正本はむしろ ADR 0007 です。少なくとも以下を参照対象にすべきです:docs/adr/0007-agent-retrospective-boundaries.md、plugincodebase-investigator.md、collect_snapshot.py、wire-contract.md。P2 — sibling 実装: agent-retrospective plugin の README/SKILL.md 説明を現状実装スコープに合わせて狭める #2420 / PR docs: agent-retrospective plugin の README/SKILL.md を実装スコープに合わせて狭める #2487 merge 後をbaselineに再定義した方がよいです。
実装: agent-retrospective plugin の README/SKILL.md 説明を現状実装スコープに合わせて狭める #2420 は同じREADME/SKILLについて one-shot、fixture-only、observer topology、repository-id 制約を正確化し、そのPR #2487はすでにmerge済みです。PR本文でも 実装: agent-retrospective plugin の base_sha と live working tree の乖離を明示する #2418 は同一ファイルの別anchorとして意図的に触れていないと明記されています。
実装: agent-retrospective plugin の base_sha と live working tree の乖離を明示する #2418 も「少なくとも一方」ではなく、READMEとSKILLの両方を同じ説明に揃える方が今の構成には適しています。
推奨する #2418 の再定義
コード変更はしない方がよいです。
項目 | 明示すべき正確な意味 -- | -- base_sha | repository collector が読む immutable commit-tree のanchor source_set_digest | source_observations のidempotency用digest。commit tree / working treeのcontent digestではない code findings | codebase-investigator が実行時の live ${CLAUDE_PROJECT_DIR} を直接読むため、staged / unstaged / untracked 等を反映し得る 解釈 | base_sha はrunのrepository anchorであり、すべてのcode findingがそのcommit内容から得られたことを証明するものではないcollect_snapshot.pyも Allowed Paths から外して構いません。Outcome は概ね次の4点だけに固定するのを推奨します。Acceptance Criteria も「単語があるか」ではなく、たとえば両ファイルについて
base_sha+live working tree+source_set_digest+content digestではない相当の4概念が同じ説明節にあることを確認する方がよいです。セキュリティ/harnessについて
このIssueには dirty tree rejection、専用sandbox、permission hook、追加live E2E、working-tree全内容hash、observer動作変更は不要です。現在のClaude Code plugin自体は
${CLAUDE_PLUGIN_ROOT}/${CLAUDE_PROJECT_DIR}の使い分けやplugin root layoutについて現行公式仕様と整合しています。(Claude)趣味開発という前提なら、dirty treeで retrospective を走らせられること自体はむしろ有用です。問題は dirty であることではなく、commit snapshotとlive worktreeを同じprovenanceだと誤認させることです。今回はそこを正確な文章で切り分けるだけで十分です。
結論として、#2418 は捨てる必要はありません。
## 判定source_set_digestの誤認を修正し、(a) のoutput変更を削除して完全docs-onlyへ縮めれば、低コストで価値のあるfollow-upになります。 machine-readable provenanceの厳密化は、実際にplugin出力を自動判断へ使う需要が出てから別Issueで扱うのが適切です。REQUEST_CHANGES— reframe in place を推奨します。#2418 の問題意識そのものは正しいです。実際、repository collector は
base_shaを固定してgit ls-tree -r -z --full-tree <base_sha>を読む一方、plugin のcodebase-investigatorは${CLAUDE_PROJECT_DIR}をRead/Grep/Globで直接調査します。つまり、未commit変更を含む live working tree と commit snapshot は実際に乖離し得ます。 Git 自身の仕様でも、git ls-treeは tree object の内容を列挙するのに対し、working tree は HEAD の tree にローカル変更を加えた実ファイル群です。([Git]1)ただし、現行Issueには事実誤認と契約矛盾があり、このまま実装すると「誤解を直すためのIssueで別の誤解を文書化する」可能性があります。
Blocker / adversarial findings
P0 —
source_set_digestの説明が事実と違います。実装: agent-retrospective plugin の base_sha と live working tree の乖離を明示する #2418 は
base_shaとsource_set_digestをまとめて「git ls-tree <base_sha>によるコミット済みツリーのスナップショット」と説明しています。 しかし実装上、source_set_digestはsource_observationsをソート・JSON化して SHA-256 した値で、コードにも idempotency use only と明記されています。 正本schemaも「source_observationsの digest」「duplicate suppression 用」と定義しています。git ls-treeから作られる mode/type/blob SHA/path の inventory は別途private_evidence.evidence_digestに入っています。したがって Outcome / In Scope から「
source_set_digestがcommit treeを表す」という記述を削除するのが必須です。P0 — 選択肢 (a) はIssue自身の契約と衝突しています。
change_kind: docs、Current Validated Scope はREADME/SKILLの記述更新なのに、(a) はworkspace_dirtyと changed-paths digest を run identity output に追加するとしています。しかも Allowed Paths にrun_retrospective.pyがありません。 現在のPublishRequest.run_identityはまさにrun_retrospective.pyで組み立てられています。さらに Stop Conditions は固定契約のキー集合・schema・型変更が必要なら停止するとしています。つまり「outputにキーを増やしてよい」と「キー集合変更なら停止」が同居しています。(a) は削除し、実装: agent-retrospective plugin の base_sha と live working tree の乖離を明示する #2418 を本当に docs-only に固定するのが最も整合的です。
P1 — 根本には docs より深い machine-readable provenance の不整合があります。
ADR 0007 は
code_contentの authoritative source を repository (base_sha時点) と明記しています。 一方、plugincodebase-investigatorは live project directory を直接読み、finding の既定claim_classはcode_contentです。さらに現在の deterministic enrichment は repository observer の evidence を
repository_blobとして扱います。 つまり dirty tree 上で見つけた内容でも、candidate 側ではsource_run_ref.base_shaと repository evidence が付く構造です。これは 実装: agent-retrospective plugin の base_sha と live working tree の乖離を明示する #2418 だけで直すには大きすぎます。今回のIssueでは修正せず、「docsでこの制約を明示するが、machine-readable provenance自体をbase_sha snapshotへ一致させるものではない」と Out of Scope に明記する程度が妥当です。自動consumerでこのplugin出力を強く信用する段階になったら別Issueにすべきです。
P1 —
workspace_dirty + changed-paths digestは費用の割に証明力が弱いです。pathだけのdigestでは、同じファイルを別内容に変更しても同じidentityになり得ます。また Git status は staged / unstaged / untracked を扱えますが、ignored files は
--ignoredなしでは出ません。(Git)codebase-investigatorは project root のファイルを Read/Grep/Glob で調査する設計なので、Git status と「agent が実際に読める集合」も完全には一致しません。Claude Code plugin の${CLAUDE_PROJECT_DIR}はproject rootを指し、subagentもmain conversationのworking directoryから開始します。([Claude]3)さらに observer 実行中にファイルが変わる TOCTOU も残ります。正確にやるなら「実際に読んだファイル内容のhash」をtool traceから作る必要がありますが、趣味開発には明らかに重いです。この用途ならメタデータを増やさず、docs warningだけが費用対効果最大です。
P1 — Acceptance Criteria / Verification Commands が現状のmainでもかなり通ってしまいます。
AC1 の
rg -n "base_sha"はSKILLに既に多数のbase_sha記述があるので新規説明を検証していません。 AC2 のrg -c "working tree"も現在のpluginにすでに「current working tree」という表現があります。つまり極端には ほぼ何も変更せず verification が成功し得ます。新しく追加すべき意味そのものをassertする必要があります。
P2 — Required Design Reference がずれています。
実装: agent-retrospective plugin の base_sha と live working tree の乖離を明示する #2418 は
docs/dev/agent-skill-boundaries.mdだけをRequired Design Referenceにしていますが、これは主にAgent/Skillの責務・permission境界の資料です。 今回の核心である run boundary / source authority の正本はむしろ ADR 0007 です。少なくとも以下を参照対象にすべきです:docs/adr/0007-agent-retrospective-boundaries.md、plugincodebase-investigator.md、collect_snapshot.py、wire-contract.md。P2 — sibling 実装: agent-retrospective plugin の README/SKILL.md 説明を現状実装スコープに合わせて狭める #2420 / PR docs: agent-retrospective plugin の README/SKILL.md を実装スコープに合わせて狭める #2487 merge 後をbaselineに再定義した方がよいです。
実装: agent-retrospective plugin の README/SKILL.md 説明を現状実装スコープに合わせて狭める #2420 は同じREADME/SKILLについて one-shot、fixture-only、observer topology、repository-id 制約を正確化し、そのPR #2487はすでにmerge済みです。PR本文でも 実装: agent-retrospective plugin の base_sha と live working tree の乖離を明示する #2418 は同一ファイルの別anchorとして意図的に触れていないと明記されています。
実装: agent-retrospective plugin の base_sha と live working tree の乖離を明示する #2418 も「少なくとも一方」ではなく、READMEとSKILLの両方を同じ説明に揃える方が今の構成には適しています。
推奨する #2418 の再定義
コード変更はしない方がよいです。
collect_snapshot.pyも Allowed Paths から外して構いません。Outcome は概ね次の4点だけに固定するのを推奨します。base_shasource_set_digestsource_observationsのidempotency用digest。commit tree / working treeのcontent digestではないcodebase-investigatorが実行時の live${CLAUDE_PROJECT_DIR}を直接読むため、staged / unstaged / untracked 等を反映し得るbase_shaはrunのrepository anchorであり、すべてのcode findingがそのcommit内容から得られたことを証明するものではないAcceptance Criteria も「単語があるか」ではなく、たとえば両ファイルについて
base_sha+live working tree+source_set_digest+content digestではない相当の4概念が同じ説明節にあることを確認する方がよいです。セキュリティ/harnessについて
このIssueには dirty tree rejection、専用sandbox、permission hook、追加live E2E、working-tree全内容hash、observer動作変更は不要です。現在のClaude Code plugin自体は
${CLAUDE_PLUGIN_ROOT}/${CLAUDE_PROJECT_DIR}の使い分けやplugin root layoutについて現行公式仕様と整合しています。(Claude)趣味開発という前提なら、dirty treeで retrospective を走らせられること自体はむしろ有用です。問題は dirty であることではなく、commit snapshotとlive worktreeを同じprovenanceだと誤認させることです。今回はそこを正確な文章で切り分けるだけで十分です。
結論として、#2418 は捨てる必要はありません。
source_set_digestの誤認を修正し、(a) のoutput変更を削除して完全docs-onlyへ縮めれば、低コストで価値のあるfollow-upになります。 machine-readable provenanceの厳密化は、実際にplugin出力を自動判断へ使う需要が出てから別Issueで扱うのが適切です。squne121 commentedon Sep 3, 2026
推奨は #2418 を anchor comment の指摘どおり reframe in place し、完全な docs-only Issue に縮めたうえで
issue-refinement-loopを最後まで自動実行です。現行 #2418 は
change_kind: docsなのにworkspace_dirty/ changed-paths digest の出力追加を許しており、Stop Conditions と自己矛盾しています。さらにsource_set_digestを commit-tree snapshot のように扱う説明も実装と不一致です。anchor comment は、この2点を P0 として修正し、README/SKILL の両方に正確な provenance 説明を揃える方針を推奨しています。また sibling #2420 の実装 PR #2487 は既に merge 済みなので、その変更後の main を baseline とするのが適切です。PR #2487 は意図的に #2418 のスコープへ触れていません。
issue-refinement-loopについては、現在のリポジトリ契約そのものが iteration 間の承認を不要としており、needs-fixは上限未満なら自動継続します。したがって--dangerously-skip-permissions等を混ぜる必要はありません。 Claude Code の Auto mode も、permission prompt を減らして長時間タスクを継続するモードで、subagent は親が Auto mode なら同じ Auto mode を継承します。([Claude]1)以下をそのまま Auto mode の対話的 Claude Code セッションへ渡すのを推奨します。
Repository:
squne121/loop-protocol対象:
#2418
human-origin anchor comment:
#2418 (comment)
.claude/skills/issue-refinement-loopを使って Issue #2418 を refinement してください。このセッションは Claude Code の Auto mode で実行されている前提です。
permission mode を変更したり、
bypassPermissions/--dangerously-skip-permissions等へ切り替えたりしないでください。このプロンプトは、Issue #2418 の refinement に必要な Issue 本文更新および canonical
issue-refinement-loopが要求する GitHub mutation を、人間への都度承認なしで実行する明示的な authorization です。実行方針
issue_number = 2418anchor_comment_url = https://github.com/squne121/loop-protocol/issues/2418#issuecomment-5531418832max_iterations = 3issue-refinement-loop契約に従いpreflight.run.with_human_contextlane を使用すること。issue-refinement-loopの planner / reviewer / deterministic scripts を SSOT とし、main thread で独自の判定ロジックを再実装しないこと。needs-fixならmax_iterationsの範囲内で自動的に rewrite → review を継続すること。human_judgment_required/ fail-closed condition だけを terminal blocker とすること。SubAgent の使用 — 必須
調査フェーズでは必ず SubAgent を使用してください。
少なくとも current
issue-refinement-loopが指定するcodebase-investigatorを実行し、planner が Web research を要求する場合はweb-researcherも実行してください。独立な調査は可能なら並列に dispatch して構いません。
ただし重要:
dispatch した SubAgent を放置したまま次の review / rewrite phase へ進んではいけません。
各 wave について:
「SubAgent を起動したので main thread 側だけで続行する」は禁止です。
SubAgent は leaf として扱い、SubAgent 自身からさらに nested SubAgent delegation は行わせないでください。
なお current canonical Step 2 が legacy
issue-reviewerSubAgent を使用しない設計なら、古い方式を復活させず current skill の root-owned review pipeline に従ってください。最初に確認する baseline
必ず current
mainを基準にしてください。特に以下を確認してください。
Issue 実装: agent-retrospective plugin の base_sha と live working tree の乖離を明示する #2418 の現本文
anchor comment #5531418832
sibling Issue 実装: agent-retrospective plugin の README/SKILL.md 説明を現状実装スコープに合わせて狭める #2420
merged PR docs: agent-retrospective plugin の README/SKILL.md を実装スコープに合わせて狭める #2487
PR docs: agent-retrospective plugin の README/SKILL.md を実装スコープに合わせて狭める #2487 merge 後の
plugins/agent-retrospective/README.mdplugins/agent-retrospective/skills/run/SKILL.mddocs/adr/0007-agent-retrospective-boundaries.mdplugins/agent-retrospective/agents/codebase-investigator.mdplugins/agent-retrospective/skills/run/scripts/collect_snapshot.pyplugins/agent-retrospective/skills/run/scripts/run_retrospective.pyplugins/agent-retrospective/skills/run/references/wire-contract.mdsource_set_digestの canonical schema / producerPR #2487 は既に merge 済みなので、#2418 を PR #2487 より前の README/SKILL に対して refinement しないでください。
anchor comment から最低限反映すべき内容
anchor comment を単に要約するのではなく、current main で fact-check したうえで Issue contract を reframe in place してください。
最低限、次を解消してください。
1.
source_set_digestの誤認を修正source_set_digestをgit ls-tree <base_sha>による commit-tree content snapshot / content digest と説明しないこと。current implementation / schema に従い、
source_set_digestはsource_observationsに対する deterministic digestという意味へ修正してください。
git ls-treeから得る repository inventory / evidence と混同しないこと。2. Issue を完全 docs-only に固定
現在の選択肢
(a):workspace_dirtyは削除してください。
この Issue ではコード変更をしません。
change_kind: docsと Current Validated Scope、Outcome、In Scope、Allowed Paths、Stop Conditions が互いに矛盾しない状態にしてください。推奨 Allowed Paths は次の2ファイルだけです。
plugins/agent-retrospective/README.mdplugins/agent-retrospective/skills/run/SKILL.mdcollect_snapshot.py等のコードは調査・design reference として読んでよいですが、実装 Allowed Paths からは外してください。3.
base_shaと live working tree の関係を正確化Issue の Outcome / AC では最低限以下を区別してください。
base_shasource_set_digestsource_observationsの idempotency 用 digestcodebase-investigatorfindings${CLAUDE_PROJECT_DIR}を Read/Grep/Glob で調査する解釈上の制約
base_shaは run の repository anchor ではあるが、すべての code finding がその commit の内容だけから得られたことを証明する provenance attestation ではないREADME と SKILL の片方だけではなく、PR #2487 後の構成を踏まえて 両方に整合した説明を持たせる方向を優先してください。
4. machine-readable provenance の厳密化は Out of Scope
ADR 0007 と live codebase investigation の間により深い provenance 問題があることは認識してよいですが、この Issue で実装しないでください。
Out of Scope に概ね以下の意味を明示してください。
base_shasnapshot に一致させるものではないmachine-readable provenance hardening 用の新規 Issue を今回 speculative に起票しないでください。
実需要が発生した場合の future concern として Out of Scope に留めてください。
5. Acceptance Criteria / Verification を強化
現行の
rg -n "base_sha"rg -c "working tree"だけでは current main の既存記述にヒットして、実質的に何も変更しなくても PASS する可能性があります。
Verification は「単語がどこかに存在する」だけでなく、追加すべき意味を検証できる形にしてください。
両ファイルについて少なくとも次の4概念が説明として成立していることを AC にしてください。
base_shasource_set_digestsource_set_digestが content digest ではないこと可能なら dedicated section / stable textual anchor を設け、それを Verification Commands から検査することで既存の無関係な occurrence による false positive を避けてください。
docs-only なので verification のためだけの runtime harness や E2E test infrastructure は追加しないでください。
6. Required Design References を修正
少なくとも以下を reference としてください。
docs/adr/0007-agent-retrospective-boundaries.mdplugins/agent-retrospective/agents/codebase-investigator.mdplugins/agent-retrospective/skills/run/scripts/collect_snapshot.pyplugins/agent-retrospective/skills/run/references/wire-contract.md必要なら
run_retrospective.pyと canonical schema も fact source として追加してください。docs/dev/agent-skill-boundaries.mdだけを核心の design reference としないでください。スコープ制約
今回やることは Issue refinement のみです。
impl-review-loopを開始しない最終状態は、Issue #2418 が reviewer
approve/ contract readinessgoを満たし、implementation_ready相当の refinement 完了状態になるところまでです。自律実行ルール
途中経過を人間に質問して止まらないでください。
次のような選択は既に anchor comment で決まっています。
(a)の metadata/output 変更案は削除これらを再度質問しないでください。
事実確認に不足があれば repository / GitHub / official documentation を自分で調査してください。
Web research が必要な場合は、Git の仕様については git-scm.com、Claude Code の仕様については Anthropic / Claude Code 公式 documentation を優先してください。
完了条件
以下がすべて成立するまで作業を継続してください。
source_set_digestの誤説明を除去した。needs-fixなら承認確認なしで次 iteration に進んだ。完了時だけ、簡潔に以下を報告してください。
作業途中で人間の承認待ちにしないでください。
特に重要なのは、「承認不要」と「fail-closed を無視する」を混同しないことです。Auto mode と loop の自動継続に任せ、実際の
human_judgment_requiredだけを例外にする構成が、現行リポジトリ契約にも最も沿っています。Auto mode はチャット内の指示で切り替えるものではなく、Claude Code 側の permission mode なので、このプロンプトは Auto が既に有効なセッションへ投入する前提です。(Claude)squne121 commentedon Sep 3, 2026
issue-refinement-loop 完了報告
approvedapproveを確定。needs-fix サイクルなし)source_set_digestの誤説明(commit-tree content digest)を除去し、source_observationsに対する idempotency 用 deterministic digest として正確化workspace_dirty/ changed-paths digest 追加案(旧選択肢 (a))を削除し、完全 docs-only へ固定plugins/agent-retrospective/README.md/plugins/agent-retrospective/skills/run/SKILL.mdの2ファイルへ縮小(collect_snapshot.pyは design reference のみ)base_sha(immutable commit-tree anchor)とcodebase-investigatorが参照する live working tree の境界を Outcome/AC で明示化## Run Identity Provenance Boundaryという dedicated section anchor に紐付け、既存の無関係なidempotency/working tree等の occurrence による false positive を回避codebase-investigator.md/collect_snapshot.py/validate_retrospective_schema.py/wire-contract.md/run_retrospective.pyを追加0b0d8f8c190d5e7839a4ba95913f137cb35c46c8)を基準に fact-check・reframe しました。sibling 実装: agent-retrospective plugin の README/SKILL.md 説明を現状実装スコープに合わせて狭める #2420 の実装 PR docs: agent-retrospective plugin の README/SKILL.md を実装スコープに合わせて狭める #2487 は本 Issue のスコープ(base_sha/source_set_digest/working tree provenance の説明)には触れていないことを確認済みです。codebase-investigator(collect_snapshot.py/validate_retrospective_schema.py/codebase-investigator.md/ README・SKILL.md 現状 / ADR 0007 / PR docs: agent-retrospective plugin の README/SKILL.md を実装スコープに合わせて狭める #2487・実装: agent-retrospective plugin の README/SKILL.md 説明を現状実装スコープに合わせて狭める #2420 の fact-check)1件、完了状態で結果回収済み。Web research は本イテレーションでは repository-internal な事実確認のみで完結したため未実行(web_research_policy上の必須シグナルなし)。CONTRACT_REVIEW_RESULT_V1相当(run_contract_review_once.py --mode execute --evidence-mode current-head)でstatus: go(gate_result: fresh_go、body_sha256: sha256:75432f5a1d3ff0a2ceec1d71329e374452570052a26defeaa3e7acccda28c851に対して fresh)を確認。AC1/AC2 ともexpected_baseline_fail(現在の main には該当セクションが存在しないため VC は意図通り fail)。semantic_review_applicable: false(checker_gap/heuristic_concern/owner_decision_conflict/cross_contract_change いずれも無し)のためスキップし、Step 4.5 へ直行。dedupe_key: follow-up:squne121/loop-protocol:pr/2411:workspace_dirty_documentationは本 Issue 自身が保持)。Note: 本セッションは呼び出し元の明示指示("今回やることは Issue refinement のみ。impl-review-loop を開始しない")に従い、上記
routing_action: run_impl_review_loopは契約状態の記録に留め、impl-review-loopの実起動(root_entry_router.py経由の handoff)は行っていません。squne121 commentedon Sep 3, 2026
#2418 はもう refinement をやり直す段階ではありません。
issue-refinement-loopは approved / impl_ready / routing_action: run_impl_review_loop / blockers: [] まで到達済みで、現在のmainもそのときと同じ0b0d8f8c…です。推奨は次の方針です。
.claude/skills/impl-review-loopをそのまま実行する。Issue は README と SKILL.md の2ファイルだけを変更する docs-only 契約です。LOOP_HANDOFF_RESULT_V1は handoff telemetry として参照しつつ、Step 1 の authorization として流用しない。現行impl-review-loopが要求する root-owned synchronous entry transition を current live Issue に対して実行してから Step 1 に入るべきです。implementation-worker → test-runner → pr-reviewerを使います。各 SubAgent は foreground で起動させ、完了結果を回収してから次 Step へ進めるのが最も確実です。Claude Code 公式仕様でも foreground subagent は親を block して完了まで待機します。また親が Auto mode なら subagent も Auto mode を継承します。([Claude]1)draft_pr_readyに到達する設計です。autoにしてから貼り付けます。CLI ならclaude --permission-mode autoが現行の公式手段です。bypassPermissionsは不要です。([Claude]2)そのまま貼れる形です。
Repository:
squne121/loop-protocol対象 Issue:
#2418
.claude/skills/impl-review-loopを使って Issue #2418 を実装してください。このセッションは Claude Code の Auto mode で実行されている前提です。
permission mode を変更しないでください。
bypassPermissions/--dangerously-skip-permissionsへ切り替えないでください。今回の目的は、Issue #2418 を current live contract に従って実装し、検証、PR作成、PRレビュー、review fix、current-head CI、mergeability 確認まで自律的に反復し、人間が最終的に Merge を実行する直前の状態まで到達することです。
通常の実装・修正・検証・PR更新・branch update・再レビューについて、人間への都度承認を求めないでください。
ただし PR の merge 自体は実行しないでください。
gh pr merge、auto-merge の有効化、main への直接 push、force push、branch protection / safety check の迂回は禁止です。Current handoff
直前の issue-refinement-loop 完了報告:
#2418 (comment)
このコメントでは以下まで確認済みです。
ただし、この handoff comment や過去 artifact を Step 1 の authorization token として扱わないでください。
current
.claude/skills/impl-review-loopの Root-Owned Synchronous Entry Transition を正本とし、root/main thread が現在の live Issue と current main を再取得したうえで、までを canonical implementation entry procedure に従って実行してください。
過去の contract snapshot、handoff comment、digest、artifact は advisory evidence であり、それ単独で authorization を代替しません。
Issue contract の固定境界
Issue #2418 の current body を execution contract としてください。
変更可能なのは原則として次の2ファイルだけです。
plugins/agent-retrospective/README.mdplugins/agent-retrospective/skills/run/SKILL.mdコード変更へスコープを広げないでください。
特に以下は Out of Scope のまま維持してください。
collect_snapshot.py等の実装変更workspace_dirtyfield の追加Issue の
Runtime Verification Applicability: not_applicableを尊重し、この docs-only 変更のためだけに新しい runtime harness を作らないでください。実装時に fact-check する正本
少なくとも以下を current main から確認してから文言を確定してください。
plugins/agent-retrospective/README.mdplugins/agent-retrospective/skills/run/SKILL.mddocs/adr/0007-agent-retrospective-boundaries.mdplugins/agent-retrospective/agents/codebase-investigator.mdplugins/agent-retrospective/skills/run/scripts/collect_snapshot.pyplugins/agent-retrospective/skills/run/scripts/validate_retrospective_schema.pyplugins/agent-retrospective/skills/run/scripts/run_retrospective.pyplugins/agent-retrospective/skills/run/references/wire-contract.mdIssue contract の意味を独自解釈で拡張せず、repository implementation / ADR / schema と照合してください。
実装する
## Run Identity Provenance Boundaryでは最低限、以下を正確に区別してください。base_shacollect_snapshot.pyがgit ls-tree -r -z --full-tree <base_sha>で読む immutable commit-tree snapshot の anchorlive working tree
codebase-investigatorは実行時の live${CLAUDE_PROJECT_DIR}を Read/Grep/Glob するsource_set_digestsource_observationsに対する deterministic sha256 digestprovenance interpretation
base_shaは run の repository anchorbase_shaの commit content だけから得られたことを証明する provenance attestation ではないREADME と SKILL.md の 両方 を整合させてください。
SubAgent orchestration — 必須
impl-review-loopの canonical SubAgent topology を使用してください。少なくとも次を root/main thread から dispatch してください。
implementation-workertest-runnerpr-reviewer重要:
各 SubAgent は foreground / blocking execution とし、完了を待ってください。
background に投げて main thread だけ先へ進むことは禁止です。
各 dispatch について必ず、
という順序にしてください。
SubAgent を spawn しただけで次 phase へ進まないでください。
SubAgent 自身から別の SubAgent を spawn する nested delegation は行わせないでください。
必要な SubAgent の chaining は root/main thread が所有してください。
.claude/skills/impl-review-loop/steps/step-1-implementation.md等の current static call shape / Common Completion Protocol を正本とし、独自 orchestration protocol を作らないでください。Loop policy
max_iterationsは canonical default の 3 を使用してください。ただし iteration 内では、人間承認を挟まず自律的に進めてください。
REQUEST_CHANGES
pr-reviewer が
REQUEST_CHANGESを返した場合:fix_deltaとして記録implementation-workerに再委譲まで自動継続してください。
「修正してよいですか?」とは聞かないでください。
stale reviewed head
reviewed_head_sha が current PR head と異なる場合、人間に聞かず current head で Step 4 を再実行してください。
BEHIND
live mergeability が BEHIND の場合、canonical
update_branchaction をimplementation-workerに委譲してください。成功したら verification と PR review を current head で再実行してください。
mergeability UNKNOWN / BLOCKED / UNSTABLE
current skill の bounded retry / CI evaluator routing に従ってください。
単なる一時状態を即 human escalation に変換しないでください。
SubAgent の human_review_required 自己申告
Step 1-4 の SubAgent が単に
human_review_required: trueを返しただけでは停止しないでください。current
impl-review-loopの #1860 / AUTONOMY_POLICY_V1 に従い、正式な hard gate でなければ warning として保持し、自動ループを継続してください。Auto mode denial
Auto mode classifier が操作を deny した場合、それを permission bypass の理由にしないでください。
まず、
で同じ目的を達成できるか検討してください。
classifier や safety check を迂回するコマンドへ変更してはいけません。
一回の deny で直ちに人間へ判断を返さず、安全な canonical alternative がある限り自律的に回復してください。
Verification
Issue #2418 本文の Verification Commands を current working tree に対して実行してください。
特に README / SKILL.md の
## Run Identity Provenance Boundarysection 内だけを対象に、base_shaworking treesource_set_digestcontent digestidempotencyが揃うことを確認してください。
false positive を避けるため、repository 全体の別 section に同語が存在するだけで PASS と判定してはいけません。
docs-only Issue なので、不必要な runtime E2E infrastructure は追加しないでください。
一方、current repository workflow が既存の lint / markdown lint / typecheck / test / build 等を required verification として要求するなら、それは省略せず canonical Step 2 に従って実行してください。
テストを通すために Issue の Allowed Paths 外へ修正を拡大しないでください。
PR
実装完了後、canonical
open-pr/implement-issueworkflow に従って Issue #2418 用の PR を作成してください。PR は Issue #2418 を close する relationship を正しく持たせてください。
PR本文には最低限、
base_sha/ live working tree /source_set_digestの境界を実際の結果に基づいて記載してください。
未実行の check を PASS と書いてはいけません。
PR review loop
PR作成後は終了せず、必ず
pr-reviewerを foreground で実行して完了を待ってください。reviewer の structured verdict を current head SHA に bind してください。
REQUEST_CHANGES があれば自動修正ループへ戻してください。
PR body hygiene のような機械的 blocker も、人間に聞かず canonical worker action で解決可能なら解決してください。
reviewer APPROVE だけを終了条件にしないでください。
current
route_loop_verdict_v2()に従い、まで確認してください。
最終停止条件
成功時は
IMPL_REVIEW_LOOP_RESULT_V1.status: draft_pr_ready/termination_reason: approved相当まで到達してください。ここでいう
draft_pr_readyは impl-review-loop の terminal status であり、GitHub Draft PR を残せという意味ではありません。最終状態は、人間が内容を確認して Merge を実行するだけの状態にしてください。
ただし merge 自体は絶対に実行しないでください。
成功時の最終報告には以下を含めてください。
IMPL_REVIEW_LOOP_RESULT_V1terminal result途中経過の承認を求めず、上記 terminal state か、current repository contract が定義する真正の hard terminal condition に到達するまで
impl-review-loopを継続してください。調査や説明だけで終了せず、実際に実装・検証・PR作成・review/fix loop を実行してください。
この形なら、Auto mode を「承認バイパス」に変えるのではなく、repo 自身の bounded autonomy と Claude Code Auto mode をそのまま活用しつつ、foreground SubAgent 完了待ちを明示する構成になります。特に #2418 は docs-only かつ refinement 済みなので、通常は 1 iteration で
draft_pr_readyまで到達できる可能性が高いです。squne121 commentedon Sep 3, 2026
implement-issue: 実装完了 (2026-09-03T22:21:19Z)
.claude/worktrees/issue-2418-run-identity-provenanceworktree-issue-2418-run-identity-provenancedocs: agent-retrospective plugin に Run Identity Provenance Boundary 節…