docs(skill): F7 is two-step — kind:"sql" records, kind:"phase" advances

The cheat-sheet, Discipline 2, and Phase 7 said F7 closes with
reviewer_confirm kind:"sql" — but the gate's kind:"sql" only records
sql_approved:phase:7; F7 is not in _AUTO_ADVANCE_PHASES, so advancing to
F8 still needs reviewer_confirm kind:"phase" (mirrors F6). Same
record-vs-advance trap this branch removes elsewhere.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-01 19:55:23 +02:00
co-authored by Claude Opus 4.8
parent 01de6f330f
commit 3dadc6fbb5
+7 -4
View File
@@ -26,7 +26,8 @@ about a domain term, ask the reviewer.
## Phase map (advance cheat-sheet)
A phase advances ONLY when a `phase_approved:phase:N` decision is recorded for the current
phase — written by `reviewer_confirm kind:"phase"` (or `kind:"sql"` for F7). A `reviewer_decide`/
phase — written by `reviewer_confirm kind:"phase"`. (F7 is two-step: `kind:"sql"` records
`sql_approved`, then `kind:"phase"` advances.) A `reviewer_decide`/
`reviewer_select` choice records its OWN decision but does NOT advance the phase. `advance:true`
auto-advances only F2 (empty memory) and F6 (skipped/empty) — never a phase that recorded
substantive decisions.
@@ -39,7 +40,7 @@ substantive decisions.
| F4 schema_linking | `schema_linking.json` | `reviewer_confirm kind:"phase"` (after `write_schema_linking`) |
| F5 sintesi | — | `reviewer_confirm kind:"phase"` (after `tht session check`) |
| F6 cte | `cte_plan.json`, `ctes/`, `cte_tests.json` | approve each CTE `kind:"cte_result"`, then `reviewer_confirm kind:"phase"` |
| F7 sql_finale | `sql_final.sql` | `reviewer_confirm kind:"sql"` |
| F7 sql_finale | `sql_final.sql` | `kind:"sql"` records `sql_approved`, then `reviewer_confirm kind:"phase"` |
| F8 datamart | — | `reviewer_confirm kind:"phase"` |
## Disciplines (hold in every phase)
@@ -51,7 +52,8 @@ substantive decisions.
2. **The choice records; the phase gate advances.** A `reviewer_decide`, or a
`reviewer_select` whose chosen option carries a `decision`, PERSISTS that decision — it
does NOT by itself advance the phase. To move to the next phase you MUST issue
`reviewer_confirm kind:"phase"` (F7 uses `kind:"sql"`), the deliberate "this phase is
`reviewer_confirm kind:"phase"` (for F7, first `kind:"sql"` to record `sql_approved`, then
`kind:"phase"` to advance), the deliberate "this phase is
done" gate. The `advance:true` flag on `reviewer_decide` is a shortcut that auto-advances
ONLY F2 when the memory phase recorded nothing and F6 when it is skipped/empty; everywhere
else it is a silent no-op, so never rely on it to advance. Do NOT add a `reviewer_confirm`
@@ -260,7 +262,8 @@ Prerequisite: Phase 6 closed.
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).
Close with `reviewer_confirm kind:"sql"`.
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.
## Phase 8 — Datamart