# tudelft-cda-lab/catma architecture

> Architecture diagram of the GitHub repository tudelft-cda-lab/catma, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tudelft-cda-lab/catma
- Repository: https://github.com/tudelft-cda-lab/catma

## Overview

CATMA compares a static DFD model with dynamic state-machine models inferred from runtime logs. Its CLI loads configuration and models, detects static and dynamic non-conformances, generates per-finding interpretations, and produces an architecture visualization plus HTML interpretation pages. The graph follows the documented workflow and shown calls; the supplied excerpts do not expose every interpretation-generation detail, so those internal links are limited to evidenced relationships.

Main entry points: [`CATMA.py`](https://github.com/tudelft-cda-lab/catma/blob/main/CATMA.py) (CATMA CLI), [`src/non_conformance_visualizer.py`](https://github.com/tudelft-cda-lab/catma/blob/main/src/non_conformance_visualizer.py) (Architecture visualizer), [`src/utils.py`](https://github.com/tudelft-cda-lab/catma/blob/main/src/utils.py) (Model utilities), [`src/model_processor.py`](https://github.com/tudelft-cda-lab/catma/blob/main/src/model_processor.py) (Model processor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Inputs and orchestration"]
  node_cli["CATMA CLI<br/>[CATMA.py]"]
  node_configuration["Run configuration<br/>[config.json]"]
  node_interpretation_texts["Interpretation text"]
  node_static_input["Static DFD"]
  node_dynamic_input["Dynamic models"]
end

subgraph group_analysis["Model analysis"]
  node_model_processor["Model processor<br/>[model_processor.py]"]
  node_utilities["Model utilities<br/>[utils.py]"]
  node_detector["Non-conformance detector"]
end

subgraph group_interpret["Interpretation"]
  node_generator["Interpretation generator"]
end

subgraph group_presentation["Outputs"]
  node_nonconformance_visualizer["Architecture visualizer"]
  node_interpretation_visualizer["HTML visualizer"]
  node_architecture_output["Architecture diagram"]
  node_html_output["Interpretation pages"]
end

node_user(("Analyst"))
node_plantuml(("PlantUML server"))

node_user -->|"runs"| node_cli
node_static_input -->|"provides model"| node_cli
node_dynamic_input -->|"provides models"| node_cli
node_configuration -->|"configures"| node_cli
node_interpretation_texts -->|"provides text"| node_cli
node_cli -->|"reads models"| node_model_processor
node_model_processor -->|"loads and cleans"| node_utilities
node_cli -->|"detects discrepancies"| node_detector
node_detector -->|"extracts links"| node_utilities
node_cli -->|"generates interpretations"| node_generator
node_generator -->|"processes models"| node_utilities
node_cli -->|"visualizes findings"| node_nonconformance_visualizer
node_nonconformance_visualizer -->|"writes diagram"| node_architecture_output
node_nonconformance_visualizer -->|"renders diagram"| node_plantuml
node_cli -->|"renders interpretations"| node_interpretation_visualizer
node_interpretation_visualizer -->|"writes HTML"| node_html_output

click node_cli "https://github.com/tudelft-cda-lab/catma/blob/main/CATMA.py"
click node_configuration "https://github.com/tudelft-cda-lab/catma/blob/main/config/config.json"
click node_interpretation_texts "https://github.com/tudelft-cda-lab/catma/blob/main/interpretation_texts/interpretation_texts.json"
click node_model_processor "https://github.com/tudelft-cda-lab/catma/blob/main/src/model_processor.py"
click node_utilities "https://github.com/tudelft-cda-lab/catma/blob/main/src/utils.py"
click node_detector "https://github.com/tudelft-cda-lab/catma/blob/main/src/non_conformance_detector.py"
click node_generator "https://github.com/tudelft-cda-lab/catma/blob/main/src/interpretation_generator.py"
click node_nonconformance_visualizer "https://github.com/tudelft-cda-lab/catma/blob/main/src/non_conformance_visualizer.py"
click node_interpretation_visualizer "https://github.com/tudelft-cda-lab/catma/blob/main/src/interpretation_visualizer.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_configuration,node_interpretation_texts,node_static_input,node_dynamic_input toneBlue
class node_model_processor,node_utilities,node_detector toneAmber
class node_generator,node_plantuml toneMint
class node_nonconformance_visualizer,node_interpretation_visualizer,node_architecture_output,node_html_output toneRose
class node_user toneIndigo
```

## Components

### Inputs and orchestration

- [CATMA CLI](https://github.com/tudelft-cda-lab/catma/blob/main/CATMA.py): `CATMA.py`
- [Run configuration](https://github.com/tudelft-cda-lab/catma/blob/main/config/config.json): `config/config.json`
- [Interpretation text](https://github.com/tudelft-cda-lab/catma/blob/main/interpretation_texts/interpretation_texts.json): `interpretation_texts/interpretation_texts.json`
- **Static DFD**
- **Dynamic models**

### Model analysis

- [Model processor](https://github.com/tudelft-cda-lab/catma/blob/main/src/model_processor.py): `src/model_processor.py`
- [Model utilities](https://github.com/tudelft-cda-lab/catma/blob/main/src/utils.py): `src/utils.py`
- [Non-conformance detector](https://github.com/tudelft-cda-lab/catma/blob/main/src/non_conformance_detector.py): `src/non_conformance_detector.py`

### Interpretation

- [Interpretation generator](https://github.com/tudelft-cda-lab/catma/blob/main/src/interpretation_generator.py): `src/interpretation_generator.py`

### Outputs

- [Architecture visualizer](https://github.com/tudelft-cda-lab/catma/blob/main/src/non_conformance_visualizer.py): `src/non_conformance_visualizer.py`
- [HTML visualizer](https://github.com/tudelft-cda-lab/catma/blob/main/src/interpretation_visualizer.py): `src/interpretation_visualizer.py`
- **Architecture diagram**
- **Interpretation pages**

### Other components

- **Analyst**
- **PlantUML server**

## Connections

- Analyst → CATMA CLI: runs (evidence: `README.md`)
- Static DFD → CATMA CLI: provides model (evidence: `README.md`)
- Dynamic models → CATMA CLI: provides models (evidence: `README.md`)
- Run configuration → CATMA CLI: configures (evidence: `CATMA.py`)
- Interpretation text → CATMA CLI: provides text (evidence: `CATMA.py`)
- CATMA CLI → Model processor: reads models (evidence: `CATMA.py`)
- Model processor → Model utilities: loads and cleans (evidence: `src/model_processor.py`)
- CATMA CLI → Non-conformance detector: detects discrepancies (evidence: `CATMA.py`)
- Non-conformance detector → Model utilities: extracts links (evidence: `src/non_conformance_detector.py`)
- CATMA CLI → Interpretation generator: generates interpretations (evidence: `CATMA.py`)
- Interpretation generator → Model utilities: processes models (evidence: `src/interpretation_generator.py`)
- CATMA CLI → Architecture visualizer: visualizes findings (evidence: `CATMA.py`)
- Architecture visualizer → Architecture diagram: writes diagram (evidence: `src/non_conformance_visualizer.py`)
- Architecture visualizer → PlantUML server: renders diagram (evidence: `src/non_conformance_visualizer.py`)
- CATMA CLI → HTML visualizer: renders interpretations (evidence: `CATMA.py`)
- HTML visualizer → Interpretation pages: writes HTML (evidence: `src/interpretation_visualizer.py`)
