specline 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specline",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "Spec-driven AI coding pipeline with deterministic quality gates for Cursor IDE",
5
5
  "bin": {
6
6
  "specline": "./cli.mjs"
@@ -202,6 +202,29 @@ specline-pipeline-gate.sh new --change "<change-name>"
202
202
  4. 尽量将任务拆解为互相独立、无数据依赖的单元
203
203
  5. 目标:`Depends: (none)` 的任务数 / 总任务数 ≥ 60%
204
204
 
205
+ ### 测试文件归属(tasks.md 末尾)
206
+
207
+ 在所有 `## N. [ ]` 任务节之后、tasks.md 文件末尾,追加「测试文件归属」表格节。
208
+
209
+ **模板**:
210
+
211
+ ````markdown
212
+ ### 测试文件归属
213
+
214
+ | 测试文件(目录) | 测试类型 | 负责者 |
215
+ |-----------------|---------|-------|
216
+ | tests/unit/<module>/ | 单元测试 | Coding Agent (Task N) |
217
+ | tests/integration/test_<capability>.py | 集成测试 | specline-test-writer |
218
+ | tests/e2e/test_<capability>_flow.py | E2E 测试 | specline-test-writer |
219
+ ````
220
+
221
+ **生成规则**:
222
+ - 对每个 `Testable: true` 的任务,从其任务描述和 Files 字段推导模块名,生成单元测试目录行(`tests/unit/<module>/` 或 `tests/models/<module>/`),负责者标注为「Coding Agent (Task N)」
223
+ - 对 `specs/` 下每个 capability 目录,生成集成测试文件行(`tests/integration/test_<capability>.py`)和 E2E 测试文件行(`tests/e2e/test_<capability>_flow.py`),负责者标注为「specline-test-writer」
224
+ - 表格按 capability 分组,单元测试行在前、集成/E2E 测试行在后
225
+ - 如果无 Testable: true 的任务,跳过 Coding Agent 的单元测试行,仅保留集成/E2E 行
226
+ - **测试文件归属** 节放在所有 `## N. [ ]` 任务节之后、tasks.md 文件末尾
227
+
205
228
  ### 完成后自检
206
229
 
207
230
  1. 确认 4 个文件均已生成到 `specline/changes/<change-name>/` 下
@@ -130,6 +130,20 @@ specline-pipeline-gate.sh artifacts --change "<name>" --json
130
130
  | 可追溯 | 每个任务必须通过 Covers 追溯到具体 Requirement/Scenario |
131
131
  | Testable 标注 | 无依赖 + 有可测代码 + 非 config/docs → Testable: true |
132
132
 
133
+ ### 测试文件归属
134
+
135
+ specline-spec-creator 生成的 tasks.md 末尾会包含「测试文件归属」表格节,按 capability 分组列出:
136
+
137
+ | 测试文件(目录) | 测试类型 | 负责者 |
138
+ |-----------------|---------|-------|
139
+ | tests/unit/<module>/ | 单元测试 | Coding Agent (Task N) |
140
+ | tests/integration/test_<capability>.py | 集成测试 | specline-test-writer |
141
+ | tests/e2e/test_<capability>_flow.py | E2E 测试 | specline-test-writer |
142
+
143
+ > - 单元测试(`tests/unit/` 或 `tests/models/`)归属 coding agent
144
+ > - 集成测试(`tests/integration/`)和 E2E 测试(`tests/e2e/`)归属 specline-test-writer
145
+ > - coding agent 和 test-writer 应只在自己的边界内编写测试文件
146
+
133
147
  ---
134
148
 
135
149
  ### Guardrails