Remove the must-haves the form dropped on 2026-10-03: the agent's must text, the judge's verdicts and the career cap they set, with migration 34 dropping their columns and the judge's format at 6 so every role is judged again

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Fable 5.1 committed 2026-10-06 13:55:59 +02:00
1 parent 38c31c830b
commit 2159c7925f
19 files changed
+157 -365

No files matched your search

+9 -62
View File
@@ -1008,79 +1008,30 @@ def language_flag(required: list[RoleLanguage],
return "", ""
#: What career counts as at most, on the judge's 0 to 10, when a posting
#: breaks one of the agent's must-haves: the foot of the rubric's 4-5 band,
#: a decent job that does not build toward the person's goals. The model
#: reports whether each must-have is met; this cap is applied in code, when a
#: role is served (`cv_score`, `Store.judgement`, `store._cv_sql`).
BROKEN_CAP = 4
#: A must-have's verdict, as the judge answers it.
MUST_VERDICTS = ("met", "broken", "unclear")
_BULLET = re.compile(r"^\s*(?:[-*\u2022]+|\(?\d+[.)])\s+")
def must_lines(text: str) -> list[str]:
"""The agent's must-haves text read as one must-have per line: a leading
bullet (`-`, `*`, `•`) or number (`1.`, `2)`) is dropped, so are empty
lines."""
found = []
for line in text.splitlines():
line = " ".join(_BULLET.sub("", line, count=1).split())
if line:
found.append(line)
return found
def capped_career(career: int, broken: int = 0) -> int:
"""`career` as it counts: at most `BROKEN_CAP` when any must-have is
broken."""
return min(career, BROKEN_CAP) if broken else career
def cv_score(skills: int, experience: int, career: int,
weights: Weights | None = None, broken: int = 0) -> float | None:
weights: Weights | None = None) -> float | None:
"""The one number of a CV match, 0 to 100 for sorting and display: the
judge's three numbers, each 0 to 10, averaged by the agent's
`cv_skills`, `cv_experience` and `cv_career` weights (30, 25 and 30 by
default), career as `capped_career` has it, times 10. None when all
three weights are 0."""
default), times 10. None when all three weights are 0."""
w = weights or Weights()
total = w.cv_skills + w.cv_experience + w.cv_career
if not total:
return None
career = capped_career(career, broken)
return round(10 * (w.cv_skills * skills + w.cv_experience * experience
+ w.cv_career * career) / total, 1)
class Must(Model):
"""One must-have of an agent as the judge read it against a role: its
`id` (`M1`, by line), the line's `text` and the `verdict`."""
id: str
text: str = ""
verdict: Literal["met", "broken", "unclear"] = "unclear"
class Judgement(Model):
"""What `judge` read of one role for one agent (`role_judgements`): the
three dimensions 0 to 10 as the model gave them, `cv_score`
(`cv_score`, 0 to 100) and 1 to 3 strengths and gaps grounded in the
posting.
`musts` is the verdict on each must-have and `broken` how many are
broken; any makes `career_capped` the lower of `career` and
`BROKEN_CAP`. `cv_score` and `career_capped` are not read from the
table: `Store.judgement` sets them from the agent's weights; `cv_score`
is None when all three are 0."""
posting. `cv_score` is not read from the table: `Store.judgement` sets
it from the agent's weights; it is None when all three are 0."""
skills: int
experience: int
career: int
career_capped: int | None = None
broken: int = 0
musts: Annotated[list[Must], BeforeValidator(lambda v: _json(v, "[]"))] = []
cv_score: float | None = None
strengths: JsonStrings = []
gaps: JsonStrings = []
@@ -1574,14 +1525,11 @@ class Agent(Model):
are the union over the enabled agents, and an agent with none means no
board is narrowed by words. They decide what is fetched, not what ranks.
`cv_text`, `cv_languages`, `like_text`, `avoid_text` and `must_text` are
what `judge` reads a role against: the CV, the languages it states with
a level, what the person likes and does not like (the work, the
workplace, situations; both feed the career score), and their
must-haves and deal-breakers (set through the API only, not on the
form; soft, read by the model only; a hard rule is a gate). An agent without
a CV is not judged, and one without languages flags none
(`language_flag`)."""
`cv_text`, `cv_languages`, `like_text` and `avoid_text` are what `judge`
reads a role against: the CV, the languages it states with a level, and
what the person likes and does not like (the work, the workplace,
situations; both feed the career score). An agent without a CV is not
judged, and one without languages flags none (`language_flag`)."""
id: int
name: str
@@ -1594,7 +1542,6 @@ class Agent(Model):
cv_languages: CvLanguages = []
like_text: str = ""
avoid_text: str = ""
must_text: str = ""
enabled: bool = True
created_at: str