{"slug": "gating-github-pull-requests-for-ast-review-friction-and-phantom-python-imports", "title": "Gating GitHub Pull Requests for AST Review Friction and Phantom Python Imports (slopcodemonitor-action@v1)", "summary": "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.", "body_md": "AI-assisted code generation is not inherently a software defect - most engineering teams use coding assistants every day to ship faster.\n\nThe 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:\n\n`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.\nTo 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`**](https://github.com/evan-mercer-dev/slopcodemonitor-action), benchmarked directly against the **7,352 open-source repositories (~3.9B LOC)** tracked on [**SlopCodeMonitor**](https://slopcodemonitor.ai/).\n\n`.github/workflows/slopcodemonitor.yml`)\nThe Action runs on standard `ubuntu-latest` runners in under 2 seconds using Python's built-in `ast` module:\n\n```\nname: Code Review & Supply-Chain Gate\n\non:\n  pull_request:\n  push:\n    branches: [main]\n\njobs:\n  review-risk:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - name: SlopCodeMonitor AST & Dependency Gate\n        uses: evan-mercer-dev/slopcodemonitor-action@v1\n        with:\n          path: \".\"\n          fail-on-score: \"35\"   # Omit or set \"101\" for non-blocking PR summaries\n```\n\nRaw 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](https://slopcodemonitor.ai/):\n\n| Language Ecosystem | Scanned OSS Repos | Mean Cohort Baseline ( `/100` ) | Canonical Reference | \n|---|---|---|---|\n| **Python** | 1,310 | **13.34** | [Python Benchmark](https://slopcodemonitor.ai/benchmark-language-python.html) | \n| **TypeScript** | 1,240 | **2.34** | [TypeScript Benchmark](https://slopcodemonitor.ai/benchmark-language-typescript.html) | \n| **JavaScript** | 555 | **3.48** | [JavaScript Benchmark](https://slopcodemonitor.ai/benchmark-language-javascript-b27ad06d12.html) | \n| **Rust** | 492 | **1.70** | [Rust Benchmark](https://slopcodemonitor.ai/benchmark-language-rust.html) | \n| **Go** | 671 | **1.40** | [Go Benchmark](https://slopcodemonitor.ai/benchmark-language-go-6cc8519b91.html) | \n\nIf your public repository is already among the 7,352 scanned projects (you can check via the [Hugging Face Explorer Space](https://huggingface.co/spaces/Evan-Mercer-Dev/slopcodemonitor-explorer) or the [Top 200 Monitored Repos Index](https://github.com/evan-mercer-dev/slopcodemonitor.ai/blob/main/TOP_200_REPOSITORIES.md)), the Action automatically links your published AST evidence profile in the CI job summary.\n\n`MIT`)` evan-mercer-dev/slopcodemonitor-action``v1.0.0`` CC-BY-4.0`)\nIf 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`](https://github.com/evan-mercer-dev/slopcodemonitor-action/issues)!", "url": "https://wpnews.pro/news/gating-github-pull-requests-for-ast-review-friction-and-phantom-python-imports", "canonical_source": "https://dev.to/evanmercerdev_63/gating-github-pull-requests-for-ast-review-friction-and-phantom-python-imports-4k8l", "published_at": "2026-12-02 10:07:38+00:00", "updated_at": "2026-12-02 10:14:25.681652+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "ai-agents"], "entities": ["GitHub", "SlopCodeMonitor", "evan-mercer-dev", "Hugging Face", "Python"], "also_reported_by": [], "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.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/gating-github-pull-requests-for-ast-review-friction-and-phantom-python-imports", "markdown": "https://wpnews.pro/news/gating-github-pull-requests-for-ast-review-friction-and-phantom-python-imports.md", "text": "https://wpnews.pro/news/gating-github-pull-requests-for-ast-review-friction-and-phantom-python-imports.txt", "jsonld": "https://wpnews.pro/news/gating-github-pull-requests-for-ast-review-friction-and-phantom-python-imports.jsonld"}}