feat(quest): emit deprecation notice for quest_clear alias#9
Merged
Merged
Conversation
561a376 to
d05bd60
Compare
quest_clear (MCP alias) and `guild quest clear` (cobra alias) now emit a one-line migration gradient so agents adopt quest_fulfill over time. MCP: ClearCommand.MCPFormat appends the notice after the success line. CLI: Command.CLIAliasDeprecations writes the notice to stderr (not stdout) when the command is called via the `clear` alias; --json mode is unaffected. QUEST-138 / LORE-122
d7242a9 to
7b0c198
Compare
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.
Summary
quest_clear(MCP alias) andguild quest clear(cobra alias) so agents and users see a pointer to the canonicalquest_fulfillverb.quest_fulfilloutput is unchanged — alias-only.The notice
Implementation
internal/command/command.go: newCLIAliasDeprecations map[string]stringfield onCommand[I,O]— maps alias name → notice stringinternal/command/cobra.go:cobraRunEcheckscc.CalledAs()against the map after rendering; writes notice tocc.ErrOrStderr()(human mode only; the JSON path returns early before this code runs)internal/quest/clear_cmd.go: definesclearDeprecationNoticeconst; setsFulfillCommand.CLIAliasDeprecations["clear"]; overridesClearCommand.MCPFormatto callformatFulfilledand append the noticeAcceptance criteria
quest_clearresponse includes⚠️ [deprecated] quest_clear will be removed — use quest_fulfillguild quest clear ...writes the notice to stderr (not stdout)--jsonmode is unaffected — notice never injected into JSON outputquest_fulfillresponse does NOT contain the noticeTestClearCommand_MCPBackwardCompatextended to assert deprecation line in MCP text outputTestCLI_QuestClearDeprecationStderrasserts stderr contains notice and stdout does not; sub-test asserts--jsonhas no leakagemake checkpassesSample
--jsonoutput (no leakage){"result":{"Cleared":{"id":"QUEST-140","subject":"demo quest","priority":"P2","status":"done","updated_at":"2026-04-21T16:44:27.428124Z"},"Unblocked":null}}Dependency
Stacks on PR #5 (
feat/quest-fulfill) —quest_clearas a backward-compat alias only exists in that branch. Must be merged after PR #5.Closes QUEST-138 · Spec: LORE-122 · Rename context: LORE-80