Repository navigation
Closed
Labels
agent/implementerAI implementer agentarea/ai-opsAI operations and agent tooling areaenhancementNew feature or requestphase/implementationImplementation phaseprocessProcess / template changes
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "#928"
goal_ref: "agent-run-report / agent-retro-index の docs と handoff 契約を追加し、既存 loop へ統合する"
change_kind: docsParent Issue
Parent Goal Ref
- Goal: issue-refinement-loop / impl-review-loop / PR open / review correction / post-merge cleanup / follow-up issue creation が run report finalize / posting / retro index update を handoff 契約として参照できる状態にする。
- Desired Destination: docs と skill surface が manifest / run report / retro index の責務差分、phase stop condition、post-run verifier の canonical gate を明記する。
Current Validated Scope
docs/dev/agent-run-report.mdとdocs/dev/agent-retro-index.mdを追加または更新する。.claude/skills/**,.codex/**,CLAUDE.md,AGENTS.mdの handoff 記述を更新する。- hook は diagnostic/prevention であり canonical security boundary ではないことを明記する。
Remaining Parent Gaps
- EntireCLI safety は 実装: EntireCLI safety checker と conditional adoption guard を追加する #941 で扱う。
- retrospective から出た helper 正規化 / overlap preflight / worklog summarize は parent 導入: ChatGPT改善検討用のAI作業ログレポートをGitHubに永続保存する #928 とは別 follow-up issue で扱う。
Outcome
agent-run-report / agent-retro-index の運用 docs と handoff 記述が 1 PR で更新され、manifest / report / retro index の責務差分表、phase stop condition、follow-up issue 起票判断、post-run verifier 優先が各入口 docs から辿れる状態。
In Scope
agent_session_manifest,agent_run_report,agent_retro_indexの責務差分表を追加する。- 各 phase の Stop Conditions に
report finalized,public-safe check pass,posting dry-run or upsert doneを追加する。 - review correction / follow-up issue creation の report 反映手順を記述する。
- hook を security boundary と誤読させない記述へ整える。
Out of Scope
- schema / validator 実装。
- GitHub posting 実装。
- EntireCLI safety checker 本体。
Acceptance Criteria
- AC1:
agent_session_manifest,agent_run_report,agent_retro_indexの責務差分が表で説明されている。 - AC2: 各 phase の Stop Conditions に
report finalized,public-safe check pass,posting dry-run or upsert doneが追加されている。 - AC3: review correction loop で CI failure / human correction / reviewer comment を report の
evidence_refsとcommands_summary.summaryに反映する手順がある。 - AC4: follow-up issue creation で
agent_retro_index.entries[].follow_up_issuesに記録するか、起票しない理由を termination report / local handoff に留める手順がある。 - AC5: hook は diagnostic/prevention であり、post-run verifier が canonical gate であると明記されている。
Verification Commands
# AC1
# baseline-expect: fail
$ rg -n "agent_session_manifest" docs/dev/agent-run-report.md CLAUDE.md AGENTS.md
# AC1
# baseline-expect: fail
$ rg -n "agent_retro_index" docs/dev/agent-run-report.md CLAUDE.md AGENTS.md
# AC1
# AC2
# baseline-expect: fail
$ rg -n "report finalized" docs/dev/agent-run-report.md CLAUDE.md AGENTS.md
# AC2
# baseline-expect: fail
$ rg -n "public-safe check pass" docs/dev/agent-run-report.md CLAUDE.md AGENTS.md
# AC2
# baseline-expect: fail
$ rg -n "posting dry-run or upsert done" docs/dev/agent-run-report.md CLAUDE.md AGENTS.md
# AC2
# AC3
# baseline-expect: fail
$ rg -n "review correction" docs/dev/agent-run-report.md
# AC3
# AC4
# baseline-expect: fail
$ rg -n "follow_up_issues" docs/dev/agent-run-report.md
# AC4
# AC5
# baseline-expect: fail
$ rg -n "diagnostic/prevention" docs/dev/agent-run-report.md CLAUDE.md AGENTS.md
# AC5
# baseline-expect: fail
$ rg -n "post-run verifier" docs/dev/agent-run-report.md CLAUDE.md AGENTS.md
# AC5Allowed Paths
docs/dev/agent-run-report.mddocs/dev/agent-retro-index.md.claude/skills/**.codex/**CLAUDE.mdAGENTS.md
Runtime Verification Applicability
decision: not_applicable
reason: "docs / skill / agent surface の更新であり、interactive runtime 実行を成功条件に含まない"Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- docs handoff と helper / hook / subagent 大規模再編を同一 PR に含めないと成立しないことが判明した場合
Required Skills
なし
Scope Delta(任意)
N/A
Delivery Rule
1 Issue = 1 PRで完了する。- Draft PR を既定とする。
- helper / overlap preflight / worklog summarize の retrospective follow-up は本 Issue に押し込まず別 issue で扱う。
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentarea/ai-opsAI operations and agent tooling areaenhancementNew feature or requestphase/implementationImplementation phaseprocessProcess / template changes
Activity
[-]docs: agent-run-report.md / agent-retro-index.md と skill handoff を整備する[/-][+]実装: agent-run-report.md / agent-retro-index.md と skill handoff を整備する[/+]squne121 commentedon Jun 21, 2026
結論
#940 は方向性自体は妥当ですが、このまま実装 PR に入ると false green になりやすいです。最大の問題は、Issue の AC が現行 schema に存在しない field を前提にしている点です。
#940 は docs / skill handoff の Issue で、
docs/dev/agent-run-report.md/docs/dev/agent-retro-index.mdと.claude/skills/**などの更新を対象にし、schema / validator / posting 実装は明確に out of scope です。さらに #940 にはコメントはありません。BLOCKER 1: #940 の AC3 / AC4 が現行 schema と矛盾している
#940 は AC3 で
ci_review_loops[]/human_intervention、AC4 でfollow_up_candidates[]への反映手順を求めています。しかし、現行
agent_run_report/v1schema はadditionalProperties: falseで、top-level property はschema,public_surface_kind,public_safety,actor,authority,token_usage,manifest_refs,evidence_refs,commands_summary,docs_read_refsに限定されています。ci_review_loops,human_intervention,follow_up_candidatesは定義されていません。agent_retro_index/v1側にもfollow_up_candidatesはなく、あるのは確定済みのfollow_up_issuesです。したがって、#940 の docs が「report に
ci_review_loops[]/human_intervention/follow_up_candidates[]を書け」と指示すると、validator を通らない運用手順を正規 docs にしてしまいます。 これは docs-only Issue としては致命的です。対処は二択です。
実装: agent-run-report.md / agent-retro-index.md と skill handoff を整備する #940 の AC3 / AC4 を現行 schema 互換に修正する。たとえば CI failure / reviewer comment / human correction は
evidence_refsとcommands_summary.summaryに記録し、follow-up は起票済みならagent_retro_index.entries[].follow_up_issuesに載せる、未起票理由は現行 schema 外なので local handoff / termination report に留める。ci_review_loops[],human_intervention,follow_up_candidates[]を本当に正規 field にしたいなら、実装: agent-run-report.md / agent-retro-index.md と skill handoff を整備する #940 は停止し、schema / validator migration の別 Issue を先に作る。敵対的に言うと、#940 は「docs を書けば完成」ではなく、AC の field 名が schema 実装に追いついていない可能性が高いです。
BLOCKER 2: 現在の
agent-run-report.mdは #940 の目的を満たしていない現行
docs/dev/agent-run-report.mdはagent_run_report/v1とexport-chatgpt-contextの説明に寄っています。report の field 一覧、禁止 field、export CLI、section priority、security properties はあります。ただし #940 が求める以下が不足しています。
agent_session_manifest/agent_run_report/agent_retro_indexの責務差分表phase stop condition
review correction loop の記録手順
follow-up issue 起票判断の記録手順
hook は diagnostic/prevention であり post-run verifier が canonical gate である、という明文化
さらに
docs/dev/agent-retro-index.mdは少なくとも今回の取得では見つかりませんでした。#940 はこのファイルの追加または更新を前提にしています。BLOCKER 3: Verification Command が grep 中心で、false green を防げない
#940 の検証は
rg -n "ci_review_loops|human_intervention|review correction"やrg -n "follow_up_candidates|起票しない理由|follow-up issue"のような文字列存在確認です。これは危険です。たとえば docs に「
ci_review_loops[]は存在しない」と書いても grep は通ります。逆に、schema 非互換の手順を書いても grep は通ります。最低限、docs 内に次のような schema-aware note を置くべきです。
ただし、これだと #940 の AC3 / AC4 と衝突します。よって最善は、#940 本文そのものを修正してから実装することです。
HIGH: skill handoff の対象が広すぎる
#940 は
.claude/skills/**,.codex/**,CLAUDE.md,AGENTS.mdを対象にしています。このまま全体に詳細手順を撒くと、AI agent の context 汚染が増えます。更新対象は絞るべきです。
優先更新先は以下です。
docs/dev/agent-run-report.mddocs/dev/agent-retro-index.md.claude/skills/impl-review-loop/SKILL.md.claude/skills/issue-refinement-loop/SKILL.md.claude/skills/open-pr/SKILL.md必要なら
issue-refinement-loop/references/follow-up-materialization.mdCLAUDE.md/AGENTS.mdは詳細を置かず、docs への短い pointer のみにする現行
impl-review-loopは終了条件をLOOP_VERDICT_V2/ merge readiness 中心に定義しており、report finalize / public-safe check / posting dry-run or upsert を終了条件に含めていません。現行
issue-refinement-loopも follow-up materialization と termination report はありますが、agent-run-report / retro-index handoff はまだ正規化されていません。外部実装調査からの補強点
GitHub の Issue comment API は Issue と PR の comment を同じ Issues endpoint で扱います。GitHub Docs も「PR は Issue でもある」と説明しており、comment update には Issues write または Pull requests write 権限が必要です。したがって #937/#938 系の marker upsert は、
gh issue comment --edit-lastではなく、comment list → marker exact match → create/update/noop/fail-closed の REST 方式を docs でも明記すべきです。(GitHub Docs) (GitHub Docs)gh issue comment --edit-lastは「current user の最後の comment」を編集するコマンドであり、marker ownership の exact match ではありません。これは #928 の親コメントが警戒していた drift と一致します。(GitHub CLI)GitHub Actions は
permissionsでGITHUB_TOKENの権限を job 単位に最小化できます。一方、pull_request_targetは public fork 起点でも read/write repository permission を持つため、untrusted PR content と組み合わせる設計は避けるべきです。(GitHub Docs) (GitHub Docs)artifact は canonical storage ではなく補助面として扱うべきです。GitHub artifact には retention があり、
artifact-urlは artifact / run / repository が消えていない間だけ有効で、認証も必要です。upload-artifactはartifact-id,artifact-url,artifact-digestを出力できるので、docs では URL だけでなく digest と retention-limited 性を必須記録にするべきです。(GitHub Docs) (GitHub)Claude Code hooks は
PreToolUseやStopを exit code 2 で block できますが、hook input にはtranscript_pathやagent_transcript_pathが含まれます。よって hook は prevention/diagnostic layer であり、raw transcript を読まず、post-run verifier / validator を canonical gate にするという #940 の方針は正しいです。(Claude Code) (Claude Code)推奨する #940 の修正方針
まず #940 は以下の責務表を docs に入れるべきです。
対象 | 役割 | public surface | 正本 | 禁止 -- | -- | -- | -- | -- agent_session_manifest/v1 | provenance / validation / evidence index | 本文は public comment 禁止。opaque ref / digest のみ | artifact + digest ref | raw transcript, local path, secret, manifest body comment agent_run_report/v1 | 1 run の public-safe summary | Issue / PR marker comment | agent-run:check 済み report + marker upsert | raw transcript, stdout/stderr, full command output, local path agent_retro_index/v1 | report comment の横断 index | parent issue marker comment | retro index workflow / digest marker | inline report copy, transcript 断片, ambiguous target の silent success現行 package scripts には
agent-run:start,agent-run:finalize,agent-run:check,agent-run:post,agent-retro-index:check,agent-retro-index:verify-digest,agent-retro-index:updateが既に存在するため、docs はこの script surface を正規 handoff として参照できます。実装 PR に入れるべき具体変更
docs/dev/agent-run-report.mdに、manifest/report/index の責務差分表を追加する。docs/dev/agent-retro-index.mdを新規追加し、agent_retro_index/v1の目的、marker namespace、digest、partial/blocked の意味、orphan/ambiguous の扱いを書く。impl-review-loopの termination / judgment に、PR ready の前提として以下を追加する。report finalizedpublic-safe check passposting dry-run or upsert doneissue-refinement-loopの Step 4.5 / Step 5 に、follow-up materialization 後の report/index handoff を追加する。open-prに、PR 作成・更新時の report posting dry-run / upsert の責務境界を追加する。CLAUDE.md/AGENTS.mdは詳細展開せず、「AI作業終了時は docs/dev/agent-run-report.md と docs/dev/agent-retro-index.md を参照」の短い pointer だけにする。AC3 / AC4 の schema 非互換 field は、PR 内で勝手に実装せず、Issue 本文修正または schema migration follow-up に分離する。
判定
現状の #940 は、そのまま実装させるなら REQUEST CHANGES 相当です。
理由は単純で、docs-only Issue なのに、AC が現行 schema に存在しない field を前提にしています。ここを直さずに PR を作ると、表面上は grep が通るが、実際の
## 結論agent-run:check/agent-retro-index:checkでは使えない運用手順になります。最初にやるべきことは、#940 の AC3 / AC4 を schema 互換に修正するか、schema migration を別 Issue として切り出すことです。
#940 は方向性自体は妥当ですが、このまま実装 PR に入ると false green になりやすいです。最大の問題は、Issue の AC が現行 schema に存在しない field を前提にしている点です。
#940 は docs / skill handoff の Issue で、
docs/dev/agent-run-report.md/docs/dev/agent-retro-index.mdと.claude/skills/**などの更新を対象にし、schema / validator / posting 実装は明確に out of scope です。さらに #940 にはコメントはありません。BLOCKER 1: #940 の AC3 / AC4 が現行 schema と矛盾している
#940 は AC3 で
ci_review_loops[]/human_intervention、AC4 でfollow_up_candidates[]への反映手順を求めています。しかし、現行
agent_run_report/v1schema はadditionalProperties: falseで、top-level property はschema,public_surface_kind,public_safety,actor,authority,token_usage,manifest_refs,evidence_refs,commands_summary,docs_read_refsに限定されています。ci_review_loops,human_intervention,follow_up_candidatesは定義されていません。agent_retro_index/v1側にもfollow_up_candidatesはなく、あるのは確定済みのfollow_up_issuesです。したがって、#940 の docs が「report に
ci_review_loops[]/human_intervention/follow_up_candidates[]を書け」と指示すると、validator を通らない運用手順を正規 docs にしてしまいます。 これは docs-only Issue としては致命的です。対処は二択です。
evidence_refsとcommands_summary.summaryに記録し、follow-up は起票済みならagent_retro_index.entries[].follow_up_issuesに載せる、未起票理由は現行 schema 外なので local handoff / termination report に留める。ci_review_loops[],human_intervention,follow_up_candidates[]を本当に正規 field にしたいなら、実装: agent-run-report.md / agent-retro-index.md と skill handoff を整備する #940 は停止し、schema / validator migration の別 Issue を先に作る。敵対的に言うと、#940 は「docs を書けば完成」ではなく、AC の field 名が schema 実装に追いついていない可能性が高いです。
BLOCKER 2: 現在の
agent-run-report.mdは #940 の目的を満たしていない現行
docs/dev/agent-run-report.mdはagent_run_report/v1とexport-chatgpt-contextの説明に寄っています。report の field 一覧、禁止 field、export CLI、section priority、security properties はあります。ただし #940 が求める以下が不足しています。
agent_session_manifest/agent_run_report/agent_retro_indexの責務差分表さらに
docs/dev/agent-retro-index.mdは少なくとも今回の取得では見つかりませんでした。#940 はこのファイルの追加または更新を前提にしています。BLOCKER 3: Verification Command が grep 中心で、false green を防げない
#940 の検証は
rg -n "ci_review_loops|human_intervention|review correction"やrg -n "follow_up_candidates|起票しない理由|follow-up issue"のような文字列存在確認です。これは危険です。たとえば docs に「
ci_review_loops[]は存在しない」と書いても grep は通ります。逆に、schema 非互換の手順を書いても grep は通ります。最低限、docs 内に次のような schema-aware note を置くべきです。
ただし、これだと #940 の AC3 / AC4 と衝突します。よって最善は、#940 本文そのものを修正してから実装することです。
HIGH: skill handoff の対象が広すぎる
#940 は
.claude/skills/**,.codex/**,CLAUDE.md,AGENTS.mdを対象にしています。このまま全体に詳細手順を撒くと、AI agent の context 汚染が増えます。更新対象は絞るべきです。
優先更新先は以下です。
docs/dev/agent-run-report.mddocs/dev/agent-retro-index.md.claude/skills/impl-review-loop/SKILL.md.claude/skills/issue-refinement-loop/SKILL.md.claude/skills/open-pr/SKILL.mdissue-refinement-loop/references/follow-up-materialization.mdCLAUDE.md/AGENTS.mdは詳細を置かず、docs への短い pointer のみにする現行
impl-review-loopは終了条件をLOOP_VERDICT_V2/ merge readiness 中心に定義しており、report finalize / public-safe check / posting dry-run or upsert を終了条件に含めていません。現行
issue-refinement-loopも follow-up materialization と termination report はありますが、agent-run-report / retro-index handoff はまだ正規化されていません。外部実装調査からの補強点
GitHub の Issue comment API は Issue と PR の comment を同じ Issues endpoint で扱います。GitHub Docs も「PR は Issue でもある」と説明しており、comment update には Issues write または Pull requests write 権限が必要です。したがって #937/#938 系の marker upsert は、
gh issue comment --edit-lastではなく、comment list → marker exact match → create/update/noop/fail-closed の REST 方式を docs でも明記すべきです。([GitHub Docs]1) (GitHub Docs)gh issue comment --edit-lastは「current user の最後の comment」を編集するコマンドであり、marker ownership の exact match ではありません。これは #928 の親コメントが警戒していた drift と一致します。([GitHub CLI]2)GitHub Actions は
permissionsでGITHUB_TOKENの権限を job 単位に最小化できます。一方、pull_request_targetは public fork 起点でも read/write repository permission を持つため、untrusted PR content と組み合わせる設計は避けるべきです。([GitHub Docs]3) ([GitHub Docs]3)artifact は canonical storage ではなく補助面として扱うべきです。GitHub artifact には retention があり、
artifact-urlは artifact / run / repository が消えていない間だけ有効で、認証も必要です。upload-artifactはartifact-id,artifact-url,artifact-digestを出力できるので、docs では URL だけでなく digest と retention-limited 性を必須記録にするべきです。([GitHub Docs]4) ([GitHub]5)Claude Code hooks は
PreToolUseやStopを exit code 2 で block できますが、hook input にはtranscript_pathやagent_transcript_pathが含まれます。よって hook は prevention/diagnostic layer であり、raw transcript を読まず、post-run verifier / validator を canonical gate にするという #940 の方針は正しいです。([Claude Code]6) ([Claude Code]6)推奨する #940 の修正方針
まず #940 は以下の責務表を docs に入れるべきです。
agent_session_manifest/v1agent_run_report/v1agent-run:check済み report + marker upsertagent_retro_index/v1現行 package scripts には
agent-run:start,agent-run:finalize,agent-run:check,agent-run:post,agent-retro-index:check,agent-retro-index:verify-digest,agent-retro-index:updateが既に存在するため、docs はこの script surface を正規 handoff として参照できます。実装 PR に入れるべき具体変更
docs/dev/agent-run-report.mdに、manifest/report/index の責務差分表を追加する。docs/dev/agent-retro-index.mdを新規追加し、agent_retro_index/v1の目的、marker namespace、digest、partial/blocked の意味、orphan/ambiguous の扱いを書く。impl-review-loopの termination / judgment に、PR ready の前提として以下を追加する。report finalizedpublic-safe check passposting dry-run or upsert doneissue-refinement-loopの Step 4.5 / Step 5 に、follow-up materialization 後の report/index handoff を追加する。open-prに、PR 作成・更新時の report posting dry-run / upsert の責務境界を追加する。CLAUDE.md/AGENTS.mdは詳細展開せず、「AI作業終了時は docs/dev/agent-run-report.md と docs/dev/agent-retro-index.md を参照」の短い pointer だけにする。AC3 / AC4 の schema 非互換 field は、PR 内で勝手に実装せず、Issue 本文修正または schema migration follow-up に分離する。
判定
現状の #940 は、そのまま実装させるなら REQUEST CHANGES 相当です。
理由は単純で、docs-only Issue なのに、AC が現行 schema に存在しない field を前提にしています。ここを直さずに PR を作ると、表面上は grep が通るが、実際の
agent-run:check/agent-retro-index:checkでは使えない運用手順になります。最初にやるべきことは、#940 の AC3 / AC4 を schema 互換に修正するか、schema migration を別 Issue として切り出すことです。
squne121 commentedon Jun 21, 2026
Refinement Loop: Human Escalation Required
The loop has terminated and requires human review. Cause: human judgment required
human_escalationhuman_judgment_requiredBlockers
squne121 commentedon Jun 21, 2026
CONTRACT_REVIEW_RESULT_V1
Checks
修正方針
Verification Commands の以下 2 点を修正する:
①
pnpm lint:docsを削除またはpnpm lintに置換pnpm lint:docsは allowlist 外のスクリプト。代替としてpnpm lintを使うか、docs-only の場合は削除する。②
rgの検索パスを.claude/skillsから特定ファイルに絞るAllowed Paths 内の具体的な更新対象ファイルを列挙する。例:
Next Action
issue-refinement-loopで VC を修正後、issue-contract-reviewを再実行してください。squne121 commentedon Jun 21, 2026
Contract Review Result
fix(#940): iteration-1 — schema/script/verdict/evidence_refs/handoff …
docs(#940): agent-run-report / agent-retro-index の運用 docs と handoff 整備 (
squne121 commentedon Jun 21, 2026
post-merge-cleanup: 完了 (2026-06-21)
Cleanup Summary
git pull origin mainissue-940-agent-run-report-handoff削除worktree-issue-940-agent-run-report-handoff削除-d非対象・hookbranch_force_delete_deniedでローカル残置(remote は削除済み)