Skip to content

chore: retire the legacy assessment column from the scoring path - #17

Merged
sangowu merged 1 commit into
mainfrom
chore/retire-legacy-assessment-scores
Aug 7, 2026
Merged

sangowu merged 1 commit into
mainfrom
chore/retire-legacy-assessment-scores

Conversation

@sangowu

@sangowu sangowu commented Aug 7, 2026

Copy link
Copy Markdown
Owner

接续 #15#16 的收尾。方案是代码层废弃,不碰 schema 和数据

背景

job_cache.assessment 是闸门(batch_assess_jds)的副产品,落库时保留了 score / strengths / weaknesses / matched_keywords / is_relevant,但不记录 cv_hash,也没有 prompt_version#15#16 已经把它从两条判定路径上摘掉,剩下的是评分口径本身。

顺带修掉一个一直存在的问题:effective_score 把 legacy 的 0~10 分MatchScore0~100 分混在同一个属性里返回,两种分制在同一次排序里直接比大小。

改动

位置 改动
schemas.py 4 个 effective_* 属性去掉 legacy 回落分支
display.py 两处渲染路径(终端详情 + Markdown 导出)去掉 legacy 分支
cli.py assess 列表过滤去掉 or j.assessment is not None
search_assessment_stage.py 两处 write_cache 停止写入该列
search_prefilter.py classify_cache_hit 不再读该列
cache.py 删除 update_job_assessment(唯一调用方已在 #15 改走 job_matches

无 cv_hash 时改为返回 reuse(原先读 legacy 列)。不能返回 reassess:该场景下 flush_assessmentshas_cv 为假,patch_pending 分支被整个跳过,这些职位会从结果里消失。

保留的部分

job_cache.assessment 列、JobAssessment 模型、JobResult.assessment 字段全部保留,历史数据可读——model_quality_audit.py:78 把它导出进审计数据集,删掉会影响历史审计的可比性。_merge_jobnew.assessment or existing.assessment 也保持不变,已有数据不会被清空。

本 PR 不修改任何数据,完全可逆。

验证

全量 235 passed。更新了两个测试以反映新行为(effective_score 不再回落、无 cv_hash 一律 reuse),新增两个:

  • test_legacy_rejection_no_longer_hides_job — 旧拒绝判定不再影响可见性
  • test_pipeline_no_longer_writes_the_legacy_assessment_column — 跑完 flush_assessments 后直接查 SQLite,断言 assessment 列为 NULLjob_matches 有对应记录

前置条件已满足:本地缓存 293 条职位在当前 CV 下全部有 match(本轮补跑 200 条,0 失败),因此移除回落不会造成掉分。

一个无关发现

tests/test_version_comparison.py::test_assessment_worker_controller_runs_isolated_offline_smoke 是既有的 flaky 测试——在 main 上重复跑同样会间歇失败(子进程跑 scripts/compare_assessment_workers.py,疑似 Windows 下 .pytest_tmp 目录锁)。与本 PR 无关,未处理。

🤖 Generated with Claude Code

https://claude.ai/code/session_012DbPx4FbswofbGn41anE1q

job_cache.assessment is no longer written or read for scoring. It recorded no
cv_hash, and its 0-10 scale was being mixed with MatchScore's 0-100 inside the
same effective_score property, so legacy and modern scores sorted against each
other on incompatible scales.

  - effective_* properties depend only on match_score
  - both display.py render paths drop their legacy branch
  - the assess listing filter drops `or j.assessment is not None`
  - flush_assessments stops populating the column
  - cache.update_job_assessment is removed (its only caller was rewired in #15)

classify_cache_hit no longer consults the column. With no cv_hash it returns
reuse rather than reassess: flush_assessments skips patch_pending when has_cv
is false, so reassess would strand those jobs.

The column, the JobAssessment model and JobResult.assessment are kept so
historical rows stay readable -- model_quality_audit exports them, and
_merge_job still preserves existing values. No data is modified.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012DbPx4FbswofbGn41anE1q
@sangowu
sangowu merged commit c82ca67 into main Aug 7, 2026
2 checks passed
@sangowu
sangowu deleted the chore/retire-legacy-assessment-scores branch August 7, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant