Skip to content

feat: runtime smoke の lifecycle failure 時に raw lifecycle event を opt-in で保全する - #2959

Merged
squne121 merged 5 commits into
mainfrom
worktree-issue-2958-lifecycle-failure-evidence
Oct 6, 2026
Merged

squne121 merged 5 commits into
mainfrom
worktree-issue-2958-lifecycle-failure-evidence

Conversation

@squne121

@squne121 squne121 commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

本 PR は次の Issue を扱います。

Closes #2958(本 Issue を完了させる)

Refs #2953(参照のみで close しない)

上記のとおり #2953 は参照のみで、close しません。

受け入れ条件の達成状況

  • AC1: 達成。重複 SubagentStop を注入した fake-claude stream で、hook event の既存 field、tool_use_result の agentId/status、task-notification の agent id/status、settings_provenance.digest_sha256 が保存されることを allowlisted_events_preserved_on_lifecycle_failure で検証。
  • AC2: 達成。assistant message 本文、prompt 文字列、last_assistant_message、secret 風 sentinel、無関係な transcript、task-notification 本文が出力 JSON に含まれないことを excludes_message_prompt_and_secret_content で検証(top-level key 集合も固定)。
  • AC3: 達成。成功 stream では flag 指定でも file が作られず、flag 未指定では失敗 stream でも作られないことを nothing_preserved_on_pass_or_without_flag で検証。
  • AC4: 達成。同一 stream を flag あり/なしで走らせ、exit code・summary.md の既存 field(run_id 以外)・[FAIL] 行が一致することを verdict_and_exit_code_unchanged で検証。
  • AC5: 達成。既存 file は上書きせず内容不変(warning のみ・exit code 不変)、--output-dir 配下でない path(絶対 path、.. 経由、output dir 自身)は起動前に exit 2 で拒否、symlink 経由の脱出も拒否することを existing_file_not_overwritten_and_path_confined で検証。
  • AC6: 達成。channel ごとに 100 件の上限を設け、失敗原因 record(duplicate / orphan / unknown child の agent id、contradictory な hook)を通常 record より優先して保持する。600 件の completed notification を持つ stream でも出力が bounded で、実数は *_total に残ることを output_is_bounded で検証。cap 超過位置の duplicate SubagentStop が evidence に残る regression(failure_beyond_cap)を追加(優先選択を外す mutation で失敗することを確認)。
  • AC7: 達成。.claude/skills/worktree-agent-runtime-smoke/SKILL.md に新 flag の使い方・保存条件・許可リスト・上限・出力先の規則を記載。
  • AC8: 達成。無害な fixture prompt に対する実 runtime(claude 2.1.291、native adapter、structured lane)の run で --lifecycle-failure-evidence-json を指定した成功 lifecycle の run が exit 0 で完了し、SubagentStart / SubagentStop の causal evidence が current run に束縛されて成立し(causal_evidence_source: hook_id_correlated)、evidence file は作られない。証跡は下記の「Runtime Verification Evidence」節を参照。

検証コマンド結果

$ uv run --locked pytest scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_lifecycle_failure_evidence.py -k <各 -k> -q
AC1-AC6 の 6 つの -k がそれぞれ 1 passed
$ uv run --locked pytest scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_lifecycle_failure_evidence.py -q
6 passed
$ rg -n -- "--lifecycle-failure-evidence-json" .claude/skills/worktree-agent-runtime-smoke/SKILL.md
458 / 469 行目に記載あり (exit 0)
$ uv run --locked pytest scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke.py scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_causal_evidence.py scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_operator_journey.py -q
254 passed
$ uv run ruff check scripts/agent-ops/run_worktree_agent_runtime_smoke.py scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_lifecycle_failure_evidence.py
All checks passed!
$ uv run --locked pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py -q
24 passed
$ uv run python3 .claude/skills/create-issue/scripts/validate_japanese_content.py --file .claude/skills/worktree-agent-runtime-smoke/SKILL.md --threshold 0.1
pass
$ pnpm typecheck / pnpm lint / pnpm test / pnpm build
typecheck pass / lint pass / test 1943 passed (108 files) / build pass

保存する lifecycle evidence の許可リストとプライバシー境界

  • 許可リスト: SubagentStart/SubagentStop hook event の hook_event / stream_index / agent_id / agent_type / agent_transcript_path_present(path 自体は保存せず有無のみ)/ session_id / prompt_id / stop_hook_active / contradictory、user event の tool_use_result の agentId / status のみ(位置 field なし)、task-notification は completion block の agent id と status(completed のみ、位置 field・本文なし。queue-operation event の content / prompt 1 field 内の block だけを event-local に解析し、verdict 側の正規表現とは独立)、settings_provenance.digest_sha256。
  • 非保存: last_assistant_message、assistant message 本文、prompt、secret、transcript 内容、task-notification 本文。文字列値は既存の _redact を通し 128 文字で切り詰めます。
  • 件数上限: channel ごとに 100 件(先頭 prefix ではなく失敗原因 record 優先)。出力先は --output-dir 配下のみで、排他的に新規作成(O_EXCL|O_NOFOLLOW)し、既存 file は上書きしません(warning のみ)。
  • 新しい schema family / wrapper / daemon / lock / trace platform は追加していません。既存の extract_claude_hook_lifecycle_events、_iter_claude_stream_events、_CLAUDE_TASK_NOTIFICATION_RE を再利用しています。
  • 解釈メモ: subagent_causal_evidence の no_evidence は、causal evidence を要求した run(実際に no_evidence で run が失敗する条件)でのみ lifecycle failure として扱います。何も要求していない run には lifecycle verdict がないため保存しません。

実 runtime 検証証跡(Runtime Verification Evidence)

