Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: research
parent_issue: "none"
goal_ref: "runtime smoke の structured run で同一 child agent_id の duplicate_completions が生成された channel(hook / tool_result / task-notification / parser / transport / upstream)を raw event 証跡付きで特定し、最小修正の ownership を確定する"
change_kind: research-onlyParent Issue
none
Background
#2941 / PR #2946 の incident head 上の canonical AC1(runtime_only)で、非決定的と見られる FAIL が観測された。2026-10-05 に実測した事実を以下に記す。以下は historical evidence であり、原因はまだ特定されていない。
-
head の区別(2026-10-06 の live 値): incident / failing head は
6736a926b2c93259976aace06d437d635b7d1bd3、PR fix: runtime smoke fixture の child 起動先を general-purpose に是正し 2.1.289 で hook_id_correlated を成立させる (#2941) #2946 の current head は0fbc32e03e377b36d5800c940ab8311479c8cf46(6736a926より 2 commit 先で、差分はcreate-issueSkill / 文書 / test の main 追随のみ。runner / launcher / fixture には触れない)、main は14ae6126b56201cacae71fae2b622cf05b910077である。本 Issue の diagnostic は incident head に対するものであり、current-head verification ではない。 -
失敗した head(incident head): PR fix: runtime smoke fixture の child 起動先を general-purpose に是正し 2.1.289 で hook_id_correlated を成立させる (#2941) #2946 の
6736a926b2c93259976aace06d437d635b7d1bd3(238c26c1と maindfc29724の merge commit)。fixture はscripts/agent-ops/tests/fixtures/subagentstop_handback_provenance_smoke_prompt.md(general-purposeを foreground で 1 回起動する)。 -
実行環境: Claude Code
2.1.289 (Claude Code)。underlying binary は/home/squne/.local/bin/claude(realpath/home/squne/.local/share/claude/versions/2.1.289)。--claude-adapter claude-gpt、--claude-bin "$PWD/scripts/claude-gpt/launch.sh"、CLAUDE_GPT_CLAUDE_BIN/CLAUDE_CODE_FORK_SUBAGENT/CLAUDE_CODE_DISABLE_BACKGROUND_TASKSはいずれも ambient で未設定。 -
失敗 run の summary(
run_id5ce699c75585、native_event_count55):exit_code: 1、process_exit_code: 0、child_agent_id/child_session_idはa8bcdb5faaae506a2、child_agent_type_observed: general-purpose、child_terminal_status: completed、child_completion_source: tool_use_result_status_completed。multi_child_lifecycleはverified: False、spawned_agent_ids/completed_agent_ids/paired_agent_idsがいずれも['a8bcdb5faaae506a2']、duplicate_completions: ['a8bcdb5faaae506a2']、orphan_startsとunknown_childrenは空。subagent_causal_evidenceはagent_id: None、subagent_start_observed: True、subagent_stop_observed: True、tool_invocation_id_correlated: False、marker_provenance_verified: False、marker_provenance_transcript_fallback_used: True、causal_evidence_source: no_evidence。 -
直前までの PASS run(同一 head・同一 prompt・同一 resolved launcher):
run_ida20716c7121c(native_event_count49)でexit_code: 0、duplicate_completions: []、causal_evidence_source: hook_id_correlated、marker_provenance_handback_report_used: True、child はa97d2c63c88810062。同系統の run は旧 head238c26c1でも PASS が複数回あり、観測された 5 run のうち FAIL は 1 回だった。 -
保全済みの incident artifact(調査用の read-only コピー。元は worktree-local で gitignore 済み): failing summary は
.claude/worktrees/issue-2941-claude-2-1-289-causal-evidence/artifacts/runtime-smoke/subagentstop-handback-provenance-fixture/summary.md。runner はsummary.mdと(任意の)--evidence-jsonの派生値しか保存せず、raw stdout や hook payload は保存しない。したがって duplicate が実際にどの stream line で発生したかは現時点で未確定である。 -
current runner の semantics(
scripts/agent-ops/run_worktree_agent_runtime_smoke.py、origin/maindfc29724):classify_claude_multi_child_lifecycle()は stop を 3 つの独立 channel(hook のSubagentStop、userevent のtool_use_result.status == "completed"、task-notification の<status>completed</status>)に分けて集め、duplicate 判定を「各 channel の内部」に限定している。docstring が 実装: worktree-agent-runtime-smoke で claude-gpt の同一 Herdr session multi-turn / 複数 SubAgent lifecycle を fail-closed に証明する #2219 AC12 を引き、この repo の project hook により 1 回の real completion は hook channel と tool_result channel の両方で 1 回ずつ観測されるため、cross-channel の corroboration は duplicate として扱わないと明記している。task-notification channel は set なので 1 件までしか寄与しない。cross-channel overlap は duplicate ではない、という契約は既存 test(test_run_worktree_agent_runtime_smoke_operator_journey.pyの hook と tool_result の corroboration、同一 hook channel の二重 Stop の test)で固定されているが、tool_result channel の二重 completed と task-notification の二重 ingest を固定する test は見つかっていない。 -
duplicate がどの channel で成立したかは未確定である。候補は、hook channel 内の同一 agent_id の二重発火、tool_result channel 内の二重発火(同一 agentId の
completeduserevent が複数)、parser による同一 raw event の二重 ingest、launcher / proxy による stream の重複、upstream の lifecycle anomaly、その他である。structured lane の stdout は 1 回しか取り込まれず extractor は同じ文字列を再 parse するだけなので、source 上は parser の二重 ingest は成立しにくいが、これは source 読解であり実測ではない。決め打ちしない。 -
agent_id: Noneのままchild_agent_idが埋まる理由(source 読解):child_agent_idはclassify_claude_child_spawn_agent_idが tool_use_result の agentId から導出するのに対し、subagent_causal_evidence.agent_idは hook の Start/Stop がともにちょうど 1 件の agent_id だけが candidate になる。同一 agent_id の Stop が 2 件以上あるか、hook event が contradictory /agent_id=Noneだと candidate が残らずno_evidenceになる。また lifecycle FAIL が先にexit_codeを 1 にするため、subagent causal evidence insufficientの error とexpected_markers_missingは出力されない。 -
upstream の関連 evidence(
anthropics/claude-code、いずれも一次情報を fresh に確認済みだが、同一 defect とは断定しない): #89555(open、2026-08-25)は SubagentStop が SubagentStart と別のagent_id(新しい id、空のagent_type)で親の Stop の 2〜7 秒後に届く事象、#90662(open、2026-08-29)は subagent 内の PreToolUse / PostToolUse が SubagentStart も SubagentStop もない別agent_idで報告される事象、#78463(open、2026-07-17)は API error burst 中に SubagentStop が出力されず Start と Stop の件数が合わない事象、#21941(closed duplicate、2026-01-30、v2.1.25)は subagent が複数回 completion する事象、#83365(open)は hooks docs のstop_hook_activeの記述が実挙動と異なる事象である。公式 hooks reference は SubagentStop を subagent instance ごとに 1 回と説明しており、v2.1.285〜v2.1.289 の release notes に二重 SubagentStop の修正記載はない。いずれも「同一agent_idの completion が 2 回見える」ことを直接報告するものではなく、agent_id の drift や欠落を報告するものである。 -
dedupe search(2026-10-06、open / closed):
duplicate_completions、multi_child_lifecycle、duplicate SubagentStop / completion、no_evidence hook_id_correlatedで検索し、現在の open Issue に本件を所有するものは存在しない。closed の 調査: Claude Code 2.1.285 で worktree-agent-runtime-smoke の SubAgent causal evidence が no_evidence になる原因を切り分ける #2846(2.1.285 のno_evidence、last_assistant_message欠落、実装: runtime smoke の marker provenance を SubagentStop の last_assistant_message 欠落時に handbackReport へ適応する(Claude Code 2.1.285 対応) #2848 で修正)と 実装: worktree-agent-runtime-smoke で claude-gpt の同一 Herdr session multi-turn / 複数 SubAgent lifecycle を fail-closed に証明する #2219(multi-child lifecycle の導入)は別事象の precedent である。 -
影響:
--require-subagent-causal-evidenceと--expect-marker-source subagentを要求する runtime_only AC、および同じ lifecycle classifier(--require-min-subagents)を使う runtime smoke consumer が、同じ head・同じ入力で非決定的に FAIL し得る。実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 / PR fix: runtime smoke fixture の child 起動先を general-purpose に是正し 2.1.289 で hook_id_correlated を成立させる (#2941) #2946 は、実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 の Stop Conditions(AC1〜AC4 が FAIL なら停止し、原因を修正した新しい head でのみ再実行する)により停止している。 -
実施済みの diagnostic(Issue コメント
issuecomment-6004129575): incident head に対する同一 commit の rerun は、clean batch B(run 21 / 22 / 23、単独・sequential 実行)の 3 回すべてで duplicate が再現せず(native_event_count47、duplicate_completions: []、hook_id_correlated)、証跡として扱える 8 run 中 FAIL は incident の 1 回のままである。batch A は background loop の並走で meta / raw stream が混在したため証跡として採用しない(これは本 Issue の diagnostic procedure に欠けていた再現性条件であり、In Scope に sequential 実行の不変条件として追加する)。失敗 run のnative_event_countは 55 で通常(47〜49)より多いが、raw stream が保存されていないため内容は復元できない。OWNER review(issuecomment-6004641038)に基づき、これ以上の同一 head rerun は行わない。 -
source 読解で絞れる候補空間(2026-10-06 に
run_worktree_agent_runtime_smoke.pyを再読解した current main の semantics。live 実測ではない):extract_claude_task_notification_completions()はset[str]を返すため、raw stream 上で task-notification が二重でもclassify_claude_multi_child_lifecycle()に渡る時点で 1 件に畳まれる。したがって task-notification の二重は current classifier のduplicate_completionsの直接原因候補ではない(hook と同期 tool_result の channel だけが list のまま channel 内 duplicate を検出できる)。subagent_causal_evidence_verdict()は、同一agent_idの Start と Stop がともにちょうど 1 件で、順序・session・prompt・type が矛盾しない candidate が 1 つだけあれば、後続の marker / tool correlation が失敗しても、そのagent_idを diagnostic として保持する。agent_id: Noneになるのは candidate が 0 件または複数件の場合であり、同一agent_idの Start / Stop が複数件、agent_id/ session / type / prompt の不一致、contradictory な hook event などが該当する。失敗 run のagent_id: Noneとsubagent_start_observed: True/subagent_stop_observed: Trueの組は、「正常な唯一の hook pair と tool_result だけの二重」では説明が足りず、hook event の multiplicity または binding の異常を先に疑うべき根拠になる。- 調査の優先順位は、(1) hook event の multiplicity、(2) hook の
agent_id/ session / type / prompt の binding、(3) contradictory な分類、(4)stop_hook_active、(5) 同期 tool_result の completion、(6) parser / stream 境界、(7) pre-runner の transport / upstream とする。source と矛盾する証跡が出た場合は current source を優先する。
-
stop_hook_activeと settings provenance: 公式 hooks reference(https://code.claude.com/docs/en/hooks、2026-10-06 に原文を確認)は、SubagentStop の入力にstop_hook_activeが含まれると記載している。runner の extractor は既にstop_hook_active(bool のみ)を hook event として保存でき、settings_provenance.digest_sha256も既存の summary /--evidence-jsonに出力される。project の SubagentStop hook(session_manifest_coordinator.sh、Task Context のhook_entry.py)は、確認した範囲ではstop_hook_active == trueで即終了し、常に exit 0 の fail-open である。upstream の #83365(v2.1.220 でstop_hook_active: trueを伴う repeated SubagentStop を実測)は version と hook 挙動が今回と同一であるとは確認できていないため、同一原因とは断定せず、次回再現時の比較項目にstop_hook_activeと settings digest を含める根拠に留める。 -
upstream の状態(2026-10-06 に GitHub API で再確認): #83365、#89555、#90662、#78463 は open、#21941 は closed(duplicate)である。#59719 と #70151 は closed(not_planned)で、同一
agent_idの SubagentStop が 2 回届くことを直接報告するものは見つかっていない。
Ownership Boundary
- 実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 / PR fix: runtime smoke fixture の child 起動先を general-purpose に是正し 2.1.289 で hook_id_correlated を成立させる (#2941) #2946: fixture の起動先是正のみを所有する。本 Issue の結果を 実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 の verification evidence としては使わず、実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 の PASS / FAIL 状態を書き換えない。PASS が出ても 実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 の latest canonical FAIL を無効化しない。incident head(
6736a926…)は current PR head(0fbc32e0…)とは別であり、本 Issue の diagnostic を current-head の readiness evidence と表現しない。実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 を unblock する evidence は、その原因を解消する修正を取り込んだ新しい PR head 上でのみ生成できる。実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 の再開は、原因が確定し、必要な修正が exact owner の下で実装され、その修正を取り込んだ新しい PR head が生成され、実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 の contract がその head 上の verification を許可する場合に限る。 - 実装: runtime smoke の expected_markers_missing が prompt echo を child marker と誤認する false-green を除去する #2944:
expected_markers_missingの prompt-echo false-green を所有する。本 Issue は吸収しない。 - 実装: claude-gpt adapter の runtime smoke が launcher の解決した underlying Claude Code binary の version を runtime_version に記録するようにする #2954:
runtime_versionがNoneになる問題を所有する。本 Issue と本 Issue の follow-up は吸収・重複起票しない。 - 調査: 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)、実装: worktree-agent-runtime-smoke で claude-gpt の同一 Herdr session multi-turn / 複数 SubAgent lifecycle を fail-closed に証明する #2219(closed): 2.1.285 の payload 欠落と multi-child lifecycle 導入の precedent であり、本件は所有しない。
- 実装: worktree-agent-runtime-smoke に generic hook-chain evidence capability を追加する #2663(closed): hook-chain の handler 単位 evidence を所有していた precedent であり、失敗時の lifecycle raw event 保全は所有していない。
Outcome
#2941 の失敗 run で観測された duplicate_completions について、次の 2 段階で帰属を記録し、最小修正の ownership を確定した状態にする。
- runner boundary の帰属: どの lifecycle channel(hook / 同期 tool_result)に重複が現れたか、raw stream 自体に重複 event が存在するか、parser が 1 つの raw event を二重計上したか、を raw event 証跡付きの Issue コメント(run ごとの per-channel 比較表を含む)で判定する。判定できない場合は
undeterminedとして残存証跡を記録する。 - pre-runner の帰属: raw stream 自体の重複が実際に再現した場合に限り、underlying Claude の直接実行、launcher 経由、既存の transport / debug evidence を bounded に比較して、upstream の Claude Code、launcher / proxy の transport のどの層かを切り分ける。raw 重複が再現しない場合は、層を推測で決めず
pre_runner_layer: undeterminedと記録する。
最小修正の ownership は次のとおり決める。原因が特定できた場合は、その exact owner(upstream Issue 参照、または runner の follow-up Issue)へ修正を materialize する。原因が undetermined で #2941 がこの incident により停止中のままの場合は、「修正不要」で閉じることを許さず、次回の lifecycle failure で raw lifecycle evidence を失わない最小の durable follow-up ownership(既存 Issue の参照、または dedupe 済みの新規 implementation Issue)を必須とする。ただし、OWNER が #2941 を再開しない旨を明示的に決定した場合はその決定の参照で代えられる。
In Scope
scripts/agent-ops/run_worktree_agent_runtime_smoke.pyのclassify_claude_multi_child_lifecycle()、_pair_agent_lifecycle()、extract_claude_task_notification_completions()、subagent_causal_evidence_verdict()と関連 test の読解(変更はしない)。- 保全済み incident artifact(失敗 run と PASS run の
summary.md)と、実施済み diagnostic(clean batch B の run 21 / 22 / 23)が worktree-local に保存した summary / raw lifecycle excerpt の readback と、field 単位の差分記録。追加の live rerun は行わず、保存済みの証跡を再解析して、hook event の multiplicity と binding(agent_id/ session / type / prompt)、stop_hook_active、既存のsettings_provenance.digest_sha256を比較項目として追補する。 - diagnostic procedure の不変条件(今後 incident 調査で同種の run を行う場合の最小手順。lock、daemon、恒久 harness は追加しない): run は foreground かつ sequential で、前の run のプロセスの terminal completion を確認してから次を開始する。output dir は run ごとに一意とし、既に存在する場合は再利用しない。同一 worktree / output namespace で concurrent な diagnostic loop を走らせない。
- raw lifecycle evidence を保存する場合の範囲: lifecycle に必要な event(SubagentStart / SubagentStop の hook event、
tool_use_result.agentIdを持つuserevent、task-notification)に限り、secret / credential / 無関係な transcript 内容は保存しない。 - attribution の候補モデル(調査の優先順位は Background に記載): hook channel の二重発火または multiplicity / binding の異常、同期 tool_result channel の二重発火、parser の二重計上、raw stream 自体の重複とその pre-runner 層(launcher / proxy の transport、upstream の lifecycle anomaly)、その他。task-notification の二重は current classifier では
setに畳まれるため直接原因候補から外す(「raw の重複 notification は current classifier では dedupe される」ことを固定する regression test は follow-up 候補として扱い、本 Issue では実装しない)。 - upstream の
anthropics/claude-codeIssue と release notes の再確認と、関連 Issue への対応関係の記録(version と hook 挙動が同一である証跡がある場合のみ同一 defect として扱う)。 - 最小修正の ownership の決定と、必要な場合の follow-up Issue の dedupe 検索(open / closed)、既存 owner の参照、または narrow な follow-up implementation Issue の起票(実装自体は含まない)。follow-up の候補範囲は、次回の lifecycle failure 時に、secret / 無関係な transcript を保存せず、lifecycle attribution に必要な raw event だけを、bounded かつ opt-in または failure-focused に保全し、既存の settings provenance と既存の event field を再利用するものに限る。generic な trace platform、恒久的な approval layer、新しい attestation framework、広範な observability の書き換えには広げない。
Out of Scope
- runner、launcher、skill、docs、test の変更(follow-up Issue で扱う)。
- 実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 / PR fix: runtime smoke fixture の child 起動先を general-purpose に是正し 2.1.289 で hook_id_correlated を成立させる (#2941) #2946 の AC1 の再実行、verification 状態の変更、merge readiness の判定、および本 Issue の結果を 実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 の evidence に転用すること。
- 実装: runtime smoke の expected_markers_missing が prompt echo を child marker と誤認する false-green を除去する #2944(prompt echo の false-green)の実装。
runtime_versionがNoneになる問題の実装。- Claude Code の install、downgrade、upgrade。
- foreign worktree / artifact の変更・削除、secret / credential の取得。
- 実施済みの clean batch B を超える同一 head の追加 rerun(新しい evidence が増える見込みが具体的に示される場合を除き行わない)。
- raw task-notification の二重 ingest を固定する regression test などの新規 test の実装(follow-up 候補として記録するに留める)。
- 実装: claude-gpt adapter の runtime smoke が launcher の解決した underlying Claude Code binary の version を runtime_version に記録するようにする #2954 が所有する
runtime_versionの記録、および 実装: runtime smoke の expected_markers_missing が prompt echo を child marker と誤認する false-green を除去する #2944 が所有する prompt-echo の false-green を、本 Issue の follow-up に吸収すること。
Runtime Verification Applicability
decision: immediate
reason: 重複 completion の発生 channel は静的な読解や fake claude では証明できず、実 Claude Code の stream の証跡で判定する必要があるため。証跡は実施済みの実 run(incident と clean batch B の 3 run)の保存物の再解析で扱い、本 refinement では追加の live rerun を行わない。
applicable_acs: [AC1, AC2]
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 が利用可能であること)。失敗した incident commit 6736a926b2c93259976aace06d437d635b7d1bd3(PR #2946 の current head 0fbc32e0… とは別)を checkout した Issue 専用 worktree の保存物を対象とする。新たに live run が必要になる場合も run は foreground かつ sequential で、output dir は run ごとに一意とする。SubAgent が marker を 1 行返すだけの無害な fixture prompt を使い、mutation・外部 code 実行・permission 緩和・credential 利用は行わない。
skip_conditions: claude 実行ファイル、scripts/claude-gpt/launch.sh、uv、または対象 commit の checkout のいずれかが利用不能な場合は SKIP(runner は exit 77 と stdout 先頭 SKIP:)を記録する。SKIP は PASS ではなく Stop Condition として扱う。
fallback_policy: pytest の PASS、fake claude、runner の SKIP、再現しない rerun の結果を原因特定の根拠として扱わない。PASS が出ても #2941 の latest canonical FAIL を無効化せず、全 run の outcome をそのまま記録する。
artifact_requirements: run ごとの runner evidence(summary.md)と lifecycle 用に絞った raw event 抜粋を、worktree-local の artifacts/runtime-smoke/ 配下の Issue 専用 prefix の別 output dir に保存する(main へ commit しない)。新しい schema・receipt・publisher は追加しない。
Acceptance Criteria
- AC1: incident head(
6736a926b2c93259976aace06d437d635b7d1bd3。current PR head0fbc32e0…および main と区別して明記する)に対する実施済みの diagnostic の全 outcome(incident、直前の PASS run、clean batch B の 3 run。batch A は混在のため証跡から除外した旨を含む)が、run ごとの binary / HEAD / ambient 状態、per-channel の件数(hook の Start と Stop、hook event のagent_id/ session / type / prompt の binding と multiplicity、stop_hook_active、tool_result の completion、task-notification の completion、channel ごとの duplicate 件数)、既存のsettings_provenance.digest_sha256、merged lifecycle の分類、marker provenance、causal evidence、exit code とともに、本 Issue のコメントに記録されている。diagnostic procedure の不変条件(foreground / sequential、前 run の terminal completion の確認、run ごとに一意で再利用しない output dir)が明記され、追加の同一 head rerun は行われていない。 - AC2:
duplicate_completionsの帰属が、runner boundary と pre-runner の 2 段階で記録されている。第 1 段階では、発生 channel(hook channel の二重発火または multiplicity / binding の異常、同期 tool_result channel の二重発火)、raw stream 自体の重複の有無、parser の二重計上の有無が、raw event の抜粋付きで判定されている(task-notification の二重は current classifier で dedupe されるため直接原因候補から除外されている)。第 2 段階は、raw 重複が実際に再現した場合に限り bounded な比較で層(launcher / proxy の transport、upstream)が切り分けられ、再現しない場合はpre_runner_layer: undeterminedとして残存する不明点と次に必要な証跡が記録されている。undeterminedの場合でも、source 読解から絞れた候補空間は live 実測とは区別して記録されている。 - AC3: 最小修正の ownership が、次の規則で決定され、実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 / PR fix: runtime smoke fixture の child 起動先を general-purpose に是正し 2.1.289 で hook_id_correlated を成立させる (#2941) #2946 の再開条件(その原因を解消する修正を取り込んだ新しい PR head でのみ evidence を生成できること)との関係とともに本 Issue のコメントに記録されている。(a) 原因が特定できた場合は exact owner(upstream Issue への参照、または runner 修正の follow-up Issue への参照)。(b) 原因が
undeterminedで 実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 がこの incident により停止中のままの場合は、「修正不要」の文書化では閉じられず、次回の lifecycle failure で raw lifecycle evidence を失わない narrow な durable follow-up ownership(open / closed の dedupe 検索の結果を添えた既存 Issue の参照、または新規 implementation Issue の参照)、あるいは OWNER が 実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 を再開しないと明示した決定への参照のいずれかが記録されている。(c) 実装: claude-gpt adapter の runtime smoke が launcher の解決した underlying Claude Code binary の version を runtime_version に記録するようにする #2954 と 実装: runtime smoke の expected_markers_missing が prompt echo を child marker と誤認する false-green を除去する #2944 の ownership を吸収・重複起票していない。 - AC4: current runner の lifecycle semantics(cross-channel の corroboration を duplicate としない契約、
extract_claude_task_notification_completions()がsetを返すこと、subagent_causal_evidence_verdict()の candidate 選択規則)と、それを固定する既存 test の範囲および未固定の範囲(tool_result channel の二重 completed、task-notification の二重 ingest)が baseline で確認され、調査結果の比較基準として記録されている。
Verification Commands
以下のコマンドは、current runner の lifecycle semantics と #2941 の状態を確認する baseline / regression の確認であり、AC1〜AC3 の dispositive evidence そのもの(live diagnostic、raw attribution、ownership の結論)を証明するものではない。AC1〜AC3 の dispositive evidence は、本 Issue のコメントに記録する per-run の比較表、raw lifecycle excerpt、attribution の結果、ownership の結論である。
# AC1
# baseline-expect: pass
$ uv run --locked pytest scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_operator_journey.py -q -k duplicate_completion
# AC2
# baseline-expect: pass
$ uv run --locked pytest scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_operator_journey.py -q -k same_hook_channel_fires_stop_twice
# AC3
# baseline-expect: pass
$ gh issue view 2941 --repo squne121/loop-protocol --json number,state
# AC4
# baseline-expect: pass
$ uv run --locked pytest scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_operator_journey.py -q -k corroborateAllowed Paths
- (none) 読み取り専用。参照対象は
scripts/agent-ops/**、scripts/claude-gpt/**、.claude/skills/worktree-agent-runtime-smoke/**、docs/dev/runtime-verification-policy.md。diagnostic の成果物は worktree-local のartifacts/runtime-smoke/配下(gitignore 済み、commit しない)と Issue コメントで表現する。
Stop Conditions
- Outcome / Scope / AC が検索可能な形で記載されていない場合は即停止
- Allowed Paths 外への書き込みを試みた場合は即停止
- 権限不足(permission denied)により操作が完了できない場合は即停止
- 成果物の書き込みに失敗した場合(I/O エラー等)は即停止
- diagnostic rerun の結果を 実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 / PR fix: runtime smoke fixture の child 起動先を general-purpose に是正し 2.1.289 で hook_id_correlated を成立させる (#2941) #2946 の verification evidence として使う必要が生じた場合は即停止
- secret / credential、または無関係な transcript 内容を採取しないと原因を切り分けられない場合は即停止
- 実施済みの clean batch B を超える同一 head の rerun が必要になった場合は、新しい evidence が増える見込みが具体的に示されない限り停止して人間判断を仰ぐ
- AC2 が
undeterminedかつ 実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 が停止中のままで、durable follow-up ownership も OWNER の明示決定も確定できない場合は、Issue を close せず停止して人間判断を仰ぐ - 実装: claude-gpt adapter の runtime smoke が launcher の解決した underlying Claude Code binary の version を runtime_version に記録するようにする #2954 または 実装: runtime smoke の expected_markers_missing が prompt echo を child marker と誤認する false-green を除去する #2944 の ownership を吸収しないと ownership を確定できない場合は即停止
Handoff Contract
Current Objective:duplicate_completionsの発生 channel を raw event 証跡付きで特定し、最小修正の ownership を確定するBounded Current Context: 上記 Background の実測事実(同一 head・同一 prompt・同一 resolved launcher で PASS と FAIL が混在、runner は raw stream を保存しない)Open Questions: 重複した stream line の channel、同一agent_idの Stop が実際に 2 回届いたのか hook payload のagent_id/ session / type / prompt が欠落または不一致だったのか、stop_hook_activeの値、FAIL run の余分な 8 event の内容、Claude Code 2.1.289 固有か否かNext Action: 判定結果に応じて、exact owner への修正の materialize(原因特定時)、またはundeterminedかつ 実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 が停止中の場合の durable follow-up ownership の確定(既存 Issue の参照または narrow な新規 implementation Issue の起票。OWNER が 実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 を再開しないと決定した場合はその決定の参照)を行う。実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 の再開は新しい PR head 上でのみ可能であるArtifact Refs: 実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941、PR fix: runtime smoke fixture の child 起動先を general-purpose に是正し 2.1.289 で hook_id_correlated を成立させる (#2941) #2946、実装: runtime smoke の expected_markers_missing が prompt echo を child marker と誤認する false-green を除去する #2944、調査: 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、実装: worktree-agent-runtime-smoke で claude-gpt の同一 Herdr session multi-turn / 複数 SubAgent lifecycle を fail-closed に証明する #2219、upstream の anthropics/claude-code #89555 / #90662 / #78463 / #21941 / #83365
Activity
squne121 commentedon Oct 5, 2026
issue-refinement-loop 終了報告(approved)
調査 Issue #2953 の本文を refinement し、deterministic review が approve で終了しました。
baseline-expect: passの注記を付けました。この修正は本文の VC と Runtime 節のみで、Outcome、In Scope、AC の意味は変えていません。status: ok/verdict: approve/next_action: proceed、blocker 0 件でした(body sha256c68a22e46f23230cf1cc18881571651f2118cb01fe989bb593db62332f919358)。squne121 commentedon Oct 5, 2026
初期 diagnostic 報告(同一 commit の bounded rerun、結果: 非再現 / 原因は undetermined)
この報告は #2941 / PR #2946 の verification には転用しません。#2941 の latest canonical FAIL(head
6736a926b2c93259976aace06d437d635b7d1bd3、duplicate_completions: ['a8bcdb5faaae506a2'])は、この結果によって無効にはなりません。#2941 は Stop Condition により停止したままです。実施条件
6736a926b2c93259976aace06d437d635b7d1bd3(Issue 専用の detached worktree.claude/worktrees/issue-2953-duplicate-lifecycle-diag、clean)。/home/squne/.local/bin/claude(realpath/home/squne/.local/share/claude/versions/2.1.289、2.1.289 (Claude Code))。CLAUDE_CODE_FORK_SUBAGENT、CLAUDE_CODE_DISABLE_BACKGROUND_TASKS、CLAUDE_GPT_CLAUDE_BINはいずれも unset。--agent-type general-purpose、--expect-marker-source subagent、--require-subagent-causal-evidenceなど)。output dir だけをartifacts/runtime-smoke/diag-2953-run<N>に変更。runner は改変せず、Issue 専用の一時 wrapper(repository に commit しない)でrun_structured_claude()の stdout を tee して保存した。extract_claude_hook_lifecycle_events、extract_claude_task_notification_completions、classify_claude_multi_child_lifecycle)を変更せずに使い、tool_result channel は stream のuserevent のtool_use_result.agentIdとstatus == completedを直接数えた。結果(clean batch B: run 21 / 22 / 23、単独実行)
a58c83796bc73b4d6×1duplicate_completions: []hook_id_correlated、errors: []a9d86b6f9002d2279×1duplicate_completions: []a2f7d489f4f187e76×1duplicate_completions: []agent_idを持つ Start と Stop が 1 件ずつ、残り 8 件はagent_idを持たない hook event(いずれも contradictory ではない)だった。native_event_count: 47、tested_headは6736a926…、marker_provenance_handback_report_usedを含む causal evidence が成立していた。比較: #2941 の失敗 run と、直前の PASS run
run_id5ce699c75585)のnative_event_countは 55、直前の PASS run(run_ida20716c7121c)は 49、今回の 3 run はいずれも 47 だった。失敗 run には通常より 8 event 多い。内容は失敗 run の raw stream が保存されていないため復元できない。duplicate_completionsに同じa8bcdb5faaae506a2が入り、subagent_causal_evidence.agent_idはNoneだった。今回の 3 run では channel 内の重複は観測されなかった。運用上の注意(batch A は証跡として使わない)
最初の batch(run 1〜3)は、最初に起動した background loop が停止せずに動き続け、2 つ目の loop と同じ worktree で並走した。後発の loop は evidence の書き込みで
FileExistsErrorになり、meta と raw stream が混在した(summary の child agent id と raw stream の agent id が一致しない run があった)。このため batch A は証跡として採用せず、単独実行の batch B を取り直した。batch A では 2 つの loop の run が重なっており、live run の正確な回数は特定できない(最大 6 回)。batch A の raw stream と meta は混在の記録として別 dir に退避してある。batch A の raw stream から解析できた範囲でも duplicate completion は観測されなかったが、証跡としては扱わない。判定(AC1 / AC2 への途中経過)
次に必要な証跡(Open Questions)
agent_idの SubagentStop または completion が 2 回届くことを直接報告した Issue は見つかっていない(関連しうるのは #89555 の agent_id の drift、#90662 の別 agent_id での tool event、#78463 の Stop 欠落)。squne121 commentedon Oct 5, 2026
判定
REQUEST_CHANGES 相当です。
Issue #2953 の切り分け方針自体は妥当で、#2941 / PR #2946 の hard-stop を迂回せず、diagnostic を別 ownership に分離した判断も正しいです。ただし、refinement 承認後の diagnostic で新しい事実が増えています。特に「非再現のまま AC3 をどう閉じるか」と「raw stream だけで upstream / launcher / proxy まで帰属できるか」が未解決です。
現時点の live state では、#2953 は open、PR #2946 の current HEAD は
0fbc32e03e377b36d5800c940ab8311479c8cf46、問題を観測した incident HEAD は6736a926b2c93259976aace06d437d635b7d1bd3です。6736… → 0fbc…の差分はcreate-issueSkill/文書/test の main 追随だけで、対象 runner / launcher / fixture には触れていません。したがって incident 調査を6736…に pin するのは合理的ですが、「PR #2946 current-head」と呼ぶのは現在の事実と一致しません。[Issue #2953](https://github.com/squne121/loop-protocol/issues/2953?utm_source=chatgpt.com) [PR #2946](https://github.com/squne121/loop-protocol/pull/2946?utm_source=chatgpt.com)Findings
[P1]
undetermined終了と 実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 の再開条件を両立させる AC3 が不足しています。Clean batch B の 3 run はすべて PASS で、incident を含む証跡扱い可能な 8 run 中 FAIL は 1 回のままです。原因を
undeterminedとして AC2 を閉じること自体は妥当です。しかし 実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 は「原因を修正した新しい HEAD」でしか再開できず、latest canonical FAIL も維持されています。この状態で AC3 が現在許している「修正不要の文書化」を選ぶと、調査: runtime smoke の duplicate_completions が生成された channel を raw event 証跡付きで特定し最小修正の ownership を確定する #2953 は閉じられる一方で 実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 は恒久的に再開不能になります。最小修正は、AC2=
undeterminedかつ 実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 がその incident により停止中なら、AC3 は durable follow-up ownership を必須にすることです。例えば「次回再現時に lifecycle-only raw evidence を自動保全する opt-in runner 改善 Issue」を起票する、あるいは owner が 実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 を再開しないと明示決定する、のどちらかです。原因未確定のまま単に「修正不要」は選べない契約にします。[P1] 現在の観測点だけでは
upstreamとlauncher / proxy transportを識別できません。Issue は AC2 で hook / tool_result / parser / launcher/proxy / upstream まで帰属しようとしています。しかし runner に到着した raw stdout に duplicate line が既に存在することを証明できても、それだけでは「Claude Code 自身が二重生成した」のか「その手前の transport が複製した」のかは区別できません。
AC2 は二段階にすべきです。まず runner boundary で (a) channel、(b) raw stream 自体に duplicate が存在するか、(c) parser が同一 raw event を二重計上したかまでを確定します。そのうえで raw duplicate が再現した場合だけ underlying Claude 直実行と launcher 経由の bounded comparison、または既存 debug evidence を使って pre-runner layer を切り分ける。再現しなければ
pre_runner_layer: undeterminedで止めます。恒久 wrapper や新しい attestation framework は不要です。[P1]
task-notification の二重 completionは current classifier のduplicate_completions原因になれません。current main の
extract_claude_task_notification_completions()はset[str]を返します。つまり同じ<task-id>の completed notification が raw stream に2回存在しても、classify_claude_multi_child_lifecycle()に渡る時点で1件へ潰れています。対して hook と synchronoustool_use_resultは list のままなので same-channel duplicate を検出できます。Issue 本文も「task-notification channel は set」と認識していますが、candidate model と test-gap の記述がそれを十分反映していません。今回の
duplicate_completionsの直接原因候補から task-notification duplicate を外すべきです。必要なら「raw duplicate notification は現 classifier では dedupe される」という regression test を1件置く follow-up に留めれば十分です。[P1] failing summary の
subagent_causal_evidence.agent_id: Noneは、既に「tool_result-only duplicate」仮説をかなり弱めています。current
subagent_causal_evidence_verdict()は、Start/Stop が構造的に1組だけ成立していれば、その後 marker provenance や tool correlation が失敗しても、その candidate のagent_idを diagnostic として返します。agent_id=Noneになるのは、hook 側で候補がゼロ、または複数になった場合です。例として same agent ID の Start/Stop 多重、ID/session/prompt/type mismatch、contradictory payload 等があります。したがって incident の全 field を同時に説明するには、正常な唯一の hook pair + tool_result だけ二重では足りません。調査順序を「まず hook event の multiplicity / ID / contradictory /
stop_hook_active→ 次に tool_result → transport/parser」に変えるべきです。無駄な rerun を増やさず、既存証拠だけで探索空間を狭められます。[P2]
stop_hook_activeと既存settings_provenancedigest が AC1 の比較表から抜けています。current runner の extractor はすでに
stop_hook_activeを保存できます。また current Claude Code 公式 docs はSubagentStopにstop_hook_activeがあり、Stop hook が block / additionalContext を返すと subagent が継続すると明記しています。upstream #83365 では、実際に最初の SubagentStop の後、stop_hook_active:trueを伴う repeated SubagentStop が観測されています。Claude Code一方、current repository の project-owned SubagentStop hooks は確認した範囲で fail-open です。
session_manifest_coordinator.shはSTOP_HOOK_ACTIVE=trueなら即 exit 0、内部 failure も exit 0、Task Contexthook_entry.pyも SubagentStop では最終的に exit 0 です。したがって #83365 と同一原因と断定する根拠はありません。だからこそ次の再現時にはstop_hook_activeを必ず raw comparison に入れる価値があります。また runner/Skill には既に
settings_provenance.digest_sha256があります。新 schema を作らず、run 21/22/23 と再発 run でこの既存 digest を記録すれば「同一 HEAD/argv だが effective settings が違った」を早期除外できます。[P2] diagnostic の concurrency invariant が contract に無く、実際に batch A を破壊しました。
初回 batch A は background loop が終了していないまま2本目を開始し、同じ worktree で並走、
FileExistsError、meta/raw の混在、summary と raw stream の child ID 不一致まで発生しています。Clean batch B を取り直した対応は正しいですが、これは単なる operator mistake ではなく Issue の diagnostic procedure に欠けた再現性条件です。[diagnostic comment](調査: runtime smoke の duplicate_completions が生成された channel を raw event 証跡付きで特定し最小修正の ownership を確定する #2953)新しい lock/harness は不要です。In Scope に「run は foreground/sequential、前 run の process terminal completion を確認してから次を開始、output dir は不存在を確認し再利用しない」の3点だけ追加すれば足ります。
[P2] incident HEAD を
current-headと呼んでいる provenance が stale です。調査: runtime smoke の duplicate_completions が生成された channel を raw event 証跡付きで特定し最小修正の ownership を確定する #2953 起票時点で PR fix: runtime smoke fixture の child 起動先を general-purpose に是正し 2.1.289 で hook_id_correlated を成立させる (#2941) #2946 は既に
0fbc32e…に進んでいました。0fbc…は6736…より2 commit ahead ですが、追加差分は.claude/skills/create-issue/**のみです。したがって diagnostic の再実行は不要ですが、本文はfailing/incident head = 6736…と書き換え、current PR headは fresh value と分離すべきです。そうしないと後続 reviewer が「current-head evidence」と誤って 実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 の readiness に転用するリスクがあります。[P2] Verification Commands は AC1〜AC3 の proof ではなく baseline regression です。
現行 VC は
-k duplicate_completion、-k same_hook_channel_fires_stop_twice、gh issue view 2941 --json number,state等で、live diagnostic / raw attribution / ownership decision 自体を証明しません。baseline-expect: passを追加した refinement は改善ですが、コメントの evidence と VC の役割がまだ紛らわしいです。新 publisher/schema は不要です。Section 名を Baseline / Regression Commands に変更し、AC1〜AC3 の dispositive evidence は Issue comment の per-run table、raw excerpt、ownership conclusion である、と明記すれば十分です。
Web 調査からの補強
current Claude Code 公式 hooks reference は、
SubagentStopがagent_id、agent_type、agent_transcript_path、stop_hook_activeを持つこと、また internal agent の完了でも SubagentStop が発生し得ることを現在は明記しています。さらに v2.1.271+ のSubagentHandbackでは report 本体はtool_input.messageで、last_assistant_messageは closing text です。[Claude Code](https://code.claude.com/docs/en/hooks)upstream には lifecycle が完全に安定しているとは言えない実測があります。#78463 は API-error burst 中の Stop 欠落、#90662 は実 subagent の tool hook が lifecycle と別
agent_idになる事象、#21941 は古い version ですが subagent completion が複数回見える症状を報告しています。ただしいずれも今回の「2.1.289 / same agent_id / same-channel duplicate」と同一 defect を証明してはいません。[GitHub](https://github.com/anthropics/claude-code/issues/78463?utm_source=chatgpt.com)Claude Code 2.1.289 の release notes に SubagentStop / lifecycle duplicate 修正は記載されていません。したがって「2.1.289 だから upstream 側は既修正」と仮定する根拠もありません。[GitHub](https://github.com/anthropics/claude-code/releases/tag/v2.1.289)
推奨する #2953 の到達点
#2953 を捨てて作り直す必要はありません。短い再-refinement を1回入れるのが妥当です。Outcome は runner-boundary attribution と pre-runner attribution を分離し、AC1 に
stop_hook_active・既存 settings digest・sequential execution invariant を加え、AC2 から task-notification duplicate を直接原因候補として外し、AC3 はundetermined + #2941 still blockedの場合に durable follow-up ownership を必須化する、という修正で足ります。その後は追加の同一 HEAD rerun を続けるべきではありません。clean 3回で新 evidence が増えなかったという現在の停止判断は正しいです。次の実質的 action は、再現を待たずとも次回 failure の raw lifecycle evidence を失わない最小 follow-up を AC3 で ownership 化することです。
runtime_version=Noneは既に別 Issue #2954 に適切に分離されており、#2953 に戻さない方がよいです。Issue #2954結論として、調査の方向性と hard-stop 分離は良い一方、現在のまま
undetermined → 修正不要 → closeへ進めるのは反対です。上記 P1 を contract に反映してから AC3/AC4 を完了させるのが最小かつ実用的です。squne121 commentedon Oct 5, 2026
推奨は、comment
6004641038を OWNER の explicit human-context anchor として #2953 を短く再-refinement することです。追加の同一 incident HEAD diagnostic rerun は現段階では不要です。添付ログでも、#2941 の same-head rerun で green を採用せず follow-up ownership に分離する方針が明示されており、merge・permission bypass・scope creep も禁止されています。貼り付けたテキスト(1) 貼り付けたテキスト(1)live 確認時点では
main=14ae6126b56201cacae71fae2b622cf05b910077、PR #2946 は Draft/Open でHEAD=0fbc32e03e377b36d5800c940ab8311479c8cf46、#2954 はruntime_version=Noneを所有する別 Issue として open です。current Claude Code docs もSubagentStopにstop_hook_activeが含まれること、v2.1.271+ のSubagentHandbackreport はtool_input.messageでありlast_assistant_messageとは別物であることを現在明記しています。[Claude Code](https://code.claude.com/docs/en/hooks) 一方 upstream #83365 の repeatedSubagentStopは有力な関連 evidence ですが v2.1.220 の観測なので、今回の root cause と同一視せず調査優先順位の根拠に留めるべきです。[GitHub](https://github.com/anthropics/claude-code/issues/83365?utm_source=chatgpt.com)そのまま fresh / auto mode の対話的 Claude Code に貼れる形です。
repo =
squne121/loop-protocol対象:
#2953https://github.com/squne121/loop-protocol/issues/2953#issuecomment-6004641038#2941/ PR#2946#2944#2954使用する repository-native Skill:
.claude/skills/issue-refinement-loop/SKILL.mdこの interactive Claude Code session は既に fresh / auto mode で起動済みです。
現在の session をそのまま継続してください。
新しい session の起動、
/clear、permission mode の変更、bypassPermissions、--dangerously-skip-permissionsは不要で、要求していません。目的
OWNER comment
6004641038を explicit human-context anchor として、current repository-nativeissue-refinement-loopを Issue #2953 に対して実行し、comment の REQUEST_CHANGES を current Issue contract に反映してください。iteration ごとの人間承認は不要です。
current Skill の既定
max_iterations=3の bounded loop を、人間への中間確認なしで terminal state まで進めてください。目標 terminal state は:
approve / proceedapprovedまたは genuine canonical hard stop です。
調査だけ、SubAgent dispatch だけ、body 書換えだけで終了しないでください。
各 SubAgent の terminal completion と final result を取得し、fresh final review と canonical termination まで進めてください。
authority / provenance
最初に live state を fresh に取得してください。
最低限:
origin/main/ current main HEAD6004641038author_association60041295756004026706.claude/skills/issue-refinement-loop/SKILL.mdreferences/index.mdanchor-comment-handling.mdscope-signal-guard.mdloop-state.mdfollow-up-materialization.mdac-vc-reflection.mdscripts/agent-ops/run_worktree_agent_runtime_smoke.py過去 transcript の HEAD、Skill procedure、agent role、classifier semantics を authority として固定しないでください。
prompt 作成時点の参考値は:
14ae6126b56201cacae71fae2b622cf05b9100770fbc32e03e377b36d5800c940ab8311479c8cf466736a926b2c93259976aace06d437d635b7d1bd3ですが、必ず開始時の live state を優先してください。
anchor comment の扱い
comment
6004641038は今回ユーザーが明示的に選択した OWNER human-context comment です。anchor_comment_url/ human-context input として current Skill の canonical lane に渡してください。この comment は structured
ANCHOR_SCOPE_REFRAME_V1を手書きしたものではありませんが、current repository が explicit trustedhuman_review_directiveを operator-selected human-context として処理できる場合、その canonical route を使ってください。人間に
ANCHOR_SCOPE_REFRAME_V1を書き直させるために停止しないでください。ただし scope authority / rewrite route を prose で独自再実装せず、current planner / scope classifier / router / issue-editor route の判断を consume してください。
NEXT_ACTION: issue_editor_required等が canonical に返る場合は、同じ anchor URL を保持したまま current Skill の手順どおり issue-editor phase を実行し、その後 fresh review に戻ってください。target comment から反映すべき technical recommendation
以下を単なる全文コピーではなく、repository source・diagnostic evidence・current upstream と照合した derived guidance として扱ってください。
1.
undeterminedと AC3 ownershipclean diagnostic batch が非再現で AC2 を
undeterminedとする場合でも、#2941 がこの incident の canonical FAIL により停止中なら、AC3 を単純な「修正不要の文書化」で閉じられないようにしてください。最低限、contract は次を区別する必要があります。
undeterminedundetermined → 修正不要 → #2953 closeにより #2941 が永久停止する contract hole を残さないでください。2. attribution を二段階に分ける
Outcome / AC2 では、runner boundary と pre-runner attribution を分離してください。
第一段階で判定可能なのは原則:
です。
raw duplicate が実際に再現した場合だけ、必要性を確認したうえで:
を bounded comparison し、pre-runner layer を切り分けてください。
再現しない場合は、Claude Code / launcher / proxy のどれかを推測で犯人扱いせず:
pre_runner_layer: undetermined相当を明示できる contract にしてください。
恒久 wrapper、attestation framework、新 schema は不要です。
3. task-notification duplicate を直接原因候補から外す
current source を再確認してください。
extract_claude_task_notification_completions()が同じ task id をsetに畳む current semantics なら、raw task-notification が二重でも currentduplicate_completionsの直接原因にはなりません。その場合:
に留めてください。
新しい test を #2953 自体で実装しないでください。
4. incident evidence から investigation order を狭める
failing summary の
subagent_causal_evidence.agent_id: Noneと current
subagent_causal_evidence_verdict()の candidate selection semantics を再検証してください。current source が、唯一の usable Start/Stop pair が存在すれば marker/tool correlation failure 後も candidate agent ID を diagnostic として保持する契約なら、incident は「normal unique hook pair + tool_result-only duplicate」だけでは説明不足です。
その場合の investigation priority は:
agent_id/ session / type / prompt bindingstop_hook_activeの順を基本としてください。
source と矛盾する場合は current source を優先してください。
5.
stop_hook_activeと settings provenancecurrent Claude Code official hooks documentation と current repository source を fresh に確認してください。
SubagentStop payload に
stop_hook_activeが存在する current contract なら、次回再現時に比較すべき lifecycle evidence へ追加してください。既存の:
settings_provenance.digest_sha256を再利用し、新 schema は追加しません。
upstream #83365 などで repeated SubagentStop が報告されていても、version・hook behavior・project hook semantics が今回と同一である evidence が無ければ same root cause と断定しないでください。
6. diagnostic concurrency invariant
diagnostic procedure に次を明記してください。
batch A の混在を再発させないための最小 procedure です。
lock、daemon、恒久 harness は追加しません。
7. incident HEAD と current PR HEAD を分離
6736a926...は incident/failing HEAD として扱ってください。PR #2946 の current HEAD は開始時に fresh read し、本文中で:
を明示的に区別してください。
incident diagnostic を current-head verification と表現しないでください。
また #2953 の diagnostic evidence を #2941 / PR #2946 の readiness evidence に転用しないことを維持してください。
8. Verification Commands の役割
current #2953 の pytest /
gh issue viewcommands は、live diagnostic/raw attribution/ownership conclusion 自体を証明していません。意味を変えずに可能なら:
Baseline / Regression Commands等へ明確化であると明記してください。
current repository contract が section heading の固定名称を要求する場合は名称を無理に変更せず、説明文だけで区別してください。
追加 diagnostic rerun
今回の refinement のために incident HEAD の diagnostic rerun を追加しないでください。
既存 clean batch B の3 runで新しい evidence が増えず、target OWNER comment も追加同一-HEAD rerunを推奨していません。
この作業は contract refinement であり、#2941 verification や #2953 diagnostic execution の継続ではありません。
baseline/static regression command を current Skill 自身が contract validation のために必要とする場合は実行して構いませんが、live incident reproduction loop を新規に開始しないでください。
SubAgent
current
issue-refinement-loopの planner result と current agent definitions に従い、appropriate SubAgents を使ってください。少なくとも relevant なら:
codebase-investigatorweb-researcherSubagentStopstop_hook_activeSubagentHandbackを独立した read-only work として使ってください。
重要:
SubAgent が upstream/repository facts を誤報する可能性を考慮し、load-bearing fact は root が一次 source で再確認してください。
follow-up ownership / 再発防止
target comment の P1 により、AC2 が最終的に
undeterminedかつ #2941 が still blocked の場合、durable follow-up owner を確立する方向を優先してください。まず open / closed Issue を dedupe search してください。
特に:
stop_hook_activeを検索してください。
exact owner が既に存在すれば新規 Issue は作らず、その Issue を AC3 ownership として参照してください。
exact owner が無く、fresh refined contract / current Skill の follow-up-materialization route が起票を要求・許可する場合は、再発防止のため narrow な implementation Issue を起票して構いません。
候補 scope は:
程度に限定してください。
generic trace platform、恒久 approval layer、新 attestation framework、広範な observability rewrite へ拡大しないでください。
なお
runtime_version=Noneは #2954 が別 ownership を持っています。#2953 の follow-up に吸収・duplicate 起票しないでください。
#2944 も別 ownership のまま維持してください。
current canonical loop が follow-up Issue 作成前の hard stop を要求する場合は、それを bypass せず exact hard-stop reason を報告してください。
今回明示的に承認する操作
この依頼の範囲では iteration ごとの追加確認なしに、以下を実行して構いません。
git fetch、refs/history/diff の read承認していない操作
bypassPermissions--dangerously-skip-permissionsrouting / stopping policy
通常の
needs-fixは人間確認を求めず max_iterations の範囲で自動修正・再reviewしてください。target OWNER directive を反映するために body rewrite が必要なら、current canonical rewrite route を使って続行してください。
次のような genuine canonical hard stop の場合だけ停止してください。
human_judgment_requiredを最終的に要求し、今回の explicit OWNER directive でも解消できない通常の needs-fix、stale review、rewrite required、fresh readback required は停止理由にしません。
最終報告
最後に root session から、簡潔だが evidence を欠かさず以下を報告してください。
live intake
investigation
subagent_causal_evidence.agent_id=Noneから絞れた candidate spacestop_hook_active/ settings provenance の扱いcontract changes
undetermined + #2941 still blockedownership ruleloop
follow-up
terminal
approvedまず current main と Issue #2953 / target OWNER comment の fresh read、および current
issue-refinement-loop/SKILL.md+ planner/reference の確認から開始してください。この版では、comment の8 findingsを「bodyへ機械的に転記する命令」ではなく、current planner/router が評価する technical recommendation として渡しています。特に 追加 diagnostic を止めたまま、AC3 の durable ownership まで閉じることを主眼にしています。
squne121 commentedon Oct 5, 2026
issue-refinement-loop 終了報告(approved)
OWNER の human-context コメント
issuecomment-6004641038を anchor として #2953 の本文を refinement し、deterministic review が approve で終了しました。この終了は本文契約の承認であり、調査(AC1〜AC4)の完了ではありません。pre_runner_layer: undetermined)、task-notification の二重を直接原因候補から除外(current classifier ではsetに畳まれる)、hook event の multiplicity と binding を先に疑う調査順序、stop_hook_activeと既存 settings digest の比較項目化、diagnostic の foreground / sequential の不変条件、incident head6736a926…と PR fix: runtime smoke fixture の child 起動先を general-purpose に是正し 2.1.289 で hook_id_correlated を成立させる (#2941) #2946 の current head0fbc32e0…と main14ae6126…の区別、Verification Commands の baseline / regression としての位置付け(見出しは checker の必須名称のため変更せず説明文で区別)。undeterminedで 実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 が停止中のままの場合は「修正不要」で閉じられず、durable follow-up ownership または OWNER の明示決定を必須にしました。approve / proceed(body sha256ad7b4dcb7935589d2d259b8f9f79ca11645e99013e0e8d9e0d06dd1d94d3022d、blocker 0 件)でした。Step 2.5 の semantic review は全 signal が false のため適用外でした。codebase-investigatorとweb-researcherの結果を、公式 hooks reference の原文、GitHub API、runner source で root が再確認して使いました。web-researcher の報告のうち #78463 の状態などの誤りは一次資料で補正しています。https://github.com/squne121/loop-protocol/issues/2958、dedupe_keyfollow-up:squne121/loop-protocol:issues/2953:lifecycle-raw-evidence-on-failure)を起票しました。範囲は、次回の lifecycle failure 時に attribution に必要な raw event だけを opt-in かつ bounded で保全することに限り、実装: claude-gpt adapter の runtime smoke が launcher の解決した underlying Claude Code binary の version を runtime_version に記録するようにする #2954(runtime_version)と 実装: runtime smoke の expected_markers_missing が prompt echo を child marker と誤認する false-green を除去する #2944(prompt-echo)は吸収していません。squne121 commentedon Oct 6, 2026
確認した live state では、#2953 は open の research Issue のままですが、contract refinement は
approved済みで、AC1–AC4 の実調査完了が残っています。既に durable follow-up として #2958 が open で作成されており、#2958 には branch / PR はまだありません。添付された直前セッションでも、#2953 の refinement approved と #2958 の materialization まで完了しています。貼り付けたテキスト(1)関連状態として、main は
14ae6126b56201cacae71fae2b622cf05b910077、PR #2946 は Draft/Open・HEAD0fbc32e03e377b36d5800c940ab8311479c8cf46です。PR #2946 の CI はtypecheck/lint/test/build/python-test等が success で、review thread も現在ありません。ただし #2941 の canonical failure を #2953 の diagnostic PASS で上書きしてはいけません。#2944 と #2954 も open で、いずれも #2958 と同じ runner file を触る可能性がありますが、現時点では branch / closing PR は確認できません。推奨アクションは、まず #2953 の research contract を実行して AC1–AC4 を証跡付きで完了・closeし、その後、今回の明示的な実装承認を使って既存 owner #2958 を current
impl-review-loopで merge 直前まで実装することです。#2958 の PR はCloses #2958、Refs #2953とし、Closes #2953にはしません。Claude Code の現行公式 hooks reference でもSubagentStopにstop_hook_activeがあり、v2.1.271+ のSubagentHandbackreport はtool_input.messageであることが現在確認できます。[Claude Code](https://code.claude.com/docs/en/hooks)そのまま現在の fresh / auto mode ClaudeCode(Claude-GPT)へ貼れるプロンプトです。
repo =
squne121/loop-protocol対象:
#2953#2958#2941#2946#2944#2954https://github.com/squne121/loop-protocol/issues/2953#issuecomment-6004641038https://github.com/squne121/loop-protocol/issues/2953#issuecomment-6004928791この interactive Claude Code / Claude-GPT session は既に fresh / auto mode で起動済みです。
現在の session と repository-owned Claude-GPT launcher/profile をそのまま継続してください。
新しい session の起動、
/clear、permission mode の変更、bypassPermissions、--dangerously-skip-permissionsは不要です。目的
今回のユーザー指示は、Issue #2953 を単に調査・提案して止めるものではありません。
.claude/skills/impl-review-loop/SKILL.mdを 実装: runtime smoke の lifecycle failure 時に attribution 用の raw lifecycle event を bounded かつ opt-in で保全する #2958 に対して起動する。inspect → implement → test → review → fix → re-test → PR create/update → CI/review対応まで自律的に進め、人間が merge 判断できる直前まで到達する。Closes #2958を入れ、調査: runtime smoke の duplicate_completions が生成された channel を raw event 証跡付きで特定し最小修正の ownership を確定する #2953 との関係はRefs #2953とする。iteration ごとの人間承認は不要です。
通常の test failure、review finding、CI failure、stale HEAD、update-branch、REQUEST_CHANGES は停止理由ではありません。current canonical loop の範囲で修正・再検証してください。
調査だけ、SubAgent dispatch だけ、PR 作成だけ、review 開始だけで終了しないでください。
各 SubAgent の terminal completion と final result を取得し、root/main session が結果を consume してから次へ進んでください。
最初に live state を fresh に取得
過去 transcript やこの prompt 内の SHA を authority とせず、開始時点で fresh read してください。
最低限確認するもの:
origin/main/ current main HEAD6004129575diagnostic result6004641038OWNER review6004928791refinement approved resultClosesする既存 PR、同一 scope の既存 branch/worktree がないか.claude/skills/impl-review-loop/SKILL.mdsteps/preparation.mdimplementation-worker/test-runner/pr-revieweragent definitionsscripts/agent-ops/run_worktree_agent_runtime_smoke.py.claude/skills/worktree-agent-runtime-smoke/SKILL.mdprompt 作成時点の参考値は以下ですが、必ず live 値で上書きしてください。
14ae6126b56201cacae71fae2b622cf05b9100770fbc32e03e377b36d5800c940ab8311479c8cf466736a926b2c93259976aace06d437d635b7d1bd3Phase A — #2953 research Issue を terminal completion させる
#2953 は
issue_kind: research/change_kind: research-onlyで、Allowed Paths は(none)です。したがって #2953 の名義で production code / test / skill / docs を変更しないでください。
A1. 保存済み evidence の readback
新しい同一 incident HEAD rerun は原則実行しません。
current contract が指定する以下を readback してください。
summary.mdagent_idstop_hook_activetool_use_result.agentId/statussettings_provenance.digest_sha256foreign worktree や foreign artifact を変更・削除しないでください。
read-only で参照してください。
保存済み artifact が存在しない、壊れている、または provenance を維持して readback できない場合は、値を捏造しないでください。
A2. current source semantics を再確認
少なくとも以下を current source から確認してください。
extract_claude_task_notification_completions()classify_claude_multi_child_lifecycle()_pair_agent_lifecycle()subagent_causal_evidence_verdict()extract_claude_hook_lifecycle_events()settings_provenance.digest_sha256producer/consumer特に current source が引き続き以下なら、その意味を維持してください。
setに畳まれるため、その raw duplicate は currentduplicate_completionsの直接原因ではないsubagent_causal_evidence.agent_id=Noneは、正常な唯一の Start/Stop pair + tool_result-only double completion だけでは説明しにくいsource が変わっていれば current source を優先してください。
A3. upstream の fresh verification
必要な load-bearing fact のみ current official/upstream source で確認してください。
最低限:
SubagentStopstop_hook_activeSubagentHandback同一 defect だと証明できない upstream Issue を今回の root cause と断定しないでください。
Claude Code harness layer と backend/model layerを混同しないでください。
A4. SubAgents
#2953 の調査では、必要に応じて少なくとも次を使ってください。
codebase-investigator
task:
authority:
constraints:
expected output:
web-researcher
task:
constraints:
expected output:
重要:
A5. #2953 の attribution conclusion
evidence が current refined contract の想定どおりで、incident failure の raw stream が失われ、clean batch B でも再現しない場合は、無理に犯人を決めないでください。
その場合、少なくとも以下を明示してください。
runner_boundary: undeterminedpre_runner_layer: undeterminedagent_id=Noneが hook multiplicity/binding anomaly を優先候補にする理由推測による
Claude Code bug/launcher bug/proxy bug認定は禁止します。A6. AC1〜AC4 completion comment
Issue #2953 に、current AC1〜AC4 を一つずつ満たす final research result comment を投稿してください。
最低限含める:
provenance
AC1
stop_hook_activeAC2
undeterminedなら exact reasonAC3
#2958AC4
追加 diagnostic rerun を実行していないことも記載してください。
A7. #2953 close
final research result が current AC1〜AC4 を満たすことを root が readback / self-review し、remaining blocker が無ければ #2953 を
completedとして close してください。#2953 は PR merge で閉じる Issue ではありません。
#2958 の implementation completion を #2953 close の必須条件へ勝手に追加しないでください。current contract が要求する durable ownership は、#2958 が open owner として成立していれば満たせます。
ただし evidence integrity を維持できず AC1/AC2 を正当に完了できない場合は、虚偽の completion にせず current contract の hard-stop を報告してください。
Phase B — repository change が必要なら existing owner #2958 を実装
今回のユーザーは、必要な implementation / test / branch / commit / push / PR / review-fix を明示的に承認しています。
live read でも #2958 が現在の durable implementation owner のままで、同 scope が main に未実装なら、#2953 の close 後に人間へ戻らずそのまま #2958 に進んでください。
#2953 の scope にコード変更を押し込まないでください。
B1. current impl-review-loop を正本として使う
current:
.claude/skills/impl-review-loop/SKILL.mdを読み、current
steps/**、agents、router/checker を正本として使ってください。自然言語で loop semantics を再実装しないでください。
Root-Owned Synchronous Entry Transition を使い、current invocation 内で:
を canonical に行ってください。
#2958 に既存 PR / branch / worktree が作成されていたら 再利用し、duplicate を作らないでください。
implementation_already_landed/already_satisfied/existing_pr_resume等の current canonical disposition を独自解釈せず consume してください。B2. #2958 current scope
live Issue を authority としますが、prompt 作成時点では:
Allowed Paths:
scripts/agent-ops/run_worktree_agent_runtime_smoke.pyscripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_lifecycle_failure_evidence.py.claude/skills/worktree-agent-runtime-smoke/SKILL.mdAC1〜AC7 は主に:
です。
必ず live body を読み直し、現在の AC / Allowed Paths が変わっていれば live contract を優先してください。
B3. related overlapping Issues の境界
#2944 と #2954 も
scripts/agent-ops/run_worktree_agent_runtime_smoke.pyを Allowed Paths に含みます。開始時と PR 作成直前にそれぞれ:
を再取得してください。
ただし scope は別です。
runtime_version#2944 / #2954 の実装を #2958 に吸収しないでください。
別 branch/PR が開始していた場合は、foreign branch/worktree を変更せず、current impl-review-loop の conflict/update/rebase routing に従ってください。
B4. implementation-worker
Step 1 は current
implementation-worker/implement-issuecontract に委譲してください。SubAgent prompt に必ず:
を自己完結的に渡してください。
親会話の暗黙 context に依存させないでください。
implementation-worker 内で contract が禁止する nested SubAgent delegation を勝手に行わせないでください。
B5. testing
current impl-review-loop Step 2 の
test-runnerを使い、current HEAD に対して独立に検証してください。Issue の Verification Commands を実行し、baseline-fail の新規 tests が実装後 PASS することを確認してください。
最低限:
test failure は通常の修正可能 failure として implementation loop に戻してください。
SKIP / unverified を PASS と扱わないでください。
B6. PR
既存 qualifying PR が無ければ current repository-native PR creation path で作成してください。
PR body には必ず:
Closes #2958を入れてください。
また origin を明示するため:
Refs #2953を入れてください。
Closes #2953は入れないでください。PR body には最低限:
IMPLEMENTATION_SCOPE_COVERAGE_V1等、current workflow が要求する durable markerを含めてください。
B7. PR review / fix loop
Step 4 の current
pr-reviewer/pr-review-judgeを fresh PR HEAD に対して実行してください。SubAgent completion を待ち、final verdict と blockers を取得してください。
修正後は必ず fresh PR HEAD で:
を再評価してください。
reviewer の自己申告だけで merge-ready と判定せず、root/control-plane が live GitHub CI / mergeability / unresolved threads を確認してください。
B8. CI
PR 作成後、required CI を current head に対して確認してください。
main の current branch protection が要求する context は開始時に fresh 取得してください。
prompt 作成時点の main protection では少なくとも:
が required context です。
current live protection を authority としてください。
fixable CI failure は修正 → push → fresh CI → fresh review の loop に戻してください。
B9. #2958 terminal state
目標は current
impl-review-loopの canonical:IMPL_REVIEW_LOOP_RESULT_V1.status: draft_pr_ready相当です。
条件:
Closes #2958Refs #2953ここで停止してください。
PR を merge しない。
auto-merge を enable しない。
明示的に承認する操作
この invocation では、人間への iteration ごとの追加確認なしに以下を実行して構いません。
git fetchcompleted)Closes #2958Refs #2953「実行してよいか」を逐次聞かないでください。
明示的な停止条件
ユーザー由来の明示停止条件は次の 2 種類です。
破壊的操作が必要
秘密情報・credential の取得/変更/公開が必要
/login等の再認証を自律実行この場合は実行せず、exact blocker と必要な human action を報告してください。
加えて current repository の deterministic router / canonical workflow が genuine hard stop を返す場合は、それを bypass してはいけません。特に actual Git conflict、evidence integrity failure、policy bypass requirement、irreconcilable authority conflict、canonical max_iterations 到達は exact reason を報告してください。
ただし通常の:
を人間確認の理由にしないでください。
禁止
最終報告
root/main session から最後に以下を簡潔に報告してください。
#2953 research
#2958 implementation
Closes #2958Refs #2953terminal
exactly one:
#2953 completed; #2958 draft_pr_ready#2953 completed; #2958 already_satisfiedmerge / auto-merge を実行していないことも明記してください。
まず、current main、#2953/#2958、#2941/PR #2946、#2944/#2954、current
impl-review-loop/ agent definitions の fresh read から開始してください。この構成なら、#2953 の research-only 境界を壊さず、ユーザーの「変更が必要なら実装まで」という承認を既存 owner #2958 に正しく接続できます。
squne121 commentedon Oct 6, 2026
最終調査結果(AC1〜AC4)— runner boundary / pre-runner の帰属は
undetermined、durable owner は #2958この結果は #2941 / PR #2946 の verification evidence として使いません。#2941 の latest canonical FAIL は無効化されず、#2941 は新しい PR head ができるまで停止したままです。本調査では追加の diagnostic rerun を一切行っていません(保存済み artifact の readback と source / upstream の再確認のみ)。#2953 の名義で repository file は変更していません。
provenance
14ae6126b56201cacae71fae2b622cf05b910077(開始時・終了時とも同一)6736a926b2c93259976aace06d437d635b7d1bd30fbc32e03e377b36d5800c940ab8311479c8cf46(Draft / Open、base14ae6126…、変更 file は fixture 1 件のみ。deploy-prが fail しているが required context ではなく、本調査では変更も判定もしない)2.1.289(~/.local/share/claude/versions/2.1.289)、adapterclaude-gpt、ambient(CLAUDE_CODE_FORK_SUBAGENT/CLAUDE_CODE_DISABLE_BACKGROUND_TASKS/CLAUDE_GPT_CLAUDE_BIN)は診断時 unset(診断コメント6004129575の記録)。.claude/worktrees/issue-2941-claude-2-1-289-causal-evidence/artifacts/runtime-smoke/subagentstop-handback-provenance-fixture/summary.md(run_id5ce699c75585).claude/worktrees/issue-2953-duplicate-lifecycle-diag/artifacts/runtime-smoke/diag-2953-run21|22|23/summary.mddiag-2953-run1|2|3/summary.md(証跡から除外)FileExistsError、summary と raw の child agent id 不一致)ため。summary.mdのみで、incident の raw stream は元から存在せず、batch B の raw lifecycle excerpt も今回の readback 時点で file として残っていない(診断コメント6004129575に転記された数値のみが一次記録)。この欠落は値を補わず、下表で「復元不能」と明記する。AC1 — per-run 比較(sequential invariant 付き)
stop_hook_activesettings_provenance.digest_sha2566736a926…a8bcdb5faaae506a2、source はtool_use_result_status_completed4a754e1f…ef32verified: False、duplicate_completions: ['a8bcdb5faaae506a2']、orphan / unknown 空agent_id: None、no_evidence、transcript fallback used6736a926…duplicate_completions: []hook_id_correlated、handback report used6736a926…a58c83796bc73b4d6×14a754e1f…ef32(summary で確認)[]hook_id_correlated、errors: []a9d86b6f9002d2279×14a754e1f…ef32(summary で確認)hook_id_correlateda2f7d489f4f187e76×14a754e1f…ef32(summary で確認)hook_id_correlated4a754e1f…ef32で一致した。したがって「effective settings の差」は incident の説明候補から除外できる。AC2 — 帰属結果
scripts/agent-ops/run_worktree_agent_runtime_smoke.pyを直読):extract_claude_task_notification_completions()(:2030)はset[str]を返す。raw 上の task-notification 二重は classifier 到達前に 1 件へ畳まれるため、duplicate_completionsの直接原因候補ではない。classify_claude_multi_child_lifecycle()(:4549)の duplicate 判定は hook / 同期 tool_result の各 channel 内に限られ、cross-channel の corroboration は duplicate にならない。したがって「hook 1 回 + tool_result 1 回」では発生しない。subagent_causal_evidence_verdict()(:4208)は、同一 agent_id の Start / Stop がともにちょうど 1 件で、順序・session・prompt・type が矛盾しない candidate が 1 つあれば、downstream が失敗してもその agent_id を diagnostic として返す(:4385 付近のlen(evaluated_candidates) == 1)。agent_id: Noneになるのは candidate が 0 件または複数件のとき。incident はagent_id: Noneかつ Start / Stop とも observed なので、「正常な唯一の hook pair + tool_result の二重」だけでは説明が足りず、hook event の multiplicity / binding(同一 agent_id の複数 Stop、id / session / type / prompt の不一致、contradictory)の異常を先に疑う根拠になる。ただしこれは優先順位付けであり、帰属の確定ではない。SubagentHandbackとtask-notificationの 2 event 配信であり hook channel の二重ではない)、#21941 closed(duplicate)、#59719 / #70151 closed(not_planned)。いずれも「同一agent_idの SubagentStop が 2 回届く」ことを直接報告するものは見つからず、同一 defect とは断定しない。公式 hooks reference は SubagentStop の入力にstop_hook_activeを含むと記載。v2.1.285〜v2.1.289 の release notes に SubagentStop の二重発火修正の記載は確認できなかった(「修正済み」とも「未修正」とも断定しない)。Claude Code harness 層と backend / model 層は混同していない。stop_hook_active/ contradictory、tool_use_resultの agentId / status、notification の id / status)と settings digest。これを 実装: runtime smoke の lifecycle failure 時に attribution 用の raw lifecycle event を bounded かつ opt-in で保全する #2958 が保全する。推測による「Claude Code bug」「launcher bug」「proxy bug」の認定はしない。
AC3 — ownership
undeterminedで 実装: runtime smoke の SubAgent causal evidence fixture を pr-reviewer persona 非依存の child に是正し 2.1.289 で hook_id_correlated を成立させる #2941 が停止中のため、「修正不要」では閉じない。durable owner は 実装: runtime smoke の lifecycle failure 時に attribution 用の raw lifecycle event を bounded かつ opt-in で保全する #2958(open、branch / PR なし、dedupe_keyfollow-up:squne121/loop-protocol:issues/2953:lifecycle-raw-evidence-on-failure、open / closed の dedupe 検索で他に exact owner なし)。範囲は opt-in かつ bounded な lifecycle failure raw event 保全のみ。runtime_version)は open のまま別 owner で、branch / PR はまだ無い。どちらも吸収・重複起票していない。AC4 — current semantics と test 範囲(baseline / regression)
set。causal evidence の candidate 規則は上記。14ae6126):-k duplicate_completion1 passed、-k same_hook_channel_fires_stop_twice1 passed、-k corroborate1 passed。gh issue view 2941はstate: OPEN。SubAgent 結果の扱い
codebase-investigator と web-researcher は terminal completion まで待ち、final result を取得した。load-bearing な事実(source 行、upstream の state、release notes)は root が一次 source で再確認して使用した。誤りのあった報告(incident を fixture の pr-reviewer 起因とする説明、「once per instance」契約が CONTRADICTED とする判定、一部 Issue の挙動の要約)は採用していない。
AC1〜AC4 の記録は以上。#2953 は PR merge で閉じる Issue ではないため、#2958 の実装完了は close 条件に含めない。
squne121 commentedon Oct 6, 2026
AC1〜AC4 の最終調査結果を #2953 (comment) に記録しました。帰属は undetermined、durable owner は #2958(open)です。#2941 / PR #2946 は変更せず停止のままです。
feat: runtime smoke の lifecycle failure 時に raw lifecycle event を opt-…