# tinyfrontier/anti-slop-py architecture

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

- Interactive diagram: https://gitdiagram.com/tinyfrontier/anti-slop-py
- Repository: https://github.com/tinyfrontier/anti-slop-py
- Video tour (about a minute): https://gitdiagram.com/tinyfrontier/anti-slop-py/video

## Overview

anti-slop-py is a zero-dependency Python linter for syntactic patterns that weaken type evidence. Its main workflow is: the CLI loads configuration and selects files (optionally by diff), the engine runs enabled rules over each file, and findings are filtered or formatted for output. The graph also preserves the documented baseline, SARIF, review, presets, and opt-in FastAPI capabilities. Exact orchestration beyond the sampled excerpts is based on README documentation; uncertain internal calls are omitted.

Main entry points: [`src/anti_slop/__main__.py`](https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/__main__.py) (CLI entry), [`src/anti_slop/engine/runner.py`](https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/engine/runner.py) (Rule runner), [`src/anti_slop/engine/config.py`](https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/engine/config.py) (Config and presets), [`src/anti_slop/engine/diff.py`](https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/engine/diff.py) (Diff selection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["CLI interface"]
  node_cli["CLI entry<br/>[__main__.py]"]
end

subgraph group_engine["Analysis engine"]
  node_configuration["Config and presets<br/>[config.py]"]
  node_diff_scope["Diff selection<br/>[diff.py]"]
  node_file_walk["File walking<br/>[walker.py]"]
  node_scope_table["Lexical scopes<br/>[scopes.py]"]
  node_rule_context["Rule context<br/>[context.py]"]
  node_comment_suppressions["Comment suppressions<br/>[comments.py]"]
  node_runner["Rule runner<br/>[runner.py]"]
end

subgraph group_rules["Rule sets"]
  node_core_registry["Core registry<br/>[__init__.py]"]
  node_core_rules["Core rules"]
  node_annotation_helpers["Annotation analysis<br/>[_annotations.py]"]
  node_fastapi_group["FastAPI rules"]
end

subgraph group_reporting["Findings and review"]
  node_baseline["Findings baseline<br/>[baseline.py]"]
  node_fingerprints["Finding fingerprints<br/>[fingerprint.py]"]
  node_review["Change review<br/>[review.py]"]
  node_sarif["SARIF output<br/>[sarif.py]"]
  node_diagnostics["Diagnostics<br/>[rule.py]"]
end

node_developer(("Developer"))
node_source["Python source"]
node_project_config["Project config"]
node_git["Git diff"]
node_result["Lint result"]

node_developer -->|"invokes"| node_cli
node_source -->|"selects paths"| node_cli
node_project_config -->|"configures"| node_configuration
node_cli -->|"loads"| node_configuration
node_cli -->|"requests changed lines"| node_diff_scope
node_git -->|"provides changes"| node_diff_scope
node_cli -->|"selects targets"| node_file_walk
node_diff_scope -->|"limits scan"| node_cli
node_cli -->|"runs checks"| node_runner
node_file_walk -->|"provides files"| node_runner
node_core_registry -->|"supplies rules"| node_runner
node_configuration -->|"sets enabled rules"| node_runner
node_runner -->|"builds per-file scopes"| node_scope_table
node_runner -->|"creates context"| node_rule_context
node_rule_context -->|"checks suppressions"| node_comment_suppressions
node_runner -->|"dispatches rules"| node_core_rules
node_core_rules -->|"uses"| node_annotation_helpers
node_configuration -.->|"enables optionally"| node_fastapi_group
node_runner -.->|"dispatches when enabled"| node_fastapi_group
node_core_rules -->|"reports findings"| node_diagnostics
node_fastapi_group -->|"reports findings"| node_diagnostics
node_runner -->|"filters findings"| node_baseline
node_runner -->|"fingerprints findings"| node_fingerprints
node_cli -->|"composes review"| node_review
node_diff_scope -->|"scopes review"| node_review
node_review -->|"formats findings"| node_diagnostics
node_cli -->|"formats output"| node_sarif
node_cli -->|"prints findings"| node_result

click node_cli "https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/__main__.py"
click node_configuration "https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/engine/config.py"
click node_diff_scope "https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/engine/diff.py"
click node_file_walk "https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/engine/walker.py"
click node_scope_table "https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/engine/scopes.py"
click node_rule_context "https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/engine/context.py"
click node_comment_suppressions "https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/engine/comments.py"
click node_runner "https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/engine/runner.py"
click node_core_registry "https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/__init__.py"
click node_core_rules "https://github.com/tinyfrontier/anti-slop-py/tree/main/src/anti_slop/rules"
click node_annotation_helpers "https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/rules/_annotations.py"
click node_fastapi_group "https://github.com/tinyfrontier/anti-slop-py/tree/main/src/anti_slop/contrib/fastapi"
click node_baseline "https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/engine/baseline.py"
click node_fingerprints "https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/engine/fingerprint.py"
click node_review "https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/engine/review.py"
click node_sarif "https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/engine/sarif.py"
click node_diagnostics "https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/engine/rule.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_cli toneBlue
class node_configuration,node_diff_scope,node_file_walk,node_scope_table,node_rule_context,node_comment_suppressions,node_runner toneAmber
class node_core_registry,node_core_rules,node_annotation_helpers,node_fastapi_group toneMint
class node_baseline,node_fingerprints,node_review,node_sarif,node_diagnostics toneRose
class node_developer,node_source,node_project_config,node_git,node_result toneIndigo
```

## Components

### CLI interface

- [CLI entry](https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/__main__.py): `src/anti_slop/__main__.py`

### Analysis engine

- [Config and presets](https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/engine/config.py): `src/anti_slop/engine/config.py`
- [Diff selection](https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/engine/diff.py): `src/anti_slop/engine/diff.py`
- [File walking](https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/engine/walker.py): `src/anti_slop/engine/walker.py`
- [Lexical scopes](https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/engine/scopes.py): `src/anti_slop/engine/scopes.py`
- [Rule context](https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/engine/context.py): `src/anti_slop/engine/context.py`
- [Comment suppressions](https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/engine/comments.py): `src/anti_slop/engine/comments.py`
- [Rule runner](https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/engine/runner.py): `src/anti_slop/engine/runner.py`

### Rule sets

- [Core registry](https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/__init__.py): `src/anti_slop/__init__.py`
- [Core rules](https://github.com/tinyfrontier/anti-slop-py/tree/main/src/anti_slop/rules): `src/anti_slop/rules`
- [Annotation analysis](https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/rules/_annotations.py): `src/anti_slop/rules/_annotations.py`
- [FastAPI rules](https://github.com/tinyfrontier/anti-slop-py/tree/main/src/anti_slop/contrib/fastapi): `src/anti_slop/contrib/fastapi`

### Findings and review

- [Findings baseline](https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/engine/baseline.py): `src/anti_slop/engine/baseline.py`
- [Finding fingerprints](https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/engine/fingerprint.py): `src/anti_slop/engine/fingerprint.py`
- [Change review](https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/engine/review.py): `src/anti_slop/engine/review.py`
- [SARIF output](https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/engine/sarif.py): `src/anti_slop/engine/sarif.py`
- [Diagnostics](https://github.com/tinyfrontier/anti-slop-py/blob/main/src/anti_slop/engine/rule.py): `src/anti_slop/engine/rule.py`

### Other components

- **Developer**
- **Python source**
- **Project config**
- **Git diff**
- **Lint result**

## Connections

- Developer → CLI entry: invokes
- Python source → CLI entry: selects paths
- Project config → Config and presets: configures
- CLI entry → Config and presets: loads
- CLI entry → Diff selection: requests changed lines
- Git diff → Diff selection: provides changes
- CLI entry → File walking: selects targets
- Diff selection → CLI entry: limits scan
- CLI entry → Rule runner: runs checks
- File walking → Rule runner: provides files
- Core registry → Rule runner: supplies rules
- Config and presets → Rule runner: sets enabled rules
- Rule runner → Lexical scopes: builds per-file scopes
- Rule runner → Rule context: creates context
- Rule context → Comment suppressions: checks suppressions
- Rule runner → Core rules: dispatches rules
- Core rules → Annotation analysis: uses
- Config and presets → FastAPI rules: enables optionally
- Rule runner → FastAPI rules: dispatches when enabled
- Core rules → Diagnostics: reports findings
- FastAPI rules → Diagnostics: reports findings
- Rule runner → Findings baseline: filters findings
- Rule runner → Finding fingerprints: fingerprints findings
- CLI entry → Change review: composes review
- Diff selection → Change review: scopes review
- Change review → Diagnostics: formats findings
- CLI entry → SARIF output: formats output
- CLI entry → Lint result: prints findings
