Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0adda6e8af | ||
|
|
31e6d3a162 | ||
|
|
c77957af93 | ||
|
|
8bd1f3e793 | ||
|
|
3222713ec6 | ||
|
|
9e8ffe2dc5 | ||
|
|
6578578acb | ||
|
|
b17d41802d | ||
|
|
40b524e393 | ||
|
|
977cf0e978 | ||
|
|
2f53512e4d | ||
|
|
497ab84031 |
@@ -12,7 +12,7 @@ Use the canonical labels `needs-triage`, `needs-info`, `ready-for-agent`, `ready
|
||||
|
||||
### Domain docs
|
||||
|
||||
This is a single-context repository with root `CONTEXT.md` and `docs/adr/`. See `docs/agents/domain.md`.
|
||||
This is a single-context repository with root `GLOSSARY.md` and `docs/adr/`. See `docs/agents/domain.md`.
|
||||
|
||||
This file provides guidance to Codex (Codex.ai/code) when working with code in this repository.
|
||||
|
||||
|
||||
-654
@@ -1,654 +0,0 @@
|
||||
# Contesto di dominio di ThothII
|
||||
|
||||
## Architettura del workflow
|
||||
|
||||
**Workflow Kernel** — Il coordinatore deterministico che possiede lo stato del workflow,
|
||||
le transizioni, il rollback, la finalizzazione e l'applicazione atomica degli esiti dei
|
||||
moduli.
|
||||
|
||||
**Workflow Module** — Una capacità incapsulata che espone un contratto versionato. Un
|
||||
modulo può partecipare a più stage e non modifica direttamente lo stato del workflow.
|
||||
|
||||
**Stage** — Un punto del workflow, identificato semanticamente, nel quale viene invocato
|
||||
un modulo. L'identità dello stage è indipendente dalla sua posizione visiva.
|
||||
|
||||
**Display code** — L'etichetta di presentazione associata a uno stage, per esempio da
|
||||
`F1` a `F8`. I display code alimentano gli indicatori di avanzamento nel frontend, ma non
|
||||
sono usati come identità del workflow o chiavi di dipendenza.
|
||||
|
||||
**Module outcome** — Il risultato proposto da un modulo: eventi tipizzati, modifiche agli
|
||||
artifact, un'eventuale richiesta di revisione umana e uno stato di esecuzione. Il
|
||||
Workflow Kernel valida e applica l'esito.
|
||||
|
||||
**Revision request** — La proposta tipizzata con cui un modulo segnala che lo stage
|
||||
corrente non può concludersi validamente senza rieseguire lo stesso stage o uno stage
|
||||
precedente. Non produce direttamente una transizione: il Workflow Kernel valida la
|
||||
richiesta, sospende l'avanzamento e, per riaprire uno stage già completato, attende una
|
||||
decisione umana tipizzata. Il Kernel, non il modulo, determina gli eventi e gli artifact
|
||||
causalmente da rendere stale.
|
||||
|
||||
**Question Admission** — Il controllo preliminare eseguito prima delle fasi da `F1` a
|
||||
`F8`. Nella prima release distingue una domanda utilizzabile da input garbage e verifica
|
||||
che la domanda appartenga allo scope dichiarato dal workspace. Il suo stato è mostrato
|
||||
separatamente dagli otto indicatori di fase.
|
||||
|
||||
**Workspace scope** — La dichiarazione gestita e versionata di ciò che il database di un
|
||||
workspace rappresenta e delle domande alle quali è destinato a rispondere. Question
|
||||
Admission la usa come riferimento per valutare la pertinenza di una domanda.
|
||||
|
||||
**Datamart Plugin** — Il modulo sostituibile che implementa lo stage semantico
|
||||
`datamart`, presentato con display code `F8`. La promozione della memory e la
|
||||
finalizzazione della sessione non appartengono al Datamart Plugin.
|
||||
|
||||
**Ordered workflow** — La pipeline deterministica composta dal preflight Admission,
|
||||
dagli otto stage principali ordinati da `F1` a `F8` e dalla finalizzazione. L'ordine
|
||||
degli stage è esplicito; il workflow non è un DAG generale.
|
||||
|
||||
**Extension point** — Una posizione semantica nel lifecycle dell'Ordered workflow alla
|
||||
quale possono contribuire uno o più moduli senza diventare nuovi stage visibili. Un
|
||||
extension point non possiede un display code.
|
||||
|
||||
**Stage state** — La proiezione deterministica degli eventi del workflow che descrive
|
||||
uno stage come `pending`, `ready`, `running`, `awaiting_human`, `completed`, `skipped` o
|
||||
`failed`. Non è un valore corrente memorizzato separatamente dal ledger.
|
||||
|
||||
**Required contribution** — Il contributo di un modulo a un extension point che deve
|
||||
concludersi o essere esplicitamente saltato secondo policy prima che il workflow possa
|
||||
avanzare.
|
||||
|
||||
**Best-effort contribution** — Il contributo di un modulo il cui fallimento viene
|
||||
registrato e mostrato come warning, ma non impedisce al workflow di avanzare.
|
||||
|
||||
**Blocked workflow** — La proiezione complessiva di un workflow che non può avanzare a
|
||||
causa di uno stage o di un contributo required fallito o non disponibile. `Blocked` non
|
||||
è uno Stage state autonomo.
|
||||
|
||||
**Module invocation** — Una singola richiesta del Workflow Kernel a un modulo in uno
|
||||
stage o extension point. Conserva la stessa identità attraverso eventuali retry, che
|
||||
sono tentativi distinti della medesima invocation.
|
||||
|
||||
**Stage skip** — La conclusione esplicita di uno stage senza eseguirne il comportamento.
|
||||
È ammessa soltanto dalla policy dello stage e registra motivo e attore; un fallimento non
|
||||
equivale mai implicitamente a uno skip.
|
||||
|
||||
**Stage reopen** — La riapertura di uno stage non finalizzato che rende stale gli esiti
|
||||
causalmente successivi. Gli effetti esterni già prodotti richiedono una marcatura o una
|
||||
compensazione esplicita e non sono presentati come automaticamente annullati. Può essere
|
||||
applicata dal Workflow Kernel in seguito all'approvazione di una Revision request, ma
|
||||
non può essere eseguita direttamente da Pi o da un Workflow Module.
|
||||
|
||||
**Completion policy** — La regola con cui uno stage si conclude: `automatic` quando il
|
||||
kernel può verificarne deterministicamente l'esito, oppure `review_required` quando è
|
||||
necessaria un'approvazione umana tipizzata.
|
||||
|
||||
**Paused session** — Una sessione interrotta intenzionalmente ma resumibile. L'azione
|
||||
“Stop and save” mette la sessione in pausa; non la completa e non la marca come fallita.
|
||||
|
||||
**Finalized session** — Una sessione completata con esito canonico e immutabile. Una
|
||||
correzione successiva crea una nuova sessione derivata, collegata a quella precedente.
|
||||
|
||||
**After-finalize hook** — Una notifica o attività best-effort eseguita tramite outbox
|
||||
dopo la finalizzazione. Non può modificare il ledger, gli artifact canonici o lo stato
|
||||
terminale della sessione.
|
||||
|
||||
## Memory
|
||||
|
||||
**Memory Module** — Il modulo che possiede le conoscenze ed esperienze curate per
|
||||
migliorare schema linking e generazione SQL di domande future. Le Memory appartengono
|
||||
a un workspace e rimangono distinte dalle Evidence.
|
||||
|
||||
**Memory Card** — L'unità di contenuto gestibile del Memory Module, con identità,
|
||||
ambito di applicazione e provenienza. Il formato è allineato per analogia alle
|
||||
Evidence, senza implicare la stessa origine o lo stesso percorso di pubblicazione.
|
||||
|
||||
**Reusable Memory** — Una Memory Card che esprime un chiarimento di dominio, una
|
||||
regola di costruzione SQL o un errore da evitare con motivo compreso e approvato.
|
||||
La sua validità è circoscritta a un ambito esplicito e non deriva dalla sola
|
||||
approvazione di una scelta occasionale in una domanda.
|
||||
|
||||
**Solved Question** — Una Memory Card che conserva una domanda risolta con la
|
||||
relativa soluzione SQL e il contesto necessario a interpretarla. È un exemplar
|
||||
consultativo: i parametri e le scelte del caso non diventano regole generali.
|
||||
|
||||
**Memory Graph** — L'insieme dei collegamenti espliciti fra card che contribuisce
|
||||
al recupero di conoscenze pertinenti oltre alla somiglianza del contenuto. Il
|
||||
ritrovamento di una card tramite un collegamento non ne implica l'approvazione.
|
||||
|
||||
**Memory Link** — Un collegamento curato fra card, con destinazione e significato
|
||||
espliciti, che contribuisce alla consultazione di contenuti pertinenti. La sua
|
||||
rimozione non comporta la cancellazione delle card collegate.
|
||||
|
||||
## Evidence
|
||||
|
||||
**Context specialist** — La persona competente sul dominio che redige e cura il
|
||||
contenuto delle Evidence. Può essere distinta da chi amministra l'installazione;
|
||||
il suo lavoro di redazione non richiede accesso al database applicativo.
|
||||
|
||||
**Evidence draft** — Il documento iniziale scritto dallo specialista di contesto,
|
||||
che il sistema acquisisce e raffina in Evidence Unit. Può essere redatto e
|
||||
consegnato indipendentemente dall'installazione che userà le Evidence risultanti.
|
||||
|
||||
**Evidence Module** — Il modulo autonomo che possiede la preparazione delle Evidence e
|
||||
la loro consultazione durante il workflow. La preparazione avviene fuori dalle singole
|
||||
sessioni; il workflow usa soltanto contenuti già pubblicati. A runtime contribuisce agli
|
||||
stage semantici esistenti, senza diventare uno stage visibile e senza modificare ledger,
|
||||
artifact o stato del workflow.
|
||||
|
||||
**Source Evidence** — Il documento o la dichiarazione che sostiene il contenuto
|
||||
corrente di una Evidence Unit. Un documento acquisito viene conservato come
|
||||
riferimento umano; una dichiarazione manuale attribuisce il contenuto alla persona
|
||||
che lo ha scritto e approvato.
|
||||
|
||||
**Manual Evidence declaration** — Una dichiarazione esplicita dell'amministratore
|
||||
che sostiene una Evidence creata direttamente o una correzione del suo significato.
|
||||
Non implica una verifica indipendente da parte di una fonte documentale esterna.
|
||||
|
||||
**Evidence origin** — Il documento da cui una Evidence Unit è stata inizialmente
|
||||
derivata. Può restare collegato per provenienza e confronto con gli aggiornamenti
|
||||
anche quando una dichiarazione manuale sostiene il testo corrente. La sola origine
|
||||
non dimostra il supporto semantico di una successiva correzione.
|
||||
|
||||
**Local Evidence archive** — L'insieme delle Evidence curate custodite
|
||||
dall'installazione, distinto dalle draft originali e dai contenuti derivati per
|
||||
la ricerca. Comprende le correzioni manuali e i ritiri deliberati.
|
||||
|
||||
**Consolidated Evidence** — Una versione delle Evidence locali controllata come
|
||||
insieme coerente e pronta per l'attivazione. I file ancora in modifica non ne
|
||||
cambiano il contenuto.
|
||||
|
||||
**Active Evidence** — La versione consolidata disponibile alla consultazione del
|
||||
core. Un tentativo di aggiornamento fallito conserva la versione attiva precedente.
|
||||
|
||||
**Evidence Unit** — La più piccola unità semantica coerente, revisionabile e ricercabile
|
||||
fondata su una Source Evidence corrente, anche manuale, e con eventuale origine
|
||||
documentale distinta. Possiede un identificatore stabile indipendente dal kind,
|
||||
assegnato una volta nella forma `evidence:<slug>`; fonti diverse non vengono fuse
|
||||
automaticamente.
|
||||
|
||||
**Evidence kind** — La categoria semantica di una Evidence Unit, che ne determina i
|
||||
campi specifici e ne orienta l'uso. Ogni unità ha un solo kind primario; i tipi iniziali
|
||||
sono `glossary`, `domain`, `enum`, `example`, `mapping`, `normalization`, `formula` e
|
||||
`reference`.
|
||||
|
||||
**Glossary Evidence** — Una Evidence Unit che definisce il significato linguistico, i
|
||||
sinonimi o le varianti di un termine.
|
||||
|
||||
**Domain Evidence** — Una Evidence Unit che esprime una regola o un vincolo del dominio
|
||||
non rappresentato da un kind più specifico.
|
||||
|
||||
**Enum Evidence** — Una Evidence Unit che collega un insieme finito di valori
|
||||
memorizzati ai relativi significati.
|
||||
|
||||
**Example Evidence** — Una Evidence Unit che associa un input o una domanda alla sua
|
||||
interpretazione o al risultato atteso.
|
||||
|
||||
**Mapping Evidence** — Una Evidence Unit che collega un concetto logico agli elementi
|
||||
del relativo schema fisico.
|
||||
|
||||
**Normalization Evidence** — Una Evidence Unit che descrive la trasformazione di una
|
||||
rappresentazione in una forma canonica.
|
||||
|
||||
**Formula Evidence** — Una Evidence Unit che contiene una singola espressione PostgreSQL
|
||||
componibile e ne dichiara gli input. Una query SQL completa non è una Formula Evidence.
|
||||
|
||||
**Reference Evidence** — Una Evidence Unit che rappresenta un collegamento esterno da
|
||||
restituire come contenuto autonomo, anziché come semplice provenienza.
|
||||
|
||||
**Evidence purpose** — La destinazione dichiarata di una Evidence Unit nel workflow:
|
||||
disambiguation, rewriting, schema linking o SQL generation. È distinta dall'Evidence
|
||||
kind: il tipo descrive cosa contiene, il purpose quando può essere utile; durante la
|
||||
ricerca il purpose richiesto è un filtro obbligatorio. Il recupero di esperienze e
|
||||
soluzioni precedenti appartiene al Memory Module e non è un Evidence purpose.
|
||||
|
||||
**Evidence Search Outcome** — Il risultato tipizzato di una consultazione del modulo
|
||||
Evidence. Distingue una ricerca disponibile, che può legittimamente non trovare
|
||||
corrispondenze, da un'indisponibilità tecnica che impedisce allo stage chiamante di
|
||||
avanzare fino a un retry riuscito.
|
||||
|
||||
**Evidence receipt** — La traccia minima di una consultazione disponibile conservata
|
||||
nella sessione: stage semantico, purpose, generazione interrogata e identificatori delle
|
||||
Evidence restituite. Non duplica il contenuto delle Evidence.
|
||||
|
||||
**Curated Evidence** — Una o più Evidence Unit preparate da documenti o curate
|
||||
manualmente. La presenza nell'archivio curato non implica da sola che il contenuto
|
||||
sia già attivo per il workflow.
|
||||
|
||||
**Published Evidence** — Le Curated Evidence valide appartenenti alla revisione attiva
|
||||
del workspace e alla generazione Evidence pubblicata. L'approvazione umana precede
|
||||
l'attivazione, ma non viene duplicata come stato nel manifest.
|
||||
|
||||
**Evidence Index** — La proiezione ricercabile e ricostruibile delle Published Evidence.
|
||||
Accelera il recupero delle informazioni, ma non è una fonte di verità.
|
||||
|
||||
**Evidence preparation** — Il processo di authoring che trasforma Source Evidence in
|
||||
Curated Evidence mediante estrazione e normalizzazione deterministiche, una singola
|
||||
ristrutturazione assistita dal modello e una validazione finale deterministica. Nella
|
||||
prima versione accetta Markdown o testo UTF-8 e non acquisisce automaticamente il
|
||||
contenuto di URL o documenti esterni. Prepara l'intero insieme delle modifiche in
|
||||
un'area temporanea e lo applica atomicamente soltanto se tutti gli output sono validi;
|
||||
non ritenta automaticamente una chiamata al modello fallita.
|
||||
|
||||
**Supporting excerpt** — Un breve estratto presente nel Source Evidence che sostiene
|
||||
una Evidence Unit. Il sistema ne verifica deterministicamente la presenza dopo la
|
||||
normalizzazione meccanica; il curatore resta responsabile di verificarne la sufficienza
|
||||
semantica.
|
||||
|
||||
**Evidence resolution** — La decisione esplicita con cui un curatore risolve un
|
||||
problema di una Evidence Unit, correggendola, ritirandola oppure ricollegandola a
|
||||
una fonte adeguata.
|
||||
|
||||
**Source update conflict** — Un contrasto fra una fonte aggiornata e una correzione
|
||||
manuale già approvata. La correzione resta in uso fino alla risoluzione esplicita
|
||||
del confronto da parte dell'amministratore.
|
||||
|
||||
**Evidence source refresh** — La riacquisizione delle fonti esterne richiesta
|
||||
dall'amministratore per rilevarne le modifiche. Fra due aggiornamenti il contenuto
|
||||
già acquisito resta il riferimento per preparazione e consultazione.
|
||||
|
||||
**Review item** — Un blocco di revisione descritto da codice stabile, messaggio umano e
|
||||
campo opzionale. Finché viene mantenuto nell'Evidence Unit, ne impedisce la
|
||||
pubblicazione; la sua storia è conservata da Git, non da uno stato interno all'item.
|
||||
|
||||
**Retirement candidate** — Una Curated Evidence che il Source Evidence esistente non
|
||||
sostiene più. Rimane visibile con un Review item e blocca la pubblicazione finché il
|
||||
curatore non la elimina oppure la rende nuovamente coerente con il sorgente.
|
||||
|
||||
**Evidence evaluation set** — Un piccolo insieme versionato di domande rappresentative
|
||||
e relativi risultati attesi. La baseline è accettabile quando ogni domanda recupera
|
||||
almeno un risultato atteso nei primi dieci risultati della fusione RRF; il risultato
|
||||
nei primi cinque è informativo. Comprende almeno un caso lessicale, uno semantico e uno
|
||||
misto e conserva, a fini diagnostici, le posizioni dense, BM25 e fused.
|
||||
|
||||
**Candidate Evidence Generation** — Una generazione completa dell'Evidence Index che
|
||||
può essere valutata ma non è ancora visibile alle sessioni. Diventa attiva soltanto se
|
||||
supera l'Evidence evaluation set.
|
||||
|
||||
**Evidence manifest** — Il file versionato e gestito dal sistema che collega ogni
|
||||
Source Evidence al suo hash e alle Evidence Unit derivate. Conserva gli identificatori
|
||||
stabili, permette l'elaborazione incrementale e segnala le unità rimaste orfane senza
|
||||
cancellarle automaticamente.
|
||||
|
||||
**Orphaned Evidence Unit** — Una Curated Evidence il cui Source Evidence non esiste più.
|
||||
Rimane disponibile per la revisione, ma blocca la pubblicazione finché non viene
|
||||
eliminata, ricollegata oppure ne viene ripristinato il sorgente.
|
||||
|
||||
**Evidence Fragment** — Una proiezione ricercabile di una sezione semanticamente
|
||||
coerente di una Published Evidence. La divisione segue intestazioni e confini di
|
||||
paragrafo; formule, coppie valore/significato, mapping, regole e URL non vengono mai
|
||||
tagliati. Il testo completo reso per il frammento usa il solo limite esistente
|
||||
`max_chunk_chars`, pari per default a 4.000 caratteri; un elemento atomico troppo grande
|
||||
produce un Review item bloccante. Qdrant indicizza i frammenti, mentre l'Evidence Module
|
||||
li raggruppa per Evidence Unit.
|
||||
|
||||
**Evidence Result** — La rappresentazione di una singola Evidence Unit restituita dalla
|
||||
ricerca con metadati, migliori estratti, provenienza e riferimento al documento completo.
|
||||
|
||||
**Hybrid Evidence retrieval** — La ricerca che combina in Qdrant una graduatoria
|
||||
semantica dense e una graduatoria lessicale BM25 sparse mediante Reciprocal Rank
|
||||
Fusion. I metadati tipizzati restringono o orientano i risultati senza creare una
|
||||
collezione separata per ogni Evidence kind.
|
||||
|
||||
**Evidence query text** — La rappresentazione deterministica condivisa dalla ricerca
|
||||
dense e BM25: domanda originale, concetti, tabelle e colonne in ordine fisso. I campi
|
||||
vuoti sono omessi; domanda e contesto ricevono soltanto normalizzazione Unicode NFC,
|
||||
conversione degli a-capo e rimozione degli spazi esterni. Gli elementi contestuali sono
|
||||
poi deduplicati e ordinati senza conversione delle maiuscole, mentre punteggiatura e
|
||||
spazi interni della domanda non vengono riscritti.
|
||||
|
||||
**Reference Vector Collection** — La collezione Qdrant ricostruibile di un workspace che
|
||||
contiene Schema, relazioni ed Evidence. Possiede il vettore dense predefinito e il vettore
|
||||
sparse `bm25`; soltanto gli Evidence Fragment ricevono valori BM25. Il preprocessing può
|
||||
sostituirla o eliminarla integralmente.
|
||||
|
||||
**Memory Vector Collection** — La collezione Qdrant persistente di un workspace che contiene
|
||||
`memory` e `solved_question`. Non è un output del preprocessing e non viene eliminata dal
|
||||
Preprocessing Clear.
|
||||
|
||||
**Preprocessing Clear** — L'operazione amministrativa che elimina Reference Vector Collection,
|
||||
LSH, corpus e checkpoint derivati e rende il workspace non pronto. Conserva Memory Vector
|
||||
Collection, sessioni, Catalog Metadata e database sorgente; non offre history o rollback.
|
||||
|
||||
**Formula proposal** — Una formula individuata durante una sessione e conservata come
|
||||
artefatto della sessione. Non diventa Published Evidence finché non viene importata,
|
||||
revisionata e approvata nel repository del workspace.
|
||||
|
||||
**Fail-closed Evidence retrieval** — Il comportamento per cui un indice assente,
|
||||
incompatibile o non aggiornato produce nessuna Evidence e un avviso esplicito. Il
|
||||
workflow può continuare, ma non usa mai silenziosamente contenuti di una revisione
|
||||
precedente o di un altro workspace.
|
||||
|
||||
## Configurazione dei modelli
|
||||
|
||||
**Workspace Descriptor** — La dichiarazione versionata dell'identità del workspace e dello
|
||||
scope delle sue Evidence. Non contiene identità o configurazione del Workspace Database,
|
||||
Database Binding, fatti strutturali o metadati semantici: il Metadata Catalog associa il
|
||||
workspace al relativo database.
|
||||
|
||||
**Installation Model Catalog** — L'insieme dichiarativo, proprio di un'installazione, dei
|
||||
modelli disponibili, dei loro Model Usage e dei relativi default. È l'unica autorità per i
|
||||
modelli di sessione, generazione dei metadati ed embedding e non appartiene a un workspace.
|
||||
_Avoid_: Model Catalog, Metadata Generation Model Configuration
|
||||
|
||||
**Model Usage** — Lo scopo per cui un modello dell'Installation Model Catalog può essere
|
||||
usato: `session`, `metadata_generation` oppure `embedding`. L'ammissibilità e il default
|
||||
dipendono dall'uso, non dal workspace.
|
||||
|
||||
**Model Selection** — La scelta runtime, a livello di installazione, di un modello del
|
||||
catalogo per uno specifico Model Usage. Riferisce l'identità canonica del modello senza
|
||||
ridefinirne provider, endpoint o capacità.
|
||||
|
||||
**Model Runtime Projection** — La rappresentazione derivata e non autoritativa
|
||||
dell'Installation Model Catalog richiesta da uno specifico runtime. Può essere rigenerata
|
||||
integralmente dalla configurazione dell'installazione.
|
||||
|
||||
## Distribuzione del prodotto
|
||||
|
||||
**Customer-Hosted Installation** — Un'installazione eseguita interamente nel trust boundary
|
||||
controllato dall'organizzazione cliente, inclusi eventuali tenant cloud privati. Credenziali,
|
||||
domande, prompt, metadati e risultati non attraversano quel boundary.
|
||||
_Avoid_: on-premise deployment, self-managed deployment
|
||||
|
||||
**Community Edition** — La distribuzione open source utilizzabile gratuitamente anche in
|
||||
produzione e capace di eseguire il workflow fondamentale completo.
|
||||
_Avoid_: free tier, trial edition
|
||||
|
||||
**Enterprise Edition** — La distribuzione con licenza commerciale che aggiunge governance
|
||||
organizzativa, esercizio production-grade e industrializzazione alla Community Edition.
|
||||
_Avoid_: paid tier, pro edition
|
||||
|
||||
## Catalogo dei metadati
|
||||
|
||||
**Workspace Database** — Il database che appartiene a un solo workspace e non può essere
|
||||
condiviso con altri workspace; un workspace può averne al massimo uno. È considerato nella
|
||||
coppia composta dal database PostgreSQL e da un solo schema: tutte le tabelle, le colonne e
|
||||
le relazioni catalogate appartengono a quello schema. Il Metadata Catalog conserva
|
||||
l'associazione, ma non crea né possiede l'identità del workspace.
|
||||
|
||||
**Database Binding** — La configurazione specifica di un'installazione che seleziona un
|
||||
trasporto e fornisce i riferimenti necessari a raggiungere un Workspace Database. Non è una
|
||||
seconda identità del database e non viene condivisa automaticamente fra installazioni.
|
||||
|
||||
**Thoth REST Connector** — Il trasporto REST tipizzato con cui ThothII interroga ed
|
||||
introspeziona un Workspace Database attraverso il contratto RPC DWH supportato. Non è un
|
||||
client configurabile per API REST arbitrarie.
|
||||
|
||||
**Orphaned Workspace Database** — Un Workspace Database il cui workspace non è più presente
|
||||
nel catalogo autorevole. Rimane conservato per il recupero amministrativo, ma non può essere
|
||||
usato dal workflow finché non viene riassegnato a un workspace esistente.
|
||||
|
||||
**Metadata Catalog** — L'autorità per l'associazione fra workspace e Workspace Database, la
|
||||
relativa Database Binding, i fatti strutturali osservati e i metadati semantici curati. Ogni
|
||||
uso downstream dei metadati del database deriva da questo catalogo.
|
||||
|
||||
**Database Profile** — L'insieme curato di scope, descrizioni e metadati semantici
|
||||
associato a un Workspace Database.
|
||||
|
||||
**Physical Table** — Una tabella osservata nello schema esterno di un Workspace Database.
|
||||
La sua identità e il suo nome appartengono al database esterno, non al Metadata Catalog.
|
||||
|
||||
**Catalog Table** — La rappresentazione persistita di una Physical Table nel Metadata Catalog.
|
||||
La sua appartenenza e identità fisica derivano dall'introspezione: non può essere creata o
|
||||
rinominata manualmente, ma può essere rimossa tramite Catalog Metadata Cleanup.
|
||||
_Avoid_: SqlTable, managed table
|
||||
|
||||
**Physical Column** — Una colonna osservata in una Physical Table, inclusi nome, posizione,
|
||||
tipo e appartenenza a chiavi dichiarate. La sua identità e i suoi fatti strutturali appartengono
|
||||
al database esterno.
|
||||
|
||||
**Catalog Column** — La rappresentazione persistita di una Physical Column nel Metadata Catalog.
|
||||
I fatti osservati sono governati dalla sincronizzazione; Description e Generated Description
|
||||
sono metadati amministrativi modificabili e la rappresentazione può essere rimossa tramite
|
||||
Catalog Metadata Cleanup.
|
||||
_Avoid_: SqlColumn, managed column
|
||||
|
||||
**Physical Relationship** — Un vincolo foreign key dichiarato nel database esterno. La sua
|
||||
identità comprende il vincolo e la sequenza ordinata delle coppie di colonne che lo compongono.
|
||||
|
||||
**Catalog Relationship** — La rappresentazione persistita di una Physical Relationship nel
|
||||
Metadata Catalog. Non è creata o modificata manualmente, ma può essere rimossa tramite Catalog
|
||||
Metadata Cleanup.
|
||||
_Avoid_: denormalized FK, relationship string
|
||||
|
||||
**Logical Relationship** — Una relazione modificabile fra due Catalog Column che non corrisponde
|
||||
necessariamente a un vincolo fisico. Può essere Generated o Manual e rimane distinta dalla Catalog
|
||||
Relationship osservata nel database.
|
||||
|
||||
**Generated Relationship** — Una Logical Relationship ricavata dai nomi delle colonne, dalle
|
||||
primary key e dalla compatibilità dei tipi mediante regole deterministiche, senza LLM, embedding o
|
||||
campionamento dei dati. Una ricostruzione non riattiva una Generated Relationship cancellata
|
||||
logicamente, ma può ricrearne una cancellata fisicamente.
|
||||
|
||||
**Manual Relationship** — Una Logical Relationship aggiunta dall'utente. La ricostruzione delle
|
||||
Generated Relationship non la modifica.
|
||||
|
||||
**Logical Relationship Deletion** — L'esclusione persistente di una Logical Relationship che ne
|
||||
conserva l'identità per impedirne la ricreazione automatica finché esistono entrambe le Catalog
|
||||
Column alle quali è collegata.
|
||||
|
||||
**Permanent Relationship Deletion** — La rimozione completa di una Logical Relationship. Una
|
||||
ricostruzione successiva può ricrearla quando soddisfa nuovamente le regole di inferenza. Anche il
|
||||
cleanup distruttivo di una tabella o colonna endpoint rimuove permanentemente le relative esclusioni.
|
||||
|
||||
**Relationship Reconstruction** — L'operazione amministrativa esplicita che scopre e aggiunge le
|
||||
Generated Relationship mancanti. Conserva le Manual Relationship e le relationship già presenti e
|
||||
non riattiva quelle cancellate logicamente.
|
||||
|
||||
**Relationship Restore** — La riattivazione esplicita di una Logical Relationship cancellata
|
||||
logicamente.
|
||||
|
||||
**Effective Relationship Map** — La vista unificata delle Catalog Relationship fisiche e delle
|
||||
Logical Relationship, con origine e stato espliciti. È l'interfaccia usata dall'amministrazione e
|
||||
dalla comprensione dello schema, non un ulteriore modello persistito.
|
||||
|
||||
**Catalog Metadata Snapshot** — La proiezione immutabile e versionata della struttura catalogata,
|
||||
delle descrizioni pubblicabili e delle relazioni effettive attive di un Workspace Database che il
|
||||
core consuma. È derivata esclusivamente dal Metadata Catalog e non è un archivio autoritativo.
|
||||
|
||||
**Schema Index** — La proiezione vettoriale ricostruibile dei metadati del Workspace Database nel
|
||||
Metadata Catalog. Il preprocessing la sostituisce integralmente e non è una fonte di verità.
|
||||
|
||||
**Description** — Il testo curato e consolidato che descrive una Catalog Table o Catalog Column
|
||||
per gli usi downstream. Quando presente, prevale sulla relativa Generated Description.
|
||||
|
||||
**Generated Description** — Il testo modificabile prodotto dall'AI per una Catalog Table o Catalog
|
||||
Column. È pubblicabile per gli usi downstream quando manca una Description, anche senza essere
|
||||
prima consolidato, e rimane distinto dal commento osservato nel database.
|
||||
_Avoid_: generated comment, source comment
|
||||
|
||||
**Description Consolidation** — L'azione amministrativa esplicita che copia la Generated
|
||||
Description di Catalog Table o Catalog Column selezionate nella relativa Description. Opera sulla
|
||||
selezione corrente, conserva la Generated Description e non modifica il commento osservato o il
|
||||
database esterno.
|
||||
|
||||
**Table Synchronization** — La riconciliazione esplicita che rende le Catalog Table di un
|
||||
Workspace Database uguali alle Physical Table osservate: crea quelle nuove, aggiorna i metadati
|
||||
di origine ed elimina definitivamente quelle assenti. Non modifica mai il database esterno.
|
||||
_Avoid_: table import
|
||||
|
||||
**Schema Synchronization** — La riconciliazione esplicita e autorevole di tabelle, colonne e
|
||||
Catalog Relationship di un Workspace Database. Può operare su uno scope specifico oppure su
|
||||
un unico snapshot completo tramite Synchronize All.
|
||||
|
||||
**Catalog Sync Run** — L'esecuzione durevole in background di una Schema Synchronization, con
|
||||
scope, stato, avanzamento e log propri. Al massimo un run per Workspace Database può essere attivo.
|
||||
|
||||
**Description Generation Run** — L'esecuzione asincrona e sequenziale che usa il modello scelto
|
||||
per produrre Generated Description di Catalog Table o Catalog Column. Al massimo una run è attiva
|
||||
nell'intera installazione e ogni risultato valido viene salvato appena disponibile. Dopo
|
||||
un'interruzione il recupero è manuale tramite una nuova generazione dei soli elementi mancanti.
|
||||
|
||||
**Description Generation Event** — Una riga testuale ordinata che registra avanzamento, risultato
|
||||
o errore di una Description Generation Run e alimenta il log visibile all'amministratore.
|
||||
|
||||
**Non-generatable Description** — L'esito valido con cui il modello dichiara di non disporre di
|
||||
informazioni sufficienti per descrivere il target. Produce una Generated Description standard
|
||||
nella lingua del workspace e non rappresenta un timeout, un errore del provider o una risposta
|
||||
non valida.
|
||||
|
||||
**Description Generation Unlock** — Il recupero amministrativo che marca come interrotta una
|
||||
Description Generation Run registrata come attiva quando il backend non ha alcun processo di
|
||||
generazione vivo. Non è un meccanismo di lock distribuito.
|
||||
|
||||
**Catalog Metadata Cleanup** — La rimozione amministrativa esplicita di Catalog Table, Catalog
|
||||
Column o Catalog Relationship selezionate. Non modifica il Workspace Database, la Database Binding
|
||||
o i segreti, e può lasciare il Metadata Catalog intenzionalmente incompleto fino alla prossima
|
||||
Schema Synchronization.
|
||||
|
||||
**Catalog Freshness** — La corrispondenza fra uno scope sincronizzato e la versione corrente
|
||||
della Database Binding. Uno scope rimane consultabile ma è stale finché non viene sincronizzato
|
||||
con la binding corrente.
|
||||
|
||||
**Metadata Content Revision** — La revisione monotona di tutto lo stato del Metadata Catalog che
|
||||
può modificare il comportamento del core. Ogni mutazione rilevante produce una nuova revisione
|
||||
nella stessa transazione che la rende durevole.
|
||||
|
||||
**Preprocessing State** — Lo stato corrente `running`, `succeeded` o `failed` del preprocessing di
|
||||
un workspace, insieme all'identità dei suoi input. Il core può usare il workspace soltanto quando
|
||||
lo stato è `succeeded` e gli input coincidono ancora.
|
||||
|
||||
**Catalog Metadata** — I campi mutabili che descrivono database, tabelle, colonne e relazioni,
|
||||
distinti dai fatti strutturali governati dalla sincronizzazione. Possono essere popolati dall'AI,
|
||||
o da una modifica amministrativa senza cambiare il database esterno.
|
||||
|
||||
**Model Completion Helper** — Il processo Python interno ed effimero che esegue una singola
|
||||
richiesta LiteLLM per conto del backend. Non è un servizio HTTP, non possiede il lifecycle della
|
||||
Description Generation Run e non è una CLI esposta agli utenti.
|
||||
|
||||
**Catalog Sample** — Un input transitorio composto da un massimo di cinque righe e da valori di
|
||||
esempio bounded di una Catalog Table per la generazione delle descrizioni. Può contenere valori
|
||||
reali oppure sintetici in base alla Source Value Disclosure Decision; non viene persistito e non
|
||||
diventa Catalog Metadata.
|
||||
|
||||
**Sensitive Data Flag** — La classificazione binaria umana applicata a una Catalog Column. Può
|
||||
essere impostata liberamente dall'amministratore anche in contrasto con una valutazione automatica.
|
||||
|
||||
**Sensitivity Reason** — La motivazione sanificata persistita insieme al Sensitive Data Flag
|
||||
quando l'amministratore salva una Sensitivity Review Draft. È Catalog Metadata della colonna, non
|
||||
history della run; viene rimossa quando il flag torna non-sensitive e può essere assente per una
|
||||
classificazione manuale priva di valutazione locale.
|
||||
_Avoid_: AI reasoning, source evidence
|
||||
|
||||
**Local Sensitivity Assessment** — La valutazione locale, non autoritativa e priva di LLM di una
|
||||
Catalog Column, basata su metadati e contenuto sorgente, con esito `sensitive`, `non_sensitive`
|
||||
oppure `unknown`.
|
||||
_Avoid_: AI suggestion, automatic flag
|
||||
|
||||
**Local NER Detector** — Il componente NLP opzionale e CPU-only che esamina soltanto testo ancora
|
||||
ambiguo e restituisce evidenze al Local Sensitivity Assessment. Non decide lo stato della colonna,
|
||||
non usa un LLM generativo e non persiste valori sorgente.
|
||||
_Avoid_: AI classifier, local LLM fallback
|
||||
|
||||
**Model Data Boundary** — La qualificazione amministrativa di un modello come `internal` oppure
|
||||
`external` rispetto al confine entro cui i valori sorgente possono essere comunicati.
|
||||
_Avoid_: local model, remote model
|
||||
|
||||
**Source Value Disclosure Decision** — L'unica decisione effettiva che stabilisce se un modello
|
||||
riceve valori sorgente reali oppure sostituti sintetici, combinando Model Data Boundary e Sensitive
|
||||
Data Flag.
|
||||
_Avoid_: sample filter, export flag
|
||||
|
||||
**Sensitive Data Policy** — L'insieme versionato di regole locali generali e specifiche che produce
|
||||
una Local Sensitivity Assessment. Un singolo riscontro blocca l'intera colonna e qualsiasi valore
|
||||
testuale più lungo di 500 caratteri rende sensibile la colonna.
|
||||
_Avoid_: PII filter, sample filter
|
||||
|
||||
**Sensitivity Analysis Run** — Il tentativo amministrativo esplicito e tracciato che valuta una
|
||||
selezione di colonne mediante la Sensitive Data Policy. Conserva stato, copertura e conteggi
|
||||
aggregati, ma non valori sorgente né esiti per colonna.
|
||||
_Avoid_: Sensitive Data Suggestion Run, AI analysis
|
||||
|
||||
**Sensitivity Review Draft** — La proposta transitoria che associa alle colonne selezionate una
|
||||
Local Sensitivity Assessment e le relative evidenze sanificate. Non modifica il Sensitive Data Flag
|
||||
né la Sensitivity Reason finché l'amministratore non salva le proprie decisioni e viene scartata al
|
||||
reload.
|
||||
_Avoid_: automatic flag
|
||||
|
||||
**Sensitivity Analysis Event** — Una riga testuale ordinata e sanificata che registra l'avvio,
|
||||
l'avanzamento per fase e batch, l'esito o l'errore di una Sensitivity Analysis Run senza conservare
|
||||
contenuti sorgente, output grezzi del detector o proposte per colonna.
|
||||
_Avoid_: Sensitive Data Suggestion Event
|
||||
|
||||
**Introspection Capability** — Una categoria di struttura fisica che una Database Binding
|
||||
può osservare, come tabelle, colonne, relazioni, indici o enum. Una capability non disponibile
|
||||
è distinta da una capability osservata che non ha restituito elementi.
|
||||
|
||||
## Amministrazione e integrazione
|
||||
|
||||
**Workspace Readiness** — La preparazione di uno specifico Workspace per l'uso nel
|
||||
workflow, comprensiva della disponibilità degli artefatti derivati dai suoi metadati
|
||||
Database e dalle sue Evidence. Il preprocessing appartiene a questa preparazione;
|
||||
la configurazione e la sincronizzazione del catalogo restano responsabilità Database.
|
||||
|
||||
**Administration Surface** — Una superficie amministrativa autonoma per configurare o curare una
|
||||
parte dell'installazione. Workspace, Evidence, Memory, Database e Pi sono superfici peer e non
|
||||
dipendono dall'esistenza di una sessione attiva.
|
||||
|
||||
**Administration Page** — La rappresentazione a pagina intera di una Administration Surface, con
|
||||
una gerarchia condivisa per identità, stato, azioni e contenuto. Un form amministrativo appartiene
|
||||
alla pagina e non a una popup come contenitore principale.
|
||||
_Avoid_: management popup, settings modal
|
||||
|
||||
**Administration Route** — L'identità navigabile di una Administration Surface nel browser. Deve
|
||||
essere ripristinabile con refresh e cronologia e non contiene valori transitori o segreti dei form.
|
||||
|
||||
**Embedded Thoth Shell** — L'esperienza Thoth ospitata dentro il documento e il contesto visuale di
|
||||
un portale host. Conserva la propria gerarchia funzionale, ma deve rispettare la geometria,
|
||||
l'autenticazione e le regole responsive del portale host.
|
||||
|
||||
**Full Thoth Shell** — L'esperienza Thoth autonoma che possiede il proprio header e il proprio
|
||||
layout di pagina. Non replica la navigazione amministrativa del portale host e non dipende dal suo
|
||||
template visuale.
|
||||
|
||||
**Shell mode** — La scelta di installazione fra `embedded` e `full`. Determina chi possiede il
|
||||
chrome globale, i comandi di identità e le integrazioni visuali, ma non cambia il workflow o la
|
||||
persistenza delle sessioni.
|
||||
|
||||
**Fullscreen state** — Lo stato temporaneo in cui il documento applicativo occupa il fullscreen
|
||||
del browser. È distinto da `Shell mode`: una Full Thoth Shell può essere aperta senza fullscreen;
|
||||
il passaggio è attivato da un comando esplicito e può essere annullato con la stessa azione o con
|
||||
il comando nativo del browser.
|
||||
|
||||
**Portal Shell Adapter** — Il confine sostituibile che traduce lo stato e i comandi del chrome di
|
||||
un portale host nel modello semantico usato da Thoth. L'adapter non possiede autorizzazione,
|
||||
sessioni di workflow o contenuti del modello.
|
||||
|
||||
**Host Shell State** — Il minimo stato visuale fornito dal portale host: locale UI, tema e stato
|
||||
fullscreen. In una Embedded Thoth Shell è la fonte autorevole per queste preferenze;
|
||||
non include identità, token o stato di autenticazione, che restano responsabilità dell'accesso.
|
||||
|
||||
**UI locale** — La lingua delle label, dei messaggi, dei tooltip, degli stati e delle istruzioni
|
||||
non generate dal modello nell'interfaccia Thoth. È distinta dalla lingua dei contenuti di un
|
||||
workspace.
|
||||
|
||||
**Interaction language** — La lingua in cui il modello presenta domande, spiegazioni e proposte
|
||||
al revisore durante una sessione. Viene fissata alla creazione della sessione e rimane invariata
|
||||
durante una ripresa, anche se la UI locale corrente cambia.
|
||||
|
||||
**Administrative Page Family** — L'insieme delle cinque Administration Page che condividono shell,
|
||||
navigazione, tipografia e regole responsive, pur mantenendo contenuti e operazioni specifici:
|
||||
Workspace, Evidence, Memory, Database e Pi.
|
||||
|
||||
## Installazione
|
||||
|
||||
**Manual standalone installation** — Una copia di ThothII predisposta per l'uso autonomo da una
|
||||
persona che possiede il computer, con una Full Thoth Shell e servizi applicativi locali. La
|
||||
procedura non implica che DWH o provider LLM siano locali o disponibili offline.
|
||||
|
||||
**Installation bootstrap** — L'insieme delle attività iniziali che rende disponibile una
|
||||
installazione manuale: verifica dell'host, generazione della configurazione, predisposizione
|
||||
delle credenziali protette e avvio dei servizi. Non è un installer dell'applicazione.
|
||||
|
||||
**Installation preparation** — La predisposizione dei documenti che descrivono i workspace
|
||||
e i parametri dell'installazione, prima di applicarli. Permette all'operatore di raccogliere
|
||||
e correggere le informazioni senza avviare l'applicazione.
|
||||
|
||||
**Installation validation** — La verifica ripetibile della completezza e coerenza dei
|
||||
documenti e delle precondizioni di un'installazione. Distingue ciò che è stato verificato
|
||||
da ciò che richiede un'applicazione già avviata.
|
||||
|
||||
**Installation execution** — L'applicazione dei documenti verificati per predisporre e
|
||||
avviare ThothII. Non raccoglie nuovi parametri dall'operatore durante l'esecuzione.
|
||||
|
||||
**Platform acceptance** — La verifica che una Manual standalone installation possa essere
|
||||
predisposta e avviata su una specifica combinazione di sistema operativo, architettura e runtime,
|
||||
distinta dalla verifica funzionale del collegamento a DWH e provider LLM.
|
||||
+591
@@ -0,0 +1,591 @@
|
||||
# ThothII
|
||||
|
||||
ThothII trasforma una domanda in linguaggio naturale in SQL eseguibile su un data warehouse,
|
||||
attraverso un workflow in cui un modello propone e un revisore umano decide.
|
||||
|
||||
## Language
|
||||
|
||||
### Sessione e workflow
|
||||
|
||||
**Workspace**:
|
||||
L'ambito di lavoro che associa un database a Evidence e Memory curate per rispondere alle domande
|
||||
su quel database. Ogni sessione appartiene a un solo workspace.
|
||||
_Avoid_: progetto, ambiente
|
||||
|
||||
**Session**:
|
||||
Il lavoro su una singola domanda, dalla formulazione al SQL approvato, registrato da documenti di
|
||||
fase e decisioni. Appartiene all'utente che l'ha creata.
|
||||
_Avoid_: chat, conversazione
|
||||
|
||||
**Phase**:
|
||||
Uno degli otto passi ordinati del workflow, da `F1` a `F8`: chiarimento, memoria, riscrittura,
|
||||
schema linking, sintesi, piano CTE, SQL finale, datamart. La fase corrente non è memorizzata ma
|
||||
derivata dalle decisioni registrate.
|
||||
_Avoid_: stage, step
|
||||
|
||||
**Phase document**:
|
||||
Un artefatto prodotto da una fase, come la domanda riscritta, lo schema linking o il SQL finale.
|
||||
Insieme al Decision ledger costituisce l'intero stato persistente della sessione.
|
||||
_Avoid_: transcript, log della chat
|
||||
|
||||
**Decision**:
|
||||
Una scelta registrata durante la sessione, di contenuto (per esempio una tabella promossa) o di
|
||||
avanzamento (una fase approvata, saltata o riaperta).
|
||||
|
||||
**Decision ledger**:
|
||||
La sequenza append-only delle decisioni di una sessione. Ciò che non vi è registrato non è
|
||||
avvenuto.
|
||||
_Avoid_: history, cronologia
|
||||
|
||||
**Reviewer**:
|
||||
La persona che decide nei gate: accetta, corregge o rifiuta le proposte del modello.
|
||||
_Avoid_: utente finale, approvatore
|
||||
|
||||
**Gate**:
|
||||
Il punto del workflow in cui il modello si ferma e attende la decisione del revisore. Il modello
|
||||
non può superarlo da solo.
|
||||
_Avoid_: checkpoint, pausa
|
||||
|
||||
**Reviewer widget**:
|
||||
La richiesta strutturata con cui un gate presenta una scelta al revisore: scelta singola, scelta
|
||||
multipla in cui ogni opzione è una decisione, oppure conferma di un artefatto o di una fase.
|
||||
_Avoid_: popup, form
|
||||
|
||||
**Phase approval**:
|
||||
La decisione che conclude una fase e consente il passaggio alla successiva. Alcune fasi si
|
||||
concludono automaticamente quando non hanno nulla da proporre.
|
||||
|
||||
**Phase skip**:
|
||||
La conclusione esplicita di una fase senza eseguirne il lavoro, consentita solo dove il workflow lo
|
||||
prevede.
|
||||
|
||||
**Phase reopen**:
|
||||
Il ritorno a una fase precedente, che rende obsolete le decisioni successive ed elimina i documenti
|
||||
di fase prodotti dopo quel punto.
|
||||
_Avoid_: rollback, undo
|
||||
|
||||
**Resume**:
|
||||
La ripresa di una sessione non conclusa dalla sua ultima fase incompleta, ricostruendo il contesto
|
||||
dai documenti di fase e dal ledger.
|
||||
_Avoid_: riavvio, nuova domanda
|
||||
|
||||
**Paused session**:
|
||||
Una sessione interrotta intenzionalmente con "Interrompi e salva", che resta riprendibile. Non è
|
||||
completata né fallita.
|
||||
_Avoid_: closed session
|
||||
|
||||
**Finalized session**:
|
||||
Una sessione completata, con esito canonico e immutabile. Una correzione successiva richiede una
|
||||
nuova sessione.
|
||||
|
||||
**Archived session**:
|
||||
Una sessione spostata fuori dall'elenco attivo e di sola lettura, indipendentemente dal suo esito.
|
||||
Il ripristino la riporta nell'elenco attivo.
|
||||
|
||||
**CTE plan**:
|
||||
La scomposizione della query finale in passaggi intermedi approvati singolarmente dal revisore
|
||||
prima del SQL finale.
|
||||
|
||||
**Datamart**:
|
||||
L'ultima fase, che decide come rendere disponibile il risultato approvato e quali conoscenze
|
||||
promuovere in Memory.
|
||||
|
||||
**Interaction language**:
|
||||
La lingua in cui il modello presenta domande, spiegazioni e proposte al revisore. È fissata alla
|
||||
creazione della sessione e non cambia alla ripresa.
|
||||
_Avoid_: lingua della UI, lingua del workspace
|
||||
|
||||
### Integrazione ETL
|
||||
|
||||
**Delivery Destination**:
|
||||
Una destinazione predisposta per ricevere il SQL oppure integrarlo in un ETL. Le destinazioni
|
||||
disponibili e il default per workspace dipendono dall'installazione.
|
||||
|
||||
**SQL Delivery**:
|
||||
La consegna di un artefatto SQL alla destinazione scelta. Da sola non attesta l'inclusione del SQL
|
||||
in un ciclo ETL.
|
||||
|
||||
**Delivery Operation**:
|
||||
Un'operazione tracciata di consegna SQL o integrazione ETL, collegata alla sessione che ha prodotto
|
||||
il SQL approvato. Ha un esito distinto dalla sessione e può essere riprovata senza riaprirla.
|
||||
|
||||
**ETL Activation**:
|
||||
L'inclusione esplicitamente autorizzata di un modello nel ciclo ETL della destinazione, distinta
|
||||
dalla consegna dell'artefatto e dalla sua esecuzione immediata.
|
||||
|
||||
### Memory
|
||||
|
||||
**Memory Module**:
|
||||
Il modulo che possiede le conoscenze e le esperienze curate per migliorare schema linking e
|
||||
generazione SQL delle domande future. Le Memory appartengono a un workspace e restano distinte
|
||||
dalle Evidence.
|
||||
|
||||
**Memory Card**:
|
||||
L'unità di contenuto gestibile del Memory Module, con identità, ambito di applicazione e
|
||||
provenienza.
|
||||
_Avoid_: memoria, nota
|
||||
|
||||
**Reusable Memory**:
|
||||
Una Memory Card che esprime un chiarimento di dominio, una regola di costruzione SQL o un errore da
|
||||
evitare, valida in un ambito esplicito. Non deriva dalla sola approvazione di una scelta occasionale.
|
||||
|
||||
**Solved Question**:
|
||||
Una Memory Card che conserva una domanda risolta con la sua soluzione SQL e il contesto per
|
||||
interpretarla. È un esempio consultivo: le scelte del caso non diventano regole generali.
|
||||
_Avoid_: esempio, template
|
||||
|
||||
**Memory Link**:
|
||||
Un collegamento curato fra due card, con significato esplicito, che aiuta a ritrovare contenuti
|
||||
pertinenti. Trovare una card tramite un link non ne implica l'approvazione.
|
||||
|
||||
**Memory Graph**:
|
||||
L'insieme dei Memory Link di un workspace, usato per il recupero oltre la somiglianza del
|
||||
contenuto.
|
||||
|
||||
### Evidence
|
||||
|
||||
**Context specialist**:
|
||||
La persona competente sul dominio che redige e cura il contenuto delle Evidence. Può essere
|
||||
diversa da chi amministra l'installazione.
|
||||
_Avoid_: curatore tecnico
|
||||
|
||||
**Evidence draft**:
|
||||
Il documento iniziale scritto dallo specialista di contesto, che il sistema acquisisce e raffina
|
||||
in Evidence Unit. Può essere redatto indipendentemente dall'installazione.
|
||||
|
||||
**Evidence Module**:
|
||||
Il modulo che possiede la preparazione delle Evidence e la loro consultazione durante il workflow.
|
||||
Contribuisce alle fasi esistenti senza essere una fase e senza modificare lo stato della sessione.
|
||||
|
||||
**Evidence Unit**:
|
||||
La più piccola unità di conoscenza di dominio coerente, revisionabile e ricercabile. Ha un
|
||||
identificatore stabile, che non cambia se ne viene corretto il kind.
|
||||
_Avoid_: documento, chunk
|
||||
|
||||
**Evidence kind**:
|
||||
La categoria semantica di una Evidence Unit, che ne determina i campi: glossary, domain, enum,
|
||||
example, mapping, normalization, formula o reference. Ogni unità ha un solo kind.
|
||||
|
||||
**Glossary Evidence**:
|
||||
Una Evidence Unit che definisce il significato, i sinonimi o le varianti di un termine.
|
||||
|
||||
**Domain Evidence**:
|
||||
Una Evidence Unit che esprime una regola o un vincolo del dominio non coperto da un kind più
|
||||
specifico.
|
||||
|
||||
**Enum Evidence**:
|
||||
Una Evidence Unit che collega un insieme finito di valori memorizzati ai loro significati.
|
||||
|
||||
**Example Evidence**:
|
||||
Una Evidence Unit che associa una domanda o un input alla sua interpretazione o al risultato
|
||||
atteso.
|
||||
|
||||
**Mapping Evidence**:
|
||||
Una Evidence Unit che collega un concetto logico agli elementi dello schema fisico.
|
||||
|
||||
**Normalization Evidence**:
|
||||
Una Evidence Unit che descrive la trasformazione di una rappresentazione in una forma canonica.
|
||||
|
||||
**Formula Evidence**:
|
||||
Una Evidence Unit che contiene una singola espressione SQL componibile con i suoi input dichiarati.
|
||||
Una query completa non è una Formula Evidence.
|
||||
|
||||
**Reference Evidence**:
|
||||
Una Evidence Unit che rappresenta un collegamento esterno da restituire come contenuto autonomo,
|
||||
non come semplice provenienza.
|
||||
|
||||
**Evidence purpose**:
|
||||
L'uso dichiarato di una Evidence Unit nel workflow: disambiguazione, riscrittura, schema linking o
|
||||
generazione SQL. Il kind dice cosa contiene, il purpose quando serve.
|
||||
|
||||
**Source Evidence**:
|
||||
Il documento o la dichiarazione che sostiene il contenuto corrente di una Evidence Unit.
|
||||
|
||||
**Manual Evidence declaration**:
|
||||
La dichiarazione di un amministratore che sostiene una Evidence creata direttamente o una
|
||||
correzione del suo significato. Non implica una verifica da parte di una fonte esterna.
|
||||
|
||||
**Evidence origin**:
|
||||
Il documento da cui una Evidence Unit è stata inizialmente derivata, conservato per provenienza
|
||||
anche quando una dichiarazione manuale ne sostiene il testo corrente.
|
||||
|
||||
**Supporting excerpt**:
|
||||
Un breve estratto della Source Evidence che sostiene una Evidence Unit. Il sistema ne verifica la
|
||||
presenza; il curatore ne verifica la sufficienza.
|
||||
|
||||
**Local Evidence archive**:
|
||||
Le Evidence curate custodite dall'installazione, distinte dalle draft originali e dagli indici di
|
||||
ricerca. Comprende correzioni manuali e ritiri deliberati.
|
||||
|
||||
**Evidence consolidation**:
|
||||
L'azione esplicita che verifica le Evidence locali modificate come insieme coerente e le rende
|
||||
attive.
|
||||
_Avoid_: pubblicazione, salvataggio
|
||||
|
||||
**Active Evidence**:
|
||||
La versione consolidata delle Evidence consultata dal workflow. Un aggiornamento fallito conserva la
|
||||
versione attiva precedente.
|
||||
_Avoid_: Published Evidence
|
||||
|
||||
**Evidence preparation**:
|
||||
Il processo che trasforma Source Evidence in Evidence Unit curate tramite estrazione, una
|
||||
ristrutturazione assistita dal modello e una validazione finale. Applica le modifiche solo se sono
|
||||
tutte valide.
|
||||
|
||||
**Evidence resolution**:
|
||||
La decisione con cui un curatore risolve un problema di una Evidence Unit correggendola,
|
||||
ritirandola o ricollegandola a una fonte adeguata.
|
||||
|
||||
**Review item**:
|
||||
Un problema segnalato su una Evidence Unit che ne impedisce l'attivazione finché non viene risolto.
|
||||
|
||||
**Orphaned Evidence Unit**:
|
||||
Una Evidence Unit la cui Source Evidence non esiste più. Resta visibile per la revisione finché non
|
||||
viene eliminata, ricollegata o ne viene ripristinata la fonte.
|
||||
|
||||
**Source update conflict**:
|
||||
Un contrasto fra una fonte aggiornata e una correzione manuale già approvata. La correzione resta
|
||||
in uso finché l'amministratore non risolve il confronto.
|
||||
|
||||
**Evidence source refresh**:
|
||||
La riacquisizione delle fonti esterne richiesta dall'amministratore per rilevarne le modifiche.
|
||||
Fra due refresh fa fede il contenuto già acquisito.
|
||||
|
||||
**Formula proposal**:
|
||||
Una formula individuata durante una sessione e conservata nella sessione. Non diventa Active
|
||||
Evidence finché non viene curata e consolidata.
|
||||
|
||||
**Evidence Index**:
|
||||
La proiezione ricercabile e ricostruibile delle Active Evidence. Accelera il recupero ma non è una
|
||||
fonte di verità.
|
||||
|
||||
**Hybrid Evidence retrieval**:
|
||||
La ricerca che combina una graduatoria semantica e una lessicale in un unico ordinamento
|
||||
deterministico.
|
||||
|
||||
**Evidence Search Outcome**:
|
||||
Il risultato di una consultazione delle Evidence. Distingue una ricerca riuscita, anche senza
|
||||
risultati, da un'indisponibilità tecnica che blocca la fase fino a un nuovo tentativo.
|
||||
|
||||
**Evidence receipt**:
|
||||
La traccia minima di una consultazione conservata nella sessione: fase, purpose e Evidence
|
||||
restituite, senza duplicarne il contenuto.
|
||||
|
||||
### Catalogo dei metadati
|
||||
|
||||
**Metadata Catalog**:
|
||||
L'autorità di un'installazione per il database di ogni workspace: binding, struttura osservata,
|
||||
descrizioni, sensibilità e relazioni. Ogni uso dei metadati del database deriva da qui.
|
||||
_Avoid_: annotations, schema YAML
|
||||
|
||||
**Workspace Database**:
|
||||
Il database, limitato a un solo schema, che appartiene a un solo workspace. Un workspace ne ha al
|
||||
massimo uno.
|
||||
_Avoid_: DWH, datasource
|
||||
|
||||
**Database Binding**:
|
||||
La configurazione propria di un'installazione che indica come raggiungere un Workspace Database.
|
||||
Non è una seconda identità del database.
|
||||
_Avoid_: connessione, connection string
|
||||
|
||||
**Thoth REST Connector**:
|
||||
Il trasporto REST tipizzato con cui ThothII interroga e ispeziona un Workspace Database secondo il
|
||||
contratto DWH supportato. Non è un client per API REST arbitrarie.
|
||||
|
||||
**Orphaned Workspace Database**:
|
||||
Un Workspace Database il cui workspace non esiste più. È conservato per il recupero ma non è
|
||||
usabile finché non viene riassegnato.
|
||||
|
||||
**Introspection Capability**:
|
||||
Una categoria di struttura fisica che una Database Binding può osservare, come tabelle, colonne o
|
||||
relazioni. Una capability assente è diversa da una capability che non ha trovato elementi.
|
||||
|
||||
**Physical Table**:
|
||||
Una tabella osservata nello schema esterno di un Workspace Database, la cui identità appartiene al
|
||||
database esterno.
|
||||
|
||||
**Catalog Table**:
|
||||
La rappresentazione nel catalogo di una Physical Table. Non può essere creata o rinominata a mano,
|
||||
ma può essere rimossa con una Catalog Metadata Cleanup.
|
||||
_Avoid_: managed table
|
||||
|
||||
**Physical Column**:
|
||||
Una colonna osservata in una Physical Table, con nome, posizione, tipo e appartenenza a chiavi.
|
||||
|
||||
**Catalog Column**:
|
||||
La rappresentazione nel catalogo di una Physical Column. I fatti osservati seguono la
|
||||
sincronizzazione; descrizioni e flag di sensibilità sono modificabili.
|
||||
_Avoid_: managed column
|
||||
|
||||
**Physical Relationship**:
|
||||
Una foreign key dichiarata nel database esterno, identificata dal vincolo e dalla sequenza ordinata
|
||||
delle sue coppie di colonne.
|
||||
|
||||
**Catalog Relationship**:
|
||||
La rappresentazione nel catalogo di una Physical Relationship. Non è modificabile a mano.
|
||||
|
||||
**Logical Relationship**:
|
||||
Una relazione fra due Catalog Column gestita nel catalogo, che non corrisponde necessariamente a un
|
||||
vincolo fisico. È Generated oppure Manual.
|
||||
_Avoid_: FK logica, join suggerita
|
||||
|
||||
**Generated Relationship**:
|
||||
Una Logical Relationship ricavata da nomi, chiavi primarie e compatibilità dei tipi con regole
|
||||
deterministiche, senza AI né lettura dei dati.
|
||||
|
||||
**Manual Relationship**:
|
||||
Una Logical Relationship aggiunta dall'utente, che la ricostruzione non modifica.
|
||||
|
||||
**Logical Relationship Deletion**:
|
||||
L'esclusione persistente di una Logical Relationship, che ne impedisce la ricreazione automatica
|
||||
finché esistono entrambe le colonne collegate.
|
||||
|
||||
**Permanent Relationship Deletion**:
|
||||
La rimozione completa di una Logical Relationship, che una ricostruzione successiva può ricreare.
|
||||
|
||||
**Relationship Reconstruction**:
|
||||
L'operazione esplicita che aggiunge le Generated Relationship mancanti senza toccare quelle
|
||||
esistenti, manuali o escluse.
|
||||
|
||||
**Relationship Restore**:
|
||||
La riattivazione esplicita di una Logical Relationship esclusa.
|
||||
|
||||
**Effective Relationship Map**:
|
||||
La vista unica delle relazioni fisiche e logiche attive, con origine e stato espliciti.
|
||||
|
||||
**Catalog Metadata**:
|
||||
I campi modificabili che descrivono database, tabelle, colonne e relazioni, distinti dai fatti
|
||||
strutturali governati dalla sincronizzazione.
|
||||
|
||||
**Description**:
|
||||
Il testo curato che descrive una Catalog Table o Catalog Column. Quando presente prevale sulla
|
||||
Generated Description.
|
||||
|
||||
**Generated Description**:
|
||||
Il testo prodotto dall'AI per una Catalog Table o Catalog Column, usato quando manca una
|
||||
Description. È distinto dal commento presente nel database.
|
||||
_Avoid_: generated comment, source comment
|
||||
|
||||
**Description Consolidation**:
|
||||
L'azione che copia la Generated Description degli elementi selezionati nella loro Description.
|
||||
|
||||
**Non-generatable Description**:
|
||||
L'esito valido con cui il modello dichiara di non avere informazioni sufficienti per descrivere un
|
||||
elemento. Non è un errore.
|
||||
|
||||
**Description Generation Run**:
|
||||
L'esecuzione sequenziale che produce Generated Description con il modello scelto. Ne è attiva al
|
||||
massimo una per installazione e ogni risultato valido è salvato subito.
|
||||
|
||||
**Description Generation Unlock**:
|
||||
Il recupero amministrativo che segna come interrotta una Description Generation Run rimasta attiva
|
||||
senza un processo vivo.
|
||||
|
||||
**Catalog Sample**:
|
||||
Un piccolo campione transitorio di righe e valori di una tabella usato per generare descrizioni.
|
||||
Contiene valori reali o sintetici secondo il Sensitive Data Flag e non viene conservato.
|
||||
|
||||
**Table Synchronization**:
|
||||
La riconciliazione che rende le Catalog Table uguali alle Physical Table osservate, eliminando
|
||||
definitivamente quelle assenti.
|
||||
_Avoid_: table import
|
||||
|
||||
**Schema Synchronization**:
|
||||
La riconciliazione esplicita e autorevole di tabelle, colonne e relazioni fisiche, su uno scope o
|
||||
sull'intero schema.
|
||||
|
||||
**Catalog Sync Run**:
|
||||
L'esecuzione durevole in background di una Schema Synchronization. Ne è attiva al massimo una per
|
||||
Workspace Database.
|
||||
|
||||
**Catalog Metadata Cleanup**:
|
||||
La rimozione esplicita di tabelle, colonne o relazioni selezionate dal catalogo, senza toccare il
|
||||
database esterno. Il catalogo può restare incompleto fino alla sincronizzazione successiva.
|
||||
|
||||
**Catalog Freshness**:
|
||||
La corrispondenza fra uno scope sincronizzato e la Database Binding corrente. Uno scope sincronizzato
|
||||
con una binding precedente è stale.
|
||||
|
||||
**Metadata Content Revision**:
|
||||
La revisione crescente dello stato del catalogo che può cambiare il comportamento del workflow.
|
||||
Ogni modifica rilevante ne produce una nuova.
|
||||
|
||||
**Catalog Metadata Snapshot**:
|
||||
La proiezione immutabile dei metadati catalogati che il workflow consuma. È derivata dal catalogo e
|
||||
non è una fonte di verità.
|
||||
|
||||
**Sensitive Data Flag**:
|
||||
La classificazione binaria, decisa da una persona, che indica se una Catalog Column contiene dati
|
||||
sensibili. Prevale su qualsiasi valutazione automatica.
|
||||
_Avoid_: PII flag
|
||||
|
||||
**Sensitivity Reason**:
|
||||
La motivazione salvata insieme al Sensitive Data Flag quando l'amministratore accetta una
|
||||
valutazione. Scompare quando il flag torna non sensibile.
|
||||
_Avoid_: AI reasoning
|
||||
|
||||
**Sensitive Data Policy**:
|
||||
L'insieme versionato di regole locali che produce una Local Sensitivity Assessment. Un solo
|
||||
riscontro rende sensibile l'intera colonna.
|
||||
_Avoid_: PII filter, sample filter
|
||||
|
||||
**Local Sensitivity Assessment**:
|
||||
La valutazione locale e non vincolante di una Catalog Column, basata su metadati e contenuto e senza
|
||||
modelli generativi. Propone sensibile o non sensibile, con la copertura ottenuta.
|
||||
_Avoid_: AI suggestion, automatic flag
|
||||
|
||||
**Local NER Detector**:
|
||||
Il riconoscitore opzionale di entità, eseguito localmente, che esamina solo testo ancora ambiguo e
|
||||
fornisce indizi alla valutazione senza decidere.
|
||||
_Avoid_: AI classifier, local LLM fallback
|
||||
|
||||
**Sensitivity Analysis Run**:
|
||||
Il tentativo esplicito e tracciato di valutare una selezione di colonne con la Sensitive Data
|
||||
Policy. Non conserva valori sorgente né esiti per colonna.
|
||||
_Avoid_: Sensitive Data Suggestion Run
|
||||
|
||||
**Sensitivity Review Draft**:
|
||||
La proposta transitoria di valutazioni per le colonne selezionate, che non cambia nulla finché
|
||||
l'amministratore non salva le proprie decisioni.
|
||||
_Avoid_: automatic flag
|
||||
|
||||
### Workspace e preprocessing
|
||||
|
||||
**Workspace Descriptor**:
|
||||
La dichiarazione versionata dell'identità di un workspace e delle sue Evidence. Non contiene nulla
|
||||
del suo database, che è associato dal Metadata Catalog.
|
||||
|
||||
**Workspace Readiness**:
|
||||
La condizione in cui un workspace ha tutti gli artefatti derivati necessari al workflow ed è quindi
|
||||
utilizzabile dalle sessioni.
|
||||
|
||||
**Preprocessing**:
|
||||
La preparazione completa e non concorrente degli artefatti derivati di un workspace a partire dal
|
||||
catalogo e dalle Evidence attive. Non modifica la Memory.
|
||||
|
||||
**Preprocessing State**:
|
||||
Lo stato del preprocessing di un workspace (in corso, riuscito, fallito) insieme all'identità dei
|
||||
suoi input. Le sessioni sono ammesse solo dopo un preprocessing riuscito sugli input correnti.
|
||||
|
||||
**Reference index**:
|
||||
L'indice ricostruibile di un workspace che contiene schema, relazioni ed Evidence, interamente
|
||||
sostituibile dal preprocessing.
|
||||
|
||||
**Memory index**:
|
||||
L'indice persistente di un workspace che contiene Memory Card e Solved Question. Non è prodotto dal
|
||||
preprocessing e non viene cancellato da esso.
|
||||
|
||||
**Preprocessing Clear**:
|
||||
L'operazione che elimina tutti gli artefatti derivati di un workspace e lo rende non pronto,
|
||||
conservando Memory, sessioni, catalogo e database sorgente.
|
||||
|
||||
### Modelli
|
||||
|
||||
**Installation Model Catalog**:
|
||||
L'elenco dichiarativo dei modelli disponibili in un'installazione, con i loro usi e default. È
|
||||
l'unica autorità per i modelli di sessione, di generazione dei metadati e di embedding.
|
||||
_Avoid_: Model Catalog, Metadata Generation Model Configuration
|
||||
|
||||
**Model Usage**:
|
||||
Lo scopo per cui un modello del catalogo può essere usato: sessione, generazione dei metadati
|
||||
oppure embedding.
|
||||
|
||||
**Model Selection**:
|
||||
La scelta di un modello del catalogo per uno specifico uso. Si riferisce al modello senza
|
||||
ridefinirne provider, endpoint o capacità.
|
||||
|
||||
**Model Runtime Projection**:
|
||||
La forma derivata del catalogo modelli richiesta da uno specifico runtime, rigenerabile in ogni
|
||||
momento.
|
||||
|
||||
### Amministrazione e shell
|
||||
|
||||
**Administration Surface**:
|
||||
Un'area amministrativa autonoma: Workspace, Evidence, Memory, Database o Pi. Non dipende da una
|
||||
sessione attiva.
|
||||
|
||||
**Administration Page**:
|
||||
La rappresentazione a pagina intera di una Administration Surface, con una struttura condivisa fra
|
||||
tutte.
|
||||
_Avoid_: management popup, settings modal
|
||||
|
||||
**Administrative Page Family**:
|
||||
L'insieme delle cinque Administration Page, che condividono shell, navigazione e regole
|
||||
responsive.
|
||||
|
||||
**Administration Route**:
|
||||
L'indirizzo navigabile di una Administration Surface, ripristinabile con refresh e cronologia.
|
||||
|
||||
**Shell mode**:
|
||||
La scelta di installazione fra `embedded` e `full`, che decide chi possiede header, comandi di
|
||||
identità e preferenze visive. Non cambia workflow né persistenza.
|
||||
|
||||
**Embedded Thoth Shell**:
|
||||
L'esperienza ThothII ospitata dentro un portale host, di cui rispetta geometria, autenticazione e
|
||||
regole responsive.
|
||||
|
||||
**Full Thoth Shell**:
|
||||
L'esperienza ThothII autonoma, con header e layout propri.
|
||||
|
||||
**Portal Shell Adapter**:
|
||||
Il confine sostituibile che traduce lo stato visivo del portale host per ThothII. Non gestisce
|
||||
autorizzazione, sessioni o contenuti.
|
||||
|
||||
**Host Shell State**:
|
||||
Lo stato visivo minimo fornito dal portale host: lingua della UI, tema e fullscreen. Non include
|
||||
identità o autenticazione.
|
||||
|
||||
**Fullscreen state**:
|
||||
Lo stato temporaneo in cui l'applicazione occupa tutto lo schermo del browser. È indipendente dallo
|
||||
Shell mode.
|
||||
|
||||
**UI locale**:
|
||||
La lingua delle parti deterministiche dell'interfaccia (etichette, messaggi, istruzioni). È
|
||||
distinta dalla lingua dei contenuti del workspace.
|
||||
_Avoid_: interaction language
|
||||
|
||||
### Installazione e distribuzione
|
||||
|
||||
**Installation**:
|
||||
Una copia in esecuzione di ThothII con configurazione, segreti, catalogo e dati propri.
|
||||
_Avoid_: deployment, istanza
|
||||
|
||||
**Manual standalone installation**:
|
||||
Un'installazione predisposta per l'uso autonomo da chi possiede il computer, con Full Thoth Shell e
|
||||
servizi applicativi locali. DWH e provider LLM restano esterni.
|
||||
|
||||
**Installation bootstrap**:
|
||||
Le attività iniziali che rendono disponibile un'installazione: verifica dell'host, configurazione,
|
||||
credenziali protette e avvio. Non è un installer dell'applicazione.
|
||||
|
||||
**Installation preparation**:
|
||||
La compilazione dei documenti che descrivono workspace e parametri dell'installazione, prima di
|
||||
applicarli.
|
||||
|
||||
**Installation validation**:
|
||||
La verifica ripetibile di completezza e coerenza dei documenti di installazione, che distingue ciò
|
||||
che è verificabile prima dell'avvio da ciò che richiede l'applicazione in esecuzione.
|
||||
|
||||
**Installation execution**:
|
||||
L'applicazione dei documenti verificati per predisporre e avviare ThothII, senza chiedere nuovi
|
||||
parametri all'operatore.
|
||||
_Avoid_: installazione interattiva
|
||||
|
||||
**Platform acceptance**:
|
||||
La verifica che un'installazione si predisponga e si avvii su una combinazione di sistema
|
||||
operativo, architettura e runtime. È distinta dalla verifica funzionale con DWH e LLM.
|
||||
|
||||
**Customer-Hosted Installation**:
|
||||
Un'installazione eseguita interamente nel perimetro controllato dal cliente. Credenziali, domande,
|
||||
metadati e risultati non ne escono.
|
||||
_Avoid_: on-premise deployment, self-managed deployment
|
||||
|
||||
**Community Edition**:
|
||||
La distribuzione open source, gratuita anche in produzione, che esegue l'intero workflow
|
||||
fondamentale.
|
||||
_Avoid_: free tier, trial edition
|
||||
|
||||
**Enterprise Edition**:
|
||||
La distribuzione con licenza commerciale che aggiunge governance organizzativa ed esercizio
|
||||
production-grade alla Community Edition.
|
||||
_Avoid_: paid tier, pro edition
|
||||
+20
-8
@@ -25,7 +25,7 @@ and invariants are in [AGENTS.md](AGENTS.md); prior snapshots remain in Git.
|
||||
pulls, local operator UID, resumable volume initialization, Catalog/Memory migrations
|
||||
and service/authentication health. Tests cover the public native command with closed
|
||||
stdin and Linux volume/private-secret behavior using published images. Platform success
|
||||
explicitly leaves workspace readiness false. The current
|
||||
explicitly leaves workspace readiness false. The earlier
|
||||
[preview.5 release](https://git.tylconsulting.it/mptyl/ThothII/releases/tag/installation-v0.1.0-install-preview.5)
|
||||
publishes amd64/arm64 images and native bundles. Its unmodified arm64 archive passed
|
||||
apply/retry, UI/admin login and live user revocation in a Linux consumer without host
|
||||
@@ -35,20 +35,25 @@ and invariants are in [AGENTS.md](AGENTS.md); prior snapshots remain in Git.
|
||||
storage, optimistic versions and container-side Catalog connection tests. Durable
|
||||
Catalog import receipts survive administrative deletion; reruns stop on divergence.
|
||||
Source/native command, authenticated client, concurrent/recovery and real PostgreSQL
|
||||
tests cover this increment. These changes are not included in published preview.5.
|
||||
tests cover this increment. These changes are included from preview.6 onward.
|
||||
Ticket #49 adds existing durable Catalog Sync Runs and preprocessing to apply,
|
||||
preserving human review (exit 3), curated content and Memory. Named one-shot checks
|
||||
cover workspace diagnostics, workflow configuration and Pi/default-model smoke.
|
||||
Reports distinguish platform, binding, workspace readiness and manual functional
|
||||
acceptance. This increment also requires a later release than preview.5.
|
||||
acceptance. This increment is included from preview.6 onward.
|
||||
Ticket #50 adds an explicit `prepare-source-installation.mjs` producer from an
|
||||
isolated committed worktree. Source bundles pin local application image IDs and
|
||||
upstream Docker Hub digests; the same native plan/apply path verifies provenance,
|
||||
shares journal/locks and never falls back to a build. Ticket #51 adds guarded
|
||||
interrupted preprocessing recovery, fencing of delayed/orphan workers and preserved
|
||||
pending schema review even during binding retry. Real-host
|
||||
acceptance and curated examples remain pending. Earlier previews are superseded
|
||||
for platform apply; no complete installer/OS acceptance is claimed.
|
||||
pending schema review even during binding retry. The current
|
||||
[preview.7 release](https://git.tylconsulting.it/mptyl/ThothII/releases/tag/installation-v0.1.0-install-preview.7)
|
||||
includes these increments and fixes local session identity persistence for the
|
||||
mapped operator UID. It publishes amd64/arm64 images and native bundles, with
|
||||
anonymous pull and image smoke checks. See the
|
||||
[completion and acceptance report](docs/reports/2026-10-06-installation-completion.md)
|
||||
for consumer results and the next user steps. Real-host acceptance and curated
|
||||
examples remain pending; no Windows/Omarchy/macOS acceptance is claimed.
|
||||
|
||||
- React supports full/embedded rendering independently of local/OIDC/upstream auth,
|
||||
with EN/IT UI and immutable session interaction language. See
|
||||
@@ -103,6 +108,12 @@ embedded/upstream identity, not another ThothII OIDC login. Read
|
||||
|
||||
Last recorded application deliveries (not a fresh runtime attestation):
|
||||
|
||||
- [Coordinated ThothII/Omics release](docs/reports/2026-09-26-server-release-execution.md):
|
||||
core/frontend `497ab840-preflight`, Omics proxy fix `928f7e9f` with existing web
|
||||
image retained. Automated acceptance passed; on September 27 the operator confirmed
|
||||
browser access, UI controls and session start/stop/resume. Functional browser
|
||||
acceptance passed; remaining extended checks are handed off in the
|
||||
[server acceptance follow-up](docs/reports/2026-09-27-server-acceptance-handoff.md).
|
||||
- [Session dialogs](docs/reports/2026-09-14-session-dialogs-release.md):
|
||||
`b1723c34-session-dialogs-20260914`, frontend-only.
|
||||
- [Session layout/Memory fix](docs/reports/2026-09-14-session-layout-memory-fix.md):
|
||||
@@ -116,8 +127,9 @@ A later deployment does not prove every earlier acceptance item passed.
|
||||
- The first installation acceptance uses an ad hoc
|
||||
[Chinook workspace without Evidence](docs/testing/chinook-installation-smoke.md),
|
||||
backed by a separate local PostgreSQL test container. Its fixture import,
|
||||
read-only credentials, offline validation and platform apply were verified; binding
|
||||
import, workspace readiness and a human-reviewed question remain pending. Evidence
|
||||
read-only credentials, offline validation, platform apply, binding import and full
|
||||
workspace readiness were verified using source and published preview.7 bundles.
|
||||
A human-reviewed question and Windows/WSL2 host acceptance remain pending. Evidence
|
||||
acceptance and the three curated examples are separate later work.
|
||||
- Fresh-machine installation acceptance, including real DWH/model endpoints, remains
|
||||
a separate operator exercise, ordered Windows/WSL2, then Omarchy, then macOS.
|
||||
|
||||
@@ -17,6 +17,11 @@ test("consumer bundle pins every service and carries all source bind resources",
|
||||
assert.equal(compose.services["catalog-migrate"].image, images.core);
|
||||
assert.equal(compose.services["workspace-maintenance"].image, images.core);
|
||||
assert.equal(compose.services["embedding-model-init"].image, images.embedding);
|
||||
// Both session commands and maintenance must retain local identity under a
|
||||
// writable shared volume when the installer maps the operator's Unix UID.
|
||||
assert.equal(compose.services.core.environment.THT_HOME, "/data/sessions/.thothii");
|
||||
assert.equal(compose.services["workspace-maintenance"].environment.THT_HOME,
|
||||
compose.services.core.environment.THT_HOME);
|
||||
for (const service of Object.values(compose.services)) {
|
||||
assert.equal(service.build, undefined);
|
||||
assert.equal(service.pull_policy, undefined);
|
||||
|
||||
@@ -12,6 +12,7 @@ services:
|
||||
THT_HARNESS_DIR: /app/harness
|
||||
THT_BIN: /opt/venv/bin/tht
|
||||
THT_DATA_ROOT: /data
|
||||
THT_HOME: /data/sessions/.thothii
|
||||
SETTINGS_FILE: /data/settings/settings.json
|
||||
THT_EVIDENCE_HOST_REGISTRY_ROOT: ${THT_WORKSPACE_REGISTRY_ROOT:-}
|
||||
THT_MAINTENANCE_FILE: /data/settings/maintenance.json
|
||||
@@ -124,6 +125,7 @@ services:
|
||||
THT_HARNESS_DIR: /app/harness
|
||||
THT_BIN: /opt/venv/bin/tht
|
||||
THT_DATA_ROOT: /data
|
||||
THT_HOME: /data/sessions/.thothii
|
||||
THT_WORKSPACE_REGISTRY_ROOT: /data/workspace-registry
|
||||
THT_WORKSPACE_GIT_REMOTE: ${THT_WORKSPACE_GIT_REMOTE:?set THT_WORKSPACE_GIT_REMOTE}
|
||||
THT_WORKSPACE_GIT_BRANCH: ${THT_WORKSPACE_GIT_BRANCH:-main}
|
||||
|
||||
@@ -1,16 +1,24 @@
|
||||
services:
|
||||
# Long-running local services restart after a Docker or Mac restart, unless stopped with stop.
|
||||
# One-shot services (embedding-model-init, catalog-migrate) and workspace-maintenance keep "no".
|
||||
catalog-db:
|
||||
restart: unless-stopped
|
||||
|
||||
embedding:
|
||||
restart: unless-stopped
|
||||
|
||||
core:
|
||||
environment:
|
||||
NODE_ENV: development
|
||||
THT_WORKSPACE_INSTALLATION_ID: ${THT_WORKSPACE_INSTALLATION_ID:-local}
|
||||
ports:
|
||||
- "127.0.0.1:${THOTH_CORE_HTTP_PORT:-8787}:8787"
|
||||
restart: "no"
|
||||
restart: unless-stopped
|
||||
|
||||
frontend:
|
||||
ports:
|
||||
- "127.0.0.1:${THOTH_HTTP_PORT:-8080}:8080"
|
||||
restart: "no"
|
||||
restart: unless-stopped
|
||||
|
||||
workspace-maintenance:
|
||||
environment:
|
||||
@@ -22,4 +30,4 @@ services:
|
||||
qdrant:
|
||||
ports:
|
||||
- "127.0.0.1:6333:6333"
|
||||
restart: "no"
|
||||
restart: unless-stopped
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
# PostgreSQL come autorità dei metadati dei database dei workspace
|
||||
|
||||
ThothII userà un Metadata Catalog PostgreSQL interno per conservare, per ogni workspace, la
|
||||
struttura fisica acquisita interrogando il relativo database e i metadati semantici generati con
|
||||
l'AI. Ogni Workspace Database conserverà un `workspace_id` obbligatorio e univoco: questo realizza
|
||||
l'associazione uno-a-uno senza introdurre nel catalogo una tabella Workspace o una foreign key SQL.
|
||||
Identità e lista dei workspace resteranno autorevoli in `thoth-workspaces.yaml`; il servizio
|
||||
validerà il riferimento contro quel catalogo. `schema/annotations.yaml` verrà sostituito come input
|
||||
del core in uno step successivo; l'interfaccia e il lifecycle amministrativi resteranno separati dal
|
||||
workflow NL→SQL.
|
||||
|
||||
## Considered Options
|
||||
|
||||
- Conservare `annotations.yaml` come fonte di verità avrebbe mantenuto il revisionamento Git, ma
|
||||
non avrebbe fornito il CRUD e il processo di introspezione/generazione richiesti.
|
||||
- Leggere metadati mutabili dal catalogo senza un confine esplicito avrebbe accoppiato il workflow
|
||||
alla disponibilità del nuovo servizio e consentito viste parziali durante gli aggiornamenti.
|
||||
|
||||
## Consequences
|
||||
|
||||
PSD importerà le annotations esistenti; gli altri workspace genereranno i metadati da zero. Il
|
||||
cutover futuro dovrà sostituire consapevolmente i consumatori delle annotations e verificarne
|
||||
l'equivalenza semantica. PostgreSQL può garantire che uno stesso `workspace_id` non sia assegnato a
|
||||
due database, ma l'esistenza del workspace e la gestione di rename o rimozioni restano responsabilità
|
||||
del confine applicativo con il catalogo YAML. Le sessioni di test esistenti non sono un vincolo di
|
||||
migrazione.
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-06-25
|
||||
---
|
||||
|
||||
# Run the agent through Pi RPC with a gate extension
|
||||
|
||||
The model runs inside Pi in `--mode rpc`, one child process per session. Human review is enforced
|
||||
by a gate extension inside Pi (`harness/.pi/extensions/tht-gate.js`) that emits widget descriptors
|
||||
through Pi's extension UI requests; the backend only translates those requests and the reviewer's
|
||||
responses between Pi and the browser and implements no gate logic of its own. The gate,
|
||||
anti-bypass and kickoff logic came from ChironeWp3 and already relied on Pi's extension and RPC
|
||||
contract; reimplementing them in the backend would have meant rewriting the most delicate part of
|
||||
the workflow from scratch.
|
||||
|
||||
## Consequences
|
||||
|
||||
Every reviewer interaction is a JSON widget descriptor, so the browser, not a terminal, is the
|
||||
primary reviewer surface (see ADR-0009 for native terminal rendering). Pi upgrades are a direct
|
||||
dependency of the review contract.
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-06-25
|
||||
---
|
||||
|
||||
# Keep workflow state in harness phase documents
|
||||
|
||||
The harness owns the NL→SQL workflow and all of its persistence. A session is a manifest, one
|
||||
document per phase (`question.md`, `schema_linking.json`, `sql_final.sql`, …) and an append-only
|
||||
decision ledger; there is no stored transcript, and a resumed Pi process rebuilds its context from
|
||||
those documents. The workflow is a linear sequence of phases declared in `harness/workflow.yaml`,
|
||||
and the current phase is never stored: it is an integer derived by folding the ledger. This keeps
|
||||
the ChironeWp3 session model, whose append-only ledger was its most reliable part, and makes
|
||||
resumption independent of chat history.
|
||||
|
||||
## Consequences
|
||||
|
||||
What is not recorded in a phase document or in the ledger did not happen. Phase logic must be read
|
||||
from the fold, not from a field, and adding parallel or optional branches would require a different
|
||||
model than the linear workflow. Where sessions are stored changed later (ADR-0011); this ownership
|
||||
did not.
|
||||
@@ -1,19 +0,0 @@
|
||||
# Riferimenti al secret store per i Workspace Database
|
||||
|
||||
Il Metadata Catalog non conserverà credenziali o chiavi dei Workspace Database. Riuserà il secret
|
||||
store cifrato già posseduto da ThothII e conserverà soltanto riferimenti ai requisiti segreti del
|
||||
workspace, evitando un secondo vault e impedendo che API, esportazioni o log espongano i valori.
|
||||
|
||||
## Considered Options
|
||||
|
||||
- Copiare i campi testuali del modello ThothAI avrebbe semplificato il CRUD, ma avrebbe conservato
|
||||
password e passphrase in chiaro.
|
||||
- Introdurre subito un secondo vault avrebbe separato il catalogo dal runtime workspace, ma avrebbe
|
||||
duplicato cifratura, rotazione, autorizzazioni e procedure operative senza un'esigenza distinta.
|
||||
|
||||
## Consequences
|
||||
|
||||
Il catalogo e il runtime condividono l'identità dei requisiti segreti, mentre permessi e API del
|
||||
catalogo restano separati. Sostituzione e cancellazione di un Workspace Database dovranno definire
|
||||
esplicitamente il lifecycle dei relativi riferimenti senza includere i valori nelle transazioni del
|
||||
catalogo PostgreSQL.
|
||||
@@ -1,26 +0,0 @@
|
||||
# Binding di database specifiche dell'installazione
|
||||
|
||||
Il Metadata Catalog separa il Workspace Database logico dalla Database Binding che lo rende
|
||||
raggiungibile in una specifica installazione. Esiste un solo Workspace Database per `workspace_id`
|
||||
e una sola binding attiva nel catalogo di ciascuna installazione; per esempio PSD usa REST in locale
|
||||
e PostgreSQL diretto sul server senza diventare due database distinti.
|
||||
|
||||
Nel modello finale il catalogo è autorevole per engine, nome fisico, schema, capability e binding,
|
||||
mentre `thoth-workspaces.yaml` conserva l'identità del workspace. Gli attuali campi DWH dei
|
||||
descriptor sono una sorgente di bootstrap da importare e confrontare durante un cutover esplicito,
|
||||
non una seconda fonte di verità permanente.
|
||||
|
||||
## Considered Options
|
||||
|
||||
- Conservare un record database per ogni trasporto avrebbe duplicato identità, struttura e
|
||||
metadati dello stesso DWH fra locale e server.
|
||||
- Conservare permanentemente i dati DWH sia nello YAML sia nel catalogo avrebbe introdotto
|
||||
conflitti non risolvibili deterministicamente.
|
||||
- Rendere globali le binding avrebbe mescolato endpoint e credenziali che appartengono a
|
||||
installazioni con topologie e confini di sicurezza differenti.
|
||||
|
||||
## Consequences
|
||||
|
||||
La lista amministrativa unisce workspace YAML, database configurati e record orphaned. Il cutover
|
||||
deve importare e confrontare la configurazione esistente prima di rimuoverla dai descriptor; il
|
||||
runtime non deve osservare simultaneamente due autorità discordanti.
|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-06-25
|
||||
---
|
||||
|
||||
# Keep the workflow CLI in Python
|
||||
|
||||
The deterministic workflow logic (introspection, value sampling, LSH and RRF search, schema
|
||||
linking, SQL validation and preview) lives in a Python CLI inside the harness, ported from
|
||||
ChironeWp3, and the gate calls it through `bash`. The Node backend does not reimplement it. Porting
|
||||
the existing SQLAlchemy, LSH and schema-linking code was less risky than a TypeScript rewrite, and
|
||||
it kept drivers such as Informix, which have no usable Node driver, available.
|
||||
|
||||
## Consequences
|
||||
|
||||
The harness has two runtimes (Python and the JavaScript gate), and the CLI's `--json` output is a
|
||||
machine contract between them and the backend. The backend later gained its own database access
|
||||
for the Metadata Catalog (ADR-0028); the NL→SQL workflow logic remains in Python.
|
||||
@@ -1,22 +0,0 @@
|
||||
# Metadata Catalog nello stesso backend con Kysely
|
||||
|
||||
Il Metadata Catalog vive nello stesso processo Fastify come modulo isolato, invece di introdurre un
|
||||
microservizio. Usa il driver `pg` già presente attraverso Kysely per query, transazioni e migrazioni
|
||||
tipizzate; route, repository, service, readiness e diagnostica restano separati dal workflow e
|
||||
l'indisponibilità del catalogo non rende indisponibili sessioni o SSE.
|
||||
|
||||
## Considered Options
|
||||
|
||||
- Un microservizio avrebbe conservato letteralmente il backend bridge senza database, ma avrebbe
|
||||
aggiunto deployment, autenticazione e failure mode per un solo contesto amministrativo.
|
||||
- Usare soltanto `pg` avrebbe evitato una dipendenza, ma avrebbe richiesto infrastruttura locale per
|
||||
transazioni, tipi delle righe, ordinamento e locking delle migrazioni.
|
||||
- Drizzle o Prisma avrebbero aggiunto schema DSL, generatori e toolchain non necessari a un servizio
|
||||
che vuole mantenere SQL e constraint PostgreSQL espliciti.
|
||||
|
||||
## Consequences
|
||||
|
||||
Il backend possiede una connection pool del catalogo e la chiude con il lifecycle Fastify. Le
|
||||
migrazioni timestampate sono compilate insieme al backend ma vengono eseguite soltanto da
|
||||
`catalog:migrate`, con credenziali migrator separate dal ruolo DML usato a runtime. Il modulo resta
|
||||
dietro un'interfaccia repository per mantenere unit test e route test indipendenti da PostgreSQL.
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-06-25
|
||||
---
|
||||
|
||||
# Tear down later artifacts when reopening a phase
|
||||
|
||||
When the reviewer returns to an earlier phase, every choice made after that point is forgotten and
|
||||
the artifacts produced by later phases are deleted. `tht phase reopen` first appends
|
||||
`phase_reopened` to the ledger and then removes the later artifacts; the ledger itself stays
|
||||
append-only, and an effective view excludes decisions made stale by the reopen. ChironeWp3 only
|
||||
appended the reopen decision, so stale artifacts and decisions survived and could block
|
||||
finalization (for example orphan CTEs); a rollback that leaves inconsistent state was judged worse
|
||||
than none.
|
||||
|
||||
## Consequences
|
||||
|
||||
Helpers must read the effective view, never the raw ledger. The ledger-first order means a crash
|
||||
can leave a reopened session with stale files, which later steps must tolerate, but never later
|
||||
artifacts without the reopen that invalidates them.
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
status: superseded by ADR-0010
|
||||
date: 2026-06-25
|
||||
---
|
||||
|
||||
# Run all layers on the operator workstation
|
||||
|
||||
The first release runs frontend, backend and harness on the operator's own machine over localhost,
|
||||
like a desktop application with a browser UI, while the data warehouse and vector store stay
|
||||
central and are reached over REST. This matched how operators worked on dedicated workstations
|
||||
with ChironeWp3. Keeping three separate layers even on one machine was meant to allow a later move
|
||||
to a central web application without changing the contracts.
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
status: superseded by ADR-0013
|
||||
date: 2026-06-25
|
||||
---
|
||||
|
||||
# Share a central vector store through reader and writer keys
|
||||
|
||||
The pgvector store stays central and is exposed over REST through two allow-listed endpoints with
|
||||
distinct API keys: a reader key for search and an optional writer key that can only upsert records
|
||||
and read hashes, never delete. A targeted `memory save-one` upsert lets a remote workstation save
|
||||
the Memory it just created without a full server-side resync. The split let remote workstations
|
||||
write Memory without receiving a key that could clear the shared store.
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
status: superseded by ADR-0015
|
||||
date: 2026-06-25
|
||||
---
|
||||
|
||||
# Select authentication from none, mock or OIDC
|
||||
|
||||
Authentication is chosen by configuration: `none` (a fixed local user, the primary mode for a
|
||||
single-operator workstation), `mock` (a static user from a header, for tests) or standard `oidc`.
|
||||
Sessions record the authenticated user as their author. One OIDC code path covers both an external
|
||||
identity provider and a later central deployment, while `none` keeps the harness and its tests
|
||||
independent of authentication.
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
status: superseded by ADR-0012
|
||||
date: 2026-06-25
|
||||
---
|
||||
|
||||
# Define workspaces as harness YAML
|
||||
|
||||
Each workspace (relational database, vector store, Evidence and embeddings) is a YAML file under
|
||||
`harness/workspaces/`, with secrets kept in `.env` and referenced as `${VAR}`. Loading is isolated
|
||||
in one harness module so that a later storage change touches only that boundary. This followed
|
||||
ChironeWp3 and kept workspaces versionable and testable.
|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
status: proposed
|
||||
date: 2026-07-04
|
||||
---
|
||||
|
||||
# Render gate widgets natively in the Pi terminal
|
||||
|
||||
When Pi runs interactively, the gate could render reviewer widgets with Pi's native terminal
|
||||
primitives (`select`, `confirm`, `editor`) instead of printing the JSON widget descriptor, while
|
||||
RPC mode keeps emitting descriptors for the browser. The discriminator is `ctx.mode === "tui"`;
|
||||
`ctx.hasUI` cannot be used because it is also true in RPC mode on current Pi releases. A feasibility
|
||||
review found the approach supported by Pi, but only the `ctx.mode` guards for terminal-only notices
|
||||
were implemented; in a terminal the gate still shows raw JSON.
|
||||
|
||||
## Consequences
|
||||
|
||||
If accepted, every widget kind needs a terminal mapping with the same response shape as the RPC
|
||||
path, including multi-select and invalid-choice handling, and both paths need round-trip tests.
|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-07-11
|
||||
---
|
||||
|
||||
# Ship two invariant application images
|
||||
|
||||
ThothII is distributed as two application images: `core` (backend, harness, Pi and the workflow
|
||||
CLI) and `frontend` (the React build and its reverse proxy). The same images run on the server that
|
||||
hosts the data warehouse, on a standalone server and on a PC or Mac. Differences between those
|
||||
targets are expressed only through adapters, configuration and deployment profiles, never through
|
||||
workflow variants or differently built images. This replaces the workstation-only model of
|
||||
ADR-0005.
|
||||
|
||||
## Consequences
|
||||
|
||||
Customer paths, credentials and certificates never enter an image or the portable Compose files;
|
||||
they are supplied by installation-local configuration and secrets.
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-07-16
|
||||
---
|
||||
|
||||
# Store sessions per principal
|
||||
|
||||
A session belongs to an authenticated principal identified by `(issuer, subject)`, never by email
|
||||
or username. On a server, sessions, artifacts, the decision ledger and preferences are stored in a
|
||||
private PostgreSQL schema protected by forced row-level security, a runtime role without
|
||||
`BYPASSRLS` and a transaction-local actor context; database failures fail closed. A local
|
||||
installation keeps them on the filesystem, with no fallback or synchronization between the two.
|
||||
Only artifacts and the ledger are durable: chat and SSE remain runtime memory, as required by
|
||||
ADR-0002.
|
||||
|
||||
## Consequences
|
||||
|
||||
Users in the configured administrators group can manage every session; any other unauthorized
|
||||
access returns 404. Sessions get no embeddings or vector columns.
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-08-03
|
||||
---
|
||||
|
||||
# Keep workspaces in a Git registry with pinned revisions
|
||||
|
||||
Workspace definitions live as versioned YAML in a generic remote Git repository, independent of
|
||||
any particular data warehouse, vector store or Git hosting provider. Each installation keeps a
|
||||
persistent local checkout, resolves its own connectivity through local variables and secret files,
|
||||
and exchanges changes by pull and push. Every new session is pinned to an immutable workspace
|
||||
revision, and the installation keeps working from its last valid snapshot when the remote is
|
||||
unavailable. This replaces harness-local YAML (ADR-0008) so that the same logical workspace can be
|
||||
used by several installations.
|
||||
|
||||
## Consequences
|
||||
|
||||
Secret values never enter the repository. The workspace descriptor was later narrowed to identity
|
||||
and Evidence: database facts moved to the Metadata Catalog (ADR-0025, ADR-0040) and model facts to
|
||||
the installation (ADR-0037).
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-08-08
|
||||
---
|
||||
|
||||
# Run Qdrant and Ollama inside the installation
|
||||
|
||||
ThothII owns its semantic infrastructure: every deployment includes a private Qdrant vector store
|
||||
and a private Ollama embedding service as mandatory Compose services, reachable only on the
|
||||
internal network. Qdrant replaces pgvector as the only vector store, and Ollama replaces
|
||||
workspace-selected external embedding endpoints, with `qwen3-embedding:0.6b` (1024 dimensions,
|
||||
CPU-viable, multilingual) as the required model. The data warehouse remains external and
|
||||
read-only. This replaces the shared vector store of ADR-0006.
|
||||
|
||||
## Consequences
|
||||
|
||||
Vector indexes are derived data that each installation must build through preprocessing. One
|
||||
collection per workspace initially held schema, Evidence and Memory points; ADR-0041 later split
|
||||
reference and memory collections.
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-08-15
|
||||
---
|
||||
|
||||
# Use one tht command name for host and core
|
||||
|
||||
The only product command is `tht`, and the name covers two programs: a native Go binary on the host
|
||||
for installation, lifecycle, authentication and diagnostics, and the Python workflow CLI inside
|
||||
`core` used by Pi, the gate and the backend. `thothctl` was removed without an alias or
|
||||
deprecation period. The host binary needs no Go, Python or virtualenv on macOS, Linux or Windows;
|
||||
the Python CLI is never installed on the host or shown in operator help.
|
||||
|
||||
## Considered Options
|
||||
|
||||
- A separate name such as `tht-runtime` for the inner CLI was rejected to keep one product name.
|
||||
|
||||
## Consequences
|
||||
|
||||
Commands called by Pi, the gate or the backend are machine contracts: their semantics, pristine
|
||||
`--json` output, stdin handling and exit codes do not change to simplify operator help.
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-08-16
|
||||
---
|
||||
|
||||
# Authenticate with local accounts or OIDC
|
||||
|
||||
Production authentication is either `local` (passwords hashed with Argon2id, optional "remember
|
||||
me" sessions) or provider-neutral `oidc`. OIDC must return a `groups` claim in the ID token as a
|
||||
JSON array; a missing or malformed claim fails authentication instead of granting ordinary access.
|
||||
Groups map to ThothII roles in installation configuration, and each mapped group must be proven to
|
||||
exist through a provider-specific catalog adapter, initially Authentik. The browser receives only
|
||||
an opaque `HttpOnly` session cookie and never stores tokens. `none` and `mock` are test-only. This
|
||||
replaces ADR-0007.
|
||||
|
||||
## Consequences
|
||||
|
||||
`upstream`, where a trusted proxy injects identity headers, was kept as a migration adapter. It
|
||||
became the integration path for Omics Portal (ADR-0045).
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-08-20
|
||||
---
|
||||
|
||||
# Issue one revocable DWH REST key per installation
|
||||
|
||||
The single shared `X-API-Key` protecting the data warehouse REST route is replaced by one random
|
||||
256-bit key per ThothII installation, independently rotatable, optionally expiring and revocable.
|
||||
A separate `dwh-auth` service checks the key through Nginx `auth_request` against a protected
|
||||
file-based registry. It is optional server infrastructure that lives in this repository but is not
|
||||
started by `tht`, and the client protocol is unchanged.
|
||||
|
||||
## Considered Options
|
||||
|
||||
- Extending the portable `tht` CLI would distribute server-only administration code to every
|
||||
workstation, although the route has its own lifecycle.
|
||||
- A manual Nginx key map encourages plaintext keys and makes rotation and revocation unreliable.
|
||||
- SQLite would add a dependency, migrations and backups without benefit at this registry size.
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
status: superseded by ADR-0043
|
||||
date: 2026-08-24
|
||||
---
|
||||
|
||||
# Use workspace activation as the Evidence publication boundary
|
||||
|
||||
Curated Evidence becomes Published Evidence only when it is valid, belongs to the
|
||||
active workspace revision, and belongs to the atomically published Evidence generation.
|
||||
Human Git review remains required before activation, but its approval is not duplicated
|
||||
as mutable state in the Evidence manifest; this keeps Git and the workspace registry as
|
||||
the existing sources of truth instead of introducing a second approval mechanism.
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-08-24
|
||||
---
|
||||
|
||||
# Keep Evidence identifiers independent from kind
|
||||
|
||||
An Evidence Unit keeps the same identifier when its kind is corrected or its Source
|
||||
Evidence is unambiguously renamed; kind remains a separate validated field. This avoids
|
||||
breaking citations and evaluation fixtures for a classification change, while genuine
|
||||
semantic splits receive new identifiers so independent units never share an identity.
|
||||
Identifiers use `evidence:<slug>`, are assigned once, persisted in the manifest and are
|
||||
never recomputed automatically from mutable titles, paths or content hashes.
|
||||
@@ -1,152 +0,0 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-09-08
|
||||
---
|
||||
|
||||
# Maintain local Evidence with external editors and manual consolidation
|
||||
|
||||
Evidence management must provide complete access to registered Evidence and a
|
||||
maintenance path, as accepted in Q11–Q15 and revised during simplification. The owner subsequently
|
||||
clarified that a context specialist writes drafts independently of the installation
|
||||
and without PostgreSQL access; the system refines and stores them locally for use
|
||||
and maintenance. Implementation is pending.
|
||||
|
||||
The storage mechanics of Q11 were revisited in the
|
||||
[simplification review](../plans/2026-09-08-memory-evidence-simplification-review.md).
|
||||
The original choice combined the workspace repository as Evidence authority with
|
||||
application-managed Git writes. The owner accepted the separation of external draft
|
||||
files/repositories from a durable local canonical file archive and removes
|
||||
commit/push from normal CRUD. The management surface must expose discoverable,
|
||||
editable Markdown for domain specialists, without JSONL editing. The owner chose
|
||||
external editors for release 0: their preferred Mac/PC editor or vim/nano on the
|
||||
server. No web editor or content form is required. The page keeps browsing,
|
||||
filtering, and detail, with actual host file paths and maintenance instructions.
|
||||
The owner also requested manual consolidation followed by manual Git diff, commit,
|
||||
and push, relying on operator discipline rather than automation. The owner accepted
|
||||
the remaining simplifications and requested explicit clarification of the core
|
||||
format change and the simple terminal-based Git check. The original application Git writer
|
||||
is not the final implementation prescription. A suggestion
|
||||
to move Evidence authority into PostgreSQL was withdrawn after the clarification.
|
||||
Memory remains a distinct module with its own PostgreSQL authority under
|
||||
[ADR 0018](0018-use-postgres-for-memory-and-qdrant-for-retrieval.md).
|
||||
|
||||
## Manual consolidation and Git follow-up
|
||||
|
||||
The external-editor decision replaces the form's single Save with saving files and
|
||||
running one consolidation command. The command checks expected structure, required
|
||||
fields, types, identifiers, references, and provenance. It reports the affected file
|
||||
and the necessary correction. Invalid input stops activation; valid input updates
|
||||
derived metadata, the corpus, and the Evidence index. New and deleted files use the
|
||||
same path. An inaccessible archive must not be interpreted as deleted Evidence.
|
||||
Structural validation does not prove semantic correctness or rerun model refinement
|
||||
to rewrite manually edited rules.
|
||||
|
||||
The core reads only successfully consolidated active content, never the editable
|
||||
working files directly. Candidate validation and activation must preserve the last
|
||||
valid corpus on failure, or report unavailability if its integrity cannot be
|
||||
guaranteed. Unconsolidated edits must not mix new text with old retrieval data.
|
||||
|
||||
Consolidation reports full local success only once the updated content is available
|
||||
to the core. If persistence succeeds but activation fails, the command reports the
|
||||
partial outcome and can be rerun without duplicating units or losing edits.
|
||||
The operation does not imply atomicity across
|
||||
authoritative storage and Qdrant; their failure and recovery behavior requires
|
||||
explicit implementation. An interrupted operation must not leave a partial corpus
|
||||
advertised as ready for subsequent use.
|
||||
|
||||
The maintained archive is a persistent Git working tree containing the local
|
||||
Evidence; it may reuse the workspace repository. Draft sources and curated units
|
||||
remain distinct even when in the same repository. Setup and the page identify the
|
||||
repository, working tree, actual host paths, branch, and configured remote. A
|
||||
rebuildable runtime snapshot is not the editing location.
|
||||
|
||||
Before consolidation, the operator checks Git status, including inspection of new
|
||||
untracked files. Normal terminal Git diff commands are available for line-level
|
||||
inspection when needed; no custom viewer or mandatory double review is required.
|
||||
After consolidation, the operator stages the Evidence and required metadata changes,
|
||||
commits, and pushes using normal Git commands. No watcher, automatic Git writes, retrying push, pull, merge,
|
||||
or dedicated web execution control is required. Missing credentials, unconfigured
|
||||
upstreams, and Git conflicts are handled by the operator.
|
||||
|
||||
Consolidation activates local changes before commit/push. If the operator omits the
|
||||
Git steps or push fails, the local update remains effective while transfer to the
|
||||
remote is incomplete. Pushing does not automatically update other installations.
|
||||
The system relies on operator discipline to complete the sequence; it does not add
|
||||
a separate editorial publication state machine or require a second reviewer.
|
||||
|
||||
Approved conflict repairs from the core still call the same persistence and
|
||||
activation service directly. They do not require an external editor or manual
|
||||
consolidation before the session can use its own approved correction. Their local
|
||||
file changes are included in the operator's subsequent Git maintenance.
|
||||
|
||||
## Administration without concurrent core work
|
||||
|
||||
The owner's simplification instruction replaces the earlier Q12 requirement to
|
||||
refresh open sessions after administrative edits. Core activity can be assumed
|
||||
absent during administration, or its overlap can be ignored. No dedicated live
|
||||
update, session notification, restart, maintenance mode, or reader coordination
|
||||
is required. Completed administrative changes apply to subsequent work.
|
||||
|
||||
Deliberate writes from the workflow itself still exist: approved conflict repairs
|
||||
and the final Memory summary use the same persistence services and handle their
|
||||
outcome before proceeding. In particular, a session must be able to use its own
|
||||
approved Evidence correction. This does not require updating all other sessions
|
||||
or rewriting previously approved decisions, artifacts, or SQL.
|
||||
|
||||
## Manual corrections survive source updates
|
||||
|
||||
When an updated source contradicts an administrator's correction, the saved manual
|
||||
Evidence remains active. Evidence management shows the conflicting content for an
|
||||
explicit decision and subsequent save. The source's newer content does not
|
||||
automatically override the correction. The owner accepts that the manual rule can
|
||||
remain in use until that comparison is resolved.
|
||||
|
||||
Deleted Evidence must not silently reappear after preparation or reindexing. The
|
||||
authoring implementation must preserve both manual corrections and suppression of
|
||||
deleted units through source refreshes. The current protection for uncommitted Git
|
||||
changes is insufficient: it does not preserve already committed manual corrections
|
||||
against regeneration, and retirement currently removes the unit without recording
|
||||
suppression for later preparation.
|
||||
|
||||
## Manual creation and explicit source refresh
|
||||
|
||||
Administrators can create Evidence without providing an external document. In R0,
|
||||
they add Markdown using the documented example and consolidate it. The application
|
||||
records a manual declaration as the managed source of the current statement.
|
||||
Explicit consolidation approves that declaration; it does not
|
||||
claim independent documentary verification.
|
||||
|
||||
A correction that changes a unit's meaning uses the same explicit manual origin.
|
||||
The original document remains linked for provenance and source-change detection,
|
||||
but its excerpt is not presented as support for a rule it does not contain. The
|
||||
canonical contract must distinguish the current supporting source from the original
|
||||
document rather than silently retaining outdated support metadata.
|
||||
|
||||
External sources are reacquired only when an administrator requests a source
|
||||
refresh. Ordinary saves and session lookups use the acquired local content; they
|
||||
do not poll sources or fetch their current versions. A remote change is therefore
|
||||
detected at the next requested refresh, when the manual-precedence rule applies.
|
||||
The revised storage recommendation reads the specialist's repository as an input;
|
||||
ordinary local edits do not write back to it or refresh its content automatically.
|
||||
|
||||
## Implementation consequences
|
||||
|
||||
The existing [Evidence lifecycle](../evidence.md) and
|
||||
[Workspace Evidence v3 contract](../contracts/workspace-evidence-v3.md) require
|
||||
explicit evolution for editable local Markdown, manual consolidation, and manual
|
||||
precedence. Source provenance and coherent canonical metadata remain requirements;
|
||||
manual changes must not be presented as statements supported by an unrelated source
|
||||
excerpt. Under the accepted local-file direction, curated files are primary
|
||||
installation data preserved by Clear and backed up separately from rebuildable
|
||||
indexes. Visible Markdown content must become authoritative for editing; operators
|
||||
must not maintain hidden duplicate text, hashes, or manifest entries themselves.
|
||||
This is a core Evidence contract change: parser, renderer, authoring, validation,
|
||||
normalization, and their integration with indexing and recall must be adapted
|
||||
together. E1 includes a new Curated unit format version, conversion of existing
|
||||
Evidence, reindexing, and end-to-end verification that visible edits reach core
|
||||
consumption. Preserve the internal typed model where possible; the change does
|
||||
not require redesigning the NL-to-SQL workflow phases.
|
||||
Local edits do not automatically change external drafts or another installation;
|
||||
Git versioning and transfer occur through the explicit manual follow-up.
|
||||
The [Evidence management project](../plans/2026-09-08-evidence-management.md)
|
||||
records the implementation sequence and acceptance checks.
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
status: superseded by ADR-0043
|
||||
date: 2026-08-24
|
||||
---
|
||||
|
||||
# Evaluate candidate Evidence before activation
|
||||
|
||||
Evidence preprocessing builds a candidate vector generation and runs the workspace's
|
||||
versioned evaluation set against that exact generation before atomically activating it.
|
||||
The workspace revision may temporarily have no matching active Evidence during this
|
||||
maintenance window, which is accepted as fail-closed degradation instead of introducing
|
||||
a distributed transaction across Git, the workspace registry and Qdrant.
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-08-24
|
||||
---
|
||||
|
||||
# Treat Formula Evidence as a composable SQL expression
|
||||
|
||||
Formula Evidence contains one validated PostgreSQL expression with declared input
|
||||
columns, not a complete query or statement. This makes formulas safely composable by
|
||||
SQL generation; complete documented queries remain Example Evidence, and incompatible
|
||||
legacy formulas require human review during migration.
|
||||
@@ -0,0 +1,22 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-08-24
|
||||
---
|
||||
|
||||
# Let Evidence contribute to workflow phases
|
||||
|
||||
The Evidence Module contributes to the existing workflow phases; it is not a visible phase of its
|
||||
own. Clarification, rewriting, schema linking, CTE and final SQL query it with their corresponding
|
||||
purpose; Memory remains owned by the Memory Module and synthesis performs no Evidence search. Each
|
||||
phase searches independently and the workflow records only a minimal receipt containing phase,
|
||||
purpose, vector generation and returned Evidence IDs.
|
||||
|
||||
A successful search may return no matches and does not block the phase. Technical unavailability
|
||||
is a distinct typed outcome that blocks the calling phase until retry, without stale-generation or
|
||||
purpose fallback. This favors an explicit temporary stop over silently treating a broken Evidence
|
||||
dependency as absence of domain knowledge.
|
||||
|
||||
## Consequences
|
||||
|
||||
Curated Evidence v4 later reduced the declared purposes to `disambiguation`, `rewriting`,
|
||||
`schema_linking` and `sql_generation`.
|
||||
@@ -1,101 +0,0 @@
|
||||
# ADR 0021 — Shell separati e adapter sostituibile per il portale
|
||||
|
||||
- Stato: accettato
|
||||
- Data: 2026-09-13
|
||||
|
||||
## Decisione
|
||||
|
||||
ThothII espone due modalità di installazione, selezionate da `shell.mode`:
|
||||
|
||||
- `embedded` (default): ThothII è ospitato da Omics Portal. Non renderizza alcun header e
|
||||
riceve dal portale lingua, tema e fullscreen. L'accesso resta verificato dal server.
|
||||
- `full`: ThothII è autonomo. Renderizza il proprio header, con selettore lingua, tema,
|
||||
fullscreen e nome utente. Il click sul nome apre il logout. Non mostra mai la rotellina o
|
||||
altri comandi amministrativi del portale. Mantiene un rail vuoto a sinistra di almeno 20 px.
|
||||
|
||||
Il fatto che la shell sia `full` è distinto dallo stato `fullscreen`: la prima decide quale
|
||||
contenitore viene renderizzato, il secondo indica se è attiva la Fullscreen API del browser.
|
||||
L'icona passa da “entra in fullscreen” a “torna alla modalità normale”; anche `Esc` aggiorna lo
|
||||
stato visualizzato.
|
||||
|
||||
La configurazione installata resta semplice e retrocompatibile. Sul Mac di sviluppo il profilo
|
||||
locale userà:
|
||||
|
||||
```yaml
|
||||
shell:
|
||||
mode: full
|
||||
defaultLocale: en
|
||||
```
|
||||
|
||||
Il deploy sul server userà invece:
|
||||
|
||||
```yaml
|
||||
shell:
|
||||
mode: embedded
|
||||
adapter: omics-portal
|
||||
```
|
||||
|
||||
`defaultLocale` indica la lingua iniziale della shell full; in embedded la fonte autorevole resta
|
||||
il portale.
|
||||
|
||||
L'adapter è l'unico confine tra ThothII e il portale. La sua interfaccia pubblica è volutamente
|
||||
profonda e minima: consegna solo snapshot dello stato, senza esporre comandi, token, identità o
|
||||
dettagli di trasporto.
|
||||
|
||||
```ts
|
||||
export type HostShellState = {
|
||||
locale: string; // BCP-47, inizialmente it/en
|
||||
theme: "light" | "dark";
|
||||
fullscreen: boolean;
|
||||
};
|
||||
|
||||
export interface PortalAdapter {
|
||||
subscribe(
|
||||
onState: (state: HostShellState) => void,
|
||||
onError: (error: Error) => void,
|
||||
): () => void;
|
||||
}
|
||||
```
|
||||
|
||||
`OmicsPortalAdapter` è l'implementazione corrente. Un adapter per un altro portale potrà
|
||||
sostituirlo senza modificare shell, i18n o workflow. In `full` l'adapter non viene istanziato:
|
||||
lo stato è gestito internamente dalla shell.
|
||||
|
||||
Per l'integrazione oggi operativa, che monta la SPA direttamente nel DOM di Omics Portal,
|
||||
l'adapter legge la lingua effettiva dal selettore Omics, osserva l'attributo del tema e ascolta
|
||||
il fullscreen del documento. Selettori e osservatori restano privati dell'implementazione Omics.
|
||||
La lingua segue il normale ricaricamento Django; tema e fullscreen cambiano nella pagina aperta.
|
||||
La revisione approvata del 2026-09-13 elimina il precedente handshake a eventi: non servono
|
||||
messaggi personalizzati, versioni di trasporto o timeout di avvio. Un futuro adapter potrà usare
|
||||
un diverso trasporto senza modificare l'interfaccia applicativa.
|
||||
|
||||
Se `shell` o l'adapter embedded sono omessi, si usa `embedded` con `omics-portal`. Questo default
|
||||
supporta il documento Omics esistente; nomi adapter sconosciuti o dati host mancanti producono
|
||||
un errore esplicito, senza attivare la shell full.
|
||||
|
||||
## Confini che restano invariati
|
||||
|
||||
L'identità e l'autorizzazione del backend non vengono ricostruite nel browser. In embedded,
|
||||
Omics Portal continua a gestire login e logout e la catena server-side `auth_request` continua a
|
||||
fornire i principal header già previsti. Lo stato UI non dichiara l'utente autenticato: il modulo
|
||||
di accesso usa la verifica backend esistente anche alla riconnessione e al ritorno alla pagina.
|
||||
Un rifiuto su una singola operazione non equivale automaticamente alla perdita dell'accesso.
|
||||
|
||||
La lingua UI e la lingua di interazione con il modello restano separate dalla lingua del
|
||||
workspace; il relativo contratto è in [ADR 0022](0022-separate-ui-locale-from-session-interaction-language.md).
|
||||
|
||||
## Alternative scartate
|
||||
|
||||
- Duplicare l'header di Omics in embedded: crea due fonti di stato e incompatibilità visive.
|
||||
- Spargere controlli `if embedded/full` nei componenti: lega ogni pagina al portale.
|
||||
- Trasmettere utente o token nel bridge: aumenta superficie e accoppia UI e autenticazione.
|
||||
- Introdurre un protocollo completo request/response: non aggiunge funzionalità richiesta.
|
||||
- Usare `profile` per distinguere le shell: `profile` descrive la topologia dell'installazione,
|
||||
non la sua presentazione.
|
||||
|
||||
## Conseguenze
|
||||
|
||||
La soluzione richiede un adapter nel frontend che osserva il documento condiviso e mantiene la
|
||||
logica di shell locale a ThothII. Il backend non necessita di un nuovo protocollo di autenticazione
|
||||
o di una nuova sessione browser. Un nuovo portale deve soddisfare anche il contratto server di
|
||||
identità fidata: la sola sostituzione della classe UI non sostituisce quel contratto.
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-08-24
|
||||
---
|
||||
|
||||
# Ground and atomically apply Evidence preparation
|
||||
|
||||
Every proposed Evidence Unit carries one to five short supporting excerpts that can be
|
||||
found in its normalized Source Evidence. The model may reuse only identifiers supplied
|
||||
for previous units; deterministic application code assigns all new canonical IDs. This
|
||||
makes provenance and identity mechanically checkable without pretending that automated
|
||||
validation can replace human semantic review.
|
||||
|
||||
Preparation validates the complete changed batch in a temporary area and applies
|
||||
curated files plus the manifest atomically. A model timeout or invalid response is not
|
||||
retried automatically and leaves the worktree unchanged. Explicit `evidence resolve`
|
||||
actions retire or relink units while preserving an ordinary, recoverable Git diff.
|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
status: superseded by ADR-0041
|
||||
date: 2026-08-24
|
||||
---
|
||||
|
||||
# Add BM25 without rebuilding the shared Qdrant collection
|
||||
|
||||
The workspace keeps its existing unnamed dense vector and adds only the sparse `bm25`
|
||||
vector with IDF through Qdrant's additive vector-schema operation. Only Evidence points
|
||||
are repopulated with both default dense and BM25 values. Schema, Memory and solved
|
||||
questions retain their current dense points and are verified before and after the
|
||||
upgrade.
|
||||
|
||||
This replaces the planned destructive conversion to a named `dense` vector. If BM25 is
|
||||
missing, Evidence preprocessing may add it and verify the resulting schema; session
|
||||
runtime remains read-only. An incompatible existing BM25 definition fails without
|
||||
mutation. A candidate failure leaves the additive schema in place while Evidence stays
|
||||
unavailable, avoiding data loss in the other workflow modules.
|
||||
@@ -0,0 +1,29 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-08-24
|
||||
---
|
||||
|
||||
# Make hybrid Evidence retrieval deterministic and diagnosable
|
||||
|
||||
Dense and BM25 retrieval receive the same deterministic query text. It preserves the
|
||||
original question and appends nonempty concepts, tables and columns in a fixed order;
|
||||
question and context receive Unicode NFC, newline canonicalization and outer trimming.
|
||||
Context values are then deduplicated exactly and sorted, without lowercasing. Case,
|
||||
punctuation and internal whitespace remain intact. This avoids accidental ranking
|
||||
changes caused only by metadata ordering, preserves quoted PostgreSQL identifiers and
|
||||
keeps the two retrieval branches directly comparable.
|
||||
|
||||
Evidence fragmentation follows semantic headings, typed fields and paragraph
|
||||
boundaries. Formulas, value/meaning pairs, mappings, rules and URLs remain atomic. An
|
||||
atomic element larger than the existing `max_chunk_chars` limit creates the blocking
|
||||
`atomic_content_too_large` Review item rather than being split mechanically. The limit
|
||||
applies to the complete rendered text, defaults to 4,000 characters and is not
|
||||
duplicated by an Evidence-specific setting.
|
||||
|
||||
An L0 contract test starts the exact Qdrant image referenced by `compose.yaml` and
|
||||
proves Italian server-side `qdrant/bm25` ingestion and search in a temporary collection.
|
||||
There is no FastEmbed or dense fallback for Evidence when that capability is absent.
|
||||
|
||||
The versioned evaluation set contains lexical, semantic and mixed queries. Its report
|
||||
shows dense-only, BM25-only and fused ranks for expected Evidence. Publication remains
|
||||
governed only by the simple fused top-10 rule; branch ranks and hit@5 are diagnostic.
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-08-26
|
||||
---
|
||||
|
||||
# Use PostgreSQL as the metadata catalog
|
||||
|
||||
ThothII uses an internal PostgreSQL Metadata Catalog to store, for each workspace, the physical
|
||||
structure obtained by introspecting its database and the AI-generated semantic metadata. Each
|
||||
Workspace Database carries a mandatory, unique `workspace_id`, which enforces the one-to-one
|
||||
association without a Workspace table or SQL foreign key; workspace identity and the workspace list
|
||||
stay authoritative in the workspace descriptors, and the service validates references against them.
|
||||
The catalog's administrative interface and lifecycle stay separate from the NL→SQL workflow.
|
||||
|
||||
## Considered Options
|
||||
|
||||
- Keeping `annotations.yaml` as the source of truth would have kept Git versioning, but not the
|
||||
required CRUD and introspection/generation process.
|
||||
- Reading mutable metadata from the catalog without an explicit boundary would have coupled the
|
||||
workflow to the availability of the new service and allowed partial views during updates.
|
||||
|
||||
## Consequences
|
||||
|
||||
Replacing `schema/annotations.yaml` as the core input is a later, explicit cutover (ADR-0040).
|
||||
PostgreSQL guarantees that one `workspace_id` is not assigned to two databases, but workspace
|
||||
existence, renames and removals remain the responsibility of the application boundary with the
|
||||
workspace descriptors.
|
||||
@@ -0,0 +1,23 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-08-27
|
||||
---
|
||||
|
||||
# Reference Workspace Database secrets
|
||||
|
||||
The Metadata Catalog stores no Workspace Database credentials or keys. It reuses ThothII's existing
|
||||
encrypted secret store and keeps only references to the workspace's secret requirements, which
|
||||
avoids a second vault and keeps values out of APIs, exports and logs.
|
||||
|
||||
## Considered Options
|
||||
|
||||
- Copying the ThothAI text fields would have simplified CRUD but stored passwords and passphrases
|
||||
in plaintext.
|
||||
- A second vault would have duplicated encryption, rotation, authorization and operating procedures
|
||||
without a distinct need.
|
||||
|
||||
## Consequences
|
||||
|
||||
Catalog and runtime share the identity of secret requirements while catalog permissions and APIs
|
||||
remain separate. Replacing or deleting a Workspace Database must define the lifecycle of its
|
||||
references without including secret values in catalog transactions.
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-08-27
|
||||
---
|
||||
|
||||
# Bind databases per installation
|
||||
|
||||
The Metadata Catalog separates the logical Workspace Database from the Database Binding that makes
|
||||
it reachable in one installation. There is one Workspace Database per `workspace_id` and one active
|
||||
binding in each installation's catalog: PSD uses REST locally and direct PostgreSQL on the server
|
||||
without becoming two databases. The catalog is authoritative for engine, physical name, schema,
|
||||
capabilities and binding; the DWH fields in workspace descriptors are only a bootstrap source,
|
||||
imported and compared during an explicit cutover.
|
||||
|
||||
## Considered Options
|
||||
|
||||
- One database record per transport would have duplicated the identity, structure and metadata of
|
||||
the same warehouse.
|
||||
- Keeping warehouse facts permanently in both YAML and catalog would have created conflicts with no
|
||||
deterministic resolution.
|
||||
- Global bindings would have mixed endpoints and credentials of installations with different
|
||||
topologies and security boundaries.
|
||||
|
||||
## Consequences
|
||||
|
||||
The runtime must never observe two disagreeing authorities: the cutover imports and compares
|
||||
existing configuration before removing it from descriptors.
|
||||
@@ -0,0 +1,25 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-08-27
|
||||
---
|
||||
|
||||
# Host the Metadata Catalog in the backend with Kysely
|
||||
|
||||
The Metadata Catalog lives in the existing Fastify process as an isolated module rather than a
|
||||
microservice. It uses the existing `pg` driver through Kysely for typed queries, transactions and
|
||||
migrations; its routes, repository, readiness and diagnostics stay separate from the workflow, and
|
||||
catalog unavailability does not make sessions or SSE unavailable.
|
||||
|
||||
## Considered Options
|
||||
|
||||
- A microservice would have kept the backend free of a database, but added deployment,
|
||||
authentication and failure modes for a single administrative context.
|
||||
- Plain `pg` would have avoided a dependency but required local infrastructure for transactions,
|
||||
row types and migration ordering and locking.
|
||||
- Drizzle or Prisma would have added a schema DSL, generators and toolchain to a service that keeps
|
||||
SQL and PostgreSQL constraints explicit.
|
||||
|
||||
## Consequences
|
||||
|
||||
Migrations ship with the backend but run only through `catalog:migrate`, with migrator credentials
|
||||
separate from the runtime DML role.
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
---
|
||||
status: superseded by ADR-0008
|
||||
status: superseded by ADR-0032
|
||||
date: 2026-08-27
|
||||
---
|
||||
|
||||
# Hard-delete catalog tables during synchronization
|
||||
+5
@@ -1,3 +1,8 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-08-27
|
||||
---
|
||||
|
||||
# Separate physical and logical relationships
|
||||
|
||||
ThothII persists each database-declared foreign-key constraint as an immutable Catalog
|
||||
+5
@@ -1,3 +1,8 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-08-27
|
||||
---
|
||||
|
||||
# Use durable runs for authoritative schema synchronization
|
||||
|
||||
All table, column, relationship, and full-schema synchronizations run as durable background
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-08-28
|
||||
---
|
||||
|
||||
# Allow explicit manual catalog metadata cleanup
|
||||
@@ -11,6 +12,6 @@ Catalog Relationships; a table selection can remove its Catalog Columns or every
|
||||
outgoing Catalog Relationship. Each selection is atomic, and a later Schema Synchronization can
|
||||
rebuild the removed projection from the external schema.
|
||||
|
||||
This supersedes ADR-0005's broader invariant that physical membership cannot be edited manually.
|
||||
This supersedes ADR-0029's broader invariant that physical membership cannot be edited manually.
|
||||
Synchronization remains authoritative when it runs, while manual cleanup intentionally permits an
|
||||
incomplete catalog between cleanup and the next successful synchronization.
|
||||
+1
@@ -1,5 +1,6 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-08-29
|
||||
---
|
||||
|
||||
# Use one sequential description-generation run
|
||||
+1
@@ -1,5 +1,6 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-08-29
|
||||
---
|
||||
|
||||
# Allow bounded real source samples for description generation
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-08-30
|
||||
---
|
||||
|
||||
# Gate source samples with a Sensitive Data Flag
|
||||
@@ -24,7 +25,7 @@ per-column proposals, prompts, raw provider output, or provider diagnostics. Thi
|
||||
history of the AI attempt, not an audit trail of human flag decisions; reloading discards an unsaved
|
||||
proposal.
|
||||
|
||||
Description generation extends ADR-0010 by sending bounded real values when `sensitive` is false
|
||||
Description generation extends ADR-0034 by sending bounded real values when `sensitive` is false
|
||||
and deterministic plausible synthetic values when it is true, without identifying the synthetic
|
||||
values to the model. The false default deliberately favors the expected stable schemas and the
|
||||
minority of protected columns: a new column remains eligible for real sampling until a user marks
|
||||
+6
-1
@@ -1,7 +1,12 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-09-01
|
||||
---
|
||||
|
||||
# Use the Catalog as the logical relationship authority
|
||||
|
||||
ThothII stores database-declared foreign keys and user-managed Logical Relationships in separate
|
||||
Catalog models, as required by ADR-0006, but exposes them through one effective relationship map.
|
||||
Catalog models, as required by ADR-0030, but exposes them through one effective relationship map.
|
||||
Physical relationships remain read-only and are refreshed from the database. Logical relationships
|
||||
are either Generated by deterministic column-name inference or Manual; inference does not call an
|
||||
AI model and does not inspect source values.
|
||||
+6
-1
@@ -1,3 +1,8 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-09-02
|
||||
---
|
||||
|
||||
# Use one Installation Model Catalog with runtime projections
|
||||
|
||||
ThothII currently declares model availability independently in installation
|
||||
@@ -12,7 +17,7 @@ Runtime Projections of that catalog. Runtime Model Selection stores only a canon
|
||||
identity and use-specific controls such as thinking level; endpoint, provider, capabilities, and
|
||||
credential references remain catalog facts, while secret values remain in protected secret stores.
|
||||
The metadata-generation helper continues to use LiteLLM independently of Pi, as established by
|
||||
ADR-0009: unifying model declaration does not unify execution lifecycles.
|
||||
ADR-0033: unifying model declaration does not unify execution lifecycles.
|
||||
|
||||
The migration is intentionally fail-closed. Workspace schema v4 removes `llm_policy` and the
|
||||
entire redundant `semantic_index`; collection identity is derived from the workspace identity,
|
||||
+4
-3
@@ -1,5 +1,6 @@
|
||||
---
|
||||
status: superseded by ADR-0015
|
||||
status: superseded by ADR-0039
|
||||
date: 2026-09-02
|
||||
---
|
||||
|
||||
# Assess sensitive columns locally from source content
|
||||
@@ -48,8 +49,8 @@ available, and would reintroduce queue latency, non-deterministic judgments, pro
|
||||
surface, and contention with normal inference. Introducing such a fallback would require a new
|
||||
decision based on evidence that the NER path is unusable.
|
||||
|
||||
This decision supersedes ADR-0011 only where that ADR assigns draft sensitivity suggestions to an
|
||||
AI using structural metadata. ADR-0011's human authority, transient draft, explicit scope, and
|
||||
This decision supersedes ADR-0035 only where that ADR assigns draft sensitivity suggestions to an
|
||||
AI using structural metadata. ADR-0035's human authority, transient draft, explicit scope, and
|
||||
Sensitive Data Flag remain in force. How description generation uses the flag is outside this
|
||||
decision.
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-09-03
|
||||
---
|
||||
|
||||
# Use progressive sampling for sensitive columns
|
||||
@@ -27,7 +28,7 @@ The HTTP operation has no global analysis deadline. It is canceled when the clie
|
||||
the backend restarts. Historic and interrupted run records retain the database field named
|
||||
`unknown` for compatibility, where it counts unprocessed columns rather than a v2 assessment.
|
||||
|
||||
This decision supersedes ADR-0014 only for scan effort, coverage semantics, and the assessment
|
||||
domain. ADR-0014 remains authoritative for the single local TypeScript decision point, the absence
|
||||
This decision supersedes ADR-0038 only for scan effort, coverage semantics, and the assessment
|
||||
domain. ADR-0038 remains authoritative for the single local TypeScript decision point, the absence
|
||||
of generative LLMs, transient human-reviewed drafts, the 500-character rule, and optional CPU-only
|
||||
NER evidence.
|
||||
+7
-2
@@ -1,8 +1,13 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-09-06
|
||||
---
|
||||
|
||||
# Use PostgreSQL metadata for all core consumers
|
||||
|
||||
The Metadata Catalog in PostgreSQL is the sole authority for every fact about a Workspace Database
|
||||
used by the core. This completes the cutover anticipated by ADR-0001 and ADR-0003 and supersedes the
|
||||
ADR-0012 statements that kept workspace annotations authoritative for descriptions and materialized
|
||||
used by the core. This completes the cutover anticipated by ADR-0025 and ADR-0027 and supersedes the
|
||||
ADR-0036 statements that kept workspace annotations authoritative for descriptions and materialized
|
||||
a relationship-only snapshot per session. The Workspace Descriptor retains workspace identity and
|
||||
Evidence scope, but contains no database identity, binding, structure, description, or relationship
|
||||
data.
|
||||
+5
@@ -1,3 +1,8 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-09-06
|
||||
---
|
||||
|
||||
# Separate reference vectors from runtime memory
|
||||
|
||||
Schema, relationships, and Evidence are deterministic projections of PostgreSQL Catalog metadata
|
||||
+1
-1
@@ -22,7 +22,7 @@ The owner also accepted hybrid semantic/lexical Qdrant retrieval with scope filt
|
||||
and explicit card links traversed in core. Both belong to the planned first version;
|
||||
there is no dedicated graph database or external Memory framework.
|
||||
|
||||
This extends [ADR 0017](0017-separate-reference-vectors-from-runtime-memory.md):
|
||||
This extends [ADR 0041](0041-separate-reference-vectors-from-runtime-memory.md):
|
||||
the separate reference and memory collections remain, while Memory gains sparse
|
||||
lexical indexing in addition to dense vectors. Memory projections become rebuildable
|
||||
from the module's PostgreSQL authority. Preprocessing Clear still preserves Memory;
|
||||
@@ -0,0 +1,41 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-09-08
|
||||
---
|
||||
|
||||
# Maintain local Evidence with external editors
|
||||
|
||||
A context specialist writes Evidence drafts independently of the installation and without
|
||||
PostgreSQL access; the installation refines them and keeps the curated Evidence in a durable local
|
||||
file archive, a persistent Git working tree that may reuse the workspace repository. Domain
|
||||
specialists edit visible Markdown with their own editor (or vim/nano on the server), with no web
|
||||
editor and no JSONL editing, and run one consolidation command that validates, activates and
|
||||
indexes the change. Git diff, commit and push stay manual. This replaces both the workspace-Git
|
||||
publication boundary and the evaluation-before-activation gate of ADR-0017 and ADR-0019, and keeps
|
||||
Evidence separate from Memory (ADR-0042).
|
||||
|
||||
## Considered Options
|
||||
|
||||
- Application-managed Git writes from the Evidence page: rejected to remove commit and push from
|
||||
normal editing and to rely on operator discipline.
|
||||
- Moving Evidence authority into PostgreSQL: withdrawn once it was clear that specialists author
|
||||
drafts outside the installation.
|
||||
- A web editor or content form: not needed for the first release.
|
||||
|
||||
## Consequences
|
||||
|
||||
- The core reads only consolidated, activated content, never the working files. A failed
|
||||
activation keeps the last valid corpus and can be rerun without duplicating units or losing
|
||||
edits; persistence and Qdrant are not atomic, so recovery is explicit.
|
||||
- Activation happens before commit and push: a skipped or failed push leaves the local change in
|
||||
effect and other installations unchanged.
|
||||
- A saved manual correction stays active when its source later contradicts it, and deleted
|
||||
Evidence must not reappear after preparation or reindexing; sources are reacquired only on an
|
||||
explicit refresh.
|
||||
- Corrections approved inside a session use the same persistence and activation service, so a
|
||||
session can use its own correction without manual consolidation.
|
||||
- Administration assumes no concurrent core work: completed changes apply to subsequent sessions,
|
||||
without live refresh of open ones.
|
||||
|
||||
The format and commands are in the [Curated Evidence v4 contract](../contracts/curated-evidence-v4.md)
|
||||
and the [Evidence lifecycle](../evidence.md).
|
||||
+5
-2
@@ -1,6 +1,9 @@
|
||||
# Unify administration pages and use namespaced routes
|
||||
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-09-10
|
||||
---
|
||||
|
||||
# Unify administration pages and use namespaced routes
|
||||
|
||||
Workspace and Pi management will become full Administration Pages alongside Evidence, Memory and
|
||||
Database, using one shared Administrative Page Family. The Embedded Thoth Shell will identify the
|
||||
@@ -0,0 +1,31 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-09-13
|
||||
---
|
||||
|
||||
# Separate shell modes behind a portal adapter
|
||||
|
||||
ThothII has two presentation modes selected by `shell.mode`: `embedded` (the default), where Omics
|
||||
Portal hosts ThothII, which renders no header and takes locale, theme and fullscreen from the
|
||||
portal; and `full`, where ThothII renders its own header with locale, theme, fullscreen and user
|
||||
controls. One deliberately minimal `PortalAdapter` is the only boundary with the host portal: it
|
||||
delivers snapshots of host shell state and never exposes commands, tokens, identity or transport,
|
||||
so another portal can replace `OmicsPortalAdapter` without touching shell, i18n or workflow. In
|
||||
`full` no adapter is instantiated. The interface and configuration are in the
|
||||
[portal shell adapter contract](../contracts/portal-shell-adapter-v1.md).
|
||||
|
||||
## Considered Options
|
||||
|
||||
- Duplicating the Omics header in embedded mode creates two sources of state and visual mismatch.
|
||||
- Scattering `embedded`/`full` checks through components ties every page to the portal.
|
||||
- Passing user or tokens through the bridge widens the surface and couples UI and authentication.
|
||||
- A full request/response protocol adds no required capability.
|
||||
- Using `profile` to select the shell conflates installation topology with presentation.
|
||||
|
||||
## Consequences
|
||||
|
||||
Identity and authorization are never rebuilt in the browser: in embedded mode Omics Portal keeps
|
||||
login and logout and the server-side `auth_request` chain supplies principal headers (ADR-0015).
|
||||
A new portal must also satisfy that trusted-identity server contract; replacing the UI adapter
|
||||
alone is not enough. Shell mode is independent of the browser fullscreen state, and UI locale is
|
||||
governed by ADR-0046.
|
||||
+5
-2
@@ -1,6 +1,9 @@
|
||||
# Separate UI locale from session interaction language
|
||||
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-09-13
|
||||
---
|
||||
|
||||
# Separate UI locale from session interaction language
|
||||
|
||||
ThothII distinguishes three language concepts:
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
---
|
||||
status: accepted
|
||||
date: 2026-09-28
|
||||
---
|
||||
|
||||
# Separate delivery operations from finalized SQL sessions
|
||||
|
||||
For [Studio integrazione in ETL — ticket #41](https://git.tylconsulting.it/mptyl/ThothII/issues/41),
|
||||
SQL file delivery and ETL integration have a lifecycle separate from the session that
|
||||
produced the approved SQL. A session can finalize while its linked Delivery Operation
|
||||
remains pending or has failed. The operation stays visible and can be retried without
|
||||
reopening the session or changing its canonical artifacts or terminal state.
|
||||
|
||||
Keeping the session incomplete until the destination becomes available was considered
|
||||
and rejected: destination failures should not require repeating or reopening completed
|
||||
SQL work. The cost of this choice is two explicit outcomes in the user experience and
|
||||
persistence model. An approved SQL query or finalized session must never be presented
|
||||
as evidence of a successful delivery, activation or execution.
|
||||
|
||||
ETL Activation requires an explicit choice by a user authorized for the destination.
|
||||
It is distinct from artifact delivery and immediate execution. The same user who
|
||||
approved the SQL may activate it when authorized; otherwise activation waits for an
|
||||
authorized responsible user. There is no universal requirement for a second approver.
|
||||
|
||||
This records the boundary accepted in interview rounds 1 and 2, not an implementation
|
||||
claim. Operation states, durable dispatch, retry semantics, approval binding and the
|
||||
remote integration protocol remain to be specified. The existing After-finalize hook
|
||||
vocabulary does not by itself provide the required delivery infrastructure.
|
||||
+49
-6
@@ -1,10 +1,53 @@
|
||||
# Domain Docs
|
||||
|
||||
This is a single-context repository.
|
||||
How the engineering skills should consume this repo's domain documentation when exploring the codebase.
|
||||
|
||||
Before exploring, read `CONTEXT.md` at the repository root and the relevant decisions in
|
||||
`docs/adr/`. Use the project's terminology from `CONTEXT.md` in issue titles, proposals, and
|
||||
tests. Surface conflicts with an ADR instead of silently overriding it.
|
||||
This is a single-context repository: root `GLOSSARY.md` (Italian) and `docs/adr/` (English).
|
||||
|
||||
When the vocabulary is missing or ambiguous, clarify the term with the `domain-modeling` skill and
|
||||
record the result in `CONTEXT.md` or an ADR before relying on it in implementation work.
|
||||
## Before exploring, read these
|
||||
|
||||
- **`GLOSSARY.md`** at the repo root, or
|
||||
- **`GLOSSARY-MAP.md`** at the repo root if it exists: it points at one `GLOSSARY.md` per context. Read each one relevant to the topic.
|
||||
- **`docs/adr/`**: read ADRs that touch the area you're about to work in. In multi-context repos, also check `src/<context>/docs/adr/` for context-scoped decisions.
|
||||
|
||||
If any of these files don't exist, **proceed silently**. Don't flag their absence; don't suggest creating them upfront. The `/domain-modeling` skill (reached via `/grill-with-docs` and `/improve-codebase-architecture`) creates them lazily when terms or decisions actually get resolved.
|
||||
|
||||
## File structure
|
||||
|
||||
Single-context repo (most repos):
|
||||
|
||||
```
|
||||
/
|
||||
├── GLOSSARY.md
|
||||
├── docs/adr/
|
||||
│ ├── 0001-event-sourced-orders.md
|
||||
│ └── 0002-postgres-for-write-model.md
|
||||
└── src/
|
||||
```
|
||||
|
||||
Multi-context repo (presence of `GLOSSARY-MAP.md` at the root):
|
||||
|
||||
```
|
||||
/
|
||||
├── GLOSSARY-MAP.md
|
||||
├── docs/adr/ ← system-wide decisions
|
||||
└── src/
|
||||
├── ordering/
|
||||
│ ├── GLOSSARY.md
|
||||
│ └── docs/adr/ ← context-specific decisions
|
||||
└── billing/
|
||||
├── GLOSSARY.md
|
||||
└── docs/adr/
|
||||
```
|
||||
|
||||
## Use the glossary's vocabulary
|
||||
|
||||
When your output names a domain concept (in an issue title, a refactor proposal, a hypothesis, a test name), use the term as defined in `GLOSSARY.md`. Don't drift to synonyms the glossary explicitly avoids.
|
||||
|
||||
If the concept you need isn't in the glossary yet, that's a signal: either you're inventing language the project doesn't use (reconsider) or there's a real gap (note it for `/domain-modeling`).
|
||||
|
||||
## Flag ADR conflicts
|
||||
|
||||
If your output contradicts an existing ADR, surface it explicitly rather than silently overriding:
|
||||
|
||||
> _Contradicts ADR-0007 (event-sourced orders), but worth reopening because…_
|
||||
|
||||
@@ -117,7 +117,7 @@ the core can admit a new session.
|
||||
|
||||
PostgreSQL is the current database-metadata authority for all core consumers, not a deferred
|
||||
catalog-to-core integration. The historical research on a separate catalog service and
|
||||
`annotations.yaml` publication is superseded by ADRs 0004 and 0016. Preserve read-only DWH access,
|
||||
`annotations.yaml` publication is superseded by ADRs 0028 and 0040. Preserve read-only DWH access,
|
||||
installation-local bindings/secrets, revision-pinned workspace identity, and fail-closed readiness
|
||||
when changing those boundaries. The exact snapshot interface is the
|
||||
[Catalog Schema Snapshot contract](../contracts/catalog-schema-snapshot.md).
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,247 @@
|
||||
{
|
||||
"schema_version": 1,
|
||||
"diagram_type": "sequence",
|
||||
"meta": {
|
||||
"title": "ThothII — login OIDC e richieste autenticate",
|
||||
"locale": "it",
|
||||
"output": "docs/architecture/thothii-auth-oidc.html",
|
||||
"quality_profile": "showcase",
|
||||
"repository": {
|
||||
"url": "https://git.tylconsulting.it/mptyl/ThothII.git",
|
||||
"link_mode": "local-only",
|
||||
"revision": "31e6d3a162e9e5ac71fc2d8da4fe44b16c06aae3"
|
||||
}
|
||||
},
|
||||
"participants": [
|
||||
{
|
||||
"id": "browser",
|
||||
"type": "frontend",
|
||||
"label": "Browser",
|
||||
"sublabel": "frontend React",
|
||||
"sources": [
|
||||
{
|
||||
"path": "frontend/src/api/auth.ts",
|
||||
"line": 71,
|
||||
"end_line": 105,
|
||||
"label": "config e beginOidcLogin"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "backend",
|
||||
"type": "backend",
|
||||
"label": "Backend",
|
||||
"sublabel": "route /auth",
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/auth/routes.ts",
|
||||
"line": 247,
|
||||
"end_line": 286,
|
||||
"label": "GET /auth/oidc/login"
|
||||
},
|
||||
{
|
||||
"path": "backend/src/auth/routes.ts",
|
||||
"line": 288,
|
||||
"end_line": 349,
|
||||
"label": "GET /auth/oidc/callback"
|
||||
},
|
||||
{
|
||||
"path": "backend/src/auth/auth.ts",
|
||||
"line": 76,
|
||||
"end_line": 110,
|
||||
"label": "authenticateSession"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "store",
|
||||
"type": "database",
|
||||
"label": "Auth state",
|
||||
"sublabel": "file, volume auth-state",
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/auth/session-store.ts",
|
||||
"line": 389,
|
||||
"end_line": 395,
|
||||
"label": "createFileAuthSessionStore"
|
||||
},
|
||||
{
|
||||
"path": "compose.yaml",
|
||||
"line": 30,
|
||||
"end_line": 30
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "idp",
|
||||
"type": "security",
|
||||
"label": "Identity provider",
|
||||
"sublabel": "OIDC",
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/auth/oidc-client.ts",
|
||||
"line": 24,
|
||||
"end_line": 27,
|
||||
"label": "OidcProtocol"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"segments": [
|
||||
{
|
||||
"from": 160,
|
||||
"to": 342,
|
||||
"label": "Avvio login"
|
||||
},
|
||||
{
|
||||
"from": 352,
|
||||
"to": 444,
|
||||
"label": "Provider"
|
||||
},
|
||||
{
|
||||
"from": 454,
|
||||
"to": 738,
|
||||
"label": "Callback"
|
||||
},
|
||||
{
|
||||
"from": 748,
|
||||
"to": 870,
|
||||
"label": "Richieste"
|
||||
}
|
||||
],
|
||||
"messages": [
|
||||
{
|
||||
"from": "browser",
|
||||
"to": "backend",
|
||||
"y": 170,
|
||||
"label": "GET /auth/config"
|
||||
},
|
||||
{
|
||||
"from": "backend",
|
||||
"to": "browser",
|
||||
"y": 200,
|
||||
"label": "mode: oidc",
|
||||
"variant": "return"
|
||||
},
|
||||
{
|
||||
"from": "browser",
|
||||
"to": "backend",
|
||||
"y": 230,
|
||||
"label": "GET /auth/oidc/login",
|
||||
"variant": "emphasis"
|
||||
},
|
||||
{
|
||||
"from": "backend",
|
||||
"to": "store",
|
||||
"y": 260,
|
||||
"label": "createOidcState",
|
||||
"note": "nonce e code verifier PKCE"
|
||||
},
|
||||
{
|
||||
"from": "backend",
|
||||
"to": "browser",
|
||||
"y": 326,
|
||||
"label": "302 verso il provider",
|
||||
"variant": "return"
|
||||
},
|
||||
{
|
||||
"from": "browser",
|
||||
"to": "idp",
|
||||
"y": 362,
|
||||
"label": "authorize + PKCE",
|
||||
"variant": "security",
|
||||
"note": "login sul provider"
|
||||
},
|
||||
{
|
||||
"from": "idp",
|
||||
"to": "browser",
|
||||
"y": 428,
|
||||
"label": "302 callback con code",
|
||||
"variant": "return"
|
||||
},
|
||||
{
|
||||
"from": "browser",
|
||||
"to": "backend",
|
||||
"y": 464,
|
||||
"label": "GET /auth/oidc/callback",
|
||||
"variant": "emphasis"
|
||||
},
|
||||
{
|
||||
"from": "backend",
|
||||
"to": "store",
|
||||
"y": 494,
|
||||
"label": "consumeOidcState",
|
||||
"note": "verifica transazione, revisione e issuer"
|
||||
},
|
||||
{
|
||||
"from": "backend",
|
||||
"to": "idp",
|
||||
"y": 560,
|
||||
"label": "scambio code",
|
||||
"variant": "security",
|
||||
"note": "firma, audience, scadenza, nonce"
|
||||
},
|
||||
{
|
||||
"from": "idp",
|
||||
"to": "backend",
|
||||
"y": 626,
|
||||
"label": "identità + gruppi",
|
||||
"variant": "return"
|
||||
},
|
||||
{
|
||||
"from": "backend",
|
||||
"to": "store",
|
||||
"y": 656,
|
||||
"label": "crea sessione",
|
||||
"note": "ruoli dai gruppi, TTL limitato al token"
|
||||
},
|
||||
{
|
||||
"from": "backend",
|
||||
"to": "browser",
|
||||
"y": 722,
|
||||
"label": "cookie + redirect /",
|
||||
"variant": "return"
|
||||
},
|
||||
{
|
||||
"from": "browser",
|
||||
"to": "backend",
|
||||
"y": 758,
|
||||
"label": "API con cookie",
|
||||
"variant": "emphasis"
|
||||
},
|
||||
{
|
||||
"from": "backend",
|
||||
"to": "store",
|
||||
"y": 788,
|
||||
"label": "resolve + touch",
|
||||
"note": "sessione revocata se cambia la config"
|
||||
},
|
||||
{
|
||||
"from": "backend",
|
||||
"to": "browser",
|
||||
"y": 854,
|
||||
"label": "risposta",
|
||||
"variant": "return"
|
||||
}
|
||||
],
|
||||
"cards": [
|
||||
{
|
||||
"dot": "cyan",
|
||||
"title": "Tre modalità",
|
||||
"items": [
|
||||
"local: utenti con hash Argon2id in users.yaml",
|
||||
"oidc: questo flusso (Authorization Code + PKCE)",
|
||||
"upstream: il proxy del portale (Omics) passa l'identità negli header; niente login né cookie ThothII"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dot": "rose",
|
||||
"title": "Autorizzazione",
|
||||
"items": [
|
||||
"I gruppi OIDC sono mappati esattamente sui ruoli user e admin",
|
||||
"I permessi si ricalcolano dai ruoli a ogni richiesta",
|
||||
"Le richieste che modificano dati richiedono origine esatta e token CSRF"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"schema_version": 3,
|
||||
"diagram_type": "lifecycle",
|
||||
"meta": { "title": "ThothII — sincronizzazione schema del Metadata Catalog", "locale": "it", "output": "docs/architecture/thothii-catalog-sync.html", "quality_profile": "showcase", "repository": {"url": "https://git.tylconsulting.it/mptyl/ThothII.git", "link_mode": "local-only", "revision": "31e6d3a162e9e5ac71fc2d8da4fe44b16c06aae3"} },
|
||||
"mainPath": ["queued", "running", "applying", "succeeded"],
|
||||
"states": [
|
||||
{ "id": "queued", "type": "start", "label": "queued", "sublabel": "un run attivo per database", "step": "01",
|
||||
"sources": [ { "path": "backend/src/catalog/migrations/003_catalog_schema_sync.ts", "line": 102, "end_line": 104, "label": "indice un solo attivo" } ] },
|
||||
{ "id": "running", "type": "active", "label": "running", "sublabel": "scan DWH + piano delle modifiche", "step": "02",
|
||||
"sources": [ { "path": "backend/src/catalog/sync-worker.ts", "line": 175, "end_line": 175, "label": "claimSyncRun" }, { "path": "backend/src/catalog/sync-worker.ts", "line": 210, "end_line": 220, "label": "scan + plan" } ] },
|
||||
{ "id": "applying", "type": "active", "label": "applying", "sublabel": "modifiche in una transazione", "tag": "non cancellabile", "step": "03",
|
||||
"sources": [ { "path": "backend/src/catalog/sync-worker.ts", "line": 243, "end_line": 250, "label": "applySchemaSync" } ] },
|
||||
{ "id": "succeeded", "type": "success", "label": "succeeded", "sublabel": "catalogo aggiornato", "step": "04",
|
||||
"sources": [ { "path": "backend/src/catalog/sync-worker.ts", "line": 300, "end_line": 300 } ] },
|
||||
{ "id": "awaiting", "type": "waiting", "label": "awaiting_confirmation", "sublabel": "cancellazioni da confermare", "tag": "admin",
|
||||
"sources": [ { "path": "backend/src/catalog/sync-worker.ts", "line": 222, "end_line": 240, "label": "diff distruttivo" }, { "path": "backend/src/catalog/sync-worker.ts", "line": 96, "end_line": 112, "label": "confirm" } ] },
|
||||
{ "id": "cancelled", "type": "neutral", "label": "cancelled", "sublabel": "annullato dall'utente",
|
||||
"sources": [ { "path": "backend/src/catalog/sync-worker.ts", "line": 114, "end_line": 136, "label": "cancel" } ] },
|
||||
{ "id": "failed", "type": "failure", "label": "failed", "sublabel": "errore o timeout",
|
||||
"sources": [ { "path": "backend/src/catalog/sync-worker.ts", "line": 260, "end_line": 272 } ] },
|
||||
{ "id": "interrupted", "type": "failure", "label": "interrupted", "sublabel": "riavvio del servizio",
|
||||
"sources": [ { "path": "backend/src/catalog/repository.ts", "line": 1896, "end_line": 1896, "label": "interruptActiveSyncRuns" } ] }
|
||||
],
|
||||
"transitions": [
|
||||
{ "id": "q-r", "from": "queued", "to": "running", "label": "claim" },
|
||||
{ "id": "r-a", "from": "running", "to": "applying", "label": "piano pronto" },
|
||||
{ "id": "a-s", "from": "applying", "to": "succeeded", "label": "commit", "variant": "emphasis" },
|
||||
{ "id": "r-w", "from": "running", "to": "awaiting", "label": "diff distruttivo", "variant": "security" },
|
||||
{ "id": "w-q", "from": "awaiting", "to": "queued", "label": "confirm" },
|
||||
{ "id": "w-c", "from": "awaiting", "to": "cancelled", "label": "cancel" },
|
||||
{ "id": "q-c", "from": "queued", "to": "cancelled", "label": "cancel" },
|
||||
{ "id": "r-f", "from": "running", "to": "failed", "label": "errore", "variant": "security" },
|
||||
{ "id": "r-i", "from": "running", "to": "interrupted", "label": "restart", "variant": "dashed" }
|
||||
],
|
||||
"cards": [
|
||||
{ "dot": "amber", "title": "Conferma", "items": [
|
||||
"Se il piano rimuove tabelle, colonne o relazioni il run si ferma e chiede conferma",
|
||||
"La conferma vale solo per lo stesso snapshot: se il DWH cambia, si richiede di nuovo"
|
||||
] },
|
||||
{ "dot": "cyan", "title": "Altri run", "items": [
|
||||
"I run di generazione descrizioni seguono stati analoghi: queued, running, completed, completed_with_errors, cancelled, failed, interrupted",
|
||||
"Un run terminato può essere rilanciato con retry"
|
||||
] }
|
||||
]
|
||||
}
|
||||
@@ -1,230 +0,0 @@
|
||||
{
|
||||
"schema_version": 1,
|
||||
"diagram_type": "sequence",
|
||||
"meta": {
|
||||
"title": "Sequenza runtime del core ThothII",
|
||||
"output": "thothii-core-sequence.html",
|
||||
"quality_profile": "showcase",
|
||||
"column_fit": "spread",
|
||||
"viewBox": [1080, 540]
|
||||
},
|
||||
"participants": [
|
||||
{
|
||||
"id": "reviewer",
|
||||
"type": "external",
|
||||
"label": "Revisore",
|
||||
"sublabel": "browser"
|
||||
},
|
||||
{
|
||||
"id": "frontend",
|
||||
"type": "frontend",
|
||||
"label": "Frontend",
|
||||
"sublabel": "React + SSE"
|
||||
},
|
||||
{
|
||||
"id": "api",
|
||||
"type": "backend",
|
||||
"label": "Core API",
|
||||
"sublabel": "Fastify + SseHub"
|
||||
},
|
||||
{
|
||||
"id": "runtime",
|
||||
"type": "backend",
|
||||
"label": "Runtime",
|
||||
"sublabel": "manager + bridge"
|
||||
},
|
||||
{
|
||||
"id": "pi",
|
||||
"type": "backend",
|
||||
"label": "Pi + tht-gate",
|
||||
"sublabel": "RPC per sessione"
|
||||
},
|
||||
{
|
||||
"id": "model",
|
||||
"type": "external",
|
||||
"label": "Modello AI",
|
||||
"sublabel": "provider configurato"
|
||||
},
|
||||
{
|
||||
"id": "tht",
|
||||
"type": "backend",
|
||||
"label": "tht CLI",
|
||||
"sublabel": "workflow persistito"
|
||||
},
|
||||
{
|
||||
"id": "state",
|
||||
"type": "database",
|
||||
"label": "Stato e dati",
|
||||
"sublabel": "workspace + dati"
|
||||
}
|
||||
],
|
||||
"segments": [
|
||||
{
|
||||
"from": 150,
|
||||
"to": 300,
|
||||
"label": "Avvio o ripresa"
|
||||
},
|
||||
{
|
||||
"from": 305,
|
||||
"to": 395,
|
||||
"label": "Turno Pi e workflow persistito"
|
||||
},
|
||||
{
|
||||
"from": 400,
|
||||
"to": 475,
|
||||
"label": "Evento SSE e gate umano"
|
||||
}
|
||||
],
|
||||
"messages": [
|
||||
{
|
||||
"id": "askQuestion",
|
||||
"from": "reviewer",
|
||||
"to": "frontend",
|
||||
"y": 160,
|
||||
"label": "domanda o decisione gate",
|
||||
"variant": "emphasis"
|
||||
},
|
||||
{
|
||||
"id": "createSession",
|
||||
"from": "frontend",
|
||||
"to": "api",
|
||||
"y": 185,
|
||||
"label": "POST /sessions o /response",
|
||||
"variant": "emphasis"
|
||||
},
|
||||
{
|
||||
"id": "newManifest",
|
||||
"from": "api",
|
||||
"to": "tht",
|
||||
"y": 210,
|
||||
"label": "sessionNew o sessionShow/reopen"
|
||||
},
|
||||
{
|
||||
"id": "persistQuestion",
|
||||
"from": "tht",
|
||||
"to": "state",
|
||||
"y": 235,
|
||||
"label": "manifest, artifact e ledger"
|
||||
},
|
||||
{
|
||||
"id": "createRuntime",
|
||||
"from": "api",
|
||||
"to": "runtime",
|
||||
"y": 260,
|
||||
"label": "createFor + bind; configure + searchPack",
|
||||
"note": "configure(...) e searchPack(...) terminano in parallelo prima dell’avvio del modello."
|
||||
},
|
||||
{
|
||||
"id": "startPi",
|
||||
"from": "runtime",
|
||||
"to": "pi",
|
||||
"y": 285,
|
||||
"label": "/nuova-domanda o /riprendi-sessione",
|
||||
"variant": "emphasis",
|
||||
"note": "In ripresa usa /riprendi-sessione <id> dopo aver riletto provider, modello e thinking dal manifest."
|
||||
},
|
||||
{
|
||||
"id": "modelRequest",
|
||||
"from": "pi",
|
||||
"to": "model",
|
||||
"y": 315,
|
||||
"label": "turno modello; token e tool call"
|
||||
},
|
||||
{
|
||||
"id": "phaseCommand",
|
||||
"from": "pi",
|
||||
"to": "tht",
|
||||
"y": 345,
|
||||
"label": "comandi phase / session / evidence",
|
||||
"variant": "emphasis"
|
||||
},
|
||||
{
|
||||
"id": "readWriteTruth",
|
||||
"from": "tht",
|
||||
"to": "state",
|
||||
"y": 375,
|
||||
"label": "legge/scrive artifact e ledger",
|
||||
"note": "Il workspace persistito è la verità; DWH è read-only e Qdrant serve il retrieval."
|
||||
},
|
||||
{
|
||||
"id": "rpcEvents",
|
||||
"from": "pi",
|
||||
"to": "runtime",
|
||||
"y": 405,
|
||||
"label": "text_delta / ui_request"
|
||||
},
|
||||
{
|
||||
"id": "sseEvent",
|
||||
"from": "runtime",
|
||||
"to": "frontend",
|
||||
"y": 430,
|
||||
"label": "SSE via SseHub: text · info · widget",
|
||||
"variant": "return"
|
||||
},
|
||||
{
|
||||
"id": "showResult",
|
||||
"from": "frontend",
|
||||
"to": "reviewer",
|
||||
"y": 455,
|
||||
"label": "testo o widget di revisione",
|
||||
"variant": "return"
|
||||
}
|
||||
],
|
||||
"activations": [
|
||||
{
|
||||
"participant": "frontend",
|
||||
"from": 155,
|
||||
"to": 460,
|
||||
"type": "frontend"
|
||||
},
|
||||
{
|
||||
"participant": "api",
|
||||
"from": 180,
|
||||
"to": 290,
|
||||
"type": "backend"
|
||||
},
|
||||
{
|
||||
"participant": "runtime",
|
||||
"from": 255,
|
||||
"to": 440,
|
||||
"type": "backend"
|
||||
},
|
||||
{
|
||||
"participant": "pi",
|
||||
"from": 280,
|
||||
"to": 415,
|
||||
"type": "backend"
|
||||
},
|
||||
{
|
||||
"participant": "model",
|
||||
"from": 310,
|
||||
"to": 335,
|
||||
"type": "external"
|
||||
},
|
||||
{
|
||||
"participant": "tht",
|
||||
"from": 205,
|
||||
"to": 390,
|
||||
"type": "backend"
|
||||
},
|
||||
{
|
||||
"participant": "state",
|
||||
"from": 230,
|
||||
"to": 390,
|
||||
"type": "database"
|
||||
}
|
||||
],
|
||||
"cards": [
|
||||
{
|
||||
"dot": "cyan",
|
||||
"title": "Bootstrap",
|
||||
"items": [
|
||||
"La sessione viene persistita prima dell’avvio di Pi; configurazione e retrieval terminano prima del primo prompt.",
|
||||
"La ripresa rifiuta sessioni finalizzate o archiviate e usa sempre /riprendi-sessione <id>.",
|
||||
"Il modello propone; il revisore decide tramite reviewer_select, reviewer_decide o reviewer_confirm.",
|
||||
"La risposta percorre POST /sessions/:id/response → bridge.respond → extension_ui_response; stale/duplicate ricevono 409.",
|
||||
"La fase avanza solo dopo append della decisione esplicita e fold del ledger persistito."
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,529 @@
|
||||
{
|
||||
"schema_version": 1,
|
||||
"diagram_type": "architecture",
|
||||
"meta": {
|
||||
"title": "ThothII — deployment Docker Compose",
|
||||
"locale": "it",
|
||||
"output": "docs/architecture/thothii-deployment.html",
|
||||
"quality_profile": "showcase",
|
||||
"repository": {
|
||||
"url": "https://git.tylconsulting.it/mptyl/ThothII.git",
|
||||
"link_mode": "local-only",
|
||||
"revision": "31e6d3a162e9e5ac71fc2d8da4fe44b16c06aae3"
|
||||
}
|
||||
},
|
||||
"components": [
|
||||
{
|
||||
"id": "operator",
|
||||
"type": "external",
|
||||
"label": "Operatore",
|
||||
"sublabel": "host",
|
||||
"pos": [
|
||||
40,
|
||||
40
|
||||
],
|
||||
"size": [
|
||||
150,
|
||||
64
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "thtcli",
|
||||
"type": "backend",
|
||||
"label": "tht (host)",
|
||||
"sublabel": "CLI Go: setup, start, stop",
|
||||
"pos": [
|
||||
290,
|
||||
40
|
||||
],
|
||||
"size": [
|
||||
170,
|
||||
64
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "tools/tht/cmd/tht/main.go",
|
||||
"line": 223,
|
||||
"end_line": 237,
|
||||
"label": "start / stop"
|
||||
},
|
||||
{
|
||||
"path": "tools/tht/internal/config/installation.go",
|
||||
"line": 548,
|
||||
"end_line": 548,
|
||||
"label": "docker compose"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "browser",
|
||||
"type": "external",
|
||||
"label": "Browser",
|
||||
"sublabel": "o proxy del portale",
|
||||
"pos": [
|
||||
40,
|
||||
340
|
||||
],
|
||||
"size": [
|
||||
150,
|
||||
64
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "frontend",
|
||||
"type": "frontend",
|
||||
"label": "frontend",
|
||||
"sublabel": "nginx :8080",
|
||||
"tag": "unica porta pubblica",
|
||||
"pos": [
|
||||
290,
|
||||
340
|
||||
],
|
||||
"size": [
|
||||
160,
|
||||
64
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "compose.yaml",
|
||||
"line": 190,
|
||||
"end_line": 208
|
||||
},
|
||||
{
|
||||
"path": "docker/nginx.conf.template",
|
||||
"line": 13,
|
||||
"end_line": 20,
|
||||
"label": "/api → core"
|
||||
},
|
||||
{
|
||||
"path": "deploy/compose.server.yaml",
|
||||
"line": 32,
|
||||
"end_line": 34,
|
||||
"label": "porta server"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "core",
|
||||
"type": "backend",
|
||||
"label": "core",
|
||||
"sublabel": "backend + Pi + tht :8787",
|
||||
"tag": "MAX_PI_PROCESSES",
|
||||
"pos": [
|
||||
540,
|
||||
340
|
||||
],
|
||||
"size": [
|
||||
190,
|
||||
84
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "compose.yaml",
|
||||
"line": 4,
|
||||
"end_line": 72
|
||||
},
|
||||
{
|
||||
"path": "docker/core.Dockerfile",
|
||||
"line": 1,
|
||||
"end_line": 5
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "catalogdb",
|
||||
"type": "database",
|
||||
"label": "catalog-db",
|
||||
"sublabel": "PostgreSQL 17",
|
||||
"tag": "volume catalog-data",
|
||||
"pos": [
|
||||
820,
|
||||
340
|
||||
],
|
||||
"size": [
|
||||
170,
|
||||
64
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "compose.yaml",
|
||||
"line": 74,
|
||||
"end_line": 98
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "migrate",
|
||||
"type": "backend",
|
||||
"label": "catalog-migrate",
|
||||
"sublabel": "one-shot",
|
||||
"pos": [
|
||||
1080,
|
||||
340
|
||||
],
|
||||
"size": [
|
||||
160,
|
||||
64
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "compose.yaml",
|
||||
"line": 100,
|
||||
"end_line": 117
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "qdrant",
|
||||
"type": "database",
|
||||
"label": "qdrant",
|
||||
"sublabel": "vector store :6333",
|
||||
"tag": "volume qdrant-data",
|
||||
"pos": [
|
||||
820,
|
||||
490
|
||||
],
|
||||
"size": [
|
||||
170,
|
||||
64
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "compose.yaml",
|
||||
"line": 210,
|
||||
"end_line": 228
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "maint",
|
||||
"type": "backend",
|
||||
"label": "workspace-maintenance",
|
||||
"sublabel": "one-shot, preprocessing",
|
||||
"pos": [
|
||||
1080,
|
||||
490
|
||||
],
|
||||
"size": [
|
||||
190,
|
||||
64
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "compose.yaml",
|
||||
"line": 119,
|
||||
"end_line": 188
|
||||
},
|
||||
{
|
||||
"path": "backend/src/workspace-maintenance.ts",
|
||||
"line": 22,
|
||||
"end_line": 22,
|
||||
"label": "comandi"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "embedding",
|
||||
"type": "backend",
|
||||
"label": "embedding",
|
||||
"sublabel": "Ollama :11434",
|
||||
"tag": "volume embedding-models",
|
||||
"pos": [
|
||||
820,
|
||||
640
|
||||
],
|
||||
"size": [
|
||||
170,
|
||||
64
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "compose.yaml",
|
||||
"line": 230,
|
||||
"end_line": 249
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "modelinit",
|
||||
"type": "backend",
|
||||
"label": "embedding-model-init",
|
||||
"sublabel": "one-shot, scarica il modello",
|
||||
"pos": [
|
||||
1080,
|
||||
640
|
||||
],
|
||||
"size": [
|
||||
190,
|
||||
64
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "compose.yaml",
|
||||
"line": 251,
|
||||
"end_line": 264
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "volumes",
|
||||
"type": "database",
|
||||
"label": "Volumi core",
|
||||
"sublabel": "sessions, settings, pi-state, auth-state",
|
||||
"tag": "+ workspace-registry/secrets",
|
||||
"pos": [
|
||||
500,
|
||||
560
|
||||
],
|
||||
"size": [
|
||||
270,
|
||||
64
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "compose.yaml",
|
||||
"line": 42,
|
||||
"end_line": 50
|
||||
},
|
||||
{
|
||||
"path": "compose.yaml",
|
||||
"line": 269,
|
||||
"end_line": 278
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "secrets",
|
||||
"type": "security",
|
||||
"label": "Secret + config",
|
||||
"sublabel": "thothii.secrets, installation.yaml",
|
||||
"pos": [
|
||||
230,
|
||||
560
|
||||
],
|
||||
"size": [
|
||||
230,
|
||||
64
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "compose.yaml",
|
||||
"line": 51,
|
||||
"end_line": 57
|
||||
},
|
||||
{
|
||||
"path": "compose.yaml",
|
||||
"line": 280,
|
||||
"end_line": 290
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "git",
|
||||
"type": "cloud",
|
||||
"label": "Git remote workspace",
|
||||
"sublabel": "THT_WORKSPACE_GIT_REMOTE",
|
||||
"pos": [
|
||||
290,
|
||||
190
|
||||
],
|
||||
"size": [
|
||||
200,
|
||||
64
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/workspaces/git-repository.ts",
|
||||
"line": 185,
|
||||
"end_line": 195,
|
||||
"label": "clone / refresh"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "dwh",
|
||||
"type": "cloud",
|
||||
"label": "DWH",
|
||||
"sublabel": "Postgres o REST, sola lettura",
|
||||
"pos": [
|
||||
820,
|
||||
190
|
||||
],
|
||||
"size": [
|
||||
190,
|
||||
64
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "compose.yaml",
|
||||
"line": 36,
|
||||
"end_line": 37
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "llm",
|
||||
"type": "cloud",
|
||||
"label": "Provider LLM",
|
||||
"sublabel": "THT_LLM_URL",
|
||||
"pos": [
|
||||
820,
|
||||
40
|
||||
],
|
||||
"size": [
|
||||
170,
|
||||
64
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "compose.yaml",
|
||||
"line": 38,
|
||||
"end_line": 38
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"boundaries": [
|
||||
{
|
||||
"kind": "region",
|
||||
"label": "rete Compose thothii",
|
||||
"wraps": [
|
||||
"frontend",
|
||||
"core",
|
||||
"catalogdb",
|
||||
"migrate",
|
||||
"qdrant",
|
||||
"maint",
|
||||
"embedding",
|
||||
"modelinit",
|
||||
"volumes",
|
||||
"secrets"
|
||||
]
|
||||
}
|
||||
],
|
||||
"connections": [
|
||||
{
|
||||
"id": "op-cli",
|
||||
"from": "operator",
|
||||
"to": "thtcli",
|
||||
"label": "comandi"
|
||||
},
|
||||
{
|
||||
"id": "cli-core",
|
||||
"from": "thtcli",
|
||||
"to": "core",
|
||||
"label": "compose up",
|
||||
"variant": "dashed"
|
||||
},
|
||||
{
|
||||
"id": "br-fe",
|
||||
"from": "browser",
|
||||
"to": "frontend",
|
||||
"label": "HTTPS",
|
||||
"variant": "emphasis"
|
||||
},
|
||||
{
|
||||
"id": "fe-core",
|
||||
"from": "frontend",
|
||||
"to": "core",
|
||||
"label": "/api",
|
||||
"variant": "emphasis"
|
||||
},
|
||||
{
|
||||
"id": "core-db",
|
||||
"from": "core",
|
||||
"to": "catalogdb",
|
||||
"label": "SQL",
|
||||
"variant": "emphasis"
|
||||
},
|
||||
{
|
||||
"id": "mig-db",
|
||||
"from": "migrate",
|
||||
"to": "catalogdb",
|
||||
"label": "migra"
|
||||
},
|
||||
{
|
||||
"id": "core-qd",
|
||||
"from": "core",
|
||||
"to": "qdrant",
|
||||
"label": "HTTP"
|
||||
},
|
||||
{
|
||||
"id": "core-emb",
|
||||
"from": "core",
|
||||
"to": "embedding",
|
||||
"label": "embed"
|
||||
},
|
||||
{
|
||||
"id": "maint-qd",
|
||||
"from": "maint",
|
||||
"to": "qdrant",
|
||||
"label": "reindicizza"
|
||||
},
|
||||
{
|
||||
"id": "init-emb",
|
||||
"from": "modelinit",
|
||||
"to": "embedding",
|
||||
"label": "pull"
|
||||
},
|
||||
{
|
||||
"id": "core-vol",
|
||||
"from": "core",
|
||||
"to": "volumes",
|
||||
"label": "monta"
|
||||
},
|
||||
{
|
||||
"id": "sec-core",
|
||||
"from": "secrets",
|
||||
"to": "core",
|
||||
"label": "/run/secrets",
|
||||
"variant": "security"
|
||||
},
|
||||
{
|
||||
"id": "core-git",
|
||||
"from": "core",
|
||||
"to": "git",
|
||||
"label": "clone"
|
||||
},
|
||||
{
|
||||
"id": "core-dwh",
|
||||
"from": "core",
|
||||
"to": "dwh",
|
||||
"label": "read-only"
|
||||
},
|
||||
{
|
||||
"id": "core-llm",
|
||||
"from": "core",
|
||||
"to": "llm",
|
||||
"label": "API modelli"
|
||||
}
|
||||
],
|
||||
"cards": [
|
||||
{
|
||||
"dot": "cyan",
|
||||
"title": "Avvio",
|
||||
"items": [
|
||||
"tht start sul host esegue docker compose con base + profilo (local o server)",
|
||||
"catalog-migrate ed embedding-model-init girano una volta prima del core",
|
||||
"Il core parte solo con catalog-db e qdrant sani e il modello di embedding scaricato"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dot": "amber",
|
||||
"title": "Profili",
|
||||
"items": [
|
||||
"local: porte solo su 127.0.0.1 (frontend 8080, core 8787, Qdrant 6333)",
|
||||
"server: espone solo il frontend dietro il proxy autenticato",
|
||||
"workspace-maintenance gira on demand: preprocessing ed Evidence"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dot": "rose",
|
||||
"title": "Confini",
|
||||
"items": [
|
||||
"DWH, provider LLM e Git remote sono esterni alla rete Compose",
|
||||
"I secret arrivano come Docker secrets, mai in variabili o YAML"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,88 @@
|
||||
<!doctype html>
|
||||
<html lang="it">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Diagrammi ThothII</title>
|
||||
<style>
|
||||
:root {
|
||||
--bg: #f6f7f9; --surface: #ffffff; --text: #18202b; --muted: #5b6676;
|
||||
--border: #e1e5eb; --accent: #0e7490; --chip: #eef6f8;
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root { --bg: #11151b; --surface: #1a2028; --text: #e7ebf0; --muted: #9aa5b3;
|
||||
--border: #2a323d; --accent: #5ec4d8; --chip: #1d2a31; }
|
||||
}
|
||||
* { box-sizing: border-box; }
|
||||
body { margin: 0; background: var(--bg); color: var(--text);
|
||||
font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
|
||||
main { max-width: 1080px; margin: 0 auto; padding: 40px 16px 64px; }
|
||||
h1 { font-size: 26px; margin: 0 0 6px; }
|
||||
.intro { color: var(--muted); margin: 0 0 32px; max-width: 70ch; }
|
||||
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
|
||||
margin: 32px 0 12px; }
|
||||
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
|
||||
a.card { display: block; text-decoration: none; color: inherit; background: var(--surface);
|
||||
border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
|
||||
a.card:hover { border-color: var(--accent); }
|
||||
.title { font-weight: 600; }
|
||||
.kind { display: inline-block; font-size: 11px; font-family: ui-monospace, monospace;
|
||||
background: var(--chip); color: var(--accent); border-radius: 4px; padding: 1px 6px; margin-left: 6px; }
|
||||
.desc { color: var(--muted); font-size: 14px; margin-top: 4px; }
|
||||
footer { margin-top: 40px; color: var(--muted); font-size: 13px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<h1>Diagrammi dell'architettura ThothII</h1>
|
||||
<p class="intro">Diagrammi interattivi generati con Archify a partire dal codice. Ogni elemento
|
||||
rimanda ai file e alle righe da cui deriva. Il sorgente JSON di ogni diagramma è nella stessa
|
||||
cartella, con lo stesso nome.</p>
|
||||
|
||||
<h2>Panoramica</h2>
|
||||
<div class="grid">
|
||||
<a class="card" href="thothii-runtime.html"><span class="title">Architettura runtime</span><span class="kind">architecture</span>
|
||||
<div class="desc">Frontend, backend, Pi, estensione gate, CLI tht e servizi collegati.</div></a>
|
||||
<a class="card" href="thothii-deployment.html"><span class="title">Deployment Docker Compose</span><span class="kind">architecture</span>
|
||||
<div class="desc">Servizi, one-shot, volumi, secret, endpoint esterni e CLI host.</div></a>
|
||||
<a class="card" href="thothii-modules.html"><span class="title">Struttura dei moduli</span><span class="kind">tree</span>
|
||||
<div class="desc">Cartelle principali del repository e loro ruolo.</div></a>
|
||||
</div>
|
||||
|
||||
<h2>Workflow e sessioni</h2>
|
||||
<div class="grid">
|
||||
<a class="card" href="thothii-phases.html"><span class="title">Workflow in 8 fasi</span><span class="kind">workflow</span>
|
||||
<div class="desc">F1–F8, gate del reviewer, salti automatici e ritorno indietro.</div></a>
|
||||
<a class="card" href="thothii-session-lifecycle.html"><span class="title">Ciclo di vita della sessione</span><span class="kind">lifecycle</span>
|
||||
<div class="desc">open, closed, failed, finalized, archiviazione e cancellazione.</div></a>
|
||||
<a class="card" href="thothii-new-question.html"><span class="title">Avvio di una nuova domanda</span><span class="kind">sequence</span>
|
||||
<div class="desc">Dalla domanda al primo turno F1 con streaming SSE.</div></a>
|
||||
<a class="card" href="thothii-gate-roundtrip.html"><span class="title">Andata e ritorno di un gate</span><span class="kind">sequence</span>
|
||||
<div class="desc">Widget, risposta del reviewer, decisione nel ledger.</div></a>
|
||||
<a class="card" href="thothii-resume.html"><span class="title">Ripresa di una sessione</span><span class="kind">sequence</span>
|
||||
<div class="desc">Riapertura e ricostruzione del contesto dallo stato su disco.</div></a>
|
||||
</div>
|
||||
|
||||
<h2>Backend e sicurezza</h2>
|
||||
<div class="grid">
|
||||
<a class="card" href="thothii-session-runtime.html"><span class="title">Classi del runtime di sessione</span><span class="kind">class</span>
|
||||
<div class="desc">PiProcessManager, SessionBridge, RpcClient, SseHub, ThtRunner.</div></a>
|
||||
<a class="card" href="thothii-auth-oidc.html"><span class="title">Login OIDC e richieste autenticate</span><span class="kind">sequence</span>
|
||||
<div class="desc">Authorization Code + PKCE, sessione browser e controlli per richiesta.</div></a>
|
||||
</div>
|
||||
|
||||
<h2>Dati e Metadata Catalog</h2>
|
||||
<div class="grid">
|
||||
<a class="card" href="thothii-metadata-flow.html"><span class="title">Dai metadati al contesto di sessione</span><span class="kind">dataflow</span>
|
||||
<div class="desc">DWH, catalogo, preprocessing, indici LSH e Qdrant, search pack, memoria.</div></a>
|
||||
<a class="card" href="thothii-metadata-catalog.html"><span class="title">Schema del Metadata Catalog</span><span class="kind">erd</span>
|
||||
<div class="desc">14 tabelle PostgreSQL ricostruite dalle migrazioni.</div></a>
|
||||
<a class="card" href="thothii-catalog-sync.html"><span class="title">Sincronizzazione dello schema</span><span class="kind">lifecycle</span>
|
||||
<div class="desc">Stati dei run di sync, conferma delle modifiche distruttive.</div></a>
|
||||
</div>
|
||||
|
||||
<footer>Per rigenerare un diagramma: modificare il suo JSON e rieseguire
|
||||
<code>archify finalize</code> con <code>--repo-root</code> sulla radice del repository.</footer>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,332 @@
|
||||
{
|
||||
"schema_version": 1,
|
||||
"diagram_type": "sequence",
|
||||
"meta": {
|
||||
"title": "ThothII — andata e ritorno di un gate reviewer",
|
||||
"locale": "it",
|
||||
"output": "docs/architecture/thothii-gate-roundtrip.html",
|
||||
"quality_profile": "showcase",
|
||||
"repository": {
|
||||
"url": "https://git.tylconsulting.it/mptyl/ThothII.git",
|
||||
"link_mode": "local-only",
|
||||
"revision": "31e6d3a162e9e5ac71fc2d8da4fe44b16c06aae3"
|
||||
}
|
||||
},
|
||||
"participants": [
|
||||
{
|
||||
"id": "reviewer",
|
||||
"type": "external",
|
||||
"label": "Reviewer",
|
||||
"sublabel": "browser"
|
||||
},
|
||||
{
|
||||
"id": "frontend",
|
||||
"type": "frontend",
|
||||
"label": "Frontend",
|
||||
"sublabel": "React",
|
||||
"sources": [
|
||||
{
|
||||
"path": "frontend/src/store/sessionStore.ts",
|
||||
"line": 76,
|
||||
"end_line": 90,
|
||||
"label": "pendingWidget"
|
||||
},
|
||||
{
|
||||
"path": "frontend/src/widgets/registry.ts",
|
||||
"line": 5,
|
||||
"end_line": 13,
|
||||
"label": "registry widget"
|
||||
},
|
||||
{
|
||||
"path": "frontend/src/api/sessions.ts",
|
||||
"line": 130,
|
||||
"end_line": 134,
|
||||
"label": "postResponse"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "backend",
|
||||
"type": "backend",
|
||||
"label": "Backend",
|
||||
"sublabel": "SessionBridge",
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/bridge/session-bridge.ts",
|
||||
"line": 63,
|
||||
"end_line": 71,
|
||||
"label": "ui_request"
|
||||
},
|
||||
{
|
||||
"path": "backend/src/routes/sessions.ts",
|
||||
"line": 634,
|
||||
"end_line": 662,
|
||||
"label": "POST /response"
|
||||
},
|
||||
{
|
||||
"path": "backend/src/bridge/session-bridge.ts",
|
||||
"line": 178,
|
||||
"end_line": 188,
|
||||
"label": "respond"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "pi",
|
||||
"type": "backend",
|
||||
"label": "Pi",
|
||||
"sublabel": "--mode rpc"
|
||||
},
|
||||
{
|
||||
"id": "gate",
|
||||
"type": "backend",
|
||||
"label": "tht-gate.js",
|
||||
"sublabel": "reviewer_select",
|
||||
"sources": [
|
||||
{
|
||||
"path": "harness/.pi/extensions/tht-gate.js",
|
||||
"line": 924,
|
||||
"end_line": 942,
|
||||
"label": "execute"
|
||||
},
|
||||
{
|
||||
"path": "harness/.pi/extensions/tht-gate.js",
|
||||
"line": 597,
|
||||
"end_line": 603,
|
||||
"label": "emitAndWait"
|
||||
},
|
||||
{
|
||||
"path": "harness/.pi/extensions/tht-gate.js",
|
||||
"line": 465,
|
||||
"end_line": 468,
|
||||
"label": "advanceIfReady"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "tht",
|
||||
"type": "backend",
|
||||
"label": "tht CLI",
|
||||
"sublabel": "ledger",
|
||||
"sources": [
|
||||
{
|
||||
"path": "harness/tht/decisions.py",
|
||||
"line": 98,
|
||||
"end_line": 120,
|
||||
"label": "append_decision"
|
||||
},
|
||||
{
|
||||
"path": "harness/tht/phase.py",
|
||||
"line": 60,
|
||||
"end_line": 79,
|
||||
"label": "current_phase"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "llm",
|
||||
"type": "cloud",
|
||||
"label": "Provider LLM",
|
||||
"sublabel": "modello di sessione"
|
||||
}
|
||||
],
|
||||
"segments": [
|
||||
{
|
||||
"from": 160,
|
||||
"to": 420,
|
||||
"label": "Proposta"
|
||||
},
|
||||
{
|
||||
"from": 428,
|
||||
"to": 600,
|
||||
"label": "Decisione"
|
||||
},
|
||||
{
|
||||
"from": 608,
|
||||
"to": 790,
|
||||
"label": "Persistenza"
|
||||
}
|
||||
],
|
||||
"messages": [
|
||||
{
|
||||
"id": "call",
|
||||
"from": "llm",
|
||||
"to": "pi",
|
||||
"y": 170,
|
||||
"label": "tool call",
|
||||
"variant": "return"
|
||||
},
|
||||
{
|
||||
"id": "exec",
|
||||
"from": "pi",
|
||||
"to": "gate",
|
||||
"y": 200,
|
||||
"label": "reviewer_select"
|
||||
},
|
||||
{
|
||||
"id": "input",
|
||||
"from": "gate",
|
||||
"to": "pi",
|
||||
"y": 230,
|
||||
"label": "ctx.ui.input",
|
||||
"note": "descrittore widget come JSON"
|
||||
},
|
||||
{
|
||||
"id": "uireq",
|
||||
"from": "pi",
|
||||
"to": "backend",
|
||||
"y": 290,
|
||||
"label": "extension_ui_request",
|
||||
"variant": "dashed",
|
||||
"note": "con l'id RPC di Pi"
|
||||
},
|
||||
{
|
||||
"id": "sse",
|
||||
"from": "backend",
|
||||
"to": "frontend",
|
||||
"y": 350,
|
||||
"label": "SSE ui_request",
|
||||
"variant": "dashed",
|
||||
"note": "il bridge ricorda l'id di Pi"
|
||||
},
|
||||
{
|
||||
"id": "widget",
|
||||
"from": "frontend",
|
||||
"to": "reviewer",
|
||||
"y": 410,
|
||||
"label": "widget",
|
||||
"variant": "return"
|
||||
},
|
||||
{
|
||||
"id": "pick",
|
||||
"from": "reviewer",
|
||||
"to": "frontend",
|
||||
"y": 440,
|
||||
"label": "scelta"
|
||||
},
|
||||
{
|
||||
"id": "post",
|
||||
"from": "frontend",
|
||||
"to": "backend",
|
||||
"y": 470,
|
||||
"label": "POST /response",
|
||||
"variant": "emphasis",
|
||||
"note": "409 se il gate non è quello in attesa"
|
||||
},
|
||||
{
|
||||
"id": "ok",
|
||||
"from": "backend",
|
||||
"to": "frontend",
|
||||
"y": 530,
|
||||
"label": "204",
|
||||
"variant": "return"
|
||||
},
|
||||
{
|
||||
"id": "uiresp",
|
||||
"from": "backend",
|
||||
"to": "pi",
|
||||
"y": 560,
|
||||
"label": "extension_ui_response",
|
||||
"variant": "emphasis"
|
||||
},
|
||||
{
|
||||
"id": "value",
|
||||
"from": "pi",
|
||||
"to": "gate",
|
||||
"y": 620,
|
||||
"label": "risposta",
|
||||
"variant": "return"
|
||||
},
|
||||
{
|
||||
"id": "add",
|
||||
"from": "gate",
|
||||
"to": "tht",
|
||||
"y": 650,
|
||||
"label": "decision add",
|
||||
"variant": "emphasis",
|
||||
"note": "accoda a review_decisions.jsonl"
|
||||
},
|
||||
{
|
||||
"id": "advance",
|
||||
"from": "gate",
|
||||
"to": "tht",
|
||||
"y": 720,
|
||||
"label": "phase advance --auto",
|
||||
"variant": "dashed"
|
||||
},
|
||||
{
|
||||
"id": "result",
|
||||
"from": "gate",
|
||||
"to": "pi",
|
||||
"y": 750,
|
||||
"label": "risultato tool",
|
||||
"variant": "return"
|
||||
},
|
||||
{
|
||||
"id": "next",
|
||||
"from": "pi",
|
||||
"to": "llm",
|
||||
"y": 780,
|
||||
"label": "turno successivo",
|
||||
"variant": "emphasis"
|
||||
}
|
||||
],
|
||||
"activations": [
|
||||
{
|
||||
"participant": "pi",
|
||||
"from": 165,
|
||||
"to": 786,
|
||||
"type": "backend"
|
||||
},
|
||||
{
|
||||
"participant": "gate",
|
||||
"from": 198,
|
||||
"to": 756,
|
||||
"type": "backend"
|
||||
},
|
||||
{
|
||||
"participant": "backend",
|
||||
"from": 288,
|
||||
"to": 566,
|
||||
"type": "backend"
|
||||
},
|
||||
{
|
||||
"participant": "frontend",
|
||||
"from": 348,
|
||||
"to": 536,
|
||||
"type": "frontend"
|
||||
},
|
||||
{
|
||||
"participant": "tht",
|
||||
"from": 648,
|
||||
"to": 726,
|
||||
"type": "backend"
|
||||
}
|
||||
],
|
||||
"cards": [
|
||||
{
|
||||
"dot": "cyan",
|
||||
"title": "Correlazione",
|
||||
"items": [
|
||||
"Pi correla la risposta sul proprio id RPC, non sull'id del descrittore",
|
||||
"Il bridge rimanda l'id di Pi; il valore contiene l'id del descrittore per il controllo del gate"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dot": "emerald",
|
||||
"title": "Persistenza",
|
||||
"items": [
|
||||
"Un'opzione con payload decision è già la conferma: il gate la scrive con tht decision add",
|
||||
"Un'opzione senza payload chiede soltanto e non scrive nulla",
|
||||
"phase advance --auto avanza solo se la fase è completa"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dot": "amber",
|
||||
"title": "Altri widget",
|
||||
"items": [
|
||||
"reviewer_decide (scelta multipla) e reviewer_confirm (artefatto o fase) seguono lo stesso percorso"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1,388 @@
|
||||
{
|
||||
"schema_version": 1,
|
||||
"diagram_type": "dataflow",
|
||||
"meta": {
|
||||
"title": "ThothII — dai metadati del DWH al contesto di sessione",
|
||||
"locale": "it",
|
||||
"output": "docs/architecture/thothii-metadata-flow.html",
|
||||
"quality_profile": "showcase",
|
||||
"repository": {
|
||||
"url": "https://git.tylconsulting.it/mptyl/ThothII.git",
|
||||
"link_mode": "local-only",
|
||||
"revision": "31e6d3a162e9e5ac71fc2d8da4fe44b16c06aae3"
|
||||
}
|
||||
},
|
||||
"stages": [
|
||||
{
|
||||
"label": "Fonti"
|
||||
},
|
||||
{
|
||||
"label": "Catalogo"
|
||||
},
|
||||
{
|
||||
"label": "Preprocessing"
|
||||
},
|
||||
{
|
||||
"label": "Indici"
|
||||
},
|
||||
{
|
||||
"label": "Sessione"
|
||||
}
|
||||
],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "dwh",
|
||||
"type": "database",
|
||||
"label": "DWH",
|
||||
"sublabel": "sola lettura",
|
||||
"stage": 0,
|
||||
"row": 0,
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/catalog/sync-worker.ts",
|
||||
"line": 210,
|
||||
"end_line": 220,
|
||||
"label": "scan schema"
|
||||
},
|
||||
{
|
||||
"path": "backend/src/catalog/description-source-sampler.ts",
|
||||
"line": 153,
|
||||
"end_line": 160,
|
||||
"label": "campionamento"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "gitws",
|
||||
"type": "cloud",
|
||||
"label": "Workspace Git",
|
||||
"sublabel": "fonti Evidence",
|
||||
"stage": 0,
|
||||
"row": 2,
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/workspaces/git-repository.ts",
|
||||
"line": 185,
|
||||
"end_line": 195
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "catalog",
|
||||
"type": "database",
|
||||
"label": "Metadata Catalog",
|
||||
"sublabel": "PostgreSQL",
|
||||
"stage": 1,
|
||||
"row": 0,
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/catalog/repository.ts",
|
||||
"line": 488,
|
||||
"end_line": 488,
|
||||
"label": "KyselyCatalogRepository"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "descgen",
|
||||
"type": "backend",
|
||||
"label": "Descrizioni AI",
|
||||
"sublabel": "helper LiteLLM",
|
||||
"stage": 1,
|
||||
"row": 1,
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/catalog/model-completer.ts",
|
||||
"line": 67,
|
||||
"end_line": 74
|
||||
},
|
||||
{
|
||||
"path": "backend/src/catalog/migrations/005_description_generation_runs.ts",
|
||||
"line": 5,
|
||||
"end_line": 5,
|
||||
"label": "run"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "memdb",
|
||||
"type": "database",
|
||||
"label": "Card memoria",
|
||||
"sublabel": "schema thoth_memory",
|
||||
"stage": 4,
|
||||
"row": 0,
|
||||
"sources": [
|
||||
{
|
||||
"path": "harness/tht/memory/repository.py",
|
||||
"line": 15,
|
||||
"end_line": 15,
|
||||
"label": "MemoryRepository"
|
||||
},
|
||||
{
|
||||
"path": "harness/tht/memory/migrate.py",
|
||||
"line": 46,
|
||||
"end_line": 50
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "snapshot",
|
||||
"type": "backend",
|
||||
"label": "Snapshot catalogo",
|
||||
"sublabel": "JSON immutabile",
|
||||
"stage": 2,
|
||||
"row": 0,
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/workspaces/preprocessing-service.ts",
|
||||
"line": 289,
|
||||
"end_line": 301
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "prep",
|
||||
"type": "backend",
|
||||
"label": "preprocess catalog",
|
||||
"sublabel": "tht + embedding",
|
||||
"stage": 2,
|
||||
"row": 1,
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/workspaces/preprocessing-service.ts",
|
||||
"line": 321,
|
||||
"end_line": 329
|
||||
},
|
||||
{
|
||||
"path": "harness/tht/cli/preprocess_cmd.py",
|
||||
"line": 523,
|
||||
"end_line": 545
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "evprep",
|
||||
"type": "backend",
|
||||
"label": "preprocess Evidence",
|
||||
"sublabel": "corpus + embedding",
|
||||
"stage": 2,
|
||||
"row": 2,
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/workspaces/preprocessing-service.ts",
|
||||
"line": 330,
|
||||
"end_line": 339
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "lsh",
|
||||
"type": "database",
|
||||
"label": "Indice LSH",
|
||||
"sublabel": "valori delle colonne",
|
||||
"stage": 3,
|
||||
"row": 1,
|
||||
"sources": [
|
||||
{
|
||||
"path": "harness/tht/cli/preprocess_cmd.py",
|
||||
"line": 167,
|
||||
"end_line": 193
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "qref",
|
||||
"type": "database",
|
||||
"label": "Qdrant reference",
|
||||
"sublabel": "schema + Evidence",
|
||||
"stage": 3,
|
||||
"row": 2,
|
||||
"sources": [
|
||||
{
|
||||
"path": "harness/tht/adapters/vector/qdrant.py",
|
||||
"line": 327,
|
||||
"end_line": 327,
|
||||
"label": "upsert"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "qmem",
|
||||
"type": "database",
|
||||
"label": "Qdrant memory",
|
||||
"sublabel": "dense + BM25",
|
||||
"stage": 3,
|
||||
"row": 0,
|
||||
"sources": [
|
||||
{
|
||||
"path": "harness/tht/memory/repository.py",
|
||||
"line": 225,
|
||||
"end_line": 235,
|
||||
"label": "proiezioni"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "pack",
|
||||
"type": "backend",
|
||||
"label": "search pack",
|
||||
"sublabel": "retrieval_pack.md",
|
||||
"stage": 4,
|
||||
"row": 2,
|
||||
"sources": [
|
||||
{
|
||||
"path": "harness/tht/cli/search_cmd.py",
|
||||
"line": 351,
|
||||
"end_line": 420
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "session",
|
||||
"type": "frontend",
|
||||
"label": "Sessione F1–F8",
|
||||
"sublabel": "search find in F4",
|
||||
"stage": 4,
|
||||
"row": 1,
|
||||
"sources": [
|
||||
{
|
||||
"path": "harness/tht/cli/search_cmd.py",
|
||||
"line": 129,
|
||||
"end_line": 131,
|
||||
"label": "search find"
|
||||
},
|
||||
{
|
||||
"path": "harness/tht/cli/search_cmd.py",
|
||||
"line": 219,
|
||||
"end_line": 226,
|
||||
"label": "usa LSH"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"flows": [
|
||||
{
|
||||
"id": "dwh-catalog",
|
||||
"from": "dwh",
|
||||
"to": "catalog",
|
||||
"label": "sync schema",
|
||||
"variant": "emphasis"
|
||||
},
|
||||
{
|
||||
"id": "dwh-desc",
|
||||
"from": "dwh",
|
||||
"to": "descgen",
|
||||
"label": "campioni",
|
||||
"variant": "security"
|
||||
},
|
||||
{
|
||||
"id": "desc-catalog",
|
||||
"from": "descgen",
|
||||
"to": "catalog",
|
||||
"label": "descrizioni"
|
||||
},
|
||||
{
|
||||
"id": "catalog-snap",
|
||||
"from": "catalog",
|
||||
"to": "snapshot",
|
||||
"label": "metadati",
|
||||
"variant": "emphasis"
|
||||
},
|
||||
{
|
||||
"id": "snap-prep",
|
||||
"from": "snapshot",
|
||||
"to": "prep",
|
||||
"label": "file snapshot"
|
||||
},
|
||||
{
|
||||
"id": "prep-lsh",
|
||||
"from": "prep",
|
||||
"to": "lsh",
|
||||
"label": "MinHash"
|
||||
},
|
||||
{
|
||||
"id": "prep-qref",
|
||||
"from": "prep",
|
||||
"to": "qref",
|
||||
"label": "vettori schema",
|
||||
"variant": "emphasis"
|
||||
},
|
||||
{
|
||||
"id": "git-ev",
|
||||
"from": "gitws",
|
||||
"to": "evprep",
|
||||
"label": "fonti Evidence"
|
||||
},
|
||||
{
|
||||
"id": "ev-qref",
|
||||
"from": "evprep",
|
||||
"to": "qref",
|
||||
"label": "vettori Evidence"
|
||||
},
|
||||
{
|
||||
"id": "mem-qmem",
|
||||
"from": "memdb",
|
||||
"to": "qmem",
|
||||
"label": "proiezione",
|
||||
"variant": "dashed"
|
||||
},
|
||||
{
|
||||
"id": "qref-pack",
|
||||
"from": "qref",
|
||||
"to": "pack",
|
||||
"label": "ricerca ibrida",
|
||||
"variant": "emphasis"
|
||||
},
|
||||
{
|
||||
"id": "qmem-pack",
|
||||
"from": "qmem",
|
||||
"to": "pack",
|
||||
"label": "domande risolte"
|
||||
},
|
||||
{
|
||||
"id": "pack-session",
|
||||
"from": "pack",
|
||||
"to": "session",
|
||||
"label": "contesto F1",
|
||||
"variant": "emphasis"
|
||||
},
|
||||
{
|
||||
"id": "lsh-session",
|
||||
"from": "lsh",
|
||||
"to": "session",
|
||||
"label": "valori"
|
||||
},
|
||||
{
|
||||
"id": "session-mem",
|
||||
"from": "session",
|
||||
"to": "memdb",
|
||||
"label": "promozione F8",
|
||||
"variant": "dashed"
|
||||
}
|
||||
],
|
||||
"cards": [
|
||||
{
|
||||
"dot": "cyan",
|
||||
"title": "Autorità",
|
||||
"items": [
|
||||
"Il Metadata Catalog è l'unica fonte dei metadati di database per tutto il core",
|
||||
"Il preprocessing lavora su uno snapshot immutabile del catalogo, non sul DWH"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dot": "amber",
|
||||
"title": "Collezioni separate",
|
||||
"items": [
|
||||
"reference (schema, relazioni, Evidence) può essere svuotata e ricostruita dal preprocessing",
|
||||
"memory si ricostruisce dalle card PostgreSQL e non viene toccata dal preprocessing"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dot": "rose",
|
||||
"title": "Prerequisito",
|
||||
"items": [
|
||||
"Senza preprocessing completato il core non ammette nuove sessioni"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,384 @@
|
||||
{
|
||||
"schema_version": 1,
|
||||
"diagram_type": "tree",
|
||||
"meta": {
|
||||
"title": "ThothII — struttura dei moduli",
|
||||
"locale": "it",
|
||||
"output": "docs/architecture/thothii-modules.html",
|
||||
"quality_profile": "showcase",
|
||||
"repository": {
|
||||
"url": "https://git.tylconsulting.it/mptyl/ThothII.git",
|
||||
"link_mode": "local-only",
|
||||
"revision": "31e6d3a162e9e5ac71fc2d8da4fe44b16c06aae3"
|
||||
}
|
||||
},
|
||||
"layout": {
|
||||
"direction": "right"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "root",
|
||||
"label": "ThothII",
|
||||
"sublabel": "monorepo, tre layer + operatore",
|
||||
"sources": [
|
||||
{
|
||||
"path": "AGENTS.md",
|
||||
"line": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "frontend",
|
||||
"label": "frontend/",
|
||||
"parent": "root",
|
||||
"sublabel": "React 18 + Vite",
|
||||
"sources": [
|
||||
{
|
||||
"path": "frontend/src/main.tsx",
|
||||
"line": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "fe_api",
|
||||
"label": "src/api",
|
||||
"parent": "frontend",
|
||||
"sublabel": "client HTTP verso /api",
|
||||
"sources": [
|
||||
{
|
||||
"path": "frontend/src/api/client.ts",
|
||||
"line": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "fe_shell",
|
||||
"label": "src/shell",
|
||||
"parent": "frontend",
|
||||
"sublabel": "AppShell e pagine admin",
|
||||
"sources": [
|
||||
{
|
||||
"path": "frontend/src/shell/AppShell.tsx",
|
||||
"line": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "fe_store",
|
||||
"label": "src/store + stream",
|
||||
"parent": "frontend",
|
||||
"sublabel": "transcript live da SSE",
|
||||
"sources": [
|
||||
{
|
||||
"path": "frontend/src/store/sessionStore.ts",
|
||||
"line": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "fe_widgets",
|
||||
"label": "src/widgets",
|
||||
"parent": "frontend",
|
||||
"sublabel": "widget dei gate reviewer",
|
||||
"sources": [
|
||||
{
|
||||
"path": "frontend/src/widgets/registry.ts",
|
||||
"line": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "fe_i18n",
|
||||
"label": "src/i18n",
|
||||
"parent": "frontend",
|
||||
"sublabel": "cataloghi EN/IT"
|
||||
},
|
||||
{
|
||||
"id": "backend",
|
||||
"label": "backend/",
|
||||
"parent": "root",
|
||||
"sublabel": "Fastify + TypeScript",
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/server.ts",
|
||||
"line": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "be_routes",
|
||||
"label": "src/routes",
|
||||
"parent": "backend",
|
||||
"sublabel": "API REST e SSE",
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/routes/sessions.ts",
|
||||
"line": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "be_bridge",
|
||||
"label": "src/pi + rpc + bridge",
|
||||
"parent": "backend",
|
||||
"sublabel": "processi Pi e bridge RPC",
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/pi/pi-process-manager.ts",
|
||||
"line": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "be_sse",
|
||||
"label": "src/sse",
|
||||
"parent": "backend",
|
||||
"sublabel": "SseHub con replay",
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/sse/sse-hub.ts",
|
||||
"line": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "be_tht",
|
||||
"label": "src/tht",
|
||||
"parent": "backend",
|
||||
"sublabel": "ThtRunner: shell del CLI",
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/tht/tht-runner.ts",
|
||||
"line": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "be_auth",
|
||||
"label": "src/auth",
|
||||
"parent": "backend",
|
||||
"sublabel": "local, OIDC, upstream",
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/auth/auth.ts",
|
||||
"line": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "be_catalog",
|
||||
"label": "src/catalog",
|
||||
"parent": "backend",
|
||||
"sublabel": "Metadata Catalog, sync, descrizioni",
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/catalog/service.ts",
|
||||
"line": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "be_ws",
|
||||
"label": "src/workspaces",
|
||||
"parent": "backend",
|
||||
"sublabel": "registry Git e preprocessing",
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/workspaces/preprocessing-service.ts",
|
||||
"line": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "harness",
|
||||
"label": "harness/",
|
||||
"parent": "root",
|
||||
"sublabel": "workflow NL→SQL",
|
||||
"sources": [
|
||||
{
|
||||
"path": "harness/README.md",
|
||||
"line": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "h_wf",
|
||||
"label": "workflow.yaml",
|
||||
"parent": "harness",
|
||||
"sublabel": "fasi F1–F8",
|
||||
"sources": [
|
||||
{
|
||||
"path": "harness/workflow.yaml",
|
||||
"line": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "h_pi",
|
||||
"label": ".pi/",
|
||||
"parent": "harness",
|
||||
"sublabel": "estensione gate, skill, prompt",
|
||||
"sources": [
|
||||
{
|
||||
"path": "harness/.pi/extensions/tht-gate.js",
|
||||
"line": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "h_cli",
|
||||
"label": "tht/cli",
|
||||
"parent": "harness",
|
||||
"sublabel": "sottocomandi del CLI tht",
|
||||
"sources": [
|
||||
{
|
||||
"path": "harness/tht/cli/__init__.py",
|
||||
"line": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "h_session",
|
||||
"label": "tht/session + phase",
|
||||
"parent": "harness",
|
||||
"sublabel": "manifest, ledger, fase",
|
||||
"sources": [
|
||||
{
|
||||
"path": "harness/tht/session/store.py",
|
||||
"line": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "h_adapters",
|
||||
"label": "tht/adapters",
|
||||
"parent": "harness",
|
||||
"sublabel": "DWH e Qdrant",
|
||||
"sources": [
|
||||
{
|
||||
"path": "harness/tht/adapters/factory.py",
|
||||
"line": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "h_search",
|
||||
"label": "tht/search + vectorstore",
|
||||
"parent": "harness",
|
||||
"sublabel": "retrieval ibrido",
|
||||
"sources": [
|
||||
{
|
||||
"path": "harness/tht/vectorstore/embeddings.py",
|
||||
"line": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "h_memory",
|
||||
"label": "tht/memory",
|
||||
"parent": "harness",
|
||||
"sublabel": "card e domande risolte",
|
||||
"sources": [
|
||||
{
|
||||
"path": "harness/tht/memory/repository.py",
|
||||
"line": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "h_evidence",
|
||||
"label": "tht/evidence",
|
||||
"parent": "harness",
|
||||
"sublabel": "corpus Evidence",
|
||||
"sources": [
|
||||
{
|
||||
"path": "harness/tht/evidence/preprocessing.py",
|
||||
"line": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "h_mschema",
|
||||
"label": "tht/mschema",
|
||||
"parent": "harness",
|
||||
"sublabel": "snapshot e schema per il modello",
|
||||
"sources": [
|
||||
{
|
||||
"path": "harness/tht/mschema/catalog_snapshot.py",
|
||||
"line": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "tools",
|
||||
"label": "tools/tht",
|
||||
"parent": "root",
|
||||
"sublabel": "CLI host in Go",
|
||||
"sources": [
|
||||
{
|
||||
"path": "tools/tht/README.md",
|
||||
"line": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "t_cmd",
|
||||
"label": "cmd/tht",
|
||||
"parent": "tools",
|
||||
"sublabel": "comandi operatore",
|
||||
"sources": [
|
||||
{
|
||||
"path": "tools/tht/cmd/tht/main.go",
|
||||
"line": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "t_internal",
|
||||
"label": "internal/",
|
||||
"parent": "tools",
|
||||
"sublabel": "compose, setup, doctor, auth",
|
||||
"sources": [
|
||||
{
|
||||
"path": "tools/tht/internal/compose/runner.go",
|
||||
"line": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "deploy",
|
||||
"label": "docker/ + deploy/",
|
||||
"parent": "root",
|
||||
"sublabel": "immagini e profili Compose",
|
||||
"sources": [
|
||||
{
|
||||
"path": "compose.yaml",
|
||||
"line": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "docs",
|
||||
"label": "docs/",
|
||||
"parent": "root",
|
||||
"sublabel": "MkDocs, ADR, contratti",
|
||||
"sources": [
|
||||
{
|
||||
"path": "mkdocs.yml",
|
||||
"line": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"cards": [
|
||||
{
|
||||
"dot": "cyan",
|
||||
"title": "Lettura",
|
||||
"items": [
|
||||
"Le linee indicano contenimento, non chiamate",
|
||||
"Alcuni nodi raggruppano più cartelle sorelle con lo stesso ruolo",
|
||||
"Test, script e cartelle generate sono omessi"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,381 @@
|
||||
{
|
||||
"schema_version": 1,
|
||||
"diagram_type": "sequence",
|
||||
"meta": {
|
||||
"title": "ThothII — avvio di una nuova domanda",
|
||||
"locale": "it",
|
||||
"output": "docs/architecture/thothii-new-question.html",
|
||||
"quality_profile": "showcase",
|
||||
"repository": {
|
||||
"url": "https://git.tylconsulting.it/mptyl/ThothII.git",
|
||||
"link_mode": "local-only",
|
||||
"revision": "31e6d3a162e9e5ac71fc2d8da4fe44b16c06aae3"
|
||||
}
|
||||
},
|
||||
"participants": [
|
||||
{
|
||||
"id": "reviewer",
|
||||
"type": "external",
|
||||
"label": "Reviewer",
|
||||
"sublabel": "browser"
|
||||
},
|
||||
{
|
||||
"id": "frontend",
|
||||
"type": "frontend",
|
||||
"label": "Frontend",
|
||||
"sublabel": "React",
|
||||
"sources": [
|
||||
{
|
||||
"path": "frontend/src/api/sessions.ts",
|
||||
"line": 96,
|
||||
"end_line": 115,
|
||||
"label": "createSession"
|
||||
},
|
||||
{
|
||||
"path": "frontend/src/stream/useSessionStream.ts",
|
||||
"line": 117,
|
||||
"end_line": 121,
|
||||
"label": "EventSource"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "backend",
|
||||
"type": "backend",
|
||||
"label": "Backend",
|
||||
"sublabel": "Fastify",
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/routes/sessions.ts",
|
||||
"line": 481,
|
||||
"end_line": 487,
|
||||
"label": "precheck DWH"
|
||||
},
|
||||
{
|
||||
"path": "backend/src/routes/sessions.ts",
|
||||
"line": 513,
|
||||
"end_line": 570,
|
||||
"label": "POST /sessions"
|
||||
},
|
||||
{
|
||||
"path": "backend/src/routes/sessions.ts",
|
||||
"line": 334,
|
||||
"end_line": 350,
|
||||
"label": "bootstrap"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "tht",
|
||||
"type": "backend",
|
||||
"label": "tht CLI",
|
||||
"sublabel": "harness",
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/tht/tht-runner.ts",
|
||||
"line": 484,
|
||||
"end_line": 500,
|
||||
"label": "session new"
|
||||
},
|
||||
{
|
||||
"path": "backend/src/tht/tht-runner.ts",
|
||||
"line": 514,
|
||||
"end_line": 518,
|
||||
"label": "search pack"
|
||||
},
|
||||
{
|
||||
"path": "harness/.pi/extensions/tht-gate.js",
|
||||
"line": 277,
|
||||
"end_line": 280,
|
||||
"label": "execFileSync"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "pi",
|
||||
"type": "backend",
|
||||
"label": "Pi",
|
||||
"sublabel": "--mode rpc",
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/pi/pi-process-manager.ts",
|
||||
"line": 143,
|
||||
"end_line": 146,
|
||||
"label": "spawn"
|
||||
},
|
||||
{
|
||||
"path": "backend/src/pi/pi-process-manager.ts",
|
||||
"line": 263,
|
||||
"end_line": 280,
|
||||
"label": "configure"
|
||||
},
|
||||
{
|
||||
"path": "backend/src/pi/pi-process-manager.ts",
|
||||
"line": 283,
|
||||
"end_line": 290,
|
||||
"label": "prompt iniziale"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "gate",
|
||||
"type": "backend",
|
||||
"label": "tht-gate.js",
|
||||
"sublabel": "estensione Pi",
|
||||
"sources": [
|
||||
{
|
||||
"path": "harness/.pi/extensions/tht-gate.js",
|
||||
"line": 780,
|
||||
"end_line": 795,
|
||||
"label": "hook input"
|
||||
},
|
||||
{
|
||||
"path": "harness/.pi/prompts/nuova-domanda.md",
|
||||
"line": 1,
|
||||
"end_line": 10,
|
||||
"label": "template prompt"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "llm",
|
||||
"type": "cloud",
|
||||
"label": "Provider LLM",
|
||||
"sublabel": "modello di sessione"
|
||||
}
|
||||
],
|
||||
"segments": [
|
||||
{
|
||||
"from": 160,
|
||||
"to": 470,
|
||||
"label": "Creazione sessione"
|
||||
},
|
||||
{
|
||||
"from": 476,
|
||||
"to": 595,
|
||||
"label": "Bootstrap"
|
||||
},
|
||||
{
|
||||
"from": 605,
|
||||
"to": 875,
|
||||
"label": "Primo turno (F1)"
|
||||
}
|
||||
],
|
||||
"messages": [
|
||||
{
|
||||
"id": "ask",
|
||||
"from": "reviewer",
|
||||
"to": "frontend",
|
||||
"y": 170,
|
||||
"label": "domanda"
|
||||
},
|
||||
{
|
||||
"id": "post",
|
||||
"from": "frontend",
|
||||
"to": "backend",
|
||||
"y": 200,
|
||||
"label": "POST /sessions",
|
||||
"variant": "emphasis"
|
||||
},
|
||||
{
|
||||
"id": "new",
|
||||
"from": "backend",
|
||||
"to": "tht",
|
||||
"y": 230,
|
||||
"label": "session new",
|
||||
"note": "scrive il manifest e fissa la lingua"
|
||||
},
|
||||
{
|
||||
"id": "new-ok",
|
||||
"from": "tht",
|
||||
"to": "backend",
|
||||
"y": 315,
|
||||
"label": "id sessione",
|
||||
"variant": "return"
|
||||
},
|
||||
{
|
||||
"id": "spawn",
|
||||
"from": "backend",
|
||||
"to": "pi",
|
||||
"y": 345,
|
||||
"label": "spawn processo",
|
||||
"note": "un processo Pi per sessione"
|
||||
},
|
||||
{
|
||||
"id": "id",
|
||||
"from": "backend",
|
||||
"to": "frontend",
|
||||
"y": 395,
|
||||
"label": "{ id }",
|
||||
"variant": "return"
|
||||
},
|
||||
{
|
||||
"id": "sse",
|
||||
"from": "frontend",
|
||||
"to": "backend",
|
||||
"y": 425,
|
||||
"label": "GET /events (SSE)",
|
||||
"note": "l'hub conserva gli eventi già emessi per la riconnessione"
|
||||
},
|
||||
{
|
||||
"id": "model",
|
||||
"from": "backend",
|
||||
"to": "pi",
|
||||
"y": 485,
|
||||
"label": "set_model + thinking"
|
||||
},
|
||||
{
|
||||
"id": "pack",
|
||||
"from": "backend",
|
||||
"to": "tht",
|
||||
"y": 515,
|
||||
"label": "search pack",
|
||||
"note": "in parallelo al modello"
|
||||
},
|
||||
{
|
||||
"id": "prompt",
|
||||
"from": "backend",
|
||||
"to": "pi",
|
||||
"y": 585,
|
||||
"label": "prompt /nuova-domanda",
|
||||
"variant": "emphasis"
|
||||
},
|
||||
{
|
||||
"id": "hook",
|
||||
"from": "pi",
|
||||
"to": "gate",
|
||||
"y": 615,
|
||||
"label": "hook input"
|
||||
},
|
||||
{
|
||||
"id": "turn",
|
||||
"from": "pi",
|
||||
"to": "llm",
|
||||
"y": 645,
|
||||
"label": "turno modello",
|
||||
"variant": "emphasis"
|
||||
},
|
||||
{
|
||||
"id": "tokens",
|
||||
"from": "llm",
|
||||
"to": "pi",
|
||||
"y": 675,
|
||||
"label": "token + tool call",
|
||||
"variant": "return"
|
||||
},
|
||||
{
|
||||
"id": "tool",
|
||||
"from": "pi",
|
||||
"to": "gate",
|
||||
"y": 705,
|
||||
"label": "tool call"
|
||||
},
|
||||
{
|
||||
"id": "cli",
|
||||
"from": "gate",
|
||||
"to": "tht",
|
||||
"y": 735,
|
||||
"label": "tht phase / session",
|
||||
"note": "scrive artefatti e ledger"
|
||||
},
|
||||
{
|
||||
"id": "event",
|
||||
"from": "pi",
|
||||
"to": "backend",
|
||||
"y": 805,
|
||||
"label": "eventi RPC",
|
||||
"variant": "dashed"
|
||||
},
|
||||
{
|
||||
"id": "push",
|
||||
"from": "backend",
|
||||
"to": "frontend",
|
||||
"y": 835,
|
||||
"label": "SSE text_delta",
|
||||
"variant": "dashed"
|
||||
},
|
||||
{
|
||||
"id": "render",
|
||||
"from": "frontend",
|
||||
"to": "reviewer",
|
||||
"y": 865,
|
||||
"label": "transcript live",
|
||||
"variant": "return"
|
||||
}
|
||||
],
|
||||
"activations": [
|
||||
{
|
||||
"participant": "frontend",
|
||||
"from": 195,
|
||||
"to": 871,
|
||||
"type": "frontend"
|
||||
},
|
||||
{
|
||||
"participant": "backend",
|
||||
"from": 200,
|
||||
"to": 841,
|
||||
"type": "backend"
|
||||
},
|
||||
{
|
||||
"participant": "tht",
|
||||
"from": 228,
|
||||
"to": 321,
|
||||
"type": "backend"
|
||||
},
|
||||
{
|
||||
"participant": "tht",
|
||||
"from": 513,
|
||||
"to": 545,
|
||||
"type": "backend"
|
||||
},
|
||||
{
|
||||
"participant": "tht",
|
||||
"from": 733,
|
||||
"to": 775,
|
||||
"type": "backend"
|
||||
},
|
||||
{
|
||||
"participant": "pi",
|
||||
"from": 343,
|
||||
"to": 811,
|
||||
"type": "backend"
|
||||
},
|
||||
{
|
||||
"participant": "gate",
|
||||
"from": 613,
|
||||
"to": 779,
|
||||
"type": "backend"
|
||||
},
|
||||
{
|
||||
"participant": "llm",
|
||||
"from": 643,
|
||||
"to": 681,
|
||||
"type": "cloud"
|
||||
}
|
||||
],
|
||||
"cards": [
|
||||
{
|
||||
"dot": "cyan",
|
||||
"title": "Ordine di avvio",
|
||||
"items": [
|
||||
"La sessione esiste su disco prima che Pi parta: il manifest è la fonte di verità",
|
||||
"Il primo prompt parte solo dopo configurazione del modello e search pack"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dot": "amber",
|
||||
"title": "Precheck DWH",
|
||||
"items": [
|
||||
"In installazione locale il backend verifica il DWH prima di creare la sessione e risponde 503 se non è raggiungibile"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dot": "emerald",
|
||||
"title": "Stream",
|
||||
"items": [
|
||||
"Il bridge traduce gli eventi Pi in text_delta, info e ui_request",
|
||||
"Il transcript vive solo nel browser; non viene salvato"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,104 @@
|
||||
{
|
||||
"schema_version": 2,
|
||||
"diagram_type": "workflow",
|
||||
"meta": {
|
||||
"title": "ThothII — workflow NL→SQL in 8 fasi",
|
||||
"locale": "it",
|
||||
"output": "docs/architecture/thothii-phases.html",
|
||||
"quality_profile": "showcase",
|
||||
"repository": {
|
||||
"url": "https://git.tylconsulting.it/mptyl/ThothII.git",
|
||||
"link_mode": "local-only",
|
||||
"revision": "31e6d3a162e9e5ac71fc2d8da4fe44b16c06aae3"
|
||||
}
|
||||
},
|
||||
"lanes": [
|
||||
{ "id": "domanda", "label": "Domanda" },
|
||||
{ "id": "schema", "label": "Schema e sintesi" },
|
||||
{ "id": "sql", "label": "SQL" },
|
||||
{ "id": "chiusura", "label": "Chiusura" },
|
||||
{ "id": "eccezioni", "label": "Ritorno indietro", "variant": "exception" }
|
||||
],
|
||||
"mainPath": ["f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "finalizzata"],
|
||||
"nodes": [
|
||||
{ "id": "f1", "lane": "domanda", "col": 0, "type": "frontend", "label": "F1 chiarimento", "sublabel": "concetti e ambiguità", "tag": "gate fase",
|
||||
"sources": [
|
||||
{ "path": "harness/workflow.yaml", "line": 13, "end_line": 18 },
|
||||
{ "path": "harness/.pi/skills/tht-sessione/SKILL.md", "line": 57, "end_line": 57 }
|
||||
] },
|
||||
{ "id": "f2", "lane": "domanda", "col": 1, "type": "database", "label": "F2 memoria", "sublabel": "memorie e esempi risolti", "tag": "auto se vuota",
|
||||
"sources": [
|
||||
{ "path": "harness/workflow.yaml", "line": 19, "end_line": 24 },
|
||||
{ "path": "harness/.pi/skills/tht-sessione/SKILL.md", "line": 58, "end_line": 58 }
|
||||
] },
|
||||
{ "id": "f3", "lane": "domanda", "col": 2, "type": "frontend", "label": "F3 riscrittura", "sublabel": "question.md", "tag": "si chiude da sola",
|
||||
"sources": [
|
||||
{ "path": "harness/workflow.yaml", "line": 25, "end_line": 31 },
|
||||
{ "path": "harness/.pi/skills/tht-sessione/SKILL.md", "line": 59, "end_line": 59 }
|
||||
] },
|
||||
{ "id": "f4", "lane": "schema", "col": 2, "type": "frontend", "label": "F4 schema linking", "sublabel": "schema_linking.json", "tag": "reviewer_decide",
|
||||
"sources": [
|
||||
{ "path": "harness/workflow.yaml", "line": 32, "end_line": 39 },
|
||||
{ "path": "harness/.pi/skills/tht-sessione/SKILL.md", "line": 60, "end_line": 60 }
|
||||
] },
|
||||
{ "id": "f5", "lane": "schema", "col": 3, "type": "frontend", "label": "F5 sintesi", "sublabel": "valida SchemaLinking", "tag": "gate fase",
|
||||
"sources": [
|
||||
{ "path": "harness/workflow.yaml", "line": 40, "end_line": 46 },
|
||||
{ "path": "harness/.pi/skills/tht-sessione/SKILL.md", "line": 61, "end_line": 61 }
|
||||
] },
|
||||
{ "id": "f6", "lane": "sql", "col": 3, "type": "backend", "label": "F6 CTE", "sublabel": "piano, CTE e test", "tag": "ultima CTE chiude",
|
||||
"sources": [
|
||||
{ "path": "harness/workflow.yaml", "line": 47, "end_line": 55 },
|
||||
{ "path": "harness/.pi/skills/tht-sessione/SKILL.md", "line": 62, "end_line": 62 }
|
||||
] },
|
||||
{ "id": "f7", "lane": "sql", "col": 4, "type": "backend", "label": "F7 SQL finale", "sublabel": "sql_final.sql", "tag": "kind sql chiude",
|
||||
"sources": [
|
||||
{ "path": "harness/workflow.yaml", "line": 56, "end_line": 62 },
|
||||
{ "path": "harness/.pi/skills/tht-sessione/SKILL.md", "line": 63, "end_line": 63 }
|
||||
] },
|
||||
{ "id": "f8", "lane": "chiusura", "col": 4, "type": "database", "label": "F8 datamart", "sublabel": "promozione memorie", "tag": "si chiude da sola",
|
||||
"sources": [
|
||||
{ "path": "harness/workflow.yaml", "line": 63, "end_line": 72 },
|
||||
{ "path": "harness/.pi/skills/tht-sessione/SKILL.md", "line": 64, "end_line": 64 }
|
||||
] },
|
||||
{ "id": "finalizzata", "lane": "chiusura", "col": 5, "type": "external", "label": "Sessione finalizzata", "sublabel": "tht session finalize",
|
||||
"sources": [
|
||||
{ "path": "harness/.pi/extensions/tht-gate.js", "line": 1650, "end_line": 1666, "label": "advancePhaseAndFinalize" }
|
||||
] },
|
||||
{ "id": "riapertura", "lane": "eccezioni", "col": 1, "type": "security", "label": "Riapertura fase", "sublabel": "/torna → phase reopen", "tag": "phase_reopened",
|
||||
"sources": [
|
||||
{ "path": "harness/.pi/extensions/tht-gate.js", "line": 1775, "end_line": 1814, "label": "comando /torna" },
|
||||
{ "path": "harness/tht/phase.py", "line": 60, "end_line": 79, "label": "fold con reopen" }
|
||||
] }
|
||||
],
|
||||
"edges": [
|
||||
{ "id": "f1-f2", "from": "f1", "to": "f2", "variant": "emphasis" },
|
||||
{ "id": "f2-f3", "from": "f2", "to": "f3", "variant": "emphasis" },
|
||||
{ "id": "f3-f4", "from": "f3", "to": "f4", "variant": "emphasis" },
|
||||
{ "id": "f4-f5", "from": "f4", "to": "f5", "variant": "emphasis" },
|
||||
{ "id": "f5-f6", "from": "f5", "to": "f6", "variant": "emphasis" },
|
||||
{ "id": "f6-f7", "from": "f6", "to": "f7", "variant": "emphasis" },
|
||||
{ "id": "f7-f8", "from": "f7", "to": "f8", "variant": "emphasis" },
|
||||
{ "id": "f8-fin", "from": "f8", "to": "finalizzata", "label": "finalize", "variant": "emphasis" },
|
||||
{ "id": "torna", "from": "f7", "to": "riapertura", "label": "/torna", "variant": "dashed", "role": "error" },
|
||||
{ "id": "riapre", "from": "riapertura", "to": "f1", "label": "fase N < corrente", "variant": "dashed", "role": "return" }
|
||||
],
|
||||
"cards": [
|
||||
{ "dot": "cyan", "title": "Chi decide", "items": [
|
||||
"Il modello propone, il reviewer decide tramite widget, tht persiste",
|
||||
"Gate fase (F1, F2 con memorie, F5): il reviewer conferma che la fase è completa",
|
||||
"F3, F4, ultima CTE di F6, F7 e F8: l'approvazione sostanziale chiude la fase da sola"
|
||||
] },
|
||||
{ "dot": "emerald", "title": "Fase corrente", "items": [
|
||||
"Non è salvata: si calcola ripercorrendo il ledger review_decisions.jsonl",
|
||||
"phase_approved avanza solo la fase corrente; phase_reopened riporta indietro"
|
||||
] },
|
||||
{ "dot": "amber", "title": "Salti automatici", "items": [
|
||||
"F2 avanza da sola se non ci sono memorie pertinenti",
|
||||
"F6 può essere saltata (phase_skipped) o essere vuota"
|
||||
] },
|
||||
{ "dot": "rose", "title": "Ritorno indietro", "items": [
|
||||
"/torna è disponibile da qualunque fase verso una fase precedente; qui è mostrato da F7 come esempio"
|
||||
] }
|
||||
]
|
||||
}
|
||||
+3785
-3849
File diff suppressed because one or more lines are too long
@@ -0,0 +1,256 @@
|
||||
{
|
||||
"schema_version": 1,
|
||||
"diagram_type": "sequence",
|
||||
"meta": {
|
||||
"title": "ThothII — ripresa di una sessione",
|
||||
"locale": "it",
|
||||
"output": "docs/architecture/thothii-resume.html",
|
||||
"quality_profile": "showcase",
|
||||
"repository": {
|
||||
"url": "https://git.tylconsulting.it/mptyl/ThothII.git",
|
||||
"link_mode": "local-only",
|
||||
"revision": "31e6d3a162e9e5ac71fc2d8da4fe44b16c06aae3"
|
||||
}
|
||||
},
|
||||
"participants": [
|
||||
{
|
||||
"id": "reviewer",
|
||||
"type": "external",
|
||||
"label": "Reviewer",
|
||||
"sublabel": "browser"
|
||||
},
|
||||
{
|
||||
"id": "frontend",
|
||||
"type": "frontend",
|
||||
"label": "Frontend",
|
||||
"sublabel": "React"
|
||||
},
|
||||
{
|
||||
"id": "backend",
|
||||
"type": "backend",
|
||||
"label": "Backend",
|
||||
"sublabel": "Fastify",
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/routes/sessions.ts",
|
||||
"line": 685,
|
||||
"end_line": 698,
|
||||
"label": "409 se in sola lettura"
|
||||
},
|
||||
{
|
||||
"path": "backend/src/routes/sessions.ts",
|
||||
"line": 774,
|
||||
"end_line": 809,
|
||||
"label": "reopen + nuovo runtime"
|
||||
},
|
||||
{
|
||||
"path": "backend/src/routes/sessions.ts",
|
||||
"line": 820,
|
||||
"end_line": 829,
|
||||
"label": "bootstrap senza search pack"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "tht",
|
||||
"type": "backend",
|
||||
"label": "tht CLI",
|
||||
"sublabel": "sessione su disco",
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/tht/tht-runner.ts",
|
||||
"line": 569,
|
||||
"end_line": 569,
|
||||
"label": "session reopen"
|
||||
},
|
||||
{
|
||||
"path": "backend/src/routes/sessions.ts",
|
||||
"line": 206,
|
||||
"end_line": 216,
|
||||
"label": "locateSession"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "pi",
|
||||
"type": "backend",
|
||||
"label": "Pi",
|
||||
"sublabel": "nuovo processo",
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/pi/pi-process-manager.ts",
|
||||
"line": 283,
|
||||
"end_line": 290,
|
||||
"label": "/riprendi-sessione"
|
||||
},
|
||||
{
|
||||
"path": "harness/.pi/skills/tht-sessione/SKILL.md",
|
||||
"line": 164,
|
||||
"end_line": 185,
|
||||
"label": "Phase 0 Resume"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "llm",
|
||||
"type": "cloud",
|
||||
"label": "Provider LLM",
|
||||
"sublabel": "modello salvato"
|
||||
}
|
||||
],
|
||||
"segments": [
|
||||
{
|
||||
"from": 160,
|
||||
"to": 438,
|
||||
"label": "Richiesta"
|
||||
},
|
||||
{
|
||||
"from": 448,
|
||||
"to": 540,
|
||||
"label": "Bootstrap"
|
||||
},
|
||||
{
|
||||
"from": 550,
|
||||
"to": 858,
|
||||
"label": "Ricostruzione"
|
||||
}
|
||||
],
|
||||
"messages": [
|
||||
{
|
||||
"from": "reviewer",
|
||||
"to": "frontend",
|
||||
"y": 170,
|
||||
"label": "riprendi sessione"
|
||||
},
|
||||
{
|
||||
"from": "frontend",
|
||||
"to": "backend",
|
||||
"y": 200,
|
||||
"label": "POST /sessions/:id/resume",
|
||||
"variant": "emphasis"
|
||||
},
|
||||
{
|
||||
"from": "backend",
|
||||
"to": "tht",
|
||||
"y": 230,
|
||||
"label": "session show",
|
||||
"note": "409 se finalizzata o archiviata"
|
||||
},
|
||||
{
|
||||
"from": "tht",
|
||||
"to": "backend",
|
||||
"y": 296,
|
||||
"label": "manifest",
|
||||
"variant": "return"
|
||||
},
|
||||
{
|
||||
"from": "backend",
|
||||
"to": "tht",
|
||||
"y": 326,
|
||||
"label": "session reopen"
|
||||
},
|
||||
{
|
||||
"from": "backend",
|
||||
"to": "pi",
|
||||
"y": 356,
|
||||
"label": "spawn",
|
||||
"note": "sostituisce il runtime fermo"
|
||||
},
|
||||
{
|
||||
"from": "backend",
|
||||
"to": "frontend",
|
||||
"y": 422,
|
||||
"label": "200 { id }",
|
||||
"variant": "return"
|
||||
},
|
||||
{
|
||||
"from": "backend",
|
||||
"to": "pi",
|
||||
"y": 458,
|
||||
"label": "set_model + thinking",
|
||||
"note": "niente search pack: il contesto è su disco"
|
||||
},
|
||||
{
|
||||
"from": "backend",
|
||||
"to": "pi",
|
||||
"y": 524,
|
||||
"label": "prompt /riprendi-sessione",
|
||||
"variant": "emphasis"
|
||||
},
|
||||
{
|
||||
"from": "pi",
|
||||
"to": "llm",
|
||||
"y": 560,
|
||||
"label": "turno modello",
|
||||
"variant": "emphasis"
|
||||
},
|
||||
{
|
||||
"from": "llm",
|
||||
"to": "pi",
|
||||
"y": 590,
|
||||
"label": "tool call",
|
||||
"variant": "return"
|
||||
},
|
||||
{
|
||||
"from": "pi",
|
||||
"to": "tht",
|
||||
"y": 620,
|
||||
"label": "tht session show",
|
||||
"note": "fase corrente, stato e lingua"
|
||||
},
|
||||
{
|
||||
"from": "pi",
|
||||
"to": "tht",
|
||||
"y": 686,
|
||||
"label": "tht session documents",
|
||||
"note": "artefatti già prodotti"
|
||||
},
|
||||
{
|
||||
"from": "tht",
|
||||
"to": "pi",
|
||||
"y": 752,
|
||||
"label": "artefatti + ledger",
|
||||
"variant": "return"
|
||||
},
|
||||
{
|
||||
"from": "pi",
|
||||
"to": "backend",
|
||||
"y": 782,
|
||||
"label": "gate della fase N",
|
||||
"variant": "dashed"
|
||||
},
|
||||
{
|
||||
"from": "backend",
|
||||
"to": "frontend",
|
||||
"y": 812,
|
||||
"label": "SSE ui_request",
|
||||
"variant": "dashed"
|
||||
},
|
||||
{
|
||||
"from": "frontend",
|
||||
"to": "reviewer",
|
||||
"y": 842,
|
||||
"label": "riprende dalla fase N",
|
||||
"variant": "return"
|
||||
}
|
||||
],
|
||||
"cards": [
|
||||
{
|
||||
"dot": "cyan",
|
||||
"title": "Stato su disco",
|
||||
"items": [
|
||||
"Pi riparte senza conversazione: manifest, artefatti e ledger sono l'unico contesto",
|
||||
"La fase corrente si ricalcola dal ledger"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dot": "amber",
|
||||
"title": "Casi particolari",
|
||||
"items": [
|
||||
"Se il runtime è ancora attivo la risposta è alreadyActive e non si riavvia nulla",
|
||||
"La lingua di interazione resta quella salvata; non si può cambiare alla ripresa",
|
||||
"Il prompt sbagliato (/nuova-domanda) trasformerebbe la ripresa in una nuova domanda"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -2,265 +2,550 @@
|
||||
"schema_version": 1,
|
||||
"diagram_type": "architecture",
|
||||
"meta": {
|
||||
"title": "ThothII Runtime Architecture",
|
||||
"locale": "en",
|
||||
"output": "thothii-runtime.html",
|
||||
"title": "ThothII — architettura runtime NL→SQL",
|
||||
"locale": "it",
|
||||
"output": "docs/architecture/thothii-runtime.html",
|
||||
"quality_profile": "showcase",
|
||||
"viewBox": [1360, 800]
|
||||
"repository": {
|
||||
"url": "https://git.tylconsulting.it/mptyl/ThothII.git",
|
||||
"link_mode": "local-only",
|
||||
"revision": "c77957af93ec77897e0c1f360091b156f3e2424b"
|
||||
}
|
||||
},
|
||||
"components": [
|
||||
{
|
||||
"id": "reviewer",
|
||||
"type": "external",
|
||||
"label": "User / Reviewer",
|
||||
"sublabel": "Browser",
|
||||
"pos": [20, 300],
|
||||
"size": [145, 72]
|
||||
"label": "Reviewer",
|
||||
"sublabel": "browser",
|
||||
"pos": [
|
||||
40,
|
||||
200
|
||||
],
|
||||
"size": [
|
||||
120,
|
||||
64
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "frontend",
|
||||
"type": "frontend",
|
||||
"label": "Frontend",
|
||||
"sublabel": "React 18 + Vite",
|
||||
"tag": "in-memory transcript",
|
||||
"pos": [205, 295],
|
||||
"size": [165, 82]
|
||||
"sublabel": "React 18 + nginx",
|
||||
"tag": "widget gate",
|
||||
"pos": [
|
||||
260,
|
||||
200
|
||||
],
|
||||
"size": [
|
||||
150,
|
||||
64
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "docker/nginx.conf.template",
|
||||
"line": 13,
|
||||
"end_line": 20,
|
||||
"label": "proxy /api → core"
|
||||
},
|
||||
{
|
||||
"path": "frontend/src/stream/useSessionStream.ts",
|
||||
"line": 121,
|
||||
"end_line": 121,
|
||||
"label": "EventSource SSE"
|
||||
},
|
||||
{
|
||||
"path": "frontend/src/widgets/registry.ts",
|
||||
"line": 5,
|
||||
"end_line": 13,
|
||||
"label": "registry widget"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "backend",
|
||||
"type": "backend",
|
||||
"label": "Backend",
|
||||
"sublabel": "Fastify + TypeScript",
|
||||
"tag": "session bridge",
|
||||
"pos": [410, 295],
|
||||
"size": [175, 82]
|
||||
"sublabel": "Fastify :8787",
|
||||
"tag": "SessionBridge + SseHub",
|
||||
"pos": [
|
||||
510,
|
||||
200
|
||||
],
|
||||
"size": [
|
||||
170,
|
||||
64
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/routes/sessions.ts",
|
||||
"line": 634,
|
||||
"end_line": 663,
|
||||
"label": "POST risposta gate"
|
||||
},
|
||||
{
|
||||
"path": "backend/src/bridge/session-bridge.ts",
|
||||
"line": 63,
|
||||
"end_line": 71,
|
||||
"label": "RPC → ui_request"
|
||||
},
|
||||
{
|
||||
"path": "backend/src/sse/sse-hub.ts",
|
||||
"line": 107,
|
||||
"end_line": 113,
|
||||
"label": "publish SSE"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "pi",
|
||||
"type": "backend",
|
||||
"label": "Pi",
|
||||
"sublabel": "RPC process per session",
|
||||
"tag": "inside core",
|
||||
"pos": [625, 295],
|
||||
"size": [170, 82]
|
||||
"sublabel": "--mode rpc, 1 per sessione",
|
||||
"pos": [
|
||||
790,
|
||||
200
|
||||
],
|
||||
"size": [
|
||||
170,
|
||||
64
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/pi/pi-process-manager.ts",
|
||||
"line": 143,
|
||||
"end_line": 146,
|
||||
"label": "spawn pi --mode rpc"
|
||||
},
|
||||
{
|
||||
"path": "backend/src/pi/pi-process-manager.ts",
|
||||
"line": 283,
|
||||
"end_line": 290,
|
||||
"label": "nuova-domanda / riprendi"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "harness",
|
||||
"id": "gate",
|
||||
"type": "backend",
|
||||
"label": "tht / Harness",
|
||||
"sublabel": "8-phase NL→SQL workflow",
|
||||
"tag": "workflow owner",
|
||||
"pos": [835, 295],
|
||||
"size": [190, 82]
|
||||
"label": "tht-gate.js",
|
||||
"sublabel": "estensione Pi, fasi F1–F8",
|
||||
"tag": "reviewer tools",
|
||||
"pos": [
|
||||
1060,
|
||||
200
|
||||
],
|
||||
"size": [
|
||||
170,
|
||||
64
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "harness/.pi/extensions/tht-gate.js",
|
||||
"line": 597,
|
||||
"end_line": 603,
|
||||
"label": "ctx.ui.input"
|
||||
},
|
||||
{
|
||||
"path": "harness/.pi/extensions/tht-gate.js",
|
||||
"line": 889,
|
||||
"end_line": 895,
|
||||
"label": "reviewer_select"
|
||||
},
|
||||
{
|
||||
"path": "harness/.pi/skills/tht-sessione/SKILL.md",
|
||||
"line": 40,
|
||||
"end_line": 66,
|
||||
"label": "regole di fase"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "workspace",
|
||||
"type": "database",
|
||||
"label": "Workspace Repository",
|
||||
"sublabel": "sessions + phase artifacts",
|
||||
"tag": "source of truth",
|
||||
"pos": [1065, 295],
|
||||
"size": [205, 82]
|
||||
"id": "tht",
|
||||
"type": "backend",
|
||||
"label": "tht CLI",
|
||||
"sublabel": "harness Python",
|
||||
"tag": "fase = fold ledger",
|
||||
"pos": [
|
||||
1335,
|
||||
200
|
||||
],
|
||||
"size": [
|
||||
160,
|
||||
64
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "harness/.pi/extensions/tht-gate.js",
|
||||
"line": 277,
|
||||
"end_line": 280,
|
||||
"label": "execFileSync tht"
|
||||
},
|
||||
{
|
||||
"path": "harness/tht/phase.py",
|
||||
"line": 60,
|
||||
"end_line": 79,
|
||||
"label": "current_phase"
|
||||
},
|
||||
{
|
||||
"path": "harness/workflow.yaml",
|
||||
"line": 12,
|
||||
"end_line": 72,
|
||||
"label": "workflow F1–F8"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "auth",
|
||||
"id": "llm",
|
||||
"type": "cloud",
|
||||
"label": "Provider LLM",
|
||||
"sublabel": "catalogo modelli installazione",
|
||||
"pos": [
|
||||
790,
|
||||
400
|
||||
],
|
||||
"size": [
|
||||
170,
|
||||
64
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/pi/managed-config.ts",
|
||||
"line": 120,
|
||||
"end_line": 128,
|
||||
"label": "models.json di Pi"
|
||||
},
|
||||
{
|
||||
"path": "backend/src/catalog/model-completer.ts",
|
||||
"line": 67,
|
||||
"end_line": 74,
|
||||
"label": "helper LiteLLM"
|
||||
},
|
||||
{
|
||||
"path": "harness/tht/internal/litellm_completion.py",
|
||||
"line": 186,
|
||||
"end_line": 195
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "idp",
|
||||
"type": "security",
|
||||
"label": "Authentication",
|
||||
"sublabel": "local registry or OIDC",
|
||||
"pos": [410, 70],
|
||||
"size": [170, 76]
|
||||
"label": "Identity provider",
|
||||
"sublabel": "OIDC / upstream",
|
||||
"pos": [
|
||||
260,
|
||||
30
|
||||
],
|
||||
"size": [
|
||||
150,
|
||||
64
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/auth/oidc-client.ts",
|
||||
"line": 24,
|
||||
"end_line": 27,
|
||||
"label": "OidcProtocol"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "modelProvider",
|
||||
"type": "external",
|
||||
"label": "AI Model Provider",
|
||||
"sublabel": "installation-selected APIs",
|
||||
"pos": [615, 70],
|
||||
"size": [190, 76]
|
||||
"id": "embedding",
|
||||
"type": "backend",
|
||||
"label": "Embedding",
|
||||
"sublabel": "Ollama :11434",
|
||||
"pos": [
|
||||
1335,
|
||||
30
|
||||
],
|
||||
"size": [
|
||||
160,
|
||||
64
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "compose.yaml",
|
||||
"line": 230,
|
||||
"end_line": 249
|
||||
},
|
||||
{
|
||||
"path": "harness/tht/vectorstore/embeddings.py",
|
||||
"line": 65,
|
||||
"end_line": 75,
|
||||
"label": "embed()"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "qdrant",
|
||||
"type": "database",
|
||||
"label": "Qdrant",
|
||||
"sublabel": "vector store :6333",
|
||||
"pos": [
|
||||
1580,
|
||||
200
|
||||
],
|
||||
"size": [
|
||||
150,
|
||||
64
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "compose.yaml",
|
||||
"line": 210,
|
||||
"end_line": 228
|
||||
},
|
||||
{
|
||||
"path": "harness/tht/adapters/vector/qdrant.py",
|
||||
"line": 141,
|
||||
"end_line": 141,
|
||||
"label": "search"
|
||||
},
|
||||
{
|
||||
"path": "harness/tht/adapters/vector/qdrant.py",
|
||||
"line": 327,
|
||||
"end_line": 327,
|
||||
"label": "upsert"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "sessions",
|
||||
"type": "database",
|
||||
"label": "Sessioni",
|
||||
"sublabel": "manifest + artefatti + ledger",
|
||||
"tag": "fonte di verità",
|
||||
"pos": [
|
||||
1335,
|
||||
400
|
||||
],
|
||||
"size": [
|
||||
160,
|
||||
64
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "harness/tht/session/repository.py",
|
||||
"line": 74,
|
||||
"end_line": 92,
|
||||
"label": "filesystem o Postgres"
|
||||
},
|
||||
{
|
||||
"path": "harness/tht/session/filesystem_repository.py",
|
||||
"line": 134,
|
||||
"end_line": 142,
|
||||
"label": "append decisioni"
|
||||
},
|
||||
{
|
||||
"path": "harness/tht/decisions.py",
|
||||
"line": 10,
|
||||
"end_line": 10,
|
||||
"label": "review_decisions.jsonl"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "dwh",
|
||||
"type": "database",
|
||||
"label": "DWH",
|
||||
"sublabel": "Postgres o REST",
|
||||
"tag": "sola lettura",
|
||||
"pos": [
|
||||
1580,
|
||||
400
|
||||
],
|
||||
"size": [
|
||||
170,
|
||||
64
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "harness/tht/adapters/dwh/postgres.py",
|
||||
"line": 29,
|
||||
"end_line": 33,
|
||||
"label": "verifica read-only"
|
||||
},
|
||||
{
|
||||
"path": "harness/tht/adapters/dwh/thoth_rest.py",
|
||||
"line": 22,
|
||||
"end_line": 29,
|
||||
"label": "REST read_only"
|
||||
},
|
||||
{
|
||||
"path": "backend/src/catalog/description-source-sampler.ts",
|
||||
"line": 153,
|
||||
"end_line": 160,
|
||||
"label": "campionamento"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "catalog",
|
||||
"type": "database",
|
||||
"label": "Metadata Catalog",
|
||||
"sublabel": "PostgreSQL + Kysely",
|
||||
"tag": "backend-owned",
|
||||
"pos": [410, 545],
|
||||
"size": [180, 82]
|
||||
},
|
||||
{
|
||||
"id": "embedding",
|
||||
"type": "backend",
|
||||
"label": "Embedding Service",
|
||||
"sublabel": "Ollama",
|
||||
"pos": [800, 545],
|
||||
"size": [170, 76]
|
||||
},
|
||||
{
|
||||
"id": "qdrant",
|
||||
"type": "database",
|
||||
"label": "Vector Store",
|
||||
"sublabel": "Qdrant",
|
||||
"pos": [1010, 545],
|
||||
"size": [160, 76]
|
||||
},
|
||||
{
|
||||
"id": "dwh",
|
||||
"type": "external",
|
||||
"label": "Data Warehouse",
|
||||
"sublabel": "external, read-only",
|
||||
"pos": [1070, 70],
|
||||
"size": [180, 82]
|
||||
"sublabel": "PostgreSQL 17",
|
||||
"pos": [
|
||||
510,
|
||||
400
|
||||
],
|
||||
"size": [
|
||||
170,
|
||||
64
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "compose.yaml",
|
||||
"line": 74,
|
||||
"end_line": 98
|
||||
},
|
||||
{
|
||||
"path": "backend/src/catalog/repository.ts",
|
||||
"line": 2054,
|
||||
"end_line": 2068,
|
||||
"label": "pool + repository"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"boundaries": [
|
||||
{
|
||||
"kind": "region",
|
||||
"label": "Local Docker Compose runtime",
|
||||
"wraps": ["frontend", "backend", "pi", "harness", "catalog", "embedding", "qdrant"],
|
||||
"pad": 26
|
||||
},
|
||||
{
|
||||
"kind": "security-group",
|
||||
"label": "core container",
|
||||
"wraps": ["pi", "harness"],
|
||||
"pad": 18
|
||||
},
|
||||
{
|
||||
"kind": "security-group",
|
||||
"label": "operator-controlled persisted state",
|
||||
"wraps": ["workspace"],
|
||||
"pad": 18
|
||||
"label": "container core",
|
||||
"wraps": [
|
||||
"backend",
|
||||
"pi",
|
||||
"gate",
|
||||
"tht"
|
||||
]
|
||||
}
|
||||
],
|
||||
"connections": [
|
||||
{
|
||||
"id": "reviewerInput",
|
||||
"id": "rev-fe",
|
||||
"from": "reviewer",
|
||||
"to": "frontend",
|
||||
"label": "question / gate decision",
|
||||
"variant": "emphasis",
|
||||
"labelAt": [185, 391]
|
||||
},
|
||||
{
|
||||
"id": "restRequests",
|
||||
"from": "frontend",
|
||||
"to": "backend",
|
||||
"label": "REST",
|
||||
"label": "HTTPS",
|
||||
"variant": "emphasis"
|
||||
},
|
||||
{
|
||||
"id": "sseEvents",
|
||||
"from": "backend",
|
||||
"to": "frontend",
|
||||
"label": "SSE: text · info · widget",
|
||||
"variant": "dashed",
|
||||
"labelAt": [390, 415]
|
||||
"id": "fe-be",
|
||||
"from": "frontend",
|
||||
"to": "backend",
|
||||
"label": "/api + SSE",
|
||||
"variant": "emphasis"
|
||||
},
|
||||
{
|
||||
"id": "piRpc",
|
||||
"id": "be-pi",
|
||||
"from": "backend",
|
||||
"to": "pi",
|
||||
"label": "JSON-RPC stdio",
|
||||
"variant": "emphasis",
|
||||
"labelAt": [605, 391]
|
||||
"label": "RPC stdio",
|
||||
"variant": "emphasis"
|
||||
},
|
||||
{
|
||||
"id": "gateCommands",
|
||||
"id": "pi-gate",
|
||||
"from": "pi",
|
||||
"to": "harness",
|
||||
"label": "phase / gate commands",
|
||||
"variant": "emphasis",
|
||||
"labelAt": [815, 391]
|
||||
"to": "gate",
|
||||
"label": "tool call",
|
||||
"variant": "emphasis"
|
||||
},
|
||||
{
|
||||
"id": "persistArtifacts",
|
||||
"from": "harness",
|
||||
"to": "workspace",
|
||||
"label": "artifacts + decision ledger",
|
||||
"variant": "emphasis",
|
||||
"labelAt": [1045, 391]
|
||||
"id": "gate-tht",
|
||||
"from": "gate",
|
||||
"to": "tht",
|
||||
"label": "execFileSync",
|
||||
"variant": "emphasis"
|
||||
},
|
||||
{
|
||||
"id": "authenticate",
|
||||
"from": "auth",
|
||||
"to": "backend",
|
||||
"label": "local session / OIDC callback",
|
||||
"variant": "security",
|
||||
"fromSide": "bottom",
|
||||
"toSide": "top"
|
||||
"id": "tht-sessions",
|
||||
"from": "tht",
|
||||
"to": "sessions",
|
||||
"label": "scrive"
|
||||
},
|
||||
{
|
||||
"id": "sessionModel",
|
||||
"id": "tht-dwh",
|
||||
"from": "tht",
|
||||
"to": "dwh",
|
||||
"label": "SQL read-only"
|
||||
},
|
||||
{
|
||||
"id": "tht-qdrant",
|
||||
"from": "tht",
|
||||
"to": "qdrant",
|
||||
"label": "ricerca"
|
||||
},
|
||||
{
|
||||
"id": "tht-embedding",
|
||||
"from": "tht",
|
||||
"to": "embedding",
|
||||
"label": "embed"
|
||||
},
|
||||
{
|
||||
"id": "pi-llm",
|
||||
"from": "pi",
|
||||
"to": "modelProvider",
|
||||
"label": "session model API",
|
||||
"fromSide": "top",
|
||||
"toSide": "bottom",
|
||||
"labelAt": [755, 185]
|
||||
"to": "llm",
|
||||
"label": "prompt"
|
||||
},
|
||||
{
|
||||
"id": "catalogState",
|
||||
"id": "be-llm",
|
||||
"from": "backend",
|
||||
"to": "catalog",
|
||||
"label": "catalog CRUD + runs",
|
||||
"fromSide": "bottom",
|
||||
"toSide": "top"
|
||||
},
|
||||
{
|
||||
"id": "metadataModel",
|
||||
"from": "backend",
|
||||
"to": "modelProvider",
|
||||
"label": "short-lived LiteLLM calls",
|
||||
"to": "llm",
|
||||
"label": "descrizioni",
|
||||
"variant": "dashed"
|
||||
},
|
||||
{
|
||||
"id": "readOnlySql",
|
||||
"from": "harness",
|
||||
"to": "dwh",
|
||||
"label": "introspection + read-only SQL"
|
||||
"id": "be-idp",
|
||||
"from": "backend",
|
||||
"to": "idp",
|
||||
"label": "OIDC",
|
||||
"variant": "security"
|
||||
},
|
||||
{
|
||||
"id": "embedRequests",
|
||||
"from": "harness",
|
||||
"to": "embedding",
|
||||
"label": "embedding requests",
|
||||
"fromSide": "bottom",
|
||||
"toSide": "top",
|
||||
"labelAt": [830, 490]
|
||||
"id": "be-catalog",
|
||||
"from": "backend",
|
||||
"to": "catalog",
|
||||
"label": "SQL"
|
||||
},
|
||||
{
|
||||
"id": "vectorAccess",
|
||||
"from": "harness",
|
||||
"to": "qdrant",
|
||||
"label": "index + vector retrieval",
|
||||
"fromSide": "bottom",
|
||||
"toSide": "top",
|
||||
"labelAt": [1165, 475]
|
||||
"id": "be-tht",
|
||||
"from": "backend",
|
||||
"to": "tht",
|
||||
"label": "ThtRunner"
|
||||
}
|
||||
],
|
||||
"cards": [
|
||||
{
|
||||
"dot": "cyan",
|
||||
"title": "Primary session path",
|
||||
"title": "Flusso di una sessione",
|
||||
"items": [
|
||||
"The browser sends questions and reviewer decisions over REST; the backend returns text, information, and widget descriptors over SSE.",
|
||||
"One Pi RPC process drives each active session and delegates deterministic phase operations to tht / Harness."
|
||||
"Il backend avvia un processo Pi per sessione e invia /nuova-domanda o /riprendi-sessione",
|
||||
"tht-gate.js guida le fasi F1–F8 e chiama il CLI tht per ogni passo deterministico",
|
||||
"I gate reviewer arrivano al browser come ui_request via SSE; la risposta torna con POST /sessions/:id/response"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dot": "emerald",
|
||||
"title": "State ownership",
|
||||
"title": "Persistenza",
|
||||
"items": [
|
||||
"Harness owns the eight-phase workflow and persists session_manifest.yaml, phase artifacts, and review_decisions.jsonl.",
|
||||
"Backend owns the separate installation-local metadata catalog; the live frontend transcript is not persisted."
|
||||
"Lo stato è nei documenti di fase e nel ledger review_decisions.jsonl, non nella chat",
|
||||
"La fase corrente si calcola ripiegando il ledger (phase.py), non viene salvata",
|
||||
"Repository sessioni su filesystem oppure PostgreSQL, secondo la configurazione"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dot": "amber",
|
||||
"title": "Catalogo metadati",
|
||||
"items": [
|
||||
"Il backend gestisce il Metadata Catalog PostgreSQL",
|
||||
"Le descrizioni AI campionano il DWH in sola lettura e usano un helper Python LiteLLM, senza Pi"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dot": "rose",
|
||||
"title": "Trust boundaries",
|
||||
"title": "Sicurezza",
|
||||
"items": [
|
||||
"Catalog DB, Qdrant, and Ollama stay inside Compose; workspace state is operator controlled and mounted into core.",
|
||||
"The DWH and AI provider remain external endpoints; DWH access is constrained to introspection, tests, bounded samples, and read-only SQL."
|
||||
"Login OIDC o identità upstream dal portale (Omics embedded)",
|
||||
"Qdrant ed Embedding sono servizi interni della rete Compose; DWH e LLM sono endpoint esterni"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
+3877
-3876
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,229 @@
|
||||
{
|
||||
"schema_version": 3,
|
||||
"diagram_type": "lifecycle",
|
||||
"meta": {
|
||||
"title": "ThothII — ciclo di vita di una sessione",
|
||||
"locale": "it",
|
||||
"output": "docs/architecture/thothii-session-lifecycle.html",
|
||||
"quality_profile": "showcase",
|
||||
"repository": {
|
||||
"url": "https://git.tylconsulting.it/mptyl/ThothII.git",
|
||||
"link_mode": "local-only",
|
||||
"revision": "31e6d3a162e9e5ac71fc2d8da4fe44b16c06aae3"
|
||||
}
|
||||
},
|
||||
"mainPath": [
|
||||
"open",
|
||||
"finalized",
|
||||
"archived"
|
||||
],
|
||||
"states": [
|
||||
{
|
||||
"id": "open",
|
||||
"type": "start",
|
||||
"label": "open",
|
||||
"sublabel": "fasi F1–F8 in corso",
|
||||
"tag": "riprendibile",
|
||||
"step": "01",
|
||||
"sources": [
|
||||
{
|
||||
"path": "harness/tht/session/models.py",
|
||||
"line": 107,
|
||||
"end_line": 107,
|
||||
"label": "status"
|
||||
},
|
||||
{
|
||||
"path": "harness/tht/session/store.py",
|
||||
"line": 524,
|
||||
"end_line": 533,
|
||||
"label": "reopen_session"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "finalized",
|
||||
"type": "success",
|
||||
"label": "finalized",
|
||||
"sublabel": "SQL verificato sul DWH",
|
||||
"tag": "sola lettura",
|
||||
"step": "02",
|
||||
"sources": [
|
||||
{
|
||||
"path": "harness/tht/session/store.py",
|
||||
"line": 570,
|
||||
"end_line": 592,
|
||||
"label": "persist_verified_finalization"
|
||||
},
|
||||
{
|
||||
"path": "harness/.pi/extensions/tht-gate.js",
|
||||
"line": 1650,
|
||||
"end_line": 1666,
|
||||
"label": "finalize automatico"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "archived",
|
||||
"type": "neutral",
|
||||
"label": "archiviata",
|
||||
"sublabel": "flag archived",
|
||||
"tag": "nascosta",
|
||||
"step": "03",
|
||||
"sources": [
|
||||
{
|
||||
"path": "harness/tht/session/store.py",
|
||||
"line": 556,
|
||||
"end_line": 562,
|
||||
"label": "set_archived"
|
||||
},
|
||||
{
|
||||
"path": "backend/src/routes/sessions.ts",
|
||||
"line": 928,
|
||||
"end_line": 937,
|
||||
"label": "POST /archive"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "closed",
|
||||
"type": "waiting",
|
||||
"label": "closed",
|
||||
"sublabel": "processo Pi fermato",
|
||||
"tag": "riprendibile",
|
||||
"sources": [
|
||||
{
|
||||
"path": "harness/tht/session/store.py",
|
||||
"line": 506,
|
||||
"end_line": 512,
|
||||
"label": "close_session"
|
||||
},
|
||||
{
|
||||
"path": "backend/src/routes/sessions.ts",
|
||||
"line": 832,
|
||||
"end_line": 850,
|
||||
"label": "POST /close"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "failed",
|
||||
"type": "failure",
|
||||
"label": "failed",
|
||||
"sublabel": "bootstrap o Pi falliti",
|
||||
"tag": "riprendibile",
|
||||
"sources": [
|
||||
{
|
||||
"path": "harness/tht/session/store.py",
|
||||
"line": 515,
|
||||
"end_line": 521,
|
||||
"label": "fail_session"
|
||||
},
|
||||
{
|
||||
"path": "backend/src/routes/sessions.ts",
|
||||
"line": 355,
|
||||
"end_line": 366,
|
||||
"label": "bootstrap fallito"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "deleted",
|
||||
"type": "neutral",
|
||||
"label": "cancellata",
|
||||
"sublabel": "directory rimossa",
|
||||
"sources": [
|
||||
{
|
||||
"path": "harness/tht/session/store.py",
|
||||
"line": 564,
|
||||
"end_line": 568,
|
||||
"label": "delete_session"
|
||||
},
|
||||
{
|
||||
"path": "backend/src/routes/sessions.ts",
|
||||
"line": 948,
|
||||
"end_line": 968,
|
||||
"label": "DELETE /sessions/:id"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"transitions": [
|
||||
{
|
||||
"id": "open-finalized",
|
||||
"from": "open",
|
||||
"to": "finalized",
|
||||
"label": "F8 chiusa",
|
||||
"variant": "emphasis"
|
||||
},
|
||||
{
|
||||
"id": "finalized-archived",
|
||||
"from": "finalized",
|
||||
"to": "archived",
|
||||
"label": "archive"
|
||||
},
|
||||
{
|
||||
"id": "open-closed",
|
||||
"from": "open",
|
||||
"to": "closed",
|
||||
"label": "close"
|
||||
},
|
||||
{
|
||||
"id": "closed-open",
|
||||
"from": "closed",
|
||||
"to": "open",
|
||||
"label": "resume (reopen)"
|
||||
},
|
||||
{
|
||||
"id": "open-failed",
|
||||
"from": "open",
|
||||
"to": "failed",
|
||||
"label": "errore runtime",
|
||||
"variant": "security"
|
||||
},
|
||||
{
|
||||
"id": "failed-open",
|
||||
"from": "failed",
|
||||
"to": "open",
|
||||
"label": "resume (reopen)"
|
||||
},
|
||||
{
|
||||
"id": "closed-deleted",
|
||||
"from": "closed",
|
||||
"to": "deleted",
|
||||
"label": "delete",
|
||||
"variant": "dashed"
|
||||
},
|
||||
{
|
||||
"id": "archived-finalized",
|
||||
"from": "archived",
|
||||
"to": "finalized",
|
||||
"label": "unarchive"
|
||||
}
|
||||
],
|
||||
"cards": [
|
||||
{
|
||||
"dot": "cyan",
|
||||
"title": "Ripresa",
|
||||
"items": [
|
||||
"Si riprendono solo sessioni open, closed o failed: reopen le riporta a open",
|
||||
"Il backend risponde 409 se la sessione è finalized o archiviata"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dot": "amber",
|
||||
"title": "Archiviazione",
|
||||
"items": [
|
||||
"archived è un flag separato dallo status: si può archiviare anche una sessione chiusa",
|
||||
"Archiviare non cambia lo status; una sessione archiviata non si riprende finché non viene ripristinata",
|
||||
"delete è possibile da qualunque stato e ferma il runtime; nel diagramma è mostrato solo da closed"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dot": "emerald",
|
||||
"title": "Fase e status",
|
||||
"items": [
|
||||
"Lo status descrive la sessione; la fase F1–F8 si ricalcola dal ledger delle decisioni"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,359 @@
|
||||
{
|
||||
"schema_version": 1,
|
||||
"diagram_type": "class",
|
||||
"meta": {
|
||||
"title": "ThothII — classi del runtime di sessione (backend)",
|
||||
"locale": "it",
|
||||
"output": "docs/architecture/thothii-session-runtime.html",
|
||||
"quality_profile": "showcase",
|
||||
"repository": {
|
||||
"url": "https://git.tylconsulting.it/mptyl/ThothII.git",
|
||||
"link_mode": "local-only",
|
||||
"revision": "31e6d3a162e9e5ac71fc2d8da4fe44b16c06aae3"
|
||||
}
|
||||
},
|
||||
"layout": {
|
||||
"mode": "grid"
|
||||
},
|
||||
"types": [
|
||||
{
|
||||
"id": "mgr",
|
||||
"label": "PiProcessManager",
|
||||
"kind": "class",
|
||||
"sublabel": "un processo Pi per sessione",
|
||||
"row": 0,
|
||||
"col": 0,
|
||||
"methods": [
|
||||
{
|
||||
"name": "createFor",
|
||||
"returns": "SessionRuntime",
|
||||
"visibility": "public",
|
||||
"parameters": "sessionId, options"
|
||||
},
|
||||
{
|
||||
"name": "configure",
|
||||
"returns": "Promise<void>",
|
||||
"visibility": "public",
|
||||
"parameters": "rt, options"
|
||||
},
|
||||
{
|
||||
"name": "start",
|
||||
"returns": "void",
|
||||
"visibility": "public",
|
||||
"parameters": "sessionId, rt, options"
|
||||
},
|
||||
{
|
||||
"name": "get",
|
||||
"returns": "SessionRuntime?",
|
||||
"visibility": "public",
|
||||
"parameters": "id"
|
||||
},
|
||||
{
|
||||
"name": "teardownIfCurrent",
|
||||
"returns": "boolean",
|
||||
"visibility": "public",
|
||||
"parameters": "id, expected"
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/pi/pi-process-manager.ts",
|
||||
"line": 46,
|
||||
"end_line": 46
|
||||
},
|
||||
{
|
||||
"path": "backend/src/pi/pi-process-manager.ts",
|
||||
"line": 178,
|
||||
"end_line": 178,
|
||||
"label": "createFor"
|
||||
},
|
||||
{
|
||||
"path": "backend/src/pi/pi-process-manager.ts",
|
||||
"line": 283,
|
||||
"end_line": 290,
|
||||
"label": "start"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "rt",
|
||||
"label": "SessionRuntime",
|
||||
"kind": "interface",
|
||||
"sublabel": "runtime vivo di una sessione",
|
||||
"row": 0,
|
||||
"col": 1,
|
||||
"attributes": [
|
||||
{
|
||||
"name": "rpc",
|
||||
"type": "RpcClient",
|
||||
"visibility": "public"
|
||||
},
|
||||
{
|
||||
"name": "bridge",
|
||||
"type": "SessionBridge",
|
||||
"visibility": "public"
|
||||
},
|
||||
{
|
||||
"name": "child",
|
||||
"type": "ChildProcess",
|
||||
"visibility": "public"
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/pi/pi-process-manager.ts",
|
||||
"line": 19,
|
||||
"end_line": 25
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "rpc",
|
||||
"label": "RpcClient",
|
||||
"kind": "class",
|
||||
"sublabel": "JSON lines su stdin/stdout di Pi",
|
||||
"row": 1,
|
||||
"col": 1,
|
||||
"methods": [
|
||||
{
|
||||
"name": "send",
|
||||
"returns": "void",
|
||||
"visibility": "public",
|
||||
"parameters": "cmd"
|
||||
},
|
||||
{
|
||||
"name": "request",
|
||||
"returns": "Promise<any>",
|
||||
"visibility": "public",
|
||||
"parameters": "cmd"
|
||||
},
|
||||
{
|
||||
"name": "on",
|
||||
"returns": "void",
|
||||
"visibility": "public",
|
||||
"parameters": "\"event\", cb"
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/rpc/rpc-client.ts",
|
||||
"line": 6,
|
||||
"end_line": 37
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "bridge",
|
||||
"label": "SessionBridge",
|
||||
"kind": "class",
|
||||
"sublabel": "eventi Pi → eventi client",
|
||||
"row": 1,
|
||||
"col": 2,
|
||||
"attributes": [
|
||||
{
|
||||
"name": "state",
|
||||
"type": "TurnState",
|
||||
"visibility": "private"
|
||||
},
|
||||
{
|
||||
"name": "pendingPiId",
|
||||
"type": "string?",
|
||||
"visibility": "private"
|
||||
}
|
||||
],
|
||||
"methods": [
|
||||
{
|
||||
"name": "onClientEvent",
|
||||
"returns": "void",
|
||||
"visibility": "public",
|
||||
"parameters": "cb"
|
||||
},
|
||||
{
|
||||
"name": "respond",
|
||||
"returns": "boolean",
|
||||
"visibility": "public",
|
||||
"parameters": "uiResponse"
|
||||
},
|
||||
{
|
||||
"name": "steer",
|
||||
"returns": "void",
|
||||
"visibility": "public",
|
||||
"parameters": "text"
|
||||
},
|
||||
{
|
||||
"name": "pendingWidget",
|
||||
"returns": "object?",
|
||||
"visibility": "public"
|
||||
},
|
||||
{
|
||||
"name": "turnState",
|
||||
"returns": "TurnState",
|
||||
"visibility": "public"
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/bridge/session-bridge.ts",
|
||||
"line": 52,
|
||||
"end_line": 71
|
||||
},
|
||||
{
|
||||
"path": "backend/src/bridge/session-bridge.ts",
|
||||
"line": 154,
|
||||
"end_line": 195
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "hub",
|
||||
"label": "SseHub",
|
||||
"kind": "class",
|
||||
"sublabel": "buffer e replay per sessione",
|
||||
"row": 0,
|
||||
"col": 2,
|
||||
"methods": [
|
||||
{
|
||||
"name": "subscribe",
|
||||
"returns": "void",
|
||||
"visibility": "public",
|
||||
"parameters": "sessionId, …"
|
||||
},
|
||||
{
|
||||
"name": "publish",
|
||||
"returns": "string",
|
||||
"visibility": "public",
|
||||
"parameters": "sessionId, event, data"
|
||||
},
|
||||
{
|
||||
"name": "clear",
|
||||
"returns": "void",
|
||||
"visibility": "public",
|
||||
"parameters": "sessionId"
|
||||
},
|
||||
{
|
||||
"name": "forget",
|
||||
"returns": "void",
|
||||
"visibility": "public",
|
||||
"parameters": "sessionId"
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/sse/sse-hub.ts",
|
||||
"line": 47,
|
||||
"end_line": 47
|
||||
},
|
||||
{
|
||||
"path": "backend/src/sse/sse-hub.ts",
|
||||
"line": 78,
|
||||
"end_line": 145
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "runner",
|
||||
"label": "ThtRunner",
|
||||
"kind": "class",
|
||||
"sublabel": "esegue il CLI tht",
|
||||
"row": 1,
|
||||
"col": 0,
|
||||
"methods": [
|
||||
{
|
||||
"name": "sessionNew",
|
||||
"returns": "Promise",
|
||||
"visibility": "public",
|
||||
"parameters": "options"
|
||||
},
|
||||
{
|
||||
"name": "sessionShow",
|
||||
"returns": "Promise",
|
||||
"visibility": "public",
|
||||
"parameters": "id"
|
||||
},
|
||||
{
|
||||
"name": "searchPack",
|
||||
"returns": "Promise<void>",
|
||||
"visibility": "public",
|
||||
"parameters": "question, id"
|
||||
},
|
||||
{
|
||||
"name": "reopenSession",
|
||||
"returns": "Promise",
|
||||
"visibility": "public",
|
||||
"parameters": "id"
|
||||
},
|
||||
{
|
||||
"name": "buildArgv",
|
||||
"returns": "string[]",
|
||||
"visibility": "public",
|
||||
"parameters": "args, workspace"
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "backend/src/tht/tht-runner.ts",
|
||||
"line": 111,
|
||||
"end_line": 114
|
||||
},
|
||||
{
|
||||
"path": "backend/src/tht/tht-runner.ts",
|
||||
"line": 392,
|
||||
"end_line": 394,
|
||||
"label": "buildArgv"
|
||||
},
|
||||
{
|
||||
"path": "backend/src/tht/tht-runner.ts",
|
||||
"line": 484,
|
||||
"end_line": 569
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"relationships": [
|
||||
{
|
||||
"from": "mgr",
|
||||
"to": "rt",
|
||||
"kind": "composition",
|
||||
"label": "runtimes"
|
||||
},
|
||||
{
|
||||
"from": "rt",
|
||||
"to": "rpc",
|
||||
"kind": "composition"
|
||||
},
|
||||
{
|
||||
"from": "rt",
|
||||
"to": "bridge",
|
||||
"kind": "composition"
|
||||
},
|
||||
{
|
||||
"from": "bridge",
|
||||
"to": "rpc",
|
||||
"kind": "association",
|
||||
"label": "ascolta"
|
||||
},
|
||||
{
|
||||
"from": "mgr",
|
||||
"to": "runner",
|
||||
"kind": "dependency",
|
||||
"label": "resume"
|
||||
}
|
||||
],
|
||||
"cards": [
|
||||
{
|
||||
"dot": "cyan",
|
||||
"title": "Collegamento",
|
||||
"items": [
|
||||
"Le route di sessione (sessionRoutes) collegano bridge e hub: ogni evento del bridge viene pubblicato con SseHub.publish",
|
||||
"app.ts crea un solo ThtRunner, SseHub e PiProcessManager per processo"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dot": "amber",
|
||||
"title": "Selezione",
|
||||
"items": [
|
||||
"Sono mostrati solo i membri usati nei flussi di sessione"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -107,7 +107,7 @@ aperta in un'altra scheda attraverso il solo controllo iniziale del proxy.
|
||||
Il cambio lingua può ricaricare la pagina: conservare la selezione della sessione,
|
||||
proteggere le modifiche non salvate e non avviare una nuova generazione al reload.
|
||||
Non si conserva una trascrizione integrale nel browser. La lingua della sessione
|
||||
rimane quella registrata nel manifest, secondo ADR 0022.
|
||||
rimane quella registrata nel manifest, secondo ADR 0046.
|
||||
|
||||
## Sostituzione e verifiche
|
||||
|
||||
|
||||
@@ -224,7 +224,7 @@ Catalog or Evidence. A missing or incompatible schema returns a clear operationa
|
||||
error. Preparation is repeatable and checks migration checksums.
|
||||
|
||||
See [the M1 specification](plans/2026-09-08-memory-m1-spec.md) and
|
||||
[ADR 0018](adr/0018-use-postgres-for-memory-and-qdrant-for-retrieval.md) for the
|
||||
[ADR 0042](adr/0042-use-postgres-for-memory-and-qdrant-for-retrieval.md) for the
|
||||
approved scope and acceptance boundaries.
|
||||
See [M2 implementation and validation](reports/knowledge-archives-release.md)
|
||||
for the retrieval checks and real embedding test command.
|
||||
|
||||
@@ -176,6 +176,6 @@ atomic operation. It skips empty generated descriptions, reports aggregate copie
|
||||
counts, and retains the generated text. Because this can replace reviewed descriptions, the
|
||||
interface requires explicit confirmation before applying it.
|
||||
|
||||
The decisions behind this surface are [ADRs 0001–0011](https://git.tylconsulting.it/mptyl/ThothII/src/branch/main/docs/adr/0001-postgres-metadata-catalog.md)
|
||||
The decisions behind this surface are [ADRs 0025–0035](https://git.tylconsulting.it/mptyl/ThothII/src/branch/main/docs/adr/0025-use-postgres-as-the-metadata-catalog.md)
|
||||
and the detailed acceptance record is
|
||||
[AI catalog description generation acceptance](https://git.tylconsulting.it/mptyl/ThothII/src/branch/main/docs/testing/2026-08-29-ai-catalog-description-generation-acceptance.md).
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Consegna a Codex sul server: ThothII e Omics Portal
|
||||
|
||||
Revisione: **14 settembre 2026**. Destinazione: Datamart Builder nel portale
|
||||
Revisione: **26 settembre 2026**. Destinazione: Datamart Builder nel portale
|
||||
Omics esistente, non un nuovo sito standalone. Questo documento è la procedura
|
||||
di riferimento per questa consegna e sostituisce le precedenti istruzioni di
|
||||
trasporto/pubblicazione del codice Omics. La distribuzione parte dai sorgenti
|
||||
@@ -57,20 +57,27 @@ conservati in un percorso operativo stabile sul server.
|
||||
|
||||
### ThothII
|
||||
|
||||
Il checkout aggiornato deve essere su `main` e includere almeno
|
||||
`bdcd8fcd28f3011471d77224db9c3f5baf227995` e questo documento. Registra anche lo
|
||||
SHA effettivo di `main`, che include il commit di consegna e il merge successivi:
|
||||
Il checkout aggiornato deve essere sulla `main` di Gitea (`origin`) e includere almeno
|
||||
`0d2e573e` (correzione della vista sessione del 26 settembre) e questo documento.
|
||||
Il branch `codex/guided-standalone-install` contiene un processo di nuova installazione
|
||||
ancora in lavorazione: non usarlo per questo aggiornamento e non eseguire
|
||||
`tht setup --complete` sull'installazione server esistente. Registra lo SHA effettivo e
|
||||
confrontalo con `origin/main` senza modificare il checkout operativo:
|
||||
|
||||
```bash
|
||||
git fetch origin main
|
||||
git status --short --branch
|
||||
git rev-parse HEAD
|
||||
git merge-base --is-ancestor bdcd8fcd28f3011471d77224db9c3f5baf227995 HEAD
|
||||
git rev-parse origin/main
|
||||
git rev-list --left-right --count HEAD...origin/main
|
||||
git merge-base --is-ancestor 0d2e573e HEAD
|
||||
```
|
||||
|
||||
Se il controllo fallisce, completa l'acquisizione della revisione approvata
|
||||
prima di toccare l'installazione. Non ricostruire a mano le singole modifiche UI:
|
||||
questa revisione contiene shell, autenticazione, i18n, workflow bilingue,
|
||||
amministrazione, typography e navigazione aggiornate.
|
||||
La divergenza ideale è `0 0` e la working tree è pulita. Se il controllo dell'antenato
|
||||
fallisce, o se il server ha commit o modifiche locali, prepara e verifica la revisione
|
||||
approvata prima di toccare l'installazione; non usare reset o force push. Non ricostruire
|
||||
a mano le singole modifiche UI: la revisione di `main` contiene shell, autenticazione,
|
||||
i18n, workflow bilingue, amministrazione, typography e navigazione aggiornate.
|
||||
|
||||
### Omics Portal
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ editoriale di pubblicazione. Dopo un errore o un riavvio, un corpus parziale non
|
||||
deve essere dichiarato pronto per la successiva elaborazione.
|
||||
|
||||
Le decisioni Q11–Q15 e il successivo chiarimento sui vincoli sono registrati
|
||||
nell'[ADR 0019](../adr/0019-author-evidence-in-app-with-automatic-activation.md).
|
||||
nell'[ADR 0043](../adr/0043-maintain-local-evidence-with-external-editors.md).
|
||||
|
||||
## Consolidamento manuale e seguito Git — release 0 {#consolidamento-manuale-e-seguito-git--release-0}
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ dichiarazione manuale sostiene il testo corrente, con l'eventuale documento
|
||||
originario conservato come provenienza distinta. Q15 limita la riacquisizione
|
||||
delle fonti esterne a una richiesta esplicita dell'amministratore; il normale
|
||||
salvataggio e il recall usano il contenuto già acquisito.
|
||||
L'[ADR 0019](../adr/0019-author-evidence-in-app-with-automatic-activation.md) registra
|
||||
L'[ADR 0043](../adr/0043-maintain-local-evidence-with-external-editors.md) registra
|
||||
l'evoluzione del contratto, ancora da implementare.
|
||||
|
||||
## Stato verificato nel repository
|
||||
@@ -191,7 +191,7 @@ filtri, percorsi di manutenzione e feedback coerenti, isolamento fra workspace e
|
||||
incrociati fra i due domini.
|
||||
|
||||
La separazione fra Reference Vector Collection e Memory Vector Collection rimane
|
||||
quella dell'[ADR 0017](../adr/0017-separate-reference-vectors-from-runtime-memory.md).
|
||||
quella dell'[ADR 0041](../adr/0041-separate-reference-vectors-from-runtime-memory.md).
|
||||
Un'operazione amministrativa sulle Evidence non cancella le Memory; una cancellazione
|
||||
di Memory non elimina Evidence, Schema o metadati del database.
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Data: 2026-09-08. Stato: M1 implementato e verificato localmente;
|
||||
confini di test confermati dal proprietario il 2026-09-08.
|
||||
|
||||
Primo incremento del progetto Memory management. Attua le decisioni già approvate
|
||||
nel piano del 2026-09-08 e nell'ADR 0018. Le scelte tecniche di dettaglio qui
|
||||
nel piano del 2026-09-08 e nell'ADR 0042. Le scelte tecniche di dettaglio qui
|
||||
proposte derivano dalla ricognizione del runtime. Gli esiti dell'implementazione
|
||||
sono riportati nel [rapporto di verifica](../reports/knowledge-archives-release.md).
|
||||
|
||||
@@ -167,7 +167,7 @@ M2 e M3, entrambi ancora obbligatori per completare il progetto Memory.
|
||||
- La ricostruzione degli indici Memory e solved-question usa esclusivamente
|
||||
le card autorevoli. Non reimporta automaticamente il registro JSONL, i payload
|
||||
Qdrant o le sessioni di origine. Il preprocessing delle reference mantiene
|
||||
la separazione delle collezioni stabilita nell'ADR 0017.
|
||||
la separazione delle collezioni stabilita nell'ADR 0041.
|
||||
- Anche i produttori attuali di Memory ed exemplar scrivono attraverso il
|
||||
servizio autorevole. Si adeguano promozione, salvataggio singolo e percorso di
|
||||
finalizzazione quanto necessario a evitare scritture dirette al solo indice.
|
||||
@@ -324,8 +324,8 @@ casi reali appartengono agli incrementi che cambiano generazione e workflow.
|
||||
|
||||
Fonti: progetto **Memory management** del 2026-09-08; piano comune
|
||||
**Amministrazione di Memory ed Evidence**; **Revisione di semplicità: Memory ed
|
||||
Evidence**; glossario di dominio; ADR 0017 sulla separazione delle collezioni e
|
||||
ADR 0018 su PostgreSQL autorevole e Qdrant per il retrieval.
|
||||
Evidence**; glossario di dominio; ADR 0041 sulla separazione delle collezioni e
|
||||
ADR 0042 su PostgreSQL autorevole e Qdrant per il retrieval.
|
||||
|
||||
La ricognizione ha verificato MemoryRecord, recall ordinario, ricerca degli
|
||||
exemplar, comandi Memory, repository PostgreSQL delle sessioni, runner del harness,
|
||||
|
||||
@@ -147,7 +147,7 @@ nel core è lavoro applicativo da implementare.
|
||||
anche i collegamenti che la coinvolgono, conservando le altre card. I collegamenti
|
||||
contribuiscono al recupero e non applicano automaticamente i contenuti.
|
||||
|
||||
La decisione architetturale è registrata nell'[ADR 0018](../adr/0018-use-postgres-for-memory-and-qdrant-for-retrieval.md).
|
||||
La decisione architetturale è registrata nell'[ADR 0042](../adr/0042-use-postgres-for-memory-and-qdrant-for-retrieval.md).
|
||||
|
||||
### Flusso da implementare
|
||||
|
||||
@@ -286,7 +286,7 @@ Verificare card attese, esclusioni per ambito, cicli, collegamenti verso card ri
|
||||
e rigenerazione dell'indice da PostgreSQL. Quando si verifica il recupero effettivo,
|
||||
usare il percorso di embedding e ricerca configurato su un indice isolato: un fake
|
||||
che restituisce gli ID predisposti verifica soltanto il contratto applicativo.
|
||||
La separazione fra le collezioni Reference e Memory rimane quella degli ADR 0017 e 0018.
|
||||
La separazione fra le collezioni Reference e Memory rimane quella degli ADR 0041 e 0042.
|
||||
|
||||
### M3 — Workflow e sincronizzazione fisica
|
||||
|
||||
|
||||
@@ -228,7 +228,7 @@ La skill deve chiedere, a ogni round, soltanto le decisioni i cui prerequisiti s
|
||||
Le risposte devono distinguere **decisione confermata**, **proposta** e **fatto da verificare**.
|
||||
Non cambiare implicitamente ADR esistenti. Un nuovo ADR è opportuno soltanto per una decisione
|
||||
costosa da invertire, sorprendente senza contesto e frutto di alternative reali; può bastare un
|
||||
titolo e un breve paragrafo. `CONTEXT.md` resta un glossario, non il contenitore del PRD.
|
||||
titolo e un breve paragrafo. `GLOSSARY.md` resta un glossario, non il contenitore del PRD.
|
||||
|
||||
## Strategia di test da approvare
|
||||
|
||||
@@ -290,7 +290,7 @@ simboli e i percorsi correnti alla ripresa; le righe e la distribuzione dei modu
|
||||
| SEC-01 | `harness/tht/session/repository.py` (`resolve_principal`), `filesystem_repository.py`, `backend/src/config.ts`; [architettura auth](../architecture/authentication.md) |
|
||||
| SEC-02 | `backend/src/pi/pi-process-manager.ts`, `provider-credentials.ts`, `harness/.pi/extensions/tht-gate.js`, repository PostgreSQL e identità di connessione |
|
||||
| SEC-03 | Renderer dell'installazione, `harness/tht/config.py`, `harness/tht/db/connection.py`; [contratto DWH](../contracts/tht-dwh.md) |
|
||||
| SEC-04 | `harness/tht/cli/search_cmd.py`, runtime LSH, worker descrizioni; [ADR-0011](../adr/0011-gate-source-samples-with-a-sensitive-data-flag.md) e gate in `PROJECT_STATE.md` |
|
||||
| SEC-04 | `harness/tht/cli/search_cmd.py`, runtime LSH, worker descrizioni; [ADR-0035](../adr/0035-gate-source-samples-with-a-sensitive-data-flag.md) e gate in `PROJECT_STATE.md` |
|
||||
| SEC-05 | `backend/src/pi/managed-config.ts`, argomenti del processo Pi, versione Pi nel lockfile e comportamento della libreria effettivamente distribuita |
|
||||
| SEC-06 | `backend/src/auth/session-store.ts`, `backend/src/routes/sessions.ts`, SSE hub; [OIDC](../install/authentication-oidc.md) |
|
||||
| SEC-07 | `backend/src/routes/workspaces.ts`, ammissione delle sessioni e policy dei permessi |
|
||||
@@ -298,8 +298,8 @@ simboli e i percorsi correnti alla ripresa; le righe e la distribuzione dei modu
|
||||
| SEC-09 | `backend/src/app.ts`, rate limiter del login, configurazione proxy e risposte HTTP del deploy di prova |
|
||||
| SEC-10 | Lockfile backend/frontend/Pi, installazione Python nell'immagine core e inventario immagini; advisory storici su `undici`, `brace-expansion`, `protobufjs` e relativa dipendenza Pi da rivalutare |
|
||||
| SEC-11 | Dockerfile e Compose in `deploy/`, confronto fra core e manutenzione, `docker inspect` con output sanitizzato solo su ambiente autorizzato |
|
||||
| SEC-12 | `backend/src/workspaces/secret-store.ts`, backup/restore in `tools/tht`; [ADR-0002](../adr/0002-workspace-database-secret-references.md) |
|
||||
| SEC-12 | `backend/src/workspaces/secret-store.ts`, backup/restore in `tools/tht`; [ADR-0026](../adr/0026-reference-workspace-database-secrets.md) |
|
||||
|
||||
Per le decisioni collegate consultare anche [ADR-0010](../adr/0010-allow-bounded-real-source-samples-for-description-generation.md),
|
||||
[ADR-0013](../adr/0013-use-one-installation-model-catalog-with-runtime-projections.md),
|
||||
Per le decisioni collegate consultare anche [ADR-0034](../adr/0034-allow-bounded-real-source-samples-for-description-generation.md),
|
||||
[ADR-0037](../adr/0037-use-one-installation-model-catalog-with-runtime-projections.md),
|
||||
gli ADR correnti sulla sensitivity e le istruzioni in `docs/agents/`.
|
||||
|
||||
@@ -77,7 +77,7 @@ Schema migrations, a new preprocessing service, Evidence web editing, new model
|
||||
|
||||
## Further Notes
|
||||
|
||||
This implements the page direction recorded by ADR 0020, refined by the owner's
|
||||
This implements the page direction recorded by ADR 0044, refined by the owner's
|
||||
2026-09-12 acceptance of shelf A and explicit functional-preservation requirements.
|
||||
Testing reuses the existing public UI seams. Ticket breakdown is recorded alongside
|
||||
this spec as four independently reviewable increments. Gitea publication is pending
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user