refactor(harness): renaming prodotto tht (Onda -1)

Thoth (tht) è il prodotto, PSD è il cliente. Nessun riferimento al contesto
clinico nel codice.

Rinomine:
- comando+package nsp→tht (dir nsp/→tht/, 46 import, pyproject entry point)
- gate nsp-gate.js→tht-gate.js (+ rewrite token, relayIfNspFails→relayIfThtFails)
- workspace chirone.{example,test}.yaml→tht.{example,test}.yaml (generici)
- env THOTH_→THT_ (19 var) + NSP_ stragglers (NSP_HARNESS_ROOT, NSP_SESSION)
- commenti/docstring chirone/psdwp3/policlinico neutralizzati ('the reference
  implementation', 'the DWH')

Aggiunto [tool.setuptools.packages.find] include=['tht*'] (necessario: l'auto-
discovery rompeva con tht/ + workspaces/ come top-level multipli).

.env operatore aggiornato in-place (prefissi THT_, valori preservati, gitignored).

Verifica: pytest 109 passed, npm test 14 pass, tht phase meta --json OK, zero
residui nsp/THOTH_/NSP_/chirone nel package.
This commit is contained in:
2026-06-27 10:33:16 +02:00
parent 0dcc0246dc
commit fc5fbe6b65
72 changed files with 309 additions and 306 deletions
+14 -14
View File
@@ -1,8 +1,8 @@
# ThothII harness — `nsp`
# ThothII harness — `tht`
The self-contained Pi layer of ThothII: a deterministic Python CLI (`nsp`) + a Pi gate
extension (`.pi/extensions/nsp-gate.js`) that runs the 8-phase NL→SQL workflow,
emitting and consuming widget-descriptor JSON. Derived from ChironeWp3 as a validated
The self-contained Pi layer of ThothII: a deterministic Python CLI (`tht`) + a Pi gate
extension (`.pi/extensions/tht-gate.js`) that runs the 8-phase NL→SQL workflow,
emitting and consuming widget-descriptor JSON. Derived from the reference implementation as a validated
starting point, **adapted** (not assumed reliable) to the ThothII contract.
## Install
@@ -13,7 +13,7 @@ python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
```
The `nsp` command is now on PATH. Node ≥ 20 is needed for the gate JS tests
The `tht` command is now on PATH. Node ≥ 20 is needed for the gate JS tests
(`npm test`).
## Configure
@@ -22,8 +22,8 @@ The `nsp` command is now on PATH. Node ≥ 20 is needed for the gate JS tests
```bash
cp .env.example .env
# fill in: THOTH_PROFILE, THOTH_DB_*, THOTH_DWH_API_KEY, THOTH_VEC_API_KEY,
# THOTH_VEC_WRITE_API_KEY, THOTH_SSL_CA, THOTH_OLLAMA_URL, ...
# fill in: THT_PROFILE, THT_DB_*, THT_DWH_API_KEY, THT_VEC_API_KEY,
# THT_VEC_WRITE_API_KEY, THT_SSL_CA, THT_OLLAMA_URL, ...
```
Keys are never logged; URLs are fine. Rotate any key that appeared in chat.
@@ -31,7 +31,7 @@ Keys are never logged; URLs are fine. Rotate any key that appeared in chat.
### `workspaces/<name>.yaml`
A workspace wires the relational DWH + the pgvector (dual-key) + embeddings + evidence.
See `workspaces/chirone.example.yaml`. `${THOTH_*}` tokens expand from `.env`.
See `workspaces/tht.example.yaml`. `${THT_*}}` tokens expand from `.env`.
## The workflow
@@ -40,8 +40,8 @@ See `workspaces/chirone.example.yaml`. `${THOTH_*}` tokens expand from `.env`.
and the skill all read from it — no mirrored constants to drift.
```bash
nsp phase meta --json # the gate reads workflow facts from here
nsp phase meta # human-readable
tht phase meta --json # the gate reads workflow facts from here
tht phase meta # human-readable
```
## Run
@@ -53,8 +53,8 @@ pi --mode rpc
# in Pi: /nuova-domanda "<your question in natural language>"
```
The gate (`nsp-gate.js`) presents reviewer widgets (widget-descriptor), the reviewer
decides, and `nsp` persists decisions to the append-only ledger (`review_decisions.jsonl`).
The gate (`tht-gate.js`) presents reviewer widgets (widget-descriptor), the reviewer
decides, and `tht` persists decisions to the append-only ledger (`review_decisions.jsonl`).
See `docs/testing.md` for what each interaction level validates.
## Test
@@ -72,9 +72,9 @@ level covers and — crucially — does **not** cover.
## Layout
```
nsp/ Python package (CLI + workflow + phase + decisions + db/rest/mschema/
tht/ Python package (CLI + workflow + phase + decisions + db/rest/mschema/
vectorstore/evidence/search/session + memory)
.pi/ Pi project (settings, prompts, themes, extensions/nsp-gate.js + gate/)
.pi/ Pi project (settings, prompts, themes, extensions/tht-gate.js + gate/)
workflow.yaml single source of workflow truth (F2)
workspaces/ workspace YAML definitions (D3)
scripts/ reader/writer RPC SQL for pgvector (D11)