File size: 2,040 Bytes
830b0e5
 
 
 
 
 
 
 
 
 
 
2112542
5716a3a
830b0e5
 
2194233
830b0e5
 
5716a3a
 
 
 
2194233
830b0e5
e5d6640
830b0e5
 
e965a47
2194233
e965a47
2194233
e965a47
830b0e5
e965a47
830b0e5
e965a47
2194233
e965a47
830b0e5
e965a47
2194233
 
 
e965a47
2194233
e965a47
5716a3a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2194233
 
5716a3a
 
 
 
 
 
 
 
 
 
 
 
 
 
82a5b1b
5716a3a
82a5b1b
2194233
82a5b1b
2194233
e965a47
 
82a5b1b
e965a47
 
 
 
 
 
2194233
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
---
title: SQL Correction RL Environment
emoji: 🛢️
colorFrom: blue
colorTo: indigo
sdk: docker
pinned: false
tags:
  - openenv
---

spec_version: 1
name: sql-correction-env
type: sequential
runtime: docker
app: server:app
port: 7860

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.
  Includes 40 tasks total with partial-credit grading and a stagnation penalty.

author: SyncShift

tasks:
  - id: easy
    description: Fix a single keyword typo. Error hint provided.
    steps: 5
    count: 15
    ideal_action: correct_sql

  - id: medium
    description: Fix multiple errors across keywords and clauses. No hint.
    steps: 5
    count: 15
    ideal_action: correct_sql

  - id: hard
    description: >
      Fix many errors in complex multi-join queries including column name
      mismatches. Schema provided, no hint.
    steps: 4
    count: 10
    ideal_action: correct_sql

observation_space:
  type: object
  fields:
    task_id:
      type: string
    broken_query:
      type: string
    schema_context:
      type: string
      nullable: true
    error_hint:
      type: string
      nullable: true
    step_number:
      type: integer
    steps_remaining:
      type: integer
    previous_attempt:
      type: string
      nullable: true
    feedback:
      type: string
      nullable: true

action_space:
  type: object
  fields:
    corrected_query:
      type: string

reward:
  range: [0.01, 0.99]
  description: >
    0.99 = exact match, 0.7 = right tokens minor structure diff,
    0.4 = most keywords correct, 0.3 = partial match,
    0.2 = basic structure present, 0.01 = invalid SQL.
    Stagnation penalty of -0.1 applied after 2+ identical-reward steps.

scoring:
  reward_range: [0.01, 0.99]
  success_threshold: 0.5
  score_formula: mean(step_rewards)

constraints:
  max_runtime_seconds: 1200
  max_memory_gb: 8
  max_vcpu: 2