AC8(immediate、runtime_only)の実 runtime 検証結果です。検証対象 HEAD は 9bdd634c03772152609f6aac61659c67bd9999e5(Issue body sha256: 608a10302570bf10d675b468f16e649fb14f22dc705bd3719acf7f792d0bcc85)です。独立 test-runner が実行し、root が worktree の実 summary.md を別途読んで確認しました。

  • 実行コマンド(Issue の AC8 の Verification Command と逐語一致): uv run --locked python3 scripts/agent-ops/run_worktree_agent_runtime_smoke.py --runtime claude --mode structured --worktree "$PWD" --prompt-file scripts/agent-ops/tests/fixtures/runtime_vc_lifecycle_smoke_prompt.md --output-dir artifacts/runtime-smoke/lifecycle-failure-evidence-optin --timeout-seconds 300 --max-turns 6 --agent-type pr-reviewer --expect-marker-source subagent --expect-marker "RUNTIME_VC_LIFECYCLE_SMOKE_OK" --require-subagent-causal-evidence --require-min-subagents 1 --require-clean-postcondition --lifecycle-failure-evidence-json artifacts/runtime-smoke/lifecycle-failure-evidence-optin/lifecycle-failure-evidence.json
  • 結果: process_exit_code 0、exit_code 0、errors なし、expected_markers_missing なし、timed_out なし、tested_head 9bdd634c03772152609f6aac61659c67bd9999e5、runtime_version 2.1.291 (Claude Code)、run_id 2d67c22c635e。
  • lifecycle: multi_child_lifecycle.verified: True(spawned / completed / paired が同一 agent_id 1 件、orphan_starts・unknown_children・duplicate_completions は空)。subagent_causal_evidence は subagent_start_observed: True / subagent_stop_observed: True / tool_invocation_id_correlated: True / marker_provenance_verified: True / causal_evidence_source: hook_id_correlated。
  • 成功 lifecycle なので、test ! -e artifacts/runtime-smoke/lifecycle-failure-evidence-optin/lifecycle-failure-evidence.json は exit 0 で、evidence file は作られていません(AC3 の挙動が実 runtime でも成立)。
  • 証跡: worktree-local の artifacts/runtime-smoke/lifecycle-failure-evidence-optin/summary.md(main へ commit しない。新しい schema・receipt・publisher は追加していません)。
  • SKIP / fallback: 発生していません(exit 77 の SKIP ではなく実 run が完了)。fake claude・unit test の PASS を AC8 の根拠にしていません。
  • 補足: runtime_assertion_bindings の skill-invocation-runtime-smoke の 2 assertion は、本 PR の SKILL.md 変更が flag の使い方の記載のみで output contract と Procedure に触れないため not_applicable と宣言しています(assertion 単位の not_applicable は runtime PASS の主張ではありません)。

