Chiusura fase di ristrutturazione e modularizzazione del workflow per favorire sviluppo modulare

This commit is contained in:
2026-08-24 13:32:20 +02:00
parent fa2298653b
commit 6062cb010e
96 changed files with 304 additions and 259 deletions
+7 -8
View File
@@ -12,8 +12,8 @@ import json
import typer
from tht.phase import (
auto_advance_eligible,
advance_problems,
auto_advance_eligible,
current_phase,
)
from tht.workflow import load_workflow
@@ -93,12 +93,11 @@ def advance_cmd(
if cur > wf.max_phase:
typer.secho("Sessione già alla fase terminale.", fg=typer.colors.YELLOW)
raise typer.Exit(0)
if auto:
if not auto_advance_eligible(snapshot):
problems = advance_problems(snapshot, cur)
for p in problems:
typer.echo(p)
raise typer.Exit(6) # needs human confirmation (gate contract)
if auto and not auto_advance_eligible(snapshot):
problems = advance_problems(snapshot, cur)
for p in problems:
typer.echo(p)
raise typer.Exit(6) # needs human confirmation (gate contract)
session_repository(cfg).append_decisions(
session, [{"type": "phase_approved", "subject": f"phase:{cur}"}]
)
@@ -164,7 +163,7 @@ def _cfg():
ws = os.environ.get("THT_WORKSPACE") or os.environ.get("THT_CONFIG")
config_path = Path(ws) if ws else Path("config/tht.yaml")
try:
from tht.cli.schema_cmd import _load_config_or_exit # noqa: F401 (portato in Onda 1.4)
from tht.cli.schema_cmd import _load_config_or_exit
return _load_config_or_exit(config_path)
except ImportError: