← Back to Pull requests

[Maintenance] Add color rule scheme to AI assistance for repository #3938

Open
unknown opened this pull request with 437 lines diff across 5 files
View on GitHub
unknown unknown commented on Oct 26, 2026 13:55 UTC
Author

Description

This PR adds a github action which analyzes which files are modified and uses comments in the CODEOWNERS to find what level of review vs AI usage is allowed.

Still missing is associated rules added for general users and AIs to understand and parse.

Tested using my fork's main and a test branch, results can be seen here: https://github.com/icfaust/oneDAL/pull/5#issuecomment-6438239849

I used AI assistance in stitching together the components, with a high level design, corrections, and base yaml implementation by me (claude, opus 5.5 with medium effort).

It uses workflow_run to get the necessary permissions in order to write comments to the PR. It uses the github API in order to query the changed files, so that the underlying PR is properly separated (security reasons). It then classifies using git's glob capability (rather than spinning our own AST to maintain), and reports back the level which is most critical (blue -> green -> yellow -> red). It matches internal discussions and agreed parameters. It will check on every commit, is low overhead, and will only update to higher levels if required (and is therefore sticky). It has edge cases for new folders and rules, and adds an initial color coding via the CODEOWNERS file (suggestions welcome for changing levels). It additionally forces disclosure and usage policies in line with other open source projects, along with some related best practices (i.e. submitters themselves should be writing review comments).

---

<!--
PR should start as a draft, then move to ready for review state
after CI is passed and all applicable checkboxes are closed.
This approach ensures that reviewers don't spend extra time asking for regular requirements.

You can remove a checkbox as not applicable only if it doesn't relate to this PR in any way.
For example, a PR with docs update doesn't require checkboxes for performance
while a PR with any change in actual code should list checkboxes and
justify how this code change is expected to affect performance (or justification should be self-evident).
-->

<details>
<summary>Checklist:</summary>

Completeness and readability

  • I have commented my code, particularly in hard-to-understand areas.

  • I have updated the documentation to reflect the changes or created a separate PR with updates and provided its number in the description, if necessary.

  • Git commit message contains an appropriate signed-off-by string _(see CONTRIBUTING.md for details)_.

  • I have resolved any merge conflicts that might occur with the base branch.
  • Testing

  • I have run it locally and tested the changes extensively.

  • All CI jobs are green or I have provided justification why they aren't.

  • I have extended testing suite if new functionality was introduced in this PR.
  • Performance

  • I have measured performance for affected algorithms using scikit-learn_bench and provided at least a summary table with measured data, if performance change is expected.

  • I have provided justification why performance and/or quality metrics have changed or why changes are not expected.

  • I have extended the benchmarking suite and provided a corresponding scikit-learn_bench PR if new measurable functionality was introduced in this PR.
  • </details>

    Diff: 437 lines (+327 / -110) across 5 files Reviewer: icfaust Review duration: 53980m
    All Vouch review confidence checks passed
    Residual risk 0.32 = Change Risk (0.57) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.57 · 437 lines diff across 5 files
    0.57
    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%
    44%
    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
    Diff Size diff_size
    0.364
    Shallow Review Depth shallow_review_depth
    0.344
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #3938"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 44.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: 57.2% (MEDIUM) · Higher = larger blast radius
    57.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: 44.7% · Lower = rushed or shallow review
    44.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: 31.6% · Safe to merge
    31.6%