Skip to content

実装: scope-rollup GraphQL pagination テストを python-test plan へ登録する #1644

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "PR #1643 に追加された scope-rollup GraphQL pagination test を python-test-plan SSOT と ci_test_selection/v1 evidence へ統合し、#1643 current head のCIで coverage を証明する"
change_kind: workflow

Parent Issue

none

Parent Goal Ref

Current Validated Scope

Remaining Parent Gaps

Outcome

PR #1643 branch を base にした #1644 の stacked Draft PR が .github/ci/python-test-plan.json と2種類の regression testを更新し、その変更を #1643 branch へ統合後の current-head CI で pagination test の collected / uncoveredなしを証明できる状態になる。

In Scope

Out of Scope

Acceptance Criteria

Verification Commands

# AC1
$ uv run --locked pytest scripts/ci/tests/test_python_test_plan.py -q
# AC2
$ uv run --locked pytest scripts/ci/tests/test_python_test_plan.py -q
# AC3
$ uv run --locked pytest .claude/skills/pr-review-judge/scripts/tests/test_generate_ci_test_selection_fail_close.py -q
# AC4
$ uv run --locked pytest scripts/ci/tests/test_python_test_plan.py .claude/skills/pr-review-judge/scripts/tests/test_generate_ci_test_selection_fail_close.py -q

Allowed Paths

  • .github/ci/python-test-plan.json
  • scripts/ci/tests/test_python_test_plan.py
  • .claude/skills/pr-review-judge/scripts/tests/test_generate_ci_test_selection_fail_close.py

Stop Conditions

Required Skills

  • ci-test-performance

Required Design References

  • docs/dev/test-lane-policy.md
  • docs/dev/agent-skill-boundaries.md
  • docs/dev/workflow.md

Runtime Verification Applicability

decision: immediate
reason: final completion is defined by the GitHub Actions current-head evidence of PR #1643 after #1644 integration.
applicable_acs: [AC4]
execution_environment:
  required_checks:
    - python-test
    - node-backed-hook-tests
  network_required: true
  github_auth_required: true
skip_conditions:
  - required checks が pending、skipped、または失敗の場合は PASS として扱わない。
fallback_policy:
  - github_live marker、workflow対象除外、fake transport で coverage を回避しない。
artifact_requirements:
  - PR #1643 の current head SHA
  - python-test success と ci_test_selection/v1 の collection / uncovered evidence
  - node-backed-hook-tests success

CI Test Performance Decision

