Skip to content

前端 recommendation.ts 镜像后端评分口径数字,改为接口下发 #112

Closed

Description

@fxbin

现状

frontend/src/lib/recommendation.ts:47-49 硬编码了与后端评分引擎对齐的门槛(注释自述对齐 CONFIG):RISK_HARD_EXCLUDE = 82、RISK_HIGH = 75、QUALITY_GATE_MIN = 45。

自 #110/#111 建立评分口径单一真相源(app/services/scoring_caliber.py)后,这是最后一处「同口径数字的第二份手写副本」——但漂移防线(tests/test_scoring_caliber.py)只覆盖后端 Python 侧,前端这份镜像在 CONFIG 调整时仍会静默漂移。

PR #111 独立 Verifier 复核发现(既有现状,非 #111 引入)。

建议

由后端接口下发(如配置 summary 端点或注入现有 scoring 响应),前端删除硬编码;或最低成本方案——在 CI 加一条前后端口径一致性检查。方案取舍时注意 82/45 是引擎行为数字,前端仅做展示口径解释,不应承载判定。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions