← Back to Pull requests

test(bundle): drive commandLines' fence-closer, indented-code and info-string guards through dist/index.js #324

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

Test Improvement

Files: __tests__/bundle/commandMarkdown.test.ts (new, bundle e2e). Cluster: src/utils/command.ts commandLines() / fenceOpener() / closesFence() — the Markdown-code guards — driven through dist/index.js with /hold as the probe. No src/, no helpers.ts, no existing suite touched; disjoint from every open held bundle PR (repoLabels() in helpers.ts is #246's, so this suite inlines its single labels route).

13 issue_comment cases:

  • fires once after Markdown code that ends — closed ``` ` `` and ~~~ fences, a ``` `` ``` fence closed by a longer closer, a closer with trailing whitespace, a backtick opener disqualified by a backtick in its info string (CommonMark), and an indented paragraph continuation — asserting the full request sequence (configReads(), GET /labels, one POST /issues/1/labels with do-not-merge/hold)

  • no API call for a /hold inside a fence that a shorter closer, a different fence character, or a closer with trailing text does not close; indented code after a blank line or at the start of the body; tab-indented code; and a later line of an indented block
  • Measured with npm run test:coverage:e2e on main @ 3fc21f2: command.ts 87.09 → 98.38 % lines, 79.41 → 94.11 % branches (previously only the unclosed-fence /kind case in bundle.test.ts reached commandLines' Markdown handling). The remainder — getLineArgs' ?? '' (L23) and getCommandArgs' throw (L38) — is unreachable from the dispatcher, which gates every handler on hasCommand.

    Verified locally: npx vitest run __tests__/bundle/commandMarkdown.test.ts → 13 pass; npx eslint and npx tsc --noEmit` clean.

    Related Issue


    Closes #323

    ---
    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: 233 lines (+174 / -59) across 2 files Reviewer: jeefy Review duration: 5276m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 233 lines diff across 2 files
    0.37
    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.326
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #324"
    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: 37.1% (MEDIUM) · Higher = larger blast radius
    37.1%
    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: 14.6% · Safe to merge
    14.6%