Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "#1890"
goal_ref: "anchor comment の全文・話者分離・取得完全性を維持したまま、owner turn は chronology metadata として保持するに留め(precedence/authorization には昇格させない)、競合する重い mutation だけを owner reaction へ保留する。同じ provenance 分離(human_supplied vs controlled_agent_report、呼び出し元引数で分類)を impl-review-loop の intake / capsule / preparation / Step 1 delegation へも伝搬する。"
change_kind: workflowParent Issue
Parent Goal Ref
#1890 の anchor comment 読了保証・話者分離・supersession 検出を維持し、複数ターンであること自体を hard blocker にしない最小の continuation を追加する。
Current Validated Scope
anchor_context.pyの既存分節・話者判定・source span・区間和集合による取得完全性を再利用する。run_refinement_preflight.pyの_apply_multi_turn_candidate_route()と blockering を、trusted OWNER segment が存在する場合の advisory route へ限定して変更する。- root control-plane が競合時に controlled comment lane で選択肢を投稿し、repository owner の reaction を readback して競合 mutation だけを適用できる手順を Skill / reference に定義する。
impl-review-loopのbuild_intake_capsule.pyは既に Issue コメントを全ページ取得しauthor_id/author_type/author_associationを保持している。この既存取得結果に、呼び出し元が明示指定した human context / agent report の comment ID を additive に紐付ける(新規 fetch 経路は追加しない)。
Remaining Parent Gaps
- 実装: Codex skill surface を root directory symlink に置換する #1926 の Codex CLI directory symlink 配線とその parity は本 Issue の対象外のまま残す。
- 導入: AIエージェント運用をminimal harnessへ縮退し、過剰なcontrol-planeを廃止する #1860 の minimal-harness 方針との整合は、新規 schema・ledger・publisher を追加しないことで維持し、必要な将来判断は 導入: anchor commentの部分読み込みによる後続結論の見落としを防ぐ読了保証・supersession検出を導入する #1890 に残す。
Outcome
trusted OWNER を含む multi-turn anchor が、取得完全性・trusted author・heavy mutation gate を保ったまま warn / proceed_with_notes と最後の owner segment の chronology metadata を返し、競合時だけ owner reaction 待ちへ遷移する実装と回帰テストが完成している。同じ human_supplied / controlled_agent_report 分離が impl-review-loop の intake capsule・preparation・Step 1 delegation まで一貫して伝搬し、raw human comment が worker への実行命令として直接連結されないことが production-shaped test で検証されている。
Background
現在は marker 付き segment が2件以上かつ候補が複数なら、候補間の意味関係を判定せず ANCHOR_MULTI_TURN_FAIL_CLOSED として停止する。#1891 / PR #1923 により全文処理・話者分離・source span は既に実装済みである。
本 Issue は当初、最後の owner segment を primary resolution input として precedence 付ける設計だった。この前提は誤りとして棄却する。 指定 anchor comment(#1950 コメント、2ターンの敵対的レビュー)により、以下が事実として確認され、矛盾なく反映する:
- 最後の owner turn という chronology の事実 と、その turn が持つ semantic relation(追加・撤回・置換・質問・仮定)、technical recommendation、mutation authorization は別軸であり、chronology だけで残り三者を決定してはならない。
latest_owner_turnは参考メタデータとして normalized context に残すが、precedence や authorization の根拠にはしない。 - 人間が投稿したコメントと、SubAgent が返した構造化 report は、本文解析(
author_association: OWNER・構造化 marker の有無・投稿アカウント)では分類できない。同一アカウントから機械生成コメント(例:create-issue transaction partial-failure)と人間コメントが混在しうるため、呼び出し元が渡した引数(どの comment URL をどちらの引数として渡したか)だけを origin 判定根拠にする。 impl-review-loopは現在この provenance 分離を持たず、issue_number/contract_snapshot_url/max_iterationsのみを入力とする。Allowed Paths をこの Issue に含めない限り、ユーザー要求(issue-refinement-loopとimpl-review-loopの両方への適用)は半分しか実装されない。二重実装を避けるため、共通 resolver を別 child に切り出すのではなく、本 Issue にimpl-review-loopの intake / capsule / preparation / Step 1 delegation への additive 拡張を含める。- GitHub reaction API は排他的なラジオボタンではなく、reacting user と content を持つレコード一覧である。有効 principal は stable user ID で固定し、許可 reaction が一意に決まらない場合は unresolved として再評価に戻す。
speaker: ownerはそれ単体で mutation authorization にはならない(質問・希望・仮説・過去判断の説明でありうる)。技術推奨(repository facts・diff・test・外部仕様から control-plane が決定する)と、明示的な owner 承認(standalone owner decision または decision preview に束縛された reaction)は別に扱う。
新しい semantic classifier、decision ledger、独立 schema、publisher は追加しない。運用だけで multi-turn anchor を避ける workaround は、owner の自由記述を構造化させるため採用しない。
In Scope
issue-refinement-loop 側(既存)
- trusted OWNER の multi-turn anchor で最後の owner segment の index / source span を
latest_owner_turnとして normalized context に chronology metadata のみとして記録する(technical recommendation・mutation authorization の precedence には使用しない)。 - multi-turn + 複数候補だけを理由とする hard block を、既存 enum を用いた
warn/proceed_with_notesに置換する。 - previous owner turn の非競合文脈を保持し、quoted assistant turn 単独から close、replacement Issue 作成、dependency removal、parent-child change を承認しない boundary を明記する。
- material conflict 時の選択肢(最大3案)・推奨案・reaction mapping(+1 / eyes / rocket / -1)・drift readback・保留 mutation を Skill / reference に定義する。reaction は全ページ取得し、stable user ID で principal を固定し、有効 reaction が複数種類ある場合は unresolved として再評価に戻す。
- repository owner の有効 reaction が一意に解決できるまで、close / not planned / replacement Issue creation / dependency removal / parent-child change を適用しない。
- 既存 unit / subprocess regression を更新し、trusted owner multi-turn は advisory route、untrusted author・取得不完全・hash 不一致・source range 欠落は block を維持することを検証する。
impl-review-loop 側(追加、provenance 伝搬)
impl-review-loop/SKILL.mdの Inputs にhuman_context_comment_urls(repeatable、任意)・agent_report_comment_urls(repeatable、任意)を追加する。origin は本文・投稿アカウント・author_association・構造化形式から推測せず、root/main thread がどちらの引数として渡したかだけで決定する。同一 URL が両方へ渡された場合は provenance conflict として fail-closed にする。build_intake_capsule.pyに--human-context-comment-url/--agent-report-comment-url(いずれも複数指定可)を追加する。既存の全ページコメント取得結果から指定 comment ID を解決し、repo/Issue 番号一致、comment 実在、URL と API readback のhtml_url一致、human/agent 両 lane 非重複、updated_at/ body hash 固定、agent report の構造化 marker 検証を行う。- 既存
IMPL_REVIEW_INTAKE_CAPSULE_V1に、後方互換な optionalcontext_inputs(human_supplied/agent_generated/provenance_conflicts)section を追加する。指定コメント本文は capsule artifact 内に保存するが、stdout projection には出さない(既存の stdout 予算・非公開境界を維持する)。 preparation.mdに、context_inputs.human_suppliedは意味解析対象の自然言語データであり、context_inputs.agent_generatedは schema validation 後の構造化 advisory result であること、いずれも単独では mutation authorization を持たないこと、human context 全体を claim 単位で評価し最後の turn に自動 precedence を与えないこと、heavy mutation は独立した owner decision または decision preview に束縛された reaction を必要とすることを明記する。step-1-implementation.mdの worker delegation message に、root が正規化したtechnical_recommendationとcapsule_artifact_path/human_context_comment_ids/agent_report_comment_idsの evidence reference を追加する。raw human comment を worker への命令として直接連結しない。
Out of Scope
anchor_context.pyへの semantic relation classifier またはfinal_candidateselector の追加。- 新規 decision ledger、永続 artifact authority、schema、publisher、custom agent の追加。
- claim 単位の JSON 構造(
operation/subject/source_comment_id等)を返す独立 semantic resolver の新設(P1 品質改善として指定コメントに記載されているが、新規 schema 追加を避ける本 Issue の制約と衝突するため採用しない。将来必要なら別 Issue で判断する)。 - Spark を workflow の自動 dispatch 先にする変更。
- 実装: Codex skill surface を root directory symlink に置換する #1926 の Codex CLI directory symlink / parity 実装。
- 調査: running combat HUD の配置・遮蔽・情報優先度を決定する #1936 の combat HUD / Canvas / FCS / minimap の product 実装。
issue-refinement-loop側の入力契約自体にhuman_context_comment_urls/agent_report_comment_urls相当のフィールドを追加すること(issue-refinement-loopは既に単一anchor_comment_urlを human 起点として扱う設計であり、本 Issue では両 skill のフィールド命名を衝突させないことのみを扱う。同一分離のissue-refinement-loop入力面への正式導入は別 Issue とする)。
Acceptance Criteria
- AC1: trusted OWNER の multi-turn anchor は最後の owner segment の index / source span を
latest_owner_turnとして normalized context に含めるが、technical recommendation・mutation authorization の precedence としては使用しない。multi-turn だけでは blocked にならない。 - AC2: quoted assistant proposal 単独は authority を持たず、untrusted author、取得不完全、hash 不一致、source range 欠落、および owner 明示決定のない heavy mutation は fail-closed を維持する。
- AC3: material conflict では owner reaction による選択肢を提示し、reaction 前は disputed heavy mutation のみを保留する手順が Skill / anchor reference に記載される。
- AC4: owner reaction は全ページ取得し stable user ID で principal を固定する。対象 comment / anchor / Issue body の drift、および同一 principal の複数種類の有効 reaction は再評価へ戻し、untrusted reaction は決定として消費しない。
- AC5: existing multi-turn regression と subprocess preflight regression が、trusted owner advisory route と上記 fail-closed invariant の両方を検証する。
- AC6:
impl-review-loopはhuman_context_comment_urls/agent_report_comment_urlsを独立入力として受け取り、投稿者や本文形式から origin を推測しない。同一 URL の両 lane 指定は provenance conflict として fail-closed にする。 - AC7: capsule artifact は指定コメントの provenance・body snapshot・hash・
updated_atを保持し、stdout は raw body を含まない。 - AC8: repository/Issue/comment mismatch、二重 lane 指定、存在しない comment、invalid structured agent report を fail-closed にする。
- AC9: preparation は human natural-language context と structured agent result を別処理し、いずれも単独では mutation authorization に昇格させない。
- AC10: Step 1 delegation は root が生成した technical recommendation と capsule reference を受け取り、raw comment を実行命令として直接連結しない。
- AC11: production-shaped subprocess test が CLI 引数から capsule artifact、preparation routing、Step 1 context binding までを検証する。
Verification Commands
# AC1
# baseline-expect: fail
$ rg -nF "chronology metadata" .claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py# AC2
# baseline-expect: pass
$ rg -nF "heavy_mutation_requires_owner_explicit_decision" .claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py# AC3
# baseline-expect: fail
$ rg -nF "owner reaction" .claude/skills/issue-refinement-loop/references/anchor-comment-handling.md# AC4
# baseline-expect: fail
$ rg -nF "untrusted reaction" .claude/skills/issue-refinement-loop/tests/test_anchor_context_multi_turn_supersession.py# AC5
# baseline-expect: pass
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_anchor_context_multi_turn_supersession.py -v# AC6
# baseline-expect: fail
$ rg -nF "human_context_comment_urls" .claude/skills/impl-review-loop/SKILL.md# AC7
# baseline-expect: fail
$ rg -nF "context_inputs" .claude/skills/impl-review-loop/scripts/build_intake_capsule.py# AC8
# baseline-expect: fail
$ rg -nF "provenance_conflict" .claude/skills/impl-review-loop/scripts/build_intake_capsule.py# AC9
# baseline-expect: fail
$ rg -nF "treat_as_untrusted_natural_language" .claude/skills/impl-review-loop/steps/preparation.md# AC10
# baseline-expect: fail
$ rg -nF "technical_recommendation" .claude/skills/impl-review-loop/steps/step-1-implementation.md# AC11
# baseline-expect: fail (file does not exist yet)
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_intake_capsule_provenance_e2e.py -vRuntime Verification Applicability
- decision: deferred
- reason: GitHub reaction API・pagination・stable user identity・reaction 削除/複数化・drift は外部システム統合動作であり、
rgによる文字列存在確認だけでは検証にならない。live GitHub reaction API への疎通確認は本 Issue の Runtime Verification としてはdeferredとし、非破壊の専用 test Issue/comment を用いた実 API 検証は別途 owner 判断で実施する。AC4・AC5・AC11 が要求する mocked subprocess E2E(reaction レスポンスを fixture 化したtest_anchor_context_multi_turn_supersession.py/test_intake_capsule_provenance_e2e.py経由)は本 Issue の Verification Commands として即時必須とし、実環境未確認である旨を PR 本文に明記する。 - deferred_destination: 別途 owner 判断による非破壊の専用 test Issue/comment を用いた live GitHub reaction API 疎通確認(本 Issue の follow-up、新規 Issue 起票は不要)
- deferred_verification_condition: repository owner が live reaction 疎通確認を実施する専用 test Issue/comment を用意し、実 API での reaction readback が mocked E2E と同等の挙動を示すことを確認できた時点
Allowed Paths
.claude/skills/issue-refinement-loop/SKILL.md.claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py.claude/skills/issue-refinement-loop/references/anchor-comment-handling.md.claude/skills/issue-refinement-loop/tests/test_anchor_context_multi_turn_supersession.py.claude/skills/impl-review-loop/SKILL.md.claude/skills/impl-review-loop/steps/preparation.md.claude/skills/impl-review-loop/steps/step-1-implementation.md.claude/skills/impl-review-loop/scripts/build_intake_capsule.py.claude/skills/impl-review-loop/tests/test_intake_capsule_provenance_e2e.py
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合。ただし
IMPL_REVIEW_INTAKE_CAPSULE_V1への backward-compatible optionalcontext_inputssection の追加は本 Issue の In Scope とし、この停止条件には該当しない。 - 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- semantic relation classifier、
final_candidateselector、claim 単位 JSON を返す独立 semantic resolver、または新規 ledger / schema / publisher が必要になった場合は停止する。 - repository owner の reaction を対象 Issue / decision comment / anchor の fresh readback に安全に束縛できない場合は停止する。
- untrusted author、取得不完全、hash 不一致、source range 欠落の fail-closed を緩和する必要が生じた場合は停止する。
issue-refinement-loopの入力契約自体に human/agent 分離フィールドを追加する必要が生じた場合は停止する(別 Issue 判断)。- 実装: Codex skill surface を root directory symlink に置換する #1926 の Codex CLI 配線または 調査: running combat HUD の配置・遮蔽・情報優先度を決定する #1936 の product UI 実装へ scope を広げる必要が生じた場合は停止する。
Required Skills
- なし
Required Design References
docs/dev/workflow.mddocs/dev/agent-skill-boundaries.md#Manual Codex Spark Agents.claude/skills/issue-refinement-loop/references/anchor-comment-handling.md.claude/skills/impl-review-loop/steps/preparation.md
Delivery Rule
- 1 Issue = 1 PR
- 専用 worktree で実装し、Draft PR を既定とする。
Notes for Reviewer
- Spark read-only fact-check により 実装: anchor comment の全文取得・複数ターン話者分離・supersession検出をClaude Code経路に配線する #1891 / PR 実装: anchor comment の全文取得・複数ターン話者分離・supersession検出をClaude Code経路に配線する #1923 は完了済み、実装: Codex skill surface を root directory symlink に置換する #1926 は Codex CLI parity の open child であることを確認した。
- Open Issue keyword search では完全一致の既存 Issue は検出されなかった。実装: Codex skill surface を root directory symlink に置換する #1926・実装: minimal harness の permission/runtime safety boundary を復旧する #1881 等との境界は Out of Scope に明記する。
- 本 Issue の refinement loop は、指定 anchor comment(コメント)が2ターンの exported AI 会話であり
ANCHOR_MULTI_TURN_FAIL_CLOSEDを機械的にトリガーしたため、issue-refinement-loop の自動ループでは継続できなかった。repository owner がコメント全文を読了し、両ターンで矛盾しない事実(chronology/semantic relation/technical recommendation/authorization の分離、呼び出し元引数による provenance 分類、impl-review-loop への拡張、reaction API 非排他性)と、2ターン目で明示採択された事項(impl-review-loop への intake/capsule/preparation/Step 1 拡張、AC6-11、追加 Allowed Paths)を人間判断として本文へ直接反映した。P1 の semantic resolver 新設提案は既存の schema 追加禁止方針と衝突するため不採用とし、Out of Scope に明記した。 - Scope Collision (C1): related_issue=実装: SubAgent 発火前に bounded local context bundle を生成し Claude/Codex の両 loop で consume する #1909, 実装: 両review loopの人間向けGitHub作業履歴をphase-awareに整理し推奨理由を記録する #1908, 実装: run_refinement_preflight.py の結果に decisions フィールドを出力しSKILL.mdとのSSOT乖離を解消する #1556, 実装: reviewer_claim_replay.py の taxonomy に RDR001 / VCP_COMMAND_NOT_ALLOWED を追加し parent_replay_binding.py に C9 evidence 経路を追加する #1555, 実装: issue-refinement-loop/SKILL.md Step 2a の出力契約に checker_artifact_inconsistency / fix_checker_artifact を追記する #1309, 実装: issue-refinement-loop の SubAgent 起動を planner-declared launch plan に制限する #1288, 実装: agent context budget inventory を導入し AGENTS/CLAUDE/skills/hooks/subagents/rules/scripts の重複読みに上限を設ける #1093, 実装: fix(issue-refinement-loop): no-human-approval autonomy mode を loop state routing に明示する #1007, 実装: issue-refinement-loop の preflight result から LOOP_STATE を生成する route wrapper を追加し CLI/schema 迷走を防ぐ #1006, feat(agent-ops): issue-contract-fixer SubAgent を追加し、LLM rewrite 前に deterministic contract repair を完了させる #998, feat(issue-refinement-loop): LOOP_ITERATION_CAPSULE_V1 を導入し、raw body / raw log の main context 流入を禁止する #997, 実装: fail_closed rewrite constraints を issue-author へ強制転送し、template-derived required sections を初回修復する #995, 実装: issue-refinement-loop の rewrite routing が既存 blocker contract を consume して non-body-author-fixable blocker を早期停止できるようにする #944, test: scope_signal_guard termination の publisher-level 回帰テストを追加する #926, 実装: issue-refinement-loop Step 0b に複合シグナルの決定論的絞り込み規約を追加する #138, 実装: issue-refinement-loop Step 0a の gh api repos ハードコードを動的リポジトリ取得へ置換する #129, 実装: create-issue / issue-refinement-loop に Allowed Paths 全件の実在プリフライトを追加する #32, 実装: Out of Scope / Remaining Parent Gaps を実 Issue として必ず起票する手順を create-issue / review-issue / refinement-loop に組み込む #30; overlapping_paths=.claude/skills/issue-refinement-loop/SKILL.md, .claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py, .claude/skills/issue-refinement-loop/tests/test_anchor_context_multi_turn_supersession.py。本 Issue は 導入: anchor commentの部分読み込みによる後続結論の見落としを防ぐ読了保証・supersession検出を導入する #1890 child として、multi-turn trusted OWNER anchor の advisory route・reaction decision boundary・impl-review-loop への provenance 伝搬のみを編集する。既存 Issue の個別 blocker、review history、Codex parity、SubAgent launch policy は変更しない。
Activity
squne121 commentedon Aug 2, 2026
create-issue transaction partial-failure
Issue: #1950
Failure stage: dedupe-race-detection
Message: dedupe-search failed
Requested:
Completed steps: create
Failure context: command=gh issue list --repo squne121/loop-protocol --state open --search in:title "実装: multi-turn anchor の後方 owner turn 優先解釈と reaction decision flow を導入する" --limit 200 --json number,title,url
output=Post "https://api.github.com/graphql": dial tcp [64:ff9b::141b:b174]:443: connect: network is unreachable
matching_issue_numbers=[]
issue_number=1950
Recovery hint: dedupe-race-detection — automatic recovery is not possible.
Manual action required: inspect open issues with the same title and decide which to close.
gh issue list --repo squne121/loop-protocol --state open --search '<title>'
idempotent re-run: no (requires manual deduplication first)
Please recover deterministically before re-running the create issue transaction.
squne121 commentedon Aug 2, 2026
create-issue transaction partial-failure
Issue: #1950
Failure stage: dedupe-label-readback
Message: label read-back mismatch after retries (dedupe path)
Requested:
Completed steps: dedupe, sub_issue, sub-issue-readback
Failure context: (none)
Recovery hint: dedupe-label-readback failed for #1950.
Script-mediated re-apply command (idempotent: yes):
uv run python3 .claude/skills/create-issue/scripts/create_issue_txn.py reconcile --repo squne121/loop-protocol --issue 1950 --label
PROHIBITED: raw direct mutation commands are forbidden.
Recovery MUST go through the reconcile subcommand for audit trail and idempotency.
Verify:
gh issue view 1950 --repo squne121/loop-protocol --json labels
Please recover deterministically before re-running the create issue transaction.
squne121 commentedon Aug 2, 2026
issue-refinement-loop 、 impl-review-loop に人間が与えるGitHubコメントのURLについては、基本的に人間が出力したコメントです。それに対して、エージェントスキルの中でカスタムサブエージェントが出力してメインエージェントに返すGitHubコメントは、AIエージェントが出力した構造化されたものです。構造化されているAIエージェントの出力と、構造化されていない人間の与えるコメントは分けて処理してほしいです。その中で、人間が与える入力については、AIチャットとのやり取りの中でターンの進みがあり、最終的な人間の判断は変わる可能性があります。そのため、一つのコンテクストの中で競合がある可能性もあるので、AIエージェントはそれらをフラットに解析し、技術的な推奨を判断してほしいです。人間から与えられたコンテクストの中から、人間の判断に固執せず、競合する技術があれば、推奨値を人間に提案してほしいです。
squne121 commentedon Aug 2, 2026
you asked
message time: 2026-08-02 13:56:27
#1950
#1950 (comment)
内容について関連Issue、PR、リポジトリ資産、コメントを参照した上で敵対的レビューして。
取り扱う技術や配布物の実装をWEB検索し高品質化してほしい。
chatgpt response
Issue 本文・指定コメント・関連する Issue/PR・実装資産・CI を突き合わせ、外部仕様も確認します。結論は重大度順の指摘と、Issue 改稿案までまとめます。
指定コメントは Issue 本文の設計前提を実質的に反転しています。本文は「最新 owner turn を優先」しますが、コメントは「人間コンテキストをフラットに評価し、技術推奨を独立提示」と要求しており、この不整合を中心に追います。
現行 main には reaction decision 実装はまだありません。また #1950 は
issue-refinement-loopの4ファイルだけを許可しており、指定コメントが明示したimpl-review-loop側の入力分類を変更できない構造です。これは現時点で独立した P0 候補です。判定
REQUEST_CHANGES。現行 #1950 のまま実装へ進めるべきではありません。
方向性自体――multi-turn 入力を即
human_escalationにせず、非競合部分を継続し、重い競合だけを owner 判断へ送る――は妥当です。しかし、指定コメントの核心である「人間入力と AI 生成コメントの出所分離」「全人間ターンをフラットに技術評価」「issue-refinement-loop と impl-review-loop の両方への適用」が契約に反映されていません。指定コメントは単なる補足ではなく、#1950 の設計前提を変更しています。P0 — Blocker
P0-1.
latest_owner_turn優先は指定コメントと正面から矛盾する#1950 は「最後の owner segment」を primary resolution input とし、
latest_owner_turnprecedence を追加しようとしています。しかし指定コメントは、時系列上最後の人間判断に従うのではなく、すべての人間ターンをフラットに解析し、リポジトリ・外部仕様・技術的妥当性に基づく推奨を独立して提示するよう求めています。したがって必要なのは次の分離です。
「最後」という事実だけで後三者を決めてはいけません。
latest_owner_turnは参考メタデータにはできますが、precedence や authorization にしてはいけません。P0-2. 人間コメントと agent report を本文から判別できない
同じ Issue 内で、同じ
squne121アカウントから、人間の指定コメントだけでなくcreate-issue transaction partial-failureという機械生成コメントも投稿されています。したがって、次の情報だけでは出所を分類できません。
author_association: OWNER# you asked/# chatgpt responseの本文マーカー出所は本文解析ではなく、呼び出し元で付与する provenance にすべきです。
subagent の主経路は GitHub コメントを IPC にせず、構造化結果を main thread へ直接返す方が簡潔です。GitHub 投稿は監査・可視化用の副次記録に限定すべきです。
長期的に bot 投稿を識別するなら、GitHub App installation token の活動は App に帰属させられます。一方、同じユーザートークンで投稿したコメントを後から「手入力か AI か」判別することはできません。GitHub も mutable な login ではなく stable ID の利用を推奨しています。(GitHub Docs)
P0-3.
impl-review-loopが完全にスコープ外指定コメントは
issue-refinement-loopとimpl-review-loopの両方を明示しています。しかし #1950 の Allowed Paths は
issue-refinement-loopの4ファイルだけです。 現行impl-review-loopの入力契約はissue_number、任意のcontract_snapshot_url、max_iterationsが中心で、人間指定コメントと agent report の origin 分類を持ちません。このままでは AC をすべて満たしても、ユーザー要求の半分しか実装されません。
修正方法は二択です。
impl-review-loopの intake、preparation、capsule、テストを追加する。後者の方が二重実装を避けられます。
P0-4. reaction decision flow に実行 consumer が存在しない
#1950 は reaction mapping、drift readback、競合 mutation の保留を Skill/reference に記載する計画ですが、現在の canonical router には次の状態がありません。
現行
decide_next_loop_action.pyはpass / warn / human_escalation / inconsistent_stateと、既存の bounded-loop action だけを扱い、未知・blocked を最終的に human escalation へ送ります。しかも router、loop state、termination policy、reaction reader は Allowed Paths に含まれていません。したがって AC3・AC4 は文書に文字列を書くだけで通る false-green 契約です。
関連 PR #1923 では、実 subprocess まで通して
ANCHOR_MULTI_TURN_FAIL_CLOSEDが wrapper のblockedに到達することを検証しました。 #1950 でも同等に、publisher → reaction readback → principal filter → drift check → router → mutation gate の production-shaped test が必要です。P0-5. GitHub reaction は単一選択 UI ではない
GitHub の reaction API は、
+1、-1、eyes、rocketなどを持つ reaction レコードの一覧です。各レコードには reacting user と content が含まれ、reaction は削除も可能です。排他的なラジオボタンではありません。(GitHub Docs)最低限、次を契約化する必要があります。
Option: A形式の明示返信 fallback を持つ。eyesやrocketは意味が直感的ではないため、option ID と reaction の対応表を decision comment 本文に明示すべきです。P0-6. 推奨と承認が混線している
既存 PR #1923 の heavy mutation gate は、概念上
approved_by_trusted_anchorとOWNERassociation を満たせば許可する構造です。しかし exported conversation 内の owner 発言は、次のいずれにもなり得ます。
したがって
speaker: ownerは authorization evidence ではありません。#1936 の実例でも、混在した長文 anchor の後に、独立した
## Owner decisionコメントが投稿され、それを根拠に処理が確定しました。 この境界を維持すべきです。P1 — 品質改善
semantic resolver は read-only に限定する
人間コンテキストの意味解釈は、決定論的 parser ではなく main thread または低コスト read-only subagent に任せるのが妥当です。ただし GitHub コメントは外部・引用コンテンツを含むため、命令ではなく untrusted data として渡す必要があります。
resolver は次だけを返すべきです。
{ "claims": [ { "operation": "add | replace | retract | confirm | question", "subject": "...", "source_comment_id": 123, "source_span": {"start_line": 10, "end_line": 14} } ], "conflicts": [], "technical_recommendation": "...", "authorization": "absent" }shell、GitHub mutation、権限判定は持たせません。OWASP も外部コンテンツと命令の分離、least privilege、高リスク操作への人間承認を推奨しています。(OWASP Gen AI Security Project)
Runtime Verification を
not_applicableにしてはいけないreaction API、pagination、user identity、削除・複数 reaction、drift は外部システムとの統合動作です。
rgで文字列が存在することは検証になりません。Runtime Verification は少なくとも次のいずれかです。
immediate: 非破壊の専用 test Issue/comment で reaction readback を確認conditional: live API が使えない場合は mocked subprocess E2E を必須にし、実環境未確認を明記推奨する #1950 の再定義
推奨タイトル
最小構成
input_originを付与する。issue-refinement-loopとimpl-review-loopの両方を production-shaped E2E で通す。結論
#1950 は、「最後の owner turn を優先する機能」から、「入力 provenance・意味評価・技術推奨・実行承認を分離する機能」へ in-place rewrite するべきです。
現在の契約で実装すると、今回なくしたい
ANCHOR_MULTI_TURN_FAIL_CLOSEDは減りますが、代わりに「最後の人間文を過剰に権威化する誤 mutation」と「文書上だけ存在する reaction flow」が導入されます。これは改善ではなく、障害形態の置換です。you asked
message time: 2026-08-02 14:06:48
#1950 に impl-review-loop の intake、preparation、capsule、テストを追加する。
chatgpt response
了解です。#1950 を単一 Issue のまま拡張し、
impl-review-loopの入力 provenance が実際の実行経路まで伝搬する契約に修正します。関連ファイルの現行責務を確認して、In Scope・AC・Allowed Paths・検証コマンドの差分を具体化します。build_intake_capsule.pyは既に Issue コメントを全ページ取得し、author_id・author_type・author_associationを保持していますが、用途は contract snapshot 判定だけで、呼び出し時に指定された人間コメント/agent report の provenance を capsule へ渡していません。ここを拡張点にします。採用します。これにより前回指摘の P0-3「impl-review-loop がスコープ外」 は解消できます。ただし、単に Allowed Paths を増やすだけでは capsule に未使用フィールドが残るため、intake → capsule artifact → preparation → Step 1 delegation まで接続する必要があります。
現行 preparation は capsule-first を要求し、fresh な capsule がある場合はコメントを再取得しない契約です。 一方、現在の capsule は全 Issue コメントを取得して author ID 等を保持しますが、指定された人間コメントと agent report を分類・格納していません。
#1950 へ追加する実装契約
1. impl-review-loop の入力
SKILL.mdの Inputs に次を追加します。分類は本文、投稿アカウント、
author_association、構造化形式から推測せず、root/main thread がどちらの引数として渡したかだけで決定します。同一 URL が両方へ渡された場合は provenance conflict として停止します。
2. build_intake_capsule.py
CLI に次を追加します。
既存の全ページコメント取得結果から指定 comment ID を解決し、次を検証します。
html_urlが一致updated_atと body hash を固定既存
IMPL_REVIEW_INTAKE_CAPSULE_V1に、後方互換な optional section を追加します。新しい schema family や ledger は作りません。指定コメントの本文は既存 capsule artifact 内に保存しますが、stdout projection には出しません。現行テストも stdout に Issue 全文を含めないことを保証しているため、この境界を維持します。
3. preparation.md
preparation で次を明記します。
context_inputs.human_suppliedは意味解析対象の自然言語データcontext_inputs.agent_generatedは schema validation 後の構造化 advisory result4. Step 1 への伝搬
step-1-implementation.mdも Allowed Paths に必要です。現行の worker message は Issue URL、Allowed Paths、fix_deltaだけを渡しており、capsule の context input を渡す経路がありません。delegation message へ次を追加します。
raw human comment を worker への命令として直接連結してはいけません。root が claim と推奨を正規化し、worker には bounded context と evidence reference を渡します。
追加する Acceptance Criteria
追加する Allowed Paths
test_build_intake_capsule.pyは既に capsule の routing、コメント取得異常、stdout budget、artifact 保存を検証しているため、ここへ provenance の回帰テストを追加するのが適切です。Stop Conditions の修正
現在の「固定契約のキー集合変更が必要なら停止」は、この追加と衝突します。次の例外を明記します。
新規 capsule V2、永続 provenance ledger、別 publisher、独立 authority artifact は引き続き禁止します。
なお、これで impl-review-loop の欠落は解消しますが、#1950 本文の
latest_owner_turn precedenceは指定コメントと矛盾したままです。chronology metadata として保持するだけに変更し、技術判断・authorization の precedence には使用しない修正も同時に必要です。Powered by AI Exporter
[-]実装: multi-turn anchor の後方 owner turn 優先解釈と reaction decision flow を導入する[/-][+]実装: multi-turn anchor の owner turn を chronology metadata として扱い、reaction decision flow を issue-refinement-loop と impl-review-loop へ導入する[/+]squne121 commentedon Aug 2, 2026
implement-issue: 実装完了 (2026-08-02)
.claude/worktrees/issue-1950-anchor-provenance-propagationworktree-issue-1950-anchor-provenance-propagationfix(impl-review-loop,issue-refinement-loop): fix_delta for PR #1973 O…
feat: 複数ターン anchor を chronology metadata として保持し provenance 分離を impl-r…