md896 commited on
Commit
8ae4239
Β·
1 Parent(s): 25c431b

Initial OpenEnv SQL debug environment

Browse files
Files changed (1) hide show
  1. README.md +3 -74
README.md CHANGED
@@ -1,42 +1,14 @@
1
- ---
2
- title: sql-debug-env
3
- emoji: "πŸ§ͺ"
4
- colorFrom: blue
5
- colorTo: green
6
- sdk: docker
7
- pinned: false
8
- ---
9
-
10
  # SQL Debug Environment (`sql-debug-env`)
11
 
12
- ![OpenEnv](https://img.shields.io/badge/OpenEnv-Validated-2ea44f)
13
- ![Docker](https://img.shields.io/badge/Deploy-Docker-2496ED?logo=docker&logoColor=white)
14
  ![Python](https://img.shields.io/badge/Python-3.11+-3776AB?logo=python&logoColor=white)
15
  ![FastAPI](https://img.shields.io/badge/FastAPI-0.115-009688?logo=fastapi&logoColor=white)
16
  ![Pydantic](https://img.shields.io/badge/Pydantic-v2-E92063?logo=pydantic&logoColor=white)
17
- ![SQLite](https://img.shields.io/badge/SQLite-In--Memory-003B57?logo=sqlite&logoColor=white)
18
- ![Uvicorn](https://img.shields.io/badge/Uvicorn-ASGI-111111)
19
- ![OpenAI](https://img.shields.io/badge/OpenAI-Baseline_API-412991?logo=openai&logoColor=white)
20
-
21
- <p align="left">
22
- <img alt="React (not used in this backend repo)" src="https://img.shields.io/badge/React-UI_optional-61DAFB?logo=react&logoColor=111111">
23
- <img alt="Vite (not used in this backend repo)" src="https://img.shields.io/badge/Vite-UI_optional-646CFF?logo=vite&logoColor=white">
24
- <img alt="Node.js (not used in this backend repo)" src="https://img.shields.io/badge/Node.js-UI_optional-339933?logo=nodedotjs&logoColor=white">
25
- <img alt="Express (not used in this backend repo)" src="https://img.shields.io/badge/Express-UI_optional-000000?logo=express&logoColor=white">
26
- <img alt="PostgreSQL (not used in this backend repo)" src="https://img.shields.io/badge/PostgreSQL-Not_used-4169E1?logo=postgresql&logoColor=white">
27
- <img alt="MongoDB (not used in this backend repo)" src="https://img.shields.io/badge/MongoDB-Not_used-47A248?logo=mongodb&logoColor=white">
28
- <img alt="Tailwind CSS (not used in this backend repo)" src="https://img.shields.io/badge/Tailwind-UI_optional-06B6D4?logo=tailwindcss&logoColor=white">
29
- <img alt="Axios (not used in this backend repo)" src="https://img.shields.io/badge/Axios-UI_optional-5A29E4?logo=axios&logoColor=white">
30
- </p>
31
 
32
  An OpenEnv environment for a real task people do every day: **debugging SQL**. The agent gets a broken query, a live (in-memory) SQLite database, and a description of the expected output. It can inspect schema/errors/samples and submit fixed queries until it solves the task.
33
 
34
- ## Why this project matters
35
- - SQL debugging is a real operational task across analytics and backend teams.
36
- - The environment is deterministic, fast, and local-first for reliable evaluation.
37
- - Reward shaping gives useful partial progress signals instead of only pass/fail.
38
- - The benchmark endpoint provides live runtime evidence for reviewers.
39
-
40
  ## What’s in this repo
41
  - **FastAPI server**: `server/main.py` (endpoints: `/health`, `/tasks`, `/reset`, `/step`, `/state`)
42
  - **Environment logic**: `server/env.py` + `server/database.py`
@@ -59,20 +31,6 @@ An OpenEnv environment for a real task people do every day: **debugging SQL**. T
59
  - Docker-first deployment path (local and Hugging Face Spaces)
60
  - Local benchmark endpoint for live latency checks (`/benchmark`)
61
 
62
- ## Architecture
63
- ```mermaid
64
- flowchart LR
65
- Client[Client Agent or Evaluator] --> API[FastAPI Server]
66
- API --> Env[SQLDebugEnv]
67
- Env --> DB[InMemory SQLite Episode DB]
68
- Env --> Tasks[Task Set easy medium hard]
69
- Env --> Reward[Reward Engine]
70
- Tasks --> Grader[Deterministic Graders]
71
- Grader --> Reward
72
- Reward --> API
73
- API --> Client
74
- ```
75
-
76
  ## API Docs (FastAPI Auto Docs)
77
  Use these for interactive testing in browser:
78
 
@@ -80,35 +38,6 @@ Use these for interactive testing in browser:
80
  - ReDoc: `http://localhost:7860/redoc`
81
  - OpenAPI spec: `http://localhost:7860/openapi.json`
82
 
83
- ## Project Structure
84
- ```text
85
- sql-debug-env/
86
- β”œβ”€β”€ Dockerfile
87
- β”œβ”€β”€ openenv.yaml
88
- β”œβ”€β”€ inference.py
89
- β”œβ”€β”€ README.md
90
- β”œβ”€β”€ requirements.txt
91
- β”œβ”€β”€ pyproject.toml
92
- β”œβ”€β”€ uv.lock
93
- β”œβ”€β”€ scripts/
94
- β”‚ └── benchmark_local.py
95
- β”œβ”€β”€ server/
96
- β”‚ β”œβ”€β”€ main.py
97
- β”‚ β”œβ”€β”€ env.py
98
- β”‚ β”œβ”€β”€ models.py
99
- β”‚ β”œβ”€β”€ database.py
100
- β”‚ β”œβ”€β”€ reward.py
101
- β”‚ └── tasks/
102
- β”‚ β”œβ”€β”€ base.py
103
- β”‚ β”œβ”€β”€ task_easy.py
104
- β”‚ β”œβ”€β”€ task_medium.py
105
- β”‚ └── task_hard.py
106
- └── tests/
107
- β”œβ”€β”€ test_env.py
108
- β”œβ”€β”€ test_graders.py
109
- └── test_reward.py
110
- ```
111
-
112
  ## Action Space
113
  | Action | Required fields | Cost / reward effect |
114
  |---|---|---|
 
 
 
 
 
 
 
 
 
 
1
  # SQL Debug Environment (`sql-debug-env`)
2
 
 
 
3
  ![Python](https://img.shields.io/badge/Python-3.11+-3776AB?logo=python&logoColor=white)
4
  ![FastAPI](https://img.shields.io/badge/FastAPI-0.115-009688?logo=fastapi&logoColor=white)
5
  ![Pydantic](https://img.shields.io/badge/Pydantic-v2-E92063?logo=pydantic&logoColor=white)
6
+ ![SQLite](https://img.shields.io/badge/SQLite-In_Memory-003B57?logo=sqlite&logoColor=white)
7
+ ![Docker](https://img.shields.io/badge/Docker-Ready-2496ED?logo=docker&logoColor=white)
8
+ ![OpenEnv](https://img.shields.io/badge/OpenEnv-Validated-2ea44f)
 
 
 
 
 
 
 
 
 
 
 
9
 
10
  An OpenEnv environment for a real task people do every day: **debugging SQL**. The agent gets a broken query, a live (in-memory) SQLite database, and a description of the expected output. It can inspect schema/errors/samples and submit fixed queries until it solves the task.
11
 
 
 
 
 
 
 
12
  ## What’s in this repo
13
  - **FastAPI server**: `server/main.py` (endpoints: `/health`, `/tasks`, `/reset`, `/step`, `/state`)
14
  - **Environment logic**: `server/env.py` + `server/database.py`
 
31
  - Docker-first deployment path (local and Hugging Face Spaces)
32
  - Local benchmark endpoint for live latency checks (`/benchmark`)
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  ## API Docs (FastAPI Auto Docs)
35
  Use these for interactive testing in browser:
36
 
 
38
  - ReDoc: `http://localhost:7860/redoc`
39
  - OpenAPI spec: `http://localhost:7860/openapi.json`
40
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  ## Action Space
42
  | Action | Required fields | Cost / reward effect |
43
  |---|---|---|