Repository navigation
fix(scoring): 百分位精选改为名次截断,消除 off-by-one 与并列整块放行 - #107
Merged
Merged
Conversation
精选率结构性偏高的第二层机制修复(第一层 local_fallback 假分污染 已随 #90 修复)。旧「nearest-rank 门槛 + >= 比较」放行 n-rank+1 条 (100 条候选选 31 条,注释目标 25-30% 数学上不可达),且门槛值上的 并列块被整块放行(假分钉 71 分时精选率达 55% 的机制之二)。 改为按 final_score 降序名次截断 top-(100-percentile)%:精确配额、 并列块按序截断(不放大也不全灭)、小批次保底 1 条(防内容少的 日子今日选题整页空白)。fixed 模式保持 >= ——绝对质量线达到即 入选的语义本就正确。threshold_used 取第 keep 名分数,展示不变。 配套:新增精确配额与并列两个回归测试;#90 对照测试改写为名次 截断语义(假分不得挤占真实头名);三个既有测试补低分陪跑适配 新配额(其中确认事件成员在打分前剔除导致候选池缩水的既有交互)。
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.
动机
精选率结构性偏高的层 2 机制修复(层 1 local_fallback 假分污染已随 #90 入 main)。生产备份重放实测精选率 55.3%(目标 30% 的 1.9 倍),根因三层:
假分钉门槛([P1][LLM] LLM 降级内容不会再被重新分析:local_fallback 落 ANALYZED 终态后无恢复路径 #90 已修):87.5% 假分 curation 收敛 71 分,P70 门槛 24/27 时点被钉在并列块上、>=整块放行——修复后备份数据模拟 16.1%;>=的 off-by-one(放行 n−rank+1 条,100 条选 31 条;注释目标 25-30% 数学上不可达)+ 门槛值并列块整块放行;改动
scoring_engine.pyPhase 5:percentile 分支改为按 final_score 降序名次截断 top-(100-percentile)%(keep = max(1, n−rank))——精确配额、并列块按序截断(不放大也不全灭)、小批次保底 1 条(防内容少的日子今日选题整页空白);threshold_used取第 keep 名分数,展示语义不变;fixed 模式保持>=(绝对质量线达到即入选的语义本就正确)Verification
make test-backend,一次性 PG)exit 0 ×2ruff check/ruff format --check/check_layering.py全过Verifier verdict
独立复核过程(实现与复核分离):初版「
>=改>」一行方案被 8 个红测试推翻——小批次(n=1/2)与均匀并列批次会一条不选,today-picks 整页空白不可接受;据此升级为名次截断 + 保底方案。测试适配中确认一个既有交互:事件成员在打分前被剔除出候选池(build_today_picks 的事件归一化路径),事件多的日子实际候选池 n 缩水、配额随之缩水——已在测试注释中记录。部署提醒