docs(qa): 基线判红归因改判,作废「运行期漂移」初判并补 lessons §5.33
台账 §9.4 初稿把 chromium-mobile 两页 +30/+21px 记为「零源码改动 ⇒ 只能来自
运行期」,参照系用错:旧参照的采集树是 040951c(09-22),当前树含 a366bd1
(09-28 第五轮),参照比树旧了一个修复轮次。
- 实测归因:row-diff.cjs(sharp 逐行比对)定位发散行 y=7440 落在 /products/erp
的 benefits 段;git diff 显示 Q-6 把指标 count-up 从 render 体迁入 useEffect
并加取消 ⇒ 旧参照冻结的是动画中间帧,新参照是稳定终态,属预期改进
- 排除数据侧:prisma/seeds/products.ts 在该窗口零改动
- 三条口径落到 lessons §5.33:归因须对「采集树 vs 当前树」;基线数量须标「例/张」
(本轮 38 张 = 31 例);裸 --update-snapshots 实为 changed 模式,不重写通过项
- §9.5 的 G 项就此关闭,取证脚本随证据目录入库
This commit is contained in:
1 parent
6ba4b70a0c
commit
c66dfcac26
4 files changed
+82
-4
No files matched your search
@@ -44,9 +44,13 @@
|
||||
- `product-card-visual-chromium-desktop.png`:`bento-product-card-erp` 卡(标题 + 研发中/企业套装徽标 + 指标三格 + 目标口径注 + 能力标签)。中部留白**不是**渲染缺失:`products-content-v3.tsx:137` 的 `<p className="... flex-1">` 在 large 卡里撑高,文本仅占顶部一行——同一形态在**已批准**的 `products-fullpage-visual-chromium-desktop.png` 里逐字一致,故新参照与既有批准基线同形。选择器锚点为 `[data-testid^="bento-product-card-"]` + `role="listitem"` + `data-bento-size` 三重钉住(`:154-157`)。
|
||||
- `button-default-visual-chromium-mobile.png`:44x44 汉堡按钮(三横线),与 N-15(c) 实测结论一致。
|
||||
|
||||
## 5. 观察项(不阻断,登记备查)
|
||||
## 5. 观察项与归因更正(2026-10-08 本轮内自我改判)
|
||||
|
||||
1. **chromium-mobile 两页 +30 / +21px 未归因**:与桌面族「大幅收缩」形态不同,移动档本来就是单列,网格修复不改高度。本轮 `1396666` 相对封版点 `a0328a6` **零生产源码改动**(29 文件全在 `docs/ specs/ e2e/ README .claude .mcp`),故该位移来自**运行期**(CMS 数据行或日期派生内容)而非代码。影响:新基线吸收了一次未归因的小位移;若后续出现移动档全页判红,先查此处。
|
||||
1. **chromium-mobile 两页 +30 / +21px 已归因,且不是运行期漂移**(本条初稿曾误判为「位移只能来自运行期」,已作废):
|
||||
- 归因错在参照系。旧参照的**采集树**是 `040951c`(2026-09-22 规范模式重生成),最后一次被改动是 `6bb7c55`(2026-09-28 10:48);而当前树含 `a366bd1`(第五轮修复,2026-09-28 10:48:07)与 `a0328a6`。⇒ 判红须对「采集树 vs 当前树」做 diff,而不是「上一轮提交 vs 本轮提交」。本轮「相对 `a0328a6` 零生产源码改动」只保证**门禁绿灯可平移**,不保证**参照与树同源**。
|
||||
- 机理已定位:`src/components/detail/detail-product-value.tsx` 在 `a366bd1` 里做了 Q-6 修复——指标数字 count-up 动画原先写在 **render 体内**(每帧 `setState` 再 spawn 一条从 0 开始的 rAF 链、从不取消),改为 `useEffect` 驱动并在卸载/重跑时取消(diff 见 `:70-100`)。旧参照拍到的是**动画竞态中的中间帧**,新参照拍到稳定终态 ⇒ 指标卡文本/高度小幅位移,属预期改进。
|
||||
- 现场取证:`node docs/acceptance/2026-10-08-baselines/row-diff.cjs <参照路径> <outdir>`(sharp 逐行比对)现取首个发散行 = **y 7440**(`product-erp-fullpage` mobile,共 24453/24483 行),该处正是 `/products/erp` 的 `benefits` 价值列表段;裁图对照显示新参照出现发丝分隔线且条目间距收紧。
|
||||
2. **仓库体积**:新增 25 张 PNG 共 **17,192 KB**(最大单张 `product-erp-upgrade-fullpage-visual-chromium-mobile.png` 2,472 KB),13 张覆盖净变化为负(如 webkit erp 2,303,020 → 2,066,938 字节)。
|
||||
3. **采集口径**:dev 目标。`docs/testing.md` §确定性约束 1 已实证「快照与 `E2E_TARGET` 无关」(`e2e/fixtures.ts` 剥 `nextjs-portal`),故 production 复核不会因此全红;`e2e/visual-snapshots` 现共 132 张(含 `manual-acceptance/` 2 张)。
|
||||
4. **只读比对的前置**:跑前 `lsof :3000` 空闲、无 `next-server` 残留 ⇒ 未落入 `reuseExistingServer` 静默复用旧构建的坑(`docs/development/quality-gates.md:163`)。
|
||||
5. **残留风险(改判后仍留一条)**:Q-6 族的其他 count-up 消费点若仍有 render 体内动画,基线仍可能拍到中间帧。本轮 125/0 只证明**当前树自洽可复现**,不证明「参照=用户所见」;下一次跨树复核(如 production 目标或换 DPR 档)若出现指标卡判红,按本条查。
|
||||
@@ -0,0 +1,55 @@
|
||||
const { execFileSync } = require('node:child_process');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const sharp = require('sharp');
|
||||
|
||||
const repo = process.cwd();
|
||||
const rel = process.argv[2];
|
||||
const outDir = process.argv[3] || '/tmp/vsdiff';
|
||||
const oldRef = process.argv[4] || '1396666';
|
||||
fs.mkdirSync(outDir, { recursive: true });
|
||||
|
||||
const oldBuf = execFileSync('git', ['show', `${oldRef}:${rel}`], { maxBuffer: 1 << 28 });
|
||||
fs.writeFileSync(path.join(outDir, 'old.png'), oldBuf);
|
||||
const newBuf = fs.readFileSync(path.join(repo, rel));
|
||||
fs.writeFileSync(path.join(outDir, 'new.png'), newBuf);
|
||||
|
||||
async function raw(f) {
|
||||
const img = sharp(f).ensureAlpha();
|
||||
const { data, info } = await img.raw().toBuffer({ resolveWithObject: true });
|
||||
return { data, w: info.width, h: info.height, ch: info.channels };
|
||||
}
|
||||
|
||||
(async () => {
|
||||
const a = await raw(path.join(outDir, 'old.png'));
|
||||
const b = await raw(path.join(outDir, 'new.png'));
|
||||
console.log(`old ${a.w}x${a.h} new ${b.w}x${b.h}`);
|
||||
const w = Math.min(a.w, b.w);
|
||||
const rows = Math.min(a.h, b.h);
|
||||
const firstDiffRows = [];
|
||||
for (let y = 0; y < rows; y++) {
|
||||
let diff = 0;
|
||||
const oa = y * a.w * a.ch, ob = y * b.w * b.ch;
|
||||
for (let x = 0; x < w; x++) {
|
||||
for (let c = 0; c < 3; c++) {
|
||||
const d = Math.abs(a.data[oa + x * a.ch + c] - b.data[ob + x * b.ch + c]);
|
||||
if (d > 24) { diff++; if (diff > 40) break; }
|
||||
}
|
||||
if (diff > 40) break;
|
||||
}
|
||||
if (diff > 40) {
|
||||
firstDiffRows.push(y);
|
||||
if (firstDiffRows.length >= 1 && y - firstDiffRows[0] > 400) break;
|
||||
}
|
||||
}
|
||||
if (!firstDiffRows.length) { console.log('no divergence in shared region'); return; }
|
||||
const start = firstDiffRows[0];
|
||||
let end = start;
|
||||
for (const y of firstDiffRows) end = y;
|
||||
console.log(`first divergent row = ${start}, last in burst = ${end}, burst rows = ${firstDiffRows.length}`);
|
||||
const top = Math.max(0, start - 260);
|
||||
const height = Math.min(b.h - top, 900);
|
||||
await sharp(path.join(outDir, 'new.png')).extract({ left: 0, top, width: b.w, height }).png().toFile(path.join(outDir, 'crop-new.png'));
|
||||
await sharp(path.join(outDir, 'old.png')).extract({ left: 0, top, width: a.w, height: Math.min(a.h - top, 900) }).png().toFile(path.join(outDir, 'crop-old.png'));
|
||||
console.log(`crops written to ${outDir}/crop-{new,old}.png (top=${top}, h=${height})`);
|
||||
})();
|
||||
@@ -358,7 +358,10 @@ S-3(about/contact/erp-upgrade 无 revalidate + revalidateTag no-op,涉渲染
|
||||
### 9.4 自证循环的处置(为什么这次「绿」仍然可失败)
|
||||
|
||||
基线由本轮自采,采集当下的绿本身不含信息量。使其仍具判别力的四点:① 容差未动(`e2e/playwright.config.ts:38-40`,`maxDiffPixels: 200` / `maxDiffPixelRatio` / `threshold: 0.3` 与历轮一致,无放宽);② `changed` 模式不重写通过项(9.2-①);③ 判定用的是**另一次独立运行**,写盘与只读之间隔了完整 server 生命周期(起停各一次);④ 三张关键新参照经人眼读图而非仅看退出码(9.3)。
|
||||
**残留风险(登记不阻断)**:chromium-mobile 两页全页仅 +30 / +21px 高度变化,与桌面族「大幅收缩」形态不同,未归因;因本轮相对 `a0328a6` 零生产源码改动,位移只能来自运行期(CMS 数据行或日期派生内容)。若后续移动档全页判红,先查此处。
|
||||
|
||||
**本小结初稿曾有一条错判,已作废并就地更正(双归零)**:原写「chromium-mobile 两页 +30/+21px 未归因;本轮相对 `a0328a6` 零生产源码改动 ⇒ 位移只能来自运行期(CMS 数据行或日期派生内容)」。参照系用错了——旧参照的**采集树**是 `040951c`(2026-09-22),最后被改动是 `6bb7c55`(09-28 10:48),而当前树含 `a366bd1`(09-28 10:48:07 第五轮)与 `a0328a6`。实测归因:`src/components/detail/detail-product-value.tsx` 的 Q-6 修复把指标 count-up 动画从 **render 体内**(每帧 `setState` 再 spawn 一条从 0 起的 rAF 链、从不取消)迁入 `useEffect` 并加取消 ⇒ 旧参照拍到的是**动画竞态中间帧**,新参照是稳定终态,位移属预期改进。现场取证法:`docs/acceptance/2026-10-08-baselines/row-diff.cjs`(sharp 逐行比对)现取首个发散行 y=7440,正落在 `/products/erp` 的 `benefits` 价值列表段。
|
||||
**管理归零(写进检查口径)**:「本轮相对上一轮零源码改动」只支撑**门禁绿灯平移**,**不支撑**「参照与当前树同源」;判红归因必须对「基线采集树 vs 当前树」做 diff。历轮把 11 例笼统记为「网格修复的预期收缩」正是漏了这个参照系,才让 mobile 那 2 例看起来「无因」。
|
||||
**改判后仍留的一条风险**:Q-6 族若还有其他 render 体内动画,基线仍可能冻结中间帧;125/0 只证明**当前树自洽可复现**,不证明「参照 = 用户所见」。
|
||||
|
||||
### 9.5 更新后的待授权清单(下一轮从这里接)
|
||||
|
||||
@@ -367,5 +370,5 @@ S-3(about/contact/erp-upgrade 无 revalidate + revalidateTag no-op,涉渲染
|
||||
| B | 建 PR / 合并 `main` | **人工可解,脚本不可解** | 本环境仍无 Gitea token(2026-10-08 复探:`env` 无 token、`~/.config/gitea` 与 `~/.gitea` 不存在、`git config` 无 credential);但 `git push` 回显已给出创建入口 `https://git.f.novalon.cn/novalon/novalon-website/pulls/new/qa/seal-2026-09-28`,浏览器登录即可建。**PR 描述文件现状**:`.pr-seal-2026-09-30.md` 过 `scripts/check-pr-checklist.sh`(EXIT=0),但叙述停在 seal 轮,须追加 §8(agentic 工具化 + `nav-keyboard`)与 §9(基线入库、视觉转绿)两轮内容后才可用 |
|
||||
| C | `npm run deploy` | 仍不建议 | 理由 ①(视觉 EXIT=1)已消除;② 需先完成 B、③ `deploy:rollback` 不回滚容器/`public/` 两条仍成立 |
|
||||
| F | `6ff19d1` + 本笔的推送 | 待批 | 快进推 `qa/seal-2026-09-28`;含 17MB 新增参照体积,须知情 |
|
||||
| G | 移动档 +30/+21px 归因 | 待做 | 只读取证即可(对比 `1396666` 与 `a0328a6` 两树的 mobile 全页 shot),不需要写授权 |
|
||||
| G | 移动档 +30/+21px 归因 | **已完成(本轮内,且推翻了自己的初判)** | 用 `row-diff.cjs` 定位发散行 y=7440 → `/products/erp` 的 `benefits` 段;根因是 `a366bd1` 的 Q-6 count-up 动画修复(旧参照冻结了动画中间帧)。取证法与教训见 9.4 |
|
||||
| — | AUTH-D2(重 seed)/ D4(写库 E2E 11 例)/ D9(Sentry 投递)/ D10(全量变异)/ D11(证据目录口径) | 状态不变 | 见 §2.3 |
|
||||
Reference in new issue
Block a user