# csc131s2026/automated-conflict-of-interest-checker architecture

> Architecture diagram of the GitHub repository csc131s2026/automated-conflict-of-interest-checker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/csc131s2026/automated-conflict-of-interest-checker
- Repository: https://github.com/csc131s2026/automated-conflict-of-interest-checker

## Overview

This is a county conflict-of-interest review application: county packet collection and Form 700 disclosure matching produce flagged records, which a reviewer loads, filters, inspects, and can share by email. The graph preserves the documented scraping, workbook parsing, alternative matchers, run history, and dashboard capabilities. Edges are limited to README statements and relationships visible in the excerpts or source index; unsampled subsystem connections are omitted where ownership cannot be established.

Main entry points: [`Frontend/core/pipeline_runner.py`](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/core/pipeline_runner.py) (Pipeline runner), [`Frontend/app.py`](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/app.py) (Dashboard orchestrator), [`Frontend/ui/theme.py`](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/ui/theme.py) (Theme tokens), [`Backend/src/llmFlagging/higherSpec_openai.py`](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Backend/src/llmFlagging/higherSpec_openai.py) (OpenAI matcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Packet collection"]
  node_county_registry["County selection<br/>[county_registry.py]"]
  node_sacramento_scraper["Sacramento scraper"]
  node_sonoma_scraper["Sonoma scraper"]
  node_scraper_helpers["Scraper helpers"]
  node_preprocess["Packet preprocessing<br/>[preprocess.py]"]
end

subgraph group_analysis["Conflict analysis"]
  node_form700_parser["Form 700 parser<br/>[seven.py]"]
  node_openai_matcher["OpenAI matcher"]
  node_ollama_matcher["Ollama matcher"]
  node_base_matcher["Alternative matchers<br/>[higherSpec.py]"]
  node_lower_matcher["Lower-spec matcher<br/>[lowerSpec.py]"]
  node_form700_paths["Workbook paths<br/>[form700_paths.py]"]
  node_run_store[("Run history store<br/>[sqlite_store.py]")]
end

subgraph group_dashboard["Review dashboard"]
  node_pipeline_ui["Pipeline controls<br/>[pipeline_agent.py]"]
  node_runner["Pipeline runner<br/>[pipeline_runner.py]"]
  node_dashboard["Dashboard orchestrator<br/>[app.py]"]
  node_data_loader["Result loader<br/>[data_loader.py]"]
  node_browser["Record browser<br/>[browser_agent.py]"]
  node_filter_engine["Filtering and aggregates<br/>[filter_engine.py]"]
  node_filter_tasks["Filter tasks<br/>[filter_tasks.py]"]
  node_selection_agent["Selection controls<br/>[selection_agent.py]"]
  node_summary_agent["Summary pane<br/>[summary_agent.py]"]
  node_confidence_agent["Confidence pane"]
  node_officials_agent["Officials pane<br/>[officials_agent.py]"]
  node_email_dialog["Email report dialog<br/>[email_dialog.py]"]
  node_email_config["SMTP settings<br/>[email_config.py]"]
  node_email_sender["Email sender<br/>[email_sender.py]"]
end

subgraph group_shared["Shared services"]
  node_theme["Theme tokens<br/>[theme.py]"]
  node_output_naming["Output naming<br/>[output_naming.py]"]
  node_export_safety["Export safety<br/>[export_safety.py]"]
  node_resource_path["Resource paths<br/>[resource_path.py]"]
end

node_reviewer(("Reviewer"))

node_reviewer -->|"sets run options"| node_pipeline_ui
node_pipeline_ui -->|"starts pipeline"| node_runner
node_runner -->|"loads county options"| node_county_registry
node_runner -->|"runs analysis"| node_openai_matcher
node_runner -.->|"can scrape packets"| node_sacramento_scraper
node_runner -.->|"can scrape packets"| node_sonoma_scraper
node_sacramento_scraper -->|"uses helpers"| node_scraper_helpers
node_sonoma_scraper -->|"uses helpers"| node_scraper_helpers
node_openai_matcher -->|"uses preprocessing"| node_preprocess
node_openai_matcher -->|"parses disclosures"| node_form700_parser
node_openai_matcher -->|"resolves workbook"| node_form700_paths
node_openai_matcher -->|"stores run state"| node_run_store
node_ollama_matcher -->|"uses preprocessing"| node_preprocess
node_ollama_matcher -->|"resolves workbook"| node_form700_paths
node_base_matcher -->|"uses preprocessing"| node_preprocess
node_base_matcher -->|"resolves workbook"| node_form700_paths
node_lower_matcher -->|"uses preprocessing"| node_preprocess
node_runner -->|"names outputs"| node_output_naming
node_runner -->|"resolves resources"| node_resource_path
node_pipeline_ui -->|"resolves resources"| node_resource_path
node_runner -->|"returns result path"| node_dashboard
node_reviewer -->|"opens and reviews"| node_dashboard
node_dashboard -->|"loads result data"| node_data_loader
node_dashboard -->|"coordinates browser"| node_browser
node_dashboard -->|"computes filters"| node_filter_tasks
node_filter_tasks -->|"applies and aggregates"| node_filter_engine
node_browser -->|"uses filtering"| node_filter_engine
node_selection_agent -->|"uses filtering"| node_filter_engine
node_dashboard -->|"opens report dialog"| node_email_dialog
node_email_dialog -->|"summarizes records"| node_filter_engine
node_email_dialog -->|"loads SMTP settings"| node_email_config
node_email_dialog -->|"sends report"| node_email_sender
node_dashboard -->|"protects exports"| node_export_safety
node_browser -->|"uses theme"| node_theme
node_selection_agent -->|"uses theme"| node_theme
node_summary_agent -->|"uses theme"| node_theme
node_confidence_agent -->|"uses theme"| node_theme
node_officials_agent -->|"uses theme"| node_theme
node_email_dialog -->|"uses theme"| node_theme

click node_pipeline_ui "https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/agents/pipeline_agent.py"
click node_runner "https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/core/pipeline_runner.py"
click node_county_registry "https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Backend/src/web_scrapers/county_registry.py"
click node_sacramento_scraper "https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Backend/src/web_scrapers/scraper_sacramento_county.py"
click node_sonoma_scraper "https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Backend/src/web_scrapers/scraper_sonoma_county.py"
click node_scraper_helpers "https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Backend/src/web_scrapers/useful_functions.py"
click node_preprocess "https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Backend/src/web_scrapers/preprocess.py"
click node_form700_parser "https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Backend/src/form700_parse/seven.py"
click node_openai_matcher "https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Backend/src/llmFlagging/higherSpec_openai.py"
click node_ollama_matcher "https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Backend/src/llmFlagging/variants/higherSpec_chatollama.py"
click node_base_matcher "https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Backend/src/llmFlagging/variants/higherSpec.py"
click node_lower_matcher "https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Backend/src/llmFlagging/variants/lowerSpec.py"
click node_form700_paths "https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Backend/src/llmFlagging/form700_paths.py"
click node_run_store "https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Backend/src/storage/sqlite_store.py"
click node_dashboard "https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/app.py"
click node_data_loader "https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/core/data_loader.py"
click node_browser "https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/agents/browser_agent.py"
click node_filter_engine "https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/core/filter_engine.py"
click node_filter_tasks "https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/core/filter_tasks.py"
click node_selection_agent "https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/agents/selection_agent.py"
click node_summary_agent "https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/agents/summary_agent.py"
click node_confidence_agent "https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/agents/confidence_agent.py"
click node_officials_agent "https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/agents/officials_agent.py"
click node_email_dialog "https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/ui/email_dialog.py"
click node_email_config "https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/core/email_config.py"
click node_email_sender "https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/core/email_sender.py"
click node_theme "https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/ui/theme.py"
click node_output_naming "https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/shared/output_naming.py"
click node_export_safety "https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/shared/export_safety.py"
click node_resource_path "https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/shared/resource_path.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_county_registry,node_sacramento_scraper,node_sonoma_scraper,node_scraper_helpers,node_preprocess,node_reviewer toneBlue
class node_form700_parser,node_openai_matcher,node_ollama_matcher,node_base_matcher,node_lower_matcher,node_form700_paths,node_run_store toneAmber
class node_pipeline_ui,node_runner,node_dashboard,node_data_loader,node_browser,node_filter_engine,node_filter_tasks,node_selection_agent,node_summary_agent,node_confidence_agent,node_officials_agent,node_email_dialog,node_email_config,node_email_sender toneMint
class node_theme,node_output_naming,node_export_safety,node_resource_path toneRose
```

## Components

### Packet collection

- [County selection](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Backend/src/web_scrapers/county_registry.py): `Backend/src/web_scrapers/county_registry.py`
- [Sacramento scraper](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Backend/src/web_scrapers/scraper_sacramento_county.py): `Backend/src/web_scrapers/scraper_sacramento_county.py`
- [Sonoma scraper](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Backend/src/web_scrapers/scraper_sonoma_county.py): `Backend/src/web_scrapers/scraper_sonoma_county.py`
- [Scraper helpers](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Backend/src/web_scrapers/useful_functions.py): `Backend/src/web_scrapers/useful_functions.py`
- [Packet preprocessing](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Backend/src/web_scrapers/preprocess.py): `Backend/src/web_scrapers/preprocess.py`

### Conflict analysis

- [Form 700 parser](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Backend/src/form700_parse/seven.py): `Backend/src/form700_parse/seven.py`
- [OpenAI matcher](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Backend/src/llmFlagging/higherSpec_openai.py): `Backend/src/llmFlagging/higherSpec_openai.py`
- [Ollama matcher](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Backend/src/llmFlagging/variants/higherSpec_chatollama.py): `Backend/src/llmFlagging/variants/higherSpec_chatollama.py`
- [Alternative matchers](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Backend/src/llmFlagging/variants/higherSpec.py): `Backend/src/llmFlagging/variants/higherSpec.py`
- [Lower-spec matcher](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Backend/src/llmFlagging/variants/lowerSpec.py): `Backend/src/llmFlagging/variants/lowerSpec.py`
- [Workbook paths](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Backend/src/llmFlagging/form700_paths.py): `Backend/src/llmFlagging/form700_paths.py`
- [Run history store](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Backend/src/storage/sqlite_store.py): `Backend/src/storage/sqlite_store.py`

### Review dashboard

- [Pipeline controls](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/agents/pipeline_agent.py): `Frontend/agents/pipeline_agent.py`
- [Pipeline runner](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/core/pipeline_runner.py): `Frontend/core/pipeline_runner.py`
- [Dashboard orchestrator](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/app.py): `Frontend/app.py`
- [Result loader](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/core/data_loader.py): `Frontend/core/data_loader.py`
- [Record browser](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/agents/browser_agent.py): `Frontend/agents/browser_agent.py`
- [Filtering and aggregates](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/core/filter_engine.py): `Frontend/core/filter_engine.py`
- [Filter tasks](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/core/filter_tasks.py): `Frontend/core/filter_tasks.py`
- [Selection controls](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/agents/selection_agent.py): `Frontend/agents/selection_agent.py`
- [Summary pane](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/agents/summary_agent.py): `Frontend/agents/summary_agent.py`
- [Confidence pane](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/agents/confidence_agent.py): `Frontend/agents/confidence_agent.py`
- [Officials pane](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/agents/officials_agent.py): `Frontend/agents/officials_agent.py`
- [Email report dialog](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/ui/email_dialog.py): `Frontend/ui/email_dialog.py`
- [SMTP settings](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/core/email_config.py): `Frontend/core/email_config.py`
- [Email sender](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/core/email_sender.py): `Frontend/core/email_sender.py`

### Shared services

- [Theme tokens](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/Frontend/ui/theme.py): `Frontend/ui/theme.py`
- [Output naming](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/shared/output_naming.py): `shared/output_naming.py`
- [Export safety](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/shared/export_safety.py): `shared/export_safety.py`
- [Resource paths](https://github.com/csc131s2026/automated-conflict-of-interest-checker/blob/main/shared/resource_path.py): `shared/resource_path.py`

### Other components

- **Reviewer**

## Connections

- Reviewer → Pipeline controls: sets run options (evidence: `README.md`)
- Pipeline controls → Pipeline runner: starts pipeline (evidence: `Frontend/agents/pipeline_agent.py`)
- Pipeline runner → County selection: loads county options (evidence: `Frontend/core/pipeline_runner.py`)
- Pipeline runner → OpenAI matcher: runs analysis (evidence: `Frontend/core/pipeline_runner.py`)
- Pipeline runner → Sacramento scraper: can scrape packets (evidence: `README.md`)
- Pipeline runner → Sonoma scraper: can scrape packets (evidence: `README.md`)
- Sacramento scraper → Scraper helpers: uses helpers (evidence: `Backend/src/web_scrapers/scraper_sacramento_county.py`)
- Sonoma scraper → Scraper helpers: uses helpers (evidence: `Backend/src/web_scrapers/scraper_sonoma_county.py`)
- OpenAI matcher → Packet preprocessing: uses preprocessing (evidence: `Backend/src/llmFlagging/higherSpec_openai.py`)
- OpenAI matcher → Form 700 parser: parses disclosures (evidence: `Backend/src/llmFlagging/higherSpec_openai.py`)
- OpenAI matcher → Workbook paths: resolves workbook (evidence: `Backend/src/llmFlagging/higherSpec_openai.py`)
- OpenAI matcher → Run history store: stores run state (evidence: `Backend/src/llmFlagging/higherSpec_openai.py`)
- Ollama matcher → Packet preprocessing: uses preprocessing (evidence: `Backend/src/llmFlagging/variants/higherSpec_chatollama.py`)
- Ollama matcher → Workbook paths: resolves workbook (evidence: `Backend/src/llmFlagging/variants/higherSpec_chatollama.py`)
- Alternative matchers → Packet preprocessing: uses preprocessing (evidence: `Backend/src/llmFlagging/variants/higherSpec.py`)
- Alternative matchers → Workbook paths: resolves workbook (evidence: `Backend/src/llmFlagging/variants/higherSpec.py`)
- Lower-spec matcher → Packet preprocessing: uses preprocessing (evidence: `Backend/src/llmFlagging/variants/lowerSpec.py`)
- Pipeline runner → Output naming: names outputs (evidence: `Frontend/core/pipeline_runner.py`)
- Pipeline runner → Resource paths: resolves resources (evidence: `Frontend/core/pipeline_runner.py`)
- Pipeline controls → Resource paths: resolves resources (evidence: `Frontend/agents/pipeline_agent.py`)
- Pipeline runner → Dashboard orchestrator: returns result path
- Reviewer → Dashboard orchestrator: opens and reviews (evidence: `README.md`)
- Dashboard orchestrator → Result loader: loads result data (evidence: `Frontend/app.py`)
- Dashboard orchestrator → Record browser: coordinates browser (evidence: `Frontend/app.py`)
- Dashboard orchestrator → Filter tasks: computes filters (evidence: `Frontend/app.py`)
- Filter tasks → Filtering and aggregates: applies and aggregates (evidence: `Frontend/core/filter_tasks.py`)
- Record browser → Filtering and aggregates: uses filtering (evidence: `Frontend/agents/browser_agent.py`)
- Selection controls → Filtering and aggregates: uses filtering (evidence: `Frontend/agents/selection_agent.py`)
- Dashboard orchestrator → Email report dialog: opens report dialog (evidence: `Frontend/app.py`)
- Email report dialog → Filtering and aggregates: summarizes records (evidence: `Frontend/ui/email_dialog.py`)
- Email report dialog → SMTP settings: loads SMTP settings (evidence: `Frontend/ui/email_dialog.py`)
- Email report dialog → Email sender: sends report (evidence: `Frontend/ui/email_dialog.py`)
- Dashboard orchestrator → Export safety: protects exports (evidence: `Frontend/app.py`)
- Record browser → Theme tokens: uses theme (evidence: `Frontend/agents/browser_agent.py`)
- Selection controls → Theme tokens: uses theme (evidence: `Frontend/agents/selection_agent.py`)
- Summary pane → Theme tokens: uses theme (evidence: `Frontend/agents/summary_agent.py`)
- Confidence pane → Theme tokens: uses theme (evidence: `Frontend/agents/confidence_agent.py`)
- Officials pane → Theme tokens: uses theme (evidence: `Frontend/agents/officials_agent.py`)
- Email report dialog → Theme tokens: uses theme (evidence: `Frontend/ui/email_dialog.py`)
