← Back to Pull requests

test(bundle): drive run()'s top-level setFailed catch through dist/index.js with a body-less issue_comment payload #361

Closed
unknown closed this pull request without merging on Oct 08, 2026 02:12 UTC
View on GitHub
unknown unknown commented on Oct 07, 2026 03:04 UTC
Author

Test Improvement

Adds __tests__/bundle/runTopLevelCatch.test.ts (one new file, no changes to existing tests or src/).

src/run.ts:40 — core.setFailed(...) in run()'s top-level catch — had unit coverage (__tests__/run.test.ts:108-125) but 0 e2e hits: every handler swallows its own rejections, so nothing in the bundle suite throws out to run(). handleIssueComment matches the comment body against each configured command before any per-command .catch, and splitLines calls body.replace unguarded, so an issue_comment payload with no comment object or a null body reaches the catch through dist/index.js.

The two cases pin the current contract: exit 1, exactly one ::error:: line (Cannot read properties of undefined|null (reading 'replace')), no API requests.

Evidence on main @ 3fc21f2:

  • before: npm run test:coverage:e2e → run.ts 88.88 % lines (line 40 uncovered)

  • after: run.ts 100 % lines; the one remaining branch is the non-Error String(error) arm, which the bundle cannot produce and run.test.ts:119 already covers.

  • npx eslint __tests__/bundle/runTopLevelCatch.test.ts clean; bundle suite 6 files / 144 tests pass.
  • Cluster claimed: src/run.ts top-level catch via handleIssueComment's unguarded body match. Disjoint from #343 (missing issue/pull number guards, body present), #324/#357 (commandLines fences, alias canonicalization).

    Related Issue


    Closes #360

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

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

    Diff: 199 lines (+149 / -50) across 2 files Reviewer: jeefy Review duration: 1387m
    All Vouch review confidence checks passed
    Residual risk 0.26 = Change Risk (0.59) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.59 · 199 lines diff across 2 files
    0.59
    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%
    56%
    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.317
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.059
    Real PR Conversation Timeline
    1 comments
    "Review active on #361"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% 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: 59.3% (MEDIUM) · Higher = larger blast radius
    59.3%
    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: 56.8% · Lower = rushed or shallow review
    56.8%
    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: 25.7% · Safe to merge
    25.7%