feat: V8.5 — FAKT-Speicherort-Dialog beim Onboarding (4 Optionen, Pfad-Validierung, strategy-aware doc_store)

This commit is contained in:
Bernd (Hermes)
2026-07-18 23:30:13 +02:00
parent 463e29d594
commit f10973810a
7 changed files with 1089 additions and 43 deletions
+30 -14
View File
@@ -175,8 +175,18 @@ class ArchivarMessageHandler:
self._state = ArchivarState(ARCHIVAR_STATE_PATH)
self._state.load()
# doc_store writes to fact_store_path from room_map
self._doc_store = DocumentationStore(base_dir=self._room_map.fact_store_path)
# Thema 3: Strategy-aware DocumentationStore
strategy = self._room_map.fact_store_strategy
if strategy == "none":
self._doc_store = None
logger.info("FAKT-Store: strategy='none' — kein DocumentationStore")
else:
fact_path = self._room_map.fact_store_path
if strategy == "auto":
# mkdir -p falls Pfad nicht existiert
fact_path.mkdir(parents=True, exist_ok=True)
logger.info("FAKT-Store: strategy='auto' — Verzeichnis erstellt: %s", fact_path)
self._doc_store = DocumentationStore(base_dir=fact_path)
# Cache for subscribed room IDs (set later via set_subscribed_room_ids)
self._subscribed_room_ids_cache: Optional[set] = None
@@ -411,16 +421,22 @@ class ArchivarMessageHandler:
self._stats["meta"] += 1
elif decision.is_unrouteable:
self._stats["classified"] += 1
stored = self._doc_store.store(
text=text,
category=decision.category,
confidence=decision.confidence,
reason=decision.unrouteable_reason,
)
logger.info(
"Unrouteable [%s] stored in doc_store: %s",
decision.category, stored,
)
if self._doc_store is not None:
stored = self._doc_store.store(
text=text,
category=decision.category,
confidence=decision.confidence,
reason=decision.unrouteable_reason,
)
logger.info(
"Unrouteable [%s] stored in doc_store: %s",
decision.category, stored,
)
else:
logger.info(
"Unrouteable [%s] NOT stored — fact_store_strategy='none'",
decision.category,
)
elif decision.is_fallback:
self._stats["fallback"] += 1
elif decision.is_catch_all:
@@ -1161,8 +1177,8 @@ class ArchivarMessageHandler:
self._router.set_subscribed_room_ids(room_ids)
@property
def doc_store(self) -> DocumentationStore:
"""Documentation store for unrouteable messages."""
def doc_store(self) -> Optional[DocumentationStore]:
"""Documentation store for unrouteable messages (None if strategy='none')."""
return self._doc_store
@property