Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "agent-retrospective live smoke verifier (`verify_agent_retrospective_live_smoke.py`) が前提とする「空 prompt → 決定論的に run_id mismatch」という記述が現行 Claude Code CLI の実測挙動と矛盾している regression を解消する"
change_kind: workflowParent Issue
なし(単独改善)
Parent Goal Ref
- Goal: なし(単独 Issue)
- Desired Destination: なし(単独 Issue)
Current Validated Scope
.claude/skills/agent-retrospective/scripts/tests/verify_agent_retrospective_live_smoke.pyの empty-prompt 前提の観測/検知経路.claude/skills/agent-retrospective/scripts/run_retrospective.pyの--prompts-file未指定時のデフォルト prompt 生成箇所(必要な場合のみ)
Remaining Parent Gaps
なし(単独改善 Issue のため)
Outcome
verify_agent_retrospective_live_smoke.py の claude_live 手動実行時、--prompts-file を渡さないケースが「observer prompt が空文字列になり、run_retrospective.py の bundle validation で run_id/ctx.run_id mismatch に決定論的に到達する」という前提で設計されている。しかし Issue #2341 / PR #2342 の fix_delta 実装中の実測では、Claude Code 2.1.245 において claude -p 自体が空文字列 prompt を bundle validation に到達する前に拒否する(Error: Input must be provided either through stdin or as a prompt argument when using --print, exit code 1)ため、run_retrospective.py の invoke_agent() は status="api_error" / reason_code="nonzero_exit" を返し、observer_failed:<agent>:<status> の raise site 経由で ObserverWaveFailed(reason_code="nonzero_exit") に到達する。これは verifier の allowlist(observer_run_id_mismatch のみ許容)に含まれないため、verifier は意図せず FAIL する。
この Issue の完了時点で、verifier が意図した検知経路(observer_run_id_mismatch への到達、または status: pass)に確実に到達できる状態、または「空 prompt 拒否を意図的に許容する」設計判断のいずれかを明文化・実装した状態を Outcome とする。
Runtime Verification Applicability
- decision: immediate
- reason: 本 Issue は
claude_liveマーカー付きの実 Claude Code CLI 経由 live smoke verifier(verify_agent_retrospective_live_smoke.py)の前提・挙動を扱うため、docs/dev/runtime-verification-policy.mdの適用判定スキーマ上 immediate に該当する。実装完了時に verifier を実 CLI で手動実行し証跡を残すこと。
applicable_acs: AC1
execution_environment: 現在インストール済みのclaudeCLI バイナリ(実装時点の最新 main HEAD、認証済みサブスクリプションログイン環境)による手動実行環境。ローカル開発機または人間/agent が直接操作できる環境を前提とし、デフォルト CI 実行環境(claudeCLI 非搭載)とは区別する。
skip_conditions:claudebinary が PATH に存在しない、またはclaude auth statusが非ゼロ exit で終了する(認証未確立)場合は SKIP(exit 77)とする。
fallback_policy: SKIP は PASS に昇格しない。SKIP が発生した場合は fail-closed のまま維持し、実装完了報告には「実行できなかった」ことと skip_condition の種別を明記する。
artifact_requirements:verify_agent_retrospective_live_smoke.py --runtime-profile claude_code --repo-root .の実行 stdout(JSON 1行、reason_code込み)を実装完了時に PR 本文または PR コメントへ証跡として残す。raw stdout 全文・credential・絶対パスは含めない(bounded classification のみ)。
Background
Issue #2341(PR #2342)の実装・fix_delta 対応中に、.claude/skills/agent-retrospective/scripts/tests/verify_agent_retrospective_live_smoke.py の claude_live 手動実行を通じて、Issue #2341/PR #2342 のスコープとは別の regression を発見した(発見経緯: PR #2342 への OWNER レビューコメント #2342 (comment) P2 item 3〜4)。
verify_agent_retrospective_live_smoke.py はこれまで、--prompts-file を渡さずに run_retrospective.py を起動すると、observer 向け prompt が空文字列 (prompts.get(observer_id, "") -> "") になり、その結果 observer wave が run_id/ctx.run_id mismatch により決定論的に ObserverWaveFailed に到達する、という前提を docstring / コメントに記載していた。
しかし実際に Claude Code 2.1.245 で計測したところ、空文字列 prompt は run_retrospective.py の bundle validation(bundle.run_id != ctx.run_id の envelope check)に到達する前に、claude -p 自体が起動段階で拒否する。
Error: Input must be provided either through stdin or as a prompt argument when using --print
exit_code=1
run_retrospective.py の invoke_agent() はこれを status="api_error" / reason_code="nonzero_exit" として観測する(observer_failed:<agent>:<status> の raise site 経由で ObserverWaveFailed(reason_code="nonzero_exit") になる)。つまり、これまで docstring が記載していた「空 prompt → run_id mismatch」という deterministic path は、少なくとも Claude Code 2.1.245 環境では成立しない。
claude -p (Claude Code CLI の headless invocation)が空文字列 prompt を拒否する挙動そのものは、run_retrospective.py / agent-retrospective skill のバグではなく、Claude Code CLI 側の既存の別 regression(起動前の入力バリデーション挙動)である。Issue #2341 / PR #2342 は run_retrospective.py の ObserverWaveFailed reason_code 診断性改善が主眼であり、この空 prompt 拒否挙動自体の修正・回避は Issue #2341 / PR #2342 のスコープ外・別 ownership として明示的に切り出す。
なお verify_agent_retrospective_live_smoke.py の docstring / コメント自体の誤記述訂正は PR #2342 fix_delta 側で既に対応済み(この Issue は「訂正後の記述が指す本来の検知経路を実際に機能させる/設計判断を確定する」ことを scope とする)。
In Scope
verify_agent_retrospective_live_smoke.py(またはrun_retrospective.pyの--prompts-file未指定時のデフォルト prompt 生成箇所)が、observer 向け prompt に非空文字列を確実に渡せるようにする対応、または「空 prompt 拒否を意図的に許容し、nonzero_exitを新たに allowlist する」設計判断を明文化する対応、のいずれかを選択し実装する。- 選択した対応方針を
verify_agent_retrospective_live_smoke.pyの docstring / コメントに、実測に基づく正確な記述として反映する。
Out of Scope
- Issue 実装: agent-retrospective canonical run が retrospective-runtime-observer の missing_structured_output で fail-closed する回帰を解消する #2341 / PR fix: agent-retrospective の observer wave 失敗を診断可能にし regression coverage gap を解消する #2342 の
ObserverWaveFailedreason_code 診断性改善そのものの再実装 - upstream Claude Code CLI 自体のソースコード修正(このリポジトリの管理外)
run_observer_wave()の envelope/base_sha/manifest 検証ロジック自体の変更
Acceptance Criteria
- AC1:
verify_agent_retrospective_live_smoke.py --runtime-profile claude_code --repo-root .を手動実行し、reason_codeが空 prompt 拒否由来のnonzero_exit(未対応のまま)ではなく、意図した経路(observer_run_id_mismatchまたはstatus: pass)に到達することを確認する - AC2: 対応方針(prompt 非空化、または
nonzero_exitallowlist 追加のいずれか)がverify_agent_retrospective_live_smoke.pyのソース上に実装として反映されている
Verification Commands
VC 補足:
- AC1 の baseline(未実装)では、verifier が空 prompt 拒否由来の
nonzero_exitで FAIL する(exit 1)ことが期待値。実装後は exit 0(observer_run_id_mismatchへの到達、またはstatus: pass)を期待する。
# AC1
# baseline-expect: fail
# preflight-scope: runtime_only
$ uv run --locked python3 .claude/skills/agent-retrospective/scripts/tests/verify_agent_retrospective_live_smoke.py --runtime-profile claude_code --repo-root .
# AC2
# baseline-expect: pass
$ grep -n "nonzero_exit" .claude/skills/agent-retrospective/scripts/tests/verify_agent_retrospective_live_smoke.pyAllowed Paths
- .claude/skills/agent-retrospective/scripts/tests/verify_agent_retrospective_live_smoke.py
- .claude/skills/agent-retrospective/scripts/run_retrospective.py(
--prompts-file未指定時のデフォルト prompt 生成箇所に限る)
Scope Delta(該当時のみ記載)
N/A
Required Skills
- なし(Python subprocess ラッパー・既存 CLI 呼び出し規約の範囲で完結する)
Required Design References
- .claude/skills/agent-retrospective/scripts/run_retrospective.py
- docs/dev/runtime-verification-policy.md
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
Activity
fix: ObserverWaveFailed の allowlist を粒度のある reason_code に絞り込む
fix: agent-retrospective の observer wave 失敗を診断可能にし regression coverag…
squne121 commentedon Aug 25, 2026
root-owned entry router audit
route: stop
reason: review_verdict_blocked
squne121 commentedon Aug 25, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
squne121 commentedon Aug 25, 2026
implement-issue: 実装完了 (2026-08-25T20:01:52Z)
.claude/worktrees/issue-2345-claude-live-smoke-fixworktree-issue-2345-claude-live-smoke-fixfix: agent-retrospective default observer prompt を construct-to-fail …
fix: agent-retrospective live smoke の空 prompt 拒否 regression を解消 (#2345)…