Skip to main content

doc-ai-slopcheck

License: MIT Rules

Deterministic scanner for AI-style code failures. 73 rules. No LLM. No backend.

Digitalist fork of ai-slopcheck by Euraika, which is no longer published.

Catches the mistakes AI coding assistants leave behind — stub functions, silent error handling, hallucinated placeholders, hardcoded secrets, and 68 more patterns across Python, JS/TS, Go, C/C++, SQL, and Markdown.


Install

pip install git+https://github.com/Digitalist-Open-Cloud/AI-Slopcheck.git

Quick Start

# Scan a project
doc-ai-slopcheck scan . --output findings.json --fail-on warning

# View results
doc-ai-slopcheck summary findings.json

# GitHub Security tab (SARIF)
doc-ai-slopcheck sarif findings.json

# Only scan changed files (CI)
doc-ai-slopcheck scan . --changed-files git --fail-on warning

What It Catches

Category Rules Examples
AI Detection 16 Stub functions, instruction comments, plan/task IDs in comments, conversational bleed, identity refusals
Security 7 Hardcoded secrets, SQL injection, XSS, weak hashing, obfuscated code
JavaScript / Node 11 await-in-loop, unguarded JSON.parse, loose equality, React antipatterns
Go 3 Ignored errors, missing defer, wrong error wrapping
Python 1 Mutable default arguments
Cross-Language 17 Debug code, unreachable code, deep inheritance, dangerous shell in markdown
Data-Flow 4 Contradictory null checks, lock safety, IDOR risk, thread-unsafe globals
Quality 9 Large functions (>150 lines), copy-pasted code across files, plus opt-in deep nesting
API Contract 1 Removed routes, deprecated endpoints
Repo-Specific 1 Import boundary violations
Meta 1 Unused suppression directives

Features

  • 73 deterministic rules — no LLM, no network, no randomness
  • 6 languages — Python, JS/TS, Go, C/C++, SQL, Markdown
  • Inline suppression — # slopcheck: ignore[rule_id], or # slopcheck: ignore-next[duplicate_code] above a copied block
  • SARIF output — integrates with GitHub Security tab
  • HTML report — standalone, shareable page (doc-ai-slopcheck html findings.json > report.html)
  • Diff-only mode — scan only changed files (--changed-files git)
  • Baselines — suppress existing findings, fail only on new ones
  • API snapshots — detect removed API routes
  • Tree-sitter — optional AST context for better precision
  • Threaded — multi-core scanning (--jobs N)
  • Confidence filtering — --min-confidence medium for high-signal-only mode

GitHub Actions

name: slopcheck
on: [pull_request]
jobs:
  scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with: { python-version: '3.12' }
      - run: pip install git+https://github.com/Digitalist-Open-Cloud/AI-Slopcheck.git
      - run: doc-ai-slopcheck scan . --output findings.json --fail-on warning
      - run: doc-ai-slopcheck github-annotations findings.json
      - run: doc-ai-slopcheck sarif findings.json > results.sarif
      - uses: github/codeql-action/upload-sarif@v3
        with: { sarif_file: results.sarif }

Baselines (Incremental Adoption)

# First run: baseline existing findings
doc-ai-slopcheck scan . --output findings.json --fail-on none
doc-ai-slopcheck create-baseline findings.json

# CI: only fail on NEW findings
doc-ai-slopcheck scan . --baseline .slopcheck/baseline.json --fail-on warning

CLI Reference

Command Purpose
doc-ai-slopcheck scan [paths] Scan files, write findings JSON
doc-ai-slopcheck summary <file> Markdown summary
doc-ai-slopcheck github-annotations <file> GitHub workflow annotations
doc-ai-slopcheck sarif <file> SARIF v2.1.0 output
doc-ai-slopcheck html <file> > report.html Standalone HTML report
doc-ai-slopcheck create-baseline <file> Create fingerprint baseline
doc-ai-slopcheck api-snapshot Snapshot API routes for contract checks

Key scan Options

Option Default Description
--fail-on error Exit 1 at severity: none / note / warning / error
--min-confidence low Filter: low / medium / high
--baseline — Suppress fingerprints from baseline file
--changed-files — git or @file.txt for diff-only mode
--jobs auto Thread count (0=auto, 1=sequential)
--api-baseline — API snapshot for contract comparison

Configuration

Create .slopcheck/config.yaml (or .slopcheck.yaml):

rules:
  # Disable a rule
  js_loose_equality:
    enabled: false
  
  # Enable an opt-in rule with custom threshold
  deep_nesting:
    enabled: true
    max_depth: 5
  
  # Configure detection
  hallucinated_placeholder:
    allowed_domains: ["example.com", "localhost"]

Tree-sitter (Optional)

For better precision (~5% improvement on string/comment context detection):

pip install "doc-ai-slopcheck[ast] @ git+https://github.com/Digitalist-Open-Cloud/AI-Slopcheck.git"
# Or manually:
pip install tree-sitter-python tree-sitter-javascript tree-sitter-go tree-sitter-typescript

Project Layout

doc_ai_slopcheck/
├── cli.py                 — 6 CLI commands
├── config.py              — 50+ Pydantic config models
├── models.py              — Finding, ScanResult (stable contract)
├── engine/
│   ├── scanner.py         — Threaded orchestrator
│   ├── duplication.py     — Cross-file copy-paste detector
│   ├── suppression.py     — Inline ignore parser
│   └── context_filter.py  — String/comment detector
├── parsers/
│   └── treesitter.py      — Optional AST adapter
├── rules/
│   ├── generic/           — 71 cross-repo rules
│   └── repo/              — 1 architecture rule
├── output/
│   ├── sarif.py           — SARIF v2.1.0
│   ├── annotations.py     — GitHub annotations
│   └── markdown_summary.py
└── state/
    └── store.py           — Baseline persistence

Development

Requires Python 3.12+ and Poetry 2.x.

poetry install            # add --all-extras for tree-sitter and requests
poetry run pytest
poetry run ruff check .
poetry build

License

MIT — Euraika 2026. Fork maintained by Digitalist.

Metadata

Release files for doc-ai-slopcheck 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for doc-ai-slopcheck 1.2.1
File Size Uploaded
doc_ai_slopcheck-1.2.1.tar.gz 90.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for doc-ai-slopcheck 1.2.1
File Interpreter ABI Platform
doc_ai_slopcheck-1.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 245.6 kB

Release files / doc_ai_slopcheck-1.2.1.tar.gz

Download URL doc_ai_slopcheck-1.2.1.tar.gz
Size 90.7 kB
Tags Source
SHA-256 checksum
How to use checksums
30d8ccfdbd9ebb5573fff3b538d94319c0def29f9121b5cb8499abb78359c07d
BLAKE2b-256 checksum
How to use checksums
e85e704e174eb0ac2cf3f7eacb566e884cf7ad051cc17870f38d9ebce7b680fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.3.4 CPython/3.13.4 Darwin/25.5.0

Release files / doc_ai_slopcheck-1.2.1-py3-none-any.whl

Download URL doc_ai_slopcheck-1.2.1-py3-none-any.whl
Size 154.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a68e67735b8510cee84c98af70ee3a977659598d34719ef2b0c5152ab31d3c51
BLAKE2b-256 checksum
How to use checksums
cb689c4d373354c3f3e1e5f8793466376e8f9772db6141e26bd0c6ee19808c89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.3.4 CPython/3.13.4 Darwin/25.5.0

Release history Release notifications | RSS feed

1.2.7

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

This release

1.2.1 This release

2 release files

1.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page