Mahathi4554/sql-query-debugging
0
1name: sql-query-debugging2version: "1.0.0"3description: >4 A real-world OpenEnv environment where AI agents learn to debug and optimize5 SQL queries. Simulates genuine data engineering tasks including syntax error6 correction, logic bug fixing, and query performance optimization.7 8tags:9 - openenv10 - sql11 - debugging12 - data-engineering13 - code-repair14 15author: "OpenEnv Hackathon Submission"16license: MIT17 18environment:19 type: text20 language: sql21 backend: sqlite322 23observation_space:24 type: object25 properties:26 task_id: {type: string}27 task_description: {type: string}28 schema_sql: {type: string, description: "Database schema as CREATE TABLE statements"}29 broken_query: {type: string, description: "The SQL query to fix"}30 error_message: {type: string, nullable: true}31 last_result_preview: {type: array, nullable: true, description: "First 5 rows of last result"}32 expected_row_count: {type: integer, nullable: true}33 attempt: {type: integer}34 max_attempts: {type: integer}35 hint: {type: string, nullable: true, description: "Revealed after 2 failed attempts"}36 37action_space:38 type: object39 properties:40 sql_query:41 type: string42 description: "The SQL query submitted as the agent's attempt"43 required: [sql_query]44 45reward:46 range: [0.0, 1.0]47 type: float48 description: >49 Partial reward signal provided at every step.50 Breakdown: syntax(0.1) + execution(0.2) + correctness(0.7) + optimization_bonus(0.3).51 Optimization bonus only applies to task_optimization.52 Small penalty for additional attempts encourages efficiency.53 54tasks:55 - id: task_syntax_fix56 difficulty: easy57 max_attempts: 558 description: "Fix a SQL syntax error (typo in keyword)"59 60 - id: task_logic_bug61 difficulty: medium62 max_attempts: 763 description: "Fix multiple logic bugs: wrong JOIN type, wrong threshold, wrong date comparison"64 65 - id: task_optimization66 difficulty: hard67 max_attempts: 768 description: "Rewrite a correlated subquery to an efficient JOIN+GROUP BY approach"69 70endpoints:71 reset: POST /reset72 step: POST /step73 state: GET /state74 tasks: GET /tasks75 grader: POST /grader76 baseline: GET /baseline77 health: GET /health78 79deployment:80 platform: huggingface-spaces81 sdk: docker82 port: 7860