This commit is contained in:
team3
2026-07-08 18:55:36 +02:00
parent 224ba1ed4f
commit 9a6ab0937b
15 changed files with 172 additions and 55 deletions

View File

@@ -284,6 +284,23 @@ async def test_events_run_summary_aggregates(testdb):
assert s["tokens"] == {"input": 15, "output": 2, "cache_read": 80, "cache_write": 1}
async def test_events_run_summary_per_board(testdb):
"""meta.board scoped die Aggregation: board="artefacts" summiert nur Artefakt-Agenten."""
db = testdb
db.set_current_run(TOPIC, "r2")
await db.add_event(TOPIC, "agent", key="inv", status="ok", dur_ms=1000,
meta={"board": "inventory", "tokens": {"input": 10, "output": 2}})
await db.add_event(TOPIC, "agent", key="art", status="ok", dur_ms=2000,
meta={"board": "artefacts", "tokens": {"input": 5, "output": 7}})
db.set_current_run(TOPIC, None)
art = await db.events_run_summary(TOPIC, "r2", board="artefacts")
assert art["agents"]["gesamt"] == 1
assert art["tokens"] == {"input": 5, "output": 7, "cache_read": 0, "cache_write": 0}
inv = await db.events_run_summary(TOPIC, "r2", board="inventory")
assert inv["agents"]["gesamt"] == 1 and inv["tokens"]["input"] == 10
assert (await db.events_run_summary(TOPIC, "r2"))["agents"]["gesamt"] == 2 # ohne board = alle
async def test_topic_delete_entfernt_guides_und_kanban(testdb, tmp_path, monkeypatch):
"""DELETE /topics: guides/guide_cards/kanban_cards mitlöschen — GET /topics leitet
Topics aus guides ab, sonst taucht das gelöschte Topic sofort wieder auf."""