Let the judge read the person's languages beside the CV, as ADR 4.2 has it: a language a posting requires above the level spoken lowers skills and is a gap, and a change to them re-judges the cut

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Fable 5.1 committed 2026-10-06 13:33:32 +02:00
1 parent e61185e4b9
commit 4a9bcb2b1c
2 files changed
+27 -11

No files matched your search

+18 -8
View File
@@ -18,7 +18,7 @@ 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, like, avoid or must text or role text than today's (`input_key`).
prompts, languages, like, avoid or must 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.
@@ -52,7 +52,7 @@ 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, cv_languages, must_lines,
LANGUAGE_LEVELS, MUST_VERDICTS, Agent, CvLanguage, _language_name, cv_languages, must_lines,
)
from app.storage import Store
@@ -66,22 +66,28 @@ EXCERPT = 8000
#: 3: what the person likes (`like_text`) beside what they do not, and the
#: career rubric reading both.
#: 4: the three numbers 0 to 10 rather than 0 to 100.
FORMAT = 4
#: 5: the person's languages, read into skills.
FORMAT = 5
#: How many strengths and gaps are kept, and how long each may be.
MOST, LONGEST = 3, 300
SYSTEM = """You judge job postings for one person: how well each fits their CV and what they want.
Below the rules is the person: their CV, 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
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.
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
most requirements match, with 1-2 gaps that are learnable; 4-5 a partial
match, significant upskilling needed; 0-3 a fundamental mismatch.
match, significant upskilling needed; 0-3 a fundamental mismatch. A
language the posting requires counts as a requirement: one the person
speaks below the level asked, or not at all when their languages are
listed, lowers skills and is a gap. A language the posting does not
mention changes nothing.
- experience: match on the function and nature of the work performed, not the
literal job title, and on its level. 8-10 direct experience in the same
domain and role type; 6-7 related, with transferable skills clear; 4-5
@@ -181,9 +187,10 @@ 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
like, avoid and must texts, and the role's text as sent. A judgement stored
languages, the like, avoid and must 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)
return hashlib.sha1(blob.encode()).hexdigest()[:16]
@@ -230,6 +237,9 @@ def pending(store: Store) -> int:
def system(agent: Agent) -> str:
"""The rubric, and the person as this agent describes them."""
parts = [SYSTEM, "", "The person.", "", f"<cv>\n{agent.cv_text.strip()}\n</cv>"]
if agent.cv_languages:
spoken = ", ".join(f"{_language_name(l.language)} {l.level}" for l in agent.cv_languages)
parts.append(f"\n<languages title=\"the languages they speak, and how well\">\n{spoken}\n</languages>")
wants = "\n".join(f"- {p.name}: {' '.join(p.text.split())}"
for p in agent.prompts if p.text.strip())
if wants:
+9 -3
View File
@@ -14,7 +14,7 @@ import pytest
from app.config import Config
from app.jobs import judge, stages
from app.models import CvLanguage, Prompt
from app.models import CvLanguage, Prompt, Weights
from app.storage import Store
from desk import modeltask
from desk.models import Item
@@ -259,10 +259,16 @@ def test_a_judgement_is_read_again_only_when_what_it_read_changed(
with store.transaction() as conn:
conn.execute("UPDATE roles SET closed_at = NULL WHERE uid = ?", (uid,))
# The languages are not part of what it read; the must text is.
# The languages and the must text are part of what it read; the weights
# are not.
store.save_agent("Data", prompts=owner.prompts, agent_id=owner.id,
cv_languages=[CvLanguage(language="da", level="native")])
weights=Weights(cv_skills=50))
assert judge.pending(store) == 0
spoken = store.save_agent("Data", prompts=owner.prompts, agent_id=owner.id,
cv_languages=[CvLanguage(language="da", level="native")])
assert judge.pending(store) == 1
assert '<languages title="the languages they speak, and how well">\nDanish native' \
in judge.system(spoken)
store.save_agent("Data", prompts=owner.prompts, agent_id=owner.id,
must_text="Remote two days a week.")
assert judge.pending(store) == 1