Skip to content

実装: pytest target plan を SSOT 化し serial→xdist 段階移行と ci_test_selection fail-close 化を行う(python-test 並列化 migration) #1064

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "1059"
goal_ref: "pytest target plan を SSOT 化し、serial 統合による実行意味論変更と xdist 並列化の安全性を段階的に証明したうえで、ci_test_selection と ci_runtime_baseline を fail-close かつ比較可能な形で移行する"
change_kind: ci-migration
runtime_verification_applicability: immediate

Parent Issue

#1059

Parent Goal Ref

CI python-test の直列構造を解消し、test lane を分離・pytest を統合・Ruff を導入・ci-test-performance Skill を追加することで、AI エージェントが CI 高速化判断を再現可能に実行できる状態にする。

Current Validated Scope

  • pyproject.toml の [dependency-groups] dev に pytest-xdist は未登録(現状 pytest>=8.0 / pyyaml>=6.0 / jsonschema>=4.0 / ruff>=0.5 のみ)。
  • python-test job の pytest step は 16 個に分割され、加えて hook discovery guard(collect-only)step と ci_test_selection artifact 生成 step が存在し、uv run / collection の固定費を毎回払っている。
  • pytest 実行 target と generate_ci_test_selection_artifact.py の pytest_args が別々にハードコードされ二重管理されている。pytest_args に schemas/tests/ が欠落しており、実行対象(別 step で実行)と artifact 証跡が drift している。
  • generate_ci_test_selection_artifact.py の get_pytest_collected_tests() は collect-only が非 0 終了・timeout(30s)・FileNotFoundError でも例外を握り潰し、空リストを返す fail-open 構造である。変更された Python test が無ければ uncovered=[] で exit 0 になり、collection 失敗を成功 artifact として upload できる。
  • docs/dev/ci-performance.md は 15 個の pytest step を stable phase inventory として定義しており、docs/dev/test-lane-policy.md と .claude/skills/ci-test-performance/SKILL.md に pytest-xdist / lane policy が記述される。これらは現行 docs として Out of Scope だった。

Remaining Parent Gaps

