Welcome! We appreciate contributions of all kinds. Here's how to get started.
To get started with local development:
-
Clone and Install:
git clone https://github.com/ArshVermaGit/open-ev-code-handler.git cd open-ev-code-handler python3 -m venv venv && source venv/bin/activate pip install -r requirements.txt
-
Initialize:
cp .env.example .env python scripts/migrate.py init
-
Run Tests:
PYTHONPATH=. pytest tests/ -v
Scenarios live in codelens_env/scenarios.py. Each scenario needs:
Step 1: Choose a task type and next sequential hash (e.g., bug_011).
Step 2: Write a realistic unified diff. The diff must:
- Start with
--- a/filenameand+++ b/filename - Include
@@ -N,M +N,M @@hunk headers - Show a few lines of context (unchanged lines)
- Include the problematic line prefixed with
+
Example patch:
patch="""--- a/api/users.py
+++ b/api/users.py
@@ -10,6 +10,6 @@ def get_users(page, size):
offset = page * size
- return items[offset:offset + size]
+ return items[offset:offset + size - 1]
"""Step 3: Define at least one GroundTruthIssue with:
keywords: 2+ specific terms an agent body must contain (case-insensitive)line_number: the line in the diff where the issue occurs (±3 tolerance for bugs/security, ±5 for arch)severity: appropriate level (criticalonly for RCE/auth bypass/data loss)
Step 4: Add to ALL_SCENARIOS list and verify:
PYTHONPATH=. python -m pytest tests/test_scenarios.py -vAll 30 (or more) scenarios must pass validation.
- Fork the repo and create a branch:
feat/my-feature,fix/my-bug,test/more-tests - Make your changes
- Run the full test suite:
PYTHONPATH=. python -m pytest tests/ -v - Run the linter:
pylint codelens_env/ app.py(target score ≥ 7.0) - Open a PR against
mainwith a clear description
- Type hints on all public functions and methods
- Docstrings on all public classes and non-trivial functions
- pylint score ≥ 7.0
- Line length ≤ 100 characters
- No bare
except:clauses — always specify the exception type
We use Conventional Commits:
feat: add rate limiting to /reset endpoint
fix: correct leaderboard rank calculation after slice
test: add parametrized tests for all 30 scenarios
docs: update README quick start commands
refactor: extract episode cleanup into separate module
chore: upgrade pydantic to 2.6.1