Add iterative refinement example for COBOL to Java refactoring#1415
Add iterative refinement example for COBOL to Java refactoring#1415
Conversation
This example demonstrates an iterative refinement workflow where: 1. A refactoring agent converts COBOL files to Java files 2. A critique agent evaluates the quality of each conversion 3. If the average score is below 90%, the process repeats with feedback Fixes #1414 Co-authored-by: openhands <openhands@all-hands.dev>
Example Run Results ✅The iterative refinement example completed successfully! Summary
Final Critique Report Snippet# COBOL to Java Refactoring Critique Report
## Summary
The COBOL to Java refactoring demonstrates a high-quality conversion with strong adherence to Java best practices and OOP principles. All three programs successfully preserve the original business logic while modernizing the codebase.
## File Evaluations
### CBACT01C.cbl
- **Java File**: AccountDisplay.java
- **File Score**: 93/100
### CBCUS01C.cbl
- **Java File**: CustomerInformation.java
- **File Score**: 93/100
### CBTRN01C.cbl
- **Java File**: TransactionProcessing.java
- **File Score**: 95/100
## Overall Score
- **Average Score**: 94/100
- **Recommendation**: PASS
The refactoring successfully converts all COBOL programs to Java with high fidelity to the original business logic while embracing modern Java practices. The code is production-ready with professional-quality documentation, error handling, and structure.Created Java Files
The example demonstrates the iterative refinement workflow working as expected - the refactoring agent achieved a high-quality conversion on the first iteration, meeting the 90% threshold. |
|
Looks like there are a few issues preventing this PR from being merged!
If you'd like me to help, just leave a comment, like Feel free to include any additional details that might help me get this PR into a better state. You can manage your notification settings |
csmith49
left a comment
There was a problem hiding this comment.
Some minor suggestions, but nothing blocking. LGTM!
|
@OpenHands do minimal changes to reflect |
|
I'm on it! neubig can track my progress at all-hands.dev |
…ceability - Expose QUALITY_THRESHOLD and MAX_ITERATIONS as environment variables - Add requirement for JavaDoc comments to include @source traceability to original COBOL source with program:line numbers format Co-authored-by: openhands <openhands@all-hands.dev>
|
I've addressed Changes MadeAddressing csmith49's comments:
Checklist
The PR has been updated: #1415 |
Description
This PR adds a new example demonstrating an iterative refinement workflow for COBOL to Java refactoring.
Changes
examples/01_standalone_sdk/31_iterative_refinement.py- A comprehensive example that demonstrates:How it works
The workflow operates in a loop:
The example includes sample COBOL files based on the AWS CardDemo application structure.
Source Data Reference
The example recommends using COBOL files from:
https://github.com/aws-samples/aws-mainframe-modernization-carddemo/tree/main/app/cbl
Fixes #1414
Testing
Documentation
Documentation PR: OpenHands/docs#191
Agent Server images for this PR
• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server
Variants & Base Images
eclipse-temurin:17-jdknikolaik/python-nodejs:python3.12-nodejs22golang:1.21-bookwormPull (multi-arch manifest)
# Each variant is a multi-arch manifest supporting both amd64 and arm64 docker pull ghcr.io/openhands/agent-server:16da1e7-pythonRun
All tags pushed for this build
About Multi-Architecture Support
16da1e7-python) is a multi-arch manifest supporting both amd64 and arm6416da1e7-python-amd64) are also available if needed