Plan application alias implementation

This commit is contained in:
2026-10-19 14:41:10 +00:00
parent f3b8a129d9
commit d7cc12a347
2 changed files with 723 additions and 47 deletions

View File

@@ -2,7 +2,9 @@
Status: command- and flag-alias behavior and consumer API direction accepted;
implementation has not started. OD-1 through OD-6 are resolved. This roadmap
records the target and work needed before implementation.
records the target and selected behavior. The
[staged implementation plan](implementation.md) owns delivery sequencing and
stage-specific validation.
[ADR 0013](../adr/0013-application-alias-routing.md) records the accepted
architectural ownership and shared installation decisions.
@@ -235,8 +237,8 @@ establish nontermination. With canonical group `group`, the mappings `a → grou
and `group again → a` allow `a again again` to terminate: each round consumes
an `again` token. Validate actual prefix-resolution behavior, including
terminating repetitions, suffix-dependent cycles, and growing expansions.
Establish focused evidence for this validation before building the rest of
routing around the algorithm.
Termination validation must distinguish these cases without conservatively
rejecting terminating repetitions.
### Installation and collisions
@@ -570,51 +572,19 @@ and help responsibilities; it does not require a public metadata API or a
general completion framework. Shell selection, candidate presentation, and
dynamic value completion remain future design work.
## Work needed from the baseline
## Delivery and compatibility
1. Prepare consumer examples for the selected declaration types and shared path handling,
covering a command shortcut, a synonym inside an integration namespace, and
a group shortcut, an application-wide help flag alias, and a command-scoped
flag alias reached through a command shortcut.
2. Establish termination-validation behavior with focused evidence for valid
repetitions, suffix-dependent cycles, and growing prefix expansions before
building the rest of routing around the algorithm.
3. Implement the selected declaration types and shared path primitives. Define
and verify installation handling for nil declarations and zero `RoutingRule`
values alongside the existing invalid-zero and explicit-absence command
contracts. Validate flag declarations as individual spellings. Extend
installation to validate aliases and commands against the complete candidate
batch, preserving retained errors and atomicity. Keep aliases
independent of optional-library dependencies and backend-specific exports.
4. Integrate command and flag alias resolution with canonical routing, help, and
invocation identity. Use canonical flag metadata and the existing parser to
preserve values and operands, and reuse typed execution machinery. Apply the
selected short-option grammar and correct explicit empty values for canonical
short spellings and aliases together. Keep metadata lookup separate from
execution and help rendering as described under future shell completion,
without implementing completion in this delivery.
5. Add focused behavioral evidence for both example mappings, group aliases,
longest matches, chains, group composition, cycles and nonterminating prefix
expansion, collisions, missing targets, same-batch
resolution, later registration, argument preservation, help without
acquisition, and a single execution lifecycle. Cover application-wide and
command-scoped flag mappings, attached and separate values, option termination,
mixed canonical/alias repetitions, flag chains and scope overrides, short
aliases, mixed clusters, attached values, explicit empty-value correction,
flag help and diagnostics, and unchanged typed binding semantics.
Include discovery-help contexts without canonical commands, longer aliases
beneath operand-taking command shortcuts, rejection of operand-bearing
targets, and canonical flag endpoints alongside inactive global mappings.
Verify rejection of `promptkit test full → promptkit test all` and
preservation of the supplied `all` operand through the valid
`smoke → promptkit test` shortcut.
6. Add maintained consumer examples and update GoDoc, the CLI reference, consumer
guidance, and internal documentation when implementation lands. Validate the
affected modules under the [developer guide](../development.md).
7. Document migration from `...Command` to `...Declaration`, including slice
conversion, and the explicit empty-value correction. Include the compatibility
impact and required consumer action in release notes under the
[release policy](../policy/release.md#versioning-and-compatibility).
The [implementation plan](implementation.md) defines the ordered work from the
current baseline, implementation choices, and evidence for the selected behavior.
The delivered feature includes maintained consumer examples, GoDoc, CLI and
consumer guidance, and internal documentation matching the implemented owners.
Consumer guidance and release notes explain migration from `...Command` to
`...Declaration`, including slice conversion, and the explicit short-option
empty-value correction under the
[release policy](../policy/release.md#versioning-and-compatibility). Nil and zero
declaration handling is specified by the implementation plan alongside the
existing invalid-zero and explicit-absence command contracts.
This delivery is complete when consumers can declare alternate command paths
and flag spellings with minimal wiring and invoke canonical behavior and help through