# shreyask95/wyreai_task architecture

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

- Interactive diagram: https://gitdiagram.com/shreyask95/wyreai_task
- Repository: https://github.com/shreyask95/wyreai_task

## Overview

WyreAI Audit Script turns existing bid-item results and drawing regions into a review workbook with drawing crops, optionally adds Gemini suggestions, then applies human decisions or eligible AI-triage decisions to a copy of the results. Its main stages are build, suggest, and apply; it does not discover missing work or rerun OCR. The map follows the README workflow and sampled functions in the single runtime script; details of unsampled implementation are not inferred.

Main entry points: [`audit_wyre.py`](https://github.com/shreyask95/wyreai_task/blob/main/audit_wyre.py) (Suggestion runner), [`audit_output/findings.xlsx`](https://github.com/shreyask95/wyreai_task/blob/main/audit_output/findings.xlsx) (Findings workbook), [`Given/results.json`](https://github.com/shreyask95/wyreai_task/blob/main/Given/results.json) (Bid results), [`audit_output`](https://github.com/shreyask95/wyreai_task/tree/main/audit_output) (Region crops)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_review_prep["Review preparation"]
  node_builder["Workbook and crops<br/>[audit_wyre.py]"]
  node_workbook["Findings workbook<br/>[findings.xlsx]"]
  node_crops["Region crops"]
end

subgraph group_suggestions["AI suggestions"]
  node_suggestion_runner["Suggestion runner<br/>[audit_wyre.py]"]
end

subgraph group_decisions["Decision application"]
  node_decision_applier["Decision applier<br/>[audit_wyre.py]"]
  node_corrected_results["Corrected results"]
end

node_operator(("Operator"))
node_results_input["Bid results<br/>[results.json]"]
node_drawings_input["Drawing PDF<br/>[drawings.pdf]"]
node_reviewer(("Human reviewer"))
node_gemini{{"Gemini service"}}

node_operator -->|"runs build"| node_builder
node_results_input -->|"reads items"| node_builder
node_drawings_input -->|"renders regions"| node_builder
node_builder -->|"creates workbook"| node_workbook
node_builder -->|"saves crops"| node_crops
node_operator -->|"runs suggest"| node_suggestion_runner
node_workbook -->|"reads rows"| node_suggestion_runner
node_crops -->|"supplies images"| node_suggestion_runner
node_suggestion_runner -->|"requests verdicts"| node_gemini
node_gemini -->|"returns suggestions"| node_suggestion_runner
node_suggestion_runner -->|"writes suggestions"| node_workbook
node_reviewer -->|"reviews rows"| node_workbook
node_operator -->|"runs apply"| node_decision_applier
node_workbook -->|"provides decisions"| node_decision_applier
node_results_input -->|"preserves structure"| node_decision_applier
node_decision_applier -->|"writes copy"| node_corrected_results

click node_results_input "https://github.com/shreyask95/wyreai_task/blob/main/Given/results.json"
click node_drawings_input "https://github.com/shreyask95/wyreai_task/blob/main/Given/drawings.pdf"
click node_builder "https://github.com/shreyask95/wyreai_task/blob/main/audit_wyre.py"
click node_workbook "https://github.com/shreyask95/wyreai_task/blob/main/audit_output/findings.xlsx"
click node_crops "https://github.com/shreyask95/wyreai_task/tree/main/audit_output"
click node_suggestion_runner "https://github.com/shreyask95/wyreai_task/blob/main/audit_wyre.py"
click node_decision_applier "https://github.com/shreyask95/wyreai_task/blob/main/audit_wyre.py"
click node_corrected_results "https://github.com/shreyask95/wyreai_task/blob/main/audit_output/corrected_results.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_builder,node_workbook,node_crops,node_reviewer toneBlue
class node_suggestion_runner toneAmber
class node_decision_applier,node_corrected_results toneMint
class node_operator,node_gemini toneIndigo
class node_results_input,node_drawings_input toneTeal
```

## Components

### Review preparation

- [Workbook and crops](https://github.com/shreyask95/wyreai_task/blob/main/audit_wyre.py): `audit_wyre.py`
- [Findings workbook](https://github.com/shreyask95/wyreai_task/blob/main/audit_output/findings.xlsx): `audit_output/findings.xlsx`
- [Region crops](https://github.com/shreyask95/wyreai_task/tree/main/audit_output): `audit_output`

### AI suggestions

- [Suggestion runner](https://github.com/shreyask95/wyreai_task/blob/main/audit_wyre.py): `audit_wyre.py`

### Decision application

- [Decision applier](https://github.com/shreyask95/wyreai_task/blob/main/audit_wyre.py): `audit_wyre.py`
- [Corrected results](https://github.com/shreyask95/wyreai_task/blob/main/audit_output/corrected_results.json): `audit_output/corrected_results.json`

### Other components

- **Operator**
- [Bid results](https://github.com/shreyask95/wyreai_task/blob/main/Given/results.json): `Given/results.json`
- [Drawing PDF](https://github.com/shreyask95/wyreai_task/blob/main/Given/drawings.pdf): `Given/drawings.pdf`
- **Human reviewer**
- **Gemini service**

## Connections

- Operator → Workbook and crops: runs build (evidence: `README.md`)
- Bid results → Workbook and crops: reads items (evidence: `README.md`)
- Drawing PDF → Workbook and crops: renders regions (evidence: `README.md`)
- Workbook and crops → Findings workbook: creates workbook (evidence: `README.md`)
- Workbook and crops → Region crops: saves crops (evidence: `README.md`)
- Operator → Suggestion runner: runs suggest (evidence: `README.md`)
- Findings workbook → Suggestion runner: reads rows (evidence: `README.md`)
- Region crops → Suggestion runner: supplies images (evidence: `README.md`)
- Suggestion runner → Gemini service: requests verdicts (evidence: `README.md`)
- Gemini service → Suggestion runner: returns suggestions (evidence: `README.md`)
- Suggestion runner → Findings workbook: writes suggestions (evidence: `README.md`)
- Human reviewer → Findings workbook: reviews rows (evidence: `README.md`)
- Operator → Decision applier: runs apply (evidence: `README.md`)
- Findings workbook → Decision applier: provides decisions (evidence: `README.md`)
- Bid results → Decision applier: preserves structure (evidence: `README.md`)
- Decision applier → Corrected results: writes copy (evidence: `README.md`)
