File size: 1,444 Bytes
76b843b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
name: sql-debugger-agent
version: "1.0.0"
description: >
  A real-world environment where an AI agent debugs broken SQL queries —
  fixing syntax errors, logic bugs (wrong JOINs, aggregation mistakes,
  subquery scope), performance anti-patterns (N+1 correlated subqueries),
  and SQL injection vulnerabilities. Uses a live in-memory SQLite database
  for 100% deterministic, execution-based grading.

author: NeuroHack
tags:
  - openenv
  - sql
  - debugging
  - optimization
  - security
  - real-world
  - data-engineering

tasks:
  - name: easy
    description: Fix SQL syntax errors  typos in keywords, missing clauses.
    difficulty: easy
    max_steps: 3
    reward_range: [0.0, 1.0]

  - name: medium
    description: Fix logic bugs  wrong JOIN types, incorrect aggregation scope, bad ORDER BY.
    difficulty: medium
    max_steps: 3
    reward_range: [0.0, 1.0]

  - name: hard
    description: >
      Fix + optimize + secure: N+1 correlated subqueries, SQL injection vulnerabilities,
      and missing column aliases. All bugs must be identified and fixed.
    difficulty: hard
    max_steps: 3
    reward_range: [0.0, 1.0]

interface:
  observation: Observation
  action: Action
  reward: Reward
  methods:
    - reset
    - step
    - state

environment:
  python: ">=3.10"
  framework: openenv-core
  database: sqlite3 (in-memory, no external deps)
  api: openai-compatible

hf_space:
  sdk: docker
  tags:
    - openenv