diff --git a/hermes_cli/commands.py b/hermes_cli/commands.py index dc931820e6c..20a87eb811c 100644 --- a/hermes_cli/commands.py +++ b/hermes_cli/commands.py @@ -1037,7 +1037,11 @@ _SLACK_RESERVED_COMMANDS = frozenset({ # unrelated command landed. These claim their slots right after /hermes, # ahead of both canonical names and the rest of the aliases. Anything not # listed here still degrades gracefully (reachable via /hermes ). -_SLACK_PRIORITY_ALIASES = ("btw", "bg", "reset") +# Keep this list TIGHT: every pinned alias takes a slot a canonical command +# would otherwise get, and the Telegram-parity test fails when a canonical +# gets clamped ("reset" was unpinned for exactly that — /new keeps its +# native slot, the alias spelling stays reachable via /hermes reset). +_SLACK_PRIORITY_ALIASES = ("btw", "bg") def _sanitize_slack_name(raw: str) -> str: diff --git a/tests/hermes_cli/test_commands.py b/tests/hermes_cli/test_commands.py index 62c2be4ab79..0954ccf790d 100644 --- a/tests/hermes_cli/test_commands.py +++ b/tests/hermes_cli/test_commands.py @@ -336,20 +336,22 @@ class TestSlackNativeSlashes: ) def test_includes_aliases_as_first_class_slashes(self): - """Aliases (/btw, /bg, /reset, …) must be registered as standalone + """Aliases (/btw, /bg, …) must be registered as standalone slashes — this is the whole point of native-slashes parity. Asserts the contract (aliases are surfaced as first-class slashes), not a specific alias's survival of Slack's 50-slash clamp — which alias - lands last shifts whenever a canonical command is added, so pinning one - name (previously ``q``) made this a change-detector. + lands last shifts whenever a canonical command is added. Only the + explicitly pinned ``_SLACK_PRIORITY_ALIASES`` are guaranteed slots; + every other alias (e.g. ``reset``) may be clamped once the registry + fills the cap — canonical commands win the contest, and clamped + aliases stay reachable via ``/hermes ``. """ slashes = slack_native_slashes() names = {n for n, _d, _h in slashes} - # Aliases that sort early in the registry always fit under the cap. + # The pinned priority aliases are guaranteed to survive the clamp. assert "btw" in names assert "bg" in names - assert "reset" in names # And at least one alias is surfaced as an alias entry (description # carries the "Alias for /…" marker), proving the alias pass ran. assert any(d.startswith("Alias for /") for _n, d, _h in slashes)