-
Notifications
You must be signed in to change notification settings - Fork 79
Open
Labels
Description
Parent Issue
Part of #879 — Support Multi-Agent Execution Modes Per Task
Context
The implementer-reviewer pattern requires capturing what the implementer changed so the reviewer can analyze it. Currently there is no diff capture or code review infrastructure in the codebase. The GitMergeService exists for git diff in prompt context but is not designed for inter-agent review handoff.
Task
Create a DiffCaptureService that snapshots file state before implementation and captures the diff after.
Key Changes
-
Create
DiffCaptureService:public class DiffCaptureService { /** Snapshot current git state (or working tree) before implementation */ String captureBaseline(Project project); /** Capture diff between baseline and current state */ String captureDiff(Project project, String baselineRef); /** Get summary of changed files */ List<FileChange> getChangedFiles(Project project, String baselineRef); }
-
FileChangemodel:@Data public class FileChange { String filePath; ChangeType type; // ADDED, MODIFIED, DELETED int linesAdded; int linesRemoved; }
-
Integration approach:
- Before implementer runs:
baseline = diffService.captureBaseline(project)(e.g.,git stash createorgit rev-parse HEAD) - After implementer completes:
diff = diffService.captureDiff(project, baseline) - Pass
diffto reviewer viaSpecContextBuilder.buildReviewerInstruction(task, diff)
- Before implementer runs:
-
Fallback for non-git projects: If git is unavailable, capture file checksums/timestamps and produce a simplified diff summary.
Files to Create
src/main/java/com/devoxx/genie/service/spec/DiffCaptureService.java(new)src/main/java/com/devoxx/genie/model/spec/FileChange.java(new)
Acceptance Criteria
- Baseline captured before implementer starts
- Diff captured after implementer completes
- Diff output is human-readable (unified diff format)
- Changed files list includes paths, types, and line counts
- Works with git-based projects
- Graceful fallback for non-git projects
- Large diffs truncated with summary (prevent token explosion)
Reactions are currently unavailable