Objective
Decompose the two largest dashboard service files to improve maintainability and reduce merge conflict risk.
Findings
[P2] agent_lifecycle.py (1224 LOC)
- Location:
sova/dashboard/services/agent_lifecycle.py
- Issue: Handles agent spawning, retry logic, context resolution, worktree discovery, PR recovery, and process management in one file.
- Recommendation: Extract retry orchestration into
agent_retry.py, context/worktree resolution into agent_context.py (already partially exists), and PR recovery into agent_recovery.py (already partially exists). Verify boundaries.
[P2] work_item_service.py (1107 LOC)
- Location:
sova/dashboard/services/work_item_service.py
- Issue: Contains PR state machine, SOVA verdict resolution, work item computation, and external review handling.
- Recommendation: Extract state machine (
compute_work_item_state and helpers) into work_state.py. Keep work item aggregation in work_item_service.py.
Files to Modify
sova/dashboard/services/agent_lifecycle.py
sova/dashboard/services/work_item_service.py
sova/dashboard/services/work_state.py (new)
Estimated Effort
6 hours
Dependencies
None
Source: docs/HEALTH-AUDIT.md -- Health Audit 2026-08-12
Triage Assessment
Title: refactor(dashboard): split agent_lifecycle and work_item_service god files
Has description: yes
Suitability: ready
Confidence: 85%
Complexity: complex
Missing context: none
Labels: type: task, area: dashboard
Issue has structured sections indicating clear scope; ready for research.
Objective
Decompose the two largest dashboard service files to improve maintainability and reduce merge conflict risk.
Findings
[P2] agent_lifecycle.py (1224 LOC)
sova/dashboard/services/agent_lifecycle.pyagent_retry.py, context/worktree resolution intoagent_context.py(already partially exists), and PR recovery intoagent_recovery.py(already partially exists). Verify boundaries.[P2] work_item_service.py (1107 LOC)
sova/dashboard/services/work_item_service.pycompute_work_item_stateand helpers) intowork_state.py. Keep work item aggregation inwork_item_service.py.Files to Modify
sova/dashboard/services/agent_lifecycle.pysova/dashboard/services/work_item_service.pysova/dashboard/services/work_state.py(new)Estimated Effort
6 hours
Dependencies
None
Source:
docs/HEALTH-AUDIT.md-- Health Audit 2026-08-12Triage Assessment
Title: refactor(dashboard): split agent_lifecycle and work_item_service god files
Has description: yes
Suitability: ready
Confidence: 85%
Complexity: complex
Missing context: none
Labels: type: task, area: dashboard
Issue has structured sections indicating clear scope; ready for research.