← Back to Pull requests

feat: add python-baseline profile #460

Open
unknown opened this pull request with 200 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 04, 2026 15:47 UTC
Author

Closes #459

Adds a python-baseline profile for Python repositories, along with three new rule types.

Rules

All rules are tool-agnostic and skip non-Python repositories automatically (no pyproject.toml, requirements.txt, setup.py, setup.cfg, or Pipfile present).

python_type_checker_configured
Passes if mypy, pyright, or pytype is detected via pyproject.toml sections ([tool.mypy], [tool.pyright], [tool.pytype]), dedicated config files (mypy.ini, .mypy.ini, pyrightconfig.json), or a GitHub Actions workflow step. Remediation only triggers when none are found.

python_linter_configured
Passes if ruff, flake8, or pylint is detected via pyproject.toml sections, dedicated config files (.flake8, .pylintrc, ruff.toml), or a CI workflow. Same approach — never overrides an existing choice.

python_pyproject_toml_exists
Checks for the presence of pyproject.toml. Skipped if the repo shows no other sign of being a Python project. Includes a remediation PR that adds a minimal template.

python_lock_file_exists (existing rule, included in profile)

Profile

profiles/github/python-baseline.yaml bundles all four rules with alerting on and remediation off by default, following the same convention as other profiles in this repo.

Test plan

  • Tested rules manually against a Python repo with mypy + ruff configured: all pass

  • Tested against a bare Python repo (only requirements.txt): type checker and linter rules fail as expected, pyproject.toml rule fails and offers remediation PR

  • Non-Python repo (no Python markers): all rules skip cleanly
  • Diff: 200 lines (+150 / -50) across 2 files Reviewer: evankanderson Review duration: 9150m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.36) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.36 · 200 lines diff across 2 files
    0.36
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.317
    Real PR Conversation Timeline
    1 comments
    "Review active on #460"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 36.2% (MEDIUM) · Higher = larger blast radius
    36.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19.3% · Safe to merge
    19.3%