CI_TEST_PERFORMANCE_DECISION_V1:
  schema: CI_TEST_PERFORMANCE_DECISION_V1
  issue_number: 1644
  pr_number: 1643
  decision_scope: ci_change
  changed_paths:
    - .github/ci/python-test-plan.json
    - scripts/ci/tests/test_python_test_plan.py
    - .claude/skills/pr-review-judge/scripts/tests/test_generate_ci_test_selection_fail_close.py
  lane_classification:
    fast_static: {applicable: false, evidence: [], required_commands: []}
    python_unit: {applicable: true, evidence: [python-test-plan], required_commands: [pytest]}
    contract_artifact: {applicable: true, evidence: [ci_test_selection/v1], required_commands: [pytest]}
    integration: {applicable: false, evidence: [], 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: [stacked_pr_requires_1643_current_head_evidence]
  reviewer_gate:
    approve_allowed: false
    required_evidence: [TEST_VERDICT_MACHINE, CI_CHECK_RUN_SCOPED]
  follow_up_required: []

Scope Collision

Delivery Rule

Activity

  1. added
    enhancement
    phase/implementation
    triage-required
    agent/implementer
    on Jul 19, 2026
  2. squne121 commented on Jul 19, 2026

    @squne121
    OwnerAuthor

    判定

    REQUEST_CHANGES — reframe_in_place。

    tests/codex/test_scope_rollup_graphql_pagination_v3.py を python-test plan の SSOT に登録する方針自体は正しいです。現行の plan は pytest 実行対象と ci_test_selection/v1 の双方を生成する正本であり、新規テストは network 不要の fake transport を使っているため、github_live へ逃がすべきではありません。

    ただし、現在の Issue 契約は依存順序が循環し、Outcome を達成不能です。

    マージブロッカー

    P0-1. 1 Issue = 1 PR のままでは循環依存になる

    #1644 は PR #1643 と別PRにする契約ですが、登録対象ファイルは PR #1643 で新規追加されたもので、現行 main にはありません。一方、plan loader の --check-paths は登録された全 path の実在を強制します。したがって、main から作った通常の #1644 PR は、対象ファイルを plan に追加した瞬間に AC1 が失敗します。

    逆に PR #1643 を先に main へマージしようとしても、current-head CI は失敗しています。つまり現状は次の循環です。

    #1644 を先にマージ
      → test file が main に存在せず --check-paths failure
    
    #1643 を先にマージ
      → test 未登録・既存 regression failure により CI failure
    

    推奨は、plan 登録を PR #1643 に統合することです。1 Issue = 1 PR を絶対維持するなら、#1644 PR の base を main ではなく PR #1643 の head branch にする stacked PR とし、明示的な統合順序を契約化する必要があります。GitHub の PR は任意の branch を base にできますが、非 default branch 向けPRでは Closes #1644 の自動 close は機能しません。([GitHub Docs]1)

    P0-2. #1644 だけ直しても PR #1643 の python-test は成功しない

    PR #1643 current head 8da7a1d4bab37f497c8fb7c5ccf8c6b0c3e8e998 の CI は、python-test と node-backed-hook-tests が failure です。

    current-head の python-test-junit-1 artifact を展開すると、結果は次のとおりでした。

    7 failed, 8429 passed, 8 skipped, 2 xfailed
    

    失敗しているのはすべて既存の tests/codex/test_run_scope_rollup_preflight.py です。

    • test_pagination_truncation_fails_closed
    • test_total_count_mismatch_fails_closed
    • test_pr_files_pagination_completes_past_100
    • test_pr_files_pagination_incomplete_fails_closed
    • test_cleanup_across_all_exit_paths
    • test_manifest_fields_recorded
    • test_stdout_stderr_separation

    旧 gh issue/pr list 前提の fake command dispatcher が、新しい gh api graphql を unexpected gh args として拒否しています。artifact 自体は current head に結び付いたものです。

    [展開結果の要約](sandbox:/mnt/data/pr1643-python-test-failures.txt)

    しかし、#1644 の Allowed Paths にはこの既存テストファイルがありません。したがって、#1644 の Outcome にある「PR CI が成功する」は、現行 scope では成立しません。

    これは既に Stop Condition に該当しています。対応は次のどちらかです。

    1. 実装: scope_rollup.run の GitHub inventory を完全 pagination で取得する #1593 の Allowed Paths に tests/codex/test_run_scope_rollup_preflight.py を追加し、PR fix(scope-rollup): GitHub inventory を完全 pagination 化 #1643 内で既存 fixture を GraphQL transport に移行する。
    2. 別の compatibility issue を先行 dependency として作り、実装: scope-rollup GraphQL pagination テストを python-test plan へ登録する #1644 をその完了まで blocked にする。

    P0-3. #1644 PR 自身の artifact では元の uncovered failure を証明できない

    ci_test_selection/v1 は明示的な base_sha...head_sha の diff から changed test files を抽出します。

    stacked PR とした場合、pagination test は #1644 の base branchである PR #1643 側に既に存在します。そのため、#1644 PR の changed files には pagination test が含まれず、#1644 の artifact が緑でも、元の uncovered failure を直接再現・解消した証拠にはなりません。

    最終証跡は #1644 の変更を取り込んだ後の PR #1643 current-head CI に固定すべきです。GitHub の required check も最新 commit SHA に対して成功している必要があります。([GitHub Docs]2)

    ACには少なくとも次を要求してください。

    required_evidence:
      pull_request: 1643
      head_sha: "<#1644 integration 後の current head>"
      python_test:
        conclusion: success
        collection_status_ok: true
        diff_status_ok: true
        collected_test_files_contains:
          - tests/codex/test_scope_rollup_graphql_pagination_v3.py
        uncovered_changed_test_files: []
      node_backed_hook_tests:
        conclusion: success

    High priority

    P1-1. AC3 の regression test が曖昧

    「追加または更新する」では実装者が弱い mock test を追加して終了できます。既存の test_generate_artifact_pr_body_validator_is_covered と同じ強度に固定すべきです。

    指定すべき assertion は以下です。

    changed_file = "tests/codex/test_scope_rollup_graphql_pagination_v3.py"
    
    assert pytest_argv.count(changed_file) == 1
    assert artifact["changed_test_files"] == [changed_file]
    assert artifact["collected_test_files"] == [changed_file]
    assert artifact["uncovered_changed_test_files"] == []
    assert generate_artifact(args) == 0

    テスト名も固定してください。

    test_generate_artifact_scope_rollup_graphql_pagination_is_covered
    

    P1-2. Parent #1059 の closure contract と不整合

    #1644 は parent_issue: "1059" を宣言していますが、#1059 の child-complete 条件には #1060/#1061/#1063/#1064 しかありません。現状では #1644 が open のままでも parent を close できます。

    次のいずれかが必要です。

    P1-3. Scope Collision の「並行可能」は誤り

    対象 test file の存在、plan path validation、PR #1643 の changed-file evidence が相互依存しています。単なる「同時変更時は新しいPRを rebase」では足りません。

    dependency_ordering:
      mode: stacked
      upstream_pr: 1643
      base_ref: worktree-issue-1593-scope-rollup-run-github-inventory-pagina
      merge_target: upstream_pr_head_branch
      final_ci_owner: 1643
      main_merge_order:
        - integrate_1644_into_1643
        - fix_existing_preflight_regressions
        - rerun_1643_current_head_ci
        - merge_1643_to_main

    P1-4. 個別ファイル列挙は再発しやすい

    現行 plan は tests/codex/ 配下を directory target にせず、多数のファイルを個別列挙しています。今回の uncovered はこの運用の自然な再発です。

    pytest は directory を target として再帰的に収集できるため、長期的には tests/codex/ 全体を対象にし、専用 lane・runtime-only test・除外対象だけを明示的に分類する方が保守しやすいです。([pytest ドキュメント]3)

    ただし、これは #1644 で即変更すると dedicated lane と二重実行する危険があるため、別 hardening issue が適切です。最低限、今後は「新規 Python test file が plan、secondary coverage、runtime-only exemption のいずれにも属さない場合に失敗する」directory-wide guard を検討すべきです。

    改訂後の完了条件

    #1644 は次の形に修正するのが妥当です。

    1. PR fix(scope-rollup): GitHub inventory を完全 pagination 化 #1643 を明示的 upstream dependency とする。
    2. 実装: scope-rollup GraphQL pagination テストを python-test plan へ登録する #1644 PR を PR fix(scope-rollup): GitHub inventory を完全 pagination 化 #1643 head branch ベースの stacked PR とするか、変更を PR fix(scope-rollup): GitHub inventory を完全 pagination 化 #1643 に統合する。
    3. plan target と2種類の regression testを追加する。
    4. tests/codex/test_run_scope_rollup_preflight.py の7件の failureは 実装: scope_rollup.run の GitHub inventory を完全 pagination で取得する #1593 側で解消する。
    5. 実装: scope-rollup GraphQL pagination テストを python-test plan へ登録する #1644 統合後の PR fix(scope-rollup): GitHub inventory を完全 pagination 化 #1643 current-head で python-test と node-backed-hook-tests を成功させる。
    6. PR fix(scope-rollup): GitHub inventory を完全 pagination 化 #1643 の ci_test_selection/v1 で対象 test が collected かつ uncovered なしであることを証跡化する。
    7. CI python-test pytest実行phase高速化: test lane分類・pytest統合・Ruff導入・Skill化 #1059 の closure contract を更新する。

    登録漏れの修正方針は妥当ですが、現状の Issue は単独実装可能な作業として定義されていません。依存順序、既存 regression migration、最終証跡の所有PRを先に固定しない限り、実装開始不可です。

  3. squne121 commented on Jul 19, 2026

    @squne121
    OwnerAuthor

    Refinement Loop: Human Escalation Required

    The loop has terminated and requires human review. Cause: human judgment required

    Blockers

    "review compact producer was blocked by local_main_branch_guard rule issue_refinement_direct before artifact creation"
    
    "C11: decision immediate requires runtime-verification tag on at least one AC"
    
    "VC preflight: AC1 command is outside the allowlist"
    
    "anchor comment #5015505374 requires reframe_in_place"
    
  4. added a commit that references this issue on Jul 19, 2026
    98b8814
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

    agent/implementerenhancementphase/implementationtriage-required

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions