Skip to content

feat(quest): emit deprecation notice for quest_clear alias#9

Merged
kunallanjewar merged 1 commit into
mainfrom
fix/quest-138-clear-deprecation-notice
Apr 21, 2026
Merged

feat(quest): emit deprecation notice for quest_clear alias#9
kunallanjewar merged 1 commit into
mainfrom
fix/quest-138-clear-deprecation-notice

Conversation

@kunallanjewar
Copy link
Copy Markdown
Contributor

Summary

  • Adds a one-line migration gradient to quest_clear (MCP alias) and guild quest clear (cobra alias) so agents and users see a pointer to the canonical quest_fulfill verb.
  • quest_fulfill output is unchanged — alias-only.
  • JSON mode is unaffected — notice only appears in human-rendering paths.

The notice

⚠️ [deprecated] quest_clear will be removed — use quest_fulfill

Implementation

  • internal/command/command.go: new CLIAliasDeprecations map[string]string field on Command[I,O] — maps alias name → notice string
  • internal/command/cobra.go: cobraRunE checks cc.CalledAs() against the map after rendering; writes notice to cc.ErrOrStderr() (human mode only; the JSON path returns early before this code runs)
  • internal/quest/clear_cmd.go: defines clearDeprecationNotice const; sets FulfillCommand.CLIAliasDeprecations["clear"]; overrides ClearCommand.MCPFormat to call formatFulfilled and append the notice

Acceptance criteria

  • MCP quest_clear response includes ⚠️ [deprecated] quest_clear will be removed — use quest_fulfill
  • CLI guild quest clear ... writes the notice to stderr (not stdout)
  • --json mode is unaffected — notice never injected into JSON output
  • quest_fulfill response does NOT contain the notice
  • TestClearCommand_MCPBackwardCompat extended to assert deprecation line in MCP text output
  • New TestCLI_QuestClearDeprecationStderr asserts stderr contains notice and stdout does not; sub-test asserts --json has no leakage
  • make check passes

Sample --json output (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_clear as 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

Base automatically changed from feat/quest-fulfill to main April 21, 2026 19:53
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
@kunallanjewar kunallanjewar force-pushed the fix/quest-138-clear-deprecation-notice branch from d7242a9 to 7b0c198 Compare April 21, 2026 19:58
@kunallanjewar kunallanjewar enabled auto-merge (squash) April 21, 2026 19:58
@github-actions github-actions Bot added area: quest Quest board / task coordination area: cli CLI surface / cobra verbs size: M < 200 lines labels Apr 21, 2026
@kunallanjewar kunallanjewar merged commit 09fa102 into main Apr 21, 2026
13 checks passed
@kunallanjewar kunallanjewar deleted the fix/quest-138-clear-deprecation-notice branch April 21, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli CLI surface / cobra verbs area: quest Quest board / task coordination size: M < 200 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant