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: "AI 作業の retrospective 用 report / index を public-safe に永続保存できるようにする"
change_kind: docs_and_validatorParent Issue
Parent Goal Ref
- Goal: Issue 起票から PR merge / follow-up Issue 作成までの AI 作業過程を、raw transcript を公開せずに GitHub 上へ永続保存し、人間が
agent_run_report/v1とagent_retro_index/v1を読ませて改善相談できる状態にする。 - Desired Destination: manifest 本文禁止と report/index の条件付き public comment 許可を、schema / validator / marker upsert guard と整合する docs 境界として固定し、historical な実行可能 surface が current public posting と誤読されない状態にする。
Current Validated Scope
docs/dev/session-recording-policy.mdとdocs/dev/onboarding/session-recording-tool.mdを、agent_session_manifest/v1とagent_run_report/v1/agent_retro_index/v1の public surface を別物として読めるように更新する。- 上記 2 文書で、manifest 本文禁止 / opaque ref のみ許可 / trusted context 限定 / hook 非 security boundary /
private artifact再定義 /artifact_urlの retention-limited non-canonical 性を current policy として固定する。 docs/schemas/agent-session-manifest.mdの comment template /phase_instance_id/ visibility 説明を current schema と current workflow に合わせ、manifest 本文の live public posting 許可として誤読されないようにする。docs/dev/schema-governance.mdに、実装: #928 導入前に session-recording policy と report公開境界の drift を解消する #934 が public-surface boundary cleanup であり、report/index schema の正式登録は 実装: agent_run_report/v1 / agent_retro_index/v1 schema・fixtures・public-safe validator を追加する #935 で扱うことを追記する。scripts/generate-session-manifest.mjsとtests/agent-session-manifest.test.tsを更新し、github-commentsurface を current public posting の正規経路として扱わないことを help / example / test 上でも明確化する。.claude/scripts/check_session_recording_policy.pyを更新し、新設public_surfaces.github_issue_or_pr_commentsubtree を fail-closed で検証する。
Remaining Parent Gaps
-
agent_run_report/v1/agent_retro_index/v1の schema と invalid fixture は 実装: agent_run_report/v1 / agent_retro_index/v1 schema・fixtures・public-safe validator を追加する #935 で固定する。 - agent run lifecycle scripts と package scripts は 実装: agent run lifecycle scripts と package scripts を追加する #936 で実装する。
- GitHub comment marker upsert と public-safe posting guard は 実装: GitHub Issue / PR marker upsert と public-safe posting guard を追加する #937 で実装する。
- retro index workflow、ChatGPT export、docs / skill handoff、EntireCLI safety は 実装: agent_retro_index/v1 の canonical parent marker と trusted post-merge workflow を追加する #938-実装: EntireCLI safety checker と conditional adoption guard を追加する #941 で扱う。
Outcome
session-recording 系 SSOT と実行可能 surface が、「manifest 本文は Issue / PR comment に出さず、opaque ref のみ許可する」「redacted report/index は #935 schema/redaction validator と #937 exact marker upsert guard 通過後に限り conditional public comment 可」「#934 merge 時点では live public posting はまだ禁止」「historical manifest comment surface は current public posting の根拠に使えない」と一貫して読める状態に更新され、対象 VC と checker が通る状態。
In Scope
- manifest body と run report / retro index の public surface 方針を別物として説明する。
Issue / PR comment への manifest 本文出力禁止とopaque ref のみ許可を docs / schema prose / checker に固定する。phase_instance_idの CI-native 記述 drift を current repo reality に合わせる。private artifactを secret-safe ではなく retention-limited non-comment surface として再定義する。artifact_urlを retention-limited / auth-dependent / non-canonical locator として説明する。- report/index posting の trusted context / minimal write permission / hook 非 security boundary を docs に固定する。
- 古い pilot wording や legacy template を historical context に降格し、current public surface の正本と競合させない。
scripts/generate-session-manifest.mjsのgithub-commentformat を historical / legacy fixture surface へ降格するか、current public posting surface ではないことを help / example / output contract 上で明示する。tests/agent-session-manifest.test.tsを current boundary と整合するよう更新する。.claude/scripts/check_session_recording_policy.pyに新 policy subtree の exact assertion を追加する。
Out of Scope
agent_run_report/v1/agent_retro_index/v1schema 本体の追加。- GitHub comment upsert 実装。
- raw transcript や manifest 本文の public comment 公開。
- research/pilot: AI 駆動 session 記録 pilot smoke test (manifest 整合性 / Kill Switch 動作 / Secret 漏れ検査) #246 など Allowed Paths 外の historical issue / docs の直接更新。
- report/index posting validator の full invalid fixture 群追加(実装: agent_run_report/v1 / agent_retro_index/v1 schema・fixtures・public-safe validator を追加する #935 の責務)。
Acceptance Criteria
- AC1:
manifest bodyとrun report / retro indexの public surface 方針が別物として説明されている。 - AC2:
Issue / PR commentではagent_session_manifest/v1の body が禁止され、artifact ref / digest / validation verdict などの opaque ref のみ許可されると明記されている。 - AC3:
agent_run_report/v1/agent_retro_index/v1は 実装: agent_run_report/v1 / agent_retro_index/v1 schema・fixtures・public-safe validator を追加する #935 schema/redaction validator と 実装: GitHub Issue / PR marker upsert と public-safe posting guard を追加する #937 exact marker upsert guard 通過後のみ conditional public comment 可であり、実装: #928 導入前に session-recording policy と report公開境界の drift を解消する #934 merge 時点では live public posting 禁止と明記されている。 - AC4:
phase_instance_idの記述がissue-<N>:<main_loop_phase>:<seq>とci:<producer_slug>:<run_id>:<run_attempt>の current schema reality に一致している。 - AC5:
private artifactが secret-safe を意味しない retention-limited non-comment surface であり、public repo では content も public-safe である必要があると再定義されている。 - AC6: public comment posting は trusted context 限定、
pull_request_target不使用、top-level read-only baseline と posting job 限定の最小 write permission を要求すると明記されている。 - AC7: hook は diagnostic / prevention layer であり、report/index の public-safe 判定正本は post-run validator + posting guard と明記されている。
- AC8: legacy comment template や historical pilot wording が historical / non-current / not live public posting として扱われ、current live public posting 許可の根拠にならないと明記されている。
- AC9:
scripts/generate-session-manifest.mjsのgithub-commentsurface が current public posting の正規経路と誤読されない help / example / output になっている。 - AC10:
tests/agent-session-manifest.test.tsが current boundary に一致し、historical comment surface を current public posting 許可として検証しない。 - AC11:
.claude/scripts/check_session_recording_policy.pyがpublic_surfaces.github_issue_or_pr_comment.agent_session_manifestと report/index subtree を exact assertion し、旧agent_session_manifest_allowed: true相当の戻りを fail-closed で検知できる。
Verification Commands
# AC1
# baseline-expect: pass
$ rg -n "manifest body|agent_run_report|agent_retro_index|public surface|opaque ref" docs/dev/session-recording-policy.md docs/dev/onboarding/session-recording-tool.md docs/schemas/agent-session-manifest.md
# AC2
# baseline-expect: pass
$ rg -n "body_allowed: false|manifest 本文.*(禁止|出さない)|opaque ref|artifact_digest|validation_verdict" docs/dev/session-recording-policy.md docs/dev/onboarding/session-recording-tool.md docs/schemas/agent-session-manifest.md
# AC3
# baseline-expect: pass
$ rg -n "#935|#936|#937|conditional public comment|live public posting|exact marker upsert guard|dry-run" docs/dev/session-recording-policy.md docs/dev/onboarding/session-recording-tool.md docs/dev/schema-governance.md
# AC4
# baseline-expect: pass
$ rg -n "issue-<N>:<main_loop_phase>:<seq>|ci:<producer_slug>:<run_id>:<run_attempt>|ci:session-manifest:" docs/dev/session-recording-policy.md docs/schemas/agent-session-manifest.md
# AC5
# baseline-expect: pass
$ rg -n "private artifact|retention-limited|non-comment surface|secret-safe|public-safe|non-canonical" docs/dev/session-recording-policy.md docs/dev/onboarding/session-recording-tool.md docs/schemas/agent-session-manifest.md
# AC6
# baseline-expect: pass
$ rg -n "trusted context|pull_request_target|issues: write|pull-requests: write|contents: read" docs/dev/session-recording-policy.md docs/dev/onboarding/session-recording-tool.md
# AC7
# baseline-expect: pass
$ rg -n "security boundary ではない|post-run validator|posting guard|diagnostic|prevention" docs/dev/session-recording-policy.md docs/dev/onboarding/session-recording-tool.md
# AC8
# baseline-expect: pass
$ rg -n "historical|non-current|not live public posting|legacy" docs/dev/onboarding/session-recording-tool.md docs/schemas/agent-session-manifest.md docs/dev/session-recording-policy.md
# AC9
# baseline-expect: pass
$ rg -n "github-comment|historical|legacy|not live public posting" scripts/generate-session-manifest.mjs tests/agent-session-manifest.test.ts
# AC10
# baseline-expect: pass
$ rg -n "github-comment|artifact_digest|opaque ref|historical" tests/agent-session-manifest.test.ts
# AC11
# baseline-expect: pass
$ python3 .claude/scripts/check_session_recording_policy.py docs/dev/session-recording-policy.mdAllowed Paths
docs/dev/session-recording-policy.mddocs/dev/onboarding/session-recording-tool.mddocs/schemas/agent-session-manifest.mddocs/dev/schema-governance.mdscripts/generate-session-manifest.mjstests/agent-session-manifest.test.ts.claude/scripts/check_session_recording_policy.py
Runtime Verification Applicability
decision: not_applicable
reason: "docs / script help / checker / schema prose 更新であり、browser runtime や external service 実行を成功条件に含まない"Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- report/index schema 本体や posting guard 実装まで同一 PR に押し込む必要があると判明した場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- current boundary の claim を docs / checker / executable surface の 3 層で同時に揃えられないと判明した場合
Required Skills
なし
Scope Delta(任意)
- review comment docs(#934): fix session recording public surface boundary #951 (comment) を一次ソースとして、docs-only から docs + executable surface compatibility repair へ scope を拡張した。
Delivery Rule
1 Issue = 1 PRで完了する。- Draft PR を既定とする。
- 実装: agent_run_report/v1 / agent_retro_index/v1 schema・fixtures・public-safe validator を追加する #935 以降の child は本 Issue の boundary / checker / historical surface 確定後に着手する。
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentarea/ai-opsAI operations and agent tooling areaenhancementNew feature or requestphase/implementationImplementation phaseprocessProcess / template changes
Activity
[-]docs: #928 導入前に session-recording policy と report公開境界の drift を解消する[/-][+]実装: #928 導入前に session-recording policy と report公開境界の drift を解消する[/+]squne121 commentedon Jun 15, 2026
判定
**REQUEST_CHANGES(Issue 契約の締め直し推奨)**です。
#934 の方向性は正しいです。#928 の導入順序どおり、
agent_run_report/v1/agent_retro_index/v1の schema・validator・posting guard を入れる前に、既存 session-recording docs の公開境界 drift を潰す child issue として妥当です。#934 自体にコメントはありません。ただし、このまま実装に渡すと docs 上は AC PASS なのに、読者や後続実装者が “manifest 本文を GitHub comment に出してよい” と再解釈する false green が起きます。現行 docs は実際に
agent_session_manifest_allowed: trueと書いており、schema docs には Issue/PR コメント用の manifest 本文テンプレートまで残っています。これは #934 の Outcome である「manifest 本文は Issue / PR comment に出さず、validator + marker guard 通過済みの redacted report/index だけを条件付き許可する」と正面衝突します。参照した関連 Issue / PR / コメント
#928 は親 delivery-rollup で、
agent_session_manifest/v1を provenance / validation / evidence index として残しつつ、ChatGPT 改善検討用にagent_run_report/v1/agent_retro_index/v1を追加する設計です。重要な固定決定は「manifest 本文は comment に出さない」「public 永続正本は Issue / PR comment の marker upsert」「artifacts は補助面」「raw transcript / local path / secret は public surface に出さない」です。#935〜#941 は依存列としてよく分割されています。#935 が schema / validator、#936 が lifecycle scripts、#937 が marker upsert / posting guard、#938 が retro index workflow、#939 が ChatGPT context export、#940 が docs / skill handoff、#941 が EntireCLI safety checker です。#934 はこの列の先頭にあり、後続 child が実装すべき安全境界を docs 上で曖昧にしてはいけません。
PR #314 は
agent_session_manifest/v1の JSON Schema Draft 2020-12 SSOT、fixtures、tests を導入し、public GitHub comment でtranscript/local_fileevidence を禁止する制約を入れた先行 PR です。PR #426 は hook wrapper とsession-manifest.ymlを導入し、manifest JSON を stdout / workflow log / Issue comment / PR comment / git commit に出さず artifact に置く方針を実装した先行 PR です。#136 と #246 も重要です。#136 の元課題は、AI が AC を読んだか、test-runner を呼んだか、SKIP/fallback を見逃したか、token/context 圧迫が起きたかを後から検証できないことでした。#246 は session recording pilot の smoke test で、AI self-report による false green を防ぐため authoritative producer / negative control / Kill Switch / secret scan を要求しています。
Blocker 1: manifest body public comment 境界がまだ自己矛盾している
#934 は「manifest body」と「run report / retro index」の public surface 方針を別物として説明する Issue です。しかし現行
session-recording-policy.mdはgithub_issue_comment.agent_session_manifest_allowed: trueとし、公開コメントには session metadata summary を置く、と読める状態です。さらに
docs/schemas/agent-session-manifest.mdには “Issue/PR コメントに agent_session_manifest を記録する際は…” という manifest 本文テンプレートが残っています。これは過去の schema docs としては理解できますが、#928 / #934 導入後の運用 docs としては危険です。後続の AI 実装者はこのテンプレートを根拠に、manifest 本文を再び public comment に貼る可能性があります。修正要求: #934 の実装では、単に「report/index は条件付き可」と追記するだけでは不足です。既存の
agent_session_manifest_allowed: trueと “GitHub Comment テンプレート” を、少なくとも以下の意味に置換してください。Blocker 2:
phase_instance_idの docs drift は実害がある#934 の AC4 は妥当です。現行 schema の実体は
issue-<N>:<phase>:<seq>とci:<producer_slug>:<run_id>:<run_attempt>の 2 形式を受け付けています。producer_slugは workflow name ではなく schema-safe な固定 slug、例session-manifestです。一方、
session-recording-policy.mdには「CI ではissue-432:impl:<seq>を生成し、rawci:<workflow>:<run_id>:<run_attempt>は current schema / validator では受け付けない」と残っています。これは現在の schema / workflow と逆です。実際の workflow は
ci:session-manifest:${{ github.run_id }}:${{ github.run_attempt }}を使って artifact を生成しています。修正要求: docs の記述を以下に寄せるべきです。
Blocker 3: “private artifact” という語が secret-safe に見える
#934 の AC5 は重要です。現行 policy にはすでに、「private artifact channel」とは Issue / PR comment ではない retention-limited GitHub Actions artifact であり、public repo では REST API 経由で公開アクセス可能、content は public-safe contract を満たす必要がある、と明記されています。
GitHub Actions artifacts はデフォルトで 90 日保持され、public repository では保持期間を 1〜90 日の範囲で設定できます。
actions/upload-artifactはartifact-id/artifact-url/artifact-digestを出力できますが、hidden files を含める場合は sensitive information を upload しないよう検証する必要がある、と公式 README も注意しています。([GitHub Docs]1) ([GitHub]2)修正要求: #934 では
private artifactを次のように再定義してください。可能なら docs prose では
private artifact単独表現を避け、non-comment retention-limited artifactを併記してください。Blocker 4: #934 は docs-only なので “安全実装済み” と読ませてはいけない
#934 の Allowed Paths は docs と schema prose に限定されています。schema 本体、validator、posting guard は #935 / #937 です。したがって #934 が merge された時点で
agent_run_report/v1/agent_retro_index/v1を public comment に live post してよい、という意味になってはいけません。現行 manifest validator の pattern scan は
/home/,/Users/,/tmp/,.env,sk-,gh[pousr]_, private key, expanded env assignment などに限定されています。#935 が要求しているgithub_pat_,AKIA, Windows path,file://,.env.local,.claude/settings.local.json,VITE_SECRET_KEY, duplicate marker, fence breakout などは、まだ report/index 用 validator の責務です。修正要求: #934 の docs に次を明記してください。
Blocker 5: marker upsert は
gh ... --edit-lastでは成立しないGitHub CLI の
gh pr comment --edit-lastは “current user の最後のコメント” を編集する機能であり、marker-addressed upsert ではありません。GitHub REST の issue comments endpoint は Issue と Pull Request の comment を扱えます。GitHub Docs も “every pull request is an issue” と説明しています。([GitHub CLI]3) ([GitHub Docs]4)#937 は正しく、list → exact marker search → 0 件 create / 1 件 update / 2 件以上 fail closed を要求しています。#934 側の docs でも、後続の public comment 許可条件に “exact marker upsert guard” を入れるだけでなく、
--edit-lastや曖昧 grep による更新を非正規経路として明示的に退けるべきです。推奨 marker は #937 の形式を維持しつつ、body 内 user-provided markdown に混入した marker を信頼しない ownership check を必須にすることです。
<!-- agent_run_report:v1 repo=squne121/loop-protocol issue=<N> pr=<N|null> run_id=<id> sha256=<digest> -->Blocker 6: workflow write 権限の境界を docs にも固定する必要がある
GitHub Actions の
permissionsは top-level / job-level で指定でき、pull_request_targetでは public fork 由来でもGITHUB_TOKENが read/write repository permission を持ち得ます。したがって report/index posting workflow は untrusted PR context で write 権限を持たせてはいけません。([GitHub Docs]5)現行
session-manifest.ymlはpermissions: contents: readで artifact 生成のみを行い、manifest を stdout / log に出さず、artifact に upload しています。この既存設計は #938 の “trusted workflow_dispatch / post-merge context only, no pull_request_target, job-level minimal write permission” と整合させるべきです。修正要求: #934 の docs boundary に次の一文を入れるべきです。
Blocker 7: EntireCLI は “採用” ではなく “unsafe config 検出対象” として扱うべき
EntireCLI は prompts / transcripts / tool calls / file changes / metadata を capture し、checkpoint data を通常の git workflow に紐付けます。公式 docs では checkpoint metadata が
entire/checkpoints/v1branch に保存され、デフォルトでは code remote に push されるが checkpoint remote で別 repo に出せる、と説明されています。([Entire]6)Entire の security docs はさらに強く、public repo なら transcript branch も public になり、redaction は best-effort であり、shadow branch の code-file snapshot は raw blob なので hardcoded secret があれば unredacted で残り得る、と説明しています。([Entire]7)
既存 onboarding も Hook-based metadata ledger を Adopt、EntireCLI local/private/no-push 構成を Conditional、public checkpoint 構成を Reject としています。
修正要求: #934 では EntireCLI を report/index 永続化の中核にしないでください。#941 のとおり、
not_applicable | safe | blockedの safety checker として扱い、unknown visibility / token env / pushurl rewrite / checkpoint branch が見えたら fail closed する、という位置づけが妥当です。Blocker 8: Claude / Codex hook は security boundary ではない
現行 policy はすでに、Codex の
PreToolUse/PermissionRequestは予防層であり security boundary ではなく、canonical final gate は post-run verifier と private artifact validation だと明記しています。Claude Code の SubagentStop hook input は
transcript_path,agent_transcript_path,last_assistant_messageを含みます。これは便利ですが、同時に transcript path や last assistant message を不用意に report generator が取り込む入口にもなります。([Claude Code]8)Codex hooks については、OpenAI developer docs が “同一 event の複数 matching command hooks は concurrently launched” と説明しています。順序や short-circuit に依存する設計は避けるべきです。([OpenAI 開発者]9)
修正要求: #934 の docs にも、hook は diagnostic/prevention であり、report/index の public-safe 判定は post-run validator + posting guard が正本、という線を入れてください。これは #940 だけに後回しにすると、#935〜#938 の実装時に hook を security boundary と誤読する余地が残ります。
Blocker 9: #246 の古い “manifest を comment に記録” 文言が将来の衝突源になる
#246 には、各 phase で
agent_session_manifest/v1を GitHub Issue / PR comment に記録する、という古い pilot 文脈の記述が残っています。一方、#928 / #934 は manifest 本文を comment に出さず、redacted report/index を条件付き public comment にする方針です。これは #934 のスコープで #246 を編集しろ、という意味ではありません。しかし #934 docs には「#246 の pilot wording は historical context であり、#928 導入後の current public surface は manifest ref + report/index」と明記しないと、レビュー時に #246 が manifest comment 許可の根拠として再利用されます。
高品質化した #934 実装方針
#934 は docs-only なので、実装内容は次の 4 点に絞るのがよいです。
docs/dev/session-recording-policy.mdのpublic_surfacesを、manifest / report / index の 3 面に分ける。manifest は body 禁止、opaque ref のみ許可。report/index は 実装: agent_run_report/v1 / agent_retro_index/v1 schema・fixtures・public-safe validator を追加する #935 + 実装: GitHub Issue / PR marker upsert と public-safe posting guard を追加する #937 通過後のみ conditional allowed。docs/dev/onboarding/session-recording-tool.mdから “manifest を public comment に記録する” と読める文を削るか、historical / non-current / not live public posting と注釈する。既存の raw transcript / local_file / secret 禁止は維持する。docs/schemas/agent-session-manifest.mdの GitHub Comment template を “legacy schema example; live Issue/PR comment に貼らない” に降格するか、manifest body public posting 禁止セクションに置換する。現行 schema のevidence.visibility: public_github_comment制約は、manifest 本文公開許可ではなく “evidence entry の visibility 制約” として説明し直す。docs/dev/schema-governance.mdには full schema 登録ではなく、実装: agent_run_report/v1 / agent_retro_index/v1 schema・fixtures・public-safe validator を追加する #935 でagent_run_report/v1/agent_retro_index/v1を正式登録する予定であることと、実装: #928 導入前に session-recording policy と report公開境界の drift を解消する #934 は public-surface boundary cleanup であることを追記する。schema consumer inventory のルール上、consumer-facing contract を変える PR では consumer 列挙と未対応 blocker の扱いが必要です。Acceptance Criteria の強化案
現行 AC は方向性として妥当ですが、
rgで positive match だけを見ると false green になります。negative check を追加してください。推奨 verdict
結論として、#934 は必要です。ただし「少し追記する docs cleanup」ではなく、過去の manifest public comment 設計を明示的に廃止し、report/index の conditional public surface に置き換える境界変更 Issue として扱うべきです。これを曖昧にしたまま #935〜#938 に進むと、validator や marker guard が正しくても、docs を根拠にした public leak 経路が残ります。
squne121 commentedon Jun 15, 2026
issue-refinement-loop により #934 本文を更新しました。
phase_instance_idの current schema reality、private artifactの再定義、trusted context / minimal write permission、hook 非 security boundary を明示pnpm lintとrgallowlist に収め、AC/VC alignment を再調整squne121 commentedon Jun 15, 2026
Refinement Loop: Approved
The issue has been approved and is ready for implementation.
approvedsqune121 commentedon Jun 15, 2026
Contract Review Result
docs(#934): restore policy checker compatibility
fix(#934): retire live github-comment manifest surface
docs(#934): fix session recording public surface boundary (#951)