CoolFace
Apppublic

akullaganeshA/professional-coding-env

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes
App README

OpenEnv: Professional Coding Task Simulation

OpenEnv is a production-grade playground for evaluating AI software engineering agents on real-world coding tasks. It provides a session-isolated, high-performance environment with integrated graders and structured logging.

๐Ÿš€ Quick Start

Prerequisites

  • โ€”Python 3.11+
  • โ€”uv (recommended) or pip

Setup

bash
# Using uv (recommended)
uv sync

# Using pip
pip install -r requirements.txt

Run Server Locally

bash
uv run python3 server/app.py

๐Ÿ›  API Documentation

The OpenEnv server exposes both REST and WebSocket interfaces for flexible integration.

REST Endpoints

  • โ€”GET /health: Health check and system metrics.
  • โ€”POST /reset: Initialize a new session. Returns session_id and the initial observation.
  • โ€”POST /step: Execute an action in an active session. Requires session_id and action_data.
  • โ€”GET /state?session_id=<id>: Retrieve full internal state for auditing/debugging.

WebSocket Interface

Connect to ws://<host>:<port>/ws for persistent, low-latency session management.

  • โ€”Protocol: JSON-based message exchange.
  • โ€”Message Types: reset, step, state.

๐Ÿง  Core Tasks

OpenEnv includes 3 distinct real-world tasks with automated graders:

  1. 1.Email Triage (Easy): Filtering urgent tickets from a support stream.
  2. 2.Data Pipeline (Medium): Cleaning and imputing customer datasets using pandas.
  3. 3.Security Patch (Hard): Remediating SQL injection vulnerabilities via parameterized queries.

๐Ÿ“Š Baseline Reproduction

To run the reference baseline and verify structured logging compliance:

bash
export API_BASE_URL="https://api.openai.com/v1"
export MODEL_NAME="gpt-3.5-turbo"
export HF_TOKEN="your-api-key"
uv run python3 inference.py

๐Ÿ” Troubleshooting

  • โ€”Connection Refused: Ensure the server is running and the port (default 7860) is exposed.
  • โ€”ModuleNotFoundError: Ensure you are using uv run or have activated your virtual environment.
  • โ€”Score is 0.0: Check the grader logic in tasks.py and ensure the agent response contains the expected patterns.

๐Ÿ›ก Security & Compliance

  • โ€”Zero-knowledge Reset: State is wiped using cryptographically secure nonces to prevent leakage between episodes.
  • โ€”Thread-safe: Session management utilizes asynchronous locks to ensure integrity under concurrent load.
  • โ€”Non-root Docker: Containers run as a limited user to minimize attack surfaces.