feat(harness): tht session documents --json read command
This commit is contained in:
@@ -218,6 +218,25 @@ def delete_cmd(session_id: str = typer.Argument(...), config: Path = CONFIG_OPT)
|
||||
typer.secho(f"OK: sessione {session_id} eliminata.", fg=typer.colors.GREEN)
|
||||
|
||||
|
||||
@session_app.command("documents")
|
||||
def documents_cmd(
|
||||
session_id: str = typer.Argument(...),
|
||||
json_out: bool = typer.Option(False, "--json", help="Emetti JSON su stdout (pristine)."),
|
||||
config: Path = CONFIG_OPT,
|
||||
) -> None:
|
||||
"""Documenti di sola lettura della sessione (domanda, rivista, schema, SQL, report, decisioni)."""
|
||||
from tht.session.store import build_documents
|
||||
|
||||
cfg = _load_config_or_exit(config)
|
||||
manifest = load_session_or_exit(cfg, session_id)
|
||||
docs = build_documents(manifest, session_dir(cfg, session_id))
|
||||
if json_out:
|
||||
typer.echo(json.dumps(docs, ensure_ascii=False, indent=2))
|
||||
return
|
||||
for d in docs:
|
||||
typer.echo(f"[{d['phase']}] {d['title']} ({d['format']})")
|
||||
|
||||
|
||||
def session_problems(cfg, session_id: str) -> list[str]:
|
||||
"""Problemi del Blocco 3 (decisioni + schema_linking). Riusato da check e finalize."""
|
||||
import json
|
||||
|
||||
Reference in New Issue
Block a user