Skip to main content

Deterministic scanner for AI-style code failures. 72 rules for Python, JS/TS, Go, C/C++, SQL.

Project description

ai-slopcheck

PyPI Python License: MIT Tests Rules

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

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 ai-slopcheck

Quick Start

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

# View results
ai-slopcheck summary findings.json

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

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

What It Catches

Category Rules Examples
AI Detection 15 Stub functions, instruction 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 Deep nesting, large functions, duplication (opt-in)
API Contract 1 Removed routes, deprecated endpoints
Repo-Specific 1 Import boundary violations
Meta 1 Unused suppression directives

Features

  • 72 deterministic rules — no LLM, no network, no randomness
  • 6 languages — Python, JS/TS, Go, C/C++, SQL, Markdown
  • Inline suppression# slopcheck: ignore[rule_id]
  • SARIF output — integrates with GitHub Security tab
  • 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 ai-slopcheck
      - run: ai-slopcheck scan . --output findings.json --fail-on warning
      - run: ai-slopcheck github-annotations findings.json
      - run: 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
ai-slopcheck scan . --output findings.json --fail-on none
ai-slopcheck create-baseline findings.json

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

CLI Reference

Command Purpose
ai-slopcheck scan [paths] Scan files, write findings JSON
ai-slopcheck summary <file> Markdown summary
ai-slopcheck github-annotations <file> GitHub workflow annotations
ai-slopcheck sarif <file> SARIF v2.1.0 output
ai-slopcheck create-baseline <file> Create fingerprint baseline
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:

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 ai-slopcheck[ast]
# Or manually:
pip install tree-sitter-python tree-sitter-javascript tree-sitter-go tree-sitter-typescript

Project Layout

slopcheck/
├── cli.py                 — 6 CLI commands
├── config.py              — 50+ Pydantic config models
├── models.py              — Finding, ScanResult (stable contract)
├── engine/
│   ├── scanner.py         — Threaded orchestrator
│   ├── 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

Documentation

Document Content
Architecture Runtime model, data model, threading, rule tables
Rule Catalog All 72 rules with examples and FP notes
Rule Authoring How to add new rules
Configuration All config options
CLI Reference Commands and flags
User Guide Getting started, CI setup
Security Model Threat model, safety
Wiki FAQ, tutorials

Contributing

See CONTRIBUTING.md. Quick summary:

  1. Branch from develop
  2. Add rule + config + tests
  3. pytest && ruff check .
  4. Merge request

License

MIT — Euraika 2026

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ai_slopcheck-1.0.1.tar.gz (124.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ai_slopcheck-1.0.1-py3-none-any.whl (139.3 kB view details)

Uploaded Python 3

File details

Details for the file ai_slopcheck-1.0.1.tar.gz.

File metadata

  • Download URL: ai_slopcheck-1.0.1.tar.gz
  • Upload date:
  • Size: 124.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ai_slopcheck-1.0.1.tar.gz
Algorithm Hash digest
SHA256 4922292ea833088aac5826ef0619c26bcc60d2720b79174531fd4cc7772e5477
MD5 c37f54a975ffb1fc4473ab087bf80659
BLAKE2b-256 475ec9727016ce8d2e74f4e24715e88ec800c486b857b6be36501199e4c5e4b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_slopcheck-1.0.1.tar.gz:

Publisher: publish.yml on anubissbe/ai-slopcheck

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ai_slopcheck-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: ai_slopcheck-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 139.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ai_slopcheck-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c21b481ed381dd1ef45213aa46f56299b6e11362a3a0638001e3120022601df7
MD5 e4a83d89eff06eeb20a017cdba0ce314
BLAKE2b-256 5dbc62e772f628369c7fb6908c8a974058a922039cbd8d5a79243ad09dd0050e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_slopcheck-1.0.1-py3-none-any.whl:

Publisher: publish.yml on anubissbe/ai-slopcheck

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page