update
This commit is contained in:
@@ -508,7 +508,9 @@ async def _verify_block(ctx: GenContext, files: dict, title: str, gen: dict, q:
|
|||||||
if vorhanden is not None: # Korrektur: Facts ersetzen, Einstufung bleibt
|
if vorhanden is not None: # Korrektur: Facts ersetzen, Einstufung bleibt
|
||||||
vorhanden["facts"] = _fk_of(e)
|
vorhanden["facts"] = _fk_of(e)
|
||||||
bfacts[sn] = vorhanden["facts"]
|
bfacts[sn] = vorhanden["facts"]
|
||||||
else: # Lücken-Fund: neuer consensus-Sub
|
elif not keep_all: # Lücken-Fund: neuer consensus-Sub
|
||||||
|
# (Bottom-up unterdrückt das: die Subs stehen fest, der Fix-Call darf keine
|
||||||
|
# neuen einschleusen — sonst wächst die Sub-Zahl über die Board-1-Atome hinaus)
|
||||||
bfacts[sn] = _fk_of(e)
|
bfacts[sn] = _fk_of(e)
|
||||||
keep.append(e["title"])
|
keep.append(e["title"])
|
||||||
sidecar_subs.append({"title": e["title"],
|
sidecar_subs.append({"title": e["title"],
|
||||||
|
|||||||
@@ -270,7 +270,10 @@ async def test_verify_keep_all_behaelt_alle_atome(env, monkeypatch):
|
|||||||
db, ctx, files = env
|
db, ctx, files = env
|
||||||
subs = ["Sub A", "Sub B", "Sub C"]
|
subs = ["Sub A", "Sub B", "Sub C"]
|
||||||
await _seed_rows(db, "alpha", subs)
|
await _seed_rows(db, "alpha", subs)
|
||||||
fix = {"subs": [_sub("Sub A", kp=["korrigiert"])]}
|
# Fix-Call liefert die Korrektur für Sub A UND einen belegten NEUEN Fund — der darf
|
||||||
|
# bei keep_all NICHT als Sub eingeschleust werden (Sub-Zahl bleibt bei den Board-1-Atomen).
|
||||||
|
fix = {"subs": [_sub("Sub A", kp=["korrigiert"]),
|
||||||
|
_sub("Extra Fund", kp=["belegt"], cf=[{"text": "x", "source": "s"}])]}
|
||||||
verdikt = {"fremd": [3], "gruppen": [{"haupt": 1, "weitere": [2]}],
|
verdikt = {"fremd": [3], "gruppen": [{"haupt": 1, "weitere": [2]}],
|
||||||
"facts_probleme": [{"nr": 1, "discard": True, "hinweis": "Zahl falsch"},
|
"facts_probleme": [{"nr": 1, "discard": True, "hinweis": "Zahl falsch"},
|
||||||
{"nr": 2, "discard": True}],
|
{"nr": 2, "discard": True}],
|
||||||
@@ -278,9 +281,10 @@ async def test_verify_keep_all_behaelt_alle_atome(env, monkeypatch):
|
|||||||
fake = _judge_slot({"1": verdikt, "2": verdikt}, fix=fix)
|
fake = _judge_slot({"1": verdikt, "2": verdikt}, fix=fix)
|
||||||
monkeypatch.setattr(bc, "run_single_slot", fake)
|
monkeypatch.setattr(bc, "run_single_slot", fake)
|
||||||
res = await bc._verify_block(ctx, files, "Alpha", _gen_von("Alpha", subs), {}, keep_all=True)
|
res = await bc._verify_block(ctx, files, "Alpha", _gen_von("Alpha", subs), {}, keep_all=True)
|
||||||
assert res["raw"] == {"Alpha": subs} # alle drei bleiben — nichts entfernt/gefaltet
|
assert res["raw"] == {"Alpha": subs} # exakt die drei Atome — nichts entfernt, nichts neu
|
||||||
rows = {r["sub_norm"]: r["status"] for r in await db.list_subblocks(TOPIC, "alpha")}
|
rows = {r["sub_norm"]: r["status"] for r in await db.list_subblocks(TOPIC, "alpha")}
|
||||||
assert all(rows[_norm_title(s)] == "consensus" for s in subs)
|
assert all(rows[_norm_title(s)] == "consensus" for s in subs)
|
||||||
|
assert "extra fund" not in rows # der Fix-Neuzugang wurde unterdrückt
|
||||||
side = {s["title"]: s for s in res["sidecar"]["Alpha"]}
|
side = {s["title"]: s for s in res["sidecar"]["Alpha"]}
|
||||||
assert side["Sub A"]["facts"]["key_points"] == ["korrigiert"] # Hinweis trotz discard=True
|
assert side["Sub A"]["facts"]["key_points"] == ["korrigiert"] # Hinweis trotz discard=True
|
||||||
assert side["Sub B"]["level"] == "expert" # Level-Korrektur greift
|
assert side["Sub B"]["level"] == "expert" # Level-Korrektur greift
|
||||||
|
|||||||
Reference in New Issue
Block a user