Skip to content

Commit 36e7a58

Browse files
committed
nit: Fix README.md
1 parent e13281b commit 36e7a58

File tree

3 files changed

+59
-41
lines changed

3 files changed

+59
-41
lines changed

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,31 @@
3434
</tr>
3535
</table>
3636

37+
3738
🚀 Repository for automated Java code migration research, part of the [MigrationBench](https://huggingface.co/collections/AmazonScience/migrationbench-68125452fc21a4564b92b6c3) project.
3839

40+
3941
## 📦 Packages
4042

4143
This repository contains two main packages for Java code migration:
4244

43-
### 🤖 [java_migration_agent](./java_migration_agent)
45+
### 1. 🤖 [java_migration_agent](./java_migration_agent)
4446
LLM-based agent library for automated Java 8 to Java 17 migration, built on the [Strands Agents](https://strandsagents.com/latest/) framework. Supports multiple migration strategies including baseline, PE (prompt engineering), RAG, and hybrid approaches.
4547

46-
### 🔧 [self_debug](./self_debug)
48+
### 2. 🔧 [self_debug](./self_debug)
4749
SDFeedback implementation for code migration with LLMs using self-debugging feedback. Includes both single-job and batch processing capabilities with AWS EMRS support.
4850

51+
4952
## 📊 Data
5053

5154
Agent trajectories and execution results are stored in the `data/` folder.
5255

5356
## 🔗 Resources
5457

55-
- 🤗 [MigrationBench (Hugging Face)](https://huggingface.co/collections/AmazonScience/migrationbench-68125452fc21a4564b92b6c3)
56-
- 💻 [MigrationBench (GitHub)](https://github.com/amazon-science/MigrationBench)
57-
- 📄 [arXiv Paper](https://arxiv.org/abs/2505.09569)
58+
1. 🤗 [MigrationBench (Hugging Face)](https://huggingface.co/collections/AmazonScience/migrationbench-68125452fc21a4564b92b6c3)
59+
1. 💻 [MigrationBench (GitHub)](https://github.com/amazon-science/MigrationBench)
60+
1. 📄 [arXiv Paper](https://arxiv.org/abs/2505.09569)
61+
5862

5963
## 📚 Citation
6064

java_migration_agent/README.md

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -52,22 +52,22 @@
5252

5353
## 1. Overview
5454

55-
Java Migration Agent is a library for automated code migration from Java 8 to Java 17 using LLM-based agents built on the [Strands Agents](https://github.com/strands-agents/strands-agents) framework.
55+
Java Migration Agent is a library for automated code migration from Java 8 to Java 17 using LLM-based agents built on the [Strands Agents](https://github.com/strands-agents) framework.
5656

5757
It provides multiple agent strategies for migration:
58-
- **Baseline**: Direct LLM-based migration
59-
- **PE (Prompt Engineering)**: Baseline with enhanced prompts for dependency updates
60-
- **RAG**: Uses retrieval-augmented generation for dependency version lookup
61-
- **Hybrid**: Pre-processes dependencies before LLM migration
58+
1. **Baseline**: Direct LLM-based migration
59+
1. **PE (Prompt Engineering)** (Baseline + PE): Baseline with enhanced prompts for dependency updates
60+
1. **RAG** (Baseline + PE + RAG): Uses retrieval-augmented generation for dependency version lookup
61+
1. **Hybrid** (Seed change, followed by baseline + PE): Pre-processes dependencies before LLM migration
6262

6363
The agent relies on the [MigrationBench](https://github.com/amazon-science/MigrationBench) package for evaluation.
6464

65-
## 2. [MigrationBench](https://huggingface.co/collections/AmazonScience/migrationbench-68125452fc21a4564b92b6c3) Datasets
65+
## 2. [🤗 MigrationBench](https://huggingface.co/collections/AmazonScience/migrationbench-68125452fc21a4564b92b6c3) Datasets
6666

6767
| Index | Dataset | Size | Notes |
6868
|-------|-----------------------------------------------|-------|-----------------------------------------------------------------------------------------------------|
69-
| 1 | [AmazonScience/migration-bench-java-full](https://huggingface.co/datasets/AmazonScience/migration-bench-java-full) | 5,102 | Each repo has a test directory or at least one test case |
70-
| 2 | [AmazonScience/migration-bench-java-selected](https://huggingface.co/datasets/AmazonScience/migration-bench-java-selected) | 300 | A **subset** of migration-bench-java-full |
69+
| 1 | [🤗 AmazonScience/migration-bench-java-full](https://huggingface.co/datasets/AmazonScience/migration-bench-java-full) | 5,102 | Each repo has a test directory or at least one test case |
70+
| 2 | [🤗 AmazonScience/migration-bench-java-selected](https://huggingface.co/datasets/AmazonScience/migration-bench-java-selected) | 300 | A **subset** of migration-bench-java-full |
7171

7272
## 3. Installation
7373

@@ -95,19 +95,26 @@ If you haven't done it yet, follow the instructions in [MigrationBench](https://
9595
### 3.2 Install Package
9696

9797
```bash
98-
cd java_migration_agent
99-
pip install -e .
98+
# cd .../JavaMigration/
99+
100+
cd java_migration_agent/
101+
pip install -r requirements.txt -e .
100102
```
101103

102104
Or with uv:
103105

104106
```bash
105-
cd java_migration_agent
107+
# cd .../JavaMigration/
108+
109+
cd java_migration_agent/
106110
uv pip install -e .
107111
```
108112

109113
## 4. Usage
110114

115+
See the full binary script at [java_migration_agent/src/java_migration_agent/main.py](https://github.com/amazon-science/JavaMigration/blob/main/java_migration_agent/src/java_migration_agent/main.py).
116+
117+
111118
### 4.1 Agent Types
112119

113120
| Agent Type | Description |
@@ -133,16 +140,18 @@ python -m java_migration_agent \
133140

134141
### 4.3 Command Line Options
135142

136-
| Option | Default | Description |
137-
|--------|---------|-------------|
138-
| `--agent-type` | (required) | Agent type: `baseline`, `pe`, `rag`, or `hybrid` |
139-
| `--exp-id` | (required) | Experiment identifier for organizing results |
140-
| `--hf-dataset` | `AmazonScience/migration-bench-java-selected` | HuggingFace dataset name |
141-
| `--model-id` | `global.anthropic.claude-sonnet-4-5-20250929-v1:0` | Bedrock model ID |
142-
| `--temperature` | `1.0` | Model temperature |
143-
| `--max-messages` | `80` | Maximum messages per conversation |
144-
| `--max-workers` | `8` | Maximum parallel workers |
145-
| `--output-dir` | `./migration_results` | Output directory for results |
143+
144+
| Flag | Type | Default | Description |
145+
|--------|------|---------|-------------|
146+
| `--agent-type` | `str` | (required) | Agent type: `baseline`, `pe`, `rag`, or `hybrid` |
147+
| `--exp-id` | `str` | (required) | Experiment identifier for organizing results |
148+
| `--hf-dataset` | `str` | `AmazonScience/migration-bench-java-selected` | HuggingFace dataset name |
149+
| `--model-id` | `str` | `global.anthropic.claude-sonnet-4-5-20250929-v1:0` | Bedrock model ID |
150+
| `--temperature` | `float` | `1.0` | Model temperature |
151+
| `--max-messages` | `int` | `80` | Maximum messages per conversation |
152+
| `--max-workers` | `int` | `8` | Maximum parallel workers |
153+
| `--output-dir` | `str` | `./migration_results` | Output directory for results |
154+
146155

147156
## 5. 📚 Citation
148157
```bibtex

self_debug/README.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SDFeedback
1+
# JavaMigratio - SDFeedback
22

33
<table>
44
<tr>
@@ -44,12 +44,12 @@ markdown-toc -i README.md
4444

4545
- [1. 📖 Overview](#1--overview)
4646
* [1.1 MigrationBench: Datasets and Evaluation Framework](#11-migrationbench-datasets-and-evaluation-framework)
47-
* [1.2 SDFeedback: Migration with LLMs](#12-sdfeedback-migration-with-llms)
47+
* [1.2 JavaMigration (SDFeedback): Migration with LLMs](#12-sdfeedback-migration-with-llms)
4848
- [2. 🤗 MigrationBench Datasets](#2--migrationbench-datasets)
4949
- [3. Code Migration with LLMs](#3-code-migration-with-llms)
5050
* [3.1 Single Job](#31-single-job)
5151
+ [3.1.1 Basic Setup](#311-basic-setup)
52-
+ [3.1.2 Install MigrationBench and SDFeedback](#312-install-migrationbench-and-sdfeedback)
52+
+ [3.1.2 Install MigrationBench and JavaMigration (SDFeedback)](#312-install-migrationbench-and-sdfeedback)
5353
+ [3.1.3 Local Run](#313-local-run)
5454
* [3.2 Batch Job](#32-batch-job)
5555
+ [3.2.1 ~~Local Run~~](#321-local-run)
@@ -60,7 +60,7 @@ markdown-toc -i README.md
6060

6161
## 1. 📖 Overview
6262

63-
[SDFeedback](https://github.com/amazon-science/SDFeedback)
63+
[JavaMigration (SDFeedback)](https://github.com/amazon-science/JavaMigration/tree/main/self_debug)
6464
is a library to conduct code migration with LLMs,
6565
and improves efficacy by providing feedback to LLMs as specific as possible,
6666
motivated by [Teaching Large Language Models to Self-Debug](https://arxiv.org/abs/2304.05128).
@@ -79,9 +79,9 @@ across multiple programming languages.
7979
is the **evaluation framework** to assess code migration success,
8080
from `java 8` to `17` or any other long-term support versions.
8181

82-
### 1.2 [SDFeedback](https://github.com/amazon-science/SDFeedback): Migration with LLMs
82+
### 1.2 [JavaMigration (SDFeedback)](https://github.com/amazon-science/JavaMigration/tree/main/self_debug): Migration with LLMs
8383

84-
[SDFeedback](https://github.com/amazon-science/SDFeedback)
84+
[JavaMigration (SDFeedback)](https://github.com/amazon-science/JavaMigration/tree/main/self_debug)
8585
(current package)
8686
is to conduct code migration with LLMs as a baseline solution,
8787
and it relies on the
@@ -145,13 +145,13 @@ $ conda --version
145145
conda 25.1.1
146146
```
147147

148-
#### 3.1.2 Install [SDFeedback](https://github.com/amazon-science/SDFeedback)
148+
#### 3.1.2 Install [JavaMigration (SDFeedback)](https://github.com/amazon-science/JavaMigration/self_debug)
149149

150150
**Option A: Using uv (Recommended)**
151151

152152
```bash
153-
git clone https://github.com/amazon-science/SDFeedback.git
154-
cd SDFeedback
153+
git clone https://github.com/amazon-science/JavaMigration.git
154+
cd JavaMigration/self_debug
155155

156156
# Create and activate virtual environment with uv
157157
uv venv --python 3.9
@@ -167,23 +167,26 @@ uv pip install -e ".[dev]"
167167
**Option B: Using conda/pip**
168168

169169
```bash
170-
git clone https://github.com/amazon-science/SDFeedback.git
171-
cd SDFeedback
170+
git clone https://github.com/amazon-science/JavaMigration.git
171+
cd JavaMigration/self_debug
172172

173173
# Optional: create a conda env
174174
# conda create -n sd-feedback python=3.9
175175
# conda activate sd-feedback
176176

177177
# Install package (MigrationBench is installed automatically as a dependency)
178-
pip install -e .
178+
pip install -r requirements.txt -e .
179+
180+
# conda deactivate
179181
```
180182

181183
#### 3.1.3 Local Run
182184

183185
To run code migration for a single repository:
184186

185187
```
186-
cd ~/SDFeedback/src/self_debug
188+
# cd .../JavaMigration/self_debug/
189+
cd src/self_debug/
187190
188191
# Explicit `max_iteration` will override it in the `config_file`
189192
python run_self_debugging.py --config_file configs/java_config.pbtxt # --max_iterations 3
@@ -214,7 +217,8 @@ Before submitting a job to EMRS, make sure you have the following ready:
214217
1. Build an ECR image
215218

216219
```
217-
cd ~/SDFeedback/src/self_debug/container
220+
# cd .../JavaMigration/self_debug/
221+
cd src/self_debug/container
218222
219223
# To build ECR image: 552793110740.dkr.ecr.us-east-1.amazonaws.com/$USER:java
220224
./image.sh java $USER 1 docker/java.Dockerfile # 999999999999.dkr.ecr.us-west-2.amazonaws.com
@@ -225,7 +229,8 @@ cd ~/SDFeedback/src/self_debug/container
225229
Note that security keys might be subject to `12h` timeout.
226230

227231
```
228-
cd ~/SDFeedback/src/self_debug/batch
232+
# cd .../JavaMigration/self_debug/
233+
cd src/self_debug/batch
229234
230235
# Update config file as needed for `emrs.py`, e.g. use the right ECR image in step `#1`
231236
CONFIG=...

0 commit comments

Comments
 (0)