md896 commited on
Commit
25c431b
Β·
1 Parent(s): 7dd64a8

Polish README for final submission presentation.

Browse files

Add a professional badge header, architecture diagram, and explicit project structure to make evaluation and navigation easier while keeping stack usage transparent.

Files changed (1) hide show
  1. README.md +65 -3
README.md CHANGED
@@ -9,15 +9,34 @@ pinned: false
9
 
10
  # SQL Debug Environment (`sql-debug-env`)
11
 
 
 
12
  ![Python](https://img.shields.io/badge/Python-3.11+-3776AB?logo=python&logoColor=white)
13
  ![FastAPI](https://img.shields.io/badge/FastAPI-0.115-009688?logo=fastapi&logoColor=white)
14
  ![Pydantic](https://img.shields.io/badge/Pydantic-v2-E92063?logo=pydantic&logoColor=white)
15
- ![SQLite](https://img.shields.io/badge/SQLite-In_Memory-003B57?logo=sqlite&logoColor=white)
16
- ![Docker](https://img.shields.io/badge/Docker-Ready-2496ED?logo=docker&logoColor=white)
17
- ![OpenEnv](https://img.shields.io/badge/OpenEnv-Validated-2ea44f)
 
 
 
 
 
 
 
 
 
 
 
18
 
19
  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.
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
+ ![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
  - 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
  |---|---|---|