feat(harness): add local session repository
This commit is contained in:
@@ -16,6 +16,11 @@ class ConfigError(Exception):
|
||||
"""Errore di configurazione, con messaggio leggibile per l'utente."""
|
||||
|
||||
|
||||
def local_tht_home() -> Path:
|
||||
"""Return the private local ThothII home, honoring the explicit override."""
|
||||
return Path(os.environ.get("THT_HOME", "~/.thothii")).expanduser()
|
||||
|
||||
|
||||
def _expand_env(value: Any) -> Any:
|
||||
if isinstance(value, str):
|
||||
|
||||
@@ -356,7 +361,9 @@ def load_config(path: Path) -> Config:
|
||||
raise ConfigError(
|
||||
f"transport: rest richiede la sezione `rest` (base_url, api_key) in {path}."
|
||||
)
|
||||
data_root = os.environ.get("THT_DATA_ROOT")
|
||||
# THT_HOME is the local-user storage root. Retain THT_DATA_ROOT as the
|
||||
# portable-deployment compatibility name until all callers use repositories.
|
||||
data_root = os.environ.get("THT_HOME") or os.environ.get("THT_DATA_ROOT")
|
||||
if data_root:
|
||||
# Import locally: paths owns resolution, while ConfigError remains the public
|
||||
# configuration exception callers already handle.
|
||||
|
||||
Reference in New Issue
Block a user