# sachinkumar-a/edith-vulnerability-triage architecture

> Architecture diagram of the GitHub repository sachinkumar-a/edith-vulnerability-triage, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sachinkumar-a/edith-vulnerability-triage
- Repository: https://github.com/sachinkumar-a/edith-vulnerability-triage

## Overview

#### Purpose and entry points
Offline personalized vulnerability triage: it filters bundled CVE-product records against an organization profile, assigns action bands, orders results, and explains five recommended decisions. Primary entry points are CLI (`cli.py`), Streamlit UI (`app.py`), and an HTTP API (`api/main.py`); all should converge on the core engine.

#### Core domain normalization
Internal domain models normalize both the shipped compact schema and the Appendix-A-style schema, preserving missing fields rather than inventing defaults. Data loading reads vulnerability rows, profiles, aliases, and optional richer version metadata.
- `src/models.py`
- `src/loader.py`
- `vulnerabilities.csv`

#### Matching and inclusion boundary
Matching is the principal relevance gate. Product names are normalized and aliases resolve genuinely different names; undeclared products remain visible as excluded records. For declared products, version evaluation yields included/high-confidence, included/needs-verification, or excluded/not-affected. This boundary prevents non-profile records from entering prioritization.
- `src/matcher.py`
- `aliases.json`
- `profiles.json`

#### Triage decision and ordering
The scorer first assigns an SSVC-inspired action band—ACT, ATTEND, or TRACK—from exploitation, declared criticality, exposure where supplied, and severity. A separate weighted score orders records only within their band, using CVSS, KEV, EPSS, profile weights, and a critical-product multiplier. Risk appetite changes EPSS and CVSS thresholds.
- `src/scorer.py`
- `src/engine.py`
- `gold_set.csv`

#### Orchestration and report assembly
The engine coordinates loading-compatible records, deduplicates by CVE/product, evaluates match status, partitions included versus excluded items, ranks included decisions, and limits the visible recommendation set. It produces structured result data consumed by each presentation layer rather than embedding UI logic.
- `src/engine.py`
- `src/models.py`
- `src/explainer.py`

#### Explainability and traceability
Explanation generation turns structured decisions into plain-language titles, contributing factors, impacts, permitted safe next steps, confidence reasons, and source-row traceability. Since the shipped pack lacks descriptions and full provenance/version columns, explanations must explicitly preserve those limitations.
- `src/explainer.py`
- `vulnerabilities.csv`
- `profile_d_sample.json`

#### Presentation and service surfaces
The CLI is the baseline operational interface for profile listing, triage, comparison, negative tests, and rules display. Streamlit is a rendering-only demo over the same engine. A separate backend API and Vite/React frontend provide a web-oriented integration surface, with request code isolated in the frontend API module.
- `cli.py`
- `app.py`
- `api/main.py`
- `web/src/api.js`
- `web/src/App.jsx`

#### Runtime and infrastructure
Python runs fully offline with standard-library core execution; Streamlit is the only declared runtime dependency for the visual demo. The React/Vite frontend uses Node tooling. There is no database, network feed, API key, or external service dependency; all authoritative inputs are bundled files.
- `requirements.txt`
- `web/package.json`
- `run.py`

