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 .ai_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 .ai_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

ai_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.2.0.tar.gz (128.0 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.2.0-py3-none-any.whl (141.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ai_slopcheck-1.2.0.tar.gz
  • Upload date:
  • Size: 128.0 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.2.0.tar.gz
Algorithm Hash digest
SHA256 76b4c68e3d5cefe0b8b81314bfd69b8b0bf1f82b9856732624304e0f5f1ee7ab
MD5 0d602448a9c1996ca1c84e387c15b3ed
BLAKE2b-256 9f6ad6525a4ffaad9d11e3648fc4272a561eb87b2da3b90a1b9d0ee0caddf2e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_slopcheck-1.2.0.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: ai_slopcheck-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 141.5 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cc4ddf9aa0e318689b462931467b16f2f6ac650a9729da72174a43885b45e6dd
MD5 4fcb5b1113b34693fe7289fb2b39caf1
BLAKE2b-256 af3df9cf2642f78c83f025638cf35045168b15d1f487b29a590d89a1273362af

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_slopcheck-1.2.0-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