Fix session resume and PSD container configuration
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
import typer
|
||||
@@ -7,7 +8,10 @@ from tht.config import ConfigError, load_config
|
||||
config_app = typer.Typer(help="Gestione configurazione")
|
||||
|
||||
CONFIG_OPT = typer.Option(
|
||||
Path("config/tht.yaml"), "--config", "-c", help="Percorso del file di configurazione."
|
||||
Path(os.environ.get("THT_CONFIG", "config/tht.yaml")),
|
||||
"--config",
|
||||
"-c",
|
||||
help="Percorso del file di configurazione.",
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -183,6 +183,28 @@ def advance_problems(source: Path | SessionSnapshot, phase: int) -> list[str]:
|
||||
l'evaluator generico (F2 pieno) entra in un secondo momento.
|
||||
"""
|
||||
problems: list[str] = []
|
||||
if phase == 4:
|
||||
raw = _artifact(source, "schema_linking", "schema_linking.json")
|
||||
if raw is None:
|
||||
problems.append("schema_linking.json assente (Fase 4)")
|
||||
else:
|
||||
try:
|
||||
linking = SchemaLinking.model_validate(json.loads(raw))
|
||||
except (json.JSONDecodeError, ValidationError) as e:
|
||||
problems.append(f"schema_linking.json non valido (Fase 4): {e}")
|
||||
else:
|
||||
promoted_tables = {
|
||||
candidate.name
|
||||
for candidate in linking.candidates
|
||||
if candidate.kind == "table" and candidate.decision == "promoted"
|
||||
}
|
||||
if len(promoted_tables) > 1 and (
|
||||
not linking.joins or not _has_decision(source, "join_modified")
|
||||
):
|
||||
problems.append(
|
||||
"Fase 4: più tabelle promosse richiedono join strutturati in "
|
||||
"schema_linking.json e una decisione join_modified del reviewer"
|
||||
)
|
||||
if phase == 3 and not _has_decision(source, "question_rewritten"):
|
||||
problems.append("manca la decisione question_rewritten (Fase 3)")
|
||||
if phase == 5:
|
||||
|
||||
Reference in New Issue
Block a user