Skip to content

ExpeRepair/ExpeRepair

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ExpeRepair

ExpeRepair is a novel LLM-based program repair framework that continuously accumulates and reuses historical repair experiences via a dual-memory system. It comprises two core components:

  • Program Repair Module: Consists of a Test Agent and a Patch Agent that collaboratively handle three key tasks — test generation, patch generation, and patch validation.
  • Memory Module: Captures repair trajectories from the Program Repair Module, extracting concrete demonstrations and summarizing high-level repair strategies. These are stored in episodic memory and semantic memory, respectively. During future repairs, ExpeRepair retrieves relevant demonstrations and insights to enhance its repair strategy for new issues.

🚀 Quick Start

Installation

git clone <repository-url>
cd ExpeRepair-v1.0
pip install -r requirements.txt

Environment Setup

Set your API keys as environment variables:

export PYTHONPATH=$PYTHONPATH:$(pwd)
# OpenAI key
export OPENAI_KEY="your-openai-key"
# Anthropic Key
export CLAUDE_KEY="your-anthropic-key"

Following Agentless, ExpeRepair uses a repository structure format to localize suspicious files. You can either preprocess the repositories yourself, or download the prepared data: swebench_lite_repo_structure.zip.

After downloading, unzip and export its location:

export PROJECT_FILE_LOC={folder which you saved}

Finally, set up the testbed by following the instructions from the auto-code-rover project.

Running ExpeRepair on the Full Benchmark

  1. Run run_reproduce_initial.sh with all instance IDs.
  2. Run run_localization.sh with all instance IDs.
  3. For instances where reproduction succeeds (i.e., a valid reproducer_X.py script is generated), run generate_initial.py.
  4. For the remaining instances, run generate_w_memory.py, which leverages the accumulated memory and continues updating it.
  5. Finally, run validation.py and obtain_predictions.py with all instance IDs.

Usage

# reproduce the issue
bash inference/run_reproduce_initial.sh

# localize potential bug locations
bash inference/run_localization.sh

# generate candidate patches
bash inference/run_generate.sh

# validate candidate patches and select the best one
python inference/validation.py

# obtain the prediction results
python inference/obtain_predictions.py

🙏 Acknowledgement

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages