fix: select jobs for assessment by current CV match, not legacy column - #15
Merged
Merged
Conversation
get_unassessed_jobs filtered on `assessment IS NULL` before consulting job_matches. The legacy assessment column carries no cv_hash, so any job scored under an earlier CV counted as done forever: on a 293-job cache the command reported "all assessed" while 205 had no match under the current CV, and 95 rejected by a previous CV could never be reconsidered. Its filter predicate also read `job.match_score` -- a leftover loop variable -- instead of `j.match_score`, so the entire batch was kept or dropped based on the last row alone. Selection now depends only on whether a match exists for the current cv_hash. That change alone would have made `assess` re-queue the same jobs forever, since the command only refreshed the legacy column; it now persists matches through the shared evaluation path (evaluate_cached_jobs), keeping repeat runs idempotent. Verified against the real cache: 0 jobs queued before, 205 after; evaluating 3 of them dropped the queue to 202 with matches written for all three. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012DbPx4FbswofbGn41anE1q
This was referenced Aug 7, 2026
sangowu
added a commit
that referenced
this pull request
Aug 7, 2026
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. Claude-Session: https://claude.ai/code/session_012DbPx4FbswofbGn41anE1q Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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.
问题
cache.get_unassessed_jobs先用 SQLWHERE assessment IS NULL筛一遍,再查job_matches。legacy
assessment列不记录 cv_hash,所以任何被旧 CV 评过的职位都被永久视为"已评估"。实测本地缓存:job_cache职位assess实际捞出的待评估is_relevant=False、永远不会被重新考虑的同一函数的过滤条件还误用了循环残留变量:
整批结果的去留由最后一条职位决定,与每条自身状态无关。
改动
cache.get_unassessed_jobs— 判定只依据当前cv_hash下有无job_matches记录;同时修正上述变量错误。先过滤过期再挂载 match,减少多余查询;limit改为作用于实际返回条数(原先作用于过滤前的扫描量,会少评)。search_assessment_stage.evaluate_cached_jobs(新增公开入口)— 复用既有的并发评估与原子提交路径,为已缓存职位补算 JD profile + CV match。cli.assess— 改用上述入口写入job_matches,并显式确定cv_hash(给了 CV 文件用sha256(cv_text),否则取cache.get_latest_cv_hash())。第 3 点是必须的:只改判定标准而仍然只写 legacy 列,会让
assess每次都重新捞出同一批职位,陷入永远评不完的循环。验证
单测新增
TestUnassessedJobs(8 个用例),覆盖旧评分不再遮挡、旧 CV 的 match 不算数、逐条独立过滤(变量 bug 回归)、过期排除、limit 语义、以及补跑后再查为空的幂等性。回退实现后 3 个用例失败,恢复后全绿;全量 224 passed。
真实缓存端到端验证(gemini,3 条):
说明
本 PR 只修
assess这一条路径。搜索管道里同源的问题(search_prefilter.py:161的缓存命中判定同样不看 cv_hash,是那 95 条被永久挡住的直接原因)留待单独 PR。🤖 Generated with Claude Code
https://claude.ai/code/session_012DbPx4FbswofbGn41anE1q