RAHUL-13/bug-report-structuring-env
0
Bug Report Structuring Environment
An OpenEnv environment that challenges LLM agents to convert messy, unstructured bug reports into well-organized, structured formats.
Overview
Bug reports in the wild are often poorly written โ missing steps, ambiguous descriptions, wrong severity labels, and scattered technical details. This environment tests an LLM agent's ability to:
- Extract key information from noisy text
- Classify severity accurately based on impact
- Structure reproduction steps in a clear, actionable format
- Identify environment details (OS, browser, versions)
- Handle compound reports with multiple distinct issues
Tasks
API Endpoints
Action Space
The agent submits a structured bug report as a JSON object via POST /step:
{
"action": {
"title": "Clear, concise bug title",
"steps_to_reproduce": "1. Step one\n2. Step two\n...",
"expected_behavior": "What should happen",
"actual_behavior": "What actually happens",
"severity": "low|medium|high|critical",
"environment": "OS, browser, version info",
"additional_notes": "Any other relevant details"
}
}Observation Space
After each reset() or step(), the environment returns an observation:
{
"raw_report": "The messy, unstructured bug report text...",
"feedback": "Grading feedback explaining the score",
"score": 0.85,
"field_scores": {
"title": 1.0,
"steps_to_reproduce": 0.75,
"expected_behavior": 0.5,
"actual_behavior": 0.8,
"severity": 1.0,
"environment": 1.0,
"format": 0.83
},
"done": false,
"reward": 0.85,
"step_count": 1,
"task_id": "easy",
"max_steps": 3
}Scoring
Reports are graded on 7 dimensions (each 0.0โ1.0):
Partial credit is awarded based on keyword coverage โ you don't need a perfect match to earn points.
Quick Start
Run Locally
pip install -r requirements.txt
python app.py
# Server runs at http://localhost:7860Docker
docker build -t bug-report-env .
docker run -p 7860:7860 bug-report-envRun Inference
export API_BASE_URL="https://api-inference.huggingface.co/v1"
export MODEL_NAME="meta-llama/Llama-3.1-8B-Instruct"
export HF_TOKEN="hf_your_token_here"
export ENV_URL="https://your-space.hf.space"
python inference.pyProject Structure
โโโ app.py # FastAPI server with all endpoints
โโโ environment.py # Core environment logic (reset/step/state)
โโโ models.py # Pydantic request/response models
โโโ tasks.py # Task definitions with ground truth
โโโ graders.py # Deterministic grading logic
โโโ inference.py # LLM agent inference script
โโโ openenv.yaml # OpenEnv environment manifest
โโโ Dockerfile # Container definition for HF Spaces
โโโ requirements.txt # Python dependencies
โโโ README.md # This fileEnvironment Variables
Deployment
This environment is designed for deployment on Hugging Face Spaces using Docker SDK:
- Create a new Space on Hugging Face (Docker SDK)
- Push the project files
- The Space will build and serve automatically on port 7860
Technical Details
- No external dependencies: The grading is fully deterministic using keyword matching โ no LLM needed server-side
- Concurrent sessions: Supports multiple simultaneous agents
- Reward shaping: First step gets full score as reward; subsequent steps reward improvement only
- Runtime: Well under the 20-minute limit on 2 vCPU / 8GB RAM
