Skip to content

Commit e1ea3cf

Browse files
Added post about the code reviewer & explainer agents, and the full refactoring pipeline
1 parent a91e25b commit e1ea3cf

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
+++
2+
date = '2025-08-15'
3+
draft = false
4+
title = 'Code Reviewer, Explainer, and End-to-End Refactoring Pipeline'
5+
tags = ["AI", "LLM", "AgenticAI", "Refactoring", "JaCoCo", "Coverage"]
6+
+++
7+
8+
<a href="#tldr" class="btn">Jump to TL;DR</a>
9+
10+
We've now reached a point where the platform can take a Java file, run it through the full workflow, and return a refactored version with no manual steps in between.
11+
That’s thanks to two new agents, coverage integration, and automated file handling, all stitched together into one continuous pipeline.
12+
13+
14+
## 1. Code Reviewer Agent
15+
The **Code Reviewer** is our new quality gate between transformations, and is now fully implemented.
16+
When the **Code Transformer** makes changes, the Reviewer checks them for correctness, quality, and whether they actually match the intended refactoring strategy.
17+
18+
If the Reviewer is not happy, it sends the code back for another pass, up to a maximum of *three cycles*.
19+
This keeps the output sharp, catches regressions early, and prevents infinite loops.
20+
21+
## 2. Explainer Agent
22+
The **Explainer** turns all of the behind-the-scenes work into human-readable explanations.
23+
For every refactoring cycle (Java file), it explains:
24+
- **What** changed;
25+
- **Why** it changed;
26+
- **How** the changes tie to the anti-patterns detected.
27+
28+
The result is an audit log in plain English which makes the whole process more transparent and easier to trust. It can also be used in future iterations of our solution to automatically create commit and pull request messages.
29+
30+
## 3. JaCoCo Integration & Coverage Reading
31+
We've wired in **JaCoCo** so the workflow can read coverage data straight from project reports.
32+
This allows us to only modify those files with **100% coverage**, giving us the highest possible likelihood of avoiding breaking changes via refactoring. The tests are then rerun on the final, refactored version of the repository for validation.
33+
34+
A major challenge in AI-assisted code generation is validating the changes. By only modifying fully-covered files and preserving public interfaces (public method signatures, class names, etc.), we drastically reduce the potential for regression.
35+
36+
## 4. Automatic Java File Ingestion
37+
As part of our coverage tool implementation, we now successfully extract fully-covered Java files from the repository to refactor.
38+
These files are then automatically queued and sent through our agentic pipeline:
39+
40+
*Detection -> Strategising -> Transform & Review Cycle -> Validation -> Explanation*.
41+
42+
At the end, the developer receives a refactored file ready to go.
43+
44+
With a few small tweaks, our project is well on its way to automatically refactor entire repositories with no human intervention.
45+
46+
## Next Steps
47+
We'll be working for the remainder of this project on creating a **Command-Line Interface (CLI)** for direct control, followed by a **web SPA GUI** to make it easier to use and visualise the intermediate steps.
48+
49+
## TL;DR
50+
51+
- **Code Reviewer** and **Explainer** agents are complete and fully integrated into our agentic workflow.
52+
- **JaCoCo** is now integrated into our solution, allowing us to extract and refactor only those files with 100% coverage.
53+
- **Automatic file ingestion** is essentially complete.
54+
- **CLI** and **GUI** implementation are our next targets.

0 commit comments

Comments
 (0)