Main entry points: [`src/engine.py`](https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/src/engine.py) (Triage engine), [`src/loader.py`](https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/src/loader.py) (Data loader), [`src/scorer.py`](https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/src/scorer.py) (Decision scorer), [`src/explainer.py`](https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/src/explainer.py) (Decision explainer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Bundled inputs"]
  node_vulns[("Vulnerability records<br/>CSV data")]
  node_profiles["Organization profiles<br/>JSON data<br/>[profiles.json]"]
  node_aliases["Product aliases<br/>JSON data<br/>[aliases.json]"]
  node_profile_sample["Sample profile<br/>JSON data"]
  node_gold_set["Gold set<br/>CSV data<br/>[gold_set.csv]"]
end

subgraph group_core["Core triage engine"]
  node_models["Domain models<br/>normalization<br/>[models.py]"]
  node_loader["Data loader<br/>ingestion<br/>[loader.py]"]
  node_matcher["Profile matcher<br/>relevance gate<br/>[matcher.py]"]
  node_scorer["Decision scorer<br/>triage policy<br/>[scorer.py]"]
  node_explainer["Decision explainer<br/>traceability<br/>[explainer.py]"]
  node_engine{{"Triage engine<br/>orchestrator<br/>[engine.py]"}}
end

subgraph group_surfaces["Presentation surfaces"]
  node_cli["CLI<br/>Python interface<br/>[cli.py]"]
  node_streamlit["Streamlit demo<br/>rendering UI<br/>[app.py]"]
  node_python_runtime["Offline Python runtime<br/>[requirements.txt]"]
  node_runner["Runtime launcher<br/>entry runner<br/>[run.py]"]
end

subgraph group_web["Web integration"]
  node_api["HTTP API<br/>Python backend<br/>[main.py]"]
  node_frontend_api["Frontend API client<br/>request module<br/>[api.js]"]
  node_react_app["React/Vite frontend<br/>web UI<br/>[App.jsx]"]
  node_node_runtime["Node frontend tooling<br/>runtime<br/>[package.json]"]
end

node_vulns -->|"loads"| node_loader
node_profiles -->|"loads"| node_loader
node_aliases -->|"loads"| node_loader
node_models -->|"normalizes"| node_loader
node_loader -->|"compatible records"| node_engine
node_models -->|"structured records"| node_engine
node_engine -->|"evaluates profile relevance"| node_matcher
node_matcher -->|"inclusion status"| node_engine
node_engine -->|"included records"| node_scorer
node_scorer -->|"band and within-band rank"| node_engine
node_engine -->|"structured decisions"| node_explainer
node_explainer -->|"explanations and traceability"| node_engine
node_profile_sample -.->|"data limitations"| node_explainer
node_gold_set -.->|"decision reference"| node_scorer
node_cli -->|"triage commands"| node_engine
node_streamlit -->|"renders results"| node_engine
node_api -->|"triage requests"| node_engine
node_react_app -->|"uses"| node_frontend_api
node_frontend_api -->|"HTTP requests"| node_api
node_runner -.->|"launches"| node_cli
node_python_runtime -.->|"supports"| node_streamlit
node_node_runtime -.->|"builds and runs"| node_react_app

click node_vulns "https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/vulnerabilities.csv"
click node_profiles "https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/profiles.json"
click node_aliases "https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/aliases.json"
click node_profile_sample "https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/profile_d_sample.json"
click node_gold_set "https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/gold_set.csv"
click node_models "https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/src/models.py"
click node_loader "https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/src/loader.py"
click node_matcher "https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/src/matcher.py"
click node_scorer "https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/src/scorer.py"
click node_explainer "https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/src/explainer.py"
click node_engine "https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/src/engine.py"
click node_cli "https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/cli.py"
click node_streamlit "https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/app.py"
click node_api "https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/api/main.py"
click node_frontend_api "https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/web/src/api.js"
click node_react_app "https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/web/src/App.jsx"
click node_python_runtime "https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/requirements.txt"
click node_node_runtime "https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/web/package.json"
click node_runner "https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/run.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_vulns,node_profiles,node_aliases,node_profile_sample,node_gold_set toneBlue
class node_models,node_loader,node_matcher,node_scorer,node_explainer,node_engine toneAmber
class node_cli,node_streamlit,node_python_runtime,node_runner toneMint
class node_api,node_frontend_api,node_react_app,node_node_runtime toneRose
```

## Components

### Bundled inputs

Offline authoritative data pack.

- [Vulnerability records](https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/vulnerabilities.csv): CSV data · `vulnerabilities.csv`
- [Organization profiles](https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/profiles.json): JSON data · `profiles.json`
- [Product aliases](https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/aliases.json): JSON data · `aliases.json`
- [Sample profile](https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/profile_d_sample.json): JSON data · Illustrates source-data limitations used in explanations. · `profile_d_sample.json`
- [Gold set](https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/gold_set.csv): CSV data · `gold_set.csv`

### Core triage engine

Shared decision pipeline.

- [Domain models](https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/src/models.py): normalization · Normalizes compact and Appendix-A-style records while preserving missing fields. · `src/models.py`
- [Data loader](https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/src/loader.py): ingestion · Loads records, profiles, aliases, and optional version metadata. · `src/loader.py`
- [Profile matcher](https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/src/matcher.py): relevance gate · Resolves names and versions into included, verification, or excluded status. · `src/matcher.py`
- [Decision scorer](https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/src/scorer.py): triage policy · Assigns action bands and ranks only within each band. · `src/scorer.py`
- [Decision explainer](https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/src/explainer.py): traceability · Builds recommendations, confidence reasons, limitations, and source-row traceability. · `src/explainer.py`
- [Triage engine](https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/src/engine.py): orchestrator · Deduplicates, gates, ranks, and limits structured recommendations. · `src/engine.py`

### Presentation surfaces

All interfaces converge on the engine.

- [CLI](https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/cli.py): Python interface · Baseline interface for triage, comparisons, negative tests, and rules. · `cli.py`
- [Streamlit demo](https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/app.py): rendering UI · Rendering-only view over the shared engine. · `app.py`
- [Offline Python runtime](https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/requirements.txt): runtime · Standard-library core; Streamlit is the visual-demo dependency. · `requirements.txt`
- [Runtime launcher](https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/run.py): entry runner · `run.py`

### Web integration

Separate API and React client.

- [HTTP API](https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/api/main.py): Python backend · `api/main.py`
- [Frontend API client](https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/web/src/api.js): request module · Isolates browser request code. · `web/src/api.js`
- [React/Vite frontend](https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/web/src/App.jsx): web UI · `web/src/App.jsx`
- [Node frontend tooling](https://github.com/sachinkumar-a/edith-vulnerability-triage/blob/main/web/package.json): runtime · `web/package.json`

## Connections

- Vulnerability records → Data loader: loads
- Organization profiles → Data loader: loads
- Product aliases → Data loader: loads
- Domain models → Data loader: normalizes
- Data loader → Triage engine: compatible records
- Domain models → Triage engine: structured records
- Triage engine → Profile matcher: evaluates profile relevance
- Profile matcher → Triage engine: inclusion status
- Triage engine → Decision scorer: included records
- Decision scorer → Triage engine: band and within-band rank
- Triage engine → Decision explainer: structured decisions
- Decision explainer → Triage engine: explanations and traceability
- Sample profile → Decision explainer: data limitations
- Gold set → Decision scorer: decision reference
- CLI → Triage engine: triage commands
- Streamlit demo → Triage engine: renders results
- HTTP API → Triage engine: triage requests
- React/Vite frontend → Frontend API client: uses
- Frontend API client → HTTP API: HTTP requests
- Runtime launcher → CLI: launches
- Offline Python runtime → Streamlit demo: supports
- Node frontend tooling → React/Vite frontend: builds and runs
