tanaymitra98 commited on
Commit
6e43eb6
·
1 Parent(s): e60a519

Enable graders on all tasks and add validator-compatible grade aliases

Browse files
Files changed (2) hide show
  1. graders.py +7 -0
  2. openenv.yaml +15 -3
graders.py CHANGED
@@ -195,3 +195,10 @@ def grade_action(
195
  "score": round(score, 4),
196
  }
197
  return score, details
 
 
 
 
 
 
 
 
195
  "score": round(score, 4),
196
  }
197
  return score, details
198
+
199
+
200
+ def grade(
201
+ action: List[Dict[str, Any]], expected: List[Dict[str, Any]]
202
+ ) -> Tuple[float, Dict[str, Any]]:
203
+ """Compatibility alias for validators expecting graders:grade."""
204
+ return grade_action(action, expected)
openenv.yaml CHANGED
@@ -4,20 +4,32 @@ description: OpenEnv RL environment for Solidity security review
4
  entrypoint: environment.py:SolidityGuardEnv
5
  tasks:
6
  - id: task_1_best_practices
 
7
  difficulty: easy
 
8
  description: Detect syntax and best-practice issues in Solidity contracts.
9
  max_steps: 1
10
- grader: graders:Grader.grade
 
 
11
  - id: task_2_gas_optimization
 
12
  difficulty: medium
 
13
  description: Detect gas optimization opportunities in Solidity contracts.
14
  max_steps: 1
15
- grader: graders:Grader.grade
 
 
16
  - id: task_3_security
 
17
  difficulty: hard
 
18
  description: Detect security vulnerabilities in Solidity contracts.
19
  max_steps: 1
20
- grader: graders:Grader.grade
 
 
21
  schemas:
22
  observation:
23
  type: object
 
4
  entrypoint: environment.py:SolidityGuardEnv
5
  tasks:
6
  - id: task_1_best_practices
7
+ name: Best Practices Audit
8
  difficulty: easy
9
+ enabled: true
10
  description: Detect syntax and best-practice issues in Solidity contracts.
11
  max_steps: 1
12
+ grader: "graders:grade_action"
13
+ graders:
14
+ - "graders:grade_action"
15
  - id: task_2_gas_optimization
16
+ name: Gas Optimization Audit
17
  difficulty: medium
18
+ enabled: true
19
  description: Detect gas optimization opportunities in Solidity contracts.
20
  max_steps: 1
21
+ grader: "graders:grade_action"
22
+ graders:
23
+ - "graders:grade_action"
24
  - id: task_3_security
25
+ name: Security Vulnerability Audit
26
  difficulty: hard
27
+ enabled: true
28
  description: Detect security vulnerabilities in Solidity contracts.
29
  max_steps: 1
30
+ grader: "graders:grade_action"
31
+ graders:
32
+ - "graders:grade_action"
33
  schemas:
34
  observation:
35
  type: object