{
  "schemaVersion": 2,
  "repository": "https://github.com/Wulfgardr/mediflow",
  "revision": "b6d9690d97df5172519b80747ef495f1c755fc5d",
  "revisionDate": "2026-11-06T11:47:22+01:00",
  "descriptions": {
    "author": "GPT-6.1 Sol",
    "reviewer": "Leonardo Pegollo",
    "approval": "approved",
    "approvedOn": "2026-11-06",
    "contentHash": "edb2dc311ad33faaebe0b16a1933939b05f87ee16b817b1868497c6a82515d96"
  },
  "structures": [
    {
      "id": "routes",
      "code": "01",
      "kind": "screen",
      "title": {
        "it": "Pagine ed ingressi",
        "en": "Pages and entry points"
      },
      "summary": {
        "it": "Porta il medico alla cartella e riceve le richieste delle altre applicazioni.",
        "en": "Opens the record for the physician and receives requests from other applications."
      },
      "what": {
        "it": "Le pagine mostrano pazienti, diario ed impostazioni. Gli ingressi del servizio ricevono le richieste, verificano l’accesso ed affidano l’operazione alla parte competente.",
        "en": "Pages show patients, the clinical diary and settings. Service entry points receive requests, check access and pass the operation to the responsible part of the system."
      },
      "how": {
        "it": "Next.js organizza pagine e route API in app/. Il contratto /api/v1 è separato dalla navigazione web.",
        "en": "Next.js organises pages and API routes in app/. The /api/v1 contract is separate from web navigation."
      },
      "paths": [
        "app/",
        "app/api/patients/route.ts"
      ],
      "docs": [
        "ARCHITECTURE.md"
      ],
      "adrs": [
        "0123",
        "0010"
      ],
      "conditions": [
        {
          "text": {
            "it": "Il guard di navigazione non promette il recupero durevole di tutte le bozze o il salvataggio automatico. La scelta della disposizione resta nel browser e non nel profilo clinico sul server.",
            "en": "The navigation guard does not promise durable recovery of all drafts or automatic saving. The layout choice stays in the browser rather than the clinical profile on the server."
          },
          "source": {
            "path": "docs/adr/0123-official-web-ui-navigation-compositions.md",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0123-official-web-ui-navigation-compositions.md"
          },
          "quote": "non promette recupero durevole di tutte le bozze o salvataggio automatico."
        }
      ],
      "steps": [
        {
          "title": {
            "it": "Richiesta",
            "en": "Request"
          },
          "description": {
            "it": "Il medico apre una pagina o richiede un’operazione.",
            "en": "The physician opens a page or requests an operation."
          },
          "path": "app/",
          "source": {
            "path": "app/",
            "url": "https://github.com/Wulfgardr/mediflow/tree/b6d9690d97df5172519b80747ef495f1c755fc5d/app"
          }
        },
        {
          "title": {
            "it": "Controllo accesso",
            "en": "Access check"
          },
          "description": {
            "it": "La richiesta attraversa i controlli della route.",
            "en": "The request passes the route’s checks."
          },
          "path": "app/api/patients/route.ts",
          "source": {
            "path": "app/api/patients/route.ts",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/app/api/patients/route.ts"
          }
        },
        {
          "title": {
            "it": "Servizio",
            "en": "Service"
          },
          "description": {
            "it": "Le regole cliniche rimangono nei servizi applicativi.",
            "en": "Clinical rules remain in application services."
          },
          "path": "lib/domain/",
          "source": {
            "path": "lib/domain/",
            "url": "https://github.com/Wulfgardr/mediflow/tree/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/domain"
          }
        }
      ],
      "position": {
        "x": -3.3774509803921564,
        "y": 6.78921568627451
      },
      "sources": [
        {
          "path": "app/",
          "url": "https://github.com/Wulfgardr/mediflow/tree/b6d9690d97df5172519b80747ef495f1c755fc5d/app"
        },
        {
          "path": "app/api/patients/route.ts",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/app/api/patients/route.ts"
        }
      ],
      "documents": [
        {
          "path": "ARCHITECTURE.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/ARCHITECTURE.md"
        }
      ],
      "decisions": [
        {
          "path": "docs/adr/0123-official-web-ui-navigation-compositions.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0123-official-web-ui-navigation-compositions.md"
        },
        {
          "path": "docs/adr/0010-openapi-spec-first-for-api-v1.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0010-openapi-spec-first-for-api-v1.md"
        }
      ],
      "fileCount": 338
    },
    {
      "id": "components",
      "code": "02",
      "kind": "cards",
      "title": {
        "it": "Interfaccia condivisa",
        "en": "Shared interface"
      },
      "summary": {
        "it": "Rende leggibili dati, azioni e stato del lavoro.",
        "en": "Makes data, actions and the state of work readable."
      },
      "what": {
        "it": "Riunisce i controlli che ricorrono nella cartella: elenchi, pannelli del paziente, documenti e conferme. Parole e segni aiutano a distinguere una proposta da un dato registrato.",
        "en": "Collects recurring record controls: lists, patient panels, documents and confirmations. Words and visual cues help distinguish a proposal from a recorded value."
      },
      "how": {
        "it": "Componenti React condivisi. DESIGN.md e Punto d’inchiostro definiscono linguaggio, gerarchia e stati.",
        "en": "Shared React components. DESIGN.md and Punto d’inchiostro define language, hierarchy and states."
      },
      "paths": [
        "components/",
        "components/document-upload.tsx"
      ],
      "docs": [
        "DESIGN.md"
      ],
      "adrs": [
        "0144-punto"
      ],
      "conditions": [
        {
          "text": {
            "it": "Le misure tipografiche documentate non coprono ogni dialogo o stato di errore. Non certificano lo zoom reale o le tecnologie assistive.",
            "en": "Documented typography measurements do not cover every dialog or error state. They do not certify real zoom or assistive technologies."
          },
          "source": {
            "path": "docs/known-limitations.md",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/known-limitations.md"
          },
          "quote": "non copre ogni dialogo, ogni stato di errore"
        }
      ],
      "steps": [
        {
          "title": {
            "it": "Vista",
            "en": "View"
          },
          "description": {
            "it": "Il contenuto viene raggruppato per il compito del medico.",
            "en": "Content is grouped around the physician’s task."
          },
          "path": "components/",
          "source": {
            "path": "components/",
            "url": "https://github.com/Wulfgardr/mediflow/tree/b6d9690d97df5172519b80747ef495f1c755fc5d/components"
          }
        },
        {
          "title": {
            "it": "Azione",
            "en": "Action"
          },
          "description": {
            "it": "Il controllo esplicita che cosa succede ai dati.",
            "en": "The control explains what happens to the data."
          },
          "path": "DESIGN.md",
          "source": {
            "path": "DESIGN.md",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/DESIGN.md"
          }
        },
        {
          "title": {
            "it": "Esito",
            "en": "Outcome"
          },
          "description": {
            "it": "Lo stato visibile deve corrispondere all’esito osservato.",
            "en": "The visible state must match the observed outcome."
          },
          "path": "docs/adr/0144-punto-inchiostro.md",
          "source": {
            "path": "docs/adr/0144-punto-inchiostro.md",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0144-punto-inchiostro.md"
          }
        }
      ],
      "position": {
        "x": 1.4558823529411764,
        "y": 1.9558823529411764
      },
      "sources": [
        {
          "path": "components/",
          "url": "https://github.com/Wulfgardr/mediflow/tree/b6d9690d97df5172519b80747ef495f1c755fc5d/components"
        },
        {
          "path": "components/document-upload.tsx",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/components/document-upload.tsx"
        }
      ],
      "documents": [
        {
          "path": "DESIGN.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/DESIGN.md"
        }
      ],
      "decisions": [
        {
          "path": "docs/adr/0144-punto-inchiostro.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0144-punto-inchiostro.md"
        }
      ],
      "fileCount": 300
    },
    {
      "id": "documents",
      "code": "03",
      "kind": "cards",
      "title": {
        "it": "Lettura dei documenti",
        "en": "Document reading"
      },
      "summary": {
        "it": "Ricava testo e riferimenti ai passaggi originali del documento.",
        "en": "Extracts text and references to the original document passages."
      },
      "what": {
        "it": "Il documento rimane una fonte da consultare. Il primo passaggio ricava il testo sul computer. Sulle pagine supportate che lo richiedono prosegue il riconoscimento del testo. I riferimenti alla fonte accompagnano il risultato.",
        "en": "The document remains a source to consult. The first pass extracts text on the computer. Supported pages that need it continue through text recognition. Source references travel with the result."
      },
      "how": {
        "it": "AnyDoc avvia l’estrazione locale. Il dominio documentale conserva provenienza e validità della fonte. La sintesi usa questi controlli.",
        "en": "AnyDoc starts local extraction. The document domain preserves source provenance and currentness. Synthesis uses these checks."
      },
      "paths": [
        "lib/domain/documents/",
        "lib/domain/documents/anydoc-local-extraction-runner.ts",
        "components/document-upload.tsx"
      ],
      "docs": [
        "ARCHITECTURE.md"
      ],
      "adrs": [
        "0099",
        "0102",
        "0128"
      ],
      "conditions": [
        {
          "text": {
            "it": "Il percorso OCR interrompe l’estrazione per immagini dirette, documenti cifrati, formati ambigui o assenza del motore locale. Le route OCR legacy rispondono 410.",
            "en": "OCR extraction stops for direct images, encrypted documents, ambiguous formats or a missing local engine. Legacy OCR routes return 410."
          },
          "source": {
            "path": "docs/known-limitations.md",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/known-limitations.md"
          },
          "quote": "Immagini dirette, documenti cifrati, formati ambigui o assenza del motore locale interrompono il percorso senza ripieghi; le route OCR legacy rispondono `410`."
        }
      ],
      "steps": [
        {
          "title": {
            "it": "Documento",
            "en": "Document"
          },
          "description": {
            "it": "Il medico sceglie il documento del paziente.",
            "en": "The physician chooses the patient’s document."
          },
          "path": "components/document-upload.tsx",
          "source": {
            "path": "components/document-upload.tsx",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/components/document-upload.tsx"
          }
        },
        {
          "title": {
            "it": "Estrazione locale",
            "en": "Local extraction"
          },
          "description": {
            "it": "Il testo viene ricavato senza un invio implicito all’esterno.",
            "en": "Text is extracted without an implicit external transfer."
          },
          "path": "lib/domain/documents/anydoc-local-extraction-runner.ts",
          "source": {
            "path": "lib/domain/documents/anydoc-local-extraction-runner.ts",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/domain/documents/anydoc-local-extraction-runner.ts"
          }
        },
        {
          "title": {
            "it": "Fonte e contesto",
            "en": "Source and context"
          },
          "description": {
            "it": "Il risultato rimane legato al documento ed al contesto valido.",
            "en": "The result stays bound to the document and valid context."
          },
          "path": "lib/ai-providers/fabric/document-synthesis-production-operation.ts",
          "source": {
            "path": "lib/ai-providers/fabric/document-synthesis-production-operation.ts",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/ai-providers/fabric/document-synthesis-production-operation.ts"
          }
        }
      ],
      "position": {
        "x": 6.28921568627451,
        "y": -2.8774509803921564
      },
      "sources": [
        {
          "path": "lib/domain/documents/",
          "url": "https://github.com/Wulfgardr/mediflow/tree/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/domain/documents"
        },
        {
          "path": "lib/domain/documents/anydoc-local-extraction-runner.ts",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/domain/documents/anydoc-local-extraction-runner.ts"
        },
        {
          "path": "components/document-upload.tsx",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/components/document-upload.tsx"
        }
      ],
      "documents": [
        {
          "path": "ARCHITECTURE.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/ARCHITECTURE.md"
        }
      ],
      "decisions": [
        {
          "path": "docs/adr/0099-ocr-document-locator-and-source-currentness.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0099-ocr-document-locator-and-source-currentness.md"
        },
        {
          "path": "docs/adr/0102-document-synthesis-source-authority.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0102-document-synthesis-source-authority.md"
        },
        {
          "path": "docs/adr/0128-local-desktop-ocr.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0128-local-desktop-ocr.md"
        }
      ],
      "fileCount": 124
    },
    {
      "id": "fabric",
      "code": "04",
      "kind": "tall",
      "title": {
        "it": "AI Fabric",
        "en": "AI Fabric"
      },
      "summary": {
        "it": "Coordina le funzioni intelligenti e restituisce proposte da valutare.",
        "en": "Coordinates intelligent functions and returns proposals to assess."
      },
      "what": {
        "it": "Quando una funzione intelligente è configurata ed autorizzata, prepara una proposta. La disponibilità del modello, il permesso di usare i dati e la possibilità di registrarli sono controlli distinti.",
        "en": "When an intelligent function is configured and admitted, it prepares a proposal. Model availability, permission to use data and permission to record results are separate checks."
      },
      "how": {
        "it": "Il Fabric risolve funzioni, modelli e configurazione. La composizione Document Synthesis controlla selezione, contesto e fonte prima di esporre un’anteprima.",
        "en": "The Fabric resolves functions, models and configuration. The Document Synthesis composition checks selection, context and source before exposing a preview."
      },
      "paths": [
        "lib/ai-providers/fabric/",
        "lib/ai-providers/fabric/function-model-dispatch.ts",
        "lib/ai-providers/fabric/document-synthesis-production-operation.ts"
      ],
      "docs": [
        "docs/known-limitations.md"
      ],
      "adrs": [
        "0129",
        "0100",
        "0134"
      ],
      "conditions": [
        {
          "text": {
            "it": "La nota del 16 ottobre non attesta generazioni ChatGPT nelle quattro funzioni né ammissione clinica. È un limite datato, non una misura ripetuta su questa revisione.",
            "en": "The 16 October note does not attest ChatGPT generation in the four functions or clinical admission. This is dated evidence, not a measurement repeated at this revision."
          },
          "source": {
            "path": "docs/known-limitations.md",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/known-limitations.md"
          },
          "quote": "La generazione nelle quattro funzioni non è ancora stata verificata"
        }
      ],
      "steps": [
        {
          "title": {
            "it": "Funzione",
            "en": "Function"
          },
          "description": {
            "it": "Viene richiesta una funzione nominata.",
            "en": "A named function is requested."
          },
          "path": "lib/ai-providers/fabric/function-model-dispatch.ts",
          "source": {
            "path": "lib/ai-providers/fabric/function-model-dispatch.ts",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/ai-providers/fabric/function-model-dispatch.ts"
          }
        },
        {
          "title": {
            "it": "Controlli",
            "en": "Checks"
          },
          "description": {
            "it": "Fonte, contesto e disponibilità devono essere ancora validi.",
            "en": "Source, context and availability must still be valid."
          },
          "path": "lib/ai-providers/fabric/document-synthesis-production-operation.ts",
          "source": {
            "path": "lib/ai-providers/fabric/document-synthesis-production-operation.ts",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/ai-providers/fabric/document-synthesis-production-operation.ts"
          }
        },
        {
          "title": {
            "it": "Proposta",
            "en": "Proposal"
          },
          "description": {
            "it": "Il risultato rimane un’anteprima da valutare.",
            "en": "The result remains a preview to assess."
          },
          "path": "lib/ai-providers/fabric/document-synthesis-fabric-production-composition.ts",
          "source": {
            "path": "lib/ai-providers/fabric/document-synthesis-fabric-production-composition.ts",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/ai-providers/fabric/document-synthesis-fabric-production-composition.ts"
          }
        }
      ],
      "position": {
        "x": 1.6225490196078436,
        "y": 11.78921568627451
      },
      "sources": [
        {
          "path": "lib/ai-providers/fabric/",
          "url": "https://github.com/Wulfgardr/mediflow/tree/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/ai-providers/fabric"
        },
        {
          "path": "lib/ai-providers/fabric/function-model-dispatch.ts",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/ai-providers/fabric/function-model-dispatch.ts"
        },
        {
          "path": "lib/ai-providers/fabric/document-synthesis-production-operation.ts",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/ai-providers/fabric/document-synthesis-production-operation.ts"
        }
      ],
      "documents": [
        {
          "path": "docs/known-limitations.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/known-limitations.md"
        }
      ],
      "decisions": [
        {
          "path": "docs/adr/0129-function-model-catalog-preferences.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0129-function-model-catalog-preferences.md"
        },
        {
          "path": "docs/adr/0100-fabric-vs-headless-semantic-plane.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0100-fabric-vs-headless-semantic-plane.md"
        },
        {
          "path": "docs/adr/0134-chatgpt-subscription-synthesis-execution.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0134-chatgpt-subscription-synthesis-execution.md"
        }
      ],
      "fileCount": 172
    },
    {
      "id": "review",
      "code": "05",
      "kind": "gate",
      "title": {
        "it": "Revisione del medico",
        "en": "Physician review"
      },
      "summary": {
        "it": "Permette di confrontare la proposta con la fonte e scegliere i dati.",
        "en": "Lets the physician compare the proposal with its source and choose data."
      },
      "what": {
        "it": "Prima di usare i dati estratti, il medico può controllarli, correggerli o escluderli. La revisione prepara una decisione esplicita. Da sola non concede una scrittura clinica.",
        "en": "Before using extracted data, the physician can check, correct or exclude it. Review prepares an explicit decision. It does not itself grant a clinical write."
      },
      "how": {
        "it": "La UI di importazione ed il modello di revisione condividono il contratto fra proposta, decisione e persistenza.",
        "en": "The import UI and review model share the contract between proposal, decision and persistence."
      },
      "paths": [
        "components/patient-document-import-review.tsx",
        "lib/domain/documents/patient-document-review.ts",
        "lib/domain/documents/patient-import-decision.ts"
      ],
      "docs": [
        "docs/clinical-write-roster.md"
      ],
      "adrs": [
        "0051",
        "0084"
      ],
      "conditions": [
        {
          "text": {
            "it": "Le anteprime Smart Import e Document Synthesis richiedono revisione. La sola accettazione di una review non modifica diagnosi o terapie.",
            "en": "Smart Import and Document Synthesis previews require review. Accepting a review alone does not change diagnoses or therapies."
          },
          "source": {
            "path": "docs/adr/0084-document-diagnoses-review-only.md",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0084-document-diagnoses-review-only.md"
          },
          "quote": "Il servizio non aggiunge o aggiorna `patients.diagnoses` automaticamente."
        }
      ],
      "steps": [
        {
          "title": {
            "it": "Confrontare",
            "en": "Compare"
          },
          "description": {
            "it": "Il medico legge dati e riferimenti alla fonte.",
            "en": "The physician reads data and source references."
          },
          "path": "components/patient-document-import-review.tsx",
          "source": {
            "path": "components/patient-document-import-review.tsx",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/components/patient-document-import-review.tsx"
          }
        },
        {
          "title": {
            "it": "Scegliere",
            "en": "Choose"
          },
          "description": {
            "it": "Include, corregge o esclude i dati proposti.",
            "en": "They include, correct or exclude proposed data."
          },
          "path": "lib/domain/documents/patient-document-review.ts",
          "source": {
            "path": "lib/domain/documents/patient-document-review.ts",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/domain/documents/patient-document-review.ts"
          }
        },
        {
          "title": {
            "it": "Decisione",
            "en": "Decision"
          },
          "description": {
            "it": "La decisione viene preparata secondo un contratto esplicito.",
            "en": "The decision is prepared under an explicit contract."
          },
          "path": "lib/domain/documents/patient-import-decision.ts",
          "source": {
            "path": "lib/domain/documents/patient-import-decision.ts",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/domain/documents/patient-import-decision.ts"
          }
        }
      ],
      "position": {
        "x": 6.455882352941177,
        "y": 6.955882352941177
      },
      "sources": [
        {
          "path": "components/patient-document-import-review.tsx",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/components/patient-document-import-review.tsx"
        },
        {
          "path": "lib/domain/documents/patient-document-review.ts",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/domain/documents/patient-document-review.ts"
        },
        {
          "path": "lib/domain/documents/patient-import-decision.ts",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/domain/documents/patient-import-decision.ts"
        }
      ],
      "documents": [
        {
          "path": "docs/clinical-write-roster.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/clinical-write-roster.md"
        }
      ],
      "decisions": [
        {
          "path": "docs/adr/0051-patient-import-decision-contract-between-review-and-persistence.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0051-patient-import-decision-contract-between-review-and-persistence.md"
        },
        {
          "path": "docs/adr/0084-document-diagnoses-review-only.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0084-document-diagnoses-review-only.md"
        }
      ],
      "fileCount": 3
    },
    {
      "id": "domain",
      "code": "06",
      "kind": "slab",
      "title": {
        "it": "Regole cliniche",
        "en": "Clinical rules"
      },
      "summary": {
        "it": "Applica le regole delle operazioni e i confini fra proposta e registrazione.",
        "en": "Applies operation rules and boundaries between proposal and recording."
      },
      "what": {
        "it": "Qui vivono decisioni sui dati e controlli delle operazioni. Le richieste devono rispettare paziente, versione, permessi e condizioni dell’operazione prima di cambiare la cartella.",
        "en": "This area holds data decisions and operation checks. Requests must respect the patient, version, permissions and operation conditions before changing a record."
      },
      "how": {
        "it": "lib/domain raccoglie contratti e servizi del dominio. Il registro delle scritture descrive i confini clinici da rispettare.",
        "en": "lib/domain collects domain contracts and services. The write roster describes clinical boundaries."
      },
      "paths": [
        "lib/domain/",
        "lib/domain/documents/patient-import-decision.ts"
      ],
      "docs": [
        "docs/clinical-write-roster.md",
        "ARCHITECTURE.md"
      ],
      "adrs": [
        "0051",
        "0086"
      ],
      "conditions": [
        {
          "text": {
            "it": "Le quattro funzioni generative della baseline documentata producono proposte e non applicano diagnosi, terapie o altri dati clinici. La disponibilità di un processo locale non dimostra prontezza clinica.",
            "en": "The four generative functions in the documented baseline produce proposals and do not apply diagnoses, treatments or other clinical data. An available local process does not establish clinical readiness."
          },
          "source": {
            "path": "docs/known-limitations.md",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/known-limitations.md"
          },
          "quote": "Nessuno dei percorsi applica diagnosi, terapie o altri dati clinici. Ollama e ATHENA/MLX sono provider locali assegnati a funzioni specifiche: non vi sono un provider generico o un ripiego silenzioso, e trovare un processo disponibile non equivale a dimostrarne la prontezza per l'uso clinico."
        }
      ],
      "steps": [
        {
          "title": {
            "it": "Validare",
            "en": "Validate"
          },
          "description": {
            "it": "Si controllano dati e decisione esplicita.",
            "en": "Data and the explicit decision are checked."
          },
          "path": "lib/domain/documents/patient-import-decision.ts",
          "source": {
            "path": "lib/domain/documents/patient-import-decision.ts",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/domain/documents/patient-import-decision.ts"
          }
        },
        {
          "title": {
            "it": "Autorizzare",
            "en": "Authorise"
          },
          "description": {
            "it": "Il servizio applica il contratto dell’operazione.",
            "en": "The service applies the operation contract."
          },
          "path": "lib/domain/",
          "source": {
            "path": "lib/domain/",
            "url": "https://github.com/Wulfgardr/mediflow/tree/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/domain"
          }
        },
        {
          "title": {
            "it": "Registrare",
            "en": "Record"
          },
          "description": {
            "it": "La scrittura segue il proprio percorso con controlli ed audit.",
            "en": "Recording follows its own path with checks and audit."
          },
          "path": "docs/clinical-write-roster.md",
          "source": {
            "path": "docs/clinical-write-roster.md",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/clinical-write-roster.md"
          }
        }
      ],
      "position": {
        "x": 11.28921568627451,
        "y": 2.1225490196078436
      },
      "sources": [
        {
          "path": "lib/domain/",
          "url": "https://github.com/Wulfgardr/mediflow/tree/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/domain"
        },
        {
          "path": "lib/domain/documents/patient-import-decision.ts",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/domain/documents/patient-import-decision.ts"
        }
      ],
      "documents": [
        {
          "path": "docs/clinical-write-roster.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/clinical-write-roster.md"
        },
        {
          "path": "ARCHITECTURE.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/ARCHITECTURE.md"
        }
      ],
      "decisions": [
        {
          "path": "docs/adr/0051-patient-import-decision-contract-between-review-and-persistence.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0051-patient-import-decision-contract-between-review-and-persistence.md"
        },
        {
          "path": "docs/adr/0086-intelligent-scaffold-and-graded-automation-boundary.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0086-intelligent-scaffold-and-graded-automation-boundary.md"
        }
      ],
      "fileCount": 123
    },
    {
      "id": "database",
      "code": "07",
      "kind": "store",
      "title": {
        "it": "Archivio e migrazioni",
        "en": "Archive and migrations"
      },
      "summary": {
        "it": "Conserva i dati e controlla la struttura dell’archivio all’apertura.",
        "en": "Stores data and checks the archive structure when opening it."
      },
      "what": {
        "it": "L’archivio locale conserva il dato autorevole. Prima di aprirlo o aggiornarne la struttura, il sistema verifica condizioni e possibilità di recupero. Il codice delle migrazioni racconta anche le trasformazioni storiche.",
        "en": "The local archive holds authoritative data. Before opening it or updating its structure, the system checks conditions and recoverability. Migration code also records historical transformations."
      },
      "how": {
        "it": "SQLite, dichiarazioni Drizzle ed apertura versionata. Le migrazioni SQL storiche sono distinte dall’inizializzatore runtime corrente.",
        "en": "SQLite, Drizzle declarations and versioned opening. Historical SQL migrations are separate from the current runtime initialiser."
      },
      "paths": [
        "lib/db-server.ts",
        "lib/schema.ts",
        "lib/sqlite-schema-open.ts",
        "lib/sqlite-schema.ts",
        "drizzle/"
      ],
      "docs": [
        "docs/backup-restore-drill.md"
      ],
      "adrs": [
        "0080",
        "0138",
        "0144-archive"
      ],
      "conditions": [
        {
          "text": {
            "it": "I file SQL storici non vengono riprodotti automaticamente all’avvio. La mappa non prova un ripristino o una migrazione reale.",
            "en": "Historical SQL files are not replayed automatically at startup. The map does not prove a real restore or migration."
          },
          "source": {
            "path": "docs/adr/0080-serialize-sqlite-schema-guards-at-bootstrap.md",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0080-serialize-sqlite-schema-guards-at-bootstrap.md"
          },
          "quote": "I file `drizzle/*.sql` restano artefatti storici e non vengono replayati al runtime."
        }
      ],
      "steps": [
        {
          "title": {
            "it": "Aprire",
            "en": "Open"
          },
          "description": {
            "it": "L’apertura esplicita verifica archivio e permessi.",
            "en": "Explicit opening checks the archive and permissions."
          },
          "path": "lib/sqlite-schema-open.ts",
          "source": {
            "path": "lib/sqlite-schema-open.ts",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/sqlite-schema-open.ts"
          }
        },
        {
          "title": {
            "it": "Aggiornare",
            "en": "Upgrade"
          },
          "description": {
            "it": "La struttura segue il percorso versionato.",
            "en": "The structure follows the versioned path."
          },
          "path": "lib/sqlite-schema.ts",
          "source": {
            "path": "lib/sqlite-schema.ts",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/sqlite-schema.ts"
          }
        },
        {
          "title": {
            "it": "Conservare",
            "en": "Persist"
          },
          "description": {
            "it": "Il servizio conserva dati e storico delle operazioni.",
            "en": "The service persists data and operation history."
          },
          "path": "lib/db-server.ts",
          "source": {
            "path": "lib/db-server.ts",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/db-server.ts"
          }
        }
      ],
      "position": {
        "x": 6.622549019607843,
        "y": 16.78921568627451
      },
      "sources": [
        {
          "path": "lib/db-server.ts",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/db-server.ts"
        },
        {
          "path": "lib/schema.ts",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/schema.ts"
        },
        {
          "path": "lib/sqlite-schema-open.ts",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/sqlite-schema-open.ts"
        },
        {
          "path": "lib/sqlite-schema.ts",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/sqlite-schema.ts"
        },
        {
          "path": "drizzle/",
          "url": "https://github.com/Wulfgardr/mediflow/tree/b6d9690d97df5172519b80747ef495f1c755fc5d/drizzle"
        }
      ],
      "documents": [
        {
          "path": "docs/backup-restore-drill.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/backup-restore-drill.md"
        }
      ],
      "decisions": [
        {
          "path": "docs/adr/0080-serialize-sqlite-schema-guards-at-bootstrap.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0080-serialize-sqlite-schema-guards-at-bootstrap.md"
        },
        {
          "path": "docs/adr/0138-explicit-data-directory-bootstrap.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0138-explicit-data-directory-bootstrap.md"
        },
        {
          "path": "docs/adr/0144-archive-generation.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0144-archive-generation.md"
        }
      ],
      "fileCount": 44
    },
    {
      "id": "security",
      "code": "08",
      "kind": "gate",
      "title": {
        "it": "Accesso e protezione",
        "en": "Access and protection"
      },
      "summary": {
        "it": "Controlla chi può vedere o cambiare i dati e a quali condizioni.",
        "en": "Checks who can see or change data and under which conditions."
      },
      "what": {
        "it": "Sessione, ruolo attivo e conferme proteggono le operazioni. Protezione dei campi, archivio e backup hanno perimetri diversi: la presenza della cifratura non descrive da sola tutta la protezione dei dati.",
        "en": "Session, active role and confirmations protect operations. Field, archive and backup protection have different scopes: encryption alone does not describe all data protection."
      },
      "how": {
        "it": "Moduli di sicurezza ed autorizzazione. Gli ADR esplicitano ruolo attivo e conferme aggiuntive per operazioni protette.",
        "en": "Security and authorisation modules. ADRs specify active roles and additional confirmation for protected operations."
      },
      "paths": [
        "lib/security/"
      ],
      "docs": [
        "SECURITY.md",
        "docs/data-at-rest-matrix.md"
      ],
      "adrs": [
        "0097",
        "0143"
      ],
      "conditions": [
        {
          "text": {
            "it": "Il bootstrap corregge i permessi dei soli file SQLite regolari dell’utente corrente. Non corregge symlink, file altrui o permessi di cartelle personalizzate e non cifra il database.",
            "en": "Bootstrap corrects permissions only for regular SQLite files owned by the current user. It does not fix symlinks, other owners’ files or custom directory permissions, and does not encrypt the database."
          },
          "source": {
            "path": "docs/known-limitations.md",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/known-limitations.md"
          },
          "quote": "Non è una verifica degli ACL Windows né una cifratura del database."
        }
      ],
      "steps": [
        {
          "title": {
            "it": "Sessione",
            "en": "Session"
          },
          "description": {
            "it": "L’accesso deve essere valido.",
            "en": "Access must be valid."
          },
          "path": "lib/security/",
          "source": {
            "path": "lib/security/",
            "url": "https://github.com/Wulfgardr/mediflow/tree/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/security"
          }
        },
        {
          "title": {
            "it": "Ruolo",
            "en": "Role"
          },
          "description": {
            "it": "Il ruolo attivo deve permettere l’operazione.",
            "en": "The active role must allow the operation."
          },
          "path": "docs/adr/0097-active-role-session-and-step-up-authorization.md",
          "source": {
            "path": "docs/adr/0097-active-role-session-and-step-up-authorization.md",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0097-active-role-session-and-step-up-authorization.md"
          }
        },
        {
          "title": {
            "it": "Protezione",
            "en": "Protection"
          },
          "description": {
            "it": "Si applicano i controlli specifici sui dati.",
            "en": "Data-specific controls apply."
          },
          "path": "docs/data-at-rest-matrix.md",
          "source": {
            "path": "docs/data-at-rest-matrix.md",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/data-at-rest-matrix.md"
          }
        }
      ],
      "position": {
        "x": 11.455882352941176,
        "y": 11.955882352941176
      },
      "sources": [
        {
          "path": "lib/security/",
          "url": "https://github.com/Wulfgardr/mediflow/tree/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/security"
        }
      ],
      "documents": [
        {
          "path": "SECURITY.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/SECURITY.md"
        },
        {
          "path": "docs/data-at-rest-matrix.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/data-at-rest-matrix.md"
        }
      ],
      "decisions": [
        {
          "path": "docs/adr/0097-active-role-session-and-step-up-authorization.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0097-active-role-session-and-step-up-authorization.md"
        },
        {
          "path": "docs/adr/0143-strong-unlock-credential.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0143-strong-unlock-credential.md"
        }
      ],
      "fileCount": 355
    },
    {
      "id": "headless",
      "code": "09",
      "kind": "tall",
      "title": {
        "it": "Headless e MCP",
        "en": "Headless and MCP"
      },
      "summary": {
        "it": "Offre agli strumenti esterni operazioni nominate, sotto il controllo di MediFlow.",
        "en": "Offers external tools named operations under MediFlow’s control."
      },
      "what": {
        "it": "È il collegamento per lavorare con la cartella attraverso un assistente. Avere un comando disponibile non significa poter leggere o scrivere ogni dato: permessi, sessione ed operazione rimangono espliciti.",
        "en": "This is the connection for working with the record through an assistant. Having a command available does not mean every value can be read or written: permissions, session and operation remain explicit."
      },
      "how": {
        "it": "Il piano Headless descrive operazioni applicative. L’adapter MCP usa questo confine e non è un accesso diretto al database.",
        "en": "The Headless plane describes application operations. The MCP adapter uses this boundary and is not direct database access."
      },
      "paths": [
        "lib/headless/",
        "lib/headless/application-operation-registry.ts",
        "packages/mcp/src/server.ts",
        "packages/mcp/src/local-operation-server.ts"
      ],
      "docs": [
        "ARCHITECTURE.md"
      ],
      "adrs": [
        "0100",
        "0159",
        "0160"
      ],
      "conditions": [
        {
          "text": {
            "it": "L’ADR distingue progetto ed autorità: un piano o un comando non può creare permessi né applicare da solo una modifica. L’integrazione con ogni host esterno non è verificata qui.",
            "en": "The ADR separates planning from authority: a plan or command cannot create permissions or apply a change on its own. Integration with every external host is not verified here."
          },
          "source": {
            "path": "docs/adr/0100-fabric-vs-headless-semantic-plane.md",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0100-fabric-vs-headless-semantic-plane.md"
          },
          "quote": "Non può creare autorità, scegliere provider o venue, coniare conferme, né eseguire `apply`."
        }
      ],
      "steps": [
        {
          "title": {
            "it": "Intento",
            "en": "Intent"
          },
          "description": {
            "it": "L’assistente chiede un’operazione nominata.",
            "en": "The assistant requests a named operation."
          },
          "path": "packages/mcp/src/server.ts",
          "source": {
            "path": "packages/mcp/src/server.ts",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/packages/mcp/src/server.ts"
          }
        },
        {
          "title": {
            "it": "Contratto",
            "en": "Contract"
          },
          "description": {
            "it": "L’operazione deve avere un contratto e un’autorizzazione.",
            "en": "The operation needs a contract and authorisation."
          },
          "path": "lib/headless/application-operation-registry.ts",
          "source": {
            "path": "lib/headless/application-operation-registry.ts",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/headless/application-operation-registry.ts"
          }
        },
        {
          "title": {
            "it": "Esito",
            "en": "Outcome"
          },
          "description": {
            "it": "Il servizio risponde entro il perimetro ammesso.",
            "en": "The service responds within its admitted scope."
          },
          "path": "packages/mcp/src/local-operation-server.ts",
          "source": {
            "path": "packages/mcp/src/local-operation-server.ts",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/packages/mcp/src/local-operation-server.ts"
          }
        }
      ],
      "position": {
        "x": 16.28921568627451,
        "y": 7.122549019607843
      },
      "sources": [
        {
          "path": "lib/headless/",
          "url": "https://github.com/Wulfgardr/mediflow/tree/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/headless"
        },
        {
          "path": "lib/headless/application-operation-registry.ts",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/headless/application-operation-registry.ts"
        },
        {
          "path": "packages/mcp/src/server.ts",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/packages/mcp/src/server.ts"
        },
        {
          "path": "packages/mcp/src/local-operation-server.ts",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/packages/mcp/src/local-operation-server.ts"
        }
      ],
      "documents": [
        {
          "path": "ARCHITECTURE.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/ARCHITECTURE.md"
        }
      ],
      "decisions": [
        {
          "path": "docs/adr/0100-fabric-vs-headless-semantic-plane.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0100-fabric-vs-headless-semantic-plane.md"
        },
        {
          "path": "docs/adr/0159-plugin-local-ui-navigation.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0159-plugin-local-ui-navigation.md"
        },
        {
          "path": "docs/adr/0160-mediflow-in-desktop-chat.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0160-mediflow-in-desktop-chat.md"
        }
      ],
      "fileCount": 37
    },
    {
      "id": "native",
      "code": "10",
      "kind": "screen",
      "title": {
        "it": "Client nativi",
        "en": "Native clients"
      },
      "summary": {
        "it": "Adatta la cartella agli ambienti nativi con contratti condivisi.",
        "en": "Adapts the record to native environments through shared contracts."
      },
      "what": {
        "it": "Le app Apple condividono parti dell’interfaccia e del collegamento alla postazione che conserva i dati. Il progetto comprende anche un’altra applicazione per computer. La presenza del codice non attesta una distribuzione pronta.",
        "en": "Apple apps share interface and connection code for the workstation that holds the data. The project also includes another desktop application. Source presence does not establish ready distribution."
      },
      "how": {
        "it": "SwiftUI e libreria Apple condivisa in native/. L’ADR 0145 descrive il client Rust/GPUI collegato ai servizi della postazione.",
        "en": "SwiftUI and the shared Apple library live in native/. ADR 0145 describes the Rust/GPUI client connected to workstation services."
      },
      "paths": [
        "native/",
        "native/README.md",
        "experiments/gpui-patient-pilot/client/src/lib.rs"
      ],
      "docs": [
        "docs/native-setup.md",
        "docs/native-testing.md"
      ],
      "adrs": [
        "0145",
        "0005"
      ],
      "conditions": [
        {
          "text": {
            "it": "La baseline di accessibilità citata non equivale a VoiceOver verificato su iPhone o iPad, né a una prova su dispositivi fisici o ad idoneità App Store.",
            "en": "The cited accessibility baseline does not establish verified VoiceOver on iPhone or iPad, physical-device testing or App Store readiness."
          },
          "source": {
            "path": "docs/known-limitations.md",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/known-limitations.md"
          },
          "quote": "VoiceOver verificato su iPhone o iPad"
        }
      ],
      "steps": [
        {
          "title": {
            "it": "Interfaccia nativa",
            "en": "Native interface"
          },
          "description": {
            "it": "La vista si adatta alla piattaforma.",
            "en": "The view adapts to the platform."
          },
          "path": "native/",
          "source": {
            "path": "native/",
            "url": "https://github.com/Wulfgardr/mediflow/tree/b6d9690d97df5172519b80747ef495f1c755fc5d/native"
          }
        },
        {
          "title": {
            "it": "Contratto condiviso",
            "en": "Shared contract"
          },
          "description": {
            "it": "Le operazioni attraversano contratti documentati.",
            "en": "Operations pass through documented contracts."
          },
          "path": "native/README.md",
          "source": {
            "path": "native/README.md",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/native/README.md"
          }
        },
        {
          "title": {
            "it": "Postazione dati",
            "en": "Data workstation"
          },
          "description": {
            "it": "Il client collegato usa i servizi della postazione.",
            "en": "The connected client uses workstation services."
          },
          "path": "docs/adr/0145-rust-gpui-connected-client.md",
          "source": {
            "path": "docs/adr/0145-rust-gpui-connected-client.md",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0145-rust-gpui-connected-client.md"
          }
        }
      ],
      "position": {
        "x": 11.622549019607845,
        "y": 21.78921568627451
      },
      "sources": [
        {
          "path": "native/",
          "url": "https://github.com/Wulfgardr/mediflow/tree/b6d9690d97df5172519b80747ef495f1c755fc5d/native"
        },
        {
          "path": "native/README.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/native/README.md"
        },
        {
          "path": "experiments/gpui-patient-pilot/client/src/lib.rs",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/experiments/gpui-patient-pilot/client/src/lib.rs"
        }
      ],
      "documents": [
        {
          "path": "docs/native-setup.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/native-setup.md"
        },
        {
          "path": "docs/native-testing.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/native-testing.md"
        }
      ],
      "decisions": [
        {
          "path": "docs/adr/0145-rust-gpui-connected-client.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0145-rust-gpui-connected-client.md"
        },
        {
          "path": "docs/adr/0005-web-native-functional-parity.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0005-web-native-functional-parity.md"
        }
      ],
      "fileCount": 327
    },
    {
      "id": "reference",
      "code": "11",
      "kind": "store",
      "title": {
        "it": "Repertori e fonti",
        "en": "Catalogues and sources"
      },
      "summary": {
        "it": "Rende consultabili cataloghi con fonte e versione riconoscibili.",
        "en": "Makes catalogues available with identifiable sources and versions."
      },
      "what": {
        "it": "Farmaci, codifiche e repertori aiutano a trovare una voce. Un catalogo conserva la propria provenienza e non certifica da solo disponibilità o appropriatezza clinica.",
        "en": "Medicines, coding systems and catalogues help find an entry. A catalogue retains its provenance and does not itself certify availability or clinical appropriateness."
      },
      "how": {
        "it": "lib/reference-data raccoglie consultazione, importazione e metadati dei repertori.",
        "en": "lib/reference-data collects catalogue lookup, import and metadata."
      },
      "paths": [
        "lib/reference-data/"
      ],
      "docs": [
        "docs/known-limitations.md"
      ],
      "adrs": [
        "0125",
        "0133"
      ],
      "conditions": [
        {
          "text": {
            "it": "La copertura del feed AIFA è parziale. Le prove sintetiche non attestano l’acquisizione dell’intero feed live. Il catalogo non certifica rimborsabilità o appropriatezza.",
            "en": "AIFA feed coverage is partial. Synthetic tests do not attest acquisition of the entire live feed. The catalogue does not certify reimbursement or appropriateness."
          },
          "source": {
            "path": "docs/known-limitations.md",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/known-limitations.md"
          },
          "quote": "Le prove sintetiche non attestano l'acquisizione dell'intero feed live."
        }
      ],
      "steps": [
        {
          "title": {
            "it": "Fonte",
            "en": "Source"
          },
          "description": {
            "it": "Ogni repertorio dichiara la propria provenienza.",
            "en": "Each catalogue declares its source."
          },
          "path": "lib/reference-data/",
          "source": {
            "path": "lib/reference-data/",
            "url": "https://github.com/Wulfgardr/mediflow/tree/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/reference-data"
          }
        },
        {
          "title": {
            "it": "Aggiornamento esplicito",
            "en": "Explicit update"
          },
          "description": {
            "it": "Il download AIFA segue il consenso e i controlli previsti.",
            "en": "AIFA download follows the required consent and checks."
          },
          "path": "docs/adr/0125-explicit-aifa-catalog-download.md",
          "source": {
            "path": "docs/adr/0125-explicit-aifa-catalog-download.md",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0125-explicit-aifa-catalog-download.md"
          }
        },
        {
          "title": {
            "it": "Consultazione",
            "en": "Lookup"
          },
          "description": {
            "it": "Le voci aiutano la selezione, senza sostituire il giudizio clinico.",
            "en": "Entries assist selection without replacing clinical judgement."
          },
          "path": "lib/reference-data/",
          "source": {
            "path": "lib/reference-data/",
            "url": "https://github.com/Wulfgardr/mediflow/tree/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/reference-data"
          }
        }
      ],
      "position": {
        "x": 16.455882352941178,
        "y": 16.955882352941178
      },
      "sources": [
        {
          "path": "lib/reference-data/",
          "url": "https://github.com/Wulfgardr/mediflow/tree/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/reference-data"
        }
      ],
      "documents": [
        {
          "path": "docs/known-limitations.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/known-limitations.md"
        }
      ],
      "decisions": [
        {
          "path": "docs/adr/0125-explicit-aifa-catalog-download.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0125-explicit-aifa-catalog-download.md"
        },
        {
          "path": "docs/adr/0133-local-prosthetics-catalog-import.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0133-local-prosthetics-catalog-import.md"
        }
      ],
      "fileCount": 64
    },
    {
      "id": "tests",
      "code": "12",
      "kind": "cards",
      "title": {
        "it": "Test e prove",
        "en": "Tests and evidence"
      },
      "summary": {
        "it": "Rende ripetibili i controlli sui comportamenti e sui confini del codice.",
        "en": "Makes behaviour and code-boundary checks repeatable."
      },
      "what": {
        "it": "Prove automatiche percorrono l’interfaccia con dati inventati e controllano casi ammessi e rifiutati. I controlli sull’architettura verificano dipendenze e confini. Un file di test presente non dimostra che sia passato su questa revisione.",
        "en": "Automated tests exercise the interface with invented data and check allowed and denied cases. Architecture checks inspect dependencies and boundaries. A test file’s presence does not prove it passed at this revision."
      },
      "how": {
        "it": "E2E Playwright, test accanto ai moduli e script di controllo. Le prove eseguite devono nominare revisione ed ambiente.",
        "en": "Playwright E2E, tests beside modules and check scripts. Executed evidence must name its revision and environment."
      },
      "paths": [
        "e2e/",
        "scripts/",
        "lib/domain/documents/patient-document-review.test.ts"
      ],
      "docs": [
        "CONTRIBUTING.md",
        "docs/development-usage.md"
      ],
      "adrs": [
        "0130"
      ],
      "conditions": [
        {
          "text": {
            "it": "Non è registrato un benchmark per accuratezza OCR, qualità dei provider, latenza o throughput. I test locali dei contratti non sostituiscono la suite finale sulla revisione esatta.",
            "en": "No benchmark is recorded for OCR accuracy, provider quality, latency or throughput. Local contract tests do not replace the final suite at the exact revision."
          },
          "source": {
            "path": "docs/known-limitations.md",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/known-limitations.md"
          },
          "quote": "Non è registrato un benchmark per accuratezza OCR, qualità dei provider, latenza o throughput. I test locali dei contratti non consentono quindi di dichiarare prestazioni e non sostituiscono la suite finale sulla revisione esatta."
        }
      ],
      "steps": [
        {
          "title": {
            "it": "Condizioni",
            "en": "Conditions"
          },
          "description": {
            "it": "Si fissa il comportamento atteso ed il perimetro.",
            "en": "Expected behaviour and scope are fixed."
          },
          "path": "CONTRIBUTING.md",
          "source": {
            "path": "CONTRIBUTING.md",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/CONTRIBUTING.md"
          }
        },
        {
          "title": {
            "it": "Esecuzione",
            "en": "Execution"
          },
          "description": {
            "it": "I test usano archivi e dati sintetici.",
            "en": "Tests use synthetic archives and data."
          },
          "path": "e2e/",
          "source": {
            "path": "e2e/",
            "url": "https://github.com/Wulfgardr/mediflow/tree/b6d9690d97df5172519b80747ef495f1c755fc5d/e2e"
          }
        },
        {
          "title": {
            "it": "Evidenze",
            "en": "Evidence"
          },
          "description": {
            "it": "L’esito si riferisce al codice ed all’ambiente provati.",
            "en": "The outcome refers to the tested code and environment."
          },
          "path": "docs/development-usage.md",
          "source": {
            "path": "docs/development-usage.md",
            "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/development-usage.md"
          }
        }
      ],
      "position": {
        "x": 21.28921568627451,
        "y": 12.122549019607845
      },
      "sources": [
        {
          "path": "e2e/",
          "url": "https://github.com/Wulfgardr/mediflow/tree/b6d9690d97df5172519b80747ef495f1c755fc5d/e2e"
        },
        {
          "path": "scripts/",
          "url": "https://github.com/Wulfgardr/mediflow/tree/b6d9690d97df5172519b80747ef495f1c755fc5d/scripts"
        },
        {
          "path": "lib/domain/documents/patient-document-review.test.ts",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/lib/domain/documents/patient-document-review.test.ts"
        }
      ],
      "documents": [
        {
          "path": "CONTRIBUTING.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/CONTRIBUTING.md"
        },
        {
          "path": "docs/development-usage.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/development-usage.md"
        }
      ],
      "decisions": [
        {
          "path": "docs/adr/0130-node-test-data-dir-preflight.md",
          "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/adr/0130-node-test-data-dir-preflight.md"
        }
      ],
      "fileCount": 699
    }
  ],
  "flows": [
    {
      "id": "document",
      "title": {
        "it": "Dal documento alla registrazione",
        "en": "From document to recording"
      },
      "note": {
        "it": "Percorso concettuale: estrazione → proposta → revisione → operazione esplicita di scrittura. La proposta da sola non registra diagnosi o terapie. Disponibilità e permessi dipendono dal singolo percorso.",
        "en": "Conceptual path: extraction → proposal → review → explicit write operation. A proposal alone does not record diagnoses or therapies. Availability and permissions depend on the individual workflow."
      },
      "nodes": [
        "documents",
        "fabric",
        "review",
        "domain",
        "database"
      ]
    },
    {
      "id": "read",
      "title": {
        "it": "Consultare la cartella",
        "en": "Read the record"
      },
      "note": {
        "it": "Percorso concettuale di una richiesta autenticata: interfaccia, ingressi, controlli di accesso ed archivio. Non è una traccia di una sessione clinica.",
        "en": "Conceptual path of an authenticated request: interface, entry points, access checks and archive. This is not a trace of a clinical session."
      },
      "nodes": [
        "components",
        "routes",
        "security",
        "database"
      ]
    },
    {
      "id": "agent",
      "title": {
        "it": "Una richiesta da un assistente",
        "en": "A request from an assistant"
      },
      "note": {
        "it": "Il collegamento agente attraversa operazioni nominate e controlli di autorità. Non concede accesso diretto all’archivio. I contratti non risolti possono negare l’operazione.",
        "en": "Agent access passes through named operations and authority checks. It does not grant direct archive access. Unresolved contracts can deny the operation."
      },
      "nodes": [
        "headless",
        "security",
        "domain"
      ]
    }
  ],
  "guide": [
    {
      "path": "README.md",
      "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/README.md"
    },
    {
      "path": "docs/start-here.md",
      "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/start-here.md"
    },
    {
      "path": "ARCHITECTURE.md",
      "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/ARCHITECTURE.md"
    },
    {
      "path": "docs/repository-topology.md",
      "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/repository-topology.md"
    },
    {
      "path": "CONTRIBUTING.md",
      "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/CONTRIBUTING.md"
    },
    {
      "path": "scripts/inventory-first-party-code.mjs",
      "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/scripts/inventory-first-party-code.mjs"
    },
    {
      "path": "docs/native-setup.md",
      "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/native-setup.md"
    },
    {
      "path": "docs/native-testing.md",
      "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/native-testing.md"
    },
    {
      "path": "docs/known-limitations.md",
      "url": "https://github.com/Wulfgardr/mediflow/blob/b6d9690d97df5172519b80747ef495f1c755fc5d/docs/known-limitations.md"
    }
  ]
}
