Add rescoring and a posting-date order to the leads inbox
rescoreJobLeads (RescoreAll, "Rescore all" on /cv/leads) scores every matched inbox lead again, for after the profile or the model has changed. Scores are not wiped first: a lead keeps its old score until the new one is saved, and the new scored_at column marks which leads the job has reached, so a job that dies partway leaves no gaps. Leads that had used up their attempts get them back. The inbox can also be ordered by when a posting went up, falling back to when it was found where the source gave no date. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -291,8 +291,10 @@ type JobSource struct {
|
||||
// Matched says whether the lead passed the keyword pre-filter the last time
|
||||
// the fetcher ran; only matched leads are shown by default and only they are
|
||||
// scored. Score (0-100) and ScoreReasons are Claude's, and nil until scored.
|
||||
// ScoreAttempts counts failed tries, so a posting Claude can never score
|
||||
// stops costing a call per run.
|
||||
// ScoredAt is when that score was given, which is how a rescore tells the
|
||||
// leads it has redone from the ones it has yet to reach; it is nil on a lead
|
||||
// scored before the column existed. ScoreAttempts counts failed tries, so a
|
||||
// posting Claude can never score stops costing a call per run.
|
||||
type JobLead struct {
|
||||
ID uint `gorm:"primarykey" json:"id"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
@@ -311,6 +313,7 @@ type JobLead struct {
|
||||
State string `gorm:"not null;default:new;index" json:"state"`
|
||||
Score *int `json:"score"`
|
||||
ScoreReasons *string `json:"scoreReasons"`
|
||||
ScoredAt *time.Time `json:"scoredAt"`
|
||||
ScoreAttempts int `gorm:"not null;default:0" json:"scoreAttempts"`
|
||||
JobAppID *uint `json:"jobAppId"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user