Skip to content

feat: retire native Codex CLI assets and documentation - #2409

Merged
squne121 merged 13 commits into
mainfrom
worktree-issue-2161-retire-codex-cli-assets-and-documentatio
Aug 30, 2026
Merged

squne121 merged 13 commits into
mainfrom
worktree-issue-2161-retire-codex-cli-assets-and-documentatio

Conversation

@squne121

@squne121 squne121 commented Aug 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • native Codex CLI(.codex/**、Codex CLI subprocess 実行、Codex-specific parity/CI/checker)を repository から段階的に撤去する(Issue 実装: retire Codex CLI assets and documentation(Phase 3, Child 3 of #2154) #2161、parent 導入: Codex CLI 実行系を廃止し Claude Code dual-subscription runtime へ移行する #2154 Phase 3 Child 3)。
  • baseline: 132b08c257d6add00c51ff660761cb6e6c90bf53(main)。実装4コミット(1/n〜4/n)+ fix_delta 4回(本文下部「fix_delta iteration 4」節参照)+ main追随マージ複数回。現在158 files changed, +1817/-19146 lines(初期実装時点の76削除・2新規・残り修正に、fix_delta分の追加変更が加わったもの)。
  • native_codex_cli.disposition: retire、compatibility_preservation: not_required(OWNER Scope Delta 確定事項)。
  • scripts/claude-gpt/**、.claude/agents/**、.claude/settings.json、既存 claude-native/claude-gpt 挙動、provider-neutral runtime/agent authority は無傷(AC10 で確認済み)。

Implementation Order(実装順序)

  1. provider-neutral authority rescue: scripts/check_claude_codex_agent_parity.py を 1415→約500行の provider-neutral .claude/agents/*.md-only structural checker へ縮小(AgentParityFacts.nested_delegation_blocked 等の provider-neutral 機能は保持)。tests/fixtures/codex-agent-config/ → tests/fixtures/agent-config/ へ migrate。
  2. producer/consumer rewiring: CI topology(.github/ci/python-test-plan.json、scripts/ci/*.py、.github/workflows/ci.yml)、hook boundary checker、agent_ops_inventory を provider-neutral 化。
  3. native runtime/hook/CI consumer removal: check-codex-agents.mjs、check_codex_agent_config.py、scripts/session-recording/validate-codex-hooks.mjs、codex_execpolicy_matrix.py、SubAgent launch ledger DELETE_CHAIN 一式、run_worktree_agent_runtime_smoke.py/run_agent_provider_route_smoke.py の Codex lane を削除。
  4. .codex/** ディレクトリ全体削除。
  5. stale cleanup: --hidden 拡張スイープ(後述)で発見した .claude/**(hook/skill/hidden dir)配下の残存参照・orphan DELETE_CHAIN・stale artifact パスを一掃(4 コミット目)。

Scope-rollup / Runtime-smoke Codex lane 決定(OWNER Scope Delta 確定事項)

  • run_worktree_agent_runtime_smoke.py: codex_runtime_lane: delete、codex_session_scanning: delete(~/.codex/sessions/**/rollout-*.jsonl scan 撤去)、replacement_codex_scanner: do_not_create。--runtime 選択肢は ["claude"] のみ。claude-native / claude-gpt lane(引数・worktree isolation・timeout/process cleanup・postcondition verification・Herdr isolation)は無傷。
  • run_agent_provider_route_smoke.py: REQUIRED_ROUTES を 6→3(codex_cli route 除去)。claude_code route は無傷、Issue 実装: codebase-investigator / web-researcher の delegation request で AGY provider をメインルートにする #1886 artifact schema は変更なし。
  • 副次的に発見した genuine bug: preflight_requested_mutation_route() が stale .codex/agents/*.toml を参照していた(live caller 0件、regression ではなく既存バグ)。初期実装時点では .claude/agents/*.md の runtime_followup_route: 規約読み取りへ修正したが、この修正後も大半の .claude/agents/*.md が同規約を宣言せず実質的に機能しないままだったため、下記「fix_delta iteration 4」節の P1-2 で機構自体を完全削除した(修復ではなく削除、OWNER 明示指示)。

Launch Ledger DELETE_CHAIN(OWNER Scope Delta 確定事項)

SUBAGENT_LAUNCH_LEDGER_V1(artifacts/codex/subagent-launch-ledger.json)の唯一の live producer が scripts/check-codex-agents.mjs(本 Issue の削除対象そのもの)であり、他の非 Codex producer/consumer が存在しないことを証拠付きで確認済み(#2154 由来の Scope Delta)。以下を DELETE_CHAIN として同時削除:

  • scripts/subagent-launch-ledger-writer.c(C writer 本体)
  • scripts/check_subagent_launch_ledger.py(validator)
  • tests/test_subagent_launch_ledger_writer.py / tests/test_subagent_launch_ledger.py(regression test)
  • tests/fixtures/subagent-ledger/**(専用 fixture)
  • scripts/agent-guards/tests/test_skill_runtime_exec_subagent_ledger.py(全12テストケースが orphan 化することを確認済み)

scripts/agent-guards/skill_runtime_exec.py(4200行、125関数)はファイル全体を保持し、_LEDGER_STABLE_EXACT_REL 等 ledger 専用の typed exact-path special case・関連 helper 関数のみを削除した(provider-neutral な shared guard ロジックの大半は無傷)。

Provider-neutral Authority への移行(要約、Provider-neutral Authority Migration)

  • check_claude_codex_agent_parity.py: cross-provider 比較ロジックを全撤去し、.claude/agents/*.md のみを検証する structural checker へ縮小。resolve_mutation_class() / extract_claude_facts()(nested delegation 3値判定含む)/ check_asset_classification_complete/pairing() / check_duplicate_agent_names() は provider-neutral 機能として保持。--strict は互換性のため no-op で残置。
  • tests/fixtures/agent-config/expected-runtime-contract.json(新設): .codex 固有フィールドと spark-* エントリを除去した provider-neutral fixture。

CI Topology 変更

  • codex-execpolicy job を .github/workflows/ci.yml から削除。内部の non-Codex step 群(Generate CI_TEST_PERFORMANCE_ASSESSMENT_V2 artifact、e2e-performance-benchmark-assessment-gate steps)は python-test-core job へ移設(AC12/AC14 で存在確認)。
  • python-test aggregate job の needs を [python-test-core, codex-execpolicy] → [python-test-core] へ更新。
  • .github/ci/python-test-plan.json: secondary_coverage.dedicated_lanes[] から codex-execpolicy エントリを除去。tests/codex/test_local_main_branch_guard.py は dedicated lane を持たない通常の python-test-core target として実行される(AC11 で verify_python_test_lane.py exit 0 確認)。
  • scripts/ci/evaluate_python_test_aggregate.py: --codex-result 引数と codex_result 判定ロジックを除去(AC15 確認)。
  • scripts/ci/codex_execpolicy_matrix.py(job 実装本体)と scripts/ci/tests/test_codex_execpolicy_matrix.py を削除。
  • .claude/skills/pr-review-judge/scripts/ci_verdict_summary_v2.py: CLASSIFICATION_MAP / REQUIRED_CHECKS から ("ci", "codex-execpolicy") エントリを除去(未除去のまま job のみ削除されていた場合、ci-verdict-summary が永続的に no_required_evidence になる potential bug を本 PR で修正)。対応する tests/**(67 tests)も更新済み。

tests/codex/** の個別判定(AC17 evidence)

Allowed Paths の指示に従い、.codex/@openai/codex/check-codex への直接参照の有無だけでなく、テスト内容を個別確認した。

削除対象 DELETE(native Codex CLI 依存、8 files):

ファイル Codex-only 根拠
test_ci_test_performance_advisory.py(tests/codex 配下、hooks 配下の同名ファイルとは別) .codex/agents/ pattern 存在検証を含む
test_codex_hook_surface_guard.py .codex/hooks.json の structural validation を検証
test_codex_permission_profile_config.py .codex/config.toml の permission profile を検証
test_execpolicy_matrix.py codex_execpolicy_matrix.py(削除対象の job 実装本体)専用 regression test
test_fixture_repo_artifact_exclusion.py Codex fixture repo artifact exclusion ロジックを検証
test_root_temporary_residue_advisory.py .codex/ root residue advisory を検証
test_scope_rollup_runner_agent_config.py scripts/agent-guards/check_scope_rollup_runtime.py(唯一の consumer として同時削除)の Codex agent config 経路を検証
test_web_research_domain_allowlist.py Codex-specific web research domain allowlist を検証

MODIFY(provider-neutral ロジック、1 file):

  • test_local_main_branch_guard.py: guard 本体は provider-neutral(check_local_main_branch_state.py)だが、Codex-only な dedicated-lane isolation 前提のテストケースのみ調整。guard 検証ロジック自体は無傷。

RETAIN(provider-neutral ロジック、6 files):

  • test_cleanup_exec_branch_only.py(cleanup_exec 認可境界、provider 非依存)
  • test_run_scope_rollup_preflight.py / test_scope_rollup_graphql_pagination_v3.py / test_scope_rollup_run_exact_executor.py(scope-rollup 実行ロジック、Codex 非依存)
  • test_worktree_bootstrap_command_policy.py(worktree bootstrap policy、provider 非依存)

同様に tests/hooks/codex-*.test.ts は 4 files のうち codex-harness-advisory-allowlist.test.ts / codex-scope-rollup-capture.test.ts を削除(.codex/hooks/session-recording-composite.mjs 直接起動に依存)、codex-harness-workflow-gates.test.ts を調整、codex-harness-advisory-boundary/fail-open/recorder.test.ts 3 files は provider-neutral advisory recorder ロジックとして RETAIN。

参照解消・Negative Reference 分類(4 コミット目、--hidden 拡張スイープで発見)

AC5 の VC(rg -q -e "\.codex/" ... .)は ripgrep のデフォルト挙動により dot-directory(.claude/、.github/ 等)を走査しない ため、--hidden フラグ付きの補助スイープを別途実施し、AC5 の真の意図(repository 全体で native Codex CLI executable consumer が消えている状態)を満たすことを確認した。

修正(stale reference / orphan DELETE_CHAIN、mechanical な direct consequence として対応):

  • scripts/check_post_merge_cleanup_boundary.py / tests/test_post_merge_cleanup_boundary.py: 削除済み .codex/agents/post-merge-cleanup-worker.toml を parse する check_codex_skill_surface() / check_codex_no_stale_canonical()(CLI/CI dispatch caller 0件)と対応する4テストを orphan DELETE_CHAIN として除去。_DEFAULT_ARTIFACT_PATH の codex-structured → claude-structured(runtime-smoke harness の実際の artifact 命名規約変更に追随、genuine bug fix)。
  • .claude/skills/issue-refinement-loop/: run_root_review_pipeline.py の TOML-only 静的 checker check_agent_is_read_only_advisory()(Issue 実装: read-only issue-reviewer の producer I/O を root-owned に分離し、0-byte stdout も validator-first で分類する #2049 AC9、sole target file 削除済み、他の production caller 0件)を orphan DELETE_CHAIN として除去。command_registry.py / run_root_review_pipeline.py / review-issue/SKILL.md / issue-refinement-loop/SKILL.md の .codex/agents/issue-reviewer.toml 参照を .claude/agents/issue-reviewer.md へ更新。plan_refinement_loop.py の SECURITY_SENSITIVE_PATH_PREFIXES から dead .codex/agents/ エントリを除去(対応する test_scope_signal_guard_lane_split.py / scope-signal-guard.md も更新)。
  • .claude/hooks/ci_test_performance_advisory.sh / .claude/skills/ci-test-performance/{SKILL.md,references/decision-matrix.md}: dead .codex/agents/ path pattern entry を除去(対応するテストも更新)。
  • .claude/skills/post-merge-cleanup{,-executor}/SKILL.md、.claude/skills/impl-review-loop/steps/preparation.md、.gitignore: .codex/** を historical/reference note へ改訂(誤って現在形で存在を主張していた箇所を修正)。
  • docs/dev/directory-structure.md(.codex/ inventory entry を除去、AGENTS.md 説明を実態に合わせ更新)、docs/dev/github-ops.md(.codex/rules/default.rules を参照する execpolicy smoke check 例を撤去済みとして更新)、docs/dev/hook-boundaries.md(Codex CLI 判断表を historical framing へ改訂)、docs/dev/onboarding/session-recording-tool.md / docs/dev/session-recording-policy.md(pilot 手順を historical note へ改訂)。

Negative reference(provider-neutral / historical、意図的に RETAIN、substring 一致のみで削除しない):

  • .claude/scripts/check_session_recording_runtime_safety.py: .codex/hooks.json を含む 7 種の third-party agent-hook-file 規約(Claude/Codex/Cursor/Factory/Gemini/OpenCode/Pi)を汎用的に検出するロジックであり、native Codex CLI 固有ではない。
  • .claude/skills/issue-refinement-loop/tests/test_issue_1952_trusted_directive_regression.py: .codex/agents/issue-creator.toml 等は permission-delta 検出ロジックをテストする synthetic fixture 文字列であり、実ファイルを読まない。
  • .claude/skills/gemini-cli-headless-delegation/tests/test_run_gemini_headless_live_trial.py: ~/.codex/sessions は Issue 実装: local_asset_research route の live Serena MCP 応答待ちタイムアウトの信頼性を改善する #2015 の過去調査を記録する historical narrative comment。
  • docs/adr/agent-skill-surface-sharing.md: ADR は設計判断の歴史的記録として不変性を保つ慣行に従い、無編集で保持。
  • scripts/check_post_merge_cleanup_boundary.py の codex exec / claude -p 禁止 regex(_EXTERNAL_AGENT_CLI_INVOCATION_RE 等): raw agent CLI 起動を禁止する provider-neutral defensive governance check であり、native Codex CLI 撤去後もむしろ意義が強まるため無編集で保持。

(.claude/skills/issue-refinement-loop/scripts/reviewer_transport.py の "codex" backend adapter は、初期実装時点では上記 Negative Reference としてスコープ外・無変更としていたが、下記「fix_delta iteration 4」節の P1-1 で OWNER 敵対的レビューを受けて削除済み。本エントリはその変更を反映して削除した。)

Checks

Issue #2161 の Verification Commands(AC1〜AC18)全件の実行結果。

AC 内容 結果
AC1 .codex/ 削除 PASS
AC2 check_codex_agent_config.py / check-codex-agents.mjs 削除 PASS
AC3 ci.yml に codex-execpolicy 参照なし PASS
AC4 tests/fixtures/codex-agent-config/ 削除 PASS
AC5 repo 全体 zero-reference(--hidden 拡張スイープで補強確認、詳細は上記) PASS
AC6 pnpm typecheck PASS
AC7 pnpm lint PASS
AC8 pnpm test(1881 tests) PASS
AC9 pnpm build PASS
AC10 scripts/claude-gpt/test_*.py(74 tests) PASS
AC11 verify_python_test_lane.py PASS (exit 0)
AC12 Generate CI_TEST_PERFORMANCE_ASSESSMENT_V2 artifact step 存続確認 PASS
AC13 check_claude_codex_agent_parity.py PASS (exit 0)
AC14 Upload e2e-performance-benchmark-assessment-gate artifact step 存続確認 PASS
AC15 --codex-result 文字列なし PASS
AC16 test_evaluate_python_test_aggregate.py + test_verify_python_test_lane.py(45 tests) PASS
AC17 削除ファイルの Codex-only evidence(上記表) 記録済み
AC18 runtime-verification(下記) PASS

追加の広域回帰確認(Allowed Paths 外への波及がないことの確認):

  • .claude/skills/issue-refinement-loop/: 1930 passed / 4 failed(TestAuthorityTransportPrivilegedExecutorRealSubprocessDispatch 3件 + live smoke 1件、いずれも git stash でクリーン baseline に対しても同一の pre-existing 失敗であることを確認済み。本 PR の回帰ではない)
  • scripts/agent-guards/tests/: 1486 passed / 14 failed(すべて既知の pre-existing uv_version_mismatch 環境問題、本 PR の回帰ではない)
  • .claude/hooks/tests/: 844 passed / 1 failed(test_sentinel_not_in_artifacts は本 worktree に残存する別 Issue 実装: AGY fallback failure_class を capability_preflight_result へ渡す production 配線を issue-refinement-loop SKILL.md に追加する #2360 の untracked/gitignored artifact に起因する local-only 偽陽性、本 PR の diff・CI とは無関係)
  • tests/test_post_merge_cleanup_boundary.py: 53 passed
  • .claude/skills/pr-review-judge/scripts/tests/test_ci_verdict_summary_v2.py + tests/ci/test_ci_verdict_summary_lane_classification.py: 67 passed
  • scripts/ci/tests/: 112 passed

Runtime Verification Evidence(AC18 実行証跡)

=== Runtime Verification Log ===
AC: AC18 -- claude-native/claude-gpt runtime smoke regression subset (Issue #2161 native Codex CLI runtime lane retirement)
Timestamp: 2026-08-29T17:16:53Z
Environment: OS=Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.39; Python=3.12.3; claude_on_PATH=yes; node_on_PATH=yes; herdr_on_PATH=yes

--- Input ---
uv run --locked pytest scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke.py scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_causal_evidence.py scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_bin.py scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_bin_settings_channel.py scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_gpt_hermetic_matrix.py scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_gpt_live_causal_evidence.py scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_help_capability.py scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_herdr_isolation.py scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_operator_journey.py scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_runtime_evidence.py scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_spark_explicit_gate.py scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_workspace_snapshot.py scripts/agent-ops/tests/test_agent_provider_route_smoke.py -q --tb=short --junitxml=/tmp/ac18-junit-bxpy4eay/junit.xml

--- Output ---
........................................................................ [ 19%]
........................................................................ [ 39%]
........................................................................ [ 59%]
........................................................................ [ 79%]
........................................................................ [ 98%]
....                                                                     [100%]
364 passed in 114.85s (0:01:54)

--- Verdict ---
Result: PASS
Exit Code: 0
Reason: 364 passed, 0 skipped (legitimate internal SKIP), 0 failed out of 364

wrapper script: scripts/agent-ops/tests/run_runtime_verification_ac18.py(新規追加、Allowed Paths 記載どおり)。SKIP は exit 77、FAIL は exit 1、PASS は exit 0 で区別し、SKIP を PASS に昇格しない。証跡ログは artifacts/runtime-verification-AC18-<timestamp>.log(gitignored、PR には内容のみ転記)。

CI_TEST_PERFORMANCE_DECISION_V1

CI_TEST_PERFORMANCE_DECISION_V1:
  schema: CI_TEST_PERFORMANCE_DECISION_V1
  issue_number: 2161
  pr_number: null
  decision_scope: ci_change
  changed_paths:
    - ".github/workflows/ci.yml"
    - ".github/ci/python-test-plan.json"
    - "scripts/ci/evaluate_python_test_aggregate.py"
    - "scripts/ci/verify_python_test_lane.py"
    - "scripts/ci/verify_ci_check_conclusions.py"
    - ".claude/skills/pr-review-judge/scripts/ci_verdict_summary_v2.py"
    - "(他 151 files のうち上記 CI 直接関連分。詳細は diff 参照)"
  lane_classification:
    fast_static:
      applicable: true
      evidence:
        - "Ruff/ESLint 対象の .py/.ts ファイルを含む変更"
      required_commands:
        - "pnpm lint"
    python_unit:
      applicable: true
      evidence:
        - "scripts/**/*.py, tests/**/*.py の変更多数"
      required_commands:
        - "uv run --locked pytest(AC10/AC11/AC13/AC16/AC18 他、上表参照)"
    contract_artifact:
      applicable: true
      evidence:
        - ".github/ci/python-test-plan.json の secondary_coverage.dedicated_lanes 変更(AC11)"
        - "docs/dev/agent-skill-boundaries.md 等の SSOT 更新"
      required_commands:
        - "uv run python3 scripts/ci/verify_python_test_lane.py"
    integration:
      applicable: false
      evidence:
        - "src/**(ゲーム本体)は変更なし。e2e/vitest integration lane への影響なし"
      required_commands: []
  baseline_inputs:
    ci_runtime_baseline_v1_available: false
    run_count: 0
    p50_p95_ready: false
  artifact_consistency:
    ci_test_selection_v1_checked: true
    missing_pytest_args: []
  risk_flags: []
  reviewer_gate:
    approve_allowed: true
    required_evidence:
      - CI_CHECK_RUN_SCOPED

