feat(compare-alert): failed 混合单某平台真技术失败被业务 headline 盖住时补判 T1 #221
Reference in New Issue
Block a user
Delete Branch "feat-compare-alert-mixed-failure-criteria"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
卡片摘要追加一行判据,让收报警的人一眼知道为什么报:深度放弃=耗时>{配置}s 或 步数>{配置} (阈值取自 COMPARE_ALERT_CANCELLED_MS/STEP_THRESHOLD、随配置变);系统技术失败=无业务原因的 系统错 或 任一平台 status=failed;T2/T6 同理,只列当期出现的类型。追加进摘要 markdown、不新增 卡片元素(不打断 table 位置)。format_alert_card 加两个阈值参数(默认=config 默认,worker 传实值)。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>🤖 review-pr 深审结论
🟢 低风险 · 置信度 0.9 — 逻辑克制、契约核对通过、测试全绿,可直接合。
净改动:
failed分支在返回「纯业务失败」前补判 T1——扫raw_payload.platform_results,任一非源平台status=failed且 reason 非业务话术 → 判「技术失败」(原本这类被干净业务 headline 盖住、漏报);卡片摘要加「判据」说明行(T5 带当前配置阈值)。构建/测试状态(已实跑)
pytest tests/test_compare_alert_rules.py tests/test_compare_alert_format.py:49 passed(含本 PR 新增 4 个:masked-failure→T1、业务话术 no-false-positive、判据 legend、阈值随配置变化)。settings.COMPARE_ALERT_CANCELLED_MS_THRESHOLD/STEP_THRESHOLD在app/core/config.py:140-141存在(默认 90000/30)→ 无 AttributeError 风险;classify_record确有biz_exclude_keywords形参;raw_payload.platform_results[*].status是他处已用的真实结构(admincomparison.py:103)。合并origin/main干净。问题
正面
return None之前,原 T6/T2 仍归 T6/T2;只把「原本漏报的 masked 技术失败」补成 T1,无回归。biz_exclude过滤 pricebot 把打烊/不配送误标成failed的业务话术;源平台status='source'+is_source双保险不误判。建议
只读深审 · worktree 合并 origin/main(干净)+ 实跑 venv pytest(49 passed)