cd /news/developer-tools/gating-github-pull-requests-for-ast-… · home › topics › developer-tools › article
[ARTICLE · art-180106] src=dev.to ↗ pub= topic=developer-tools verified=true sentiment=↑ positive

Gating GitHub Pull Requests for AST Review Friction and Phantom Python Imports (slopcodemonitor-action@v1)

A developer released slopcodemonitor-action@v1, a zero-dependency composite GitHub Action that uses Python's built-in ast module to flag structural code-review risks in pull requests, including phantom imports, swallowed exceptions, and deep nesting or monolithic functions. The Action runs on ubuntu-latest in under two seconds, writes a Markdown report to $GITHUB_STEP_SUMMARY, and benchmarks each repository's score against cohort means drawn from 7,352 scanned open-source repositories, with Python at 13.34 out of 100 and TypeScript at 2.34.

key takeaway

The Action gates pull requests on a 0-100 structural score with a configurable fail-on-score threshold (default 35) and reports each repo's score against ecosystem cohort means such as Python's 13.34.

by read2 min views5 publishedDec 2, 2026

AI-assisted code generation is not inherently a software defect - most engineering teams use coding assistants every day to ship faster.

The operational bottleneck is pull-request review throughput versus diff velocity. When 800-line diffs arrive faster than senior engineers can read them line by line, three structural risks slip into production:

import statements that happen to resolve locally via transitive packages (or do not exist in pyproject.toml / requirements.txt at all).except Exception: pass or empty catch {} blocks that make CI tests green while hiding production failures.depth >= 6) and 150-line monolithic functions that nobody on on-call can safely debug. To catch these deterministically in CI without external SaaS tokens or probabilistic "AI authorship detectors," I packaged our core heuristics into a zero-dependency composite GitHub Action: evan-mercer-dev/slopcodemonitor-action@v1, benchmarked directly against the 7,352 open-source repositories (~3.9B LOC) tracked on SlopCodeMonitor.

.github/workflows/slopcodemonitor.yml) The Action runs on standard ubuntu-latest runners in under 2 seconds using Python's built-in ast module:

name: Code Review & Supply-Chain Gate

on:
  pull_request:
  push:
    branches: [main]

jobs:
  review-risk:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: SlopCodeMonitor AST & Dependency Gate
        uses: evan-mercer-dev/slopcodemonitor-action@v1
        with:
          path: "."
          fail-on-score: "35"   # Omit or set "101" for non-blocking PR summaries

Raw static warnings are hard to calibrate without ecosystem baselines. Every run writes a Markdown report into $GITHUB_STEP_SUMMARY comparing your repository's score against the empirical cohort means from slopcodemonitor.ai:

Language Ecosystem Scanned OSS Repos Mean Cohort Baseline ( /100 ) Canonical Reference
Python 1,310 13.34 Python Benchmark
TypeScript 1,240 2.34 TypeScript Benchmark
JavaScript 555 3.48 JavaScript Benchmark
Rust 492 1.70 Rust Benchmark
Go 671 1.40 Go Benchmark

If your public repository is already among the 7,352 scanned projects (you can check via the Hugging Face Explorer Space or the Top 200 Monitored Repos Index), the Action automatically links your published AST evidence profile in the CI job summary.

MIT) evan-mercer-dev/slopcodemonitor-action``v1.0.0`` CC-BY-4.0) If there are additional structural AST checks (e.g. Go or Rust syn patterns) you would find valuable in PR summaries, open an issue on slopcodemonitor-action!

── more in #developer-tools 4 stories · sorted by recency
── more on @github 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/gating-github-pull-r…] indexed:0 read:2min 2026-12-02 · —