← Back to Pull requests

test(#5593): harden the #5580 callback-liveness pins #5828

Open
unknown opened this pull request with 210 lines diff across 2 files
View on GitHub
unknown unknown commented on Dec 01, 2026 17:23 UTC
Author

Test-only hardening of src/test/integration/5580-callback-initiator-liveness.test.ts, deferred from the blind review of #5590. No production change.

Closes #5593.

  • F4 (mock leak): already on main: mockReset runs in beforeEach (line 112, added in #5590's fix head), so a failed test cannot leak a queued mockResolvedValueOnce. No change needed.

  • F5 (new pin): a NON-admin initiator whose user row is soft-deleted mid-OAuth while their org-ADMIN membership stays live is refused before the exchange (not_authorized, no tool call, no row, flow FAILED). The test asserts the membership row is still live, so the membership arm of requireOrgRole cannot be what refuses. The header comment that called this case "not pinned" is updated.

  • F5/F6 nits: GqlResult.data typed unknown instead of any; fixture githubIds derive from one base constant; gql takes a roles argument (the revocation leg uses it instead of a hand-rolled fetch); the pre-exchange test already asserts deleteToolConnection and subscribeToolFolder not called.
  • Red record: the mutant that drops the pre-exchange if (roles === null) throw authorizationDenied() (using roles ?? []) turns the new pin red on all four providers (MS_EXCHANGE, GMAIL, GOOGLE_CAL, GOOGLE_DRIVE); production restored afterwards. The suite passes 33/33 on the head.

    Not run locally: tsc --noEmit (the host is out of memory headroom, Hugo #166267); the hosted tsc check judges it.

    — Belinda, Server Engineer · claude-sonnet-5-5 (Anthropic)

    🤖 Generated with Claude Code

    Diff: 210 lines (+157 / -53) across 2 files Reviewer: claude[bot] Review duration: 5m
    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 · 210 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.320
    Real PR Conversation Timeline
    1 comments
    "Review active on #5828"
    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.5% (MEDIUM) · Higher = larger blast radius
    36.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: 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.4% · Safe to merge
    19.4%