← Back to Pull requests

feat: Review Intelligence Features (Load Balancing, Pair Analytics, SLA Predictions) & Groq Failover Cascade #12

Re-review Required
Ishaan-Chaturved1 merged 21 files (2678 lines) on Sep 20, 2026 10:32 UTC
View on GitHub
Ishaan-Chaturved1 Ishaan-Chaturved1 commented on Sep 20, 2026 10:25 UTC
Author

Summary


This PR delivers major intelligence capabilities to Vouch, refactors reviewer workload metrics, resolves frontend validator issues, and introduces an automatic dual-key failover cascade for AI risk narration with a refreshed GitHub Primer UI.

---

Key Highlights & Changes

1. Reviewer Load Balancing & Pair Intelligence


  • Workload Capacity & Overload Detection: Added live active PR count, queue pressure index, and capacity status (healthy, near limit, overloaded) across all team reviewers.

  • Reviewer Pairing Analytics (/pair-intelligence): Implemented pair co-review frequency tracking, collaboration depth scores, and reviewer affinity metrics to prevent reviewer silos.

  • Reviewer Profile Refactor: Replaced static "Domain Expertise" with dynamic Workload Capacity and Consistent Review Pairs directly on the reviewer profile and team health dashboards.
  • 2. Review SLA Predictions & Org Health


  • Review SLA Breach Predictor: Added duration estimations, risk factor weights (PR size, cross-team files, reviewer backlog), and breach risk probability indicators (Low, Moderate, High).

  • Org Review Health Dashboard (/team-health): Added macro-level team review velocity, fatigue rates, department health KPIs, CSV/JSON report exports, and team-wide alert indicators.
  • 3. Dual-Key Groq Failover & Bedrock Cascade


  • Bedrock $\to$ Groq Auto-Failover: If AWS Bedrock is disconnected, times out, or encounters quota issues, the system automatically falls back to Groq for instant one-sentence triage narration.

  • Groq Dual-Key Cascade:

  • - Resolves GROQ_API_KEY (primary) $\to$ GROQ_API_KEY_backup (secondary).
    - Automatically cascades on HTTP 401, 429 rate limit/quota, timeouts, or 5xx server errors.
    - Returns requires_key: true to trigger an inline API key prompt if all configured keys fail or are unconfigured.

    4. UI & Template Polish


  • Risk Narration Card Redesign:

  • - Displays Bedrock Claude 3 · Risk Narration (disconnected) status clearly in the header.
    - Places Groq on-demand risk narration directly below the disconnected header.
    - Replaced legacy tag/bookmark icons with the official circular Groq logo (/static/img/groq-logo.png).

  • Team Health & Validation Fixes:

  • - Added user avatars and GitHub-style status badges across reviewer cards.
    - Cleaned up inline Jinja CSS styles across team_health.html to eliminate template validator warnings.
    - Updated repository count in the navbar and polished Model 1 attribution charts.

    ---

    Commits Included


  • ccd88a0 after ui changes bug fixes

  • 0768386 feat(ui): polished UI improvements for Model 1 chart, sidebar risk breakdown

  • f92db21 feat(ui): update repos view, navbar count, team health avatars, and badges

  • ec8cd6f Merge branch 'main' of https://github.com/ankit-cybertron/Vouch

  • 32ad550 feat: Features 1, 5, 6, 8 — Load Balancing, Pair Intelligence, SLA Predictions, Org Health

  • c834d7a fix(ui): remove inline Jinja styles to fix HTML/CSS validator errors and add reviewer avatars in team health

  • 08861e1 feat(reviewer): replace Domain Expertise with Workload Capacity & Consistent Review Pairs

  • c3c1eb5 feat(explain): implement Groq multi-key failover cascade and UI redesign
  • ---

    Verification & Testing


  • Automated Tests:

  • - tests/unit/test_groq_explanation.py: verified primary $\to$ backup cascade, user key prompting, and Bedrock fallback.
    - tests/unit/test_load_balancing.py, tests/unit/test_pair_intelligence.py, tests/unit/test_sla_predictions.py: verified routing and calculation engines.
    - tests/integration/dashboard_routes.py: verified all views (/, /repos, /pulls, /reviewer/<id>, /pair-intelligence, /team-health).
    - 186 / 186 unit and integration tests passing.

    Diff: 2678 lines (+2034 / -644) across 21 files Reviewer: ankit-cybertron Review duration: 6m
    Review confidence threshold not met — re-review recommended
    Residual risk 0.73 = Change Risk (0.82) × (1 − Review Confidence (0.11)). Flagged for follow-up review before production rollout.
    Model 1 · Change Risk (XGBoost)
    Score: 0.82 · 2678 lines diff across 21 files
    0.82
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.00 · 1 substantive comment(s)
    0.00
    Model 3 · Review Timing & Attention
    Session adequacy: 9% · Reviewer familiarity: 35%
    10%
    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.400
    Shallow Review Depth shallow_review_depth
    0.350
    Rapid Merge rapid_merge
    0.100
    Mass File Touch mass_file_touch
    0.080
    Real PR Conversation Timeline
    2 items
    ankit-cybertron ankit-cybertron approved these changes on Sep 20, 2026 10:32 UTC
    Approved Reviewer

    LGTM

    Assignees
    Ishaan-Chaturved1 Ishaan-Chaturved1
    Labels
    risk: high confidence: 11.0% needs-re-review
    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: 81.5% (HIGH) · Higher = larger blast radius
    81.5%
    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: 11.0% · Lower = rushed or shallow review
    11.0%
    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: 72.6% · Re-review required
    72.6%