Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Description
Source
- dedupe_key: "follow-up:squne121/loop-protocol:pr/2185:codex-execpolicy-matrix-mirror-update"
- Source PR: feat: cleanup executor に one-shot discard lane と compare-and-delete を追加する #2185 (merged, Closes 実装: 明示的人間確認で未公開 commit を one-shot cleanup executor から破棄する #1523)
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "PR #2185 で Claude 側 worktree_scope_guard.py に追加した materialize_cleanup_contract.py の --check/--consume allowlist を Codex CLI 側の execpolicy matrix にも鏡写しし、両エージェント経路の防御を対称にする"
change_kind: codeParent Issue
none(単独改善・PR #2185 の follow-up)
Parent Goal Ref
- Goal: 該当なし(親 Issue なし)
- Desired Destination: 該当なし(親 Issue なし)
Current Validated Scope
- scripts/ci/codex_execpolicy_matrix.py に
materialize_cleanup_contract.py --check(agent-allow)と--consume(agent-deny, human-only)の allow/deny ケースを追加 - scripts/ci/tests/test_codex_execpolicy_matrix.py / tests/codex/test_execpolicy_matrix.py に対応するテストケースを追加(既存の cleanup_exec.py 系ケースの構造を参照)
Remaining Parent Gaps
なし(本 Issue で追加した execpolicy matrix ケースをもって、PR #2185 が意図的に据え置いた follow-up は解消される想定)
Outcome
scripts/ci/codex_execpolicy_matrix.py に materialize_cleanup_contract.py --check(agent 発行 allow)と --consume(agent 発行 deny、human-only)の allow/deny ケースが追加され、対応する scripts/ci/tests/test_codex_execpolicy_matrix.py と tests/codex/test_execpolicy_matrix.py のテストが green になっている状態。これにより PR #2185 で Claude 側 worktree_scope_guard.py に追加された allowlist 形状(--check は bool_flags に含め agent-allow、--consume/--contract-id/--expected-contract-sha256 は allowlist から意図的に除外し agent-deny)が Codex CLI 側 execpolicy matrix にも鏡写しされる。
Runtime Verification Applicability
- decision: immediate
- reason: pinned Codex CLI binary で expected_execpolicy を実測する必要があり、静的検証のみでは完結しないため(下記 Stop Conditions 参照)
In Scope
scripts/ci/codex_execpolicy_matrix.pyのexecpolicy_case_definitionsに、materialize_cleanup_contract.py --check(agent-allow 相当)と--consume(agent-deny 相当、human-only)を模した argv ケースを追加する- 追加ケースの
expected_execpolicyは pinned Codex CLI 実測値に基づいて設定する(推測値を書かない。詳細は Stop Conditions 参照) scripts/ci/tests/test_codex_execpolicy_matrix.pyとtests/codex/test_execpolicy_matrix.pyに、新規ケースを検証する対応するテスト・fixture 更新を追加する- PR feat: cleanup executor に one-shot discard lane と compare-and-delete を追加する #2185 の
scripts/agent-guards/worktree_scope_guard.py(_AGENT_OPS_ARG_SPECS["scripts/agent-ops/materialize_cleanup_contract.py"])とtests/agent_guards/test_worktree_scope_guard.py(test_materialize_check_allowed_real_hook/test_materialize_consume_denied_real_hook)の allow/deny 形状を参照実装として、Codex 側ケースの意図(--checkallow /--consumedeny)を一致させる
Out of Scope
scripts/agent-guards/worktree_scope_guard.pyおよび Claude 側 hook の変更(PR feat: cleanup executor に one-shot discard lane と compare-and-delete を追加する #2185 で完了済み)materialize_cleanup_contract.py/cleanup_exec.py/cleanup_contract_v3.py本体のロジック変更- execpolicy matrix 全体のリファクタリング(既存ケースの再設計は行わない。新規ケース追加のみ)
.codex/rules/default.rulesの static rule 変更(execpolicy 実測結果次第で別途要否判断が必要になった場合は本 Issue のスコープ外とし、follow-up として扱う)
Acceptance Criteria
- AC1:
scripts/ci/codex_execpolicy_matrix.pyのexecpolicy_case_definitionsにmaterialize_cleanup_contract.py --checkを含む argv ケース(label にmaterialize_checkを含む)が追加されている - AC2:
scripts/ci/codex_execpolicy_matrix.pyのexecpolicy_case_definitionsにmaterialize_cleanup_contract.py --consumeを含む argv ケース(label にmaterialize_consumeを含む)が追加され、expected_guard_pairがdenyになっている - AC3:
scripts/ci/tests/test_codex_execpolicy_matrix.pyに AC1/AC2 で追加したケースに対応するテストが存在する - AC4:
tests/codex/test_execpolicy_matrix.pyが既存テストを壊さず PASS する
Verification Commands
# AC1
$ rg -c "materialize_check" scripts/ci/codex_execpolicy_matrix.py# AC2
$ rg -c "materialize_consume" scripts/ci/codex_execpolicy_matrix.py# AC3
$ rg -c "materialize_check" scripts/ci/tests/test_codex_execpolicy_matrix.py# AC3
$ rg -c "materialize_consume" scripts/ci/tests/test_codex_execpolicy_matrix.py# AC4
$ uv run --locked pytest tests/codex/test_execpolicy_matrix.py -q# AC4
$ uv run --locked pytest scripts/ci/tests/test_codex_execpolicy_matrix.py -qAllowed Paths
- scripts/ci/codex_execpolicy_matrix.py
- scripts/ci/tests/test_codex_execpolicy_matrix.py
- tests/codex/test_execpolicy_matrix.py
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- 環境/ツール前提条件: 本 Issue の AC1/AC2/AC5 は pinned Codex CLI バイナリ(
.codex配下の pin 定義に従うバージョン)が実装環境で利用可能であることを前提とする。pinned バイナリが用意できない環境ではexpected_execpolicyを推測で埋めず、直ちに作業を停止して人間に環境準備を依頼すること(PR feat: cleanup executor に one-shot discard lane と compare-and-delete を追加する #2185 でこの follow-up が据え置かれた理由そのものであり、同じ回避不能な制約が本 Issue にも適用される)
Required Skills
なし
Required Design References
- scripts/agent-guards/worktree_scope_guard.py(
_AGENT_OPS_ARG_SPECS["scripts/agent-ops/materialize_cleanup_contract.py"]— mirror 対象の allow/deny 形状) - tests/agent_guards/test_worktree_scope_guard.py(
test_materialize_check_allowed_real_hook/test_materialize_consume_denied_real_hook— mirror 対象のテスト意図) - docs/dev/agent-skill-boundaries.md
Scope Delta(任意)
N/A
Notes for Reviewer
- 重複チェック: overlap preflight(
check_issue_overlap.py)はdecision: overlap_requires_comment(reason_code: allowed_paths_overlap, policy_class: C1)を返した。候補は 実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601 / 実装: visual diff AI/VLM triage を非ブロッキング助言として分離する #1390 / 実装: playtest-log の JSON Schema / validator の追加 #420 / 実装: .claude/skills 配下スクリプトの executable bit を監査し CI guard を追加する #205(いずれも OPEN)だが、いずれもタイトル・スコープが本 Issue と無関係(scope_rollup.run統合、visual diff triage、playtest-log schema、executable bit 監査)で、scripts/ci/codex_execpolicy_matrix.py系ファイルへの実質的な同時変更ではないと判断した(false positive、fuzzy path match による誤検出)。non_conflict_reason: 対象ファイル群への競合する変更を主張する候補 Issue は存在しない。 - ラベル: このタスクは low-priority / non-blocking な follow-up である。実際の enforcement point は既に PR feat: cleanup executor に one-shot discard lane と compare-and-delete を追加する #2185 で Claude 側
worktree_scope_guard.pyに実装済みであり、本 Issue はセキュリティ上の穴の修正ではなく CI 側 execpolicy matrix の対称性確保が目的(独立 PR レビュアーによる評価済み)。 - pinned Codex CLI 実測ログの記録要求は、機械判定可能な単一コマンド VC を構成できないため AC 化せず、Stop Conditions の「環境/ツール前提条件」に記載した。実装者は PR 本文に実測ログ(コマンド・出力の抜粋)を残すこと。
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Activity
squne121 commentedon Aug 16, 2026
AI駆動開発におけるCodex CLI の運用は廃止する方針なので関連するGitHubイシューも順次クローズされていくべき認識です。
squne121 commentedon Aug 16, 2026
結論
#2188 は実装せず、
not_plannedでクローズするのが妥当です。指定 OWNER コメントは「AI駆動開発における Codex CLI 運用を廃止し、関連 Issue も順次クローズする」という明示的な最新方針です。 しかも既に #2154 が「Codex CLI 実行系を廃止して Claude Code dual-runtime へ移行する」migration authority であり、#2160 が Codex 固有 parity contract の除去、#2161 が Codex CLI asset/documentation の inventory-first retirement を担当しています。
敵対的に見ると、#2188 は「小さな follow-up」ではなく、廃止対象の runtime に新しい互換性契約と CI 保守負債を追加する Issue になっています。
敵対的レビュー
[P0] 最新の architecture authority と目的が正面衝突しています。
実装: codex execpolicy matrix に materialize_cleanup_contract.py の --check/--consume 許可・拒否ケースを追加する #2188 は
parent_issue: noneとし、「Claude と Codex の両エージェント経路の防御を対称にする」ことを goal に置いています。 しかし現在の destination はそもそも「Claude/Codex CLI の二経路を維持する」ことではありません。.claude/agentsを provider-neutral SSOT にして Codex-specific parity を除去し、その後.codex/**や Codex-specific bridge tests/runtime adapters を撤去する設計です。よって 実装: codex execpolicy matrix に materialize_cleanup_contract.py の --check/--consume 許可・拒否ケースを追加する #2188 の正しい後継先は implementation PR ではなく、実装: retire Codex CLI assets and documentation(Phase 3, Child 3 of #2154) #2161 の producer/consumer inventory に対象資産を登録することです。
[P0] 「防御を対称にする」という threat model が誤っています。
元の 実装: codex execpolicy gate を fail-open から fail-closed へ修正し、execpolicy と hook の責務境界を明確化する (#1137 Blocker10 follow-up) #1150 は Codex execpolicy を coarse routing layer と定義し、exact argv・cleanup contract・one-shot authorization は別の runtime guard が担う、と明確に分離しています。
.codex/rules/default.rules自身も rules を security boundary とみなさず、controlled executor の正確な argv/value 検査は runtime guard が実際の enforcement だと記述しています。OpenAI の現行設計も、技術的境界を sandbox に置き、rules/approval をその外側での実行判断に使う layered posture です。(OpenAI) Codex execpolicy matrix に同じ allow/deny 行を増やしても、PR feat: cleanup executor に one-shot discard lane と compare-and-delete を追加する #2185 の cleanup safety が強くなるわけではありません。
[P1] 「mirror」のテスト仕様が、実際の PR feat: cleanup executor に one-shot discard lane と compare-and-delete を追加する #2185 契約を mirror していません。
現行
worktree_scope_guard.pyは--checkだけを agent に許し、--consume、--contract-id、--expected-contract-sha256をすべて allowlist から除外しています。さらに--flag=value、duplicate flag、unknown flag、positionals も拒否します。 実装本体でも destructive--consumeは、事前発行された immutable contract の nonce と SHA-256 digest の双方が必要です。ところが 実装: codex execpolicy matrix に materialize_cleanup_contract.py の --check/--consume 許可・拒否ケースを追加する #2188 の AC は実質「
materialize_checkという label がある」「materialize_consumeがあって guard_pair=deny」という程度です。 これでは exact valid consume shape、digest binding、--flag=value、duplicate、unknown flag を再現しません。仮に 実装: codex execpolicy matrix に materialize_cleanup_contract.py の --check/--consume 許可・拒否ケースを追加する #2188 を残すなら AC 自体が不足しています。[P1] Runtime Verification contract が自己矛盾しています。
実装: codex execpolicy matrix に materialize_cleanup_contract.py の --check/--consume 許可・拒否ケースを追加する #2188 は「pinned Codex CLI で実測し、
expected_execpolicyを推測してはいけない」と要求する一方、Acceptance Criteria は AC1~AC4しかなく、Stop Conditions では存在しない AC5 を参照しています。さらに Verification Commands はrg -cと Python tests が主体で、実測 provenance の PR ログは AC にしていません。既存 matrix は version・package・native executable・SHA・raw JSON 等を machine-readable artifact に残せる設計です。 人間が PR 本文へログを貼る方式へ退化させる理由がありません。実装するなら「pinned binary artifact readback」を AC にすべきですが、今回は廃止対象なのでその投資自体を止めるべきです。
[P1] pinned binary の所在記述が誤っており、しかも古い版を新規 contract に固定しようとしています。
実装: codex execpolicy matrix に materialize_cleanup_contract.py の --check/--consume 許可・拒否ケースを追加する #2188 は「
.codex配下の pin 定義に従う」と書いていますが、currentmainの.codex/config.tomlに CLI version pin はありません。 実際の required CI lane は.github/workflows/ci.ymlで@openai/[email protected]/codex-cli 0.142.0を直接固定しています。OpenAI 公式 changelog では 2026年8月7日に 0.147.0 が公開済みで、0.142 系自体も 0.142.5 まで更新されています。([OpenAI Developers]2) 0.142.5 には Responses WebSocket payload の trace logging 修正もありますが、これは 実装: codex execpolicy matrix に materialize_cleanup_contract.py の --check/--consume 許可・拒否ケースを追加する #2188 の CI lane がその問題に直接さらされているという意味ではありません。重要なのは、0.142.0 が historical behavior snapshot になっていることです。廃止対象 runtime に対して、その古い挙動をさらに parity test として固定する合理性は低いです。
[P2] upstream semantics との乖離が進んでおり、legacy test の意味が曖昧です。
current OpenAI docs では
prefix_rule自体は positional exact-prefix ですが、単純なbash -lc/bash -cの compound command は tree-sitter で分解し、各 command を別々に評価して最も restrictive な結果を採用します。([OpenAI Developers]3) 一方 current repo の.rulesコメントは、bash -lcwrapper を別の blanketbash -> promptrule で処理する必要があるという、より古い execpolicy model を前提にしています。0.142.0 当時の挙動としてその説明が正しい可能性はありますが、現行 Codex 一般仕様として固定してはいけません。残すなら必ず「0.142.0 compatibility snapshot」と version-scope すべきです。しかし migration 方針上は retire の方が自然です。
PR #2185 の安全設計について
ここは #2188 と切り離すべきです。PR #2185 の OWNER security review で本当に問題になったのは、execpolicy parity ではなく、approval substitution、verification-to-destruction TOCTOU、branch の他 worktree 使用、exact human handoff といった destructive transaction の境界でした。
その方向性は Git 自身の primitive とも整合しています。
git worktree removeはデフォルトで dirty worktree を削除せず、force が必要です。git update-refは expected old OID を指定した compare-and-delete が可能で、ref value が変化していれば削除しません。([Git]4) この runtime revalidation + lock + non-force removal + CAS が cleanup の重要な防御であり、Codex execpolicy matrix はその代替にはなりません。推奨 disposition
#2188 は
closed / not_plannedとし、理由は「OWNER の Codex CLI retirement 方針および #2154/#2160/#2161 に superseded。PR #2185 の security boundary は Claude/runtime-independent cleanup implementation 側ですでに成立しており、legacy Codex parity の新規追加は行わない」とするのが最も整合的です。ただし、Codex 関連 Issue を一括で全部 close するのも誤りです。#2154、#2160、#2161 のように「Codex を廃止するために必要な migration/retirement Issue」は存続させる必要があります。#2161 の inventory には少なくとも
codex_execpolicy_matrix.py、その2系統の tests、.codex/rules/default.rules、codex-execpolicyCI job とその downstream verifier を producer/consumer として取り込んだ上で、zero-reference 化してから撤去するのが安全です。判定:
REQUEST_CHANGESではなく、Issue 自体をNOT_PLANNED / SUPERSEDEDにするレベルです。 #2188 の仕様を修正して実装を続けるより、#2161 の retirement contract を高品質化する方が現在の設計判断に一致します。GitHub 上の変更・コメント投稿・Issue クローズ操作は行っていません。
squne121 commentedon Aug 16, 2026
issue-refinement-loop 終了報告(#2188)
superseded_by_decisionauthor_association: OWNER、trusted)superseded_by_decision#2161が Phase 3 retirement inventory としてcodex_execpolicy_matrix.py系ファイルの producer/consumer 登録・zero-reference 化・撤去を担当)事実確認(repository evidence、この session で直接検証済み)
#2154(OPEN, delivery-rollup parent,closure_children: [2158, 2160, 2161]): goal は「Claude Code を共通 development harness とし Codex CLI 実行系を段階的に廃止する」#2160(OPEN, Phase 2, parent#2154):.claude/agents↔.codex/agentsparity を dual-provider portability contract へ置換#2161(OPEN, Phase 3, parent#2154): producer/consumer inventory 先行で Codex CLI asset/documentation を段階的撤去.codex/config.tomlに CLI version pin は存在しない(grep -n "version|pin"0 件)— 実装: codex execpolicy matrix に materialize_cleanup_contract.py の --check/--consume 許可・拒否ケースを追加する #2188 の Stop Conditions 記載(「.codex配下の pin 定義に従う」)は現状の repo と不整合.github/workflows/ci.ymlのcodex-execpolicyjob が@openai/[email protected]/codex-cli 0.142.0を直接固定(L3009-3010)— pin の実体は CI 側にあり、.codex/config.tomlではないscripts/agent-guards/worktree_scope_guard.pyのmaterialize_cleanup_contract.pyallow/deny 形状(--checkはbool_flagsに含め agent-allow、--consume/--contract-id/--expected-contract-sha256は allowlist から除外し agent-deny)は既に PR feat: cleanup executor に one-shot discard lane と compare-and-delete を追加する #2185 で実装済みであることを確認以上より、anchor comment の dispositive claim(#2154/#2160/#2161 の存在・scope、pin 記述の齟齬、PR #2185 の実装状況)はすべて repository 上で独立に確認でき、追加の外部 web 調査は不要と判断した。
結論
#2188はclosed / not_plannedとする。理由: OWNER の Codex CLI retirement 方針、および#2154/#2160/#2161に superseded。PR #2185 の security boundary(approval substitution・verification-to-destruction TOCTOU・branch の他 worktree 使用・exact human handoff 等)は Claude/runtime-independent cleanup 実装側で既に成立しており、廃止対象 runtime(Codex CLI execpolicy matrix)に新規の legacy parity 投資を追加しない。codex_execpolicy_matrix.py系ファイル(本 Issue が対象にしていたテストを含む)の producer/consumer inventory への登録・zero-reference 化・撤去は#2161のスコープで扱う。follow-up 新規起票は行わない(
#2161が既存 tracking issue として十分にカバーしている)。