Skip to content

refactor(dashboard): split agent_lifecycle and work_item_service god files #642

Description

@xsovad06

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent:readyReady for autonomous developmentagent:triagedIssue triaged by SOVA agentarea: dashboardFastAPI web dashboardtype: taskImplementation task

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions