fix: V8.2.1 — 7 Befunde (A2 Caller, A3 Persistenz, A4 Strategie-Block, Tests, Feature-Flag, conftest, runbook)

Befund 1 (P0): A2 Dead-Code — _should_trigger_nachklaerung() in adapter.py
Button-Response-Handler angebunden. stay_once (Button 3) triggert jetzt
Nachklärung mit Strategie-Buttons. ARCHIVAR_CLARIFY-Responses werden
verarbeitet (Strategie-Thema → Ring-Zustand "jetzt", ANDERER GRUND →
normales Lernen).

Befund 2 (P0): A3 Persistenz-Bug — _stay_counts und _keyword_last_matched
in RoomMap.save() und _from_dict() serialisiert. Tracking-Felder
überleben Gateway-Restart.

Befund 3 (P1): A4 Strategie-Block — _is_strategie_topic() im DM-Pfad
des Routers. Strategie-Themen im DM → stay_in_room (kein Routing,
kein Lernen).

Befund 4 (P1): Tests — 8 neue echte Integrationstests (TestV821A2,
TestV821A3, TestV821A4). 27/27 grün.

Befund 5 (P2): ARCHIVAR_STRATEGY_AUTO_DETECT env var in config.py,
Default false (Rainer Auflage P1).

Befund 6 (P2): conftest.py mit temp_room_map_path und temp_state_path
Fixtures für saubere Pfad-Tests.

Befund 7 (P2): docs/deployment-runbook.md mit .45 Bare-VM Schritten
inkl. room-map.json Pfad-Korrektur.
This commit is contained in:
Bernd (Hermes)
2026-07-14 21:27:32 +02:00
parent 39a5041621
commit de930a1227
7 changed files with 590 additions and 4 deletions
+9 -1
View File
@@ -492,7 +492,10 @@ class RoomMap:
"description": room_entry.description,
"keywords_100": room_entry.keywords_100,
"keywords_context": room_entry.keywords_context,
"catch_all": room_entry.catch_all
"catch_all": room_entry.catch_all,
# V8.2.1 A3: Persistiere Tracking-Felder
"_stay_counts": room_entry._stay_counts,
"_keyword_last_matched": room_entry._keyword_last_matched,
}
# Schreibe die Datei mit exklusivem File-Lock
@@ -705,6 +708,11 @@ class RoomMap:
keywords_context=keywords_context,
catch_all=room_data.get("catch_all", False),
)
# V8.2.1 A3: Tracking-Felder aus JSON deserialisieren
if "_stay_counts" in room_data:
rooms[room_id]._stay_counts = room_data["_stay_counts"]
if "_keyword_last_matched" in room_data:
rooms[room_id]._keyword_last_matched = room_data["_keyword_last_matched"]
excluded = set(data.get("excluded_rooms", []))
fact_store = Path(