From 3dadc6fbb54e63445c56b95855cd482c2026df32 Mon Sep 17 00:00:00 2001 From: mptyl Date: Wed, 1 Jul 2026 19:55:23 +0200 Subject: [PATCH] =?UTF-8?q?docs(skill):=20F7=20is=20two-step=20=E2=80=94?= =?UTF-8?q?=20kind:"sql"=20records,=20kind:"phase"=20advances?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- harness/.pi/skills/tht-sessione/SKILL.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/harness/.pi/skills/tht-sessione/SKILL.md b/harness/.pi/skills/tht-sessione/SKILL.md index 9b60b5fd..29fdb1a7 100644 --- a/harness/.pi/skills/tht-sessione/SKILL.md +++ b/harness/.pi/skills/tht-sessione/SKILL.md @@ -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//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