なし(本 Issue が #1059 の最終 child)。並列化後の ci_runtime_baseline_v1 集約方式変更も本 Issue scope に含めて反映済み。

Runtime Verification Applicability

decision: immediate

applicable_acs: AC3, AC4, AC5, AC9, AC11

execution_environment: GitHub Actions python-test job(同一 runner image・同一 runner 条件で base/head 各 20 run)

skip_conditions: none(runtime 観測を伴う本 Issue で SKIP は不可)

fallback_policy: live CI run が参照不能な場合も SKIP せず、committed evidence artifact docs/dev/ci-runtime-baseline-1064.md の必須フィールド存在を決定論的に検査して代替検証する。artifact 欠落時は fail-close。

artifact_requirements: docs/dev/ci-runtime-baseline-1064.md に base/head 20 run の P50/P95・run ID 一覧・runner image・resolved_workers・scheduler・xdist_version・現行分割実行と unified serial の nodeid_hash 一致・parallel_repeat(5 回連続実行の race/crash 無し)を記録する。

本 Issue は CI 実行時間・並列化挙動・collection 証跡という runtime 観測を伴うため、docs/dev/runtime-verification-policy.md の immediate 規約に従う。

  • AC3 / AC4 / AC5 / AC9 / AC11 は CI runtime 観測 AC であり、実 CI run の証跡を docs/dev/ci-runtime-baseline-1064.md(committed evidence artifact)へ記録して検証する。SKIP は不可。
  • 各 runtime AC の VC は live CI ではなく committed evidence artifact の必須フィールド存在を決定論的に検査する。実測値の妥当性(runner image 同一性・20 run・flake 除外)は PR レビューと runtime-verification-policy の証跡監査で担保する。
  • AC1 / AC2 / AC6 / AC7 / AC8 / AC10 / AC12 は静的・決定論的に検証可能であり runtime 観測を要しない。

Outcome

pytest-xdist>=3.8,<4 を dev dependency へ追加し、pytest target / --ignore / --deselect / worker 数 / scheduler を単一の machine-readable plan(.github/ci/python-test-plan.json)へ集約して pytest 実行と ci_test_selection/v1 artifact 生成の双方に同一 plan を消費させる。現行分割実行と unified serial(-n 0)の collected nodeid 集合・件数・hash 一致を証明し、その後初めて xdist 並列化を有効化する。generate_ci_test_selection_artifact.py を collect 非 0 / timeout / nodeid 0 件で fail-close へ修正し、pytest_argv に schemas/tests/ を正確に 1 回含めて実行 plan と完全一致させる。docs/dev/ci-performance.md の stable phase inventory・docs/dev/test-lane-policy.md・.claude/skills/ci-test-performance/SKILL.md を最終 workflow に同期し、base/head それぞれ同一 runner 条件 20 run の P50/P95・run ID・worker 数・scheduler・xdist version を docs/dev/ci-runtime-baseline-1064.md に記録する。python-test / actionlint / pnpm typecheck / pnpm lint / pnpm test / pnpm build がすべて成功すること。

In Scope

  • pyproject.toml の [dependency-groups] dev に pytest-xdist>=3.8,<4 を追加し、uv lock で uv.lock を更新する。
  • pytest target / --ignore / --deselect / worker 数 / scheduler を単一の machine-readable plan .github/ci/python-test-plan.json へ集約し、shell 文字列 eval を避けて JSON / NUL 区切りから安全に読み込む loader scripts/ci/python_test_plan.py(+ scripts/ci/tests/)を追加する。
  • python-test job の分割 pytest step を、上記 plan を消費する unified invocation へ統合する(serial -n 0 互換性検証を経たうえで xdist を有効化)。hook discovery の collect-only guard と専用 Node-backed lane の境界は維持する。
  • generate_ci_test_selection_artifact.py を、collect 終了コード・timeout・stderr を artifact へ記録し、collect 非 0 / timeout / nodeid 0 件を CI failure にする fail-close 構造へ修正する。pytest_args を plan から導出し schemas/tests/ を含める。negative test を .claude/skills/pr-review-judge/scripts/tests/ に追加する。
  • JUnit XML・--durations・resolved worker 数・scheduler・xdist version を CI artifact として保存する。
  • docs/dev/ci-performance.md の stable phase inventory・docs/dev/test-lane-policy.md・.claude/skills/ci-test-performance/SKILL.md を最終 workflow と同期する。
  • base/head それぞれ同一 runner 条件 20 run の P50/P95・run ID・採用 scheduler 選択理由・nodeid 一致 hash を docs/dev/ci-runtime-baseline-1064.md に記録する。

Out of Scope

  • python-test 以外の job の変更。
  • E2E / Playwright の変更。
  • テストコード(test 関数本体)の意味的変更。ただし plan SSOT / loader / generator とそれらの test は tooling として In Scope。
  • 本 Issue に無関係な docs の変更。

Acceptance Criteria

  • AC1: pyproject.toml の dev dependency に pytest-xdist>=3.8,<4 が追加され、uv.lock に解決済み pytest-xdist version が固定されていること。
  • AC2: pytest target / --ignore / --deselect / worker 数 / scheduler を集約した machine-readable plan .github/ci/python-test-plan.json が追加され、scripts/ci/python_test_plan.py loader を pytest 実行と artifact 生成の双方が消費すること。
  • AC3: 現行分割実行と unified serial(-n 0)の collected nodeid 集合・件数・hash 一致と、unified serial run の pass が docs/dev/ci-runtime-baseline-1064.md に nodeid hash 付きで記録されていること。
  • AC4: 固定 worker 数で --dist load / loadscope / worksteal を比較し、採用 scheduler の選択理由と P50/P95 が docs/dev/ci-runtime-baseline-1064.md に記録されていること。
  • AC5: 採用した parallel command を 5 回以上連続実行し、collection mismatch / worker crash / race failure が無いことが docs/dev/ci-runtime-baseline-1064.md に記録されていること。
  • AC6: generate_ci_test_selection_artifact.py が collect 非 0 / timeout / nodeid 0 件で fail-close し、collection_status を artifact へ記録すること。
  • AC7: 生成 artifact の pytest_argv が実行 plan と完全一致し、schemas/tests/ を正確に 1 回含み、collected nodeid が空でないこと。
  • AC8: hook discovery の --ignore / --deselect 契約と専用 Node-backed lane の境界が維持されていること。
  • AC9: JUnit XML・--durations・resolved worker 数・scheduler・xdist version が CI artifact として保存されること。
  • AC10: docs/dev/ci-performance.md の stable phase inventory・docs/dev/test-lane-policy.md・.claude/skills/ci-test-performance/SKILL.md が最終 workflow に同期されていること。
  • AC11: base/head それぞれ同一 runner 条件 20 run の P50/P95・run ID・runner image が docs/dev/ci-runtime-baseline-1064.md に記録されていること。
  • AC12: pnpm typecheck / pnpm lint / pnpm test / pnpm build がすべて exit 0 を返すこと。

Verification Commands

# AC1
$ rg -c "pytest-xdist.*3.8" pyproject.toml
# AC1
$ rg -c "pytest-xdist" uv.lock
# AC2
# baseline-expect: fail
$ test -f .github/ci/python-test-plan.json
# AC2
# baseline-expect: fail
$ test -f scripts/ci/python_test_plan.py
# AC2
$ rg -c "python-test-plan" .claude/skills/pr-review-judge/scripts/generate_ci_test_selection_artifact.py
# AC3
# baseline-expect: fail
$ test -f docs/dev/ci-runtime-baseline-1064.md
# AC4
# baseline-expect: fail
$ test -f docs/dev/ci-runtime-baseline-1064.md
# AC5
# baseline-expect: fail
$ test -f docs/dev/ci-runtime-baseline-1064.md
# AC6
$ rg -c "collection_status" .claude/skills/pr-review-judge/scripts/generate_ci_test_selection_artifact.py
# AC7
# baseline-expect: fail
$ test -f .github/ci/python-test-plan.json
# AC8
# baseline-expect: pass
$ rg -c "collect-only" .github/workflows/ci.yml
# AC9
$ rg -c "junitxml" .github/workflows/ci.yml
# AC9
# baseline-expect: fail
$ test -f docs/dev/ci-runtime-baseline-1064.md
# AC10
$ rg -c "python-test-plan" .claude/skills/ci-test-performance/SKILL.md
# AC10
$ rg -c "python-test-plan" docs/dev/test-lane-policy.md
# AC11
# baseline-expect: fail
$ test -f docs/dev/ci-runtime-baseline-1064.md
# AC12
# baseline-expect: pass
$ pnpm typecheck

Allowed Paths

  • .github/workflows/ci.yml
  • .github/ci/python-test-plan.json
  • scripts/ci/python_test_plan.py
  • scripts/ci/
  • scripts/ci/tests/
  • pyproject.toml
  • uv.lock
  • .claude/skills/pr-review-judge/scripts/generate_ci_test_selection_artifact.py
  • .claude/skills/pr-review-judge/scripts/tests/
  • docs/dev/ci-performance.md
  • docs/dev/test-lane-policy.md
  • docs/dev/ci-runtime-baseline-1064.md
  • .claude/skills/ci-test-performance/SKILL.md
  • .claude/skills/impl-review-loop/tests/test_handoff_pr_hygiene_regression.py

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合。
  • In Scope の固定契約(plan のキー集合・schema・型定義)の変更が必要になった場合。
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)。
  • 後続 Phase / 別スコープへの波及が判明した場合。
  • nested SubAgent delegation が必要になった場合。
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合。
  • serial -n 0 の collected nodeid 集合・件数・hash が現行分割実行と一致しない場合(意味論 drift を特定し Stop)。
  • xdist 並列化後にテストが flake になる場合(共有 fixture / cwd / 共有 artifact への並行アクセスを特定し Stop)。