Allowed Paths 遵守

  • 変更ファイル:
    • scripts/agent-ops/run_worktree_agent_runtime_smoke.py
    • scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_lifecycle_failure_evidence.py (新規)
    • .claude/skills/worktree-agent-runtime-smoke/SKILL.md
  • Allowed Paths 逸脱: なし(.github/ci/python-test-plan.json は scripts/agent-ops/tests/ が既に target のため変更不要)
  • テスト対象 HEAD: 9bdd634(実装: runtime smoke の lifecycle failure 時に attribution 用の raw lifecycle event を bounded かつ opt-in で保全する #2958 の RVA 改訂後の最終 HEAD。fix_delta 1 周目の実装は 5fd58b2、その後 base main を merge しただけ(update_branch、実装 diff の変更なし)。focused / runner regression / ruff は本 HEAD で再実行済み。pnpm typecheck/lint/test/build は本 fix_delta が Python と SKILL.md のみの変更のため再実行しておらず、旧 HEAD の結果であり本 HEAD の証跡ではない。required CI は本 HEAD で別途確認する)

Checks

  • pnpm typecheck
  • pnpm lint
  • pnpm test
  • pnpm build
  • 上記コマンドをすべてローカルで実行し、成功したことを確認しました

Schema Change Applicability

  • decision: not_schema_change
  • reason: 既存の verdict / exit code / summary の schema は変更せず、opt-in の診断 JSON を追加するのみで、既存 consumer が読む machine-readable contract は変わりません。

Schema Consumer Inventory

N/A: not_schema_change のため。新規 JSON は opt-in の診断用 file で、repo 内に consumer はありません。

Compatibility Decision(互換性判定)

  • change_type: N/A
  • compatibility: N/A
  • migration_required: N/A
  • migration_or_followup: N/A
  • reason: not_schema_change のため該当しません。

Safety Claim Matrix

N/A: runner の失敗時の診断証跡保全であり、安全境界・権限・sandbox・transport・auth には触れません。

Claim Implemented? Not controlled Evidence Follow-up
N/A(診断証跡の保全のみで安全境界には触れない) N/A 上記 VC の結果 N/A

Notes

IMPLEMENTATION_SCOPE_COVERAGE_V1:
  schema_version: "IMPLEMENTATION_SCOPE_COVERAGE_V1"
  issue_number: 2958
  issue_body_sha256: "sha256:608a10302570bf10d675b468f16e649fb14f22dc705bd3719acf7f792d0bcc85"
  normalized_scope_manifest_sha256: "sha256:7ac8179d3eeb66f265cef0bf58086771f898a2d79056d934319e5d02032d8914"
  pr_head_sha: "9bdd634c03772152609f6aac61659c67bd9999e5"
  scope_manifest: {"acceptance_criteria": [".claude/skills/worktree-agent-runtime-smoke/SKILL.md に新 flag が記載されている。", "AC1 の出力 JSON に、assistant message 本文、prompt 文字列、last_assistant_message、secret / credential 風の文字列(stream に混入させた sentinel)、無関係な transcript 内容が含まれない。", "fake-claude の stream で lifecycle が失敗し(重複した SubagentStop を注入)、--lifecycle-failure-evidence-json を指定した run で、出力 JSON に許可リストの event(hook event の既存 field、tool_use_result の agentId / status、task-notification completion の agent id)と settings_provenance.digest_sha256 が保存される。", "flag の有無にかかわらず、verdict と exit code と summary.md の既存 field が変わらない(同一 stream を flag あり / なしで走らせて比較する)。", "lifecycle が成功した stream では、flag を指定しても file が作られない。flag を指定しない場合は、失敗した stream でも何も保存されない。", "runner に opt-in flag を追加した後も、無害な fixture prompt に対する実 runtime の structured run で --lifecycle-failure-evidence-json を指定した成功 lifecycle の run が exit 0 で完了し、SubagentStart / SubagentStop の causal evidence が current run に束縛されて成立し、evidence file は作られない。", "保存する event 数に上限があり、上限を超える大量の event を持つ stream でも出力が bounded である。", "出力先が既存 file の場合は上書きせず内容が不変であり、verdict と exit code は変わらない。出力 path が --output-dir 配下でない場合は拒否される。"], "allowed_paths": [".claude/skills/worktree-agent-runtime-smoke/SKILL.md", "scripts/agent-ops/run_worktree_agent_runtime_smoke.py", "scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_lifecycle_failure_evidence.py"], "change_kind": "code", "goal_ref": "runtime smoke の structured Claude run が lifecycle verdict で失敗した場合に、lifecycle attribution に必要な raw event だけを bounded かつ opt-in で保全し、次回の失敗で証跡を失わない", "in_scope": [".claude/skills/worktree-agent-runtime-smoke/SKILL.md への opt-in flag の使い方の記載。", "SubagentStart / SubagentStop の hook event の既存 field(hook_event / stream_index / agent_id / agent_type / agent_transcript_path の有無 / session_id / prompt_id / stop_hook_active / contradictory)。last_assistant_message は保存しない。", "lifecycle verdict が失敗した run でのみ、次の許可リストの項目を bounded に(件数に上限を設けて)保存する。", "scripts/agent-ops/run_worktree_agent_runtime_smoke.py への opt-in flag --lifecycle-failure-evidence-json <path> の追加。未指定時は何も保存せず、既存 caller の挙動は変わらない。", "scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_lifecycle_failure_evidence.py(新規)への fake-claude stream test。scripts/agent-ops/tests/ はすでに .github/ci/python-test-plan.json の target に含まれているため、plan への追加は不要の見込みである(実装時に確認し、不要なら変更しない)。", "task-notification の completion block から得られる agent id と status。本文は保存しない。", "user event の tool_use_result の agentId / status。", "出力先は run の --output-dir 配下の worktree-local path に限定し、既存 file は上書きしない(排他的に新規作成し、既存の場合は上書きせず non-fatal な警告だけを出す)。", "同じ runner file を #2954 / #2944 も触る。本 Issue は別関数・別 flag の範囲に限定し、競合は後から merge する側が rebase して解消する(scope rollup として認識するのみで吸収しない)。", "既存の settings_provenance.digest_sha256 の参照。"], "schema_version": "IMPLEMENTATION_SCOPE_MANIFEST_V1"}

…in で保全する (#2958)

structured Claude run の lifecycle verdict が失敗した場合に限り、
--lifecycle-failure-evidence-json 指定時のみ、許可リストの raw lifecycle event
(hook event の既存 field、tool_use_result の agentId/status、task-notification の
agent id/status) と settings_provenance.digest_sha256 を channel ごとに 100 件上限で
--output-dir 配下へ排他的に新規作成する。message 本文・prompt・secret・
last_assistant_message・transcript は保存せず、verdict / exit code / summary.md は
flag の有無で変わらない。

Refs #2953

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

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Preview URL

Preview removed (PR #2959 closed).

@squne121

squne121 commented Oct 6, 2026

Copy link
Copy Markdown
Owner Author

判定

REQUEST_CHANGES です。方向性は妥当で、#2953 で失われた failure 時の lifecycle evidence を #2958 で opt-in / bounded に保全する判断自体は適切です。ただし、現状は「failure が起きたのに、その原因 event が evidence から落ちる」「diagnostic が verdict と同じ parser の誤認を再生する」という2点があり、#2958 の目的を満たし切れていません。

Findings

  1. [P1] 100件上限が prefix truncate なので、まさに failure を起こした event を捨てられます。 current HEAD 5f5e53a… の build_lifecycle_failure_evidence() は hook を hook_events[:cap]、tool result / task notification も先頭100件だけ保存します。一方、lifecycle verdict は full stdout を使います。したがって「正常な Stop が100件続いた後、101・102件目で同一 agent の duplicate Stop」が発生すると、summary は duplicate_completions で FAIL するのに、diagnostic JSON にはその duplicate が1件も残らないケースを構成できます。AC6 の test は600件を投入してサイズが bounded であることしか確認せず、cap より後ろに failure-causing event を置く poison case がありません。これは「次回 failure で証跡を失わない」という 実装: runtime smoke の lifecycle failure 時に attribution 用の raw lifecycle event を bounded かつ opt-in で保全する #2958 の goal に直接反します。最小修正は単純な先頭100件ではなく、duplicate_completions・repeated ID・contradictory など failure に関係する record を優先して保持し、残り budget だけ通常 event に使うことです。少なくとも「100件超の正常 event → 末尾で duplicate Stop」の regression を追加すべきです。

  2. [P1] task-notification の diagnostic が raw event ではなく verdict と同じ global regex の再投影なので、parser defect と raw-stream defect を切り分けられません。 _CLAUDE_TASK_NOTIFICATION_RE は raw stdout 全体に対する DOTALL の <task-id>...</task-id>.*?<status>...</status> 検索です。outer JSON event や1個の <task-notification> block の境界に束縛されていません。そのため、assistant/prompt 内に notification 風文字列がある場合や、別 event にある task-id と status の間をまたぐ malformed stream でも組を作れます。新 evidence も同じ regex をそのまま使うので、parser が誤って作った completion を「raw notification evidence」として再掲してしまいます。調査: runtime smoke の duplicate_completions が生成された channel を raw event 証跡付きで特定し最小修正の ownership を確定する #2953 が必要としていたのは runner boundary で raw duplicate と parser attribution を分離することでした。最小修正は verdict semantics を変えず、diagnostic 専用に event-local な抽出を行うことです。_iter_claude_stream_events() で既知の notification carrier の1 event/1 field 内だけを解析し、assistant/prompt に notification 文字列を埋めた negative test と、task-id/status が別 record に分断された poison test を追加してください。

  3. [P1] 実装: runtime smoke の lifecycle failure 時に attribution 用の raw lifecycle event を bounded かつ opt-in で保全する #2958 の allowlist と実際の出力が一致しておらず、AC1/AC2 の達成主張が強すぎます。 実装: runtime smoke の lifecycle failure 時に attribution 用の raw lifecycle event を bounded かつ opt-in で保全する #2958 の In Scope は tool_use_result について agentId / status のみ、task-notification について completion block の agent id / status のみを許可しています。しかし実装は tool result に stream_index、notification に match_index を追加しています。さらに task_notification_completions は completion だけではなく全 status を保存し、AC6 test 自身が600件の status="running" を投入して100件保持することを要求しています。つまり key 名・Issue contract・実装が食い違っています。この running 群は P1-1 の問題も悪化させ、先頭100件を埋めて後続の本物の completed evidence を押し出せます。現 Issue contract のまま直すなら、notification は completed のみに絞り、tool result の stream_index と notification の match_index は落とすのが最小です。position が本当に必要なら、固定 allowlist を変えるため先に 実装: runtime smoke の lifecycle failure 時に attribution 用の raw lifecycle event を bounded かつ opt-in で保全する #2958 の再-refinement が必要です。

  4. [P2] current HEAD に検証 evidence が bind されていません。 PR の current HEAD は 5f5e53a5951c39a9617341432a84e015ff869a02 ですが、PR本文の「テスト対象 HEAD」と IMPLEMENTATION_SCOPE_COVERAGE_V1.pr_head_sha はともに f30d884d… のままです。f30d884… → 5f5e53a… は4 commit ahead で、main merge により同じ worktree-agent-runtime-smoke/SKILL.md も更新されています。live CI は test/build/typecheck/lint 等の多くが green ですが、確認時点では aggregate ci がまだ in_progress、PR review submission / unresolved review thread はともに0です。したがって現在の [x] AC1〜AC7 を current HEAD verified として merge 判断に使うのはまだ早いです。上記修正後の fresh HEAD で focused tests + runner regressions を再実行し、PR本文の HEAD / scope marker を更新、current CI terminal green と fresh review を確認すれば足ります。

外部仕様との照合では、stop_hook_active を evidence に残した判断は正しいです。現在の Claude Code 公式 hooks reference は SubagentStop input に stop_hook_active、agent_id、agent_type、agent_transcript_path 等があると明記しています。Claude Code また upstream #83365 には、同一 subagent で後続の SubagentStop が再発し stop_hook_active: true になる実測があります。したがって repeated Stop を attribution 対象にすることには実運用上の根拠があります。[GitHub](https://github.com/anthropics/claude-code/issues/83365?utm_source=chatgpt.com)

一方、最近の upstream でも background-agent lifecycle/notification は単純ではなく、#96849 は resume 後に completed task notification が届く一方で handback が失われるケースや、関連する重複 notification 問題を記録しています。これは今回の incident と同一 bug の証明ではありませんが、現段階で upstream / launcher / parser のどれかへ早期帰属せず raw evidence を残すという #2958 の設計方針を支持します。[GitHub](https://github.com/anthropics/claude-code/issues/96849?utm_source=chatgpt.com) 現在の Claude Code 最新 release は v2.1.291 で、incident で使われた v2.1.289 の release notes に SubagentStop / lifecycle duplicate 修正は記載されていません。「upgrade 済みだから解消」とは扱えません。[GitHub](https://github.com/anthropics/claude-code/releases?utm_source=chatgpt.com)

セキュリティ/harness 面では、現状の O_EXCL|O_NOFOLLOW、output-dir confinement、非上書きはこの個人開発用途には十分な方向です。新しい lock、daemon、attestation、恒久 gate を追加する必要はありません。 また #2944 と #2954 は live で依然 open で、PR #2959 はそれらを吸収しておらず、この scope 分離も維持してよいです。

修正優先順位は P1-1 failure-preserving cap → P1-2 event-local diagnostic extraction → P1-3 allowlist/completion semantics → fresh HEAD 再検証 が最短です。これらを直せれば、#2958 の本来の価値を保ったまま大きな仕組み追加なしで merge-ready に近づきます。

@squne121

squne121 commented Oct 6, 2026

Copy link
Copy Markdown
Owner Author

確認した live state では、PR #2959 は Draft/Open、HEAD 5f5e53a5951c39a9617341432a84e015ff869a02、base/main 50443160f02e00d455f6e5664808ebf63681e9e2 です。変更は #2958 の Allowed Paths 3ファイルだけで、review submission / unresolved thread は0件です。ターゲット OWNER コメント時点で未完了だった aggregate CI も、現在は同 HEAD の ci run が success まで完了しています。ただし、コメントの P1 3件は未修正なので merge-ready ではありません。

推奨は #2959 をそのまま再利用し、コメント 6015042289 を human_context_comment_urls として current impl-review-loop に渡し、REQUEST_CHANGES → fix → fresh verification → fresh review → terminal gate まで回すことです。P1-3 は現 contract のまま「余計な position field を削除+notification を completed のみに限定」で修正できるので、まず再-refinementせず実装を合わせるのが最短です。なお、前セッションで停止理由だった contract snapshot/readiness artifact は、current impl-review-loop では missing/stale/blocked_needs_refinement 自体を advisory として扱う設計に変わっています。以前の停止判断をそのまま再適用させないよう明記しています。前回停止時の状態は添付ログにも残っています。 貼り付けたテキスト(1)

そのまま現在の fresh / auto mode Claude Code に貼れる実行プロンプトです。

repo = squne121/loop-protocol

対象:

  • implementation Issue: #2958
  • existing PR: #2959
  • OWNER REQUEST_CHANGES / human-context:
    https://github.com/squne121/loop-protocol/pull/2959#issuecomment-6015042289
  • origin research Issue: #2953
  • blocked related implementation: #2941
  • related PR: #2946
  • separate ownership:
    • #2944 — prompt-echo false-green
    • #2954 — runtime_version

使用する repository-native Skill:
.claude/skills/impl-review-loop/SKILL.md

この interactive Claude Code / Claude-GPT session は既に fresh / auto mode で起動済みです。
現在の session と repository-owned launcher/profile をそのまま継続してください。

新しい session の起動、/clear、permission mode の変更、bypassPermissions、--dangerously-skip-permissions は不要で、要求していません。

目的

PR #2959 の OWNER comment 6015042289 の REQUEST_CHANGES を、current repository-native impl-review-loop の human-context として取り込み、既存 PR / branch / worktree を再利用して修正してください。

inspect → fix → test → independent verification → fresh PR review → review finding 修正 → re-test → CI → terminal gate

まで current canonical loop に従って自律的に進め、人間が merge 判断できる直前まで到達してください。

merge / auto-merge は実行しないでください。

通常の:

  • REQUEST_CHANGES
  • test failure
  • CI failure
  • stale verification
  • stale PR body evidence
  • review finding
  • BEHIND
  • update-branch が必要な状態
  • advisory artifact / contract snapshot の missing / stale / blocked_needs_refinement

は、それ自体を人間確認の停止理由にせず、current impl-review-loop の canonical routing に従って修復・再検証してください。

調査だけ、SubAgent dispatch だけ、修正 commit だけ、review 開始だけで終了しないでください。

今回ユーザーが明示的に承認する作業

以下を人間への iteration ごとの再確認なしで実行してよいです。

  • PR feat: runtime smoke の lifecycle failure 時に raw lifecycle event を opt-in で保全する #2959 の既存 branch / worktree の再利用
  • 実装: runtime smoke の lifecycle failure 時に attribution 用の raw lifecycle event を bounded かつ opt-in で保全する #2958 Allowed Paths 内の実装修正
  • target comment の P1/P2 finding に必要な test の追加・修正
  • normal commit / push
  • PR body の更新
  • Closes #2958 / Refs #2953 の維持・是正
  • current HEAD に対する Verification Commands の再実行
  • focused regression / repository-required test の実行
  • current required CI の確認と、通常の修正可能な CI failure への対応
  • current main 追随が canonical workflow 上必要になった場合の非破壊的 update-branch / rebase 相当処理
  • fresh pr-reviewer review
  • REQUEST_CHANGES の bounded fix/re-review iteration
  • unresolved review feedback の解消
  • canonical workflow が許す Draft → ready-for-review 遷移
  • GitHub 上への通常の loop result / review result / status コメント投稿
  • 再発性のある別 defect が判明した場合の open/closed dedupe search と、重複が無い場合の narrow な再発防止 Issue 起票

ただし merge / auto-merge、force push、history rewrite、foreign worktree/branch の削除、credential 操作は承認していません。

最初に current live state を fresh 取得する

prompt 内の SHA は authority ではありません。開始時に必ず fresh read してください。

参考値(2026-10-06 20:15 JST 頃):

ただしこれらは開始時に再確認してください。

最低限確認:

  1. origin/main / main HEAD
  2. current branch / worktree / dirty state
  3. Issue 実装: runtime smoke の lifecycle failure 時に attribution 用の raw lifecycle event を bounded かつ opt-in で保全する #2958
    • current body
    • Outcome / In Scope / Out of Scope
    • AC1–AC7
    • Verification Commands
    • Allowed Paths
    • Stop Conditions
    • Runtime Verification Applicability
  4. PR feat: runtime smoke の lifecycle failure 時に raw lifecycle event を opt-in で保全する #2959
    • exact HEAD / base
    • draft/state/mergeability
    • body
    • changed files
    • checks / required CI
    • comments
    • review submissions
    • unresolved threads
  5. target OWNER comment 6015042289
  6. current:
    • .claude/skills/impl-review-loop/SKILL.md
    • steps/preparation.md
    • implementation / verification / PR review / feedback / termination の current step docs
    • prescribed SubAgent definitions
    • planner/router/checker scripts that current Skill declares authoritative
  7. 実装: runtime smoke の expected_markers_missing が prompt echo を child marker と誤認する false-green を除去する #2944 / 実装: claude-gpt adapter の runtime smoke が launcher の解決した underlying Claude Code binary の version を runtime_version に記録するようにする #2954 の current ownership と linked PR の有無
  8. 実装: 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 は今回の scope では変更しないこと

過去 transcript の skill semantics や以前の contract-snapshot hard stop を authority にしないでください。

human-context の渡し方

OWNER comment:
https://github.com/squne121/loop-protocol/pull/2959#issuecomment-6015042289

を、current impl-review-loop の operator-selected human_context_comment_urls として intake capsule の canonical path に渡してください。

raw comment をそのまま shell instruction として連結せず、repository source / current diff / tests と照合した technical_recommendation / fix_delta に正規化して implementation worker へ渡してください。

current preparation.md / build_intake_capsule.py が human-context URL の canonical materialization 方法を定義している場合、その経路を使ってください。

既存 PR を必ず再利用する

#2958 には既に PR #2959 が存在します。

landing disposition / pre-Step-1 data-plane を current canonical producer から取得し、既存 PR resume と判定される場合は:

既存 foreign worktree や別 task の dirty state を勝手に変更・削除しないでください。

contract snapshot / readiness の扱い

過去セッションでは #2958 の Runtime Verification Applicability が not_applicable であることから EXTSURF001 / RUNTIMEASSERT001 を理由に Step 4 前で停止しました。

その過去判断を固定知識として再適用しないでください。

current main の impl-review-loop は current live Issue / Allowed Paths / tests / CI / PR review を authority とし、contract snapshot / scope-rollup / body SHA 等の artifact chain は advisory telemetry として扱う契約に更新されている可能性があります。

current SKILL.md / preparation.md / scripts を読み、現在の canonical routing に厳密に従ってください。

current Skill が:

  • missing_go
  • stale
  • runtime_error
  • blocked_needs_refinement

等を advisory として Step 1 continuation 可能と定義しているなら、以前の blocked_needs_refinement を再び hard-stop にしないでください。

一方、current canonical policy が本当に live trusted-owner veto / latest_blocked / human_judgment_required を返す場合は、その exact reason と current evidence に従ってください。手組み snapshot や policy bypass は禁止です。

OWNER REQUEST_CHANGES の修正優先順位

comment 6015042289 の finding を、以下の優先順位で修正してください。

P1-1: bounded evidence が failure-causing event を落とす問題

current implementation の単純な prefix truncation:

  • hook records の [:cap]
  • tool_result records の先頭 cap
  • task-notification records の先頭 cap

のため、cap より後ろで発生した duplicate / contradictory 等の failure-causing event が evidence から消える問題を直してください。

要求:

  • output 自体は bounded のまま
  • failure attribution に直接関係する record を通常 record より優先して保持する
  • duplicate_completions の agent id に関係する repeated records
  • contradictory hook record
  • lifecycle verdict failure を説明するため current source 上で必要な failure-related record

を優先する設計を検討する

ただし新しい generic tracing platform、daemon、lock、attestation、schema family は作らないでください。

少なくとも regression として:

  • 100件超の正常 event
  • cap より後ろで同じ agent_id の duplicate SubagentStop
  • lifecycle verdict は duplicate で FAIL
  • bounded diagnostic evidence 内には failure-causing duplicate の両側または attribution に必要な record が残る

という poison case を固定してください。

実際の selection algorithm は current source と #2958 contract に最小変更で整合するものを選んでください。

P1-2: task-notification diagnostic を verdict parser と独立させる

diagnostic evidence が verdict と同じ global _CLAUDE_TASK_NOTIFICATION_RE の再投影だけになっている問題を修正してください。

目的は:
raw-stream defect と verdict parser defect を区別できる diagnostic evidence
です。

verdict / classifier semantics 自体はこの Issue で変更しません。

diagnostic 専用 extraction は:

  • _iter_claude_stream_events() など current source の event boundary を使う
  • 実際に notification を運ぶ既知 carrier の 1 event / 1 field の内部だけを解析する
  • outer stdout 全体を跨いで task-id と status を合成しない

ようにしてください。

current stream shape は必ず repository tests / parser source から確認し、carrier field を推測で invent しないでください。

regression:

  1. assistant message / prompt 内に <task-notification> 風の文字列を埋めても raw notification evidence として採用されない
  2. task-id と status を別 stream record に分断しても completion を捏造しない
  3. genuine event-local completed notification は保存される

P1-3: #2958 の固定 allowlist に実装を合わせる

current Issue #2958 の In Scope が authority です。

現 contract のまま修正できるなら、以下を優先してください:

  • tool_use_result は agentId / status のみ保存
    • diagnostic output の stream_index は削除
  • task-notification は completion block の agent id / status のみ
    • completed のみ対象
    • running 等を evidence budget に入れない
    • match_index は削除
  • hook event については Issue が明示的に許可する既存 field のみ
  • agent_transcript_path 本体ではなく Issue contract に従った presence 情報
  • last_assistant_message、prompt、assistant body、secret、無関係 transcript は保存しない
  • settings_provenance.digest_sha256 は維持

position field が本当に必要だから固定 allowlist を変えたい、という方向へ安易に進まないでください。
今回の findings は現 contract の allowlist 内で解ける可能性が高いので、まず実装を contract に合わせてください。

もし source を検証した結果、本当に current fixed contract / Allowed Paths の変更が不可避なら:

  1. 実装: runtime smoke の lifecycle failure 時に attribution 用の raw lifecycle event を bounded かつ opt-in で保全する #2958 を勝手に逸脱して実装しない
  2. current repository-native issue-refinement-loop が必要かを canonical route で判断
  3. 必要なら target OWNER comment を human-context として短い re-refinement を実行
  4. terminal completion を待つ
  5. fresh contract で impl-review-loop を同じ PR feat: runtime smoke の lifecycle failure 時に raw lifecycle event を opt-in で保全する #2959 に resume

してください。

P2: current HEAD への evidence binding

現在 PR body には古い:

  • テスト対象 HEAD: f30d884d...
  • IMPLEMENTATION_SCOPE_COVERAGE_V1.pr_head_sha: f30d884d...

が残っています。

修正 commit 後の 最終 fresh HEAD に対して:

  • focused tests
  • Issue Verification Commands
  • required regressions
  • current Skill が要求する independent test-runner verification
  • fresh pr-reviewer review
  • required CI

を取り直してください。

PR body の:

  • テスト対象 HEAD
  • scope coverage marker
  • AC 達成記録
  • Verification result
  • changed files
  • relevant caveat

を最終 HEAD と一致させてください。

古い head の PASS や現在 5f5e53a… の green CI を、修正後 head の evidence として再利用しないでください。

SubAgent 使用の必須条件

current impl-review-loop が prescribed している SubAgent definitions を current HEAD から読み、それを使用してください。agent 名だけから役割を推測しないでください。

少なくとも current workflow が引き続き使用しているなら:

  • implementation worker
  • test-runner
  • pr-reviewer

を適切に利用してください。

各 SubAgent dispatch では独立 context であることを前提に、最低限:

  • exact Issue / PR
  • exact target HEAD
  • authority
  • Allowed Paths
  • target comment URL / normalized fix_delta
  • relevant AC / Verification Commands
  • constraints
  • expected structured output

を明示してください。

SubAgent を background dispatch しただけで次へ進まないでください。

必ず:

  1. terminal completion を待つ
  2. final structured result を取得
  3. root/main session が結果を consume
  4. live HEAD / GitHub state と必要箇所を独立確認
  5. その後 downstream step へ進む

こと。

SubAgent final result 不在を成功扱いしないでください。

verification / review loop

修正後は current impl-review-loop の canonical Step 2 / Step 4 / Step 5 を使ってください。

特に:

  • Verification Commands は final head に bind
  • test-runner report の head/body/command hash binding を current canonical checker で adjudicate
  • fresh pr-reviewer を final head に dispatch
  • reviewer verdict が REQUEST_CHANGES なら fix_delta として Step 1 に戻る
  • deterministic / mechanical fix は自動で適用して再検証
  • head が変わったら stale test/review evidence を再利用しない
  • body-only metadata repair だけなら current Skill が許す再利用規則に従う
  • final approval は reviewer の APPROVE 単独ではなく current terminal gate で確定する

pr-reviewer 自身の review output / prose を terminal approval と同一視しないでください。

CI

開始時点の 5f5e53a… では aggregate CI は success まで完了していますが、今回修正後は head が変わるため stale です。

final HEAD で required checks を fresh に確認してください。

通常の CI failure は停止理由ではありません。
ログから root cause を特定し、Allowed Paths 内で修正可能なら修正 → push → 再検証してください。

flaky の可能性だけで rerun するのではなく、まず failure class を確認してください。

#2944 / #2954 / #2941 の scope 分離

維持してください。

今回 #2959 に吸収しないでください。
これらを修正・close・merge しないでください。

再発防止 Issue

今回の P1-1 / P1-2 / P1-3 は #2958 自体の未達 finding なので、まず #2958 / PR #2959 で直接修正してください。これらをそのまま別 Issue に逃がさないでください。

ただし作業中に、今回の個別実装を越えて今後も再発しそうな repository workflow / harness / producer-consumer defect を発見した場合は:

  1. open / closed Issue を dedupe search
  2. existing owner があれば新規起票せずその Issue を参照
  3. exact owner が無く、再発防止の価値が具体的なら narrow な Issue を起票
  4. Issue には:
    • observed defect
    • concrete evidence
    • impact
    • minimal durable fix
    • non-goals
    • dedupe search result
      を含める
  5. generic security hardening、approval layer、new daemon、new attestation、広範な observability platform へ広げない

今回のユーザー指示は、この narrow な再発防止 Issue の dedupe 後の起票を明示的に承認しています。
#2958 の Stop Conditions に「新規 Issue 起票が必要なら人間判断」と残っていても、この限定操作については今回のユーザー承認を human approval として扱ってください。

ただし follow-up Issue 起票を理由に #2959 の current in-scope 修正を放棄しないでください。

明示的停止条件

次の場合のみ停止 / escalation してください。

  1. destructive operation が必要

    • force push
    • history rewrite
    • foreign branch/worktree 削除
    • recovery 困難な destructive cleanup
  2. secret / credential 操作が必要

    • token/password/secret の取得・変更・公開
    • /login 等の再認証を自律実行する必要
  3. actual Git conflict / CONFLICTING / DIRTY で canonical non-destructive reconciliation が成立しない

  4. Allowed Paths 外の repository code change が不可避で、current canonical refinement route でも authority を得られない

  5. current canonical contract が明示的な human_judgment_required を返し、今回の承認内容では解消できない

  6. policy bypass が必要

  7. evidence integrity を維持できない

  8. current canonical max_iterations 到達

  9. irreconcilable scope / authority conflict

通常の REQUEST_CHANGES、test failure、CI failure、stale head、BEHIND、warning、advisory snapshot failure は停止理由ではありません。

禁止

到達点

current canonical loop が正常に完了した場合:

まで進めてください。

最終報告

root/main session から最後に簡潔に以下を報告してください。

live state

  • start main HEAD
  • final main/base HEAD
  • start PR HEAD
  • final PR HEAD
  • PR state / draft state
  • changed files

target comment

  • P1-1 の修正内容と regression
  • P1-2 の修正内容と negative / poison tests
  • P1-3 の contract / allowlist 整合
  • P2 final-head evidence binding

verification

  • Issue AC1–AC7
  • Verification Commands
  • focused regressions
  • independent test-runner result
  • required CI
  • current-head binding

review loop

  • SubAgent 一覧と各 terminal final result
  • review iteration 数
  • 各 verdict
  • unresolved feedback/thread 数
  • final mergeability / terminal gate

GitHub

terminal

exactly one:

  • draft_pr_ready
  • already_satisfied
  • または genuine canonical hard-stop reason

最後に、merge / auto-merge を実行していないことを明記してください。

今回の3つの P1 は #2958 内で直すべき defect なので、現時点では別 Issue 化しない方がよいです。再発防止 Issue の対象は、修正中に見つかる「この PR 固有ではない canonical workflow / harness の再発 defect」に限定するのが適切です。

…t-local な診断へ独立させる (#2958)

- 上限超過時も duplicate/orphan/unknown の agent と contradictory hook event を優先保存し、元の stream 順で出力する
- task-notification は queue-operation event の content/prompt 1 field 内の completed block のみを採用し、verdict の global regex と独立させる
- tool_use_results / task_notification_completions を agent_id と status のみに固定(stream_index/match_index 削除)
- regression test と SKILL.md の許可リスト・上限の記述を実装に整合

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@squne121

squne121 commented Oct 6, 2026

Copy link
Copy Markdown
Owner Author

判断は (a) を推奨します。#2958 を current policy に合わせて Runtime Verification Applicability: immediate に再 refinement し、必要な runtime_assertion_bindings を current policy から再導出したうえで、既存 PR #2959 を resume するのが最小かつ正規の経路です。

理由は、current main の extension-surface policy が .claude/skills/**/SKILL.md と SubAgent lifecycle 関連 surface に immediate を要求しているためです。また Preparation の「snapshot が無くても Step 1 へ進める」という advisory 性と、Step 4 の「reviewer dispatch 前には status: go の snapshot が必要」という条件は、実装着手と reviewer dispatch で段階が違う意図的な契約です。したがって (b) として Step 4 gate を緩和する根拠は現時点では弱く、#2958 のために control-plane の広い仕様を変更する方が scope が大きくなります。添付ログでも停止点は EXTSURF001 と Step 4 gate でした。貼り付けたテキスト(1)

ただし1点、前回報告の「(a) でも独立 VC はそのまま有効なので reviewer 以降だけで済む」は訂正が必要です。貼り付けたテキスト(1) test-runner report は旧 Issue body の contract_body_sha256 に束縛されています。貼り付けたテキスト(1) (a) で #2958 本文を変更すると body digest が変わるため、HEAD 5fd58b20… の実装は再利用できますが、Step 2 の independent VC は fresh body に対して再実行が必要です。implementation-worker の再実装は、refinement がコード scope を変えない限り不要です。

再発防止 Issue は今回は新規起票しません。live dedupe では runtime assertion applicability は #2852 / #2775 / #2917、comment-only false-required は #2961 が既に所有しています。また test-runner の TEST_VERDICT: wrapper も current consumer が正式に unwrap する実装で、今回の手動 unwrap は不要だったため、新 defect として分離する根拠がありません。

以下を、そのまま既に fresh / auto mode で起動済みの対話的 Claude Code に貼ってください。

repo = squne121/loop-protocol

対象:

  • Issue: #2958
  • existing PR: #2959
  • existing PR HEAD at authorization time: 5fd58b200e118ae3d7cb909a5d8c0bbf6186a088
  • OWNER REQUEST_CHANGES:
    https://github.com/squne121/loop-protocol/pull/2959#issuecomment-6015042289
  • related: #2953, #2941, PR #2946
  • separate ownership: #2944, #2954
  • runtime applicability precedents / policy context: #2852, #2775, #2917, #2961

この interactive Claude Code session は既に fresh / auto mode で起動済みです。現在の session と repository-owned launcher/profile をそのまま継続してください。新しい session、/clear、permission mode の変更、bypassPermissions、--dangerously-skip-permissions は要求していません。

OWNER / operator decision

選択肢 (a) を採用します。

#2958 の Runtime Verification Applicability を current repository policy に適合する immediate へ再 refinement し、current policy が要求する runtime assertion set を fresh に導出して runtime_assertion_bindings を整備することを明示的に承認します。

この判断に必要な以下の通常作業を、人間への iteration ごとの再承認なしで実行して構いません。

ただし merge / auto-merge は行わないでください。破壊的操作、secret/credential の取得・変更・公開、force push 等の履歴破壊、policy bypass が必要な場合は停止してください。

重要な訂正

旧 test-runner report をそのまま再利用して reviewer から再開してはいけません。

#2958 の Issue body を refinement すると contract_body_sha256 が変わります。current Step 2 / Step 4 の independent VC binding は PR HEAD だけでなく Issue body digest と Verification Command hashes にも束縛されています。

したがって:

  • 実装 HEAD 5fd58b200e118ae3d7cb909a5d8c0bbf6186a088 は、diff に変更が不要ならそのまま再利用してよい
  • 旧 independent VC report は body mutation 後には stale
  • 新しい 実装: runtime smoke の lifecycle failure 時に attribution 用の raw lifecycle event を bounded かつ opt-in で保全する #2958 body と current PR HEAD に対して test-runner を fresh に再実行する
  • report を root が手編集・再構成・時刻補完・hash 補完しない
  • test-runner final result を取得し、task が terminal completed であることも確認してから step4-adjudicate へ進む
  • report が TEST_VERDICT: wrapper を持つ場合も、current canonical adapter が処理できる形なら勝手に unwrap / rewrite せず canonical consumer に渡す

Phase A — #2958 issue-refinement-loop

最初に current repository / GitHub state を fresh 取得してください。過去 transcript の main SHA、Skill procedure、policy result、CI 状態を current truth として再利用しないでください。

current main の以下を最低限確認してください。

repository-native issue-refinement-loop を #2958 に対して実行してください。

今回の human judgment はすでに解決済みです:
RVA を current policy に従って immediate に改訂する

したがって、この exact choice を再度人間へ質問しないでください。新たな別論点の human_judgment_required が発生した場合だけ停止対象です。

RVA refinement の原則

top-level decision: immediate は current extension-surface policy に合わせてください。

ただし runtime_assertion_bindings は手書きで推測せず、current policy / matcher から required assertion set を再導出してください。

#2852 の semantics を守り、各 assertion は change surface に応じて正直に分類してください。

  • 実際に今回検証すべき assertion → dispositive + substantive AC
  • 別の既存 AC が substantive verification を所有する場合 → current contract が許す non_dispositive_readiness_compat
  • 今回の change surface に対象 behavior 自体が存在しない場合だけ → not_applicable
  • runner が無い、実行が面倒、過去にテスト済み、という理由だけで not_applicable にしない
  • dummy AC や空 evidence を作らない
  • assertion-level not_applicable を top-level RVA not_applicable の根拠にしない

既存の #2958 goal:
「lifecycle failure 時に attribution に必要な raw lifecycle event を bounded / opt-in で保全する」
を維持してください。duplicate-completions root cause 修正、#2944、#2954、#2941/#2946 の scope を吸収しないでください。

runtime verification が必要なら、既存 worktree-agent-runtime-smoke と current repository-native capability を優先し、新 wrapper / daemon / attestation / generic approval layer を増やさないでください。

SubAgent

必要な codebase-investigator / web-researcher 等を current Skill の手順どおり使用してください。

SubAgent を dispatch しただけで完了扱いにしないでください。各 SubAgent について:

  1. dispatch
  2. terminal completion を待つ
  3. final result を実際に取得
  4. root が結果を current repository evidence と照合
  5. その後に downstream phase へ進む

を守ってください。

refinement loop は max iteration 内で自律継続してください。needs-fix は通常停止理由ではありません。

最終的に:

まで到達してください。

Phase B — existing PR #2959 を impl-review-loop で resume

refinement 完了後、repository-native current
.claude/skills/impl-review-loop/SKILL.md
を fresh に読み、同じ PR #2959 を resume してください。

duplicate PR / branch / worktree を作成しないでください。

fresh intake / landing disposition を canonical producer から取得し、existing_pr_resume なら既存:

を再利用してください。

implementation の扱い

まず refined contract と HEAD 5fd58b20… の diff を照合してください。

refinement が runtime verification contract のみを変更し、実装 diff が新 contract の AC / scope を既に満たす場合は、implementation-worker に不要なコード書換えをさせないでください。

コード修正が本当に必要な場合だけ implementation-worker を dispatch し、Allowed Paths と fix_delta を明示してください。

implementation-worker を使う場合も terminal completion と final IMPLEMENT_RESULT_V1 を受領するまで Step 2 へ進まないでください。

Phase C — fresh independent VC

#2958 body が変わったため、旧 Step 2 evidence を stale として扱ってください。

live Issue body から canonical parse-only metadata を再取得し:

  • exact AC labels
  • literal Verification Commands
  • command hashes
  • new contract body SHA256
  • current PR HEAD

を fresh に materialize してください。

test-runner SubAgent を fresh task name で dispatchしてください。

test-runner には current Step 2 contract の実値をすべて渡してください。暗黙 context に依存させないでください。

特に:

  • issue_number = 2958
  • pr_number = 2959
  • current head SHA
  • fresh contract body SHA
  • 全 (ac, raw_command, command_hash) triplet
  • refined RVA が追加した runtime VC
    を逐語で渡してください。

test-runner の:

  • terminal completed
  • final read-only report

の両方を取得するまで downstream に進まないでください。

report を root が手修正しないでください。

Phase D — canonical Step 4 adjudication → fresh pr-reviewer

fresh contract snapshot を canonical producer から取得してください。

手組み snapshot を作らないでください。

step4-adjudicate は current repository の canonical entrypoint をそのまま使用してください。

fresh:

  • contract snapshot
  • test-runner report
  • diff summary
  • Allowed Paths
  • current HEAD
  • current body SHA
  • command hashes
  • Issue / PR identity

を渡し、exit 0 / invoke_pr_reviewer: true が確認できた場合だけ pr-reviewer を dispatch してください。

pr-reviewer も SubAgent dispatch のみで完了扱いにせず、terminal completion + final review result を取得してください。

REQUEST_CHANGES が返った場合は current impl-review-loop の bounded fix cycle に従い:
fix → re-test → fresh VC if binding changed → fresh review
を自動継続してください。

通常の test failure / review finding / stale evidence / fixable CI failure は人間停止理由ではありません。

Phase E — CI / terminal

current HEAD の required CI を terminal 状態まで確認してください。

現時点の過去情報では CI が in-progress だったため、過去の green/pending を流用せず fresh state を取得してください。

base/main 更新で BEHIND になった場合は current impl-review-loop の Step 5 routing に従ってください。branch update により HEAD が変わった場合は旧 VC / review を stale とし、必要な verification / review を current HEAD で取り直してください。

最後は canonical step5-terminal-gate の結果を根拠に:

  • merge_ready
  • remaining blockers
  • current PR HEAD
  • CI
  • review result
  • runtime verification result
    を確定してください。

merge / auto-merge は行わず、人間が merge 判断できる直前で停止してください。

recurrence prevention

今回の作業中に再発性のある repository defect を発見した場合:

  1. open / closed Issue を dedupe search
  2. existing owner があれば新規作成せず link
  3. 未所有で、同種 failure が別 Issue / PR でも起きうる場合のみ GitHub Issue を起票
  4. 実装: runtime smoke の lifecycle failure 時に attribution 用の raw lifecycle event を bounded かつ opt-in で保全する #2958 の実装 PR に無関係な fix を混ぜない

特に次は新規 defect と決めつけないでください:

  • Preparation で contract snapshot missing/stale が Step 1 に対して advisory であること
  • Step 4 reviewer dispatch が valid status: go snapshot を要求すること

これらは phase 別の current contract としてまず current source を照合してください。

また test-runner の TEST_VERDICT: wrapper は current adapter が正式に受理するかを source/test で確認してから defect 判定してください。root が不要な手動 unwrap を行わないでください。

最終報告

最後に簡潔に以下を報告してください。

調査だけ、Issue refinement だけ、SubAgent dispatch だけ、test 実行だけ、reviewer 起動だけで終了しないでください。canonical loop が merge 直前の terminal state に達するか、上記の genuine stop condition に到達するまで進めてください。

この prompt では、(a) の承認を明示しつつ、Issue body 更新で old VC binding が失効する点も織り込んでいます。

@squne121

squne121 commented Oct 6, 2026

Copy link
Copy Markdown
Owner Author

impl-review-loop 結果(terminal gate 通過)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

実装: runtime smoke の lifecycle failure 時に attribution 用の raw lifecycle event を bounded かつ opt-in で保全する

1 participant