Skip to content

Commit 6048674

Browse files
Fix core command inventory namespacing
Assisted-by: GitHub Copilot (model: GPT-5.6, autonomous) Co-authored-by: nicolehaugen <10600161+nicolehaugen@users.noreply.github.com>
1 parent e295871 commit 6048674

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

‎src/specify_cli/core/__init__.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ def _normalize_description(raw: Any, *, kind: str, name: str, source_path: str)
281281
def _build_command_entry(name: str, layout: _CoreLayout) -> dict[str, Any]:
282282
file_path = layout.commands_dir / f"{name}.md"
283283
source_path = _package_relative(layout.command_source_path(name))
284+
logical_name = f"speckit.{name}"
284285
if not file_path.is_file():
285286
raise CoreInventoryError(
286287
error="core_inventory.missing_file",
@@ -327,8 +328,8 @@ def _build_command_entry(name: str, layout: _CoreLayout) -> dict[str, Any]:
327328
frontmatter.get("handoffs"), name=name, source_path=source_path
328329
)
329330
return {
330-
"id": f"core:_:command:{name}",
331-
"name": name,
331+
"id": f"core:_:command:{logical_name}",
332+
"name": logical_name,
332333
"description": description,
333334
"sourcePath": source_path,
334335
"artifact": artifact,

‎tests/test_core_inventory.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def test_parse_command_frontmatter_rejects_non_mapping(tmp_path: Path) -> None:
170170
def test_build_command_entries_uses_typed_empty_defaults(well_formed_layout: Path, override_layout) -> None:
171171
override_layout(well_formed_layout)
172172
inv = build_core_inventory()
173-
alpha = next(c for c in inv["commands"] if c["name"] == "alpha")
173+
alpha = next(c for c in inv["commands"] if c["name"] == "speckit.alpha")
174174
# alpha.md declares only `description:` — everything else must default.
175175
assert alpha["artifact"] is None
176176
assert alpha["optional"] is False
@@ -180,7 +180,7 @@ def test_build_command_entries_uses_typed_empty_defaults(well_formed_layout: Pat
180180
def test_build_command_handoffs_flatten_agent_field(well_formed_layout: Path, override_layout) -> None:
181181
override_layout(well_formed_layout)
182182
inv = build_core_inventory()
183-
beta = next(c for c in inv["commands"] if c["name"] == "beta")
183+
beta = next(c for c in inv["commands"] if c["name"] == "speckit.beta")
184184
# beta.md's handoffs are mappings with `agent:` — we surface only agent ids.
185185
assert beta["handoffs"] == ["alpha", "alpha"]
186186

0 commit comments

Comments
 (0)