# pmkaulani/sha-pmt-reform architecture

> Architecture diagram of the GitHub repository pmkaulani/sha-pmt-reform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pmkaulani/sha-pmt-reform
- Repository: https://github.com/pmkaulani/sha-pmt-reform

## Overview

SHA PMT v2.1 is presented as an interactive MVP for assessing household contributions with an AGI means-testing model, alongside fraud-risk analysis and revenue projections. A household enters information in the web app; the model is intended to produce an adjusted assessment, indigent classification, and explainable factors. The sampled code confirms the React entry point, a revenue stress-test call, and MSISDN hashing, but not the app’s full assessment wiring. Other documented capabilities are shown without asserting unsampled call paths; external data integrations are optional and dashed.

Main entry points: [`sha-mvp/src/lib/AlgorithmSimulation.js`](https://github.com/pmkaulani/sha-pmt-reform/blob/master/sha-mvp/src/lib/AlgorithmSimulation.js) (AGI calculation), [`sha-mvp/src/App.jsx`](https://github.com/pmkaulani/sha-pmt-reform/blob/master/sha-mvp/src/App.jsx) (Assessment interface), [`sha-mvp/src/main.jsx`](https://github.com/pmkaulani/sha-pmt-reform/blob/master/sha-mvp/src/main.jsx) (React entry), [`sha-mvp/src/lib/hash.js`](https://github.com/pmkaulani/sha-pmt-reform/blob/master/sha-mvp/src/lib/hash.js) (MSISDN hashing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web MVP"]
  node_app["Assessment interface<br/>[App.jsx]"]
  node_entry["React entry<br/>[main.jsx]"]
end

subgraph group_model["Assessment Model"]
  node_agi["AGI calculation"]
  node_deductions["Fairness deductions"]
  node_classification["Indigent classification"]
  node_fraud["Fraud flags"]
  node_triangulation["Signal triangulation"]
  node_audit["Audit record"]
  node_hash["MSISDN hashing<br/>[hash.js]"]
end

subgraph group_insights["Risk And Impact"]
  node_factors["Assessment factors"]
  node_revenue["Revenue stress test"]
end

node_household(("Household user"))
node_data_sources["Verification sources"]
node_mno["MNO signals"]

node_household -->|"opens app"| node_entry
node_entry -->|"renders"| node_app
node_household -->|"enters details"| node_app
node_app -->|"runs stress test"| node_revenue
node_app -->|"submits assessment"| node_agi
node_agi -->|"applies adjustments"| node_deductions
node_agi -->|"classifies eligibility"| node_classification
node_agi -->|"checks risk flags"| node_fraud
node_agi -->|"returns factors"| node_factors
node_agi -->|"creates record"| node_audit
node_audit -->|"hashes identifier"| node_hash
node_data_sources -.->|"provides signals"| node_triangulation
node_mno -.->|"provides signals"| node_triangulation

click node_app "https://github.com/pmkaulani/sha-pmt-reform/blob/master/sha-mvp/src/App.jsx"
click node_entry "https://github.com/pmkaulani/sha-pmt-reform/blob/master/sha-mvp/src/main.jsx"
click node_agi "https://github.com/pmkaulani/sha-pmt-reform/blob/master/sha-mvp/src/lib/AlgorithmSimulation.js"
click node_deductions "https://github.com/pmkaulani/sha-pmt-reform/blob/master/sha-mvp/src/lib/AlgorithmSimulation.js"
click node_classification "https://github.com/pmkaulani/sha-pmt-reform/blob/master/sha-mvp/src/lib/AlgorithmSimulation.js"
click node_fraud "https://github.com/pmkaulani/sha-pmt-reform/blob/master/sha-mvp/src/lib/AlgorithmSimulation.js"
click node_triangulation "https://github.com/pmkaulani/sha-pmt-reform/blob/master/sha-mvp/src/lib/AlgorithmSimulation.js"
click node_factors "https://github.com/pmkaulani/sha-pmt-reform/blob/master/sha-mvp/src/lib/AlgorithmSimulation.js"
click node_revenue "https://github.com/pmkaulani/sha-pmt-reform/blob/master/sha-mvp/src/lib/AlgorithmSimulation.js"
click node_audit "https://github.com/pmkaulani/sha-pmt-reform/blob/master/sha-mvp/src/lib/AlgorithmSimulation.js"
click node_hash "https://github.com/pmkaulani/sha-pmt-reform/blob/master/sha-mvp/src/lib/hash.js"

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_app,node_entry,node_household toneBlue
class node_agi,node_deductions,node_classification,node_fraud,node_triangulation,node_audit,node_hash toneAmber
class node_factors,node_revenue toneMint
class node_data_sources,node_mno toneIndigo
```

## Components

### Web MVP

- [Assessment interface](https://github.com/pmkaulani/sha-pmt-reform/blob/master/sha-mvp/src/App.jsx): `sha-mvp/src/App.jsx`
- [React entry](https://github.com/pmkaulani/sha-pmt-reform/blob/master/sha-mvp/src/main.jsx): `sha-mvp/src/main.jsx`

### Assessment Model

- [AGI calculation](https://github.com/pmkaulani/sha-pmt-reform/blob/master/sha-mvp/src/lib/AlgorithmSimulation.js): `sha-mvp/src/lib/AlgorithmSimulation.js`
- [Fairness deductions](https://github.com/pmkaulani/sha-pmt-reform/blob/master/sha-mvp/src/lib/AlgorithmSimulation.js): `sha-mvp/src/lib/AlgorithmSimulation.js`
- [Indigent classification](https://github.com/pmkaulani/sha-pmt-reform/blob/master/sha-mvp/src/lib/AlgorithmSimulation.js): `sha-mvp/src/lib/AlgorithmSimulation.js`
- [Fraud flags](https://github.com/pmkaulani/sha-pmt-reform/blob/master/sha-mvp/src/lib/AlgorithmSimulation.js): `sha-mvp/src/lib/AlgorithmSimulation.js`
- [Signal triangulation](https://github.com/pmkaulani/sha-pmt-reform/blob/master/sha-mvp/src/lib/AlgorithmSimulation.js): `sha-mvp/src/lib/AlgorithmSimulation.js`
- [Audit record](https://github.com/pmkaulani/sha-pmt-reform/blob/master/sha-mvp/src/lib/AlgorithmSimulation.js): `sha-mvp/src/lib/AlgorithmSimulation.js`
- [MSISDN hashing](https://github.com/pmkaulani/sha-pmt-reform/blob/master/sha-mvp/src/lib/hash.js): `sha-mvp/src/lib/hash.js`

### Risk And Impact

- [Assessment factors](https://github.com/pmkaulani/sha-pmt-reform/blob/master/sha-mvp/src/lib/AlgorithmSimulation.js): `sha-mvp/src/lib/AlgorithmSimulation.js`
- [Revenue stress test](https://github.com/pmkaulani/sha-pmt-reform/blob/master/sha-mvp/src/lib/AlgorithmSimulation.js): `sha-mvp/src/lib/AlgorithmSimulation.js`

### Other components

- **Household user**
- **Verification sources**
- **MNO signals**

## Connections

- Household user → React entry: opens app
- React entry → Assessment interface: renders
- Household user → Assessment interface: enters details
- Assessment interface → Revenue stress test: runs stress test
- Assessment interface → AGI calculation: submits assessment
- AGI calculation → Fairness deductions: applies adjustments
- AGI calculation → Indigent classification: classifies eligibility
- AGI calculation → Fraud flags: checks risk flags
- AGI calculation → Assessment factors: returns factors
- AGI calculation → Audit record: creates record
- Audit record → MSISDN hashing: hashes identifier
- Verification sources → Signal triangulation: provides signals
- MNO signals → Signal triangulation: provides signals
