[P0] 管理后台:批量失败可见、Webhook 读数口径、面包屑缺 4 项映射 (#88) - #89
Merged
Merged
Conversation
Owner
Author
独立复核结论与处置(verdict: hold → 已返工重验)独立 verifier 子 Agent 对本 PR 做了变异测试证伪。生产代码(三条修复、导航 15 项数据、分层、门禁)未能被证伪;但它查出回归矩阵两处不实与接线层无保护,verdict 为 变异测试:4 项原本存活,现已全部被杀
处置内容
一并修正的测试质量问题
返工后门禁
Verifier verdictpass(第二次复核后)。依据:三条修复经变异测试证伪失败;导航 15 项 id/label/href/顺序逐项全等; 仍未关闭的遗留项(不阻塞本 PR,需独立认领)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
管理后台有三处让操作者做出错误判断的缺陷,来源是一次对
src/app/admin/**的五席圆桌实测诊断(判据:可用性缺陷 > 工程债 > 纯审美)。handleBatchToggle逐条update的catch只写console.error,循环后无条件清空选择态并重取。批量停用 30 个信源、5 个失败时,UI 报告「全部处理完」,失败的 5 个仍按原状态继续采集并污染内容池。total并排渲染成同款 Badge,诱导2/1240 = 0.16%的误读;且失败徽章以failCount > 0条件渲染,0 失败时整枚消失——徽章缺席本身即错误信念。Webhook 是产品交付通道。prompts/scoring-dashboard/evidence/webhook-logs顶栏回退显示「管理」。Refs #88
Area
提交拆分
b07272474d3ef7e673d5898967c4cb16308Verification
npx tsc --noEmitpasses — 通过,0 错npm run test:coveragepasses — 通过,179/179;lines 96.53% / branch 92.7% / func 100%(阈值 90/85/90)npx vitest run— 13 个测试文件全绿,其中本次新增 32 条next dev干净重启后 5 个 admin 页面均 200、无编译错误变异测试(证明测试有效,不只证明测试存在):把两处实现改回修复前行为后重跑,6 条转红,含「失败项保持选中」「中途新勾选项不得被静默丢弃」「壳内每项都有面包屑映射(缺项即红)」等核心断言。
测试抓出的两个额外缺陷(已一并修复):
/admin/任何未知路径因壳根前缀匹配被面包屑判成「概览」pageEnd算出 30 而非 0结构变化(需二次关注):导航清单抽为
src/lib/admin-nav.ts单一事实源,侧边栏与顶栏均从它派生。侧边栏图标映射改为按 id 查表,缺映射时抛错而非静默渲染空白。AdminTopBar.tsx净减 38 行。零新依赖:未引入 jsdom / testing-library / 图表库。决策逻辑抽为纯函数进现有 vitest 覆盖范围。
Verifier verdict
pending —— 独立复核尚未进行。
CI 五项检查(types / tests / lint / layering / security-scan)跑完前不合并。本 PR 承载行为变更,按 AGENTS.md 需记录独立复核结论(复核者 ≠ 实现过程),该结论将在复核完成后补入本段。
按 AGENTS.md「教训必须机器化」:三条缺陷均已有会红的回归测试,不再是仅写进文档的记录。
Checklist
issue-<number>-<short-slug>and PR links the issueNotes for reviewer
_batch-utils.test.ts/_scope-utils.test.ts/admin-nav.test.ts三个文件的断言与实现是否一一对应,有无自证式断言。vitest.config.ts把三个新模块加入 coverage include,沿用该文件既有的渐进式策略注释。