Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "root_review_pipeline.produce のtimeoutをregistryから実際に消費するrepository-owned consumerが存在する場合に限り、full produce envelopeより短いouter deadlineを再発不能にする"
change_kind: codeParent Issue
none
Parent Goal Ref
- Goal: Issue 実装: repair_action.apply の unauthorized_write_path false negative を解消する #2584 のcanonical Step 2を、修正後のfresh review evidenceで再開可能にする
- Desired Destination: #2584ではなく、root review timeout contractの独立修正
Current Validated Scope
- 最初に
root_review_pipeline.produceの execution surface(.claude/skills/issue-refinement-loop/SKILL.mdのStep 2記述)/registry timeout consumer/outer deadline owner/signal producer/process cleanup owner の5項目を個別にinventoryし、rendered command・caller・deadline値の対応で証明する(consumer不在を無条件no-op停止の理由にしない。下記「In Scope」a/b参照)。 - 実consumerが確認された場合だけ、
.claude/skills/issue-refinement-loop/scripts/command_registry.py、.claude/skills/issue-refinement-loop/scripts/run_root_review_pipeline.py、.claude/skills/issue-contract-review/scripts/contract_readiness_check.pyの範囲で、そのconsumerが読むbounded timeout contractを変更する。実consumerが確認されない場合でも、command_registry.pyのtimeout_secondsが未強制/informational値であることを明記する注記追加(下記In Scope d)は行う。 .claude/skills/issue-refinement-loop/SKILL.mdのStep 2実行契約を「明示的background launch(run_in_background: true)+ mandatory completion join」に変更し、background起動時点をStep 2完了として扱わないことを明記する(OWNER REQUEST_CHANGES、下記In Scope c)。ReviewBudgetのinner deadlineではなく、body fetch/pin、canonical-plan/setup、accepted bodyのReviewBudget.total_seconds、TERM/KILL wait、bounded reader join、result/artifact finalizationを含むfullproduceenvelopeをnamed SSOTまたはexplicit bounded transportで扱う。inner(ReviewBudget)/outer(SKILL.md background+join契約)の責務分離を維持し、outerがbody-specific budgetを事前二重計算・transportする新protocolは追加しない。.claude/skills/issue-refinement-loop/tests/test_review_budget_wiring.py、.claude/skills/issue-contract-review/tests/test_run_contract_review_once_wrapper_wiring.py、新規.claude/skills/issue-refinement-loop/tests/test_root_review_pipeline_outer_timeout_budget.pyでfocused parity/integration testを追加する。既存のcommand_registry.py --validateCLI機能に対しては、新規thin pytest wrapper.claude/skills/issue-refinement-loop/tests/test_command_registry_validate_cli.pyを追加し、uv run python3直呼びをVCから排除する(下記In Scope e、VC preflight allowlist制約対応)。skill_runtime_exec.pyをroot-review eligible commandへ追加して回避しない。inventoryで実行ownerと確認できた場合だけ、Allowed Paths外のためStop Conditionsに従う。
Remaining Parent Gaps
- なし。AGY authentication persistenceは別Issueで扱い、本Issueに含めない。
Outcome
repository-owned outer consumerが確認された場合に、そのouter deadlineがcurrent canonical VC planから導かれる合法なfull produce envelopeを下回らず、inner budgetの将来変更がstatic/parityまたはproduction-shaped regression testで検出される状態。repository外harnessだけがdeadline ownerの場合は、コード変更を開始せず、その証跡を残して停止する状態。加えて、SKILL.md Step 2実行契約がbackground launch + mandatory completion joinとして明記され、registryのtimeout_secondsが実consumer不在の現状で未強制/informational値であることが明示され、Issue #2584に対する1回限りのread-only canaryで実際のexecution surfaceを検証した状態。
Runtime Verification Applicability
decision: immediate
applicable_acs: [AC2, AC3, AC4, AC5, AC9]
execution_environment: "network/auth不要のlocal pytest。deadline/clockはtest-only injectionまたはproduction-shaped fixtureで制御する。AC9のみ#2584に対する1回限りのread-only GitHub呼び出しを伴う(常設CI live mutation gateにはしない)。"
skip_conditions:
- "registry timeoutを読むrepository-owned outer consumerをinventoryで確認できない(AC2/AC3のnamed SSOT変更のみskipし、AC1/AC6/AC7/AC8/AC9のtest-onlyまたは注記系ACはskipしない)"
- "outer deadline ownerがrepository外harnessのみである(同上)"
fallback_policy: "skip conditionではコード変更・成功主張を行わずStop Conditionsに従って停止し、ownerへexecution ownerの証跡を返す。"
artifact_requirements:
- "focused pytestの結果: review-budget wiring、wrapper wiring、outer-envelope parity、command_registry --validate wrapper"
- "command_registry.py --validateの成功出力(pytest wrapper経由)"
- "AC9 canary実行の証跡(route/approve/implementation authorizationを捏造していないことの確認込み)"
reason: "AC2/AC4/AC5はtimeout ownershipとfail-closed cleanupを実行形fixtureで検証する必要があり、AC9はcanonical execution surfaceに対する1回限りのread-only実地確認を必要とする。"Current Evidence
- Evidence cut: 2026-09-10; repository source was checked at
a2568fdad178b9e22b74595a982f0550c2595f49.9b54baadb6ff971d17be95cadf1729236172eeecis prior evidence, not the current checked-out HEAD. - 実装: repair_action.apply の unauthorized_write_path false negative を解消する #2584 comment 5611908804は、
preflight.run.with_human_context成功後にroot-owned reviewがregistered 90-second budget後にterminateされ、exit 143となりcanonical_step2_routeを生成しなかったと記録する。Issue本文はrewriteされずimplementation-readyではない。 - current registryは
root_review_pipeline.produce.timeout_seconds: 90を宣言する。 - current sourceのminimum compatibility ReviewBudgetはN<=2でbaseline aggregate 350s、readiness wrapper 400s、reviewer per-attempt 480s、reviewer total 520s。
- current 実装: repair_action.apply の unauthorized_write_path false negative を解消する #2584 bodyをside-effect-free canonical VC-plan producerで計算すると、
command_occurrence_count=4、aggregate=660s、ReviewBudgetはbaseline=680s / readiness=730s / per-attempt=810s / total=850s。 - 90秒はminimum 520秒と#2584固有の850秒のいずれも下回る。ただしこれだけではouter 90秒のconsumer・signal producer・active phase・repository内外のexecution ownerは証明しない。
skill_runtime_exec.pyはgeneric registry executor向けSIGTERM→grace→SIGKILL cleanupを持つが、root_review_pipeline.produceはcurrent policyのeligible commandとして確認されていない。#2584のexit 143を当該executorへ帰属しない。- 5項目inventoryの現状調査結果(OWNER REQUEST_CHANGES反映): (1) execution surface =
.claude/skills/issue-refinement-loop/SKILL.mdStep 2記述(main-thread直接Bash実行、canonical Step 2 routing authority); (2) registry timeout consumer =scripts/agent-guards/skill_runtime_command_policy.pyのSKILL_RUNTIME_COMMAND_POLICY_V2["eligible_command_ids"]にroot_review_pipeline.produceは含まれず、registryのtimeout_seconds: 90を読むrepository-owned callerは調査時点で確認できない(証拠:eligible_command_idsキー集合の直接確認); (3) outer deadline owner = 現状なし(repository内に明示的なouter watchdog実装が存在しない); (4) signal producer = exit 143はSIGTERM示唆だが送信元は未証明のまま維持する; (5) process cleanup owner = 現状なし(skill_runtime_exec.pyのcleanup契約は対象外のため適用されない)。この5項目inventory結果は、consumerが見つからないことを理由に無条件no-op停止する根拠にはしない(下記In Scope a/b)。
Timeout Ownership Decision
- fact (high confidence): registryのstatic 90s宣言はpipelineのcurrent legitimate ReviewBudgetより短い。registryをouter deadlineとして消費するconsumerではcontract driftとなる。
- fact (medium confidence): #2584での90秒terminationとexit 143のsignal producer、inner active phase、cleanup telemetry、repository内外のownerは未証明である。
- fact (high confidence, OWNER REQUEST_CHANGES反映): registryの
timeout_secondsフィールドは、実consumerが存在しない現状では repository codeによって強制されない、ドキュメント/意図表示専用の値である。現在の90という値はminimum legitimate ReviewBudget(520秒)や#2584相当(850秒)を大きく下回り、"canonical runtime budget"であるかのように誤解を招くdriftである。実consumerがない場合でも、この値をそのまま放置せず、command_registry.py内のコメントに「unenforced / informational, see SKILL.md Step 2 background+join contract for actual execution model」相当の注記を追加して是正する(下記In Scope d、AC7)。 - required design: outer timeoutをbody-derived ReviewBudgetだけでなくfull
produceenvelopeから導出し、static integerが必要なconsumerではaccepted policy ceilingから同じpure derivationでmaximum envelopeを作る。単なる90 → 任意の固定大値は不可。 - inner/outer責務分離(OWNER REQUEST_CHANGES反映): 既存のinvocation-local
ReviewBudget(body取得後にVC occurrence数から計算、実装: review pipeline の timeout budget を動的 VC 本数ベースに再設計する #2207/#2221実装)はinner semantic/runtime deadlineのSSOTとして維持し、outer(SKILL.mdのbackground+join契約)がbody-specific budgetを事前に二重計算・transportする新protocolは追加しない。 - outer supervisionの実装方式(OWNER REQUEST_CHANGES反映): monotonic absolute deadlineの要求は、既存のinner ReviewBudget実装(
run_root_review_pipeline.py/reviewer_transport.pyのSIGTERM→grace→SIGKILL/reap実装)に対して維持し弱化しない。新しいouter watchdogスクリプトの新規実装は、Stop Conditions(control-plane増殖回避、新schema/ledger/receipt禁止)により行わない。outer supervisionはClaude Code自体のbackground task機構(run_in_background: true+ mandatory completion join。既定BASH_DEFAULT_TIMEOUT_MS=120000ms、BASH_MAX_TIMEOUT_MS上限=600000ms、timeout到達時はkillでなく自動background転換、main conversation発のbackground taskはresponse後も実行継続する。Web-researcher確認のfresh公式仕様)に委ねる。globalBASH_MAX_TIMEOUT_MS自体の変更は引き続きOut of Scope。
In Scope
- (a) rendered command、caller、deadline値によるregistry consumer inventoryと、repository-owned ownerのproof gate。execution surface(
.claude/skills/issue-refinement-loop/SKILL.md)/registry timeout consumer(scripts/agent-guards/skill_runtime_command_policy.py)/outer deadline owner/signal producer/process cleanup owner の5項目を独立に確認・記載し、consumer不在を理由に無条件no-op停止としない(AC1)。 - (b)
legitimate full produce envelope + required cleanup/grace <= outer supervisor deadlineをminimum compatibility、#2584相当N=4、static-policy-elevated planで保証する(.claude/skills/issue-refinement-loop/scripts/command_registry.py、.claude/skills/issue-refinement-loop/scripts/run_root_review_pipeline.py、.claude/skills/issue-contract-review/scripts/contract_readiness_check.py、AC2/AC3)。 - (c)
.claude/skills/issue-refinement-loop/SKILL.mdのStep 2実行契約を「明示的background launch + mandatory completion join」に変更する:root_review_pipeline.produceをClaude Code main threadのBash toolから呼ぶ際、run_in_background: trueで明示的にbackground実行し、完了を示すtask notificationをjoinしてから(=完了したJSON結果を実際に取得してから)canonical Step 2 routingに進む契約をSKILL.md本文に明記する。background起動した時点でStep 2完了扱いにしないことを明記する(AC6)。 - (d)
.claude/skills/issue-refinement-loop/scripts/command_registry.pyのtimeout_secondsフィールドについて、実consumerが存在しない現状は repository codeによって強制されない、ドキュメント/意図表示専用の値であることをコード内コメントで明記する(AC7)。 - (e)
command_registry.py --validateの既存呼び出しを、VC preflight allowlist準拠の新規thin pytest wrapper.claude/skills/issue-refinement-loop/tests/test_command_registry_validate_cli.py(subprocessまたはimport経由でCLI/関数を呼び出しexit codeをassertする)に置き換える(AC8)。 - (f) runaway processのbounded termination、SIGTERM→grace→SIGKILL、fail-closed環境/integrity semantics、timeout時にcanonical_step2_routeを推測しないことの維持(AC4/AC5)。
- (g) test-only deadline/clock injection又は同等のproduction-shaped fixtureで、実時間90秒待機なしにouter timeout/cleanup provenanceを検証する(AC4/AC5)。
- (h) 実装後、Issue #2584に対して実際のcanonical Step 2 execution surface(background+join契約後の
root_review_pipeline.produce)を1回だけread-onlyで通す run-time canaryを実行し証跡を残す(AC9。常設CI live mutation gateにはしない)。
Out of Scope
- AGY authentication、credential、provider、permission mode、launcher設定の変更。
- root review commandを
skill_runtime_exec.pyのeligible commandへ新規追加すること、cleanup policyを弱めること、repository外harnessの設定変更。 - 全commandのtimeout一律拡大、無制限timeout、retry回数増加、live GitHub mutation canary(AC9のread-only canaryを除く。AC9はmutationを行わない)。
- Issue #2584本文の変更、implementation-ready判断、古いpreflight/review evidenceの再利用。
BASH_MAX_TIMEOUT_MS等、Claude Code自体のglobal設定変更。- outer timeout supervisionのための新規watchdogスクリプト実装、新schema/ledger/receipt/persistent stateの追加、root-review専用exact-executor profileの新設。
Acceptance Criteria
- AC1:
root_review_pipeline.produceのouter timeout ownershipを、execution surface/registry timeout consumer/outer deadline owner/signal producer/process cleanup ownerの5項目として実装前に独立にinventoryし、#2584のexit 143の生成主体を未証明のままskill_runtime_exec.pyへ帰属せず、consumer不在を理由に無条件no-op停止としない。 - AC2: in-repo outer consumerが確認された場合、outer deadlineはnamed SSOTから導くfull
produceenvelope以上である。envelopeは少なくともbody fetch/pin、canonical-plan/setup、accepted bodyのReviewBudget.total_seconds、TERM wait、KILL wait、bounded reader join、result/artifact finalizationを含み、各addendはsource constant又は明示的にboundedなcontractに対応付ける。 - AC3: static integerが必要なconsumerではaccepted policy ceilingからmaximum full envelopeを同じpure derivationで生成し、invocation-local budgetを読めるconsumerではexplicit transportを行う。
90 → 任意の固定大値、独立コピー、未証明consumerへの値変更を禁止する。 - AC4: test-only production-shaped fixtureがouter deadline前にinner合法deadlineをkillしないこと、timeout時にもSIGTERM→grace→SIGKILLとreap/cleanup契約を維持することを検証する。
- AC5: timeoutの場合はfail-closedのままであり、canonical_step2_route、approve、implementation authorizationを捏造しない。
- AC6:
.claude/skills/issue-refinement-loop/SKILL.mdのStep 2実行契約に、root_review_pipeline.produceをrun_in_background: trueで明示的にbackground実行し、完了を示すtask notificationをjoinしてから(完了JSON結果取得後に)canonical Step 2 routingへ進むことを明記し、background起動時点でStep 2完了扱いにしないことを明記する。 - AC7:
.claude/skills/issue-refinement-loop/scripts/command_registry.pyのroot_review_pipeline.produce.timeout_seconds宣言近傍に、実consumer不在の現状ではrepository codeによって強制されないunenforced/informational値であり、実際のexecution modelはSKILL.md Step 2 background+join契約を参照する旨のコメントを追加する。 - AC8:
command_registry.py --validateの検証を、新規thin pytest wrapper.claude/skills/issue-refinement-loop/tests/test_command_registry_validate_cli.py経由で行い、focused pytestとregistry validationがPASSし、全agent-guards suiteやlive GitHub mutationを無条件local gateにしない。 - AC9: 実装後、Issue #2584に対して実際のcanonical Step 2 execution surface(background+join契約後の
root_review_pipeline.produce)を1回だけread-onlyで通すrun-time canaryを実行し、(1) 旧90秒boundaryでpremature terminationしないこと、(2) background実行後に確実にjoinされること、(3) genuineなcanonical_step2_routeまたは genuineなtyped failureを取得すること、(4) timeout/failure時にroute/approve/implementation authorizationを捏造しないこと、を確認して証跡を残す。常設CI live mutation gateにはしない。
Verification Commands
AC9 は実装後1回限りの read-only canary であり、常設 CI live mutation gate にはしない(Out of Scope 参照)。test_step2_execution_surface_canary.py は docs/dev/runtime-verification-policy.md のSKIP規約(exit code 77、SKIP: prefix)に従い、明示的な live-canary有効化(例: 環境変数)がない限りSKIPし、有効化時のみ実際に#2584に対してread-onlyでcanonical Step 2 execution surfaceを1回通す。
# AC1
# baseline-expect: pass
$ rg -n "root_review_pipeline.produce" .claude/skills/issue-refinement-loop/SKILL.md .claude/skills/issue-refinement-loop/scripts/run_root_review_pipeline.py
# baseline-expect: pass
$ rg -n "run_root_review_pipeline.py" .claude/skills/issue-refinement-loop/SKILL.md scripts/agent-guards/skill_runtime_command_policy.py
# baseline-expect: pass
$ rg -n "timeout_seconds" .claude/skills/issue-refinement-loop/scripts/command_registry.py scripts/agent-guards/skill_runtime_command_policy.py
# AC2
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_review_budget_wiring.py -v
# AC3
$ uv run --locked pytest .claude/skills/issue-contract-review/tests/test_run_contract_review_once_wrapper_wiring.py -v
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_root_review_pipeline_outer_timeout_budget.py -v
# AC4
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_root_review_pipeline_outer_timeout_budget.py -v
# AC5
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_root_review_pipeline_outer_timeout_budget.py -v
# AC6
$ rg -n "background起動した時点でStep 2完了扱いにしない" .claude/skills/issue-refinement-loop/SKILL.md
# AC7
$ rg -n "unenforced / informational, see SKILL.md Step 2 background\+join contract" .claude/skills/issue-refinement-loop/scripts/command_registry.py
# AC8
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_command_registry_validate_cli.py -v
# AC9
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_step2_execution_surface_canary.py -vAllowed Paths
(scripts/agent-guards/skill_runtime_command_policy.py は read-only reference であり、変更しない)
- .claude/skills/issue-refinement-loop/scripts/command_registry.py
- .claude/skills/issue-refinement-loop/scripts/run_root_review_pipeline.py
- .claude/skills/issue-contract-review/scripts/contract_readiness_check.py
- .claude/skills/issue-refinement-loop/SKILL.md
- .claude/skills/issue-refinement-loop/tests/test_review_budget_wiring.py
- .claude/skills/issue-refinement-loop/tests/test_root_review_pipeline_outer_timeout_budget.py
- .claude/skills/issue-contract-review/tests/test_run_contract_review_once_wrapper_wiring.py
- .claude/skills/issue-refinement-loop/tests/test_command_registry_validate_cli.py
- scripts/agent-guards/skill_runtime_command_policy.py
- .claude/skills/issue-refinement-loop/tests/test_step2_execution_surface_canary.py
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- registry timeoutを読むrepository-owned consumerを確認できない、又はouter deadline ownerがrepository外harnessのみと判明した場合(AC2/AC3のnamed SSOT変更のみ停止し、AC1/AC6/AC7/AC8/AC9は継続する)
- full envelopeにunbounded addendが残る、又はconsumerのownerをproofできない場合
- timeout envelopeの修正に
skill_runtime_exec.py又はAllowed Paths外のconsumer変更が必要と判明した場合 - outer timeout supervisionのための新規watchdogスクリプト・新schema・ledger・receipt・persistent stateの追加が必要と判明した場合
skill_runtime_exec.pyへのcommand eligibility拡張(root-review eligible command追加)が必要と判明した場合
Required Skills
なし
Required Design References
- docs/dev/agent-skill-boundaries.md#オーケストレーター設計原則
- docs/dev/workflows/issue-refinement-loop-design.md
- .claude/skills/issue-refinement-loop/SKILL.md
- .claude/skills/issue-contract-review/SKILL.md
Scope Delta(任意)
N/A
Overlap Resolution
- 実装: #1939 Workstream 4 — retrospective candidate を issue-refinement-loop → impl-review-loop へ controlled handoffする #2602、実装: workflow trusted signalsとIssue/PR Task equivalenceをTask Contextへ統合する #2565、contract_readiness_check.py の canonical parent skip 判定を run_contract_review_once.py と共有する #1945、実装: docs/dev/schema-governance.md に REVIEW_COMPACT_INTERMEDIATE_VALIDATION_RESULT_V1 を登録し command_registry.py に phase_state.build.review を追加する #1829、実装: fix(replay-taxonomy): readiness rule_id/category を deterministic_domain_key taxonomy に正規化する #1810、#1601等のC1 candidate overlapはpath/token候補でありduplicate判定ではない。各Issueのcurrent scopeを実装開始前にreadbackする。
- #1945と共有するのは
contract_readiness_check.pysurfaceのみで、canonical-parent skip ownershipは移さない。timeout envelopeのためにその既存scopeを侵食する必要が出た場合は停止する。 - exact title/goalのOPEN ownerが見つかった場合はsupersede/mergeを自己判断せずowner decisionを求める。
Related / Prior Art
- Trigger: 実装: repair_action.apply の unauthorized_write_path false negative を解消する #2584 comment 実装: repair_action.apply の unauthorized_write_path false negative を解消する #2584 (comment)
- OWNER (squne121) REQUEST_CHANGES反映済み: 実装: root review outer timeout と invocation-local budget の parity を固定する #2610 (comment) (comment id 5616040399, body_sha256: 54ebac51bb8f2a1d9cf86a084d2ca7fb257a4c0c6dfad1edd13ed4c8e7de1839。SKILL.md Allowed Paths追加、AC1 5項目inventory化、SKILL.md background+join契約明記、inner/outer責務分離明記、registry timeout_seconds注記、AC9 canary追加を反映)。追加の人間承認は不要(本セッションの直接指示で解決済みscope decision)。
- Historical design, not current truth: 実装: reviewer transport の固定90秒 deadline が長時間 Verification Command を environment_failure にする #2165 / PR fix: reviewer transport の deadline/retry policy を長時間 VC に整合させる #2177 (
1cc7515814d5f0142661e64cda450575eb8df7c3), 実装: review pipeline の timeout budget を動的 VC 本数ベースに再設計する #2207 / PR 実装: review pipeline の timeout budget を動的 VC 本数ベースに再設計する #2221 (8a87a5dcb64cf731c27352f6ccb1d2489655f485)
Activity
squne121 commentedon Sep 10, 2026
判定: REQUEST_CHANGES
#2610 が捉えている障害は実在します。#2584 の refinement では、Step 0f 成功後の
root_review_pipeline.produceが registered 90-second budget で終了し、exit 143、canonical_step2_route未生成のまま停止しています。current registry にもroot_review_pipeline.produce.timeout_seconds: 90が残っています。また、#2165→PR #2177、#2207→PR #2221 で inner review pipeline はすでに「90秒固定」から大きく進化しています。現在は pinned body の VC occurrence 数から invocation-local
ReviewBudgetを計算し、N<=2でも total 520秒、#2584 のN=4では total 850秒になる設計です。process-group cancellation も SIGTERM→grace→SIGKILL/reap まで既に実装されています。したがって 「inner は動的850秒を許すのに、その外側に90秒が残っている」contract drift を問題視する方向は正しいです。ただし、現状の #2610 には実装を開始する前に直した方がよい設計上の穴があります。
重大度 | Finding | 推奨 -- | -- | -- P0 | Issue が「原因を特定して停止するだけ」で終わり得る | canonical owner が repo の SKILL.md に記述された main-thread invocation なら、その経路を本 Issue で修正対象にする P0 | Claude Code 自身の Bash timeout/background semantics が未考慮 | foreground timeout を伸ばすだけでなく、長時間 produce の 明示 background + deterministic join を検討する P1 | invocation-local budget は produce 起動後にしか確定しない | outer へ body-specific budget を事前 transport しようとせず、outer は emergency watchdog、inner budget は既存 ReviewBudget に分離 P1 | policy ceiling から static timeout を作ると最大約113分になる | static 最大値を通常 foreground timeout として使わない P1 | full envelope を加算式だけで定義すると deadline reset/drift が起こりやすい | absolute time.monotonic() deadline + remaining-budget 方式に固定 P1 | pytest fixture だけでは今回の親 boundary を false-green にできる | 最後に actual Step 2 execution surface を通す read-only runtime canary を1本だけ置く P2 | control-plane を増やす誘惑がある | skill_runtime_exec の新 profile、ledger/schema/receipt 等は追加しないP0-1 — 現在の timeout consumer 仮説と Allowed Paths が噛み合っていない
skill_runtime_exec.pyは確かに registry のtimeout_secondsを読む generic executor です。 しかし currentSKILL_RUNTIME_COMMAND_POLICY_V2["eligible_command_ids"]を確認すると、root_review_pipeline.produceは登録されていません。一方、current
issue-refinement-loop/SKILL.mdは canonical Step 2 を「orchestrator/main thread がrun_root_review_pipeline.py produceを直接実行する」契約にしています。 さらにcommand_registry.render_command()自体は argv を返すだけで、timeout を command line に埋め込んでいません。つまり registry の90秒を誰かが別途読まなければ kill deadline にはなりません。ここで #2610 は「repository-owned consumer が見つからなければ停止」「
skill_runtime_exec.pyが必要なら停止」としています。 これは調査としては安全ですが、implementation Issue としては no-op completion を許してしまいます。推奨は
skill_runtime_exec.pyを拡張することではありません。むしろ.claude/skills/issue-refinement-loop/SKILL.mdを Allowed Paths に加え、現在すでに authority になっている main-thread execution contract を修正対象にしてください。root review を privileged exact-executor に押し込むと、policy/parser/guard/cancellation/parity tests まで広がり、#1860 の minimal-harness 方針にも逆行します。P0-2 — 850秒の仕事を Claude Code の通常 foreground Bash として扱う前提が成立しない
これは #2610 に追加すべき重要な外部仕様です。
現在の Claude Code 公式ドキュメントでは、Bash の標準 timeout は2分、model が指定できる標準最大値は 10分 (
BASH_MAX_TIMEOUT_MS=600000) です。さらに timeout に達した Bash command は、現在の仕様では単純 kill ではなく background へ移される動作が記載されています。(code.claude.com) (Claude)#2584 の合法
ReviewBudget.total_seconds=850は約14分10秒です。つまり、main thread → ordinary Bash foreground → produce → JSONを同期consume
というモデルでは、registry の90秒だけ直しても次の ceiling に衝突します。
また exit 143 は一般的な shell 慣行では SIGTERM と整合しますが、誰が SIGTERM を送ったかの証拠にはなりません。現在の Claude Code 公式 timeout 動作とも単純には一致しないため、#2610 が signal producer の attribution を保留している点は維持すべきです。(The Open Group)
このプロジェクトなら、グローバルな
BASH_MAX_TIMEOUT_MSを何時間にも拡張するより、long-running
root_review_pipeline.produceは明示的に background 起動 → completion を必ず join → 完了後の JSON を canonical Step 2 が consumeという orchestration contract の方を推します。追加 control-plane は不要です。ただし non-interactive invocation の場合も、セッション終了に任せず join が完了するまで Step 2 を進めないことを契約にしてください。
P1 — outer と inner の責務を分離した方が単純になる
現在の
ReviewBudgetは pinned Issue body を取得した後で canonical VC plan から計算されます。 したがって、produceを spawn する前の outer runner に同じ invocation-local budget を正確に教えるには、outer 側でも body fetch/parse を再実行するか、新しい prepare protocol が必要になります。それは避けるべきです。#2207/#2221 がわざわざ body SHA に budget を bind した設計を再び二重化します。
責務は次の形が最小です。
inner semantic/runtime deadline: 既存 invocation-local
ReviewBudgetが所有する。outer supervision: 正当な inner deadline を先に殺さない emergency watchdog と process cleanup だけを所有する。
Claude main-thread surface: 長時間なら background + explicit join で同期 consumer 契約を維持する。
registry
timeout_seconds: 実 consumer があるなら policy ceiling から導出した emergency ceiling として意味を固定する。consumer がなくても90秒を「canonical runtime budget」であるかのように残さない。特に policy cap は現在
MAX_VC_EXECUTION_SLOTS=40です。現行式をそのまま当てるとReviewBudget.total_secondsは最大 6790秒、約113分に達します。 これを「通常の foreground command timeout」にするのは数学的には整合していても運用として悪いです。static max は watchdog 用、通常の完走制御は invocation-local budget + join と分離する方が有用です。P1 — deadline は
monotonicな一つの時計にする#2610 は full envelope に body fetch、setup、
ReviewBudget.total_seconds、TERM/KILL wait、reader join、finalization を含める方針で、これは正しいです。ただし「各 timeout を足して、それぞれで新しい timeout を始める」実装より、
deadline_at = time.monotonic() + full_envelope_secondsを一度作り、各 phase が
deadline_at - time.monotonic()の remaining budget だけを消費する方式を AC に明記することを勧めます。Python のmonotonic()は system clock 更新の影響を受けず deadline 計測向きですし、repo のreviewer_transport.py/ cooperative supervisor もすでに monotonic clock を利用しています。(Python Docs)#2610 へ入れる修正
Issue を refine するなら、以下まで固定すると implementation-ready に近づきます。
SKILL.mdを Allowed Paths に追加し、「repo-owned direct main-thread invocation だった場合」は Stop Condition から除外する。skill_runtime_exec.pyへの新規登録は引き続き禁止する。AC1 で actual execution surface / timeout consumer / signal producer を別々に inventory する。exit 143 だけから sender を推定しない。
ReviewBudgetは inner SSOT のまま維持し、outer へ body-specific budget を二重計算して transport しない。canonical Claude Code path では、合法 budget が foreground ceiling を超え得るため background + mandatory completion join を正式な実行方法として扱う。global timeout 設定変更は原則不要。
outer supervisor が必要な経路では、policy ceiling 由来の full-envelope emergency ceiling + absolute monotonic deadline を使い、既存 SIGTERM→grace→SIGKILL/reap を再利用する。Python の通常の
subprocess.run(timeout=...)だけへ簡略化しない。(Python Docs)scaled pytest に加え、修正後に 実装: repair_action.apply の unauthorized_write_path false negative を解消する #2584 を actual canonical Step 2 surface から read-only で1回だけ再実行し、「90秒で脱落しない」「background なら join される」「最終的に genuine
canonical_step2_routeを取得する」を runtime evidence にする。CI の常設 live gate にはしない。この形なら、#2177/#2221 で得た timeout/cancellation の品質を落とさず、#1860 の「live state・実 test を authority にする minimal harness」にも沿います。新しい timeout schema、receipt、ledger、exact-executor profile は不要です。
結論として、原因設定は良いが、現在の #2610 のままでは「consumer を証明できず停止」で実障害が残る可能性が高いです。最優先の修正は timeout 数値そのものではなく、canonical main-thread execution ownership と Claude Code の long-running Bash/join semantics を Issue contract に取り込むことです。
## 判定: **REQUEST_CHANGES**#2610 が捉えている障害は実在します。#2584 の refinement では、Step 0f 成功後の
root_review_pipeline.produceが registered 90-second budget で終了し、exit 143、canonical_step2_route未生成のまま停止しています。current registry にもroot_review_pipeline.produce.timeout_seconds: 90が残っています。また、#2165→PR #2177、#2207→PR #2221 で inner review pipeline はすでに「90秒固定」から大きく進化しています。現在は pinned body の VC occurrence 数から invocation-local
ReviewBudgetを計算し、N<=2でも total 520秒、#2584 のN=4では total 850秒になる設計です。process-group cancellation も SIGTERM→grace→SIGKILL/reap まで既に実装されています。したがって 「inner は動的850秒を許すのに、その外側に90秒が残っている」contract drift を問題視する方向は正しいです。ただし、現状の #2610 には実装を開始する前に直した方がよい設計上の穴があります。
SKILL.mdに記述された main-thread invocation なら、その経路を本 Issue で修正対象にするproduceの 明示 background + deterministic join を検討するproduce起動後にしか確定しないReviewBudgetに分離time.monotonic()deadline + remaining-budget 方式に固定skill_runtime_execの新 profile、ledger/schema/receipt 等は追加しないP0-1 — 現在の timeout consumer 仮説と Allowed Paths が噛み合っていない
skill_runtime_exec.pyは確かに registry のtimeout_secondsを読む generic executor です。 しかし currentSKILL_RUNTIME_COMMAND_POLICY_V2["eligible_command_ids"]を確認すると、root_review_pipeline.produceは登録されていません。一方、current
issue-refinement-loop/SKILL.mdは canonical Step 2 を「orchestrator/main thread がrun_root_review_pipeline.py produceを直接実行する」契約にしています。 さらにcommand_registry.render_command()自体は argv を返すだけで、timeout を command line に埋め込んでいません。つまり registry の90秒を誰かが別途読まなければ kill deadline にはなりません。ここで #2610 は「repository-owned consumer が見つからなければ停止」「
skill_runtime_exec.pyが必要なら停止」としています。 これは調査としては安全ですが、implementation Issue としては no-op completion を許してしまいます。推奨は
skill_runtime_exec.pyを拡張することではありません。むしろ.claude/skills/issue-refinement-loop/SKILL.mdを Allowed Paths に加え、現在すでに authority になっている main-thread execution contract を修正対象にしてください。root review を privileged exact-executor に押し込むと、policy/parser/guard/cancellation/parity tests まで広がり、#1860 の minimal-harness 方針にも逆行します。P0-2 — 850秒の仕事を Claude Code の通常 foreground Bash として扱う前提が成立しない
これは #2610 に追加すべき重要な外部仕様です。
現在の Claude Code 公式ドキュメントでは、Bash の標準 timeout は2分、model が指定できる標準最大値は 10分 (
BASH_MAX_TIMEOUT_MS=600000) です。さらに timeout に達した Bash command は、現在の仕様では単純 kill ではなく background へ移される動作が記載されています。([code.claude.com]1) ([Claude]2)#2584 の合法
ReviewBudget.total_seconds=850は約14分10秒です。つまり、main thread → ordinary Bash foreground → produce → JSONを同期consume
というモデルでは、registry の90秒だけ直しても次の ceiling に衝突します。
また exit 143 は一般的な shell 慣行では SIGTERM と整合しますが、誰が SIGTERM を送ったかの証拠にはなりません。現在の Claude Code 公式 timeout 動作とも単純には一致しないため、#2610 が signal producer の attribution を保留している点は維持すべきです。([The Open Group]3)
このプロジェクトなら、グローバルな
BASH_MAX_TIMEOUT_MSを何時間にも拡張するより、long-running
root_review_pipeline.produceは明示的に background 起動 → completion を必ず join → 完了後の JSON を canonical Step 2 が consumeという orchestration contract の方を推します。追加 control-plane は不要です。ただし non-interactive invocation の場合も、セッション終了に任せず join が完了するまで Step 2 を進めないことを契約にしてください。
P1 — outer と inner の責務を分離した方が単純になる
現在の
ReviewBudgetは pinned Issue body を取得した後で canonical VC plan から計算されます。 したがって、produceを spawn する前の outer runner に同じ invocation-local budget を正確に教えるには、outer 側でも body fetch/parse を再実行するか、新しい prepare protocol が必要になります。それは避けるべきです。#2207/#2221 がわざわざ body SHA に budget を bind した設計を再び二重化します。
責務は次の形が最小です。
ReviewBudgetが所有する。timeout_seconds: 実 consumer があるなら policy ceiling から導出した emergency ceiling として意味を固定する。consumer がなくても90秒を「canonical runtime budget」であるかのように残さない。特に policy cap は現在
MAX_VC_EXECUTION_SLOTS=40です。現行式をそのまま当てるとReviewBudget.total_secondsは最大 6790秒、約113分に達します。 これを「通常の foreground command timeout」にするのは数学的には整合していても運用として悪いです。static max は watchdog 用、通常の完走制御は invocation-local budget + join と分離する方が有用です。P1 — deadline は
monotonicな一つの時計にする#2610 は full envelope に body fetch、setup、
ReviewBudget.total_seconds、TERM/KILL wait、reader join、finalization を含める方針で、これは正しいです。ただし「各 timeout を足して、それぞれで新しい timeout を始める」実装より、
deadline_at = time.monotonic() + full_envelope_secondsを一度作り、各 phase が
deadline_at - time.monotonic()の remaining budget だけを消費する方式を AC に明記することを勧めます。Python のmonotonic()は system clock 更新の影響を受けず deadline 計測向きですし、repo のreviewer_transport.py/ cooperative supervisor もすでに monotonic clock を利用しています。([Python Docs]4)#2610 へ入れる修正
Issue を refine するなら、以下まで固定すると implementation-ready に近づきます。
SKILL.mdを Allowed Paths に追加し、「repo-owned direct main-thread invocation だった場合」は Stop Condition から除外する。skill_runtime_exec.pyへの新規登録は引き続き禁止する。ReviewBudgetは inner SSOT のまま維持し、outer へ body-specific budget を二重計算して transport しない。subprocess.run(timeout=...)だけへ簡略化しない。([Python Docs]5)canonical_step2_routeを取得する」を runtime evidence にする。CI の常設 live gate にはしない。この形なら、#2177/#2221 で得た timeout/cancellation の品質を落とさず、#1860 の「live state・実 test を authority にする minimal harness」にも沿います。新しい timeout schema、receipt、ledger、exact-executor profile は不要です。
結論として、原因設定は良いが、現在の #2610 のままでは「consumer を証明できず停止」で実障害が残る可能性が高いです。最優先の修正は timeout 数値そのものではなく、canonical main-thread execution ownership と Claude Code の long-running Bash/join semantics を Issue contract に取り込むことです。
squne121 commentedon Sep 10, 2026
推奨アクションは #2610 の実装開始ではなく、comment
5616040399を direct human context / OWNER directive として固定し、issue-refinement-loopを再実行して Issue 契約自体を修正することです。理由は明確です。現行 #2610 は「repository-owned consumer を証明できなければ停止」という条件を持つため、implementation Issue なのに実障害を残したまま no-op で終了し得ます。対象コメントはここを P0 として修正し、canonical main-thread execution surface、background + mandatory join、inner
ReviewBudgetと outer watchdog の責務分離、monotonic absolute deadline、read-only runtime canary を Issue 契約へ入れるよう要求しています。外部仕様も再確認しました。現在の Claude Code 公式仕様では Bash のデフォルト timeout は120秒、model が指定できる標準上限は600秒で、timeout 到達時には条件を満たす command が background に移行します。したがって #2584 相当の
ReviewBudget.total_seconds=850を ordinary foreground Bash だけで同期実行する設計は不十分、というコメントの指摘は現在も妥当です。([Claude]1) また、PR #2221 は invocation-local budget と cooperative cancellation を既に導入済みです。そのまま貼るなら以下です。
対象リポジトリ:
squne121/loop-protocol対象:
https://github.com/squne121/loop-protocol/issues/2610#issuecomment-5616040399現在の対話的 Claude Code セッションは既に auto mode で起動済みです。
このセッションをそのまま使用し、
.claude/skills/issue-refinement-loopを Issue #2610 に対して実行してください。実行方針
このプロンプト自体を direct interactive human instruction として扱ってください。
anchor comment
5616040399は、このプロンプトによって明示的に OWNER / human context として指定されています。URLだけから human origin を推定するのではなく、この現在の対話指示を provenance として、canonical な
preflight.run.with_human_contextlane を使用してください。repo 側の
loop_iteration_approval_gateについて途中承認は不要です。needs-fixになった場合も、skill の canonical routing と iteration 上限の範囲で自律的に rewrite → fresh review を継続してください。Claude Code 自体の permission mode、
/permissions、launcher 設定、--dangerously-skip-permissions等は変更しないでください。repo workflow の approval と Claude Code runtime permission を混同しないでください。
このタスクの完了条件は Issue #2610 の refinement 完了です。
implementation-ready になっても、コード実装・branch作成・PR作成・mergeには進まないでください。
最初に行うこと
5616040399を snapshot 固定する。.claude/skills/issue-refinement-loop/SKILL.mdと planner が要求するreferences/を読み、現在の canonical procedure を authority とする。preflight.run.with_human_contextを canonical main root / default branch から実行する。contract_update.run.with_human_contextを使用する。手書きの代替フローで skill の planner / routing / review 判定を再実装しないでください。
anchor comment の REQUEST_CHANGES を refinement input として解決すること
comment
5616040399の finding を単なる参考情報ではなく、Issue #2610 の current contract に対する明示的 REQUEST_CHANGES として扱ってください。少なくとも以下を調査・Issue本文へ反映すべきか判定してください。
1. canonical execution ownership
root_review_pipeline.produceについて、以下を別々に inventory してください。exit 143 だけを根拠に SIGTERM sender を帰属しないでください。
repository-owned generic registry consumer が見つからなかったことを理由に、そのまま no-op completion してはいけません。
current
.claude/skills/issue-refinement-loop/SKILL.mdが canonical Step 2 を orchestrator/main-thread の directrun_root_review_pipeline.py produceinvocation と定義しているなら、その execution contract 自体を Issue #2610 の修正対象として扱えるよう scope / Allowed Paths / Stop Conditions を見直してください。ただし
root_review_pipeline.produceをskill_runtime_exec.pyの新規 eligible command/profile に押し込むことをデフォルト解にしないでください。2. Claude Code long-running Bash semantics
Claude Code の現在の公式仕様を web-researcher で fresh に確認してください。
特に:
BASH_DEFAULT_TIMEOUT_MSBASH_MAX_TIMEOUT_MSを確認してください。
#2584 相当の合法な
ReviewBudget.total_secondsが通常の foreground Bash ceiling を超える場合を Issue contract が扱えるようにしてください。推奨設計の第一候補は:
root_review_pipeline.produce→ explicit background launch
→ mandatory deterministic completion join
→ genuine producer result取得
→ canonical Step 2 routing
です。
background に投げた時点で Step 2 完了扱いしてはいけません。
必ず completion を join し、結果を取得してから後続 routing に進む契約にしてください。
global
BASH_MAX_TIMEOUT_MSを巨大化することを通常解にしないでください。3. inner budget と outer supervision の責務分離
既存の invocation-local
ReviewBudgetを semantic/runtime deadline の SSOT のまま維持する方向を優先してください。outer launcher が pinned body を再取得・再parseして invocation-local budget を二重計算する新 protocol は、明確な必要性がない限り追加しないでください。
原則:
existing invocation-local
ReviewBudgetlegitimate inner executionを先にkillしない emergency watchdog + cleanup
long-runningなら background + mandatory join
実 consumer が存在するなら emergency ceiling として意味を固定
としてください。
90 -> 600等の arbitrary fixed-number replacement だけで AC を満たしたことにしないでください。4. monotonic absolute deadline
full produce envelope を複数 phase ごとの timeout reset の集合にしないでください。
必要な outer supervisor が存在する場合は原則として、
deadline_at = time.monotonic() + full_envelope_secondsという invocation 単位の absolute deadline を一度だけ作り、各 phase は remaining budget を消費する形を検討してください。
full envelope に含める addend は source constant または explicit bounded contract に対応付けてください。
既存の SIGTERM → bounded grace → SIGKILL → reap / reader join / finalization contract は弱化しないでください。
5. runtime verification
pytest fixture だけで parent execution boundary を false-green にしないようにしてください。
Issue #2610 の実装後 verification requirement として、必要なら #2584 に対して actual canonical Step 2 execution surface を通す read-only runtime canary 1回を要求してください。
確認対象は少なくとも:
canonical_step2_routeまたは genuine typed failure を取得するとしてください。
これは常設 CI の live mutation gate にしないでください。
6. control-plane の増殖を避ける
以下は明確な必要性が証明されない限り追加しないでください。
skill_runtime_exec.pyへの安易な command eligibility 拡張既存 SSOT / helper / cancellation primitive を再利用してください。
関連 evidence
最低限、以下を fresh に確認してください。
5611908804.claude/skills/issue-refinement-loop/SKILL.md.claude/skills/issue-refinement-loop/scripts/command_registry.py.claude/skills/issue-refinement-loop/scripts/run_root_review_pipeline.py.claude/skills/issue-refinement-loop/scripts/reviewer_transport.py.claude/skills/issue-contract-review/scripts/contract_readiness_check.py.claude/skills/issue-contract-review/scripts/baseline_vc_preflight.pyscripts/agent-guards/skill_runtime_exec.pyscripts/agent-guards/skill_runtime_command_policy.py関連 Issue / PR の current scope と merged implementation を見て、historical description を current truth と誤認しないでください。
SubAgent 使用
SubAgent を積極的に使用してください。
少なくとも canonical skill が要求する:
codebase-investigatorweb-researcherを使用してください。
独立に実行可能な investigation と web research は並列化して構いません。
ただし:
こと。
canonical Step 2 が現在
run_root_review_pipeline.py produceの root-owned direct consumption を要求しているなら、そこで legacyissue-reviewerSubAgent に置き換えないでください。rewrite policy
Issue body の semantic rewrite が必要なら human confirmation を求めず実施してください。
anchor comment により明示的に解決された scope decision、特に:
SKILL.mdを必要なら Allowed Paths に含めるについて、既存本文の Stop Conditions を機械的に優先して再び human escalation しないでください。
この current human instruction + anchor comment は、それら既知の設計判断に対する human context です。
一方で、anchor commentにもrepository evidenceにも答えがなく、新しい product/scope choice が本当に必要な場合のみ canonical
human_judgment_requiredを尊重してください。単なる「安全のため」「Allowed Paths が旧本文と違うため」「既存 Stop Condition に文字列上該当するため」だけで停止しないでください。まず trusted contract update / semantic rewrite で今回の human directive を反映してください。
完了条件
以下をすべて満たすまで続行してください。
iteration 上限内の
needs-fixでは人間承認を求めず自動継続してください。このタスクでは Issue refinement 完了後に implementation へ進まないでください。
最後に簡潔に以下を報告してください。
通常の途中承認は求めず、canonical workflow が許す範囲で最後まで完走してください。
このプロンプトでは、特に 旧本文の Stop Conditions をそのまま適用して再度
human_judgment_requiredに落ちるループを避けるため、今回のコメントで既に判断済みの scope delta を human context として明示しています。また、Step 2 自体は現行スキルどおり root-owned のまま維持し、SubAgent 化して別の execution semantics に変えないようにしています。squne121 commentedon Sep 10, 2026
Issue Refinement Loop 完了報告
Verdict: approved(refinement完了。実装・branch・PR作成には進みません — human instructionによる明示的停止)
Iteration数
79c1ff72323eede20811a166f1258905cd5bc2451d7ccdbbc99d1ba5125e799eAnchor Comment (comment 5616040399, OWNER, REQUEST_CHANGES) の各finding disposition
.claude/skills/issue-refinement-loop/SKILL.mdをAllowed Pathsへ追加し、main-thread直接invocation契約をこのIssueの修正対象に含めた。test_step2_execution_surface_canary.py、SKIP規約準拠、常設CI化しない)。skill_runtime_exec.py拡張禁止、新schema/ledger/receipt禁止を維持)。Review結果
run_root_review_pipeline.py produce): approve /canonical_step2_route: step_2_5(最終review, body_sha256:79c1ff72...)issue-design-reviewer, Step 2.5): findings(medium×1, low×2、いずれもblocker/high以外のためfinding_policyによりeffective_verdict: approve)test_root_review_pipeline_outer_timeout_budget.pyを作成すべきか否かが実装者の解釈に委ねられている。実行したSubAgentとcompletion join状態
Runtime Verification Applicability
decision: immediate(AC2/AC4/AC5)。本Issueのrefinement段階では未実行(実装Issueのため、実装後にAC9の一時canaryとAC2/AC4/AC5のpytestで検証される)。Implementation-ready か
Yes(refinement完了)。ただし本セッションの明示指示により、このIssueのimplementation・branch作成・PR作成には進みません。次のアクションが必要な場合は、通常の実装フロー(
impl-review-loop等)を別途開始してください。squne121 commentedon Sep 10, 2026
推奨アクションは 再refinementではなく、#2610 に対して
impl-review-loopを開始です。直近の refinement はapproved / implementation-readyで完了しており、実装フェーズへ進むことが明示されています。 現行mainではroot_review_pipeline.produce.timeout_seconds: 90がまだ残っているため、実装対象も未解消です。一点だけ、refinement 最終レビューの 「consumer 不在時に AC2/AC3 と outer-timeout test をどこまで実装するか」 という medium warning は、今回の直接指示で先に解決しておくのを推奨します。具体的には「fresh inventory でも consumer 不在なら仮想的な outer supervisor を作らず、conditional な production timeout変更はしない。一方 AC1/AC6/AC7/AC8/AC9 と既存 timeout/fail-closed 契約の検証は進める」と固定します。Claude Code公式仕様でも Bash の既定timeoutは120秒、モデル指定上限は通常600秒で、長時間コマンドは明示的
run_in_background: trueが利用できます。timeout到達時のbackground移行も現在の仕様です。([Claude]1)そのまま対話的 Claude Code に貼れる形です。
対象リポジトリ:
squne121/loop-protocol対象 Issue:
https://github.com/squne121/loop-protocol/issues/2610現在のこの対話的 Claude Code セッションは、すでに auto mode で起動済みです。
.claude/skills/impl-review-loopを Issue #2610 に対して実行し、実装 → 検証 → PR作成 → PRレビュー → fix → 再検証・再レビューを自律的に反復してください。目標は「人間が merge 操作を行う直前」まで完了させることです。
通常の設計判断、実装判断、テスト修正、PR作成、レビュー指摘対応、branch update、CI対応について途中の人間承認を求めないでください。
実際の merge は実行しないでください。auto-mergeも有効化しないでください。
このプロンプト自体を current direct interactive human instruction / OWNER directive として扱ってください。Issue #2610 の refinement 後に残った非blockingな owner-choice warning については、下記の判断を現在の人間判断として使用し、同じ点で再度 human escalation しないでください。
今回の Owner Decision
fresh inventory の結果、
root_review_pipeline.produceのtimeout_secondsを実際に強制する repository-owned outer consumer / outer deadline owner が依然として存在しない場合:90 -> 600や巨大な固定値など、未消費のtimeout_secondsを arbitrary に変更して解決したことにしない。test_root_review_pipeline_outer_timeout_budget.pyは、存在しない outer supervisor を捏造するための production plumbing を要求してはならない。現行 architecture の non-enforcement / budget boundary / fail-closed regression を意味のある形で固定できる範囲で実装する。この判断は refinement 完了報告に残った
「consumer未確認時に
test_root_review_pipeline_outer_timeout_budget.pyをどこまで作成すべきか」という owner-choice ambiguity を解決するためのものです。
また、Issue本文の「追加の人間承認は不要」は、PR review の
REQUEST_CHANGESを無視する意味ではありません。PR reviewer が concrete blocker / REQUEST_CHANGES を返した場合は、それを fix_delta として自律的に修正し、verification と review を必要なだけ再実行してください。
実行手順
Fresh state を取得する。
Issue 実装: root review outer timeout と invocation-local budget の parity を固定する #2610 の current body、全コメント、current default-branch HEAD、関連 Issue / PR、open PR overlap、対象ファイルの現在内容を取得してください。refinement 時点の evidence SHA を current truth とみなさないでください。既存 branch / worktree / PR が存在する場合は重複作成せず、live state に基づいて canonical recovery/reuse を行ってください。
canonical skill を authority として読む。
.claude/skills/impl-review-loop/SKILL.mdと、そのsteps/、必要な references、docs/dev/workflow.mdを読み、現在の procedure に従ってください。手書きの簡易 implementation loop で代替しないでください。root-owned implementation entry transition を fresh に実行する。
過去の refinement result や comment を implementation authorization packet として再利用せず、current run の canonical preflight / issue-contract-review / live Issue readback / routing を通してください。
triage-required等の presentation label 自体を implementation permission の authority にしないでください。SubAgent を実際に使用する。
canonical
impl-review-loopが定義するimplementation-worker、test-runner、pr-reviewer等を使ってください。追加の codebase investigation が必要なら適切な SubAgent を使用してください。独立した read-only investigation は安全な範囲で並列化して構いません。
SubAgent に nested SubAgent delegation はさせず、main Claude Code が routing authority を保持してください。
起動した全SubAgentの完了を必ず待ち、結果をjoinしてください。
background/asyncで起動しただけの状態を完了扱いして、次の judgment、commit、PR review、最終報告へ進んではいけません。
Issue 実装: root review outer timeout と invocation-local budget の parity を固定する #2610 の実装を行う。
Issue の Current Validated Scope / In Scope / Allowed Paths / Acceptance Criteria を current contract として実装してください。
特に
root_review_pipeline.produceの execution surface、registry timeout consumer、outer deadline owner、signal producer、process cleanup owner の5項目を fresh inventory してください。exit 143だけから signal sender を推測しないでください。
canonical Step 2 execution contract は、Issueが要求する
explicit background launch -> mandatory completion join -> genuine completed JSON result -> canonical routingを満たしてください。
background launch 時点を Step 2 completion と扱わないでください。
invocation-local
ReviewBudgetは inner semantic/runtime budget のSSOTとして維持し、outer側でIssue bodyを再fetch/reparseして同じbudgetを二重計算する新protocolは作らないでください。既存 SIGTERM → bounded grace → SIGKILL → reap / reader join / fail-closed semantics を弱化しないでください。
timeout/failure時に
canonical_step2_route、approve、implementation authorization を推測・捏造しないでください。テストと検証を完遂する。
Issue 実装: root review outer timeout と invocation-local budget の parity を固定する #2610 の Verification Commands とACを満たす focused tests を実行してください。
必要なら関連 regression tests、typecheck、lint、build、および変更範囲に対応する既存 test plan も実行してください。
test failure を「既存failure」と推測せず、current HEAD / base との比較で attribution してください。
AC9 の 実装: repair_action.apply の unauthorized_write_path false negative を解消する #2584 read-only runtime canary は、Issue contract の opt-in / SKIP規約を守って実施してください。
live mutation gateへ拡張してはいけません。
PRを作成し、review loopを完走する。
canonical worktree / branch workflow に従って commit・push・PR作成まで進めてください。
PR本文には Issue 実装: root review outer timeout と invocation-local budget の parity を固定する #2610 を閉じる canonical closing keyword、原則
Closes #2610を含めてください。current head のCIを確認し、失敗が今回の変更に起因する場合は修正してください。
pr-reviewerの review を current PR head に対して実行し、REQUEST_CHANGES/ blockers があれば implementation-worker に fix_delta として戻し、修正 → verification → current-head re-review を繰り返してください。base branch drift / BEHIND は canonical
update_branchroute で処理し、その後 verification と review を再実行してください。stale review は current head で再reviewしてください。
mere
human_review_required: trueself-report、advisory artifact不足、label状態、stale advisory evidenceだけを理由に停止しないでください。current skill の live-state routingを使ってください。人間承認を求めない範囲
Issue #2610 の既存 scope 内で解決可能な実装方式選択、テスト方式選択、軽微な refactor、PR body修正、レビュー指摘対応、CI修正、branch updateについては自律判断してください。
複数案がある場合は、
correctness / regression resistance / repository既存SSOTの再利用 / control-plane最小化 / 保守性
を優先し、Issue scope 内の最小変更を選択してください。
refinement の medium/low warning を理由に再度 owner approval を求めないでください。本プロンプトの Owner Decision で解決済みです。
停止条件
以下だけは無理に突破しないでください。
通常の
REQUEST_CHANGES、CI failure、merge-base drift、review stale、修正可能なtest failureは停止条件ではありません。自律修正してループを継続してください。Claude Code自身の permission mode、
/permissions、launcher設定、sandbox設定、--dangerously-skip-permissions、globalBASH_MAX_TIMEOUT_MS等を、このタスクの都合で変更しないでください。完了条件
以下をすべて満たした時だけ完了してください。
Issue #2610 の実装が current contract のACを満たしていること。
必要なテスト/検証がcurrent headで成功していること。
PRが作成済みで
Closes #2610のbindingが正しいこと。未解決のreview blockerがないこと。
pr-reviewer が current head をレビュー済みであること。
route_loop_verdict_v2()が current live mergeability と reviewer result からapprovedを返す状態であること。PR headがreviewed headと一致していること。
CI / mergeability が merge直前の状態として許容されていること。
起動したすべてのSubAgentがcompletion済みで、その結果がmain orchestratorへjoin済みであること。
ここまで到達したら停止し、mergeは行わず最終報告してください。
最終報告には Issue番号、branch、PR番号/URL、最終HEAD SHA、変更概要、ACごとの達成状況、実行したテスト、CI状態、最終review verdict、live mergeability、残存warnings、AC9 runtime canaryの結果、全SubAgentのcompletion/join状態を含めてください。
impl-review-loop自体も Step 1/2/4 を SubAgent に委譲し、APPROVEだけでなく live mergeability と blocker 空を終端条件にしています。triage-requiredなどのラベルは readiness authority ではないため、今回それが残っていても実装開始を止める根拠にはなりません。必要なら、このプロンプトをさらに短くした「Claude Code貼り付け用の圧縮版」にもできます。
squne121 commentedon Sep 10, 2026
implement-issue: 実装完了 (2026-09-10T10:02:24Z)
.claude/worktrees/issue-2610-root-review-outer-timeoutworktree-issue-2610-root-review-outer-timeoutsqune121 commentedon Sep 10, 2026
impl-review-loop: 完了 (2026-09-10T10:54:40Z)
fix: root_review_pipeline.produce のouter timeout ownershipをinventoryし…
fix: claude-gpt launcher の session-global background task disable を撤去…