Skip to content

refactor(slm): drift_checker.py should reuse DEFAULT_REPO_PATH from git_tracker instead of re-reading SLM_REPO_PATH #3434

@mrveiss

Description

@mrveiss

Summary

`drift_checker.get_default_source_dir()` reads `SLM_REPO_PATH` directly from `os.environ`:

```python
source_root = os.environ.get("SLM_REPO_PATH", "/opt/autobot/code_source")
```

`services/git_tracker.py` already exports `DEFAULT_REPO_PATH` which resolves the same env var with the same fallback. Duplicating the read creates two places where the default can diverge.

Affected file: `autobot-slm-backend/services/drift_checker.py`

Fix

Import and use `DEFAULT_REPO_PATH` from `services.git_tracker`:

```python
from services.git_tracker import DEFAULT_REPO_PATH

def get_default_source_dir(component: str = "autobot-slm-backend") -> str:
candidate = Path(DEFAULT_REPO_PATH) / component
...
```

Introduced in

PR #3430 — identified in code review as LOW finding.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions