Skip to content

[FEATURE] #879 - Implement reviewer agent verdict parsing and revision cycle #906

@stephanj

Description

@stephanj

Parent Issue

Part of #879 — Support Multi-Agent Execution Modes Per Task

Context

In the implementer-reviewer pattern, the reviewer agent outputs a verdict (approve or request changes). This verdict must be reliably parsed from the agent's response to decide whether to proceed or trigger a revision cycle. There is no existing verdict parsing or structured output extraction in the codebase.

Task

Implement verdict parsing for reviewer output and the revision feedback loop.

Key Changes

  1. Create ReviewVerdictParser:

    public class ReviewVerdictParser {
        ReviewVerdict parse(String reviewerOutput);
    }
    
    @Data
    public class ReviewVerdict {
        VerdictType type;          // APPROVE, REQUEST_CHANGES
        List<String> comments;     // specific feedback items
        String summary;            // one-line summary
        double confidence;         // 0.0-1.0 (optional)
    }
    
    enum VerdictType { APPROVE, REQUEST_CHANGES }
  2. Parsing strategy:

    • Instruct reviewer to output a structured block (e.g., JSON or markdown with ## Verdict: APPROVE|REQUEST_CHANGES)
    • Parser extracts verdict type and comments
    • Fallback heuristics if structured format not followed (keyword detection: "approve", "reject", "changes needed")
  3. Revision cycle in MultiAgentPhaseManager:

    reviewVerdict = parser.parse(reviewerOutput)
    if (APPROVE) → complete task
    if (REQUEST_CHANGES && revisionCount < maxRevisions):
        - Build revision prompt with review comments
        - Re-run implementer with revision context
        - Re-run reviewer on new diff
        - revisionCount++
    if (REQUEST_CHANGES && revisionCount >= maxRevisions):
        - Mark task as "Needs Manual Review"
        - Append all review comments to task's implementationNotes
        - Skip task with reason
    
  4. Configurable max revision cycles: Default 2, configurable in Agent settings.

Files to Create / Modify

  • src/main/java/com/devoxx/genie/service/spec/ReviewVerdictParser.java (new)
  • src/main/java/com/devoxx/genie/model/spec/ReviewVerdict.java (new)
  • src/main/java/com/devoxx/genie/service/spec/MultiAgentPhaseManager.java
  • src/main/java/com/devoxx/genie/ui/settings/agent/AgentSettingsComponent.java (max revisions setting)

Dependencies

Acceptance Criteria

  • Parser extracts APPROVE/REQUEST_CHANGES from structured reviewer output
  • Fallback heuristic works when structured format not followed
  • Revision cycle re-runs implementer with review feedback
  • Max revision cycles enforced
  • Exhausted revisions result in task marked for manual review
  • Review comments persisted to task's implementationNotes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions