🛡️ SlopGate
The AST-Based Code Integrity & PR Shield for Open Source Maintainers
Stop AI slop pull requests before they burn out your maintainers.
Zero-dependency AST analysis that intercepts test tampering, neutered assertions, and hallucinated packages in < 0.05 seconds.
# 🎮 Try the instant interactive simulator in your terminal
pip install slopgate-cli
slopgate demo
Runs locally. Zero API keys required. No LLM tokens billed.
Why SlopGate · How It Works · CLI Usage · 10-Second Setup · The 4 Invariant Shields · Comparison · Badge
💥 The Problem: "Death by a Thousand Slops"
"The telltale signs are always the same: reports that arrive as walls of perfectly formatted text, complete with extensive bullet point lists and flawless English... and debugging information for functions that do not exist. This low-effort, high-impact abuse pattern is a denial-of-service attack on open source."
— Daniel Stenberg, Founder & Maintainer ofcurl
According to recent open-source ecosystem studies, maintainers now spend over 60% of their engineering capacity on maintenance and triage.
With the explosive rise of AI coding agents, thousands of automated and hallucinated pull requests are submitted daily. These PRs look clean on the surface:
- They pass CI by weakening tests: Deleting
assertstatements or changingassert result == expectedtoassert result is not Noneorassert True. - They hallucinate libraries: Importing non-existent cloud packages or inventing fake methods on standard library objects (
json.loads_async,os.mkdir_p). - They bury trivial logic in 50 lines of AI docstring buzzwords: Masking unverified code diffs behind walls of AI-generated markdown.
Existing "AI detector" tools try to detect "AI-sounding English text." That is the wrong layer to inspect. It creates false positives on non-native English speakers while letting broken code slip right through.
SlopGate does not judge your English. SlopGate enforces Code & Test Invariants.
⚡ How It Works
SlopGate parses the unified git diff directly into an AST (Abstract Syntax Tree) in < 50 milliseconds:
flowchart TD
PR["📥 Pull Request Opened / Synchronized"] --> SG["🛡️ SlopGate AST Engine (< 0.05s)"]
subgraph SG["🛡️ SlopGate Core (Zero Dependencies)"]
direction TB
T1["1. Test Tamper Guard<br/>Assertion deletions · Tautology swaps · try-except pass"]
T2["2. Phantom Symbol Interceptor<br/>Hallucinated imports · Non-existent stdlib methods"]
T3["3. Reproduction Gate<br/>Verifies if bugfix PR includes a test case"]
T4["4. Slop Ratio Analyzer<br/>Docstring bloat vs executable AST nodes"]
T1 --- T2 --- T3 --- T4
end
SG -->|"Integrity Intact"| PASS["✅ PASSED<br/>PR Approved for Human Review"]
SG -->|"Tampered / Hallucinated"| BLOCK["⛔ BLOCKED<br/>GitHub Step Summary + Inline Annotations"]
style PR fill:#1e293b,stroke:#3b82f6,color:#fff
style SG fill:#0f172a,stroke:#22c55e,color:#fff
style PASS fill:#064e3b,stroke:#22c55e,color:#fff
style BLOCK fill:#450a0a,stroke:#ef4444,color:#fff
🖥️ Live Terminal Simulation
Run slopgate demo to see SlopGate catch 3 real-world scenarios in real-time:
=======================================================
🎮 SLOPGATE INTERACTIVE AUDIT SIMULATOR v0.1.0
=======================================================
Scenario 1: Rogue AI PR weakens test assertion to pass CI
Simulating: Contributor PR replaces 'assert val == False' with 'assert val is not None'...
=======================================================
🛡️ SLOPGATE — Code & PR Integrity Shield
=======================================================
Diff: 2 files | +2 / -1 | Code: +0 | Tests: +1 | Docs: +1
Status: [WARNING] ⚠️ SlopGate Warning: Found 1 non-blocking notice(s).
Violations Detected:
• [SG-ASSERT_WEAKENED] Assert Weakened
Location: tests/test_auth.py:14
Details: Weakened assertion: 'is not None' checks existence instead of value equivalence.
Snippet: assert verify_token("expired_xyz") is not None
-------------------------------------------------------
Scenario 2: AI PR with phantom packages and hallucinated stdlib APIs
Simulating: PR imports 'phantom_ai_driver' and calls 'json.loads_async()'...
=======================================================
🛡️ SLOPGATE — Code & PR Integrity Shield
=======================================================
Diff: 1 files | +3 / -1 | Code: +3 | Tests: +0 | Docs: +0
Status: [BLOCKED] ⛔ SlopGate Blocked: Found 2 critical integrity violation(s).
Violations Detected:
• [SG-HALLUCINATED_IMPORT] Hallucinated Import
Location: src/database.py:5
Details: Package 'phantom_ai_driver' is not in stdlib, project dependencies, or local modules.
Snippet: symbol: phantom_ai_driver
• [SG-HALLUCINATED_STDLIB_METHOD] Hallucinated Stdlib Method
Location: src/database.py:9
Details: json has no async loads method.
Snippet: symbol: json.loads_async
💻 Local CLI Usage
Audit a branch, a saved diff, or a pipe — the same engine the Action runs:
slopgate check # auto-detects the PR/branch diff
slopgate check --fail-on warning # fail on warnings as well
slopgate check --format json # machine-readable report
slopgate check --format github # Step Summary markdown + annotations
git diff main...HEAD | slopgate check --diff - # audit any diff you have
Exit codes are CI-friendly: 0 passed, 1 blocked (or warned, with
--fail-on warning). Inside GitHub Actions SlopGate fails closed when it cannot
find a diff, so a broken checkout can never report a false pass.
🚀 10-Second GitHub Action Setup
Add .github/workflows/slopgate.yml to your repository:
name: SlopGate PR Integrity Check
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: read
jobs:
slopgate:
name: SlopGate PR Audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run SlopGate Shield
uses: Shinraya-Tech-Labs/slopgate@v0
with:
fail-on: blocked # 'blocked' (fails on tamper/hallucinations) or 'warning'
Or install it automatically into your repo:
slopgate install
🛡️ The 4 Invariant Shields
1. Test Tampering & Neutering Guard
Detects when a pull request attempts to pass failing CI by:
- Deleting
assertstatements in existing test files. - Replacing strict comparisons (
assert x == 42) with tautologies (assert x is not Noneorassert Trueorassert len(x) >= 0). - Wrapping failing assertions in silent
try: ... except: passblocks. - Explicitly adding
@pytest.mark.skipto failing tests.
2. Phantom Symbol & Hallucinated Import Detector
- Intercepts newly added
import <package>that does not exist in standard library, project manifests (pyproject.toml,requirements.txt), or local modules. - Intercepts made-up standard library methods (e.g.
json.loads_async,os.mkdir_p,re.match_all).
3. Reproduction Gate
- Checks if a pull request modifies core production logic without adding or updating a test.
- Reminds the author: "Please supply a reproduction test verifying the bug before this patch."
4. Slop-to-Logic Ratio
- Computes $\frac{\text{Docstring and explanatory comments added}}{\text{Executable AST nodes added}}$.
- Flags PRs that paste 60 lines of AI-generated architectural buzzwords for a 1-line non-functional change.
📊 SlopGate vs Text Detectors
| Capability | SlopGate | Text-Based "AI Detectors" | Standard CI Linter (flake8 / ruff) |
|---|---|---|---|
| Underlying Analysis | AST Invariants | Probabilistic Text Heuristics | Static Style Rules |
| Detects Weakened Assertions | ✅ Yes | ❌ No | ❌ No |
| Detects Hallucinated Packages | ✅ Yes | ❌ No | ⚠️ Only if installed |
| Runtime Speed | < 0.05s | 2.0s – 8.0s (LLM calls) | ~ 0.5s |
| API Costs / Token Spend | $0.00 (Zero) | $0.05 – $0.20 per PR | $0.00 |
| False Positives on Non-Native English | Zero (Code only) | ⚠️ High (Bans legitimate devs) | Zero |
| External Dependencies | 0 (Stdlib only) | Heavy / Cloud API | Python virtualenv |
🏷️ Add the Badge to Your README
Show your contributors that your project values code integrity:
[](https://github.com/Shinraya-Tech-Labs/slopgate)
🗺️ Roadmap
- Python AST assertion tamper detection
- Python stdlib & dependency hallucination detector
- Composite GitHub Action with Step Summary output
- Interactive Terminal Simulator (
slopgate demo) - TypeScript / JavaScript AST Invariant Engine (Babel / SWC parser)
- Go AST Invariant Engine
- Automatic PR reply bot with reproduction sandbox runner
🤝 Contributing
We welcome contributions! Please see CONTRIBUTING.md for local development and testing guidelines.
To run tests locally:
git clone https://github.com/Shinraya-Tech-Labs/slopgate.git
cd slopgate
pip install -e ".[dev]"
python -m pytest -q
📄 License
Apache 2.0 — Created by Shinraya Tech Labs and open-source contributors.
Metadata
Release files for slopgate-cli 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| slopgate_cli-0.1.1.tar.gz | 44.7 kB | With provenance | Details for slopgate_cli-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| slopgate_cli-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for slopgate_cli-0.1.1-py3-none-any.whl |
Total release size: 76.9 kB
Release files / slopgate_cli-0.1.1.tar.gz
| Download URL | slopgate_cli-0.1.1.tar.gz |
|---|---|
| Size | 44.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4498f3bee6d25079736bd6053720c9662169c2ebbf5009deeaa09ee098f92275
|
|
BLAKE2b-256 checksum How to use checksums |
2fcd2ab324ef8b62c44b92188aa072385614e0acf4623aa33eb98cfc1f44acbd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.
Transparency logRelease files / slopgate_cli-0.1.1-py3-none-any.whl
| Download URL | slopgate_cli-0.1.1-py3-none-any.whl |
|---|---|
| Size | 32.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6a8ca522582df367a774d0dbddeb2e68fc02049aa491b073d5493d5c35b52b21
|
|
BLAKE2b-256 checksum How to use checksums |
55b1b971c9160dae5e2eadfd0e6688a5aa2fb67b2a1c2d7d73e94bf49db28631
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.
Transparency logSecurity for slopgate-cli 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for slopgate_cli-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.