Skip to main content

arch-auditor

Evidence-backed repository architecture analysis. Deterministic static analysis first (AST-level facts, import graphs, cycle detection, coupling, blast radius), with Gemini as an optional explain-and-plan assistant. Ships a Streamlit web app and a CLI from the same engine.

  • Python 3.10+
  • Detectors: circular dependencies, high coupling, large modules, layer violations; plus a blast-radius impact report per module.
  • Ruleset-driven layer validation (config/architecture.yaml).
  • Architecture model, findings, severity, impact: arch_auditor/models/.
  • Detector engine: arch_auditor/analyzer/.
  • Gemini integration (overview, per-finding insights, refactoring plans): arch_auditor/ai/.
  • Streamlit single-page app: app.py (7 sections per the UI spec).

Install

pip install -e .

or, once published, pip install arch-auditor.

CLI

# Analyze a repository
arch-auditor analyze path/to/repo

# Analyze the bundled demo repository
arch-auditor demo

# Ask Gemini for a refactoring plan for one finding (needs GEMINI_API_KEY)
arch-auditor plan CIRCULAR_DEPENDENCY_1 path/to/repo

# Version
arch-auditor --version

The CLI returns exit code 1 when findings exist, 0 when the repository is clean, and 2 for usage errors. The Gemini key is read from the environment only and is never logged.

Web app

streamlit run app.py

Open the generated localhost URL. Enter a repository path (default: the bundled demo_repo) and press ANALYZE.

For Streamlit Community Cloud: connect the repo and set the main script path to arch-auditor/app.py. Dependencies come from arch-auditor/requirements.txt.

Reference architecture ruleset

Layer validation is opt-in: drop config/architecture.yaml (see arch_auditor/config/architecture.yaml) into the repository being analyzed. Without a ruleset, layer validation is skipped and the remaining detectors run on structure alone.

Gemini key

Optional. Set GEMINI_API_KEY in the environment (CLI) or paste a key into the app's sidebar (session only).

Demo repository

demo_repo/ is an intentionally problematic repository that exercises every detector:

  • cycle orders -> payments -> users -> orders
  • payment_service.py: > 30 functions (LARGE_MODULE), fan-in 5 + fan-out 1 (HIGH_COUPLING, HIGH impact)
  • database.py -> api.py inverts the layer rules (LAYER_VIOLATION)

Development

pip install -e ".[dev]"
ruff check .
pytest -q
python -m build

CI (.github/workflows/ci.yml) runs ruff, pytest, pip-audit (dependency CVE scan), and builds + verifies the distribution on every push and PR. CodeQL and weekly Dependabot updates keep the supply chain current.

License

GPL-3.0-only. See LICENSE in the repository root and arch-auditor/LICENSE (shipped inside the wheel).

Metadata

Release files for arch-auditor 0.1.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 arch-auditor 0.1.1
File Size Uploaded
arch_auditor-0.1.1.tar.gz 38.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for arch-auditor 0.1.1
File Interpreter ABI Platform
arch_auditor-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 79.9 kB

Release files / arch_auditor-0.1.1.tar.gz

Download URL arch_auditor-0.1.1.tar.gz
Size 38.1 kB
Tags Source
SHA-256 checksum
How to use checksums
43d33a8c1096a7f370206a46e99139d98b82da3426fe218ed656d3cccd730255
BLAKE2b-256 checksum
How to use checksums
50ff8998f5de5bdd49d35fd55441c37ad73ebda5008f0021c50f139df883e25a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 4, 2026.

Transparency log

Release files / arch_auditor-0.1.1-py3-none-any.whl

Download URL arch_auditor-0.1.1-py3-none-any.whl
Size 41.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a245d2313dd764530613a0e626112bb9f83ccd416730c939f5c3d0e753b342ff
BLAKE2b-256 checksum
How to use checksums
726db76194a0e7b76a40fae62879e4b03a612ef42c5dabaa4bdc9f46d3f3f972
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 4, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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