Schema Change Applicability

- decision: not_schema_change
  reason: >
    native Codex CLI asset・consumer の削除および provider-neutral checker への縮小であり、
    新規スキーマ・キー集合・型定義の追加/変更は行わない。SUBAGENT_LAUNCH_LEDGER_V1 と
    CODEX_ASSET_REMOVAL_INVENTORY_V1 はいずれも唯一の producer 撤去に伴う DELETE_CHAIN
    (契約の変更ではなく契約自体の廃止)。

Schema Consumer Inventory

N/A(not_schema_change のため、契約の新設・変更なし。DELETE_CHAIN 対象の契約は本文中「Launch Ledger DELETE_CHAIN」節に producer/consumer 一覧を記載)。

Safety Claim Matrix

Claim Implemented? Not controlled Evidence Follow-up
.github/workflows/ci.yml から codex-execpolicy job を削除しても ci-verdict-summary の merge-ready 計算が壊れない yes none AC3/AC11 PASS、ci_verdict_summary_v2.py の CLASSIFICATION_MAP/REQUIRED_CHECKS から該当エントリを同時除去し 67 tests で確認 -
.claude/skills/pr-review-judge/scripts/ci_verdict_summary_v2.py の REQUIRED_CHECKS 変更が既存 required check の判定を壊さない yes none TestP0_1AllRealCiJobsClassified 等の regression test group PASS(67/67) -
SubAgent launch ledger DELETE_CHAIN が他の非 Codex producer/consumer を巻き込んでいない yes none Scope Delta で証拠付き確認済み(check-codex-agents.mjs が唯一の live producer)。削除後、scripts/agent-guards/tests/ の関連 12 テストが orphan として同時削除され、残る 1486 tests は無傷 -
claude-native / claude-gpt の runtime smoke lane が Codex lane 削除の影響を受けない yes none AC18 で 364/364 PASS(--runtime codex 削除後も claude lane は不変) -
scripts/claude-gpt/** が本変更で無傷である yes none AC10 で 74/74 PASS -

fix_delta iteration 4(OWNER 敵対的レビュー対応、issuecomment-5465797624)

OWNER(squne121 本人)が #2409 (comment) で敵対的レビューを投稿し、「以下2件の P1 が直れば APPROVE 寄りに変える」と明言した。これを受けて以下を実施した:

  • P1-1(実施済み): .claude/skills/issue-refinement-loop/scripts/reviewer_transport.py に残存していた native Codex CLI executable backend(codex exec resume <session_id> を構築する "codex" backend)を削除。_KNOWN_BACKENDS から "codex" を除去し、codex 分岐を削除。専用テストを「rejection を assert」する形に更新し、claude/deterministic/fixture の既存カバレッジは無傷(関連48テスト全PASS)。代替 Codex adapter は作成していない。
  • P1-2(実施済み): scripts/agent-ops/run_worktree_agent_runtime_smoke.py の preflight_requested_mutation_route() を完全削除(修復ではなく削除、OWNER 明示指示)。.codex/agents/*.toml(runtime_followup_route: 宣言あり)から .claude/agents/*.md(ほとんど宣言なし)への参照先変更により実質的に壊れていた機構。CLI引数2つ・呼び出し箇所・専用定数(_RUNTIME_FOLLOWUP_ROUTE_RE/_TRANSACTION_ENTRYPOINTS)も削除。live caller 0件・専用テスト0件を確認済み。scripts/agent-ops/tests/ フルスイート843 passed / 1 skipped(退行なし)。
  • P2-1(実施済み、reviewer推奨の低コスト修正): scripts/check_claude_codex_agent_parity.py の agent discovery を glob("*.md") → rglob("*.md") に変更し、Claude Code の実際の再帰的 subagent discovery(サブディレクトリを含む)に一致させた。nested duplicate 検出の回帰テストを追加(tests/test_agent_parity.py、34テスト全PASS)。
  • P2-2(意図的に未実施): .claude/agents/issue-reviewer.md の "read-only" 表現の訂正を reviewer は推奨したが、.claude/agents/** は本 Issue の Allowed Paths で明示的に RETAIN 指定されており、かつ Issue 自身の Stop Conditions に .claude/agents/** 変更が明記されているため、worker は自己判断で変更せず revert し、人間判断が必要な項目として報告した。reviewer 自身も「3〜5のために Draft を長期間維持する必要はない」と明言しており、merge blocker ではない。
  • P3(意図的にスコープ外): --strict no-op flag・parse_known_args()の簡素化・checker のさらなる rename は reviewer 自身が「別PRでもよい」としたため未実施。

新規コミット: 775ad9ae(P1-1 + P1-2)、8094bb76(P2-1)。fix_delta後、AC1-AC18を再実行し全PASSを確認済み(AC18: 364/364 PASS)。reviewer_transport.pyと関連2テストファイルはIssue #2161の現行Allowed Pathsに明示列挙されていないが、OWNER本人がPRコメントで直接この変更を要求しており、Issue Outcome(native Codex CLI executable consumerの完全撤去)そのものを完成させる narrow scope の変更である。

Notes

本 PR は Issue #2161 を解消する: Closes #2161

Visual Impact Declaration(視覚影響の宣言)

schema: VISUAL_IMPACT_DECLARATION_V1
surfaces:
  - surface_id: combat-hud-critical
    disposition: verified_unchanged
  - surface_id: combat-hud-running
    disposition: verified_unchanged

visual-impact-policy gate が meta_policy_change として上記2 surface を検知したが、本 PR は src/**(ゲーム本体)を一切変更していない(git diff origin/main...HEAD --stat -- src/ は空)ため、両 surface とも verified_unchanged である。

Test and others added 5 commits August 30, 2026 00:31
…縮小する (#2161 1/n)

native Codex CLI retirement (#2161 Phase 3) の第一段として、
scripts/check_claude_codex_agent_parity.py から Codex agent TOML との
cross-provider 比較ロジック(extract_codex_facts / compare_parity /
SCHEMA_PARITY_001 / PERMISSION_BOUNDARY_001 / NESTED_DELEGATION_001 等)を
除去し、.claude/agents/*.md 単体の構造検証(frontmatter 整合性・
mutation_class 矛盾検出・asset_classification 完全性/pairing・重複名検出)
のみを行う checker へ縮小した。expected-runtime-contract.json から
.codex/agents/*.toml 系フィールド(path・default_permissions・
model_reasoning_effort・runtime_dependency_status・parity_mode・
permission_exclusion・spark-* codex_only エントリ)を除去し
provider-neutral な形へ移行。scripts/agent_ops_inventory.py の
Codex 専用 classification エントリ(.codex/ target_prefix・
CoverageTarget(".codex/agents/", ...)・codex_agent_definition/
codex_config 分岐)を除去した。

tests/test_agent_parity.py は縮小後の checker API に合わせて全面書き換え、
tests/test_agent_portability_contract.py・tests/test_agent_ops_inventory.py・
tests/test_issue_refinement_ops_review.py は Codex 専用アサーションのみ
除去した。

Co-Authored-By: Claude Sonnet 5 <[email protected]>
…2/n)

- `.codex/**` を無条件削除(AC1)。`scripts/check_codex_agent_config.py` /
  `scripts/check-codex-agents.mjs` を削除(AC2)
- `.github/workflows/ci.yml` から `codex-execpolicy` job を削除し、
  非 Codex な CI_TEST_PERFORMANCE_ASSESSMENT_V2 producer と
  e2e-performance-benchmark-assessment-gate steps を python-test-core へ
  移設。`python-test` aggregate の `needs` を `[python-test-core]` に更新し
  `scripts/ci/evaluate_python_test_aggregate.py` から `--codex-result` を除去
  (AC3/AC12/AC14/AC15)
- `scripts/ci/verify_python_test_lane.py` / `scripts/ci/verify_ci_check_conclusions.py`
  から codex-execpolicy job 固有の invariant/sentinel 検証を除去(AC11)
- `tests/fixtures/codex-agent-config/` を `tests/fixtures/agent-config/` へ
  migrate し、`.codex/agents/*.toml` 系フィールドを含まない provider-neutral
  な形にした上で旧ディレクトリを削除(AC4)
- SUBAGENT_LAUNCH_LEDGER_V1 DELETE_CHAIN(唯一の live producer だった
  check-codex-agents.mjs 削除に伴い、C writer・validator・fixture・
  scripts/agent-guards/skill_runtime_exec.py 内の ledger 専用 typed
  exact-path special case を撤去)
- 唯一の wiring 先だった `.codex/hooks.json` PreToolUse matcher が消えた
  ことで孤立した `scripts/agent-guards/codex_apply_patch_adapter.py` を削除
  し、`scripts/check_hook_boundaries.py` の Codex hook config 検証・
  `scripts/session-recording/validate-codex-hooks.mjs` を削除
- `tests/codex/**` は個別に内容確認し、native Codex CLI 資産に直接依存する
  ファイルのみ削除、provider-neutral なロジック(cleanup_exec・scope_rollup・
  worktree_bootstrap 等)を検証するファイルは維持
- `scripts/agent-guards/tests/test_rtk_*_policy.py` / `test_controlled_git_change_exec.py`
  から実 Codex CLI バイナリを呼ぶ execpolicy smoke のみ除去し、provider-neutral
  な executor authorization テストは維持

Co-Authored-By: Claude Sonnet 5 <[email protected]>
… から撤去する (#2161 3/n)

- `scripts/agent-ops/run_worktree_agent_runtime_smoke.py` から native Codex
  CLI の `--runtime codex` 選択肢・`codex exec` subprocess 起動
  (`run_structured_codex`)・`~/.codex/sessions/**/rollout-*.jsonl` scan
  (`extract_codex_child_session_id` 等)・`classify_codex_events`・
  `preflight_codex_flags` を削除し、claude(native)/claude-gpt lane の挙動・
  引数は変更しない。`preflight_requested_mutation_route()` の canonical
  route 参照先を削除済みの `.codex/agents/*.toml` から `.claude/agents/*.md`
  へ修正(実呼び出し元はゼロだが latent bug だったため)
- `scripts/agent-ops/run_agent_provider_route_smoke.py` から `codex_cli`
  runtime route の enumeration・dispatch ロジックを削除し、`claude_code`
  route のみ残す(Issue #1886 artifact schema 自体は変更しない)
- 対応する `scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke*.py`・
  `test_agent_provider_route_smoke.py`・`test_route_smoke_deadline_and_poll.py`
  から Codex-only test case のみ削除し、claude-native lane のテストは維持
  (AC18 の runtime verification 対象として使用する)
- `.codex/**` 撤去に伴い孤立した `scripts/agent-guards/check_scope_rollup_runtime.py`・
  `scripts/check_impl_review_loop_codex_dispatch.py`・
  `scripts/verify_codex_agent_model_refresh_evidence.py` と対応する test を削除

Co-Authored-By: Claude Sonnet 5 <[email protected]>
producer/consumer inventory (--hidden 拡張スイープ) で発見した codex-execpolicy
CLASSIFICATION_MAP/REQUIRED_CHECKS 残留、issue-refinement-loop / post-merge-cleanup
系の .codex/agents/*.toml DELETE_CHAIN orphan、ci-test-performance / hooks の
dead pattern entry、docs の stale setup 手順を除去し、AC18 runtime-verification
wrapper を追加する。

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Mechanical auto-merge; only overlapping file was
.claude/skills/worktree-agent-runtime-smoke/SKILL.md, resolved without
conflict markers (additive changes in different sections).
@github-actions

github-actions Bot commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Preview URL

Preview removed (PR #2409 closed).

…ty checker (#2161 fix_delta)

adversarial review iteration-1 flagged two Ruff blockers that broke
python-test-core CI:

- F821 undefined name `check_agent_is_read_only_advisory` in
  run_root_review_pipeline.py:1620. The prior orphan DELETE_CHAIN
  removed the function but left its caller `_cmd_check_agent_contract()`
  and the `check-agent-contract` argparse subcommand wired to it. Both
  are now removed as the direct mechanical consequence of the function's
  removal (no other production caller; sole target `.codex/agents/*.toml`
  already deleted earlier in this PR).
- E501 line too long in check_claude_codex_agent_parity.py:669. Wrapped
  the `claude_permission_mode` guard condition across multiple lines.

Verified: `uv run ruff check .claude/scripts scripts schemas .claude/skills`
(the exact CI python-test-core scope) is clean; AC1-AC18 from the live
Issue #2161 body all pass (pnpm typecheck/lint/test/build,
scripts/claude-gpt/test_*.py, scripts/ci/tests/*, the full
issue-refinement-loop test suite, and the AC18 runtime verification
smoke).
@squne121

Copy link
Copy Markdown
Owner Author

fix_delta 適用完了(adversarial review iteration-1 REQUEST_CHANGES 対応)

new head: 4643dfc6(旧 head 9ce89313 から)

修正内容

  1. F821 Undefined name check_agent_is_read_only_advisory(.claude/skills/issue-refinement-loop/scripts/run_root_review_pipeline.py:1620): 先行コミットの orphan DELETE_CHAIN クリーンアップで関数本体は削除済みだったが、呼び出し元 _cmd_check_agent_contract() と argparse の check-agent-contract サブコマンド登録(p_contract 一式)、CLI help テキストの該当ブロックが dangling のまま残っていた。これらを機械的な直接帰結として削除。rg -n "check_agent_is_read_only_advisory|check-agent-contract" で repo 全体を再検索し、他に live な参照がないことを確認済み(残る2件は撤去理由を説明する historical comment のみ)。
  2. E501 line too long(scripts/check_claude_codex_agent_parity.py:669, 131>120桁): claude_permission_mode の条件式を複数行に整形。

検証結果

  • uv run ruff check .claude/scripts scripts schemas .claude/skills(CI python-test-core job と同一スコープ): 全 pass(新規エラーなし)
  • Issue 実装: retire Codex CLI assets and documentation(Phase 3, Child 3 of #2154) #2161 本文 VC AC1-AC18 を再実行し全 PASS:
    • AC1-AC5, AC11-AC15, AC17: 静的検証 PASS
    • AC6 pnpm typecheck: PASS
    • AC7 pnpm lint: PASS
    • AC8 pnpm test: 1881 tests PASS(109 files)
    • AC9 pnpm build: PASS
    • AC10 uv run --locked pytest scripts/claude-gpt/test_*.py: 74 passed
    • AC16 uv run --locked pytest scripts/ci/tests/test_evaluate_python_test_aggregate.py scripts/ci/tests/test_verify_python_test_lane.py: 45 passed
    • AC18 runtime verification(scripts/agent-ops/tests/run_runtime_verification_ac18.py): exit 0
  • run_root_review_pipeline.py を参照する issue-refinement-loop の関連テスト一式(test_ac1_live_issue_no_environment_failure.py / test_root_review_pipeline_readback_v2_ssot.py / test_canonical_step2_route_wiring.py / test_issue_reviewer_contract_static.py / test_reviewer_transport_environment_failure_regression.py / test_review_budget_wiring.py / test_reviewer_transport_deadline_matches_vc_worst_case.py / test_root_review_canonical_delivery.py): 138 passed

スコープはブロッカー2件とその直接的な機械的帰結(dangling caller/subparser の削除)のみに限定し、それ以外の拡張は行っていません。

#2161 fix_delta 2/n)

- docs/dev/agent-skill-boundaries.md: reword the Manual Spark Agents
  heading to raise its Japanese-character density above the PR Body
  Japanese Check threshold (0.339, was 0.088).
- artifacts/claude-code-spawn-observability-research/code-analysis.md:
  update run_agent_provider_route_smoke.py:<line> citations that
  drifted by -1 after this PR's native codex_cli route removal shifted
  every line in the failure ladder.
- artifacts/claude-code-spawn-observability-research/tests/_research_contract_support.py:
  same -1 correction to PRODUCTION_FAILURE_LADDER, the fixture that
  independently hardcodes the same citations used to slice the
  production source in tests.
- artifacts/claude-code-spawn-observability-research/retry-policy-assessment.md:
  add an Issue #2161 update note recording that the codex_cli-specific
  spawn_not_observed bounded-retry branch this assessment originally
  evaluated was retired; the keep_excluded verdict is unaffected.
- artifacts/claude-code-spawn-observability-research/tests/test_retry_policy_assessment_contract.py:
  update the predicate-shape assertion to match the current,
  runtime-independent _is_transient_infrastructure_candidate() body
  instead of asserting the retired codex_cli-conditional literal.
@squne121

Copy link
Copy Markdown
Owner Author

fix_delta iteration 2(両 CI failure をローカル再現後に修正・head d4007711)

A. PR Body Japanese Check FAILURE — docs/dev/agent-skill-boundaries.md の見出し
## Manual Spark Agents の撤去(Issue #2161) が日本語比率不足(jp=3/total=34=0.088 < 0.1)でローカル再現。
見出しを ## Manual Spark Agents の撤去(手動 Spark エージェントの撤去、Issue #2161 で削除済み) に改訂し、
validate_japanese_content.py --threshold 0.1 で ratio=0.339・exit 0 を確認。他の見出し/本文は無変更。

B. python-test / python-test-core FAILURE — artifacts/claude-code-spawn-observability-research/tests/ の
10 テスト failure をローカル再現後に修正。

  • B1(9 failure): code-analysis.md が run_agent_provider_route_smoke.py の各行を引用する
    failure ladder の行番号citationが、このPRの native codex_cli route 撤去でソース側が -1 行シフトしたため
    drift していた。code-analysis.md の該当 9 行citation(911→910 … 935→934、および table10行目 938→937、
    range citation 911-940→910-939)を現在のソース実体に合わせて再計算・修正。
    同じ行番号を独立に保持していた test fixture
    tests/_research_contract_support.py の PRODUCTION_FAILURE_LADDER も同一の drift を抱えていたため
    同様に修正(このタプルがテストのソース行読み取りに直接使われるため、doc 側だけの修正では test は通らない)。
  • B2(1 failure): tests/test_retry_policy_assessment_contract.py::test_names_the_real_production_predicate が
    route["runtime"] == "codex_cli" という、このPRで正当に撤去された(OWNER Decision: native_codex_cli.disposition: retire)
    コード片の存在を production source に対して直接assertしていたため恒久的に false になっていた。
    retry-policy-assessment.md に Issue 実装: retire Codex CLI assets and documentation(Phase 3, Child 3 of #2154) #2161 update note を追加し、
    「本評価は元々 codex_cli 限定の bounded-retry 分岐を評価対象としていたが、その分岐は Issue 実装: retire Codex CLI assets and documentation(Phase 3, Child 3 of #2154) #2161 で撤去された。
    現行の _is_transient_infrastructure_candidate() は runtime に依存しない形状であり、
    keep_excluded 判定は不変」であることを明記。test 側の assertion も、
    もはや存在しない codex_cli 条件分岐ではなく、現行の実際の predicate 形状
    (agy_transient_quota_failure / child_completed_but_artifact_not_materialized のみをゲートする)を検証するよう更新。
    production コードへの codex_cli 参照は再導入していない。

検証:

  • uv run --locked pytest artifacts/claude-code-spawn-observability-research/tests/test_code_analysis_contract.py artifacts/claude-code-spawn-observability-research/tests/test_retry_policy_assessment_contract.py -v → 55 passed
  • uv run --locked pytest artifacts/claude-code-spawn-observability-research/ (suite 全体) → 114 passed
  • uv run ruff check .claude/scripts scripts schemas .claude/skills → clean(regression なし)

変更ファイルは5つ(docs/dev/agent-skill-boundaries.md、code-analysis.md、retry-policy-assessment.md、
_research_contract_support.py、test_retry_policy_assessment_contract.py)のみ。
scripts/agent-ops/run_agent_provider_route_smoke.py は本 iteration では無変更。

CI check-japanese.yml の whole-file scan が docs/dev/directory-structure.md
の5見出し(Top Level 等の英語のみ見出し)と docs/dev/workflow.md の
Multi-Agent V2 rollback 見出し(前 commit で日本語密度が閾値未満に低下)を
検出したため、各見出しに日本語の補足を付与して閾値 0.1 を回復する。
本文の意味・構造は変更しない。
@squne121

Copy link
Copy Markdown
Owner Author

fix_delta iteration 3: PR Body Japanese Check の残り失敗ファイルを修正した (commit ffa4e1b)。

whole-file Japanese-ratio scan(check-japanese.yml)が以下2ファイルで閾値 0.1 未満だったため、失敗した見出しにのみ日本語の補足を追加した(本文の意味・構造は変更なし):

  • docs/dev/directory-structure.md: ## Top Level / ## Docs Roles / ## Runtime Layers / ## Dependency Rules / ## Current MVP の5見出しに日本語補足を追加
  • docs/dev/workflow.md: ### Multi-Agent V2 の V1 rollback(historical、...) 見出しの括弧内を日本語密度が十分になるよう言い換え

このPRで変更された全 *.md ファイル(merge-base 差分)に対して validate_japanese_content.py --threshold 0.1 をローカルで再実行し、全て pass することを確認済み。ruff check .claude/scripts scripts schemas .claude/skills も引き続き clean。

@squne121

Copy link
Copy Markdown
Owner Author

結論

現状は REQUEST_CHANGES 相当です。
PR #2409 の大筋――native Codex CLI を撤去し、Claude Code を共通 harness にして claude-gpt → claude-code-proxy → ChatGPT Pro を残す――には賛成です。PR は現在 Draft、head 718e921b... で、CI も主要 job は green です。

特に upstream の claude-code-proxy は v0.1.15 で Codex credential を native Codex CLI から独立して保存・更新するよう変更されており、現在も proxy 自身の codex auth login で ChatGPT Plus/Pro 認証を所有します。したがって .codex/** や native CLI を消しても claude-gpt を残せる、という #2154/#2161 のアーキテクチャ判断は技術的にも妥当です。([GitHub]1)

ただし、merge 前に直すべき P1 が2件あります。どちらも新しい security harness を追加する話ではありません。むしろ dead capability / dead harness をさらに削って単純化する方向です。


P1 — native Codex CLI の executable capability がまだ残っている

#2161 の Outcome はかなり明確で、native Codex CLI の executable consumer / Codex CLI subprocess execution を repository から消すことです。さらに #2161 は parent #2154 の最後の closure child です。

ところが PR 自身が negative reference として残している

.claude/skills/issue-refinement-loop/scripts/reviewer_transport.py

には、現在も

  • _KNOWN_BACKENDS = {"claude", "codex", "deterministic", "fixture"}
  • Codex backend の same-session retry → resume <session_id>
  • claude / codex backend timeout retry

という native Codex CLI を実行するための backend adapter が生きています。

これは単なる "Codex" という歴史的文字列ではありません。OpenAI の現行仕様でも codex exec は現在の non-interactive CLI surface であり、codex exec resume <SESSION_ID> は有効な実行方法です。([OpenAI Developers]2)

PR 本文は「production caller は現状 deterministic のみなので follow-up 候補」としていますが、そこがむしろ敵対レビュー上の問題です。

caller がゼロなら、今消すコストが最小です。
これを残す合理的な互換性要件も、#2161 では compatibility_preservation: not_required と明示されています。

さらに AC5 の VC は、

  • .codex/
  • @openai/codex
  • check-codex

しか検索していないため、codex exec が残っていても AC5 が PASS します。つまり現在の green はこの残存 capability を検出できません。

推奨修正

最小でいいです。

  • reviewer_transport.py から "codex" backend を削除
  • build_backend_command() の Codex branch を削除
  • Codex retry policy/comment を削除
  • Codex backend 専用 regression test を削除
  • 代替 adapter は作らない
  • AC5 に codex exec を追加するか、少なくとも今回だけ focused zero-reference check を行う

別 Issue に送るより、この PR で削ることを推します。「native Codex CLI retirement 完了」として parent を閉じるなら、ここまで消すべきです。


P1 — requested-mutation-route preflight が Claude-only 化で実質壊れている

こちらは現在の PR で生じた具体的な挙動退行です。

削除前の .codex/agents/implementation-worker.toml には、

runtime_followup_route: implement-issue

という machine-readable declaration がありました。

PR は stale .codex 参照を見つけ、preflight_requested_mutation_route() の参照先を .claude/agents/<agent>.md に変更しています。しかし新しい実装自身が、

most .claude/agents/*.md definitions do not declare a runtime_followup_route: bullet

と認識しており、見つからなければ declared_route_unavailable を返します。

実際、現 head の .claude/agents/implementation-worker.md は implement-issue を使うこと自体は記述していますが、旧 TOML と同じ runtime_followup_route: declaration はありません。

一方で CLI surface は依然として

  • --requested-mutation-route
  • --require-transaction-entrypoint-preflight

を公開しています。

さらに皮肉なことに、新しい provider-neutral fixture にはちゃんと

"runtime_followup_route": "implement-issue"

等が保存されています。

したがって、たとえば従来成立していた概念上の

implementation-worker + requested route=implement-issue

が、Codex TOML 消去後は Claude agent Markdown に literal declaration がないという理由だけで unavailable になります。

これは #2161 AC18 の

claude-native / claude-gpt lane の preflight が変更前と同じ挙動

という要求と一致しません。

PR 本文の「live caller 0なので既存バグ」という評価にも半分しか同意できません。caller 0 なら、存在価値のない preflight surface を残して壊れたままにするより、削除した方がプロジェクトの方針に合います。

推奨修正

この個人開発用途なら第一候補は、

requested-mutation-route 機構そのものを削除することです。

  • --requested-mutation-route 削除
  • --require-transaction-entrypoint-preflight 削除
  • preflight_requested_mutation_route() 削除
  • その専用 test/receipt fields を、他 consumer が無ければ削除

これが最も単純です。

もし実際に使いたい機能なら、Markdown prose を regex で解析するのはやめて、provider-neutral contract を唯一の source にしてください。ただし、そのために新 framework を作るほどの価値はありません。


P2 — provider-neutral checker が Claude Code の recursive agent discovery と一致していない

新しい scripts/check_claude_codex_agent_parity.py は provider-neutral authority checker へ縮小されていますが、agent discovery に

claude_agent_dir.glob("*.md")

を使っています。duplicate-name check も同様です。

しかし現行 Claude Code は .claude/agents/ を再帰的に scanします。サブディレクトリ内も load し、名前は subtree 全体で unique にすべきと公式仕様に明記されています。(Claude)

したがって将来、

.claude/agents/review/foo.md

を追加すると、

  • Claude Code → 認識する
  • provider-neutral checker → 認識しない

になります。

現時点で nested agent がある証拠はないので merge blocker までは上げません。ただし修正は非常に安価です。

glob("*.md") → rglob("*.md")

にし、classification path は p.name ではなく agent root からの relative path を使うべきです。nested duplicate を1ケースだけ regression test に足せば十分です。

これは harness 強化というより、checker を実 runtime の仕様に合わせるだけです。


P2 — issue-reviewer の「read-only」は実際の permission boundary ではない

.claude/agents/issue-reviewer.md は、

  • tools: Bash, Read, Grep, Glob
  • permissionMode: dontAsk
  • 「read-only」「Issue mutation を行わない」

という契約になっています。

一方 global .claude/settings.json は Bash について、

  • gh issue edit
  • gh issue close
  • gh issue comment
  • gh pr merge
  • gh api
  • git push
  • git commit

などを allow しています。

Claude Code の現在の dontAsk は「read-only mode」ではありません。permissions.allow で事前承認された tool は実行し、それ以外を auto-deny するモードです。公式仕様でも allow rule は manual approval を省略し、dontAsk は pre-approved tool を許可するとされています。(Claude)

したがって run_root_review_pipeline.py の

read-only (no Issue mutation tools)

という説明も厳密には誤りです。

ただし、ここで deny rule や sandbox や新 hook を追加することは推しません。canonical Step 2 ではこの agent 自体がもう起動されず、legacy/diagnostic 用だからです。

文言だけ正確にするのが最適です。

例えば概念として、

behavioral/advisory read-only contract。permission-level isolation を意味しない。

程度で十分です。

実用上問題がない legacy agent に security machinery を増やす方が、このリポジトリでは有害です。


P3 — retirement PR なのに互換性用 dead surface を残しすぎ

neutral checker には、

  • --strict: no-op compatibility flag
  • parse_known_args(): unrelated args を黙って無視

が残っています。

しかし #2161 は compatibility_preservation: not_required です。

特に parse_known_args() は、たとえば将来 --strcit と typo しても checker が成功しかねません。小規模個人開発なら、この種の「昔の caller がいるかもしれない」互換層は維持費の方が高いです。

私なら、

  • --strict 削除
  • parse_known_args() → parse_args()
  • 可能なら check_claude_codex_agent_parity.py も neutral な名前に rename

までやります。

ただしこれは P1修正後なら別 PRでもよいです。


良い部分

この PR は151ファイル規模ですが、削除戦略自体はかなり適切です。

特に評価できるのは、codex-execpolicy job を単純削除せず、そこに同居していた Codex 非依存の performance assessment producer/gate を python-test-core へ救出してから撤去したことです。現 head の実 CI でも CI_TEST_PERFORMANCE_ASSESSMENT_V2 の generate / validate / upload は成功しています。

また、

  • .codex/** 一括削除前に producer/consumer を分類
  • tests/codex/** を名前だけで全削除せず provider-neutral test を保持
  • launch ledger のように producer が消える chain は validator/test/fixture ごと削除
  • hidden directory を含まない当初の rg VC の弱点を --hidden sweep で補完
  • 新しい security/runtime harness を作らなかった

という判断も #2161 の OWNER 方針と整合しています。


merge 前に私なら要求する修正

優先順位はこうです。

  1. reviewer_transport.py の Codex backend を削除する。
  2. 壊れた mutation-route preflight を修復するのではなく、live caller 0なら丸ごと削除する。
  3. checker の glob を recursive discovery に合わせる。
  4. issue-reviewer の read-only 表現を「behavioral contract」に修正する。
  5. 余力があれば --strict / parse_known_args() 等の compatibility residue を削除する。

1・2が直れば、私は APPROVE 寄りに変えます。3〜5のために Draft を長期間維持する必要はありません。

特にこの PR では「Codex CLI を消すために別の制御機構を追加する」のは避けるべきです。使われていない capability・checker・preflight は削除し、Claude Code / claude-gpt の実際に使う経路だけ残すのが、個人趣味開発として最も品質と保守性のバランスが良いです。

Test and others added 2 commits August 30, 2026 10:08
…broken requested-mutation-route preflight

OWNER adversarial review (issuecomment-5465797624) on Issue #2161's
native Codex CLI retirement found two residual/broken mechanisms:

- reviewer_transport.py still had a live "codex" backend capable of
  building `codex exec resume <session_id>` argv, evading AC5's
  substring grep (Outcome requires
  native_codex_cli.disposition=retire,
  compatibility_preservation=not_required). Removed "codex" from
  _KNOWN_BACKENDS and the build_backend_command() codex branch; no
  replacement adapter added. Updated the one dedicated codex-backend
  test to assert rejection instead of command construction, and
  dropped "codex" from a generic multi-backend retry-matrix test
  parametrization list.

- run_worktree_agent_runtime_smoke.py's
  preflight_requested_mutation_route() mechanism (CLI flags
  --requested-mutation-route / --require-transaction-entrypoint-preflight)
  became permanently broken after this PR's earlier migration from
  the deleted native Codex CLI agent TOML (which declared
  runtime_followup_route:) to .claude/agents/*.md (which mostly lacks
  that declaration) -- it now always returns
  declared_route_unavailable for any agent besides web-researcher.
  Confirmed zero live callers and zero dedicated tests; deleted the
  function, its CLI flags, call sites, and the now-unused
  _RUNTIME_FOLLOWUP_ROUTE_RE / _TRANSACTION_ENTRYPOINTS constants
  rather than repairing it, per OWNER instruction. No downstream
  schema consumer of the removed receipt fields was found.

All AC1-AC18 verification commands from the live Issue #2161 body
still pass, including AC18's runtime verification (364 passed, 0
skipped, 0 failed). Full scripts/agent-ops test suite (286) and the
issue-refinement-loop skill's reviewer_transport-related tests pass.

Note: .claude/skills/issue-refinement-loop/scripts/reviewer_transport.py
and its two touched test files are not explicitly enumerated in
Issue #2161's current Allowed Paths list; this change is scoped
narrowly to the codex-backend removal directly required by the
Issue's own Outcome and flagged for Scope Delta reconciliation.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
…overy in parity checker

Claude Code recursively scans .claude/agents/** (subdirectories
included, name: uniqueness required across the whole subtree per
https://code.claude.com/docs/en/sub-agents), but
check_claude_codex_agent_parity.py used a non-recursive
glob("*.md") for asset-classification discovery and duplicate
agent-name detection, silently skipping any nested
.claude/agents/<subdir>/foo.md.

Switched both check_asset_classification_complete() and
check_duplicate_agent_names() to rglob("*.md"), and made the
discovered/reported path relative to claude_agent_dir (not just the
bare filename) so nested files are correctly attributed to their
subdirectory instead of colliding with a same-named top-level file.
Added a regression test exercising a nested
.claude/agents/subdir/foo.md file for both discovery and duplicate
detection.

AC13's VC (scripts/check_claude_codex_agent_parity.py exit 0) and the
full tests/test_agent_parity.py suite (34 tests) still pass against
the real repo.

Note: P2-2 (issue-reviewer.md "read-only" wording) from the fix_delta
request was NOT applied -- .claude/agents/** is explicitly listed as
RETAIN in Issue #2161's asset inventory, and editing it hits the
Issue's own Stop Condition ("`.claude/agents/**` ... の変更が必要と
判明した場合(RETAIN 対象への波及のため)"). Reported as a blocker
instead of guessing past an explicit Stop Condition.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@squne121

Copy link
Copy Markdown
Owner Author

fix_delta iteration 4 対応(OWNER adversarial review #2409 (comment) への対応)

head: 8094bb76(775ad9ae + 8094bb76 の2コミット、718e921b からの差分)

P1-1(必須): reviewer_transport.py の live codex backend を削除

  • _KNOWN_BACKENDS から "codex" を除去、build_backend_command() の codex exec resume <session_id> を組み立てる分岐を削除。代替 Codex adapter は追加していない。
  • 専用の codex-backend テスト(test_given_codex_backend_when_session_present_then_resume_subcommand_is_materialized)を「codex は unknown backend として ValueError で reject される」ことを検証するテストに置き換え。
  • test_reviewer_transport_deadline_matches_vc_worst_case.py の汎用 backend 列挙 ("claude", "codex", "fixture") から "codex" を除去(retry_matrix() はこれまでも _KNOWN_BACKENDS に依存していなかったため機能的には無害だったが、退役済み backend 名を能動的な生テストパラメータとして残すのは避けた)。
  • grep -n "codex exec\|_KNOWN_BACKENDS" reviewer_transport.py で live な codex backend が残っていないことを確認済み。

P1-2(必須): run_worktree_agent_runtime_smoke.py の壊れた requested-mutation-route preflight 機構を削除

  • preflight_requested_mutation_route() 関数本体、--requested-mutation-route / --require-transaction-entrypoint-preflight CLI フラグ、全 call site(route_preflight / route_refused / entrypoint_preflight_failed 変数と分岐)、専用の _RUNTIME_FOLLOWUP_ROUTE_RE / _TRANSACTION_ENTRYPOINTS 定数を削除。
  • 修理ではなく削除(OWNER 明示指示通り)。live caller ゼロ・専用テストゼロを確認済み。schema_summary から **route_preflight の展開で追加されていた receipt フィールド群も削除したが、これらを消費する downstream schema consumer は見つからなかった(schemas/ 配下に該当スキーマファイルなし、専用テストなし)。

P2-1(推奨、実施): check_claude_codex_agent_parity.py の agent discovery を Claude Code の実際の再帰探索に合わせる

  • check_asset_classification_complete() / check_duplicate_agent_names() の両方を glob("*.md") から rglob("*.md") へ変更し、claude_agent_dir からの相対パスで discover/report するよう修正(同名ファイルがサブディレクトリ違いで衝突しないように)。
  • tests/test_agent_parity.py に nested .claude/agents/subdir/foo.md の discovery + 重複検知の regression テストを追加。

P2-2(推奨、未実施 — Stop Condition 該当のため実施を見送り、blocker として報告)

issue-reviewer.md の "read-only" wording 修正を試みましたが、.claude/agents/** は Issue #2161 の資産棚卸しで明示的に RETAIN 指定されており、Issue 自身の Stop Conditions に「.claude/agents/** ... の変更が必要と判明した場合(RETAIN 対象への波及のため)」という条項が存在します。この修正はネイティブ Codex CLI 撤去そのものとは無関係な内容のため、この Stop Condition に該当すると判断し、実装せず revert しました(run_root_review_pipeline.py 側の同種 docstring 修正も、その File の Allowed Paths 許可範囲が「Codex agent dispatch routing 部分のみ除去」に限定されているため同様に revert)。人間判断が必要です。

検証結果

  • Issue 実装: retire Codex CLI assets and documentation(Phase 3, Child 3 of #2154) #2161 の live AC1-AC18 検証コマンドを全て再実行し、全て PASS(AC5 は自分が追加した説明コメント内の .codex/agents/*.toml という文字列で一度誤って自己ブロックしたため、コメント文言を .codex/ を含まない表現に修正して再確認)。AC18(runtime verification)は 364 passed / 0 skipped / 0 failed、artifacts/runtime-verification-AC18-<timestamp>.log を生成。
  • scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke*.py 全286件 PASS。
  • reviewer_transport 関連テスト(test_reviewer_transport_e2e.py / test_reviewer_transport_deadline_matches_vc_worst_case.py / test_reviewer_transport_environment_failure_regression.py / test_reviewer_transport_fresh_session_resume_regression.py / test_issue_reviewer_contract_static.py)全67件 PASS。
  • tests/test_agent_parity.py 全34件 PASS(新規 nested-discovery テスト含む)。
  • .claude/skills/issue-refinement-loop/tests/ フルスイート実行(1872 passed / 4 failed)。失敗4件は今回の変更と無関係な既存環境依存の flake(uv_version_mismatch、live AGY native fallback smoke のタイミング依存)であり、今回変更したファイルを一切参照していないことを確認済み。
  • uv run ruff check .claude/scripts scripts schemas .claude/skills clean。
  • pnpm typecheck / pnpm lint / pnpm test(1881 passed) / pnpm build 全て green。

スコープに関する開示(Allowed Paths gap)

P1-1 で修正した reviewer_transport.py とその2つのテストファイルは、現在の Issue #2161 本文の Allowed Paths に明示的に列挙されていません(同スキルの command_registry.py / plan_refinement_loop.py / run_root_review_pipeline.py のみが列挙)。Issue の Outcome(native_codex_cli.disposition: retire)を実際に満たすために必須の修正と判断し実装しましたが、Scope Delta による Allowed Paths 拡張の正式な反映は本 SubAgent の権限外(Issue 本文編集不可)のため未実施です。次の review iteration で pr-review-judge の独立 Allowed Paths 判定と合わせて確認・reconciliation をお願いします。

P3 は今回対象外

--strict no-op flag 除去・parse_known_args() → parse_args()・check_claude_codex_agent_parity.py のさらなる rename は、reviewer 自身の優先順位付けに従い別 PR とし、本 fix_delta では触れていません。

@squne121
squne121 marked this pull request as ready for review August 30, 2026 02:56
@squne121
squne121 merged commit 8675869 into main Aug 30, 2026
74 of 78 checks passed
@squne121
squne121 deleted the worktree-issue-2161-retire-codex-cli-assets-and-documentatio branch August 30, 2026 03:08
squne121 pushed a commit that referenced this pull request Aug 30, 2026
…2412)

PR #2409 merged (8675869) and removed
.codex/hooks.json / .codex/hooks/session-recording-composite.mjs, leaving
scripts/session-recording/codex-hook-adapter.mjs as an orphaned native
Codex CLI runtime asset with production_inbound_producer_count == 0
(verified via fresh-HEAD git grep inventory).

DELETE_CHAIN:
- scripts/session-recording/codex-hook-adapter.mjs (adapter)
- tests/hooks/codex-harness-advisory-boundary.test.ts
- tests/hooks/codex-harness-advisory-recorder.test.ts
- tests/hooks/codex-harness-workflow-gates.test.ts
- tests/hooks/codex-harness-advisory-fail-open.test.ts (discovered
  mid-implementation: sole consumer of codex-harness-advisory-recorder's
  exported `invoke` helper, which spawns the adapter directly -- deleting
  the recorder test alone breaks this file's import and fails pnpm test)
- tests/session_recording/codex/test_hook_adapter.py
- tests/session_recording/codex/test_initial_branch_create_lane.py
- tests/session_recording/codex/test_external_manifest_publish.py

Mechanical cleanup of stale references:
- scripts/agent-guards/tests/test_git_mutation_command_policy.py: removed
  the adapter direct-reference guard assertion that read the now-deleted
  source file.
- .github/workflows/ci.yml: removed the 3 dead pytest steps, dropped the
  3 deleted test paths from collect-only/pytest_args/session-recording
  prefix classification, and reworded a comment to stop referencing the
  deleted filename.
- .github/ci/python-test-plan.json: removed the secondary_coverage entry
  for the 3 deleted test paths.

Runtime verification: not_applicable (static cleanup + tracked-file
inventory only; no native Codex runtime session to exercise).

Closes #2412
squne121 added a commit that referenced this pull request Aug 30, 2026
)

* feat: retire orphaned codex-hook-adapter.mjs and adapter-only tests (#2412)

PR #2409 merged (8675869) and removed
.codex/hooks.json / .codex/hooks/session-recording-composite.mjs, leaving
scripts/session-recording/codex-hook-adapter.mjs as an orphaned native
Codex CLI runtime asset with production_inbound_producer_count == 0
(verified via fresh-HEAD git grep inventory).

DELETE_CHAIN:
- scripts/session-recording/codex-hook-adapter.mjs (adapter)
- tests/hooks/codex-harness-advisory-boundary.test.ts
- tests/hooks/codex-harness-advisory-recorder.test.ts
- tests/hooks/codex-harness-workflow-gates.test.ts
- tests/hooks/codex-harness-advisory-fail-open.test.ts (discovered
  mid-implementation: sole consumer of codex-harness-advisory-recorder's
  exported `invoke` helper, which spawns the adapter directly -- deleting
  the recorder test alone breaks this file's import and fails pnpm test)
- tests/session_recording/codex/test_hook_adapter.py
- tests/session_recording/codex/test_initial_branch_create_lane.py
- tests/session_recording/codex/test_external_manifest_publish.py

Mechanical cleanup of stale references:
- scripts/agent-guards/tests/test_git_mutation_command_policy.py: removed
  the adapter direct-reference guard assertion that read the now-deleted
  source file.
- .github/workflows/ci.yml: removed the 3 dead pytest steps, dropped the
  3 deleted test paths from collect-only/pytest_args/session-recording
  prefix classification, and reworded a comment to stop referencing the
  deleted filename.
- .github/ci/python-test-plan.json: removed the secondary_coverage entry
  for the 3 deleted test paths.

Runtime verification: not_applicable (static cleanup + tracked-file
inventory only; no native Codex runtime session to exercise).

Closes #2412

* fix: remove retired codex_hook_adapter_pretooluse authorization residue (#2412)

OWNER REQUEST_CHANGES review on PR #2428
(#2428 (comment))
found that scripts/agent-guards/git_mutation_command_policy.py still
authorized `boundary_layer=codex_hook_adapter_pretooluse` -- a live caller
identity for the now-deleted native Codex CLI hook adapter -- in the
remote-write authorization gate used by
execute_existing_branch_update_transaction and
execute_initial_branch_create_transaction.

- _AUTHORIZED_EXECUTION_BOUNDARY_LAYERS narrows to
  frozenset({"worktree_scope_guard_denied"}); no caller in the repo passes
  codex_hook_adapter_pretooluse anymore (verified via git grep).
- Add a focused regression test asserting
  --boundary-layer codex_hook_adapter_pretooluse is now rejected with
  execution_not_authorized_for_boundary_layer, same as any other unknown
  caller.
- docs/dev/hook-boundaries.md's "Codex advisory hook allowlist" section
  historicized to match docs/dev/session-recording-policy.md's existing
  historical framing for the same retired architecture -- it previously
  described the passive recorder as currently active, which could prompt
  a future agent to reintroduce the retired architecture.

Closes #2412

---------

Co-authored-by: Test <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

実装: retire Codex CLI assets and documentation(Phase 3, Child 3 of #2154)

1 participant