Metadata-Version: 2.4
Name: polycheck
Version: 0.3.31
Summary: Polyglot static analysis pipeline that produces LLM-ready triage output
Author-email: Philip Hofmann <philiphofmann@hotmail.com>
License: MIT
Project-URL: Homepage, https://github.com/Phhofm/polycheck
Project-URL: Repository, https://github.com/Phhofm/polycheck
Project-URL: Issues, https://github.com/Phhofm/polycheck/issues
Project-URL: Changelog, https://github.com/Phhofm/polycheck/blob/main/CHANGELOG.md
Keywords: static-analysis,lint,linter,triage,llm,code-quality,polyglot,mcp
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typer>=0.12
Requires-Dist: rich>=13.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: mcp<2,>=1.0
Requires-Dist: anyio>=4
Requires-Dist: requests>=2.28
Requires-Dist: tomli>=2.0; python_version < "3.11"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: pytest-mock>=3.10; extra == "dev"
Requires-Dist: coverage>=7.0; extra == "dev"
Requires-Dist: ruff>=0.2; extra == "dev"
Requires-Dist: mypy>=1.0; extra == "dev"
Requires-Dist: types-PyYAML; extra == "dev"
Requires-Dist: types-requests; extra == "dev"
Requires-Dist: tomli>=2.0; extra == "dev"
Dynamic: license-file

# polycheck

[![CI](https://github.com/Phhofm/polycheck/actions/workflows/ci.yml/badge.svg)](https://github.com/Phhofm/polycheck/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/polycheck)](https://pypi.org/project/polycheck/)
[![Python](https://img.shields.io/pypi/pyversions/polycheck)](https://pypi.org/project/polycheck/)

A polyglot static-analysis pipeline and MCP server that lets deterministic analyzers do the cheap exhaustive pass so your LLM only triages verified findings.

## Why

polycheck started when a teammate's *"Bug Hunting with Claude Code"* post concluded: massive tokens burned, barely anything usable came out. The counter-proposal was simple — don't let the LLM spray-and-pray at your codebase; let deterministic analyzers do the cheap exhaustive pass and hand the LLM only verified findings to triage.

AI coding agents degrade codebases over iterative tasks: *SlopCodeBench* ([arXiv:2603.24755](https://arxiv.org/abs/2603.24755)) measured structural erosion rising in **77%** of trajectories and verbosity in **75.5%** — even while tests stay green. Prompting the agent to write cleaner code does not stop the degradation rate.

Static analyzers catch what prompts miss, and handing an LLM a structured findings list costs a fraction of having it re-read your whole repo.

## How It Works

```text
  repo ──▶ 25 deterministic analyzers ──▶ polycheck-report.{md,json,sarif}
                                                               │
                                                               ▼
                                          LLM triages findings + baseline / suppress
```

1. **Deterministic sweep:** Runs applicable analyzers across your repo and normalizes every result to one schema (`tool`, `rule`, `severity`, `file`, `line`).
2. **Built-in anti-slop metrics:** `scb-check` (zero extra install) measures duplicated AST blocks, slop patterns, and complexity-mass erosion.
3. **Slim MCP + triage loop:** Exposes `polycheck.run` and `polycheck.audit_run` so the LLM reads compact reports, triages real bugs vs false positives (`.polycheck.yml` `suppress:`), and snapshots accepted state (`polycheck baseline`).
4. **Self-auditing fleet:** `polycheck verify-tools` tests installed analyzers against seeded defects so silently broken tools never give a false bill of health.

## What It Is / Best Used For

- **Analyzer fleet:** runs 26 bundled analyzers across Python (`ruff`, `mypy`, `vulture`, `pip-audit`, `deptry`, `tach`), JS/TS (`eslint`, `tsc`, `knip`, `npm-audit`, `depcheck`, `dependency-cruiser`, `ts-slop`), Security/Universal (`gitleaks`, `semgrep`, `scb-check`, **SonarQube via `sonarless`**), Shell/CI/Docker (`shellcheck`, `actionlint`, `zizmor`, `hadolint`), Docs (`markdownlint-cli2`, `lychee`), Tests (`test-slop` — flags assertion-less Python tests), Vue (`vue-tsc` — type-checks .vue SFCs, tsc defers to it), plus `coverage`.
- **Profiles for every stage:** `--profile deep` for repo onboarding, `--profile pr` for fast changed-file pre-push gates.
- **Want the full coding harness?** **[vibecode-harness](https://github.com/Phhofm/vibecode-harness)** installs `polycheck` + `vibecode-skill` together in one command.

## Quickstart

### Install with an AI Agent (Recommended)

Paste this prompt into your coding agent (Claude Code, OpenCode, Kilo Code, Antigravity, etc.):

```text
Inspect https://github.com/Phhofm/polycheck (read README.md and DOCS.md first).

1. Check my machine for `pipx`, `docker`, `sonarless`, and existing agent configs (`~/.claude`, `~/.config/kilo`, `~/.config/opencode`).
2. Explain what is missing — specifically note that Docker + sonarless unlock SonarQube's 30+ language deep analysis (optional, everything else works without Docker), and separate agent-installable packages from human-only commands (Docker, sonarless, system binaries).
3. Summarize the planned installs and config changes, and wait for my confirmation before running anything.
4. Once confirmed, install `polycheck` via `pipx`, run `polycheck init --host all --scope global --yes`, run `polycheck doctor --json .` + `polycheck verify-tools`, and offer to run a scan on my current repo.
```

### Manual Quickstart

```bash
pipx install polycheck
polycheck init --host all --scope global --dry-run   # preview host wiring
polycheck init --host all --scope global             # wire Kilo / OpenCode / Claude
polycheck verify-tools                               # smoke-test installed analyzers
```

Then restart your coding assistant and run `/polycheck` (or `polycheck run .` in any repo).

## Foundations & References

- **SlopCodeBench** ([arXiv:2603.24755](https://arxiv.org/abs/2603.24755), [scbench.ai](https://www.scbench.ai)) — erosion and verbosity metrics for agent-written code.
- **No AI Slop Manifesto** ([slopmanifesto.com](https://www.slopmanifesto.com/)) — Resolution 12: anything a linter or automated check can catch, let it catch.
- **Code Mode** ([Cloudflare](https://blog.cloudflare.com/code-mode/)) — tiny MCP tool surface, file-backed reports, CLI for composition.

## Documentation

See **[DOCS.md](DOCS.md)** for the full 22-tool matrix, scan profiles, `.polycheck.yml` configuration schema, CLI reference, MCP server & manual JSON setup, `sonarless`/Docker setup, and extending `polycheck`.
