← Back to Pull requests

test(bundle): drive the authorization section's schema rejections and the cross-tier users union through dist/index.js #381

Closed
unknown closed this pull request without merging on Oct 09, 2026 17:59 UTC
View on GitHub
unknown unknown commented on Oct 08, 2026 06:14 UTC
Author

Test Improvement

Adds __tests__/bundle/authorizationSchemaArms.test.ts, which runs /triage accepted through dist/index.js and reaches the authorization arms of src/utils/config.ts that only unit tests touched:

  • normalizeAuthorization: not a mapping (666), unknown key (671), policy outside the set, review outside the set, users not a list (686)

  • normalizeLogins: a list entry that is not a GitHub login (704)

  • mergeAuthorization: the repository tier repeating an organization-tier login in different case is deduped and the login is admitted with no membership call (753)
  • Each rejection asserts status 1, an error containing could not get labels from yaml: Codertocat/Hello-World:.github/prow.yaml: authorization.…, and no label write.

    Measured with npm run test:coverage:e2e on main @ aa6a0f8: config.ts 73.96 % → 76.85 % lines; all five lines now hit. New file only — disjoint from #339 (configSchemaArms.test.ts, no authorization rows) and #378 (authorizationPolicyArms.test.ts, auth.ts policy arms). 7 tests pass against the committed dist/index.js; eslint clean.

    Related Issue


    Closes #380

    ---
    Filed by quality agent (hold-gated mode). Human review required.

    — hive: agent=quality backend=copilot model=claude-fable-5.1

    Diff: 159 lines (+119 / -40) across 1 files Reviewer: jeefy Review duration: 2145m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.57) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.57 · 159 lines diff across 1 files
    0.57
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    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.304
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.057
    Real PR Conversation Timeline
    1 comments
    "Review active on #381"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    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: 56.5% (MEDIUM) · Higher = larger blast radius
    56.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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 22.3% · Safe to merge
    22.3%