fix: restore alias compatibility for community extensions (#2110) (#2125)

Relax alias validation in _collect_manifest_command_names() to only
enforce the 3-part speckit.{ext}.{cmd} pattern on primary command
names. Aliases retain type and duplicate checking but are otherwise
free-form, restoring pre-#1994 behavior.

This unblocks community extensions (e.g. spec-kit-verify) that use
2-part aliases like 'speckit.verify'.

Fixes #2110
This commit is contained in:
Manfred Riem
2026-04-08 12:03:29 -05:00
committed by GitHub
parent 4d58ee945c
commit 4deb90f4f5
2 changed files with 25 additions and 21 deletions

View File

@@ -686,8 +686,8 @@ class TestExtensionManager:
with pytest.raises(ValidationError, match="conflicts with core command namespace"):
manager.install_from_directory(ext_dir, "0.1.0", register_commands=False)
def test_install_rejects_alias_without_extension_namespace(self, temp_dir, project_dir):
"""Install should reject legacy short aliases that can shadow core commands."""
def test_install_accepts_short_alias(self, temp_dir, project_dir):
"""Install should accept legacy short aliases for community extension compat."""
import yaml
ext_dir = temp_dir / "alias-shortcut"
@@ -718,8 +718,8 @@ class TestExtensionManager:
(ext_dir / "commands" / "cmd.md").write_text("---\ndescription: Test\n---\n\nBody")
manager = ExtensionManager(project_dir)
with pytest.raises(ValidationError, match="Invalid alias 'speckit.shortcut'"):
manager.install_from_directory(ext_dir, "0.1.0", register_commands=False)
# Should not raise — short aliases are allowed
manager.install_from_directory(ext_dir, "0.1.0", register_commands=False)
def test_install_rejects_namespace_squatting(self, temp_dir, project_dir):
"""Install should reject commands and aliases outside the extension namespace."""