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