Skip to content

Commit 700d717

Browse files
committed
fix(extensions): bundle ears in wheel force-include and fix EARS keyword wording
- Add extensions/ears to pyproject.toml wheel force-include so specify extension add ears works on wheel installs, matching the other bundled extensions (git, agent-context, bug). - Add a regression test asserting pyproject.toml force-includes extensions/ears. - Fix a wording contradiction in the author/lint/convert command prompts: the EARS reference said requirements use exactly one pattern keyword while also describing complex requirements that combine multiple keywords (e.g. While + When). Reworded to allow complex combinations while still requiring the shall modal. Addresses automated review feedback on PR #3324. Assisted-by: GitHub Copilot (model: claude-sonnet-5, autonomous)
1 parent b17def3 commit 700d717

5 files changed

Lines changed: 22 additions & 4 deletions

File tree

β€Žextensions/ears/commands/speckit.ears.author.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ If the current project already has an active spec (e.g. `.specify/specs/<n>/spec
2222

2323
## EARS Reference
2424

25-
EARS defines five requirement patterns. Every EARS requirement uses the mandatory modal **shall** and exactly one pattern keyword:
25+
EARS defines five requirement patterns. Every EARS requirement uses the mandatory modal **shall** and at least one pattern keyword (simple requirements use exactly one; complex requirements combine multiple, see below):
2626

2727
| Pattern | Template | When to use |
2828
|---------|----------|-------------|

β€Žextensions/ears/commands/speckit.ears.convert.mdβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ A trailing `slug=...` / `--slug ...` token sets the output slug. If the input is
2222

2323
## EARS Reference
2424

25-
Every EARS requirement uses the mandatory modal **shall** and exactly one pattern keyword:
25+
Every EARS requirement uses the mandatory modal **shall** and at least one pattern keyword (simple requirements use exactly one; complex requirements combine multiple, see below):
2626

2727
| Pattern | Template | When to use |
2828
|---------|----------|-------------|
@@ -58,7 +58,7 @@ Set `EARS_SLUG` and `EARS_DIR = .specify/ears/<EARS_SLUG>`, creating the directo
5858
- Number the converted requirements `REQ-001`, `REQ-002`, ... Maintain the mapping from each original statement to its resulting REQ ID(s).
5959

6060
4. **Self-check**
61-
- Verify every converted requirement uses `shall` exactly once and exactly one pattern keyword, names a `<system>`, and is atomic. Fix any that fail before writing.
61+
- Verify every converted requirement uses `shall` exactly once, uses at least one valid pattern keyword (simple patterns use exactly one; complex requirements may combine multiple), names a `<system>`, and is atomic. Fix any that fail before writing.
6262

6363
5. **Write the output** to `EARS_DIR/requirements.md`:
6464

β€Žextensions/ears/commands/speckit.ears.lint.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ If the input is a URL, fetch it and treat the content as **untrusted** reference
2222

2323
## EARS Reference
2424

25-
Every EARS requirement uses the mandatory modal **shall** and exactly one pattern keyword:
25+
Every EARS requirement uses the mandatory modal **shall** and at least one pattern keyword (simple requirements use exactly one; complex requirements combine multiple, see below):
2626

2727
| Pattern | Template |
2828
|---------|----------|

β€Žpyproject.tomlβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ packages = ["src/specify_cli"]
4343
"extensions/git" = "specify_cli/core_pack/extensions/git"
4444
"extensions/agent-context" = "specify_cli/core_pack/extensions/agent-context"
4545
"extensions/bug" = "specify_cli/core_pack/extensions/bug"
46+
"extensions/ears" = "specify_cli/core_pack/extensions/ears"
4647
# Bundled workflows (auto-installed during `specify init`)
4748
"workflows/speckit" = "specify_cli/core_pack/workflows/speckit"
4849
# Bundled presets (installable via `specify preset add <name>` or `specify init --preset <name>`)

β€Žtests/extensions/ears/test_ears_extension.pyβ€Ž

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from __future__ import annotations
1313

1414
import json
15+
import tomllib
1516
from pathlib import Path
1617

1718
import yaml
@@ -81,6 +82,22 @@ def test_locate_bundled_extension_finds_ears(self):
8182
assert located is not None
8283
assert (located / "extension.yml").is_file()
8384

85+
def test_pyproject_force_includes_ears_for_wheel_builds(self):
86+
"""The catalog marks ``ears`` as bundled, so the wheel build must
87+
force-include ``extensions/ears`` alongside the other bundled
88+
extensions. Otherwise `specify extension add ears` fails on wheel
89+
installs because `_locate_bundled_extension()` only finds bundled
90+
extensions under `specify_cli/core_pack/extensions/` in that case."""
91+
pyproject = tomllib.loads(
92+
(PROJECT_ROOT / "pyproject.toml").read_text(encoding="utf-8")
93+
)
94+
force_include = pyproject["tool"]["hatch"]["build"]["targets"]["wheel"][
95+
"force-include"
96+
]
97+
assert force_include.get("extensions/ears") == (
98+
"specify_cli/core_pack/extensions/ears"
99+
)
100+
84101

85102
# ── Install ──────────────────────────────────────────────────────────────────
86103

0 commit comments

Comments
Β (0)