update
This commit is contained in:
@@ -372,6 +372,41 @@ async def test_clarify_inline_evidence_no_tools(sub_env, monkeypatch, tmp_path):
|
||||
assert list(tmp_path.glob("subblock-final-*-j*.md")) # Engine persistiert die Judge-Antwort
|
||||
|
||||
|
||||
async def test_thema_nutzt_research_material_inline(sub_env, monkeypatch, tmp_path):
|
||||
"""thema mit Research-Fundstellen (arbeit/material/*.txt): Finder bekommt sie inline
|
||||
und läuft ohne Tools — vorher eigene Websuche pro Call (Reasoning-Schleifen, Retries)."""
|
||||
db, ctx, files = sub_env
|
||||
monkeypatch.setattr(blx, "source_folder", lambda t: None)
|
||||
md = tmp_path / "arbeit" / "material"
|
||||
md.mkdir(parents=True)
|
||||
(md / "research-1.txt").write_text(
|
||||
"https://example.org/alpha\nAlpha Grundlagen: der Kernbegriff, gut belegt.\n",
|
||||
encoding="utf-8")
|
||||
monkeypatch.setattr(blx, "arbeit_dir", lambda t: tmp_path / "arbeit")
|
||||
fake, prompts = _mk_race({1: ["Alpha Grundlagen"], 2: ["Alpha Grundlagen"]})
|
||||
monkeypatch.setattr(blx, "_race", fake)
|
||||
raw = await blx._subblocks_block(ctx, lambda *a, **k: None, files, {1: "Alpha — Grundkonzept"},
|
||||
"", wipe=False, ns="x-")
|
||||
assert raw == {"Alpha": ["Alpha Grundlagen"]}
|
||||
finders = [s for s in fake.slots_seen if "-r1-" in s["key"]]
|
||||
assert finders and all(s["capabilities"] == "none" for s in finders)
|
||||
assert "── research-1.txt" in finders[0]["prompt"] # Fundstellen inline
|
||||
|
||||
|
||||
def test_material_folder_fallbacks(monkeypatch, tmp_path):
|
||||
"""Echte Quelle gewinnt; sonst arbeit/material mit Inhalt; sonst None."""
|
||||
monkeypatch.setattr(blx, "source_folder", lambda t: tmp_path / "quelle")
|
||||
assert blx.material_folder("t") == tmp_path / "quelle"
|
||||
monkeypatch.setattr(blx, "source_folder", lambda t: None)
|
||||
monkeypatch.setattr(blx, "arbeit_dir", lambda t: tmp_path / "arbeit")
|
||||
assert blx.material_folder("t") is None # kein Material-Ordner
|
||||
md = tmp_path / "arbeit" / "material"
|
||||
md.mkdir(parents=True)
|
||||
assert blx.material_folder("t") is None # leer zählt nicht
|
||||
(md / "research-1.txt").write_text("x", encoding="utf-8")
|
||||
assert blx.material_folder("t") == md
|
||||
|
||||
|
||||
async def test_panel_2of3_kehrt_bei_einigkeit_zurueck(tmp_path):
|
||||
"""Zwei übereinstimmende Verdicts → Rückkehr ohne den langsamen Dritten; sein
|
||||
Ergebnis wird detached nachpersistiert (Resume)."""
|
||||
@@ -418,6 +453,7 @@ async def test_facts_check_inline_cited_evidence(sub_env, monkeypatch, tmp_path)
|
||||
die Check-Datei schreibt die Engine aus der Text-Antwort."""
|
||||
db, ctx, files = sub_env
|
||||
d = _corpus(tmp_path)
|
||||
monkeypatch.setattr(blx, "source_folder", lambda t: d)
|
||||
facts = {"facts": [{"block": "Alpha", "subblock": "Sub Eins", "key_points": ["k"],
|
||||
"prerequisites": "", "hurdles": "",
|
||||
"cited_facts": [{"text": "T", "source": "Skript.txt, Z.2"}],
|
||||
@@ -455,6 +491,7 @@ async def test_facts_find_inline_evidence_no_tools(sub_env, monkeypatch, tmp_pat
|
||||
verloren sich in Reasoning-Schleifen und endeten mit leerem Turn (Retry-Wellen)."""
|
||||
db, ctx, files = sub_env
|
||||
d = _corpus(tmp_path)
|
||||
monkeypatch.setattr(blx, "source_folder", lambda t: d)
|
||||
seen = []
|
||||
facts = {"facts": [{"block": "Alpha", "subblock": "Sub Eins", "key_points": ["k"],
|
||||
"prerequisites": "", "hurdles": "",
|
||||
|
||||
Reference in New Issue
Block a user