StackVet (stackvet)
Universal Project Health & Static Diagnostics Engine
Rigorously examine, inspect, and evaluate modern polyglot application stacks for health, safety, concurrency hazards, and architectural soundness in milliseconds.
Table of Contents
- Overview
- Key Features
- Installation
- Quick Start
- CLI Command Guide
stackvet doctor(aliases:diagnose,health)stackvet check(aliases:scan,audit)stackvet inspect(aliases:examine,details)stackvet explainstackvet fix(aliases:remediate,auto-fix)stackvet graph(aliases:architecture,dependencies)stackvet baselinestackvet init(alias:setup)stackvet rules(aliases:catalog,list-rules)
- Diagnostic Rules Catalog (132 Rules)
- Python Dependency Rules (
DEP-xxx) - Node Dependency Rules (
NDEP-xxx) - Import & Architecture Rules (
IMP-xxx,ARC-xxx) - Environment & Drift Rules (
ENV-xxx) - Docker Rules (
DOC-xxx) - FastAPI Framework Rules (
FAP-xxx) - SQLAlchemy Rules (
SQL-xxx) - Django Rules (
DJG-xxx) - Celery Rules (
CEL-xxx) - React & Next.js Rules (
RCT-xxx,NXT-xxx)
- Python Dependency Rules (
- Output Formats
- CI/CD Integration
- Publishing to npm & PyPI
- Architecture & Workspace Structure
- Contributing
- License
Overview
Modern software applications are polyglot by nature: Python backends (FastAPI, Django), Node/TypeScript frontends (React, Next.js), Docker containers, and CI/CD pipelines.
When applications break, developers often suffer from alert fatigue—facing dozens of disconnected warnings across different linters that fail to identify the single underlying root cause.
StackVet bridges this gap:
- Parallel Static Analysis: Uses Rust with
ruff_python_parserandoxc_parserto inspect ASTs without running user code. - Cross-Layer Drift Detection: Detects mismatches between local environments, package manifests, lockfiles, Docker images, and CI matrix definitions.
- Correlation Engine: Groups individual symptoms into concise Root Cause Clusters.
- Health Score & Grade: Produces an actionable 0–100 health score with letter grades (A through F).
- Format-Preserving Auto-Fixes: Injects missing dependencies into
pyproject.tomlorpackage.jsonpreserving user comments and indentation usingtoml_edit.
Key Features
- Blazing Fast: Native Rust engine with Rayon parallel processing; analyzes multi-thousand-file repositories in milliseconds.
- AST-Level Accuracy: Direct AST traversal eliminating regex false positives.
- Circular Dependency Detection: Detects import cycles using Tarjan's Strongly Connected Components (SCC) algorithm.
- Zero-Config Discovery: Automatically discovers
pyproject.toml,requirements.txt,uv.lock,package.json,pnpm-lock.yaml, Dockerfiles, and GitHub workflows. - Enterprise Reporting: Outputs rich terminal tables, machine-readable JSON, OASIS SARIF v2.1.0 for GitHub Code Scanning, and standalone responsive dark-mode HTML reports.
Installation
Via Cargo (Rust)
cargo install stackvet
Via uv / pip (Python)
# Run instantly with uvx (no install required):
uvx stackvet doctor
# Or install with pip / pipx:
pip install stackvet
# or
pipx install stackvet
Via npm / npx (Node.js)
# Run instantly with npx:
npx stackvet doctor
# Or install in your project:
pnpm add -D stackvet
# or
npm install --save-dev stackvet
Quick Start
Run a full project health check in your repository root:
stackvet doctor
Output:
=======================================================================
StackVet Universal Project Health Report
=======================================================================
Health Score: 92 / 100
Overall Grade: A (Healthy)
Critical: 0 | Errors: 0 | Warnings: 2
--- Root Cause Clusters (1) ---
1. [WARN] Environment, Lockfile & Runtime Drift
Summary: Detected 1 discrepancy(ies) between local manifests, Docker, CI matrix, or lockfiles.
Remediation: Align runtime version declarations across pyproject, package.json, Dockerfile, and CI workflows.
Symptoms Count: 1
CLI Command Guide
All subcommands support positional path arguments (e.g. stackvet doctor ./backend) as well as the global -p / --path option.
stackvet doctor (aliases: diagnose, health)
Runs a comprehensive health check, aggregates symptoms into root causes, and assigns a health grade (A–F).
# Run on current directory
stackvet doctor
# Run on a target directory (positional or -p)
stackvet doctor ./backend
stackvet -p ./services/api doctor
# Using intuitive aliases
stackvet health ./backend
stackvet diagnose
# Fail CI with exit code 1 if health score is below 85
stackvet doctor --min-score 85
# Output in standalone HTML report
stackvet --format html doctor > health-report.html
stackvet check (aliases: scan, audit)
A fast gate optimized for pre-commit hooks and CI pipelines. Returns exit code 0 if clean, or 1 if errors are detected.
# Normal check (fails only on ERROR and CRITICAL)
stackvet check ./backend
stackvet scan ./backend
# Strict mode (fails on WARNINGS as well)
stackvet check --strict
stackvet audit --strict
# Output machine-readable JSON in CI
stackvet --format json check
stackvet inspect (aliases: examine, details)
Deep diagnostics inspection displaying code locations, snippets, severity, and targeted remediation guides.
# Inspect all detected diagnostics
stackvet inspect ./backend
stackvet examine ./backend
# Filter diagnostics by rule category prefix:
stackvet inspect --rule FAP # Only FastAPI rules
stackvet inspect --rule SQL # Only SQLAlchemy rules
stackvet inspect --rule DOC # Only Docker rules
stackvet inspect --rule RCT # Only React rules
stackvet explain
Displays in-depth documentation, potential runtime consequences, code examples, and remediation steps for any diagnostic rule code.
# Explain any rule in detail
stackvet explain FAP-001
stackvet explain SQL-004
stackvet explain DOC-001
stackvet fix (aliases: remediate, auto-fix)
Applies safe, format-preserving automated remediations (e.g. injecting missing packages into pyproject.toml or package.json).
# Preview available safe fixes
stackvet fix
stackvet remediate
# Apply all fixes automatically without prompts
stackvet fix --yes
stackvet auto-fix --yes
stackvet graph (aliases: architecture, dependencies)
Visualizes project module dependencies and detects circular import cycles.
# Clean ASCII hierarchy
stackvet graph --style ascii
stackvet architecture
# Mermaid diagram (pasteable directly into GitHub Markdown or Notion)
stackvet graph --style mermaid
# Graphviz DOT format
stackvet graph --style dot
stackvet baseline
Records existing issues in legacy codebases to prevent CI failures on technical debt while blocking new regressions.
# Record current diagnostics into baseline
stackvet baseline record ./backend
# Verify in CI that no new regressions were introduced
stackvet baseline verify ./backend
# Strict verification (fails on new warnings too)
stackvet baseline verify ./backend --strict
stackvet init (alias: setup)
Bootstraps a recommended .stackvet.toml configuration and optional GitHub Actions CI workflow.
# Generate .stackvet.toml
stackvet init
# Generate configuration AND GitHub Actions CI workflow (.github/workflows/stackvet.yml)
stackvet init --ci
stackvet rules (aliases: catalog, list-rules)
Displays the complete catalog of 132 supported diagnostic rules across Python, Node.js, Docker, CI/CD, and frameworks.
# Show all rules in a formatted table
stackvet rules
# Filter catalog by ecosystem or framework
stackvet rules docker
stackvet rules fastapi
stackvet rules sqlalchemy
stackvet rules react
Diagnostic Rules Catalog
Python Dependency Rules (DEP-xxx)
| Rule ID | Severity | Name | Description |
|---|---|---|---|
DEP-001 |
ERROR |
Version Conflict | Detects conflicting version specifiers in dependencies (e.g. foo>=2.0 vs foo<2.0). |
DEP-002 |
ERROR |
Missing Declaration | Imported package is used in Python code but not declared in pyproject.toml or requirements.txt. |
DEP-003 |
WARN |
Unused Dependency | Package listed in dependencies is never imported by any Python source files. |
DEP-004 |
ERROR |
Python Version Incompatible | Package requirements target end-of-life Python runtimes (e.g. <3.10). |
DEP-005 |
WARN |
Lockfile Drift | Manifest file exists (pyproject.toml) but lockfile (uv.lock/poetry.lock) is missing. |
DEP-006 |
CRITICAL |
Vulnerability Audit | Batched security audit against OSV database for known CVEs. |
DEP-007 |
WARN |
Transitive Dependency Import | Package imported is present in lockfile but not directly declared in pyproject.toml. |
Node Dependency Rules (NDEP-xxx)
| Rule ID | Severity | Name | Description |
|---|---|---|---|
NDEP-001 |
ERROR |
Missing Node Package | Package imported in .ts/.tsx/.js is missing from package.json. |
NDEP-002 |
WARN |
Unused Node Package | Production dependency in package.json is never imported in source files. |
NDEP-003 |
ERROR |
Unmet Peer Dependency | Declared dependencies conflict with peer dependency constraints. |
NDEP-004 |
WARN |
Lockfile Out of Sync | Missing lockfile (pnpm-lock.yaml, package-lock.json, yarn.lock). |
NDEP-005 |
ERROR |
DevDependency in Production | A package from devDependencies is imported inside production source files (outside test files). |
Import & Architecture Rules (IMP-xxx, ARC-xxx)
| Rule ID | Severity | Name | Description |
|---|---|---|---|
IMP-001 |
ERROR |
Circular Imports | Import cycle detected across modules (e.g. a -> b -> c -> a). |
IMP-002 |
ERROR |
Unresolved Local Import | Relative import path (./utils, from .mod) has no corresponding file on disk. |
IMP-003 |
WARN |
Orphan File / Dead Code | Source file has 0 incoming imports and is not an application entrypoint. |
IMP-004 |
ERROR |
PEP 594 Removed Stdlib | Importing deprecated standard library module removed in Python 3.13 (cgi, pipes, imp, crypt, etc.). |
ARC-001 |
WARN |
Layer Violation | Lower-tier persistence layer directly imports upper-tier presentation or API layers. |
ARC-002 |
WARN |
Component Cycle | Cross-boundary cycles detected between top-level feature directories. |
Environment & Drift Rules (ENV-xxx)
| Rule ID | Severity | Name | Description |
|---|---|---|---|
ENV-001 |
WARN |
Runtime Drift | .python-version or .nvmrc contradicts the runtime constraint in pyproject.toml or package.json. |
ENV-002 |
ERROR |
Docker Drift | Dockerfile base image (e.g. python:3.10-slim) contradicts project requirement (>=3.12). |
ENV-003 |
ERROR |
CI Matrix Drift | GitHub Actions workflow matrix runs tests on unsupported runtime versions. |
FastAPI Framework Rules (FAP-xxx)
| Rule ID | Severity | Name | Description |
|---|---|---|---|
FAP-001 |
CRITICAL |
Blocking Call in Async Route | Calling blocking functions (time.sleep(), synchronous requests.*, subprocess.*) inside async def routes. |
FAP-003 |
WARN |
Missing Response Model | FastAPI route handler lacks a response_model argument or return type annotation (-> Model). |
FAP-004 |
CRITICAL |
Insecure Wildcard CORS | CORSMiddleware configured with allow_origins=["*"] combined with allow_credentials=True. |
FAP-006 |
ERROR |
Missing Path Parameter | URL template contains a placeholder (e.g. /{item_id}) not present in handler arguments. |
FAP-008 |
WARN |
Deprecated on_event | Using @app.on_event("startup") instead of modern lifespan context managers. |
FAP-010 |
ERROR |
Duplicate Route Path | Multiple handlers registered for the exact same HTTP method and path template. |
FAP-011 |
ERROR |
Mutable Default Argument | Route parameter has a mutable default value (e.g. def list_items(tags: list = []):). |
FAP-015 |
ERROR |
Sync File I/O in Async Handler | Synchronous open() or with open(...) executed inside an async def route handler. |
React & Next.js Rules (RCT-xxx, NXT-xxx)
| Rule ID | Severity | Name | Description |
|---|---|---|---|
RCT-001 |
WARN |
Missing Hook Dependencies | useEffect or useCallback missing referenced variables in dependency array. |
RCT-002 |
ERROR |
Conditional Hook Call | React hook (useState, useEffect) invoked conditionally inside an if block. |
RCT-003 |
ERROR |
Direct State Mutation | Modifying state directly (state.foo = 1) rather than calling state dispatcher. |
RCT-004 |
WARN |
Missing Key in List | JSX elements rendered inside .map() missing a unique key prop. |
RCT-005 |
WARN |
Barrel Import Bloat | Importing from root barrel exports (e.g. from '@mui/material') causing bundle bloat. |
NXT-001 |
ERROR |
Server Component Client API | Browser APIs (window, localStorage) or client hooks used without "use client" directive. |
NXT-002 |
CRITICAL |
Client Component Private Secret | Client Component accesses private environment variable (not prefixed with NEXT_PUBLIC_). |
Output Formats
StackVet supports 4 built-in egress formats via --format:
| Format | Description | Command Example |
|---|---|---|
text (default) |
Colored ANSI terminal output with tables and scorecard | stackvet doctor |
json |
Structured JSON with full diagnostics and root causes | stackvet --format json check |
sarif |
OASIS SARIF v2.1.0 for GitHub Code Scanning tab | stackvet --format sarif doctor > results.sarif |
html |
Standalone responsive dark-mode HTML report | stackvet --format html doctor > report.html |
CI/CD Integration
GitHub Actions (with SARIF Security Tab)
name: StackVet Health Check
on:
push:
branches: [main]
pull_request:
jobs:
health:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install StackVet
run: cargo install stackvet
# Fast CI Gate (Fails on Error)
- name: Run StackVet Check
run: stackvet check --strict
# Generate SARIF report for GitHub Code Scanning
- name: Generate SARIF Report
if: always()
run: stackvet --format sarif doctor > stackvet-results.sarif
- name: Upload SARIF to GitHub Security Tab
uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: stackvet-results.sarif
Pre-Commit Hook (.pre-commit-config.yaml)
repos:
- repo: local
hooks:
- id: stackvet
name: stackvet check
entry: stackvet check
language: system
pass_filenames: false
Publishing to npm & PyPI
StackVet includes dedicated automated GitHub Actions workflows and local build scripts for publishing to npm and PyPI:
- npm Workflow:
.github/workflows/publish-npm.yml - PyPI Workflow:
.github/workflows/publish-pypi.yml - Detailed Step-by-Step Guide: See the complete Publishing Guide for prerequisites, token setup, and verification.
# Build PyPI distribution (wheel & sdist)
npm run build:pypi
# Build npm package & tarball
npm run build:npm
Architecture & Workspace Structure
StackVet is designed as a modular Cargo workspace:
stackvet/
├── Cargo.toml # Workspace root
├── crates/
│ ├── stackvet-core/ # Core models: Diagnostic, Rule, Severity, ProjectContext, RootCause
│ ├── stackvet-scanner/ # Discovery engine with ignore::WalkBuilder
│ ├── stackvet-python/ # Python AST (ruff_python_parser), manifests & lockfiles
│ ├── stackvet-node/ # Node/TS AST (oxc_parser), package.json & builtins
│ ├── stackvet-graph/ # Tarjan's SCC cycle detection (petgraph)
│ ├── stackvet-analyzers/ # Core analyzers: deps, env, imports, drift
│ ├── stackvet-frameworks/ # Framework engines: FastAPI, React, Next.js
│ ├── stackvet-correlation/ # Root cause clustering and health scoring (0-100)
│ ├── stackvet-remediation/ # Format-preserving auto-fixes (toml_edit)
│ ├── stackvet-reporter/ # Terminal, SARIF v2.1.0, JSON, HTML reporters
│ └── stackvet-cli/ # CLI binary entrypoint (clap)
Contributing
-
Clone repository:
git clone https://github.com/stackvet/stackvet.git cd stackvet
-
Run test suite:
cargo test
-
Run locally against sample code:
cargo run -p stackvet -- doctor
Pull requests and rule proposals are welcome!
License
StackVet is licensed under the MIT License.
Metadata
Release files for stackvet 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| stackvet-0.1.0-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details |
| stackvet-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | Python 3 | none | Linux glibc 2.17+ x86-64 | Details |
| stackvet-0.1.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | Python 3 | none | Linux glibc 2.17+ ARM64 | Details |
| stackvet-0.1.0-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details |
| stackvet-0.1.0-py3-none-macosx_10_12_x86_64.whl | Python 3 | none | macOS 10.12+ x86-64 | Details |
Total release size: 13.1 MB
Release files / stackvet-0.1.0-py3-none-win_amd64.whl
| Download URL | stackvet-0.1.0-py3-none-win_amd64.whl |
|---|---|
| Size | 2.6 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
de2a0f09eb44837a52202448208dd0d0fc379753d7a3cdb7a8db1e7e17217410
|
|
BLAKE2b-256 checksum How to use checksums |
2040eaa23e17c5e006e014bd9735839d4898f7803af5bdf0742586de9050ca95
|
| 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 11, 2026.
Transparency logRelease files / stackvet-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | stackvet-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | Linux glibc 2.17+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
7ffb69a25a49b20518d96939903c06bf71068dea7eb881d3ee18479ce2207075
|
|
BLAKE2b-256 checksum How to use checksums |
23148f7d92a71aef0dd227706a5099e3713ee552a9544d706d446f8115d8d9c1
|
| 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 11, 2026.
Transparency logRelease files / stackvet-0.1.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | stackvet-0.1.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 2.6 MB |
| Tags | Linux glibc 2.17+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
7b0daccee9011c0ce1d859520269d55fd1226dd36ca56aa2c6ba79d6273a1f05
|
|
BLAKE2b-256 checksum How to use checksums |
61082e8fa9c8c33b92a007929eaecc52336897039c002674b5d8f9bc1fe2934e
|
| 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 11, 2026.
Transparency logRelease files / stackvet-0.1.0-py3-none-macosx_11_0_arm64.whl
| Download URL | stackvet-0.1.0-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 2.5 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
99c824f3eeec7b17e63156fbedcc3c3196446dfc768e78efec5405809d606b79
|
|
BLAKE2b-256 checksum How to use checksums |
99cb7f8952ed265cc8f90e39117dd8c9359cdcc095cab11e8f3fed9df4428eac
|
| 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 11, 2026.
Transparency logRelease files / stackvet-0.1.0-py3-none-macosx_10_12_x86_64.whl
| Download URL | stackvet-0.1.0-py3-none-macosx_10_12_x86_64.whl |
|---|---|
| Size | 2.6 MB |
| Tags | Python 3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
bb1db974be89848e2214421eb48a787d4d16ce8ca3f638b85117dca284608141
|
|
BLAKE2b-256 checksum How to use checksums |
8140f275afe1884270fb5417d4d10b22bf12b17d089625f3a37a453b589d80ec
|
| 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 11, 2026.
Transparency logSecurity for stackvet 0.1.0
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
All 5 files in this release have been uploaded with provenance metadata.
Attestation for stackvet-0.1.0-py3-none-win_amd64.whl
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 11, 2026.
Transparency logA 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.