From 471418e5c3eed4dc759559aa0947a9a0b49ff5b5 Mon Sep 17 00:00:00 2001 From: yourname Date: Tue, 14 Apr 2026 07:27:26 +0000 Subject: [PATCH] sync: add immediate PNG format check rule after each screenshot capture - Add mandatory rule: check each screenshot with 'file' command immediately after capture - If check fails, re-capture immediately, cannot accumulate to batch fix at end - Prevents the bug where file extension is .png but content is YAML text from browser_snapshot --- .claude/skills/d8d-dev/journey-mode.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.claude/skills/d8d-dev/journey-mode.md b/.claude/skills/d8d-dev/journey-mode.md index ade51fe..d10e38f 100644 --- a/.claude/skills/d8d-dev/journey-mode.md +++ b/.claude/skills/d8d-dev/journey-mode.md @@ -422,7 +422,9 @@ Story 验证全部通过 ≠ 用户能正常使用系统。旅程模式弥补这 - [ ] `browser_take_screenshot` = PNG 截图保存(用于视觉验证),**每个步骤必须** - [ ] 截图文件名**必须**包含 `.png` 扩展名(`journey-epic-N-M-step-S.png`) - [ ] 截图**必须**保存到 `tests/e2e/screenshots/` 目录,不能保存到当前工作目录 -- [ ] 每个用户步骤完成 → `browser_take_screenshot` + `analyze_image` → 视觉验证关卡 +- [ ] **每个截图文件必须是真正的 PNG 图片** → `file ` 检测输出必须包含 "PNG image data" +- [ ] **强制:每截一张图立刻检查** → `browser_take_screenshot` 完成后立即执行 `file` 检测,失败立刻重截 +- [ ] 每个用户步骤完成 → `browser_take_screenshot` + `file` 格式验证 + `analyze_image` → 视觉验证关卡 - [ ] 旅程最终完成 → `browser_take_screenshot` 最终截图 + `browser_network_requests` 资源检查 - [ ] 违反任意一条 → 中断补全,不能继续 @@ -480,12 +482,18 @@ Story 验证全部通过 ≠ 用户能正常使用系统。旅程模式弥补这 executed_at: "{ISO timestamp}" note: "{备注}" ``` - c. 步骤级 GATE 检查(5 项,任一 FAIL → 阻断): + c. 步骤级 GATE 检查(6 项,任一 FAIL → 阻断): ├── G1: screenshot_consistency — screenshot_path 文件存在 ├── G2: analyze_image_executed — analyze_image_result 非空 ├── G3: checklist_synced — verification-checklist.yaml step status 已更新 ├── G4: state_persisted — pipeline-state.yaml step_results 已追加 - └── G5: all_issues_resolved — 所有 issues_detected 有对应 resolved auto_fix + ├── G5: all_issues_resolved — 所有 issues_detected 有对应 resolved auto_fix + ├── G6: file_format_validation — `file screenshot.png` 输出检测为 "PNG image data" + │ ⛔ **强制规则:每截一张图立即检查** → `browser_take_screenshot` 完成后**立刻**执行 `file` 命令检测格式 + │ - 检测失败 → **立即重新截图**,不得累积到最后批量修复 + │ - 检测通过 → 才允许继续下一步骤 + │ - 目的:防止出现"扩展名 .png 但内容是 YAML 文本"的错误 + 4.5. ⛔ **源码 SVG data URI 扫描**(视觉验证关卡内 — 每次 snapshot 后强制执行): - Bash: `grep -rn "data:image/svg+xml" app/mini-program/src/`(扫描小程序源码目录) - 发现匹配 → svg_data_uri_check.found = FOUND → 记录文件列表