Repository navigation
Description
Source
- Follow-up from PR feat: harden remote protocol Git builders #2381 / Issue 実装: #2197向け remote protocol Git builderを閉鎖型に hardenする #2378; the dedicated-runtime migration is explicitly out of their scope.
dedupe_key: follow-up:squne121/loop-protocol:pr/2381:contract-update-dedicated-runtime
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "#2190"
goal_ref: "#2190 AC1/AC3/AC5/AC9/AC10: migrate exactly the two contract_update mutation profiles excluded from #2199 to the dedicated control-plane runtime while preserving fail-closed behavior."
change_kind: codeParent Issue
Parent Goal Ref
- Goal: 実装: fix: bind issue-refinement control-plane preflight to a dedicated linked worktree #2190 binds production control-plane profiles to a sanitized, detached, remote-default-ref-pinned dedicated worktree and preserves fail-closed behavior.
- Desired Destination: The explicit contract-update mutation lanes run only through the dedicated control-plane runtime after 実装: control-plane preflight を dedicated linked worktree の identity probe と command class 分離で 4 production profile へ移行する #2199's preflight runtime is available.
Current Validated Scope
- Migrate only
contract_update.run.with_anchorandcontract_update.run.with_human_contextfrom the current canonical-main-root / default-branch mutation lane to the dedicated control-plane runtime.
Remaining Parent Gaps
- Artifact confinement and 実装: fix: bind issue-refinement control-plane preflight to a dedicated linked worktree #2190 final verification remain outside this issue.
- The other production preflight profiles remain owned by 実装: control-plane preflight を dedicated linked worktree の identity probe と command class 分離で 4 production profile へ移行する #2199; test-only fixture profiles remain unchanged.
Outcome
PR #2495 が実装した既存の parent-controller(control_plane_dedicated_execution_session()、scripts/agent-ops/worktree_bootstrap_exec.py)を再利用し、対象2つの contract_update mutation profile(contract_update.run.with_anchor / contract_update.run.with_human_context)の child dispatch を、既存の dedicated worktree 実行経路へ追加する。新しい re-exec route、command entrypoint、lifecycle lock protocol は追加しない。invocation root(親プロセスが起動する canonical main root / default branch)と child execution root(dedicated worktree)を区別し、registry の required_cwd を機械的に dedicated root へ置き換えるだけの実装にしない。既存の explicit-lane authorization、trusted-anchor/human-context 区別、artifact write-root 限定、fail-closed 挙動、および mutation 成功/検証失敗/mutation 失敗の既存結果分類(disposition: patch/final_readback/fresh_review、status: handoff_required/disposition: full_rewrite_required/writes: 0 を含む)を維持したまま、GH_CONFIG_DIR の相対パス解決先を invocation cwd 基準で固定する。
Runtime Verification Applicability
decision: immediate
reason: Isolated Git fixtures can exercise dedicated-runtime dispatch, identity mismatch, unavailable-runtime failure paths, GH_CONFIG_DIR path resolution, and outer/inner result-classification preservation without operating on the production primary checkout.
applicable_acs: [AC1, AC2, AC3, AC4, AC5, AC6]
execution_environment:
cli_tools: [python3, uv, git]
auth_required: false
network_required: false
skip_conditions:
- If isolated Git fixtures cannot run, record environment_blocked and do not convert the result to a pass.
fallback_policy:
fallback_success_is_pass: false
notes: Canonical-main execution, primary-checkout fallback, or a non-fail-closed unavailable result is a failure.
artifact_requirements:
- Focused pytest output for command-policy, runtime-executor profile, and dedicated-execution-boundary test casesIn Scope
- Route only
contract_update.run.with_anchorandcontract_update.run.with_human_contextthrough the existing dedicated control-plane runtime already delivered by PR feat: control-plane preflight に dedicated-lane identity probe primitive を追加 (#2199) #2495: the surviving parent-controller entered viacontrol_plane_dedicated_execution_session(), which holds the existing lifecycle lock while supervising a dedicated-worktree child process. This is not a re-exec model; no new re-exec route, command entrypoint, or lock protocol is introduced by this issue. - Keep the invocation root (canonical main root / default branch, where the parent starts) and the child execution root (the dedicated worktree, where mutation work actually happens) distinct; do not implement this by mechanically flipping the registry's
required_cwdto the dedicated root alone. - Update
tests/agent_ops/test_control_plane_worktree_bootstrap.py's three existing boundary assertions from "4 production preflight profiles only are dedicated" to "4 production preflight profiles + the 2 named contract_update profiles are dedicated", while preserving (never deleting or skipping) its guarantee that test-only fixture profiles (preflight.run.fixture,preflight.run.fixture.with_human_context) remain excluded. - Anchor
GH_CONFIG_DIRresolution to the invocation cwd before the child cwd switches to the dedicated worktree, for both named profiles, so a relativeGH_CONFIG_DIRvalue continues to resolve to the same directory it resolved to under the current canonical-main-root execution (PR fix: preserve GH_CONFIG_DIR for bare preflight.run #2407 non-regression). No token copying, config-content reads, or env-allowlist expansion. - Preserve the existing mutation-result classification vocabulary across the new outer dedicated-runtime supervision layer: a post-mutation verification/readback failure at the outer (dedicated-runtime supervisor) layer must not overwrite or discard an already-achieved inner-transaction disposition (e.g.
disposition: patch+final_readback: verified+fresh_review: needs_fix, orstatus: handoff_required+disposition: full_rewrite_required+writes: 0); an unknown/unverifiable outer result must not trigger a blind mutation resend. - Correct the pre-existing
network_effect: "github_read_only"label on bothcontract_update.run.*registry entries to accurately reflect theirmutation: TrueGitHub-writing effect, since this issue already touches these entries'required_cwd. - Update the registry, runtime policy/executor, and focused profile tests needed to prove the two mutation profiles use the dedicated runtime while fixture profiles and the four preflight profiles retain their separately owned behavior.
- Record the 実装: fix: bind issue-refinement control-plane preflight to a dedicated linked worktree #2190 overlap as intentional; no overlapping PR may be developed in parallel on shared dedicated-runtime paths.
Out of Scope
- Remote protocol Git builders and their closed typed builder contract delivered by PR feat: harden remote protocol Git builders #2381 / Issue 実装: #2197向け remote protocol Git builderを閉鎖型に hardenする #2378.
- The dedicated-runtime bootstrap, lifecycle lock, remote OID protocol, identity probe, command-class separation, and migration of the four
preflight.run*production profiles owned by 実装: control-plane preflight の remote default-ref OID observe/fetch/pin/verify プロトコルを実装する #2197, 実装: control-plane preflight lifecycle 用 git-common-dir スコープ排他ロックを実装する #2198, and 実装: control-plane preflight を dedicated linked worktree の identity probe と command class 分離で 4 production profile へ移行する #2199 (already delivered by PR feat: control-plane preflight に dedicated-lane identity probe primitive を追加 (#2199) #2495; reused, not re-implemented, by this issue). - Artifact-confinement completion,
WORKTREE_CATALOG_ENTRY_V1schema changes, fixture-profile migration, or any generic mutation/runtime capability. - 実装: control-plane preflight の artifact confinement と #2190 全AC最終検証を実装する #2200's artifact-confinement completion and 実装: fix: bind issue-refinement control-plane preflight to a dedicated linked worktree #2190's full parent-issue verification; this issue only needs to prove that artifacts written from the new dedicated root remain readable by the existing downstream consumer chain (e.g.
edit_issue_txn.py, fresh readiness/preflight/review), not that 実装: fix: bind issue-refinement control-plane preflight to a dedicated linked worktree #2190/実装: control-plane preflight の artifact confinement と #2190 全AC最終検証を実装する #2200's broader confinement work is complete. - Redesigning the transaction/receipt framework, PR fix: preserve GH_CONFIG_DIR for bare preflight.run #2407's credential/token handling, or any new primary-checkout-change monitoring mechanism.
Acceptance Criteria
- AC1:
contract_update.run.with_anchorreaches the dedicated control-plane runtime only via the existing parent-controller (control_plane_dedicated_execution_session()) after its required bootstrap and identity checks; no new re-exec route, command entrypoint, or lock protocol is added; missing, duplicate, mismatched, or non-dedicated context fails closed with no canonical-main or primary-checkout fallback. - AC2:
contract_update.run.with_human_contexthas the same dedicated-runtime-only behavior while retaining its required human-context argument binding and mutation-lane restrictions. - AC3: Focused tests prove neither named profile weakens explicit-lane authorization, allowed write roots, trusted-context requirements, or
with_anchor's legitimate no-write/issue_editor_requiredhandoff result path;tests/agent_ops/test_control_plane_worktree_bootstrap.py's three existing boundary assertions are updated (never deleted or skipped) to reflect the new "4 production preflight + 2 contract_update -> dedicated execution" / "test-only fixture profiles -> unchanged" boundary. - AC4: A relative
GH_CONFIG_DIRvalue resolves to the same configuration directory after this migration as it did under the current canonical-main-root execution; both absolute and relativeGH_CONFIG_DIRinputs are covered by focused tests. No token copying, config-content reads, or environment allowlist expansion. - AC5: A post-mutation outer-supervision failure (timeout, readback mismatch, artifact-verification failure) does not reclassify an already-achieved inner-transaction result (mutation-succeeded-but-review-failed, or a legitimate no-write handoff) as an unmutated/failed state, and does not trigger a blind mutation resend when the outer result is unknown.
- AC6: Result, provenance, and transaction artifacts produced by the dedicated-runtime child are written to and verifiable from the correct (dedicated) root, and remain readable by the existing downstream consumer chain without an implicit fallback to a primary-root path of the same name.
Verification Commands
# AC1
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_anchor.py -q# AC2
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_command_policy_anchor.py -q# AC3
$ uv run --locked pytest tests/agent_ops/test_control_plane_worktree_bootstrap.py .claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.py -q# AC4
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_anchor.py -q# AC5
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_anchor.py -q# AC6
$ uv run --locked pytest tests/agent_ops/test_control_plane_worktree_bootstrap.py -qAllowed Paths
.claude/skills/issue-refinement-loop/SKILL.md.claude/skills/issue-refinement-loop/scripts/command_registry.pyscripts/agent-guards/skill_runtime_command_policy.pyscripts/agent-guards/skill_runtime_exec.pyscripts/agent-guards/tests/test_skill_runtime_command_policy_anchor.pyscripts/agent-guards/tests/test_skill_runtime_exec_anchor.py.claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.pytests/agent_ops/test_control_plane_worktree_bootstrap.py
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- 既存の parent-controller(
control_plane_dedicated_execution_session())が両 profile の fixed authorization と fail-closed semantics を維持できない、または canonical-main/primary fallback を必要とすることが判明した場合
Required Skills
なし
Required Design References
docs/dev/agent-skill-boundaries.mddocs/dev/workflow.md- 実装: fix: bind issue-refinement control-plane preflight to a dedicated linked worktree #2190, 実装: control-plane preflight の remote default-ref OID observe/fetch/pin/verify プロトコルを実装する #2197, 実装: control-plane preflight lifecycle 用 git-common-dir スコープ排他ロックを実装する #2198, 実装: control-plane preflight を dedicated linked worktree の identity probe と command class 分離で 4 production profile へ移行する #2199 (PR feat: control-plane preflight に dedicated-lane identity probe primitive を追加 (#2199) #2495, merged 2026-09-05), PR feat: harden remote protocol Git builders #2381, and Issue 実装: #2197向け remote protocol Git builderを閉鎖型に hardenする #2378
Scope Collision Record
- Scope Collision (C3): related_issue=実装: fix: bind issue-refinement control-plane preflight to a dedicated linked worktree #2190; overlapping paths are intentional parent-delivery paths. Edit intent is restricted to the two contract-update profiles that 実装: control-plane preflight を dedicated linked worktree の identity probe と command class 分離で 4 production profile へ移行する #2199/PR feat: control-plane preflight に dedicated-lane identity probe primitive を追加 (#2199) #2495 did not migrate. 実装: control-plane preflight を dedicated linked worktree の identity probe と command class 分離で 4 production profile へ移行する #2199 (PR feat: control-plane preflight に dedicated-lane identity probe primitive を追加 (#2199) #2495) has merged (2026-09-05); the blocking dependency is resolved. Do not parallel-edit shared dedicated-runtime paths with other in-flight 実装: fix: bind issue-refinement control-plane preflight to a dedicated linked worktree #2190-family work.
Delivery Rule
1 Issue = 1 PR. Use a dedicated implementation worktree and a Draft PR. #2199 (PR #2495) has merged into main (2026-09-05); the prerequisite is satisfied and implementation may proceed.
Scope Delta(任意)
N/A
Activity
squne121 commentedon Sep 6, 2026
判定:
REQUEST_CHANGES移行する方向は妥当です。ただし、現在の #2393 は、依存先の最終実装に追従していない契約と、移行によって壊れ得る通常利用経路の検証不足があります。 新しいセキュリティ機構を足すのではなく、既存の parent-controller を再利用し、2つのプロファイルが実際に使えることを確認する変更に絞るのが適切です。
取得した main
3b053dfb65cd1254b690657114f58cd4fa131b75を基準に、#2393、親 #2190、依存先 #2199 と PR #2495、後続 #2200、起票元 #2378/PR #2381、認証設定の引き継ぎを修正した PR #2407、および関連コメント・実装・テストを照合しました。#2393 自体にはコメントがなく、本文は 2026年8月29日のままです。一方、#2199 の実装 PR #2495 は 9月5日にマージ済みなので、実装開始の前提は満たされています。以下はコードとテスト内容を照合したレビューです。この環境で pytest を実行した結果ではないため、実測していない回帰は、その発生条件と必要な検証を分けて示します。
1. P1:移行に必須の既存テスト修正が Allowed Paths から漏れている
これは、実装前に直すべき確定した契約矛盾です。
現在の
tests/agent_ops/test_control_plane_worktree_bootstrap.pyは、次の3点を明示的に検証しています。dedicated 実行対象は、既存の4つの production preflight profile だけである。
2つの
contract_updateprofile は、その集合に含まれない。実際の
skill_runtime_exec.main()を通しても、contract_update.run.with_anchorの child は primary checkout で実行される。つまり、#2393 を正しく実装すると、現在のテストの期待値とは衝突します。ところが、このファイルは #2393 の Allowed Paths にも Verification Commands にも含まれていません。現在の Stop Conditions に従えば、実装者は正常な移行を進めるために停止することになります。
最小修正
Allowed Paths に、次の1ファイルを追加してください。
そのうえで、テストの意味を次のように更新します。
既存テストを削除・skip する必要はありません。 「以前は意図的に除外していた2件を今回移行する」という仕様変更に対応させれば十分です。
指定された3本のテストだけを通し、別の既存テストが要求する動作と矛盾したまま完了する、という false green を防ぐ修正です。
2. P1:#2199 が提供する実行方式について、Issue の前提が古い
#2393 の In Scope は、#2199 が提供する次の仕組みを利用するよう要求しています。
しかし、現行
skill_runtime_exec.pyは、親プロセスを re-exec する方式ではありません。親がcontrol_plane_dedicated_execution_session()に入り、ロックを保持したまま dedicated worktree の child を起動・監督し、終了後の検証を行う構造です。#2199 の関連コメントでも、初期の「initializer → re-exec でロックが切れる」問題から、生存する parent-controller にロックを保持させる方式へ変更したことが明確に整理されています。
この差は単なる用語の問題ではありません。古い文章に忠実に実装すると、存在しない command class を探して停止するか、不要な第二の起動経路を作る可能性があります。
最小修正
In Scope は、例えば次の内容に置き換えるのが適切です。
特に、「親をどこから起動するか」と「更新処理をどこで実行するか」を同一視しないことが重要です。現行実装には canonical-main-root/default-branch の呼び出し検証があり、その後に dedicated child へ切り替える処理があります。registry の
required_cwdを機械的に dedicated root に書き換えるだけでは、この境界を壊します。今回の目的には、既存の dispatch 対象を2件増やし、それに伴う root 依存処理を揃える変更で足ります。
3. P1:
GH_CONFIG_DIRを文字列のまま引き継ぐと、相対パス設定が別の場所を指すこれは、外部実装との照合で見つかった具体的な移行リスクです。
現行
_sanitize_env()は、対象2 profile を含む有限の command ID に対してGH_CONFIG_DIRを引き継ぎます。ただし、値は環境変数からそのままコピーされ、絶対パス化されません。GitHub CLI 側の公式実装
cli/go-gh/pkg/config/config.goを確認すると、ConfigDir()もGH_CONFIG_DIRがあればその文字列をそのまま返します。呼び出し元の cwd に対する絶対パスへの固定は行いません。例えば、次の設定で現在の primary 実行が動いていた場合です。
環境変数の値が同じでも、同じ認証設定を参照しているとは限りません。 cwd だけを変更する移行では、認証設定が消えたように見えたり、意図しない別設定を参照したりします。これは値のコピーだけでは防げない、パス解決上の回帰です。
PR #2407 は、まさに対象2 profile の
GH_CONFIG_DIRを下流の実プロセスまで届ける修正を含んでいます。その成果を、今回の cwd 変更で壊さないことが必要です。最小修正
既に引き継ぎ対象となっている
GH_CONFIG_DIRが明示されている場合だけ、child の cwd を変える前に、元の invocation cwd を基準として絶対パスへ固定してください。設定ファイルの中身を読む必要も、token をコピーする必要も、環境変数の許可範囲を広げる必要もありません。
既存の isolated-HOME/fake-gh テストに、次の2ケースを加える程度で十分です。
下流の
edit_issue_txn.pyと controlled executor は、自身の実行ファイルの場所から repository root を導出しています。したがって AC2/AC6 は、単なるcwdの確認ではなく、dedicated 側の実ファイルを実行し、その root で成果物を扱うことを確認する必要があります。Allowed Paths と検証コマンド
必須の追加は、先述の bootstrap テスト1ファイルです。まず次の4本を対象にすれば、現在の3本だけよりも仕様変更を正しく検証できます。
run_refinement_preflight.pyの timeout/結果処理まで今回修正する場合に限り、そのファイルを理由付きで Allowed Paths に追加してください。最初から広いscripts/**を許可する必要も、既存不備を理由に全 transaction 基盤の再設計へ進む必要もありません。今回、実装を止める条件に追加しない方がよいもの
#2200 の artifact confinement 完成や #2190 全体の最終検証を、#2393 の新たな前提条件にする必要はありません。#2393 はそれらを明示的に対象外とし、#2200 も別スコープとして存在しています。今回確認すべきなのは、移行した更新処理の成果物が、既存の次工程から読めることです。
また、#2199 の関連コメントでは、primary の変化を別プロセスに帰属できない監視が、並列ワークフローを誤停止させる問題も指摘されています。#2393 でその監視をさらに強化するのは逆効果です。primary を変更しないことは focused integration test で確認し、通常の並列編集を理由に無条件で「更新は失敗した、最初からやり直す」と扱わない設計にすべきです。
最終的な推奨は、「#2495 の仕組みは戻さない」「#2393 の古い契約を直す」「2 profile の接続と通常利用の回帰だけを実証する」です。 特に、漏れている既存テストの追加、re-exec 前提の削除、相対
## 判定:`REQUEST_CHANGES`GH_CONFIG_DIRの解決先維持、更新済み/検証失敗の区別が、今回の変更で優先する価値の高い修正です。移行する方向は妥当です。ただし、現在の #2393 は、依存先の最終実装に追従していない契約と、移行によって壊れ得る通常利用経路の検証不足があります。 新しいセキュリティ機構を足すのではなく、既存の parent-controller を再利用し、2つのプロファイルが実際に使えることを確認する変更に絞るのが適切です。
取得した main
3b053dfb65cd1254b690657114f58cd4fa131b75を基準に、#2393、親 #2190、依存先 #2199 と PR #2495、後続 #2200、起票元 #2378/PR #2381、認証設定の引き継ぎを修正した PR #2407、および関連コメント・実装・テストを照合しました。#2393 自体にはコメントがなく、本文は 2026年8月29日のままです。一方、#2199 の実装 PR #2495 は 9月5日にマージ済みなので、実装開始の前提は満たされています。以下はコードとテスト内容を照合したレビューです。この環境で pytest を実行した結果ではないため、実測していない回帰は、その発生条件と必要な検証を分けて示します。
1. P1:移行に必須の既存テスト修正が Allowed Paths から漏れている
これは、実装前に直すべき確定した契約矛盾です。
現在の
tests/agent_ops/test_control_plane_worktree_bootstrap.pyは、次の3点を明示的に検証しています。contract_updateprofile は、その集合に含まれない。skill_runtime_exec.main()を通しても、contract_update.run.with_anchorの child は primary checkout で実行される。つまり、#2393 を正しく実装すると、現在のテストの期待値とは衝突します。ところが、このファイルは #2393 の Allowed Paths にも Verification Commands にも含まれていません。現在の Stop Conditions に従えば、実装者は正常な移行を進めるために停止することになります。
最小修正
Allowed Paths に、次の1ファイルを追加してください。
そのうえで、テストの意味を次のように更新します。
既存テストを削除・skip する必要はありません。 「以前は意図的に除外していた2件を今回移行する」という仕様変更に対応させれば十分です。
指定された3本のテストだけを通し、別の既存テストが要求する動作と矛盾したまま完了する、という false green を防ぐ修正です。
2. P1:#2199 が提供する実行方式について、Issue の前提が古い
#2393 の In Scope は、#2199 が提供する次の仕組みを利用するよう要求しています。
しかし、現行
skill_runtime_exec.pyは、親プロセスを re-exec する方式ではありません。親がcontrol_plane_dedicated_execution_session()に入り、ロックを保持したまま dedicated worktree の child を起動・監督し、終了後の検証を行う構造です。#2199 の関連コメントでも、初期の「initializer → re-exec でロックが切れる」問題から、生存する parent-controller にロックを保持させる方式へ変更したことが明確に整理されています。
この差は単なる用語の問題ではありません。古い文章に忠実に実装すると、存在しない command class を探して停止するか、不要な第二の起動経路を作る可能性があります。
最小修正
In Scope は、例えば次の内容に置き換えるのが適切です。
特に、「親をどこから起動するか」と「更新処理をどこで実行するか」を同一視しないことが重要です。現行実装には canonical-main-root/default-branch の呼び出し検証があり、その後に dedicated child へ切り替える処理があります。registry の
required_cwdを機械的に dedicated root に書き換えるだけでは、この境界を壊します。今回の目的には、既存の dispatch 対象を2件増やし、それに伴う root 依存処理を揃える変更で足ります。
3. P1:
GH_CONFIG_DIRを文字列のまま引き継ぐと、相対パス設定が別の場所を指すこれは、外部実装との照合で見つかった具体的な移行リスクです。
現行
_sanitize_env()は、対象2 profile を含む有限の command ID に対してGH_CONFIG_DIRを引き継ぎます。ただし、値は環境変数からそのままコピーされ、絶対パス化されません。GitHub CLI 側の公式実装
cli/go-gh/pkg/config/config.goを確認すると、ConfigDir()もGH_CONFIG_DIRがあればその文字列をそのまま返します。呼び出し元の cwd に対する絶対パスへの固定は行いません。例えば、次の設定で現在の primary 実行が動いていた場合です。
環境変数の値が同じでも、同じ認証設定を参照しているとは限りません。 cwd だけを変更する移行では、認証設定が消えたように見えたり、意図しない別設定を参照したりします。これは値のコピーだけでは防げない、パス解決上の回帰です。
PR #2407 は、まさに対象2 profile の
GH_CONFIG_DIRを下流の実プロセスまで届ける修正を含んでいます。その成果を、今回の cwd 変更で壊さないことが必要です。最小修正
既に引き継ぎ対象となっている
GH_CONFIG_DIRが明示されている場合だけ、child の cwd を変える前に、元の invocation cwd を基準として絶対パスへ固定してください。設定ファイルの中身を読む必要も、token をコピーする必要も、環境変数の許可範囲を広げる必要もありません。
既存の isolated-HOME/fake-gh テストに、次の2ケースを加える程度で十分です。
GH_CONFIG_DIRGH_CONFIG_DIRこれは「セキュリティのために通常設定を拒否する」のではなく、移動前に使えていた設定を、そのまま使えるようにする修正です。
4. P1:更新済み・検証失敗・結果不明を分ける受け入れ条件がない
#2393 の AC は dedicated dispatch と拒否条件に偏っています。しかし mutation profile では、child の失敗が GitHub 未更新を意味しないことが重要です。
これは仮説ではなく、既存の実プロセステストにその状態が明示されています。
{ "status": "failed", "disposition": "patch", "writes": 1, "final_readback": "verified", "fresh_review": "needs_fix" }このテストでは、実際の controlled executor 経由で fixture の Issue 本文が更新され、その後のレビュー失敗により exit 2 になります。再実行では
writes: 0を確認しています。つまり、「更新は済んだが、次の工程へ進めない」は既存の正しい結果の一つです。一方、dedicated 側を監督する外側の executor には、timeout、書き込み検証、artifact 検証などによる失敗経路があります。これらを mutation profile に適用する際、外側の失敗だけを見て「未更新だから再実行」と判断すると、既存の結果表現を壊します。
timeout は特に確認が必要
対象2 profile の registry timeout は現在 120秒です。一方、更新処理内部には candidate readiness の30秒、transaction の60秒、その後の readiness・preflight・review などが連続しています。すべての内部処理が自身の timeout 内でも、全体では外側の120秒を超える構成です。
隣接する
repair_action.applyには既に、更新後の readback が外側の timeout で潰されないよう、readiness + transaction + readback reserve + margin を考慮する設計があります。今回、新しい deadline 管理基盤を作る必要はなく、この既存方針に揃えるのが自然です。最小修正
AC に、次の意味を追加してください。
検証には、既存の「更新成功 → review 失敗 → replay は追加更新なし」のテストを dedicated 上へ移すことが有効です。これなら、新しい receipt schema や永続 ledger は不要です。
なお、120秒の予算不足は今回の移行が新しく導入する不具合ではありません。移行時に露出・悪化させないための確認項目です。別の transaction 全体を再設計する作業へ膨らませる必要はありません。
5. P2:2つの profile に同じ「更新成功」を要求してはいけない
registry は、汎用の
with_anchorと明示的なwith_human_contextを区別しています。with_anchorに human-context の意味を自動的に付与する設計ではありません。さらに既存テストでは、汎用
with_anchorから、書き込みを行わずに次の結果へ到達するケースがあります。これは mutation 失敗ではなく、正当な制御の引き継ぎです。 一方、別の generic-anchor ケースでは、更新せずに拒否されることも確認されています。
したがって、AC の成功条件を「2つとも dedicated で PATCH できる」と解釈すると、権限境界を広げてしまいます。逆に「
with_anchorは常に blocked」と決めつけても、正当な issue-editor への引き継ぎを壊します。固定すべき意味
with_human_context+適用可能な明示的指示issue_editor_required既存の結果分類を変えず、実行場所だけを移すことを明記するのが適切です。
6. P2:
network_effectの宣言が実際の処理と整合していない対象2 profile は
mutation: Trueですが、registry のnetwork_effectはどちらもgithub_read_onlyになっています。実際の human-context 経路は、先述のテストでもissue_content_patchを通ります。この宣言が現在の実行失敗を起こしている、とまでは断定しません。ただし、registry を読む側が「この操作は GitHub を変更しない」と判断するには不正確です。
profile の下流を含めた効果を表すのか、直接呼び出す操作だけを表すのかを揃えるべきです。 前者なら、既存の mutation 用表現に合わせて registry と policy を同時に修正してください。新しい capability system を追加する必要はありません。
外部実装・仕様を踏まえた、維持すべき設計
Git:
worktree --lockと実行の排他制御は別物Git の
worktree lockは、worktree の管理情報の prune や move/remove を防ぐ仕組みです。処理全体の実行排他を代替しません。また linked worktree 間では、一部の ref や repository config が共有されます。(Git)したがって、既存の lifecycle mutex と parent-controller をそのまま再利用する方針が適切です。今回の2 profile のために、TTL、heartbeat、lease takeover、別 daemon を追加する価値はありません。
uv:worktree 外の専用環境は残す
uv は、絶対パスの
UV_PROJECT_ENVIRONMENTを正式にサポートしています。指定先が存在しなければ環境を作成し、通常のuv runは環境の同期も行います。したがって、--lockedを付けたことだけでは「依存関係の準備もファイル生成も起きない」とは言えません。([Astral Docs]2)PR #2495 の専用環境準備を再利用し、primary の
.venvが準備済みだから dedicated でも動くはず、というテストにしないことが重要です。現行 executor には、dedicated checkout 外の環境を指定して準備する処理があります。同期の重複を減らす最適化は、遅延を測ってからで十分です。新しい environment manager やキャッシュ台帳は不要です。
GitHub CLI:認証情報ではなく、同じ設定への参照を保つ
GitHub CLI の設定ディレクトリ選択は、公式実装でも
GH_CONFIG_DIRを優先しています。今回必要なのは、その参照先を cwd 変更の前後で保つことです。PR #2407 が実施した、isolated HOME、テスト所有の設定ディレクトリ、fake-gh による実プロセス検証を流用するのが適切です。実 token の読み出し、設定ファイルの内容保存、live GitHub mutation を必須にする理由はありません。
#2393 に入れる修正案
Outcome
現在の Outcome を、次の内容へ具体化することを推奨します。
Acceptance Criteria
大量の新規テストを要求するのではなく、次の6項目を既存テストへ割り当てる形がよいです。
GH_CONFIG_DIRが同じ設定先を指し、専用 Python 環境の初回準備でも通常利用を壊さない。下流の
edit_issue_txn.pyと controlled executor は、自身の実行ファイルの場所から repository root を導出しています。したがって AC2/AC6 は、単なるcwdの確認ではなく、dedicated 側の実ファイルを実行し、その root で成果物を扱うことを確認する必要があります。Allowed Paths と検証コマンド
必須の追加は、先述の bootstrap テスト1ファイルです。まず次の4本を対象にすれば、現在の3本だけよりも仕様変更を正しく検証できます。
run_refinement_preflight.pyの timeout/結果処理まで今回修正する場合に限り、そのファイルを理由付きで Allowed Paths に追加してください。最初から広いscripts/**を許可する必要も、既存不備を理由に全 transaction 基盤の再設計へ進む必要もありません。今回、実装を止める条件に追加しない方がよいもの
#2200 の artifact confinement 完成や #2190 全体の最終検証を、#2393 の新たな前提条件にする必要はありません。#2393 はそれらを明示的に対象外とし、#2200 も別スコープとして存在しています。今回確認すべきなのは、移行した更新処理の成果物が、既存の次工程から読めることです。
また、#2199 の関連コメントでは、primary の変化を別プロセスに帰属できない監視が、並列ワークフローを誤停止させる問題も指摘されています。#2393 でその監視をさらに強化するのは逆効果です。primary を変更しないことは focused integration test で確認し、通常の並列編集を理由に無条件で「更新は失敗した、最初からやり直す」と扱わない設計にすべきです。
最終的な推奨は、「#2495 の仕組みは戻さない」「#2393 の古い契約を直す」「2 profile の接続と通常利用の回帰だけを実証する」です。 特に、漏れている既存テストの追加、re-exec 前提の削除、相対
GH_CONFIG_DIRの解決先維持、更新済み/検証失敗の区別が、今回の変更で優先する価値の高い修正です。squne121 commentedon Sep 6, 2026
推奨アクション
#2393 は、実装へ進む前に 指定コメントを
operator-selected human contextとしてissue-refinement-loopに投入し、Issue 本文を自動 refinement するのが適切です。コメントは Issue #2393 所属かつauthor_association: OWNERです。特に反映すべきなのは次の5点です。
control_plane_dedicated_execution_session()を使う parent-controller 型の dedicated dispatch が実装されています。実装: Migrate contract_update control-plane mutation profiles to the dedicated runtime worktree #2393 の「実装: control-plane preflight を dedicated linked worktree の identity probe と command class 分離で 4 production profile へ移行する #2199 が提供する re-exec / command class」という古い前提は更新対象です。tests/agent_ops/test_control_plane_worktree_bootstrap.pyを Allowed Paths と Verification Commands に追加する。 現 main のテストは4 production preflight profile のみを dedicated 対象としており、実装: Migrate contract_update control-plane mutation profiles to the dedicated runtime worktree #2393 を実装すると既存期待値と衝突します。GH_CONFIG_DIRの相対パス意味保存を契約化する。 PR fix: preserve GH_CONFIG_DIR for bare preflight.run #2407 は対象contract_updateprofile へのGH_CONFIG_DIR伝播を既に実装しているので、dedicated cwd 化によってその解決先を変えない AC/テストが必要です。approve/proceedまで自動反復する。issue-refinement-loopは iteration approval を既定で不要としており、semantic finding をissue-editorへ渡して AC/VC/Allowed Paths/Stop Conditions まで semantic rewrite できる設計になっています。このケースでは、人間承認を追加するより 既存 workflow をそのまま使わせる方がよいです。semantic review は sibling SubAgent の完了を待つ completion join barrier が既に契約化されています。 また現在の Claude Code は background SubAgent が既定ですが、結果が必要なら foreground 実行にでき、background の場合でも completion notification を待ってから結果を扱う契約です。([Claude Platform Docs]1)
Auto mode についても、
--dangerously-skip-permissions等へ切り替える必要はありません。Auto mode は通常の permission prompt を減らすための正式な mode で、Auto mode 中の SubAgent は親と同じ classifier rules を継承します。([Claude]2)以下を、そのまま auto mode の対話的 Claude Code に渡すのを推奨します。
リポジトリ
squne121/loop-protocolの Issue #2393 を、repository-owned のissue-refinement-loopを使って refinement してください。対象:
実装: Migrate contract_update control-plane mutation profiles to the dedicated runtime worktree #2393 (comment)
この anchor comment は、今回の operator-selected human context として明示的に指定します。
preflight.run.with_human_context/contract_update.run.with_human_contextの canonical lane を使用してください。unlabeled
with_anchorやwith_agent_reportlane に勝手に変更しないでください。目的は Issue #2393 の refinement です。
実装コードの開発を開始することではありません。
Issue 本文を current main と指定コメントに整合させ、fresh review で implementation-ready になるところまで進めてください。
この依頼は、Issue #2393 の本文を
issue-refinement-loopの controlled mutation path で更新することを明示的に許可しています。ループ iteration ごとの人間確認や、「この修正を適用してよいですか」という確認は不要です。
repository の
loop_iteration_approval_gate.default_required: falseに従って自動継続してください。max_iterations は既定の 3 を使用してください。
Claude Code の現在の auto mode はそのまま使用してください。
permission mode を変更しないでください。
bypassPermissions、--dangerously-skip-permissions、--allow-dangerously-skip-permissions等へ切り替えないでください。まず Issue 本文、anchor comment、current main、関連 Issue / PR / repository assets を読み、コメントの各 finding を current state に対して fact-check してください。
最低限、以下を確認してください。
scripts/agent-guards/skill_runtime_exec.py.claude/skills/issue-refinement-loop/SKILL.md.claude/skills/issue-refinement-loop/scripts/command_registry.pyscripts/agent-guards/skill_runtime_command_policy.pytests/agent_ops/test_control_plane_worktree_bootstrap.pyscripts/agent-guards/tests/test_skill_runtime_exec_anchor.pyscripts/agent-guards/tests/test_skill_runtime_command_policy_anchor.py.claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.pySubAgent を使用してください。
repo/code fact-check は
codebase-investigatorなど repository-defined の適切な read-only SubAgent に委譲してください。外部実装の確認が disposition に必要なら、workflow が定める
web-researcherを使用してください。semantic review applicability が成立する場合は repository contract に従って
issue-design-reviewerを sibling SubAgent として起動してください。rewrite が必要なら repository contract に従って
issue-editorを使用してください。重要:
SubAgent を起動したら、その SubAgent の作業完了と結果取得を必ず待ってください。
結果を必要とするフェーズでは foreground 実行を優先してください。
Claude Code が background で起動した場合も、completion notification / final result を取得する前に次の dependent phase へ進んではいけません。
SubAgent の未完了状態を成功扱いしないでください。
複数の独立した read-only investigation は並列化して構いませんが、全 required result を join してから判定してください。
issue-editor自身に nested SubAgent delegation を要求しないでください。必要な chain は main thread から sequential に orchestration してください。anchor comment のレビュー指摘は、単なる参考情報ではなく fact-check 対象の refinement input として扱ってください。
ただしコメントを盲目的に転記せず、current main で確認できた事実を source of truth にしてください。
少なくとも以下の semantic delta を検証し、事実なら Issue 本文へ反映してください。
実装: control-plane preflight を dedicated linked worktree の identity probe と command class 分離で 4 production profile へ移行する #2199 / PR feat: control-plane preflight に dedicated-lane identity probe primitive を追加 (#2199) #2495 は既に完了しているため、
「実装: Migrate contract_update control-plane mutation profiles to the dedicated runtime worktree #2393 は 実装: control-plane preflight を dedicated linked worktree の identity probe と command class 分離で 4 production profile へ移行する #2199 が merge されるまで開始不可」という stale dependency 表現を現在状態へ更新する。
実装: Migrate contract_update control-plane mutation profiles to the dedicated runtime worktree #2393 に残っている
「dedicated runtime command class / re-exec」
という前提を current implementation に合わせる。
current implementation が PR feat: control-plane preflight に dedicated-lane identity probe primitive を追加 (#2199) #2495 の
control_plane_dedicated_execution_session()を使う surviving parent-controller 方式なら、In Scope / AC / Stop Conditions 等をその方式へ更新する。
新しい re-exec route、command entrypoint、lock protocol を 実装: Migrate contract_update control-plane mutation profiles to the dedicated runtime worktree #2393 で新設する要求にしない。
invocation root と child execution root を混同しない。
registry の
required_cwdを機械的に dedicated root へ変えるだけ、という仕様にもしてはいけない。tests/agent_ops/test_control_plane_worktree_bootstrap.pyが現在の「4 production preflight dedicated / contract_update 非dedicated」
契約を明示的に検証していることを確認する。
実装: Migrate contract_update control-plane mutation profiles to the dedicated runtime worktree #2393 の実装によりその期待値変更が必須なら、このファイルを
Allowed Pathsおよび relevant Verification Commands
に追加する。
既存テストを delete / skip する方向にはしない。
期待値を
「既存4 production preflight + 対象2 contract_update → dedicated execution」
「test-only fixture profiles → 従来どおり」
へ更新する仕様にする。
GH_CONFIG_DIRの current behavior を確認する。PR fix: preserve GH_CONFIG_DIR for bare preflight.run #2407 により
contract_update.run.with_anchorcontract_update.run.with_human_contextが
GH_CONFIG_DIRcarrier になっており、dedicated child cwd への migration で relative
GH_CONFIG_DIRの解決先が変わるなら、invocation cwd を基準に同一 config directory を維持することを Issue contract に追加する。
token のコピー、config 内容の読み出し、global env allowlist の拡大は要求しない。
absolute
GH_CONFIG_DIRrelative
GH_CONFIG_DIRの両ケースを focused test で検証する契約にする。
runtime verification は cwd 文字列だけを確認する弱いものにしない。
dedicated worktree 側の実ファイルが実際に実行され、その repository root で必要な artifact / downstream result が扱われることを focused integration test で証明する。
実装: control-plane preflight の artifact confinement と #2190 全AC最終検証を実装する #2200 の artifact confinement 完成や 実装: fix: bind issue-refinement control-plane preflight to a dedicated linked worktree #2190 全体の最終 verification を、
実装: Migrate contract_update control-plane mutation profiles to the dedicated runtime worktree #2393 の新しい blocker にしてはいけない。
今回の migration に直接必要な範囲へ閉じる。
primary checkout の変更検知を新しい広範な監視機構へ拡張しない。
実装: Migrate contract_update control-plane mutation profiles to the dedicated runtime worktree #2393 で必要な invariant は focused integration tests で証明し、
unrelated parallel workflow の変更を誤帰属する仕組みを追加要求しない。
anchor review が指摘する
「mutation 自体は完了したが post-update verification が失敗した」
ケースと
「mutation 自体が失敗した」
ケースの区別が current contracts で必要かを確認する。
実装: Migrate contract_update control-plane mutation profiles to the dedicated runtime worktree #2393 の目的達成に直接必要で、既存 contract で表現できるなら反映する。
unrelated transaction framework redesign へ拡大しない。
推奨 verification command の baseline は、current main を確認した上で少なくとも次を評価してください。
uv run --locked pytest
tests/agent_ops/test_control_plane_worktree_bootstrap.py
scripts/agent-guards/tests/test_skill_runtime_exec_anchor.py
scripts/agent-guards/tests/test_skill_runtime_command_policy_anchor.py
.claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.py
-q
ただし、Issue refinement 中に implementation test を「PASS した」と偽装してはいけません。
ここでの目的は Verification Commands / AC / Allowed Paths を正しく契約化することです。
実際に安全に実行可能な mutation-free/static checks があれば実行して構いません。
Issue 本文 rewrite は ad-hoc
gh issue editで行わず、issue-refinement-loop→ repository-defined controlledissue-editor/edit-issuetransaction route を使用してください。semantic finding がある場合、
recommended_fixを文字列置換としてコピーするのではなく、evidence を根拠に AC、Verification Commands、Allowed Paths、In Scope、Out of Scope、Stop Conditions、dependency 状態を意味論的に整合させてください。
指定コメントには HTML 表現と Markdown 表現が重複して含まれている可能性があります。
同じ finding を二重の独立 requirement として数えず、snapshot provenance は維持したまま semantic に deduplicate してください。
rewrite 後は必ず current Issue body を read back してください。
その fresh body に対して canonical preflight と review を再実行してください。
review が
needs-fix/request_changesなら、max_iterations の範囲内で人間確認なしに rewrite loop を継続してください。deterministic checker が approve しても semantic review applicability が成立するなら semantic review を省略しないでください。
semantic SubAgent の completion join barrier を満たしてから結果を join してください。
終了条件:
この条件を満たしたら refinement を終了してください。
このプロンプトでは implementation PR の作成・実装開始までは行わないでください。
真に
human_judgment_requiredとなるのは、既存 workflow contract が定める非自動化境界
(例: destructive/non-idempotent scope change、permission boundary change、external service boundary change、Issue split が必要、解消不能な owner decision conflict)
に到達した場合だけにしてください。
単に
という理由だけで人間へ戻さないでください。
最後に簡潔に報告してください:
このプロンプトなら、今回の
REQUEST_CHANGESを単純な文字列パッチではなく、fact-check → semantic review → controlled Issue rewrite → fresh review の既存経路へ乗せつつ、途中の確認待ちをかなり抑えられます。squne121 commentedon Sep 6, 2026
issue-refinement-loop 完了報告(#2393)
operator-selected human context(anchor: #2393 (comment) , author_association: OWNER)を
preflight.run.with_human_contextlane で fact-check し、以下の semantic delta を確認のうえ本文を更新しました。解消した findings
scripts/agent-ops/worktree_bootstrap_exec.py:617のcontrol_plane_dedicated_execution_session()を用いる surviving parent-controller 方式(scripts/agent-guards/skill_runtime_exec.py:2530から呼び出し)。In Scope をこの実装に整合させ、新規 re-exec route / entrypoint / lock protocol を追加しない旨、invocation root と child execution root を混同しない旨を明記。tests/agent_ops/test_control_plane_worktree_bootstrap.py(現状「4 production preflight のみ dedicated」「contract_update は非dedicated」を assert する既存3テスト、459/468/508行目)を Allowed Paths と AC3 / VC に追加。既存テストの削除・skip ではなく期待値更新として契約化。_sanitize_env()(skill_runtime_exec.py:1017-1027)が絶対パス化せず引き継ぐ現状を確認し、AC4 として invocation cwd 基準の固定要件・absolute/relative 両ケースの test 要件を追加。disposition: patch/final_readback/fresh_review、status: handoff_required/writes: 0語彙を確認し、AC5 として outer supervision failure が inner disposition を上書きしない・unknown時に盲目的resendしない要件を追加。contract_update.run.*エントリのmutation: Trueと矛盾するnetwork_effect: "github_read_only"を drive-by 訂正対象として In Scope に明記。AC は3件から6件に拡張し、Verification Commands・Allowed Paths も対応して更新済みです。
実行した SubAgent(すべて完了・結果 join 済み)
codebase-investigator(fact-check、一部の結論はcontrol-planeが独立grep/readで再検証・訂正して採用)issue-design-reviewer(1周目: REQUEST_CHANGES、4件blocking + 2件non-blocking)issue-editor(controlled mutation transaction、body_sha256 事前一致確認 → 更新 → readback確認済み)issue-design-reviewer(2周目 fresh review: APPROVE、live body sha256照合済み、findings: [])fresh review / readiness
sha256:62669c51c1a79d8d1722afbf539f6d13d6eedec19fb41675606f5063e1601a83run_root_review_pipeline.py produce):verdict: approve/canonical_step2_route: step_2_5APPROVE、findings なしremaining warnings
scope_cvs_in_scope_mismatch(Current Validated Scope と In Scope のトークンjaccardが低い旨の定型警告、severity: warning)。blocking ではないため対応不要と判断。実装について
本ループの依頼スコープは Issue #2393 の refinement までであり、implementation PR の作成・実装着手は行っていません。
squne121 commentedon Sep 6, 2026
結論として、#2393 は そのまま
impl-review-loopに投入してよい状態です。Issue 本文は既に PR #2495 の parent-controller 実装に合わせて更新され、AC1–AC6、Allowed Paths、Verification Commands、Stop Conditions まで具体化されています。 一方、現行 main のskill_runtime_exec.pyはまだcontract_update.run.with_anchor/.with_human_contextを dedicated execution 対象から意図的に除外しており、実装作業自体は残っています。 Registry のnetwork_effect: "github_read_only"も残っているため、#2393 の修正対象と一致します。推奨する運用は、直接
implementation-workerを起動せず、root からimpl-review-loopの正規 entry を通すことです。現行 skill は Step 1 をimplementation-worker、Step 2 を test runner、Step 4 をpr-reviewerに分離し、PR 作成まで worker に実行させる設計です。 また、SubAgent 完了判定も既にかなり厳密で、wait_agentだけでは完了扱いせず、final result の取得とlist_agents上の terminalcompletedの双方を要求しています。 これは今回の「SubAgent の作業完了を待つ」という要求にそのまま使えます。Claude Code 側では
autopermission mode を使うのが適切です。Auto mode は tool call を background safety check で自動承認しますが、明示的なaskrule 等は prompt だけでは解除できません。([Claude]1) また現在の Claude Code は SubAgent が background 起動になる場合があるため、依存関係のある実装→検証→レビューでは foreground を指定するか、repo の Common Completion Protocol で terminal completion まで待たせるのが重要です。([Claude]2)セッションがまだ Auto でなければ
claude --permission-mode autoで起動し、以下をそのまま投入するのを推奨します。Issue #2393 を、repository-defined
impl-review-loopを使って実装・検証・PR review まで自律的に完遂してください。目的は 人間の途中承認なしで merge 直前の repository-defined ready state まで到達することです。
実装だけして停止せず、REQUEST_CHANGES の修正、再検証、CI、fresh current-head review までループしてください。
ただし merge 自体は絶対に実行しないでください。
gh pr merge、auto-merge 有効化、merge button 相当操作は行わず、最終的な merge 判断だけを人間に残してください。Execution mode
.claude/skills/impl-review-loop/SKILL.mdとそのsteps/を読み、独自の簡易ループを作らず canonical workflow を実行する。max_iterationsは 6 とする。ループ可能な問題を途中で人間へ返さない。AskUserQuestionは通常の設計判断・修正判断・retry 判断には使用しない。Root entry
Step 1 の
implementation-workerを直接 shortcut 起動しないでください。impl-review-loopが定義する Root-Owned Synchronous Entry Transition に従い、を同じ継続した control flow で行ってください。
artifact/snapshot/ledger の欠落や stale だけを理由に停止しないでください。
停止 authority は live Issue contract、actual worktree state、Allowed Paths、実テスト、CI、current-head review 等の repository-defined authoritative boundary に限定してください。
Mandatory SubAgent orchestration
canonical workflow の担当を root が肩代わりせず、少なくとも以下の SubAgent を使ってください。
implementation-workertest-runnerpr-reviewer依存する Step の SubAgent は、結果が必要なので foreground execution を優先してください。
runtime の都合で background task になった場合を含め、SubAgent を起動しただけで次の Step に進んではいけません。
各 canonical task について必ず Common Completion Protocol を満たしてください。
wait_agentの timeout、mailbox update、途中経過、steer response は完了とみなさない。list_agents等の canonical lifecycle observation で、同じ task name が terminalcompletedであることを確認する。completedの 両方を確認して初めて次の routing を決める。errored/interrupted/shutdown/not_foundを completed とみなさない。つまり、implementation-worker がまだ作業中なのに test-runner を走らせたり、test-runner が未完了なのに pr-reviewer を起動したりしないでください。
#2393 implementation anchors
live Issue 本文を最終 SSOT としつつ、今回の implementation recommendation は以下です。
対象は厳密に次の2 profile です。
contract_update.run.with_anchorcontract_update.run.with_human_contextPR #2495 / Issue #2199 が実装済みの既存 parent-controller と
control_plane_dedicated_execution_session()を再利用してください。新しい re-exec route、command entrypoint、lifecycle lock protocol、generic runtime abstraction は追加しないでください。
重要な境界は、
です。
単純に registry の
required_cwdを dedicated root に変更するだけの実装にしないでください。既存 parent-controller が lifecycle lock を保持した状態で dedicated child を supervise する既存方式へ、この2 profile を接続してください。
GH_CONFIG_DIR
relative
GH_CONFIG_DIRが dedicated child cwd の変更によって別パスを指さないようにしてください。child cwd を切り替える前に、明示された relative
GH_CONFIG_DIRは 元の invocation cwd 基準で同一 configuration directory を指すよう固定してください。absolute path は同一値・同一対象を維持してください。
token copy、GitHub config contents の読み出し、新しい env allowlist 拡張は不要です。
Result preservation
outer dedicated-runtime supervision が失敗した場合でも、inner mutation transaction で既に確定した意味論を破壊しないでください。
特に、
issue_editor_requiredhandoffdisposition: patchfinal_readbackfresh_reviewstatus: handoff_requireddisposition: full_rewrite_requiredwrites: 0等の既存 classification を outer failure で「mutation 未実行」に潰さないでください。
outer result が unknown / unverifiable の場合、blind mutation resend を行わないでください。
Registry / tests
対象2 profile の pre-existing
network_effect: "github_read_only"は mutation 実態と一致する値へ修正してください。
tests/agent_ops/test_control_plane_worktree_bootstrap.pyの既存 boundary assertions は削除・skip せず、の計6 profileが dedicated execution、
preflight.run.fixturepreflight.run.fixture.with_human_contextは従来どおり excluded、
という境界へ更新してください。
fixture migration や broader runtime redesign は行わないでください。
Scope discipline
Issue #2393 の live Allowed Paths を厳守してください。
現在の Issue contract が許可している対象以外へ変更を広げないでください。
「ついでのリファクタリング」はしないでください。
ただし Allowed Paths 内で、AC を満たすために必要な production code / test の変更は approval を求めず実行してください。
既存 test を pass させるために assertion を弱める、skip する、削除する、実装を test 固有に hard-code することは禁止です。
#2190 / #2200 全体の artifact confinement 完成を #2393 の新しい blocker にしないでください。
Verification
Issue #2393 に記載された AC1–AC6 の Verification Commands を current candidate head で実行してください。
特に少なくとも以下の focused suites を実測してください。
uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_anchor.py -quv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_command_policy_anchor.py -quv run --locked pytest tests/agent_ops/test_control_plane_worktree_bootstrap.py .claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.py -q失敗した場合は結果を報告して停止するのではなく、原因を解析し、Issue scope 内で修正可能なら implementation-worker に fix_delta として戻して再実装してください。
candidate head が変わるたびに stale test/review evidence を current-head evidence として使わないでください。
PR and CI loop
Step 1 で repository-defined
implement-issue/open-prroute を使い、1 Issue = 1 PR を守ってください。PR 作成、commit、push について人間承認を求めないでください。
PR が存在したら current head に対して required CI を待ってください。
CI failure が implementation に起因し、Allowed Paths 内で修正可能なら、自動で修正 → commit → push → current-head verification を繰り返してください。
BEHINDは repository-definedroute_to_update_branchで自動処理してください。reviewed head が stale なら
route_stale_head_rereviewで fresh review を行ってください。mergeability
UNKNOWNは repository-defined bounded retry を使って再取得してください。BLOCKED/UNSTABLE/DRAFTを、それだけで人間 escalation の理由にしないでください。current-head CI / branch protection / workflow routing を再評価してください。PR review loop
Verification gate を通った current head だけを
pr-reviewerに渡してください。pr-reviewerがREQUEST_CHANGESを返した場合、fix_deltaに変換implementation-workerに再委譲pr-reviewerを再実行まで自動で継続してください。
過去 head の APPROVE は使用禁止です。
Step 1–4 の child が単に
human_review_required: trueと自己申告しただけでは停止せず、repository-defined root routing に従ってください。canonical
HUMAN_REVIEW_REQUIREDroute が生じた場合も、まず定義済みの automatic recovery をすべて尽くしてください。Hard-stop policy
途中で私に「続けますか?」とは聞かないでください。
本当に自動継続不能な場合だけ停止してください。
例:
この場合も approval question を出すのではなく、何が blocker で、どの evidence に基づき、どこまで完了したかを明示して停止してください。
Definition of done
以下をすべて current head で満たすまで作業を続けてください。
pr-reviewerverdict =APPROVEblockers: []impl-review-loopの canonical approved termination conditionを満たすIMPL_REVIEW_LOOP_RESULT_V1.status: draft_pr_ready相当まで到達ここまで到達したら merge はせず停止してください。
最終報告では簡潔に以下を出してください。
merge-ready: yes/no説明だけで終わらず、実際に
impl-review-loopを開始してください。この形なら、「auto mode だから何でも勝手にやれ」ではなく、既存の loop protocol が持っている recovery / current-head gate / SubAgent lifecycle を最大限使いながら、承認待ちだけを除去する指示になります。特に最後の「説明せず実行開始」と「final result + terminal completed の両方を待つ」は入れておいた方がよいです。
squne121 commentedon Sep 6, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
squne121 commentedon Sep 6, 2026
implement-issue: 実装完了 (2026-09-06T02:32:07Z)
.claude/worktrees/issue-2393-contract-update-dedicated-runtimeworktree-issue-2393-contract-update-dedicated-runtimefix: cold-worktree tmp/ misdetection and AC5 inner-result recovery in…
feat: contract_update mutation profileをdedicated control-plane runtim…