Resolve command context for completion

This commit is contained in:
2026-11-03 03:51:26 +00:00
parent fc2f6d5346
commit 8bb5383169
3 changed files with 166 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
# Shell completion implementation plan
Status: Stages 1–3 complete. Stage 4 is next.
Status: Stages 1–4 complete. Stage 5 is next.
Implement the [shell completion roadmap](completion.md) from baseline
`2301872`. Follow the stages in order in one sprint. Intermediate stages may
@@ -148,6 +148,8 @@ Zsh, and Fish. Root and adapter package tests pass with `GOWORK=off` and
## Stage 4: Resolve the entered command context
Status: complete.
1. Add a private core completion request that separates completed words from
the current word. Call `resolveEnteredRoute` on completed words only;
use the snapshot's canonical metadata, resolved flag-alias context, and
@@ -172,6 +174,14 @@ Zsh, and Fish. Root and adapter package tests pass with `GOWORK=off` and
child shadowed in the entered route, and flags beginning before the
complete command path. Use existing routing rules as the oracle.
Completion: added private request context resolution using completed words and
the committed routing snapshot. Canonical child candidates are checked by
resolving the entered route with the candidate inserted; discovery-only and
unknown contexts do not invent command continuations. Tests cover canonical
and aliased routes, chains, scoped and discovery flag aliases, shadowed
children, runnable operand metadata, and paths ended by flags or operands.
The root package suite passes with `GOWORK=off` and `GOTOOLCHAIN=local`.
## Stage 5: Interpret flags and locate value positions
1. Walk the completed tail using the same canonical and alias spellings and