Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: research
parent_issue: "none"
goal_ref: "#1526 (PR #2364) の runtime guard 修正が canonical control-plane 経路で pytest VC preflight を実際に復旧させたことを確認する"
change_kind: research-onlyParent Issue
なし(単独改善)
Outcome
PR #2364 の merge commit(cc5e3633d3992c0ff9ea99691a15332f39930179)を含む canonical main から、本 Issue(#2369)自身を対象として registry-defined bare preflight.run(command ID: preflight.run。呼び出しコマンドは LOOP_PLANNED_OPERATIONS_JSON='[{"phase":"canary_verification","actor_role":"orchestrator","operation":"preflight_run_self_canary","requires_mutation":false}]' uv run --locked python3 scripts/agent-guards/skill_runtime_exec.py --command-id preflight.run --issue-number 2369 --repo squne121/loop-protocol。.claude/skills/issue-refinement-loop/scripts/command_registry.py で定義、mutation: false / network_effect: github_read_only、内部的に workflow_start_entry.py を起動。workflow_start_entry.py の capability-request gate(#2311 / PR #2320 / PR #2328)は LOOP_PLANNED_OPERATIONS_JSON の1回限りの env var 宣言(non-empty JSON array)を必須とし、未宣言のまま実行すると CapabilityRequestError: planned_operations_missing により STATUS: blocked / exit code 2 で inner preflight に到達せず fail-closed する。上記の env var 宣言を付けることでこの gate を通過し、inner preflight が実際に起動することを本 Issue の canary 実行前に確認済み)を一度実行する。本 Issue に記載された focused pytest Verification Command は、上記の canonical executor 呼び出しに先立って(または同一手順内で)実行され、unauthorized_write_path を発生させず完了し、tested HEAD・command ID・exit code・canonical stdout/stderr・tracked tree delta を含む結果コメントが本 Issue に記録された状態を完了とする。Step 0f より後の refinement loop(reviewer 起動・本文書き換え・follow-up 起票・impl-review-loop 起動等)は実行しない。
In Scope
- canonical main(bootstrap bypass なし)から registry-defined bare
preflight.run(command ID を1つに固定、preflight.run.with_human_context等の別経路とは相当扱いしない)を本 Issue(調査: #1526 runtime guard 修正の canonical control-plane recovery を canary 検証する #2369)自身に対して一度実行し、unauthorized_write_pathで fail-close しないことを確認する - 本 Issue に記載された focused pytest regression(下記 Verification Commands)を実行し、結果を記録する
- 実行前後で tracked / staged repository content に差分がないことを確認する
- 上記の実行結果(PASS/FAIL/INCONCLUSIVE、tested HEAD、command ID、executor exit code、STATUS、NEXT_ACTION、関連 blocker、stdout/stderr)を本 Issue のコメントとして記録する
Out of Scope
- 実装: runtime guard が peer pytest nodeids を child write と誤帰属しないようにする #1526 の再実装や設計変更
- 進行中の別 Issue(実装: extension_surface_policy_matcher の has_match:false 経路に unknown_surface_policy セマンティクスを実装する #2339 等、実装 PR が既に存在するもの)を canary 対象にすること
- Step 0f より後段の
issue-refinement-loop(reviewer 起動・本文書き換え・child/follow-up Issue 作成・impl-review-loop起動)の実行 - canary 実行中に新たな regression が発見された場合、そのバグ自体の修正(別途 follow-up Issue を起票する)
.pytest_cacheの syscall attribution、cacheprovider 無効化、cache_dir の強制 relocation 等の追加 security harness(PR fix: runtime guard が repo-root .pytest_cache/** を peer pytest の disposable state として誤帰属しないようにする #2364 のレビューで不要と整理済み)
Acceptance Criteria
- AC1: PR fix: runtime guard が repo-root .pytest_cache/** を peer pytest の disposable state として誤帰属しないようにする #2364 の merge commit
cc5e3633d3992c0ff9ea99691a15332f39930179がリポジトリに存在する(git showで存在確認。本リポジトリは force-push/rebase を禁止する branch protection 下の単一 main であるため、履歴に存在する = 現在の HEAD の ancestor であることを意味する) - AC2(手動確認、詳細は Notes for Reviewer): canonical main root から registry-defined
preflight.runを本 Issue(調査: #1526 runtime guard 修正の canonical control-plane recovery を canary 検証する #2369)に対して一度だけ実行し、inner preflight(workflow_start_entry.py経由の実際の preflight 実行)が起動される - AC3: 本 Issue の focused pytest VC(
test_independent_pytest_process_writes_real_pytest_cache_and_is_permitted/test_pytest_cache_cold_start_temp_dir_race_is_permitted)が exit code 0 で完了し、executor output にunauthorized_write_pathが存在しない - AC4(手動確認、詳細は Notes for Reviewer): canary 前後で tracked / staged repository content に差分がない
- AC5(手動確認、詳細は Notes for Reviewer): PASS / FAIL / INCONCLUSIVE、tested HEAD、command ID、executor exit code、STATUS、NEXT_ACTION、関連 blocker、stdout/stderr が本 Issue のコメントに記録されている
Verification Commands
# AC1
# baseline-expect: pass
$ git show --no-patch --format=%H cc5e3633d3992c0ff9ea99691a15332f39930179
# AC2
# baseline-expect: pass
$ true
# AC3
# baseline-expect: pass
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_pytest_cache.py::test_independent_pytest_process_writes_real_pytest_cache_and_is_permitted scripts/agent-guards/tests/test_skill_runtime_exec_pytest_cache.py::test_pytest_cache_cold_start_temp_dir_race_is_permitted -q
# AC4
# baseline-expect: deferred
$ git diff --quiet HEAD
# AC5
# baseline-expect: pass
$ trueAllowed Paths
- tracked repository files: なし(変更しない)
- staged repository files: なし(変更しない)
- 想定される local generated state(許可された副作用):
.claude/artifacts/issue-refinement-loop/2369/**.pytest_cache/**- repo-root 直下の
pytest-cache-files-*一時ディレクトリ
- 許可される GitHub mutation:
- 本 Issue(調査: #1526 runtime guard 修正の canonical control-plane recovery を canary 検証する #2369)への canary result comment
- PASS 時の本 Issue(調査: #1526 runtime guard 修正の canonical control-plane recovery を canary 検証する #2369)の close
- 禁止事項:
- Issue 実装: extension_surface_policy_matcher の has_match:false 経路に unknown_surface_policy セマンティクスを実装する #2339 その他の Issue の本文・label・comment の変更
- child/follow-up Issue の自動作成
- implementation handoff
impl-review-loopの起動
Stop Conditions
- Outcome / Scope / AC が検索可能な形で記載されていない場合は即停止
- Allowed Paths 外への書き込みを試みた場合は即停止
- 権限不足(permission denied)により操作が完了できない場合は即停止
- 成果物の書き込みに失敗した場合(I/O エラー等)は即停止
- 判定が INCONCLUSIVE の場合、自動的に FAIL または follow-up Issue 化として扱わない(再現性と 実装: runtime guard が peer pytest nodeids を child write と誤帰属しないようにする #1526 との因果が確認できた場合のみ follow-up を起票する)
Handoff Contract
Current Objective: 実装: runtime guard が peer pytest nodeids を child write と誤帰属しないようにする #1526(PR fix: runtime guard が repo-root .pytest_cache/** を peer pytest の disposable state として誤帰属しないようにする #2364)の control-plane recovery を canonical 経路で実証するBounded Current Context: 実装: runtime guard が peer pytest nodeids を child write と誤帰属しないようにする #1526 修正内容は独立 SubAgent review 済みだが、main マージ後の canonical control-plane 経路での動作確認は未実施。実装: extension_surface_policy_matcher の has_match:false 経路に unknown_surface_policy セマンティクスを実装する #2339 は実装 PR feat: extension_surface_policy_matcher の has_match:false 経路を project-local unclassified candidate perimeter 限定の non-blocking advisory に再設計する #2370(OPEN、Closes #2339)が既に進行中のため canary 対象から除外した。Open Questions: なし(本 Issue 自身を canary にすることで解消)Next Action: canonical main root から本 Issue(調査: #1526 runtime guard 修正の canonical control-plane recovery を canary 検証する #2369)に対してLOOP_PLANNED_OPERATIONS_JSONの env var 宣言付きで registry-defined barepreflight.runを一度実行し(詳細は Outcome / Notes for Reviewer AC2 参照)、focused pytest VC の結果を本 Issue にコメント記録するArtifact Refs: fix: runtime guard が repo-root .pytest_cache/** を peer pytest の disposable state として誤帰属しないようにする #2364 、 実装: runtime guard が peer pytest nodeids を child write と誤帰属しないようにする #1526
Notes for Reviewer
- 判定は PASS / FAIL / INCONCLUSIVE の三値。GitHub auth/rate limit、wrong branch/checkout、merge commit 不在、capability request 不正、permission/runtime/dependency 環境不良、inner preflight 未起動などは INCONCLUSIVE とし、FAIL として自動的に follow-up Issue 化しない。
- 結果コメントは新しい schema/validator/publisher を作らず、fenced YAML(
result/tested_head_sha/required_merge_commit/required_merge_is_ancestor/target_issue/command_id/executor_exit_code/inner_preflight_invoked/status/next_action/unauthorized_write_path_observed/tracked_tree_changed)と実際の stdout/stderr で十分である。 - canary 実行中に regression が発見された場合は、本 Issue のスコープを超えるため別途 follow-up 実装 Issue を起票すること。
- AC2(手動確認):
preflight.run(command ID:preflight.run、呼び出しコマンドLOOP_PLANNED_OPERATIONS_JSON='[{"phase":"canary_verification","actor_role":"orchestrator","operation":"preflight_run_self_canary","requires_mutation":false}]' uv run --locked python3 scripts/agent-guards/skill_runtime_exec.py --command-id preflight.run --issue-number 2369 --repo squne121/loop-protocol、.claude/skills/issue-refinement-loop/scripts/command_registry.pyで定義、mutation: false/network_effect: github_read_only、内部的にworkflow_start_entry.pyを起動)は VC preflight allowlist(git read-only サブコマンドと pytest 限定)の対象外の自動化スクリプト実行であるため、Verification Commands 節の VC としては自動実行できない($ trueはプレースホルダ)。LOOP_PLANNED_OPERATIONS_JSONの env var 宣言を省略するとworkflow_start_entry.pyの capability-request gate(実装: issue-refinement-loop の Step 0 で workflow capability preflight をSubAgent起動前に実行する #2311 / PR feat: canonical preflight.run に workflow capability preflight gate を配線する #2320 / PR fix: preflight.run の blocked/malformed 経路の stdout を compact line grammar へ統一 #2328)によりCapabilityRequestError: planned_operations_missingでSTATUS: blocked(exit code 2)となり inner preflight に到達しないため、必ず上記の宣言を付けて実行すること。 実行者がこのコマンドを1回実行し、inner preflight が起動したことを exit code・STATUS/NEXT_ACTION 出力から目視確認すること。 - AC4(手動確認):
git diff --quiet HEADはbaseline-expect: deferredにより自動実行を保留している。canary 実行前後で tracked/staged repository content に差分がないことは、実行者が canary 実行の直前・直後にこのコマンド(またはgit status --porcelain)を手動で実行し、比較すること。 - AC5(手動確認):
$ trueはプレースホルダであり、自動検証コマンドを持たない。実行者が本 Issue への結果コメント(PASS/FAIL/INCONCLUSIVE、tested HEAD、command ID、exit code、STATUS、NEXT_ACTION、stdout/stderr を含む)投稿を目視で確認すること。
Source
- dedupe_key:
follow-up:squne121/loop-protocol:pr/2364:canary-control-plane - fix: runtime guard が repo-root .pytest_cache/** を peer pytest の disposable state として誤帰属しないようにする #2364
Activity
squne121 commentedon Aug 28, 2026
判定
REQUEST_CHANGES —
contract_update_required / reframe_in_placeIssue #2369 の目的自体は妥当です。PR #2364 はマージ済みで、
runtime guard修正を canonical control-plane 上で一度確認する価値があります。しかし、現在の契約をそのまま実行すると、canary が false-green になるか、進行中の Issue #2339 を不必要に変更する可能性が高いため、実行前にリフレームが必要です。現時点では #2369 に canary 結果コメントもありません。主要な指摘
優先度 | Finding | 影響 | 必須修正 -- | -- | -- | -- P0 | Verification Commands が AC1・AC2を検証していない | 実行前から成功する false-green | 実際の pytest VC と canonical preflight 実行結果を検証対象にする P0 | Step 0f の確認に full issue-refinement-loop を使っている | Issue 本文・ラベル・コメント・後続実装を変更し得る | preflight.run で停止する P0 | #2339 は既に PR #2370 で実装中 | live worktree/PR/契約更新と衝突する | #2339 を canary 対象から外す P1 | with_human_context と「相当経路」を同一視している | 何を証明したか不明確になる | command ID を一つに固定する P1 | tested HEAD・merge commit・exit code の記録がない | 古い main や無関係な実行でも PASS 扱いできる | provenance を AC に追加する P1 | PASS/FAIL 二値しかない | auth・rate limit・環境故障を regression と誤分類する | INCONCLUSIVE を追加する P1 | 「読み取り専用」と予定される書き込みが矛盾 | artifact/pytest cache/結果コメントが Stop Condition に触れる | tracked-source 非変更という意味に限定する P2 | regression test の説明が一部古い | 将来の調査で誤った前提になる | コメントだけ小さく修正するP0-1 — 現在の Verification Commands は完全に false-green
現在の AC1・AC2 は、実際には次のコマンドで検証される契約です。
しかし
gh issue viewは Issue のタイトル・本文・状態・コメントなどを表示するだけのコマンドです。preflight を実行せず、executor の exit code も、pytest VC の成否も、unauthorized_write_pathの有無も証明しません。(GitHub CLI)さらに #2339 には既に複数のレビューコメントが存在するため、
--json commentsは canary 未実行でも成功します。--json stateも Issue が OPEN であることしか確認しません。THIS_ISSUE_NUMBERについても置換規則が定義されていないため、記載どおりには実行不能です。これは AC の不足ではなく、現在の Verification Commands が canary 実行の有無を全く区別できないという blocker です。
P0-2 — full
issue-refinement-loopは canary として破壊範囲が広すぎるIssue #2369 が確認したいのは Step 0f の preflight recovery です。それにもかかわらず AC2 は、通常の
issue-refinement-loop全体を実行するよう要求しています。現在の
issue-refinement-loopは単なる read-only review ではありません。Step 0 で stale label を除去し得る
needs-fixなら Step 4 で Issue 本文を書き換えるStep 4.5 で child/follow-up Issue を作成し得る
approve 時は終了コメントを投稿し、条件次第で直ちに
impl-review-loopを起動するしたがって、Step 0f が通るかを確かめるために full loop を回すのは、診断対象より後段の副作用を大量に含む不適切な canaryです。後段 reviewer や GitHub mutation が失敗した場合、#1526 の regression なのか別の失敗なのかも区別できなくなります。
preflight.runは registry 上mutation: false、network_effect: github_read_onlyと定義されています。canary はこの command ID の完了時点で停止すべきです。P0-3 — #2339 は既に canary として失効している
Issue #2369 は #2339 を候補にしていますが、現在 #2339 には実装 PR #2370 が存在します。PR #2370 は OPEN・Draft で、明示的に
Closes #2339を持ち、複数回の OWNER review/fix_delta まで進行しています。つまり、
state: openだけでは canary 適格性を判定できません。最低でも次を除外条件にする必要があります。#2339 に full loop を再実行すると、既に調整済みの契約を再レビュー・再書換えしたり、PR #2370 と別の implementation handoff を作ったりする可能性があります。
P1-1 —
preflight.run.with_human_contextと barepreflight.runは「相当経路」ではないIssue は、
としていますが、現在の実装では両者の上位経路が異なります。
bare
preflight.runはworkflow_start_entry.pyを first hop とし、capability preflight を経由するpreflight.run.with_human_contextは exact anchor comment URL を必要とし、直接run_refinement_preflight.py側へ入るhuman-context profile は
--anchor-comment-urlと--human-context-comment-urlを同一 URL に束縛するruntime guard の snapshot 誤検知だけを検証するなら、どちらも共通の
skill_runtime_exec.pyを通るため一方で足ります。しかし「canonical control-plane 全体」を証明するなら、異なる経路を「相当」として扱うことはできません。今回の最小解は、bare
preflight.runに固定することです。human-context anchor の provenance、contract patch plan、origin lane といった無関係な変数を canary へ持ち込む必要はありません。P1-2 — 「読み取り専用」の意味が不正確
現在の Allowed Paths は「読み取り専用。リポジトリ変更なし」ですが、予定されている操作には次の書き込みがあります。
canonical preflight artifact
pytest の
.pytest_cache/**cold-start 時の一時的な
pytest-cache-files-*調査: #1526 runtime guard 修正の canonical control-plane recovery を canary 検証する #2369 への結果コメント
PASS 時に close するなら Issue state の変更
preflight registry 自体も
.claude/artifacts/issue-refinement-loop/{active_issue}/を allowed write root としています。したがって、契約は次のように書き換えるべきです。
「repo 内に一切書かない」と定義すると、今回確認したい修正が許可した
.pytest_cache自体と矛盾します。#1526/PR #2364 の技術判断
PR #2364 の最終的な実装方針は妥当です。マージ後の production code は、次を区別しています。
repo-root の
.pytest_cache/**:disposable state として除外repo-root 直下の
pytest-cache-files-*:pytest の atomic cold-start 用一時ディレクトリとして除外nested
sub/pytest-cache-files-*や.pytest_cache2/**:引き続き audit 対象tracked source や
.mypy_cache等:引き続き unauthorized writeこの境界は pytest の実装とも一致します。pytest の cacheprovider は既定で有効で、他の plugin も公開
config.cacheAPI に JSON 化可能な任意の値を保存できます。--cache-clearは通常は不要な cleanup option とされています。(pytestドキュメント)また pytest は cache directory を cold-start する際、
pytest-cache-files-prefix の一時ディレクトリを同じ親に作成し、supporting files を配置した後で target へ rename します。したがって top-level prefix の狭い例外は必要です。(pytestドキュメント)ここに追加の security harness は不要です。 以下は品質を上げるより、個人開発の通常フローを重くします。
process-level syscall attribution
strace/fanotify 監視cacheprovider の無効化
production
cache_dirの強制 relocation.pytest_cache内の key 単位 allowlistcache 用 ledger/receipt/schema validator
PR #2364 の review でも、必要だったのは exact temp prefix と真の sibling peer test までであり、それ以上の strict attribution は不要と整理されています。
小さな残存不整合
production comment は既に正しく、
lastfailedは保存値が変化した場合だけ書かれると説明しています。一方、regression test ファイルの冒頭コメントには、現在もnodeidsとlastfailedが「unconditionally」書かれるという古い説明が残っています。pytest 本体も
saved_lastfailed != self.lastfailedの場合だけcache.set()しています。(pytestドキュメント)これは canary blocker ではありません。次に当該 test を触る際、コメントだけ修正すれば十分です。専用 follow-up Issue や追加テストは不要です。
推奨する最小リフレーム
1. #2369 自身を canary にする
進行中の別 Issue を利用せず、#2369 の Verification Commands に focused pytest VC を持たせ、#2369 に対して bare
preflight.runを1回実行します。これにより、
unrelated implementation Issue を変更しない
canary の目的・VC・結果を1 Issue に閉じ込められる
Step 0f より後を実行しない
active PR collision 判定が不要になる
という利点があります。
2. Verification Commands の置換案
現在の
gh issue view3本は削除し、以下の focused regression のみにします。この2本は、PR review で問題になった真の sibling pytest process と cold-start temp directory race を直接扱う既存テストです。
full test file、repo 全体 test、full refinement loop は canary として不要です。
3. Outcome の置換案
4. Acceptance Criteria の置換案
AC2: canonical main root から registry-defined
preflight.runを Issue #2369 に対して一度だけ実行し、inner preflight が起動される
AC3: 調査: #1526 runtime guard 修正の canonical control-plane recovery を canary 検証する #2369 の focused pytest VC が exit code 0 で完了し、
executor output に
unauthorized_write_pathが存在しないAC4: canary 前後で tracked / staged repository content に差分がない
[ ] AC5: PASS / FAIL / INCONCLUSIVE、tested HEAD、command ID、executor exit code、STATUS、NEXT_ACTION、関連 blocker、
stdout/stderr が #2369 のコメントに記録されている
PR #2364 の merge commit は
cc5e3633d3992c0ff9ea99691a15332f39930179です。5. 結果判定を三値にする
PASS
required merge commit を含む正しい canonical main
inner preflight が実際に起動
focused pytest VC が成功
unauthorized_write_pathなしtracked tree delta なし
FAIL
正しい HEAD と canonical executor 経路で再現
pytest VC 実行中に
unauthorized_write_pathが発生または runtime guard 修正が原因で focused VC が失敗
INCONCLUSIVE
GitHub auth/rate limit
wrong branch/wrong checkout/merge commit 不在
capability request 不正
permission/runtime/dependency 環境不良
unrelated contract-readiness failure
inner preflight 未起動
INCONCLUSIVEを FAIL として自動的に follow-up Issue 化してはいけません。再現性と #1526 との因果が確認できた場合だけ follow-up を起票すべきです。6. 結果コメントの最小形式
新しい schema、validator、publisher は作らず、単純な fenced YAML と出力で十分です。
squne121 commentedon Aug 28, 2026
issue-refinement-loop 完了報告
判定: approved(go)
OWNER のレビューコメント(issuecomment-5453078382、
REQUEST_CHANGES — contract_update_required / reframe_in_place)を起点に、契約を全面リフレームしました。反映した変更点
Closes #2339)が進行中の Issue 実装: extension_surface_policy_matcher の has_match:false 経路に unknown_surface_policy セマンティクスを実装する #2339 を canary 対象から外し、本 Issue(調査: #1526 runtime guard 修正の canonical control-plane recovery を canary 検証する #2369)自身を canary にした。issue-refinement-loopの代わりに、mutation: false/network_effect: github_read_onlyの registry-defined barepreflight.runに限定した。gh issue view系(canary 実行有無を検証しない)を、AC ごとに個別に主張を検証するコマンド(git showによる merge commit 存在確認、focused pytest regression、git diff --quiet HEAD等)に差し替えた。preflight.runの呼び出しコマンドがworkflow_start_entry.pyの capability-request gate(LOOP_PLANNED_OPERATIONS_JSONの env var 宣言必須)を欠いており、そのまま実行するとCapabilityRequestError: planned_operations_missingで inner preflight に到達しない問題 → 実際にコマンドを実行して再現・修正後の成功を確認した上で、必須の env var 宣言を Outcome / AC2 / Notes for Reviewer に追記。baseline_vc_preflight.py)との整合:# trivially_pass:注記(静的 lint 専用)は実行エンジンに認識されないため、# baseline-expect: pass|deferredへ統一。AC4 はリポジトリ作業ディレクトリの無関係な既存汚染で false failure したためdeferred(手動の前後比較に委譲)とした。検証
run_root_review_pipeline.py produce:VERDICT: approve、blocker 0件。baseline_vc_preflight.py --strictの実ドライラン: 全 AC がgo(AC1/AC2/AC3/AC5: expected_pass、AC4: skipped/deferred)。assessment: clearに収束)。最終 body_sha256:
sha256:b7c7d0f328558883bbe66370b77fda6f69c8bc4435ee52a5358755821b38d82f本 Issue(research/standalone、
parent_issue: none)は refinement のみが対象であり、impl-review-loopへの自動 handoff は行いません。実際の canary 実行(preflight.runの起動・pytest VC 実行・結果コメント記録)は本 Issue の Outcome/Handoff Contract に記載された手順に従い、別途実行者が行ってください。squne121 commentedon Aug 28, 2026
確認した限り、#2369 は現在も OPEN の
research-onlyIssue で、契約はすでにリフレーム済みです。実施すべき本線は「#2369 自身に対して barepreflight.runを一度 canary 実行し、focused pytest・inner preflight・tracked/staged delta・stdout/stderr を証跡化し、PASS なら閉じる」です。直前のissue-refinement-loopもapproved (go)まで収束しており、実 canary だけが未実施です。前提となる PR #2364 はマージ済みで、merge commit は
cc5e3633d3992c0ff9ea99691a15332f39930179です。最終 head4be62fb...のcirun #5491 はsuccessまで到達しています。 調査時点のmainはf6ad7a09...まで進んでおり、以前 #2369 の canary 候補から除外された #2339 の PR #2370 も既にマージ済みです。また現在の
preflight.runは引き続きworkflow_start_entry.pyを first hop にしており、LOOP_PLANNED_OPERATIONS_JSONが欠けると inner preflight より前で fail-close する契約も現存します。 Claude Code の現行ドキュメント上、サブエージェントはAgenttool で起動し、foreground 実行ならメイン会話は完了までブロックされるため、下のプロンプトでは foreground 起動と完了待ちを明示しています。([Claude]1)そのまま Claude Code に渡せる形です。
対象リポジトリ:
squne121/loop-protocol対象 Issue: #2369
あなたはこの作業の root orchestrator です。このメッセージはオペレーターからの明示的な実行承認です。追加の人間承認を待たず、Issue #2369 の完了条件を満たすところまで自律的に進めてください。
調査時点では #2369 は
issue_kind: research/change_kind: research-onlyで、既にissue-refinement-loopがapproved (go)まで完了しています。目的は PR #2364 / Issue #1526 の runtime guard 修正を canonical control-plane で実証することです。PR #2364 は merge 済みで、required merge commit はcc5e3633d3992c0ff9ea99691a15332f39930179。ただし、この情報を固定前提にはせず、開始時に GitHub・origin/main・Issue 本文・コメント・CI・関連 PR を live に再取得してください。停止して人間に確認してよい条件は次の2種類だけです。 破壊的操作が必要になる場合、または秘密情報を扱う必要が生じる場合です。破壊的操作とは、force push、履歴書き換え、未保存作業を失う
reset --hard、無関係な branch/tag/Issue/PR/file の削除、branch protection の強制 bypass、未マージ作業を含む worktree の強制削除などを指します。秘密情報とは token、password、private key、GitHub Secrets、credential、.env等の secret value の閲覧・表示・コピー・送信を指します。通常の scoped edit、worktree/branch 作成、commit/push、Issue/PR/comment 作成、テスト、CI rerun、review 対応、通常の squash merge、完了済み Issue の close は承認済みであり停止理由にしないでください。secret をログや GitHub comment に露出させないでください。最初に live state を再構築する。
git fetch --prune originを行い、canonical repo root、current branch、HEAD、origin/main、worktree 一覧、tracked/staged/untracked state を確認してください。Issue 調査: #1526 runtime guard 修正の canonical control-plane recovery を canary 検証する #2369 の最新本文・全コメント、Issue 実装: runtime guard が peer pytest nodeids を child write と誤帰属しないようにする #1526、PR fix: runtime guard が repo-root .pytest_cache/** を peer pytest の disposable state として誤帰属しないようにする #2364 の diff・コメント・review・CI、調査: #1526 runtime guard 修正の canonical control-plane recovery を canary 検証する #2369 を参照する PR、関連する open PR、現在の main の CI 状況も確認してください。PR fix: runtime guard が repo-root .pytest_cache/** を peer pytest の disposable state として誤帰属しないようにする #2364 の merge commit が現在の canonical main の ancestor であることをgit merge-base --is-ancestor等で実証してください。ローカル main が単純に behind なら--ff-onlyで更新して構いません。既存作業を失う操作は禁止です。ここで必ず foreground SubAgent を起動し、その完了を待つ。 Claude Code の
Agenttool を使い、read-only の Explore 系 SubAgent に「調査: #1526 runtime guard 修正の canonical control-plane recovery を canary 検証する #2369、実装: runtime guard が peer pytest nodeids を child write と誤帰属しないようにする #1526、PR fix: runtime guard が repo-root .pytest_cache/** を peer pytest の disposable state として誤帰属しないようにする #2364、関連コメント、CI、command registry、workflow_start_entry.py、skill_runtime_exec.py、focused pytest tests、現在の main との差分」を独立調査させてください。background に投げっぱなしにせず foreground で完了を待ち、返却 report を読んでから次へ進んでください。メインスレッド自身の調査結果と矛盾があれば、実データで解消してください。部分結果だけで canary を開始しないでください。調査: #1526 runtime guard 修正の canonical control-plane recovery を canary 検証する #2369 の現契約を authoritative として canary 前提を確認する。 既に有効な canary result comment が存在して PASS 済みなら重複実行せず証跡を検証して close 状態まで確認してください。未実施なら続行してください。canary 前の tracked/staged state を保存し、少なくとも
git status --porcelain=v1、tracked diff、cached diff の before state を後で同一条件比較できる形で保持してください。既存の無関係な dirty state を勝手に消さないでください。focused regression を実行する。 現在の Issue 本文を再確認した上で、少なくとも以下を canonical main 上で実行してください。
exit code と出力を保存してください。
unauthorized_write_pathの有無を明示的に確認してください。preflight.runcanary を実行する。 Issue 調査: #1526 runtime guard 修正の canonical control-plane recovery を canary 検証する #2369 の最新本文に別の canonical command が明示されていない限り、次をそのまま使用してください。LOOP_PLANNED_OPERATIONS_JSONを省略してはいけません。LOOP_PLANNED_OPERATIONS_JSON='[{"phase":"canary_verification","actor_role":"orchestrator","operation":"preflight_run_self_canary","requires_mutation":false}]' \ uv run --locked python3 scripts/agent-guards/skill_runtime_exec.py \ --command-id preflight.run \ --issue-number 2369 \ --repo squne121/loop-protocolexecutor exit code、
STATUS、NEXT_ACTION、BLOCKERS、stdout、stderr を保存し、workflow_start_entry.pyを経て inner preflight が実際に起動したことを確認してください。初回 canary の結果を都合よく再分類するために無意味な再実行を繰り返さないでください。canary 後の repository state を before state と比較する。 tracked/staged content に canary 起因の delta がないことを確認してください。
.claude/artifacts/issue-refinement-loop/2369/**、.pytest_cache/**、repo-root のpytest-cache-files-*など契約で許可された generated/disposable state は tracked source delta と混同しないでください。独立した判定 SubAgent を foreground で起動し、必ず完了を待つ。 ここまでの raw evidence を渡し、PASS / FAIL / INCONCLUSIVE のどれに該当するか独立判定させてください。メインスレッドは report を鵜呑みにせず Issue AC と突き合わせて最終判定してください。PASS は required merge が ancestor、focused pytest 成功、inner preflight 起動、
unauthorized_write_pathなし、tracked/staged canary delta なしの場合です。FAIL は正しい canonical main と canonical executor 経路で 実装: runtime guard が peer pytest nodeids を child write と誤帰属しないようにする #1526 修正に因果的な regression が再現した場合だけです。auth/rate-limit、wrong checkout、capability-request 不正、dependency/runtime failure、inner preflight 未起動等は INCONCLUSIVE であり、コード regression と捏造しないでください。PASS なら PR は作らず 調査: #1526 runtime guard 修正の canonical control-plane recovery を canary 検証する #2369 を完了させる。 Issue 調査: #1526 runtime guard 修正の canonical control-plane recovery を canary 検証する #2369 に
## Canonical control-plane canary resultコメントを投稿し、fenced YAML でresult、tested_head_sha、required_merge_commit、required_merge_is_ancestor、target_issue、command_id、executor_exit_code、inner_preflight_invoked、status、next_action、unauthorized_write_path_observed、tracked_tree_changedを記録してください。その後に実際の stdout/stderr を、secret を含まないことを確認した上で添付してください。AC1〜AC5 がすべて成立したことを再確認し、Issue 調査: #1526 runtime guard 修正の canonical control-plane recovery を canary 検証する #2369 をcompletedとして close してください。コード変更や「念のため」の追加 harness は不要です。INCONCLUSIVE ならコード変更を捏造しない。 非破壊的に解消可能な auth/rate-limit/runtime/dependency/checkout 問題は自律的に調査・再確認してください。ただし secret の取得や branch protection bypass はしないでください。最終的にも外部条件により証明不能なら、調査: #1526 runtime guard 修正の canonical control-plane recovery を canary 検証する #2369 に INCONCLUSIVE の raw evidence を残し、Issue は open のままにしてください。これは人間承認待ちではなく、検証不能という事実上の terminal result として報告してください。
FAIL なら canary phase と修正 phase を分離し、その後は人間承認なしで修正を完遂する。 まず 調査: #1526 runtime guard 修正の canonical control-plane recovery を canary 検証する #2369 に FAIL 証跡を記録してください。調査: #1526 runtime guard 修正の canonical control-plane recovery を canary 検証する #2369 の canary 契約中は実装や
impl-review-loopを混在させません。その canary phase を終了した後、このオペレーター指示を別フェーズの明示 authorization として扱い、foreground の root-cause SubAgent を起動して完了を待ってください。再現性と 実装: runtime guard が peer pytest nodeids を child write と誤帰属しないようにする #1526/runtime-guard との因果を確認できた場合のみ、canonical Issue 作成手順で standalone implementation follow-up Issue を作成してください。新 Issue には 調査: #1526 runtime guard 修正の canonical control-plane recovery を canary 検証する #2369 / 実装: runtime guard が peer pytest nodeids を child write と誤帰属しないようにする #1526 / PR fix: runtime guard が repo-root .pytest_cache/** を peer pytest の disposable state として誤帰属しないようにする #2364 を provenance として結び、Outcome、In/Out of Scope、AC、Verification Commands、Allowed Paths、Delivery Rule を具体化してください。過剰な security harness は追加せず、通常ワークフローの有用性と回帰防止に必要な最小修正を優先してください。その follow-up Issue を
issue-refinement-loopで実装可能な契約まで収束させ、続けて repo-native のimpl-review-loop/implement-issueを使用して dedicated worktree/branch で実装してください。実装・検証・PR review はそれぞれ SubAgent に委譲し、各 SubAgent の終了を必ず待ってから次の Step に進んでください。PR は最初 Draft で構いませんが、本文に必ずCloses #<follow-up Issue番号>を含め、#2369 / #1526 / PR #2364 も関連資料として記載してください。PR 作成後は current head に対する focused tests、関連 regression、プロジェクト標準検証、GitHub Actions を確認し、review comments・inline threads・REQUEST_CHANGES をすべて回収してください。妥当な blocker は修正し、再テスト・push・再レビューを反復してください。CI failure が変更と無関係な一時的外部障害ならコードを歪めず rerun 等で evidence を取り直してください。reviewer が APPROVE、blocker が空、current-head CI が必要条件を満たし、live mergeability が正常になるまで終了しないでください。
通常の repo 手順に「PR は人間がマージ判断」とある場合でも、このセッションではこのオペレーター指示が追加承認に相当します。追加確認は要求しないでください。branch protection を bypass せず、force merge せず、リポジトリで許可される通常の merge method を使ってください。現状 squash merge のみが許可されているなら squash merge を使用してください。follow-up PR を merge 後、
Closes #Nにより follow-up Issue が閉じたことを確認し、閉じていなければ AC 達成を確認して正常 close してください。origin/mainを canonical root に反映し、調査: #1526 runtime guard 修正の canonical control-plane recovery を canary 検証する #2369 の focused regression と barepreflight.runを改めて実行してください。最初の FAIL と修正後 PASS を両方 provenance として残し、最終 canary が PASS した場合だけ 調査: #1526 runtime guard 修正の canonical control-plane recovery を canary 検証する #2369 に最終結果コメントを投稿して AC1〜AC5 を再確認し、調査: #1526 runtime guard 修正の canonical control-plane recovery を canary 検証する #2369 を close してください。作業終了時は、最終状態として tested main SHA、#2369 の verdict/state、作成した follow-up Issue/PR(存在する場合)、merge SHA、実行した主要テスト、CI 状態、処理した review blocker、残存 blocker の有無を簡潔に報告してください。「人間の確認待ち」で止めないでください。停止が許されるのは冒頭で定義した破壊的操作または秘密情報が必要な場合だけです。
この Issue については、正常系なら「実装→PR」には進まず canary PASS → コメント → close が正解です。コード変更フローは、canonical canary が再現可能な
FAILを出した場合だけ起動するようにしてあります。squne121 commentedon Aug 28, 2026
Canonical control-plane canary result
AC1: merge commit ancestor確認
現在の main HEAD (
f6ad7a09a92bdc24270407423a2c59119cdd05ac) は origin/main と同一(ahead/behind 0)。AC2: canonical bare
preflight.runcanary 実行実行コマンド:
executor exit code:
0stdout:
stderr: 空。
inner preflight (
workflow_start_entry.py) の実起動は、生成されたrefinement_preflight_result_v1.jsonの内容(live Issue #2369 本文のoriginal_updated_at: "2026-08-28T18:52:24Z"を実際に取得・処理、planner_exit_code: 0,blockers: [],status: pass)と、3成果物のファイルサイズ・mtimeが実行時刻と一致することで実証済み。AC3: focused pytest regression
exit code:
0。stdout/stderr全体を検索してもunauthorized_write_pathは出現しない。AC4: canary前後の tracked/staged 差分比較
canary実行前(
git status --porcelain=v1):(この2件は本canary着手前から存在した無関係な既存 dirty state)
canary実行後(
git status --porcelain=v1):git diff HEAD --stat/git diff --cached --statも canary前後で完全に同一。canary実行による新規 tracked/staged 差分はゼロ。.claude/artifacts/issue-refinement-loop/2369/**配下の生成物は Issue 契約上の許可された local generated state であり、tracked git内容には影響しない。独立判定
read-only の独立判定 SubAgent(本セッションの調査結果とは別プロセス)が上記 raw evidence を精査し、AC1〜AC4 すべて PASS、causal regression なしと判定した。
結論
AC1〜AC5 すべて成立(AC5は本コメント自体で充足)。PR #2364(#1526 修正)は canonical main・canonical control-plane 経路(registry-defined bare
preflight.run→workflow_start_entry.py)で正しく機能しており、.pytest_cache関連のunauthorized_write_path誤帰属は再現しない。本 Issue をcompletedとして close する。squne121 commentedon Aug 28, 2026
AC1〜AC5 すべて PASS。canonical control-plane canary(registry-defined bare
preflight.run→workflow_start_entry.py)で PR #2364(#1526 修正)が正しく機能していることを実証したため close します。詳細は上記の canary result コメントを参照。