Spaces:
Sleeping
Sleeping
commit
Browse files- openenv.yaml +77 -0
openenv.yaml
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: code-review-env
|
| 2 |
+
version: "1.0.0"
|
| 3 |
+
description: >
|
| 4 |
+
An OpenEnv reinforcement-learning environment where AI agents learn to
|
| 5 |
+
review source code for syntax errors, logic bugs, and security vulnerabilities.
|
| 6 |
+
Agents receive partial reward signals at each step, enabling curriculum learning
|
| 7 |
+
from easy syntax checks up to multi-vulnerability security audits.
|
| 8 |
+
|
| 9 |
+
author: Simran Shaikh
|
| 10 |
+
tags:
|
| 11 |
+
- openenv
|
| 12 |
+
- code-review
|
| 13 |
+
- security
|
| 14 |
+
- software-engineering
|
| 15 |
+
- real-world
|
| 16 |
+
|
| 17 |
+
language: python
|
| 18 |
+
|
| 19 |
+
tasks:
|
| 20 |
+
- id: easy_syntax
|
| 21 |
+
name: "Python Syntax Error Detection"
|
| 22 |
+
difficulty: easy
|
| 23 |
+
max_steps: 5
|
| 24 |
+
description: >
|
| 25 |
+
Identify and fix a syntax error hidden in a short Python function.
|
| 26 |
+
Graded on: correct issue_type, description accuracy, and fix validity.
|
| 27 |
+
|
| 28 |
+
- id: medium_logic
|
| 29 |
+
name: "Logic Bug: Off-by-One in Palindrome Check"
|
| 30 |
+
difficulty: medium
|
| 31 |
+
max_steps: 8
|
| 32 |
+
description: >
|
| 33 |
+
Find and fix a subtle off-by-one indexing bug in a palindrome checker.
|
| 34 |
+
Fix is verified by executing 5 deterministic test cases.
|
| 35 |
+
|
| 36 |
+
- id: hard_security
|
| 37 |
+
name: "Security Vulnerability: SQL Injection, Path Traversal & Weak Hashing"
|
| 38 |
+
difficulty: hard
|
| 39 |
+
max_steps: 10
|
| 40 |
+
description: >
|
| 41 |
+
Perform a full security audit of an authentication module containing
|
| 42 |
+
three distinct vulnerabilities. All must be identified and remediated.
|
| 43 |
+
|
| 44 |
+
api:
|
| 45 |
+
reset: POST /reset
|
| 46 |
+
step: POST /step
|
| 47 |
+
state: GET /state
|
| 48 |
+
tasks: GET /tasks
|
| 49 |
+
|
| 50 |
+
reward:
|
| 51 |
+
min: 0.0
|
| 52 |
+
max: 1.0
|
| 53 |
+
type: continuous
|
| 54 |
+
partial_credit: true
|
| 55 |
+
|
| 56 |
+
observation_space:
|
| 57 |
+
task_id: string
|
| 58 |
+
task_name: string
|
| 59 |
+
difficulty: string
|
| 60 |
+
language: string
|
| 61 |
+
code_snippet: string
|
| 62 |
+
context: string
|
| 63 |
+
step_number: integer
|
| 64 |
+
max_steps: integer
|
| 65 |
+
previous_feedback: string | null
|
| 66 |
+
|
| 67 |
+
action_space:
|
| 68 |
+
identified_issues:
|
| 69 |
+
type: array
|
| 70 |
+
items:
|
| 71 |
+
line_number: integer | null
|
| 72 |
+
issue_type: "syntax_error | logic_bug | security_vulnerability | performance | style"
|
| 73 |
+
description: string
|
| 74 |
+
severity: "low | medium | high | critical"
|
| 75 |
+
suggested_fix: string | null
|
| 76 |
+
explanation: string
|
| 77 |
+
done: boolean
|