test(cmd): add an exhaustive :Forge completion slot matrix #342

Closed
opened 2026-04-20 00:19:08 +00:00 by barrettruth · 0 comments
barrettruth commented 2026-04-20 00:19:08 +00:00

Prerequisites

  • I have searched existing issues

Problem

The agreed stock :Forge cmdline contract is subtle. The interesting bugs here will not be obvious parse failures; they will be quiet drift between:

  • slot kind
  • mixed-slot ordering
  • suppression rules
  • cache/fetch boundaries
  • shared picker semantics

Without an exhaustive slot matrix, future edits to forge.cmd are likely to regress the contract silently.

Proposed solution

Add exhaustive test coverage for the stock :Forge completion contract.

Matrix categories to cover

  1. Root and family slots
    • :Forge <Tab>
    • :Forge pr <Tab>
    • :Forge issue <Tab>
    • :Forge ci <Tab>
    • :Forge release <Tab>
    • :Forge browse <Tab>
    • :Forge clear <Tab>
  2. Mixed slots
    • :Forge review <Tab>
    • :Forge issue browse <Tab>
    • :Forge ci browse <Tab>
    • :Forge release browse <Tab>
  3. Suppressed numeric subject slots
    • PR, issue, and CI subject positions
  4. Surviving dynamic subject slot
    • release tags on browse / delete
  5. Modifier-value subtrees
    • repo=
    • template=
    • head= / base=
    • branch= / commit=
    • target=
    • adapter=
    • method=
  6. Empty-result behavior
    • confirm no helpful-noise fallback

Specific assertions to require

  • numeric entity completion is suppressed even when a numeric prefix is typed
  • release tags remain dynamically completable on empty and non-empty prefix
  • mixed slots keep static/local candidates before dynamic ones
  • entering a name=... subtree disables forge entity-list fetching for that request
  • parser acceptance remains broader than completion suggestions where intended (for example, manually typed valid repo= values)
  • no fetch-on-keystroke behavior is implied or required by the tests

Acceptance criteria:

  • tests cover family slots, verb slots, subject slots, and modifier-value subtrees
  • tests cover mixed slots and ordering
  • tests cover suppression behavior, not just happy-path candidate-return cases
  • tests cover local-only modifier discovery and release-tag dynamics
  • the matrix is explicit enough that future changes to cmdline completion behavior have to update tests intentionally

Alternatives considered

  • Rely on the existing happy-path completion specs
  • Test only positive candidate-return cases and skip suppression behavior
## Prerequisites - [x] I have searched existing issues ## Problem The agreed stock `:Forge` cmdline contract is subtle. The interesting bugs here will not be obvious parse failures; they will be quiet drift between: - slot kind - mixed-slot ordering - suppression rules - cache/fetch boundaries - shared picker semantics Without an exhaustive slot matrix, future edits to `forge.cmd` are likely to regress the contract silently. ## Proposed solution Add exhaustive test coverage for the stock `:Forge` completion contract. ### Matrix categories to cover 1. Root and family slots - `:Forge <Tab>` - `:Forge pr <Tab>` - `:Forge issue <Tab>` - `:Forge ci <Tab>` - `:Forge release <Tab>` - `:Forge browse <Tab>` - `:Forge clear <Tab>` 2. Mixed slots - `:Forge review <Tab>` - `:Forge issue browse <Tab>` - `:Forge ci browse <Tab>` - `:Forge release browse <Tab>` 3. Suppressed numeric subject slots - PR, issue, and CI subject positions 4. Surviving dynamic subject slot - release tags on `browse` / `delete` 5. Modifier-value subtrees - `repo=` - `template=` - `head=` / `base=` - `branch=` / `commit=` - `target=` - `adapter=` - `method=` 6. Empty-result behavior - confirm no helpful-noise fallback ### Specific assertions to require - numeric entity completion is suppressed even when a numeric prefix is typed - release tags remain dynamically completable on empty and non-empty prefix - mixed slots keep static/local candidates before dynamic ones - entering a `name=...` subtree disables forge entity-list fetching for that request - parser acceptance remains broader than completion suggestions where intended (for example, manually typed valid `repo=` values) - no fetch-on-keystroke behavior is implied or required by the tests Acceptance criteria: - tests cover family slots, verb slots, subject slots, and modifier-value subtrees - tests cover mixed slots and ordering - tests cover suppression behavior, not just happy-path candidate-return cases - tests cover local-only modifier discovery and release-tag dynamics - the matrix is explicit enough that future changes to cmdline completion behavior have to update tests intentionally ## Alternatives considered - Rely on the existing happy-path completion specs - Test only positive candidate-return cases and skip suppression behavior
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
barrettruth/forge.nvim#342
No description provided.