This commit is contained in:
Team3
2026-07-04 16:50:50 +02:00
parent 8488737303
commit 92c69c1561
7 changed files with 298 additions and 37 deletions

View File

@@ -75,11 +75,9 @@ def _mk_race(finder_by_agent):
if "-r1-" in key:
agent = int(key.rsplit("-", 1)[1])
subs = finder_by_agent.get(agent) or []
if subs and (m := _MD_PATH.search(prompt)):
if subs: # Finder antworten als TEXT (Marker-Format), kein out_path mehr
text = "<!-- block: Alpha -->\n" + "\n".join(f"- {s}" for s in subs)
with open(m.group(1), "w", encoding="utf-8") as f:
f.write(text)
outs.append(slot["payload"](None))
outs.append(slot["payload"]((0, text, "")))
outs = [o for o in outs if o]
return outs or None
fake_race.slots_seen = []
@@ -177,11 +175,8 @@ async def test_catchup_adds_and_stops(sub_env, monkeypatch, tmp_path):
if any("-subblock-x" in s["key"] for s in slots):
hit["n"] += 1
if hit["n"] == 1: # first catch-up round: both agents agree on one new sub
for slot in slots[:2]:
m = _MD_PATH.search(slot["prompt"])
with open(m.group(1), "w", encoding="utf-8") as f:
f.write("<!-- block: Alpha -->\n- Vertiefung der Konzepte")
return [slot["payload"](None) for slot in slots[:2]]
text = "<!-- block: Alpha -->\n- Vertiefung der Konzepte"
return [slot["payload"]((0, text, "")) for slot in slots[:2]]
return None
return await base(topic, label, slots, *a, **k)
@@ -251,13 +246,8 @@ async def test_paraphrase_saturation_stops_early(sub_env, monkeypatch):
async def with_r2(topic, label, slots, *a, **k):
if any("-r2-" in s["key"] for s in slots):
outs = []
for slot in slots[:2]:
m = _MD_PATH.search(slot["prompt"])
with open(m.group(1), "w", encoding="utf-8") as f:
f.write("<!-- block: Alpha -->\n- Umbruch erfordert explizite Marker!")
outs.append(slot["payload"](None))
return outs
text = "<!-- block: Alpha -->\n- Umbruch erfordert explizite Marker!"
return [slot["payload"]((0, text, "")) for slot in slots[:2]]
return await base_fake(topic, label, slots, *a, **k)
monkeypatch.setattr(blx, "_race", with_r2)
@@ -282,11 +272,8 @@ async def test_round_cap_stops_endless_finders(sub_env, monkeypatch):
rn = _re.search(r"-r(\d+)-", slots[0]["key"])
n = rn.group(1) if rn else "x"
for slot in slots[:2]:
m = _MD_PATH.search(slot["prompt"])
with open(m.group(1), "w", encoding="utf-8") as f:
f.write(f"<!-- block: Alpha -->\n- Konzept{n} ist eigenständig")
prompts.append((slot["key"], slot["prompt"]))
outs.append(slot["payload"](None))
outs.append(slot["payload"]((0, f"<!-- block: Alpha -->\n- Konzept{n} ist eigenständig", "")))
return outs
monkeypatch.setattr(blx, "_race", endless)
@@ -362,8 +349,9 @@ def test_sink_json_writes_only_valid(tmp_path):
async def test_clarify_inline_evidence_no_tools(sub_env, monkeypatch, tmp_path):
"""Mit Korpus: Judges bekommen Auszüge inline und laufen ohne Tools (Text-Antwort);
die j-Datei schreibt die Engine. Finder bleiben unverändert bei capabilities=files."""
"""Mit Korpus: Judges UND Finder bekommen Auszüge inline und laufen ohne Tools
(Text-Antwort); die Dateien schreibt die Engine. Der Finder verlor vorher 313
Tool-Runden pro Call mit der Material-Suche via glob/grep/bash."""
db, ctx, files = sub_env
d = _corpus(tmp_path)
monkeypatch.setattr(blx, "source_folder", lambda t: d)
@@ -378,7 +366,9 @@ async def test_clarify_inline_evidence_no_tools(sub_env, monkeypatch, tmp_path):
assert judges and all(s["capabilities"] == "none" for s in judges)
assert "── Skript.txt" in judges[0]["prompt"]
assert "ls/find" not in judges[0]["prompt"] # keine Selbst-Recherche-Anweisung mehr
assert finders and all(s["capabilities"] == "files" for s in finders)
assert finders and all(s["capabilities"] == "none" for s in finders)
assert "── Skript.txt" in finders[0]["prompt"] # Auszüge inline statt Dateisystem-Suche
assert "web search" not in finders[0]["prompt"]
assert list(tmp_path.glob("subblock-final-*-j*.md")) # Engine persistiert die Judge-Antwort