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

+2 -34
View File
@@ -91,37 +91,6 @@ def test_best_cv_match_puts_the_judged_first_by_cv_score(
"order": "best"}).status_code == 422
def test_a_broken_must_have_caps_career_in_the_order_and_the_reader(
client: TestClient, store: Store) -> None:
owner, uid = setup(store)
# c: 9 on all three, but one must-have broken: career counts as 4.
musts = [{"id": "M1", "text": "Permanent", "verdict": "met"},
{"id": "M2", "text": "Remote", "verdict": "broken"}]
store.set_judgement(owner.id, uid["c"], "k", 9, 9, 9, [], [], musts)
capped = round(10 * (30 * 9 + 25 * 9 + 30 * 4) / 85, 1)
rows = client.get("/api/roles", params={"agent": owner.id, "order": "cv"}).json()["items"]
assert [(r["uid"], r["cv_score"]) for r in rows[:2]] == [(uid["c"], capped), (uid["b"], 60.0)]
# With career weighted up the capped value drops under b's 60.
store.save_agent("Data", prompts=owner.prompts, agent_id=owner.id, cv_text=owner.cv_text,
weights=Weights(cv_skills=0, cv_experience=0, cv_career=1))
rows = client.get("/api/roles", params={"agent": owner.id, "order": "cv"}).json()["items"]
assert [(r["uid"], r["cv_score"]) for r in rows[:2]] == [(uid["b"], 60.0), (uid["c"], 40.0)]
one = client.get(f"/api/roles/{uid['c']}", params={"agent": owner.id}).json()
j = one["judgement"]
assert (j["career"], j["career_capped"], j["broken"]) == (9, 4, 1)
assert j["musts"] == musts and one["cv_score"] == j["cv_score"] == 40.0
def test_a_met_or_unclear_must_have_leaves_career_as_the_model_gave_it(
client: TestClient, store: Store) -> None:
owner, uid = setup(store)
musts = [{"id": "M1", "text": "Permanent", "verdict": "met"},
{"id": "M2", "text": "Remote", "verdict": "unclear"}]
store.set_judgement(owner.id, uid["c"], "k", 9, 9, 9, [], [], musts)
j = client.get(f"/api/roles/{uid['c']}", params={"agent": owner.id}).json()["judgement"]
assert (j["career"], j["career_capped"], j["broken"], j["cv_score"]) == (9, 9, 0, 90.0)
def test_the_agents_weights_make_the_cv_score_at_read_time(
client: TestClient, store: Store) -> None:
owner, uid = setup(store)
@@ -218,15 +187,14 @@ def test_an_agent_without_languages_flags_nothing(client: TestClient, store: Sto
def test_the_cv_fields_round_trip_and_are_kept_when_left_out(client: TestClient) -> None:
body = {"name": "Data", "cv_text": "VP Data.", "like_text": "Teams.", "avoid_text": "Reporting.",
"must_text": "Permanent.",
"cv_languages": [{"language": "da", "level": "native"},
{"language": "EN", "level": "fluent"}]}
made = client.post("/api/agents", json=body).json()
assert made["cv_languages"] == [{"language": "da", "level": "native"},
{"language": "en", "level": "fluent"}]
kept = client.post("/api/agents", json={"id": made["id"], "name": "Data"}).json()
assert (kept["cv_text"], kept["like_text"], kept["avoid_text"], kept["must_text"]) == \
("VP Data.", "Teams.", "Reporting.", "Permanent.")
assert (kept["cv_text"], kept["like_text"], kept["avoid_text"]) == \
("VP Data.", "Teams.", "Reporting.")
assert len(kept["cv_languages"]) == 2
nulls = client.post("/api/agents", json={"id": made["id"], "name": "Data",
"cv_text": None, "cv_languages": None}).json()