# doodabomb89/goai-source-code-kopicheck architecture

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

- Interactive diagram: https://gitdiagram.com/doodabomb89/goai-source-code-kopicheck
- Repository: https://github.com/doodabomb89/goai-source-code-kopicheck

## Overview

KopiCheck’s implemented prototype takes a recorded video, samples frames, classifies them against NEA checklist categories, and writes a reviewable JSON compliance log. The main control flow is in `pipeline.py`, which uses `models.py` for visual classification and `checklist.py` for categories and severity. The README also describes a broader live, audio-aware, schedule- and event-driven agent; those capabilities are documented but are not wired into the prototype shown here. Dashed edges mark those documented, unimplemented flows.

Main entry points: [`pipeline.py`](https://github.com/doodabomb89/goai-source-code-kopicheck/blob/main/pipeline.py) (Frame Classification), [`README.md`](https://github.com/doodabomb89/goai-source-code-kopicheck/blob/main/README.md) (Ambient Audio), [`models.py`](https://github.com/doodabomb89/goai-source-code-kopicheck/blob/main/models.py) (Qwen Model Wrapper), [`checklist.py`](https://github.com/doodabomb89/goai-source-code-kopicheck/blob/main/checklist.py) (NEA Checklist)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Input Processing"]
  node_video["Recorded Clip"]
  node_sampling["Frame Sampling<br/>[pipeline.py]"]
  node_audio["Ambient Audio<br/>[README.md]"]
end

subgraph group_understanding["Classification and Rules"]
  node_classifier["Frame Classification<br/>[pipeline.py]"]
  node_qwen["Qwen Model Wrapper<br/>[models.py]"]
  node_omni["Audio-Visual Fusion<br/>[models.py]"]
  node_checklist["NEA Checklist<br/>[checklist.py]"]
end

subgraph group_orchestration["Event Orchestration"]
  node_schedule["Schedule Checks<br/>[README.md]"]
  node_event_flags["Hazard Flags<br/>[README.md]"]
  node_review["Review Status<br/>[pipeline.py]"]
end

subgraph group_delivery["Log Delivery"]
  node_compile["Log Compilation<br/>[pipeline.py]"]
  node_log["Compliance Log"]
  node_approval["Owner Approval<br/>[README.md]"]
end

node_owner(("Stall Owner"))
node_dashscope["DashScope API"]

node_owner -->|"provides clip"| node_video
node_video -->|"samples frames"| node_sampling
node_sampling -->|"classifies frames"| node_classifier
node_classifier -->|"calls classifier"| node_qwen
node_qwen -->|"requests inference"| node_dashscope
node_classifier -->|"looks up categories"| node_checklist
node_classifier -->|"assigns status"| node_review
node_review -->|"supplies events"| node_compile
node_compile -->|"writes JSON"| node_log
node_log -.->|"awaits review"| node_approval
node_owner -.->|"provides audio"| node_audio
node_audio -.->|"informs fusion"| node_omni
node_omni -.->|"resolves ambiguity"| node_classifier
node_schedule -.->|"prompts checks"| node_review
node_event_flags -.->|"routes hazards"| node_review

click node_sampling "https://github.com/doodabomb89/goai-source-code-kopicheck/blob/main/pipeline.py"
click node_audio "https://github.com/doodabomb89/goai-source-code-kopicheck/blob/main/README.md"
click node_classifier "https://github.com/doodabomb89/goai-source-code-kopicheck/blob/main/pipeline.py"
click node_qwen "https://github.com/doodabomb89/goai-source-code-kopicheck/blob/main/models.py"
click node_omni "https://github.com/doodabomb89/goai-source-code-kopicheck/blob/main/models.py"
click node_checklist "https://github.com/doodabomb89/goai-source-code-kopicheck/blob/main/checklist.py"
click node_schedule "https://github.com/doodabomb89/goai-source-code-kopicheck/blob/main/README.md"
click node_event_flags "https://github.com/doodabomb89/goai-source-code-kopicheck/blob/main/README.md"
click node_review "https://github.com/doodabomb89/goai-source-code-kopicheck/blob/main/pipeline.py"
click node_compile "https://github.com/doodabomb89/goai-source-code-kopicheck/blob/main/pipeline.py"
click node_approval "https://github.com/doodabomb89/goai-source-code-kopicheck/blob/main/README.md"

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_video,node_sampling,node_audio toneBlue
class node_classifier,node_qwen,node_omni,node_checklist toneAmber
class node_schedule,node_event_flags,node_review,node_dashscope toneMint
class node_compile,node_log,node_approval toneRose
class node_owner toneIndigo
```

## Components

### Input Processing

- **Recorded Clip**
- [Frame Sampling](https://github.com/doodabomb89/goai-source-code-kopicheck/blob/main/pipeline.py): `pipeline.py`
- [Ambient Audio](https://github.com/doodabomb89/goai-source-code-kopicheck/blob/main/README.md): `README.md`

### Classification and Rules

- [Frame Classification](https://github.com/doodabomb89/goai-source-code-kopicheck/blob/main/pipeline.py): `pipeline.py`
- [Qwen Model Wrapper](https://github.com/doodabomb89/goai-source-code-kopicheck/blob/main/models.py): `models.py`
- [Audio-Visual Fusion](https://github.com/doodabomb89/goai-source-code-kopicheck/blob/main/models.py): `models.py`
- [NEA Checklist](https://github.com/doodabomb89/goai-source-code-kopicheck/blob/main/checklist.py): `checklist.py`

### Event Orchestration

- [Schedule Checks](https://github.com/doodabomb89/goai-source-code-kopicheck/blob/main/README.md): `README.md`
- [Hazard Flags](https://github.com/doodabomb89/goai-source-code-kopicheck/blob/main/README.md): `README.md`
- [Review Status](https://github.com/doodabomb89/goai-source-code-kopicheck/blob/main/pipeline.py): `pipeline.py`

### Log Delivery

- [Log Compilation](https://github.com/doodabomb89/goai-source-code-kopicheck/blob/main/pipeline.py): `pipeline.py`
- **Compliance Log**
- [Owner Approval](https://github.com/doodabomb89/goai-source-code-kopicheck/blob/main/README.md): `README.md`

### Other components

- **Stall Owner**
- **DashScope API**

## Connections

- Stall Owner → Recorded Clip: provides clip
- Recorded Clip → Frame Sampling: samples frames (evidence: `pipeline.py`)
- Frame Sampling → Frame Classification: classifies frames (evidence: `pipeline.py`)
- Frame Classification → Qwen Model Wrapper: calls classifier (evidence: `pipeline.py`)
- Qwen Model Wrapper → DashScope API: requests inference (evidence: `models.py`)
- Frame Classification → NEA Checklist: looks up categories (evidence: `pipeline.py`)
- Frame Classification → Review Status: assigns status (evidence: `pipeline.py`)
- Review Status → Log Compilation: supplies events (evidence: `pipeline.py`)
- Log Compilation → Compliance Log: writes JSON (evidence: `pipeline.py`)
- Compliance Log → Owner Approval: awaits review (evidence: `README.md`)
- Stall Owner → Ambient Audio: provides audio (evidence: `README.md`)
- Ambient Audio → Audio-Visual Fusion: informs fusion (evidence: `README.md`)
- Audio-Visual Fusion → Frame Classification: resolves ambiguity (evidence: `README.md`)
- Schedule Checks → Review Status: prompts checks (evidence: `README.md`)
- Hazard Flags → Review Status: routes hazards (evidence: `README.md`)
