File size: 2,198 Bytes
5716a3a
 
 
 
 
 
e5d6640
5716a3a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1a1713a
5716a3a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a24bc4f
5716a3a
 
 
 
 
a24bc4f
5716a3a
 
 
 
 
a24bc4f
5716a3a
 
 
 
0a9f157
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: sql-correction-env
version: "1.0.0"
description: >
  An OpenEnv RL environment where an AI agent fixes broken SQL queries.
  Simulates a real developer task: identifying and correcting SQL syntax
  and logical errors across easy, medium, and hard difficulty levels.
author: SyncShift
tags:
  - openenv
  - sql
  - code-correction
  - real-world

observation_space:
  type: object
  fields:
    task_id:
      type: string
      description: Unique identifier for the current task
    broken_query:
      type: string
      description: The malformed SQL query the agent must fix
    schema_context:
      type: string
      nullable: true
      description: Table and column definitions when a task includes schema context
    error_hint:
      type: string
      nullable: true
      description: A hint describing the type of error (provided on easy tasks only)
    step_number:
      type: integer
      description: Current step index within the episode
    previous_attempt:
      type: string
      nullable: true
      description: The agent's last submitted corrected query
    feedback:
      type: string
      nullable: true
      description: Grader feedback from the previous step

action_space:
  type: object
  fields:
    corrected_query:
      type: string
      description: The agent's corrected SQL query

reward:
  range: [0.0, 1.0]
  description: >
    1.0 = exact match, 0.7 = right tokens minor structure diff,
    0.4 = most keywords correct, 0.2 = basic structure present, 0.0 = invalid SQL.
    Stagnation penalty of 0.1 applied after 2 consecutive identical rewards.

tasks:
  - name: easy
    difficulty: easy
    max_steps: 5
    description: Fix a single syntax error. Error hint provided.
    grader: sql_env.grader.grade

  - name: medium
    difficulty: medium
    max_steps: 5
    description: Fix multiple errors across keywords and clauses. No hint.
    grader: sql_env.grader.grade

  - name: hard
    difficulty: hard
    max_steps: 4
    description: Fix many errors in complex multi-join queries. Schema provided. No hint.
    grader: sql_env.grader.grade

endpoints:
  reset: POST /reset
  step:  POST /step
  state: GET /state
  health: GET /health