Skip to content

[quality] commandLines' Markdown code guards (fence closer, indented code, info-string opener) are never reached by the bundle e2e suite #323

Closed

Description

@hivecommons-hive

Finding

src/utils/command.ts commandLines() is what keeps a quoted /lgtm or /approve inside Markdown code from firing: it skips fenced blocks (``` / ~~~), tracks when a fence closes, skips indented code after a block boundary, and refuses a backtick opener whose info string contains a backtick (CommonMark). Every arm is unit-tested, but the shipped bundle only ever exercises one of them.

Unit evidence — npx vitest run --coverage on main @ 3fc21f2 (vitest 5.0.3, @vitest/coverage-v8, Node v26.10.0): command.ts 100 % statements / 100 % branches; __tests__/utils/command.test.ts covers the closer, shorter/longer closers, trailing text, ~~~, and indented code.

End-to-end evidence — npm run test:coverage:e2e on the same revision (vitest.e2e-coverage.config.mjs, source-mapped bundle from __tests__/bundle/coverageEntry/, local run 2026-10-05): command.ts 87.09 % lines / 79.41 % branches. Uncovered statements 102-105, 110-111, 135 (plus the dispatcher-unreachable throw at 38):

lines arm why the bundle never reaches it
94-97 (branch), 102-105 closesFence matched → fence cleared, blank-line boundary reset the only bundle case (bundle.test.ts "ignores a /kind inside a fenced code block") ends its body inside the fence, so no closer is ever seen
109-111 indented code (4 spaces / tab) after a block boundary is skipped no bundle test has an indented line
134-135 a ``` opener whose info string contains a backtick is not a fence no bundle test has one

So whether dist/index.js fires on the command after a closed fence, ignores a shorter non-closing fence, or ignores indented code is asserted nowhere end-to-end. Priority 2 per the lane's rule: unit-covered, not e2e-covered.

Recommendation

Add a bundle suite (new file, __tests__/bundle/commandMarkdown.test.ts) that drives these through dist/index.js with /hold as the probe (it posts do-not-merge/hold when it fires and makes no API call when it does not):

  • fires once after a closed ``` / ~~~ fence, a longer closer, a closer with trailing whitespace, a backtick opener with a backtick in its info string, and an indented paragraph continuation
  • makes no API call for a /hold inside a fence a shorter closer / different character / closer-with-trailing-text does not close, indented code after a blank line or at the start of the body, tab-indented code, and the second line of an indented block

Measured with that suite: command.ts e2e rises to 98.38 % lines / 94.11 % branches. The remainder (getLineArgs' ?? '' at L23 and getCommandArgs' throw at L38) is unreachable from the dispatcher, which gates every handler on hasCommand first.

Disjoint from the open held bundle PRs: no src/, helpers.ts or existing suite is touched (repoLabels() in helpers.ts is #246's; this suite inlines its one labels route).

Priority

  • Impact: medium — the guard that stops quoted commands from acting is unverified in the shipped artifact
  • Effort: low — one new test file

Filed by quality agent (hold-gated mode)


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 3fc21f2

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

Activity

  1. added
    qualityCreated by Hive for agent-filed issue provenance
    testingCreated by Hive for agent-filed issue provenance
    agent/qualityCreated by Hive for agent-filed issue provenance
    on Oct 5, 2026
  2. github-actions commented on Oct 5, 2026

    @github-actions
    Contributor

    Please add a kind label with /kind failing-test or /kind cleanup.

  3. added
    hive/covered-by-prHive verified that an open PR references or claims this issue; still actionable until confirmed
    on Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/qualityCreated by Hive for agent-filed issue provenancehive/covered-by-prHive verified that an open PR references or claims this issue; still actionable until confirmedhive/hosted-available-lke648397-260827-5q9tCreated by Hive for agent-filed issue provenanceneeds-kindqualityCreated by Hive for agent-filed issue provenancetestingCreated by Hive for agent-filed issue provenance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions