refactor(harness): route workflow persistence through repositories

This commit is contained in:
User
2026-07-16 18:01:29 +02:00
parent 259f021313
commit c1cddaa667
30 changed files with 925 additions and 348 deletions
+5 -2
View File
@@ -353,7 +353,9 @@ Prerequisite: Phase 5 closed.
"output_columns":["cod_paz","data_ricovero"]}
]}
```
3. For each CTE (in plan order): write `sessions/<id>/ctes/<name>.sql` (ONLY the
3. For each CTE (in plan order): call `write_cte_sql` with the session id, CTE name,
and SQL block (the tool invokes `tht cte save --session <id> --name <name> --file -`).
Persist ONLY the
`WITH ... AS (...)` block, NO trailing SELECT), test with `tht cte test --session
<id> <name>` (with an **ok** outcome), then present it with
`reviewer_confirm kind:"cte_result"`. Pass ONLY the thin v2 data
@@ -385,7 +387,8 @@ Prerequisite: Phase 6 closed.
columns (`dt.year`, `dt.month`, …), NEVER arithmetic on the key.
3. `tht sql validate` + `tht sql preview` (max 10 rows). On errors / suspicious
results, apply the `sql-generation.md` checklist and correct with the reviewer.
4. `tht sql save` writes `sessions/<id>/sql_final.sql` (ONLY clean SQL, no comments).
4. Call `write_final_sql` with the session id and clean SQL; it invokes
`tht sql set-final --session <id> --file -` (ONLY clean SQL, no comments).
Approve with `reviewer_confirm kind:"sql"` (records `sql_approved`), then advance to
Phase 8 with `reviewer_confirm kind:"phase"` — `kind:"sql"` alone does NOT advance F7.