How open-paws/no-animal-violence works
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: check_versions.sh Version check · generate_all.py Generate all · rules.yaml Rules model · check_consistency.py Consistency check
Components 26
Canonical rules
Source-of-truth rule corpus and native rule assets
- Rules model · Canonical rule definitions and metadata used to generate all adapters
rules.yaml - Woke rules · Woke-format speciesism rules maintained as a canonical adapter output
woke/.woke.yaml - Alex animals · Alex rules for violent animal idioms
alex/animal-violence.yml - Alex industry · Alex rules for industry euphemisms
alex/industry-euphemisms.yml - Vale idioms · Vale rules for animal idioms
vale/Speciesism/AnimalIdioms.yml - Vale industry · Vale rules for industry euphemisms
vale/Speciesism/IndustryEuphemisms.yml - Semgrep rules · Semgrep ruleset for speciesist-language detection
semgrep-no-animal-violence.yaml
Tooling
Generators, consistency checks, and sync automation
- Generators · Shared generator package that renders the rule model into tool-native outputs
tools/generators - Generate all · Entry point that runs all generators from the shared model
tools/generate_all.py - Consistency check · Detects drift between canonical rule representations
tools/check_consistency.py - Propagate sync · Synchronizes generated outputs and downstream updates
tools/propagate.py - Version check · Checks whether downstream adapter repos lag the canonical version
scripts/check_versions.sh - CI · Main lint and test workflow
.github/workflows/ci.yml - CodeQL · Security scanning for automation and Python code
.github/workflows/codeql.yml - Propagate wf · Automated synchronization workflow
.github/workflows/propagate.yml - Version wf · Automation for version drift monitoring
.github/workflows/version-check.yml - Desloppify wf · Automation for repository quality scoring and cleanup
.github/workflows/desloppify.yml
Downstream adapters
Tool-specific outputs consumed by external linting and scanning ecosystems
- ESLint · Downstream linting consumer generated from the shared rule model
- VS Code · Editor integration consumer for inline detection
- pre-commit · Git hook consumer for local checks
- reviewdog · Code review consumer for surfaced findings
- Danger.js · Pull-request automation consumer
- GitHub Action · Workflow consumer for repository automation
- Woke · Woke language rule consumer
- Vale · Vale prose lint consumer
- Semgrep · Semgrep scanning consumer
Connections 34
- 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