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

+13 -68
View File
@@ -7,18 +7,14 @@ to three strengths and gaps. A model's rating is an estimate, so the scale is
coarse. The total is `app.models.cv_score`, the three numbers under the
agent's `cv_*` weights times 10, so 0 to 100, worked out when a role is served
and not stored, so the weights are no part of `input_key`; it is what the
feed's CV match sorts by. The model also reports a verdict on each of the
agent's must-haves (one per line of its must text, numbered M1..Mn in the
prompt); it does not apply them. The rule is code's: a "broken" one makes
career count as at most `app.models.BROKEN_CAP` (4), when the role is
served. Culture and location are left out: the first is guessed from ad text,
the second is what the fetch gate does.
feed's CV match sorts by. Culture and location are left out: the first is
guessed from ad text, the second is what the fetch gate does.
The work is pairs, `(agent, role)`: an enabled agent with a CV, with or
without a prompt, and an open role in its cut (`scores.cut`, see `app.jobs.score`: the best by
fit, the best by CV closeness that those leave out, and the liked and saved)
with some text, that has no judgement yet, or one read from another CV,
prompts, languages, like, avoid or must text or role text than today's (`input_key`).
prompts, languages, like or avoid text or role text than today's (`input_key`).
The cut is the only selection: the pull judges it after extract and the
rescore that follows, so it reads the cut as recomputed. A pair is named by the composite key `"<agent_id>:<uid>"`,
which is what `desk.modeltask` hands round as a uid, so `desk/` is untouched.
@@ -51,9 +47,7 @@ from pipeline import NULL, RunContext, Task, job
from pipeline.task import Batch
from app.config import Config
from app.jobs import stages
from app.models import (
LANGUAGE_LEVELS, MUST_VERDICTS, Agent, CvLanguage, _language_name, cv_languages, must_lines,
)
from app.models import LANGUAGE_LEVELS, Agent, CvLanguage, _language_name, cv_languages
from app.storage import Store
#: How much of a posting goes in one item: summarise's 8000, since the
@@ -67,7 +61,8 @@ EXCERPT = 8000
#: career rubric reading both.
#: 4: the three numbers 0 to 10 rather than 0 to 100.
#: 5: the person's languages, read into skills.
FORMAT = 5
#: 6: no must-haves: the profile is the CV, languages, likes and dislikes.
FORMAT = 6
#: How many strengths and gaps are kept, and how long each may be.
MOST, LONGEST = 3, 300
@@ -76,9 +71,8 @@ SYSTEM = """You judge job postings for one person: how well each fits their CV a
Below the rules is the person: their CV, the languages they speak and how
well, what they want, what they like and what they do not like (the work,
the workplace, situations), and their must-haves and deal-breakers when they
gave any. Each item is one posting with a key, its title, company, place
and text. Answer one judgement per item.
the workplace, situations). Each item is one posting with a key, its title,
company, place and text. Answer one judgement per item.
Score three dimensions, each a whole number from 0 to 10:
- skills: 8-10 the core requirements are the person's primary skills; 6-7
@@ -99,16 +93,6 @@ Score three dimensions, each a whole number from 0 to 10:
whether the tasks and the setting would energise them, not only whether
they could do them.
Their must-haves and deal-breakers are numbered M1, M2 and so on. Give a
verdict on every one of them, in `musts`, for each item:
- "met": the posting text says it is met.
- "broken": only when the posting text clearly contradicts it.
- "unclear": the text does not say. Never infer from silence: a posting that
is silent on a must-have is "unclear", not "broken".
Judge a must-have by its own words, not by how well the role fits otherwise.
Answer musts as [] when there are none. The verdicts do not change the three
scores, which follow their rubrics; name a broken must-have as a gap.
Then 1 to 3 strengths and 1 to 3 gaps, each one short sentence grounded in
the posting text. State the gaps honestly: a prestigious role that fits
poorly scores low.
@@ -132,21 +116,8 @@ SCHEMA: dict[str, Any] = {
"career": {"type": "integer"},
"strengths": {"type": "array", "items": {"type": "string"}},
"gaps": {"type": "array", "items": {"type": "string"}},
"musts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {"type": "string"},
"verdict": {"type": "string", "enum": list(MUST_VERDICTS)},
},
"required": ["id", "verdict"],
"additionalProperties": False,
},
},
},
"required": ["key", "skills", "experience", "career", "strengths", "gaps",
"musts"],
"required": ["key", "skills", "experience", "career", "strengths", "gaps"],
"additionalProperties": False,
},
},
@@ -187,11 +158,11 @@ def _text(row: Any) -> str:
def input_key(agent: Agent, text: str) -> str:
"""A hash of everything a judgement reads: the CV, the prompts, the
languages, the like, avoid and must texts, and the role's text as sent. A judgement stored
under another key is read again."""
languages, the like and avoid texts, and the role's text as sent. A judgement
stored under another key is read again."""
blob = json.dumps([FORMAT, agent.cv_text, [[p.name, p.text] for p in agent.prompts],
[[l.language, l.level] for l in agent.cv_languages],
agent.like_text, agent.avoid_text, agent.must_text, text], ensure_ascii=False)
agent.like_text, agent.avoid_text, text], ensure_ascii=False)
return hashlib.sha1(blob.encode()).hexdigest()[:16]
@@ -250,9 +221,6 @@ def system(agent: Agent) -> str:
if agent.avoid_text.strip():
parts.append("\n<dislikes title=\"what they do not like\">\n"
f"{agent.avoid_text.strip()}\n</dislikes>")
if musts := must_lines(agent.must_text):
lines = "\n".join(f"M{n}: {line}" for n, line in enumerate(musts, start=1))
parts.append(f"\n<must title=\"must-haves and deal-breakers\">\n{lines}\n</must>")
return "\n".join(parts)
@@ -300,25 +268,6 @@ def _lines(value: Any) -> list[str]:
return [line for line in found if line][:MOST]
def _musts(agent: Agent | None, value: Any) -> list[dict[str, str]]:
"""The verdicts on the agent's must-haves as they are stored: one
`{id, text, verdict}` per line of its must text, in order. A must-have
the model left out, or gave a verdict outside "met", "broken", "unclear",
is "unclear": nothing is broken by silence. An id that is not one of the
agent's is ignored, the first answer for an id counts."""
said: dict[str, str] = {}
for one in value if isinstance(value, list) else []:
if isinstance(one, dict):
said.setdefault(str(one.get("id") or "").strip().upper(),
str(one.get("verdict") or "").strip().lower())
found = []
for n, line in enumerate(must_lines(agent.must_text if agent else ""), start=1):
verdict = said.get(f"M{n}", "")
found.append({"id": f"M{n}", "text": line,
"verdict": verdict if verdict in MUST_VERDICTS else "unclear"})
return found
def apply_batch(store: Store, answer: dict[str, Any],
batch: dict[str, Any] | None = None,
config: Config | None = None) -> JudgeResult:
@@ -327,7 +276,6 @@ def apply_batch(store: Store, answer: dict[str, Any],
all three numbers; the pair stays waiting."""
keys: dict[str, str] = dict((batch or {}).get("keys") or {})
stats = JudgeResult()
agents: dict[int, Agent | None] = {}
for one in answer.get("judgements") or []:
key = str(one.get("key") or "")
pair = pair_of(key)
@@ -336,11 +284,8 @@ def apply_batch(store: Store, answer: dict[str, Any],
stats.rejected.append(key or "?")
continue
skills, experience, career = (int(m) for m in marks if m is not None)
if pair[0] not in agents:
agents[pair[0]] = store.agent(pair[0])
if not store.set_judgement(pair[0], pair[1], keys.pop(key), skills, experience, career,
_lines(one.get("strengths")), _lines(one.get("gaps")),
_musts(agents[pair[0]], one.get("musts"))):
_lines(one.get("strengths")), _lines(one.get("gaps"))):
stats.rejected.append(key)
continue
stats.judged += 1