Thirteen source-backed interactive diagrams in docs/architecture with an index page (thothii-diagrams.html): runtime and deployment architecture, module tree, F1-F8 workflow, session and catalog-sync lifecycles, new-question, gate round-trip, resume and OIDC sequences, session runtime classes, metadata dataflow and Metadata Catalog ERD. Replaces the old thothii-core sequence diagram. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
388 lines
8.2 KiB
JSON
388 lines
8.2 KiB
JSON
{
|
||
"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"
|
||
]
|
||
}
|
||
]
|
||
} |