update
This commit is contained in:
@@ -1986,7 +1986,7 @@ COLUMNS = [
|
|||||||
_TITLE_STAGES = ["ingest", "cluster"]
|
_TITLE_STAGES = ["ingest", "cluster"]
|
||||||
_CLUSTER_STAGES = ["pair_check", "consensus_gate", "clarify", "naming", "naming_check"]
|
_CLUSTER_STAGES = ["pair_check", "consensus_gate", "clarify", "naming", "naming_check"]
|
||||||
_BLOCK_STAGES = ["fragment_filter", "dedup", "grouping", "gap_check", "done"]
|
_BLOCK_STAGES = ["fragment_filter", "dedup", "grouping", "gap_check", "done"]
|
||||||
_ART_STAGES = ["generate", "verify", "artefakte", "finalize", "konsolidierung", "outline"]
|
_ART_STAGES = ["generate", "verify", "artefakte", "finalize", "outline"]
|
||||||
# where a requeued dead card restarts, by kind
|
# where a requeued dead card restarts, by kind
|
||||||
_DEAD_RESTART = {"title": "cluster", "cluster": "pair_check", "block": "fragment_filter",
|
_DEAD_RESTART = {"title": "cluster", "cluster": "pair_check", "block": "fragment_filter",
|
||||||
"ablock": "generate", "outline": "outline"}
|
"ablock": "generate", "outline": "outline"}
|
||||||
@@ -2125,13 +2125,17 @@ async def reset_board_from_stage(topic: str, board: str, stage: str, files: dict
|
|||||||
await _requeue(r, "outline")
|
await _requeue(r, "outline")
|
||||||
elif r["stage"] in later:
|
elif r["stage"] in later:
|
||||||
await _requeue(r, stage)
|
await _requeue(r, stage)
|
||||||
if stage == "generate": # full artefact re-derive → also the DB mirrors
|
if stage == "generate": # re-derive enrichment + artefacts; the Board-1 subs STAY
|
||||||
await db.delete_subblocks(topic)
|
# Bottom-up: subblocks belong to Board 1 (the clustered atoms). Deleting them would
|
||||||
|
# leave Board 2 nothing to enrich → cards fall straight through to done. Only the
|
||||||
|
# DERIVED artefacts/questions + sidecar files are wiped; the enrichment (facts/level)
|
||||||
|
# gets overwritten by the fresh Board-2 run.
|
||||||
await db.delete_question_pattern(topic)
|
await db.delete_question_pattern(topic)
|
||||||
await db.delete_sub_artefakte(topic)
|
await db.delete_sub_artefakte(topic)
|
||||||
|
await db.delete_outline(topic) # the outline is a blocks artifact too (set in board_artefacts)
|
||||||
# global sidecar files and per-block resume slots: leftovers of the previous
|
# global sidecar files and per-block resume slots: leftovers of the previous
|
||||||
# derive would re-merge/resume into the fresh run — nothing here is reused
|
# derive would re-merge/resume into the fresh run — nothing here is reused
|
||||||
for k in ("sidecar", "facts", "sub_roh", "question_pattern", "artefakte"):
|
for k in ("sidecar", "facts", "sub_roh", "question_pattern", "artefakte", "outline"):
|
||||||
files[k].unlink(missing_ok=True)
|
files[k].unlink(missing_ok=True)
|
||||||
for d in files["arbeit"].glob("ab-*"):
|
for d in files["arbeit"].glob("ab-*"):
|
||||||
if d.is_dir():
|
if d.is_dir():
|
||||||
|
|||||||
@@ -1225,12 +1225,14 @@ def test_hat_anker_ziffern_suffix():
|
|||||||
assert not bi._hat_anker("Algorithmus Verfahren", ctoks) # nur Stopwörter → kein Anker
|
assert not bi._hat_anker("Algorithmus Verfahren", ctoks) # nur Stopwörter → kein Anker
|
||||||
|
|
||||||
|
|
||||||
async def test_reset_generate_loescht_globale_dateien(testdb, tmp_path):
|
async def test_reset_generate_behaelt_subs_loescht_artefakte(testdb, tmp_path):
|
||||||
"""Reset auf Spalte generate: DB-Spiegel UND globale Sidecar-Dateien + ab-*-Resume-Slots
|
"""Reset auf Spalte generate (Artefakte entfernen): die Board-1-Subs BLEIBEN (Board 2
|
||||||
weg — Reste des Vor-Laufs würden sonst in den frischen Lauf zurückmergen."""
|
reichert sie neu an), aber die abgeleiteten Fragen/Artefakte + globalen Sidecar-Dateien
|
||||||
|
+ ab-*-Resume-Slots gehen weg — sonst mergen Reste in den frischen Lauf zurück."""
|
||||||
db = testdb
|
db = testdb
|
||||||
await db.kanban_upsert_card(TOPIC, "artefacts", "alpha", "ablock", "artefakte", {"title": "Alpha"})
|
await db.kanban_upsert_card(TOPIC, "artefacts", "alpha", "ablock", "artefakte", {"title": "Alpha"})
|
||||||
await db.put_subblock(TOPIC, "alpha", "s1", "Alpha", "S1", status="consensus")
|
await db.put_subblock(TOPIC, "alpha", "s1", "Alpha", "S1", status="consensus")
|
||||||
|
await db.upsert_question_pattern(TOPIC, "alpha", "s1", "Alpha", "S1", "Frage?")
|
||||||
arbeit = tmp_path / "arbeit"
|
arbeit = tmp_path / "arbeit"
|
||||||
(arbeit / "ab-alpha").mkdir(parents=True)
|
(arbeit / "ab-alpha").mkdir(parents=True)
|
||||||
(arbeit / "ab-alpha" / "facts.json").write_text("{}", encoding="utf-8")
|
(arbeit / "ab-alpha" / "facts.json").write_text("{}", encoding="utf-8")
|
||||||
@@ -1240,7 +1242,8 @@ async def test_reset_generate_loescht_globale_dateien(testdb, tmp_path):
|
|||||||
files[k].write_text("{}", encoding="utf-8")
|
files[k].write_text("{}", encoding="utf-8")
|
||||||
moved = await bi.reset_board_from_stage(TOPIC, "artefacts", "generate", files)
|
moved = await bi.reset_board_from_stage(TOPIC, "artefacts", "generate", files)
|
||||||
assert moved == 1
|
assert moved == 1
|
||||||
assert not await db.list_subblocks(TOPIC)
|
assert len(await db.list_subblocks(TOPIC)) == 1 # Sub bleibt (Board-1-Eigentum)
|
||||||
|
assert not await db.list_question_pattern(TOPIC, "alpha") # abgeleitete Frage weg
|
||||||
assert not (arbeit / "ab-alpha").exists()
|
assert not (arbeit / "ab-alpha").exists()
|
||||||
assert all(not files[k].exists() for k in ("sidecar", "facts", "sub_roh", "question_pattern", "artefakte"))
|
assert all(not files[k].exists() for k in ("sidecar", "facts", "sub_roh", "question_pattern", "artefakte"))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user