fix: realign workflow advance semantics and phase labels with workflow.yaml

Audit findings 2.1 + 2.2 (high).

2.1 WorkflowBar's static phase list was fiction from F2 on (F2 "Schema
linking" vs memoria, F4 "SQL plan" vs schema_linking, …): every live
session showed the wrong phase name. Both maps now mirror
harness/workflow.yaml (F1 chiarimento … F8 datamart).

2.2 forceAdvance (6ee5bda) let reviewer_decide advance:true bypass the
phase gate on ANY phase, contradicting SKILL.md's "auto-advance only
empty F2 / skipped F6". reviewer_decide is back on advanceIfReady (exit-6
no-op) and tells the model to close via reviewer_confirm; forceAdvance
stays only where selection IS the approval by design: reviewer_schema_linking
(F4) and the F8 promotion close path. SKILL.md now names the three
self-closing gates (F3 rewrite_question, F4 schema-linking advance:true,
F8 memory_promote) so gate and skill state one contract.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-20 01:28:18 +02:00
co-authored by Claude Fable 5
parent 075883370e
commit 3e072fe652
3 changed files with 39 additions and 26 deletions
+18 -15
View File
@@ -2,15 +2,18 @@
import { useSessionStore } from "../store/sessionStore";
import { ElapsedTimer } from "./ElapsedTimer";
// Mirror of harness/workflow.yaml phase ids/names (F1 chiarimento … F8 datamart).
// Keep the two lists in lockstep: the harness is the single source of phase truth,
// and a drifted label here mislabels every live session from that phase on.
const PHASES = [
{ id: "F1", name: "Disambiguation" },
{ id: "F2", name: "Schema linking" },
{ id: "F3", name: "Exploration" },
{ id: "F4", name: "SQL plan" },
{ id: "F5", name: "SQL generation" },
{ id: "F6", name: "Validation" },
{ id: "F7", name: "Review" },
{ id: "F8", name: "Results" },
{ id: "F1", name: "Clarification" },
{ id: "F2", name: "Memory" },
{ id: "F3", name: "Rewrite" },
{ id: "F4", name: "Schema linking" },
{ id: "F5", name: "Plan" },
{ id: "F6", name: "CTE build" },
{ id: "F7", name: "Final SQL" },
{ id: "F8", name: "Datamart" },
];
// Synthetic, human-readable title for the current phase, shown under the dots.
@@ -19,13 +22,13 @@ const PHASES = [
const PHASE_LANG: "en" | "it" = "en";
const PHASE_TITLES: Record<string, { en: string; it: string }> = {
F1: { en: "Clarifying the question", it: "Chiarimento della domanda" },
F2: { en: "Linking the schema", it: "Collegamento dello schema" },
F3: { en: "Exploring the data", it: "Esplorazione dei dati" },
F4: { en: "Planning the SQL", it: "Pianificazione della query" },
F5: { en: "Generating the SQL", it: "Generazione della query" },
F6: { en: "Validating the results", it: "Validazione dei risultati" },
F7: { en: "Reviewing with you", it: "Revisione con te" },
F8: { en: "Presenting results", it: "Presentazione dei risultati" },
F2: { en: "Recalling relevant memory", it: "Recupero delle memorie utili" },
F3: { en: "Rewriting the question", it: "Riscrittura della domanda" },
F4: { en: "Linking the schema", it: "Collegamento dello schema" },
F5: { en: "Planning the SQL", it: "Pianificazione della query" },
F6: { en: "Building the CTEs", it: "Costruzione delle CTE" },
F7: { en: "Finalizing the SQL", it: "Finalizzazione della query" },
F8: { en: "Building the datamart", it: "Costruzione del datamart" },
};
type DotState = "done" | "running" | "error" | "pending";