sillyspec 3.22.0 → 3.22.1

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": "sillyspec",
3
- "version": "3.22.0",
3
+ "version": "3.22.1",
4
4
  "description": "SillySpec CLI — 流程状态机,让 AI 严格按步骤来",
5
5
  "icon": "logo.jpg",
6
6
  "homepage": "https://sillyspec.ppdmq.top/",
@@ -361,30 +361,48 @@ function parseWavesFromPlan(planContent) {
361
361
  const lines = planContent.split('\n')
362
362
  let currentWave = null
363
363
  let currentTask = null
364
+ // light/none plan.md 用 `## Tasks`(无 `## Wave N`)包任务,需识别为隐式任务区,
365
+ // 让其中的 task checkbox 能被收进惰性创建的隐式 Wave(见下方 taskMatch 分支)。
366
+ let inImplicitTaskSection = false
364
367
 
365
368
  for (const line of lines) {
366
369
  const waveMatch = line.match(/^#+\s*Wave\s+(\d+)/i)
367
370
  if (waveMatch) {
368
371
  currentWave = { index: parseInt(waveMatch[1]), tasks: [] }
369
372
  currentTask = null
373
+ inImplicitTaskSection = false
370
374
  waves.push(currentWave)
371
375
  continue
372
376
  }
373
377
 
374
- // 遇到任何非 Wave 的标题行(## 自检、## 备注 等)时退出当前 Wave 段,
375
- // 避免「## 自检」段里的 - [x] checkbox 被误当 task 定义解析(导致
376
- // Contract 校验报 task id 重复/不连续)。详见 docs/sillyspec/plan-postcheck-self-check-checkbox-false-dup.md
377
- if (/^#+\s/.test(line)) {
378
+ // 任何非 Wave 的标题行:
379
+ // 1) 退出当前显式 Wave 段,避免「## 自检」段里的 - [x] checkbox 被误当 task 定义解析
380
+ // (导致 Contract 校验报 task id 重复/不连续,详见 docs/sillyspec/plan-postcheck-self-check-checkbox-false-dup.md
381
+ // 2) 识别 light/none 的 `## Tasks`/`## 任务` 任务区(无 Wave 标题),置位隐式任务区标志
382
+ const headingMatch = line.match(/^#+\s+(.+?)\s*$/)
383
+ if (headingMatch) {
378
384
  currentWave = null
379
385
  currentTask = null
386
+ const headingText = headingMatch[1].trim().toLowerCase()
387
+ inImplicitTaskSection = /^(tasks?|任务)$/.test(headingText)
380
388
  continue
381
389
  }
382
390
 
383
- if (!currentWave) continue
384
-
385
391
  const taskMatch = line.match(/^[-*]\s*\[[ x]\]\s*(.+)/)
386
392
  if (taskMatch) {
387
393
  const taskNoMatch = taskMatch[1].match(/\btask-(\d+)\b/i)
394
+ // full plan.md:task 必须在显式 Wave 段内(currentWave 非 null),正常收容。
395
+ // light/none plan.md(无 Wave 标题,任务在 `## Tasks` 下):在隐式任务区内,遇含
396
+ // task-XX 编号的 checkbox 时惰性创建隐式 Wave 收容,否则 validatePlanForExecute 会报
397
+ // "没有找到 checkbox task"。详见 docs/sillyspec/plan-light-needs-wave-heading.md
398
+ // 不收的情况:非任务区(## 自检/## 验收 等)的 checkbox,或任务区内无 task-XX 编号的 checkbox。
399
+ if (!currentWave) {
400
+ if (!inImplicitTaskSection || !taskNoMatch) continue
401
+ const nextIndex = waves.length === 0 ? 1 : (waves[waves.length - 1].index || waves.length) + 1
402
+ currentWave = { index: nextIndex, tasks: [], implicit: true }
403
+ currentTask = null
404
+ waves.push(currentWave)
405
+ }
388
406
  currentTask = {
389
407
  index: taskNoMatch ? parseInt(taskNoMatch[1], 10) : null,
390
408
  name: taskMatch[1].trim(),
@@ -549,12 +567,12 @@ ${taskSummary}
549
567
  4. 如存在模块文档(.sillyspec/docs/*/modules/),按需读取涉及模块的 <module>.md 参考接口约定和数据流
550
568
 
551
569
  ### Wave 开始前
552
- 1. 读取 design.md 的「编码铁律」章节(如果存在),严格遵守
570
+ 1. 读取 design.md 的「非目标」与「兼容策略」章节(如存在),确保子代理不超范围、不破坏旧逻辑
553
571
  2. 读取 plan.md 了解全局任务划分和依赖关系
554
572
  3. 确认本 Wave 的输入/输出契约(前置 Wave 产出了什么,本 Wave 需要消费什么)
555
573
  4. 检查前置 Wave 的产出是否完整(文件是否存在、测试是否通过)
556
574
  5. **上下文分层加载**:
557
- - 🔥 热上下文:design.md 编码铁律 + 当前 Wave 任务(必须加载)
575
+ - 🔥 热上下文:design.md 非目标/兼容策略 + 当前 Wave 任务(必须加载)
558
576
  - 🌡️ 温上下文:CONVENTIONS.md + ARCHITECTURE.md(需要时加载)
559
577
  - ❄️ 冷上下文:其他变更的 design.md、历史 plan.md(不要主动加载,除非明确需要)
560
578
  ${contractInjection}
@@ -114,10 +114,10 @@ export const definition = {
114
114
  ### 自动探针(必须先执行)
115
115
  在检查前,依次运行以下三个探针,将结果作为验证输入:
116
116
 
117
- **探针 1:未实现标记扫描**
118
- 在项目源码目录中搜索未实现标记:
117
+ **探针 1:未实现标记扫描(仅变更文件)**
118
+ 只扫描本次变更涉及的文件,不要全项目扫描——历史 TODO 与本次变更无关,徒增噪音与 token。变更文件 = design.md「文件变更清单」列出的源码文件(你已在「加载规范」步骤读取 design.md,glob 路径需展开为具体文件):
119
119
  \`\`\`bash
120
- grep -rn "尚未实现\|TODO\|FIXME\|HACK\|XXX" <源码目录>/ --include="*.java" --include="*.js" --include="*.ts" --include="*.jsx" --include="*.tsx" --include="*.py"
120
+ grep -n "尚未实现\|TODO\|FIXME\|HACK\|XXX" <design 清单中的源码文件>
121
121
  \`\`\`
122
122
  记录每个匹配的文件、行号和内容。
123
123