Skip to content

🔥 Hot Leads 视图的 rating ≥ 4.5 与整星评分/路由流的「hot = rating ≥ 4」不一致:被判定为 hot、发了告警的四星线索永远进不了这个队列 #766

Description

@yinlianghui

来源:#758(sales 页列表视图重写)核对 src/views/lead.view.ts 时发现。#758 的文件面是文档,不含 src/**,故单独立单。基线 origin/main = c55aaf5。

现状

三处对「hot」的定义不一致:

位置 判据
src/views/lead.view.ts:357-359(hot_leads 视图) rating >= 4.5 且 status in [new, contacted]
src/flows/lead-assignment.flow.ts:61,126(路由流) 决策节点标题 Hot Lead (rating ≥ 4)?,边 e2 的条件是 record.rating >= 4 —— 命中后写 1 天 SLA 并向负责人发 inbox + email 告警
src/objects/lead.hook.ts:144-148(打分钩子) Math.round(clamped) —— 只产生整星(1-5),注释写明「round to WHOLE stars」

rating 是 Field.rating(5)(lead.object.ts:200),表单用 star_rating 控件,也只给整星。

于是 rating >= 4.5 在实际数据上等价于 rating == 5。后果:一条四星线索会被路由流判为 hot、拿到 1 天 SLA、给负责人发出「Hot lead — assign within 24h」的告警,然后不出现在 🔥 Hot Leads 视图里——它落在 high_priority(rating >= 4)里。收到「24 小时内跟进」告警的人打开 Hot Leads 队列,看不到那条线索。

hot_leads 的注释还说这是「a tighter cut than the High Priority view (rating >= 4) so the two are not duplicates」——意图(更紧的一刀)成立,但用 4.5 表达一个只有整星的量,读起来像是存在半星,且与告警口径分叉。同一处注释里的「(Set by the auto_flag_hot_lead workflow)」也已失效:仓库里没有名为 auto_flag_hot_lead 的 workflow / flow。

影响

用户可见:告警说「这是热线索,24 小时内处理」,产品里的热线索队列却没有它。四星在当前打分权重下并不罕见(computeRating 里一个正经域名 + 电话 + 高级职位 + 高价值行业就到 4)。

修法(需要决定,不要直接猜)

两个方向都自洽,选哪个是产品决定:

  • A. 让视图跟随告警口径:hot_leads 改成 rating >= 4,与 lead_assignment 一致;此时它与 high_priority 的差别只剩排序(按下次跟进日期 vs 按评分着色)和列,需要重新回答「这两个视图是否还该并存」。
  • B. 让告警跟随视图口径:路由流的 hot 判据收紧到 5 星,四星走标准 3 天 SLA;此时 hot_leads 的阈值应写成 >= 5 而不是 >= 4.5,把「整星」这件事写进条件本身。

无论选哪个,>= 4.5 这个写法都应该消失(对整星字段做半星比较),auto_flag_hot_lead 那句注释应一并删掉或改成真实的自动化名。

文档侧已在 PR(#758)里按现状描述:Hot Leads 记为「实际上的五星队列,四星在 High Priority」。这条 issue 落地后,content/docs/sales/leads.mdx 及其 zh 兄弟页的对应行需要同步。

Refs #758

Activity

  1. added
    bugSomething isn't working
    metadataDeclarative metadata — schema, security posture, UI surfaces
    pm:queueReady for the PM dispatch loop
    on Aug 5, 2026
  2. yinlianghui commented on Aug 5, 2026

    @yinlianghui
    CollaboratorAuthor

    分诊(PM 循环第 7 轮,会话 session_01VHrPAGEgFDoHjphqYG4BMa):按恢复不变式裁定为 PM 可决,入 pm:queue,不进决策收件箱 —— 理由与否决窗口如下:

    「hot」的定义仓库里只能有一个。语义生产者是 lead_assignment 路由流(≥4 → hot SLA + 24 小时认领告警,后果用户可见);hot_leads 视图的 4.5 阈值无任何书面理由,且其注释引用一个不存在的 auto_flag_hot_lead workflow —— 这是漂移证据,不是设计意图。被系统宣告为 hot、发过告警的线索永远进不了同名队列,正是 declared ≠ enforced。

    裁定方向:视图阈值对齐流的 ≥4(一个 hot 定义),同时删掉那条幽灵 workflow 注释;五星专属队列如果是真实需求,应该以自己的名字另立视图,而不是借 Hot 之名。维护者如倾向反向(把流的告警阈值提到 4.5),请在本单否决,派发前会再读本线程。


    Generated by Claude Code

  3. added
    pm:dispatchedDispatched to a dev agent by /pm-dispatch
    and removed
    pm:queueReady for the PM dispatch loop
    on Aug 5, 2026
  4. self-assigned this
    on Aug 5, 2026
  5. yinlianghui commented on Aug 5, 2026

    @yinlianghui
    CollaboratorAuthor

    认领:PM 循环(17.0 发布修复线)第 8 轮
    会话:session_01VHrPAGEgFDoHjphqYG4BMa
    分支:claude/issue-766-hot-leads-threshold
    Worktree:hotcrm-issue-766
    文件面:src/views/lead.view.ts(hot_leads 过滤阈值 ≥4.5 → ≥4,删幽灵 workflow 注释)、相关测试(建议钉「视图阈值 = 路由流 hot 分支阈值」的一致性)、changeset;若 #768 刚落地的 leads 文档因此需要一句话同步(五星队列表述),同 PR 顺改并说明。⛔ 不动 src/views/opportunity.view.ts(#744 同轮在飞)。

    派发依据:分诊评论已裁定方向(恢复不变式:一个 hot 定义,流是语义生产者)。dev 复核时若发现新证据推翻裁定,照常 premise 报告,不强行执行。


    Generated by Claude Code

  6. yinlianghui commented on Aug 5, 2026

    @yinlianghui
    CollaboratorAuthor

    ✅ 验收通过 — PR #774 已转 ready 并挂 auto-merge(新 head 669918d,CI 9/9 绿)。

    判定要点:

    #766 随本 PR 关闭;#775 入 finding 池(决策项:两视图是否并存)。


    Generated by Claude Code

  7. added and removed on Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingmetadataDeclarative metadata — schema, security posture, UI surfacespm:dispatchedDispatched to a dev agent by /pm-dispatchpriority:p2Medium: important, M3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions