Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "#1958"
goal_ref: "#1958 / PR #2006 により失効した combat-hud-running component VRT baseline を、critical HUD fragment の欠落を実際に検出できる comparator 契約のもとで再生成し、判別力のある runtime evidence を current head に紐づけて残す"
change_kind: code
preflight_scope: pr_review_onlyParent Issue
#1958(combat HUD の配置・safe-zone配置・情報優先度の実装。PR #2006 でマージ済み)。本 Issue は、その production HUD 変更により失効した component-vrt-report(非required・report-only)の combat-hud-running baseline を追従させる debt repair として、#1958 の子 Issue に位置付け直す。
- ancestor_issue: 実装: Playwright + Vitest Browser Mode 段階導入で #1370 battle-stage DOM overlay を VRT 保護 #1380(VRT rollout tracker。実装: Vitest Browser Mode component VRT を report-only scaffold として追加する #1389 / 実装: #1375 merge後 running HUD / paused HUD VRT baseline を frozen 昇格する #1391 を child として管理)
- related_issues: 実装: Vitest Browser Mode component VRT を report-only scaffold として追加する #1389(component-vrt-running の component VRT scaffold 導入元)、実装: #1375 merge後 running HUD / paused HUD VRT baseline を frozen 昇格する #1391(実装: combat HUD の配置・safe-zone・情報優先度を実装する #1958 merge 後の running/paused HUD baseline frozen 昇格を扱う follow-up)、実装: PR #1964 の battle-stage 寸法修正に伴い vrt-running-hud-overlay.png VRT baseline を更新する #1980(baseline-only Issue の調査中に oracle defect(pixel diversity・negative control・capture semantics の欠陥)が発見され、契約を再定義した直接の先例)、実装: visual-surface dependency registry と required visual-impact policy check を導入し、UI変更PR内でVRT処置を強制する #2019(visual-surface dependency registry・required visual-impact policy check の恒久対策 follow-up)
- source_pr: PR 実装: combat HUD の配置・safe-zone・情報優先度を実装する (#1958) #2006(実装: combat HUD の配置・safe-zone・情報優先度を実装する #1958 を Close、component baseline は Allowed Paths 外のため未対応のまま merge)、PR test(vrt): combat-hud-running component baseline を #1958 新レイアウトへ追従させる #2024(本 Issue の baseline candidate PR。OWNER REQUEST_CHANGES により本 Issue の再スコープが発生した)
Parent Goal Ref
#1958 の Outcome(combat HUD の safe-zone 配置・情報優先度実装)。本 Issue は、その変更で component-vrt-report が failing のまま放置されている状態を解消する debt repair として起票されたが、PR #2024 のレビュー過程で、baseline 再生成だけでは comparator 自体に回帰検出力がないという Stop Condition が発火した(Source 参照)。本 Issue はその Stop Condition の解消を含む形に再スコープする。
Current Validated Scope
tests/component/combat-hud-running.vrt.test.tsの comparator 契約を、実測ノイズから校正したallowedMismatchedPixels絶対値上限をallowedMismatchedPixelRatio: 0.02と併記する形に更新し、status/elapsed/pause/edge-controlの critical subregion を個別に検証する capture もしくは visual assertion を追加する。- HULL / Pause / elapsed を意図的に非表示にする env-gated negative-control mutation lane を追加し、通常の screenshot assertion が non-zero mismatch で fail することを CI 上で証明する。
hp=25/maxHp=100等の critical fixture を追加し、critical warning の視覚契約を実際に一度は撮影する。- 上記の契約変更を反映した状態で、
tests/component/__screenshots__/combat-hud-running.vrt.test.ts/combat-hud-running-chromium-linux.png(および critical fixture 用の新規 baseline PNG)を CI ピン留め canonical environment 内で再生成する。 - 「3 回連続実行で安定」の evidence を、コミット済み baseline file の不変性ではなく、各 fresh process が保存した actual PNG の SHA-256 一致によって証明する。
- current head に紐づく expected/actual/diff・mismatch count・effective pixel limit・mutation control 結果を、PR comment または CI artifact として構造化 evidence(
VISUAL_BASELINE_REVIEW_EVIDENCE_V1)で残す。
Remaining Parent Gaps
- production source(
src/ui/combatHud.ts等)と visual contract(component baseline / comparator 契約)の依存関係が機械可読に定義されておらず、PR 内での co-change を強制する仕組みが存在しない。恒久対策として Issue 実装: visual-surface dependency registry と required visual-impact policy check を導入し、UI変更PR内でVRT処置を強制する #2019(visual-surface dependency registry と required visual-impact policy check の導入)を canonical follow-up として起票済み。ただし 2% comparator の感度証明と surface-specific negative control は 実装: visual-surface dependency registry と required visual-impact policy check を導入し、UI変更PR内でVRT処置を強制する #2019 の Out of Scope であり(PR test(vrt): combat-hud-running component baseline を #1958 新レイアウトへ追従させる #2024 OWNER レビュー明記)、本 Issue のスコープとして解決する。実装: visual-surface dependency registry と required visual-impact policy check を導入し、UI変更PR内でVRT処置を強制する #2019 の実装完了は本 Issue の完了条件ではないが、Required Design References にリンクする。 #1391が扱う running/paused HUD baseline の frozen 昇格は本 Issue のスコープ外(docs/dev/visual-baseline-registry.mdの maturity はprovisionalのまま変更しない)。
Outcome
.github/workflows/ci.yml の component-vrt-report ジョブ(非required・report-only)が、critical HUD fragment(HULL / Pause / elapsed)の欠落を実際に検出できる comparator 契約のもとで PASS する状態にする。具体的には、tests/component/combat-hud-running.vrt.test.ts の comparator に校正済み絶対値 pixel cap と critical subregion assertion を追加し、env-gated mutation negative-control lane でその検出力を証明したうえで、critical fixture を含めて baseline PNG 群を CI ピン留め canonical environment で再生成・コミットし、current head に紐づく判別力のある runtime evidence を残す。恒久的な co-change enforcement(visual-surface dependency registry・required visual-impact policy check)は Issue #2019 で別途実装する。
In Scope
tests/component/combat-hud-running.vrt.test.tsの既存combat-hud-runningシナリオの comparator に、実測ノイズ(fresh-run actual と現行 baseline の diff)から校正したallowedMismatchedPixels絶対値上限を追加し、allowedMismatchedPixelRatio: 0.02と併記する(Vitest は比率と絶対値を併記した場合、厳しい方を採用する)。status/elapsed/pause/edge-controlの critical subregion に対する個別 capture または個別の小さい visual assertion を追加する。各 critical subregion の DOM ルートにはdata-critical-subregion="status|elapsed|pause|edge-control"属性を付与し、テストコードから機械可読に選択できるようにする。DOM のtoBeVisible()だけでは代替しない(Vitest の visibility 定義ではopacity: 0も visible 扱いのため、visual mutation または computed-style/pixel assertion を用いる)。- HULL・Pause・elapsed を意図的に非表示にする env-gated mutation negative-control lane(新規 test ファイルまたは既存ファイル内の env-gated describe/test)を追加し、CI wrapper で通常の screenshot assertion が必ず non-zero mismatch で fail することを確認する。
hp=25/maxHp=100等、critical warning が表示される critical fixture のシナリオを追加し、対応する baseline PNG を新規に capture・コミットする。- 上記のテスト・comparator 変更を反映した状態で、
combat-hud-running-chromium-linux.png(既存 running シナリオ)と新規 critical fixture 用 baseline PNG を、CI がピン留めしている Playwright Docker イメージ(mcr.microsoft.com/playwright@sha256:9bd26ad900bb5e0f4dee75839e957a89ae89c2b7ab1e76050e559790e946b948)内でpnpm test:vrt:update:componentを対象 spec に絞って実行し再生成する。 - 再生成前後で expected/actual/diff を個別に目視レビューし、実装: combat HUD の配置・safe-zone・情報優先度を実装する #1958 の意図した新レイアウト(status 左下・elapsed 上部中央・条件付き edge control)以外の差分がないことを確認する(blanket tolerance widening は行わない)。
- 各 fresh browser process が reference とは別に actual PNG を保存する evidence capture(
locator.screenshot({ path: ... })等)を追加する。pnpm test:vrt:evidence:triple-run(新規 pnpm script。pnpm test:vrt:componentを fresh process で 3 回連続実行し、各回の actual PNG からactual_sha256_run_1/actual_sha256_run_2/actual_sha256_run_3を計算・比較する単一コマンド)を追加する。 - head SHA、container digest、browser/tool versions、viewport、DPR、run ID、artifact ID、baseline/actual SHA-256、mismatched pixel count、effective pixel limit、mutation control 結果を含む
VISUAL_BASELINE_REVIEW_EVIDENCE_V1相当の evidence manifest を生成し、current head に紐づく形で CI artifact または PR comment として残す。 - 上記に必要な範囲で
vitest.visual.config.ts(calibration に config 変更が必要な場合)、.github/workflows/ci.yml(mutation negative-control lane / evidence artifact 生成の CI 統合が必要な場合)、package.json(新規 pnpm script が必要な場合)、docs/dev/visual-baseline-registry.md(comparator 契約・evidence 方針の記述更新。maturity 遷移は含まない)を変更する。
Out of Scope
docs/dev/visual-baseline-registry.mdの maturity 遷移(provisional→frozen等)。本 Issue は comparator 契約の再定義と evidence retrofit のみを扱う。tests/e2e/**配下の Playwright VRT baseline(m2-running-hud-baseline.png等、既に PR 実装: combat HUD の配置・safe-zone・情報優先度を実装する (#1958) #2006 のコミット9db238cfで対応済み)。component-vrt-reportジョブを required check に昇格させること。- visual-surface dependency registry・resolver・required visual-impact policy check の恒久的な co-change enforcement 機構そのものの実装(Issue 実装: visual-surface dependency registry と required visual-impact policy check を導入し、UI変更PR内でVRT処置を強制する #2019 のスコープ)。ただし 2% comparator の感度証明と surface-specific negative control(本 Issue の In Scope)は 実装: visual-surface dependency registry と required visual-impact policy check を導入し、UI変更PR内でVRT処置を強制する #2019 に先送りしない(PR test(vrt): combat-hud-running component baseline を #1958 新レイアウトへ追従させる #2024 OWNER レビュー明記)。
#1391が扱う running/paused HUD baseline の frozen 昇格。
Acceptance Criteria
- AC1:
tests/component/combat-hud-running.vrt.test.tsのcombat-hud-runningシナリオの comparator がallowedMismatchedPixelRatio: 0.02に加えてallowedMismatchedPixels絶対値上限を指定しており、その値が実測ノイズ(fresh-run actual と再生成後 baseline の diff)から導出されたものであり、任意の固定値ではないことがコメントまたは evidence manifest で追跡可能である。 - AC2:
status/elapsed/pause/edge-controlの critical subregion それぞれについて、data-critical-subregion属性で選択した個別 capture または個別の小さい visual assertion がtests/component/配下に存在する。 - AC3: HULL・Pause・elapsed のいずれかを意図的に非表示にする env-gated mutation negative-control lane が存在し、CI 上でその lane を有効化すると通常の screenshot assertion が non-zero mismatch で fail する(false-negative にならない)。
- AC4:
hp=25/maxHp=100等、critical warning を表示する critical fixture のシナリオと、対応する baseline PNG が新規に追加されている。 - AC5:
tests/component/__screenshots__/combat-hud-running.vrt.test.ts/combat-hud-running-chromium-linux.png(および AC4 の critical fixture baseline)が、AC1-AC3 の comparator/critical-region/mutation-control 契約変更を反映した最終状態で、CI ピン留め canonical environment 内で再生成されコミット更新されている。 - AC6: CI ピン留め canonical environment 内で
pnpm test:vrt:component(対象 spec 限定)を実行すると、running シナリオ・critical fixture シナリオともに PASS し、mutation negative-control lane は AC3 の通り意図通り fail する。 - AC7:
pnpm test:vrt:evidence:triple-runが、AC6 の通常 assertion(mutation lane を除く)を fresh browser process で 3 回連続実行し、各回で保存した actual PNG の SHA-256(actual_sha256_run_1/actual_sha256_run_2/actual_sha256_run_3)が 3 回とも一致することを確認して exit code 0 で終了する。コミット済み baseline file が--updateなしの実行で変化しないことの確認だけでは満たさない。 - AC8: current head SHA・CI run ID・artifact ID・baseline SHA-256・
actual_sha256_run_1/2/3・mismatched pixel count・effective pixel limit・mutation control 結果(hull_hidden/pause_hidden/elapsed_hiddenそれぞれの expected_failure 判定)を含む evidence manifest が生成され、current head に紐づく形で CI artifact または PR comment として残っている。旧 head の自己申告や、baseline PNG のみの artifact では満たさない。 - AC9: 本 Issue で変更されるファイルは、拡張後 Allowed Paths の集合と完全に一致する(
origin/main...HEADの changed-path 集合が Allowed Paths のいずれかに一致する)。
Verification Commands
# AC1
# preflight-scope: pr_review_only
$ rg -n "allowedMismatchedPixels" tests/component/combat-hud-running.vrt.test.ts# AC2
# preflight-scope: pr_review_only
$ rg -n "data-critical-subregion" tests/component/ -g "*.vrt.test.ts"# AC3
# preflight-scope: pr_review_only
$ rg -n "mutation" tests/component/ -g "*.vrt.test.ts"# AC4
# preflight-scope: pr_review_only
$ rg -n "mountCriticalScenario" tests/component/combat-hud-running.vrt.test.ts# AC5
# preflight-scope: pr_review_only
$ pnpm test:vrt:component -- tests/component/combat-hud-running.vrt.test.ts# AC6
# preflight-scope: pr_review_only
$ pnpm test:vrt:component -- tests/component/combat-hud-running.vrt.test.ts# AC7
# preflight-scope: pr_review_only
$ pnpm test:vrt:evidence:triple-run# AC8
# preflight-scope: pr_review_only
$ rg -rn "VISUAL_BASELINE_REVIEW_EVIDENCE_V1" .# AC9
# baseline-expect: pass
$ git diff --name-only origin/main...HEADpnpm test:vrt:component / pnpm test:vrt:update:component は build を含まない hermetic な VC である。pnpm typecheck / pnpm lint / pnpm test / pnpm build は project-constitution の必須検証として PR レビュー時に別途実行する(本 Issue 固有の AC/VC には含めない)。AC7 の「3 回連続」・AC8 の evidence manifest は Runtime Verification Applicability の artifact_requirements で evidence として記録する。
Runtime Verification Applicability
decision: immediate
reason: "comparator 感度・critical subregion・mutation negative control・baseline 再生成は Vitest Browser Mode 上の実 Chromium レンダリングでのみ検証でき、静的解析では代替できない"
applicable_acs: [AC1, AC2, AC3, AC4, AC5, AC6, AC7, AC8, AC9]
execution_environment: "CI ピン留め Playwright Docker イメージ(mcr.microsoft.com/playwright@sha256:9bd26ad900bb5e0f4dee75839e957a89ae89c2b7ab1e76050e559790e946b948)内、Vitest Browser Mode、Chromium、viewport 1280x720、DPR 1"
skip_conditions: "pinned Docker イメージが利用不可、browser launch failure、pnpm install --frozen-lockfile の dependency lock mismatch"
fallback_policy: "host 環境生成または skip された evidence は PASS として扱わない。canonical environment での実行結果のみを merge blocker 解除の根拠とする。current head と紐づかない自己申告 evidence(旧 head で取得した3回実行等)は evidence として扱わない"
artifact_requirements:
- head_sha
- run_id
- artifact_id
- container_digest
- node_version
- pnpm_version
- vitest_version
- playwright_version
- chromium_version
- viewport
- device_scale_factor
- baseline_sha256
- actual_sha256_run_1
- actual_sha256_run_2
- actual_sha256_run_3
- mismatched_pixels
- effective_pixel_limit
- mutation_controls: { hull_hidden: expected_failure, pause_hidden: expected_failure, elapsed_hidden: expected_failure }
- expected_actual_diff_reviewAllowed Paths
tests/component/combat-hud-running.vrt.test.tstests/component/__screenshots__/combat-hud-running.vrt.test.ts/**vitest.visual.config.tspackage.json.github/workflows/ci.ymldocs/dev/visual-baseline-registry.mdscripts/tests/test_check_visual_artifact_pipeline.py
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- 校正済み
allowedMismatchedPixelsを導入してもなお critical subregion(HULL/Pause/elapsed/status/edge-control)の欠落が comparator tolerance 内に収まる、mutation negative-control lane が意図通り fail しない、capture root / comparator / fixture に別の欠陥がある、または環境差以外の非決定性が検出された場合(baseline を更新せず、Issue 契約を再定義するために停止する)
Required Skills
- Visual regression testing
- Vitest Browser Mode
- Playwright Docker image compatibility
- image diff review
- Chromium rendering determinism
- pixel-level comparator calibration(絶対値 pixel cap の実測導出)
- CI evidence artifact 設計
Required Design References
docs/dev/visual-baseline-registry.md(combat-hud-running (component VRT)行。maturity はprovisionalのまま変更しない)- 実装: combat HUD の配置・safe-zone・情報優先度を実装する #1958(producer 変更元)
- PR 実装: combat HUD の配置・safe-zone・情報優先度を実装する (#1958) #2006(実装: combat HUD の配置・safe-zone・情報優先度を実装する #1958 のマージ、本 Issue の起票根拠)
- 実装: Playwright + Vitest Browser Mode 段階導入で #1370 battle-stage DOM overlay を VRT 保護 #1380(VRT rollout tracker、ancestor)
- 実装: Vitest Browser Mode component VRT を report-only scaffold として追加する #1389(component VRT scaffold 導入元)
- 実装: #1375 merge後 running HUD / paused HUD VRT baseline を frozen 昇格する #1391(実装: combat HUD の配置・safe-zone・情報優先度を実装する #1958 merge 後の running/paused HUD baseline frozen 昇格 follow-up)
- 実装: PR #1964 の battle-stage 寸法修正に伴い vrt-running-hud-overlay.png VRT baseline を更新する #1980(baseline-only Issue の調査中に oracle defect が発見され、pixel diversity・negative control・capture semantics まで契約を再定義した直接の先例)
- 実装: visual-surface dependency registry と required visual-impact policy check を導入し、UI変更PR内でVRT処置を強制する #2019(visual-surface dependency registry と required visual-impact policy check の導入。2% comparator の感度証明と negative control は 実装: visual-surface dependency registry と required visual-impact policy check を導入し、UI変更PR内でVRT処置を強制する #2019 の Out of Scope であり本 Issue のスコープ)
- PR test(vrt): combat-hud-running component baseline を #1958 新レイアウトへ追従させる #2024(本 Issue の baseline candidate PR。OWNER REQUEST_CHANGES review comment: test(vrt): combat-hud-running component baseline を #1958 新レイアウトへ追従させる #2024 (comment) )
Source
本 Issue は post-merge-cleanup の follow-up 検出により起票され、issue-refinement-loop の anchor comment(OWNER, REQUEST_CHANGES, https://github.com/squne121/loop-protocol/issues/2014#issuecomment-5224590803)を反映して初版が全面的に rewrite された。
その後、本 Issue を Closes する PR #2024(baseline PNG 1 件のみの regeneration)に対し、OWNER が REQUEST_CHANGES review を投稿し(#2024 (comment) )、本 Issue 自身の Stop Condition「candidate が意図した HUD を撮影していない、critical region の欠落が comparator tolerance 内に収まる…場合、baseline を更新せず、Issue 契約を再定義するために停止する」が発火したことを指摘した。具体的には、現行 allowedMismatchedPixelRatio: 0.02(1280×212px capture で実効上限 約5,427px)は、HULL(約4,128px)・Pause(約2,808px)・elapsed(約1,344px)の欠落を tolerance 内に収め得ること、および「3 回連続安定」の evidence が実際には --update なし実行でコミット済み baseline file が不変であることしか確認しておらず actual rendering の同一性を証明していないことが指摘された。OWNER は承認条件として「Issue #2014 の Stop Condition を適用し、Allowed Paths を test/config/CI/registry まで拡張して契約を再定義する」ことを明示的に指示した。
本 rewrite はこの OWNER 指示を反映し、スコープを「baseline 再生成のみ」から「baseline 再生成 + comparator 感度修正(校正済み絶対値 pixel cap・critical subregion assertion・env-gated mutation negative control・critical fixture 追加)+ evidence retrofit(current head 紐づけの actual PNG 3 回 hash 比較・VISUAL_BASELINE_REVIEW_EVIDENCE_V1 相当の evidence manifest)」へ再定義した。#1980 が同種の oracle defect 発見・契約再定義の直接の先例として参照された。#2019 は visual-surface dependency registry の恒久対策として妥当であり続けるが、2% comparator の感度証明と surface-specific negative control は #2019 の明示的な Out of Scope であるため、本 Issue に残す。
さらに、AC4 で追加された hp=25/maxHp=100 critical fixture(combat-hud-critical.png)の実装は、既存の(本 Issue 起票以前から存在する)required check python-test-core の scripts/tests/test_check_visual_artifact_pipeline.py::test_extract_derived_vitest_component_captures_against_real_repo_spec_files を破壊した。同テストが Vitest component-VRT capture ID の期待集合を combat-hud-running.png のみにハードコードしており、AC4 で契約上正当に追加された combat-hud-critical.png を未考慮だったためである。この修正はテストのハードコードされた期待 capture-id 集合を更新するのみであり、新規の production behavior を伴わない。この narrow な修正のために Allowed Paths へ scripts/tests/test_check_visual_artifact_pipeline.py を追加する Scope Delta を適用した。
- dedupe_key:
follow-up:squne121/loop-protocol:pr/2006:component-vrt-report-baseline
Activity
squne121 commentedon Aug 8, 2026
新しいレイアウトを設計及び決定した際にVRT baseline再生成を作业内に含めるようにできないですか。
テスト戦略サブエージェントやVRT設計者やIssue作成の際のSSOTに判断が思い出されるようにするとか。
実装の都度、VRT baseline再生成が別Issueで行われる運用を良くないものだと思っているので再発防止策をWEB調査と検討してほしい。
squne121 commentedon Aug 8, 2026
判定
指定コメントの問題提起は正しいです。
#2014 は、既に壊れている component VRT を直す緊急補修としては有効です。しかし本文が意図的に「PNG 1ファイルのみ」に閉じ、テスト、registry、Issue 作成契約、CI gate の変更をすべて対象外にしているため、コメントが求める「レイアウト変更と baseline 更新を同じ作業に含める再発防止」には回答していません。
根本原因
今回の因果関係は次のとおりです。
createHudController()と production CSS を直接使うcombat-hud-runningcomponent VRT が導入された。ただし CI は report-only / non-required とされた。component-vrt-reportは production HUD 変更により失敗していたにもかかわらず、非requiredであるため PR は承認・マージされた。したがって、これは単なる PNG の更新漏れではありません。production source と visual contract の依存関係が機械可読に定義されておらず、PR 内での co-change を強制できなかったワークフロー欠陥です。
敵対的レビュー findings
P0-1 — Issue の Outcome が指定コメントと一致していない
#2014 の Outcome は「report-only job を PASS に戻すこと」であり、再発防止を完了条件に含みません。さらに、テスト定義、comparator、registry、required 化を明示的に除外しています。これでは同じ事象が次の HUD 変更で再発します。
リポジトリ自身の Issue 作成ガイドは、follow-up でワークフロー不具合を扱う場合、次を要求しています。
#2014 は、この比較を行わず、事後 PNG 更新という workaround だけを採用しています。これは既存の authoring guidance に反します。
Required change:
#2014 は「既存負債の即時修復」に位置付け直し、別途、一度だけ実装する再発防止 Issue を mandatory follow-up として明記してください。指定コメントは、その再発防止 Issue が完了するまで resolved 扱いにすべきではありません。
P0-2 — source → visual surface の依存契約が存在しない
現在の registry にある
combat-hud-running (component VRT)行は、次の情報を持っています。allowedMismatchedPixelRatio: 0.02invalidated_by: #1380しかし、実際の描画 producer である次のパスを invalidation source として持っていません。
src/ui/combatHud.tssrc/ui/HudController.tssrc/style.cssまた、
invalidated_byに直接の変更 Issue #1958 も含まれていません。その結果、Issue 作成時の exact path overlap 検索では、#1389、#1391、#1980 といった意味的に関連する VRT Issue が発見されず、#1390 と #420 の PNG path 一致有無だけが確認されました。これは依存関係の探索方式として不十分です。
Required change:
baseline path ではなく、visual surface ID を中心とした構造化 SSOT が必要です。
TypeScript/Vite の module import は dependency graph で追跡し、global CSS は最初は明示 mapping にするのが現実的です。Storybook も、
git diffと builder の module graph を組み合わせて、直接・間接依存する visual surface を特定しています。これは導入製品の推奨ではなく、影響解析方式の実装 precedent として有用です。(Storybook)P0-3 — report-only CI では同一 PR 更新を強制できない
component-vrt-reportは意図的にexcludedに分類され、成功・失敗にかかわらず merge-ready を阻害しません。CI 自体は実際の失敗 exit code を保持していますが、最終 verdict には反映されません。これは今回の再現条件そのものです。
単純に screenshot job 全体を required にすると、環境揺らぎや unrelated PR まで止める可能性があります。必要なのは、別の軽量な required visual-impact policy check です。
この check は全 PR で必ず起動し、変更された surface ごとに次のいずれかを要求します。
baseline_changed: 同じ PR で baseline が更新され、canonical environment で PASSverified_unchanged: source は変わったが、既存 baseline のまま canonical VRT が PASSwaived: owner、理由、追跡 Issue、期限を持つ明示 waiver該当 surface があり、いずれの disposition もない場合は required check を失敗させます。これなら、重い VRT job 自体は report-only のままでも、影響を受けた PR に限って未処置の visual regression を merge blocker にできます。
なお required workflow 自体に
paths:filter を設定する設計は避けるべきです。GitHub は path filter で required workflow 全体が skip されると check を Pending のまま残し、merge を阻害します。全 PR で起動する aggregator job の内部で impact の有無を判定する構造が安全です。([GitHub Docs]2)P0-4 — 「PNG だけ変更」を先に固定すると、壊れた oracle を承認する危険がある
#1980 は重要な先例です。当初は baseline PNG の寸法追従だけを行う Issue でしたが、敵対的レビューによって、Canvas mask が capture の約 99.8% を覆い、HUD を実質的に検査していないことが判明しました。そのため、capture semantics、pixel diversity、negative control、registry まで修正する契約に再定義されています。
#2014 は反対に、次を最初から禁止しています。
この契約では、調査中に capture defect や comparator defect を発見しても、正しい修正を行えません。実装者は Stop Condition で停止するしかなく、最悪の場合は赤い test を緑にするためだけに誤った画面を baseline として固定します。
現在の component test は production DOM、production CSS、固定 GameState、
document.fonts.ready、[data-combat-hud]capture を使用しており、基礎設計は妥当です。しかし、その scenario について「重要な HUD 要素を意図的に消した場合に comparator が確実に fail する」という mutation-sensitive な証明はありません。CI に存在する negative control は、.vitest-attachmentsが artifact upload を往復できることの証明であって、combat-hud-runningの visual oracle の有効性を証明するものではありません。Required change:
#2014 に次の Stop Condition を追加してください。
P1-1 — Verification Commands が Acceptance Criteria を証明していない
AC1
現在のコマンドは次です。
これは、そのファイルに過去のコミットが1件でも存在すれば成功します。
証明できないものは次のとおりです。
つまり、実装前の main でも成立する非判別的 VC です。
AC4
現在のコマンドは次です。
これはファイル名を表示するだけで、次の場合も exit 0 になります。
tests/component/外に大量の変更があるAC4 の「変更ファイルが exact singleton である」を検査していません。
Required change:
既存の single-command guard に適合する、exact allowed-path checker を用意すべきです。最低限、次を機械判定してください。
そして、集合が完全一致しない場合は non-zero にします。
P1-2 — Vitest の Issue なのに Playwright の update mode 用語が混入している
#2014 は再生成後に「
--update-snapshots=none(CI の実際のモード)」で実行すると記述しています。しかし component lane は Playwright test runner ではなく Vitest Browser Mode です。現在の package scripts は次の構成です。
したがって、component VRT の read-only verification は、単に
--updateを付けずに実行することです。--update-snapshots=noneは Playwright 側の語彙であり、Issue 契約に混ぜるべきではありません。Vitest の公式手順も、意図した UI 変更時は
vitest --updateで candidate を作り、更新画像をレビューしてからコミットする運用です。(Vitest)また、VC は fuzzy な名前引数より exact spec path にした方が安全です。
pnpm exec vitest run \ --config vitest.visual.config.ts \ tests/component/combat-hud-running.vrt.test.tsP1-3 — Runtime Verification Applicability が欠落している
#2014 の主成果物は、Chromium を起動して DOM を描画し、PNG を比較することです。これは静的検証ではありません。
それにもかかわらず、Issue には repo 標準の
Runtime Verification Applicabilityがありません。既存 authoring guidance では、decision: immediateの場合に次を要求しています。applicable_acsexecution_environmentskip_conditionsfallback_policyartifact_requirements少なくとも以下が必要です。
P1-4 — 「複数回」の定義がない
「複数回実行して安定していること」では、実装者ごとに1回、2回、10回と解釈が変わります。
Vitest 自身は、連続した screenshot が一致するまで再撮影する stable screenshot detection を持っていますが、これは単一 test run 内の settling 検出です。clean process / clean container 間の再現性とは別です。(Vitest)
推奨条件:
--updateなしDocker コンテナまで毎回 fresh にするかはコスト次第ですが、少なくとも browser process は fresh にすべきです。
P1-5 — 2% tolerance の感度が証明されていない
現在の comparator は
allowedMismatchedPixelRatio: 0.02です。capture が Issue 記載どおり約 1280×212 なら、理論上は約 5,427 pixel の不一致を許容します。2% 自体を直ちに過大と断定することはできません。font rasterization を吸収する意図は registry に記載されています。しかし、次が未証明です。
これらが 2% を超えて確実に fail するかどうかです。
#1728 は E2E VRT について、fixture receipt と具体的 state assertion を screenshot 前に要求し、緩い comparator による silent pass を防ごうとしています。component lane にも同じ思想が必要です。
恒久対策 Issue では、
combat-hud-running専用に次のいずれかを追加すべきです。P1-6 — Issue hierarchy が事実を表していない
#2014 は次のように記載しています。
parent_issue: noneしかし実態は次のすべてに接続しています。
#1380 は明示的に #1389 と #1391 を VRT rollout child として管理しています。
#1391 も #1958 merge 後の HUD geometry baseline を扱うと明示しています。
推奨関係は次です。
少なくとも
Remaining Parent Gapsには「visual impact co-change enforcement が未実装」と残す必要があります。P1-7 — MRC と Required Skills が正規形から逸脱している
#2014 の
change_kindはtest_baselineですが、現行 implementation template の列挙は次です。test_baselineは文書化された値ではありません。validator が偶然通すとしても schema drift です。PNG のみならdata、再発防止まで含めるならmixedまたはworkflowが妥当です。また
Required Skills: なしも不適切です。元の #1389 は、この lane に必要な知識として TypeScript、Vitest Browser Mode、Playwright、Python/CI policy を明記しています。baseline-only 作業でも最低限、次は必要です。現行実装で維持すべき点
環境固定と evidence upload の実装は比較的強固です。
pnpm install --frozen-lockfileVitest と Playwright の公式資料も、visual baseline と verification を同じ OS・browser・設定・hardware 条件で実行するよう求めています。現在の pinned container 方針は維持すべきです。(Vitest)
問題は rendering environment ではなく、どの source 変更がどの visual contract を無効化するかを発見し、同じ PR 内の処置を強制する配線です。
推奨する恒久対策
1. 一度だけ systemic Issue を起票する
推奨タイトル:
これは「今後も baseline ごとに別 Issue を作る」提案ではありません。今後の別 Issue 発生を止めるための、一度限りの workflow implementation です。
主要 AC は次の形が妥当です。
baseline_changed | verified_unchanged | waivedの disposition を要求する。visual-impact-policycheck が fail する。2. Agent ではなく deterministic resolver を正本にする
指定コメントでは「テスト戦略サブエージェント」「VRT設計者」「Issue作成時のSSOT」が候補に挙げられています。
このうち正本にすべきなのは SSOT + deterministic resolver です。LLM に「思い出させる」だけでは再発します。
また現行の
.claude/agents/issue-author.mdは deprecated stub で、新規起票はissue-creator、既存修正はissue-editorが担当します。したがって、旧issue-authorや新しい VRT designer agent に規則を複製するのではなく、次へ集約すべきです。resolve_visual_impact.pyissue-creator/issue-editorIssue MRC または専用 section の候補:
decision: unknownのまま consumer-ready implementation Issue に進むことは禁止します。3. controlled update command を作る
手動で長い Docker command を組み立てるのではなく、surface ID を受け取る controlled executor を作る方が安全です。
この executor は次を行います。
VISUAL_BASELINE_UPDATE_RESULT_V1JSON を生成Vitest 公式資料も、通常の PR CI で snapshot を無条件自動更新せず、feature branch 上の手動・制御された update workflow を使い、更新画像をレビューする方式を推奨しています。(Vitest)
4. review ownership を追加する
baseline path と visual registry に CODEOWNERS を設定し、code-owner approval を必須化するのが妥当です。GitHub は CODEOWNERS に基づく自動 review request と、protected branch / ruleset 上の必須承認を提供します。([GitHub Docs]4)
ただし同じ CODEOWNERS 行に複数 owner を書いても、GitHub はそのうち1名の承認で条件を満たします。implementation owner と visual owner の独立した二者承認が必要なら、次を組み合わせる必要があります。
#2014 の最小修正案
#2014 自体は削除せず、既存負債の補修として次のように修正するのが妥当です。
Acceptance Criteria は最低限、次へ変更します。
component-vrt-reportを green に戻すだけなら #2014 で完了できます。しかし、指定コメントへの回答として必要なのは AC6 の先にある恒久対策です。最終結論
#2014 は補修 Issue として残してよいものの、現状の契約では承認不可です。
特に blocking なのは次の4点です。
適切な終了条件は、#2014 で current baseline debt を直し、同時に一度限りの visual-impact enforcement Issue を起票・実装し、以後は HUD source 変更PRの中で baseline 更新または unchanged 証明を完結させることです。これが実装されるまで、指定コメントは未解決です。
squne121 commentedon Aug 8, 2026
issue-refinement-loop: approved
sha256:355b4b2e1a1b1a76c1daf1db4fea7ca2db9a1cd8580e34866e98d6c805ebf71e反映した anchor comment 指摘
change_kindを正規 enum(data)に修正、Required Skills を明記Follow-up materialization
squne121 commentedon Aug 8, 2026
implement-issue: 実装完了 (2026-08-08T05:52:36Z)
.claude/worktrees/issue-2014-combat-hud-vrt-baselineworktree-issue-2014-combat-hud-vrt-baselinesqune121 commentedon Aug 8, 2026
impl-review-loop: 完了 (2026-08-08T00:00:00Z)
fix_delta iteration 1: comparator感度・critical subregion・mutation negat…
fix_delta iteration 2: mutation-control CI verifier outcome polarityを…
fix: PR Body Japanese Check の見出し日本語0%を解消する (#2014)
fix_delta iteration 3: derived Vitest component-VRT capture-idテストにcom…
fix: VISUAL_BASELINE_REVIEW_EVIDENCE_V1 manifest の head_sha を実PRヘッドに束縛する
squne121 commentedon Aug 8, 2026
impl-review-loop: 完了 (2026-08-08T09:45:00Z)
経緯サマリ
VISUAL_BASELINE_REVIEW_EVIDENCE_V1evidence manifest)。head_shaが GitHub Actions の ephemeral merge-preview SHA を誤って参照していたバグを発見・修正mergeStateStatus: BEHINDのためroute_to_update_branchで implementation-worker にupdate_branch(merge-only)を委譲 → 新 head で再検証・再レビュー → 全 required CI(component-vrt-report / e2e 含む)green・mergeStateStatus: CLEANを確認しroute: approvedで終了。test(vrt): combat-hud-running component baseline を #1958 新レイアウトへ追従させる (…