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:
WolfandClaude Opus 5.5 committed 2026-10-04 15:11:43 +02:00
1 parent 060ccf66e6
commit 617356e60c
35 files changed
+1054 -751

No files matched your search

+11 -10
View File
@@ -45,11 +45,12 @@ def store(tmp_path: Path) -> Store:
def ranked(store: Store) -> None:
"""Two roles scored well for one enabled agent: inside both stages' bounds."""
"""Two roles scored well for one enabled agent, both in its cut."""
for sid in ("1", "2"):
store.upsert_role(posting(sid))
one = store.save_agent("Backend", "python backend")
store.replace_scores(one.id, [(posting("1").uid, 1.0, ""), (posting("2").uid, 0.9, "")])
store.replace_scores(one.id, [(posting("1").uid, 1.0, "", "", None, 1.0, "fit"),
(posting("2").uid, 0.9, "", "", None, 0.9, "fit")])
def answered_by(monkeypatch: pytest.MonkeyPatch, backend: str) -> None:
@@ -159,7 +160,7 @@ def test_get_stages_lists_all_four_with_their_source_model_and_who_answers(
{"name": "judge", "on": False, "source": "config",
"model": "claude-haiku-4-5-20251001", "backend": "api",
"answer": "answered by the Claude API"},
{"name": "enrich", "on": True, "source": "config", "model": "", "backend": "",
{"name": "fetch_text", "on": True, "source": "config", "model": "", "backend": "",
"answer": "reads role pages, asks no model"},
]
@@ -169,7 +170,7 @@ def test_who_answers_is_said_for_the_api_claude_code_and_nobody(
answers = {}
for backend in ("api", "claude_code", ""):
answered_by(monkeypatch, backend)
[first, second, third, _enrich] = client.get("/api/stages").json()
[first, second, third, _fetch_text] = client.get("/api/stages").json()
assert first["backend"] == second["backend"] == third["backend"] == backend
answers[backend] = first["answer"]
@@ -196,16 +197,16 @@ def test_put_stores_the_setting_returns_the_same_shape_and_starts_nothing(
assert res.json()["on"] is False and store.state["stage:summarise"] == "off"
def test_the_enrich_switch_is_listed_and_stored_like_the_others(
def test_the_fetch_text_switch_is_listed_and_stored_like_the_others(
client: TestClient, store: Store) -> None:
res = client.put("/api/stages/enrich", json={"on": False})
res = client.put("/api/stages/fetch_text", json={"on": False})
assert res.status_code == 200
assert res.json()["name"] == "enrich" and res.json()["on"] is False
assert store.state["stage:enrich"] == "off"
assert res.json()["name"] == "fetch_text" and res.json()["on"] is False
assert store.state["stage:fetch_text"] == "off"
listed = {stage["name"]: stage for stage in client.get("/api/stages").json()}
assert list(listed) == ["extract", "summarise", "judge", "enrich"]
assert listed["enrich"]["on"] is False and listed["enrich"]["source"] == "stored"
assert list(listed) == ["extract", "summarise", "judge", "fetch_text"]
assert listed["fetch_text"]["on"] is False and listed["fetch_text"]["source"] == "stored"
def test_an_unknown_stage_is_404_and_a_bad_body_is_422(client: TestClient) -> None: