diff --git a/src/config.py b/src/config.py index 4de9ad46..8da3d2b5 100644 --- a/src/config.py +++ b/src/config.py @@ -455,6 +455,10 @@ class Settings(BaseSettings): # Background meditation interval in seconds (0 = disabled). scripture_meditation_interval: int = 0 + # ── Perception Cache ─────────────────────────────────────────────── + # Minimum confidence threshold for template matching in perception cache. + perception_confidence_threshold: float = 0.85 + def _compute_repo_root(self) -> str: """Auto-detect repo root if not set.""" if self.repo_root: diff --git a/src/timmy/sovereignty/perception_cache.py b/src/timmy/sovereignty/perception_cache.py index fe0df9b9..4d4de63b 100644 --- a/src/timmy/sovereignty/perception_cache.py +++ b/src/timmy/sovereignty/perception_cache.py @@ -8,6 +8,8 @@ from typing import Any import cv2 import numpy as np +from config import settings + @dataclass class Template: @@ -43,7 +45,7 @@ class PerceptionCache: best_match_confidence = max_val best_match_name = template.name - if best_match_confidence > 0.85: # TODO: Make this configurable per template + if best_match_confidence > settings.perception_confidence_threshold: return CacheResult( confidence=best_match_confidence, state={"template_name": best_match_name} )