# open-paws/no-animal-violence architecture

> Architecture diagram of the GitHub repository open-paws/no-animal-violence, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/open-paws/no-animal-violence
- Repository: https://github.com/open-paws/no-animal-violence

## Overview

1. **What this repository is**
   - `no-animal-violence` is not an application runtime; it is a **canonical rule source and synchronization repo** for inclusive-language detection.
   - Its main job is to define speciesist-language patterns once, then propagate them into multiple linting/scanning ecosystems.

2. **Core architectural boundary: rule corpus vs. adapters**
   - The repo holds the authoritative rule set and the tooling that keeps outputs in sync.
   - Downstream projects such as ESLint, Semgrep, Vale, VS Code, pre-commit, GitHub Actions, reviewdog, and Danger.js are **consumers**, not owners, of the rules.

3. **Canonical rule assets**
   - The rule definitions live in native-format files under `woke/`, `alex/`, and `vale/Speciesism/`, with `semgrep-no-animal-violence.yaml` as an additional adapter-specific artifact.
   - These files encode the same conceptual categories: violent animal idioms, animal-as-object metaphors, speciesist technical terminology, and industry euphemisms.

4. **Shared rule model and generation layer**
   - The `rules.yaml` file and the `tools/generators/` package form the repo’s transformation layer.
   - `tools/generate_all.py` and the generator modules (`gen_alex.py`, `gen_woke.py`, `gen_vale.py`, `gen_semgrep.py`, `gen_eslint.js`, `gen_vscode.js`, `gen_action.py`, `gen_pre_commit.py`, `gen_reviewdog.py`, `gen_danger.js`) convert the shared rule model into tool-native outputs.

5. **Synchronization and drift control**
   - `tools/check_consistency.py` is the key integrity gate: it detects when the canonical rule files diverge from each other.
   - `scripts/check_versions.sh` checks whether downstream adapter repos are behind the canonical rule version, so version drift is visible early.

6. **Validation and test boundary**
   - The repo uses Python-based testing for the consistency checker and generator behavior (`tools/test_check_consistency.py`, `tools/generators/tests/`).
   - Static quality gates are enforced with `ruff`, `pre-commit`, and GitHub Actions, which matters because most repo content is configuration/data, not application code.

7. **CI/CD and automation**
   - `.github/workflows/ci.yml` runs the main lint/test path.
   - `codeql.yml` adds security scanning for the Python/automation code.
   - `propagate.yml`, `version-check.yml`, and `desloppify.yml` automate synchronization, version monitoring, and quality scoring; `auto-merge.yml` and `setup-labels.yml` support repo operations.

8. **Distribution model**
   - The repo does not serve end users directly; it publishes rule data that downstream packages embed or mirror.
   - Each adapter translates the same detection semantics into a different execution environment, which is why rule IDs and suppression comments must stay stable.

9. **Operational flow**
   - Author adds or edits a pattern in the canonical rule set.
   - Consistency checks ensure all native representations agree.
   - Generators produce or update downstream artifacts.
   - CI and version checks validate the repo and flag any consumer lag.

10. **What to show in an architecture diagram**
   - Put the **rule corpus** at the center, the **generator/validation tooling** around it, and the **eight downstream tool adapters** as external consumers.
   - Emphasize that the repo is a **source-of-truth + build pipeline** for rule propagation, not a service with databases, APIs, or user-facing runtime components.

