Skip to content

実装: body-only AC6 の protected-script 全体diff検査が別Issueの正当な変更を CI false-fail させる問題を是正する #2989

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "body-only repair の AC6(wrapper-only mutation / protected script を body-only 実行が変更しない)を維持しつつ、別 Issue の正当な adjudicator 変更が python-test を false-fail させる cross-PR 差分検査を是正する"
change_kind: test
dedupe_key: "impl-review-loop-v1:body-only-ac6-cross-pr-protected-script-diff-false-deny"

Parent Issue

none

Parent Goal Ref

  • Goal: body-only repair の AC6(wrapper-only mutation / protected script 非変更)を維持しつつ、別 Issue の正当な adjudicator 変更が python-test を false-fail させる cross-PR 差分検査を是正する。
  • Desired Destination: N/A(単独の再発防止改善 Issue のため)

Current Validated Scope

発見元は #2971 / PR #2976 の AC6 test と、#2916 / PR #2982 の CI failure(下記 Verified Incident / Root Cause 参照)。本 Issue は test_body_only_repair_plan.py の AC6 test のみを対象とし、production code は変更しない。

Remaining Parent Gaps

なし(parent Issue なし。#2916 / #2982 の実装内容は本 Issue の範囲外)。

Related / Ownership

Verified Incident / Root Cause

Outcome

Issue #2971 の AC6「body-only repair は既存 update_pr.py wrapper を経由し、保護対象 script を実行中に勝手に変更しない」を保持する一方、無関係の合法 PR が同じ script をコードレビュー付きで修正しただけでは test/CI が失敗しない。branch 対 base の repository-wide diff を body-only 実行の副作用判定に流用しない。

In Scope

  • test_body_only_repair_plan.py の AC6 test を、body-only の実操作を対象にした hermetic / bounded な検証に差し替える。既存の test_ac6_production_module_never_edits_a_pr_body_directly / test_ac6_cli_calls_only_read_only_gh_subcommands と重複するだけの新 gate は増やさない。
  • mutation / negative case: body-only 実行が protected script を実際に書き換えた場合は検出できること。
  • positive case: unrelated に protected script の合法な差分が存在しても body-only 実行が変更していなければ PASS すること。
  • focused pytest + module 全体 + PR CI で regressions を確認する。

Out of Scope

Acceptance Criteria

  • AC1: git diff origin/main に合法な別 Issue の adjudicate_vc_result.py 差分が存在する場合でも、body-only CLI が protected script を変更していなければ AC6 test は PASS する。current incident を再現する hermetic positive test が存在する。
  • AC2: body-only 実行が protected script を予期せず変更する mutation / negative case は FAIL し、wrapper-only/read-only gh 不変条件を維持する。
  • AC3: base/ref の存在や branch、異なる head の偶然の差分により nondeterministic false-fail しない。新規 generic guard や schema は作らない。
  • AC4: test_body_only_repair_plan.py の全テスト・impl-review-loop 関連 focused test が PASS。修正用 PR の fresh CI python-test-core / python-test の失敗原因が解消したことを確認する。
  • AC5: fix: pr_review_only の実行失敗を事実を保持したまま reviewer へ委譲できるようにする #2982 の CI failure との causality と、修正後の検証結果を PR/Issue evidence に明記する(別 Issue の code file を fix: pr_review_only の実行失敗を事実を保持したまま reviewer へ委譲できるようにする #2982 に混ぜない)。

Verification Commands

# AC1
# AC2
# AC3
# AC4
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_body_only_repair_plan.py -q

# AC4
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/ -q

# AC5
# preflight-scope: pr_review_only
$ gh pr view 2993 --json body --jq 'if (.body | test("#2982")) and (.body | test("python-test-core")) then "ok" else error("PR body lacks #2982 causality or python-test-core evidence") end'

Runtime Verification Applicability

  • decision: not_applicable
  • reason: テストの判定は hermetic pytest で再現・検証可能。PR CI の fresh check は delivery evidence として確認する。

Allowed Paths

  • .claude/skills/impl-review-loop/tests/test_body_only_repair_plan.py

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
  • Allowed Paths 外の production code 変更が不可避になった場合。
  • 再発防止: impl-review-loop の post-verification PR body-only evidence sync を iteration budget から分離する #2971 の wrapper-only/no-protected-write invariant を維持できない場合。
  • 他 task の branch / worktree に干渉する必要がある場合。

Required Design References

  • docs/dev/workflow.md
  • docs/dev/runtime-verification-policy.md
  • .claude/skills/impl-review-loop/steps/step-2-verification.md

Delivery Rule

1 Issue = 1 Draft PR。既存 PR / worktree があれば再利用し、実 merge / auto-merge は行わない。#2982 の実装修正とは別 owner とし、main 到達の必要性と merge 順序を明示する。

Required Skills

なし

Activity

  1. added
    enhancement
    phase/implementation
    agent/implementer
    on Oct 8, 2026
  2. added a commit that references this issue on Oct 8, 2026
  3. squne121 commented on Oct 8, 2026

    @squne121
    OwnerAuthor

    再発 evidence: #2836 / PR #2995 でも同じ failure class が発生

    #2993(恒久修正)への引き継ぎ

  4. squne121 commented on Oct 8, 2026

    @squne121
    OwnerAuthor

    Contract Review Result

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-10-08T22:19:29Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/2989
      body_sha256: "sha256:37df7cafe6d9184e7f686c0f8ebfc60175a1444b8e24aed014686a4947b6f5ca"
      checks:
        readiness: go
        blockers: pass
        product_spec: pass
        product_spec_check: {"schema":"product_spec_check/v1","applicability":"applicable","decision":"pass","triggers":{"docs_product_allowed_paths":false,"tasks_md_mentioned":false,"specify_artifact_mentioned":false,"generated_task_mentioned":false,"product_spec_context_present":false,"machine_readable_contract_present":true},"conditions":{"docs_product_requires_spec_evidence":{"status":"pass","evidence":[]},"tasks_md_not_direct_source":{"status":"pass","evidence":[]},"specify_not_canonical":{"status":"pass","evidence":[]},"diff_first_rationale_present":{"status":"pass","evidence":[]},"generated_task_trace_present":{"status":"pass","evidence":[]},"task_dependencies_materialized":{"status":"pass","evidence":[]}},"blocked_reasons":[],"body_sha256":"sha256:37df7cafe6d9184e7f686c0f8ebfc60175a1444b8e24aed014686a4947b6f5ca","source_provenance":{"source_type":"body_file","body_file":"/tmp/contract_review_once_body_5lvezzqr.md"}}
        vc_preflight:
          decision: pass
          classifications: '[{"ac":"AC1,AC2,AC3,AC4","line":5,"raw_command":"uv run --locked pytest .claude/skills/impl-review-loop/tests/test_body_only_repair_plan.py -q","command_hash":"sha256:23c869a8c74c1c1da828e03a3b22a34445f4c57574dd66cbd4a8472c2c907527","execution_key_hash":"sha256:992e506b7e97904515774346a21a807d2d78880324989bc31218dce5cfc4ba7d","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":["........................................................................ [ 23%]","........................................................................ [ 46%]","........................................................................ [ 70%]","........................................................................ [ 93%]","...................                                                      [100%]","307 passed in 19.37s"],"stdout_truncated":false,"stdout_original_line_count":7,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":21598,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null,"timeout_provenance":{"timeout_seconds":150,"cleanup_tail_seconds":15,"source":"static_fallback","estimator_version":"v2","estimator_input_digest":"sha256:a673269a8aee356752ac231b58b8408797047ed4171c4bd12550c608895fc645"}},{"ac":"AC4","line":8,"raw_command":"uv run --locked pytest .claude/skills/impl-review-loop/tests/ -q","command_hash":"sha256:43494f3983a2e95800be00e3c008782d7da0cd0606d2f114bf311db6fec0d10d","execution_key_hash":"sha256:cdbbd536e248410c2a3f91bdd435c2d90d68a39152bf25ea7dd74948f0bdd3cf","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":["........................................................................ [  5%]","........................................................................ [ 10%]","........................................................................ [ 16%]","........................................................................ [ 21%]","........................................................................ [ 26%]","........................................................................ [ 32%]","........................................................................ [ 37%]","........................................................................ [ 42%]","........................................................................ [ 48%]","........................................................................ [ 53%]","........................................................................ [ 58%]","......x......................s.......................................... [ 64%]","........................................................................ [ 69%]","........................................................................ [ 75%]","........................................................................ [ 80%]","........................................................................ [ 85%]","........................................................................ [ 91%]","........................................................................ [ 96%]","................................................                         [100%]","1342 passed, 1 skipped, 5 deselected, 1 xfailed in 46.64s"],"stdout_truncated":true,"stdout_original_line_count":21,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":49059,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null,"timeout_provenance":{"timeout_seconds":150,"cleanup_tail_seconds":15,"source":"static_fallback","estimator_version":"v2","estimator_input_digest":"sha256:85f454f238a679e3f0bdfb2bbe6aa661a912f5da166043f9c90a12590c5dee8b"}},{"ac":"AC5","line":12,"raw_command":"gh pr view 2993 --json body --jq ''if (.body | test(\"#2982\")) and (.body | test(\"python-test-core\")) then \"ok\" else error(\"PR body lacks #2982 causality or python-test-core evidence\") end''","command_hash":"sha256:a882978f3b61bead46cd961b4a9e78e68c2be43425e0628f5f18a82bcff3b7fa","execution_key_hash":null,"runner":"skipped","exit_code":null,"classification":"skipped","category":"preflight_scope_pr_review_only","decision":"go","scope_class":"pr_review_only","confidence":"low","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":0,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null,"verification_owner":"pr-review-judge","deferred_reason":"VC marked pr_review_only; verification deferred to PR review","runtime_verification_required":false,"timeout_provenance":{"timeout_seconds":150,"cleanup_tail_seconds":15,"source":"static_fallback","estimator_version":"v2","estimator_input_digest":"sha256:94d8dfd5e8edaa6e4e1fc0abdd2e00e573a87cdb6f5afc71bac4342fb6128251"}}]'
          classifications_transport: {"schema":"vc_preflight_classifications_transport/v1","classification_count":3,"original_payload_sha256":"sha256:ea3f19a38bcad2358492f2d87fbe0f371684feacf097deb6f00a1f04a7f22d64","compact":false,"truncated":false}
        declared_path_overlap: '{"schema":"declared_path_overlap/v1","advisory":true,"blocking":false,"decision":"advisory_only","disjoint":true,"overlapping_prs":[],"inventory":{"schema":"OPEN_PR_INVENTORY_V1","repo":"squne121/loop-protocol","state":"open","base_ref":"main","base_sha":"00275db676ef448287ddeea77ec0bd37aefa6ffe","draft_policy":"include_drafts","prs":[{"number":2831,"title":"実装: Claude-GPT model/proxy runtime migration の3分類ルーティングを追加する","base_ref_name":"main","head_ref_name":"worktree-issue-2810-runtime-migration-classifier","head_ref_oid":"7c06e272c14b2d38e8f01899abdf85f3d0d5c9ec","is_draft":false,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/2831","changed_files_count_graphql":20},{"number":2914,"title":"fix: test-runner が mergeStateStatus=BLOCKED/UNSTABLE だけで TEST_VERDICT を FAIL にしないようにする","base_ref_name":"main","head_ref_name":"worktree-issue-2908-test-runner-blocked-not-fail","head_ref_oid":"2f44329742e2117b1bbbb34452417362558175aa","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/2914","changed_files_count_graphql":1},{"number":2931,"title":"fix: Auto mode の固定 /tmp scratch 上書き false-deny を run-scoped workspace で解消する","base_ref_name":"main","head_ref_name":"worktree-issue-2860-run-scoped-scratch","head_ref_oid":"344f5da35326e04dacd13aa57dd962674888f336","is_draft":false,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/2931","changed_files_count_graphql":6},{"number":2940,"title":"feat: runner evidence に main-session init の permission_mode_observed を出力する","base_ref_name":"main","head_ref_name":"worktree-issue-2935-main-session-permission-mode","head_ref_oid":"37eb1ae20b98cc72fed816a7c88aca0d9b623a39","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/2940","changed_files_count_graphql":3},{"number":2946,"title":"fix: runtime smoke fixture の child 起動先を general-purpose に是正し 2.1.289 で hook_id_correlated を成立させる (#2941)","base_ref_name":"main","head_ref_name":"worktree-issue-2941-claude-2-1-289-causal-evidence","head_ref_oid":"0fbc32e03e377b36d5800c940ab8311479c8cf46","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/2946","changed_files_count_graphql":1},{"number":2974,"title":"fix: component-vrt-report の negative-control artifact を run_attempt 単位名に束縛する (#2969)","base_ref_name":"main","head_ref_name":"worktree-issue-2969-vrt-negctl-attempt-artifact","head_ref_oid":"2ab61441acc3f5062fa83fd147f570958f2dea3e","is_draft":false,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/2974","changed_files_count_graphql":2},{"number":2982,"title":"fix: pr_review_only の実行失敗を事実を保持したまま reviewer へ委譲できるようにする","base_ref_name":"main","head_ref_name":"worktree-issue-2916-pr-review-only-nonpass-reviewer-route","head_ref_oid":"a4aa0edc4da73c2bcf4eeb8d86c13f88133a1a15","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/2982","changed_files_count_graphql":4},{"number":2993,"title":"fix: body-only AC6 の protected-script 検査を別 Issue の正当な変更で false-fail させない (#2989)","base_ref_name":"main","head_ref_name":"worktree-issue-2989-body-only-ac6-protected-diff","head_ref_oid":"97f2c635be0e06a4acef06985ea4171355c37cd2","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/2993","changed_files_count_graphql":1},{"number":2995,"title":"fix: wait_ci_checks が未出現の required context を pending として扱う (#2836)","base_ref_name":"main","head_ref_name":"worktree-issue-2836-wait-ci-checks-materialize-required-cont","head_ref_oid":"0975b0b86f83342be08011a7e6f7048f573252d9","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/2995","changed_files_count_graphql":3},{"number":3000,"title":"test: body-only lane runtime smoke を counterfactual control に接続する (#2986)","base_ref_name":"main","head_ref_name":"worktree-issue-2986-impl-review-loop-body-only-lane-runtime-","head_ref_oid":"3f0c2886da69fa2c9a6f136f9fcc94d10c5d5f50","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/3000","changed_files_count_graphql":1}],"fetched_count":10,"totalCount":10,"has_next_page":false,"complete":true,"saturated":false,"limit":200,"page_count":1,"inventory_digest":"sha256:a1e77c605e942d73fc325665097f15bf4bd12335f1fe911c6c1038adeaaff115","errors":[]},"inventory_digest_extended":"sha256:d150fc95bfdacf53145b278f1ccbf10422624f552e265262aededba4ea21d342","errors":[],"note":"changed-file 名の単純な重なりのみを証明する advisory check。3-way merge・hunk 競合・rename/delete 競合は評価しない(実 Git merge 競合の判定は Issue #1792 の PAIRWISE_MERGE_OBSERVATION_V1 producer の責務)。単独では blocking にしない。disjoint は tri-state(true/false/null)— 観測が不完全な場合は null。"}'
      source: ensure_contract_snapshot_auto
      expected_contract_fingerprint: '{"issue_number":2989,"contract_source_kind":"issue_comment","contract_source_id":"6070177231","contract_body_sha256":"sha256:37df7cafe6d9184e7f686c0f8ebfc60175a1444b8e24aed014686a4947b6f5ca","allowed_paths_normalized_sha256":"c5be9035f37e31c45b9e4ce5544d3672e91c9808d2261a7f153f9a7691d06e4b","base_ref":"main","base_sha_at_snapshot":"00275db676ef448287ddeea77ec0bd37aefa6ffe"}'
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/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions