Objective
Break down _build_review_comments (606 lines) into independently testable subfunctions, making the reviewer module safer to modify.
Findings
[P2] 606-line function: _build_review_comments
- Location:
sova/roles/reviewer.py:417
- Issue: Single function handling inline comment mapping, body-only fallback, diff line validation, and formatting. Hardest function to modify safely in the entire codebase.
- Recommendation: Extract into
_map_findings_to_diff_lines(), _partition_inline_vs_body(), _format_inline_comments(), _format_body_fallback(). Each independently testable.
[P2] reviewer.py is a 1022-line god file
- Location:
sova/roles/reviewer.py
- Issue: Module handles review execution, comment building, posting, handoff, and memory extraction. Multiple responsibilities.
- Recommendation: Extract
_build_review_comments and helpers into sova/roles/_review_comments.py. Keep orchestration in reviewer.py.
Files to Modify
sova/roles/reviewer.py
sova/roles/_review_comments.py (new)
Estimated Effort
6 hours
Dependencies
None
Source: docs/HEALTH-AUDIT.md -- Health Audit 2026-08-12
Triage Assessment
Title: refactor(roles): decompose reviewer's 606-line function
Has description: yes
Suitability: ready
Confidence: 85%
Complexity: complex
Missing context: none
Labels: type: task, area: agent
Issue has structured sections indicating clear scope; ready for research.
Objective
Break down
_build_review_comments(606 lines) into independently testable subfunctions, making the reviewer module safer to modify.Findings
[P2] 606-line function: _build_review_comments
sova/roles/reviewer.py:417_map_findings_to_diff_lines(),_partition_inline_vs_body(),_format_inline_comments(),_format_body_fallback(). Each independently testable.[P2] reviewer.py is a 1022-line god file
sova/roles/reviewer.py_build_review_commentsand helpers intosova/roles/_review_comments.py. Keep orchestration inreviewer.py.Files to Modify
sova/roles/reviewer.pysova/roles/_review_comments.py(new)Estimated Effort
6 hours
Dependencies
None
Source:
docs/HEALTH-AUDIT.md-- Health Audit 2026-08-12Triage Assessment
Title: refactor(roles): decompose reviewer's 606-line function
Has description: yes
Suitability: ready
Confidence: 85%
Complexity: complex
Missing context: none
Labels: type: task, area: agent
Issue has structured sections indicating clear scope; ready for research.