Verify before you ship. CodeProof turns real output from Python quality tools into a clear, shareable report — in your terminal, your browser, or your CI pipeline. No account. No hosted service. No claim that a passing score means correct code.
Evidence over claims. Every report shows what ran, what failed, what was skipped, and why.
pip install -e ".[checkers]"
codeproof quickstartThat one command:
- creates a sensible
.codeproof.ymlfrom the balanced preset, - tells you which optional tools are missing and how to install them,
- runs a scan, prints a readable summary and a short next-actions list, and writes reports to
.codeproof/reports/.
Prefer a different starting point?
codeproof quickstart --preset fast # syntax + lint + types, no code execution
codeproof quickstart --preset strict # all checks + coverage, high-severity gates
codeproof quickstart --preset security # Bandit + Semgrep + dependency advisoriesAlready have a policy? quickstart uses it and does not overwrite it unless you pass --force.
- Windows: double-click
start-windows.bat(orstart-desktop-windows.batfor desktop only). - Linux/macOS: run
chmod +x start-linux.shonce, then./start-linux.sh(or./start-desktop-linux.shfor desktop only;bash start-linux.shalso works).
The launcher asks Web or Desktop, then runs the same local engine and UI
either way. Web opens http://127.0.0.1:8765/ in your browser; Desktop opens
the same URL in a native window via codeproof desktop . (needs the optional
.[desktop] extra, installed on first desktop launch). Both modes share the same
scans, history, policies, reports, accessibility controls and suggested commands.
Nothing is hosted and no account is needed.
Both launchers create a local .venv, install the package with checkers only on
first run, and are idempotent. Press Ctrl+C in the terminal to stop the local
server. Pass --web or --desktop to skip the question; other arguments are
passed through, for example ./start-linux.sh --web --port 9000 (browser
auto-open is skipped when custom options are used).
Click the repository name in the left sidebar to Change repository. Browse
works in both Web and Desktop: it lists only folders inside the allowed roots, and
Desktop also offers the native system picker. You can still type an absolute or
relative path. Pasting a public HTTPS GitHub URL or /tree/<branch> link shows a
parse-only preview (branch, clone URL and local destination) before you explicitly
allow the network clone. Local folders show immediate metadata: branch and short
commit from git, policy threshold, required checks, file counts and whether a
custom .codeproof.yml exists. The workspace validates the path, clones GitHub
into a local sibling folder, switches to the new root, and opens a scan dialog
after a clone. Each repository has its own history and policy. codeproof serve .
still works unchanged; repeat --repo-root PATH to allow extra folders and use
--clones-dir PATH to move cloned repositories. --retention N sets how many
completed runs are kept per repository (1–500, default 50); the same limit can
be changed later in the Quality policy panel, and older runs are pruned
immediately.
Suggested commands in What to do next are now shown in full, including a
cd into the repository root. Try here opens a consent dialog and runs one
allowlisted command locally in a bounded terminal panel; Open terminal in
desktop mode puts the full command into a new terminal window for review before
you run it. There are no automatic fixes.
| Goal | Command | What you get |
|---|---|---|
| Pre-commit feedback | codeproof scan . --preset fast |
Fast static checks, no test execution |
| PR verification | codeproof scan . --preset balanced --format all |
Score, gates, HTML/JSON/Markdown reports |
| Release gate | codeproof scan . --preset strict --format sarif |
Coverage-aware policy, severity gate, SARIF |
| Security review | codeproof scan . --preset security |
Bandit, Semgrep, dependency advisories |
| Repeat scans on a large repo | codeproof scan . --cache |
Reuses deterministic results; never caches network-backed checks |
| Review only what changed | codeproof changed . |
Findings on lines touched by a local git diff |
| Turn a report into a to-do list | codeproof next .codeproof/reports/codeproof-report.json |
Prioritized actions with evidence and copyable commands |
| Get guided fix steps | codeproof insights report.json --root . |
Evidence-cited steps and safe, review-only diff drafts |
| Adopt a team policy | codeproof policy --template team |
Commented template with rationale and review prompts |
| Review an existing policy | codeproof policy --diff-template team |
Actionable semantic diff, not a silent override |
| Share evidence offline | codeproof export report.json --format html |
Single HTML file with embedded data and optional baseline |
| Explore visually | codeproof serve . |
Local workspace with presets, next actions, runnable commands, history, findings, comparison, evidence bundles and monorepo aggregation |
| Use a native window | codeproof desktop . |
Same local workspace and features in a desktop window (optional .[desktop] extra) |
| Work accessibly | codeproof serve . |
Keyboard shortcuts, screen-reader labels, scrollable sidebar, contrast and locale controls; static audit runs in CI |
| Add a custom check | codeproof plugins |
Inspect explicitly installed adapters, then opt in via policy or --plugin |
| CI gate | Use the GitHub Action below | Annotations, job summary, artifacts, optional SARIF upload |
Open http://127.0.0.1:8765/ after codeproof serve .. Browser scans require explicit opt-ins for code execution and network access.
codeproof doctor # tool readiness + install hints
codeproof doctor --json # stable JSON array of tool readiness
codeproof desktop . # same workspace in a native window
codeproof serve . --repo-root ~/projects # allow another local folder from the UI
codeproof tools # built-in checks and behaviors
codeproof plugins --json # installed third-party adapters
codeproof init --preset balanced # write a reviewable policy
codeproof policy --preset strict # show/export an effective policy
codeproof pack create . --output team.json --name team
codeproof pack verify team.json # checksum integrity, not a signature
codeproof scan . --pack team.json # run the verified pack
codeproof bundle create .codeproof/reports/codeproof-report.json --output review.json
codeproof bundle verify review.json # portable evidence, not a signature
codeproof policy --migrate --json # show legacy fields explicitly
codeproof templates --json # list reviewable policy templates
codeproof policy --diff-template team # review local policy vs a template
codeproof scan . --checks ruff,pytest # run an explicit subset
codeproof scan . --plugin license --checks ruff,pytest,license
codeproof projects . --json # discover monorepo projects
codeproof aggregate . --project api # per-project scans + aggregate evidence
codeproof scan . --cache --jobs 2 # opt in to cached runs and parallel workers
python scripts/benchmark_workers.py # measure worker speedups offline
codeproof cache # inspect / clear the result cache
codeproof export report.json --format sarif
codeproof export report.json --format html --baseline old.json
codeproof verify-viewer report.html --report report.json --baseline old.json
python scripts/check_i18n.py # validate UI catalog and a11y hooks
codeproof compare before.json after.json # new / resolved / moved findings
codeproof changed . --json # findings on changed git lines
codeproof next report.json --json # deterministic, evidence-backed to-do list
codeproof insights report.json --root . # evidence-cited guidance + safe diff drafts
codeproof history . --format csv # export local run history
codeproof annotate report.json --summary "$GITHUB_STEP_SUMMARY"
codeproof inventory . # public symbols (not coverage)
codeproof generate-tests . --output tests/generatedExit codes: 0 policy passed, 1 policy failed (or a viewer mismatch), 2 invalid usage or configuration. aggregate uses 0 aggregate pass, 1 aggregate fail and 2 invalid input. Inspection commands such as next, insights, projects, changed, history, templates, pack verify and bundle verify exit 0 on success and never gate a build. An invalid or tampered policy pack or evidence bundle exits 2.
codeproof doctor --json emits a stable JSON array on stdout with one object per built-in tool: tool, purpose, available, path and install. path is null for built-in checks and unavailable executables, while install is null for available tools or the exact pip extra needed for a missing one.
codeproof scan . --format all writes to .codeproof/reports/:
codeproof-report.html— self-contained, searchable, offline report;codeproof-report.json— machine-readable schema v1.1 with provenance;codeproof-report.md— compact summary for PRs and changelogs.
--format sarif writes codeproof-report.sarif for code-scanning consumers. Older JSON reports are migrated in memory by export, compare, and annotate. The HTML report is a single file with inline styles/scripts and an embedded JSON payload; export --baseline old.json adds an offline comparison, and verify-viewer checks the embedded data against the CLI engine. No external assets are required.
Each report includes:
- weighted score and grade, plus required-check gates;
- normalized findings with file, line, rule, and raw tool output retained; pytest failures also carry bounded node identity and resolved line details, and mypy diagnostics retain column, code and raw severity in JSON evidence;
- provenance: source revision, tool versions, effective policy, and optional policy-pack checksum metadata;
- limitations, including unavailable checks, severity blockers and reused cached results;
- a deterministic What to do next plan: severity and required gates first, then score impact and setup gaps, each item tied to saved evidence.
codeproof next report.json prints that plan without running checks, changing files or inventing findings. scan and quickstart show a three-item summary automatically; pass --no-next to keep scripted output unchanged. The workspace shows the full command with the repository path; its Try here action runs a recomputed, allowlisted command only after explicit consent. See docs/next-actions.md for the contract and limits.
codeproof insights report.json --root . adds step-by-step guidance with citations to the saved tool output. It is opt-in, deterministic and local-only: no model, network call or code execution. A small allowlist produces review-only diff drafts; CodeProof never applies them. See docs/insights.md.
For monorepos, codeproof projects discovers project markers and codeproof aggregate scans each project with its own policy before writing a workspace report. The aggregate score is a weighted average, but every project policy must pass — a strong package cannot average away a failed one. The same discovery and aggregation are available from the Web/Desktop Projects page with explicit execution/network consent. See docs/monorepos.md.
codeproof bundle create REPORT.json packages a report with optional review artifacts into one bounded JSON file; bundle verify checks its SHA-256 manifest. The Web/Desktop history panel offers the same create, inspect, verify and download actions from saved runs. This is checksum integrity, not a signature — see docs/evidence-bundles.md.
Subprocess output is capped (max_output_bytes, default 2 MB per stream) and timeouts terminate the whole child process tree. When output is limited, the report says so rather than silently dropping evidence.
codeproof changed and codeproof compare focus that evidence on a diff or on the difference between two reports. Findings are matched by tool, rule, path and normalized message, so a moved line is not reported as a new issue. A changed-code view never overrides the full-repository score or policy gate. See docs/baselines.md for the exact method and limits.
.codeproof.yml is optional. If present, it overlays the built-in defaults:
version: 1
fail_under: 75
required_tools: [ruff, pytest]
severity_gate: high # off | medium | high | critical
cache_enabled: false # opt in for repeated scans on large repos
max_output_bytes: 2000000 # bounded capture per output stream
jobs: 1 # 1-8 workers; measure before increasing
plugins: [] # explicit installed adapter names, never repo code
source_paths: [src]
test_paths: [tests]
checks:
ruff: {weight: 20}
pytest: {weight: 40}
coverage: {enabled: true, weight: 10, config: "80"}
semgrep: {config: p/python}- Weights are relative. Required checks must pass even at weight 0.
severity_gate: highblocks policy when a high/critical/error finding exists, even if the weighted score is otherwise fine.- Partial policies keep all defaults; explicitly disable checks you do not want.
- Presets are run-time choices or generated files. They never secretly change an existing
.codeproof.yml. - Policy packs freeze an effective policy with a SHA-256 checksum and provenance metadata. They are reviewable and verifiable locally, but not signed and not an identity guarantee. See docs/policy-packs.md.
.codeproof-workspace.ymllists monorepo projects, optional per-project policies and weights; the aggregate gate requires every selected project to pass. See docs/monorepos.md.- Evidence bundles carry a saved report plus optional embedded artifacts with SHA-256 checksums. They are portable snapshots, not signed and not identity proofs. See docs/evidence-bundles.md.
- Caching is opt-in. Keys include source/test content, policy, lockfiles, tool/Python/CodeProof versions;
pip-auditandsemgrepalways run fresh. See docs/performance.md for measured baselines and worker speedups. - Plugins are opt-in installed adapters listed in
plugins:. Repository code is never auto-loaded, and custom checks emit the same evidence model as built-ins. See docs/extensions.md andexamples/plugins.
- uses: PeaBox-Lab/CodeProof-AI@v1.6.0
with:
preset: balanced
# policy-pack: .github/codeproof-policy.json # optional; excludes preset
annotations: "true"
upload-sarif: "true"The action installs checkers, runs the same engine, emits ::error/::warning annotations, writes a job summary, uploads report artifacts, and optionally uploads SARIF. SARIF upload needs permissions: security-events: write. The optional policy-pack input runs a verified pack; it is mutually exclusive with preset and uses the pack threshold instead of fail-under. The scan step exits 1 when policy fails.
CodeProof is a Python verification workspace. It does not prove correctness, measure coverage itself, write application code, offer AI chat, certify compliance, or run a hosted multi-tenant service. It can ingest an existing coverage.xml, and generated tests check symbol exposure only — review them before running.
See PRODUCT.md for usecases and USP, docs/audit.md for the codebase audit, docs/performance.md for measured scale baselines, docs/baselines.md for changed-code review, docs/team-workflows.md for policies and shareable reports, docs/accessibility.md for keyboard, screen-reader and locale support, docs/extensions.md for custom adapters and workers, docs/compatibility.md for supported versions and dependency updates, docs/next-actions.md for the action-plan contract, docs/insights.md for guided fix steps, docs/policy-packs.md for verifiable policies, docs/monorepos.md for aggregate evidence, docs/evidence-bundles.md for portable evidence, docs/roadmap.md for delivery history, and ROADMAP.md for the next 10 releases.
pytest and import checks execute repository code. mypy plugins and dependency resolution can also execute code. Scan untrusted repositories only in an isolated container or ephemeral runner. Semgrep auto, registry and URL configs and pip-audit use the network; use a contained local Semgrep rule file or directory for offline operation. The local workspace binds to loopback by default and requires a per-session token for scans and local command runs. Try here accepts only a run/action/command index, recomputes the command from the saved report, checks an executable allowlist, caps output at 20 KB and 60 seconds, and cancels the child process tree on timeout. It still runs with your user permissions and may execute repository or package code or install packages; the consent dialog names those risks. Only use it on repositories you trust. Desktop Open terminal only displays the reviewed command in a new window. Repository switching requires the same token, constrains local paths to configured roots, and clones only public HTTPS GitHub URLs with bounded output/time and no shell or credential prompt. Cloned code is untrusted until you review and scan it. Installing a plugin grants it the privileges of the CodeProof process; review third-party adapters before adding their entry points to a policy.
pip install -e ".[dev]"
pytest
ruff check src tests scripts examples
mypy src/codeproof
python scripts/check_packaging.pyApache-2.0. See LICENSE for the full terms and NOTICE for attribution.