# salikawtar/responsible-ai-checkup architecture

> Architecture diagram of the GitHub repository salikawtar/responsible-ai-checkup, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/salikawtar/responsible-ai-checkup
- Repository: https://github.com/salikawtar/responsible-ai-checkup

## Overview

Responsible AI Check-up is a bilingual Streamlit app that turns a plain-language AI-system description into a traceable, rule-by-rule Canadian compliance report, followed by human review, sign-off, and PDF export. Its fixed workflow separates AI-assisted fact extraction from deterministic rule evaluation; it also estimates impact, records changes and reviewer actions, and supports a simulated Bill C-36 change. The graph follows relationships shown in the excerpts, source index, or README; some internal wiring is not shown, so uncertain links are omitted.

Main entry points: [`app/intake_screen.py`](https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/intake_screen.py) (Check-up intake), [`app/report.py`](https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/report.py) (Report builder), [`app/report_view.py`](https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/report_view.py) (Report screen), [`app/main.py`](https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/main.py) (Streamlit app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Intake and facts"]
  node_app["Streamlit app<br/>[main.py]"]
  node_intake_screen["Check-up intake<br/>[intake_screen.py]"]
  node_model["Description reader<br/>[model.py]"]
  node_registry[("System registry<br/>[registry.py]")]
  node_followup["Follow-up questions<br/>[followup.py]"]
end

subgraph group_evaluation["Rules and evaluation"]
  node_rule_packs["Canadian rule packs"]
  node_rules["Rule loader<br/>[rules.py]"]
  node_conditions["Condition matching<br/>[conditions.py]"]
  node_impact["Impact estimate<br/>[impact.py]"]
  node_checker["Rule checker<br/>[checker.py]"]
end

subgraph group_review["Report and review"]
  node_report["Report builder<br/>[report.py]"]
  node_review_logic["Review and sign-off<br/>[review.py]"]
  node_report_view["Report screen<br/>[report_view.py]"]
  node_pdf["PDF export<br/>[export_pdf.py]"]
end

subgraph group_support["Shared services"]
  node_audit[("Append-only audit log<br/>[audit.py]")]
  node_i18n["English / French text<br/>[i18n.py]"]
end

node_user(("Reviewer / user"))
node_openrouter{{"OpenRouter model"}}

node_user -->|"uses"| node_app
node_app -->|"opens intake"| node_intake_screen
node_app -->|"loads systems"| node_registry
node_app -->|"loads text"| node_i18n
node_intake_screen -->|"reads description"| node_model
node_model -->|"sends prompt"| node_openrouter
node_intake_screen -->|"saves system"| node_registry
node_intake_screen -->|"gets questions"| node_followup
node_intake_screen -->|"estimates impact"| node_impact
node_intake_screen -->|"snapshots rules"| node_review_logic
node_intake_screen -->|"logs intake"| node_audit
node_followup -->|"loads questions"| node_rules
node_followup -->|"finds missing facts"| node_conditions
node_followup -->|"checks impact facts"| node_impact
node_rules -->|"loads YAML"| node_rule_packs
node_impact -->|"loads impact config"| node_rules
node_checker -->|"gets rules"| node_rules
node_checker -->|"tests conditions"| node_conditions
node_checker -->|"uses impact level"| node_impact
node_report -->|"gets findings"| node_checker
node_report -->|"uses system facts"| node_registry
node_report -->|"applies decisions"| node_review_logic
node_report -->|"formats text"| node_i18n
node_report_view -->|"builds cards"| node_report
node_report_view -->|"records review"| node_review_logic
node_report_view -->|"saves changes"| node_registry
node_report_view -->|"logs actions"| node_audit
node_report_view -->|"offers download"| node_pdf
node_pdf -->|"exports report data"| node_report
node_pdf -->|"formats PDF text"| node_i18n

click node_app "https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/main.py"
click node_intake_screen "https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/intake_screen.py"
click node_model "https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/model.py"
click node_registry "https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/registry.py"
click node_followup "https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/followup.py"
click node_rule_packs "https://github.com/salikawtar/responsible-ai-checkup/tree/main/rules"
click node_rules "https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/rules.py"
click node_conditions "https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/conditions.py"
click node_impact "https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/impact.py"
click node_checker "https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/checker.py"
click node_report "https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/report.py"
click node_review_logic "https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/review.py"
click node_report_view "https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/report_view.py"
click node_pdf "https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/export_pdf.py"
click node_audit "https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/audit.py"
click node_i18n "https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/i18n.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_app,node_intake_screen,node_model,node_registry,node_followup,node_user toneBlue
class node_rule_packs,node_rules,node_conditions,node_impact,node_checker toneAmber
class node_report,node_review_logic,node_report_view,node_pdf,node_openrouter toneMint
class node_audit,node_i18n toneRose
```

## Components

### Intake and facts

- [Streamlit app](https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/main.py): `app/main.py`
- [Check-up intake](https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/intake_screen.py): `app/intake_screen.py`
- [Description reader](https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/model.py): `app/model.py`
- [System registry](https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/registry.py): `app/registry.py`
- [Follow-up questions](https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/followup.py): `app/followup.py`

### Rules and evaluation

- [Canadian rule packs](https://github.com/salikawtar/responsible-ai-checkup/tree/main/rules): `rules`
- [Rule loader](https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/rules.py): `app/rules.py`
- [Condition matching](https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/conditions.py): `app/conditions.py`
- [Impact estimate](https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/impact.py): `app/impact.py`
- [Rule checker](https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/checker.py): `app/checker.py`

### Report and review

- [Report builder](https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/report.py): `app/report.py`
- [Review and sign-off](https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/review.py): `app/review.py`
- [Report screen](https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/report_view.py): `app/report_view.py`
- [PDF export](https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/export_pdf.py): `app/export_pdf.py`

### Shared services

- [Append-only audit log](https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/audit.py): `app/audit.py`
- [English / French text](https://github.com/salikawtar/responsible-ai-checkup/blob/main/app/i18n.py): `app/i18n.py`

### Other components

- **Reviewer / user**
- **OpenRouter model**

## Connections

- Reviewer / user → Streamlit app: uses (evidence: `README.md`)
- Streamlit app → Check-up intake: opens intake (evidence: `app/main.py`)
- Streamlit app → System registry: loads systems (evidence: `app/main.py`)
- Streamlit app → English / French text: loads text (evidence: `app/main.py`)
- Check-up intake → Description reader: reads description (evidence: `app/intake_screen.py`)
- Description reader → OpenRouter model: sends prompt (evidence: `app/model.py`)
- Check-up intake → System registry: saves system (evidence: `app/intake_screen.py`)
- Check-up intake → Follow-up questions: gets questions (evidence: `app/intake_screen.py`)
- Check-up intake → Impact estimate: estimates impact (evidence: `app/intake_screen.py`)
- Check-up intake → Review and sign-off: snapshots rules (evidence: `app/intake_screen.py`)
- Check-up intake → Append-only audit log: logs intake (evidence: `app/intake_screen.py`)
- Follow-up questions → Rule loader: loads questions (evidence: `app/followup.py`)
- Follow-up questions → Condition matching: finds missing facts (evidence: `app/followup.py`)
- Follow-up questions → Impact estimate: checks impact facts (evidence: `app/followup.py`)
- Rule loader → Canadian rule packs: loads YAML (evidence: `app/rules.py`)
- Impact estimate → Rule loader: loads impact config (evidence: `app/impact.py`)
- Rule checker → Rule loader: gets rules (evidence: `app/checker.py`)
- Rule checker → Condition matching: tests conditions (evidence: `app/checker.py`)
- Rule checker → Impact estimate: uses impact level (evidence: `app/checker.py`)
- Report builder → Rule checker: gets findings (evidence: `app/report.py`)
- Report builder → System registry: uses system facts (evidence: `app/report.py`)
- Report builder → Review and sign-off: applies decisions (evidence: `app/report.py`)
- Report builder → English / French text: formats text (evidence: `app/report.py`)
- Report screen → Report builder: builds cards (evidence: `app/report_view.py`)
- Report screen → Review and sign-off: records review (evidence: `app/report_view.py`)
- Report screen → System registry: saves changes (evidence: `app/report_view.py`)
- Report screen → Append-only audit log: logs actions (evidence: `app/report_view.py`)
- Report screen → PDF export: offers download (evidence: `app/report_view.py`)
- PDF export → Report builder: exports report data (evidence: `app/export_pdf.py`)
- PDF export → English / French text: formats PDF text (evidence: `app/export_pdf.py`)
