sql-correction-env / openenv.yaml
sravaniamere's picture
B
82a5b1b
Raw
History Blame Contribute Delete
2.04 kB
---
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