Repository navigation
Closed
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "push イベントで visual-impact-policy ジョブが常に失敗し ci-verdict-summary artifact が main tip commit で得られない構造的欠陥を修正する"
change_kind: workflowParent Issue
なし(単独改善。related: #2155)
Parent Goal Ref
- Goal: なし(親 Issue なし。検証: #2119 AC9/AC10 の close-grade 実CI証跡を確認する #2155 は「関連 Issue」として参照するのみで、本 Issue のスコープや作業計画の正本ではない)
- Desired Destination: なし
Current Validated Scope
- 本 Issue は 検証: #2119 AC9/AC10 の close-grade 実CI証跡を確認する #2155 の Phase 6(44-run production Performance close-grade verification)実行中に発見された、無関係な CI インフラ不具合の follow-up として起票する(検証: #2119 AC9/AC10 の close-grade 実CI証跡を確認する #2155 の作業計画・本文・AC は変更しない)
.github/workflows/ci.ymlのvisual-impact-policyjob 内、「Write PR body to file (untrusted input -- never shell-expanded)」step(PR_NUMBER: ${{ github.event.pull_request.number }}を使うenv:ブロックと、その後段のgh api "repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}"呼び出し)のみ
Remaining Parent Gaps
なし
Outcome
.github/workflows/ci.yml の visual-impact-policy job の「Write PR body to file」step が、github.event.pull_request.number が未定義(push イベント、または PR に紐付かない workflow_dispatch)の場合でも gh api repos/.../pulls/ への空 PR 番号呼び出しで 404 失敗しないよう修正されたコミットが main にマージされ、actionlint .github/workflows/ci.yml が引き続き PASS し、pull_request イベント経路の挙動が byte-for-byte 不変であることが確認できる状態。
Runtime Verification Applicability
- decision: deferred
- reason: このバグは
push(または PR に紐付かないworkflow_dispatch)イベントでのみ再現する。この repo の通常 CI 実行は PR trigger のため、修正 PR 自体の CI 実行では再現条件を満たさない。 - deferred_destination: この PR 自身が squash-merge され
mainへのpushイベントとして実行される、次の実 CI 実行 - deferred_verification_condition: PR マージ後の
pushイベントで起動した.github/workflows/ci.ymlのvisual-impact-policyjob(gh run list -R squne121/loop-protocol --workflow ci.yml --json event,headSha,conclusionでevent=="push"かつマージコミット SHA の run を特定)がconclusion: successであることを確認する。マージのブロック条件にはしない(PR 本文にマニュアル確認ノートとして残す)。
In Scope
.github/workflows/ci.ymlのvisual-impact-policyjob の「Write PR body to file (untrusted input -- never shell-expanded)」step に、PR_NUMBERが空の場合にgh api repos/.../pulls/を呼ばず空のpr_body.mdを書き出すガードを追加する- ガードは同ファイル内の既存パターン(line ~3468 の
PR_NUMBER: ${{ github.event.pull_request.number || 0 }}および line ~4038 のGH_PR_NUMBER: ${{ github.event.pull_request.number || '' }}+ 使用前の空文字チェック)に倣う。新しいパターンを発明しない pull_requestイベント経路(PR_NUMBERが非空)の挙動は完全に不変とする(byte-for-byte 同一のpr_body.md内容・同一の後続 step 挙動).github/workflows/ci.ymlに既存の regression test harness がこの step 用に存在する場合、そのテストへ追加検証を行う(git grep -l "visual-impact-policy" tests/ .github/で確認。本 Issue 起票時点で.github/workflows/ci.ymlと.github/pull_request_template.mdと.github/workflows/visual-impact-trusted-consumer.ymlがヒットしたが、専用 unit-test harness は確認できなかった)- harness が存在しない場合は
actionlint .github/workflows/ci.ymlの PASS とこの Issue に記載した再現手順・修正内容を明記した PR 本文を最小検証として採用する(新しいテストフレームワークを本 Issue のためだけに作らない)
Out of Scope
- commit
63ef5f6598125f9c0d0177e3a5336aa1cfba031eに対する遡及的なci_verdict_summary_v2取得(構造的に不可能。当該 commit が push された時点のci.ymlに既にこのバグが含まれているため、後続の修正 commit でmainの tip が新しい SHA に変わっても、古い run の failed job を rerun すれば checkout されるのは push 時点の古いコードであり、後の修正 commit ではない) .github/workflows/ci.ymlのchanged-paths/BASE_SHA/HEAD_SHAの計算ロジック変更(push イベントでBASE_SHA == HEAD_SHAになる別件の挙動。今回の 404 failure の原因ではないため対象外)#2155/#2119/#2554/#2555/#2422/#2423/#2424の本文・Allowed Paths・Delivery Rule・AC の変更(一切触れない)- 新規の
blocks=22/blocks=Nproduction benchmark dispatch の実行(人間または 検証: #2119 AC9/AC10 の close-grade 実CI証跡を確認する #2155 の別途継続判断に委ねる) python-test-core/python-testjob など、同じ run(34256855152)で別途失敗していた他 job の修正(別件。本 Issue のスコープ外)
Acceptance Criteria
-
.github/workflows/ci.ymlのvisual-impact-policyjob の「Write PR body to file」step が、PR_NUMBERが空文字の場合にgh api repos/.../pulls/を呼ばず空のpr_body.mdを書き出す -
pull_requestイベント経路(PR_NUMBERが非空)で、修正前後の step の実行内容(gh api呼び出しの有無・引数)が変わらない -
actionlint .github/workflows/ci.ymlが exit 0 で PASS する - 修正後の該当 step の
run:ブロックが、同ファイル内の既存ガードパターン(|| 0または|| ''+ 空文字チェック)と同型の記述になっている
Verification Commands
$ actionlint .github/workflows/ci.yml$ rg -n "Write PR body to file" .github/workflows/ci.yml$ rg -c "PR_NUMBER: \${{ github.event.pull_request.number }}" .github/workflows/ci.yml$ rg -c "Write PR body to file" .github/workflows/ci.ymlAllowed Paths
.github/workflows/ci.yml- 対応する専用 regression test ファイル(
git grep -l "visual-impact-policy" tests/ .github/で発見できる既存 harness がある場合のみ。本 Issue 起票時点では専用 unit-test harness の存在は確認できていない)
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
.github/workflows/*の編集は CI 動作に直結するため、変更時は PR レビューで人間承認を必須とする(.github/CLAUDE.md参照)。この Issue の実装 PR は人間承認を経てからマージする
Required Skills
- なし
Required Design References
- docs/dev/ci-performance.md
Scope Delta(任意)
N/A
Notes for Reviewer
- overlap preflight helper(
check_issue_overlap.py)は.github/workflows/ci.ymlを Allowed Paths に含む過去の複数 Issue(実装: python-test CI job に node_modules セットアップを追加しajv依存のpytestテストをgreenにする #1607 / 実装: verify-vitest-discovery-policy.mjs を CI 常設 gate として追加する #1569 / 実装: .github/workflows/ci.yml に test_implementation_worker_request_v2_contract.py の pytest 実行を追加する #641 等)とのallowed_paths単一パス集合一致によりdecision: duplicate(reason_code: goal_ref_duplicate) を返したが、いずれも goal_ref・title は本 Issue と無関係(node_modules セットアップ、vitest discovery policy gate、pytest 実行追加)であり、#1860 Owner Decisionに基づき「declared Allowed Paths の文字列重複は起票停止理由にしない」規約に従って起票を継続した - 再現ログの生ログ全文は本文に含めていない。再現確認は
gh run view 34256855152 -R squne121/loop-protocol --json jobsおよびgh run view 34256855152 -R squne121/loop-protocol --log-failedで独立に取得可能 push_runs=36 failed=35(97%)は長期的に既存の傾向であり、本 Issue の修正で新規 push 以降に改善されることを期待するが、遡及的な過去 run の再実行成功は保証しない(Out of Scope 参照)
Delivery Rule
1 Issue = 1 PR。worktree で作業し、Draft PR を既定とする。.github/workflows/* 変更のため、マージ前に人間レビュー承認を必須とする(.github/CLAUDE.md)。
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Activity
squne121 commentedon Sep 8, 2026
implement-issue: 実装完了 (2026-09-08T19:19:18Z)
.claude/worktrees/issue-2594-visual-impact-pr-number-guardworktree-issue-2594-visual-impact-pr-number-guard.github/workflows/*変更のため、.github/CLAUDE.mdに従いマージ前に人間レビュー承認が必須fix: PR body 取得ステップの guard を acquisition parity harness と両立させる (#2594)
squne121 commentedon Sep 8, 2026
implement-issue: 更新 (2026-09-08T19:45:11Z)
PR #2595 に 2 回目のコミットを追加。1 回目のコミットは
if/else分岐でpr_body.mdを条件ごとに別行で書いており、既存の regression harnessscripts/agent-ops/tests/test_pr_body_acquisition_parity.py(tests/.github/配下ではないため Issue 起票時のプリフライト grep では発見できなかった)に「acquisition 行後の再書き込み」として誤検知されpython-test-coreを落としていた。: > pr_body.mdを if/else の前に一度だけ置き、PR_NUMBER非空時のみ direct なgh api ... > pr_body.mdで上書きする形に修正し、全 CI check が PASS(visual-impact-policy含む)。ci-verdict-summaryのみ既存の無関係な構造的問題で fail — 直前の PR fix: dispatch_workflow_run に reliability_experiment_identity input を配線する #2593 でも同一パターンで発生済み、詳細は PR コメント参照)test: PR body 取得 guard の PR_NUMBER 空文字時 gh 未呼び出しを実行検証で回帰テスト追加する (#2594)
fix: visual-impact-policy job の PR_NUMBER 未定義時 gh api pulls/ 404 を防ぐ (#…