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.
.
├── 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
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 -
# 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
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
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
{
"total": 3,
"by_severity": {
"high": 1,
"medium": 1,
"low": 1
}
}
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
- 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
- You need a clear, portable risk summary from APV JSON.
- You want Markdown/JSON outputs for PRs, audits, or dashboards.
- 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
.
- No shell changes required; pure Python CLI.
- Keep sensitive APV JSON private (avoid public PRs).
- CodeQL enabled in CI.
- Small, atomic PRs using Conventional Commits.
- Keep all gates green before asking for review.
- Enable auto-merge once checks pass.
CoderDeltaLAN (Yosvel)
GitHub: https://github.com/CoderDeltaLAN
Support open-source: your donations keep projects clean, secure, and evolving for the global community.
Released under the MIT License. See LICENSE.