Bring the Python side to the ADR: the judge scores 0 to 10 with the cap at 4 and migration 33 clears every judgement, summarise reads the top 30 of the want and the match order, a hidden company's roles are never in the feed, and the company switch is called All locations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Opus 5.5 committed 2026-10-04 21:40:32 +02:00
1 parent 6cad9713ac
commit 6d82287402
27 files changed
+390 -247

No files matched your search

+10 -7
View File
@@ -279,7 +279,7 @@ def test_list_roles_limit_is_bounded(client: TestClient, store: Store) -> None:
assert client.get("/api/roles", params={"limit": 1001}).status_code == 422
def test_muted_roles_are_hidden_unless_show_muted(client: TestClient, store: Store) -> None:
def test_a_hidden_companys_roles_are_never_shown(client: TestClient, store: Store) -> None:
store.add_company("Acme", key="acme")
upsert(store, posting("1", company="Acme"))
upsert(store, posting("2", company="Other"))
@@ -296,7 +296,10 @@ def test_muted_roles_are_hidden_unless_show_muted(client: TestClient, store: Sto
# without `agent` hides for.
assert client.post("/api/companies/acme/affinity", json={"affinity": -1}).status_code == 200
assert shown() == {uid["2"]}
assert shown(show_muted="true") == {uid["1"], uid["2"]}
# `show_muted` is gone: the parameter is ignored and lifts nothing.
assert shown(show_muted="true") == {uid["2"]}
assert shown(agent=agent.id) == {uid["2"]}
assert client.get("/api/roles", params={"agent": agent.id}).json()["total"] == 1
assert shown(agent=agent.id, order="newest") == {uid["2"]}
# Hidden is per agent: the other agent still sees Acme.
assert shown(agent=other.id, order="newest") == {uid["1"], uid["2"]}
@@ -528,14 +531,14 @@ def test_list_roles_filters_by_tags_any_and_all(client: TestClient, store: Store
assert item["tags"] == ["backend", "python"]
def test_filters_lists_tag_counts_and_respects_show_muted(
def test_filters_lists_tag_counts_without_a_hidden_company(
client: TestClient, store: Store) -> None:
store.add_company("Hidden", key="hidden")
agent = store.save_agent("A") # the default agent, whose hidden companies count
store.set_affinity(agent.id, "hidden", -1)
upsert(store, posting("1", company="Acme"))
upsert(store, posting("2", company="Hidden"))
uid = {r.source_id: r.uid for r in store.roles(hide_muted=False)}
uid = {r.source_id: r.uid for r in store.roles()}
store.set_tags(uid["1"], ["python"])
store.set_tags(uid["2"], ["python"])
@@ -544,7 +547,7 @@ def test_filters_lists_tag_counts_and_respects_show_muted(
assert res.json() == {"tags": [{"tag": "python", "count": 1, "unread": 1}]}
muted = client.get("/api/filters", params={"show_muted": "true"})
assert muted.json() == {"tags": [{"tag": "python", "count": 2, "unread": 2}]}
assert muted.json() == {"tags": [{"tag": "python", "count": 1, "unread": 1}]}
def test_one_role_and_its_read_page(client: TestClient, store: Store) -> None:
@@ -1204,7 +1207,7 @@ def test_an_agents_limits_are_saved_listed_and_checked(client: TestClient) -> No
outside 0..1 and a key from before the cut are refused."""
default = client.post("/api/agents", json={"name": "Wide"}).json()
assert default["limits"] == {"cut_fit_top": 500, "cut_fit_min": 0.6,
"cut_cv_top": 150, "cut_cv_min": 0.6, "summarise_top": 50}
"cut_cv_top": 150, "cut_cv_min": 0.6, "summarise_top": 30}
narrow = {"cut_fit_top": 50, "cut_fit_min": 0.7, "cut_cv_top": 10, "cut_cv_min": 0.75,
"summarise_top": 5}
saved = client.post("/api/agents", json={"name": "Narrow", "limits": narrow})
@@ -1916,7 +1919,7 @@ def test_saved_filters_are_listed_saved_and_deleted_per_agent(
def test_an_override_queues_a_rescore_and_fetch_text_either_way(
client: TestClient, store: Store, queue: Any) -> None:
"""All countries and All roles change the agents' fetch gates for the
"""All locations and All roles change the agents' fetch gates for the
roles already stored, so either switch, on or off, rescores."""
states = ("queued", "running", "done", "failed", "cancelled")
store.add_company("Acme")