← Back to Pull requests

test(bundle): drive createCommentOnce's already-carries-marker arm (comments.ts 59-60) through dist/index.js #379

Closed
unknown closed this pull request without merging on Oct 09, 2026 02:56 UTC
View on GitHub
unknown unknown commented on Oct 08, 2026 03:58 UTC
Author

Test Improvement

Adds __tests__/bundle/commentOnce.test.ts, driving the dedupe arm of src/utils/comments.ts createCommentOnce() (lines 59–60) through the shipped bundle via both production callers:

  • src/plugins/lgtmBinding.ts stripStaleLgtm() — pull_request labeled lgtm by a bot, with a github-actions[bot] comment already carrying <!-- prow-github-actions/lgtm-stale: <sha7> -->: the label is still stripped, ::debug::#1 already carries <marker> is logged, no POST …/issues/1/comments

  • src/plugins/tide.ts explainForkWorkflows() — schedule lgtm job on a fork pr refused with 403 over workflow files, with the <!-- prow-github-actions/fork-workflows: <sha7> --> comment already present: the pr is still skipped, no re-post

  • Counter-cases: a human (type: User) quoting the marker, a bot marker for a different head, and a body-less bot comment do not count — the explanation is posted
  • Evidence: npm run test:coverage:e2e → comments.ts 70 % → 100 % lines. npx vitest run __tests__/bundle/commentOnce.test.ts: 6/6 pass. No change to helpers.ts, fakeGithub.ts or production code.

    Disjoint from every open held test(bundle) PR: none routes a pre-existing marked comment (#318 covers the read failure of the stale comment; #347's dedupe is evaluateMerge's per-run set).

    Related Issue


    Closes #348

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

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

    Diff: 185 lines (+138 / -47) across 2 files Reviewer: jeefy Review duration: 1378m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.36) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.36 · 185 lines diff across 2 files
    0.36
    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.313
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #379"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% 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: 35.7% (MEDIUM) · Higher = larger blast radius
    35.7%
    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: 15.4% · Safe to merge
    15.4%