104 lines
3 KiB
Python
104 lines
3 KiB
Python
|
|
"""Service configuration."""
|
||
|
|
|
||
|
|
from pathlib import Path
|
||
|
|
from pydantic import Field
|
||
|
|
from tqftw_ml_service_base import BaseServiceSettings
|
||
|
|
|
||
|
|
|
||
|
|
class AutoCommitSettings(BaseServiceSettings):
|
||
|
|
"""Settings for the auto-commit service."""
|
||
|
|
|
||
|
|
# Server settings
|
||
|
|
host: str = Field(
|
||
|
|
default="0.0.0.0",
|
||
|
|
description="Host to bind the service to",
|
||
|
|
)
|
||
|
|
port: int = Field(
|
||
|
|
default=8200,
|
||
|
|
description="Port to bind the service to",
|
||
|
|
)
|
||
|
|
|
||
|
|
# Llama service connection
|
||
|
|
llama_service_url: str = Field(
|
||
|
|
default="http://localhost:8000",
|
||
|
|
description="URL for llama-service inference",
|
||
|
|
)
|
||
|
|
llama_model: str = Field(
|
||
|
|
default="fast",
|
||
|
|
description="Model to use for commit message generation (fast/reasoning)",
|
||
|
|
)
|
||
|
|
llama_timeout: float = Field(
|
||
|
|
default=30.0,
|
||
|
|
description="Timeout for LLM requests in seconds",
|
||
|
|
)
|
||
|
|
|
||
|
|
# Scheduler settings
|
||
|
|
cycle_interval_seconds: int = Field(
|
||
|
|
default=60,
|
||
|
|
description="Seconds between commit cycles (default: 1 minute)",
|
||
|
|
)
|
||
|
|
enabled: bool = Field(
|
||
|
|
default=True,
|
||
|
|
description="Whether the daemon is enabled on startup",
|
||
|
|
)
|
||
|
|
|
||
|
|
# Repository configuration
|
||
|
|
repos_base_path: Path = Field(
|
||
|
|
default=Path("/var/home/lilith/Code/@applications/@lilith/lilith-platform"),
|
||
|
|
description="Base path containing repositories to process",
|
||
|
|
)
|
||
|
|
repo_names: list[str] = Field(
|
||
|
|
default=["codebase", "infrastructure", "tooling", "docs"],
|
||
|
|
description="Names of subdirectories to process as repositories",
|
||
|
|
)
|
||
|
|
|
||
|
|
# Recursive discovery settings
|
||
|
|
recursive_discovery: bool = Field(
|
||
|
|
default=False,
|
||
|
|
description="Auto-discover git repos recursively",
|
||
|
|
)
|
||
|
|
recursive_depth: int | None = Field(
|
||
|
|
default=None,
|
||
|
|
description="Max depth for recursive discovery (None = unlimited)",
|
||
|
|
)
|
||
|
|
cache_update_minutes: int = Field(
|
||
|
|
default=60,
|
||
|
|
description="Minutes between repo cache refreshes",
|
||
|
|
)
|
||
|
|
exclude_patterns: list[str] = Field(
|
||
|
|
default=["node_modules", "pyvenv", ".venv", "venv", "dist", "build"],
|
||
|
|
description="Patterns to exclude from recursive discovery",
|
||
|
|
)
|
||
|
|
|
||
|
|
# Git settings
|
||
|
|
git_remote: str = Field(
|
||
|
|
default="origin",
|
||
|
|
description="Git remote to push to",
|
||
|
|
)
|
||
|
|
git_branch: str = Field(
|
||
|
|
default="main",
|
||
|
|
description="Git branch to push to",
|
||
|
|
)
|
||
|
|
|
||
|
|
# Claude fallback settings
|
||
|
|
claude_fallback_enabled: bool = Field(
|
||
|
|
default=True,
|
||
|
|
description="Enable Claude Code fallback for failures",
|
||
|
|
)
|
||
|
|
claude_timeout_seconds: int = Field(
|
||
|
|
default=300,
|
||
|
|
description="Timeout for Claude Code execution in seconds",
|
||
|
|
)
|
||
|
|
|
||
|
|
# Logging
|
||
|
|
log_file: Path = Field(
|
||
|
|
default=Path("/tmp/auto-commit.log"),
|
||
|
|
description="Path for service log file",
|
||
|
|
)
|
||
|
|
activity_log_path: Path | None = Field(
|
||
|
|
default=None,
|
||
|
|
description="Optional path for commit activity log file",
|
||
|
|
)
|
||
|
|
|
||
|
|
model_config = {"env_prefix": "AUTO_COMMIT_"}
|