# steveonw/jubilant-funicular architecture

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

- Interactive diagram: https://gitdiagram.com/steveonw/jubilant-funicular
- Repository: https://github.com/steveonw/jubilant-funicular

## Overview

PolicyTrace is an evidence-grounded policy and public-sentiment review application. Analysts load a policy and source package, run AI analysis, inspect evidence and verification, review or edit findings, and explicitly approve a leadership brief; an audit log preserves the review trail. The graph reflects the README’s documented capabilities and sampled frontend/backend orchestration. Some subsystem wiring is documented but not shown in the excerpts, so uncertain call edges are omitted.

Main entry points: [`backend/api.py`](https://github.com/steveonw/jubilant-funicular/blob/main/backend/api.py) (API Routes), [`backend/policy_intake.py`](https://github.com/steveonw/jubilant-funicular/blob/main/backend/policy_intake.py) (Source Packaging), [`backend/federal_register.py`](https://github.com/steveonw/jubilant-funicular/blob/main/backend/federal_register.py) (Policy Search), [`backend/response_sources.py`](https://github.com/steveonw/jubilant-funicular/blob/main/backend/response_sources.py) (Public Comments)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Policy Intake"]
  node_policy["Policy Search"]
  node_intakeflow["Source Packaging<br/>[policy_intake.py]"]
  node_status["Policy Freshness<br/>[policy_status.py]"]
  node_responses["Public Comments"]
  node_news["Related Reporting<br/>[news_sources.py]"]
end

subgraph group_analysis["Analysis"]
  node_interpreter["Policy Interpretation"]
  node_viewpoints["Viewpoint Analysis"]
  node_rush["Rush Analysis<br/>[rush_mode.py]"]
  node_evidence["Evidence Linking<br/>[evidence.py]"]
end

subgraph group_review["Review and Reporting"]
  node_verifier["Claim Verification<br/>[claim_verifier.py]"]
  node_guided["Human Review<br/>[guided_review.py]"]
  node_reanalysis["Selective Reanalysis"]
  node_report["Leadership Brief<br/>[api.py]"]
  node_audit["Evidence Audit Log<br/>[api.py]"]
end

subgraph group_app["Application"]
  node_browser["PolicyTrace UI<br/>[app.js]"]
  node_server["HTTP Application<br/>[run_app.py]"]
  node_api["API Routes<br/>[api.py]"]
  node_models["Analysis Models<br/>[models.py]"]
end

node_analyst(("Policy Analyst"))
node_fr["Federal Register"]
node_regulations["Regulations.gov"]
node_media["Reporting Sources"]
node_foundry["Microsoft Foundry"]

node_analyst -->|"uses"| node_browser
node_browser -->|"HTTP requests"| node_server
node_server -->|"dispatches"| node_api
node_api -->|"searches policy"| node_policy
node_policy -->|"fetches documents"| node_fr
node_api -->|"builds source package"| node_intakeflow
node_intakeflow -->|"checks freshness"| node_status
node_intakeflow -->|"retrieves comments"| node_responses
node_responses -.->|"fetches comments"| node_regulations
node_intakeflow -->|"discovers reporting"| node_news
node_news -.->|"retrieves sources"| node_media
node_api -->|"analyzes policy"| node_interpreter
node_interpreter -->|"requests analysis"| node_foundry
node_api -->|"analyzes responses"| node_viewpoints
node_viewpoints -->|"requests analysis"| node_foundry
node_api -->|"runs analysis"| node_rush
node_rush -->|"requests analysis"| node_foundry
node_api -->|"links evidence"| node_evidence
node_api -->|"verifies claims"| node_verifier
node_verifier -->|"checks support"| node_foundry
node_api -->|"applies review actions"| node_guided
node_api -->|"refreshes findings"| node_reanalysis
node_api -->|"builds approved brief"| node_report
node_api -->|"preserves review trail"| node_audit
node_api -->|"validates analysis data"| node_models

click node_browser "https://github.com/steveonw/jubilant-funicular/blob/main/frontend/app/app.js"
click node_server "https://github.com/steveonw/jubilant-funicular/blob/main/backend/run_app.py"
click node_api "https://github.com/steveonw/jubilant-funicular/blob/main/backend/api.py"
click node_models "https://github.com/steveonw/jubilant-funicular/blob/main/backend/models.py"
click node_policy "https://github.com/steveonw/jubilant-funicular/blob/main/backend/federal_register.py"
click node_intakeflow "https://github.com/steveonw/jubilant-funicular/blob/main/backend/policy_intake.py"
click node_status "https://github.com/steveonw/jubilant-funicular/blob/main/backend/policy_status.py"
click node_responses "https://github.com/steveonw/jubilant-funicular/blob/main/backend/response_sources.py"
click node_news "https://github.com/steveonw/jubilant-funicular/blob/main/backend/news_sources.py"
click node_interpreter "https://github.com/steveonw/jubilant-funicular/blob/main/backend/policy_interpreter.py"
click node_viewpoints "https://github.com/steveonw/jubilant-funicular/blob/main/backend/response_viewpoint_analyst.py"
click node_rush "https://github.com/steveonw/jubilant-funicular/blob/main/backend/rush_mode.py"
click node_evidence "https://github.com/steveonw/jubilant-funicular/blob/main/backend/evidence.py"
click node_verifier "https://github.com/steveonw/jubilant-funicular/blob/main/backend/claim_verifier.py"
click node_guided "https://github.com/steveonw/jubilant-funicular/blob/main/backend/guided_review.py"
click node_reanalysis "https://github.com/steveonw/jubilant-funicular/blob/main/backend/selective_reanalysis.py"
click node_report "https://github.com/steveonw/jubilant-funicular/blob/main/backend/api.py"
click node_audit "https://github.com/steveonw/jubilant-funicular/blob/main/backend/api.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_policy,node_intakeflow,node_status,node_responses,node_news toneBlue
class node_interpreter,node_viewpoints,node_rush,node_evidence toneAmber
class node_verifier,node_guided,node_reanalysis,node_report,node_audit toneMint
class node_browser,node_server,node_api,node_models toneRose
class node_analyst,node_fr,node_regulations,node_media,node_foundry toneIndigo
```

## Components

### Policy Intake

- [Policy Search](https://github.com/steveonw/jubilant-funicular/blob/main/backend/federal_register.py): `backend/federal_register.py`
- [Source Packaging](https://github.com/steveonw/jubilant-funicular/blob/main/backend/policy_intake.py): `backend/policy_intake.py`
- [Policy Freshness](https://github.com/steveonw/jubilant-funicular/blob/main/backend/policy_status.py): `backend/policy_status.py`
- [Public Comments](https://github.com/steveonw/jubilant-funicular/blob/main/backend/response_sources.py): `backend/response_sources.py`
- [Related Reporting](https://github.com/steveonw/jubilant-funicular/blob/main/backend/news_sources.py): `backend/news_sources.py`

### Analysis

- [Policy Interpretation](https://github.com/steveonw/jubilant-funicular/blob/main/backend/policy_interpreter.py): `backend/policy_interpreter.py`
- [Viewpoint Analysis](https://github.com/steveonw/jubilant-funicular/blob/main/backend/response_viewpoint_analyst.py): `backend/response_viewpoint_analyst.py`
- [Rush Analysis](https://github.com/steveonw/jubilant-funicular/blob/main/backend/rush_mode.py): `backend/rush_mode.py`
- [Evidence Linking](https://github.com/steveonw/jubilant-funicular/blob/main/backend/evidence.py): `backend/evidence.py`

### Review and Reporting

- [Claim Verification](https://github.com/steveonw/jubilant-funicular/blob/main/backend/claim_verifier.py): `backend/claim_verifier.py`
- [Human Review](https://github.com/steveonw/jubilant-funicular/blob/main/backend/guided_review.py): `backend/guided_review.py`
- [Selective Reanalysis](https://github.com/steveonw/jubilant-funicular/blob/main/backend/selective_reanalysis.py): `backend/selective_reanalysis.py`
- [Leadership Brief](https://github.com/steveonw/jubilant-funicular/blob/main/backend/api.py): `backend/api.py`
- [Evidence Audit Log](https://github.com/steveonw/jubilant-funicular/blob/main/backend/api.py): `backend/api.py`

### Application

- [PolicyTrace UI](https://github.com/steveonw/jubilant-funicular/blob/main/frontend/app/app.js): `frontend/app/app.js`
- [HTTP Application](https://github.com/steveonw/jubilant-funicular/blob/main/backend/run_app.py): `backend/run_app.py`
- [API Routes](https://github.com/steveonw/jubilant-funicular/blob/main/backend/api.py): `backend/api.py`
- [Analysis Models](https://github.com/steveonw/jubilant-funicular/blob/main/backend/models.py): `backend/models.py`

### Other components

- **Policy Analyst**
- **Federal Register**
- **Regulations.gov**
- **Reporting Sources**
- **Microsoft Foundry**

## Connections

- Policy Analyst → PolicyTrace UI: uses
- PolicyTrace UI → HTTP Application: HTTP requests
- HTTP Application → API Routes: dispatches
- API Routes → Policy Search: searches policy
- Policy Search → Federal Register: fetches documents
- API Routes → Source Packaging: builds source package
- Source Packaging → Policy Freshness: checks freshness
- Source Packaging → Public Comments: retrieves comments
- Public Comments → Regulations.gov: fetches comments
- Source Packaging → Related Reporting: discovers reporting
- Related Reporting → Reporting Sources: retrieves sources
- API Routes → Policy Interpretation: analyzes policy
- Policy Interpretation → Microsoft Foundry: requests analysis
- API Routes → Viewpoint Analysis: analyzes responses
- Viewpoint Analysis → Microsoft Foundry: requests analysis
- API Routes → Rush Analysis: runs analysis
- Rush Analysis → Microsoft Foundry: requests analysis
- API Routes → Evidence Linking: links evidence
- API Routes → Claim Verification: verifies claims
- Claim Verification → Microsoft Foundry: checks support
- API Routes → Human Review: applies review actions
- API Routes → Selective Reanalysis: refreshes findings
- API Routes → Leadership Brief: builds approved brief
- API Routes → Evidence Audit Log: preserves review trail
- API Routes → Analysis Models: validates analysis data
