Rank by the cut: fetch gate overrides in scoring, the cut per agent, stages read the cut, fetch text renamed from enrich, the feed kept to the fetch gate, and migration 32
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
060ccf66e6
commit
617356e60c
35 files changed
+1054
-751
No files matched your search
+12
-10
@@ -71,9 +71,11 @@ def test_a_cv_language_is_a_code_and_a_level_of_the_ladder() -> None:
|
||||
CvLanguage(language="da", level="good")
|
||||
|
||||
|
||||
def test_new_agents_have_judge_limits_by_default(store: Store) -> None:
|
||||
def test_new_agents_have_the_cut_by_default(store: Store) -> None:
|
||||
made = store.save_agent("Data")
|
||||
assert (made.limits.judge_top, made.limits.judge_min) == (150, 0.55)
|
||||
assert made.limits.model_dump() == {"cut_fit_top": 500, "cut_fit_min": 0.6,
|
||||
"cut_cv_top": 150, "cut_cv_min": 0.6,
|
||||
"summarise_top": 50}
|
||||
|
||||
|
||||
# --------------------------------------------------------------- migration
|
||||
@@ -96,7 +98,7 @@ def test_v28_adds_the_cv_columns_and_the_host_deadline_and_runs_twice(tmp_path:
|
||||
|
||||
migrated = Store(path)
|
||||
|
||||
assert migrated.migrations_applied == [28, 29, 30, 31]
|
||||
assert migrated.migrations_applied == [28, 29, 30, 31, 32]
|
||||
rows = {r["source_id"]: r for r in migrated._rows(
|
||||
"SELECT source_id, languages_required, deadline_host, deadline FROM roles")}
|
||||
assert (rows["a"]["deadline_host"], rows["a"]["deadline"]) == ("2026-10-18", None)
|
||||
@@ -108,7 +110,7 @@ def test_v28_adds_the_cv_columns_and_the_host_deadline_and_runs_twice(tmp_path:
|
||||
assert migrated.role(posting("a").uid).deadline == "2026-10-18"
|
||||
with sqlite3.connect(path) as conn:
|
||||
conn.execute("PRAGMA user_version = 27")
|
||||
assert Store(path).migrations_applied == [28, 29, 30, 31]
|
||||
assert Store(path).migrations_applied == [28, 29, 30, 31, 32]
|
||||
|
||||
|
||||
# ---------------------------------------------------------------- deadline
|
||||
@@ -159,7 +161,7 @@ def test_extract_reads_levels_kinds_and_the_deadline(
|
||||
store: Store, tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
item = posting("1")
|
||||
upsert(store, item)
|
||||
store.replace_scores(store.save_agent("Data", "data").id, [(item.uid, 0.9, "")])
|
||||
store.replace_scores(store.save_agent("Data", "data").id, [(item.uid, 0.9, "", "", None, 0.9, "fit")])
|
||||
model = Model(lambda roles: [answer(r["uid"], deadline="2026-10-30", languages_required=[
|
||||
{"language": "DA", "level": "fluent", "kind": "required"},
|
||||
{"language": "en", "level": "", "kind": "required"},
|
||||
@@ -186,7 +188,7 @@ def test_extract_reads_levels_kinds_and_the_deadline(
|
||||
def test_a_role_extracted_before_is_read_once_more_for_the_new_fields(store: Store) -> None:
|
||||
item = posting("1")
|
||||
upsert(store, item)
|
||||
store.replace_scores(store.save_agent("Data", "data").id, [(item.uid, 0.9, "")])
|
||||
store.replace_scores(store.save_agent("Data", "data").id, [(item.uid, 0.9, "", "", None, 0.9, "fit")])
|
||||
store.set_extracted(item.uid, {"seniority": "director"})
|
||||
assert store.extract_pending() == 0
|
||||
with store.transaction() as conn:
|
||||
@@ -249,12 +251,12 @@ def test_v29_adds_the_musts_and_broken_columns_and_runs_twice(tmp_path: Path) ->
|
||||
conn.execute(f"ALTER TABLE role_judgements DROP COLUMN {column}")
|
||||
conn.execute("PRAGMA user_version = 28")
|
||||
|
||||
assert Store(path).migrations_applied == [29, 30, 31]
|
||||
assert Store(path).migrations_applied == [29, 30, 31, 32]
|
||||
with sqlite3.connect(path) as conn:
|
||||
columns = {r[1] for r in conn.execute("PRAGMA table_info(role_judgements)")}
|
||||
assert {"musts", "broken"} <= columns
|
||||
conn.execute("PRAGMA user_version = 28")
|
||||
assert Store(path).migrations_applied == [29, 30, 31]
|
||||
assert Store(path).migrations_applied == [29, 30, 31, 32]
|
||||
|
||||
|
||||
def test_v30_adds_like_text_and_runs_twice(tmp_path: Path) -> None:
|
||||
@@ -266,12 +268,12 @@ def test_v30_adds_like_text_and_runs_twice(tmp_path: Path) -> None:
|
||||
|
||||
migrated = Store(path)
|
||||
|
||||
assert migrated.migrations_applied == [30, 31]
|
||||
assert migrated.migrations_applied == [30, 31, 32]
|
||||
[data] = migrated.agents()
|
||||
assert (data.like_text, data.avoid_text) == ("", "Reporting.")
|
||||
with sqlite3.connect(path) as conn:
|
||||
conn.execute("PRAGMA user_version = 29")
|
||||
assert Store(path).migrations_applied == [30, 31]
|
||||
assert Store(path).migrations_applied == [30, 31, 32]
|
||||
|
||||
|
||||
def test_the_musts_text_is_one_must_have_per_line() -> None:
|
||||
|
||||
Reference in new issue
Block a user