Extract and summarise bounds are each agent's own limits, set on its form

agents.limits holds extract_top, extract_min, summarise_top and
summarise_min; the scope query reads them per ranked row, and a row saved
before this behaves like a fresh agent. The four global config keys go.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Fable 5.1 committed 2026-09-28 16:02:06 +02:00
1 parent e602eb3388
commit cebe62ddc9
20 files changed
+229 -147

No files matched your search

+20
View File
@@ -621,6 +621,12 @@ def test_the_agents_page_lists_and_edits_search_agents(client: TestClient) -> No
for weight in ("a-fit", "a-recency", "a-affinity", "a-taste"):
assert f'id="{weight}"' in page
assert 'id="a-taste" min="0" step="0.05" value="0.2"' in page
# What the model reads after a pull: a count and a score floor per stage.
assert "<legend>What the model reads</legend>" in template
for limit in ("a-extract-top", "a-extract-min", "a-summarise-top", "a-summarise-min"):
assert f'id="{limit}"' in template
assert 'id="a-extract-top" min="0" step="10" value="500"' in page
assert 'id="a-summarise-min" min="0" max="1" step="0.05" value="0.5"' in page
assert 'id="a-new"' in page and 'id="a-delete"' in page
assert "Save and score" in page
@@ -756,6 +762,20 @@ def test_a_gate_on_an_unknown_field_is_refused(client: TestClient) -> None:
assert client.post("/api/agents", json=body).status_code == 422
def test_an_agents_limits_are_saved_listed_and_checked(client: TestClient) -> None:
"""How deep the model stages read is the agent's own; a score outside
0..1 is refused."""
default = client.post("/api/agents", json={"name": "Wide"}).json()
assert default["limits"] == {"extract_top": 500, "extract_min": 0.3,
"summarise_top": 30, "summarise_min": 0.5}
narrow = {"extract_top": 50, "extract_min": 0.6, "summarise_top": 5, "summarise_min": 0.7}
saved = client.post("/api/agents", json={"name": "Narrow", "limits": narrow})
assert saved.status_code == 200 and saved.json()["limits"] == narrow
assert [a["limits"]["extract_top"] for a in client.get("/api/agents").json()] == [50, 500]
bad = client.post("/api/agents", json={"name": "Bad", "limits": {"extract_min": 2}})
assert bad.status_code == 422
def test_roles_by_agent_are_ordered_by_score_and_hide_the_gated(
client: TestClient, store: Store) -> None:
for sid in ("low", "high", "gated"):