# pradnyadange/h26_softerror_trustledger architecture

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

- Interactive diagram: https://gitdiagram.com/pradnyadange/h26_softerror_trustledger
- Repository: https://github.com/pradnyadange/h26_softerror_trustledger

## Overview

Dependency Exit Capsule assesses at-risk Python dependencies and packages factual findings with a proposed migration and differential-test evidence. The user-facing workflow is a Streamlit dashboard for inspecting scan results and saved capsules; the command-line tools provide risk scanning, AST usage mapping, replacement proposals, differential testing, and capsule assembly. The excerpts show these as separate tools but do not establish an orchestrator connecting them, so the graph preserves the stages without inventing a pipeline. Some dashboard and CLI behavior is only partially excerpted.

Main entry points: [`dependency-exit-capsule/scripts/scan_risk.py`](https://github.com/pradnyadange/h26_softerror_trustledger/blob/main/dependency-exit-capsule/scripts/scan_risk.py) (Risk Scanner), [`dependency-exit-capsule/scripts/propose_replacement.py`](https://github.com/pradnyadange/h26_softerror_trustledger/blob/main/dependency-exit-capsule/scripts/propose_replacement.py) (Replacement Proposer), [`dependency-exit-capsule/app.py`](https://github.com/pradnyadange/h26_softerror_trustledger/blob/main/dependency-exit-capsule/app.py) (Capsule Dashboard), [`dependency-exit-capsule/scripts/build_capsule.py`](https://github.com/pradnyadange/h26_softerror_trustledger/blob/main/dependency-exit-capsule/scripts/build_capsule.py) (Capsule Builder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Inspection UI"]
  node_dashboard["Capsule Dashboard<br/>[app.py]"]
end

subgraph group_analysis["Dependency Analysis"]
  node_risk_scan["Risk Scanner<br/>[scan_risk.py]"]
  node_usage_map["AST Usage Mapper<br/>[map_usage.py]"]
end

subgraph group_migration["Migration Validation"]
  node_replacement["Replacement Proposer"]
  node_diff_tests["Differential Tests<br/>[run_diff_tests.py]"]
end

subgraph group_artifacts["Capsule Artifacts"]
  node_saved_capsules["Saved Capsules"]
  node_capsule_builder["Capsule Builder<br/>[build_capsule.py]"]
  node_capsule_schema["Capsule Schema"]
end

node_user(("Engineer"))
node_pypi["PyPI"]
node_github["GitHub API"]
node_model_service["Model Service"]

node_user -->|"inspects"| node_dashboard
node_dashboard -->|"loads"| node_saved_capsules
node_risk_scan -->|"queries"| node_pypi
node_risk_scan -->|"queries"| node_github
node_replacement -->|"validates package"| node_pypi
node_replacement -->|"requests proposal"| node_model_service
node_capsule_builder -->|"validates against"| node_capsule_schema

click node_dashboard "https://github.com/pradnyadange/h26_softerror_trustledger/blob/main/dependency-exit-capsule/app.py"
click node_saved_capsules "https://github.com/pradnyadange/h26_softerror_trustledger/tree/main/dependency-exit-capsule/assets"
click node_risk_scan "https://github.com/pradnyadange/h26_softerror_trustledger/blob/main/dependency-exit-capsule/scripts/scan_risk.py"
click node_usage_map "https://github.com/pradnyadange/h26_softerror_trustledger/blob/main/dependency-exit-capsule/scripts/map_usage.py"
click node_replacement "https://github.com/pradnyadange/h26_softerror_trustledger/blob/main/dependency-exit-capsule/scripts/propose_replacement.py"
click node_diff_tests "https://github.com/pradnyadange/h26_softerror_trustledger/blob/main/dependency-exit-capsule/scripts/run_diff_tests.py"
click node_capsule_builder "https://github.com/pradnyadange/h26_softerror_trustledger/blob/main/dependency-exit-capsule/scripts/build_capsule.py"
click node_capsule_schema "https://github.com/pradnyadange/h26_softerror_trustledger/blob/main/dependency-exit-capsule/references/capsule-schema.json"

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_dashboard toneBlue
class node_risk_scan,node_usage_map toneAmber
class node_replacement,node_diff_tests,node_github toneMint
class node_saved_capsules,node_capsule_builder,node_capsule_schema toneRose
class node_user,node_pypi,node_model_service toneIndigo
```

## Components

### Inspection UI

- [Capsule Dashboard](https://github.com/pradnyadange/h26_softerror_trustledger/blob/main/dependency-exit-capsule/app.py): `dependency-exit-capsule/app.py`

### Dependency Analysis

- [Risk Scanner](https://github.com/pradnyadange/h26_softerror_trustledger/blob/main/dependency-exit-capsule/scripts/scan_risk.py): `dependency-exit-capsule/scripts/scan_risk.py`
- [AST Usage Mapper](https://github.com/pradnyadange/h26_softerror_trustledger/blob/main/dependency-exit-capsule/scripts/map_usage.py): `dependency-exit-capsule/scripts/map_usage.py`

### Migration Validation

- [Replacement Proposer](https://github.com/pradnyadange/h26_softerror_trustledger/blob/main/dependency-exit-capsule/scripts/propose_replacement.py): `dependency-exit-capsule/scripts/propose_replacement.py`
- [Differential Tests](https://github.com/pradnyadange/h26_softerror_trustledger/blob/main/dependency-exit-capsule/scripts/run_diff_tests.py): `dependency-exit-capsule/scripts/run_diff_tests.py`

### Capsule Artifacts

- [Saved Capsules](https://github.com/pradnyadange/h26_softerror_trustledger/tree/main/dependency-exit-capsule/assets): `dependency-exit-capsule/assets`
- [Capsule Builder](https://github.com/pradnyadange/h26_softerror_trustledger/blob/main/dependency-exit-capsule/scripts/build_capsule.py): `dependency-exit-capsule/scripts/build_capsule.py`
- [Capsule Schema](https://github.com/pradnyadange/h26_softerror_trustledger/blob/main/dependency-exit-capsule/references/capsule-schema.json): `dependency-exit-capsule/references/capsule-schema.json`

### Other components

- **Engineer**
- **PyPI**
- **GitHub API**
- **Model Service**

## Connections

- Engineer → Capsule Dashboard: inspects
- Capsule Dashboard → Saved Capsules: loads (evidence: `dependency-exit-capsule/app.py`)
- Risk Scanner → PyPI: queries (evidence: `dependency-exit-capsule/scripts/scan_risk.py`)
- Risk Scanner → GitHub API: queries (evidence: `dependency-exit-capsule/scripts/scan_risk.py`)
- Replacement Proposer → PyPI: validates package (evidence: `dependency-exit-capsule/scripts/propose_replacement.py`)
- Replacement Proposer → Model Service: requests proposal (evidence: `dependency-exit-capsule/scripts/propose_replacement.py`)
- Capsule Builder → Capsule Schema: validates against (evidence: `dependency-exit-capsule/scripts/build_capsule.py`)
