Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: parent
goal_ref: "AI agent の作業過程を ChatGPT が public-safe にレビューできる run report / retro index 層を GitHub 上へ永続保存する"
change_kind: workflow
parent_mode: "delivery-rollup"
closure_mode: "child-complete"Summary
agent_session_manifest/v1 の provenance / validation / evidence index 役割は維持したまま、ChatGPT が AI エージェント運用改善を検討できる粒度の agent_run_report/v1 と agent_retro_index/v1 を追加する親トラッカー。
現行 manifest は metadata-first / full transcript は疑義発生時のみという設計で、Issue/PR/phase/token/evidence の索引には向く一方、prompt・読んだ資料・修正ループ・CI 失敗・human intervention・context pollution を横断的にレビューするには薄い。さらに GitHub public surface には raw transcript / local path / secret 類を出せず、現行 agent-session-manifest workflow artifact は 7 日保持の補助面に留まるため、public-safe に redaction された構造化作業レポートを Issue / PR comment に marker upsert で永続保存する新しい層が必要。
#246 は AI 駆動 session 記録 pilot smoke test の research issue であり、本親 Issue は pilot 可否そのものではなく、pilot を含む AI 作業の retrospective 用 report / index の schema・validator・script・GitHub 永続化・docs・workflow 統合を delivery-rollup する。agent_session_manifest/v1 を置き換えず、その根拠リンクを ChatGPT 改善検討に読ませる report 層を追加する。
Outcome
agent_session_manifest/v1 を public comment に出さない既存境界を維持したまま、public-safe な agent_run_report/v1 / agent_retro_index/v1 を生成・検証・upsert・参照できる child issue 群と handoff 契約が parent issue 上で固定されている。
Goal
Issue 起票から PR merge / follow-up Issue 作成までの AI 作業過程を、raw transcript を公開せずに GitHub 上へ永続保存し、人間が対象 Issue / PR に紐付く agent_run_report/v1 と agent_retro_index/v1 を読ませて ChatGPT に prompt / skill / hook / script / CI / context engineering / token 削減の改善相談を行える状態にする。
Desired Destination
docs/schemas/agent-run-report.schema.jsonとdocs/schemas/agent-retro-index.schema.jsonが正本として追加されているscripts/agent-logs/*.mjsとpackage.jsonscripts により run report 生成・GitHub marker upsert・retro index 更新・ChatGPT context export が再実行可能になっている.github/workflows/agent-retro-index.ymlが trusted context だけで retro index を再生成し、必要最小限の write permission だけで parent Issue comment を更新できるdocs/dev/agent-run-report.mdとdocs/dev/agent-retro-index.mdに public-safe 運用手順と manifest との責務差分が明記されているissue-refinement-loop/impl-review-loop/ PR open / review correction / post-merge cleanup / follow-up issue creation が、作業完了時の run report finalize / posting / retro index 更新を handoff 契約として参照できる
Current Validated Scope
agent_session_manifest/v1は provenance / validation / evidence index として継続利用し、置き換えない- GitHub public surface へ raw transcript、local absolute path、secret、private config を出さない public-safe redaction が必須
- public comment に載せるのは manifest 本文ではなく redacted report / index のみであり、manifest への参照は digest / artifact ref / validation verdict などの opaque ref に限定する
- artifact は補助用途に留め、永続正本は Issue / PR comment の marker upsert comment とする
#246の smoke/policy 検証とは別 concern として、run report / retro index の docs drift cleanup、schema、validator、script、posting guard、workflow、docs、skill integration を扱う- EntireCLI は private/local 詳細ログ保管の補助としてのみ条件付き採用可能であり、public checkpoint branch や raw session push は許容しない
Decisions Fixed
- 2026-06-15:
agent_session_manifest/v1は provenance / validation / evidence index として継続利用し、ChatGPT 改善検討用には新規agent_run_report/v1を追加する - 2026-06-15: public 永続正本は GitHub Issue / PR comment の marker upsert とし、manifest 本文は comment に出さない
- 2026-06-15: report / index の public posting より前に、既存 docs 上で manifest と report/index の公開境界を固定する docs drift cleanup child を置く
- 2026-06-15: child issue の依存順は
docs drift cleanup -> schema/validator -> lifecycle scripts -> posting guard -> retro index workflow -> ChatGPT export -> docs/skill handoff -> EntireCLI safety checkerとする - 2026-06-15: workflow permission は existing
session-manifest.ymlの read-only baseline と、必要 job にだけ write を付与する既存方針に合わせる
Quality Decision Record
Status: N/ADecision Date: 2026-06-15Does this prove the parent goal complete?: N/AReason: 本 Issue は delivery-rollup parent であり、品質ゲート判定ではなく child issue 完了により close するEvidence: owner comment 導入: ChatGPT改善検討用のAI作業ログレポートをGitHubに永続保存する #928 (comment) と既存 session-recording SSOT / workflow 実装Next Action: docs drift cleanup child を先頭に追加し、dependency 順に child issue を materialize する
Parent Closure Rule
delivery-rollup: 下記 Child Issues が依存順どおりに close され、親 Goal に対する Remaining Parent Gaps がなしになった時点で close するquality-gate: N/Arouting-map: N/Adecision-log: N/Aquality-gateparent ではclosure_modeとQuality Decision Recordを同一編集で更新する- 非
quality-gateparent のQuality Decision RecordはN/A扱いでよく、close 判定の必須材料にしない
Child Issues
- 実装: #928 導入前に session-recording policy と report公開境界の drift を解消する #934 — docs: 導入: ChatGPT改善検討用のAI作業ログレポートをGitHubに永続保存する #928 導入前に session-recording policy と report公開境界の drift を解消する
- 実装: agent_run_report/v1 / agent_retro_index/v1 schema・fixtures・public-safe validator を追加する #935 — 実装: agent_run_report/v1 / agent_retro_index/v1 schema・fixtures・public-safe validator を追加する
- 実装: agent run lifecycle scripts と package scripts を追加する #936 — 実装: agent run lifecycle scripts と package scripts を追加する
- 実装: GitHub Issue / PR marker upsert と public-safe posting guard を追加する #937 — 実装: GitHub Issue / PR marker upsert と public-safe posting guard を追加する
- 実装: agent_retro_index/v1 の canonical parent marker と trusted post-merge workflow を追加する #938 — 実装: agent_retro_index/v1 builder と post-merge workflow を追加する
- 実装: export-chatgpt-context.mjs を追加し ChatGPT投入用 context bundle を生成する #939 — 実装: export-chatgpt-context.mjs を追加し ChatGPT投入用 context bundle を生成する
- 実装: agent-run-report.md / agent-retro-index.md と skill handoff を整備する #940 — docs: agent-run-report.md / agent-retro-index.md と skill handoff を整備する
- 実装: EntireCLI safety checker と conditional adoption guard を追加する #941 — 実装: EntireCLI safety checker と conditional adoption guard を追加する
Remaining Parent Gaps
- manifest 本文禁止と public-safe report/index 許可の境界を既存 docs / policy 上で drift なく固定する
- report schema の禁止パターンと invalid fixture を validator に落とし込む
- GitHub public comment へ出せる JSON / markdown 形式と marker upsert 規約を exact match で固定する
- merge 後 workflow から対象 Issue / PR を決定論的に辿る方法を固定する
- skill / hook / script への統合順序と stop condition 追記位置を固定する
- artifact を「secret-safe」ではなく「public-safe content に限る retention-limited 補助面」として明確化する
Phase Handoff Contract
Desired DestinationCurrent Validated ScopeRemaining Parent GapsCurrent ObjectiveBounded Current ContextNormative ReferencesAllowed PathsRequired SkillsValidation CommandsStop ConditionsOpen QuestionsNext ActionArtifact RefsHandoff Prompt DraftLinked PR(implementation のみ)
Acceptance Criteria
- AC1: parent issue として
agent_run_report/v1/agent_retro_index/v1導入の決定事項、禁止事項、境界 (#246との差分を含む) が固定されている - AC2: docs drift cleanup を含む child issue 分割先と依存順が定義されている
- AC3: child issue が parent の Goal と Desired Destination をそのまま参照できる handoff 契約を持つ
- AC4: public-safe 永続化の原則(manifest 本文非公開、raw transcript 非公開、local path 非公開、secret 非公開、artifact 補助・Issue/PR comment 正本)が parent issue 上で明文化されている
- AC5: comment upsert / workflow permission / artifact boundary / EntireCLI conditional 採用の guardrail が child issue へ分解されている
- AC6: close 条件が child-complete として固定され、quality-gate issue と混同しない
Verification Commands
# AC1
# baseline-expect: pass
$ gh issue view 928 --repo squne121/loop-protocol --json body --jq '.body | contains("manifest 本文は comment に出さない") and contains("raw transcript")'
# AC2
# baseline-expect: pass
$ gh issue view 928 --repo squne121/loop-protocol --json body --jq '.body | contains("docs: #928 導入前に session-recording policy と report公開境界の drift を解消する") and contains("agent_run_report/v1 / agent_retro_index/v1 schema・fixtures・public-safe validator") and contains("EntireCLI safety checker")'
# AC3
# baseline-expect: pass
$ gh issue view 928 --repo squne121/loop-protocol --json body --jq '.body | contains("## Phase Handoff Contract") and contains("Desired Destination") and contains("Linked PR")'
# AC4
# baseline-expect: pass
$ rg -n "agent_session_manifest_allowed|raw_transcript_allowed|source_kind_prohibited|private_artifact" docs/dev/session-recording-policy.md docs/dev/onboarding/session-recording-tool.md docs/schemas/agent-session-manifest.md
# AC5
# baseline-expect: pass
$ gh issue view 928 --repo squne121/loop-protocol --json body --jq '.body | contains("exact marker match") and contains("issues: write") and contains("pull-requests: write") and contains("conditional 採用")'
# AC6
# baseline-expect: pass
$ gh issue view 928 --repo squne121/loop-protocol --json body --jq '.body | contains("child-complete") and contains("delivery-rollup") and contains("close する")'Allowed Paths
- GitHub Issue 本文・comment の作成/更新
.claude/tmp/issue928_refined_body.mdのような起票用一時ファイルdocs/dev/session-recording-policy.mddocs/dev/onboarding/session-recording-tool.mddocs/schemas/agent-session-manifest.md.github/workflows/session-manifest.yml- child issue 起票時に参照する docs / schemas / scripts / workflow / skill path の列挙のみ(この parent 自体では repo 本体の実装変更を行わない)
Runtime Verification Applicability
- decision: not_applicable
- reason: 本 Issue は delivery-rollup parent であり、runtime 実行そのものではなく child issue の分割・境界固定・handoff 契約の確定を成果物とする
Notes
session-manifest.ymlの artifact retention 7 日は現行 manifest workflow の事実であり、report/index の retention 設計は child issue で別途固定する- comment upsert は
list -> exact marker match -> 0件 create / 1件 update / 2件以上 fail closedを child issue の必須仕様とする - workflow write permission は top-level read-only baseline を維持しつつ、必要 job にだけ
issues: write/pull-requests: writeを付与する deploy-pages.ymlの marker comment update パターンを、agent-run-report posting guard 設計の前例として参照してよい- ChatGPT に読ませる対象は raw transcript ではなく、redacted された structured report / retro index / evidence link / friction signal とする
Activity
squne121 commentedon Jun 15, 2026
結論
#928 の方向性は妥当です。
agent_session_manifest/v1を provenance / validation / evidence index として残し、その上に ChatGPT へ読ませるagent_run_report/v1とagent_retro_index/v1を追加する、という責務分離は正しいです。#928 本文も「raw transcript 非公開」「local path 非公開」「secret 非公開」「Issue / PR comment を永続正本」「artifact は補助」という原則を明示しています。ただし、現状の #928 はこのまま implementation issue に落とすと false green / public leak / comment upsert drift / workflow permission overreach を起こしやすいです。#928 自体にはコメントがまだ無く、本文上の設計をそのまま精査対象にする必要があります。
最重要の敵対的指摘はこれです。既存の session recording policy と PR #426 は、
agent_session_manifest本文を workflow log / Issue comment / PR comment / git commit / stdout に出すことを明示的に禁止しています。一方 #928 はrun report / retro indexを Issue / PR comment に永続保存する方針です。この2つは矛盾ではありませんが、manifest JSON を comment に出すな、public-safe report/index だけを comment に出せ、という境界を schema・validator・posting guard で機械的に固定しないと危険です。参照した関連 Issue / PR / コメント
#928 は delivery-rollup parent で、
agent_session_manifest/v1を置換せず、ChatGPT 改善検討用にagent_run_report/v1とagent_retro_index/v1を足す設計です。Desired Destination には schema、scripts、GitHub upsert、retro index workflow、docs、skill handoff、EntireCLI safety が含まれています。#246 は別 concern です。#246 は session recording pilot smoke test であり、authoritative producer / negative control / Kill Switch / secret scan / metrics strictness により「AI が自分で manifest を書いて成功に見せる」false green を防ぐ契約です。#928 はその pilot 自体ではなく、pilot を含む AI 作業を後からレビューする report / index 層です。
#246 のコメントでは、#326 / #377 / #378 / #379 / #380 などが揃うまで pilot 開始不可、各 phase で
agent_session_manifest/v1を記録、token / latency / human intervention は実測可能なもののみ、public GitHub comment に raw transcript / local file / secret-bearing artifact を載せない、という前提が同期されています。#136 は元の導入判断 Issue で、AI agent が AC を読んだか、test-runner SubAgent を呼んだか、SKIP exit 0 を黙認したか、PR body を全面置換したか、token/context 圧迫があったかを後から検証できない、という問題意識を起点にしています。
PR #314 は
agent_session_manifest/v1の JSON Schema Draft 2020-12 SSOT、valid/invalid fixtures、tests を導入した PR です。public comment 時にtranscript/local_fileevidence を禁止する制約、4 backticks fence、token unavailable を 0 偽装しないルールなどが REQUEST_CHANGES 対応として入っています。PR #426 は hook wrapper と CI workflow を導入し、manifest を artifact に書くが stdout / workflow log / Issue / PR comment / git commit へ出さない方針を明文化しています。ここが #928 の設計境界に直結します。
敵対的レビュー
Blocker 1: 「Issue / PR comment 永続正本」と既存 manifest 禁止方針の境界が未固定
#928 は public 永続正本を GitHub Issue / PR comment の marker upsert としています。一方、既存 policy は manifest 本文の Issue / PR comment 出力を禁止しています。
これは「manifest は出さないが、redacted report/index は出す」という設計にすれば成立します。しかし #928 の child 分割では、その境界がまだ enforcement まで落ちていません。
agent_run_report/v1が manifest JSON、command output、prompt全文、読んだ資料の長文引用、CI log 抜粋を取り込み始めると、実質的な transcript/comment leak になります。修正方針は、schema に
public_surface_kind: github_issue_comment | github_pr_commentとpublic_safety.redaction_status: cleanを必須化し、raw_transcript,transcript_excerpt,local_path,absolute_path,secret_value,full_command_output,full_promptを field 名としても値としても invalid にすることです。manifest への参照はmanifest_refs[]の URL / artifact id / digest / schema / validation verdict だけに限定すべきです。Blocker 2: comment upsert が未設計だと idempotency が壊れる
GitHub CLI の
gh issue comment --edit-lastは「現在ユーザーの最後のコメント」を編集する機能であり、marker-addressed upsert ではありません。(GitHub CLI)#928 の用途では、必ず REST API で comments を list し、marker を検索し、comment ID を指定して update する実装に寄せるべきです。GitHub REST は Issue comment / PR comment の update endpoint を持ち、PR も issue として扱われます。更新には Issues write または Pull requests write permission が必要です。([GitHub Docs]2)
必須仕様は次です。
<!-- agent_run_report:v1 repo=squne121/loop-protocol issue=928 run_id=arr-... sha256=... -->この marker を1コメントに1つだけ置き、list → exact marker match → 0件なら create、1件なら update、2件以上なら fail closed。
--edit-lastや「本文 grep でなんとなく最後を更新」は禁止です。Blocker 3: public-safe validator が現状の manifest validator より強くないと漏れる
既存
agent-session-manifest-validation.mjsの secret pattern は/home/,/Users/,/tmp/,.env,sk-,gh[pousr]_, private key, expanded env assignment などを検出しますが、coverage は限定的です。一方、現行 workflow 側は
github_pat_や 40-hex token-like string も grep しています。#928 の report posting guard は、manifest validator の流用だけでは不足です。少なくとも
github_pat_,AKIA,BEGIN OPENSSH PRIVATE KEY, Windows path,C:\,file://,.env.local,.claude/settings.local.json,VITE_.*(SECRET|TOKEN|KEY|PASSWORD|PRIVATE), long base64/hex, markdown fence breakout, duplicate HTML marker を invalid fixture に入れるべきです。#928 本文も raw transcript / local path / secret 類を禁止していますが、validator の負例に落とさない限り品質保証になりません。Blocker 4: workflow permissions が未固定
GitHub Actions の
permissionsは top-level / job-level で指定でき、未指定 permission はnoneになります。またpull_request_targetは fork 由来の PR でも read/write token になり得るため、comment write workflow では避けるべきです。([GitHub Docs]3)#928 の
.github/workflows/agent-retro-index.ymlは、read-only artifact 生成と write-comment upsert を分離した方が安全です。post-merge またはworkflow_dispatchの trusted context だけでissues: write/pull-requests: writeを job-level 付与し、contents: writeやsecrets.*は不要にするべきです。GitHub docs 上も issue comment にはissues: writeが必要です。([GitHub Docs]4)High 1: artifact を “private” と呼ぶと誤解が残る
既存 docs は public repo の GitHub Actions artifact は REST API 経由で誰でも download 可能であり、「private artifact」は secret safety を意味しない、と明記しています。
GitHub artifact の retention は public repo では設定範囲が制限され、
actions/upload-artifactのretention-daysも repository / organization / enterprise の上限を超えられません。([GitHub Docs]5) ([GitHub Docs]6)したがって #928 は artifact を「補助」「短期」「public-safe content only」と明記するだけでなく、
artifact_id,artifact_url,artifact_digest,expires_at,retention_daysを report/index に記録し、永続正本は comment marker だけ、と固定すべきです。upload-artifactは artifact digest などの output を持つため、digest を report に入れる設計ができます。([GitHub]7)High 2: retro index の対象 Issue / PR 解決が未決定
#928 の Remaining Parent Gaps に「merge 後 workflow から対象 Issue / PR を決定論的に辿る方法」が残っています。ここを曖昧にすると、merge 後に別 Issue へ report が紐付く、関連 PR が欠落する、follow-up issue が index に入らない、という drift が起きます。
推奨順序は、
Linked PRfield → PR body のCloses #N→ branch naming convention → parent issue body の explicit refs → GitHub API の linked issue 情報、です。複数候補なら自動 merge-index 更新を fail closed にして、ambiguous_targets[]として parent comment に記録すべきです。High 3: Claude / Codex hook を security boundary として扱ってはいけない
既存 docs は Codex の
PreToolUse/PermissionRequestを予防層であり security boundary ではない、canonical final gate は post-run verifier と private artifact validation に置く、と明記しています。Claude Code hooks は Stop / SubagentStop / PreToolUse などで exit code 2 による block ができますが、hook input には transcript path なども含まれます。設計上、report generator が transcript path を読みに行かないことを schema / tests / wrapper で固定する必要があります。([Claude Code]8)
Codex 側は hook coverage / dispatch の不安定性が issue として出ており、repo docs も live smoke を diagnostic-only としています。 ([GitHub]9)
Medium: docs drift が既にある
現行
agent-session-manifest.schema.jsonと producer はci:<producer_slug>:<run_id>:<run_attempt>のphase_instance_idを受け付けます。しかし session-recording-policy の古い記述には、CI では raw
ci:<workflow>:<run_id>:<run_attempt>が current schema / validator で受け付けられない、という記述が残っています。#928 実装前に、既存 policy docs の drift cleanup child を1本足すべきです。これを放置すると、新 report schema の
phase_instance_idや retro index の join key がまた揺れます。Medium: EntireCLI は conditional のままにすべき
EntireCLI 公式情報では、AI coding sessions の transcript / prompt / file changes / token / tool calls を捕捉し、checkpoint metadata を
entire/checkpoints/v1に保存し、通常のgit push時に checkpoint branch を push する挙動があります。([docs.entire.io]10)公式 README でも、public repo では sessions が誰でも見える可能性、redaction は best-effort、temporary shadow branches に未 redacted data が残り得ること、
--local,--skip-push-sessions,--checkpoint-remote,--telemetry=false,strategy_options.push_sessionsなどの設定が説明されています。([GitHub]11)既存 onboarding も Hook-based metadata ledger を Adopt、EntireCLI local/private/no-push 構成を Conditional、public checkpoint 構成を Reject としています。
したがって #928 の EntireCLI child は「導入」ではなく「unsafe 設定検出時に report posting / index update を fail closed する checker」として扱うべきです。
高品質化した設計案
agent_run_report/v1は、GitHub public comment に出せる レビュー用要約 だけにします。必須 field はschema,run_id,target,time_range,phase,actor,authority,prompt_summary_redacted,docs_read_refs,issue_pr_refs,files_touched_summary,commands_summary,ci_review_loops,human_intervention,token_usage,context_pollution_signals,friction_signals,evidence_refs,manifest_refs,public_safety,known_data_gaps,follow_up_candidatesがよいです。agent_retro_index/v1は、run report を横断検索するための index に限定します。必須 field はschema,index_id,repository,generated_at,source_scope,entries[],orphan_reports[],ambiguous_links[],generation_verdict,public_safety,source_comment_refsがよいです。entry はissue,pr,merge_sha,report_comment_url,manifest_artifact_refs,follow_up_issues,tags,friction_summary,quality_signalsまでに止めます。posting は
post-agent-run-report.mjsとupsert-github-marker-comment.mjsに分けます。前者は schema / redaction / max-size validation を担当し、後者は GitHub comment API の list / create / update だけを担当します。これにより、GitHub write 権限を持つ script の責務を狭くできます。推奨 Child Issues 草案
Child 0 — docs: #928 導入前に session-recording policy と report公開境界の drift を解消する
Parent: #928
Goal:
agent_session_manifestは Issue / PR comment に出さないが、agent_run_report/agent_retro_indexは public-safe validator 通過後に comment 永続化できる、という境界を既存 docs 上で明文化する。Allowed Paths
docs/dev/session-recording-policy.mddocs/dev/onboarding/session-recording-tool.mddocs/schemas/agent-session-manifest.mddocs/dev/schema-governance.mdAcceptance Criteria
manifest bodyとrun report / retro indexの public surface 方針が別物として説明されている。Issue / PR comment への manifest 本文出力禁止は維持されている。agent_run_report/v1/agent_retro_index/v1は schema + redaction validator + marker upsert guard 通過時のみ public comment 可、と明記されている。phase_instance_idの CI-native 記述 drift が現行 schema / workflow と一致している。private artifactという語を「非 comment / retention-limited surface」であり secret-safe ではない、と再定義している。Validation Commands
Child 1 — 実装:
agent_run_report/v1/agent_retro_index/v1schema・fixtures・public-safe validator を追加するParent: #928
Goal: ChatGPT 改善レビューに必要な作業要約と retro index を、raw transcript / local path / secret を含めず validation できる SSOT schema と validator に落とす。
Allowed Paths
docs/schemas/agent-run-report.schema.jsondocs/schemas/agent-retro-index.schema.jsondocs/schemas/examples/agent-run-report/**docs/schemas/examples/agent-retro-index/**scripts/lib/agent-run-report-validation.mjsscripts/check-agent-run-reports.mjstests/agent-run-report*.test.tsAcceptance Criteria
additionalProperties: false、$defsベースで定義されている。raw_transcript,transcript_excerpt,local_path,absolute_path,secret_value,full_command_output,full_promptが public report で invalid。authorityはauthoritative | derived | non_authoritativeを持ち、AI self-report はnon_authoritative以外にできない。token_usage.availability: unavailableの場合、数値 field は null。0 偽装は invalid。/home/,/Users/,C:\,file://,.env.local,.claude/settings.local.json,ghp_,github_pat_,sk-,AKIA, private key,VITE_SECRET_KEY, duplicate marker, fence breakout が含まれる。--allow-local-pathのような escape hatch を持たない。pnpm agent-run-report:checkが explicit target 0件を fail し、default target 0件 only の silent green を出さない。Validation Commands
Child 2 — 実装: agent run lifecycle scripts と package scripts を追加する
Parent: #928
Goal: run 開始・終了・report finalize・local artifact 生成を deterministic に行う CLI を追加する。
Allowed Paths
scripts/agent-logs/start-agent-run.mjsscripts/agent-logs/finalize-agent-run.mjsscripts/agent-logs/lib/**package.jsontests/agent-logs/**docs/schemas/examples/agent-run-report/**Acceptance Criteria
start-agent-run.mjsはrun_id, target issue/pr, phase, actor, start time を含む local draft を atomic write する。finalize-agent-run.mjsは manifest refs / evidence refs / command summaries / CI summaries / human intervention / known data gaps を取り込み、agent_run_report/v1を生成する。--outputのみ許可。package.jsonにagent-run:start,agent-run:finalize,agent-run:checkが追加されている。Validation Commands
pnpm agent-run:start --issue 928 --phase impl --actor ai_agent --output tmp/agent-runs/demo-start.json pnpm agent-run:finalize --input tmp/agent-runs/demo-start.json --output tmp/agent-runs/demo-report.json pnpm agent-run:check tmp/agent-runs/demo-report.json pnpm test -- --run tests/agent-logsChild 3 — 実装: GitHub Issue / PR marker upsert と public-safe posting guard を追加する
Parent: #928
Goal:
agent_run_report/v1を GitHub Issue / PR comment に idempotent に upsert する。gh issue comment --edit-last依存は禁止。Allowed Paths
scripts/agent-logs/post-agent-run-report.mjsscripts/agent-logs/upsert-github-marker-comment.mjsscripts/agent-logs/lib/github-comments.mjstests/agent-logs/github-comment-upsert*.test.tspackage.jsonAcceptance Criteria
AC1: marker format が固定されている。
<!-- agent_run_report:v1 repo=squne121/loop-protocol issue=<N> pr=<N|null> run_id=<id> sha256=<digest> -->AC2: upsert は comments list → exact marker search → 0件 create / 1件 update / 2件以上 fail closed。
AC3: marker が user-provided markdown 内に混入しても、script が自前 marker 以外を信頼しない。
AC4: report body は validator + redaction scanner + max byte limit を通過しないと post しない。
AC5: max body size を固定し、超過時は summary を縮約するか fail closed する。
AC6: dry-run mode は GitHub API write を行わず、予定 marker / target / digest だけを出す。
AC7: tests は mocked REST response で create / update / duplicate marker / permission failure / 422 validation failure を検証する。
Validation Commands
Child 4 — 実装:
agent_retro_index/v1builder と post-merge workflow を追加するParent: #928
Goal: merged PR / Issue / run report / manifest artifact / follow-up issue を横断参照する retro index を deterministic に再生成し、parent Issue comment に marker upsert する。
Allowed Paths
scripts/agent-logs/update-retro-index.mjsscripts/agent-logs/lib/retro-index*.mjs.github/workflows/agent-retro-index.ymltests/agent-logs/retro-index*.test.tspackage.jsonAcceptance Criteria
agent_retro_index/v1は Child 1 schema を通る。Linked PR/Closes #N/ branch pattern / parent issue refs / API linked data。ambiguous_links[]/orphan_reports[]に入り、index generation verdict はpartialになる。workflow_dispatchと trusted post-merge context のみ。pull_request_targetは使わない。permissions: {}、job-level に必要最小限のcontents: read,issues: write,pull-requests: writeのみ。catしない。Validation Commands
Child 5 — 実装:
export-chatgpt-context.mjsを追加し ChatGPT投入用 context bundle を生成するParent: #928
Goal: parent issue、retro index、選択 run reports、関連 evidence refs から、ChatGPT に投入しやすい public-safe markdown bundle を生成する。
Allowed Paths
scripts/agent-logs/export-chatgpt-context.mjsscripts/agent-logs/lib/chatgpt-context*.mjstests/agent-logs/chatgpt-context*.test.tsdocs/dev/agent-run-report.mdAcceptance Criteria
--max-charsまたは--max-sectionsで制御できる。omitted_sections[]と理由を出す。friction_signals,context_pollution_signals,ci_review_loops,human_intervention,follow_up_candidatesが優先的に残る。Validation Commands
Child 6 — docs:
agent-run-report.md/agent-retro-index.mdと skill handoff を整備するParent: #928
Goal: issue-refinement-loop / impl-review-loop / PR open / review correction / post-merge cleanup / follow-up issue creation の handoff 契約に run report finalize / posting / retro index update を組み込む。
Allowed Paths
docs/dev/agent-run-report.mddocs/dev/agent-retro-index.md.claude/skills/**.codex/**CLAUDE.mdAGENTS.mdAcceptance Criteria
agent_session_manifest,agent_run_report,agent_retro_indexの責務差分が表で説明されている。report finalized,public-safe check pass,posting dry-run or upsert doneが追加されている。ci_review_loops[]/human_interventionに反映する手順がある。follow_up_candidates[]から child/follow-up issue を起票するか、起票しない理由を記録する。Validation Commands
pnpm lint:docs rg -n "agent_run_report|agent_retro_index|report finalized|public-safe" docs .claude AGENTS.md CLAUDE.mdChild 7 — 実装: EntireCLI safety checker と conditional adoption guard を追加する
Parent: #928
Goal: EntireCLI を使う場合でも public checkpoint branch / session auto-push / telemetry / unknown config を検出して、report posting と retro index update を fail closed する。
Allowed Paths
scripts/agent-logs/check-entirecli-safety.mjsscripts/agent-logs/lib/entirecli-safety*.mjstests/agent-logs/entirecli-safety*.test.tsdocs/dev/agent-run-report.mdpackage.jsonAcceptance Criteria
not_applicableverdict を出す。entire version,entire enable --help,entire configure --helpなどの available surface を記録する。push_sessions: false/--skip-push-sessions/--local/--telemetry=false/ checkpoint remote private verified を確認できない場合は fail closed。entire/checkpoints/v1,entire/*,*checkpoint*,*session*remote branch を検査する。.entire/, commit trailers, gitpushurl,insteadOf,pushInsteadOf, checkpoint token env presence を検査する。blocked。agent_run_report.public_safety.entirecli_safetyに取り込める。Validation Commands
親 #928 の Child Issues 欄はこう直すのがよい
現在の6本は方向性としてはよいですが、実装リスクに対して粒度が粗いです。特に
schema,posting,workflow,ChatGPT export,EntireCLI safety,docs/skillは責務を分けるべきです。推奨順序は次です。
この順序なら、public write 権限を持つ処理を schema / validator 完成後に実装できます。逆に、workflow や comment upsert を先に作ると、validator 不備のまま public surface へ書けてしまいます。
squne121 commentedon Jun 15, 2026
更新内容
/home/squne/projects/LOOP_PROTOCOL/.claude/tmp/issue928_refined_body.mdと一致する形に更新しました## Outcomeを追加しました## Runtime Verification Applicabilityを追加しました確認結果
check_vc_scope.py: PASSguard-issue-body.py: PASScontract_readiness_check.py --mode preflight-static: statusgo備考
squne121 commentedon Jun 15, 2026
Refinement Loop: Approved
The issue has been approved and is ready for implementation.
approvedsqune121 commentedon Jun 22, 2026
全 8 件の child Issue(#934〜#941)がクローズ完了。#941(EntireCLI safety checker)のマージにより全 delivery が揃ったため、parent #928 をクローズします。