Spaces:
Running
Running
Polish README for final submission presentation.
Browse filesAdd a professional badge header, architecture diagram, and explicit project structure to make evaluation and navigation easier while keeping stack usage transparent.
README.md
CHANGED
|
@@ -9,15 +9,34 @@ pinned: false
|
|
| 9 |
|
| 10 |
# SQL Debug Environment (`sql-debug-env`)
|
| 11 |
|
|
|
|
|
|
|
| 12 |

|
| 13 |

|
| 14 |

|
| 15 |
-
 SQLite database, and a description of the expected output. It can inspect schema/errors/samples and submit fixed queries until it solves the task.
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
## Whatβs in this repo
|
| 22 |
- **FastAPI server**: `server/main.py` (endpoints: `/health`, `/tasks`, `/reset`, `/step`, `/state`)
|
| 23 |
- **Environment logic**: `server/env.py` + `server/database.py`
|
|
@@ -40,6 +59,20 @@ An OpenEnv environment for a real task people do every day: **debugging SQL**. T
|
|
| 40 |
- Docker-first deployment path (local and Hugging Face Spaces)
|
| 41 |
- Local benchmark endpoint for live latency checks (`/benchmark`)
|
| 42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
## API Docs (FastAPI Auto Docs)
|
| 44 |
Use these for interactive testing in browser:
|
| 45 |
|
|
@@ -47,6 +80,35 @@ Use these for interactive testing in browser:
|
|
| 47 |
- ReDoc: `http://localhost:7860/redoc`
|
| 48 |
- OpenAPI spec: `http://localhost:7860/openapi.json`
|
| 49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
## Action Space
|
| 51 |
| Action | Required fields | Cost / reward effect |
|
| 52 |
|---|---|---|
|
|
|
|
| 9 |
|
| 10 |
# SQL Debug Environment (`sql-debug-env`)
|
| 11 |
|
| 12 |
+

|
| 13 |
+

|
| 14 |

|
| 15 |

|
| 16 |

|
| 17 |
+

|
| 18 |
+

|
| 19 |
+

|
| 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 |
- 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 |
- 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 |
|---|---|---|
|