Comprehensive API documentation for bug reproduction, patch creation, and testing workflows
Bug reproduction and fixing service providing REST APIs for managing complete software bug workflows.
Base URL: http://localhost:8000
| Version: 1.0.0
Retrieve all available projects for bug reproduction and fixing. This endpoint provides the foundation for other operations by listing valid project names that can be used with the bug_id parameter.
curl http://localhost:8000/projects
import requests
response = requests.get("http://localhost:8000/projects")
print(response.json())
const response = await fetch('http://localhost:8000/projects');
const data = await response.json();
console.log(data);
{
"projects": [
"libxml2",
"openssl",
"curl",
"nginx",
"apache"
]
}
Initiate bug reproduction for a specific bug ID. This endpoint queues a background task to reproduce the bug environment, set up dependencies, and run tests. The bug reproduction process includes environment setup, dependency installation, and test execution.
/projects
endpoint.
/status/{handle}
to monitor progress.
import requests
response = requests.post(
"http://localhost:8000/reproduce",
json={
"bug_id": "libxml2@a1b2c3d4e5f6789012345678901234567890abcd",
"is_force_cleanup": True
}
)
print(response.json())
curl http://localhost:8000/reproduce \
-H "Content-Type: application/json" \
-d '{
"bug_id": "libxml2@a1b2c3d4e5f6789012345678901234567890abcd",
"is_force_cleanup": true
}'
const response = await fetch('http://localhost:8000/reproduce', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
bug_id: "libxml2@a1b2c3d4e5f6789012345678901234567890abcd",
is_force_cleanup: true
})
});
const data = await response.json();
console.log(data);
{
"handle": "abc123def456789012345678901234567890uvwx"
}
Apply a patch to fix a bug and test the fix. This endpoint uses caching to avoid redundant processing of the same patch. Results are cached based on the combination of bug_id and patch_path, making subsequent requests with identical parameters return immediately.
/projects
.
import requests
response = requests.post(
"http://localhost:8000/fix",
json={
"bug_id": "openssl@f1e2d3c4b5a6789012345678901234567890cdef",
"patch_path": "/patches/openssl_security_fix.patch"
}
)
print(response.json())
curl http://localhost:8000/fix \
-H "Content-Type: application/json" \
-d '{
"bug_id": "openssl@f1e2d3c4b5a6789012345678901234567890cdef",
"patch_path": "/patches/openssl_security_fix.patch"
}'
const response = await fetch('http://localhost:8000/fix', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
bug_id: "openssl@f1e2d3c4b5a6789012345678901234567890cdef",
patch_path: "/patches/openssl_security_fix.patch"
})
});
const data = await response.json();
console.log(data);
{
"handle": "cGF0Y2hfZjFlMmQzYzRiNWE2XzEyMzQ1Njc4LmxvZw==",
"redis_key": "patch_f1e2d3c4b5a6_12345678.log"
}
Alternative implementation for applying patches to fix bugs. This endpoint provides different configuration options and processing strategies compared to the standard /fix endpoint.
/projects
.
import requests
response = requests.post(
"http://localhost:8000/fix_with_patch",
json={
"bug_id": "curl@b2c3d4e5f6a789012345678901234567890abcde",
"patch_path": "/patches/curl_memory_fix.patch",
"options": {
"validation": "strict",
"backup": True
}
}
)
print(response.json())
curl http://localhost:8000/fix_with_patch \
-H "Content-Type: application/json" \
-d '{
"bug_id": "curl@b2c3d4e5f6a789012345678901234567890abcde",
"patch_path": "/patches/curl_memory_fix.patch",
"options": {
"validation": "strict",
"backup": true
}
}'
const response = await fetch('http://localhost:8000/fix_with_patch', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
bug_id: "curl@b2c3d4e5f6a789012345678901234567890abcde",
patch_path: "/patches/curl_memory_fix.patch",
options: {
validation: "strict",
backup: true
}
})
});
const data = await response.json();
console.log(data);
{
"handle": "ZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXphYmNkZWZnaGk=",
"method": "alternative_v2"
}
Core endpoint for processing LLM responses and generating patches. Supports multiple patch application methods including direct replacement, unified diff application, and prefix-based patching. The service automatically detects the input format and selects appropriate processing strategies.
diff
- Apply unified diff format patchesinline
- Extract code from markdown and apply directlyinline+meta
- Apply unified diff with metadata contextdirect
- Direct replacement of function bodyprefix
- Prefix-based replacement with context (default)import requests
response = requests.post(
"http://localhost:8000/extract_anchor_patch",
json={
"bug_id": "libxml2@a1b2c3d4e5f6789012345678901234567890abcd",
"llm_response": "```cpp\nint validateInput(const char* input) {\n if (!input || strlen(input) == 0) {\n return 0;\n }\n return 1;\n}\n```",
"method": "direct",
"generate_diff": True,
"persist_flag": False
}
)
print(response.json())
curl http://localhost:8000/extract_anchor_patch \
-H "Content-Type: application/json" \
-d '{
"bug_id": "libxml2@a1b2c3d4e5f6789012345678901234567890abcd",
"llm_response": "```cpp\nint validateInput(const char* input) {\n if (!input || strlen(input) == 0) {\n return 0;\n }\n return 1;\n}\n```",
"method": "direct",
"generate_diff": true,
"persist_flag": false
}'
const response = await fetch('http://localhost:8000/extract_anchor_patch', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
bug_id: "libxml2@a1b2c3d4e5f6789012345678901234567890abcd",
llm_response: "```cpp\nint validateInput(const char* input) {\n if (!input || strlen(input) == 0) {\n return 0;\n }\n return 1;\n}\n```",
method: "direct",
generate_diff: true,
persist_flag: false
})
});
const data = await response.json();
console.log(data);
{
"success": true,
"md5_hash": "5d41402abc4b2a76b9719d911017c592",
"patch_content": "diff --git a/src/validation.cpp...",
"bug_id": "libxml2@a1b2c3d4e5f6789012345678901234567890abcd",
"sha": "a1b2c3d4e5f6789012345678901234567890abcd",
"fix_p": "/tmp/patches/tmp_xyz123.cpp",
"fix_p_diff": "/tmp/patches/tmp_xyz123.patch",
"func_start_byte": 450,
"func_end_byte": 485
}