Implement runtime agent loop and container hygiene

This commit is contained in:
2026-05-12 07:56:37 -05:00
parent 412d7caec3
commit a09197e85a
13 changed files with 524 additions and 70 deletions

View File

@@ -1,5 +1,6 @@
"""Configuration management using pydantic-settings."""
from pydantic import field_validator
from pydantic_settings import BaseSettings
from typing import Optional
@@ -12,6 +13,30 @@ class Settings(BaseSettings):
APP_ENV: str = "development"
DEBUG: bool = False
@field_validator("DEBUG", mode="before")
@classmethod
def parse_debug(cls, value: object) -> bool:
"""Parse permissive runtime DEBUG values from shell environments."""
if isinstance(value, bool):
return value
if isinstance(value, str):
normalized = value.strip().lower()
if normalized in {"1", "true", "t", "yes", "y", "on", "debug"}:
return True
if normalized in {
"0",
"false",
"f",
"no",
"n",
"off",
"release",
"prod",
"production",
}:
return False
return False
# Database
DATABASE_URL: str = "postgresql+asyncpg://sanctum:password@localhost:5432/sanctum"
@@ -27,6 +52,9 @@ class Settings(BaseSettings):
LLM_API_KEY: Optional[str] = None
LLM_MODEL: str = "gpt-3.5-turbo"
# Agent loop
AGENT_LOOP_INTERVAL_SECONDS: float = 60.0
# Export
EXPORT_PATH: str = "exports"