This commit is contained in:
team3
2026-07-24 11:23:18 +02:00
parent cb68cd671b
commit 1b054497ed
49 changed files with 935 additions and 408 deletions

View File

@@ -1,22 +1,21 @@
"""Konsens: 1 kuratierter Wikipedia-Beleg genügt, 1 Blog-Beleg nicht."""
"""Konsens ohne 2-Quellen-Regel: 1 wörtlicher Beleg genügt (Zitat-Gate schützt);
ohne Beleg bleibt der Punkt Kandidat."""
from backend import db, korpus
from .conftest import topic_anlegen
async def test_wiki_einzelbeleg_bestaetigt():
async def test_einzelbeleg_bestaetigt_ohne_beleg_nicht():
topic = topic_anlegen()
run_id = db.insert("runs", topic=topic, status="running")
q_wiki = db.insert("quellen", topic=topic, url="https://de.wikipedia.org/w",
url_norm="u1", backend="wikipedia_de", status="geladen")
q_blog = db.insert("quellen", topic=topic, url="https://blog.de/x",
url_norm="u2", backend="ddgs", status="geladen")
db.insert("soll", topic=topic, punkt="Overflow-Pomodoros erklären",
belege=db.j([{"quelle": q_wiki, "zitat": "z1"}]))
db.insert("soll", topic=topic, punkt="Nur Blog-These",
db.insert("soll", topic=topic, punkt="Blog-These mit Beleg",
belege=db.j([{"quelle": q_blog, "zitat": "z2"}]))
db.insert("soll", topic=topic, punkt="These ohne Beleg", belege=db.j([]))
await korpus.soll_konsens({"run_id": run_id, "topic": topic, "runde": 1,
"item": "r1:konsens", "payload": "{}"})
wiki = db.one("SELECT status FROM soll WHERE punkt LIKE 'Overflow%'")
blog = db.one("SELECT status FROM soll WHERE punkt LIKE 'Nur Blog%'")
assert wiki["status"] == "bestaetigt" # kuratierte Quelle: 1 Beleg reicht
assert blog["status"] == "kandidat" # Blog allein bestätigt nicht
"knoten": "soll_konsens", "item": "r1:konsens",
"payload": "{}"})
mit = db.one("SELECT status FROM soll WHERE punkt LIKE 'Blog-These%'")
ohne = db.one("SELECT status FROM soll WHERE punkt LIKE 'These ohne%'")
assert mit["status"] == "bestaetigt" # 1 wörtlicher Beleg reicht
assert ohne["status"] == "kandidat" # ohne Beleg keine Bestätigung