[Bug]: Extension alias conflict check misses spellings that map to the same file, so one extension overwrites and then deletes another's alias
维护者通常 1 天内回复
评估
调研方向
阅读 src/specify_cli/extensions/__init__.py,从 1203–1240 行附近的 _normalize_shadow_name 和 _validate_install_conflicts 开始。按照 issue 中的复现步骤操作,确认 shared.sync 和 shared-sync 指向同一个别名文件。完成标准是:添加第二个扩展时报告冲突,并保留第一个扩展的别名;在扩展测试旁添加一个有针对性的回归测试。
由索引模型根据 Issue 内容生成。
描述
Bug Description
_validate_install_conflicts normalises declared names with _normalize_shadow_name only when comparing them with core commands. Against installed extensions it uses an exact spelling check (if name in installed_names, src/specify_cli/extensions/__init__.py:1240). Aliases such as shared.sync and shared-sync both render to .claude/skills/speckit-shared-sync/SKILL.md, so a second extension is installed without error and overwrites the first extension's alias file. Removing the second extension then deletes that file, although the first extension is still installed.
Steps to Reproduce
Save this as repro.py and run uv run python -I repro.py from the repository root.
import os, tempfile
from pathlib import Path
from typer.testing import CliRunner
from specify_cli import app
root = Path(tempfile.mkdtemp())
def make_ext(eid, alias):
d = root / eid
(d / "commands").mkdir(parents=True)
(d / "commands/hello.md").write_text(f"---\ndescription: {eid}\n---\n\nHello from {eid}\n")
(d / "extension.yml").write_text(f"""schema_version: "1.0"
extension: {{id: {eid}, name: {eid}, version: 1.0.0, description: d}}
requires: {{speckit_version: ">=0.1.0"}}
provides:
commands:
- name: speckit.{eid}.hello
file: commands/hello.md
description: x
aliases: ["{alias}"]
""")
return d
proj = root / "project"
(proj / ".specify").mkdir(parents=True)
(proj / ".claude/skills").mkdir(parents=True)
os.chdir(proj)
run = lambda *a: CliRunner().invoke(app, list(a))
skill = proj / ".claude/skills/speckit-shared-sync/SKILL.md"
print("add alpha:", run("extension", "add", "--dev", str(make_ext("alpha", "shared.sync"))).exit_code)
print("skill belongs to alpha:", "alpha" in skill.read_text())
print("add beta:", run("extension", "add", "--dev", str(make_ext("beta", "shared-sync"))).exit_code)
print("skill belongs to beta:", "beta" in skill.read_text())
print("remove beta:", run("extension", "remove", "beta", "--force").exit_code)
print("alpha still installed:", "alpha" in run("extension", "list").output)
print("alpha's alias skill exists:", skill.exists())
Expected Behavior
specify extension add --dev for beta fails with a conflict error. The _validate_install_conflicts docstring says "Reject installs that would shadow core or installed extension commands" (__init__.py:1220). The _normalize_shadow_name docstring (__init__.py:1203-1216) notes that dotted and hyphenated spellings "land on the same on-disk command name".
Actual Behavior
add alpha: 0
skill belongs to alpha: True
add beta: 0
skill belongs to beta: True
remove beta: 0
alpha still installed: True
alpha's alias skill exists: False
Specify CLI Version
1.2.4.dev0 (main at 27d14e2)
AI Agent
Claude Code
Operating System
Linux 6.18 (Ubuntu container)
Python Version
Python 3.12.3
Additional Context
Comparing _normalize_shadow_name(name) against the normalised installed names, as is already done for core commands, would catch this.
Also reproduced on macOS (Darwin 25.6, arm64) with Python 3.14.4 and uv run python -I repro.py against 27d14e2; the output matches the above.
AI Disclosure
Found and reproduced with Claude Code (model: Claude Opus 4.8), run autonomously under human supervision. The human reporter re-ran every reproduction above before filing.
- 主要语言
- Python
- 星标
- 144k
- 派生
- 12.9k
- 平均合并
- 1 天 6 小时
- 30 天内合并 PR
- 194
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/spec-kit 的其他 Issue
-
The Python branch-creation port accepts an oversized `--number` and crashes at `int()` instead of rejecting it可能已有人在做 @github-actions 于 4 天前认领。 未关闭bug-assess bug-fix bug-test fix-proposed severity-low tests-passing triage-can-wait
难度 2/5 1-3 小时 新手友好度 84/100
github/spec-kit#5194 · 4 条评论 ·
维护者通常 1 天内回复
-
[Bug]: `create-new-feature.sh` rejects the feature descriptions `-n`, `-e` and `-E`, which the Python script accepts可能已有人在做 @WOLIKIMCHENG 于 8 天前认领。 未关闭triage-can-wait
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
[Bug]: `bundle init <bundle>` initialises with the default integration instead of the bundle's, then aborts with a clash可能已有人在做 @chelsealong 于 10 天前认领。 未关闭triage-must-have
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
[Bug]: `specify preset set-priority` does not update agent command files that are already written可能已有人在做 @mikamikasuki 于 9 天前认领。 未关闭triage-must-have
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 1 天内回复
-
[Bug]: Local config override file name differs between the docs (`<id>-config.local.yml`) and ConfigManager (`local-config.yml`)可能已有人在做 @gavenren 于 6 天前认领。 未关闭triage-must-have
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
相似的 Issue
-
难度 1/5 1-3 小时 新手友好度 78/100
QuantConnect/Documentation#2838 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
awslabs/route53-dynamic-dns-with-lambda#67 · 1 条评论 ·
-
`SubAgents` returns a child run's `DeferredToolRequests` to the parent as a successful tool result未关闭bug pkg:harness
难度 2/5 1-3 小时 新手友好度 70/100
pydantic/pydantic-ai#12405 ·
维护者通常 1 天内回复
-
good first issue help wanted
难度 2/5 1-3 小时 新手友好度 78/100
-
good first issue help wanted
难度 1/5 1 小时以内 新手友好度 82/100