sillyspec 3.20.2 → 3.20.3

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.
Files changed (208) hide show
  1. package/.claude/skills/sillyspec-archive/SKILL.md +1 -5
  2. package/.claude/skills/sillyspec-auto/SKILL.md +2 -8
  3. package/.claude/skills/sillyspec-brainstorm/SKILL.md +1 -28
  4. package/.claude/skills/sillyspec-commit/SKILL.md +3 -4
  5. package/.claude/skills/sillyspec-continue/SKILL.md +4 -5
  6. package/.claude/skills/sillyspec-doctor/SKILL.md +3 -12
  7. package/.claude/skills/sillyspec-execute/SKILL.md +2 -15
  8. package/.claude/skills/sillyspec-explore/SKILL.md +1 -14
  9. package/.claude/skills/sillyspec-plan/SKILL.md +36 -5
  10. package/.claude/skills/sillyspec-propose/SKILL.md +0 -4
  11. package/.claude/skills/sillyspec-quick/SKILL.md +1 -5
  12. package/.claude/skills/sillyspec-resume/SKILL.md +66 -23
  13. package/.claude/skills/sillyspec-scan/SKILL.md +1 -5
  14. package/.claude/skills/sillyspec-state/SKILL.md +8 -8
  15. package/.claude/skills/sillyspec-status/SKILL.md +1 -5
  16. package/.claude/skills/sillyspec-verify/SKILL.md +1 -5
  17. package/.claude/skills/sillyspec-workspace/SKILL.md +3 -11
  18. package/.sillyspec/changes/archive/2026-04-08-derive-state/design.md +97 -0
  19. package/.sillyspec/changes/archive/2026-04-08-derive-state/plan.md +51 -0
  20. package/.sillyspec/changes/archive/2026-04-08-derive-state/proposal.md +29 -0
  21. package/.sillyspec/changes/archive/2026-04-08-derive-state/requirements.md +34 -0
  22. package/.sillyspec/changes/archive/2026-04-08-derive-state/tasks.md +13 -0
  23. package/.sillyspec/changes/archive/2026-04-08-derive-state/verify-result.md +43 -0
  24. package/.sillyspec/changes/auto-mode/design.md +50 -0
  25. package/.sillyspec/changes/auto-mode/proposal.md +19 -0
  26. package/.sillyspec/changes/auto-mode/requirements.md +21 -0
  27. package/.sillyspec/changes/auto-mode/tasks.md +7 -0
  28. package/.sillyspec/changes/brainstorm-archive/2026-04-05-dashboard-design.md +206 -0
  29. package/.sillyspec/changes/brainstorm-archive/2026-04-05-unified-docs-design.md +199 -0
  30. package/.sillyspec/changes/dashboard/design.md +219 -0
  31. package/.sillyspec/changes/dashboard/design.md.braindraft +206 -0
  32. package/.sillyspec/changes/run-command-design/design.md +1230 -0
  33. package/.sillyspec/changes/unified-docs-design/design.md +199 -0
  34. package/.sillyspec/docs/sillyspec/scan/.gitkeep +0 -0
  35. package/.sillyspec/knowledge/INDEX.md +8 -0
  36. package/.sillyspec/knowledge/uncategorized.md +3 -0
  37. package/.sillyspec/plans/2026-04-05-dashboard.md +737 -0
  38. package/.sillyspec/projects/sillyspec.yaml +3 -0
  39. package/README.md +11 -13
  40. package/SKILL.md +40 -44
  41. package/dist/steps/brainstorm/01-load-context.md +30 -0
  42. package/dist/steps/brainstorm/02-reuse-check.md +6 -0
  43. package/dist/steps/brainstorm/03-prototype-analysis.md +11 -0
  44. package/dist/steps/brainstorm/04-module-split.md +23 -0
  45. package/dist/steps/brainstorm/05-dialog-explore.md +8 -0
  46. package/dist/steps/brainstorm/06-propose-approaches.md +3 -0
  47. package/dist/steps/brainstorm/07-present-design.md +3 -0
  48. package/dist/steps/brainstorm/08-write-design.md +21 -0
  49. package/dist/steps/brainstorm/09-self-review.md +15 -0
  50. package/dist/steps/brainstorm/10-user-confirm.md +3 -0
  51. package/dist/steps/brainstorm/11-output-spec.md +7 -0
  52. package/dist/steps/brainstorm/manifest.yaml +26 -0
  53. package/dist/steps/execute/01-load-context.md +41 -0
  54. package/dist/steps/execute/02-scan-conventions.md +47 -0
  55. package/dist/steps/execute/03-skill-mcp.md +19 -0
  56. package/dist/steps/execute/04-assign-task.md +22 -0
  57. package/dist/steps/execute/04b-prompt-template.md +54 -0
  58. package/dist/steps/execute/05-write-test.md +7 -0
  59. package/dist/steps/execute/06-write-code.md +8 -0
  60. package/dist/steps/execute/07-run-test.md +26 -0
  61. package/dist/steps/execute/08-fix-issues.md +28 -0
  62. package/dist/steps/execute/09-next-task.md +33 -0
  63. package/dist/steps/execute/manifest.yaml +28 -0
  64. package/dist/steps/plan/01-load-context.md +22 -0
  65. package/dist/steps/plan/02-anchor-confirm.md +1 -0
  66. package/dist/steps/plan/03-expand-tasks.md +33 -0
  67. package/dist/steps/plan/04-mark-order.md +15 -0
  68. package/dist/steps/plan/05-e2e-planning.md +17 -0
  69. package/dist/steps/plan/06-self-check.md +16 -0
  70. package/dist/steps/plan/07-save.md +1 -0
  71. package/dist/steps/plan/manifest.yaml +18 -0
  72. package/dist/steps/scan/01-env-detect.md +51 -0
  73. package/dist/steps/scan/02-tech-stack.md +16 -0
  74. package/dist/steps/scan/03-conventions.md +16 -0
  75. package/dist/steps/scan/04-structure.md +19 -0
  76. package/dist/steps/scan/05-quality.md +18 -0
  77. package/dist/steps/scan/06-complete.md +49 -0
  78. package/dist/steps/scan/manifest.yaml +16 -0
  79. package/dist/steps/verify/01-load-specs.md +28 -0
  80. package/dist/steps/verify/02-check-tasks.md +1 -0
  81. package/dist/steps/verify/03-check-design.md +6 -0
  82. package/dist/steps/verify/04-run-tests.md +7 -0
  83. package/dist/steps/verify/05-e2e-tests.md +27 -0
  84. package/dist/steps/verify/05b-e2e-fix.md +33 -0
  85. package/dist/steps/verify/06-code-quality.md +25 -0
  86. package/dist/steps/verify/07-lint-check.md +27 -0
  87. package/dist/steps/verify/08-output-report.md +14 -0
  88. package/dist/steps/verify/manifest.yaml +22 -0
  89. package/package.json +1 -7
  90. package/packages/dashboard/dist/assets/{index-Bq_Z2hne.js → index-D1EVTLmc.js} +1264 -1264
  91. package/packages/dashboard/dist/assets/index-DGe8CqeP.css +1 -0
  92. package/packages/dashboard/dist/index.html +2 -2
  93. package/packages/dashboard/package-lock.json +6 -6
  94. package/packages/dashboard/server/executor.js +1 -1
  95. package/packages/dashboard/server/index.js +18 -98
  96. package/packages/dashboard/server/parser.js +71 -139
  97. package/packages/dashboard/server/watcher.js +6 -14
  98. package/packages/dashboard/src/App.vue +185 -418
  99. package/packages/dashboard/src/components/ActionBar.vue +1 -10
  100. package/packages/dashboard/src/components/CommandPalette.vue +1 -5
  101. package/packages/dashboard/src/components/DocPreview.vue +8 -105
  102. package/packages/dashboard/src/components/DocTree.vue +19 -75
  103. package/packages/dashboard/src/components/PipelineStage.vue +2 -22
  104. package/packages/dashboard/src/components/PipelineView.vue +5 -32
  105. package/packages/dashboard/src/components/ProjectOverview.vue +139 -113
  106. package/packages/dashboard/src/components/StageBadge.vue +3 -17
  107. package/packages/dashboard/src/components/StepCard.vue +2 -7
  108. package/packages/dashboard/src/composables/useDashboard.js +0 -28
  109. package/src/derive.js +147 -0
  110. package/src/index.js +40 -688
  111. package/src/init.js +63 -119
  112. package/src/migrate.js +7 -7
  113. package/src/progress.js +248 -1474
  114. package/src/run.js +302 -3008
  115. package/src/setup.js +64 -2
  116. package/src/stages/archive.js +17 -123
  117. package/src/stages/brainstorm.js +48 -454
  118. package/src/stages/doctor.js +46 -99
  119. package/src/stages/execute.js +59 -420
  120. package/src/stages/index.js +18 -12
  121. package/src/stages/plan.js +189 -492
  122. package/src/stages/propose.js +11 -70
  123. package/src/stages/quick.js +13 -52
  124. package/src/stages/scan.js +68 -485
  125. package/src/stages/status.js +1 -1
  126. package/src/stages/verify.js +16 -203
  127. package/src/step.js +543 -0
  128. package/.claude/skills/sillyspec-knowledge/SKILL.md +0 -270
  129. package/.husky/pre-push +0 -13
  130. package/CLAUDE.md +0 -18
  131. package/docs/brainstorm-plan-contract.md +0 -64
  132. package/docs/plan-execute-contract.md +0 -123
  133. package/docs/platform-scan-protocol.md +0 -298
  134. package/docs/revision-mode.md +0 -115
  135. package/docs/sillyspec/file-lifecycle/known-implementation-gaps.md +0 -99
  136. package/docs/sillyspec/file-lifecycle/platform-workflows-sync.md +0 -218
  137. package/docs/sillyspec/file-lifecycle/stage-artifacts.md +0 -167
  138. package/docs/sillyspec/file-lifecycle/storage-and-state.md +0 -148
  139. package/docs/sillyspec/file-lifecycle/worktree-and-guard.md +0 -193
  140. package/docs/sillyspec/file-lifecycle.md +0 -125
  141. package/docs/workflow-contract-regression.md +0 -106
  142. package/docs/worktree-isolation.md +0 -252
  143. package/packages/dashboard/dist/assets/index-O2W5RV4z.css +0 -1
  144. package/packages/dashboard/dist/prototype-dashboard.html +0 -836
  145. package/packages/dashboard/dist/prototype-overview.html +0 -256
  146. package/packages/dashboard/public/prototype-dashboard.html +0 -836
  147. package/packages/dashboard/public/prototype-overview.html +0 -256
  148. package/packages/dashboard/src/components/HResizeHandle.vue +0 -48
  149. package/packages/dashboard/src/components/ProjectCard.vue +0 -187
  150. package/packages/dashboard/src/components/VResizeHandle.vue +0 -61
  151. package/packages/dashboard/src/composables/useLayout.js +0 -131
  152. package/src/brainstorm-postcheck.js +0 -158
  153. package/src/change-list.js +0 -52
  154. package/src/change-risk-profile.js +0 -352
  155. package/src/classify-change.js +0 -73
  156. package/src/constants.js +0 -70
  157. package/src/contract-matrix.js +0 -278
  158. package/src/db.js +0 -201
  159. package/src/endpoint-extractor.js +0 -315
  160. package/src/hooks/claude-pre-tool-use.cjs +0 -125
  161. package/src/hooks/worktree-guard.js +0 -761
  162. package/src/knowledge-match.js +0 -130
  163. package/src/modules.js +0 -482
  164. package/src/scan-postcheck.js +0 -383
  165. package/src/stage-contract.js +0 -700
  166. package/src/stages/brainstorm-auto.js +0 -229
  167. package/src/stages/explore.js +0 -34
  168. package/src/stages/knowledge.js +0 -498
  169. package/src/stages/plan-postcheck.js +0 -513
  170. package/src/sync.js +0 -497
  171. package/src/task-review.js +0 -346
  172. package/src/workflow.js +0 -785
  173. package/src/worktree-apply.js +0 -549
  174. package/src/worktree.js +0 -932
  175. package/templates/workflows/archive-impact.yaml +0 -79
  176. package/templates/workflows/scan-docs.yaml +0 -132
  177. package/test/brainstorm-plan-contract.test.mjs +0 -273
  178. package/test/check-syntax.mjs +0 -26
  179. package/test/cli-top-level-aliases.test.mjs +0 -174
  180. package/test/contract-artifacts.test.mjs +0 -323
  181. package/test/decision-supersede.test.mjs +0 -277
  182. package/test/knowledge-match.test.mjs +0 -231
  183. package/test/plan-execute-contract.test.mjs +0 -330
  184. package/test/plan-optimization.test.mjs +0 -572
  185. package/test/platform-artifacts.test.mjs +0 -190
  186. package/test/platform-failure-samples.test.mjs +0 -199
  187. package/test/platform-recovery-chain.test.mjs +0 -179
  188. package/test/platform-recovery.test.mjs +0 -167
  189. package/test/platform-scan-p0.test.mjs +0 -175
  190. package/test/revision-v1.test.mjs +0 -1145
  191. package/test/run-sanitize-project-name.test.mjs +0 -51
  192. package/test/run-scan-postcheck-fail.test.mjs +0 -64
  193. package/test/run-scan-project-parse.test.mjs +0 -200
  194. package/test/run-tests.mjs +0 -48
  195. package/test/scan-docs-yaml-placeholders.test.mjs +0 -84
  196. package/test/scan-knowledge.test.mjs +0 -175
  197. package/test/scan-paths.test.mjs +0 -68
  198. package/test/scan-postcheck-project-priority.test.mjs +0 -85
  199. package/test/scan-postcheck.test.mjs +0 -197
  200. package/test/scan-workflow-anyfailed-block.test.mjs +0 -52
  201. package/test/spec-dir.test.mjs +0 -206
  202. package/test/stage-contract-failed-post-check.test.mjs +0 -102
  203. package/test/stage-contract.test.mjs +0 -299
  204. package/test/stage-definitions.test.mjs +0 -39
  205. package/test/wait-gates.test.mjs +0 -501
  206. package/test/workflow-spec-base.test.mjs +0 -142
  207. package/test/worktree-guard.test.mjs +0 -136
  208. package/test/worktree-native-overlay.test.mjs +0 -188