Required Skills

  • GitHub Actions YAML(actionlint)
  • Python packaging(pyproject.toml / uv / --locked)
  • pytest-xdist(-n / --dist scheduler / known limitations)
  • ci-test-performance(ci_test_selection/v1 / ci_runtime_baseline_v1)

Delivery Rule

1 Issue = 1 PR。worktree を作成して実装する。Draft PR で起票し、CI(python-test / actionlint / pnpm typecheck / pnpm lint / pnpm test / pnpm build)が通ったことを確認してから draft を外す。serial -n 0 互換性検証 → xdist 有効化 → 連続実行 flake 検査の順を守り、docs/dev/ci-runtime-baseline-1064.md に base/head 20 run の P50/P95・run ID・worker 数・scheduler・xdist version・nodeid hash を必須添付する。Depends on #1063 merge。

Scope Delta (#1064 impl-review-loop)

serial -n 0 統合により単一プロセス化したことで、移行前は別プロセス境界が隠していた既存の
test-isolation 問題が顕在化した(collected nodeid 集合自体は不変)。本 Issue の中核である「serial 統合に
よる実行意味論変更の安全化」を同一 PR で完結させるため、以下 1 ファイルを Allowed Paths に追加した:

  • .claude/skills/impl-review-loop/tests/test_handoff_pr_hygiene_regression.py
    — validate_pr_body 同名モジュール衝突を、一意モジュール名+sys.modules 事前登録で解消し、changed_paths
    非空化で LP058 混入を排除(LP057 単独検証という本来の意図を保持。assertion の意味は不変)。

debounce timing flake(test_session_manifest_debounce.py)は plan SSOT(.github/ci/python-test-plan.json)の
parallel_exclude + ci.yml の serial lane で解消しており、これらは既存 Allowed Paths 内のため追加パスは不要。
詳細は docs/dev/ci-runtime-baseline-1064.md §5 を参照。

Scope Delta 2 (#1064 OWNER review 反映)

PR #1151 への OWNER REQUEST_CHANGES(false-green / fail-close / 固定 worker / lane 検証)を解消する過程で、
以下の CI helper を scripts/ci/ 配下に追加した。Allowed Paths に scripts/ci/(ディレクトリ)を追加する:

  • scripts/ci/collect_nodeids_plugin.py — pytest collection の node ID を JSON 出力する plugin(stdout 解析の脆弱性を排除)。
  • scripts/ci/verify_lane_union.py — parallel ∪ serial == scope / ∩ == ∅ の lane 不変条件を CI 検証。
  • scripts/ci/verify_python_test_manifest.py — parallel + serial の JUnit testcase 合計 == scope collected を検証(AC9)。

これらは B1(false-green 除去)/ B3(全体 JUnit manifest)/ B6(lane union 検証)の必須コンポーネントである。

Activity

  1. squne121 commented on Jun 23, 2026

    @squne121
    OwnerAuthor

    判定

    REQUEST_CHANGES。現行の #1064 は実装開始不可です。

    pytest起動回数の削減と並列化の方向性は妥当です。ただし現在の契約では、テスト選択証跡が壊れたままCIをgreenにでき、性能比較も再現不能です。単なる「pytest統合+-n auto」ではなく、テスト集合・実行意味論・証跡契約を維持するmigrationとして再設計すべきです。

    関連履歴もこの判断を補強します。#1078/#1060でlane policyとskillが導入され、#1121ではpnpm削除後に実際にpython-testが破損し、#1123でNode依存テストを専用laneへ退避しています。#1129/#1063ではRuff gateが追加済みです。したがって#1064は当初のworkflowを前提にせず、これらの変更後の現行構造を基準にする必要があります。

    実測で確認した現状

    直近の成功したpython-test runのartifactを集計すると、pytestは15回起動され、pytest_skillsの合計は216.989秒でした。主な内訳はhook tests 84.972秒、issue-contract-review scripts 39.868秒、issue-refinement-loop 32.796秒です。ci_test_selectionは4,106 nodeid、128 collected filesを記録していますが、pytest_argvからschemas/tests/が欠落しています。一方、schemas自体は別stepで既に実行されています。つまり問題は実行漏れではなく、実行対象と証跡のdriftです。

    ただし、これはhotspotの形を把握するための単一runであり、改善判定には使えません。リポジトリの性能ポリシーは、少数runをcalibration、意思決定用baselineを20 runのP50/P95として区別しています。

    Blocker

    1. ci_test_selection生成器がfail-open

    現行生成器はpytest --collect-onlyが非0終了しても失敗扱いせず、30秒timeoutや実行ファイル不在も握り潰して空リストを返します。その後、変更されたPython testがなければuncovered=[]となりexit 0になります。

    したがって、collectionが完全に失敗しているのに、空の成功artifactを生成できる状態です。#1064がschemas/tests/という文字列だけを追加しても、証跠品質は保証されません。

    修正には少なくとも以下が必要です。

    • collect終了コード、timeout、stderrをartifactへ記録
    • collect非0、timeout、nodeid 0件をCI failureにする
    • generatorのnegative testを追加
    • collection_status: okをupload前に検証

    しかしgeneratorは現在のAllowed Paths外です。Allowed Pathsへ以下を追加しない限り、このBlockerは解消できません。

    .claude/skills/pr-review-judge/scripts/generate_ci_test_selection_artifact.py
    .claude/skills/pr-review-judge/scripts/tests/**
    

    2. pytest targetが二重管理されている

    実際の各pytest stepとartifact generatorの--pytest-argsが別々にハードコードされています。これが今回のschemas/tests/ driftの直接原因です。片方にschemasを追記するだけでは、次のtarget変更時に再発します。

    pytest実行とartifact生成は同一のmachine-readable planを消費させるべきです。

    推奨構成は次のいずれかです。

    .github/ci/python-test-plan.json
    scripts/ci/python_test_plan.py
    

    planにはtargetだけでなく、--ignore、--deselect、worker数、schedulerも含めます。workflow内のshell文字列をevalする方式は避け、JSONまたはNUL区切りからshell arrayへ安全に読み込むべきです。

    3. Allowed Pathsと既存証跡契約が矛盾している

    現在のci-performance.mdは、15個のpytest step_idをstable phase inventoryとして定義しています。これらを1 stepへ統合すると、既存baselineとの比較軸が変わります。またtest-lane policyとcanonical skillにもpytest-xdistのtarget policyが記載されています。#1064はdocs変更をOut of Scopeとしているため、実装するとdocsとartifact contractが即座にstaleになります。

    Allowed Pathsへ次を追加すべきです。

    docs/dev/ci-performance.md
    docs/dev/test-lane-policy.md
    .claude/skills/ci-test-performance/SKILL.md
    

    特にpytest_skills phaseの集約規則を維持し、統合前後で同じphase_idを比較可能にする必要があります。

    4. 「統合」と「並列化」を一段で実施している

    これは異なる二つの意味論変更です。

    1. 複数pytest process → 1 process
      import cache、sys.path、環境変数、module state、fixture stateの隔離が失われる。
    2. 1 process → xdist workers
      固定パス、外部プロセス、session fixture、cwd、共有artifactへの並行アクセスが発生する。

    pytest-xdistでは全workerのcollection順序・件数が一致しなければならず、session-scope fixtureもworkerごとに実行されます。共有初期化が一度だけ必要なら、worker識別子やinter-process lockが必要です。([pytest-xdist]1) (pytest-xdist)

    導入順は次に固定すべきです。

    1. 現行分割実行のnodeid set/hashを採取
    2. unified invocationを-n 0で実行
    3. nodeid set/hashと全テスト結果が一致することを確認
    4. 初めてxdistを有効化
    5. 並列実行を複数回繰り返し、flakeを検査

    serial compatibility runは移行PRの証跡でよく、恒久CIでserialとparallelを二重実行する必要はありません。

    5. -n autoとschedulerが無根拠

    -n autoは物理CPU core数に応じてworker数が変わります。defaultの--dist loadには実行順保証がありません。loadscopeはmodule/class単位、loadfileはfile単位、workstealはdurationの偏りが大きいsuite向けです。今回の実測は84秒、39秒、32秒と偏りが大きいため、workstealが候補になりますが、計測なしで固定すべきではありません。([pytest-xdist]3)

    最低限、同じrunner条件で以下を比較してください。

    -n <fixed-count> --dist load
    -n <fixed-count> --dist loadscope
    -n <fixed-count> --dist worksteal
    

    最終的にはworker数を明示または上限設定し、次をartifactへ記録すべきです。

    xdist:
      requested_workers: 4
      resolved_workers: 4
      scheduler: worksteal
      version: 3.8.0
    runner_image: ubuntu24/...

    autoを残す場合でも、PYTEST_XDIST_AUTO_NUM_WORKERSまたは--maxprocessesでcapし、resolved worker数を記録する必要があります。GitHub-hosted runnerのimageと同梱ソフトウェアは更新されるため、runner image自体も比較条件です。([pytest-xdist]3)

    6. Verification CommandsがACを証明していない

    現在の以下の検証は無効です。

    rg -c "pytest" .github/workflows/ci.yml

    これは他job、collect-only、step名、スクリプト名まで数えるため、「python-testの実行invocationが1回」を証明しません。現在のworkflowにはhook test discoveryを保護する別のcollect-only guardもあり、単純にpytest文字列を減らす実装は、この安全装置を誤って削除する誘因になります。

    同様に、rg -c "schemas/tests"はartifact内容との一致を証明しません。YAMLのjobs.python-test.stepsを構造的に解析し、生成artifactのJSONを検証する必要があります。

    7. 性能判定契約が不足

    Issueは「before/after比較を添付」としか定義していませんが、次が未定義です。

    • base SHA / head SHA
    • runner image
    • worker数とscheduler
    • run ID一覧
    • P50/P95
    • collect数
    • phase集約方式
    • 許容regression閾値
    • flaky runの除外方針

    親Issueは、並列化後のci_runtime_baseline_v1集約方式変更も#1064のscopeに含めています。現行childのAllowed PathsとACには反映されていません。

    8. dependency指定とrequired gatesが弱い

    PyPI上の現行pytest-xdistは3.8.0です。3.6.0はpytest-covとの重大なregressionでyankされています。uv.lockが実際の解決versionを固定するため直ちに危険ではありませんが、2026年時点で新規導入を>=3.6から開始する理由はありません。pytest-xdist>=3.8,<4程度へ更新し、lockされた実versionを証跡化する方が明確です。([PyPI]4)

    またOutcomeにはpnpm buildが含まれる一方、ACにはtypecheckとtestしかありません。親Issueはtypecheck/test/buildの3 gateを要求しています。pnpm lint、workflow構文検証、実際のpython-test required checkも追加すべきです。

    推奨する改訂Acceptance Criteria

    1. pytest-xdist>=3.8,<4をdev dependencyへ追加し、uv lock --check、uv sync --locked --group dev、xdist plugin activationが成功する。
    2. pytest target、ignore、deselectを一つのmachine-readable planへ集約し、pytest実行とartifact生成の双方が同じplanを使用する。
    3. 現行分割実行とunified -n 0のcollected nodeid集合・件数・hashが一致し、unified serial runがpassする。
    4. 固定worker数でload、loadscope、workstealを比較し、選択理由とP50/P95をPR本文へ記録する。
    5. 採用したparallel commandを5回以上連続実行し、collection mismatch、worker crash、race failureがない。
    6. ci_test_selection生成器はcollect非0、timeout、nodeid 0件でfail-closeする。
    7. artifactのpytest_argvが実行planと完全一致し、schemas/tests/を正確に1回含み、collected nodeidが空でない。
    8. hook discoveryのignore/deselect契約と専用Node-backed laneの境界を維持する。
    9. JUnit XML、--durations、worker数、scheduler、xdist versionをartifactとして保存する。
    10. ci-performance.mdのstable phase inventory、test-lane policy、canonical skillを最終workflowに同期する。
    11. base/headそれぞれについて同一runner条件の20 runを採取し、P50/P95とrun IDを記録する。
    12. python-test、actionlint、pnpm typecheck、pnpm lint、pnpm test、pnpm buildがすべて成功する。

    uvのdev dependencyは[dependency-groups]で管理され、--lockedはlockfileがstaleなら更新せず失敗します。したがってgrepではなく、実際のlock整合性とplugin activationを検証すべきです。([Astral Docs]5)

    最終結論

    #1064は、現状の「pytestを1回にまとめて-n autoを付けるIssue」から、次へ変更すべきです。

    pytest target planをSSOT化し、serial統合による実行意味論とxdist並列化の安全性を段階的に証明し、ci_test_selectionおよびci_runtime_baselineをfail-closeかつ比較可能な形で移行する。

    特に、artifact generatorのfail-open修正、Allowed Paths拡張、serial -n 0互換性検証、20-run P50/P95契約が入るまでは、implementation-workerへ渡すべきではありません。

  2. changed the title [-]実装: pytest invocation を統合し pytest-xdist を導入、ci_test_selection に schemas/tests/ を追加する[/-] [+]実装: pytest target plan を SSOT 化し serial→xdist 段階移行と ci_test_selection fail-close 化を行う(python-test 並列化 migration)[/+] on Jun 23, 2026
  3. squne121 commented on Jun 23, 2026

    @squne121
    OwnerAuthor

    Refinement Loop: Approved

    OWNER の REQUEST_CHANGES(#issuecomment-4778510355、8 Blocker / 12 改訂 AC)を anchor として #1064 を再設計し、reviewer approve と issue-contract-review の status: go を確認しました。実装着手可能(impl_ready)です。

    反映した owner 判断の要点

    • 「pytest 統合+-n auto」から、pytest target plan の SSOT 化(.github/ci/python-test-plan.json + scripts/ci/python_test_plan.py loader)/serial(-n 0) 互換性検証 → xdist 段階移行/ci_test_selection 生成器の fail-close 化/20-run P50/P95 性能契約 への migration へ再設計。
    • Allowed Paths を拡張(generator+tests、plan SSOT、loader+tests、docs/dev/ci-performance.md、docs/dev/test-lane-policy.md、docs/dev/ci-runtime-baseline-1064.md、ci-test-performance skill)。docs は Out of Scope から除外。
    • AC を 12 本へ改訂し、runtime 観測 AC(AC3/4/5/9/11)は ## Runtime Verification Applicability: immediate と committed evidence artifact docs/dev/ci-runtime-baseline-1064.md で決定論的に検証。
    • VC を rg -c "pytest" ci.yml のような無効検証から、新 Allowed Path の存在・新規 content marker・regression gate の決定論的検証へ置換。全 VC が baseline で expected_fail(15)/ expected_pass(2、annotated)に分類され human_judgment ゼロ。
    • native dependency と本文の整合(Depends on #1063)を修正。

    検証サマリ

    • review-issue(check_issue_contract.py): C1–C11 すべて pass、verdict approve。
    • issue-contract-review(run_contract_review_once.py --mode execute): status: go / source: all_checks_pass(readiness=go, blockers=pass, product_spec=pass, vc_preflight=pass)。
    • baseline_vc_preflight.py --strict: status: pass(expected_fail 15 / expected_pass 2 / unexpected_pass 0 / blocked 0 / human_judgment 0)。
    LOOP_HANDOFF_RESULT_V1:
      status: impl_ready
      routing_action: run_impl_review_loop
      contract_review:
        status: go
        gate_result: fresh_go
        latest_comment_url: null
        generated_at: "2026-06-23T11:27:00Z"
        body_sha256: "sha256:58e437fd59a383be5b5d28b9612ecd8e984bd69f935bb777d72faa0333ae26a7"
      metadata:
        title_prefix_ready: true
        phase_label_ready: true
      auto_fixes:
        result: auto_fixed
        required: []
        skipped: []
      blockers: []
      permissions:
        unavailable: []
      generated_at: "2026-06-23T11:27:00Z"
      checked_body_sha256: "sha256:58e437fd59a383be5b5d28b9612ecd8e984bd69f935bb777d72faa0333ae26a7"
      checker_exit_code: 0
      missing_sections: []
      missing_contract_keys: []
    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: issue-refinement-loop
      follow_up_issues: []
      note_only_observations: []

    次アクション

    本 Issue は #1059 の最終 child です。Depends on #1063(CLOSED)であり依存はすべて merge 済みのため、impl-review-loop へ handoff 可能です。実装時は serial -n 0 互換性検証 → xdist 有効化 → 連続実行 flake 検査の順を守り、docs/dev/ci-runtime-baseline-1064.md に base/head 20-run の証跡を記録してください。

  4. squne121 commented on Jun 23, 2026

    @squne121
    OwnerAuthor

    Contract Review Result

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-06-23T11:39:57Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/1064
      body_sha256: "sha256:1d50d949d6336797782bb7bc84c547f2e87d89aa95ef6d27af27776da1a0e23e"
      checks:
        readiness: go
        blockers: pass
        product_spec: pass
        vc_preflight: pass
      source: ensure_contract_snapshot_auto
  5. added 5 commits that reference this issue on Jun 23, 2026
  6. squne121 commented on Jun 24, 2026

    @squne121
    OwnerAuthor

    Contract Review Result

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-06-24T17:44:06Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/1064
      body_sha256: "sha256:953d683d0ffd4af547105ea510a66e431e2b2ff492b36f7daa28d91d0783e76d"
      checks:
        readiness: go
        blockers: pass
        product_spec: pass
        vc_preflight: pass
      source: ensure_contract_snapshot_auto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    phase/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions