fix(f4): harden schema-columns enrichment + ValidationError guard + staged-helper note
This commit is contained in:
@@ -147,11 +147,17 @@ def sync_schema_linking_cmd(
|
||||
config: Path = CONFIG_OPT,
|
||||
) -> None:
|
||||
"""Riproietta schema_linking.json dalle decisioni F4 del ledger (deterministico)."""
|
||||
from pydantic import ValidationError
|
||||
|
||||
from tht.session.store import sync_schema_linking
|
||||
|
||||
cfg = _load_config_or_exit(config)
|
||||
load_session_or_exit(cfg, session_id)
|
||||
path = sync_schema_linking(session_id, cfg.paths.sessions)
|
||||
try:
|
||||
path = sync_schema_linking(session_id, cfg.paths.sessions)
|
||||
except ValidationError as e:
|
||||
typer.secho(f"ERRORE: schema_linking non valido:\n{e}", fg=typer.colors.RED, err=True)
|
||||
raise typer.Exit(code=5)
|
||||
typer.secho(f"OK: schema_linking.json riproiettato ({path}).", fg=typer.colors.GREEN)
|
||||
|
||||
|
||||
|
||||
@@ -54,6 +54,8 @@ def promoted_tables_for(cfg, session_id: str | None) -> set[str] | None:
|
||||
}
|
||||
|
||||
|
||||
# Staged for a future SQL-projection consumer; hard column enforcement is a
|
||||
# documented non-goal (Option-1 soft) — not yet wired into validate_or_exit.
|
||||
def promoted_columns_for(cfg, session_id: str | None) -> set[str] | None:
|
||||
if session_id is None:
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user