Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "python-test-core を Node/npm/Codex runtime から分離した Python-only lane にし、Codex CLI・execpolicy matrix・Codex 固有 runtime pytest を codex-execpolicy 専用 job へ移動し、required aggregate job と projection verifier で再混入・plan外実行・false-green を fail-close で拒否する"
change_kind: workflow
depends_on:
- 1725
readiness: blocked_until_dependencies_mergedParent Issue
none(#1059 の child にはしない。related: #1059, #1061, #1064, #1123, #1725, #1782)
Parent Goal Ref
N/A(親 Issue なし。#1059 は completed で close 済み)
Current Validated Scope
python-testjob にはactions/setup-node@v6が存在し、同 job 内で Codex CLI の導入と execpolicy matrix を実行している。.github/ci/python-test-plan.jsonのtargetsには既にscripts/ci/tests/(ディレクトリ全体)とtests/codex/test_execpolicy_matrix.py(明示 target)が含まれており、これらは plan-driven pytest としてpython-test内で実行される。plan 外で dedicated coverage として扱われているのはsecondary_coverage.dedicated_lanes[]に登録されたtests/codex/test_local_main_branch_guard.pyのみで、そのprovider_jobは現在"python-test"である。- required status check(
docs/ops/branch-protection.md)はtypecheck/lint/test/build/python-testの5つのみで、codex-execpolicyのような新規 job 名は含まれない。job を単純に追加しただけでは required gate として機能しない。 python-testjob は checkout →setup-python-uv→uv sync --locked --group dev→actions/setup-node@v6(node-version 22) という共有 bootstrap の上に Codex step を積んでおり、同 job 単位のci_runtime_baseline_v1artifact 収集にも Codex 計測が混入する。- そのため、Python-only lane および plan-driven pytest invariant が成立していない。
Remaining Parent Gaps
なし(本 Issue は独立 follow-up。#1059 の Closure には影響しない)
Outcome
python-test-core job が Python・uv・Ruff・plan-driven parallel/serial pytest(scripts/ci/tests/test_codex_execpolicy_matrix.py と tests/codex/test_execpolicy_matrix.py を含む、既存 plan 対象は維持)のみを実行する状態になり、Node/npm/Codex CLI・execpolicy matrix・tests/codex/test_local_main_branch_guard.py は codex-execpolicy 専用 job(secondary_coverage.dedicated_lanes[].provider_job: codex-execpolicy)へ移動する。既存 required status check 名 python-test は needs: [python-test-core, codex-execpolicy] かつ if: always() の required aggregate job として維持され、いずれかの失敗・skip でも失敗する。YAML AST を検査する invariant verifier(scripts/ci/verify_python_test_lane.py)が Node/Codex 再混入・plan 外 pytest・job 欠落・verifier 自体の無効化を fail-close で拒否し、実 ci.yml を読む positive contract test で verifier の接続を保証する。同一 head SHA の実 check conclusion と artifact 内容を検証する script が AC の充足を機械判定する。
In Scope
.github/workflows/ci.yml: 既存python-testjob をpython-test-core(Python-only)へ改称・純化し、新規codex-execpolicyjob(Node/Codex CLI/matrix/runtime guard test)を追加し、python-testをneeds: [python-test-core, codex-execpolicy]/if: always()の required aggregate job として再定義する.github/ci/python-test-plan.json:secondary_coverage.dedicated_lanes[]のtests/codex/test_local_main_branch_guard.pyのprovider_jobをpython-testからcodex-execpolicyへ変更する(targetsの既存 Codex 関連 pytest は変更しない)scripts/ci/verify_python_test_lane.pyの追加(Node/Codex 再混入・plan 外 pytest・job 欠落・verifier 無効化を拒否する negative test 群 + 実ci.ymlを読む positive contract test)scripts/ci/verify_ci_check_conclusions.pyの追加(同一 head SHA の実 check conclusion と AC 該当 artifact 内容を検証する script。文字列検索によらない AC8 相当の実行時検証)- job 間の required gate・artifact 責務(bootstrap failure sentinel と matrix failure artifact の区別を含む)の更新
docs/dev/ci-performance.md/docs/dev/test-lane-policy.md/.claude/skills/ci-test-performance/SKILL.mdの更新python_test_benchdispatch 時の aggregate job の skip/成功条件の定義
Out of Scope
- pytest target inventory 全体の再設計
python_test_planschema migration(secondary_coverage.dedicated_lanes[].provider_jobの値変更のみで、schema 自体は変更しない)- job total の性能比較
- Codex execpolicy テスト自体の意味変更
@openai/codexのバージョン、Node バージョン、native package provenance(platform 固有 package・SHA-256・npm ls)、execpolicy probe 挙動の変更- required status check 名自体の変更(
typecheck/lint/test/build/python-testを維持し、branch protection / GitHub ruleset の live 変更は行わない) codex-execpolicyを required status check として直接登録すること(別案。remote ruleset・branch protection・docs/ops/branch-protection.mdの live readback を要するため本 Issue のスコープ外)
Acceptance Criteria
- AC1:
jobs.python-test-coreが存在する - AC2:
python-test-core内にnode/npm/npx/pnpm/corepack/codexを起動する command が存在しない(scripts/ci/verify_python_test_lane.pyが shell indirection を含め lexical 検査する) - AC3:
python-test-coreの pytest 実行は plan 由来の parallel lane と serial lane のみであり、scripts/ci/tests/test_codex_execpolicy_matrix.pyとtests/codex/test_execpolicy_matrix.pyは plan targets に残る(移動しない) - AC4:
codex-execpolicyjob が既存 execpolicy matrix とtests/codex/test_local_main_branch_guard.pyを実行し、python-test-plan.jsonのsecondary_coverage.dedicated_lanes[].provider_jobがcodex-execpolicyに更新される - AC5:
python-test(required aggregate)がneeds: [python-test-core, codex-execpolicy]かつif: always()で定義され、いずれかの失敗・skip で aggregate も失敗する - AC6:
codex-execpolicyの matrix orchestrator は開始前に sentinel artifact を作成し、bootstrap failure・matrix failure のいずれでも status artifact が保存される - AC7: invariant verifier(
scripts/ci/verify_python_test_lane.py)が Node/Codex 再混入・plan 外 pytest・job 欠落・verifier 自体の削除/continue-on-error: true付与/別 job への移動を拒否する negative test を持ち、実ci.ymlを読んで verifier が exact command として接続されていることを検証する positive contract test を持つ - AC8: docs(
docs/dev/ci-performance.md,docs/dev/test-lane-policy.md)・Skill(.claude/skills/ci-test-performance/SKILL.md)が変更後 topology(python-test-core/codex-execpolicy分離、provider_job移管)と一致する - AC9:
scripts/ci/verify_ci_check_conclusions.pyが、同一 head SHA に対するactionlint/python-test-core/codex-execpolicy/python-test/node-backed-hook-testsの実 check conclusion と AC6 artifact の内容を検証する(単純な文字列検索ではない) - AC10:
python_test_benchdispatch 時の aggregate job の skip/成功条件がci.ymlに明示され、python-test-core単独実行時もpython-test(aggregate)が意図通り評価される - AC11:
@openai/codexのバージョン・Node 22・execpolicy probe の挙動・native package provenance 記録が変更されない(topology 変更のみ) - AC12:
pnpm typecheck/pnpm lint/pnpm test/pnpm buildが成功する
Verification Commands
# AC1
# baseline-expect: fail
$ rg -n "^ python-test-core:$" .github/workflows/ci.yml# AC2
# baseline-expect: fail
$ test -f scripts/ci/verify_python_test_lane.py# AC3
# baseline-expect: pass
$ rg -c "tests/codex/test_execpolicy_matrix.py" .github/ci/python-test-plan.json# AC4
# baseline-expect: fail
$ rg -n "\"provider_job\": \"codex-execpolicy\"" .github/ci/python-test-plan.json# AC5
# baseline-expect: fail
$ rg -n "needs: \[python-test-core, codex-execpolicy\]" .github/workflows/ci.yml# AC6
# baseline-expect: fail
$ rg -n "sentinel" scripts/ci/tests/test_codex_execpolicy_matrix.py# AC7
# baseline-expect: fail
$ test -f scripts/ci/tests/test_verify_python_test_lane.py# AC8
# baseline-expect: fail
$ rg -n "python-test-core" docs/dev/test-lane-policy.md# AC9
# baseline-expect: fail
$ test -f scripts/ci/tests/test_verify_ci_check_conclusions.py# AC10
# baseline-expect: fail
$ rg -n "python_test_bench_aggregate_policy" .github/workflows/ci.yml# AC11
# baseline-expect: pass
$ rg -n "@openai/codex" .github/workflows/ci.yml# AC12
$ pnpm typecheckAllowed Paths
.github/workflows/ci.yml.github/ci/python-test-plan.jsonscripts/ci/verify_python_test_lane.pyscripts/ci/verify_ci_check_conclusions.pyscripts/ci/verify_ruff_configuration.pyscripts/ci/tests/docs/dev/ci-performance.mddocs/dev/test-lane-policy.md.claude/skills/ci-test-performance/SKILL.md.claude/skills/pr-review-judge/tests/.claude/skills/pr-review-judge/scripts/tests/.claude/skills/pr-review-judge/scripts/ci_verdict_summary_v2.pyscripts/ci/evaluate_python_test_aggregate.pyscripts/ci/python_invocation_policy_exceptions.json
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- required status check 名の追加・変更や branch protection / GitHub ruleset の live 変更が必要と判明した場合
Required Skills
なし
Required Design References
.claude/skills/ci-test-performance/SKILL.mddocs/dev/test-lane-policy.md
Scope Delta(任意)
-
追加ファイル:
scripts/ci/verify_ruff_configuration.py -
理由:
.github/workflows/ci.ymlのpython-testjob をpython-test-coreへ改称した本 Issue の実装により、Ruff 実行 job 名を固定文字列("python-test"/"Ruff check (timed)"の tuple)でチェックする既存スクリプトverify_ruff_configuration.pyが CI 上で fail するため(FAILURE_KEY: workflow_ruff_step_invalid)、job 名チェックの期待値をpython-test-coreに更新する直接的整合性修正が必要になった(「Ruff invocation は python-test job の Ruff check (timed) step に限定されます」という不変条件の意図自体は維持し、job 名のみを実態に追随させる)。 -
承認: リポジトリ owner が本 PR(実装: Codex execpolicyを専用jobへ分離しpython-testのPython-only invariantを復元する #1824)レビューフローの中で確認・承認済み。
-
追加ファイル:
.claude/skills/pr-review-judge/scripts/ci_verdict_summary_v2.py -
理由: 本 Issue の実装で
python-testjob をpython-test-core+codex-execpolicyへ分割したことに伴い、既存の CI 機械可読 verdict 生成スクリプト(ci_verdict_summary_v2.py)のCLASSIFICATION_MAP/REQUIRED_CHECKSに新設 job 名を登録しないと、実際には両jobが成功していても machine verdict artifact のoverall_statusがgh_errorになる(owner レビューで実証跡とともに指摘、PR 実装: Codex execpolicyを専用jobへ分離しpython-testのPython-only invariantを復元する #1824 コメント参照)。job トポロジ変更に伴う直接的な consumer 修正であり、意味論的 enum(job名)の登録漏れを解消するもの。 -
承認: リポジトリ owner が PR 実装: Codex execpolicyを専用jobへ分離しpython-testのPython-only invariantを復元する #1824 レビューコメントで修正を明示的に要求・承認済み。
-
追加ファイル:
scripts/ci/evaluate_python_test_aggregate.py(新規) -
理由: owner の PR 実装: Codex execpolicyを専用jobへ分離しpython-testのPython-only invariantを復元する #1824 レビュー指摘(P1-1)により、既存
verify_python_test_lane.pyが aggregate job の実際の依存job結果評価を検証していない不備が判明したため、aggregate評価ロジックを専用スクリプトへ切り出し、table-driven test で全組み合わせを固定する対応が必要になった。 -
承認: リポジトリ owner が PR 実装: Codex execpolicyを専用jobへ分離しpython-testのPython-only invariantを復元する #1824 レビューコメントで両修正を明示的に要求・承認済み。
-
追加ファイル:
scripts/ci/python_invocation_policy_exceptions.json -
理由: owner の PR 実装: Codex execpolicyを専用jobへ分離しpython-testのPython-only invariantを復元する #1824 レビュー指摘(P1-4)により、
codex-execpolicyjob の巨大 artifact(約110MB)を是正するため npm-prefix を$RUNNER_TEMPへ移動する必要があり、既存の Python invocation policy exception エントリのexact_argv値を実態に合わせて更新する必要が生じた。 -
承認: リポジトリ owner が PR 実装: Codex execpolicyを専用jobへ分離しpython-testのPython-only invariantを復元する #1824 レビューコメントで両修正を明示的に要求・承認済み。
Runtime Verification Applicability
decision: immediate
reason: "GitHub Actions の job 境界と required test execution を変更するため、当該 PR の実 CI run で検証する"
applicable_acs:
- AC1
- AC4
- AC5
- AC6
- AC7
- AC9
- AC10
execution_environment: github_actions_pr_check
skip_conditions: "対象 PR の CI run が取得できない場合はローカル actionlint / dry-run 検証に fallback する"
fallback_policy: "runtime 検証が不可の場合は human_judgment_required として PR review で明示する"
artifact_requirements:
- ci_runtime_baseline_v1
- codex_execpolicy_matrix_statusNotes for Reviewer
- OWNER コメント(https://github.com/squne121/loop-protocol/issues/1059#issuecomment-5079148059)の「Issue案1」を issue-refinement-loop control-plane が Issue テンプレート形式へ再構成したもの。推奨実施順序: 実装: node-backed-hook-tests に test_external_manifest_publish.py の実行 step を追加し既知の宣言・実行不一致を解消する #1725 → 本 Issue → 案2 → 案3 → 案4 → 案5。
- OWNER の REQUEST_CHANGES(https://github.com/squne121/loop-protocol/issues/1760#issuecomment-5090688963)を反映し、job 構成を
python-test-core+codex-execpolicy+python-test(required aggregate) の3層に再設計した。plan 対象ファイルの前提誤り、required check の false-green 経路、bootstrap/artifact 契約、verifier の workflow 接続保証を修正済み。実装: node-backed-hook-tests に test_external_manifest_publish.py の実行 step を追加し既知の宣言・実行不一致を解消する #1725 完了まではreadiness: blocked_until_dependencies_merged。
Activity
squne121 commentedon Jul 27, 2026
判定
REQUEST_CHANGES。現状の #1760 は実装着手不可です。
Codex runtime を別 job へ分離する方向は妥当です。しかし、現在の契約には以下の二つの false-green 経路があります。
Issue 本文の前提、Allowed Paths、required gate、artifact 責務を先に修正すべきです。
P0-1: 「Codex 固有 pytest は plan 外」という前提が事実と異なる
現在の Codex step は次の三ファイルを実行しています。
scripts/ci/tests/test_codex_execpolicy_matrix.pytests/codex/test_execpolicy_matrix.pytests/codex/test_local_main_branch_guard.pyところが python-test plan は、既に以下を plan 対象にしています。
scripts/ci/tests/ディレクトリ全体tests/codex/test_execpolicy_matrix.pyの明示 targetplan 外の dedicated coverage なのは、実質的に
tests/codex/test_local_main_branch_guard.pyだけです。さらに、その provider は現在python-testと宣言されています。plan の notes も、前二ファイルのうち純 Python の execpolicy contract test は共有 Python lane に残し、
test_local_main_branch_guard.pyだけを runtime 専用 lane に置く設計を明記しています。したがって、#1760 の「Codex 固有 pytest をすべて移動」は誤りです。そのまま実装すると、二重実行または
ci_test_selectionの虚偽 coverage が発生します。修正案
scripts/ci/tests/test_codex_execpolicy_matrix.pyは plan-driven pytest に残す。tests/codex/test_execpolicy_matrix.pyも plan-driven pytest に残す。tests/codex/test_local_main_branch_guard.pyだけをcodex-execpolicyへ移す。secondary_coverage.dedicated_lanes[].provider_jobをpython-testからcodex-execpolicyへ変更する。Allowed Paths に少なくとも次を追加する。
.github/ci/python-test-plan.json.claude/skills/pr-review-judge/tests/.claude/skills/pr-review-judge/scripts/tests/実際に generator の回帰テストも
provider_job: python-testを固定値として検証しているため、現行 Allowed Paths だけでは整合した変更ができません。P0-2: 新 job が required check にならず、失敗してもマージできる
リポジトリ内の branch protection 設定記録では、required context は次の五つです。
typechecklinttestbuildpython-testcodex-execpolicyは含まれていません。なお、これはリポジトリに記録された snapshot の確認であり、remote の live ruleset を独立に読み戻したものではありません。単純に
codex-execpolicyjob を追加しただけでは、その job が赤でも現在の requiredpython-testが緑ならマージ可能です。また、
python-testにneeds: codex-execpolicyを追加するだけでも不十分です。GitHub Actions は依存 job が失敗すると後続 job を skip し、条件で skip された job は成功扱いになり得ます。required check の依存集約にはif: always()とneeds.*.resultの明示検査が必要です。([GitHub Docs]1)推奨構成
これなら既存の required context
python-testを維持でき、remote branch protection の変更を回避しつつ、二 job を並列実行できます。別案として
codex-execpolicy自体を required context に追加することも可能ですが、その場合は remote ruleset、branch protection、docs/ops/branch-protection.mdの更新と live readback が必要です。現行 Allowed Paths/Stop Conditions とは両立していません。P0-3: 専用 job の bootstrap と artifact 契約が不足している
既存の Codex step は、同じ
python-testjob の前半で準備された以下に依存しています。setup-python-uvuv sync --locked --group devjob は相互に隔離されるため、Codex 関連 step だけをコピーしても動きません。AC4 には専用 job の完全な bootstrap を固定すべきです。
また、matrix の JSON writer はスクリプト開始時に
status: runningartifact を作り、install/probe/case の途中結果を逐次保存します。これは適切な実装です。しかし
actions/setup-nodeや checkout が失敗した場合、matrix スクリプト自体が開始されないため JSON は存在しません。if-no-files-found: errorは upload action を失敗させるだけで、失敗証跡を生成する機能ではありません。([GitHub]2)AC5 は次のどちらかに限定すべきです。
さらに
codex_execpolicyの計測値は現在python-testのci_runtime_baseline_v1に入ります。分離後は専用 job が独自の baseline artifact を生成するか、計測対象から明示的に外す必要があります。現在の docs は phase の所有 job をpython-testとしています。P0-4: verifier の negative test だけでは workflow 接続を保証できない
AC6 は fixture の negative test しか要求していません。これでは以下を検出できません。
continue-on-error: trueが付く最低限、以下の三層が必要です。
.github/workflows/ci.ymlを読む positive contract test#1782 は後段で current-state manifest と verifier connection を扱う予定ですが、#1760 自身が「再混入を機械保証する」と宣言する以上、接続保証をすべて後続 Issue へ先送りするのは矛盾します。#1782 自体も #1760 などの完了待ちです。
P1 指摘
「Python-only」の定義が過剰で曖昧
現行
python-testには shell、apt-get、Git、artifact action、複数の policy script が存在します。単に Python/uv/Ruff/pytest だけを実行する job ではありません。さらに AC2 は
run:内の command しか検査せず、uses:action の内部 runtime、local composite action、bash -c、変数展開などを扱いません。契約名は次の程度に限定すべきです。
YAML parse だけでなく、shell indirection を拒否する lexical policy が必要です。既存 Ruff verifier も workflow の run block を抽出し、
shlexベースで invocation を検査しています。python_test_benchの意味が壊れるworkflow input は現在、「他の全 job を skip して python-test だけを実行する」と明記されています。
分離後に Codex jobも実行すると benchmark cohort が変わります。逆に Codex jobを skipするなら aggregate gate は benchmark 時だけ
skippedを許容する必要があります。これを AC 化してください。#1725 依存が機械化されていない
#1760 は推奨順序を文章で書くだけですが、前提となる #1725 はまだ open です。
#1782 と同じ形式で、次を machine-readable contract に入れるべきです。
Codex 配布物の provenance を維持すること
現在の matrix は exact package/version に加えて、umbrella package、選択された platform package、native executable の realpath/SHA-256、
npm lsを記録しています。OpenAI の公式 package builder も、
@openai/codexから platform 固有 package をoptionalDependenciesとして参照する構成です。この provenance は過剰ではなく、実際の native payload を特定するために必要です。([GitHub]3)#1760 は topology 変更に限定し、
@openai/[email protected]、Node 22、version/help probe、native provenance を変更しないことを AC に入れるべきです。execpolicy check自体は現在の上流 CLI にも存在します。([GitHub]4)修正後の最低条件
実装前に #1760 を次の状態へ修正する必要があります。
.github/ci/python-test-plan.jsonと generator tests を Allowed Paths に追加する。secondary_coverage.provider_jobをcodex-execpolicyに移管する。python-testcontext を維持する fail-closed aggregate job を追加する。python_test_bench時の skip/aggregate 条件を定義する。方向性は正しいものの、現契約のままでは分離後に Codex gate が optional となり、pytest plan の coverage 証跡も破損します。Issue 契約の修正が先です。
squne121 commentedon Jul 27, 2026
Refinement Loop: Human Escalation Required
The loop has terminated and requires human review. Cause: human judgment required
human_escalationhuman_judgment_requiredBlockers
squne121 commentedon Jul 27, 2026
Refinement Loop: Human Escalation Required
The loop has terminated and requires human review. Cause: human judgment required
human_escalationhuman_judgment_requiredBlockers
squne121 commentedon Jul 27, 2026
Refinement Loop: Approved
The issue has been approved and is ready for implementation.
approvedsqune121 commentedon Jul 27, 2026
Contract Review Result
fix: #1760 CI実fail対応 (verify_ruff_configuration job名追随 + Japanese Check)
squne121 commentedon Jul 27, 2026
Contract Review Result
squne121 commentedon Jul 27, 2026
Contract Review Result
fix(#1760): PR #1824 review Blocker修正 (P0-1/P1-1〜P1-5)
squne121 commentedon Jul 27, 2026
Contract Review Result
fix: test_resolve_visual_impact.py が python-test-core lane で node_mod…
実装: visual-surface dependency registry と required visual-impact polic…
fix: root-cause CI failure as ajv/ajv-formats absence in python-test-…
fix: wire AC2 runtime-verification test into node-backed-hook-tests C…
feat: agent_session_manifest/v1 に runtime_lane/completion_outcome/com…
fix: #2422 python-test job.if を#1760 AC5要求のalways()へ復元
fix: #2422 PR #2501 OWNER REQUEST_CHANGES fix_delta (P1 Blocker 1-8)
feat: frozen E2E benchmarkをlayout A/B/A/B dispatch契約へ置換 (#2422) (#2501)
fix: node-backed-hook-tests レーンにAC2 symlink traversal limitテストを登録する (#…
fix: preparePrivateParentDir の mkdirSync/openSync 両失敗を診断し未確認ELOOPを断定し…