This commit is contained in:
Lars committed 2025-12-18 13:21:53 +01:00
1 parent 3eac646cb6
commit 48729e6f5d
3 files changed
+46 -44

No files matched your search

+4 -2
View File
@@ -2,7 +2,7 @@
FILE: app/services/edge_registry.py
DESCRIPTION: Single Source of Truth für Kanten-Typen. Parst '01_User_Manual/01_edge_vocabulary.md'.
WP-22 Teil B: Registry & Validation.
Beachtet den dynamischen Vault-Root aus ENV oder Parameter.
FIX: Dynamische Pfad-Auflösung basierend auf MINDNET_VAULT_ROOT.
"""
import re
import os
@@ -25,7 +25,7 @@ class EdgeRegistry:
if self.initialized:
return
# Priorität: 1. Parameter -> 2. ENV -> 3. Default
# Priorität: 1. Parameter (Test) -> 2. ENV (dotenv) -> 3. Default
self.vault_root = vault_root or os.getenv("MINDNET_VAULT_ROOT", "./vault")
self.vocab_rel_path = os.path.join("01_User_Manual", "01_edge_vocabulary.md")
self.unknown_log_path = "data/logs/unknown_edges.jsonl"
@@ -38,9 +38,11 @@ class EdgeRegistry:
def _load_vocabulary(self):
"""Parst die Markdown-Tabelle im Vault."""
# Absoluten Pfad auflösen, um Verwechslungen im venv zu vermeiden
full_path = os.path.abspath(os.path.join(self.vault_root, self.vocab_rel_path))
if not os.path.exists(full_path):
# Debug-Info: Zeige wo genau gesucht wurde
logger.warning(f"Edge Vocabulary NOT found at: {full_path}. Registry is empty.")
return