From eb83cb8fc132cd151c41e7be4da22704dfd54ef6 Mon Sep 17 00:00:00 2001 From: User Date: Sun, 12 Jul 2026 23:11:20 +0200 Subject: [PATCH] docs(state)+test(l2): deploy state snapshot + configurable L2 workspace path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PROJECT_STATE: sezione deploy Docker live (Profile A embedded portale, ruoli DB, secrets, merge codex, fix load-bearing). L2 test: WORKSPACE da env THT_L2_WORKSPACE (default path Mac) -> può girare ovunque, skip pulito se assente. --- PROJECT_STATE.md | 15 ++++++++++++++- harness/tests/l2/test_value_grounding_real.py | 3 ++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/PROJECT_STATE.md b/PROJECT_STATE.md index 67b0e16c..bba4d150 100644 --- a/PROJECT_STATE.md +++ b/PROJECT_STATE.md @@ -1,8 +1,21 @@ # ThothII — Project State -> Starting-point snapshot for new sessions. Last updated: 2026-07-08 (three efficiency levers deployed). +> Starting-point snapshot for new sessions. Last updated: 2026-07-12 (Docker deploy live + codex portable-deployment merged). > Point a fresh session here ("read PROJECT_STATE.md") before substantial work. +## Deployment — Docker locale (Profile A, co-located) — LIVE 2026-07-12 + +ThothII gira in Docker sul server co-locato, **embedded nel portale omics_portal** a `https://aritmolab.policlinicosandonato.it/datamart-builder` (backend invisibile, tutto same-origin via nginx del portale). + +- **2 container** su `compose.yaml`: `thothii-core` (Fastify + harness tht + Pi) + `thothii-frontend` (Vite + nginx-unprivileged). Rete `omics_portal_omics_network` (external) con alias `thothii-core`/`thothii-frontend`. +- **DB**: Postgres diretto `:5438` (stessa istanza: schema `datawarehouse` 163 tabelle + `vectors` pgvector). Ruoli dedicati `thoth_dwh_reader` (read-only) + `thoth_vector_rw` (read+write). Embeddings: Ollama `:11434`. +- **Secrets**: `deploy/thothii.env` (env_file, gitignored) + `THT_MODEL_API_KEY_FILE` (key modello, file 0600 — meccanismo provider-credentials di Codex) + bind-mount `~/.pi` (pi-config). +- **Backend**: merge di `codex/portable-deployment` (secret-bundle, provider-credentials, auth `upstream`, security hardening, CI multiarch). Setup Docker MIO tenuto (il modello Docker-secrets di Codex è in `deploy/` come alternativa inerte). +- **Portale** (repo `omics_portal`, branch `agent/patient-capabilities-datamart-ui`): `nginx.conf` rotte `/datamart-builder/api`+`/assets` + `auth_request`, template `datamart_builder.html` (mount `
` + tag `{% vite_assets %}`), vista `datamart_builder_api_auth`. Auth: `authentik Admins` bypass; utenti normali necessitano gruppo `omics-datamart-builder`. +- **Fix load-bearing**: `configPath` da `THT_CONFIG` (route senza workspace), `vite_assets` `mark_safe` (SPA bianca), `COPY harness/`+`cp workflow.yaml`+`pip install .` (pip 26 / tht module-relative), entrypoint `server` case. +- **Standalone/dev**: `docker-compose.dev.yml` (rete propria, porte host 8787/8090) + `scripts/docker-smoke.sh`. +- Piano dettagliato: `docs/superpowers/plans/2026-07-12-local-docker-deploy-implementation.md`. + ## What ThothII is A **human-in-the-loop datamart builder**: it turns a natural-language question into diff --git a/harness/tests/l2/test_value_grounding_real.py b/harness/tests/l2/test_value_grounding_real.py index 25129d7e..0e63a844 100644 --- a/harness/tests/l2/test_value_grounding_real.py +++ b/harness/tests/l2/test_value_grounding_real.py @@ -6,6 +6,7 @@ here the LSH index is built from the real sampled values and the query is real. Run: pytest -m l2 tests/l2/test_value_grounding_real.py -s (needs .env + VPN) """ +import os from pathlib import Path import pytest @@ -15,7 +16,7 @@ from tht.workspace import load_workspace pytestmark = [pytest.mark.l2] # Per-customer workspace repo (spec D7): the LSH index lives in the customer repo, # not in harness/. PSD is the reference customer for L2. Skip cleanly if absent. -WORKSPACE = Path("/Users/mp/projects/tht-workspace-psd/psd.yaml") +WORKSPACE = Path(os.environ.get("THT_L2_WORKSPACE", "/Users/mp/projects/tht-workspace-psd/psd.yaml")) def test_ablazione_returns_multiple_columns(l2_env):