# projectguerilla/watchdog-ae architecture

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

- Interactive diagram: https://gitdiagram.com/projectguerilla/watchdog-ae
- Repository: https://github.com/projectguerilla/watchdog-ae

## Overview

WatchDog is a command-line After Effects render coordinator: an operator points it at a watch folder and chooses a worker count; it discovers eligible projects, dispatches render tasks to parallel aerender processes, and records outcomes and completion markers. The README also documents shared-network watch folders, per-instance logs, headless rendering, and coordination with After Effects Watch Folder renders. grinder_html.py is a separate HTML-output implementation of the same general worker model. Source excerpts are partial, so links to aerender and documented external behavior rely on the README.

Main entry points: [`watchdog.py`](https://github.com/projectguerilla/watchdog-ae/blob/master/watchdog.py) (Render workers), [`grinder_html.py`](https://github.com/projectguerilla/watchdog-ae/blob/master/grinder_html.py) (HTML-output variant), [`grinder_templates.html`](https://github.com/projectguerilla/watchdog-ae/blob/master/grinder_templates.html) (HTML template)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Command and coordination"]
  node_watchdog_cli["WatchDog CLI<br/>[watchdog.py]"]
  node_job_discovery["Job discovery<br/>[watchdog.py]"]
  node_job_scheduler["Job scheduler<br/>[watchdog.py]"]
  node_task_queue["Task queue<br/>[watchdog.py]"]
end

subgraph group_render["Parallel rendering"]
  node_render_workers["Render workers<br/>[watchdog.py]"]
end

subgraph group_results["Render results"]
  node_result_queue["Result queue<br/>[watchdog.py]"]
  node_result_handler["Result handling<br/>[watchdog.py]"]
  node_render_logs["Render logs<br/>[watchdog.py]"]
  node_completion_markers["Completion markers<br/>[watchdog.py]"]
  node_frame_cleanup["Bad-frame cleanup<br/>[watchdog.py]"]
  node_html_variant["HTML-output variant<br/>[grinder_html.py]"]
  node_html_template["HTML template"]
end

node_operator(("Operator"))
node_watch_folder[("Watch folder")]
node_aerender["Adobe aerender"]

node_operator -->|"runs with options"| node_watchdog_cli
node_watchdog_cli -->|"starts coordination"| node_job_discovery
node_job_discovery -->|"scans projects"| node_watch_folder
node_job_scheduler -->|"enqueues tasks"| node_task_queue
node_render_workers -->|"takes tasks"| node_task_queue
node_render_workers -->|"renders projects"| node_aerender
node_render_workers -->|"reports results"| node_result_queue
node_result_handler -->|"handles results"| node_result_queue
node_result_handler -->|"writes logs"| node_render_logs
node_result_handler -->|"sets markers"| node_completion_markers
node_frame_cleanup -->|"checks logs"| node_render_logs
node_html_variant -.-> node_html_template

click node_watchdog_cli "https://github.com/projectguerilla/watchdog-ae/blob/master/watchdog.py"
click node_job_discovery "https://github.com/projectguerilla/watchdog-ae/blob/master/watchdog.py"
click node_job_scheduler "https://github.com/projectguerilla/watchdog-ae/blob/master/watchdog.py"
click node_task_queue "https://github.com/projectguerilla/watchdog-ae/blob/master/watchdog.py"
click node_render_workers "https://github.com/projectguerilla/watchdog-ae/blob/master/watchdog.py"
click node_result_queue "https://github.com/projectguerilla/watchdog-ae/blob/master/watchdog.py"
click node_result_handler "https://github.com/projectguerilla/watchdog-ae/blob/master/watchdog.py"
click node_render_logs "https://github.com/projectguerilla/watchdog-ae/blob/master/watchdog.py"
click node_completion_markers "https://github.com/projectguerilla/watchdog-ae/blob/master/watchdog.py"
click node_frame_cleanup "https://github.com/projectguerilla/watchdog-ae/blob/master/watchdog.py"
click node_html_variant "https://github.com/projectguerilla/watchdog-ae/blob/master/grinder_html.py"
click node_html_template "https://github.com/projectguerilla/watchdog-ae/blob/master/grinder_templates.html"

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_watchdog_cli,node_job_discovery,node_job_scheduler,node_task_queue toneBlue
class node_render_workers,node_watch_folder toneAmber
class node_result_queue,node_result_handler,node_render_logs,node_completion_markers,node_frame_cleanup,node_html_variant,node_html_template toneMint
class node_operator,node_aerender toneIndigo
```

## Components

### Command and coordination

- [WatchDog CLI](https://github.com/projectguerilla/watchdog-ae/blob/master/watchdog.py): `watchdog.py`
- [Job discovery](https://github.com/projectguerilla/watchdog-ae/blob/master/watchdog.py): `watchdog.py`
- [Job scheduler](https://github.com/projectguerilla/watchdog-ae/blob/master/watchdog.py): `watchdog.py`
- [Task queue](https://github.com/projectguerilla/watchdog-ae/blob/master/watchdog.py): `watchdog.py`

### Parallel rendering

- [Render workers](https://github.com/projectguerilla/watchdog-ae/blob/master/watchdog.py): `watchdog.py`

### Render results

- [Result queue](https://github.com/projectguerilla/watchdog-ae/blob/master/watchdog.py): `watchdog.py`
- [Result handling](https://github.com/projectguerilla/watchdog-ae/blob/master/watchdog.py): `watchdog.py`
- [Render logs](https://github.com/projectguerilla/watchdog-ae/blob/master/watchdog.py): `watchdog.py`
- [Completion markers](https://github.com/projectguerilla/watchdog-ae/blob/master/watchdog.py): `watchdog.py`
- [Bad-frame cleanup](https://github.com/projectguerilla/watchdog-ae/blob/master/watchdog.py): `watchdog.py`
- [HTML-output variant](https://github.com/projectguerilla/watchdog-ae/blob/master/grinder_html.py): `grinder_html.py`
- [HTML template](https://github.com/projectguerilla/watchdog-ae/blob/master/grinder_templates.html): `grinder_templates.html`

### Other components

- **Operator**
- **Watch folder**
- **Adobe aerender**

## Connections

- Operator → WatchDog CLI: runs with options (evidence: `README.md`)
- WatchDog CLI → Job discovery: starts coordination (evidence: `watchdog.py`)
- Job discovery → Watch folder: scans projects (evidence: `watchdog.py`)
- Job scheduler → Task queue: enqueues tasks (evidence: `watchdog.py`)
- Render workers → Task queue: takes tasks (evidence: `watchdog.py`)
- Render workers → Adobe aerender: renders projects (evidence: `README.md`)
- Render workers → Result queue: reports results (evidence: `watchdog.py`)
- Result handling → Result queue: handles results (evidence: `watchdog.py`)
- Result handling → Render logs: writes logs (evidence: `README.md`)
- Result handling → Completion markers: sets markers (evidence: `watchdog.py`)
- Bad-frame cleanup → Render logs: checks logs (evidence: `watchdog.py`)
- HTML-output variant → HTML template
