[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
- 星號
- 147k
- 分支
- 13.2k
- 平均合併
- 1 天 6 小時
- 30 天內合併 PR
- 208
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
github/spec-kit 的其他 Issue
-
[Bug]: `create-new-feature.sh` rejects the feature descriptions `-n`, `-e` and `-E`, which the Python script accepts可能已有人在做 @WOLIKIMCHENG 於 10 天前認領。 未關閉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 於 11 天前認領。 未關閉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 於 11 天前認領。 未關閉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 於 7 天前認領。 未關閉triage-must-have
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
bug-assess invalid triage-must-have
難度 2/5 1-3 小時 新手友好度 78/100
github/spec-kit#5080 · 1 則留言 ·
維護者通常 1 天內回覆
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
huggingface/deep-rl-class#723 ·
-
[tool] bug: Qwen3 XML tool parser raises on `...` argument values (Ellipsis is not JSON serializable)可能已有人在做 @super-yuki 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 87/100
verl-project/verl#8559 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 75/100
TencentCloud/octop-harness#228 ·
維護者通常 1 天內回覆
-
fix(requirements): UTF-8 BOM omits the first pinned requirement可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
google/osv-scalibr#2585 ·
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 85/100
NousResearch/hermes-agent#149323 ·
維護者通常 1 天內回覆