@@ -1,298 +0,0 @@
1
- # 平台 Scan 产物协议
2
-
3
- SillySpec 平台执行模式的核心设计:**SillySpec 写产物,SillyHub 读产物**。平台不看 stdout,只靠文件系统判断 scan 成功、失败原因和证据文件位置。
4
-
5
- ## 状态枚举(src/constants.js)
6
-
7
- 所有平台产物共享同一套枚举值,SillyHub 直接使用常量,不猜字符串。
8
-
9
- ### SCAN_STATUS
10
-
11
- | 值 | 说明 |
12
- ---|---|
13
- | `pending` | scan 未开始 |
14
- | `in_progress` | scan 进行中 |
15
- | `success` | scan 成功,所有检查通过 |
16
- | `completed_with_warnings` | scan 成功但有警告 |
17
- | `failed_post_check` | scan 失败,post-check 不通过 |
18
-
19
- ### POINTER_STATUS
20
-
21
- | 值 | 说明 |
22
- ---|---|
23
- | `active` | 指针活跃,任务进行中 |
24
- | `scan_completed` | scan 已完成 |
25
- | `stale` | 指针过时(完成超过 24h,建议清理) |
26
- | `corrupted` | 指针损坏(缺少必要字段) |
27
-
28
- ### CHECK_SEVERITY
29
-
30
- | 值 | 说明 |
31
- ---|---|
32
- | `failed` | 严重:阻止成功 |
33
- | `warning` | 警告:不阻止成功 |
34
- | `passed` | 通过 |
35
-
36
- ## 目录结构
37
-
38
- ```
39
- <spec_root>/
40
- ├── manifest.json # 扫描元数据 + 产物索引
41
- ├── docs/<project>/scan/ # 项目文档
42
- │ ├── ARCHITECTURE.md
43
- │ ├── CONVENTIONS.md
44
- │ ├── PROJECT.md
45
- │ ├── STACK.md
46
- │ ├── STRUCTURE.md
47
- │ └── ... (7 份必需文档)
48
- ├── projects/*.yaml # 子项目注册
49
- ├── changes/<change-name>/ # 变更目录
50
- └── .runtime/
51
- ├── postcheck-result.json # post-check 结构化结果
52
- └── platform-scan.json # 平台参数持久化(主文件)
53
-
54
- <runtime_root>/
55
- └── scan-runs/<scan_run_id>/
56
- └── workflow-runs/
57
- └── <timestamp>-<workflow>-<project>-<status>.json # workflow 检查结果
58
-
59
- <source_root>/
60
- ├── .sillyspec-platform.json # 平台参数恢复指针(轻量,不在 .sillyspec 内)
61
- └── (源码,禁止 .sillyspec/ 污染)
62
- ```
63
-
64
- ## manifest.json
65
-
66
- scan 完成后写入 `<spec_root>/manifest.json`,是 SillyHub 判断 scan 结果的入口文件。
67
-
68
- ### 结构
69
-
70
- ```json
71
- {
72
- "workspace_id": "ws-xxx",
73
- "scan_run_id": "scan-2026-06-14-test-001",
74
- "source_root": "/path/to/source",
75
- "spec_root": "/path/to/spec",
76
- "runtime_root": "/path/to/runtime",
77
- "source_commit": "abc123...",
78
- "source_commit_error": null,
79
- "generated_at": "2026-06-14T01:50:00.000Z",
80
- "schema_version": 1,
81
- "postcheck_result_path": "<spec_root>/.runtime/postcheck-result.json",
82
- "workflow_runs_dir": "<runtime_root>/scan-runs/<scan_run_id>/workflow-runs",
83
- "platform_pointer_path": "<source_root>/.sillyspec-platform.json",
84
- "platform_pointer_status": "active",
85
- "scan_post_check": {
86
- "status": "success | completed_with_warnings | failed_post_check",
87
- "checks": [...]
88
- }
89
- }
90
- ```
91
-
92
- ### 字段说明
93
-
94
- | 字段 | 类型 | 说明 |
95
- |---|---|---|
96
- | `workspace_id` | string \| null | SillyHub workspace 标识 |
97
- | `scan_run_id` | string \| null | 本次 scan 唯一标识 |
98
- | `source_root` | string | 源码目录绝对路径 |
99
- | `spec_root` | string \| null | 规范目录(specDir) |
100
- | `runtime_root` | string \| null | 运行时产物目录 |
101
- | `source_commit` | string \| null | 源码 HEAD commit hash |
102
- | `source_commit_error` | string \| undefined | commit 获取失败原因 |
103
- | `generated_at` | string (ISO 8601) | manifest 生成时间 |
104
- | `schema_version` | number | 产物协议版本,当前为 1 |
105
- | `postcheck_result_path` | string \| null | post-check 结构化结果路径 |
106
- | `workflow_runs_dir` | string \| null | workflow 检查结果目录 |
107
- | `platform_pointer_path` | string | 平台指针文件路径 |
108
- | `platform_pointer_status` | string | 初始 `active`,由指针文件独立更新 |
109
- | `scan_post_check` | object \| undefined | post-check 结果(写入后追加) |
110
-
111
- ### 判断 scan 结果
112
-
113
- SillyHub 消费 manifest 的方式:
114
-
115
- 1. 读取 `<spec_root>/manifest.json`
116
- 2. 检查 `scan_post_check.status`:
117
- - `success` → scan 成功
118
- - `completed_with_warnings` → scan 成功但有警告
119
- - `failed_post_check` → scan 失败
120
- 3. 如果失败,读 `scan_post_check.checks` 获取具体失败项
121
- 4. 读 `postcheck_result_path` 获取完整结构化结果
122
- 5. 读 `workflow_runs_dir` 获取 workflow 检查证据
123
-
124
- ## .sillyspec-platform.json
125
-
126
- 跨 `--done` 生命周期的轻量指针文件,存储在 `<source_root>/.sillyspec-platform.json`(不在 `.sillyspec/` 内,不污染源码结构)。
127
-
128
- ### 生命周期
129
-
130
- | 阶段 | 行为 |
131
- |---|---|
132
- | **创建** | `run scan --spec-root` 时,写入 cwd 根目录 |
133
- | **读取** | 每次 `run`/`--done`/`--skip` 时,优先从 pointer 恢复平台参数 |
134
- | **更新** | 每次 `run` 时刷新 `savedAt` |
135
- | **完成标记** | scan post-check 后追加 `status=scan_completed` + `completedAt` + `scanStatus` |
136
- | **异常检测** | pointer 存在但缺 `specRoot` 时报错退出 |
137
- | **清理** | 无自动清理。`sillyspec platform pointer` 查看状态,`sillyspec platform pointer --cleanup` 手动清理 |
138
-
139
- ### CLI 检查命令
140
-
141
- ```bash
142
- # 查看指针状态
143
- sillyspec platform pointer
144
-
145
- # 清理过时/损坏指针
146
- sillyspec platform pointer --cleanup
147
- ```
148
-
149
- 输出示例:
150
- ```
151
- 📄 指针文件: /path/to/source/.sillyspec-platform.json
152
- specRoot: /path/to/spec
153
- runtimeRoot: /path/to/runtime
154
- workspaceId: ws-xxx
155
- scanRunId: scan-2026-06-14-test-001
156
- savedAt: 2026-06-14T01:50:00.000Z
157
- 状态: stale ⚠️
158
- completedAt: 2026-06-12T01:00:00.000Z
159
- scanStatus: success
160
- ⚠️ 指针已过时(完成超过 24h),可以安全删除。
161
- ```
162
-
163
- 状态判定逻辑:
164
- - 缺少 `specRoot` → `corrupted`
165
- - `status=scan_completed` 且 `completedAt` 超过 24h → `stale`
166
- - `status=scan_completed` 且未超时 → `scan_completed` ✅
167
- - 无 `status` 字段 → `active` 🔄
168
-
169
- ### 结构
170
-
171
- ```json
172
- {
173
- "specRoot": "/path/to/spec",
174
- "runtimeRoot": "/path/to/runtime",
175
- "workspaceId": "ws-xxx",
176
- "scanRunId": "scan-2026-06-14-test-001",
177
- "savedAt": "2026-06-14T01:50:00.000Z"
178
- }
179
- ```
180
-
181
- scan 完成后追加:
182
-
183
- ```json
184
- {
185
- "status": "scan_completed",
186
- "completedAt": "2026-06-14T01:52:00.000Z",
187
- "scanStatus": "success"
188
- }
189
- ```
190
-
191
- ## postcheck-result.json
192
-
193
- 写入 `<spec_root>/.runtime/postcheck-result.json`(平台模式)或 `<cwd>/.sillyspec/.runtime/postcheck-result.json`(本地模式)。
194
-
195
- ### 结构
196
-
197
- ```json
198
- {
199
- "workspace_id": "ws-xxx",
200
- "scan_run_id": "scan-2026-06-14-test-001",
201
- "status": "success | completed_with_warnings | failed_post_check",
202
- "source_root": "/path/to/source",
203
- "spec_root": "/path/to/spec",
204
- "runtime_root": "/path/to/runtime",
205
- "checks": [
206
- {
207
- "name": "source_root_docs_leak",
208
- "severity": "failed | warning",
209
- "detail": "..."
210
- }
211
- ],
212
- "source_root_leak": true,
213
- "docs_missing": ["ARCHITECTURE.md"],
214
- "profile": {
215
- "mode": "quick | standard | deep",
216
- "file_count": 10,
217
- "source_bytes": 102400,
218
- "project_count": 1,
219
- "reason": "..."
220
- }
221
- }
222
- ```
223
-
224
- ### check 类型
225
-
226
- | check name | severity | 说明 |
227
- |---|---|---|
228
- | `source_root_docs_leak` | failed | docs 文档泄漏到 source_root |
229
- | `source_root_leak` | failed | projects/workflows/knowledge/manifest/local 泄漏到 source_root |
230
- | `all_docs_missing` | failed | 7 份必需文档全部缺失 |
231
- | `partial_docs_missing` | failed | 部分文档缺失 |
232
- | `docs_missing_header` | warning | 文档缺少 frontmatter |
233
- | `local_config_invalid` | warning | local.yaml 中命令不存在 |
234
- | `tool_use_error` | warning | AI 执行工具调用错误 |
235
- | `api_error` | warning | API 错误(529/429/超时) |
236
-
237
- ## workflow-runs
238
-
239
- 写入 `<runtime_root>/scan-runs/<scan_run_id>/workflow-runs/`(平台模式)或 `<cwd>/.sillyspec/.runtime/workflow-runs/`(本地模式)。
240
-
241
- 每个文件命名:`<timestamp>-<workflow>-<project>-<status>.json`
242
-
243
- ### 结构
244
-
245
- ```json
246
- {
247
- "run_id": "20260614015000-scan-docs-test-project-pass",
248
- "created_at": "2026-06-14T01:50:00.000Z",
249
- "source": "run.js",
250
- "stage": "scan",
251
- "step": "深度扫描",
252
- "workflow": "scan-docs",
253
- "project": "test-project",
254
- "status": "pass | fail",
255
- "spec_version": 1,
256
- "roles": [...],
257
- "workflow_checks": [...],
258
- "failures": [...],
259
- "retry_prompts": [...]
260
- }
261
- ```
262
-
263
- ## source_root 零污染
264
-
265
- 平台模式的核心约束:source_root 下不产生 `.sillyspec/` 目录。
266
-
267
- post-check 会检查以下路径是否存在泄漏:
268
- - `<source_root>/.sillyspec/docs/` — 文档泄漏
269
- - `<source_root>/.sillyspec/projects/` — 项目注册泄漏
270
- - `<source_root>/.sillyspec/workflows/` — 工作流泄漏
271
- - `<source_root>/.sillyspec/knowledge/` — 术语泄漏
272
- - `<source_root>/.sillyspec/manifest.json` — manifest 泄漏
273
- - `<source_root>/.sillyspec/local.yaml` — 配置泄漏
274
-
275
- ## 产物消费优先级
276
-
277
- SillyHub 判断 scan 结果的推荐顺序:
278
-
279
- 1. `manifest.json` → `scan_post_check.overall_status` → 快速判断成功/失败
280
- 2. `postcheck-result.json` → 完整检查明细 + failure_categories
281
- 3. `workflow-runs/*.json` → workflow 检查证据
282
- 4. `docs/<project>/scan/*.md` → 实际文档内容
283
-
284
- ### failure_categories
285
-
286
- `postcheck-result.json` 中的 `failure_categories` 提供分类视图:
287
-
288
- | 类别 | 包含的 check |
289
- ---|---|
290
- | `path_pollution` | source_root_leak, source_root_docs_leak |
291
- | `missing_outputs` | all_docs_missing, partial_docs_missing, missing_docs |
292
- | `bad_references` | local_config_invalid |
293
- | `quality_warnings` | tool_use_error, api_error_529, rate_limit_exhausted, fallback_or_skip |
294
- | `violations` | manifest_write_failed, project_list_parse_failed + 所有 path_pollution |
295
-
296
- SillyHub 可以按类别快速定位问题域,而不需要遍历所有 checks。
297
-
298
- 不需要解析 stdout。
@@ -1,115 +0,0 @@
1
- ---
2
- author: qinyi
3
- created_at: 2026-06-18 22:48:00
4
- ---
5
-
6
- # Revision Mode — 阶段修订
7
-
8
- ## 核心语义
9
-
10
- 已完成(completed)的阶段不能直接重跑。必须通过 `--reopen` 进入受控修订模式。
11
-
12
- 修订模式确保:
13
- - 阶段状态机闭环:completed → revising → completed
14
- - 因果链不断:上游修订时,下游阶段自动标记 stale
15
- - 产物安全:reopen 不删除、不备份、不回滚文件,只改 progress 状态
16
-
17
- ## 命令
18
-
19
- ### `--reopen` — 重新打开已完成阶段
20
-
21
- ```bash
22
- sillyspec run brainstorm --reopen
23
- ```
24
-
25
- 把阶段从 completed 变为 revising。不删除步骤历史,不清空产物文件。
26
-
27
- **不带 `--from-step` 时:** 只在阶段存在 pending/stale/waiting/failed 步骤时允许继续。如果所有步骤都是 completed,会拒绝并要求指定 `--from-step`。
28
-
29
- ### `--reopen --from-step <index|name>` — 从指定步骤开始修订
30
-
31
- ```bash
32
- # 按序号(1-based)
33
- sillyspec run brainstorm --reopen --from-step 3
34
-
35
- # 按名称
36
- sillyspec run brainstorm --reopen --from-step "方案选择"
37
- ```
38
-
39
- 效果:
40
- - from-step 之前的步骤:保持 completed
41
- - from-step 本身:变为 pending
42
- - from-step 之后的步骤:标记为 stale(曾经完成,但因上游修订失效)
43
- - 当前阶段状态:变为 revising
44
- - 所有下游阶段:自动 cascade stale
45
-
46
- ### `--reset` — 彻底重置(核弹)
47
-
48
- ```bash
49
- sillyspec run brainstorm --reset
50
- ```
51
-
52
- 清空所有步骤状态,从头开始。不保留任何历史。只在确实需要完全重来时使用。
53
-
54
- ## 下游 cascade 规则
55
-
56
- 阶段顺序:`scan → brainstorm → plan → execute → verify → archive`
57
-
58
- reopen 任意阶段,其下游所有已 completed 的阶段自动变为 stale,并记录 staleReason。
59
-
60
- 示例:
61
- ```
62
- reopen brainstorm --from-step 2
63
- → brainstorm: revising
64
- → plan: stale (上游 brainstorm 已修订)
65
- → execute: stale
66
- → verify: stale
67
- → archive: stale (已有归档文件保留但不再可信)
68
- ```
69
-
70
- stale 阶段不能直接 `run`,必须 `--reopen --from-step` 或 `--reset`。
71
-
72
- ## --reopen / --from-step / --reset 对比
73
-
74
- | 维度 | --reopen --from-step | --reopen | --reset |
75
- |------|---------------------|----------|---------|
76
- | 步骤历史 | 保留之前的,后面失效 | 保留 | 全部清空 |
77
- | 产物文件 | 不动 | 不动 | 不动 |
78
- | 阶段状态 | revising | revising | pending |
79
- | revision 计数 | +1 | +1 | 不变 |
80
- | 下游 cascade | stale | stale | 不 cascade |
81
- | 适用场景 | 局部返工 | 继续中断 | 彻底重来 |
82
-
83
- ## 文件策略
84
-
85
- - reopen **不触碰**任何产物文件(design.md、plan.md、task docs 等)
86
- - agent 在 revision context 下审视并更新已有产物
87
- - 如需备份/快照功能,后续版本再加
88
-
89
- ## Revision Context 注入
90
-
91
- 修订模式下执行步骤时,prompt 前会注入:
92
-
93
- ```
94
- 🔄 Revision Context
95
- 本阶段处于修订模式(revision N),不是首次执行。
96
- - 修订起始步骤:index: name
97
- - 当前步骤之前已完成的步骤仍然有效,不需要重做。
98
- - 当前步骤及之后的步骤需要重新生成或调整已有产物。
99
- - 已有产物文件被保留,审视并更新它们,而不是从零创建。
100
- - 不要绕过 CLI 进度追踪。
101
- ```
102
-
103
- ## progress 展示示例
104
-
105
- ```
106
- 🔧 🧠 需求探索
107
- 📋 revision: 2, from step: 2: 加载项目上下文
108
- ✅ 状态检查 (保持 completed)
109
- ⬜ 加载项目上下文 (pending — 从这里重做)
110
- ⚠️ 协作与复用检查 (stale)
111
- ⚠️ 原型/设计图分析 (stale)
112
- ...
113
- ⚠️ 📐 实现计划
114
- ⚠️ stale: 上游阶段 brainstorm 已修订 (revision 2)
115
- ```
@@ -1,99 +0,0 @@
1
- ---
2
- author: qinyi
3
- created_at: 2026-06-04 16:25:42
4
- updated_at: 2026-06-04 16:55:00
5
- ---
6
-
7
- # 剩余实现差异清单
8
-
9
- 本页只记录当前代码仍存在的实现差异。已修复的条目不再保留为缺口,包括:
10
-
11
- - `brainstorm` / `propose` 重复 object key 导致步骤丢失。
12
- - scan prompt 写 `.sillyspec/.runtime/local.yaml`。
13
- - hook 只读根目录 `local.yaml`。
14
- - archive 第 4 步正常流程不触发自动归档。
15
- - 自动 sync / approval 参数顺序不匹配。
16
- - `ProgressManager._updatePlatformLastSync()` / `_updateApprovalStatus()` 缺失。
17
-
18
- ## workflow-runs 平台路径支持未从 run.js 接通
19
-
20
- 代码位置:`src/workflow.js`、`src/run.js`
21
-
22
- 现象:
23
-
24
- - `saveWorkflowRun()` 支持传 `runtimeRoot`。
25
- - `run.js` scan/archive post-check 调用时没有传 `runtimeRoot` / `scanRunId`。
26
-
27
- 影响:
28
-
29
- - 自动 post-check 的 workflow run 当前写本地 `.sillyspec/.runtime/workflow-runs/`。
30
- - 平台模式下不能按旧文档断言它会写入 `<runtime-root>/scan-runs/<scan-run-id>/workflow-runs/`。
31
-
32
- ## `--no-worktree` 未作为 run flag 接通
33
-
34
- 代码位置:`src/run.js`、`src/stages/execute.js`、`src/worktree.js`、`src/hooks/worktree-guard.js`
35
-
36
- 现象:
37
-
38
- - execute prompt 和 worktree 错误信息提到 `--no-worktree`。
39
- - `buildExecuteSteps()` 也有 `noWorktree` option。
40
- - `runCommand()` 的 known flags 不包含 `--no-worktree`。
41
- - CLI usage 也没有列出 `--no-worktree`。
42
-
43
- 影响:
44
-
45
- - 文档不能把 `--no-worktree` 描述成已可用的公开 run 参数。
46
- - `changes.no_worktree` / gate `noWorktree` 字段存在,但当前没有清晰 CLI 生命周期入口。
47
-
48
- ## DB schema version 口径不统一
49
-
50
- 代码位置:`src/db.js`、`src/progress.js`
51
-
52
- 现象:
53
-
54
- - `db.js` 的 `project.schema_version` 默认值是 4。
55
- - `progress.js` 的 `CURRENT_VERSION` 是 3。
56
- - `ProgressManager.init()` 写 project 行时使用 `CURRENT_VERSION`。
57
-
58
- 影响:
59
-
60
- - 文档只描述表结构,不把当前状态存储称为明确 v4 schema。
61
-
62
- ## `global.json` 是遗留口径
63
-
64
- 代码位置:`src/progress.js`
65
-
66
- 现象:
67
-
68
- - 注释和常量还提到 `.sillyspec/.runtime/global.json`。
69
- - 实际 `readGlobal()` / `writeGlobal()` 已经走 SQL。
70
-
71
- 影响:
72
-
73
- - 文档应写成“当前没有实际 global.json 生命周期”。
74
-
75
- ## workflow archive 固定 project 为 `sillyspec`
76
-
77
- 代码位置:`src/run.js`
78
-
79
- 现象:
80
-
81
- - archive `extract-module-impact` post-check 调用 `runPostCheck(resolved, cwd, 'sillyspec')`。
82
- - 不按当前项目注册表动态选择 project。
83
-
84
- 影响:
85
-
86
- - 文档不能写成 archive impact workflow 对所有项目自动按 project 维度检查。
87
-
88
- ## platform approve / reject 尚未实现
89
-
90
- 代码位置:`src/sync.js`
91
-
92
- 现象:
93
-
94
- - `sillyspec platform approve <change-name>` 和 `reject <change-name>` 有 CLI 分支。
95
- - 当前实现只打印 “尚未实现” warning。
96
-
97
- 影响:
98
-
99
- - 本地 `checkApproval()` 能读取并记录平台审批状态,但 CLI 端还不能主动向平台发起 approve/reject。