Skip to main content

ZMB Standalone Codebase Auditor (zmb_audit.py)

A zero-dependency, standard-library-only static AST auditor that catches the exact failure modes AI coding agents introduce while passing unit tests.

What It Catches

  1. Orphan Modules: Non-test Python modules that exist in the repo but are never imported by anything.
  2. Unresolved Repo-Class Attribute Calls: Method calls on classes defined inside your repository where the method does not exist (zero false positives on stdlib or third-party objects).
  3. Silent Exception Fallbacks: Broad except Exception: / except: blocks that swallow errors and return [], {}, None, "", or pass, turning fatal runtime bugs into false-green tests.
  4. Git Pre-Commit Guard Status: Checks whether out-of-process pre-commit protection is active.

Requirements

  • Python 3.8+ (Stdlib only — zero runtime dependencies).

Installation (v0.2.0)

# Install CLI command directly from GitHub
pip install git+https://github.com/ADevBelgie/zmb-audit.git

# Or run standalone with zero install
curl -sLO https://raw.githubusercontent.com/ADevBelgie/zmb-audit/main/zmb_audit.py

Usage

# Run via installed CLI entry point
zmb-audit . --strict

# Or run standalone script directly
python zmb_audit.py

# Audit specific repository path
python zmb_audit.py /path/to/repository

# CI mode: exit 1 if orphan modules or unresolved repo-class calls are detected
python zmb_audit.py /path/to/repository --strict

# Output structured JSON
python zmb_audit.py /path/to/repository --json

# Output SARIF v2.1.0 for GitHub Code Scanning
zmb-audit /path/to/repository --sarif --out zmb-audit.sarif

# Exclude custom directories
python zmb_audit.py /path/to/repository --exclude legacy_code experimental

Example Output

================================================================
[AUDIT] ZMB STANDALONE REPOSITORY AUDIT: /path/to/repo
================================================================
[*] Health Score:        97/100
[*] Total Python Files:  42
[*] Pre-Commit Guard:    PROTECTED
----------------------------------------------------------------
[OK] Zero Orphan Modules detected.
[OK] Zero unresolved repo-class attribute calls.
[!] Silent Exception Fallbacks (1):
   - app/fetcher.py (line 44: broad except returns empty default)
================================================================

Drop-In GitHub Actions Marketplace & Code Scanning (SARIF)

name: Agent Code Audit
on: [pull_request]
permissions:
  security-events: write
jobs:
  audit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: ADevBelgie/zmb-audit@v0.3.1
        with:
          strict: "true"
          sarif-file: zmb-audit.sarif
      - if: always()
        uses: github/codeql-action/upload-sarif@v3
        with:
          sarif_file: zmb-audit.sarif

PyPI Trusted Publishing

Releases published from main trigger .github/workflows/publish-pypi.yml (python -m build, twine check, and OIDC pypa/gh-action-pypi-publish). Configure a PyPI Trusted Publisher pointing at ADevBelgie/zmb-audit (environment: pypi) once, then publish a GitHub Release for v0.3.1.

Full Report & CI Governance Kit

For the 10-chapter empirical postmortem (144+ autonomous cycles), Python 3.14 sys.monitoring live-path reachability tracer, pre-commit cryptographic guard, and two-arm benchmark starter:

Get the ZMB Failure-Mode Report & Governance Kit

Metadata

Release files for zmb-audit 0.3.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 zmb-audit 0.3.1
File Size Uploaded Provenance Actions
zmb_audit-0.3.1.tar.gz 10.4 kB With provenance Details for zmb_audit-0.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for zmb-audit 0.3.1
File Interpreter ABI Platform Actions
zmb_audit-0.3.1-py3-none-any.whl Python 3 none any Details for zmb_audit-0.3.1-py3-none-any.whl

Total release size: 21.9 kB

Release files / zmb_audit-0.3.1.tar.gz

Download URL zmb_audit-0.3.1.tar.gz
Size 10.4 kB
Tags Source
SHA-256 checksum
How to use checksums
cf975d515da5b025d01529aadb96c929aec239b2cede8e3d9267a433a263d7bb
BLAKE2b-256 checksum
How to use checksums
67e69240bec742c4951cd71e079944123db51fba4a05b258a58cf14e7210cd38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.

Transparency log

Release files / zmb_audit-0.3.1-py3-none-any.whl

Download URL zmb_audit-0.3.1-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f288f16c90888db0e1d6896635a0b7158f876be1801ef5cd1711616514d86cca
BLAKE2b-256 checksum
How to use checksums
845a358252fc0f5eab71b6e6ee7aea551aed80d3b8bfb33941ed9490a7854386
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.

Transparency log

Security for zmb-audit 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for zmb_audit-0.3.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files Full provenance

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