Main entry points: [`scripts/check_versions.sh`](https://github.com/open-paws/no-animal-violence/blob/main/scripts/check_versions.sh) (Version check), [`tools/generate_all.py`](https://github.com/open-paws/no-animal-violence/blob/main/tools/generate_all.py) (Generate all), [`rules.yaml`](https://github.com/open-paws/no-animal-violence/blob/main/rules.yaml) (Rules model), [`tools/check_consistency.py`](https://github.com/open-paws/no-animal-violence/blob/main/tools/check_consistency.py) (Consistency check)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_canon["Canonical rules"]
  node_rules_yaml["Rules model<br/>shared schema<br/>[rules.yaml]"]
  node_woke_rules["Woke rules<br/>native rules<br/>[.woke.yaml]"]
  node_alex_animals["Alex animals<br/>native rules"]
  node_alex_industry["Alex industry<br/>native rules"]
  node_vale_idioms["Vale idioms<br/>native rules<br/>[AnimalIdioms.yml]"]
  node_vale_industry["Vale industry<br/>native rules"]
  node_semgrep_rules["Semgrep rules<br/>adapter output"]
end

subgraph group_tooling["Tooling"]
  node_generators["Generators<br/>build package"]
  node_generate_all["Generate all<br/>orchestrator<br/>[generate_all.py]"]
  node_check_consistency["Consistency check<br/>integrity gate"]
  node_propagate["Propagate sync<br/>automation<br/>[propagate.py]"]
  node_check_versions["Version check<br/>sync script<br/>[check_versions.sh]"]
  node_ci_workflow["CI<br/>github workflow<br/>[ci.yml]"]
  node_codeql_workflow["CodeQL<br/>github workflow<br/>[codeql.yml]"]
  node_propagate_workflow["Propagate wf<br/>github workflow<br/>[propagate.yml]"]
  node_version_workflow["Version wf<br/>github workflow<br/>[version-check.yml]"]
  node_desloppify_workflow["Desloppify wf<br/>github workflow<br/>[desloppify.yml]"]
end

subgraph group_consumers["Downstream adapters"]
  node_eslint_adapter["ESLint<br/>consumer adapter"]
  node_vscode_adapter["VS Code<br/>consumer adapter"]
  node_precommit_adapter["pre-commit<br/>consumer adapter"]
  node_reviewdog_adapter["reviewdog<br/>consumer adapter"]
  node_danger_adapter["Danger.js<br/>consumer adapter"]
  node_action_adapter["GitHub Action<br/>consumer adapter"]
  node_woke_adapter["Woke<br/>consumer adapter"]
  node_vale_adapter["Vale<br/>consumer adapter"]
  node_semgrep_adapter["Semgrep<br/>consumer adapter"]
end

node_rules_yaml -->|"feeds model"| node_generators
node_rules_yaml -->|"canonicalizes"| node_woke_rules
node_rules_yaml -->|"renders"| node_alex_animals
node_rules_yaml -->|"renders"| node_alex_industry
node_rules_yaml -->|"renders"| node_vale_idioms
node_rules_yaml -->|"renders"| node_vale_industry
node_rules_yaml -->|"renders"| node_semgrep_rules
node_generators -->|"used by"| node_generate_all
node_generate_all -->|"writes"| node_woke_rules
node_generate_all -->|"writes"| node_alex_animals
node_generate_all -->|"writes"| node_alex_industry
node_generate_all -->|"writes"| node_vale_idioms
node_generate_all -->|"writes"| node_vale_industry
node_generate_all -->|"writes"| node_semgrep_rules
node_check_consistency -->|"verifies"| node_rules_yaml
node_check_consistency -->|"verifies"| node_woke_rules
node_check_consistency -->|"verifies"| node_alex_animals
node_check_consistency -->|"verifies"| node_vale_idioms
node_propagate -->|"invokes"| node_generate_all
node_propagate_workflow -->|"runs"| node_propagate
node_ci_workflow -->|"runs"| node_check_consistency
node_ci_workflow -->|"runs"| node_generate_all
node_codeql_workflow -->|"scans"| node_generators
node_version_workflow -->|"runs"| node_check_versions
node_desloppify_workflow -->|"automates"| node_propagate
node_check_versions -->|"monitors"| node_eslint_adapter
node_check_versions -->|"monitors"| node_vscode_adapter
node_check_versions -->|"monitors"| node_precommit_adapter
node_check_versions -->|"monitors"| node_reviewdog_adapter
node_check_versions -->|"monitors"| node_danger_adapter
node_check_versions -->|"monitors"| node_action_adapter
node_check_versions -->|"monitors"| node_woke_adapter
node_check_versions -->|"monitors"| node_vale_adapter
node_check_versions -->|"monitors"| node_semgrep_adapter

click node_rules_yaml "https://github.com/open-paws/no-animal-violence/blob/main/rules.yaml"
click node_woke_rules "https://github.com/open-paws/no-animal-violence/blob/main/woke/.woke.yaml"
click node_alex_animals "https://github.com/open-paws/no-animal-violence/blob/main/alex/animal-violence.yml"
click node_alex_industry "https://github.com/open-paws/no-animal-violence/blob/main/alex/industry-euphemisms.yml"
click node_vale_idioms "https://github.com/open-paws/no-animal-violence/blob/main/vale/Speciesism/AnimalIdioms.yml"
click node_vale_industry "https://github.com/open-paws/no-animal-violence/blob/main/vale/Speciesism/IndustryEuphemisms.yml"
click node_semgrep_rules "https://github.com/open-paws/no-animal-violence/blob/main/semgrep-no-animal-violence.yaml"
click node_generators "https://github.com/open-paws/no-animal-violence/tree/main/tools/generators"
click node_generate_all "https://github.com/open-paws/no-animal-violence/blob/main/tools/generate_all.py"
click node_check_consistency "https://github.com/open-paws/no-animal-violence/blob/main/tools/check_consistency.py"
click node_propagate "https://github.com/open-paws/no-animal-violence/blob/main/tools/propagate.py"
click node_check_versions "https://github.com/open-paws/no-animal-violence/blob/main/scripts/check_versions.sh"
click node_ci_workflow "https://github.com/open-paws/no-animal-violence/blob/main/.github/workflows/ci.yml"
click node_codeql_workflow "https://github.com/open-paws/no-animal-violence/blob/main/.github/workflows/codeql.yml"
click node_propagate_workflow "https://github.com/open-paws/no-animal-violence/blob/main/.github/workflows/propagate.yml"
click node_version_workflow "https://github.com/open-paws/no-animal-violence/blob/main/.github/workflows/version-check.yml"
click node_desloppify_workflow "https://github.com/open-paws/no-animal-violence/blob/main/.github/workflows/desloppify.yml"

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_rules_yaml,node_woke_rules,node_alex_animals,node_alex_industry,node_vale_idioms,node_vale_industry,node_semgrep_rules toneBlue
class node_generators,node_generate_all,node_check_consistency,node_propagate,node_check_versions,node_ci_workflow,node_codeql_workflow,node_propagate_workflow,node_version_workflow,node_desloppify_workflow toneAmber
class node_eslint_adapter,node_vscode_adapter,node_precommit_adapter,node_reviewdog_adapter,node_danger_adapter,node_action_adapter,node_woke_adapter,node_vale_adapter,node_semgrep_adapter toneMint
```

## Components

### Canonical rules

Source-of-truth rule corpus and native rule assets

- [Rules model](https://github.com/open-paws/no-animal-violence/blob/main/rules.yaml): shared schema · Canonical rule definitions and metadata used to generate all adapters · `rules.yaml`
- [Woke rules](https://github.com/open-paws/no-animal-violence/blob/main/woke/.woke.yaml): native rules · Woke-format speciesism rules maintained as a canonical adapter output · `woke/.woke.yaml`
- [Alex animals](https://github.com/open-paws/no-animal-violence/blob/main/alex/animal-violence.yml): native rules · Alex rules for violent animal idioms · `alex/animal-violence.yml`
- [Alex industry](https://github.com/open-paws/no-animal-violence/blob/main/alex/industry-euphemisms.yml): native rules · Alex rules for industry euphemisms · `alex/industry-euphemisms.yml`
- [Vale idioms](https://github.com/open-paws/no-animal-violence/blob/main/vale/Speciesism/AnimalIdioms.yml): native rules · Vale rules for animal idioms · `vale/Speciesism/AnimalIdioms.yml`
- [Vale industry](https://github.com/open-paws/no-animal-violence/blob/main/vale/Speciesism/IndustryEuphemisms.yml): native rules · Vale rules for industry euphemisms · `vale/Speciesism/IndustryEuphemisms.yml`
- [Semgrep rules](https://github.com/open-paws/no-animal-violence/blob/main/semgrep-no-animal-violence.yaml): adapter output · Semgrep ruleset for speciesist-language detection · `semgrep-no-animal-violence.yaml`

### Tooling

Generators, consistency checks, and sync automation

- [Generators](https://github.com/open-paws/no-animal-violence/tree/main/tools/generators): build package · Shared generator package that renders the rule model into tool-native outputs · `tools/generators`
- [Generate all](https://github.com/open-paws/no-animal-violence/blob/main/tools/generate_all.py): orchestrator · Entry point that runs all generators from the shared model · `tools/generate_all.py`
- [Consistency check](https://github.com/open-paws/no-animal-violence/blob/main/tools/check_consistency.py): integrity gate · Detects drift between canonical rule representations · `tools/check_consistency.py`
- [Propagate sync](https://github.com/open-paws/no-animal-violence/blob/main/tools/propagate.py): automation · Synchronizes generated outputs and downstream updates · `tools/propagate.py`
- [Version check](https://github.com/open-paws/no-animal-violence/blob/main/scripts/check_versions.sh): sync script · Checks whether downstream adapter repos lag the canonical version · `scripts/check_versions.sh`
- [CI](https://github.com/open-paws/no-animal-violence/blob/main/.github/workflows/ci.yml): github workflow · Main lint and test workflow · `.github/workflows/ci.yml`
- [CodeQL](https://github.com/open-paws/no-animal-violence/blob/main/.github/workflows/codeql.yml): github workflow · Security scanning for automation and Python code · `.github/workflows/codeql.yml`
- [Propagate wf](https://github.com/open-paws/no-animal-violence/blob/main/.github/workflows/propagate.yml): github workflow · Automated synchronization workflow · `.github/workflows/propagate.yml`
- [Version wf](https://github.com/open-paws/no-animal-violence/blob/main/.github/workflows/version-check.yml): github workflow · Automation for version drift monitoring · `.github/workflows/version-check.yml`
- [Desloppify wf](https://github.com/open-paws/no-animal-violence/blob/main/.github/workflows/desloppify.yml): github workflow · Automation for repository quality scoring and cleanup · `.github/workflows/desloppify.yml`

### Downstream adapters

Tool-specific outputs consumed by external linting and scanning ecosystems

- **ESLint**: consumer adapter · Downstream linting consumer generated from the shared rule model
- **VS Code**: consumer adapter · Editor integration consumer for inline detection
- **pre-commit**: consumer adapter · Git hook consumer for local checks
- **reviewdog**: consumer adapter · Code review consumer for surfaced findings
- **Danger.js**: consumer adapter · Pull-request automation consumer
- **GitHub Action**: consumer adapter · Workflow consumer for repository automation
- **Woke**: consumer adapter · Woke language rule consumer
- **Vale**: consumer adapter · Vale prose lint consumer
- **Semgrep**: consumer adapter · Semgrep scanning consumer

## Connections

- Rules model → Generators: feeds model · Shared rule definitions are loaded by generator code
- Rules model → Woke rules: canonicalizes · Model produces the Woke rule artifact
- Rules model → Alex animals: renders · Model produces Alex animal-violence rules
- Rules model → Alex industry: renders · Model produces Alex industry-euphemism rules
- Rules model → Vale idioms: renders · Model produces Vale idiom rules
- Rules model → Vale industry: renders · Model produces Vale industry rules
- Rules model → Semgrep rules: renders · Model produces Semgrep output
- Generators → Generate all: used by · Orchestrator imports and runs generators
- Generate all → Woke rules: writes · Build step updates the Woke artifact
- Generate all → Alex animals: writes · Build step updates Alex output
- Generate all → Alex industry: writes · Build step updates Alex output
- Generate all → Vale idioms: writes · Build step updates Vale output
- Generate all → Vale industry: writes · Build step updates Vale output
- Generate all → Semgrep rules: writes · Build step updates Semgrep output
- Consistency check → Rules model: verifies · Checks the shared model against generated/native rule files
- Consistency check → Woke rules: verifies · Detects drift in Woke rules
- Consistency check → Alex animals: verifies · Detects drift in Alex rules
- Consistency check → Vale idioms: verifies · Detects drift in Vale rules
- Propagate sync → Generate all: invokes · Propagation runs the full generator pipeline
- Propagate wf → Propagate sync: runs · GitHub Actions automation triggers sync propagation
- CI → Consistency check: runs · CI gates repository state on consistency
- CI → Generate all: runs · CI exercises generation behavior
- CodeQL → Generators: scans · Security workflow covers automation code
- Version wf → Version check: runs · Version monitoring workflow executes the sync check
- Desloppify wf → Propagate sync: automates · Quality workflow participates in repo maintenance automation
- Version check → ESLint: monitors · Checks downstream ESLint consumer version lag
- Version check → VS Code: monitors · Checks downstream VS Code consumer version lag
- Version check → pre-commit: monitors · Checks downstream pre-commit consumer version lag
- Version check → reviewdog: monitors · Checks downstream reviewdog consumer version lag
- Version check → Danger.js: monitors · Checks downstream Danger.js consumer version lag
- Version check → GitHub Action: monitors · Checks downstream GitHub Action consumer version lag
- Version check → Woke: monitors · Checks downstream Woke consumer version lag
- Version check → Vale: monitors · Checks downstream Vale consumer version lag
- Version check → Semgrep: monitors · Checks downstream Semgrep consumer version lag
