← Back to Pull requests

test(bundle): drive the missing issue/pull number guards of every command handler and onPrLgtm through dist/index.js #343

Closed
unknown closed this pull request without merging on Oct 09, 2026 01:30 UTC
View on GitHub
unknown unknown commented on Oct 06, 2026 06:36 UTC
Author

Test Improvement

Adds __tests__/bundle/missingNumberGuards.test.ts (27 tests), driving through dist/index.js the one arm every command handler shares and no bundle fixture had ever reached: the github context payload missing issue number guard (pull number in cc.ts/uncc.ts, pr number in onPrLgtm.ts) thrown before the first API call.

Claimed ground — exactly these 18 statements, all at 0 end-to-end hits on main @ 3fc21f2 and still at 0 after overlaying every open hold-gated bundle PR (#242–#341):

src/issueComment/{assign.ts:29, unassign.ts:25, cc.ts:26, uncc.ts:25, approve.ts:44, retitle.ts:26, close.ts:24, lock.ts:33, reopen.ts:21, milestone.ts:28, meow.ts:35, trigger.ts:207 (prepare)}, src/labels/{remove.ts:25, hold.ts:30, lgtm.ts:39, fixed.ts:70, prefixed.ts:146}, src/pullReq/onPrLgtm.ts:19.

  • For each of /assign /unassign /cc /uncc /approve /retitle /remove /hold /lgtm /close /lock /reopen /milestone /meow /retest /help /kind: an issue_comment payload with issue.number deleted exits 1 and core.setFailed carries error handling issue comment: Error: github context payload missing issue|pull number: [object Object].

  • For the hand-written commands that read nothing before the guard (/assign /cc /retitle /close /lock /reopen /milestone /meow /retest): the fake GitHub receives no request.

  • jobs: lgtm on a pull_request synchronize payload with pull_request.number deleted fails with error handling pull request: Error: github context payload missing pr number.
  • Measured with npm run test:coverage:e2e on main @ 3fc21f2: src/ 77.9 % → 79.16 % lines; all 18 listed statements go from 0 to ≥1 hits. The file passes against both the committed dist/index.js (npx vitest run __tests__/bundle/missingNumberGuards.test.ts) and the source-mapped coverage bundle; eslint and tsc --noEmit clean. No src/, dist/ or workflow changes.

    Related Issue


    Closes #342

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

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

    Diff: 259 lines (+194 / -65) across 3 files Reviewer: jeefy Review duration: 4013m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 259 lines diff across 3 files
    0.39
    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.333
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #343"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% 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: 39.2% (MEDIUM) · Higher = larger blast radius
    39.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: 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: 15.5% · Safe to merge
    15.5%