chore: retire the legacy assessment column from the scoring path - #17
Merged
Merged
Conversation
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
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.
接续 #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 分和MatchScore的 0~100 分混在同一个属性里返回,两种分制在同一次排序里直接比大小。改动
schemas.pyeffective_*属性去掉 legacy 回落分支display.pycli.pyassess列表过滤去掉or j.assessment is not Nonesearch_assessment_stage.pywrite_cache停止写入该列search_prefilter.pyclassify_cache_hit不再读该列cache.pyupdate_job_assessment(唯一调用方已在 #15 改走job_matches)无 cv_hash 时改为返回
reuse(原先读 legacy 列)。不能返回reassess:该场景下flush_assessments的has_cv为假,patch_pending分支被整个跳过,这些职位会从结果里消失。保留的部分
job_cache.assessment列、JobAssessment模型、JobResult.assessment字段全部保留,历史数据可读——model_quality_audit.py:78把它导出进审计数据集,删掉会影响历史审计的可比性。_merge_job的new.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列为NULL且job_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