feat(cmd): make subject completion cache-backed and state-aware #330

Merged
barrettruth merged 2 commits from feat/dynamic-completion into main 2026-04-19 16:37:21 +00:00
barrettruth commented 2026-04-19 05:06:13 +00:00

Problem

Ex completion was still mostly grammar-driven. It could complete repos, refs, and static modifier values, but not real PR, issue, CI, or release subjects, so flows like :Forge pr merge <Tab> and :Forge issue close <Tab> could not suggest actionable items. The picker already had state- and capability-aware gating for many of these operations, which left the Ex surface drifting away from the picker surface tracked by #314 and #298.

Solution

Add cache-backed dynamic subject completion for PRs, issues, CI runs, and releases in forge.cmd, using existing durable list caches first and falling back to backend list commands when the relevant cache is cold. Resolve completion scope from repo= when present and otherwise from the current forge scope so completion reuses the same scoped cache keys as the pickers. Extract shared PR availability helpers into forge.availability and use them from both picker action gating and Ex completion filtering so merge / approve / draft / ready suggestions stay aligned with picker behavior. Extend the command specs to cover cache hits, backend fallback, scoped completion, and state-aware filtering across PR, issue, CI, and release subjects.

## Problem Ex completion was still mostly grammar-driven. It could complete repos, refs, and static modifier values, but not real PR, issue, CI, or release subjects, so flows like `:Forge pr merge <Tab>` and `:Forge issue close <Tab>` could not suggest actionable items. The picker already had state- and capability-aware gating for many of these operations, which left the Ex surface drifting away from the picker surface tracked by #314 and #298. ## Solution Add cache-backed dynamic subject completion for PRs, issues, CI runs, and releases in `forge.cmd`, using existing durable list caches first and falling back to backend list commands when the relevant cache is cold. Resolve completion scope from `repo=` when present and otherwise from the current forge scope so completion reuses the same scoped cache keys as the pickers. Extract shared PR availability helpers into `forge.availability` and use them from both picker action gating and Ex completion filtering so merge / approve / draft / ready suggestions stay aligned with picker behavior. Extend the command specs to cover cache hits, backend fallback, scoped completion, and state-aware filtering across PR, issue, CI, and release subjects.
Sign in to join this conversation.
No description provided.