Repository navigation
Open
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: none
goal_ref: "旧 HEAD の非必須 deploy-pr CANCELLED が現 HEAD の PR review を false-block しないよう CI provenance を分離する"
change_kind: workflow
dedupe_key: "follow-up:squne121/loop-protocol:pr-2861:historical-optional-deploy-pr-cancelled:v1"Parent Issue
なし(単独改善。PR #2861 で発見した別スコープの follow-up)
Parent Goal Ref
- Goal: current PR head の required CI evidence を欠落なく fail-closed に検査し、旧 HEAD の非必須 deploy-pr cancellation を現 HEAD の blocker と混同しない。
- Desired Destination: N/A(単独改善。PR fix: trusted human-context contract-update の安全性と producer 到達性を修正 #2861 の Allowed Paths を拡張しない)。
Current Validated Scope
- V1 CI verdict の check head / workflow run・attempt / required-context provenance を区別する最小分類変更と同じ領域の回帰テストのみ。
- 旧 run と current run の identity を混同せず、required/current-head の失敗は従来どおり block する。
Remaining Parent Gaps
なし(単独改善)。#1666 の skipped 対応、#2605 の V2 unknown optional checks 設計調査、#1673 の required identity readback、#2836 の required waiter inventory はそれぞれ別スコープ。
Outcome
.claude/skills/pr-review-judge/scripts/ci_verdict_summary.py と対応する pytest 回帰テストを含む 1 PR を作り、旧 HEAD に結びついた非必須 deploy-pr CANCELLED は現 HEAD review を false-block せず、現 HEAD / required check の不備は fail-closed のままテストで検証できる状態にする。
Background
- PR fix: trusted human-context contract-update の安全性と producer 到達性を修正 #2861 の旧 reviewed HEAD
255d1f71b545e1f87a7b958b443c953da489b5d1の review comment: fix: trusted human-context contract-update の安全性と producer 到達性を修正 #2861 (comment) 。その HEAD の required 6/6 はwait_ci_checks.pyで PASS した一方、V1ci_verdict_summary.pyの raw result は exit 10 /status: failed/failed_checks: [deploy-pr]だった。 - provenance: https://github.com/squne121/loop-protocol/actions/runs/37065810649 (run 37065810649, attempt 1,
event: pull_request,head_sha: 255d1f71b545e1f87a7b958b443c953da489b5d1, completed/CANCELLED)、job https://github.com/squne121/loop-protocol/actions/runs/37065810649/job/111033199844 (deploy-pr, completed/CANCELLED)。head_sha: null + skippedではない。 - 起票前 live readback 時点の PR fix: trusted human-context contract-update の安全性と producer 到達性を修正 #2861 HEAD は
6d69d9c86fd30df03295ecf8d867a95102e37afb。https://github.com/squne121/loop-protocol/actions/runs/37072979303 (attempt 1, completed/SUCCESS)と https://github.com/squne121/loop-protocol/actions/runs/37072979363 (attempt 1, deploy-pr SUCCESS)がこの HEAD に結びつく。現 HEAD の V1 raw result は exit 0 /all_pass(旧取消を現 HEAD の現行 blocker と再主張しない)。 - main の branch protection required contexts は
typecheck,lint,test,build,python-test,validate-generated-artifactの 6 件。deploy-pr は required ではない。現行 V1 の stale-first 集約は古い非必須取消の帰属と必須・現 HEAD の判定を分離できない場合に誤検出となり得る。再現条件を golden fixture に固定する(現 HEAD の失敗を推測で主張しない)。 - 対案は運用で review コメントに例外を書き現結果を無視することだが、証跡の再現性がなく fail-closed 境界を曖昧にするため不採用。provenance に基づく限定的・決定論的修正とテストを採用する。
- Overlap preflight:
ISSUE_OVERLAP_PREFLIGHT_RESULT_V1は C2b /dependency_ambiguous(source search/readback ok; candidate 実装: deploy-pr skipped を CI verdict から安全に除外する #1666; shared paths は本 Issue の Allowed Paths 2 ファイル)。実装: deploy-pr skipped を CI verdict から安全に除外する #1666 はhead_sha: null + skippedの deploy-pr に限る。本件は旧 run/旧 HEAD に束縛された completed/CANCELLED の非必須 check であり同一 Outcome ではない。実装: ci_verdict_summary.py の exclude rule に HEAD_SHA_NULL_SKIPPED パターンを追加する #1506 は同じ script の Japanese skipped で別 Outcome。実装: deploy-pr skipped を CI verdict から安全に除外する #1666 は 実装: ci_verdict_summary.py の exclude rule に HEAD_SHA_NULL_SKIPPED パターンを追加する #1506 merge 後、本 Issue は 実装: deploy-pr skipped を CI verdict から安全に除外する #1666 merge 後に着手する直列依存とし、並行実装による同一ファイル衝突を避ける。
In Scope
- V1 verdict の check SHA と workflow run/attempt、required-context identity を区別し、旧 HEAD の非必須 deploy-pr CANCELLED だけが現 HEAD の最終結果を汚染しない限定分類にする。必要な provenance が欠け判別できない場合は fail-closed。
- required six contexts の current-head evidence の欠落・stale・cancelled・skipped・failed・pending は従来どおり success とみなさない。非必須でも current-head の cancelled/skipped/failed/pending を安易に許容しない。
- 旧/現 HEAD・run/attempt・required/non-required の境界を pytest fixture で固定する。V1 public schema を不要に拡張しない。
Out of Scope
- 汎用 CI hardening、workflow topology / branch protection 再設計、approval layer 新設、required check の cancellation を success 扱いにする変更。
- 実装: deploy-pr skipped を CI verdict から安全に除外する #1666 の head_sha:null + skipped rule、調査: CI verdict の unknown check fail-closed 一律運用の Go/No-Go を判断する #2605 の V2 unknown-policy 調査、実装: current-head ci_verdict_summary_v2 artifact と required check identity の readback を保持する #1673 の artifact identity、実装: wait_ci_checks が未materialize required contextを見落として false-green する問題を解消する #2836 の required waiter completeness の実装を本 Issue に取り込まない。
- PR fix: trusted human-context contract-update の安全性と producer 到達性を修正 #2861 への policy 変更混入、Issue 実装: trusted human-context の contract_update mutation lane が、freeform directive から不正な patch operation を導出し、失敗理由を出さずに停止する欠陥を是正する #2842 の Allowed Paths 外変更、PR merge / auto-merge / Issue close。
Acceptance Criteria
- AC1: 旧 HEAD
255d1f71b545e1f87a7b958b443c953da489b5d1の run 37065810649/attempt 1 に由来する非必須 deploy-pr completed/CANCELLED と現 HEAD の required 6/6 success が共存しても、旧取消のみを根拠に現 HEAD の V1 review verdict を failed/stale にせず、除外理由が検証できる。 - AC2: 同じ deploy-pr でも現 HEAD に帰属する cancelled/skipped/failed/pending は pass にせず、provenance 不完全で old/current や required が特定できない場合も fail-closed にする。
- AC3: 6 required contexts のどれかが current-head で missing/stale/cancelled/skipped/failed/pending の場合、非必須の過去取消の有無にかかわらず all_pass にしない。
- AC4: 現 HEAD
6d69d9c86fd30df03295ecf8d867a95102e37afbの run 37072979303/attempt 1 と deploy-pages run 37072979363/attempt 1 が success の fixture は all_pass/exit 0。expected head と live head がずれた場合は stale とし、current-head review を旧 HEAD に巻き戻さない。 - AC5: 実装: deploy-pr skipped を CI verdict から安全に除外する #1666 の null+skipped のみの除外境界を維持し、既存 V1 verdict regression suite が PASS する。
Verification Commands
# AC1
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/pr-review-judge/scripts/tests/test_ci_verdict_summary.py::test_historical_optional_deploy_cancel_does_not_block_current_head -q
# AC2
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/pr-review-judge/scripts/tests/test_ci_verdict_summary.py::test_current_or_unknown_deploy_cancel_stays_blocking -q
# AC3
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/pr-review-judge/scripts/tests/test_ci_verdict_summary.py::test_required_context_failures_remain_blocking_with_historical_cancel -q
# AC4
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/pr-review-judge/scripts/tests/test_ci_verdict_summary.py::test_current_head_success_and_expected_head_drift -q
# AC5
$ uv run --locked pytest .claude/skills/pr-review-judge/scripts/tests/test_ci_verdict_summary.py -qAllowed Paths
.claude/skills/pr-review-judge/scripts/ci_verdict_summary.py.claude/skills/pr-review-judge/scripts/tests/test_ci_verdict_summary.py
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- required contexts の信頼できる inventory / run-attempt provenance が取得できず安全な除外の証明ができない場合
Required Skills
- なし
Required Design References
docs/dev/workflow.mddocs/dev/runtime-verification-policy.md
Runtime Verification Applicability
- decision: not_applicable
- reason: CI verdict の分類ロジックと hermetic pytest fixture で境界を検証する変更であり外部 runtime smoke は AC で要求しない。
Delivery Rule
- 1 Issue = 1 PR。専用 worktree
.claude/worktrees/issue-<番号>-<slug>/を使用し Draft PR を既定とする。 - Depends on 実装: deploy-pr skipped を CI verdict から安全に除外する #1666 merge(実装: deploy-pr skipped を CI verdict から安全に除外する #1666 は 実装: ci_verdict_summary.py の exclude rule に HEAD_SHA_NULL_SKIPPED パターンを追加する #1506 merge 後)。同じ 2 ファイルを持つ Issue と並行実装せず、先行修正を取り込んでから本変更に着手する。調査: CI verdict の unknown check fail-closed 一律運用の Go/No-Go を判断する #2605/実装: current-head ci_verdict_summary_v2 artifact と required check identity の readback を保持する #1673/実装: wait_ci_checks が未materialize required contextを見落として false-green する問題を解消する #2836 は参考であり本件の hard dependency ではない。
- review 時は必ず PR の最新 head と required inventory を live readback し、旧 run の historical evidence を最新 head の blocker と誤用しない。
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Activity