Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "#2271"
goal_ref: "Parent #2271 が要求する (1) workflow capability preflight (2) optional Spark delegation (3) Issue契約修復・GitHub mutation (4) fresh review (5) implementation entry の順序のうち、(1) を issue-refinement-loop の bare `preflight.run` command(parent-owned preflight / isolation worktree 委譲経路)で、最初の mutation または SubAgent dispatch より前に到達する executable gate として保証する。anchor-comment 駆動経路(`preflight.run.with_anchor` / `.with_human_context` / `.with_agent_report`)への同種配線は本 Issue のスコープ外とし、follow-up Issue で扱う"
change_kind: workflowParent Issue
Parent Goal Ref
- Goal: Claude-GPT → issue-refinement-loop → impl-review-loop の実行契約を end-to-end で整合させ、workflow capability preflight → optional Spark delegation → Issue契約修復・GitHub mutation → fresh review → implementation entry の順序を保証する。
- Desired Destination:
issue-refinement-loopの実行経路全体(Step 0〜Step 5)が Parent 導入: Claude-GPT → issue-refinement-loop → impl-review-loop の実行契約を end-to-end で整合させる #2271 の順序契約を満たす状態。
Current Validated Scope
- canonical
ISSUE_REFINEMENT_COMMAND_REGISTRY_V1の barepreflight.runエントリ(preflight.run.with_anchor/.with_human_context/.with_agent_report等の sibling エントリは対象外。これらは Remaining Parent Gaps に follow-up として記載する)が、既存のrun_refinement_preflight.py直接起動ではなく、新設する薄い同期 wrapperworkflow_start_entry.pyを起動するように変更する。 workflow_start_entry.pyは次の3段を一続きに実行する: (1) 構造化 workflow capability preflight(root_entry_router.pyに新設するcapability_preflight_result()を利用)を一度だけ実行する、(2)decision: blockedまたは producer 呼び出し失敗/結果 malformed の場合はrun_refinement_preflight.pyを一切起動せず compact blocked result を返して終了する、(3)decision: readyまたはdegradedの場合のみ trusteduv経由でrun_refinement_preflight.pyを一度だけ起動する。root_entry_router.pyに、既存の boolean-onlycapability_preflight()とは別に、CLAUDE_GPT_WORKFLOW_CAPABILITIES_V1のdecision/checks/reasonsをそのまま保持するcapability_preflight_result()を追加する。既存capability_preflight()はこの構造化結果を boolean へ縮退させる後方互換 adapter として維持し、Step 5(run_root_transition)の既存呼び出し・既存テスト(test_ac11_capability_preflight_blocked_stops_before_mutation等)の挙動を変更しない。- Step 0 の caller は capability request として
spark_mode/spark_fallback/ invocation-scopedplanned_operations(各 operation にphase/actor_role/requires_mutationを持つ)を明示的に渡す。static な全 operation superset は禁止し、request が欠落または malformed な場合はenvironment_failureとして fail-closed する。 .claude/skills/issue-refinement-loop/SKILL.mdの Step 0 系に、workflow capability preflight が Step 0g(trusted contract update mutation)・Step 1 SubAgent dispatch・Step 4 Issue mutation のいずれよりも前に、preflight.runの一部として一度だけ実行されることを明記する。Step 0 の capability preflight と Step 5 の capability preflight は独立した fresh call であり、Step 0 の結果を Step 5 の implementation-entry authorization として再利用しないことも明記する。- 上記変更を検証する hermetic behavioral test(fake transport / fake gh、live GitHub 呼び出し不要)を
.claude/skills/issue-refinement-loop/scripts/tests/に追加する。
Remaining Parent Gaps
- 統合: merged Child A/B/C の単一 clean HEAD で issue-to-impl E2E を検証する #2278 による単一 clean integration HEAD 上の issue-to-impl E2E
- anchor-comment 駆動経路(
preflight.run.with_anchor/.with_human_context/.with_agent_report)への capability preflight 配線(follow-up Issue。本 Issue は barepreflight.runのみを対象とする) - Parent 導入: Claude-GPT → issue-refinement-loop → impl-review-loop の実行契約を end-to-end で整合させる #2271 closure requirements の最終確認
Outcome
canonical bare preflight.run(command_registry.py の ISSUE_REFINEMENT_COMMAND_REGISTRY_V1。anchor-comment 駆動の sibling エントリは対象外)から到達する workflow_start_entry.py が、Step 0g mutation・SubAgent dispatch(Step 1/1b)・Step 4 Issue mutation のいずれよりも前に workflow capability preflight を一度だけ実行し、decision: blocked または producer 呼び出し失敗/malformed の場合に run_refinement_preflight.py を含む後続処理を一切起動しないことが、hermetic behavioral test で証明できる状態。decision: ready / degraded の場合は run_refinement_preflight.py を trusted uv 経由で一度だけ起動し、structured な checks / reasons が blocked result に保持される。
Runtime Verification Applicability
decision: immediate
reason: "producer が実際に一度だけ呼ばれる/blocked で downstream 呼び出しがゼロ回になる/ready・degraded で一度だけ次へ進む、という runtime control-flow は静的 grep や文言確認だけでは証明できないため。"
applicable_acs:
- AC2
- AC3
- AC4
- AC5
- AC7
- AC9
execution_environment:
cli_tools:
- python3
- uv
auth_required: false
network_required: false
skip_conditions:
- "local repository checkout が存在しない場合は SKIP ではなく environment blocked として扱う"
fallback_policy:
fallback_success_is_pass: false
notes: "fallback 経由の成功を PASS に変換しない。live GitHub API 呼び出しや live Claude-GPT E2E は要求しない(統合 live smoke は #2278 が別途担当)"
artifact_requirements:
- "pytest output(test_workflow_start_entry.py の hermetic fake transport / fake gh 実行ログ)"本 Issue が証明対象とするのは「producer が実際に一度だけ呼ばれる」「blocked で downstream(run_refinement_preflight.py 起動・GitHub mutation)呼び出しがゼロ回になる」「ready/degraded で一度だけ次へ進む」という runtime control-flow であり、静的 grep や文言確認だけでは証明できない。hermetic fake transport(stub producer JSON・fake gh/uv 呼び出し記録)を用いた subprocess/behavioral pytest で検証する。
In Scope
-
command_registry.pyの barepreflight.runargv をworkflow_start_entry.py起動に変更する(preflight.run.with_anchor/.with_human_context/.with_agent_report等の sibling エントリは変更しない) -
workflow_start_entry.pyの新規実装(capability preflight 実行 → blocked分岐 → ready/degraded分岐 →run_refinement_preflight.py起動) -
root_entry_router.pyへのcapability_preflight_result()追加と、既存capability_preflight()の後方互換 adapter化 -
capability request(
spark_mode/spark_fallback/planned_operations[].{phase,actor_role,requires_mutation})の caller 側組み立てと、欠落/malformed 時のenvironment_failurefail-closed -
.claude/skills/issue-refinement-loop/SKILL.mdの Step 0 系への上記 ordering・freshness 契約の明記 -
対応する hermetic behavioral test の追加
-
AC1 の command migration は、以下3つの consumer を同一 PR で atomic に同期する契約とする:
command_registry.py— canonical barepreflight.runargvskill_runtime_command_policy.py—_EXPECTED_ARGV_BY_COMMAND["preflight.run"]skill_runtime_exec.py— pre-dispatch integrity/symlink check の first-hop target
三者とも bare
preflight.runについてworkflow_start_entry.pyを指すこと。これは policy の一般化・緩和ではなく、既存 exact-match command contract の atomic migration である。上記migrationに伴い、bare
preflight.runを real executor 経由で real-dispatch する既存 fixture/snapshot テスト7件(Allowed Paths参照)も同一PRで migration parity のため更新する。これらは production behavior変更ではなく、既存テストが検証しているbarepreflight.runの first-hop契約をmigration後の値に追従させるものである。変更しないもの:
preflight.run.with_anchor/.with_human_context/.with_agent_report/.fixture/.fixture.with_human_contextの production argv・wiring(これらは引き続きrun_refinement_preflight.pyを first-hop とする)。
Out of Scope
- Parent 導入: Claude-GPT → issue-refinement-loop → impl-review-loop の実行契約を end-to-end で整合させる #2271 の (2) optional Spark delegation / (3) Issue契約修復・GitHub mutation の詳細実装
- Issue 実装: Claude-GPT に workflow-profile capability preflight と controlled GitHub route を配線する #2273 が既に配線した「implementation-entry capability preflight」(Step 5 終了処理側)のロジック変更。Step 5 の既存 producer 呼び出し・既存 boolean 挙動は変更しない
scripts/claude-gpt/preflight.sh/workflow_capability_preflight.py自体の変更(Issue 実装: Claude-GPT に workflow-profile capability preflight と controlled GitHub route を配線する #2273 のスコープ)- 新しい enforcing hook(
PreToolUse等)の追加 - 新しい mutation broker・capability ledger・authorization token・digest/receipt・永続 state store・actor/operation permission registry の新設
- live Claude-GPT E2E を本 Issue の unit/behavioral test へ持ち込むこと(統合: merged Child A/B/C の単一 clean HEAD で issue-to-impl E2E を検証する #2278 のスコープ)
preflight.run.with_anchor/.with_human_context/.with_agent_report等、anchor-comment 駆動経路の capability preflight 配線(Remaining Parent Gaps に記載した follow-up Issue のスコープ)
Acceptance Criteria
- AC1:
command_registry.pyのISSUE_REFINEMENT_COMMAND_REGISTRY_V1の barepreflight.run(.with_anchor等の suffix を持たない既定エントリ)の canonical argv がworkflow_start_entry.pyを起動する(run_refinement_preflight.pyを直接指さない)。同時に、skill_runtime_command_policy.pyの exact argv policy(_EXPECTED_ARGV_BY_COMMAND["preflight.run"])とskill_runtime_exec.pyの pre-dispatch integrity/symlink check の first-hop target も同じworkflow_start_entry.pyに同期し、real privileged executor のvalidate_registry_entry()を通過してargv_template_mismatchを発生させないことを確認する。sibling エントリ(preflight.run.with_anchor/.with_human_context/.with_agent_report/.fixture/.fixture.with_human_context)の argv・first-hop target は変更しない - AC2:
workflow_start_entry.pyは Step 0g mutation・SubAgent dispatch・GitHub mutation のいずれよりも前に、root_entry_router.capability_preflight_result()を実際に import/呼び出しして workflow capability preflight producer を一度だけ実行する(workflow_start_entry.pyが独自に preflight 呼び出しを再実装しないことを静的チェックで確認する)。この runtime 順序の証明は AC9 のtest_workflow_start_ready_invokes_inner_once/test_workflow_start_blocked_does_not_invoke_inner_preflightが担う - AC3: producer の
decisionはready/degraded/blockedの3値のみであり、blocked、または producer subprocess 呼び出し自体の失敗・結果 JSON の malformed(この2つを合わせて以下producer 呼び出し失敗/malformedと呼ぶ)の場合、workflow_start_entry.pyはrun_refinement_preflight.pyを一切起動せず、compact blocked result(reason を含む)を返して終了する - AC4: capability preflight の結果が
readyまたはdegradedの場合、workflow_start_entry.pyは trusteduv経由でrun_refinement_preflight.pyを一度だけ起動する - AC5: caller は capability request として
spark_mode/spark_fallback/ invocation-scopedplanned_operations(各 operation にphase/actor_role/requires_mutation)を明示的に渡す。static global superset は使わず、caller が渡した capability request 自体(producer の応答ではない)が欠落または malformed な場合は、producer を呼び出す前にenvironment_failureとして fail-closed する。この caller-side 欠落/malformed ケースは AC3 の producer 応答 malformed ケースとは別の専用テスト(test_workflow_start_missing_planned_operations_fails_closed)で検証する - AC6:
root_entry_router.pyに構造化結果を返すcapability_preflight_result()が追加され、既存capability_preflight()boolean adapter はこれを内部で呼ぶ後方互換 wrapper として維持される(Step 5 の既存呼び出し元・既存テストの挙動は変更しない)。実装者はpnpm test相当の全体検証の一環として、既存のtest_ac11_capability_preflight_blocked_stops_before_mutation(.claude/skills/issue-refinement-loop/tests/test_loop_handoff_contract.py)が無回帰で PASS することも確認する(VC 単一コマンド制約のため個別 AC の Verification Command には含めない) - AC7:
blockedの理由(checks/reasons)がworkflow_start_entry.pyの compact result に保持される(Step 5 のready|degraded -> True/blocked|producer呼び出し失敗/malformed -> Falseという boolean 縮退は Step 0 経路には適用しない) - AC8:
.claude/skills/issue-refinement-loop/SKILL.mdに、Step 0 の capability preflight と Step 5 の capability preflight が独立した fresh call であり、Step 0 の結果を Step 5 の implementation-entry authorization として再利用しないことが明記されている - AC9:
.claude/skills/issue-refinement-loop/scripts/tests/に hermetic fake transport / fakeghを用いた behavioral test が追加され PASS する(test_workflow_start_blocked_does_not_invoke_inner_preflight/test_workflow_start_blocked_performs_no_github_mutation/test_workflow_start_ready_invokes_inner_once/test_workflow_start_degraded_uses_declared_fallback_once/test_workflow_start_passes_exact_spark_and_planned_operations/test_workflow_start_missing_planned_operations_fails_closed/test_workflow_start_preserves_block_reason/test_workflow_start_malformed_producer_result_fails_closedの8本を含む) - AC10:
.claude/skills/issue-refinement-loop/tests/test_thin_entrypoint.py(SKILL.md 500行制約)が引き続き PASS する
Verification Commands
# AC1
# baseline-expect: fail
$ rg -n "workflow_start_entry" .claude/skills/issue-refinement-loop/scripts/command_registry.py
# AC2
# baseline-expect: fail
$ rg -n "capability_preflight_result" .claude/skills/issue-refinement-loop/scripts/workflow_start_entry.py
# AC3
$ uv run --locked pytest .claude/skills/issue-refinement-loop/scripts/tests/test_workflow_start_entry.py -q -k "test_workflow_start_blocked_does_not_invoke_inner_preflight or test_workflow_start_blocked_performs_no_github_mutation or test_workflow_start_malformed_producer_result_fails_closed"
# AC4
$ uv run --locked pytest .claude/skills/issue-refinement-loop/scripts/tests/test_workflow_start_entry.py -q -k "test_workflow_start_ready_invokes_inner_once or test_workflow_start_degraded_uses_declared_fallback_once"
# AC5
$ uv run --locked pytest .claude/skills/issue-refinement-loop/scripts/tests/test_workflow_start_entry.py -q -k "test_workflow_start_passes_exact_spark_and_planned_operations or test_workflow_start_missing_planned_operations_fails_closed"
# AC6
# baseline-expect: fail
$ rg -n "capability_preflight_result" .claude/skills/issue-refinement-loop/scripts/root_entry_router.py
# AC7
$ uv run --locked pytest .claude/skills/issue-refinement-loop/scripts/tests/test_workflow_start_entry.py -q -k "test_workflow_start_preserves_block_reason"
# AC8
$ rg -n "独立した fresh call" .claude/skills/issue-refinement-loop/SKILL.md
# AC9
$ uv run --locked pytest .claude/skills/issue-refinement-loop/scripts/tests/test_workflow_start_entry.py -v
# AC10
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_thin_entrypoint.py -v
# Scope Delta parity(AC1 consumer sync・migration parity)
# test_skill_runtime_policy_commands.py は変更対象ファイルではなく no-op regression 確認用
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_policy_commands.py -v
# preflight-scope: pr_review_only
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_preflight_no_worktree.py -v
# preflight-scope: pr_review_only
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.py -v
# preflight-scope: pr_review_only
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_session_manifest_lifecycle.py -v
# preflight-scope: pr_review_only
$ uv run --locked pytest scripts/agent-guards/tests/test_guard_shadow_log_write_path_policy.py -v
# preflight-scope: pr_review_only
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_anchor.py -v
# preflight-scope: pr_review_only
$ uv run --locked pytest tests/agent_guards/test_worktree_scope_guard.py -v
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.py -vAllowed Paths
- .claude/skills/issue-refinement-loop/SKILL.md
- .claude/skills/issue-refinement-loop/scripts/root_entry_router.py
- .claude/skills/issue-refinement-loop/scripts/command_registry.py
- .claude/skills/issue-refinement-loop/scripts/workflow_start_entry.py
- .claude/skills/issue-refinement-loop/scripts/tests/
- scripts/agent-guards/skill_runtime_command_policy.py
- scripts/agent-guards/skill_runtime_exec.py
- scripts/agent-guards/tests/test_skill_runtime_preflight_no_worktree.py
- scripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.py
- scripts/agent-guards/tests/test_skill_runtime_exec_session_manifest_lifecycle.py
- scripts/agent-guards/tests/test_guard_shadow_log_write_path_policy.py
- scripts/agent-guards/tests/test_skill_runtime_exec_anchor.py
- tests/agent_guards/test_worktree_scope_guard.py
- .claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.py
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- 本Issueの scope delta(
skill_runtime_command_policy.py,skill_runtime_exec.py, 7つのfixture/snapshotテスト)は、複数ラウンドの独立SubAgent調査とOWNER承認を経て確定済み。これ以上のwhole-repo scope再探索は不要。
- 本Issueの scope delta(
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- 新しい enforcing hook(
PreToolUse等)の追加が必要になった場合
Required Skills
- なし
Required Design References
- docs/dev/workflow.md
- docs/dev/agent-skill-boundaries.md
Scope Delta(任意)
N/A
Notes for Reviewer
- 本 Issue は Parent 導入: Claude-GPT → issue-refinement-loop → impl-review-loop の実行契約を end-to-end で整合させる #2271 の順序契約と Issue 実装: Claude-GPT に workflow-profile capability preflight と controlled GitHub route を配線する #2273 の scope 境界を巡る OWNER レビュー(PR 実装: Claude-GPT に workflow-profile capability preflight と controlled GitHub route を配線する #2307 の REQUEST_CHANGES, P0-1: https://github.com/squne121/loop-protocol/pull/2307#issuecomment-5381555495)を受けて、Issue 実装: Claude-GPT に workflow-profile capability preflight と controlled GitHub route を配線する #2273 を「implementation-entry capability preflight」に狭めた際に未解決として残った follow-up。
- Issue 実装: Claude-GPT に workflow-profile capability preflight と controlled GitHub route を配線する #2273 は Allowed Paths に
issue-refinement-loop/SKILL.mdを含んでいなかったため、Step 1/1b/4 より前の gate 実装は同一 PR ではなく本 Issue に分離した。 - Depends on 実装: Claude-GPT に workflow-profile capability preflight と controlled GitHub route を配線する #2273(本 Issue の production consumer wiring の前提となる
capability_preflight()実装が 実装: Claude-GPT に workflow-profile capability preflight と controlled GitHub route を配線する #2273 で行われる)。 - 本 Issue は 実装: issue-refinement-loop の Step 0 で workflow capability preflight をSubAgent起動前に実行する #2311 (comment) の OWNER REQUEST_CHANGES レビュー(P0-1〜P0-6, P1-1〜P1-4)を反映して全面改訂した。dead code で AC を満たせる問題(P0-1)を production carrier(
workflow_start_entry.py+ canonicalpreflight.run配線)の明記で解消し、「Step 1 より前」ではなく「最初の mutation/SubAgent dispatch より前」(P0-2)、capability request の正本定義(P0-3)、structured result の保持(P0-4)、Runtime Verification Applicability のimmediate化(P0-5)、Allowed Paths と canonical bootstrap の自己矛盾解消(P0-6)、VC の baseline-expect 注釈と canonical pytest 呼び出し形式(P1-1/1-2 相当。checker feedback:uv run --locked python3 -m pytestではなくuv run --locked pytestを使う)、Remaining Parent Gaps の 統合: merged Child A/B/C の単一 clean HEAD で issue-to-impl E2E を検証する #2278 明記(P1-3)、Step 0/Step 5 preflight の freshness 分離明記(P1-4)を反映した。OWNER が「採用しない方がよい」とした新規 hook・mutation broker・capability ledger・authorization token・digest/receipt・永続 state store・permission registry の新設は Out of Scope に明記して除外した。 - refinement loop の Step 2.5 semantic design review(
issue-design-reviewer)が2ラウンド実施された。1ラウンド目の high finding 2件(AC5 の caller-side capability request 検証テストが AC9 正本リストに無かった/workflow_start_entry.pyがroot_entry_router.capability_preflight_resultを実際に呼ぶことを検証する AC/VC が無かった)は AC5/AC9/AC2 の拡張で解消済み。2ラウンド目で新たに検出された high finding(AC1/In Scopeが barepreflight.runのみを差し替え、Step 0g mutation を実際にゲートする anchor-comment 駆動経路preflight.run.with_anchor/.with_human_context/.with_agent_reportには配線が届いていなかった、requires_owner_choice: true)に対しては、スコープを barepreflight.run(parent-owned preflight / isolation worktree 委譲経路)に明示的に narrow し、anchor-comment 駆動経路の配線は Remaining Parent Gaps に follow-up として明記する方針を採用した(Allowed Paths・アーキテクチャ層の拡張は行わない、既存の scope narrowing パターン — 実装: Claude-GPT に workflow-profile capability preflight と controlled GitHub route を配線する #2273 からの分離 — を踏襲)。medium finding 2件(baseline-expect 注釈の AC1/AC6 への拡張、AC6 の既存 Step5 backward-compat 回帰テストの実行を明記)と low finding(AC2 の runtime-verification 対応先の明記)も反映した。AC6 の回帰テストは VC の単一コマンド制約(compound shell operator 禁止)のため個別 VC には追加せず、AC6 の Acceptance Criteria 本文に実装者向け確認事項として明記した。anchor-comment 駆動経路の capability preflight 配線については、barepreflight.runのみへの scope narrowing で進めるか、本 Issue のスコープを拡張するかは OWNER 判断を推奨する。実装着手前に本ノートを確認されたい。 - Scope Delta parity ブロックの
test_skill_runtime_preflight_no_worktree.py/test_skill_runtime_exec_unauthorized_write_path.py/test_skill_runtime_exec_session_manifest_lifecycle.py/test_guard_shadow_log_write_path_policy.py/test_skill_runtime_exec_anchor.py/test_worktree_scope_guard.pyの6コマンドは、複数ラウンドの独立SubAgent調査とOWNER承認によりpr_review_onlyとして pre-implementation baseline から defer する(# preflight-scope: pr_review_onlyを付与済み)。理由: current-main の fixture(_install_skill_runtime_exec_fixture系ヘルパー)が temporary repo にpyproject.tomlをseedしないため、uvがaccount-home lane(~/.local/bin/uv)から解決されるローカル環境でskill_runtime_command_policyの trusted-uv version-pin検証がuv_version_mismatchでfail-closedする。これは本 Issue の AC1 production migrationとは無関係な pre-existing local fixture gapであり、テスト免除ではない。実装Phaseで対象6ファイルのfixture helperに、rootpyproject.tomlの[tool.uv].required-versionを動的に読み取って生成する最小pyproject.toml(managed = false)をseedするhermetic修正を行い、実装後はこれら6コマンドをローカルで実際に実行し、さらにPR CIでの実結果も確認する。CI PASSを未確認のまま最終承認しない。test_skill_runtime_policy_commands.pyとtest_preflight_run_with_anchor.py(44/44 PASS確認済み)はこのfixture gapの影響を受けないため対象外のまま変更していない。
Activity
squne121 commentedon Aug 23, 2026
判定
REQUEST_CHANGES/ 現状の Issue 契約では実装着手 NO-GO です。問題設定自体は正しいです。PR #2307で残った「workflow 開始前ではなく、Step 5 の implementation-entry でしか preflight していない」という欠陥を #2311 へ分離した判断も妥当です。実際、#2307 の最終レビューでも P0-1 は #2311 に切り出した未解決事項として扱われています。
ただし、現在の #2311 は SKILL.md に記述を足し、
root_entry_router.pyに呼べる関数を置くことを主な完了条件にしており、production workflow がその関数を必ず通ることを証明していません。現状の AC1〜AC4 は、実際には使われない helper と説明文だけでも満たせます。P0-1: production の呼び出し元が定義されておらず、dead code で AC を満たせる
現在の
root_entry_router.pyは、モジュール自身が明記しているとおり Step 5 の root-owned implementation-entry transition です。また、その CLI subprocess 自体は、親の agentic turn における SubAgent tool call を直接制御できないとも明記されています。つまり、ここに「Step 0 から呼べる公開関数」を追加しても、Step 0 の production control flow がそれを呼ばなければ何も変わりません。一方、現在の Step 0f の正規経路は
run_refinement_preflight.pyであり、orchestrator-facing command の正本はISSUE_REFINEMENT_COMMAND_REGISTRY_V1のpreflight.runです。main thread と SubAgent は手書き shell ではなく、この registry を使う契約です。したがって、AC3 の「Step 0 consumer から呼び出す経路が実装されている」では不十分です。少なくとも以下を固定する必要があります。
blockedの場合に既存 Step 0f 以降を呼ばない分岐Anthropic の公式仕様でも、Skill は「Claude が読み、解釈して従う instructions」であり結果は可変、hook は lifecycle event で必ず発火する決定論的機構とされています。したがって、SKILL.md の記述だけを「実行保証」と呼ぶことはできません。([Claude]1)
ただし、このリポジトリでは新しい enforcing hook を追加しない判断が既にあり、趣味開発としての運用負荷も考えると、ここで hook を増やすべきではありません。必要なのは 正規 command を一本の同期 executable gate にすることです。PR #2307 の OWNER review も、永続 ledger・broker・hook ではなく単純な同期呼び出しを推奨していました。
P0-2: 「Step 1 より前」では遅い可能性があり、Step 0g mutation が AC から漏れている
現行 SKILL の順序は概ね次です。
Step 0g は
contract_update.run.with_human_contextを通じて Issue 本文を更新し得る mutation phase です。ところが #2311 の AC は主に「Step 1 / 1b / Step 4 より前」としか規定していません。これでは、Step 0g の mutation 後に capability gate を置いても AC1・AC2を満たした扱いになり得ます。順序契約は次のように修正すべきです。
重要なのは「Step 1 より前」ではなく、最初の mutation または SubAgent dispatch より前です。
P0-3: Step 0 で渡す capability request が未定義
既存 producer は、単純な GitHub auth boolean ではありません。以下を caller が渡す前提です。
spark_modespark_fallbackplanned_operationsphaseactor_rolerequires_mutationそして、GitHub read capability と operation route を別々に判定します。
現在の
GhCliGitHubEntryTransportは Step 5 用として、既定のplanned_operationsに audit comment のissue_comment一件だけを持ち、結果を最終的に boolean へ潰しています。これをそのまま Step 0 から呼ぶと、次の mutation が capability request から漏れます。
issue_editissue_editissue_createissue_comment逆に、すべての operation を常時渡す静的 superset にすると、実際には使わない route の不足で workflow を過剰に止める可能性があります。
Issue 本文で、少なくとも以下を決定してください。
Spark directive の正本が planner、delegation request、launcher input のどれなのかは、現 Issue から判別できません。ここを実装者判断に残すと、再び
spark_mode: nullで常時not_requiredになる回帰が起きます。P0-4: boolean consumer では remediation と
degradedsemantics が消える既存 producer は
decisionに加えて、checksと具体的なreasonsを返します。しかし現在のcapability_preflight()は次のように集約しています。そのため Step 0 で使うと、例えば以下の違いが消えます。
uvがないStep 0 用には構造化結果を保持すべきです。Step 5 との後方互換性は、小さな adapter で維持できます。
Step 0 consumer は次のように扱います。
新しい永続 schema、receipt、digest、authorization token は不要です。
P0-5:
Runtime Verification Applicability: not_applicableは誤り#2311 が証明しようとしているのは、単なる文言や関数シグネチャではありません。
blockedで downstream callback がゼロ回になるready/degradedで一度だけ次へ進むこれは明確な runtime control-flow の検証です。リポジトリの runtime verification policy でも、
not_applicableは静的検証だけで完結し、process・communication・I/O を必要としない場合に限定されています。したがって、#2311 は次に変更すべきです。
ここで live Claude-GPT E2E まで要求する必要はありません。統合 live smoke は #2278 が既に担当しており、#2278 自身も #2311 の merge を前提としています。
P0-6: canonical bootstrap と Allowed Paths が自己矛盾している
現在の canonical
preflight.runは先頭でuv run python3 run_refinement_preflight.pyを実行します。そのため、workflow gate を単に
run_refinement_preflight.py内部へ追加すると、trusteduvを検査する前にuv自体を起動した形になります。exact_skill_runtimeが常に canonical resolver を経由することを production path で証明するか、system Python で起動する薄い start wrapper を置く必要があります。canonical resolver は既に信頼済みuvの絶対パスを返せるので、新しい resolver は不要です。しかし #2311 の Allowed Paths には、以下がありません。
command_registry.pyrun_refinement_preflight.py一方で、Allowed Paths 外が必要なら停止する Stop Condition になっています。つまり、正規経路へ配線しようとすると Issue 契約自身が停止条件を発火させます。
推奨する production carrier
最も分かりやすいのは、stdlib-only の薄い wrapper 一枚です。
SKILL.md は「
preflight.runが workflow-start gate を所有する」と一文だけ記述し、判断ロジックを置かない方が適切です。P1-1: 現在の Verification Commands は変更前からほぼ green
現 Issue の VC は、実質的に以下です。
問題は次のとおりです。
rg "Step 1"は現状でも多数一致し、blocked ordering を何も証明しないroot_entry_router.pyには既にcapability_preflight()があり、AC3 は変更前から成立-k capability_preflightは 実装: Claude-GPT に workflow-profile capability preflight と controlled GitHub route を配線する #2273 由来の implementation-entry tests を実行するだけでも greenPR #2307 の最終検証でも、既存の consumer tests は Step 5 側の Spark/planned operations 配線と audit suppression を対象としており、workflow-start gate は #2311 に残されています。
最低限、以下の behavioral tests が必要です。
P1-2: SKILL.md の line budget を無視している
取得した current main の
SKILL.mdは 499行でした。既存test_thin_entrypoint.pyは 500行以下を強制しています。#2311 は Step 0 に複数の説明を追加する契約ですが、現在の VC は
scripts/tests/しか実行せず、tests/test_thin_entrypoint.pyを実行しません。したがって、SKILL.md への追加は一文程度に限定し、少なくとも次を VC に含めるべきです。
詳細な branching semantics は Python 側へ置くべきで、thin entrypoint に再実装してはいけません。
P1-3:
Remaining Parent Gaps: なしは事実と異なる#2311 が完了しても、Parent #2271 には #2278 の integration E2E と closure verification が残ります。#2278 は明示的に #2311 の実装 PR merge 後の clean integration HEAD を要求しています。
次の記述が適切です。
P1-4: Step 0 と Step 5 の preflight は別々の fresh call であるべき
Step 0 gate は「workflow を開始できるか」を判定します。
Step 5 gate は、refinement と mutation が終わった後の「今この状態で implementation-entry できるか」を判定します。
両者の間では、GitHub auth、repository state、Spark route、planned operations、Issue 本文が変化し得ます。したがって、Step 0 の結果を保存・再提示して Step 5 authorization に使ってはいけません。
Issue に次を明記してください。
これは既存
root_entry_router.pyの process-local・non-persistent 方針とも整合します。非ブロッキングだが、workflow 負荷の観点で直す価値がある点
現在の producer は
spark_modeが未指定でも_run_env_only_preflight()を実行してからnot_requiredを返します。Step 0 へ配線すると、Spark を使わない invocation でも毎回 proxy binary/auth probe が走ります。趣味開発の応答性を優先するなら、次の短絡で十分です。
これは security hardening ではなく、不要な subprocess と認証 probe を減らす単純な性能修正です。
推奨する Acceptance Criteria
推奨する Verification Commands
推奨する Allowed Paths
workflow_start_entry.pyを作らず既存 wrapper を system-Python bootstrap 化する設計なら、その代わりにrun_refinement_preflight.pyを Allowed Paths へ追加します。採用しない方がよいもの
今回の修正に、以下は不要です。
PreToolUsehook公式には hook の方が強い enforcement を提供しますが、ここで必要なのは adversarial な利用者への防御ではなく、canonical workflow の接続ミスをなくすことです。同期 wrapper と数本の hermetic behavioral test で十分です。live Claude-GPT 上の最終成立性は #2278 に残すのが妥当です。
本レビューでは live Issue・関連 Issue/PR/comment と current main の実装資産を確認しました。リポジトリのローカル checkout による pytest 全体の再実行までは行っていません。
squne121 commentedon Aug 23, 2026
Refinement Loop 完了報告
結果:
approved(deterministic review VERDICT: approve、semantic design review 3ラウンド実施し low finding 1件を除き全て解消・残る low finding は AC8 の baseline-expect 注釈のみで non-blocking)経緯
OWNER の REQUEST_CHANGES レビュー(#2311 (comment) 、P0-1〜P0-6, P1-1〜P1-4)を受けて Issue 契約を全面改訂した。
preflight.run(bare エントリ)から到達する新設workflow_start_entry.pyを明記spark_mode/spark_fallback/planned_operations[].{phase,actor_role,requires_mutation}を明記、caller-side 欠落/malformed の fail-closed も専用テストで担保capability_preflight_result()を新設し boolean adapter は後方互換 wrapper化immediateに変更、hermetic behavioral test 方針を明記command_registry.py/workflow_start_entry.py等を Allowed Paths に追加uv run --locked pytest形式に統一、AC ごとに単一 VCStep 2.5 Semantic Design Review(3ラウンド)
capability_preflight_result実呼び出し検証欠落)→ AC5/AC9/AC2 拡張で解消requires_owner_choice: true。AC1/In Scope が barepreflight.runのみを差し替え、Step 0g mutation を実際にゲートする anchor-comment 駆動経路preflight.run.with_anchor/.with_human_context/.with_agent_reportには配線が届いていなかった)→ 本 Issue のスコープを barepreflight.run(parent-owned preflight / isolation worktree 委譲経路)に明示的に narrow し、anchor-comment 駆動経路の配線を Remaining Parent Gaps の follow-up として明記する方針で解決(scope 拡張は行わず、実装: Claude-GPT に workflow-profile capability preflight と controlled GitHub route を配線する #2273 からの分離と同じ narrowing パターンを踏襲)。medium finding 2件も解消。route_high_open_to_rewritepolicy 上 rewrite を要求しない severity のためeffective_verdict: approveで終了。特記事項(OWNER 確認推奨)
Round 2 で発見された scope narrowing(bare
preflight.runのみを対象とし、anchor-comment 駆動経路のゲートを follow-up Issue に分離する)は、Parent #2271 の順序契約を「実際の主要な運用経路(anchor-comment 駆動)」ではなく「parent-owned preflight 経路」にのみ適用する判断です。本 Issue の実装着手前に、この scope narrowing が Parent #2271 の意図と整合するか OWNER の確認を推奨します(Remaining Parent Gaps に follow-up Issue 起票の必要性を記載済み)。次のアクション
Issue は
implementation-entry可能な状態です。実装(impl-review-loopへの handoff)は本 refinement loop の依頼スコープ外のため、本 run では起動していません。人間が確認後、impl-review-loop等で実装に着手してください。squne121 commentedon Aug 23, 2026
推奨アクション
Option 1 を採用し、同時に Option 2 の内容も Issue 契約へ反映するのが妥当です。つまり、#2311 を別 Issue に分割せず、同一 PR で registry と fail-closed policy の契約を原子的に更新する方針です。
現在の main では
command_registry.pyのpreflight.runがrun_refinement_preflight.pyを指しています。 一方、skill_runtime_command_policy.pyも_EXPECTED_ARGV_BY_COMMAND["preflight.run"]に同じ旧 argv を独立して固定しており、validate_registry_entry()は完全一致しなければargv_template_mismatchを返します。しかもこれは死んだ検査ではありません。
skill_runtime_exec.pyは実 dispatch の直前に registry を読み、validate_registry_entry()を実行した後、registry の argv を render して child process を起動しています。したがって policy だけ旧値のまま #2311 を実装すると、指摘どおり production path が fail-closed します。Option 3 の follow-up 分離は不適切です。これは「あとで直せる付随機能」ではなく、AC1 の contract consumer です。registry 側だけ先に merge 可能にすると、意図的に壊れた中間状態を main に作ることになります。
また、現在の #2311 は Allowed Paths 外変更を Stop Condition にしています。 リポジトリ自身の scope guard も、新しい Allowed Paths architecture layer を human escalation とし、承認後も contract review / refinement preflight / allowed-path gate の fresh rerun を要求しています。今回停止したサブエージェントの判断は正しいです。
なお
.specify/memory/constitution.md自体は現在 non-normative pointer と明記されているので、Claude Code には「constitution がそう言っている」ではなく、実際のscope-signal-guard/ Issue contract を根拠に処理させる方が正確です。追加スコープはまず以下に限定するのがよいです。
scripts/agent-guards/skill_runtime_command_policy.pyskill_runtime_exec.py自体は registry を動的 render しているため、今回の blocker 解消だけなら変更不要です。ただし現在の pre-dispatch integrity check にはrun_refinement_preflight.pyの名前が残っているため、新しいworkflow_start_entry.pyを first child にした際にもそのチェックの意味が成立するかはサブエージェントに必ず再確認させるべきです。必要変更と判定された場合は、勝手に追加せず再度 Stop Condition とします。Claude Code は最近の版ではサブエージェントを background で動かすことがあるので、プロンプトでは foreground を明示するのが確実です。公式仕様でも foreground subagent は完了まで main conversation を block します。([Claude]1)
Claude Code 作業プロンプト — Issue #2311 再スコープ・実装再開
対象リポジトリ:
squne121/loop-protocol対象 Issue:
https://github.com/squne121/loop-protocol/issues/2311OWNER decision
Issue #2311 の停止理由について、人間判断は以下で確定した。
Option 1 を採用し、Option 2 の内容も同時に Issue 契約へ反映する。
すなわち:
scripts/agent-guards/skill_runtime_command_policy.pyと必要最小限の focused tests を Issue 実装: issue-refinement-loop の Step 0 で workflow capability preflight をSubAgent起動前に実行する #2311 の Allowed Paths / In Scope に追加する。command_registry.pyだけを変更する契約ではなく、canonicalpreflight.runargv とskill_runtime_command_policy.pyの exact argv policy を 同一変更で同期する契約として明記する。preflight.runの新しい canonical argv を exact contract として明示的に更新する。この指示は scope delta に対する interactive human/OWNER decision である。リポジトリの既存 contract-update / trusted human-context materialization mechanism が必要ならそれを使用し、author provenance を捏造しないこと。
最重要: 実装前に SubAgent を使うこと
repo-tracked file を変更する前に、親 Claude Code セッションから read-only の SubAgent を1つ foreground で起動すること。
run_in_background相当を使用しない。SubAgent には最低限、以下を独立調査させること。
Issue 実装: issue-refinement-loop の Step 0 で workflow capability preflight をSubAgent起動前に実行する #2311 の最新 body / comments / Allowed Paths / Stop Conditions / AC / Verification Commands を GitHub から取得する。
current main の以下を読む。
.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/.claude/skills/issue-refinement-loop/scripts/tests/.claude/skills/issue-refinement-loop/references/scope-signal-guard.md以下の既知 finding を独立検証する。
REGISTRY["preflight.run"]["argv"]の child script をrun_refinement_preflight.pyからworkflow_start_entry.pyに変更すると、skill_runtime_command_policy._EXPECTED_ARGV_BY_COMMAND["preflight.run"]が旧 argv のままなので、validate_registry_entry()がargv_template_mismatchで fail-closed すること。skill_runtime_exec.pyが real dispatch 前にvalidate_registry_entry()を実際に通ることを確認する。skill_runtime_exec.py自体の変更が必要かを確認する。decide.run用の pre-dispatch script integrity check がrun_refinement_preflight.pyを固定参照している点を確認する。workflow_start_entry.pyになっても security/runtime contract が成立するなら「変更不要」と明記する。skill_runtime_exec.pyの変更が本当に必要なら、それは新しい Allowed Paths delta なので、実装せず親へ報告する。policy と registry の同期に必要な最小 test surface を特定する。
anchor siblings (
preflight.run.with_anchor,.with_human_context,.with_agent_report) を今回変更する必要がないことも確認する。SubAgent の出力は次だけに絞ること:
skill_runtime_exec.pymust changeSubAgent 完了を待ってから以下へ進むこと。
Phase 1: Issue contract を先に修復
SubAgent が既知 mismatch を確認し、
skill_runtime_exec.py等の追加 scope が不要なら、コード変更より先に Issue #2311 の契約を修復する。既存 Issue body を全面的に書き換えず、必要箇所だけを最小変更する。
Allowed Paths
少なくとも以下を追加する:
- scripts/agent-guards/skill_runtime_command_policy.pyfocused test については SubAgent の調査結果を基に、必要最小の exact path または test directory を追加する。
既存の unrelated agent-guard 実装全体を Allowed Paths に広げない。
In Scope
次を明示する:
command_registry.pyの canonical barepreflight.runargv 更新と同時に、scripts/agent-guards/skill_runtime_command_policy.pyの_EXPECTED_ARGV_BY_COMMAND["preflight.run"]を同じ canonical argv へ同期する。これは policy relaxation ではなく、同一 command contract の atomic migration である。
AC1
AC1 を概ね次の意味になるよう更新する:
文面は既存 Issue の用語・schema・style に合わせること。
Tests / Verification
以下を runtime/behavioral evidence として要求すること。
REGISTRY["preflight.run"]がworkflow_start_entry.pyを指す。validate_registry_entry("preflight.run", ...)が新 canonical registry entry を受理する。run_refinement_preflight.pyの barepreflight.runtemplate が残っていない。preflight.run.with_anchor/.with_human_context/.with_agent_reportの argv は変更されていない。preflight.runがargv_template_mismatchにならず、新 wrapper へ dispatch 可能である。Issue contract 更新後、既存 workflow が要求する contract review、refinement preflight、allowed-path gate を fresh に再実行する。
fresh rerun が green になるまでは implementation GO とみなさない。
Phase 2: 実装
fresh contract checks が green になった場合のみ実装へ進む。
Issue #2311 の最新 AC を正本として実装する。
特に以下を守ること。
command_registry.pyの barepreflight.runのみ新しいworkflow_start_entry.pyへ切り替える。skill_runtime_command_policy.pyの barepreflight.runexact argv も同じ変更に同期する。workflow_start_entry.py/root_entry_router.py/ capability request / structured result / blocked and ready/degraded behavior / freshness semantics は Issue 実装: issue-refinement-loop の Step 0 で workflow capability preflight をSubAgent起動前に実行する #2311 の最新 AC をそのまま満たす。run_refinement_preflight.pyは downstream inner preflight として維持する。実装中にさらに Allowed Paths 外の production file の変更が必要と判明した場合は、変更を加えず STOP する。
Phase 3: 検証
Issue #2311 に記載された全 Verification Commands を fresh に実行する。
加えて、SubAgent が特定した focused agent-guard tests を実行する。
最低限、以下の実挙動を証明すること。
preflight.runと exact runtime policy が一致する。argv_template_mismatchが発生しない。workflow_start_entry.pyの blocked result では innerrun_refinement_preflight.pyを一度も起動しない。テスト失敗を test weakening / skip / xfail / policy relaxation で隠さない。
Phase 4: fresh review
実装とテストが完了したら、親セッションから fresh review SubAgent を foreground で起動し、完了まで待つこと。
REQUEST_CHANGES があれば Allowed Paths 内で修正し、該当 tests を再実行して必要なら fresh review を再度行う。
新しい scope delta が出た場合は停止する。
Phase 5: PR
全 AC・tests・fresh review が green になった場合:
Closes #2311を含める。skill_runtime_command_policy.pyが同一 PR に必要だったか、registry-policy parity の runtime evidence を明記する。人間承認を追加で求める必要はない。ただし以下の場合のみ停止して報告する:
最終報告には、Issue contract 更新内容、変更ファイル、tests、review findings、PR URL、残存 blocker の有無を簡潔にまとめること。
このプロンプトなら、今回の人間判断を明示的な scope approval として与えつつ、「policy を別 Issue に逃がして一時的に production path を壊す」ことを防げます。また、Claude Code 公式仕様上 foreground subagent は完了まで親をブロックするので、「サブエージェントを起動しただけで親が先へ進む」問題も避けられます。(Claude)
squne121 commentedon Aug 23, 2026
推奨判断
scripts/agent-guards/skill_runtime_exec.pyも Allowed Paths に追加し、#2311 の同一PRで修正するのが妥当です。別Issueへ分離しないことを推奨します。理由は、今回の finding (c) が単なる「追加のセキュリティ改善」ではなく、AC1 で変更する
preflight.runcommand contract の既存 consumer を同期させる変更だからです。前回の OWNER 判断はすでに、
command_registry.pyとskill_runtime_command_policy.pyを「壊れた中間状態を作らず atomic に移行する」と決めています。また、その時点でskill_runtime_exec.pyの integrity check は再確認対象とされ、「本当に変更が必要なら新しい Allowed Paths delta として停止する」と明示されていました。今回まさにその条件が成立しています。さらに決定的なのは
skill_runtime_exec.py自身の #2086 コメントです。そこでは、integrity/symlink check は 「その command_id が実際に到達する script」を検証しなければならないと明記されています。しかし現在はdecide.runと「それ以外」の二分岐で、「それ以外」はrun_refinement_preflight.py固定です。AC1 後の barepreflight.runはworkflow_start_entry.pyに到達するため、現状維持するとその既存 invariant を自分で破ることになります。したがって最小修正は、generic な argv 解析や policy 緩和ではなく、明示的な三分岐です。
これなら
preflight.run.fixtureや anchor siblings は従来どおりrun_refinement_preflight.pyを検証でき、#2311 の scope narrowing も維持できます。skill_runtime_command_policy.pyの exact argv も現在は旧 script 名を固定しており、完全一致でargv_template_mismatchにすることも確認できます。テストについて
提示された4本の real-dispatch fixture は実際に bare
preflight.runの registry stub とrun_refinement_preflight.pyをseedしているため、workflow_start_entry.pyの first-hop seed を追加する必要があります。一方、検索上
run_refinement_preflight.pyを参照するテストは他にもあります。たとえば bytecode-cache 系は test-onlypreflight.run.fixture→ real inner preflight を意図的に検証しているので、barepreflight.runの移行に便乗して変えるべきではありません。 したがって Claude Code には「既知4本だけを機械的変更」ではなく、SubAgent に barepreflight.run/ sibling / direct-inner-test を分類させるのが安全です。また、現在の Issue 本文の Allowed Paths には、前回 OWNER が承認した
skill_runtime_command_policy.pyすらまだ反映されていません。実装より先に Issue contract を更新するべきです。Claude Code は foreground SubAgent なら完了まで main conversation を block します。現行仕様ではSubAgentが background で走る場合もあるため、今回のような phase gate では foreground を明記し、結果を受け取るまで次へ進まない指示が適切です。(Claude)
以下をそのまま渡すことを推奨します。
Claude Code 作業プロンプト — Issue #2311 scope delta 承認・atomic migration 実装
対象リポジトリ:
squne121/loop-protocol対象 Issue:
https://github.com/squne121/loop-protocol/issues/2311OWNER decision
Phase 0 で報告された新しい Allowed Paths delta について、OWNER 判断は以下で確定した。
scripts/agent-guards/skill_runtime_exec.pyを Issue #2311 の Allowed Paths / In Scope に追加し、同一 Issue・同一 PR で修正してよい。これは別 Issue に分離しない。
理由:
preflight.runの first-hop child をrun_refinement_preflight.pyからworkflow_start_entry.pyへ変更する command-contract migration である。skill_runtime_command_policy.pyの exact argv contract と同様、skill_runtime_exec.pyの pre-dispatch integrity/symlink check もその command contract の既存 consumer である。skill_runtime_exec.py自身の既存 実装: operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する #2086 コメントが、「integrity check は command_id が実際に到達する script を検証する」という invariant を明示している。preflight.runについてrun_refinement_preflight.pyを検証し続ける状態は、機能上 dispatch できても integrity check の意味を空洞化する。承認する最小実装
skill_runtime_exec.pyの script integrity target を概念的に次の三分岐へすること。実コードの既存構造に合わせて最小差分で実装すること。
以下は変更しない。
preflight.run.fixturepreflight.run.with_anchorpreflight.run.with_human_contextpreflight.run.with_agent_reportrun_refinement_preflight.pyを first-hop とする sibling commandpreflight_script_invalid等の既存 error contract も、変更が不要なら維持する。Phase 0 — read-only再確認
コード編集・Issue mutationを始める前に、SubAgentを使用すること。
SubAgent は foreground で実行すること。background に送らないこと。
各SubAgentが完全に終了し、その最終結果を受け取るまで main agent は次の Phase に進んではならない。
nested SubAgent delegationは禁止。
SubAgent A — command-contract / scope auditor
read-only で以下を確認させる。
Issue 実装: issue-refinement-loop の Step 0 で workflow capability preflight をSubAgent起動前に実行する #2311 の最新 body / comments / AC / Allowed Paths / Stop Conditions を取得する。
current
mainの以下を読む。.claude/skills/issue-refinement-loop/scripts/command_registry.pyscripts/agent-guards/skill_runtime_command_policy.pyscripts/agent-guards/skill_runtime_exec.py次を独立に再検証する。
preflight.runの現在の registry argv_EXPECTED_ARGV_BY_COMMAND["preflight.run"]validate_registry_entry()の exact equalityvalidate_registry_entry()が呼ばれることAC1 後の正しい atomic contract が以下であることを検証する。
preflight.run→workflow_start_entry.pyworkflow_start_entry.pyworkflow_start_entry.pyanchor siblings /
preflight.run.fixtureを変更する必要がないことを確認する。これ以外に production source の新しい Allowed Paths delta がないか検索する。
出力は以下だけに限定する。
SubAgent A の完了を待つこと。
SubAgent B — test-impact auditor
SubAgent A 完了後に foreground で起動する。
read-only で、
run_refinement_preflight.py,preflight.run,workflow_start_entry.py,skill_runtime_exec.pyを参照するテストを inventory し、以下に分類する。preflight.runreal-dispatch fixturepreflight.run.fixturerun_refinement_preflight.pyを直接テストする inner-preflight test少なくとも以下の既知4ファイルを確認する。
scripts/agent-guards/tests/test_skill_runtime_preflight_no_worktree.pyscripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.pyscripts/agent-guards/tests/test_skill_runtime_exec_session_manifest_lifecycle.pyscripts/agent-guards/tests/test_guard_shadow_log_write_path_policy.pyまた、
scripts/agent-guards/tests/test_skill_runtime_policy_commands.pyの registry-policy parity test surface を確認する。
既知4本について、bare
preflight.runの registry stub がworkflow_start_entry.pyを指すよう変更した場合に、fixture repo に最小workflow_start_entry.pyseed が必要か確認する。preflight.run.fixtureや direct-inner-preflight test を、単に文字列一致したという理由だけで変更対象にしないこと。出力:
SubAgent B の完了を待つこと。
Phase 0 Stop Condition
以下の場合はコードもIssueも変更せず停止して報告する。
Phase 1 — Issue #2311 contract repair
SubAgent A/B が GO の場合のみ進む。
実装より先に Issue #2311 の契約を修復する。
既存 body を全面書き換えせず、必要箇所のみ最小編集する。
1. Allowed Paths
既存 Allowed Paths に以下を追加する。
Phase 0 の inventory でさらにファイルが必要と判明した場合は、勝手に追加せず STOP する。
2. In Scope
AC1 の command migration は以下3 consumer を同一変更で同期する、と明記する。
command_registry.pypreflight.runcanonical argvskill_runtime_command_policy.py_EXPECTED_ARGV_BY_COMMAND["preflight.run"]skill_runtime_exec.py三者とも
workflow_start_entry.pyを指すこと。3. AC1
AC1 を最低限、以下の意味になるよう更新する。
preflight.runはworkflow_start_entry.pyを起動する。preflight.runについてworkflow_start_entry.pyを検証する。preflight.run.fixtureは変更しない。4. Verification
agent-guard focused tests も verification surface に追加する。
Issue contract repair 後、リポジトリ所定の contract review / refinement preflight / allowed-path gate を fresh に再実行する。
fresh check が新しい scope delta を返した場合は STOP。
Phase 2 — 実装
Issue contract が fresh validation を通った場合のみコード変更する。
A. Original #2311 implementation
Issue 最新 body の AC を正本として、元々の #2311 実装を完了する。
主対象:
.claude/skills/issue-refinement-loop/scripts/command_registry.py.claude/skills/issue-refinement-loop/scripts/workflow_start_entry.py.claude/skills/issue-refinement-loop/scripts/root_entry_router.py.claude/skills/issue-refinement-loop/SKILL.md.claude/skills/issue-refinement-loop/scripts/tests/既存 AC2〜AC10 を勝手に弱めない。
B. exact argv policy
skill_runtime_command_policy.pyの barepreflight.runexpected argv をworkflow_start_entry.pyに同期する。exact equality 自体は維持する。
generic allowlist 化、prefix match、任意 script 許可などへの緩和は禁止。
C. pre-dispatch integrity target
skill_runtime_exec.pyを最小差分で修正する。要件:
decide.run→decide_next_loop_action.pypreflight.run→workflow_start_entry.pyrun_refinement_preflight.pyregistry argv から任意 path を無条件に信頼する generic 実装へ広げない。
D. agent-guard fixture migration
bare
preflight.runを real executor 経由で実行する既知4 fixture を更新する。各 fixture の目的を維持すること。
推奨形:
workflow_start_entry.pyfixture は、そのテストが capability-preflight semantics 自体を検証する必要がない場合、CLIを受け取り既存 inner stub へ委譲する最小 harness とする。各既存テストの本来の検証対象
(unauthorized write detection / session lifecycle / shadow log / no-worktree 等)
を capability-preflight test に変質させない。
wrapper 自身の capability semantics は #2311 の dedicated behavioral tests で検証する。
E. integrity regression
少なくとも focused regression を1ケース追加する。
bare
preflight.runについて、run_refinement_preflight.pyは regular file として存在するworkflow_start_entry.pyが missing または symlinkという状態で executor が
preflight_script_invalid相当で fail-closed することを証明する。これにより「旧 inner script が存在するだけで integrity check が通ってしまう」回帰を防ぐ。
regular
workflow_start_entry.pyなら integrity check を通過して actual dispatch へ進む positive case も、既存 fixture でカバーされないなら追加する。Phase 3 — 検証
まず Issue #2311 に記載された 全 Verification Commands を fresh に実行する。
その後、少なくとも以下を実行する。
さらに Issue 本文が要求する以下の backward-compat / thin-entrypoint verification を必ず実行する。
.claude/skills/issue-refinement-loop/tests/test_loop_handoff_contract.py.claude/skills/issue-refinement-loop/tests/test_thin_entrypoint.pytest_workflow_start_entry.py相当SKIP や fallback 成功を PASS に昇格しない。
失敗を「今回と無関係」と推測だけで除外しない。原因を特定する。
Phase 4 — fresh adversarial review
実装とテスト完了後、別の reviewer SubAgent を foreground で起動する。
background にしない。
reviewer 完了まで main agent は PR 作成/更新へ進まない。
reviewer には少なくとも以下を確認させる。
preflight.runactual first-hop がworkflow_start_entry.pyであることpreflight.run.fixtureが意図せず変更されていないこと出力:
reviewer が REQUEST_CHANGES の場合は、Allowed Paths 内で直せるものだけ修正し、affected tests + Issue全VCを再実行する。
修正に新しい Allowed Paths が必要なら STOP。
Phase 5 — diff / PR
最終的に変更ファイル一覧を取得し、Issue #2311 の Allowed Paths と機械的に照合する。
Allowed Paths 外が1件でもあれば PR を完成扱いにしない。
既存の #2311 implementation PR が存在すればそれを更新する。存在しなければ repository workflow に従い PR を作成する。
PR body には少なくとも以下を記載する。
Closes #2311OWNER-approved scope delta:
skill_runtime_command_policy.pyskill_runtime_exec.pyregistry / policy / integrity target を atomic migration したこと
anchor siblings /
preflight.run.fixtureは変更していないことVerification Commands と実結果
fresh reviewer verdict
Allowed Paths compliance
merge は行わない。
最終報告
以下の形式で簡潔に報告する。
none)重要: Phase間を飛ばさないこと。特に 各 foreground SubAgent の完了を必ず待ってから次へ進むこと。
この方針なら、今回の delta は「scope creep」として無制限に取り込むのではなく、bare
preflight.runの first-hop migration に直接従属する consumer とテストだけを追加承認する形になります。最も小さく、かつ stale integrity check を残さない境界です。squne121 commentedon Aug 23, 2026
結論は、
test_skill_runtime_exec_anchor.pyの追加自体は承認してよいが、現時点ではまだ実装再開 NO-GO です。理由は、SubAgent B の inventory に少なくとも1件の漏れがあるためです。
scripts/agent-guards/tests/test_skill_runtime_exec_anchor.pyは確かに、fixture 内の barepreflight.runが旧run_refinement_preflight.pyを向き、test_executor_preflight_run_unaffected_without_anchorが real executor 経由で実際に dispatch しているので、今回の migration に追随する必要があります。これは anchor sibling の production behavior 変更ではなく、bare command の fixture parity 修正として扱えます。ただし、
tests/agent_guards/test_worktree_scope_guard.pyも同じく未承認の affected test です。このファイルも productionskill_runtime_exec.py/skill_runtime_command_policy.pyを temporary repo にコピーし、fixture の barepreflight.runを旧run_refinement_preflight.pyに固定したうえで、skill_runtime_exec.py --command-id preflight.runを実行しています。policy 側の exact argv をworkflow_start_entry.pyに更新すると、この fixture はそのままではargv_template_mismatchで壊れます。これはまさに Phase 0 の「approved set 外の必要ファイルが判明したら STOP」に該当します。 しかも production policy は bare command の argv を byte-for-byte exact match しており、executor 自身にも現在
run_refinement_preflight.pyを検証する integrity check があるため、fixture の見落としは実際の回帰になります。したがって推奨は、scope を1ファイルずつ継ぎ足すのではなく、read-only の「Phase 0R」だけをもう一度行い、whole-repo で affected fixture set を有限集合として確定することです。そこで新規必要ファイルが
test_skill_runtime_exec_anchor.pyとtests/agent_guards/test_worktree_scope_guard.pyの2本だけと独立確認できたら、両方を一括 OWNER 承認して同一PRへ入れるのが最も効率的です。なお #2311 自体は barepreflight.runのみに意図的に narrow され、anchor sibling の production wiring は follow-up 扱いなので、この境界は維持すべきです。Claude Code は現行仕様では subagent が background になり得るため、foreground を明示し、各 agent の完了結果を受け取るまで次へ進まない指示を入れるのが適切です。公式にも foreground subagent は完了まで main conversation を block すると明記されています。([Claude]1)
以下をそのまま渡すのを推奨します。
対象リポジトリ:
squne121/loop-protocol対象 Issue:
https://github.com/squne121/loop-protocol/issues/2311目的
Issue #2311 の Phase 0 は一度 STOP している。
直前の Phase 0 では、SubAgent A は production files について GO、新規 delta なしと判定した。一方 SubAgent B は OWNER 承認済み test set 外に
script/agent-guards/tests/test_skill_runtime_exec_anchor.pyではなく正確には
scripts/agent-guards/tests/test_skill_runtime_exec_anchor.pyが必要と発見した。
さらに OWNER 側の独立確認で、少なくとも次のもう1ファイルも同種の affected fixture であることが判明している。
tests/agent_guards/test_worktree_scope_guard.pyこのファイルも production
skill_runtime_exec.py/skill_runtime_command_policy.pyを temporary repo にコピーし、barepreflight.runの fixture registry argv をrun_refinement_preflight.pyに固定した上で real executor dispatch を行う。したがって、直ちにコード編集を再開せず、まず Phase 0R として scope inventory を一度だけ whole-repo で reconciliation すること。
OWNER decision
以下を OWNER decision とする。
scripts/agent-guards/tests/test_skill_runtime_exec_anchor.pyは、barepreflight.runmigration に必要な fixture parity 修正として追加候補に承認する。tests/agent_guards/test_worktree_scope_guard.pyも同じ理由で追加候補に承認する。ただし、この2ファイルだけを追加して即実装開始してはならない。Phase 0R の2つの read-only SubAgent が whole-repo inventory を独立確認し、これ以外の新規 required path がないことを確認してから承認を確定する。
Phase 0R でさらに required path が1つでも発見された場合は、コード変更・Issue mutationを行わず再度 STOP して OWNER に完全な finite path list を報告する。
anchor sibling の production behavior は変更しない。
preflight.run.with_anchorpreflight.run.with_human_contextpreflight.run.with_agent_reporttest_skill_runtime_policy_commands.pyは現在の調査で migration-specific dispatch assertion を持たないことが判明している。Allowed Paths に残っていても、変更不要なら変更しない。ファイル変更数を稼ぐ目的で触らない。exact policy を一般化・緩和しない。bare
preflight.runの新 canonical argv を exact contract として同期する。Phase 0R — scope reconciliation
repo-tracked file を一切変更する前に SubAgent を使用すること。
SubAgent は必ず foreground で実行すること。background に送らないこと。
各 SubAgent が完全に終了し、main session がその最終レポートを受け取るまで次の Phase に進んではならない。
nested SubAgent delegation は禁止する。
SubAgent A — whole-repo fixture inventory
read-only で実行する。
目的は、今回の bare
preflight.runfirst-hop migrationrun_refinement_preflight.py→
workflow_start_entry.pyによって変更が必要になる test fixture / regression test を whole-repo で列挙すること。
最低限、以下のパターンを repository 全体で探索する。
_install_skill_runtime_exec_fixtureskill_runtime_exec.pyを temporary repo に copy する fixtureskill_runtime_command_policy.pyを temporary repo に copy する fixtureREGISTRY["preflight.run"]相当を手書きしている箇所preflight.runargv にrun_refinement_preflight.pyを固定している箇所--command-id preflight.runを realskill_runtime_exec.pysubprocess へ渡す testvalidate_registry_entry()を通過する fixturepreflight_script_invalidの target script existence に依存する fixture特に以下を必ず確認する。
Previously OWNER-approved:
scripts/agent-guards/tests/test_skill_runtime_preflight_no_worktree.pyscripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.pyscripts/agent-guards/tests/test_skill_runtime_exec_session_manifest_lifecycle.pyscripts/agent-guards/tests/test_guard_shadow_log_write_path_policy.pyscripts/agent-guards/tests/test_skill_runtime_policy_commands.pyNewly discovered:
scripts/agent-guards/tests/test_skill_runtime_exec_anchor.pytests/agent_guards/test_worktree_scope_guard.py検索ヒットを機械的に required path にしてはならない。各 hit を次に分類すること。
preflight.runreal-dispatch fixture → migration requiredpreflight.run.fixturetest-only sibling →通常変更不要run_refinement_preflight.pybehavior test →通常変更不要各 required path について、
argv_template_mismatchpreflight_script_invalidworkflow_start_entry.pyのどれに該当するかを具体的に示す。
最終出力:
SubAgent A の完了を待つこと。
SubAgent B — adversarial independent validator
SubAgent A の調査結果を鵜呑みにせず、read-only で独立検証する。
特に、
skill_runtime_command_policy.validate_registry_entry()の exact argv contractskill_runtime_exec.pyの script integrity checkを call site まで追うこと。
SubAgent A の required path list に対して、各ファイルを
required / not required / uncertainで判定し、理由を示す。
また repository 全体を独立検索し、A が漏らした同型 fixture がないか確認する。
anchor sibling production behavior を変更せずに migration を完了できるかも明示する。
最終出力:
SubAgent B の完了を待つこと。
Phase 0R gate
両 SubAgent が
新規 required path は
scripts/agent-guards/tests/test_skill_runtime_exec_anchor.pytests/agent_guards/test_worktree_scope_guard.pyの2つだけ
anchor sibling production change は不要
schema/key/type contract の追加変更不要
で一致した場合のみ GO。
その場合、この2ファイルへの OWNER conditional approval を確定し、Issue #2311 の Allowed Paths / In Scope へ同一変更で追加してよい。
それ以外は STOP。
Phase 1 — Issue contract reconciliation
Phase 0R が GO の場合のみ実施する。
repository の既存 trusted human-context / contract-update mechanism が必要ならそれを使用し、human provenance を捏造しない。
Issue #2311 の Allowed Paths に、Phase 0R で確定した required test paths を追加する。
少なくとも:
scripts/agent-guards/tests/test_skill_runtime_exec_anchor.pytests/agent_guards/test_worktree_scope_guard.pyを追加する。
In Scope / AC / Verification では、この追加が bare
preflight.runcommand-contract migration に追随する fixture parity 修正であり、preflight.run.with_anchor等の sibling production wiring をworkflow_start_entry.pyへ変更するものではないことを明記する。
test_skill_runtime_policy_commands.pyが no-op の場合、それも「変更不要」と記録し、無理に変更しない。Phase 2 — implementation
Issue #2311 の最新 AC を正本として実装する。
特に command migration は atomic に行う。
A. command_registry.py
canonical bare
preflight.runの first-hop executable をrun_refinement_preflight.pyから
workflow_start_entry.pyへ変更する。
最終的な argv shape は Issue #2311 の current contract と完全一致させる。
anchor/human-context/agent-report sibling の argv は変更しない。
B. skill_runtime_command_policy.py
_EXPECTED_ARGV_BY_COMMAND["preflight.run"]を新しい canonical bare argv と exact match するよう同期する。exact comparison を緩和・prefix化・wildcard化しない。
他 command ID の argv contract を巻き込まない。
C. skill_runtime_exec.py
script integrity check を bare migration と同期する。
最低条件:
preflight.runが first-hopworkflow_start_entry.pyを検証するrun_refinement_preflight.pyを検証する意味を失わないdecide.runその他の既存 command-specific integrity target を回帰させないpreflight_script_invalid等の既存 error contract は必要がなければ維持「non-decide は全部 workflow_start_entry.py」のような粗い一般化は禁止。
D. workflow_start_entry.py / root_entry_router.py
Issue #2311 AC の通り実装する。
root_entry_router.capability_preflight_result()を実際に利用するblocked/ producer failure / malformed response は inner preflight を0回ready/degradedのみ innerrun_refinement_preflight.pyを trusted route でちょうど1回checks/reasonsを保持planned_operationssuperset を作らないE. affected test fixtures
Phase 0R で required と確定した fixture のみ変更する。
各 fixture では production migration と同じ bare
preflight.runargv を seed する。必要なら fixture-local
workflow_start_entry.pystub を追加し、既存 fakerun_refinement_preflight.pyへ forwarding するなどして、その test 本来の executor/write-policy/anchor regression intent を維持する。重要:
run_refinement_preflight.pyのままworkflow_start_entry.pyへ変更しないPhase 3 — verification
まず Issue #2311 に現在記載されている 全 Verification Commands を fresh に実行する。
その後、affected fixture regression を個別に実行する。少なくとも:
uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_policy_commands.py -vuv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_preflight_no_worktree.py -vuv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.py -vuv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_session_manifest_lifecycle.py -vuv run --locked pytest scripts/agent-guards/tests/test_guard_shadow_log_write_path_policy.py -vuv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_anchor.py -vuv run --locked pytest tests/agent_guards/test_worktree_scope_guard.py -vさらに Issue が要求する:
を実行する。
SKIP や fallback を PASS に昇格させない。
テスト後に changed-file inventory を取得し、全変更が最終 Allowed Paths 内であることを確認する。
また検索で以下を確認する。
preflight.runが旧 inner scriptを first-hop として残していないPhase 4 — fresh independent review
実装・検証完了後、別の read-only review SubAgent を foreground で起動すること。
background 禁止。
reviewer には少なくとも以下を敵対的に確認させる。
run_refinement_preflight.pybare first-hop fixture の取り残しreview SubAgent の完了を待つこと。
blocking finding があれば main agent が修正し、関連テストを再実行した後、fresh reviewer を再度 foreground で完了まで待つ。
blocking finding が0になるまで review 完了扱いにしない。
最終報告
最後に以下を簡潔に報告する。
test_skill_runtime_policy_commands.pyが no-op だったか追加 scope が Phase 0R で見つかった場合は、実装せずその path list と理由だけを報告して STOP する。
squne121 commentedon Aug 23, 2026
推奨判断
.claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.pyを追加承認し、Phase 0R をこれで閉じて実装再開 GO が妥当です。理由は明確です。このテストは
preflight.run.with_anchorの production wiring を変更するテストではなく、barepreflight.runの全 entry を_EXPECTED_PREFLIGHT_RUN_ENTRYと完全一致で snapshot しています。現在はその argv にrun_refinement_preflight.pyが固定されているため、#2311 の AC1 を正しく実装すれば確実に失敗します。anchor sibling 自体の argv は引き続きrun_refinement_preflight.pyのままでよく、変更対象は bare snapshot の canonical value と、それに伴って古くなる説明コメントだけです。さらに
_EXPECTED_PREFLIGHT_RUN_ENTRYをリポジトリ全体で確認すると、この exact snapshot は当該ファイルだけです。一般検索ではrun_refinement_preflight.py参照は多数ありますが、例えばtest_command_registry.pyは bare command のレンダリング可能性を検証するだけで script path を固定しておらず、test_step_0f_parent_owned_preflight.pyも SKILL 文言契約です。したがって、Phase 0R の両独立 SubAgent が「7件で打ち止め」と一致した判断を覆す根拠は見つかりませんでした。ここで Phase 0S のような全リポジトリ再探索をもう一度挟むのは非推奨です。すでに二重独立 inventory が完了しているので、これ以上は scope discovery loop 自体が作業を妨げます。OWNER decision として「7件目を承認し、7件を final finite migration set と確定」と明示して探索を閉じるべきです。なお文言上は「他7ファイルと同様」ではなく **「他6ファイルと同様」**です。
また、Issue 本文の現在の Allowed Paths は依然として元の5エントリだけなので、コードより先に Issue contract repair → fresh contract/refinement/allowed-path checks → implementation の順にする必要があります。Allowed Paths 外変更が Stop Condition であることも現行 Issue に残っています。
Claude Code については、現在の公式仕様では subagent はデフォルトで background になり得るため、この種の phase gate では
foregroundを明示するのが適切です。Foreground subagent は完了まで main conversation を block します。 ([Claude]1)以下をそのまま渡す構成を推奨します。
Claude Code 作業プロンプト — Issue #2311 final scope 承認・実装再開
対象リポジトリ:
squne121/loop-protocol対象 Issue:
https://github.com/squne121/loop-protocol/issues/2311OWNER decision
Phase 0R の結果に対する OWNER 判断を以下で確定する。
.claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.pyを Issue #2311 の Allowed Paths / In Scope に追加承認する。これにより Phase 0R の scope reconciliation は完了とし、追加の whole-repo scope discovery round は行わない。
Phase 0R の2つの独立 SubAgent が一致して報告した以下の 7 test files を final finite required-change test set と確定する。
scripts/agent-guards/tests/test_skill_runtime_preflight_no_worktree.pyscripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.pyscripts/agent-guards/tests/test_skill_runtime_exec_session_manifest_lifecycle.pyscripts/agent-guards/tests/test_guard_shadow_log_write_path_policy.pyscripts/agent-guards/tests/test_skill_runtime_exec_anchor.pytests/agent_guards/test_worktree_scope_guard.py.claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.pytest_skill_runtime_policy_commands.pyは Phase 0R で migration-specific change 不要と確定している。verification のため実行してよいが、変更目的で触らないこと。新規7件目について:
test_preflight_run_with_anchor.pyは anchor sibling production behavior の変更ではない。同ファイルの
_EXPECTED_PREFLIGHT_RUN_ENTRYが canonical barepreflight.runの完全 snapshot を保持しており、現在run_refinement_preflight.pyを固定しているため、#2311 の migration 後には必ず更新が必要になる fixture/snapshot parity 修正である。変更時は:
_EXPECTED_PREFLIGHT_RUN_ENTRY["argv"]の bare first-hop をworkflow_start_entry.pyに更新する。preflight.run.with_anchor自体の argv はrun_refinement_preflight.pyのまま維持する。以下の production delta についても過去の OWNER decision を確定事項として扱う。
scripts/agent-guards/skill_runtime_command_policy.pyscripts/agent-guards/skill_runtime_exec.pybare
preflight.runmigration は次の3 consumer を atomic に同期する。command_registry.pypreflight.runargvskill_runtime_command_policy.py_EXPECTED_ARGV_BY_COMMAND["preflight.run"]skill_runtime_exec.py三者とも bare
preflight.runについてworkflow_start_entry.pyを指すこと。anchor siblings、
preflight.run.fixture、その他既存 inner-preflight command は従来どおりrun_refinement_preflight.pyを first-hop とする。exact argv policy の一般化、prefix match、wildcard、任意 script 許可等への緩和は禁止する。
Phase 0F — final drift verification
repo-tracked file または Issue を変更する前に、親 Claude Code セッションから read-only SubAgent を1つ foreground で起動すること。
これは Phase 0R の whole-repo inventory をやり直すためではない。
目的は Phase 0R 完了時点から current HEAD が変化しておらず、確定済み finite scope がまだ成立していることだけを確認する drift check とする。
Background 実行は禁止する。
SubAgent が完全に終了し、main session が最終レポートを受け取るまで Issue mutation、コード編集、commit、PR作成へ進んではならない。
nested SubAgent delegation は禁止。
SubAgent は read-only で以下だけを確認する。
preflight.runはまだ旧 first-hop であり、本 Issue の migration が未実装である。skill_runtime_command_policy.pyとskill_runtime_exec.pyの既知 consumer contract が Phase 0R の結論から変化していない。.claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.pyの_EXPECTED_PREFLIGHT_RUN_ENTRYが barepreflight.runの旧 argv を snapshot している。広範な新規 architecture exploration や「念のため」の新しい scope discovery は行わない。
出力:
SubAgent の完了を待つこと。
HEAD drift により新しい required path が実際に発生していた場合のみ STOP する。
単なる検索ヒットや既知 no-op file は STOP 理由にしない。
Phase 1 — Issue #2311 contract repair
Phase 0F が GO の場合のみ実施する。
コード編集より先に Issue #2311 の contract を修復する。
既存 body を全面再生成せず、必要部分のみ最小変更する。
Final Allowed Paths
既存 Allowed Paths に必要な production/test paths を追加し、最終的に少なくとも以下を許可する。
test_skill_runtime_policy_commands.pyは verification-only とし、変更不要なら Allowed Paths を広げる目的で追加しない。In Scope / AC1
AC1 の migration が以下を atomic に同期することを明記する。
workflow_start_entry.pypreflight.runではworkflow_start_entry.pytest_preflight_run_with_anchor.pyの bare-entry snapshot → 新 canonical argv以下は変更しないことを明記する。
preflight.run.with_anchorpreflight.run.with_human_contextpreflight.run.with_agent_reportpreflight.run.fixturetest_preflight_run_with_anchor.pyの修正は anchor sibling wiring の変更ではなく bare snapshot parity migration と明記する。Verification contract
7 required test filesを verification surface に含める。
test_skill_runtime_policy_commands.pyは no-op regression verification として実行してよいが、変更を要求しない。Issue contract 更新後、repository workflow が要求する:
を fresh に再実行する。
fresh validation が green になるまで実装開始しない。
Phase 2 — implementation
fresh contract validation が green の場合のみコードを変更する。
Original #2311 behavior
Issue #2311 の最新 AC2〜AC10 を弱めず実装する。
特に:
workflow_start_entry.pyはroot_entry_router.capability_preflight_result()を実際に使用する。blocked/ producer failure / malformed result は innerrun_refinement_preflight.pyを0回。ready/degradedの場合のみ trusted route で inner preflight をちょうど1回。checks/reasonsを blocked result に保持する。planned_operationsを使い、static global superset を作らない。Atomic command migration
command_registry.py
bare
preflight.runの first-hop を:run_refinement_preflight.pyから:
workflow_start_entry.pyへ変更する。
sibling argv は変更しない。
skill_runtime_command_policy.py
_EXPECTED_ARGV_BY_COMMAND["preflight.run"]を新 canonical argv と byte-for-byte 一致させる。exact equality は維持する。
skill_runtime_exec.py
pre-dispatch script integrity target を最小差分で同期する。
概念上:
既存コード構造に合わせること。
generic argv parsing や任意 target acceptance に一般化しない。
Seven required fixture/test migrations
final required-change test set の7ファイルだけを migration parity のため変更する。
real executor fixture では必要に応じて fixture-local
workflow_start_entry.pyfirst-hop stub を seed し、そのテスト本来の write-policy/session/anchor/no-worktree 等の目的を維持する。production capability-preflight implementation を fixture ごとに複製しない。
test_skill_runtime_exec_anchor.pyでは bare command と anchor sibling を明確に区別する。tests/agent_guards/test_worktree_scope_guard.pyでも production exact policy と一致する bare argv を seed する。test_preflight_run_with_anchor.pyでは:_EXPECTED_PREFLIGHT_RUN_ENTRYの script path を新 canonical first-hop へ変更preflight.run.with_anchorの exact argv assertion はrun_refinement_preflight.pyのまま新しい8件目の migration-specific test fileは作らない。
必要な regression は上記7ファイルまたは既存
.claude/skills/issue-refinement-loop/scripts/tests/内へ置く。Phase 3 — verification
Issue #2311 に記載された全 Verification Commands を fresh に実行する。
その上で以下の focused regression を実行する。
さらに:
test_workflow_start_entry.py.claude/skills/issue-refinement-loop/tests/test_loop_handoff_contract.py.claude/skills/issue-refinement-loop/tests/test_thin_entrypoint.pyを実行する。
SKIP / xfail / fallback 成功を PASS に昇格しない。
test weakening で失敗を隠さない。
verification 後に検索で以下を確認する。
preflight.runの first-hop に stalerun_refinement_preflight.pyが残っていない。run_refinement_preflight.pyを維持。test_skill_runtime_policy_commands.pyは必要がなければ untouched。Phase 4 — fresh adversarial review SubAgent
実装・verification 完了後、親セッションから 別の read-only reviewer SubAgent を foreground で起動すること。
background 実行は禁止。
reviewer が完全に終了し、main session が最終 verdict を受け取るまで PR 作成へ進んではならない。
nested SubAgent delegationは禁止。
reviewerには Phase 0R の結論を正解として与えず、最新 Issue contract と actual diff/tests から独立レビューさせる。
最低限確認する事項:
preflight.runactual first-hop =workflow_start_entry.pyrun_refinement_preflight.pytest_preflight_run_with_anchor.pyが bare snapshotだけ更新し anchor sibling contractを変更していないことrun_refinement_preflight.pyassertion/fixture の取り残し出力:
APPROVE/REQUEST_CHANGESreviewer SubAgent の完了を必ず待つこと。
REQUEST_CHANGESの場合、final Allowed Paths 内で解決できる finding だけ修正し、affected tests と Issue全VCを再実行した後、fresh reviewer をもう一度 foreground で起動して完了まで待つ。新しい required path が必要なら勝手に追加せず STOP。
Phase 5 — branch / commit / PR
全 AC、tests、fresh reviewer が green の場合のみ進む。
現在の repository workflow に従って Issue #2311 用 branch/worktree で commit する。
open implementation PR がなければ PR を作成する。
PR body に最低限以下を記載する。
Closes #2311.claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.pyは bare snapshot parity のみであり anchor sibling production behavior は untouchedtest_skill_runtime_policy_commands.pyが no-op / untouched だったかmerge は行わない。
Stop Conditions
以下の場合のみ停止する。
単なる検索ヒット、verification-only file、docs reference は scope delta として扱わない。
最終報告
以下を簡潔に報告する。
test_skill_runtime_policy_commands.pyno-op/untouched 確認noneならnone)Phase を飛ばさないこと。特に各 foreground SubAgent の完了結果を受け取る前に次の Phase へ進んではならない。
この形なら、今回の7件目を承認しつつ、今後また「8件目が出るかもしれない」という理由だけで探索を繰り返すことを止められます。一方で、Phase 0R 後に main が実際に変化していた場合だけ drift verifier が STOP できるので、scope gate の意味も残ります。
squne121 commentedon Aug 23, 2026
推奨は、提示された 1〜3 のどれかをそのまま採るのではなく、**「Issue #2311 内で preflight 契約だけ修復して Phase 2 に進み、同じ PR で fixture を hermetic 化する」**です。
現在の #2311 は、問題の7テストをすでに Allowed Paths に含め、bare
preflight.runmigration に追随する migration-parity test として同一PRで更新する契約になっています。したがって、この fixture gap を別 Issue に切り出す必然性は薄いです。一方で、選択肢1の「baseline から失敗しているから無視して実装へ進む」もそのままでは勧めません。
issue-contract-reviewの現行契約ではregression_gateは pass → go、fail → blocked で、環境上 baseline 実行が適切でない検証にはpr_review_only/runtime_onlyという正式な defer 手段があります。赤い regression gate を人間判断だけで横断するより、ここを契約上正しく分類する方が後続の自動化を壊しません。またユーザーの原因分析は実コードとも整合します。代表 fixture の
_install_skill_runtime_exec_fixture()は production executor/policy と temp registry をコピーする一方、pyproject.tomlを seed していません。対照的に同じテスト群の大きな fixture はpyproject.tomlとuv.lockを明示的に seed しています。 現在の repo pin はuv==0.11.29で、CI の composite action も同じバージョンをastral-sh/setup-uvでセットアップしています。fixture 修正については、本番 resolver を緩和しないのが重要です。uv 公式にも
required-versionは実行時バージョン制約であり、managed=falseは project の自動 lock/sync を止めるための設定として定義されています。 ([Astral Docs]1) ([Astral Docs]2) 私の独立再現では[tool.uv]だけの最小ファイルでは.venv/uv.lockが生成されるケースがありましたが、最小[project]とmanaged=falseを併用すると生成されませんでした。したがって root の canonical pin を読み取って minimal temppyproject.tomlを生成する案を、実機の pinned uv 0.11.29 で先に検証させるのがよいです。pin の0.11.29を各テストへ直書きするのは避けます。したがって進行は、①2つの foreground SubAgent で原因・最小fixture修正・CI laneを独立確認 → ②OWNER directive として issue-refinement-loop を execute、人間再承認なしで実行 → ③7本を pre-implementation preflight だけ
pr_review_onlyに defer → ④fresh issue-contract-review が go になったら Phase 2 → ⑤まずfixtureを hermetic化し、7本を実際にローカル実行 → ⑥#2311本体実装 → ⑦全VC+CI+fresh reviewer が最も整合的です。Claude Code は現在 background subagent がデフォルトなので、今回の phase gate では foreground を明示する意味があります。公式仕様でも foreground subagent は完了まで main conversation を block します。 ([Claude]3)
Claude Code 作業プロンプト — Issue #2311 local uv fixture gap を契約修復して実装再開
対象リポジトリ:
squne121/loop-protocol対象 Issue:
https://github.com/squne121/loop-protocol/issues/2311OWNER decision
Issue #2311 の Phase 1 contract repair 後に fresh
issue-contract-review --mode executeがhuman_judgmentで停止した件について、以下を OWNER decision とする。今回確認された7件の regression-gate failure は、Issue #2311 の production implementation による regression ではなく、current
mainの未変更状態でも再現する pre-existing local fixture/environment gap である。原因は次の通り。
skill_runtime_exec.pyの trusteduvresolver は、hostedtoolcache 以外から解決されたuvについて repository の[tool.uv].required-versionと実バイナリを照合する。uvが real account home の~/.local/bin/uvから解決されるため、その exact-version validation path を通る。_install_skill_runtime_exec_fixture()は temporary repository にpyproject.tomlを seed していない。_required_uv_version()がNoneとなり、uv_version_mismatchで fail-closed する。mainのコード変更前から同じ failure が発生すること、instrumented repro でrequired_version=Noneになることは確認済み。pyproject.toml/uv.lockを seedしている。ただし、「pre-existing だから regression_gate failure を無視する」ことはしない。
現行
issue-contract-reviewの scope-class contract を維持し、このローカル環境で baseline regression gate として決定論的に実行できない7件については、pre-implementation contract review のみpr_review_onlyへ defer する。これはテスト免除ではない。
Phase 2 では対象 fixture 自体を hermetic に修正し、実装後には当該7テストをローカルで実際に実行する。さらに PR CI でも結果を確認する。
今回の判断について追加の人間承認を要求しないこと。
issue-refinement-loopは execute mode で実行してよい。この OWNER decision の範囲内の Issue contract mutation は人間再承認なしで実施すること。
新しい production scope、新しい Allowed Path、新しい schema/key/type contract が必要と判明した場合だけ STOP する。
新しい follow-up Issue は現時点では作成しない。
Phase 0E — independent environment/scope verification
repo-tracked file および Issue を変更する前に、2つの SubAgent を使用すること。
SubAgent execution contract
すべての SubAgent は foreground で起動する。
background にしない。
Claude Code の Agent invocation で指定可能なら
run_in_background: falseを明示する。各 SubAgent が完全に終了し、main session が最終結果を受領するまで、次の SubAgentまたは次Phaseへ進んではならない。
nested SubAgent delegation は禁止する。
SubAgent A — local uv / fixture root-cause verifier
read-only で実行する。
以下を current
mainと current local environment から独立に再確認する。1. production resolver
確認対象:
scripts/agent-guards/skill_runtime_exec.pypyproject.toml_resolve_trusted_executable("uv", ...)_trusted_toolchain_dirs("uv")_validate_trusted_executable_version()_required_uv_version()確認事項:
uvabsolute pathuv --version[tool.uv].required-versionpyproject.tomlが無い場合にrequired_version=Noneとなるかuv_version_mismatchになる call chain推測ではなく実行証跡を取る。
2. affected fixture inventory
Issue #2311 の現在の Scope Delta parity VC 7件を確認する。
少なくとも:
scripts/agent-guards/tests/test_skill_runtime_preflight_no_worktree.pyscripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.pyscripts/agent-guards/tests/test_skill_runtime_exec_session_manifest_lifecycle.pyscripts/agent-guards/tests/test_guard_shadow_log_write_path_policy.pyscripts/agent-guards/tests/test_skill_runtime_exec_anchor.pytests/agent_guards/test_worktree_scope_guard.py.claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.py各ファイルについて、
mainで実際に失敗するか_install_skill_runtime_exec_fixture相当を使うかpyproject.tomlを seedするかuv_version_mismatch/ missing required-version かを分類する。
「7件全部同じはず」と仮定しない。
3. minimal hermetic fixture experiment
production resolver は変更せず、scratch temporary directory のみを使って最小 fixture 案を検証する。
第一候補は、root
pyproject.tomlから canonical[tool.uv].required-versionを読み取り、temporary repo にテスト専用の最小pyproject.tomlを生成する方式。概念例:
重要:
==0.11.29等の version literal を各fixtureへ直書きしない。pyproject.tomlを SSOT とする。uv run python3 ...により.venv/uv.lock/ その他 unrelated file が生成されないことを確認する。uv syncが不要であることを確認する。managed = falseだけでは十分と決めつけず、actual pinned uv で確認すること。もしこの最小形が成立しなければ、既存の large fixture helper の
pyproject.toml/uv.lockseed pattern を調査する。ただしuv syncや full project materialization を7 fixtureへ機械的にコピーする前に、より小さい方法が存在しないことを示す。SubAgent A output
以下のみ返す。
SubAgent A の完了を待つこと。
SubAgent B — contract / CI adversarial verifier
SubAgent A 完了後に foreground で起動する。
A の結論を鵜呑みにせず独立に確認する。
1. Issue contract
Issue #2311 の最新:
を取得する。
確認事項:
preflight.runmigration-parity verification として同一PR更新対象になっているか2. issue-contract-review semantics
current repository の以下を読む。
.claude/skills/issue-contract-review/SKILL.md.claude/skills/issue-contract-review/references/vc-preflight.mdbaseline_vc_preflight.py確認する:
regression_gatefailure の正式な扱いpr_review_onlyの正式な marker syntaxverification_ownerdeferred_reasonsyntax は推測しない。current repository の parser/test を正本とする。
3. CI path
current workflow/composite action を確認する。
少なくとも:
.github/actions/setup-python-uv/action.ymlについて、
astral-sh/setup-uvが使用されていることを確認する。
「CIでは恐らくPASS」を最終証拠にしない。
PR 作成後の実 CI result を最終 verification に含められることを確認する。
SubAgent B output
pr_review_onlycontract syntaxSubAgent B の完了を待つこと。
Phase 0E gate
以下の場合のみ GO。
新しい production path または新しい test path が必要なら STOP。
単に current 7 files 内の test fixture implementation を修正するだけなら STOP しない。
Phase 1R — issue-refinement-loop execute
Phase 0E が GO なら、issue-refinement-loop を execute mode で実行する。
Human approval policy
この Phase について追加の人間承認は不要。
OWNER directive はこのプロンプト自体で与えられている。
issue-refinement-loop 内で human approval checkpoint に到達しても、判断対象が以下の bounded contract repair の範囲内なら自動的に OWNER-approved として続行する。
human provenance を捏造しない。
必要ならこの prompt を explicit OWNER directive source として扱う。
issue-refinement-loop SubAgents
issue-refinement-loop が SubAgent を利用する場合も foreground で実行する。
各 SubAgent の終了を待ってから次へ進む。
SubAgent が nested SubAgent を起動することは禁止。
Required contract repair
A. affected 7 commands の preflight scope
今回の local environment で baseline regression gate として決定論的に実行できない affected commands だけを、repository の canonical syntax を使って
pr_review_onlyへ変更する。
これは pre-implementation issue-contract-review における defer である。
baseline_fail_expectedへ変えてはならない。これらは実装前に fail することが仕様上期待される AC ではないためである。
B. defer reason / owner
current parser contract が要求する正式な形式で、
を設定する。
意味は次とする。
実フィールド名・marker placement は current repository implementation に従う。
C. Verification は削除しない
7 commands 自体を Issue から削除しない。
Phase 2/3 の mandatory verification surface として保持する。
Issue Notes / In Scope に、次を明記する。
D. fixture repair scope
existing affected test files の fixture helper に対して、
.venv/uv.lockwriteを起こさないという test-only repair を #2311 In Scope / Notes に追加する。
新しい Allowed Paths は追加しない。
E. production contract を弱めない
変更しない:
skill_runtime_exec.pyの trusted uv validation semanticspreflight.run.fixturePhase 1R.5 — fresh issue-contract-review
Issue mutation 完了後、fresh snapshot から
issue-contract-reviewを execute mode で再実行する。古い review result は再利用しない。
期待結果:
gohuman_judgmentまたはblockedの場合:same known local-uv cause
同じ7 parity VC がまだ baseline execution されている等、Phase 1R の contract repair が正しく反映されていない場合は、parser/marker placement を調査し、current contract syntax の範囲内で修正して再実行する。
この既知原因について人間へ再質問しない。
different/new cause
以下なら STOP。
goになるまで Phase 2 へ進まない。Phase 2 — implementation
fresh issue-contract-review が
goの場合のみコード変更する。Phase 2A — fixture hermeticity repair first
#2311 production migration より先に、affected fixture の local uv gap を current Allowed Paths 内で修正する。
SubAgent A が実証した最小方式を使う。
推奨優先順位:
pyproject.toml[project][tool.uv] managed = false.venv/ nouv.lock/ no network / nouv sync実機検証で成立した場合のみ採用。
version literal の複製は禁止。
例えば Python で root
pyproject.tomlをtomllibで読み、tool.uv.required-versionだけを取得して fixture config を生成する方式を優先する。
shared helper を新しい path に切り出すために Allowed Paths を増やしてはならない。
多少の small test-helper duplication の方が、この Issue では新しい production/test infrastructure scope を増やすより良い。
Phase 2A verification
production #2311 implementation を行う前に affected commands を実行する。
ここでは current production semantics + fixture-only repair の状態で、
uv_version_mismatchが消えること.venv/uv.lock等 unrelated writes が発生しないことを確認する。
本来 current-main で PASS すべき migration-neutral tests は PASS させる。
#2311 の first-hop migration 前提で expected baseline mismatch になるテストがあれば、その failure reason が #2311 intended delta そのものであることを明示する。
環境エラーと intended baseline fail を混同しない。
Phase 2B — original Issue #2311 implementation
最新 Issue body の AC を正本として実装する。
command migration
bare
preflight.runについて、以下3 consumer を atomic に同期する。command_registry.pyworkflow_start_entry.pyskill_runtime_command_policy.py_EXPECTED_ARGV_BY_COMMAND["preflight.run"]skill_runtime_exec.pypreflight.run→workflow_start_entry.pygeneric policy relaxation は禁止。
workflow start
Issue AC に従う。
root_entry_router.capability_preflight_result()を使用producer logic を duplicate しない
missing/malformed caller request は producer 前 fail-closed
blocked / producer failure / malformed result:
ready/degraded:
checks/reasonsを保持Step 0 result を Step 5 authorization として再利用しない
fixture first-hop migration
affected fixture は production bare command と同じ first-hop contract に更新する。
bare:
workflow_start_entry.pyanchor/human-context/agent-report sibling:
run_refinement_preflight.pyの境界を維持する。
fixture-local wrapper が必要な場合は最小 forwarding stub とし、capability producer implementation を各fixtureへ複製しない。
Phase 3 — verification
実装後、Issue #2311 の全 Verification Commands を fresh に確認する。
pr_review_onlyへ defer した7 commands も、この Phase ではスキップせず手動で実際に実行する。少なくとも:
Issue body に現在記載された no-op parity command が別にある場合も、その最新 contract に従う。
さらに:
を実施する。
判定:
uv_version_mismatchが再発 → failurePhase 4 — fresh adversarial reviewer SubAgent
implementation + local verification 完了後、別の reviewer SubAgent を foreground で起動する。
完了まで必ず待つ。
reviewer は read-only。
確認項目:
workflow_start_entry.py.venv/uv.lock等を unintended write しないこと出力:
REQUEST_CHANGES の場合、Allowed Paths 内で修正可能なものは修正し、affected verification を再実行してから 新しい reviewer SubAgent を foreground で起動し直す。
blocking finding が0になるまで review完了扱いにしない。
Phase 5 — PR / CI
既存 #2311 implementation PR があれば更新する。
無ければ repository workflow に従って作成する。
merge は行わない。
PR body には最低限:
Closes #2311pr_review_onlyにした理由を記載する。
CI
PR 作成後、relevant required CI jobs の実結果を確認する。
特に affected parity tests が実際に CI lane で実行されていることを確認する。
「setup-uv だから通るはず」では済ませない。
CI が失敗した場合はログを取得し、
へ分類する。
#2311 関連なら修正して再検証・fresh reviewerをやり直す。
CI evidence が取れる前に最終
APPROVE / readyと報告しない。Stop Conditions
次の場合だけ STOP して報告する。
以下は STOP 条件ではない。
required_version=None -> uv_version_mismatchpr_review_onlycontract repairこれらについて追加の人間承認を要求しない。
最終報告
以下の順で簡潔に報告する。
noneif none)Phaseを飛ばさないこと。
特に、各 foreground SubAgent の完了を必ず待ってから次Phaseへ進むこと。
この形なら、「既知の環境問題だからゲートを無視する」でも「本筋と別の Issue を増やす」でもなく、baseline preflight では正式に deferし、同じ #2311 実装内で fixture 自体を直して post-change では本当に7本を通す、という一貫した扱いになります。
squne121 commentedon Aug 23, 2026
implement-issue: 実装完了
.claude/worktrees/issue-2311-workflow-start-entryworktree-issue-2311-workflow-start-entryPhase 2A: fixture hermeticity 修正
対象 6 ファイルの fixture install helper(
_install_skill_runtime_exec_fixture/_install_lifecycle_fixture)に、rootpyproject.tomlの[tool.uv].required-versionを動的に読み取る最小pyproject.toml(managed = false、uv syncは呼ばない)を seed する処理を追加した。production の trusted-uvresolver semantics 自体は変更していない。修正後、6 ファイル全てで
uv_version_mismatchが解消し全 PASS:test_skill_runtime_preflight_no_worktree.py: 20 passedtest_skill_runtime_exec_unauthorized_write_path.py: 10 passedtest_skill_runtime_exec_session_manifest_lifecycle.py: 13 passedtest_guard_shadow_log_write_path_policy.py: 61 passed, 1 skippedtest_skill_runtime_exec_anchor.py: 8 passedtest_worktree_scope_guard.py: 238 passedPhase 2B: AC1 command migration(atomic)
3 consumer を同一 PR で atomic に同期した:
command_registry.py— barepreflight.runの canonical argv をworkflow_start_entry.pyに変更skill_runtime_command_policy.py—_EXPECTED_ARGV_BY_COMMAND["preflight.run"]を同期skill_runtime_exec.py— pre-dispatch integrity/symlink check を二分岐(decide.run/それ以外)から三分岐(decide.run/preflight.run/その他)に変更sibling の anchor-comment 駆動 profile(
.with_anchor/.with_human_context/.with_agent_report/.fixture/.fixture.with_human_context)の argv・first-hop は無変更。新規
workflow_start_entry.pyを実装:root_entry_router.capability_preflight_result()を実際に import して呼び出す(producer logic の複製なし)planned_operations等)の欠落/malformed は producer 呼び出し前に fail-closedrun_refinement_preflight.pyを 0 回起動sys.executable。hop 1 でskill_runtime_exec.pyが既に trusteduv経由で resolve 済み)経由で inner preflight をちょうど 1 回起動root_entry_router.pyに構造化結果(decision/checks/reasons)を返すcapability_preflight_result()を新設し、既存capability_preflight()は boolean adapter として後方互換維持(Step 5 の既存呼び出し元・既存テストtest_ac11_capability_preflight_blocked_stops_before_mutationを含め無回帰で PASS)。7 件の fixture/snapshot テスト(既存 6 ファイル +
test_preflight_run_with_anchor.py)の barepreflight.runfirst-hop を production 同様に migration。全 7 ファイル全 PASS(test_preflight_run_with_anchor.pyは 44/44)。全 Verification Commands 結果
AC1〜AC10、Scope Delta parity(8 コマンド)全て PASS。詳細は PR #2320 本文の「検証コマンド結果」セクションを参照。
Allowed Paths 準拠
変更ファイルは Issue 契約の Allowed Paths(14ファイル)と完全一致。Allowed Paths 外の変更は行っていない。
発見した問題
なし(Allowed Paths 外の周辺テストで pre-existing local
uv_version_mismatchfixture gap を複数観測したが、いずれも本 Issue のスコープ外ファイルであり、baseline main でも再現する既知の gap。詳細は PR #2320 本文参照)。後続: PR レビュー(pr-review-judge)→ マージ → post-merge-cleanup
fix: canonical bare preflight.run が常に blocked になる回帰を修正する (#2311)
fix: canonical preflight.run が capability request を消失するP0欠陥を修正する (#2311)
feat: canonical preflight.run に workflow capability preflight gate を配…
feat: runtime_smoke_test.sh に --scenario issue_to_impl を追加し統合 E2E を l…