Spaces:
Sleeping
Sleeping
github-actions[bot]
commited on
Commit
·
5098767
1
Parent(s):
29e8fa4
Sync from GitHub main @ b2c3db43f778c7feaaf7d149697958f5cc69ef21
Browse files- README.md +8 -5
- nl2sql/pipeline.py +0 -20
README.md
CHANGED
|
@@ -13,17 +13,17 @@ pinned: false
|
|
| 13 |
[](docs/runbook.md)
|
| 14 |
[](LICENSE)
|
| 15 |
|
| 16 |
-
|
| 17 |
-
**
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
| 21 |
|
| 22 |
---
|
| 23 |
|
| 24 |
## At a glance
|
| 25 |
|
| 26 |
-
* **
|
| 27 |
* **Safety-first execution** enforced at the system level (single-statement, SELECT-only)
|
| 28 |
* **Failure-aware design** with verifier-driven repair and a structured error taxonomy
|
| 29 |
* **Built-in evaluation**: lightweight smoke runs and Spider-based benchmarks with artifacts
|
|
@@ -68,6 +68,7 @@ A live interactive demo is available on Hugging Face Spaces:
|
|
| 68 |
> This is a minimal end-to-end demo of the deployed system.
|
| 69 |
> Detailed UI inspection views (trace, repair, timings) are documented in
|
| 70 |
> [docs/ui.md](docs/ui.md).
|
|
|
|
| 71 |
---
|
| 72 |
|
| 73 |
## Quickstart (Local)
|
|
@@ -158,6 +159,8 @@ Detector
|
|
| 158 |
→ Repair (bounded)
|
| 159 |
```
|
| 160 |
|
|
|
|
|
|
|
| 161 |
The pipeline is designed so that **failures are explicit, classified, and observable** —
|
| 162 |
not hidden behind retries or prompt heuristics.
|
| 163 |
|
|
|
|
| 13 |
[](docs/runbook.md)
|
| 14 |
[](LICENSE)
|
| 15 |
|
| 16 |
+
**NL2SQL Copilot** is a **safety-first NL→SQL backend system** built as a **multi-stage, testable pipeline**.
|
| 17 |
+
It treats LLM outputs as **proposals** and enforces execution safety via **verification, bounded repair, evaluation, and observability**.
|
| 18 |
|
| 19 |
+
The system is designed to operate LLMs as **untrusted components** inside a constrained, measurable backend —
|
| 20 |
+
with explicit guarantees around what can be generated, executed, and returned.
|
| 21 |
|
| 22 |
---
|
| 23 |
|
| 24 |
## At a glance
|
| 25 |
|
| 26 |
+
* **Multi-stage NL2SQL pipeline** with explicit planning, verification, and a bounded repair loop
|
| 27 |
* **Safety-first execution** enforced at the system level (single-statement, SELECT-only)
|
| 28 |
* **Failure-aware design** with verifier-driven repair and a structured error taxonomy
|
| 29 |
* **Built-in evaluation**: lightweight smoke runs and Spider-based benchmarks with artifacts
|
|
|
|
| 68 |
> This is a minimal end-to-end demo of the deployed system.
|
| 69 |
> Detailed UI inspection views (trace, repair, timings) are documented in
|
| 70 |
> [docs/ui.md](docs/ui.md).
|
| 71 |
+
|
| 72 |
---
|
| 73 |
|
| 74 |
## Quickstart (Local)
|
|
|
|
| 159 |
→ Repair (bounded)
|
| 160 |
```
|
| 161 |
|
| 162 |
+
>**LLM outputs are treated as proposals; the system decides what is safe to execute.**
|
| 163 |
+
|
| 164 |
The pipeline is designed so that **failures are explicit, classified, and observable** —
|
| 165 |
not hidden behind retries or prompt heuristics.
|
| 166 |
|
nl2sql/pipeline.py
CHANGED
|
@@ -391,26 +391,6 @@ class Pipeline:
|
|
| 391 |
details: List[str] = []
|
| 392 |
exec_result: Dict[str, Any] = {}
|
| 393 |
|
| 394 |
-
def _tag_last_trace_attempt(stage_name: str, attempt: int) -> None:
|
| 395 |
-
# Attach attempt metadata to the most recent trace entry for this stage.
|
| 396 |
-
for t in reversed(traces):
|
| 397 |
-
if t.get("stage") == stage_name:
|
| 398 |
-
notes = t.get("notes") or {}
|
| 399 |
-
if not isinstance(notes, dict):
|
| 400 |
-
notes = {}
|
| 401 |
-
notes["attempt"] = attempt
|
| 402 |
-
t["notes"] = notes
|
| 403 |
-
return
|
| 404 |
-
|
| 405 |
-
def _fallback_trace(stage_name: str, dt_ms: float, ok: bool) -> None:
|
| 406 |
-
traces.append(
|
| 407 |
-
self._mk_trace(
|
| 408 |
-
stage=stage_name,
|
| 409 |
-
duration_ms=dt_ms,
|
| 410 |
-
summary=("ok" if ok else "failed"),
|
| 411 |
-
)
|
| 412 |
-
)
|
| 413 |
-
|
| 414 |
schema_preview = schema_preview or ""
|
| 415 |
clarify_answers = clarify_answers or {}
|
| 416 |
|
|
|
|
| 391 |
details: List[str] = []
|
| 392 |
exec_result: Dict[str, Any] = {}
|
| 393 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 394 |
schema_preview = schema_preview or ""
|
| 395 |
clarify_answers = clarify_answers or {}
|
| 396 |
|