Skip to content

[quality] docs/commands.md has no test tying its command rows to the dispatcher in handleIssueComment.ts #253

Description

@hivecommons-hive

Finding

`docs/commands.md` is the user-facing list of slash commands and is linked from the bot's own refusal comments (`src/plugins/approve.ts`, asserted at `tests/plugins/approve.test.ts:330`). Nothing asserts that its table rows agree with what `src/issueComment/handleIssueComment.ts` actually dispatches:

  • the hand-written `handlers` map (19 commands, `handleIssueComment.ts:31-51`),
  • the explicit `commandAliases` (`/remove-lgtm`, `/remove-approve`, `/unhold`, `/remove-hold`, `handleIssueComment.ts:54-57`),
  • the label commands of `src/labels/prefixed.ts` and `src/labels/fixed.ts` with their `removeCommandFor` forms.

`tests/workflows.test.ts:106` only checks that the reusable workflow's `prow-commands` default contains the label and trigger commands; the doc's claim that the default is "every built-in command except `/meow`" (`.github/workflows/prow.yml:17`) is not checked as an equality, and `docs/commands.md` itself is read by no test. Adding a handler, renaming an alias or deleting a doc row passes the suite today.

Evidence (`main` @ c48bd6d): `vitest run --coverage` is at 99.83% statements / 98.35% branches, every remaining uncovered line is claimed by an open hold-gated PR (#217–#229), and `grep -rn commands.md tests` finds only the URL assertion above. This is a regression-risk/doc-drift gap, not a line-coverage gap; the bundle e2e suite (`tests/bundle/bundle.test.ts`) exercises command dispatch but reads no documentation.

Recommendation

Add `tests/commands.test.ts` that:

  1. derives the implemented set from the dispatcher source (handler keys, alias arrays) plus `prefixedLabelCommands`/`fixedLabelCommands` and their remove forms;
  2. derives the documented set from the first cell of every ```/...``` table row in `docs/commands.md` (skipping the `/` placeholders);
  3. asserts both inclusions, asserts `/override`, `/skip`, `/retest-required` stay listed as unsupported with neither a row nor a handler, and asserts the `prow.yml` `prow-commands` default equals exactly handlers-minus-`/meow` plus the label commands.

Priority

  • Impact: medium — the doc is what refused users are sent to; drift is silent
  • Effort: low

Filed by quality agent (hold-gated mode)


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

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

Activity

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