Skip to content

fix(cli)!: refuse an old flat api key and name the key it moved to - #3145

Open
leemour wants to merge 1 commit into
mainfrom
fix/api-old-keys-refused
Open

leemour wants to merge 1 commit into
mainfrom
fix/api-old-keys-refused

Conversation

@leemour

@leemour leemour commented Nov 19, 2026

Copy link
Copy Markdown
Member

Task

Owner ruling NEED-2759 B: no exception to WC-CMD-8. An old flat api key (api.contacts-list) in a config is refused with an error that names the new key (api.contacts.list), on the command line and over MCP. It is no longer checked as an alias, as #3141 did.

Why

WC-CMD-8 keeps no alias for a moved path, its permission key included. A refusal is loud and never widens access, and the message says exactly what to rename.

What

  • serviceApiCommand marks the moved keys on its group (markRenamedPermissionKeys). The old keys are no longer known keys: not in extra, not in alsoChecks, not checked by the guard, and no warning.
  • The unknown-key checks read the marks and name the new key:
    • a saved key, refused before any command runs and by mcp serve (configuration_error): "permissions.api.contacts-list names no command: its command moved, so rename it to permissions.api.contacts.list";
    • mcp serve --permission api.contacts-list=deny;
    • config set permissions.api.contacts-list deny (validation_error).
  • Changelog fragment changes/fix-api-old-keys-refused.md under "Changed — may break callers".

Testing

  • service-api-groups.test.ts: an old key at deny and at allow is refused on the command line; mcp serve with a saved old key and with --permission; config set; nothing is sent.
  • vitest run src/cli src/mcp src/kit: 3354 pass. Plus typecheck and docs:check.

🤖 Generated with Claude Code

The owner ruled against the alias (NEED-2759): WC-CMD-8 keeps no alias,
for a path or its key. An old api.contacts-list in a config is now an
unknown key again, so every command, mcp serve and config set refuse it,
and the refusal names the new key to rename it to (api.contacts.list).
serviceApiCommand marks its moved keys on the group; the unknown-key
checks read them for the message. The alias check, its warning and its
--dry-run entry are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant