Skip to content

docs: agent-retrospective の run boundary・source authority・mutation boundary を ADR 0007 として確定する - #2253

Merged
squne121 merged 5 commits into
mainfrom
worktree-issue-2234-agent-retrospective-adr-run-boundary-sou
Aug 19, 2026
Merged

squne121 merged 5 commits into
mainfrom
worktree-issue-2234-agent-retrospective-adr-run-boundary-sou

Conversation

@squne121

Copy link
Copy Markdown
Owner

Summary

agent-retrospective Skill(#2192)の Child 1 として、docs/adr/0007-agent-retrospective-boundaries.md を新規追加し、run consistency model(bounded observation)、claim-class 単位の source authority と conflict taxonomy、threat/trust matrix、mutation boundary(artifact-publication mutation と remediation の区別)、optimistic concurrency と idempotency の区別、public/private artifact 境界(allowlist モデル)、既存 agent_retro_index/v1 との責務分離を normative decision table として確定した。docs/dev/agent-skill-boundaries.md には本 ADR への参照リンクを additive に追記した。

本 PR は Issue #2234 を解消するため、本文末尾でクローズを宣言する(Closes #2234)。

Checks

以下の検証コマンドを実行し、いずれも合格した。

Schema Change Applicability

Schema Consumer Inventory

N/A(Schema Change Applicability: not_schema_change のため対象なし)

Safety Claim Matrix

N/A(reason: 本 PR は docs/adr/ と docs/dev/ 配下の Markdown ドキュメントのみを変更し、transport / permission / sandbox / auth / mcp / .claude/skills/ / .github/workflows/ のいずれにも該当しない safety-sensitive でない変更のため)

Notes

…undary を ADR 0007 として確定する (#2234)

継続的 retrospective Skill(#2192)の Child 2〜6 が参照する normative decision table
として、bounded observation・claim-class 単位の source authority・threat/trust
matrix・mutation boundary(artifact-publication と remediation の区別)・
optimistic concurrency と idempotency の区別・public/private artifact 境界
(allowlist モデル)・既存 agent_retro_index との責務分離を ADR 0007 として新規追加し、
docs/dev/agent-skill-boundaries.md に参照リンクを additive に追記する。

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Preview URL

✅ verified live assets: https://squne121.github.io/loop-protocol/pr-2253/

The preview will be removed when this PR is closed.

PR #2253 iteration 2 の REQUEST_CHANGES blocker(frontmatter block と 8 見出し block が
日本語比率不足で FAIL)を修正する。見出しへの日本語併記と frontmatter への summary_ja
追加により、validate_japanese_content.py の全 47 prose block が pass する(#2234)。
…nese Check を解消する

docs/dev/agent-skill-boundaries.md に additive 追記した ADR 0007 参照セクションの見出しが
英語のみ(日本語比率 1/67=0.015)で threshold 0.1 を下回っていたため、
run boundary / source authority / mutation boundary の各語に日本語訳を併記した。
@squne121

Copy link
Copy Markdown
Owner Author

結論

Verdict: REQUEST_CHANGES
Recommended disposition: Draft 維持。Ready化・merge はまだ行わない。

機械的状態についてはユーザー報告と一致しました。PR #2253 は現在も Draft、head は 9c87f2f6abdd133e775c0e8dda5d0f7381ecf3ed、GitHub API 上 mergeable: true / mergeable_state: clean です。main も PR が基準としている e8323222... のままです。

ただし、CLEAN/MERGEABLE と CI green は「Git と CI が受理可能」という証明で、ADR の意味論が親契約・既存 control-plane・外部セキュリティモデルと整合することの証明ではありません。今回の ADR は Child 2〜6 の normative contract になるため、この差は merge blocker と判断します。

  1. P0 — artifact-publication mutation の自動許可が Parent 導入: Claude-GPT運用ログの継続的レトロスペクティブと改善提案を行う agent-retrospective Skill を確立する #2192 の固定契約と矛盾しています。 ADR 0007 は retrospective run の Issue comment 投稿について「事前承認不要、自動投稿可」と明記しています。 一方、Parent 導入: Claude-GPT運用ログの継続的レトロスペクティブと改善提案を行う agent-retrospective Skill を確立する #2192 は現在も retrospective run を proposal-only とし、Issue/PR/repository mutation は人間判断後に controlled executor へ routing することを固定しています。 元の OWNER adversarial review も「Issue 作成・Issue body 更新等は明示的人間判断後」と要求していました。 実装: agent-retrospective の ADR で run boundary・source authority・mutation boundary・public/private artifact 境界を確定する #2234 の OWNER review は「artifact publication を自動許可するか人間承認にするかを ADR で固定せよ」とは述べていますが、「自動許可へ変更してよい」という parent-level scope decision までは与えていません。 Child 1 が Parent の safety contract を暗黙に緩和する形になっています。修正は二択で、ADR を Parent に合わせて artifact publication も human-authorized にするか、OWNER directive を得て 導入: Claude-GPT運用ログの継続的レトロスペクティブと改善提案を行う agent-retrospective Skill を確立する #2192 の Goal/AC8/mutation policy を先に同期変更してから ADR を accepted にするべきです。

  2. P0 — issue_intent の「Issue body が常に comments より authority」という規則が、このリポジトリ自身の trusted-anchor model と矛盾します。 ADR は body/comment が semantic disagreement の場合に「body を優先」と固定しています。 しかし issue-refinement-loop は OWNER|MEMBER|COLLABORATOR の trusted anchor comment を authority evidence として扱い、scope/contract update の入力にする設計です。 しかも 実装: agent-retrospective の ADR で run boundary・source authority・mutation boundary・public/private artifact 境界を確定する #2234 自身が、OWNER の REQUEST_CHANGES / reframe_in_place comment を trusted human-context anchor として採用し、その comment を根拠に Issue body を全面 rewrite したと記録しています。 つまり body が rewrite される前の時間窓では、ADR の規則だと stale body が最新 OWNER directive に勝ちます。issue_intent は body > comments ではなく、current body + typed trusted-directive/anchor events + temporal supersession としてモデル化すべきです。untrusted comment は intent authority に昇格させず、trusted provenance を持つ directive のみ contract delta authority にするのが既存設計と整合します。

  3. P0 — review_decision が GitHub Review・review comment・通常 PR comment・impl-review-loop verdict を一つに混同しています。 ADR は authority を GitHub (PR review/comment API) と一括しています。 GitHub では Pull Request Review、diff 上の review comment、通常の PR timeline comment は別オブジェクトです。通常の timeline comment は Issue Comments API、diff comment は Review Comments API、review state は Reviews API が所有します。 ([GitHub Docs]1) さらに、この repository の impl-review-loop は native gh pr review を使わず、pr-reviewer の LOOP_VERDICT を control-plane が通常の PR commentとして監査投稿する独自モデルです。 実際、現在の PR docs: agent-retrospective の run boundary・source authority・mutation boundary を ADR 0007 として確定する #2253 の GitHub Reviews endpoint は [] です。 したがって少なくとも internal_loop_review_verdict、github_native_review_state、review_comment、mergeability を別 claim class に分割し、reviewed_head_sha・object ID・provenance を保持する必要があります。

  4. P0 — そのうえ、今回報告された APPROVE の canonical audit comment が PR 上にありません。 impl-review-loop の Step 4 は、pr-reviewer の verdict を control-plane が通常の gh pr comment で投稿し、verdict / reviewed_head_sha / blockers / warnings を残すことを規範化しています。 現在取得できる PR conversation は Preview URL を投稿した bot comment 1件だけで、semantic verdict comment は確認できません。 Native Review が空なのは設計上問題ではありませんが、独自 review verdict の代替となる audit comment まで無いのは問題です。少なくとも current head 9c87f2f6... に束縛した final LOOP_VERDICT を永続化してから draft_pr_ready とすべきです。

  5. P0 — threat matrix の「untrusted content はテキストとして LLM context に渡せばよい」が弱すぎます。 ADR は shell/tool argument への直接連結を禁止する一方、Issue/PR/comment 等を「テキストとしてのみ LLM コンテキストに渡す」としています。 しかし prompt injection ではテキストとして LLM に入ること自体が攻撃経路です。Claude Code の現行公式 security guidance は untrusted content を直接 Claude に pipe しないことを推奨し、Web Fetch では injection を避けるため別 context window を使っています。 (Claude) GitHub も Issue/PR body、title、ref、branch name 等を potentially untrusted としています。 ([GitHub Docs]3) この ADR なら Child 4/6 は「raw malicious text を evaluator/orchestrator context に入れてよい」と実装できてしまいます。deterministic extraction → provenance/taint → isolated observation context → structured projection → privileged evaluator/control-plane という境界まで normative にした方がよいです。少なくとも raw untrusted payload を authorization/synthesis を行う main context に直接投入しないことを明文化すべきです。

  6. P0 — schema-controlled projection だけでは public-safe を保証できず、自動投稿との組み合わせで leak path になります。 ADR は「schema に定義された field だけなら public 化可」という allowlist を主要防御にしています。 JSON Schema の additionalProperties は object の property set を制限する仕組みで、許可済み string field の中身が secret、absolute path、PII、private GitHub content、prompt payload かどうかを自動的に安全化するものではありません。文字列内容を制限するには pattern 等の value-level constraint が別途必要です。 ([JSON Schema]4) 例えば friction_summary: "Authorization: Bearer ..." は field 名として合法でも confidential です。field allowlist + value-level public-safety validator/redaction/taint policy の二層にすべきです。とくに P0-1 の「自動 Issue comment 投稿」と組み合わせるなら merge 前に不可欠です。

  7. P1 — 実装 handoff の Final Gate 証跡が欠落しています。 実装: agent-retrospective の ADR で run boundary・source authority・mutation boundary・public/private artifact 境界を確定する #2234 の refinement 終了時点では明示的に status: blocked / gate_result: missing_go で、「issue-contract-review を current body に対して実行してから implementation handoff」と記録されています。その次の Issue comment は既に implement-issue: 実装完了 です。 repository の termination policy は issue-contract-review status: go がない状態から impl-review-loop への handoff を禁止しています。 GitHub 上からはその間の fresh go を検証できません。ローカル artifact にだけ存在する可能性は否定できませんが、それなら current body SHA と結び付いた durable evidence を公開/永続化する必要があります。これは ADR 内容とは別の merge-process blocker です。

  8. P1 — bounded observation は方向性は正しいものの、timestamp semantics が曖昧です。 observed_from/until を「収集開始終了 wall-clock または API resource の更新時刻範囲」と同じ field に入れており、acquisition window と resource-event window が混ざっています。 GitHub REST の pagination は Link header を辿るモデルで、conditional GET では ETag/Last-Modified が使われます。 ([GitHub Docs]5) 後続 schema では fetch_started_at/fetch_completed_at と resource_updated_at_min/max を分離し、endpoint、API version、query params、page size、Link traversal completeness、ETag を持たせる方が再現性が高いです。

Child Issue の同期については、以前の P0 の多くは改善済みです。#2235 は source_observations、#2238 は idempotency と optimistic concurrency の分離まで既に反映されています。 一方 #2239 の redaction AC は依然 raw transcript / secret / absolute local path が中心で、ADR が非公開対象に追加した private GitHub content、PII、environment values、credential-bearing URL、stdout/stderr、prompt-injection payload まで deterministic に検証する契約にはなっていません。 ここも ADR 修正後に同期すべきです。

Merge 前に必要な状態

最小修正セットは、#2192 と artifact-publication authorization の整合を確定、issue_intent と review_decision の authority matrix を既存 control-plane に合わせて再設計、untrusted LLM context と public projection に value-level safety boundary を追加、#2239 を同期、fresh contract-review go と final LOOP_VERDICT comment を durable に残す、です。

そこまで修正した current head に対して CI → pr-review-judge → live MERGEABLE/CLEAN を取り直せば、APPROVE / blockers: [] はかなり強い merge-ready 証明になります。現 9c87f2f6 は GitHub 上は CLEAN ですが、semantic/policy review としては merge-ready ではありません。

…反映する

PR #2253 への OWNER REQUEST_CHANGES
(#2253 (comment))
を反映し、docs/adr/0007-agent-retrospective-boundaries.md を修正する。

- P0-1: artifact-publication mutation の human authorization point を
  「事前承認不要」から「事前の人間承認が必要(proposal-only)」に修正
  (Parent #2192 の固定契約との矛盾を解消)
- P0-2: issue_intent の claim-class authority を「body が常に優先」から
  「current body + trusted directive/anchor events + temporal supersession」
  にモデル化し直す(issue-refinement-loop の trusted anchor 設計と整合)
- P0-3: review_decision を internal_loop_review_verdict /
  github_native_review_state / review_comment / mergeability の
  4 claim_class に分割(GitHub API object の違いと本 repo 固有の
  impl-review-loop モデルを反映)
- P0-5: threat/trust matrix に deterministic extraction -> provenance/taint
  付与 -> isolated observation context -> structured projection ->
  privileged evaluator/control-plane の多段境界を追記
  (untrusted content をテキストとして LLM context に渡すこと自体が
  攻撃経路になる点を明記)
- P0-6: public/private artifact 境界を field allowlist と
  value-level public-safety validator の二層防御として明記
- P1-8: bounded observation の evidence metadata を
  fetch_started_at/fetch_completed_at(acquisition window)と
  resource_updated_at_min/resource_updated_at_max(resource-event window)
  に分離、endpoint/api_version/page_size も追加

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@squne121
squne121 marked this pull request as ready for review August 19, 2026 10:33
@squne121
squne121 merged commit 5f26a1f into main Aug 19, 2026
42 checks passed
@squne121
squne121 deleted the worktree-issue-2234-agent-retrospective-adr-run-boundary-sou branch August 19, 2026 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

実装: agent-retrospective の ADR で run boundary・source authority・mutation boundary・public/private artifact 境界を確定する

1 participant