feat: V8.5 — FAKT-Speicherort-Dialog beim Onboarding (4 Optionen, Pfad-Validierung, strategy-aware doc_store)
This commit is contained in:
@@ -126,6 +126,8 @@ class RoomMap:
|
||||
fact_store_path: Path,
|
||||
version: int = 1,
|
||||
butler_mode: str = "cognitive",
|
||||
fact_store_strategy: str = "manual",
|
||||
fact_store_created_at: Optional[str] = None,
|
||||
) -> None:
|
||||
"""Initialize from pre-parsed data.
|
||||
|
||||
@@ -136,6 +138,8 @@ class RoomMap:
|
||||
self._fact_store_path = fact_store_path
|
||||
self._version = version
|
||||
self._butler_mode = butler_mode # Fix C v7: 'cognitive' | 'strict' | 'off'
|
||||
self._fact_store_strategy = fact_store_strategy # Thema 3: 'auto' | 'manual' | 'none'
|
||||
self._fact_store_created_at = fact_store_created_at # Thema 3: ISO-Timestamp
|
||||
|
||||
# ── Properties ───────────────────────────────────────────────────
|
||||
|
||||
@@ -180,6 +184,36 @@ class RoomMap:
|
||||
raise ValueError(f"Invalid butler_mode: {mode}")
|
||||
self._butler_mode = mode
|
||||
|
||||
# ── Thema 3: FAKT-Speicherort-Properties ──────────────────────────
|
||||
|
||||
@property
|
||||
def fact_store_strategy(self) -> str:
|
||||
"""Thema 3: FAKT-Speicherort-Strategie — 'auto', 'manual', oder 'none'."""
|
||||
return self._fact_store_strategy
|
||||
|
||||
def set_fact_store_strategy(self, strategy: str) -> None:
|
||||
"""Thema 3: Setze die FAKT-Speicherort-Strategie.
|
||||
|
||||
Args:
|
||||
strategy: 'auto', 'manual', or 'none'.
|
||||
"""
|
||||
if strategy not in ("auto", "manual", "none"):
|
||||
raise ValueError(f"Invalid fact_store_strategy: {strategy}")
|
||||
self._fact_store_strategy = strategy
|
||||
|
||||
@property
|
||||
def fact_store_created_at(self) -> Optional[str]:
|
||||
"""Thema 3: ISO-Timestamp der FAKT-Speicherort-Erstellung (Telemetrie)."""
|
||||
return self._fact_store_created_at
|
||||
|
||||
def set_fact_store_created_at(self, timestamp: Optional[str]) -> None:
|
||||
"""Thema 3: Setze den FAKT-Speicherort-Erstellungszeitpunkt.
|
||||
|
||||
Args:
|
||||
timestamp: ISO-Format Timestamp oder None.
|
||||
"""
|
||||
self._fact_store_created_at = timestamp
|
||||
|
||||
# ── Lookup Methods ────────────────────────────────────────────────
|
||||
|
||||
def find_room_by_keywords(self, text: str, min_score: int = 1, origin_room_id: Optional[str] = None) -> Optional[RoomEntry]:
|
||||
@@ -459,6 +493,8 @@ class RoomMap:
|
||||
self._fact_store_path = new_map._fact_store_path
|
||||
self._version = new_map._version
|
||||
self._butler_mode = new_map._butler_mode # Fix C v7
|
||||
self._fact_store_strategy = new_map._fact_store_strategy # Thema 3
|
||||
self._fact_store_created_at = new_map._fact_store_created_at # Thema 3
|
||||
|
||||
@staticmethod
|
||||
def save(room_map: 'RoomMap', path: Optional[Path] = None) -> None:
|
||||
@@ -488,7 +524,11 @@ class RoomMap:
|
||||
"excluded_rooms": list(room_map._excluded_room_ids),
|
||||
"fact_store_path": str(room_map._fact_store_path),
|
||||
"butler_mode": room_map._butler_mode, # Fix C v7
|
||||
"fact_store_strategy": room_map._fact_store_strategy, # Thema 3
|
||||
}
|
||||
# Thema 3: fact_store_created_at nur persistieren wenn gesetzt
|
||||
if room_map._fact_store_created_at is not None:
|
||||
data["fact_store_created_at"] = room_map._fact_store_created_at
|
||||
|
||||
for room_id, room_entry in room_map._rooms.items():
|
||||
data["rooms"][room_id] = {
|
||||
@@ -760,6 +800,9 @@ class RoomMap:
|
||||
os.path.expanduser(data.get("fact_store_path", "~/archivar_docs"))
|
||||
)
|
||||
butler_mode = data.get("butler_mode", "cognitive") # Fix C v7
|
||||
# Thema 3: FAKT-Speicherort-Felder
|
||||
fact_store_strategy = data.get("fact_store_strategy", "manual") # Migration: default 'manual'
|
||||
fact_store_created_at = data.get("fact_store_created_at", None)
|
||||
|
||||
return cls(
|
||||
rooms=rooms,
|
||||
@@ -767,6 +810,8 @@ class RoomMap:
|
||||
fact_store_path=fact_store,
|
||||
version=version,
|
||||
butler_mode=butler_mode,
|
||||
fact_store_strategy=fact_store_strategy,
|
||||
fact_store_created_at=fact_store_created_at,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user