Repository navigation
fix: Help-Dump Emit Aliases - #44
Merged
Merged
Conversation
Adds an optional aliases field to HelpNode (omitempty) so ls/new/rm surface alongside list/create/delete in the structured help/wt.json tree, fixing shll.ai's README-drift checker false positives.
There was a problem hiding this comment.
Pull request overview
Adds first-class Cobra alias visibility to the wt help-dump structured output so downstream consumers (e.g., shll.ai’s README drift checker) can recognize alias-form invocations (ls, new, rm) as valid commands.
Changes:
- Extend
HelpNodewith an optionalaliasesfield (omitempty) and populate it fromcmd.Aliases. - Add unit and command-level tests that pin both alias presence and
omitemptyabsence behavior at the raw JSON level. - Update the in-repo help-dump contract memory doc and record the fab change plan/intake/status artifacts.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/internal/worktree/helpdump.go | Emit Cobra command aliases in the structured help-dump node output via an optional aliases field. |
| src/internal/worktree/helpdump_test.go | Add coverage that verifies alias list correctness and omitempty key absence/presence in marshaled JSON. |
| src/cmd/wt/help_dump_test.go | Add end-to-end validation that wt help-dump output includes aliases for known aliased commands and omits the key elsewhere. |
| docs/memory/wt-cli/help-dump-contract.md | Update the documented help-dump contract to include the optional aliases node field and current command inventory. |
| fab/changes/260718-zb77-help-dump-emit-aliases/plan.md | Capture requirements, tasks, and acceptance criteria for the change. |
| fab/changes/260718-zb77-help-dump-emit-aliases/intake.md | Record intake findings and rationale for choosing an optional aliases field approach. |
| fab/changes/260718-zb77-help-dump-emit-aliases/.status.yaml | Track change status and metrics for the fab pipeline. |
| fab/changes/260718-zb77-help-dump-emit-aliases/.history.jsonl | Record fab stage transitions and commands executed for traceability. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Meta
zb77excludes
fab/,docs/· generated by fab-kit v2.16.0Pipeline: intake ✓ → apply ✓ → review ✓ → hydrate ✓ → ship → review-pr
Summary
wt help-dumponly emitted each cobra command's canonical name, so alias forms (ls,new,rm) were invisible in the structuredhelp/wt.jsontree. This caused shll.ai's README-drift checker to flag these legitimate, working alias invocations as unknown commands.Changes
HelpNodegains an optionalaliasesfield (omitempty), placed alongsidenamebuildNodecopiescmd.Aliasesinto each node —list/create/deletenow carry["ls"]/["new"]/["rm"]; all other nodes remain byte-identicalhelpdump_test.goandhelp_dump_test.gopinning the new field's presence/absence