-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
architectureArchitecture changesArchitecture changeshighHigh priorityHigh priorityjulesTask for Jules AITask for Jules AI
Description
Task Type
refactor - Architecture fix
Component
agents.coder, agents.devops
Problem Description
Domain layer (agents/) imports from CLI layer (vertice_cli/), violating clean architecture principles. Dependencies should flow inward: CLI → Core, not Core → CLI.
Violations Found
agents/coder/agent.py:41- imports from vertice_cli.agentsagents/devops/agent.py:251- imports from vertice_cli.tools
Files to Modify
agents/coder/agent.py:41- Fix importagents/devops/agent.py:251- Fix import
Current Code (Problematic)
# agents/coder/agent.py:41
from vertice_cli.agents.architect import ArchitectAgent # WRONG: domain imports CLI
# agents/devops/agent.py:251
from vertice_cli.tools.registry import ToolRegistry # WRONG: domain imports CLIExpected Code (Fix)
Option 1: Move shared code to vertice_core
# agents/coder/agent.py
from vertice_core.agents import ArchitectAgent # Correct: imports from core
# agents/devops/agent.py
from vertice_core.tools import ToolRegistry # Correct: imports from coreOption 2: Use protocol/interface
# agents/coder/agent.py
from typing import Protocol
class ArchitectProtocol(Protocol):
async def analyze(self, code: str) -> AnalysisResult: ...
# Inject concrete implementation from CLI layerValidation Commands
# Check imports
python3 -c "from agents.coder.agent import CoderAgent; print('OK')"
python3 -c "from agents.devops.agent import DevOpsAgent; print('OK')"
# Verify no CLI imports in agents/
grep -rn "from vertice_cli" agents/ --include="*.py"
# Run agent tests
pytest tests/agents/ -vPriority
high
References
- Clean Architecture
- Audit ID: ARCH-002
Metadata
Metadata
Assignees
Labels
architectureArchitecture changesArchitecture changeshighHigh priorityHigh priorityjulesTask for Jules AITask for Jules AI