5 cmd foglia portati con rename + drift fix: - memory_cmd: portato col modello registry INTATTO (TODO marker per il drop registry decisione spec 5 — task separato, richiede L2 per validare il rewrite su vectordb) - search_cmd: creata search_app sub-app (era funzione standalone in ChironeWp3), registrata come 'tht search find' - evidence_cmd, db_cmd, decision_cmd: port verbatim Drift fix decision_cmd: DECISION_MIN_PHASE.get(type,1) -> load_workflow().decision_min_phase(type). Check grep-per-file: ~15 residui nsp/PSD_SSL_CA nei messaggi utente fixati (nsp <cmd> -> tht <cmd>, nsp.yaml -> workspace yaml, PSD_SSL_CA -> THT_SSL_CA). Suite: 165 passed. tht --help ora mostra 10 sottocomandi.
60 lines
1.9 KiB
Python
60 lines
1.9 KiB
Python
"""tht CLI -- Typer app `tht`.
|
|
|
|
Minimal skeleton for now: registers `phase_app` (the gate needs `tht phase meta --json`).
|
|
Other command groups (db, schema, lsh, vector, memory, session, decision, sql, cte,
|
|
evidence, search) are wired in their porting tasks, once their backend deps land
|
|
(A9 ports db/mschema/_guards; B1 ports vectorstore; B3 ports search/lshindex/sampling).
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
import typer
|
|
|
|
from tht import __version__
|
|
|
|
app = typer.Typer(
|
|
help="tht (Thoth) -- kit operativo per generazione SQL assistito da Pi",
|
|
no_args_is_help=True,
|
|
)
|
|
|
|
|
|
def _version_callback(value: bool) -> None:
|
|
if value:
|
|
typer.echo(__version__)
|
|
raise typer.Exit()
|
|
|
|
|
|
@app.callback()
|
|
def main(
|
|
version: bool = typer.Option(
|
|
False,
|
|
"--version",
|
|
callback=_version_callback,
|
|
is_eager=True,
|
|
help="Mostra la versione ed esce.",
|
|
),
|
|
) -> None:
|
|
pass
|
|
|
|
|
|
from tht.cli.config_cmd import config_app # noqa: E402
|
|
from tht.cli.db_cmd import db_app # noqa: E402
|
|
from tht.cli.decision_cmd import decision_app # noqa: E402
|
|
from tht.cli.evidence_cmd import evidence_app # noqa: E402
|
|
from tht.cli.memory_cmd import memory_app # noqa: E402
|
|
from tht.cli.phase_cmd import phase_app # noqa: E402
|
|
from tht.cli.schema_cmd import schema_app # noqa: E402
|
|
from tht.cli.search_cmd import search_app # noqa: E402
|
|
from tht.cli.session_cmd import session_app # noqa: E402
|
|
from tht.cli.vector_cmd import vector_app # noqa: E402
|
|
|
|
app.add_typer(phase_app, name="phase")
|
|
app.add_typer(config_app, name="config")
|
|
app.add_typer(schema_app, name="schema")
|
|
app.add_typer(session_app, name="session")
|
|
app.add_typer(vector_app, name="vector")
|
|
app.add_typer(memory_app, name="memory")
|
|
app.add_typer(search_app, name="search")
|
|
app.add_typer(evidence_app, name="evidence")
|
|
app.add_typer(db_app, name="db")
|
|
app.add_typer(decision_app, name="decision")
|