# baddieangelasolos-bot/long-video-genarator architecture

> Architecture diagram of the GitHub repository baddieangelasolos-bot/long-video-genarator, 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/baddieangelasolos-bot/long-video-genarator
- Repository: https://github.com/baddieangelasolos-bot/long-video-genarator

## Overview

Long Video Generator automatically turns Drive football clips and a music track into a planned, rendered highlight video, then uploads it and emails run reports. Its workflow fetches media, inventories and scans footage, labels shots and groups moments, builds and validates a template-constrained timeline, renders and verifies the result, and exports it. The graph preserves the documented v2 labeling and planning stages. Some connections are documented only in the README; unsampled implementation details are not inferred.

Main entry points: [`autonomy/run_pipeline.py`](https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/autonomy/run_pipeline.py) (Pipeline supervisor), [`scripts/script_planner.py`](https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/scripts/script_planner.py) (Timeline planner), [`scripts/classify_shots.py`](https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/scripts/classify_shots.py) (Shot labeling), [`autonomy/gemini_router.py`](https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/autonomy/gemini_router.py) (Gemini model router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Run orchestration"]
  node_supervisor["Pipeline supervisor<br/>[run_pipeline.py]"]
  node_mechanic["Recovery mechanic<br/>[mechanic.py]"]
  node_fetch["Drive fetch<br/>[fetch_drive.py]"]
end

subgraph group_analysis["Footage analysis"]
  node_inventory["Media inventory<br/>[inventory.py]"]
  node_scan["Footage scan<br/>[fullscan.py]"]
  node_duplicates["Duplicate detection<br/>[dup_scan.py]"]
  node_windows["Shot windows<br/>[shots.py]"]
end

subgraph group_planning["Labeling and planning"]
  node_classification["Shot labeling<br/>[classify_shots.py]"]
  node_router["Gemini model router<br/>[gemini_router.py]"]
  node_moments["Moment grouping<br/>[shot_events.py]"]
  node_catalog["Catalog tools<br/>[catalog_tools.py]"]
  node_planner["Timeline planner<br/>[script_planner.py]"]
  node_offline["Offline planner<br/>[offline_planner.py]"]
  node_rules["Plan validation and repair<br/>[timeline_core.py]"]
  node_composition["Composition rules<br/>[comp_rules.py]"]
end

subgraph group_delivery["Render and delivery"]
  node_render["Master renderer<br/>[render_video.py]"]
  node_qa["Output quality checks<br/>[qa.py]"]
  node_export["Drive export<br/>[drive_export.py]"]
  node_email["Run and log mail<br/>[email_logs.py]"]
end

node_owner(("Repository owner"))
node_drive[("Google Drive")]
node_gemini{{"Gemini API"}}
node_ffmpeg{{"FFmpeg"}}

node_owner -->|"starts run"| node_supervisor
node_supervisor -->|"supervises stages"| node_mechanic
node_supervisor -->|"runs fetch"| node_fetch
node_fetch -->|"downloads media"| node_drive
node_supervisor -->|"runs inventory"| node_inventory
node_supervisor -->|"runs scan"| node_scan
node_scan -->|"finds repeats"| node_duplicates
node_supervisor -->|"plans windows"| node_windows
node_windows -->|"labels windows"| node_classification
node_classification -->|"requests labels"| node_router
node_router -->|"calls models"| node_gemini
node_classification -->|"groups labels"| node_moments
node_moments -.->|"forms catalog"| node_catalog
node_supervisor -->|"runs planning"| node_planner
node_planner -.->|"requests plan"| node_router
node_planner -->|"falls back"| node_offline
node_planner -->|"validates plan"| node_rules
node_rules -->|"checks composition"| node_composition
node_supervisor -->|"runs render"| node_render
node_render -->|"renders video"| node_ffmpeg
node_supervisor -->|"runs QA"| node_qa
node_supervisor -->|"runs export"| node_export
node_export -->|"uploads video"| node_drive
node_supervisor -->|"mails logs"| node_email

click node_supervisor "https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/autonomy/run_pipeline.py"
click node_mechanic "https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/autonomy/mechanic.py"
click node_fetch "https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/autonomy/fetch_drive.py"
click node_inventory "https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/pipeline/inventory.py"
click node_scan "https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/pipeline/fullscan.py"
click node_duplicates "https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/scripts/dup_scan.py"
click node_windows "https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/pipeline/shots.py"
click node_classification "https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/scripts/classify_shots.py"
click node_router "https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/autonomy/gemini_router.py"
click node_moments "https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/scripts/shot_events.py"
click node_catalog "https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/scripts/catalog_tools.py"
click node_planner "https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/scripts/script_planner.py"
click node_offline "https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/scripts/offline_planner.py"
click node_rules "https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/scripts/timeline_core.py"
click node_composition "https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/scripts/comp_rules.py"
click node_render "https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/scripts/render_video.py"
click node_qa "https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/pipeline/qa.py"
click node_export "https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/autonomy/drive_export.py"
click node_email "https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/autonomy/email_logs.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_supervisor,node_mechanic,node_fetch toneBlue
class node_inventory,node_scan,node_duplicates,node_windows,node_drive toneAmber
class node_classification,node_router,node_moments,node_catalog,node_planner,node_offline,node_rules,node_composition,node_gemini toneMint
class node_render,node_qa,node_export,node_email toneRose
class node_owner,node_ffmpeg toneIndigo
```

## Components

### Run orchestration

- [Pipeline supervisor](https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/autonomy/run_pipeline.py): `autonomy/run_pipeline.py`
- [Recovery mechanic](https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/autonomy/mechanic.py): `autonomy/mechanic.py`
- [Drive fetch](https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/autonomy/fetch_drive.py): `autonomy/fetch_drive.py`

### Footage analysis

- [Media inventory](https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/pipeline/inventory.py): `pipeline/inventory.py`
- [Footage scan](https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/pipeline/fullscan.py): `pipeline/fullscan.py`
- [Duplicate detection](https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/scripts/dup_scan.py): `scripts/dup_scan.py`
- [Shot windows](https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/pipeline/shots.py): `pipeline/shots.py`

### Labeling and planning

- [Shot labeling](https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/scripts/classify_shots.py): `scripts/classify_shots.py`
- [Gemini model router](https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/autonomy/gemini_router.py): `autonomy/gemini_router.py`
- [Moment grouping](https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/scripts/shot_events.py): `scripts/shot_events.py`
- [Catalog tools](https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/scripts/catalog_tools.py): `scripts/catalog_tools.py`
- [Timeline planner](https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/scripts/script_planner.py): `scripts/script_planner.py`
- [Offline planner](https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/scripts/offline_planner.py): `scripts/offline_planner.py`
- [Plan validation and repair](https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/scripts/timeline_core.py): `scripts/timeline_core.py`
- [Composition rules](https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/scripts/comp_rules.py): `scripts/comp_rules.py`

### Render and delivery

- [Master renderer](https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/scripts/render_video.py): `scripts/render_video.py`
- [Output quality checks](https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/pipeline/qa.py): `pipeline/qa.py`
- [Drive export](https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/autonomy/drive_export.py): `autonomy/drive_export.py`
- [Run and log mail](https://github.com/baddieangelasolos-bot/long-video-genarator/blob/main/autonomy/email_logs.py): `autonomy/email_logs.py`

### Other components

- **Repository owner**
- **Google Drive**
- **Gemini API**
- **FFmpeg**

## Connections

- Repository owner → Pipeline supervisor: starts run (evidence: `README.md`)
- Pipeline supervisor → Recovery mechanic: supervises stages (evidence: `autonomy/run_pipeline.py`)
- Pipeline supervisor → Drive fetch: runs fetch (evidence: `autonomy/run_pipeline.py`)
- Drive fetch → Google Drive: downloads media (evidence: `README.md`)
- Pipeline supervisor → Media inventory: runs inventory (evidence: `README.md`)
- Pipeline supervisor → Footage scan: runs scan (evidence: `README.md`)
- Footage scan → Duplicate detection: finds repeats (evidence: `README.md`)
- Pipeline supervisor → Shot windows: plans windows (evidence: `README.md`)
- Shot windows → Shot labeling: labels windows (evidence: `README.md`)
- Shot labeling → Gemini model router: requests labels (evidence: `scripts/classify_shots.py`)
- Gemini model router → Gemini API: calls models (evidence: `autonomy/gemini_router.py`)
- Shot labeling → Moment grouping: groups labels (evidence: `scripts/classify_shots.py`)
- Moment grouping → Catalog tools: forms catalog
- Pipeline supervisor → Timeline planner: runs planning (evidence: `README.md`)
- Timeline planner → Gemini model router: requests plan
- Timeline planner → Offline planner: falls back (evidence: `scripts/script_planner.py`)
- Timeline planner → Plan validation and repair: validates plan (evidence: `scripts/script_planner.py`)
- Plan validation and repair → Composition rules: checks composition (evidence: `scripts/timeline_core.py`)
- Pipeline supervisor → Master renderer: runs render (evidence: `README.md`)
- Master renderer → FFmpeg: renders video (evidence: `README.md`)
- Pipeline supervisor → Output quality checks: runs QA (evidence: `README.md`)
- Pipeline supervisor → Drive export: runs export (evidence: `README.md`)
- Drive export → Google Drive: uploads video (evidence: `README.md`)
- Pipeline supervisor → Run and log mail: mails logs (evidence: `README.md`)
