test(harness): report L2 cardioversione+ablazione + fix phase show (#2)

Prima sessione L2 end-to-end dopo il porting. Il loop skill->LLM->gate funziona nel
dominio (ricerche, evidence, quadro corretto su fact_cardioversione/fact_see_ablazione)
ma si blocca a F1 sul bug fatale #4 (ctx.sendRaw non esiste nel runtime Pi).

Bug emersi (4):
  #1 tht non nel PATH di Pi (basso, workaround wrapper)
  #2 phase show non passava config (medio, FIXATO: _cfg() risolve env+default)
  #3 session check signature inconsistente (basso, da verificare)
  #4 ctx.sendRaw is not a function (FATALE, mismatch architetturale: il porting ha
     sostituito i dialog nativi ctx.ui.* con ctx.sendRaw, API non esposta in questo Pi)

Analisi #4 (verificata sul runtime installato):
  - ctx.sendRaw non esiste; extension_ui_request e' emesso solo dal runtime
    (modes/rpc) come traduzione di ctx.ui.select/confirm/input, non come API extension
  - canali RPC per decisioni: enum chiuso select/confirm/input/editor (no custom)
  - ctx.ui.custom (multiselect TUI di ChironeWp3) e' no-op in RPC mode
  - conseguenza: multiselect F4 non ha canale in RPC -> decisione di design del gate
    aperta (opzioni A/B/C nel report, C=scartato), merita brainstorming dedicato

Fix #2 (dal modello in sessione, validato e ripulito): phase_cmd._cfg() ora risolve
THT_WORKSPACE/THT_CONFIG env poi fallback config/tht.yaml (stessa convenzione CONFIG_OPT).
Testato phase show OK, suite 165 passed.

Report: docs/l2-run-report-2026-06-27.md.
This commit is contained in:
2026-06-27 16:14:46 +02:00
parent 386ec3b833
commit daf33f77fe
2 changed files with 136 additions and 13 deletions
+10 -13
View File
@@ -146,22 +146,19 @@ def show_cmd(
def _cfg():
"""Load the workspace config. Tries the shared helper once schema_cmd is ported
(Onda 1.4); falls back to THT_WORKSPACE env + load_config for now."""
"""Load the workspace config. Resolves THT_WORKSPACE/THT_CONFIG first, then
falls back to the CLI default ``config/tht.yaml`` (same convention as
schema_cmd.CONFIG_OPT)."""
import os
from pathlib import Path
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)
return _load_config_or_exit()
return _load_config_or_exit(config_path)
except ImportError:
import os
from tht.workspace import load_config
ws = os.environ.get("THT_WORKSPACE") or os.environ.get("THT_CONFIG")
if not ws:
typer.secho(
"Nessun workspace: imposta THT_WORKSPACE o usa --config.",
fg=typer.colors.RED, err=True,
)
raise typer.Exit(2)
return load_config(ws)
return load_config(config_path)