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.
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 -
A) 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
Install & Run
B) From PyPI (recomendado)
python -m pip install -U pip
python -m pip install diff-risk-dashboard
# Use the CLI
diff-risk examples/sample_apv.json -f md -o report.md
diff-risk examples/sample_apv.json -f json -o report.json
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.
📄 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file diff_risk_dashboard-0.4.37.tar.gz.
File metadata
- Download URL: diff_risk_dashboard-0.4.37.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aba53d4bc53215f3d6172c7ffab922d992ef92fd4331b863172fb0cac5d5a2b0
|
|
| MD5 |
0f32a4fa4c07040bb0a1f2fd5241c3f5
|
|
| BLAKE2b-256 |
dfd651226510b6fb4cd9fd8dc414d10216d933fc0f866bdfc75f464aadd7109e
|
Provenance
The following attestation bundles were made for diff_risk_dashboard-0.4.37.tar.gz:
Publisher:
publish-pypi.yml on CoderDeltaLAN/diff-risk-dashboard
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
diff_risk_dashboard-0.4.37.tar.gz -
Subject digest:
aba53d4bc53215f3d6172c7ffab922d992ef92fd4331b863172fb0cac5d5a2b0 - Sigstore transparency entry: 528316440
- Sigstore integration time:
-
Permalink:
CoderDeltaLAN/diff-risk-dashboard@c186311f17fd7da73d9457e83454d73b87357dbc -
Branch / Tag:
refs/heads/main - Owner: https://github.com/CoderDeltaLAN
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@c186311f17fd7da73d9457e83454d73b87357dbc -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file diff_risk_dashboard-0.4.37-py3-none-any.whl.
File metadata
- Download URL: diff_risk_dashboard-0.4.37-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aedabdc63ad8201a0f0c4e4a8f0c4af3103fe618941d3777c9135c40af078b4c
|
|
| MD5 |
6921ef46cdaa2a401132b870a7353126
|
|
| BLAKE2b-256 |
ab4df90e14f2710e1dbecc1a51ae63fc38f0fb5b7a16c29a028a604380258e7b
|
Provenance
The following attestation bundles were made for diff_risk_dashboard-0.4.37-py3-none-any.whl:
Publisher:
publish-pypi.yml on CoderDeltaLAN/diff-risk-dashboard
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
diff_risk_dashboard-0.4.37-py3-none-any.whl -
Subject digest:
aedabdc63ad8201a0f0c4e4a8f0c4af3103fe618941d3777c9135c40af078b4c - Sigstore transparency entry: 528316453
- Sigstore integration time:
-
Permalink:
CoderDeltaLAN/diff-risk-dashboard@c186311f17fd7da73d9457e83454d73b87357dbc -
Branch / Tag:
refs/heads/main - Owner: https://github.com/CoderDeltaLAN
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@c186311f17fd7da73d9457e83454d73b87357dbc -
Trigger Event:
workflow_run
-
Statement type: