Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "runtime smoke の SubAgent causal evidence fixture を、marker だけを返せる contract-compatible な child agent(general-purpose)に是正し、Claude Code 2.1.289 の実 run で child が生成した marker から causal_evidence_source が hook_id_correlated として成立する"
change_kind: code
dedupe_key: "runtime-smoke:subagentstop-handback-provenance-fixture:pr-reviewer-persona-mismatch:v1"Parent Issue
なし(単独改善。先行の #2846 / #2848 は CLOSED で 2.1.285 対応であり、親 tracker ではない)
Parent Goal Ref
- Goal: runtime_only の AC が
--require-subagent-causal-evidenceを付けた runtime smoke で、現行の Claude Code(2.1.289)でも PASS できる状態にする。 - Desired Destination: N/A(単独改善 Issue)。
Current Validated Scope
本 Issue は 2 回の refinement を経ている。1 回目の contract は「2.1.289 の SubagentHandback.tool_input.message を runner の marker provenance が読み落としている」という有力仮説に基づいていたが、実装者の fix 前 live 観測(https://github.com/squne121/loop-protocol/issues/2941#issuecomment-5993485179、agent implementation report。human context ではなく fact-check 対象の evidence として扱った)で仮説が成立しないと判明し、Stop Condition で停止した。以下は再 refinement で独立に再検証した事実と、current main(6b59f108fe8905728f392462c8c3bc4f273906b2)の source だけを write-capable scope の根拠とする。
- 症状:
uv run --locked python3 scripts/agent-ops/run_worktree_agent_runtime_smoke.py --runtime claude --mode structured --claude-adapter claude-gpt --claude-bin "$PWD/scripts/claude-gpt/launch.sh" --prompt-file scripts/agent-ops/tests/fixtures/subagentstop_handback_provenance_smoke_prompt.md --agent-type pr-reviewer --expect-marker SUBAGENTSTOP_HANDBACK_PROVENANCE_SMOKE_OK --require-subagent-causal-evidence ...が Claude Code 2.1.289 で exit 1、causal_evidence_source='no_evidence'、marker_provenance_verified=falseになる。 - fix 前 live 観測(2.1.289、診断のみ追加した runner で 3 回、raw stream を保存した 2 回を親 thread が独立に再検証):
- marker
SUBAGENTSTOP_HANDBACK_PROVENANCE_SMOKE_OKの出現位置は、parent の Agent tool_useinput.prompt、task_started、child の user prompt、parent-lineage の Agent tool_result(tool_use_result.promptの echo)の prompt echo だけである。child が生成した出力には存在しない。 - child(
pr-reviewer)は child lineage のSubagentHandback.tool_input.messageと legacytool_use_result.handbackReport.textの両方にagent_terminal_state: insufficient_context(PR 番号が指定されていません)を返している(terminal state はcompleted)。SubagentStoppayload にはlast_assistant_messageの key 自体が無い。 agent_transcript_rejected_reasonはmissingである(--no-session-persistence下ではagent-<id>.meta.jsonのみで.jsonlが無い)。child-scoped primary evidence が provenance を供給できる場合、transcript の欠落は正常であり root cause ではない。
- marker
- root cause(確定): runner の parser 欠陥ではなく、fixture と repository-owned agent contract の semantic mismatch である。
.claude/agents/pr-reviewer.mdはpr_number(必須)を要求し、欠落時はinsufficient_contextを報告して停止する契約を持つ。fixture(scripts/agent-ops/tests/fixtures/subagentstop_handback_provenance_smoke_prompt.md)はpr-reviewerを起動して marker 1 行だけを返させるがpr_numberを一切渡さない。この不整合は fixture 導入時(実装: runtime smoke の marker provenance を SubagentStop の last_assistant_message 欠落時に handbackReport へ適応する(Claude Code 2.1.285 対応) #2848 / PR fix: SubagentStop に last_assistant_message が無い場合に handbackReport で marker provenance を検証する #2849、commitab2d9238)から存在し、pr-reviewer.mdの同契約も同 commit 時点で存在する。したがってpr-reviewerが marker を生成しないのは persona contract の正しい動作である。 - contract-compatible な child での live 観測(再 refinement 時、2.1.289): fixture の起動先だけを
general-purposeに替えたコピー(fixture 本体は未変更)と--agent-type general-purposeで、現行 runner(変更なし)を同一構成で実行した結果、exit 0、child_agent_type_observed: general-purpose、child_terminal_status: completed、marker_provenance_verified: True、marker_provenance_transcript_fallback_used: False、causal_evidence_source: hook_id_correlated、marker_provenance_handback_report_used: True(agent_transcript_verified: False、agent_transcript_rejected_reason: missingは audit のみ)となった。つまり valid な child 出力があれば、現行 parser は既存の 実装: runtime smoke の marker provenance を SubagentStop の last_assistant_message 欠落時に handbackReport へ適応する(Claude Code 2.1.285 対応) #2848 経路(legacyhandbackReport.text)だけでhook_id_correlatedを成立させる。SubagentHandback.tool_input.messageを新たに読む parser 修正は、現時点の live evidence では不要である。 - precedent(neutral な marker echo / lifecycle smoke の child agent):
scripts/claude-gpt/runtime_smoke_test.shの subagent step はgeneral-purposeを使う。scripts/agent-ops/tests/fixtures/expect_marker_quoted_smoke_prompt.md(実装: runtime smoke の --expect-marker が二重引用符を含む literal で expected_markers_missing と marker provenance を同時に満たせない不整合を是正する #2923)はtest-runnerを使う。runtime_vc_lifecycle_smoke_prompt.md(実装: 再発防止: Auto mode runtime VC の独立 claude -p session で approval context 欠落による false capability-blocker を防ぐ #2839)はpr-reviewerを使うが start/stop lifecycle の観測だけを検証し marker provenance を要求しないため本 Issue の対象外である。 - upstream 一次資料: 公式 Hooks reference では
last_assistant_messageがStop/SubagentStopの入力 field として説明されていることを確認した(親 thread の取得でSubagentHandback節そのものは取得結果に現れなかった。web-researcher の報告は 2.1.285〜2.1.289 の release が存在しないとするなど実機(claude --version= 2.1.289)と矛盾する記述を含み、dispositive な根拠として採用しない)。本 Issue の contract は上記の実測 evidence だけに束縛し、upstream docs のSubagentHandback記述の真偽には依存しない。 - 既存の回帰契約:
test_run_worktree_agent_runtime_smoke_causal_evidence.pyの 実装: runtime smoke の marker provenance を SubagentStop の last_assistant_message 欠落時に handbackReport へ適応する(Claude Code 2.1.285 対応) #2848 正常系(missing transcript でもlast_assistant_message/handbackReportが marker provenance を満たせばhook_id_correlated)は変更しない。runner は本 Issue で変更しない。 - 先行・関連 Issue: 調査: Claude Code 2.1.285 で worktree-agent-runtime-smoke の SubAgent causal evidence が no_evidence になる原因を切り分ける #2846 / 実装: runtime smoke の marker provenance を SubagentStop の last_assistant_message 欠落時に handbackReport へ適応する(Claude Code 2.1.285 対応) #2848(CLOSED、2.1.285)は本件を所有しない。実装: runtime smoke の --expect-ordered-marker を causal evidence の marker provenance 検証へ接続する #2874(OPEN、
--expect-ordered-marker)と 実装: Claude-GPT launcher 縮退(#2925)で撤去された surface を参照している Allowed Paths 外の consumer と文書を更新する #2938(OPEN、launcher 縮退 consumer)は別件。実装: runtime smoke の expected_markers_missing が prompt echo を child marker と誤認する false-green を除去する #2944(OPEN)はexpected_markers_missingが Agent prompt / task metadata / child user prompt /tool_use_result.promptの prompt echo だけで green になり得る false-green を所有し、本 Issue は 実装: runtime smoke の expected_markers_missing が prompt echo を child marker と誤認する false-green を除去する #2944 を関連 Issue として参照するだけで scope を吸収しない(本 Issue の AC は prompt echo を根拠にせず、child agent identity と child-scoped provenance で判定する)。 - 影響: 実装: runner の structured 実行 evidence に main-session init permissionMode を観測値として出力する #2935 の AC6、実装: Auto mode の固定 /tmp scratch 上書き false-deny を run-scoped temporary workspace で解消する #2860 / PR fix: Auto mode の固定 /tmp scratch 上書き false-deny を run-scoped workspace で解消する #2931 の AC5 など、この fixture を使い
hook_id_correlatedを要求する runtime_only AC が現環境で PASS できない。実装: runner の structured 実行 evidence に main-session init permissionMode を観測値として出力する #2935 は GitHub native blockedBy にはしないが、本 Issue は 実装: runner の structured 実行 evidence に main-session init permissionMode を観測値として出力する #2935 の AC6 完了の前提となる blocker である。 - 再発機構: 起動先の agent が repository-owned な入力契約(必須入力)を持つとき、その契約を満たさない smoke prompt は child に拒否される。本 Issue はこの再発の一般対策ではなく、観測された fixture の不整合の最小是正だけを所有する。
Remaining Parent Gaps
- なし(単独改善 Issue)。実装: runner の structured 実行 evidence に main-session init permissionMode を観測値として出力する #2935 AC6 と 実装: Auto mode の固定 /tmp scratch 上書き false-deny を run-scoped temporary workspace で解消する #2860 / PR fix: Auto mode の固定 /tmp scratch 上書き false-deny を run-scoped workspace で解消する #2931 AC5 の再実行は、それぞれの Issue / PR が所有する。
Outcome
scripts/agent-ops/tests/fixtures/subagentstop_handback_provenance_smoke_prompt.md が、marker だけを返せる contract-compatible な child(general-purpose)を起動するよう是正され、Claude Code 2.1.289 の実 runtime の smoke が child の生成した marker から causal_evidence_source == hook_id_correlated で PASS する。runner の parser は変更しない。
Runtime Verification Applicability
decision: immediate
reason: 本 Issue は extension-surface policy の rule subagent-lifecycle-start-stop-delegation-fallback(docs/dev/extension-surface-runtime-policy.yaml)に一致する SubAgent lifecycle smoke の fixture を変更する。fixture が実 runtime で child に marker を生成させ causal evidence を成立させるかは pytest や fake claude では証明できず、実 run の artifact にしか存在しないため。
applicable_acs: [AC1, AC2, AC3, AC4]
execution_environment: 現在の Claude Code session と repository の scripts/agent-ops/run_worktree_agent_runtime_smoke.py(claude 実行ファイルが 2.1.289 であり、scripts/claude-gpt/launch.sh と uv が利用可能であること)。SubAgent が marker を 1 行返すだけの無害な fixture prompt を使う。mutation・外部 code 実行・permission 緩和・credential 利用は行わない。
skip_conditions: claude 実行ファイル、scripts/claude-gpt/launch.sh、uv のいずれかが利用不能な場合は、runner / VC は exit 77 と stdout 先頭 SKIP: で SKIP を宣言する(docs/dev/runtime-verification-policy.md の SKIP 規約に従う)。SKIP は PASS ではなく Stop Condition として扱う。
fallback_policy: pytest の PASS・fake claude・runner の SKIP・unverified の結果を AC1〜AC4 の PASS として扱わない。marker が prompt text や prompt echo に含まれることだけを PASS 根拠にしない。
artifact_requirements: AC1〜AC4 は同一 run の worktree-local artifacts/runtime-smoke/subagentstop-handback-provenance-fixture/(main へ commit しない)配下の runner evidence(summary.md)を証跡とする。新しい schema・receipt・publisher は追加しない。
runtime_assertion_bindings:
- profile: subagent-lifecycle-causal-evidence-smoke
assertion: subagent_start_stop_causal_evidence_correlated
ac: AC3
In Scope
scripts/agent-ops/tests/fixtures/subagentstop_handback_provenance_smoke_prompt.mdの child 起動先をpr-reviewerからgeneral-purposeに変更する。fixture 内の説明文(英文の起動指示・日本語注記・タイトル行)が起動先と矛盾しないよう同時に更新する。marker 文字列(SUBAGENTSTOP_HANDBACK_PROVENANCE_SMOKE_OK)、「foreground で 1 回だけ起動する」「child の最終応答を親が逐語で転記する」という契約、日本語注記の併記慣習は維持する。- 実装者は、変更後の fixture を使う AC1 の live run で、child の marker が
SubagentStop.last_assistant_message/ legacytool_use_result.handbackReport.text/ child lineage のSubagentHandback.tool_input.messageのどこに現れたか(summary のmarker_provenance_handback_report_used等)とagent_transcript_rejected_reasonの有無を PR 本文に記録する。 - 方針は fixture の最小是正のみ。runner の変更・新 schema・新 harness・汎用 compatibility framework・新 approval layer は追加しない。
Out of Scope
- runner(
scripts/agent-ops/run_worktree_agent_runtime_smoke.py)の parser 変更。SubagentHandback.tool_input.messageを marker provenance source に加える変更、agent_transcript_rejected_reason/marker_provenance_subagent_handback_usedの追加出力を含む。fix 前の live 観測で作成された runner の未 commit diagnostic は本 Issue の実装に持ち込まない。valid な child 出力が存在するのに parser が落とす live evidence が別途得られた場合に限り、別 Issue で扱う。 .claude/agents/pr-reviewer.mdの変更、およびpr-reviewerを使う他 fixture(runtime_vc_lifecycle_smoke_prompt.md等)の変更。expected_markers_missingの prompt echo による false-green の是正(実装: runtime smoke の expected_markers_missing が prompt echo を child marker と誤認する false-green を除去する #2944 の ownership)。- Claude Code の version pinning・downgrade、
--require-subagent-causal-evidenceの要件の緩和、permission 緩和、credential 利用。 - 実装: runner の structured 実行 evidence に main-session init permissionMode を観測値として出力する #2935 / PR feat: runner evidence に main-session init の permission_mode_observed を出力する #2940、実装: Auto mode の固定 /tmp scratch 上書き false-deny を run-scoped temporary workspace で解消する #2860 / PR fix: Auto mode の固定 /tmp scratch 上書き false-deny を run-scoped workspace で解消する #2931、実装: runtime smoke の --expect-ordered-marker を causal evidence の marker provenance 検証へ接続する #2874、実装: Claude-GPT launcher 縮退(#2925)で撤去された surface を参照している Allowed Paths 外の consumer と文書を更新する #2938、PR refactor: Claude-GPT launcher を upstream minimal client contract へ縮退し、launcher-owned isolation/policy 層を撤去する #2932 の内容変更と scope 吸収。実装: runner の structured 実行 evidence に main-session init permissionMode を観測値として出力する #2935 / 実装: Auto mode の固定 /tmp scratch 上書き false-deny を run-scoped temporary workspace で解消する #2860 の VC 文言の更新はそれぞれの Issue が所有する。
- background(async)completion の ordering への対応。
.claude/skills/worktree-agent-runtime-smoke/**と docs の更新。- 調査: Claude Code 2.1.285 で worktree-agent-runtime-smoke の SubAgent causal evidence が no_evidence になる原因を切り分ける #2846 / 実装: runtime smoke の marker provenance を SubagentStop の last_assistant_message 欠落時に handbackReport へ適応する(Claude Code 2.1.285 対応) #2848(CLOSED)への追記。
Acceptance Criteria
- AC1: 変更後の fixture と
--agent-type general-purposeを使った 2.1.289 の実 run が exit 0 で完了し、summary のchild_agent_type_observedがgeneral-purpose(prompt echo ではなく runner が実際に観測した child agent 型)で、child_terminal_statusがcompletedである。 - AC2: 同一 run の summary で、child の出力による marker provenance が成立し(
marker_provenance_verifiedがTrue)、transcript fallback に依存していない(marker_provenance_transcript_fallback_usedがFalse)。 - AC3: 同一 run の summary で
causal_evidence_sourceがhook_id_correlatedである(Claude Code 2.1.289)。 - AC4: 同一 run の summary の
marker_provenance_handback_report_usedがTrueであり、child の marker の actual source が既存の 実装: runtime smoke の marker provenance を SubagentStop の last_assistant_message 欠落時に handbackReport へ適応する(Claude Code 2.1.285 対応) #2848 経路(legacyhandbackReport.text)であることを live で確認する(再 refinement 時の live 観測と一致すること。一致しない場合は PASS 扱いにせず Stop Condition とする)。 - AC5: fixture が
general-purposeの child を foreground で 1 回だけ起動し、marker 文字列を 1 行返させる指示を持つ。 - AC6: runner と既存の causal evidence の回帰が変わらず PASS している(runner は変更しない)。特に transcript が存在しなくても primary evidence が marker provenance を満たす 実装: runtime smoke の marker provenance を SubagentStop の last_assistant_message 欠落時に handbackReport へ適応する(Claude Code 2.1.285 対応) #2848 の正常系、実装: runtime smoke の --expect-marker が二重引用符を含む literal で expected_markers_missing と marker provenance を同時に満たせない不整合を是正する #2923 の
--expect-marker-source subagentの回帰を含む。
Verification Commands
# AC1
# preflight-scope: runtime_only
$ uv run --locked python3 scripts/agent-ops/run_worktree_agent_runtime_smoke.py --runtime claude --mode structured --claude-adapter claude-gpt --claude-bin "$PWD/scripts/claude-gpt/launch.sh" --worktree "$PWD" --prompt-file scripts/agent-ops/tests/fixtures/subagentstop_handback_provenance_smoke_prompt.md --output-dir artifacts/runtime-smoke/subagentstop-handback-provenance-fixture --timeout-seconds 300 --max-turns 6 --agent-type general-purpose --expect-marker-source subagent --expect-marker "SUBAGENTSTOP_HANDBACK_PROVENANCE_SMOKE_OK" --require-subagent-causal-evidence --require-min-subagents 1 --require-clean-postcondition
# preflight-scope: runtime_only
$ rg -n "child_agent_type_observed: general-purpose" artifacts/runtime-smoke/subagentstop-handback-provenance-fixture/summary.md
# preflight-scope: runtime_only
$ rg -n "child_terminal_status: completed" artifacts/runtime-smoke/subagentstop-handback-provenance-fixture/summary.md
# AC2
# 上記 AC1 の run が生成した同一 artifact を検査する
# preflight-scope: runtime_only
$ rg -n "marker_provenance_verified.{1,4}True" artifacts/runtime-smoke/subagentstop-handback-provenance-fixture/summary.md
# preflight-scope: runtime_only
$ rg -n "marker_provenance_transcript_fallback_used.{1,4}False" artifacts/runtime-smoke/subagentstop-handback-provenance-fixture/summary.md
# AC3
# 上記 AC1 の run が生成した同一 artifact を検査する
# preflight-scope: runtime_only
$ rg -n "causal_evidence_source.{1,6}hook_id_correlated" artifacts/runtime-smoke/subagentstop-handback-provenance-fixture/summary.md
# AC4
# 上記 AC1 の run が生成した同一 artifact を検査する
# preflight-scope: runtime_only
$ rg -n "marker_provenance_handback_report_used.{1,4}True" artifacts/runtime-smoke/subagentstop-handback-provenance-fixture/summary.md
# AC5
$ rg -n "launch the .general-purpose. SubAgent in the foreground" scripts/agent-ops/tests/fixtures/subagentstop_handback_provenance_smoke_prompt.md
# AC6
$ uv run --locked pytest scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_causal_evidence.py scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_named_subagent_resume.py scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_gpt_live_causal_evidence.py -qAllowed Paths
- scripts/agent-ops/tests/fixtures/subagentstop_handback_provenance_smoke_prompt.md
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合(runner の変更が必要と判明した場合を含む)
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- 実装が
--require-subagent-causal-evidenceの要件の緩和、または generic な compatibility 層を必要とすると判明した場合 - fixture を是正した live run で child が marker を生成したにもかかわらず runner が
no_evidenceとする場合(valid な child 出力を parser が落とす evidence であり、parser 修正を要する別 contract として観測 evidence を報告して停止し、再 refinement を求める) - AC1〜AC4 が SKIP(exit 77)または FAIL になった場合は PASS 扱いにせず、報告して停止する(原因を修正した新しい head でのみ再実行する)
Required Skills
なし
Required Design References
- docs/dev/runtime-verification-policy.md
- docs/dev/extension-surface-runtime-policy.yaml
- .claude/agents/pr-reviewer.md
- scripts/agent-ops/tests/fixtures/subagentstop_handback_provenance_smoke_prompt.md
Delivery Rule
1 Issue = 1 PR。Draft PR を既定とする。- 本 Issue は 実装: runner の structured 実行 evidence に main-session init permissionMode を観測値として出力する #2935 の AC6 完了の前提となる blocker である(GitHub native blockedBy は設定しない)。
- 関連: 調査: Claude Code 2.1.285 で worktree-agent-runtime-smoke の SubAgent causal evidence が no_evidence になる原因を切り分ける #2846 / 実装: runtime smoke の marker provenance を SubagentStop の last_assistant_message 欠落時に handbackReport へ適応する(Claude Code 2.1.285 対応) #2848(CLOSED、2.1.285)、実装: runtime smoke の expected_markers_missing が prompt echo を child marker と誤認する false-green を除去する #2944(prompt echo false-green、別 ownership)、実装: runner の structured 実行 evidence に main-session init permissionMode を観測値として出力する #2935 / PR feat: runner evidence に main-session init の permission_mode_observed を出力する #2940、実装: Auto mode の固定 /tmp scratch 上書き false-deny を run-scoped temporary workspace で解消する #2860 / PR fix: Auto mode の固定 /tmp scratch 上書き false-deny を run-scoped workspace で解消する #2931、実装: runtime smoke の --expect-ordered-marker を causal evidence の marker provenance 検証へ接続する #2874・実装: Claude-GPT launcher 縮退(#2925)で撤去された surface を参照している Allowed Paths 外の consumer と文書を更新する #2938(別件)、PR refactor: Claude-GPT launcher を upstream minimal client contract へ縮退し、launcher-owned isolation/policy 層を撤去する #2932(read-only precedent)。
Scope Delta(任意)
あり。1 回目の contract(runner の parser と新規 test file が Allowed Paths、SubagentHandback.tool_input.message を provenance source に加える是正)から、fix 前 live 観測と再 refinement の live 観測に基づいて、fixture のみの是正へ縮小した。runner の変更は不要と実測で判明したため Allowed Paths から除外した。
Notes for Reviewer
- 本 contract は、停止報告(https://github.com/squne121/loop-protocol/issues/2941#issuecomment-5993485179、agent report)の主張を raw stream と live 再実行で独立に fact-check した上で再構成している。historical な OWNER context は https://github.com/squne121/loop-protocol/issues/2941#issuecomment-5992934403、前回 refinement の termination report は 実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 (comment) である。
general-purposeを選んだ根拠は repository precedent(scripts/claude-gpt/runtime_smoke_test.sh)と、変更なしの現行 runner での live PASS である。--agent-typeは runner が child の観測型と照合するため、fixture の起動先と VC の--agent-typeを一致させること。- AC4 は 2.1.289 の観測に束縛した検査であり、upstream の配信形が変われば別 contract の対象になる。
- 実装: runner の structured 実行 evidence に main-session init permissionMode を観測値として出力する #2935 の AC6 の VC は
--agent-typeを指定していないが、この fixture を--prompt-fileに使う。fixture 是正後も同 VC が成立するかは 実装: runner の structured 実行 evidence に main-session init permissionMode を観測値として出力する #2935 が所有する。
Activity
squne121 commentedon Oct 5, 2026
判定
REQUEST_CHANGES 相当です。実装開始前に #2941 の Issue contract を修正するのを推奨します。
特に重大なのは、現状の AC2 と AC4 が current main 上の既存回帰契約と矛盾しており、そのままでは同時達成できない点です。また、2.1.289 の実 failure は transcript の拒否というより、current Claude Code の
SubagentHandbackreport channel を causal-evidence parser が読んでいないことが本命です。Findings
[P1] 根本原因の仮説が current Claude Code の producer contract から外れている
問題: 実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 は
agent_transcript_verified=falseのrejected_reasonを最初の調査軸に置き、「allowed_roots / transcript parser 適応」を主要な修正候補にしています。しかし current Claude Code の公式仕様では、v2.1.271 以降 Auto mode の SubAgent がSubagentHandbackを使う場合、親へ実際に届けた report はSubagentStop.last_assistant_messageではありません。report はSubagentHandbackのtool_input.messageにあり、last_assistant_messageは停止時の closing text にすぎない場合があります。[Claude](https://code.claude.com/docs/en/hooks)current main
0b230a34のrun_worktree_agent_runtime_smoke.pyはこれに追随していません。_claude_agent_handback_report_text()は旧 実装: runtime smoke の marker provenance を SubagentStop の last_assistant_message 欠落時に handbackReport へ適応する(Claude Code 2.1.285 対応) #2848 契約であるAgentresult のtool_use_result.handbackReport.textだけを読み、しかもsubagent_causal_evidence_verdict()はlast_assistant_messageが空の場合にしかこの fallback を呼びません。したがって「closing text は存在するが、marker を含む本物の report は child lineage のSubagentHandback.tool_input.message」という current upstream の正規形だと、marker provenance が transcript fallback に落ちる構造です。repository 内でも既に
scripts/claude-gpt/auto_mode_canary.pyが current runtime をこの形で扱っており、child lineage のSubagentHandbackのinput.messageを worker result として抽出しています。test_run_worktree_agent_runtime_smoke_named_subagent_resume.pyにも同じ producer shape があります。これはまだ 2.1.289 raw stream を 実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 が保存していないため高信頼の root-cause 仮説であって確定ではありません。ただし、観測済みの
tool_invocation_id_correlated=true/child_terminal_status=completed/marker_provenance_transcript_fallback_used=true/agent_transcript_verified=falseと非常によく整合します。最小修正: 最初の 2.1.289 live capture で
SubagentStop.last_assistant_message、旧tool_use_result.handbackReport.text、child-lineageSubagentHandback.tool_input.messageの3経路を確認する。後者に marker があるなら、transcript gate を緩めるのではなく、既存の agent/tool-use correlation に束縛してSubagentHandback.tool_input.messageを child-scoped provenance source に加えるべきです。generic compatibility framework は不要です。なお v2.1.285 では upstream 自体が「report を返した時点で subagent run を終える」変更を入れており、調査: Claude Code 2.1.285 で worktree-agent-runtime-smoke の SubAgent causal evidence が no_evidence になる原因を切り分ける #2846/実装: runtime smoke の marker provenance を SubagentStop の last_assistant_message 欠落時に handbackReport へ適応する(Claude Code 2.1.285 対応) #2848 の当時の症状とも整合します。[GitHub](https://github.com/anthropics/claude-code/releases/tag/v2.1.285)
[P1] AC2 は AC4 および merge 済み 実装: runtime smoke の marker provenance を SubagentStop の last_assistant_message 欠落時に handbackReport へ適応する(Claude Code 2.1.285 対応) #2848 の回帰契約と直接矛盾している
問題: AC2 は「transcript が欠落・allowed root 外・stale・symlink の場合は
no_evidenceのまま」と無条件に要求しています。しかし current main には正反対の positive regression が既にあります。test_handbackreport_provenance_no_last_assistant_message_is_hook_id_correlated()は、存在しない transcript を使いagent_transcript_verified == Falseのまま、直接の handback provenance によりhook_id_correlatedを要求しています。またtest_given_last_assistant_message_satisfies_markers_transcript_missing_then_hook_id_correlated()も、missing transcript でも child-scoped primary evidence が十分ならhook_id_correlatedを要求しています。production logic も同じで、
not marker_provenance_transcript_fallback_used or agent_transcript_verifiedという条件です。つまり transcript verification は 実際に transcript fallback に依存した場合だけ hard gate です。
Impact: AC2 を文字どおり実装すると 実装: runtime smoke の marker provenance を SubagentStop の last_assistant_message 欠落時に handbackReport へ適応する(Claude Code 2.1.285 対応) #2848 の正常系を壊します。一方 AC4 は既存 causal-evidence tests の全 PASS を要求しているため、AC2 と AC4 が論理的に両立しません。
最小修正: AC2 の negative condition は「marker provenance が transcript fallback を必要とする場合に限り、missing / outside-root / stale / symlink は
no_evidence」へ限定するべきです。last_assistant_messageまたは相関済みSubagentHandbackが単独で provenance を確立できる場合、transcript は audit metadata のままでよいです。[P1] AC1 の Verification Command は false-green で、想定している rejected_reason の一部は actual runtime path から到達不能
問題: AC1 は「2.1.289 の実 run で
rejected_reasonを特定する」ことを要求しているのに、VC は単にrg -n "rejected_reason" scripts/agent-ops/run_worktree_agent_runtime_smoke.pyです。
rejected_reasonは current main に既に存在するので、実 runtime を一度も調べず baseline で PASS します。さらに
_read_claude_agent_transcript_content()でoutside_allowed_rootsが発生するのはallowed_rootsが渡された場合だけ、stale_mtimeは run start/end の両時刻が渡された場合だけです。しかし structured production call は current main:9485で、subagent_causal_evidence_verdict(out, args.expect_marker)と呼んでおり、
transcript_allowed_rootsもrun_start_time/run_end_timeも渡していません。したがって Issue が候補として挙げているoutside_allowed_rootsとstale_mtimeは、この AC3 の actual structured path では現在発生しません。Impact: implementer が
allowed_rootsを調整しても実 failure と無関係な可能性が高く、AC1 自体は原因未特定でも green にできます。最小修正: AC1 を actual runtime artifact に束縛してください。既存 evidence dict の慣習に収まるなら
agent_transcript_rejected_reasonを additive diagnostic として出し、2.1.289 run の artifact で exact value を assert するのが最小です。ただし、それを「root cause」と自動的に同一視してはいけません。例えばmissingでも、current documentedSubagentHandbackが marker provenance を完全に供給できれば transcript absence は正常です。[P2] 「2.1.289 形の fixture」の定義がなく、旧 実装: runtime smoke の marker provenance を SubagentStop の last_assistant_message 欠落時に handbackReport へ適応する(Claude Code 2.1.285 対応) #2848 shape で unit test だけ green にできる
実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 は既存
subagentstop_handback_provenance_smoke_prompt.mdを再利用しますが、これは 実装: runtime smoke の marker provenance を SubagentStop の last_assistant_message 欠落時に handbackReport へ適応する(Claude Code 2.1.285 対応) #2848 用に作られ、説明もhandbackReportを前提としています。対して current upstream contract はSubagentHandback.tool_input.messageです。公式 docs は completed Agent result 自体も report ではなく handback の短い通知になる場合があると明記しています。[Claude](https://code.claude.com/docs/en/hooks)新 test の「2.1.289 形の入力」という表現だけでは、実装者が旧
handbackReportfixture を作って green にしても AC2 を満たせます。これでは AC3 で再度落ちる false-green を防げません。最小修正: live 2.1.289 capture 後、fixture の構造を明記してください。少なくとも「Agent tool invocation と child identity の相関」「child lineage の
SubagentHandbacktool-use」「marker はtool_input.messageにのみ存在」「last_assistant_messageは marker を持たない closing text または空」「parent text / arbitrary tool input / foreign child の marker は採用しない」を固定するのが妥当です。async path が実測されたならtask_notification(status=completed)との ordering も fixture に含めるべきです。修正後の Issue contract の方向性
#2941 自体は存続させてよく、別 Issue に分割する必要は現時点ではありません。dedupe でも
SubagentHandback + causal evidenceを直接所有する別 Issue は見つかっておらず、#2848 は 2.1.285 の旧handbackReportadaptation、#2874 は ordered-marker 接続で別 ownership です。AC は概ね次の形に直すのがよいです。AC1 は「2.1.289 raw evidence から marker の actual child report source と transcript rejected_reason を特定」。AC2 は「実測した producer shape、特に
SubagentHandback.tool_input.messageを fail-closed に相関してhook_id_correlated。transcript fallback が必要なケースだけ missing/outside/stale/symlink を reject」。AC3 の real runtime 2.1.289 PASS はそのまま維持。AC4 の既存 causal suite 全 PASS も維持、です。妥当な部分
pristine main
0b230a34でも PR #2940 と同じ failure が再現しているため、#2935 / PR #2940 の変更から独立した blocker と切り分けた点は妥当です。またscripts/agent-ops/**の SubAgent lifecycle semantics 変更に real runtime verification を要求するdecision: immediateも currentextension-surface-runtime-policy.yamlと整合しています。さらに、start/stop correlation、tool invocation correlation、single qualifying candidate、symlink/oversize 等の fail-closed 条件を維持する方針、新 compatibility framework・version pin・permission 緩和を追加しない方針も適切です。今回必要なのは harness を増やすことではなく、current Claude Code が既に出している正規の child report channel を既存 correlation に接続する狭い parser 修正です。
結論として、#2941 は方向性は正しいものの、現 body のまま implementation に渡すべきではありません。特に AC2/AC4 の矛盾は blocking defect です。 先に Issue refinement で上記4点を反映してから
impl-review-loopへ渡すのが安全です。squne121 commentedon Oct 5, 2026
確認した範囲では、推奨は #2941 をまだ実装へ送らず、対象 OWNER comment を trusted human context として
issue-refinement-loopで contract 修正することです。重要な fresh drift があります。prompt 作成時点の
mainは306086d881a7affed9ef7b3fd5ae5d1df3a22f81まで進んでおり、PR #2932 由来で Claude Code 2.1.289 のSubagentHandback実 stream shape を別 consumer が既に扱う実装 precedent が入っています。一方、対象 runner の causal-evidence 部分は依然として #2848 型のhandbackReport.textfallback です。Claude Code 公式 Hooks reference も、v2.1.271 以降はSubagentHandbackreport がtool_input.messageにあり、SubagentStop.last_assistant_messageは report 本体ではないと明記しています。[Claude](https://code.claude.com/docs/en/hooks)また、添付された直前 run でも #2935 の AC6 は
permission_mode_observed=autoまで観測できた一方、causal_evidence_source=no_evidenceで停止し、その再発修正として #2941 が起票されています。貼り付けたテキスト(1) 現時点で別の再発防止 Issue を追加する根拠は薄く、#2848 / #2874 / #2938 と重複しない新しい独立 root cause が refinement 中に具体化した場合だけ起票させるのがよいです。以下をそのまま fresh / auto mode の対話的 Claude Code に貼れます。
repo =
squne121/loop-protocol対象 Issue:
#2941
今回の trusted OWNER human-context anchor:
#2941 (comment)
使用する repository-native Skill:
.claude/skills/issue-refinement-loop/SKILL.mdこの対話的 Claude Code session は既に fresh / auto mode で起動済みです。現在の session を継続してください。
新しい session の起動、
/clear、permission mode の変更、bypassPermissions、--dangerously-skip-permissions等は不要で、要求していません。目的
Issue #2941 を、上記 OWNER comment を trusted human context として current repository-native
issue-refinement-loopで refinement してください。iteration ごとの人間承認は不要です。current Skill の bounded loop policy の範囲で、
fresh intake → trusted-anchor preflight → investigation → web research → review → contract update/rewrite → fresh review → readiness → terminationを自律的に完遂し、
approvedまたは genuine canonical hard stop まで進めてください。今回は issue refinement のみです。実装開始、implementation worktree 作成、implementation branch、commit、push、PR 作成、
impl-review-loop起動は行わないでください。approvedtermination は implementation authorization の代替ではありません。明示的な承認
以下の通常作業は、この依頼の範囲で明示的に承認します。
main、関連 repository assets、tests、scripts、Skills、Agent definitions の readcodebase-investigatorの利用web-researcherの利用issue-refinement-loopが要求する controlled contract updateissue-editorによる Issue 実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 本文の完全 rewriteissue-creatorによる follow-up Issue 起票ただし destructive operation、permission bypass、secret / credential 操作、force push、history rewrite は承認していません。
最初に fresh state を取得する
過去情報を authority として固定しないでください。
開始時に少なくとも次を fresh に取得してください。
mainHEAD5992934403の current snapshot と author associationSubagentHandback/handbackReport/ causal evidence を扱う producer / consumer / testsprompt 作成時点では
mainは306086d881a7affed9ef7b3fd5ae5d1df3a22f81まで進んでいることを観測しています。
ただしこの SHA を current authority として固定せず、必ず開始時に再取得してください。
特に、この main drift には PR #2932 由来の Claude Code 2.1.289
SubagentHandbackstream shape を扱う別 consumer の実装 precedent が含まれています。対象 OWNER comment は旧 main0b230a34...を参照しているため、comment の意図と findings は trusted authority として尊重しつつ、repository factual claims は fresh main に再束縛してください。current Skill を先に読む
実行前に current HEAD から必要な範囲を読み、過去チャットの procedure を再利用しないでください。
最低限:
.claude/skills/issue-refinement-loop/SKILL.mdreferences/anchor-comment-handling.mdreferences/web-research-routing.mdreferences/ac-vc-reflection.mdreferences/semantic-design-review.mdreferences/follow-up-materialization.mdreferences/termination-policy.md.claude/agents/codebase-investigator.md.claude/agents/web-researcher.md.claude/agents/issue-editor.md.claude/agents/issue-creator.mdcanonical Step 2 は current Skill の root-owned review pipeline を使ってください。
旧手順の
issue-reviewerSubAgent を canonical Step 2 として勝手に復活させないでください。trusted anchor の扱い
対象 comment は OWNER による明示的な REQUEST_CHANGES 相当の human directive です。
したがって、current Skill が定める
preflight.run.with_human_contextlane と、その後の canonical contract-update / issue-editor route を使用してください。
agent-report lane や unlabeled anchor lane と混同しないでください。
OWNER comment の raw prose をそのまま Issue 本文へコピーするのではなく、codebase investigation・upstream research・current main evidence で fact-check した上で contract に反映してください。
SubAgent の使用
今回の対象は repository implementation semantics と current external Claude Code contract の両方に依存するため、canonical planner が明示的に不要と判定しない限り、少なくとも以下を使用してください。
codebase-investigator
調査対象を明示してください。
run_worktree_agent_runtime_smoke.pysubagent_causal_evidence_verdict_claude_agent_handback_report_text_marker_provenance_verified_read_claude_agent_transcript_contentSubagentHandbackshape を既に扱っている consumer / testsweb-researcher
current upstream を fresh に確認してください。
優先 source:
少なくとも次の claim を検証してください。
SubagentHandbackを使う SubAgent の delivered report はtool_input.messageSubagentStop.last_assistant_messageは closing text であり、delivered report と同一ではない完了待ち
SubAgent を dispatch しただけで downstream へ進まないでください。
各 SubAgentについて:
SubAgent input は親会話の暗黙 context に依存させず、repo、Issue、anchor URL、current HEAD、task、authority、constraints、expected evidence、expected output を明記してください。
OWNER findings の contract 反映方針
OWNER comment の4 findings を個別に disposition してください。
Finding 1: root-cause framing
現 body の
agent_transcript_verified=false/rejected_reasonを root cause と先取りする framing を修正してください。最初の live evidence では少なくとも、
SubagentStop.last_assistant_messageAgent tool_use_result.handbackReport.textSubagentHandback.tool_input.messageの3経路を区別して確認する契約にしてください。
current evidence で
SubagentHandback.tool_input.messageが actual report source と確認された場合は、transcript gate 自体を緩和するのではなく、既存の child identity / Agent invocation correlation に束縛した narrow provenance source として扱う方向を contract に固定してください。generic compatibility framework、新 harness、新 approval layer は要求しないでください。
Finding 2: AC2 / AC4 contradiction
現 AC2 の
「transcript missing / outside-root / stale / symlink なら無条件で
no_evidence」という要求を維持しないでください。
current #2848 regression と production semantics を保ち、
transcript fallback が実際に必要な場合だけ
missing / outside-root / stale / symlink が promotion を拒否する、
という条件に限定してください。
相関済みの
last_assistant_messageまたは currentSubagentHandbackreport が marker provenance を独立に確立できる場合、agent_transcript_verifiedは audit metadata のままでよい、という既存 semantics を壊さないでください。これにより AC2 と AC4 が同時達成可能な contract にしてください。
Finding 3: AC1 false-green
現 AC1 の VC:
rg -n "rejected_reason" ...だけで AC1 を PASS 可能にする contract を修正してください。
AC1 が要求するものは actual runtime evidence です。
fresh runtime artifact に、
rejected_reasonの exact diagnosticを束縛できる verification にしてください。
既存 evidence shape の慣習に収まるなら、
agent_transcript_rejected_reasonのような additive diagnostic を許容する方向は検討してよいですが、rejected_reasonがmissingだから root cause だ、と自動的に結論しないSubagentHandbackが primary provenance を供給する場合、transcript absence は正常になり得ることを contract に反映してください。
actual runtime に依存する AC が増えるなら、
Runtime Verification Applicability.applicable_acsも整合するよう更新してください。Finding 4: 2.1.289 fixture の exact shape
「2.1.289 形の fixture」という曖昧な表現だけにしないでください。
fresh live capture と current main precedent に基づき、positive fixture は少なくとも以下を固定する方向で refinement してください。
SubagentHandbacktool use があるSubagentHandback.tool_input.messageに存在するlast_assistant_messageは marker を持たない closing text、または実測に従うnegative controls には少なくとも:
を検討してください。
async path が fresh 2.1.289 capture で実測された場合だけ、
task_notification(status=completed)等の ordering も fixture contract に追加してください。推測で追加しないでください。current main drift を Issue contract に反映する
current main / PR #2932 が既に 2.1.289
SubagentHandbackshape を別 consumer で扱っているなら、その実装と tests を read-only precedent / evidence として #2941 の Current Validated Scope / Notes for Reviewer 等へ必要最小限反映してください。ただし #2932 や #2938 の scope を #2941 に吸収しないでください。
#2941 の write-capable scope は causal-evidence runner の narrow parser adaptation と対応 regression に維持してください。
また current evidence に照らして、Machine-Readable Contract の
goal_ref/dedupe_keyがagent-transcript-verifiedを root cause と過度に固定しているなら、ownership を変えない範囲で stale framing を修正すべきか review してください。AC / VC の目標形
最終 contract は概ね以下の意味を満たすようにしてください。ただし exact wording / commands は current repository-native reviewer/editor に決めさせてください。
fresh 2.1.289/current runtime evidence から actual child report source と transcript diagnostic を特定し、artifact に束縛して検証
実測 producer shape、特に相関済み
SubagentHandback.tool_input.messageを fail-closed に provenance として扱う regression。transcript fallback が必要なケースだけ unsafe/missing transcript を拒否real runtime smoke で
causal_evidence_source == hook_id_correlatedcurrent causal-evidence regression suite 全 PASS
baseline で既に成立する static
rgだけを未実装 AC の成功判定にしないでください。scope / fail-closed
維持するべきもの:
緩和しないもの:
--require-subagent-causal-evidence追加しないもの:
follow-up / recurrence prevention
まず open / closed Issue を dedupe してください。
特に:
SubagentHandback,causal evidence,agent_transcript_verified,no_evidence, Claude Code version drift を所有する Issueを確認してください。
#2941 自体が今回の recurrence remediation なので、単に「Claude Code の version drift が再発する」という一般論だけで追加 Issue を作らないでください。
ただし refinement 中に、
という別 defect が具体化した場合は、current
follow-up-materialization/issue-creatorの canonical route で follow-up Issue を起票してください。起票した SubAgent の terminal completion を待ち、GitHub で実在と内容を readback してください。
iteration と停止境界
通常の:
は、current bounded loop 内で自動修復して続行してください。
iteration ごとの人間承認を要求しないでください。
停止するのは current canonical workflow が要求する genuine hard stop のみです。
例:
human_judgment_requiredSubAgent 自身の単なる「human review required」という自己申告だけを authority として停止しないでください。
termination
approved に到達したら current
termination-policy.mdに従って終了してください。implementation Issue で必要な
LOOP_HANDOFF_RESULT_V1は current canonical publisher 経由で生成してください。ただしこれは audit telemetry であり、implementation dispatch authority として扱わないでください。approved 後も
impl-review-loopを起動しないでください。最終報告
最後に簡潔に以下を報告してください。
0b230a34... → current mainをどう扱ったかapproved調査や提案だけで終えず、current repository-native
issue-refinement-loopの approved termination、または genuine hard stop までこの turn で完遂してください。この prompt は refinement 完了で明確に停止させています。#2941 が
approvedになった後、実装は別途impl-review-loopの fresh root-entry から開始するのが current repository contract と整合します。squne121 commentedon Oct 5, 2026
issue-refinement-loop 終了報告: approved
Issue #2941 の contract を、OWNER の trusted human context(https://github.com/squne121/loop-protocol/issues/2941#issuecomment-5992934403、author_association: OWNER、
preflight.run.with_human_contextlane)に基づき refinement し、approvedで終了する。この終了は implementation の開始を authorize しない(#2740)。実装・worktree 作成・branch・commit・push・PR 作成・impl-review-loop起動は行っていない。経緯(iteration 1 回の rewrite)
306086d881a7affed9ef7b3fd5ae5d1df3a22f81(OWNER comment が参照する旧 main0b230a34...から進んでいる。comment の意図と findings は trusted authority として尊重し、repository の事実主張は current main に再束縛した)。^\s*<field>:に合わず 8 blocker)。issue-editor/edit_issue_txn.py、status ok)。start body sha256e6ab5921da86f1001cd395efd796995c7ac7ad8136729a73397adbae09e5acf7→ finalaac7a9762c197300c304645bafd6aff1ce338b00e3130d43ba0584b2a23d07b8。issue-contract-review(execute / baseline): go。OWNER findings の disposition
rejected_reasonを root cause とせず、SubagentHandback.tool_input.messageを「有力仮説」として AC1 の live 観測で確認する契約にした。確認できた場合は transcript gate を緩和せず、既存の Agent invocation / child identity 相関に束縛した child-scoped provenance source としてだけ加える。generic framework は禁止。観測が仮説と異なる場合は Stop Condition。no_evidenceにするのは、transcript fallback が実際に必要なケースに限定した。実装: runtime smoke の marker provenance を SubagentStop の last_assistant_message 欠落時に handbackReport へ適応する(Claude Code 2.1.285 対応) #2848 の正常系(missing transcript でも primary evidence が provenance を満たせばhook_id_correlated)は AC4 で維持する。rgを廃止し、実 run のsummary.mdにagent_transcript_rejected_reasonとmarker_provenance_subagent_handback_usedが出力されることを検証する。両者は既存のmarker_provenance_handback_report_usedと同じ「該当時のみ出力する加算的 audit field」とし、新 schema は作らない。applicable_acsは [AC1, AC3]。structured 経路がallowed_roots/ run 時刻を渡さないためoutside_allowed_roots/stale_mtimeは到達不能であることも明記した。SubagentHandback.tool_input.messageのみに marker、last_assistant_messageは closing text または欠落、Agent の completed result は固定の配信通知、transcript なし)と、negative control(foreign child、相関しない handback、parent text のみ、無関係な tool input のみ、handback tool_result 失敗、terminal success 不成立)を AC2 に固定した。async の ordering は実測されていないため含めていない。upstream 確認(root が一次資料で確認)
公式 Hooks reference(https://code.claude.com/docs/en/hooks)の記述を確認した。v2.1.271 以降、SubagentHandback を使う SubAgent の report は
tool_input.messageにあり、SubagentStop.last_assistant_messageは closing text で delivered report ではなく、完了した Agent result のcontentは hand-back の短い通知である。v2.1.285 の release note も同趣旨(report を返した時点で run を終える)。web-researcher は公式 docs を「記述なし」と報告したが、root の一次確認と一致しなかったため採用しなかった。current main drift / precedent
PR #2932(merged)が 2.1.289 の stream shape を別 consumer(
_nr_text_blocks、_real_shape_role_stream)で扱っている。これを read-only precedent として Current Validated Scope に記載し、#2932 / #2938 の scope は吸収していない。write-capable scope は runner の narrow parser 適応と新規 test file に維持した(Allowed Paths 変更なし)。dedupe / follow-up
#2846 / #2848(CLOSED、2.1.285)、#2874(OPEN、
--expect-ordered-marker)、#2938(OPEN、launcher 縮退 consumer)は別 ownership。"SubagentHandback" / "causal evidence no_evidence" の open / closed 検索で他の owner は 0 件。別 ownership の具体的な再発 defect は新たに判明していないため、follow-up Issue は起票していない。補足
dedupe_keyを...:agent-transcript-verified:v1から...:subagent-handback-provenance:v1に更新した(root cause の先取りを解消。ownership は不変)。squne121 commentedon Oct 5, 2026
推奨アクションは #2941 を current
impl-review-loopに投入し、draft_pr_ready=人間が merge 判断できる直前まで自律実行です。live GitHub 確認時点ではmainは306086d881a7affed9ef7b3fd5ae5d1df3a22f81、#2941 に対応する既存 PR は見つかっていません。ただし prompt 内では両方を fresh 再取得させます。直前の refinement もapprovedで終了し、実装・branch・PR・AC1/AC3 runtime はまだ開始していません。貼り付けたテキスト(1)また Claude Code の current Hooks reference を再確認すると、v2.1.271+ の
SubagentHandbackは report をtool_input.messageで渡し、last_assistant_messageは report 本体ではない closing text になり得る、という refined contract の前提は現在も公式仕様と一致しています。[Claude](https://code.claude.com/docs/en/hooks)以下をそのまま、既に fresh / auto mode で起動している対話的 Claude Code に貼れます。
repo =
squne121/loop-protocol対象 Issue:
#2941
refinement で使用された historical OWNER human-context:
#2941 (comment)
直近の refinement termination report:
#2941 (comment)
使用する repository-native Skill:
.claude/skills/impl-review-loop/SKILL.mdこの対話的 Claude Code session は既に fresh / auto mode で起動済みです。現在の session をそのまま継続してください。
新しい session の起動、
/clear、permission mode の変更、bypassPermissions、--dangerously-skip-permissions等は不要で、要求していません。目的
Issue #2941 を current repository-native
impl-review-loopで、fresh intake / synchronous entry → landing disposition → implementation → verification → PR review → fix → re-verification → fresh re-reviewまで自律的に進め、人間が merge 判断できる直前の
draft_pr_ready、または current canonical workflow が定める genuine hard stop まで完遂してください。iteration ごとの人間承認は不要です。
通常の実装、test failure の修正、PR reviewer の
REQUEST_CHANGES、stale head の再 review、BEHINDの branch update、修正後の再 test / 再 review は、currentimpl-review-loopの bounded loop 内で自律的に処理してください。実 merge / auto-merge は行わないでください。
現時点の参考情報 — authority として固定しない
prompt 作成時の live GitHub 確認では:
mainHEAD:306086d881a7affed9ef7b3fd5ae5d1df3a22f81phase/implementation/agent/implementerapprovedただし、これらを current authority として固定しないでください。開始時と各 freshness boundary で live state を再取得してください。
comment provenance の扱い
#issuecomment-5992934403は historical な OWNER human-context です。当時のREQUEST_CHANGESは、その後の refinement によって Issue body へ反映済みです。#issuecomment-5993284332はissue-refinement-loopの structured termination report / audit telemetry として扱ってください。LOOP_HANDOFF_RESULT_V1や refinement のapprovedcomment 自体を implementation authorization packet として扱わないでください。今回の implementation authorization はこの prompt によるユーザー指示です。それでも Step 1 の起動可否は current
impl-review-loopの Root-Owned Synchronous Entry Transition で fresh に確定してください。明示的に承認する通常作業
この依頼の範囲で、以下を人間への iteration ごとの再確認なしで実行してよいです。
git fetchと currentmain/ remote refs の fresh readimpl-review-loopが要求する capability preflight と Root-Owned Synchronous Entry Transitionartifacts/への runtime evidence 生成open-prroute による pushimplementation-workertest-runnerpr-reviewerimplementation-workerrepair modeBEHIND時の canonicalupdate_branchissue-creatorによる follow-up Issue 起票ただし次は承認していません。
最初に current Skill と正本を読む
過去 transcript の procedure を再利用せず、current HEAD から最低限以下を読んでください。
.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/steps/step-2-verification.md.claude/skills/impl-review-loop/steps/step-4-pr-review.md.claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md.claude/skills/impl-review-loop/steps/step-5-mergeability-handling.md.claude/agents/implementation-worker.md.claude/agents/test-runner.md.claude/agents/pr-reviewer.md.claude/skills/implement-issue/SKILL.md.claude/skills/pr-review-judge/SKILL.mddocs/dev/workflow.md.claude/agents/issue-creator.mdと.claude/skills/create-issue/SKILL.mdcurrent Skill / deterministic script / router が authority としている判断を prose で再実装しないでください。
fresh intake
開始時に少なくとも以下を fresh に取得してください。
mainHEADSubagentHandback/handbackReport/ causal-evidence producer・consumer・testsscripts/claude-gpt/launch.shの current stateRoot-Owned Synchronous Entry Transition
Step 1 を直接 dispatch しないでください。
current
impl-review-loopの正本どおり、root/main thread 自身が同じ continuous invocation の中で:capability preflight → live Issue fetch → current-run issue-contract-review → 直後の live re-fetch → routing decision → 条件成立時だけ Step 1 dispatchを実行してください。
refinement comment、artifact、digest、
LOOP_HANDOFF_RESULT_V1を Step 1 authorization の代わりにしないでください。pre-Step-1 duplicate dispatch 防止
worker / worktree / new PR を作る前に、current
implementation_landed_evidence.py系の Evidence-Based Landing Disposition を canonical に評価してください。producer が返す disposition /
start_data_plane/ action を自己解釈せず使ってください。existing_pr_resume→ 既存 PR / branch / worktree を再利用し、新規 PR を作らないimplementation_already_landed→ duplicate implementation を開始しないalready_satisfied→ canonical recommendation を返し、PR / Issue を勝手に close しないreconciliation_required→ evidence を reconciliation し、無理に worker を dispatch しないordinary_dispatch_or_explicit_recovery→ 通常 Step 1prompt 作成時には #2941 PR は見つかっていませんが、この観測を前提に shortcut しないでください。
SubAgent completion barrier
canonical loop の各 SubAgent を必ず使用してください。
主に:
implementation-workertest-runnerpr-reviewer必要なら current Skill が認める別 SubAgent を使って構いません。
ただし SubAgent を dispatch しただけでその工程を完了扱いにしないでください。
各 dispatch ごとに:
依存関係がある Step 1 → Step 2 → Step 4 → Step 5 は順序を守ってください。
独立した read-only 調査だけは必要なら並列化して構いません。
#2941 固有の implementation 方針
live Issue body が最終 authorityです。以下は特に取り落とさないでください。
1. fix 前の runtime observation と最終 acceptance run を混同しない
Issue が要求する「fix 前の 2.1.289 live 観測」は root-cause investigation 用です。
provenance semantics を変更する前に、必要なら最小の additive diagnostic
agent_transcript_rejected_reasonだけを先に実装して、2.1.289 の実 stream を観測してください。
そこで以下のどこに marker が存在するかを確認してください。
SubagentStop.last_assistant_messageAgentresulttool_use_result.handbackReport.textSubagentHandback.tool_input.messageこの investigation run が現行 defect により
no_evidenceになること自体を、final AC1 / AC3 PASS と混同しないでください。観測結果は PR body または Issue comment へ記録してください。
2. hypothesis を observation より優先しない
current official Claude Code contract と current main precedent は
SubagentHandback.tool_input.messageが本命ですが、Issue contract 自身が「有力仮説」としています。live 2.1.289 observation で actual marker source が異なるなら、推測で
SubagentHandbackfix を続行しないでください。Issue の Stop Condition に従い、観測 evidence を残して canonical stop / re-refinement route に入ってください。
3. SubagentHandback 対応は既存 correlation に束縛する
live observation が仮説を確認した場合のみ、
SubagentHandback.tool_input.messageを causal-evidence marker provenance source に追加してください。最低限、current Issue が要求している既存の fail-closed semantics を維持してください。
agent_idparent_tool_use_idtranscript gate を緩めることで green にしないでください。
primary child-scoped evidence だけで provenance が成立する場合に transcript が audit metadata である、という #2848 からの semantics を維持してください。
4. additive audit fields
Issue body の指定どおり:
agent_transcript_rejected_reasonmarker_provenance_subagent_handback_used: trueを、既存
marker_provenance_handback_report_usedと同じ additive audit-field 慣習に収めてください。新 schema / receipt / publisher / compatibility framework は作らないでください。
5. fixture の false-green を防ぐ
新規 test file:
scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_2_1_289_causal_evidence.pyは live Issue の exact fixture requirements を満たしてください。
positive case では marker を
SubagentHandback.tool_input.messageにのみ置き、last_assistant_messageは marker のない closing text または欠落、Agent completed result は短い delivery notice、transcript は missing の shape を固定してください。negative controls も Issue body に列挙された:
parent_tool_use_idmismatch / missingを固定してください。
transcript fallback が実際に必要な case だけ、missing / outside-root / stale / symlink が
no_evidenceになることを検証してください。6. precedent は reuse するが scope は吸収しない
PR #2932 / current main の:
_nr_text_blocksscripts/claude-gpt/auto_mode_canary.pyは read-only precedent として使ってください。
#2932 / #2938 の ownership を #2941 に吸収しないでください。
generic compatibility layer に一般化しないでください。
Allowed Paths
live Issue body の Allowed Paths を hard boundary としてください。
現時点の contract では:
scripts/agent-ops/run_worktree_agent_runtime_smoke.pyscripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_2_1_289_causal_evidence.pyのみです。
開始時に live body から再取得してください。
既存 fixture prompt、docs、Skills、Agents 等を「ついでに直す」ことは禁止です。
Allowed Paths 外の変更が必要なら Issue Stop Condition に従ってください。
Verification
Step 2 は current
step-2-verification.mdの正規経路を使ってください。live Issue body から Verification Commands を fresh に抽出し、
adjudicate_vc_result.py extract-vc-metadataの canonical parse-only route で(ac, raw_command, command_hash)triplet を得てください。root はそれを
test-runnerへ逐語で渡し、test-runner 側で AC label / command / hash を推測・再計算させないでください。全 SubAgent completion を待ってください。
特に #2941 は AC1 / AC3 が
runtime_onlyです。baseline で runtime_only が defer された事実を、post-implementation verification の免除として使わないでください。
final implementation head では Issue の AC1 / AC3 runtime verification を実際に実行してください。
final head の AC1 / AC3 が SKIP / FAIL なら PASS と扱わず、Issue Stop Condition に従ってください。
pytest や fake Claude の green だけで AC1 / AC3 を満たしたことにしないでください。
runtime artifact:
artifacts/runtime-smoke/claude-2-1-289-causal-evidence/summary.mdは worktree-local evidence とし、main へ commit しないでください。
current runtime が 2.1.289 でない、
scripts/claude-gpt/launch.shが利用不能、または Issue が定義する runtime environment を満たせない場合も、推測で代替せず current contract の SKIP / Stop Condition に従ってください。current-head gate
Step 4 の
pr-reviewer起動直前に current Skill の canonical current-head gate を必ず通してください。PR head / live Issue body SHA / literal Verification Command hashes の binding が Step 2 adjudication と一致しない場合は reviewer を起動せず、fresh Step 2 に戻ってください。
TEST_VERDICT comment / artifact だけで gate を開かないでください。
PR 作成・更新
実装が必要なら
1 Issue = 1 PRを守り、current canonicalopen-prroute で Draft PR を作成してください。既存対象 PR が発見された場合は新規作成せず再利用してください。
PR body には少なくとも:
agent_transcript_rejected_reasonの actual valueを current template / Skill の契約に従って記録してください。
PR review / fix loop
Step 4 は必ず
pr-reviewerを使用し、terminal completion を待ってください。reviewer は read-only review authority であり、編集 worker と混同しないでください。
REQUEST_CHANGESの場合は停止せず、currentroute_loop_verdict_v2()の route がcontinue_loopなら blocker を exact fix_delta としてimplementation-workerに渡してください。修正後は:
new head → fresh Verification → current-head adjudication → fresh PR reviewを必ずやり直してください。
古い reviewer result を新 head へ流用しないでください。
BEHINDなら canonicalupdate_branch→ verification → review。stale reviewed HEAD なら current head で re-review。
BLOCKED/UNSTABLE/DRAFT等を prose だけで即 human escalation に変換せず、current Skill の deterministic route に従ってください。iteration 上限は current Skill の bounded policy に従ってください。
CI
PR 作成・更新後は current-head の required CI を fresh に確認してください。
prompt 作成時点の branch-protection context 名を固定せず、その時点の required checks を fresh に取得してください。
修正可能な通常 CI failure は、Issue scope / Allowed Paths 内であれば loop 内で修正し、new head で再検証してください。
CI の old-head green を current head の証拠として使わないでください。
recurrent defect / 再発防止 Issue
実装・runtime observation・test・review の途中で、#2941 の narrow fix とは別 ownership の 具体的かつ再発可能な defect が見つかった場合は放置しないでください。
ただし一般論だけで Issue を増やさないでください。
次をすべて満たす場合だけ follow-up Issue を起票してください。
該当する場合は root/main thread から
issue-creatorを dispatch し、currentFOLLOW_UP_ISSUE_REQUEST_V1/create-issuecanonical route を使ってください。raw
gh issue createを直接組み立てないでください。issue-creatorの terminal completion を待ち、起票後は GitHub で number / URL / body / dedupe relation を readback してください。follow-up Issue を理由に #2941 の scope を広げないでください。
follow-up が必要という事実自体が live #2941 の Stop Condition に該当する場合は、Issue 作成後にその canonical Stop Condition に従ってください。
逆に、新しい独立 recurrent defect が具体化していないなら「再発しそう」という一般論だけで追加 Issue を作らないでください。
人間承認を要求しない通常ケース
以下だけを理由に iteration 途中で私へ確認を求めないでください。
REQUEST_CHANGESBEHINDhuman_review_required: true自己申告current Skill の bounded repair route が存在するなら自律的に進めてください。
genuine hard stop
停止するのは current Issue / current Skill が定める genuine hard stop のみです。
特に:
の場合です。
終了地点
目標は merge ではなく merge 直前です。
current
impl-review-loopの terminal condition:APPROVEまで進め、
IMPL_REVIEW_LOOP_RESULT_V1.status: draft_pr_ready相当で終了してください。merge / auto-merge は実行しないでください。
最終報告
最後に簡潔に、ただし evidence を欠かさず報告してください。
mainHEADlast_assistant_messagehandbackReport.textSubagentHandback.tool_input.messageのどれが actual marker source だったか
agent_transcript_rejected_reasoncausal_evidence_sourceimplementation-workerterminal resulttest-runnerterminal resultpr-reviewer各 iteration の terminal verdictdraft_pr_readyalready_satisfied調査や implementation-worker dispatch だけで終えず、SubAgent の terminal completion と downstream verification を最後まで join し、current repository-native
impl-review-loopの terminal state までこの turn で完遂してください。この版では、古い refinement
REQUEST_CHANGESを現在の veto と誤認しないこと、同時に refinement のapprovedmarker を実装 authorization と誤用しないことを明示しています。さらに #2941 固有の「fix前 observation」と「final AC runtime」を分離しているので、baseline failure を acceptance failure と混同しにくい構成です。squne121 commentedon Oct 5, 2026
実装 fix 前の live 観測結果(Stop Condition 発火: 有力仮説が成立しない)
impl-review-loop の Step 1 で、diagnostic のみ(
agent_transcript_rejected_reasonの加算出力)を入れた状態で、Claude Code 2.1.289 の AC1 runtime コマンドを 3 回実行した。結果は 3 回とも exit 1 /causal_evidence_source='no_evidence'で、これは root-cause 観測であり AC1/AC3 の PASS ではない。agent_transcript_rejected_reason:missing(--no-session-persistence下ではagent-<id>.meta.jsonのみで.jsonlが無い。primary source が provenance を供給できるなら正常な状態で、root cause ではない)SubagentStop.last_assistant_message: payload に key 自体が無いAgentresult のhandbackReport.text: 存在するが内容はagent_terminal_state: insufficient_context — PR番号が指定されていません。SubagentHandback.tool_input.message: 存在するが同じinsufficient_context文input.prompt、task_started、child の user prompt、parent の Agent tool_result のtool_use_result.prompt)。child 出力としては存在しない。SubagentHandback(child lineage、success:true)と旧handbackReportが併存している。parser が配信形を読み落としている証拠は得られなかった。pr-reviewerpersona が smoke prompt の「marker を 1 行返す」指示に従わずinsufficient_contextを返しているため、marker が child 側に生成されていない可能性が高い。なお raw stdout のexpected_markers_missingが空になるのは prompt echo に marker が含まれるためである。Issue の Stop Condition「fix 前の live 観測で marker の actual source が
SubagentHandback.tool_input.messageではないと判明した場合」に該当するため、Phase 2 の fix は実装していない(commit / push / PR なし)。contract の再 refinement を求める。worktree-local の証跡(未 commit):
.claude/worktrees/issue-2941-claude-2-1-289-causal-evidence/artifacts/(raw-capture/raw_stdout.jsonl、runtime-smoke/*/summary.md)。diagnostic の 10 行は同 worktree に未 commit で残している。merge / auto-merge は行っていない。squne121 commentedon Oct 5, 2026
推奨アクションは、#2941 をいったん
issue-refinement-loopに戻し、今回の live evidence で contract を再構成した後、fresh な Root-Owned Synchronous Entry を通してimpl-review-loopを再開する、です。今回の停止は妥当です。実測では marker は child output に存在せず、
pr-reviewerはinsufficient_contextを返しています。貼り付けたテキスト(1) current repository のpr-reviewerはpr_number必須で、欠落時は停止する契約なので、marker-only smoke prompt と persona contract が衝突しています。一方、Claude Code の現行公式 Hooks docs は v2.1.271+ のSubagentHandback.tool_input.messageが report 本体になること自体は引き続き明記しています。つまり「delivery channel の仕様」は正しいものの、「そこに marker が生成される」という #2941 の仮説が今回の fixture では成立していません。[Claude](https://code.claude.com/docs/en/hooks)また、prompt echo だけで
expected_markers_missing == []になり得る再発性のある false-green は #2941 とは分離すべきなので、重複検索の上で **#2944「runtime smoke の expected_markers_missing が prompt echo を child marker と誤認する false-green を除去する」**を起票済みです。#2941 の再 refinement ではこの Issue を関連 Issue として扱い、同じ問題を重複起票しないようにします。以下を、現在 auto mode で開いている対話的 Claude Code にそのまま貼ってください。
repo =
squne121/loop-protocol対象:
issuecomment-5993485179issuecomment-5992934403issuecomment-5993284332使用する repository-native Skills:
.claude/skills/issue-refinement-loop/SKILL.md.claude/skills/impl-review-loop/SKILL.mdこの対話的 Claude Code session は既に auto mode で起動済みです。
現在の session をそのまま継続してください。
新しい session の起動、
/clear、permission mode の変更、bypassPermissions、--dangerously-skip-permissions等は不要で、要求していません。目的
前回
impl-review-loopが正しく Stop Condition に到達したため、まず #2941 の contract を今回の live evidence に基づいて currentissue-refinement-loopで再 refinement してください。refinement が canonical に
approved/ implementation-ready まで到達した場合は、この prompt 自体を今回の implementation authorization として扱い、fresh な Root-Owned Synchronous Entry Transition と Evidence-Based Landing Disposition を改めて実行した上で、currentimpl-review-loopを再開してください。最終到達点は:
re-refinement → fresh implementation entry → implementation → verification → PR review → fix → re-verification → fresh re-review → draft_pr_readyです。
実 merge / auto-merge は行わないでください。
通常の iteration ごとの人間承認は不要です。
authority / provenance
最初に以下を fresh に再取得してください。
origin/main/ current main HEAD5993485179prompt 作成時点では main HEAD は
306086d881a7affed9ef7b3fd5ae5d1df3a22f81でしたが、authority として固定せず fresh read を優先してください。comment 5993485179 の provenance
comment
5993485179は前回impl-review-loopが生成した agent implementation report / runtime evidence report です。GitHub 上の投稿者 identity が OWNER であっても、その comment 自体を direct human-context と誤分類しないでください。
5993485179は fact-check 対象の agent report / evidenceissue-refinement-loopの origin rules に従うpreflight.run.with_human_contextの要件を満たさない agent report を human-context lane に偽装しないpreflight.run.with_agent_reportを要求するならそれを使用するmutation authorization と evidence provenance を混同しないでください。
Phase A — #2941 の re-refinement
current
.claude/skills/issue-refinement-loop/SKILL.mdと必要な references を current HEAD から読み直して、その canonical procedure を実行してください。過去 session の Skill 内容、command、schema、agent role を記憶だけで再利用しないでください。
今回 fact-check すべき live evidence
前回の worktree がまだ存在する場合:
.claude/worktrees/issue-2941-claude-2-1-289-causal-evidenceを read-only evidence source としてまず確認してください。
削除・reset・clean・上書きする前に以下を確認してください。
artifacts/raw-capture/raw_stdout.jsonlartifacts/raw-capture-run2/raw_stdout.jsonlartifacts/runtime-smoke/*/summary.mdscripts/agent-ops/run_worktree_agent_runtime_smoke.pyの未 commit diagnostic 10 行前回報告を自己申告だけで信用せず、raw stream と current source で独立に fact-check してください。
確認対象:
SubagentStop.last_assistant_messagetool_use_result.handbackReport.textSubagentHandback.tool_input.messageagent_transcript_rejected_reason前回観測では marker は actual child output には無く、prompt echo にだけ存在しました。この結論が raw evidence と一致するか確認してください。
最重要の contract 再評価ポイント
1.
pr-reviewerpersona と fixture の整合性current
.claude/agents/pr-reviewer.mdを読むこと。current repository では
pr-reviewerは PR review 専用 persona であり、pr_numberが必須で、欠落時はinsufficient_contextを返す契約になっているはずです。さらに、#2848 で現在の handback provenance fixture が導入された時点の
pr-reviewer.mdも必要なら git history で確認してください。marker-only prompt を strict-purpose
pr-reviewerへ送る smoke 自体が persona contract と矛盾していないかを明示的に判定してください。これは model が prompt に「従わなかった」という曖昧な説明で済ませず、repository-owned Agent contract と fixture contract の semantic mismatch として調査してください。
2. neutral / general-purpose agent precedent
repository 内で、単純 marker echo / lifecycle smoke に
general-purposeSubAgent を使っている precedent を調査してください。少なくとも次のような current assets を確認対象にしてください。
scripts/claude-gpt/runtime_smoke_test.sh.claude/skills/worktree-agent-runtime-smoke/fixtures/named-subagent-resume.prompt.md#2941 の最小修正が、
general-purpose等の contract-compatible agent に変更するのどれなのかは、repository precedent と live runtime evidence を見て決めてください。
先に結論を固定しないでください。
3. parser bug と invalid fixture を分離する
current upstream Claude Code docs も fresh に確認してください。
特に v2.1.271+ の:
SubagentHandback.tool_input.messagecontentSubagentStop.last_assistant_messageの semantics を一次資料で確認すること。
ただし、
「
SubagentHandback.tool_input.messageが report channel である」ことと、
「今回の marker がそこに存在する」
ことを同一視しないでください。
contract は最低限、次の順序で検証可能になるよう再設計してください。
handbackReport.text/SubagentHandback.tool_input.message/last_assistant_messageのどこに存在するかを確認例えば valid marker が legacy
handbackReport.textにも現れ、既存 #2848 path だけでhook_id_correlatedになるなら、不要な SubagentHandback parser fix を実装しないでください。逆に marker が
SubagentHandback.tool_input.messageにだけ存在し、既存 parser が読み落とすことを live evidence で確認できた場合は、その evidence に束縛して最小 parser fix を contract 化してください。4.
agent_transcript_rejected_reason前回観測の
missingは--no-session-persistenceの正常形になり得ます。primary child-scoped evidence が成立する場合に transcript 欠落を root cause と扱わない、という既存 semantics は維持してください。
diagnostic field 自体が有用なら、additive audit field として残すかどうかを current contract で明示してください。
5. Allowed Paths / AC / Verification Commands
現行 #2941 は parser + new test file だけを Allowed Paths としていますが、fixture/persona mismatch が root cause ならその scope は不足しています。
必要なら Issue body を rewrite して:
のうち 本当に必要な最小集合へ Allowed Paths を更新してください。
不要な generic compatibility layer、新 schema、新 harness、新 approval layer は追加しないでください。
AC は false-green を避けるため、
を必要に応じて分離してください。
「marker が prompt text に含まれる」だけの検査を runtime PASS の根拠にしないこと。
SubAgent 利用
current
issue-refinement-loopplanner が要求する SubAgent を使用してください。特に必要なら:
codebase-investigatorweb-researcherを利用してください。
両方 required なら independent work は並列化して構いません。
ただし dispatch しただけで完了扱いにしないでください。
各 SubAgent について:
を明示してください。
terminal completion を必ず待ち、final result を取得してから Step 2 へ進んでください。
background task / root review pipeline も current Skill が completion join を要求する場合、launch 時点ではなく実 completion JSON / task notification を join してから routing してください。
SubAgent の self-report は必要に応じて親 thread が repository evidence / raw artifact で独立検証してください。
Issue rewrite
current canonical
issue-refinement-loopが body rewrite を要求したら、controlled repository-native route で実行してください。この prompt により、#2941 の以下を iteration ごとの再承認なしで更新して構いません。
ただし raw
gh issue edit等で canonical controlled route を迂回しないでください。rewrite 後は必ず:
を取り直してください。
stale な previous
approvedcomment は新 contract の implementation authorization として使わないでください。再発防止 Issue
prompt-echo false-green については既に Issue #2944 を起票済みです。
#2944 は:
expected_markers_missingが Agent prompt / task metadata / child user prompt /tool_use_result.prompt等の prompt echo だけで green になり得る問題を所有します。
同じ問題の duplicate Issue は作成しないでください。
#2941 の refinement / implementation では #2944 を関連 Issue として参照するだけにしてください。#2944 の implementation を今回の #2941 scope に吸収しないでください。
今回の調査で #2944 とは別の recurrent/systemic defect が確認された場合のみ:
してください。
follow-up Issue は具体的な:
を持たせてください。
worktree の扱い
前回 worktree と diagnostic / artifacts は今回の root-cause evidence です。
refinement 前に削除しないでください。
ただし refinement 後の implementation で、その dirty worktree を無条件に authority として継続しないでください。
fresh contract と current
impl-review-loopの intake / landing / worktree ownership rules に従って:してください。
force reset / force push / destructive cleanup は要求していません。
他 Issue / foreign branch / foreign worktree の dirty work を変更・削除しないでください。
Phase A terminal
issue-refinement-loopを canonical terminal state まで完遂してください。通常の
needs-fixは max iteration まで自動 rewrite / re-review を続けてください。単なる SubAgent の
human_review_required: true自己申告だけで停止しないでください。停止権限は current canonical router / Skill の定義に従ってください。refinement が genuine:
等の terminal state に到達するまで進めてください。
Phase B — approved 後の implementation
Phase A が implementation-ready で終了した場合、この prompt は #2941 の implementation を続行する明示的な人間 authorization でもあります。
ただし refinement termination report 自体を authorization token として扱わないでください。
current
impl-review-loopの Root-Owned Synchronous Entry Transition を fresh に実行し:から Step 1 起動可否を決定してください。
次に Evidence-Based Landing Disposition を fresh に実行してください。
既存 PR / branch が存在するなら canonical disposition に従って reuse し、duplicate PR を作らないでください。
authorization が成立した場合のみ:
implementation-worker → test-runner → pr-reviewer → routingへ進んでください。
implementation/review loop で明示的に承認する通常作業
以下は iteration ごとの追加承認なしで実行して構いません。
git fetchREQUEST_CHANGES修正update_branchBEHIND解消implementation-worker/test-runner/pr-reviewerは必ず terminal completion まで待って final result を取得してください。SubAgent dispatch だけで downstream へ進まないでください。
pr-reviewerには必ず current PR number と reviewed head SHA 等、current agent contract が要求する context を明示してください。通常の REQUEST_CHANGES や deterministic failure は bounded loop 内で自律修正してください。
修正後は必ず fresh HEAD に対して再 test / fresh review を行ってください。
禁止 / genuine hard stop
以下は承認していません。
bypassPermissions--dangerously-skip-permissions停止するのは current canonical workflow が genuine hard stop と判定する場合だけです。
通常の test failure、CI failure、REQUEST_CHANGES、BEHIND、stale review、修正可能な implementation error は停止理由ではありません。
implementation の終了地点
目標は merge ではありません。
current
impl-review-loopの terminal conditionを満たして:した
draft_pr_ready、または exact canonical hard-stop reason まで進めてください。merge / auto-merge は絶対に実行しないでください。
最終報告
最後に以下を簡潔に、evidence 付きで報告してください。
refinement
5993485179provenance classificationpr-reviewerpersona/fixture mismatch の最終判定implementation
agent_transcript_rejected_reasoncausal_evidence_sourcefollow-up
最後に必ず:
ことを明記してください。
調査・SubAgent dispatch・Issue rewrite の途中で終了せず、各 SubAgent / background task の terminal completion を join し、canonical terminal state までこの session で進めてください。
この prompt の重要点は、#2941 の parser fix を既定解にしないことです。まず contract-valid な SubAgent が marker を実際に生成する smoke を成立させ、その後の実 stream だけを根拠に parser 修正の要否を決めさせています。これで今回の Stop Condition を迂回せず、そのまま次の実装可能状態まで自律的に戻せます。
[-]実装: Claude Code 2.1.289 で runtime smoke の SubAgent causal evidence が no_evidence になる parser を是正する[/-][+]実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる[/+]squne121 commentedon Oct 5, 2026
issue-refinement-loop 終了報告: approved(再 refinement)
Issue #2941 の contract を、停止報告(https://github.com/squne121/loop-protocol/issues/2941#issuecomment-5993485179、agent implementation report。human context ではなく fact-check 対象の evidence として
preflight.run.with_agent_reportで扱った)と今回の live 再検証に基づいて再構成し、approvedで終了する。この終了は implementation 開始の代替承認ではなく、本 comment 自体も authorization token ではない。root cause の分類
parser の欠陥ではなく、fixture と repository-owned agent contract の semantic mismatch である。
.claude/agents/pr-reviewer.mdはpr_numberを必須とし欠落時はinsufficient_contextで停止する。fixture はpr-reviewerに marker 1 行だけを返させpr_numberを渡さない。この不整合は fixture 導入時(#2848 / PR #2849、commitab2d9238)から存在する。独立 fact-check の結果
SubagentHandback.tool_input.messageと legacyhandbackReport.textの両方でinsufficient_contextを返している。SubagentStopにlast_assistant_messageの key は無い。agent_transcript_rejected_reasonはmissing(--no-session-persistenceの正常形)。general-purposeに替えた fixture のコピーの live run(2.1.289): exit 0、child_agent_type_observed: general-purpose、marker_provenance_verified: True、marker_provenance_transcript_fallback_used: False、causal_evidence_source: hook_id_correlated、marker_provenance_handback_report_used: True。valid な child 出力があれば既存の 実装: runtime smoke の marker provenance を SubagentStop の last_assistant_message 欠落時に handbackReport へ適応する(Claude Code 2.1.285 対応) #2848 経路だけで成立するため、SubagentHandbackを読む parser 修正は不要と判定した。runtime_smoke_test.shはgeneral-purpose、実装: runtime smoke の --expect-marker が二重引用符を含む literal で expected_markers_missing と marker provenance を同時に満たせない不整合を是正する #2923 の fixture はtest-runnerを使う。codebase-investigator(terminal completed。fixture 参照・runner の--agent-type照合・legacy 経路の trace は親 thread が grep と live run で独立に再検証し、一部の行番号や記述は採用しなかった)、web-researcher(terminal completed。2.1.285〜2.1.289 の release が存在しないとする記述が実機の 2.1.289 と矛盾するため dispositive な根拠として不採用。contract は実測 evidence にのみ束縛した)。contract の主要 delta(rewrite 1 回)
scripts/agent-ops/tests/fixtures/subagentstop_handback_provenance_smoke_prompt.mdのみSubagentHandback.tool_input.messageの追加、agent_transcript_rejected_reason/marker_provenance_subagent_handback_used)は Out of Scope。fixture の起動先をgeneral-purposeに変更child_agent_type_observed)・child-scoped provenance・transcript fallback 非依存・hook_id_correlated・marker の actual source を分離。prompt echo だけを根拠にしない。static は fixture の起動指示、regression は既存 3 test file経緯
306086d881a7affed9ef7b3fd5ae5d1df3a22f81/ final6b59f108fe8905728f392462c8c3bc4f273906b2aac7a9762c197300c304645bafd6aff1ce338b00e3130d43ba0584b2a23d07b8→ final12af2d7b89c53de0e81033efd058b3e2c295975664f42792e4365a88440ddf9fissue-editor/edit_issue_txn.py(status ok、title も反映)。live readback で本文が candidate と一致することを親 thread が確認preflight.run: pass / proceed。fresh Step 2: approve / proceed(blocker 0、body sha 一致)。Step 2.5: applicable false(明示シグナルなし)のため skiproot_entry_router.py、live equality 成立)dedupe / follow-up
prompt echo による false-green は #2944 が所有する。本 Issue は #2944 を関連 Issue として参照するだけで scope を吸収しておらず、重複起票もしていない。追加の独立した recurrent defect は確認していない。
squne121 commentedon Oct 5, 2026
implement-issue: 実装完了
.claude/worktrees/issue-2941-claude-2-1-289-causal-evidenceworktree-issue-2941-claude-2-1-289-causal-evidence0c3c4f834455d9d1d3e63282fe0e9b9f69dcb2f3squne121 commentedon Oct 5, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality