sync: add immediate PNG format check rule after each screenshot capture #36

Merged
d8dfun merged 1 commits from sync/d8d-skills-20260414-072634 into master 2026-04-14 15:30:08 +08:00

View File

@@ -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 <path>` 检测输出必须包含 "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 → 记录文件列表