watchflow

Architecture Overview

Watchflow is a rule engine for GitHub: you define rules in YAML; we evaluate them on PR and push events and surface violations as check runs and PR comments. No custom code in the repo—just conditions and parameters that map to built-in logic. Built for maintainers who want consistent enforcement without another dashboard or “AI-powered” abstraction.

Design principles

Flow

graph TD
    A[GitHub Event] --> B[Webhook Router]
    B --> C[Delivery ID + Payload]
    C --> D[Handler: enqueue processor]
    C --> E[Processor: load rules, enrich, evaluate]
    E --> F[Rule Engine: conditions only]
    F --> G[Violations / Pass]
    G --> H[Check Run + PR Comment]
    G --> I[Acknowledgment parsing on comment]
  1. Webhook — GitHub sends pull_request or push; router reads X-GitHub-Delivery, builds WebhookEvent with delivery_id.
  2. Handler — Enqueues a processor task with event_type + delivery_id + func so dedup doesn’t skip the processor.
  3. Processor — Loads .watchflow/rules.yaml from default branch (via GitHub API). If missing, creates a neutral check run and posts a welcome comment with a link to watchflow.dev (installation_id + repo).
  4. Enrichment — Fetches PR files, reviews, CODEOWNERS content so conditions can run without a local clone.
  5. Rule engine — Passes Rule objects (with attached condition instances) to the engine. Engine runs each rule’s conditions; no conversion to dicts that would drop conditions.
  6. Output — Violations → check run + PR comment; developers can reply @watchflow acknowledge "reason" where the rule allows it.

Core components

Rule loader

Condition registry

PR enricher

Task queue

Where AI is used (and where it isn’t)

So: enforcement is deterministic and condition-based by default; LLM-assisted conditions are opt-in and fail-open; suggestions and feasibility are agent-assisted. That keeps the hot path simple and auditable.

Use cases

Docs