wip fixing regressions, removing hardcoded paths

This commit is contained in:
2026-03-06 19:24:08 -05:00
parent cb1440d61c
commit f439b5c525
5 changed files with 43 additions and 53 deletions

View File

@@ -105,14 +105,24 @@ def _is_allowed(path: Path) -> bool:
CRITICAL: Blacklisted files (history) are NEVER allowed.
"""
# Blacklist check
name = path.name.lower()
if name in ("history.toml", "config.toml", "credentials.toml") or name.endswith("_history.toml"):
return False
from src.paths import get_config_path
from src.ai_client import get_credentials_path
try:
rp = path.resolve(strict=True)
except (OSError, ValueError):
rp = path.resolve()
# Blacklist check by resolved path
if rp == get_config_path().resolve():
return False
if rp == get_credentials_path().resolve():
return False
name = path.name.lower()
if name == "history.toml" or name.endswith("_history.toml"):
return False
if rp in _allowed_paths:
return True
# Allow current working directory and subpaths by default if no base_dirs