Skip to main content

Visual risk exposure of PRs powered by ai-patch-verifier outputs.

Project description

⭐ diff-risk-dashboard — APV → Risk Summary (Python CLI)

A lean, production-grade Python CLI that ingests ai-patch-verifier (APV) JSON and outputs a clear risk summary as Markdown or JSON. Designed for clean CI; use the JSON output to enforce your own merge gates in workflows.

Manual


CI / build CodeQL Analysis Release License: MIT GHCR Repo views Donate - PayPal


Repo layout

.
├── examples/
│   └── sample_apv.json           # APV sample for demos/tests
├── src/diff_risk_dashboard/
│   ├── __main__.py               # module entry
│   ├── cli.py                    # CLI
│   ├── core.py                   # summarization logic
│   └── report.py                 # Markdown generator
├── tests/                        # pytest
└── .github/workflows/            # CI + CodeQL + Release Drafter

🚀 Quick Start (end users)

Usage (file path input)

Input must be a file path to an APV JSON. Inline JSON is not supported.

# JSON output to file
diff-risk examples/sample_apv.json -f json -o out.json

# Markdown output to file
diff-risk examples/sample_apv.json -f md -o report.md

# Send to stdout
diff-risk examples/sample_apv.json -f json -o -
diff-risk examples/sample_apv.json -f md   -o -

Install & run locally

# 1) Clone
git clone https://github.com/CoderDeltaLAN/diff-risk-dashboard.git
cd diff-risk-dashboard

# 2) Install as package
python -m pip install --upgrade pip
python -m pip install .

# 3) Use the CLI
diff-risk examples/sample_apv.json -f md -o report.md

CLI usage

usage: diff-risk [-h] [-f {md,json}] [-o OUTPUT] input

positional arguments:
  input                 Path to ai-patch-verifier JSON file

options:
  -h, --help            Show help and exit
  -f {md,json}, --format {md,json}
                        Output format
  -o OUTPUT, --output OUTPUT
                        Output file; '-' = stdout

Example JSON output

{
  "total": 3,
  "by_severity": {
    "high": 1,
    "medium": 1,
    "low": 1
  }
}

🧪 Local Developer Workflow (mirrors CI)

python -m pip install --upgrade pip
pip install poetry

# Dependencies
poetry install --no-interaction

# Local gates
poetry run ruff check .
poetry run black --check .
PYTHONPATH=src poetry run pytest -q
# optional:
# poetry run mypy src

🔧 CI (GitHub Actions)

  • Matrix Python 3.11 / 3.12 aligned with local gates.
  • CodeQL on PRs and main.
  • Release Drafter for changelog.
  • Branch protection + linear history via squash.

Typical Python job steps:

- run: python -m pip install --upgrade pip
- run: pip install poetry
- run: poetry install --no-interaction
- run: poetry run ruff check .
- run: poetry run black --check .
- env:
    PYTHONPATH: src
  run: poetry run pytest -q
# Example CLI usage in CI:
- run: poetry run python -m pip install .
- run: diff-risk examples/sample_apv.json -f md -o report.md

🗺 When to Use This Project

  • You need a clear, portable risk summary from APV JSON.
  • You want Markdown/JSON outputs for PRs, audits, or dashboards.

🧩 Customization

  • Produce your own APV JSON and pass the file path as input.
  • Choose output format with --format {md,json} and write to a file with --output.

🔒 Security

  • No shell changes required; pure Python CLI.
  • Keep sensitive APV JSON private (avoid public PRs).
  • CodeQL enabled in CI.

🙌 Contributing

  • Small, atomic PRs using Conventional Commits.
  • Keep all gates green before asking for review.
  • Enable auto-merge once checks pass.

👤 Author

CoderDeltaLAN (Yosvel)
GitHub: https://github.com/CoderDeltaLAN


💚 Donations & Sponsorship

Support open-source: your donations keep projects clean, secure, and evolving for the global community. Donate


📄 License

Released under the MIT License. See LICENSE.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

diff_risk_dashboard-0.4.36.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

diff_risk_dashboard-0.4.36-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file diff_risk_dashboard-0.4.36.tar.gz.

File metadata

  • Download URL: diff_risk_dashboard-0.4.36.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for diff_risk_dashboard-0.4.36.tar.gz
Algorithm Hash digest
SHA256 870c416946b11530b834c417b0c1d86905cc373eff89c8d52a4a35dfc3d61090
MD5 2ff7519f1afcb219c396449a3aa1c093
BLAKE2b-256 3cc933b0006f1dc344c6e0b8f508d5240115591182d3021bb0e12e8e33c9ae2b

See more details on using hashes here.

Provenance

The following attestation bundles were made for diff_risk_dashboard-0.4.36.tar.gz:

Publisher: publish-pypi.yml on CoderDeltaLAN/diff-risk-dashboard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file diff_risk_dashboard-0.4.36-py3-none-any.whl.

File metadata

File hashes

Hashes for diff_risk_dashboard-0.4.36-py3-none-any.whl
Algorithm Hash digest
SHA256 5a729af74845caa11aa9a19832134de555b2d229a36fe3ef5b8e46a8af473c19
MD5 56a586e6b3d2aa286026e9116dea47f8
BLAKE2b-256 3d695e7e2cb8bee4bdbc9496ae7ae648d9ab8a3fc60e003d470ecfe16d04ebb1

See more details on using hashes here.

Provenance

The following attestation bundles were made for diff_risk_dashboard-0.4.36-py3-none-any.whl:

Publisher: publish-pypi.yml on CoderDeltaLAN/diff-risk-dashboard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page