Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions patchwork/steps/FixIssue/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# `FixIssue` Module Documentation

This documentation provides an overview of the `FixIssue` module in the `patchwork/steps/FixIssue/` directory, detailing its purpose, inputs, and outputs for developers working with the code.

## Overview

The FixIssue module is part of a system aimed at automating the analysis and resolution of coding issues within a software repository. It leverages language model clients (such as OpenAI's API) to understand the code structure, identify problems, propose changes, and test them. The module defines input and output data structures and contains the main logic for analyzing and fixing code issues.

## Components

The module is divided into several components:

- **typed.py**: Defines the input and output data structure types needed for the FixIssue step.
- **FixIssue.py**: Contains the main implementation logic to carry out issue analysis and resolution.
- **__init__.py**: Placeholder for package initialization, currently empty.

## Inputs

### FixIssueInputs

Defined in `typed.py`, this structure specifies the necessary inputs for the module:

- **Required**
- `issue_description` (str): A description of the coding issue to be resolved.

- **Optional** (with conditions via `Annotated` attributes):
- `base_path` (str): The base path to the repository (marked as a path).
- `openai_api_key` (str): API key for OpenAI services.
- `anthropic_api_key` (str): API key for Anthropic services.
- `patched_api_key` (str): API key alternative, includes a message prompt if not present.
- `google_api_key` (str): API key for Google services.

## Outputs

### FixIssueOutputs

Defined in `typed.py`, representing the output of the FixIssue step:

- `modified_files` (List[Dict]): A list of modified files and their respective changes made by the tool.

## Usage

The typical usage involves defining inputs, initializing the `FixIssue` class, and executing the `run()` method to process the issue. This would be suitable for development automation tools or CI/CD pipelines that automatically resolve identified code issues.

## Functions and Classes

### _ResolveIssue

A private class that extends `AnalyzeImplementStrategy`, implementing the logic to analyze and fix issues identified within a repository. It interacts with the codebase and uses language models for guidance.

### FixIssue

A `Step` subclass that orchestrates the setup of environment and execution of issue resolution based on the provided inputs. It initializes configurations, clients, and strategies, and runs the multiturn language model operation until the issue is resolved.

## Conclusion

The `FixIssue` module is a sophisticated tool designed for automated issue detection and correction in software repositories. It wraps around advanced language models to offer intelligent analysis and implementations, thereby enhancing the code maintenance process.