sillyspec 3.27.12 → 3.28.0

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 (1207) hide show
  1. package/.claude/skills/sillyspec-execute/SKILL.md +214 -214
  2. package/.claude/skills/sillyspec-plan/SKILL.md +156 -156
  3. package/.claude/skills/sillyspec-quick/SKILL.md +116 -116
  4. package/package.json +1 -1
  5. package/src/agent-session-log.js +77 -10
  6. package/src/config-schema.js +2 -2
  7. package/src/contract-matrix.js +15 -2
  8. package/src/doctor-diagnostics.js +64 -1
  9. package/src/endpoint-extractor.js +100 -24
  10. package/src/index.js +36 -5
  11. package/src/machine-interface.js +63 -0
  12. package/src/progress/stage-machine.js +106 -1
  13. package/src/progress.js +3 -0
  14. package/src/run/command.js +1 -1
  15. package/src/run/complete-handlers.js +31 -3
  16. package/src/run/complete.js +12 -4
  17. package/src/run/quick-audit.js +98 -0
  18. package/src/run/shared.js +54 -0
  19. package/src/run/stage.js +18 -11
  20. package/src/spec-sync.js +191 -14
  21. package/src/stages/execute.js +6 -2
  22. package/src/sync.js +122 -4
  23. package/src/task-review.js +51 -4
  24. package/src/verify-postcheck.js +60 -8
  25. package/src/verify-probes.js +3 -0
  26. package/.claude/worktrees/sillyspec-data-model-research/.claude/skills/sillyspec-archive/SKILL.md +0 -87
  27. package/.claude/worktrees/sillyspec-data-model-research/.claude/skills/sillyspec-auto/SKILL.md +0 -93
  28. package/.claude/worktrees/sillyspec-data-model-research/.claude/skills/sillyspec-brainstorm/SKILL.md +0 -114
  29. package/.claude/worktrees/sillyspec-data-model-research/.claude/skills/sillyspec-commit/SKILL.md +0 -67
  30. package/.claude/worktrees/sillyspec-data-model-research/.claude/skills/sillyspec-continue/SKILL.md +0 -47
  31. package/.claude/worktrees/sillyspec-data-model-research/.claude/skills/sillyspec-doctor/SKILL.md +0 -76
  32. package/.claude/worktrees/sillyspec-data-model-research/.claude/skills/sillyspec-execute/SKILL.md +0 -214
  33. package/.claude/worktrees/sillyspec-data-model-research/.claude/skills/sillyspec-explore/SKILL.md +0 -102
  34. package/.claude/worktrees/sillyspec-data-model-research/.claude/skills/sillyspec-export/SKILL.md +0 -57
  35. package/.claude/worktrees/sillyspec-data-model-research/.claude/skills/sillyspec-init/SKILL.md +0 -177
  36. package/.claude/worktrees/sillyspec-data-model-research/.claude/skills/sillyspec-knowledge/SKILL.md +0 -270
  37. package/.claude/worktrees/sillyspec-data-model-research/.claude/skills/sillyspec-plan/SKILL.md +0 -156
  38. package/.claude/worktrees/sillyspec-data-model-research/.claude/skills/sillyspec-quick/SKILL.md +0 -116
  39. package/.claude/worktrees/sillyspec-data-model-research/.claude/skills/sillyspec-resume/SKILL.md +0 -70
  40. package/.claude/worktrees/sillyspec-data-model-research/.claude/skills/sillyspec-scan/SKILL.md +0 -79
  41. package/.claude/worktrees/sillyspec-data-model-research/.claude/skills/sillyspec-state/SKILL.md +0 -64
  42. package/.claude/worktrees/sillyspec-data-model-research/.claude/skills/sillyspec-status/SKILL.md +0 -54
  43. package/.claude/worktrees/sillyspec-data-model-research/.claude/skills/sillyspec-verify/SKILL.md +0 -87
  44. package/.claude/worktrees/sillyspec-data-model-research/.claude/skills/sillyspec-workspace/SKILL.md +0 -175
  45. package/.claude/worktrees/sillyspec-data-model-research/.gitattributes +0 -2
  46. package/.claude/worktrees/sillyspec-data-model-research/.husky/pre-push +0 -20
  47. package/.claude/worktrees/sillyspec-data-model-research/README.md +0 -203
  48. package/.claude/worktrees/sillyspec-data-model-research/SKILL.md +0 -91
  49. package/.claude/worktrees/sillyspec-data-model-research/bin/sillyspec.js +0 -2
  50. package/.claude/worktrees/sillyspec-data-model-research/logo.jpg +0 -0
  51. package/.claude/worktrees/sillyspec-data-model-research/package-lock.json +0 -977
  52. package/.claude/worktrees/sillyspec-data-model-research/package.json +0 -39
  53. package/.claude/worktrees/sillyspec-data-model-research/packages/dashboard/dist/assets/index-Bq_Z2hne.js +0 -7446
  54. package/.claude/worktrees/sillyspec-data-model-research/packages/dashboard/dist/assets/index-O2W5RV4z.css +0 -1
  55. package/.claude/worktrees/sillyspec-data-model-research/packages/dashboard/dist/favicon.jpg +0 -0
  56. package/.claude/worktrees/sillyspec-data-model-research/packages/dashboard/dist/index.html +0 -16
  57. package/.claude/worktrees/sillyspec-data-model-research/packages/dashboard/dist/logo.jpg +0 -0
  58. package/.claude/worktrees/sillyspec-data-model-research/packages/dashboard/dist/prototype-dashboard.html +0 -836
  59. package/.claude/worktrees/sillyspec-data-model-research/packages/dashboard/dist/prototype-overview.html +0 -256
  60. package/.claude/worktrees/sillyspec-data-model-research/packages/dashboard/package.json +0 -25
  61. package/.claude/worktrees/sillyspec-data-model-research/packages/dashboard/server/executor.js +0 -95
  62. package/.claude/worktrees/sillyspec-data-model-research/packages/dashboard/server/index.js +0 -679
  63. package/.claude/worktrees/sillyspec-data-model-research/packages/dashboard/server/parser.js +0 -526
  64. package/.claude/worktrees/sillyspec-data-model-research/packages/dashboard/server/watcher.js +0 -357
  65. package/.claude/worktrees/sillyspec-data-model-research/src/agent-session-log.js +0 -803
  66. package/.claude/worktrees/sillyspec-data-model-research/src/change-list.js +0 -290
  67. package/.claude/worktrees/sillyspec-data-model-research/src/change-risk-profile.js +0 -270
  68. package/.claude/worktrees/sillyspec-data-model-research/src/check-primitives.js +0 -65
  69. package/.claude/worktrees/sillyspec-data-model-research/src/classify-change.js +0 -109
  70. package/.claude/worktrees/sillyspec-data-model-research/src/commit-suggest.js +0 -202
  71. package/.claude/worktrees/sillyspec-data-model-research/src/config-cat.js +0 -88
  72. package/.claude/worktrees/sillyspec-data-model-research/src/config-schema.js +0 -328
  73. package/.claude/worktrees/sillyspec-data-model-research/src/constants.js +0 -97
  74. package/.claude/worktrees/sillyspec-data-model-research/src/contract-matrix.js +0 -480
  75. package/.claude/worktrees/sillyspec-data-model-research/src/datetime.js +0 -20
  76. package/.claude/worktrees/sillyspec-data-model-research/src/db-engine.js +0 -55
  77. package/.claude/worktrees/sillyspec-data-model-research/src/db.js +0 -381
  78. package/.claude/worktrees/sillyspec-data-model-research/src/decision-distill.js +0 -517
  79. package/.claude/worktrees/sillyspec-data-model-research/src/dispatch/backends/local-agent.js +0 -155
  80. package/.claude/worktrees/sillyspec-data-model-research/src/dispatch/backends/sillyhub-mcp.js +0 -245
  81. package/.claude/worktrees/sillyspec-data-model-research/src/dispatch/probe.js +0 -246
  82. package/.claude/worktrees/sillyspec-data-model-research/src/dispatch/strategy.js +0 -121
  83. package/.claude/worktrees/sillyspec-data-model-research/src/docs-check.js +0 -825
  84. package/.claude/worktrees/sillyspec-data-model-research/src/docs-debt.js +0 -393
  85. package/.claude/worktrees/sillyspec-data-model-research/src/docs-gate.js +0 -107
  86. package/.claude/worktrees/sillyspec-data-model-research/src/doctor-diagnostics.js +0 -1099
  87. package/.claude/worktrees/sillyspec-data-model-research/src/endpoint-extractor.js +0 -420
  88. package/.claude/worktrees/sillyspec-data-model-research/src/foreign-declared.js +0 -78
  89. package/.claude/worktrees/sillyspec-data-model-research/src/fs-atomic.js +0 -73
  90. package/.claude/worktrees/sillyspec-data-model-research/src/git-helper.js +0 -150
  91. package/.claude/worktrees/sillyspec-data-model-research/src/hooks/claude-pre-tool-use.cjs +0 -130
  92. package/.claude/worktrees/sillyspec-data-model-research/src/hooks/worktree-guard.js +0 -892
  93. package/.claude/worktrees/sillyspec-data-model-research/src/index.js +0 -2798
  94. package/.claude/worktrees/sillyspec-data-model-research/src/init.js +0 -626
  95. package/.claude/worktrees/sillyspec-data-model-research/src/knowledge-match.js +0 -231
  96. package/.claude/worktrees/sillyspec-data-model-research/src/local-detect.js +0 -128
  97. package/.claude/worktrees/sillyspec-data-model-research/src/local-register.js +0 -104
  98. package/.claude/worktrees/sillyspec-data-model-research/src/machine-interface.js +0 -543
  99. package/.claude/worktrees/sillyspec-data-model-research/src/migrate.js +0 -127
  100. package/.claude/worktrees/sillyspec-data-model-research/src/module-impact.js +0 -166
  101. package/.claude/worktrees/sillyspec-data-model-research/src/module-resolve.js +0 -222
  102. package/.claude/worktrees/sillyspec-data-model-research/src/modules.js +0 -580
  103. package/.claude/worktrees/sillyspec-data-model-research/src/progress/change-registry.js +0 -336
  104. package/.claude/worktrees/sillyspec-data-model-research/src/progress/consistency-doctor.js +0 -355
  105. package/.claude/worktrees/sillyspec-data-model-research/src/progress/shared.js +0 -36
  106. package/.claude/worktrees/sillyspec-data-model-research/src/progress/stage-machine.js +0 -594
  107. package/.claude/worktrees/sillyspec-data-model-research/src/progress/step-store.js +0 -265
  108. package/.claude/worktrees/sillyspec-data-model-research/src/progress.js +0 -1304
  109. package/.claude/worktrees/sillyspec-data-model-research/src/quick-recommend.js +0 -115
  110. package/.claude/worktrees/sillyspec-data-model-research/src/quicklog.js +0 -852
  111. package/.claude/worktrees/sillyspec-data-model-research/src/review-tier.js +0 -77
  112. package/.claude/worktrees/sillyspec-data-model-research/src/run/command.js +0 -1595
  113. package/.claude/worktrees/sillyspec-data-model-research/src/run/complete-handlers.js +0 -1552
  114. package/.claude/worktrees/sillyspec-data-model-research/src/run/complete.js +0 -1259
  115. package/.claude/worktrees/sillyspec-data-model-research/src/run/concurrent-detect.js +0 -156
  116. package/.claude/worktrees/sillyspec-data-model-research/src/run/gates.js +0 -1084
  117. package/.claude/worktrees/sillyspec-data-model-research/src/run/multi-repo-context.js +0 -208
  118. package/.claude/worktrees/sillyspec-data-model-research/src/run/next.js +0 -128
  119. package/.claude/worktrees/sillyspec-data-model-research/src/run/prompt.js +0 -843
  120. package/.claude/worktrees/sillyspec-data-model-research/src/run/quick-audit.js +0 -186
  121. package/.claude/worktrees/sillyspec-data-model-research/src/run/scan-profile.js +0 -269
  122. package/.claude/worktrees/sillyspec-data-model-research/src/run/shared.js +0 -1562
  123. package/.claude/worktrees/sillyspec-data-model-research/src/run/stage.js +0 -584
  124. package/.claude/worktrees/sillyspec-data-model-research/src/run.js +0 -23
  125. package/.claude/worktrees/sillyspec-data-model-research/src/scan-diff.js +0 -388
  126. package/.claude/worktrees/sillyspec-data-model-research/src/scan-postcheck.js +0 -512
  127. package/.claude/worktrees/sillyspec-data-model-research/src/scan-staleness.js +0 -95
  128. package/.claude/worktrees/sillyspec-data-model-research/src/setup.js +0 -414
  129. package/.claude/worktrees/sillyspec-data-model-research/src/sillyhub-mcp/client.js +0 -597
  130. package/.claude/worktrees/sillyspec-data-model-research/src/sillyhub-mcp/config.js +0 -62
  131. package/.claude/worktrees/sillyspec-data-model-research/src/spec-dir-typo.js +0 -50
  132. package/.claude/worktrees/sillyspec-data-model-research/src/spec-sync.js +0 -358
  133. package/.claude/worktrees/sillyspec-data-model-research/src/stage-contract-engine.js +0 -171
  134. package/.claude/worktrees/sillyspec-data-model-research/src/stage-contract-spec.js +0 -550
  135. package/.claude/worktrees/sillyspec-data-model-research/src/stage-contract.js +0 -889
  136. package/.claude/worktrees/sillyspec-data-model-research/src/stage-review.js +0 -597
  137. package/.claude/worktrees/sillyspec-data-model-research/src/stages/archive.js +0 -199
  138. package/.claude/worktrees/sillyspec-data-model-research/src/stages/brainstorm-auto.js +0 -236
  139. package/.claude/worktrees/sillyspec-data-model-research/src/stages/brainstorm.js +0 -617
  140. package/.claude/worktrees/sillyspec-data-model-research/src/stages/cmd-existence.js +0 -145
  141. package/.claude/worktrees/sillyspec-data-model-research/src/stages/doctor.js +0 -540
  142. package/.claude/worktrees/sillyspec-data-model-research/src/stages/execute.js +0 -1275
  143. package/.claude/worktrees/sillyspec-data-model-research/src/stages/explore.js +0 -43
  144. package/.claude/worktrees/sillyspec-data-model-research/src/stages/index.js +0 -29
  145. package/.claude/worktrees/sillyspec-data-model-research/src/stages/knowledge.js +0 -514
  146. package/.claude/worktrees/sillyspec-data-model-research/src/stages/plan-postcheck.js +0 -1344
  147. package/.claude/worktrees/sillyspec-data-model-research/src/stages/plan.js +0 -650
  148. package/.claude/worktrees/sillyspec-data-model-research/src/stages/quick.js +0 -167
  149. package/.claude/worktrees/sillyspec-data-model-research/src/stages/scan.js +0 -608
  150. package/.claude/worktrees/sillyspec-data-model-research/src/stages/status.js +0 -64
  151. package/.claude/worktrees/sillyspec-data-model-research/src/stages/verify.js +0 -246
  152. package/.claude/worktrees/sillyspec-data-model-research/src/sync.js +0 -1470
  153. package/.claude/worktrees/sillyspec-data-model-research/src/task-review.js +0 -1498
  154. package/.claude/worktrees/sillyspec-data-model-research/src/taskcard.js +0 -210
  155. package/.claude/worktrees/sillyspec-data-model-research/src/verify-postcheck.js +0 -1718
  156. package/.claude/worktrees/sillyspec-data-model-research/src/verify-probes.js +0 -277
  157. package/.claude/worktrees/sillyspec-data-model-research/src/version.js +0 -19
  158. package/.claude/worktrees/sillyspec-data-model-research/src/workflow.js +0 -600
  159. package/.claude/worktrees/sillyspec-data-model-research/src/workspace.js +0 -125
  160. package/.claude/worktrees/sillyspec-data-model-research/src/worktree-apply.js +0 -1446
  161. package/.claude/worktrees/sillyspec-data-model-research/src/worktree-deps.js +0 -576
  162. package/.claude/worktrees/sillyspec-data-model-research/src/worktree.js +0 -1715
  163. package/.claude/worktrees/sillyspec-data-model-research/templates/claude-instruction.md +0 -23
  164. package/.claude/worktrees/sillyspec-data-model-research/templates/prompts/taskcard-rules.md +0 -28
  165. package/.claude/worktrees/sillyspec-data-model-research/templates/prompts/testcase-design.md +0 -12
  166. package/.claude/worktrees/sillyspec-data-model-research/templates/prompts/verify-probes.md +0 -32
  167. package/.claude/worktrees/sillyspec-data-model-research/templates/workflows/archive-impact.yaml +0 -79
  168. package/.claude/worktrees/sillyspec-data-model-research/templates/workflows/scan-docs.yaml +0 -132
  169. package/.worktrees/2c37b1d7/.claude/skills/sillyspec-archive/SKILL.md +0 -87
  170. package/.worktrees/2c37b1d7/.claude/skills/sillyspec-auto/SKILL.md +0 -93
  171. package/.worktrees/2c37b1d7/.claude/skills/sillyspec-brainstorm/SKILL.md +0 -114
  172. package/.worktrees/2c37b1d7/.claude/skills/sillyspec-commit/SKILL.md +0 -67
  173. package/.worktrees/2c37b1d7/.claude/skills/sillyspec-continue/SKILL.md +0 -47
  174. package/.worktrees/2c37b1d7/.claude/skills/sillyspec-doctor/SKILL.md +0 -76
  175. package/.worktrees/2c37b1d7/.claude/skills/sillyspec-execute/SKILL.md +0 -214
  176. package/.worktrees/2c37b1d7/.claude/skills/sillyspec-explore/SKILL.md +0 -102
  177. package/.worktrees/2c37b1d7/.claude/skills/sillyspec-export/SKILL.md +0 -57
  178. package/.worktrees/2c37b1d7/.claude/skills/sillyspec-init/SKILL.md +0 -177
  179. package/.worktrees/2c37b1d7/.claude/skills/sillyspec-knowledge/SKILL.md +0 -270
  180. package/.worktrees/2c37b1d7/.claude/skills/sillyspec-plan/SKILL.md +0 -156
  181. package/.worktrees/2c37b1d7/.claude/skills/sillyspec-propose/SKILL.md +0 -87
  182. package/.worktrees/2c37b1d7/.claude/skills/sillyspec-quick/SKILL.md +0 -116
  183. package/.worktrees/2c37b1d7/.claude/skills/sillyspec-resume/SKILL.md +0 -70
  184. package/.worktrees/2c37b1d7/.claude/skills/sillyspec-scan/SKILL.md +0 -79
  185. package/.worktrees/2c37b1d7/.claude/skills/sillyspec-state/SKILL.md +0 -64
  186. package/.worktrees/2c37b1d7/.claude/skills/sillyspec-status/SKILL.md +0 -54
  187. package/.worktrees/2c37b1d7/.claude/skills/sillyspec-verify/SKILL.md +0 -87
  188. package/.worktrees/2c37b1d7/.claude/skills/sillyspec-workspace/SKILL.md +0 -175
  189. package/.worktrees/2c37b1d7/.claude/skills/verify-per-user/SKILL.md +0 -6
  190. package/.worktrees/2c37b1d7/.gitattributes +0 -2
  191. package/.worktrees/2c37b1d7/.husky/pre-push +0 -20
  192. package/.worktrees/2c37b1d7/README.md +0 -203
  193. package/.worktrees/2c37b1d7/SKILL.md +0 -91
  194. package/.worktrees/2c37b1d7/architecture-analysis.md +0 -448
  195. package/.worktrees/2c37b1d7/bin/sillyspec.js +0 -2
  196. package/.worktrees/2c37b1d7/eval/README.md +0 -86
  197. package/.worktrees/2c37b1d7/eval/eval.config.json +0 -28
  198. package/.worktrees/2c37b1d7/eval/lib/adapters/cli.mjs +0 -63
  199. package/.worktrees/2c37b1d7/eval/lib/adapters/dryrun.mjs +0 -27
  200. package/.worktrees/2c37b1d7/eval/lib/config.mjs +0 -82
  201. package/.worktrees/2c37b1d7/eval/lib/db.mjs +0 -76
  202. package/.worktrees/2c37b1d7/eval/lib/report.mjs +0 -120
  203. package/.worktrees/2c37b1d7/eval/lib/runner.mjs +0 -157
  204. package/.worktrees/2c37b1d7/eval/lib/tasks.mjs +0 -73
  205. package/.worktrees/2c37b1d7/eval/lib/util.mjs +0 -107
  206. package/.worktrees/2c37b1d7/eval/lib/workdir.mjs +0 -30
  207. package/.worktrees/2c37b1d7/eval/run.mjs +0 -83
  208. package/.worktrees/2c37b1d7/eval/tasks/001-slugify/files/package.json +0 -6
  209. package/.worktrees/2c37b1d7/eval/tasks/001-slugify/solution/src/slugify.mjs +0 -26
  210. package/.worktrees/2c37b1d7/eval/tasks/001-slugify/task.json +0 -6
  211. package/.worktrees/2c37b1d7/eval/tasks/001-slugify/verify.mjs +0 -28
  212. package/.worktrees/2c37b1d7/eval/tasks/002-each-day/files/package.json +0 -6
  213. package/.worktrees/2c37b1d7/eval/tasks/002-each-day/files/src/dates.mjs +0 -4
  214. package/.worktrees/2c37b1d7/eval/tasks/002-each-day/solution/src/dates.mjs +0 -30
  215. package/.worktrees/2c37b1d7/eval/tasks/002-each-day/task.json +0 -6
  216. package/.worktrees/2c37b1d7/eval/tasks/002-each-day/verify.mjs +0 -31
  217. package/.worktrees/2c37b1d7/eval/tasks/003-word-report/files/data/notes.txt +0 -5
  218. package/.worktrees/2c37b1d7/eval/tasks/003-word-report/files/package.json +0 -6
  219. package/.worktrees/2c37b1d7/eval/tasks/003-word-report/solution/bin/report.mjs +0 -36
  220. package/.worktrees/2c37b1d7/eval/tasks/003-word-report/task.json +0 -6
  221. package/.worktrees/2c37b1d7/eval/tasks/003-word-report/verify.mjs +0 -38
  222. package/.worktrees/2c37b1d7/logo.jpg +0 -0
  223. package/.worktrees/2c37b1d7/package-lock.json +0 -977
  224. package/.worktrees/2c37b1d7/package.json +0 -41
  225. package/.worktrees/2c37b1d7/packages/dashboard/dist/assets/index-Bq_Z2hne.js +0 -7446
  226. package/.worktrees/2c37b1d7/packages/dashboard/dist/assets/index-O2W5RV4z.css +0 -1
  227. package/.worktrees/2c37b1d7/packages/dashboard/dist/favicon.jpg +0 -0
  228. package/.worktrees/2c37b1d7/packages/dashboard/dist/index.html +0 -16
  229. package/.worktrees/2c37b1d7/packages/dashboard/dist/logo.jpg +0 -0
  230. package/.worktrees/2c37b1d7/packages/dashboard/dist/prototype-dashboard.html +0 -836
  231. package/.worktrees/2c37b1d7/packages/dashboard/dist/prototype-overview.html +0 -256
  232. package/.worktrees/2c37b1d7/packages/dashboard/package.json +0 -25
  233. package/.worktrees/2c37b1d7/packages/dashboard/server/executor.js +0 -95
  234. package/.worktrees/2c37b1d7/packages/dashboard/server/index.js +0 -679
  235. package/.worktrees/2c37b1d7/packages/dashboard/server/parser.js +0 -526
  236. package/.worktrees/2c37b1d7/packages/dashboard/server/watcher.js +0 -357
  237. package/.worktrees/2c37b1d7/src/agent-session-log.js +0 -803
  238. package/.worktrees/2c37b1d7/src/change-list.js +0 -290
  239. package/.worktrees/2c37b1d7/src/change-risk-profile.js +0 -339
  240. package/.worktrees/2c37b1d7/src/check-primitives.js +0 -65
  241. package/.worktrees/2c37b1d7/src/classify-change.js +0 -109
  242. package/.worktrees/2c37b1d7/src/commit-suggest.js +0 -202
  243. package/.worktrees/2c37b1d7/src/config-cat.js +0 -88
  244. package/.worktrees/2c37b1d7/src/config-schema.js +0 -328
  245. package/.worktrees/2c37b1d7/src/constants.js +0 -97
  246. package/.worktrees/2c37b1d7/src/contract-matrix.js +0 -533
  247. package/.worktrees/2c37b1d7/src/datetime.js +0 -20
  248. package/.worktrees/2c37b1d7/src/db-engine.js +0 -55
  249. package/.worktrees/2c37b1d7/src/db.js +0 -381
  250. package/.worktrees/2c37b1d7/src/decision-distill.js +0 -517
  251. package/.worktrees/2c37b1d7/src/dispatch/backends/local-agent.js +0 -155
  252. package/.worktrees/2c37b1d7/src/dispatch/backends/sillyhub-mcp.js +0 -245
  253. package/.worktrees/2c37b1d7/src/dispatch/probe.js +0 -246
  254. package/.worktrees/2c37b1d7/src/dispatch/strategy.js +0 -121
  255. package/.worktrees/2c37b1d7/src/docs-check.js +0 -825
  256. package/.worktrees/2c37b1d7/src/docs-debt.js +0 -393
  257. package/.worktrees/2c37b1d7/src/docs-gate.js +0 -107
  258. package/.worktrees/2c37b1d7/src/doctor-diagnostics.js +0 -1099
  259. package/.worktrees/2c37b1d7/src/endpoint-extractor.js +0 -409
  260. package/.worktrees/2c37b1d7/src/foreign-declared.js +0 -155
  261. package/.worktrees/2c37b1d7/src/fs-atomic.js +0 -73
  262. package/.worktrees/2c37b1d7/src/git-helper.js +0 -150
  263. package/.worktrees/2c37b1d7/src/hooks/claude-pre-tool-use.cjs +0 -130
  264. package/.worktrees/2c37b1d7/src/hooks/worktree-guard.js +0 -892
  265. package/.worktrees/2c37b1d7/src/index.js +0 -2854
  266. package/.worktrees/2c37b1d7/src/init.js +0 -626
  267. package/.worktrees/2c37b1d7/src/knowledge-match.js +0 -231
  268. package/.worktrees/2c37b1d7/src/local-detect.js +0 -128
  269. package/.worktrees/2c37b1d7/src/local-register.js +0 -104
  270. package/.worktrees/2c37b1d7/src/machine-interface.js +0 -543
  271. package/.worktrees/2c37b1d7/src/migrate.js +0 -127
  272. package/.worktrees/2c37b1d7/src/module-impact.js +0 -166
  273. package/.worktrees/2c37b1d7/src/module-resolve.js +0 -222
  274. package/.worktrees/2c37b1d7/src/modules.js +0 -580
  275. package/.worktrees/2c37b1d7/src/plan-adopt-waves.js +0 -126
  276. package/.worktrees/2c37b1d7/src/progress/change-registry.js +0 -336
  277. package/.worktrees/2c37b1d7/src/progress/consistency-doctor.js +0 -355
  278. package/.worktrees/2c37b1d7/src/progress/shared.js +0 -36
  279. package/.worktrees/2c37b1d7/src/progress/stage-machine.js +0 -594
  280. package/.worktrees/2c37b1d7/src/progress/step-store.js +0 -265
  281. package/.worktrees/2c37b1d7/src/progress.js +0 -1304
  282. package/.worktrees/2c37b1d7/src/quick-recommend.js +0 -115
  283. package/.worktrees/2c37b1d7/src/quicklog.js +0 -883
  284. package/.worktrees/2c37b1d7/src/review-tier.js +0 -77
  285. package/.worktrees/2c37b1d7/src/run/command.js +0 -1641
  286. package/.worktrees/2c37b1d7/src/run/complete-handlers.js +0 -1552
  287. package/.worktrees/2c37b1d7/src/run/complete.js +0 -1259
  288. package/.worktrees/2c37b1d7/src/run/concurrent-detect.js +0 -156
  289. package/.worktrees/2c37b1d7/src/run/gates.js +0 -1111
  290. package/.worktrees/2c37b1d7/src/run/multi-repo-context.js +0 -208
  291. package/.worktrees/2c37b1d7/src/run/next.js +0 -128
  292. package/.worktrees/2c37b1d7/src/run/prompt.js +0 -843
  293. package/.worktrees/2c37b1d7/src/run/quick-audit.js +0 -186
  294. package/.worktrees/2c37b1d7/src/run/scan-profile.js +0 -269
  295. package/.worktrees/2c37b1d7/src/run/shared.js +0 -1562
  296. package/.worktrees/2c37b1d7/src/run/stage.js +0 -587
  297. package/.worktrees/2c37b1d7/src/run.js +0 -23
  298. package/.worktrees/2c37b1d7/src/scan-diff.js +0 -388
  299. package/.worktrees/2c37b1d7/src/scan-postcheck.js +0 -524
  300. package/.worktrees/2c37b1d7/src/scan-staleness.js +0 -95
  301. package/.worktrees/2c37b1d7/src/setup.js +0 -414
  302. package/.worktrees/2c37b1d7/src/sillyhub-mcp/client.js +0 -597
  303. package/.worktrees/2c37b1d7/src/sillyhub-mcp/config.js +0 -62
  304. package/.worktrees/2c37b1d7/src/spec-dir-typo.js +0 -50
  305. package/.worktrees/2c37b1d7/src/spec-sync.js +0 -358
  306. package/.worktrees/2c37b1d7/src/stage-contract-engine.js +0 -171
  307. package/.worktrees/2c37b1d7/src/stage-contract-spec.js +0 -551
  308. package/.worktrees/2c37b1d7/src/stage-contract.js +0 -948
  309. package/.worktrees/2c37b1d7/src/stage-review.js +0 -597
  310. package/.worktrees/2c37b1d7/src/stages/archive.js +0 -199
  311. package/.worktrees/2c37b1d7/src/stages/brainstorm-auto.js +0 -285
  312. package/.worktrees/2c37b1d7/src/stages/brainstorm.js +0 -624
  313. package/.worktrees/2c37b1d7/src/stages/cmd-existence.js +0 -145
  314. package/.worktrees/2c37b1d7/src/stages/doctor.js +0 -540
  315. package/.worktrees/2c37b1d7/src/stages/execute.js +0 -1277
  316. package/.worktrees/2c37b1d7/src/stages/explore.js +0 -43
  317. package/.worktrees/2c37b1d7/src/stages/index.js +0 -29
  318. package/.worktrees/2c37b1d7/src/stages/knowledge.js +0 -514
  319. package/.worktrees/2c37b1d7/src/stages/plan-postcheck.js +0 -1398
  320. package/.worktrees/2c37b1d7/src/stages/plan.js +0 -655
  321. package/.worktrees/2c37b1d7/src/stages/quick.js +0 -167
  322. package/.worktrees/2c37b1d7/src/stages/scan.js +0 -608
  323. package/.worktrees/2c37b1d7/src/stages/status.js +0 -64
  324. package/.worktrees/2c37b1d7/src/stages/verify.js +0 -246
  325. package/.worktrees/2c37b1d7/src/sync.js +0 -1470
  326. package/.worktrees/2c37b1d7/src/task-review.js +0 -1498
  327. package/.worktrees/2c37b1d7/src/taskcard-placeholders.js +0 -21
  328. package/.worktrees/2c37b1d7/src/taskcard.js +0 -250
  329. package/.worktrees/2c37b1d7/src/verify-postcheck.js +0 -1718
  330. package/.worktrees/2c37b1d7/src/verify-probes.js +0 -327
  331. package/.worktrees/2c37b1d7/src/version.js +0 -19
  332. package/.worktrees/2c37b1d7/src/workflow.js +0 -600
  333. package/.worktrees/2c37b1d7/src/workspace.js +0 -125
  334. package/.worktrees/2c37b1d7/src/worktree-apply.js +0 -1611
  335. package/.worktrees/2c37b1d7/src/worktree-deps.js +0 -668
  336. package/.worktrees/2c37b1d7/src/worktree.js +0 -1849
  337. package/.worktrees/2c37b1d7/templates/claude-instruction.md +0 -23
  338. package/.worktrees/2c37b1d7/templates/prompts/taskcard-rules.md +0 -29
  339. package/.worktrees/2c37b1d7/templates/prompts/testcase-design.md +0 -12
  340. package/.worktrees/2c37b1d7/templates/prompts/verify-probes.md +0 -32
  341. package/.worktrees/2c37b1d7/templates/workflows/archive-impact.yaml +0 -79
  342. package/.worktrees/2c37b1d7/templates/workflows/scan-docs.yaml +0 -132
  343. package/.worktrees/542c4415/.claude/skills/sillyspec-archive/SKILL.md +0 -87
  344. package/.worktrees/542c4415/.claude/skills/sillyspec-auto/SKILL.md +0 -93
  345. package/.worktrees/542c4415/.claude/skills/sillyspec-brainstorm/SKILL.md +0 -114
  346. package/.worktrees/542c4415/.claude/skills/sillyspec-commit/SKILL.md +0 -67
  347. package/.worktrees/542c4415/.claude/skills/sillyspec-continue/SKILL.md +0 -47
  348. package/.worktrees/542c4415/.claude/skills/sillyspec-doctor/SKILL.md +0 -76
  349. package/.worktrees/542c4415/.claude/skills/sillyspec-execute/SKILL.md +0 -214
  350. package/.worktrees/542c4415/.claude/skills/sillyspec-explore/SKILL.md +0 -102
  351. package/.worktrees/542c4415/.claude/skills/sillyspec-export/SKILL.md +0 -57
  352. package/.worktrees/542c4415/.claude/skills/sillyspec-init/SKILL.md +0 -177
  353. package/.worktrees/542c4415/.claude/skills/sillyspec-knowledge/SKILL.md +0 -270
  354. package/.worktrees/542c4415/.claude/skills/sillyspec-plan/SKILL.md +0 -156
  355. package/.worktrees/542c4415/.claude/skills/sillyspec-quick/SKILL.md +0 -116
  356. package/.worktrees/542c4415/.claude/skills/sillyspec-resume/SKILL.md +0 -70
  357. package/.worktrees/542c4415/.claude/skills/sillyspec-scan/SKILL.md +0 -79
  358. package/.worktrees/542c4415/.claude/skills/sillyspec-state/SKILL.md +0 -64
  359. package/.worktrees/542c4415/.claude/skills/sillyspec-status/SKILL.md +0 -54
  360. package/.worktrees/542c4415/.claude/skills/sillyspec-verify/SKILL.md +0 -87
  361. package/.worktrees/542c4415/.claude/skills/sillyspec-workspace/SKILL.md +0 -175
  362. package/.worktrees/542c4415/.gitattributes +0 -2
  363. package/.worktrees/542c4415/.husky/pre-push +0 -20
  364. package/.worktrees/542c4415/README.md +0 -203
  365. package/.worktrees/542c4415/SKILL.md +0 -91
  366. package/.worktrees/542c4415/architecture-analysis.md +0 -448
  367. package/.worktrees/542c4415/bin/sillyspec.js +0 -2
  368. package/.worktrees/542c4415/eval/README.md +0 -86
  369. package/.worktrees/542c4415/eval/eval.config.json +0 -28
  370. package/.worktrees/542c4415/eval/lib/adapters/cli.mjs +0 -63
  371. package/.worktrees/542c4415/eval/lib/adapters/dryrun.mjs +0 -27
  372. package/.worktrees/542c4415/eval/lib/config.mjs +0 -82
  373. package/.worktrees/542c4415/eval/lib/db.mjs +0 -76
  374. package/.worktrees/542c4415/eval/lib/report.mjs +0 -120
  375. package/.worktrees/542c4415/eval/lib/runner.mjs +0 -157
  376. package/.worktrees/542c4415/eval/lib/tasks.mjs +0 -73
  377. package/.worktrees/542c4415/eval/lib/util.mjs +0 -107
  378. package/.worktrees/542c4415/eval/lib/workdir.mjs +0 -30
  379. package/.worktrees/542c4415/eval/run.mjs +0 -83
  380. package/.worktrees/542c4415/eval/tasks/001-slugify/files/package.json +0 -6
  381. package/.worktrees/542c4415/eval/tasks/001-slugify/solution/src/slugify.mjs +0 -26
  382. package/.worktrees/542c4415/eval/tasks/001-slugify/task.json +0 -6
  383. package/.worktrees/542c4415/eval/tasks/001-slugify/verify.mjs +0 -28
  384. package/.worktrees/542c4415/eval/tasks/002-each-day/files/package.json +0 -6
  385. package/.worktrees/542c4415/eval/tasks/002-each-day/files/src/dates.mjs +0 -4
  386. package/.worktrees/542c4415/eval/tasks/002-each-day/solution/src/dates.mjs +0 -30
  387. package/.worktrees/542c4415/eval/tasks/002-each-day/task.json +0 -6
  388. package/.worktrees/542c4415/eval/tasks/002-each-day/verify.mjs +0 -31
  389. package/.worktrees/542c4415/eval/tasks/003-word-report/files/data/notes.txt +0 -5
  390. package/.worktrees/542c4415/eval/tasks/003-word-report/files/package.json +0 -6
  391. package/.worktrees/542c4415/eval/tasks/003-word-report/solution/bin/report.mjs +0 -36
  392. package/.worktrees/542c4415/eval/tasks/003-word-report/task.json +0 -6
  393. package/.worktrees/542c4415/eval/tasks/003-word-report/verify.mjs +0 -38
  394. package/.worktrees/542c4415/logo.jpg +0 -0
  395. package/.worktrees/542c4415/package-lock.json +0 -977
  396. package/.worktrees/542c4415/package.json +0 -41
  397. package/.worktrees/542c4415/packages/dashboard/dist/assets/index-Bq_Z2hne.js +0 -7446
  398. package/.worktrees/542c4415/packages/dashboard/dist/assets/index-O2W5RV4z.css +0 -1
  399. package/.worktrees/542c4415/packages/dashboard/dist/favicon.jpg +0 -0
  400. package/.worktrees/542c4415/packages/dashboard/dist/index.html +0 -16
  401. package/.worktrees/542c4415/packages/dashboard/dist/logo.jpg +0 -0
  402. package/.worktrees/542c4415/packages/dashboard/dist/prototype-dashboard.html +0 -836
  403. package/.worktrees/542c4415/packages/dashboard/dist/prototype-overview.html +0 -256
  404. package/.worktrees/542c4415/packages/dashboard/package.json +0 -25
  405. package/.worktrees/542c4415/packages/dashboard/server/executor.js +0 -95
  406. package/.worktrees/542c4415/packages/dashboard/server/index.js +0 -679
  407. package/.worktrees/542c4415/packages/dashboard/server/parser.js +0 -526
  408. package/.worktrees/542c4415/packages/dashboard/server/watcher.js +0 -357
  409. package/.worktrees/542c4415/src/agent-session-log.js +0 -803
  410. package/.worktrees/542c4415/src/change-list.js +0 -290
  411. package/.worktrees/542c4415/src/change-risk-profile.js +0 -339
  412. package/.worktrees/542c4415/src/check-primitives.js +0 -65
  413. package/.worktrees/542c4415/src/classify-change.js +0 -109
  414. package/.worktrees/542c4415/src/commit-suggest.js +0 -202
  415. package/.worktrees/542c4415/src/config-cat.js +0 -88
  416. package/.worktrees/542c4415/src/config-schema.js +0 -328
  417. package/.worktrees/542c4415/src/constants.js +0 -97
  418. package/.worktrees/542c4415/src/contract-matrix.js +0 -533
  419. package/.worktrees/542c4415/src/datetime.js +0 -20
  420. package/.worktrees/542c4415/src/db-engine.js +0 -55
  421. package/.worktrees/542c4415/src/db.js +0 -381
  422. package/.worktrees/542c4415/src/decision-distill.js +0 -517
  423. package/.worktrees/542c4415/src/dispatch/backends/local-agent.js +0 -155
  424. package/.worktrees/542c4415/src/dispatch/backends/sillyhub-mcp.js +0 -245
  425. package/.worktrees/542c4415/src/dispatch/probe.js +0 -246
  426. package/.worktrees/542c4415/src/dispatch/strategy.js +0 -121
  427. package/.worktrees/542c4415/src/docs-check.js +0 -825
  428. package/.worktrees/542c4415/src/docs-debt.js +0 -393
  429. package/.worktrees/542c4415/src/docs-gate.js +0 -107
  430. package/.worktrees/542c4415/src/doctor-diagnostics.js +0 -1099
  431. package/.worktrees/542c4415/src/endpoint-extractor.js +0 -409
  432. package/.worktrees/542c4415/src/foreign-declared.js +0 -155
  433. package/.worktrees/542c4415/src/fs-atomic.js +0 -73
  434. package/.worktrees/542c4415/src/git-helper.js +0 -150
  435. package/.worktrees/542c4415/src/hooks/claude-pre-tool-use.cjs +0 -130
  436. package/.worktrees/542c4415/src/hooks/worktree-guard.js +0 -892
  437. package/.worktrees/542c4415/src/index.js +0 -2854
  438. package/.worktrees/542c4415/src/init.js +0 -626
  439. package/.worktrees/542c4415/src/knowledge-match.js +0 -231
  440. package/.worktrees/542c4415/src/local-detect.js +0 -128
  441. package/.worktrees/542c4415/src/local-register.js +0 -104
  442. package/.worktrees/542c4415/src/machine-interface.js +0 -543
  443. package/.worktrees/542c4415/src/migrate.js +0 -127
  444. package/.worktrees/542c4415/src/module-impact.js +0 -166
  445. package/.worktrees/542c4415/src/module-resolve.js +0 -222
  446. package/.worktrees/542c4415/src/modules.js +0 -580
  447. package/.worktrees/542c4415/src/plan-adopt-waves.js +0 -126
  448. package/.worktrees/542c4415/src/progress/change-registry.js +0 -336
  449. package/.worktrees/542c4415/src/progress/consistency-doctor.js +0 -355
  450. package/.worktrees/542c4415/src/progress/shared.js +0 -36
  451. package/.worktrees/542c4415/src/progress/stage-machine.js +0 -594
  452. package/.worktrees/542c4415/src/progress/step-store.js +0 -265
  453. package/.worktrees/542c4415/src/progress.js +0 -1304
  454. package/.worktrees/542c4415/src/quick-recommend.js +0 -115
  455. package/.worktrees/542c4415/src/quicklog.js +0 -883
  456. package/.worktrees/542c4415/src/review-tier.js +0 -77
  457. package/.worktrees/542c4415/src/run/command.js +0 -1641
  458. package/.worktrees/542c4415/src/run/complete-handlers.js +0 -1552
  459. package/.worktrees/542c4415/src/run/complete.js +0 -1259
  460. package/.worktrees/542c4415/src/run/concurrent-detect.js +0 -156
  461. package/.worktrees/542c4415/src/run/gates.js +0 -1111
  462. package/.worktrees/542c4415/src/run/multi-repo-context.js +0 -208
  463. package/.worktrees/542c4415/src/run/next.js +0 -128
  464. package/.worktrees/542c4415/src/run/prompt.js +0 -843
  465. package/.worktrees/542c4415/src/run/quick-audit.js +0 -186
  466. package/.worktrees/542c4415/src/run/scan-profile.js +0 -269
  467. package/.worktrees/542c4415/src/run/shared.js +0 -1562
  468. package/.worktrees/542c4415/src/run/stage.js +0 -587
  469. package/.worktrees/542c4415/src/run.js +0 -23
  470. package/.worktrees/542c4415/src/scan-diff.js +0 -388
  471. package/.worktrees/542c4415/src/scan-postcheck.js +0 -524
  472. package/.worktrees/542c4415/src/scan-staleness.js +0 -95
  473. package/.worktrees/542c4415/src/setup.js +0 -414
  474. package/.worktrees/542c4415/src/sillyhub-mcp/client.js +0 -597
  475. package/.worktrees/542c4415/src/sillyhub-mcp/config.js +0 -62
  476. package/.worktrees/542c4415/src/spec-dir-typo.js +0 -50
  477. package/.worktrees/542c4415/src/spec-sync.js +0 -358
  478. package/.worktrees/542c4415/src/stage-contract-engine.js +0 -171
  479. package/.worktrees/542c4415/src/stage-contract-spec.js +0 -551
  480. package/.worktrees/542c4415/src/stage-contract.js +0 -948
  481. package/.worktrees/542c4415/src/stage-review.js +0 -597
  482. package/.worktrees/542c4415/src/stages/archive.js +0 -199
  483. package/.worktrees/542c4415/src/stages/brainstorm-auto.js +0 -285
  484. package/.worktrees/542c4415/src/stages/brainstorm.js +0 -624
  485. package/.worktrees/542c4415/src/stages/cmd-existence.js +0 -145
  486. package/.worktrees/542c4415/src/stages/doctor.js +0 -540
  487. package/.worktrees/542c4415/src/stages/execute.js +0 -1277
  488. package/.worktrees/542c4415/src/stages/explore.js +0 -43
  489. package/.worktrees/542c4415/src/stages/index.js +0 -29
  490. package/.worktrees/542c4415/src/stages/knowledge.js +0 -514
  491. package/.worktrees/542c4415/src/stages/plan-postcheck.js +0 -1398
  492. package/.worktrees/542c4415/src/stages/plan.js +0 -655
  493. package/.worktrees/542c4415/src/stages/quick.js +0 -167
  494. package/.worktrees/542c4415/src/stages/scan.js +0 -608
  495. package/.worktrees/542c4415/src/stages/status.js +0 -64
  496. package/.worktrees/542c4415/src/stages/verify.js +0 -246
  497. package/.worktrees/542c4415/src/sync.js +0 -1470
  498. package/.worktrees/542c4415/src/task-review.js +0 -1498
  499. package/.worktrees/542c4415/src/taskcard-placeholders.js +0 -21
  500. package/.worktrees/542c4415/src/taskcard.js +0 -250
  501. package/.worktrees/542c4415/src/verify-postcheck.js +0 -1718
  502. package/.worktrees/542c4415/src/verify-probes.js +0 -327
  503. package/.worktrees/542c4415/src/version.js +0 -19
  504. package/.worktrees/542c4415/src/workflow.js +0 -600
  505. package/.worktrees/542c4415/src/workspace.js +0 -125
  506. package/.worktrees/542c4415/src/worktree-apply.js +0 -1611
  507. package/.worktrees/542c4415/src/worktree-deps.js +0 -668
  508. package/.worktrees/542c4415/src/worktree.js +0 -1849
  509. package/.worktrees/542c4415/templates/claude-instruction.md +0 -23
  510. package/.worktrees/542c4415/templates/prompts/taskcard-rules.md +0 -29
  511. package/.worktrees/542c4415/templates/prompts/testcase-design.md +0 -12
  512. package/.worktrees/542c4415/templates/prompts/verify-probes.md +0 -32
  513. package/.worktrees/542c4415/templates/workflows/archive-impact.yaml +0 -79
  514. package/.worktrees/542c4415/templates/workflows/scan-docs.yaml +0 -132
  515. package/.worktrees/8d2d0392/.claude/skills/sillyspec-archive/SKILL.md +0 -87
  516. package/.worktrees/8d2d0392/.claude/skills/sillyspec-auto/SKILL.md +0 -93
  517. package/.worktrees/8d2d0392/.claude/skills/sillyspec-brainstorm/SKILL.md +0 -114
  518. package/.worktrees/8d2d0392/.claude/skills/sillyspec-commit/SKILL.md +0 -67
  519. package/.worktrees/8d2d0392/.claude/skills/sillyspec-continue/SKILL.md +0 -47
  520. package/.worktrees/8d2d0392/.claude/skills/sillyspec-doctor/SKILL.md +0 -76
  521. package/.worktrees/8d2d0392/.claude/skills/sillyspec-execute/SKILL.md +0 -214
  522. package/.worktrees/8d2d0392/.claude/skills/sillyspec-explore/SKILL.md +0 -102
  523. package/.worktrees/8d2d0392/.claude/skills/sillyspec-export/SKILL.md +0 -57
  524. package/.worktrees/8d2d0392/.claude/skills/sillyspec-init/SKILL.md +0 -177
  525. package/.worktrees/8d2d0392/.claude/skills/sillyspec-knowledge/SKILL.md +0 -270
  526. package/.worktrees/8d2d0392/.claude/skills/sillyspec-plan/SKILL.md +0 -156
  527. package/.worktrees/8d2d0392/.claude/skills/sillyspec-propose/SKILL.md +0 -87
  528. package/.worktrees/8d2d0392/.claude/skills/sillyspec-quick/SKILL.md +0 -116
  529. package/.worktrees/8d2d0392/.claude/skills/sillyspec-resume/SKILL.md +0 -70
  530. package/.worktrees/8d2d0392/.claude/skills/sillyspec-scan/SKILL.md +0 -79
  531. package/.worktrees/8d2d0392/.claude/skills/sillyspec-state/SKILL.md +0 -64
  532. package/.worktrees/8d2d0392/.claude/skills/sillyspec-status/SKILL.md +0 -54
  533. package/.worktrees/8d2d0392/.claude/skills/sillyspec-verify/SKILL.md +0 -87
  534. package/.worktrees/8d2d0392/.claude/skills/sillyspec-workspace/SKILL.md +0 -175
  535. package/.worktrees/8d2d0392/.claude/skills/verify-per-user/SKILL.md +0 -6
  536. package/.worktrees/8d2d0392/.gitattributes +0 -2
  537. package/.worktrees/8d2d0392/.husky/pre-push +0 -20
  538. package/.worktrees/8d2d0392/README.md +0 -203
  539. package/.worktrees/8d2d0392/SKILL.md +0 -91
  540. package/.worktrees/8d2d0392/architecture-analysis.md +0 -448
  541. package/.worktrees/8d2d0392/bin/sillyspec.js +0 -2
  542. package/.worktrees/8d2d0392/eval/README.md +0 -86
  543. package/.worktrees/8d2d0392/eval/eval.config.json +0 -28
  544. package/.worktrees/8d2d0392/eval/lib/adapters/cli.mjs +0 -63
  545. package/.worktrees/8d2d0392/eval/lib/adapters/dryrun.mjs +0 -27
  546. package/.worktrees/8d2d0392/eval/lib/config.mjs +0 -82
  547. package/.worktrees/8d2d0392/eval/lib/db.mjs +0 -76
  548. package/.worktrees/8d2d0392/eval/lib/report.mjs +0 -120
  549. package/.worktrees/8d2d0392/eval/lib/runner.mjs +0 -157
  550. package/.worktrees/8d2d0392/eval/lib/tasks.mjs +0 -73
  551. package/.worktrees/8d2d0392/eval/lib/util.mjs +0 -107
  552. package/.worktrees/8d2d0392/eval/lib/workdir.mjs +0 -30
  553. package/.worktrees/8d2d0392/eval/run.mjs +0 -83
  554. package/.worktrees/8d2d0392/eval/tasks/001-slugify/files/package.json +0 -6
  555. package/.worktrees/8d2d0392/eval/tasks/001-slugify/solution/src/slugify.mjs +0 -26
  556. package/.worktrees/8d2d0392/eval/tasks/001-slugify/task.json +0 -6
  557. package/.worktrees/8d2d0392/eval/tasks/001-slugify/verify.mjs +0 -28
  558. package/.worktrees/8d2d0392/eval/tasks/002-each-day/files/package.json +0 -6
  559. package/.worktrees/8d2d0392/eval/tasks/002-each-day/files/src/dates.mjs +0 -4
  560. package/.worktrees/8d2d0392/eval/tasks/002-each-day/solution/src/dates.mjs +0 -30
  561. package/.worktrees/8d2d0392/eval/tasks/002-each-day/task.json +0 -6
  562. package/.worktrees/8d2d0392/eval/tasks/002-each-day/verify.mjs +0 -31
  563. package/.worktrees/8d2d0392/eval/tasks/003-word-report/files/data/notes.txt +0 -5
  564. package/.worktrees/8d2d0392/eval/tasks/003-word-report/files/package.json +0 -6
  565. package/.worktrees/8d2d0392/eval/tasks/003-word-report/solution/bin/report.mjs +0 -36
  566. package/.worktrees/8d2d0392/eval/tasks/003-word-report/task.json +0 -6
  567. package/.worktrees/8d2d0392/eval/tasks/003-word-report/verify.mjs +0 -38
  568. package/.worktrees/8d2d0392/logo.jpg +0 -0
  569. package/.worktrees/8d2d0392/package-lock.json +0 -977
  570. package/.worktrees/8d2d0392/package.json +0 -41
  571. package/.worktrees/8d2d0392/packages/dashboard/dist/assets/index-Bq_Z2hne.js +0 -7446
  572. package/.worktrees/8d2d0392/packages/dashboard/dist/assets/index-O2W5RV4z.css +0 -1
  573. package/.worktrees/8d2d0392/packages/dashboard/dist/favicon.jpg +0 -0
  574. package/.worktrees/8d2d0392/packages/dashboard/dist/index.html +0 -16
  575. package/.worktrees/8d2d0392/packages/dashboard/dist/logo.jpg +0 -0
  576. package/.worktrees/8d2d0392/packages/dashboard/dist/prototype-dashboard.html +0 -836
  577. package/.worktrees/8d2d0392/packages/dashboard/dist/prototype-overview.html +0 -256
  578. package/.worktrees/8d2d0392/packages/dashboard/package.json +0 -25
  579. package/.worktrees/8d2d0392/packages/dashboard/server/executor.js +0 -95
  580. package/.worktrees/8d2d0392/packages/dashboard/server/index.js +0 -679
  581. package/.worktrees/8d2d0392/packages/dashboard/server/parser.js +0 -526
  582. package/.worktrees/8d2d0392/packages/dashboard/server/watcher.js +0 -357
  583. package/.worktrees/8d2d0392/src/agent-session-log.js +0 -803
  584. package/.worktrees/8d2d0392/src/change-list.js +0 -290
  585. package/.worktrees/8d2d0392/src/change-risk-profile.js +0 -339
  586. package/.worktrees/8d2d0392/src/check-primitives.js +0 -65
  587. package/.worktrees/8d2d0392/src/classify-change.js +0 -109
  588. package/.worktrees/8d2d0392/src/commit-suggest.js +0 -202
  589. package/.worktrees/8d2d0392/src/config-cat.js +0 -88
  590. package/.worktrees/8d2d0392/src/config-schema.js +0 -328
  591. package/.worktrees/8d2d0392/src/constants.js +0 -97
  592. package/.worktrees/8d2d0392/src/contract-matrix.js +0 -533
  593. package/.worktrees/8d2d0392/src/datetime.js +0 -20
  594. package/.worktrees/8d2d0392/src/db-engine.js +0 -55
  595. package/.worktrees/8d2d0392/src/db.js +0 -381
  596. package/.worktrees/8d2d0392/src/decision-distill.js +0 -517
  597. package/.worktrees/8d2d0392/src/dispatch/backends/local-agent.js +0 -155
  598. package/.worktrees/8d2d0392/src/dispatch/backends/sillyhub-mcp.js +0 -245
  599. package/.worktrees/8d2d0392/src/dispatch/probe.js +0 -246
  600. package/.worktrees/8d2d0392/src/dispatch/strategy.js +0 -121
  601. package/.worktrees/8d2d0392/src/docs-check.js +0 -825
  602. package/.worktrees/8d2d0392/src/docs-debt.js +0 -393
  603. package/.worktrees/8d2d0392/src/docs-gate.js +0 -107
  604. package/.worktrees/8d2d0392/src/doctor-diagnostics.js +0 -1099
  605. package/.worktrees/8d2d0392/src/endpoint-extractor.js +0 -409
  606. package/.worktrees/8d2d0392/src/foreign-declared.js +0 -78
  607. package/.worktrees/8d2d0392/src/fs-atomic.js +0 -73
  608. package/.worktrees/8d2d0392/src/git-helper.js +0 -150
  609. package/.worktrees/8d2d0392/src/hooks/claude-pre-tool-use.cjs +0 -130
  610. package/.worktrees/8d2d0392/src/hooks/worktree-guard.js +0 -892
  611. package/.worktrees/8d2d0392/src/index.js +0 -2854
  612. package/.worktrees/8d2d0392/src/init.js +0 -626
  613. package/.worktrees/8d2d0392/src/knowledge-match.js +0 -231
  614. package/.worktrees/8d2d0392/src/local-detect.js +0 -128
  615. package/.worktrees/8d2d0392/src/local-register.js +0 -104
  616. package/.worktrees/8d2d0392/src/machine-interface.js +0 -543
  617. package/.worktrees/8d2d0392/src/migrate.js +0 -127
  618. package/.worktrees/8d2d0392/src/module-impact.js +0 -166
  619. package/.worktrees/8d2d0392/src/module-resolve.js +0 -222
  620. package/.worktrees/8d2d0392/src/modules.js +0 -580
  621. package/.worktrees/8d2d0392/src/plan-adopt-waves.js +0 -126
  622. package/.worktrees/8d2d0392/src/progress/change-registry.js +0 -336
  623. package/.worktrees/8d2d0392/src/progress/consistency-doctor.js +0 -355
  624. package/.worktrees/8d2d0392/src/progress/shared.js +0 -36
  625. package/.worktrees/8d2d0392/src/progress/stage-machine.js +0 -594
  626. package/.worktrees/8d2d0392/src/progress/step-store.js +0 -265
  627. package/.worktrees/8d2d0392/src/progress.js +0 -1304
  628. package/.worktrees/8d2d0392/src/quick-recommend.js +0 -115
  629. package/.worktrees/8d2d0392/src/quicklog.js +0 -883
  630. package/.worktrees/8d2d0392/src/review-tier.js +0 -77
  631. package/.worktrees/8d2d0392/src/run/command.js +0 -1641
  632. package/.worktrees/8d2d0392/src/run/complete-handlers.js +0 -1552
  633. package/.worktrees/8d2d0392/src/run/complete.js +0 -1259
  634. package/.worktrees/8d2d0392/src/run/concurrent-detect.js +0 -156
  635. package/.worktrees/8d2d0392/src/run/gates.js +0 -1094
  636. package/.worktrees/8d2d0392/src/run/multi-repo-context.js +0 -208
  637. package/.worktrees/8d2d0392/src/run/next.js +0 -128
  638. package/.worktrees/8d2d0392/src/run/prompt.js +0 -843
  639. package/.worktrees/8d2d0392/src/run/quick-audit.js +0 -186
  640. package/.worktrees/8d2d0392/src/run/scan-profile.js +0 -269
  641. package/.worktrees/8d2d0392/src/run/shared.js +0 -1562
  642. package/.worktrees/8d2d0392/src/run/stage.js +0 -587
  643. package/.worktrees/8d2d0392/src/run.js +0 -23
  644. package/.worktrees/8d2d0392/src/scan-diff.js +0 -388
  645. package/.worktrees/8d2d0392/src/scan-postcheck.js +0 -524
  646. package/.worktrees/8d2d0392/src/scan-staleness.js +0 -95
  647. package/.worktrees/8d2d0392/src/setup.js +0 -414
  648. package/.worktrees/8d2d0392/src/sillyhub-mcp/client.js +0 -597
  649. package/.worktrees/8d2d0392/src/sillyhub-mcp/config.js +0 -62
  650. package/.worktrees/8d2d0392/src/spec-dir-typo.js +0 -50
  651. package/.worktrees/8d2d0392/src/spec-sync.js +0 -358
  652. package/.worktrees/8d2d0392/src/stage-contract-engine.js +0 -171
  653. package/.worktrees/8d2d0392/src/stage-contract-spec.js +0 -551
  654. package/.worktrees/8d2d0392/src/stage-contract.js +0 -948
  655. package/.worktrees/8d2d0392/src/stage-review.js +0 -597
  656. package/.worktrees/8d2d0392/src/stages/archive.js +0 -199
  657. package/.worktrees/8d2d0392/src/stages/brainstorm-auto.js +0 -285
  658. package/.worktrees/8d2d0392/src/stages/brainstorm.js +0 -624
  659. package/.worktrees/8d2d0392/src/stages/cmd-existence.js +0 -145
  660. package/.worktrees/8d2d0392/src/stages/doctor.js +0 -540
  661. package/.worktrees/8d2d0392/src/stages/execute.js +0 -1277
  662. package/.worktrees/8d2d0392/src/stages/explore.js +0 -43
  663. package/.worktrees/8d2d0392/src/stages/index.js +0 -29
  664. package/.worktrees/8d2d0392/src/stages/knowledge.js +0 -514
  665. package/.worktrees/8d2d0392/src/stages/plan-postcheck.js +0 -1398
  666. package/.worktrees/8d2d0392/src/stages/plan.js +0 -651
  667. package/.worktrees/8d2d0392/src/stages/quick.js +0 -167
  668. package/.worktrees/8d2d0392/src/stages/scan.js +0 -608
  669. package/.worktrees/8d2d0392/src/stages/status.js +0 -64
  670. package/.worktrees/8d2d0392/src/stages/verify.js +0 -246
  671. package/.worktrees/8d2d0392/src/sync.js +0 -1470
  672. package/.worktrees/8d2d0392/src/task-review.js +0 -1498
  673. package/.worktrees/8d2d0392/src/taskcard-placeholders.js +0 -21
  674. package/.worktrees/8d2d0392/src/taskcard.js +0 -217
  675. package/.worktrees/8d2d0392/src/verify-postcheck.js +0 -1718
  676. package/.worktrees/8d2d0392/src/verify-probes.js +0 -327
  677. package/.worktrees/8d2d0392/src/version.js +0 -19
  678. package/.worktrees/8d2d0392/src/workflow.js +0 -600
  679. package/.worktrees/8d2d0392/src/workspace.js +0 -125
  680. package/.worktrees/8d2d0392/src/worktree-apply.js +0 -1611
  681. package/.worktrees/8d2d0392/src/worktree-deps.js +0 -576
  682. package/.worktrees/8d2d0392/src/worktree.js +0 -1838
  683. package/.worktrees/8d2d0392/templates/claude-instruction.md +0 -23
  684. package/.worktrees/8d2d0392/templates/prompts/taskcard-rules.md +0 -29
  685. package/.worktrees/8d2d0392/templates/prompts/testcase-design.md +0 -12
  686. package/.worktrees/8d2d0392/templates/prompts/verify-probes.md +0 -32
  687. package/.worktrees/8d2d0392/templates/workflows/archive-impact.yaml +0 -79
  688. package/.worktrees/8d2d0392/templates/workflows/scan-docs.yaml +0 -132
  689. package/.worktrees/c1eae35e/.claude/skills/sillyspec-archive/SKILL.md +0 -87
  690. package/.worktrees/c1eae35e/.claude/skills/sillyspec-auto/SKILL.md +0 -93
  691. package/.worktrees/c1eae35e/.claude/skills/sillyspec-brainstorm/SKILL.md +0 -114
  692. package/.worktrees/c1eae35e/.claude/skills/sillyspec-commit/SKILL.md +0 -67
  693. package/.worktrees/c1eae35e/.claude/skills/sillyspec-continue/SKILL.md +0 -47
  694. package/.worktrees/c1eae35e/.claude/skills/sillyspec-doctor/SKILL.md +0 -76
  695. package/.worktrees/c1eae35e/.claude/skills/sillyspec-execute/SKILL.md +0 -214
  696. package/.worktrees/c1eae35e/.claude/skills/sillyspec-explore/SKILL.md +0 -102
  697. package/.worktrees/c1eae35e/.claude/skills/sillyspec-export/SKILL.md +0 -57
  698. package/.worktrees/c1eae35e/.claude/skills/sillyspec-init/SKILL.md +0 -177
  699. package/.worktrees/c1eae35e/.claude/skills/sillyspec-knowledge/SKILL.md +0 -270
  700. package/.worktrees/c1eae35e/.claude/skills/sillyspec-plan/SKILL.md +0 -156
  701. package/.worktrees/c1eae35e/.claude/skills/sillyspec-quick/SKILL.md +0 -116
  702. package/.worktrees/c1eae35e/.claude/skills/sillyspec-resume/SKILL.md +0 -70
  703. package/.worktrees/c1eae35e/.claude/skills/sillyspec-scan/SKILL.md +0 -79
  704. package/.worktrees/c1eae35e/.claude/skills/sillyspec-state/SKILL.md +0 -64
  705. package/.worktrees/c1eae35e/.claude/skills/sillyspec-status/SKILL.md +0 -54
  706. package/.worktrees/c1eae35e/.claude/skills/sillyspec-verify/SKILL.md +0 -87
  707. package/.worktrees/c1eae35e/.claude/skills/sillyspec-workspace/SKILL.md +0 -175
  708. package/.worktrees/c1eae35e/.gitattributes +0 -2
  709. package/.worktrees/c1eae35e/.husky/pre-push +0 -20
  710. package/.worktrees/c1eae35e/README.md +0 -203
  711. package/.worktrees/c1eae35e/SKILL.md +0 -91
  712. package/.worktrees/c1eae35e/architecture-analysis.md +0 -448
  713. package/.worktrees/c1eae35e/bin/sillyspec.js +0 -2
  714. package/.worktrees/c1eae35e/eval/README.md +0 -86
  715. package/.worktrees/c1eae35e/eval/eval.config.json +0 -28
  716. package/.worktrees/c1eae35e/eval/lib/adapters/cli.mjs +0 -63
  717. package/.worktrees/c1eae35e/eval/lib/adapters/dryrun.mjs +0 -27
  718. package/.worktrees/c1eae35e/eval/lib/config.mjs +0 -82
  719. package/.worktrees/c1eae35e/eval/lib/db.mjs +0 -76
  720. package/.worktrees/c1eae35e/eval/lib/report.mjs +0 -120
  721. package/.worktrees/c1eae35e/eval/lib/runner.mjs +0 -157
  722. package/.worktrees/c1eae35e/eval/lib/tasks.mjs +0 -73
  723. package/.worktrees/c1eae35e/eval/lib/util.mjs +0 -107
  724. package/.worktrees/c1eae35e/eval/lib/workdir.mjs +0 -30
  725. package/.worktrees/c1eae35e/eval/run.mjs +0 -83
  726. package/.worktrees/c1eae35e/eval/tasks/001-slugify/files/package.json +0 -6
  727. package/.worktrees/c1eae35e/eval/tasks/001-slugify/solution/src/slugify.mjs +0 -26
  728. package/.worktrees/c1eae35e/eval/tasks/001-slugify/task.json +0 -6
  729. package/.worktrees/c1eae35e/eval/tasks/001-slugify/verify.mjs +0 -28
  730. package/.worktrees/c1eae35e/eval/tasks/002-each-day/files/package.json +0 -6
  731. package/.worktrees/c1eae35e/eval/tasks/002-each-day/files/src/dates.mjs +0 -4
  732. package/.worktrees/c1eae35e/eval/tasks/002-each-day/solution/src/dates.mjs +0 -30
  733. package/.worktrees/c1eae35e/eval/tasks/002-each-day/task.json +0 -6
  734. package/.worktrees/c1eae35e/eval/tasks/002-each-day/verify.mjs +0 -31
  735. package/.worktrees/c1eae35e/eval/tasks/003-word-report/files/data/notes.txt +0 -5
  736. package/.worktrees/c1eae35e/eval/tasks/003-word-report/files/package.json +0 -6
  737. package/.worktrees/c1eae35e/eval/tasks/003-word-report/solution/bin/report.mjs +0 -36
  738. package/.worktrees/c1eae35e/eval/tasks/003-word-report/task.json +0 -6
  739. package/.worktrees/c1eae35e/eval/tasks/003-word-report/verify.mjs +0 -38
  740. package/.worktrees/c1eae35e/logo.jpg +0 -0
  741. package/.worktrees/c1eae35e/package-lock.json +0 -977
  742. package/.worktrees/c1eae35e/package.json +0 -41
  743. package/.worktrees/c1eae35e/packages/dashboard/dist/assets/index-Bq_Z2hne.js +0 -7446
  744. package/.worktrees/c1eae35e/packages/dashboard/dist/assets/index-O2W5RV4z.css +0 -1
  745. package/.worktrees/c1eae35e/packages/dashboard/dist/favicon.jpg +0 -0
  746. package/.worktrees/c1eae35e/packages/dashboard/dist/index.html +0 -16
  747. package/.worktrees/c1eae35e/packages/dashboard/dist/logo.jpg +0 -0
  748. package/.worktrees/c1eae35e/packages/dashboard/dist/prototype-dashboard.html +0 -836
  749. package/.worktrees/c1eae35e/packages/dashboard/dist/prototype-overview.html +0 -256
  750. package/.worktrees/c1eae35e/packages/dashboard/package.json +0 -25
  751. package/.worktrees/c1eae35e/packages/dashboard/server/executor.js +0 -95
  752. package/.worktrees/c1eae35e/packages/dashboard/server/index.js +0 -679
  753. package/.worktrees/c1eae35e/packages/dashboard/server/parser.js +0 -526
  754. package/.worktrees/c1eae35e/packages/dashboard/server/watcher.js +0 -357
  755. package/.worktrees/c1eae35e/src/agent-session-log.js +0 -803
  756. package/.worktrees/c1eae35e/src/change-list.js +0 -290
  757. package/.worktrees/c1eae35e/src/change-risk-profile.js +0 -339
  758. package/.worktrees/c1eae35e/src/check-primitives.js +0 -65
  759. package/.worktrees/c1eae35e/src/classify-change.js +0 -109
  760. package/.worktrees/c1eae35e/src/commit-suggest.js +0 -202
  761. package/.worktrees/c1eae35e/src/config-cat.js +0 -88
  762. package/.worktrees/c1eae35e/src/config-schema.js +0 -328
  763. package/.worktrees/c1eae35e/src/constants.js +0 -97
  764. package/.worktrees/c1eae35e/src/contract-matrix.js +0 -533
  765. package/.worktrees/c1eae35e/src/datetime.js +0 -20
  766. package/.worktrees/c1eae35e/src/db-engine.js +0 -55
  767. package/.worktrees/c1eae35e/src/db.js +0 -381
  768. package/.worktrees/c1eae35e/src/decision-distill.js +0 -517
  769. package/.worktrees/c1eae35e/src/dispatch/backends/local-agent.js +0 -155
  770. package/.worktrees/c1eae35e/src/dispatch/backends/sillyhub-mcp.js +0 -245
  771. package/.worktrees/c1eae35e/src/dispatch/probe.js +0 -246
  772. package/.worktrees/c1eae35e/src/dispatch/strategy.js +0 -121
  773. package/.worktrees/c1eae35e/src/docs-check.js +0 -825
  774. package/.worktrees/c1eae35e/src/docs-debt.js +0 -393
  775. package/.worktrees/c1eae35e/src/docs-gate.js +0 -107
  776. package/.worktrees/c1eae35e/src/doctor-diagnostics.js +0 -1099
  777. package/.worktrees/c1eae35e/src/endpoint-extractor.js +0 -409
  778. package/.worktrees/c1eae35e/src/foreign-declared.js +0 -155
  779. package/.worktrees/c1eae35e/src/fs-atomic.js +0 -73
  780. package/.worktrees/c1eae35e/src/git-helper.js +0 -150
  781. package/.worktrees/c1eae35e/src/hooks/claude-pre-tool-use.cjs +0 -130
  782. package/.worktrees/c1eae35e/src/hooks/worktree-guard.js +0 -892
  783. package/.worktrees/c1eae35e/src/index.js +0 -2854
  784. package/.worktrees/c1eae35e/src/init.js +0 -626
  785. package/.worktrees/c1eae35e/src/knowledge-match.js +0 -231
  786. package/.worktrees/c1eae35e/src/local-detect.js +0 -128
  787. package/.worktrees/c1eae35e/src/local-register.js +0 -104
  788. package/.worktrees/c1eae35e/src/machine-interface.js +0 -543
  789. package/.worktrees/c1eae35e/src/migrate.js +0 -127
  790. package/.worktrees/c1eae35e/src/module-impact.js +0 -166
  791. package/.worktrees/c1eae35e/src/module-resolve.js +0 -222
  792. package/.worktrees/c1eae35e/src/modules.js +0 -580
  793. package/.worktrees/c1eae35e/src/plan-adopt-waves.js +0 -126
  794. package/.worktrees/c1eae35e/src/progress/change-registry.js +0 -336
  795. package/.worktrees/c1eae35e/src/progress/consistency-doctor.js +0 -355
  796. package/.worktrees/c1eae35e/src/progress/shared.js +0 -36
  797. package/.worktrees/c1eae35e/src/progress/stage-machine.js +0 -594
  798. package/.worktrees/c1eae35e/src/progress/step-store.js +0 -265
  799. package/.worktrees/c1eae35e/src/progress.js +0 -1304
  800. package/.worktrees/c1eae35e/src/quick-recommend.js +0 -115
  801. package/.worktrees/c1eae35e/src/quicklog.js +0 -883
  802. package/.worktrees/c1eae35e/src/review-tier.js +0 -77
  803. package/.worktrees/c1eae35e/src/run/command.js +0 -1641
  804. package/.worktrees/c1eae35e/src/run/complete-handlers.js +0 -1552
  805. package/.worktrees/c1eae35e/src/run/complete.js +0 -1259
  806. package/.worktrees/c1eae35e/src/run/concurrent-detect.js +0 -156
  807. package/.worktrees/c1eae35e/src/run/gates.js +0 -1111
  808. package/.worktrees/c1eae35e/src/run/multi-repo-context.js +0 -208
  809. package/.worktrees/c1eae35e/src/run/next.js +0 -128
  810. package/.worktrees/c1eae35e/src/run/prompt.js +0 -843
  811. package/.worktrees/c1eae35e/src/run/quick-audit.js +0 -186
  812. package/.worktrees/c1eae35e/src/run/scan-profile.js +0 -269
  813. package/.worktrees/c1eae35e/src/run/shared.js +0 -1562
  814. package/.worktrees/c1eae35e/src/run/stage.js +0 -587
  815. package/.worktrees/c1eae35e/src/run.js +0 -23
  816. package/.worktrees/c1eae35e/src/scan-diff.js +0 -388
  817. package/.worktrees/c1eae35e/src/scan-postcheck.js +0 -524
  818. package/.worktrees/c1eae35e/src/scan-staleness.js +0 -95
  819. package/.worktrees/c1eae35e/src/setup.js +0 -414
  820. package/.worktrees/c1eae35e/src/sillyhub-mcp/client.js +0 -597
  821. package/.worktrees/c1eae35e/src/sillyhub-mcp/config.js +0 -62
  822. package/.worktrees/c1eae35e/src/spec-dir-typo.js +0 -50
  823. package/.worktrees/c1eae35e/src/spec-sync.js +0 -358
  824. package/.worktrees/c1eae35e/src/stage-contract-engine.js +0 -171
  825. package/.worktrees/c1eae35e/src/stage-contract-spec.js +0 -551
  826. package/.worktrees/c1eae35e/src/stage-contract.js +0 -948
  827. package/.worktrees/c1eae35e/src/stage-review.js +0 -597
  828. package/.worktrees/c1eae35e/src/stages/archive.js +0 -199
  829. package/.worktrees/c1eae35e/src/stages/brainstorm-auto.js +0 -285
  830. package/.worktrees/c1eae35e/src/stages/brainstorm.js +0 -624
  831. package/.worktrees/c1eae35e/src/stages/cmd-existence.js +0 -145
  832. package/.worktrees/c1eae35e/src/stages/doctor.js +0 -540
  833. package/.worktrees/c1eae35e/src/stages/execute.js +0 -1277
  834. package/.worktrees/c1eae35e/src/stages/explore.js +0 -43
  835. package/.worktrees/c1eae35e/src/stages/index.js +0 -29
  836. package/.worktrees/c1eae35e/src/stages/knowledge.js +0 -514
  837. package/.worktrees/c1eae35e/src/stages/plan-postcheck.js +0 -1398
  838. package/.worktrees/c1eae35e/src/stages/plan.js +0 -655
  839. package/.worktrees/c1eae35e/src/stages/quick.js +0 -167
  840. package/.worktrees/c1eae35e/src/stages/scan.js +0 -608
  841. package/.worktrees/c1eae35e/src/stages/status.js +0 -64
  842. package/.worktrees/c1eae35e/src/stages/verify.js +0 -246
  843. package/.worktrees/c1eae35e/src/sync.js +0 -1470
  844. package/.worktrees/c1eae35e/src/task-review.js +0 -1498
  845. package/.worktrees/c1eae35e/src/taskcard-placeholders.js +0 -21
  846. package/.worktrees/c1eae35e/src/taskcard.js +0 -250
  847. package/.worktrees/c1eae35e/src/verify-postcheck.js +0 -1718
  848. package/.worktrees/c1eae35e/src/verify-probes.js +0 -327
  849. package/.worktrees/c1eae35e/src/version.js +0 -19
  850. package/.worktrees/c1eae35e/src/workflow.js +0 -600
  851. package/.worktrees/c1eae35e/src/workspace.js +0 -125
  852. package/.worktrees/c1eae35e/src/worktree-apply.js +0 -1611
  853. package/.worktrees/c1eae35e/src/worktree-deps.js +0 -668
  854. package/.worktrees/c1eae35e/src/worktree.js +0 -1849
  855. package/.worktrees/c1eae35e/templates/claude-instruction.md +0 -23
  856. package/.worktrees/c1eae35e/templates/prompts/taskcard-rules.md +0 -29
  857. package/.worktrees/c1eae35e/templates/prompts/testcase-design.md +0 -12
  858. package/.worktrees/c1eae35e/templates/prompts/verify-probes.md +0 -32
  859. package/.worktrees/c1eae35e/templates/workflows/archive-impact.yaml +0 -79
  860. package/.worktrees/c1eae35e/templates/workflows/scan-docs.yaml +0 -132
  861. package/.worktrees/dafc71ad/.claude/skills/sillyspec-archive/SKILL.md +0 -87
  862. package/.worktrees/dafc71ad/.claude/skills/sillyspec-auto/SKILL.md +0 -93
  863. package/.worktrees/dafc71ad/.claude/skills/sillyspec-brainstorm/SKILL.md +0 -114
  864. package/.worktrees/dafc71ad/.claude/skills/sillyspec-commit/SKILL.md +0 -67
  865. package/.worktrees/dafc71ad/.claude/skills/sillyspec-continue/SKILL.md +0 -47
  866. package/.worktrees/dafc71ad/.claude/skills/sillyspec-doctor/SKILL.md +0 -76
  867. package/.worktrees/dafc71ad/.claude/skills/sillyspec-execute/SKILL.md +0 -214
  868. package/.worktrees/dafc71ad/.claude/skills/sillyspec-explore/SKILL.md +0 -102
  869. package/.worktrees/dafc71ad/.claude/skills/sillyspec-export/SKILL.md +0 -57
  870. package/.worktrees/dafc71ad/.claude/skills/sillyspec-init/SKILL.md +0 -177
  871. package/.worktrees/dafc71ad/.claude/skills/sillyspec-knowledge/SKILL.md +0 -270
  872. package/.worktrees/dafc71ad/.claude/skills/sillyspec-plan/SKILL.md +0 -156
  873. package/.worktrees/dafc71ad/.claude/skills/sillyspec-propose/SKILL.md +0 -87
  874. package/.worktrees/dafc71ad/.claude/skills/sillyspec-quick/SKILL.md +0 -116
  875. package/.worktrees/dafc71ad/.claude/skills/sillyspec-resume/SKILL.md +0 -70
  876. package/.worktrees/dafc71ad/.claude/skills/sillyspec-scan/SKILL.md +0 -79
  877. package/.worktrees/dafc71ad/.claude/skills/sillyspec-state/SKILL.md +0 -64
  878. package/.worktrees/dafc71ad/.claude/skills/sillyspec-status/SKILL.md +0 -54
  879. package/.worktrees/dafc71ad/.claude/skills/sillyspec-verify/SKILL.md +0 -87
  880. package/.worktrees/dafc71ad/.claude/skills/sillyspec-workspace/SKILL.md +0 -175
  881. package/.worktrees/dafc71ad/.gitattributes +0 -2
  882. package/.worktrees/dafc71ad/.husky/pre-push +0 -20
  883. package/.worktrees/dafc71ad/README.md +0 -203
  884. package/.worktrees/dafc71ad/SKILL.md +0 -91
  885. package/.worktrees/dafc71ad/analysis.md +0 -366
  886. package/.worktrees/dafc71ad/architecture-analysis.md +0 -448
  887. package/.worktrees/dafc71ad/bin/sillyspec.js +0 -2
  888. package/.worktrees/dafc71ad/eval/README.md +0 -86
  889. package/.worktrees/dafc71ad/eval/eval.config.json +0 -28
  890. package/.worktrees/dafc71ad/eval/lib/adapters/cli.mjs +0 -63
  891. package/.worktrees/dafc71ad/eval/lib/adapters/dryrun.mjs +0 -27
  892. package/.worktrees/dafc71ad/eval/lib/config.mjs +0 -82
  893. package/.worktrees/dafc71ad/eval/lib/db.mjs +0 -76
  894. package/.worktrees/dafc71ad/eval/lib/report.mjs +0 -120
  895. package/.worktrees/dafc71ad/eval/lib/runner.mjs +0 -157
  896. package/.worktrees/dafc71ad/eval/lib/tasks.mjs +0 -73
  897. package/.worktrees/dafc71ad/eval/lib/util.mjs +0 -107
  898. package/.worktrees/dafc71ad/eval/lib/workdir.mjs +0 -30
  899. package/.worktrees/dafc71ad/eval/run.mjs +0 -83
  900. package/.worktrees/dafc71ad/eval/tasks/001-slugify/files/package.json +0 -6
  901. package/.worktrees/dafc71ad/eval/tasks/001-slugify/solution/src/slugify.mjs +0 -26
  902. package/.worktrees/dafc71ad/eval/tasks/001-slugify/task.json +0 -6
  903. package/.worktrees/dafc71ad/eval/tasks/001-slugify/verify.mjs +0 -28
  904. package/.worktrees/dafc71ad/eval/tasks/002-each-day/files/package.json +0 -6
  905. package/.worktrees/dafc71ad/eval/tasks/002-each-day/files/src/dates.mjs +0 -4
  906. package/.worktrees/dafc71ad/eval/tasks/002-each-day/solution/src/dates.mjs +0 -30
  907. package/.worktrees/dafc71ad/eval/tasks/002-each-day/task.json +0 -6
  908. package/.worktrees/dafc71ad/eval/tasks/002-each-day/verify.mjs +0 -31
  909. package/.worktrees/dafc71ad/eval/tasks/003-word-report/files/data/notes.txt +0 -5
  910. package/.worktrees/dafc71ad/eval/tasks/003-word-report/files/package.json +0 -6
  911. package/.worktrees/dafc71ad/eval/tasks/003-word-report/solution/bin/report.mjs +0 -36
  912. package/.worktrees/dafc71ad/eval/tasks/003-word-report/task.json +0 -6
  913. package/.worktrees/dafc71ad/eval/tasks/003-word-report/verify.mjs +0 -38
  914. package/.worktrees/dafc71ad/logo.jpg +0 -0
  915. package/.worktrees/dafc71ad/package-lock.json +0 -977
  916. package/.worktrees/dafc71ad/package.json +0 -41
  917. package/.worktrees/dafc71ad/packages/dashboard/dist/assets/index-Bq_Z2hne.js +0 -7446
  918. package/.worktrees/dafc71ad/packages/dashboard/dist/assets/index-O2W5RV4z.css +0 -1
  919. package/.worktrees/dafc71ad/packages/dashboard/dist/favicon.jpg +0 -0
  920. package/.worktrees/dafc71ad/packages/dashboard/dist/index.html +0 -16
  921. package/.worktrees/dafc71ad/packages/dashboard/dist/logo.jpg +0 -0
  922. package/.worktrees/dafc71ad/packages/dashboard/dist/prototype-dashboard.html +0 -836
  923. package/.worktrees/dafc71ad/packages/dashboard/dist/prototype-overview.html +0 -256
  924. package/.worktrees/dafc71ad/packages/dashboard/package.json +0 -25
  925. package/.worktrees/dafc71ad/packages/dashboard/server/executor.js +0 -95
  926. package/.worktrees/dafc71ad/packages/dashboard/server/index.js +0 -679
  927. package/.worktrees/dafc71ad/packages/dashboard/server/parser.js +0 -526
  928. package/.worktrees/dafc71ad/packages/dashboard/server/watcher.js +0 -357
  929. package/.worktrees/dafc71ad/src/agent-session-log.js +0 -803
  930. package/.worktrees/dafc71ad/src/change-list.js +0 -290
  931. package/.worktrees/dafc71ad/src/change-risk-profile.js +0 -339
  932. package/.worktrees/dafc71ad/src/check-primitives.js +0 -65
  933. package/.worktrees/dafc71ad/src/classify-change.js +0 -109
  934. package/.worktrees/dafc71ad/src/commit-suggest.js +0 -202
  935. package/.worktrees/dafc71ad/src/config-cat.js +0 -88
  936. package/.worktrees/dafc71ad/src/config-schema.js +0 -328
  937. package/.worktrees/dafc71ad/src/constants.js +0 -97
  938. package/.worktrees/dafc71ad/src/contract-matrix.js +0 -533
  939. package/.worktrees/dafc71ad/src/datetime.js +0 -20
  940. package/.worktrees/dafc71ad/src/db-engine.js +0 -55
  941. package/.worktrees/dafc71ad/src/db.js +0 -381
  942. package/.worktrees/dafc71ad/src/decision-distill.js +0 -517
  943. package/.worktrees/dafc71ad/src/dispatch/backends/local-agent.js +0 -155
  944. package/.worktrees/dafc71ad/src/dispatch/backends/sillyhub-mcp.js +0 -245
  945. package/.worktrees/dafc71ad/src/dispatch/probe.js +0 -246
  946. package/.worktrees/dafc71ad/src/dispatch/strategy.js +0 -121
  947. package/.worktrees/dafc71ad/src/docs-check.js +0 -825
  948. package/.worktrees/dafc71ad/src/docs-debt.js +0 -393
  949. package/.worktrees/dafc71ad/src/docs-gate.js +0 -107
  950. package/.worktrees/dafc71ad/src/doctor-diagnostics.js +0 -1099
  951. package/.worktrees/dafc71ad/src/endpoint-extractor.js +0 -409
  952. package/.worktrees/dafc71ad/src/foreign-declared.js +0 -155
  953. package/.worktrees/dafc71ad/src/fs-atomic.js +0 -73
  954. package/.worktrees/dafc71ad/src/git-helper.js +0 -150
  955. package/.worktrees/dafc71ad/src/hooks/claude-pre-tool-use.cjs +0 -130
  956. package/.worktrees/dafc71ad/src/hooks/worktree-guard.js +0 -892
  957. package/.worktrees/dafc71ad/src/index.js +0 -2854
  958. package/.worktrees/dafc71ad/src/init.js +0 -626
  959. package/.worktrees/dafc71ad/src/knowledge-match.js +0 -231
  960. package/.worktrees/dafc71ad/src/local-detect.js +0 -128
  961. package/.worktrees/dafc71ad/src/local-register.js +0 -104
  962. package/.worktrees/dafc71ad/src/machine-interface.js +0 -543
  963. package/.worktrees/dafc71ad/src/migrate.js +0 -127
  964. package/.worktrees/dafc71ad/src/module-impact.js +0 -166
  965. package/.worktrees/dafc71ad/src/module-resolve.js +0 -222
  966. package/.worktrees/dafc71ad/src/modules.js +0 -580
  967. package/.worktrees/dafc71ad/src/plan-adopt-waves.js +0 -126
  968. package/.worktrees/dafc71ad/src/progress/change-registry.js +0 -336
  969. package/.worktrees/dafc71ad/src/progress/consistency-doctor.js +0 -355
  970. package/.worktrees/dafc71ad/src/progress/shared.js +0 -36
  971. package/.worktrees/dafc71ad/src/progress/stage-machine.js +0 -594
  972. package/.worktrees/dafc71ad/src/progress/step-store.js +0 -265
  973. package/.worktrees/dafc71ad/src/progress.js +0 -1304
  974. package/.worktrees/dafc71ad/src/quick-recommend.js +0 -115
  975. package/.worktrees/dafc71ad/src/quicklog.js +0 -883
  976. package/.worktrees/dafc71ad/src/review-tier.js +0 -77
  977. package/.worktrees/dafc71ad/src/run/command.js +0 -1641
  978. package/.worktrees/dafc71ad/src/run/complete-handlers.js +0 -1552
  979. package/.worktrees/dafc71ad/src/run/complete.js +0 -1259
  980. package/.worktrees/dafc71ad/src/run/concurrent-detect.js +0 -156
  981. package/.worktrees/dafc71ad/src/run/gates.js +0 -1111
  982. package/.worktrees/dafc71ad/src/run/multi-repo-context.js +0 -208
  983. package/.worktrees/dafc71ad/src/run/next.js +0 -128
  984. package/.worktrees/dafc71ad/src/run/prompt.js +0 -843
  985. package/.worktrees/dafc71ad/src/run/quick-audit.js +0 -186
  986. package/.worktrees/dafc71ad/src/run/scan-profile.js +0 -269
  987. package/.worktrees/dafc71ad/src/run/shared.js +0 -1562
  988. package/.worktrees/dafc71ad/src/run/stage.js +0 -587
  989. package/.worktrees/dafc71ad/src/run.js +0 -23
  990. package/.worktrees/dafc71ad/src/scan-diff.js +0 -388
  991. package/.worktrees/dafc71ad/src/scan-postcheck.js +0 -524
  992. package/.worktrees/dafc71ad/src/scan-staleness.js +0 -95
  993. package/.worktrees/dafc71ad/src/setup.js +0 -414
  994. package/.worktrees/dafc71ad/src/sillyhub-mcp/client.js +0 -597
  995. package/.worktrees/dafc71ad/src/sillyhub-mcp/config.js +0 -62
  996. package/.worktrees/dafc71ad/src/spec-dir-typo.js +0 -50
  997. package/.worktrees/dafc71ad/src/spec-sync.js +0 -358
  998. package/.worktrees/dafc71ad/src/stage-contract-engine.js +0 -171
  999. package/.worktrees/dafc71ad/src/stage-contract-spec.js +0 -551
  1000. package/.worktrees/dafc71ad/src/stage-contract.js +0 -948
  1001. package/.worktrees/dafc71ad/src/stage-review.js +0 -597
  1002. package/.worktrees/dafc71ad/src/stages/archive.js +0 -199
  1003. package/.worktrees/dafc71ad/src/stages/brainstorm-auto.js +0 -285
  1004. package/.worktrees/dafc71ad/src/stages/brainstorm.js +0 -624
  1005. package/.worktrees/dafc71ad/src/stages/cmd-existence.js +0 -145
  1006. package/.worktrees/dafc71ad/src/stages/doctor.js +0 -540
  1007. package/.worktrees/dafc71ad/src/stages/execute.js +0 -1277
  1008. package/.worktrees/dafc71ad/src/stages/explore.js +0 -43
  1009. package/.worktrees/dafc71ad/src/stages/index.js +0 -29
  1010. package/.worktrees/dafc71ad/src/stages/knowledge.js +0 -514
  1011. package/.worktrees/dafc71ad/src/stages/plan-postcheck.js +0 -1398
  1012. package/.worktrees/dafc71ad/src/stages/plan.js +0 -655
  1013. package/.worktrees/dafc71ad/src/stages/quick.js +0 -167
  1014. package/.worktrees/dafc71ad/src/stages/scan.js +0 -608
  1015. package/.worktrees/dafc71ad/src/stages/status.js +0 -64
  1016. package/.worktrees/dafc71ad/src/stages/verify.js +0 -246
  1017. package/.worktrees/dafc71ad/src/sync.js +0 -1470
  1018. package/.worktrees/dafc71ad/src/task-review.js +0 -1498
  1019. package/.worktrees/dafc71ad/src/taskcard-placeholders.js +0 -21
  1020. package/.worktrees/dafc71ad/src/taskcard.js +0 -250
  1021. package/.worktrees/dafc71ad/src/verify-postcheck.js +0 -1718
  1022. package/.worktrees/dafc71ad/src/verify-probes.js +0 -327
  1023. package/.worktrees/dafc71ad/src/version.js +0 -19
  1024. package/.worktrees/dafc71ad/src/workflow.js +0 -600
  1025. package/.worktrees/dafc71ad/src/workspace.js +0 -125
  1026. package/.worktrees/dafc71ad/src/worktree-apply.js +0 -1611
  1027. package/.worktrees/dafc71ad/src/worktree-deps.js +0 -668
  1028. package/.worktrees/dafc71ad/src/worktree.js +0 -1849
  1029. package/.worktrees/dafc71ad/templates/claude-instruction.md +0 -23
  1030. package/.worktrees/dafc71ad/templates/prompts/taskcard-rules.md +0 -29
  1031. package/.worktrees/dafc71ad/templates/prompts/testcase-design.md +0 -12
  1032. package/.worktrees/dafc71ad/templates/prompts/verify-probes.md +0 -32
  1033. package/.worktrees/dafc71ad/templates/workflows/archive-impact.yaml +0 -79
  1034. package/.worktrees/dafc71ad/templates/workflows/scan-docs.yaml +0 -132
  1035. package/.worktrees/e58fcc4c/.claude/skills/sillyspec-archive/SKILL.md +0 -87
  1036. package/.worktrees/e58fcc4c/.claude/skills/sillyspec-auto/SKILL.md +0 -93
  1037. package/.worktrees/e58fcc4c/.claude/skills/sillyspec-brainstorm/SKILL.md +0 -114
  1038. package/.worktrees/e58fcc4c/.claude/skills/sillyspec-commit/SKILL.md +0 -67
  1039. package/.worktrees/e58fcc4c/.claude/skills/sillyspec-continue/SKILL.md +0 -47
  1040. package/.worktrees/e58fcc4c/.claude/skills/sillyspec-doctor/SKILL.md +0 -76
  1041. package/.worktrees/e58fcc4c/.claude/skills/sillyspec-execute/SKILL.md +0 -214
  1042. package/.worktrees/e58fcc4c/.claude/skills/sillyspec-explore/SKILL.md +0 -102
  1043. package/.worktrees/e58fcc4c/.claude/skills/sillyspec-export/SKILL.md +0 -57
  1044. package/.worktrees/e58fcc4c/.claude/skills/sillyspec-init/SKILL.md +0 -177
  1045. package/.worktrees/e58fcc4c/.claude/skills/sillyspec-knowledge/SKILL.md +0 -270
  1046. package/.worktrees/e58fcc4c/.claude/skills/sillyspec-plan/SKILL.md +0 -156
  1047. package/.worktrees/e58fcc4c/.claude/skills/sillyspec-propose/SKILL.md +0 -87
  1048. package/.worktrees/e58fcc4c/.claude/skills/sillyspec-quick/SKILL.md +0 -116
  1049. package/.worktrees/e58fcc4c/.claude/skills/sillyspec-resume/SKILL.md +0 -70
  1050. package/.worktrees/e58fcc4c/.claude/skills/sillyspec-scan/SKILL.md +0 -79
  1051. package/.worktrees/e58fcc4c/.claude/skills/sillyspec-state/SKILL.md +0 -64
  1052. package/.worktrees/e58fcc4c/.claude/skills/sillyspec-status/SKILL.md +0 -54
  1053. package/.worktrees/e58fcc4c/.claude/skills/sillyspec-verify/SKILL.md +0 -87
  1054. package/.worktrees/e58fcc4c/.claude/skills/sillyspec-workspace/SKILL.md +0 -175
  1055. package/.worktrees/e58fcc4c/.gitattributes +0 -2
  1056. package/.worktrees/e58fcc4c/.husky/pre-push +0 -20
  1057. package/.worktrees/e58fcc4c/README.md +0 -203
  1058. package/.worktrees/e58fcc4c/SKILL.md +0 -91
  1059. package/.worktrees/e58fcc4c/architecture-analysis.md +0 -503
  1060. package/.worktrees/e58fcc4c/bin/sillyspec.js +0 -2
  1061. package/.worktrees/e58fcc4c/eval/README.md +0 -86
  1062. package/.worktrees/e58fcc4c/eval/eval.config.json +0 -28
  1063. package/.worktrees/e58fcc4c/eval/lib/adapters/cli.mjs +0 -63
  1064. package/.worktrees/e58fcc4c/eval/lib/adapters/dryrun.mjs +0 -27
  1065. package/.worktrees/e58fcc4c/eval/lib/config.mjs +0 -82
  1066. package/.worktrees/e58fcc4c/eval/lib/db.mjs +0 -76
  1067. package/.worktrees/e58fcc4c/eval/lib/report.mjs +0 -120
  1068. package/.worktrees/e58fcc4c/eval/lib/runner.mjs +0 -157
  1069. package/.worktrees/e58fcc4c/eval/lib/tasks.mjs +0 -73
  1070. package/.worktrees/e58fcc4c/eval/lib/util.mjs +0 -107
  1071. package/.worktrees/e58fcc4c/eval/lib/workdir.mjs +0 -30
  1072. package/.worktrees/e58fcc4c/eval/run.mjs +0 -83
  1073. package/.worktrees/e58fcc4c/eval/tasks/001-slugify/files/package.json +0 -6
  1074. package/.worktrees/e58fcc4c/eval/tasks/001-slugify/solution/src/slugify.mjs +0 -26
  1075. package/.worktrees/e58fcc4c/eval/tasks/001-slugify/task.json +0 -6
  1076. package/.worktrees/e58fcc4c/eval/tasks/001-slugify/verify.mjs +0 -28
  1077. package/.worktrees/e58fcc4c/eval/tasks/002-each-day/files/package.json +0 -6
  1078. package/.worktrees/e58fcc4c/eval/tasks/002-each-day/files/src/dates.mjs +0 -4
  1079. package/.worktrees/e58fcc4c/eval/tasks/002-each-day/solution/src/dates.mjs +0 -30
  1080. package/.worktrees/e58fcc4c/eval/tasks/002-each-day/task.json +0 -6
  1081. package/.worktrees/e58fcc4c/eval/tasks/002-each-day/verify.mjs +0 -31
  1082. package/.worktrees/e58fcc4c/eval/tasks/003-word-report/files/data/notes.txt +0 -5
  1083. package/.worktrees/e58fcc4c/eval/tasks/003-word-report/files/package.json +0 -6
  1084. package/.worktrees/e58fcc4c/eval/tasks/003-word-report/solution/bin/report.mjs +0 -36
  1085. package/.worktrees/e58fcc4c/eval/tasks/003-word-report/task.json +0 -6
  1086. package/.worktrees/e58fcc4c/eval/tasks/003-word-report/verify.mjs +0 -38
  1087. package/.worktrees/e58fcc4c/logo.jpg +0 -0
  1088. package/.worktrees/e58fcc4c/package-lock.json +0 -977
  1089. package/.worktrees/e58fcc4c/package.json +0 -41
  1090. package/.worktrees/e58fcc4c/packages/dashboard/dist/assets/index-Bq_Z2hne.js +0 -7446
  1091. package/.worktrees/e58fcc4c/packages/dashboard/dist/assets/index-O2W5RV4z.css +0 -1
  1092. package/.worktrees/e58fcc4c/packages/dashboard/dist/favicon.jpg +0 -0
  1093. package/.worktrees/e58fcc4c/packages/dashboard/dist/index.html +0 -16
  1094. package/.worktrees/e58fcc4c/packages/dashboard/dist/logo.jpg +0 -0
  1095. package/.worktrees/e58fcc4c/packages/dashboard/dist/prototype-dashboard.html +0 -836
  1096. package/.worktrees/e58fcc4c/packages/dashboard/dist/prototype-overview.html +0 -256
  1097. package/.worktrees/e58fcc4c/packages/dashboard/package.json +0 -25
  1098. package/.worktrees/e58fcc4c/packages/dashboard/server/executor.js +0 -95
  1099. package/.worktrees/e58fcc4c/packages/dashboard/server/index.js +0 -679
  1100. package/.worktrees/e58fcc4c/packages/dashboard/server/parser.js +0 -526
  1101. package/.worktrees/e58fcc4c/packages/dashboard/server/watcher.js +0 -357
  1102. package/.worktrees/e58fcc4c/src/agent-session-log.js +0 -803
  1103. package/.worktrees/e58fcc4c/src/change-list.js +0 -290
  1104. package/.worktrees/e58fcc4c/src/change-risk-profile.js +0 -339
  1105. package/.worktrees/e58fcc4c/src/check-primitives.js +0 -65
  1106. package/.worktrees/e58fcc4c/src/classify-change.js +0 -109
  1107. package/.worktrees/e58fcc4c/src/commit-suggest.js +0 -202
  1108. package/.worktrees/e58fcc4c/src/config-cat.js +0 -88
  1109. package/.worktrees/e58fcc4c/src/config-schema.js +0 -328
  1110. package/.worktrees/e58fcc4c/src/constants.js +0 -97
  1111. package/.worktrees/e58fcc4c/src/contract-matrix.js +0 -533
  1112. package/.worktrees/e58fcc4c/src/datetime.js +0 -20
  1113. package/.worktrees/e58fcc4c/src/db-engine.js +0 -55
  1114. package/.worktrees/e58fcc4c/src/db.js +0 -381
  1115. package/.worktrees/e58fcc4c/src/decision-distill.js +0 -517
  1116. package/.worktrees/e58fcc4c/src/dispatch/backends/local-agent.js +0 -155
  1117. package/.worktrees/e58fcc4c/src/dispatch/backends/sillyhub-mcp.js +0 -245
  1118. package/.worktrees/e58fcc4c/src/dispatch/probe.js +0 -246
  1119. package/.worktrees/e58fcc4c/src/dispatch/strategy.js +0 -121
  1120. package/.worktrees/e58fcc4c/src/docs-check.js +0 -825
  1121. package/.worktrees/e58fcc4c/src/docs-debt.js +0 -393
  1122. package/.worktrees/e58fcc4c/src/docs-gate.js +0 -107
  1123. package/.worktrees/e58fcc4c/src/doctor-diagnostics.js +0 -1099
  1124. package/.worktrees/e58fcc4c/src/endpoint-extractor.js +0 -409
  1125. package/.worktrees/e58fcc4c/src/foreign-declared.js +0 -155
  1126. package/.worktrees/e58fcc4c/src/fs-atomic.js +0 -73
  1127. package/.worktrees/e58fcc4c/src/git-helper.js +0 -150
  1128. package/.worktrees/e58fcc4c/src/hooks/claude-pre-tool-use.cjs +0 -130
  1129. package/.worktrees/e58fcc4c/src/hooks/worktree-guard.js +0 -892
  1130. package/.worktrees/e58fcc4c/src/index.js +0 -2854
  1131. package/.worktrees/e58fcc4c/src/init.js +0 -626
  1132. package/.worktrees/e58fcc4c/src/knowledge-match.js +0 -231
  1133. package/.worktrees/e58fcc4c/src/local-detect.js +0 -128
  1134. package/.worktrees/e58fcc4c/src/local-register.js +0 -104
  1135. package/.worktrees/e58fcc4c/src/machine-interface.js +0 -543
  1136. package/.worktrees/e58fcc4c/src/migrate.js +0 -127
  1137. package/.worktrees/e58fcc4c/src/module-impact.js +0 -166
  1138. package/.worktrees/e58fcc4c/src/module-resolve.js +0 -222
  1139. package/.worktrees/e58fcc4c/src/modules.js +0 -580
  1140. package/.worktrees/e58fcc4c/src/plan-adopt-waves.js +0 -126
  1141. package/.worktrees/e58fcc4c/src/progress/change-registry.js +0 -336
  1142. package/.worktrees/e58fcc4c/src/progress/consistency-doctor.js +0 -355
  1143. package/.worktrees/e58fcc4c/src/progress/shared.js +0 -36
  1144. package/.worktrees/e58fcc4c/src/progress/stage-machine.js +0 -594
  1145. package/.worktrees/e58fcc4c/src/progress/step-store.js +0 -265
  1146. package/.worktrees/e58fcc4c/src/progress.js +0 -1304
  1147. package/.worktrees/e58fcc4c/src/quick-recommend.js +0 -115
  1148. package/.worktrees/e58fcc4c/src/quicklog.js +0 -883
  1149. package/.worktrees/e58fcc4c/src/review-tier.js +0 -77
  1150. package/.worktrees/e58fcc4c/src/run/command.js +0 -1641
  1151. package/.worktrees/e58fcc4c/src/run/complete-handlers.js +0 -1552
  1152. package/.worktrees/e58fcc4c/src/run/complete.js +0 -1259
  1153. package/.worktrees/e58fcc4c/src/run/concurrent-detect.js +0 -156
  1154. package/.worktrees/e58fcc4c/src/run/gates.js +0 -1111
  1155. package/.worktrees/e58fcc4c/src/run/multi-repo-context.js +0 -208
  1156. package/.worktrees/e58fcc4c/src/run/next.js +0 -128
  1157. package/.worktrees/e58fcc4c/src/run/prompt.js +0 -843
  1158. package/.worktrees/e58fcc4c/src/run/quick-audit.js +0 -186
  1159. package/.worktrees/e58fcc4c/src/run/scan-profile.js +0 -269
  1160. package/.worktrees/e58fcc4c/src/run/shared.js +0 -1562
  1161. package/.worktrees/e58fcc4c/src/run/stage.js +0 -587
  1162. package/.worktrees/e58fcc4c/src/run.js +0 -23
  1163. package/.worktrees/e58fcc4c/src/scan-diff.js +0 -388
  1164. package/.worktrees/e58fcc4c/src/scan-postcheck.js +0 -524
  1165. package/.worktrees/e58fcc4c/src/scan-staleness.js +0 -95
  1166. package/.worktrees/e58fcc4c/src/setup.js +0 -414
  1167. package/.worktrees/e58fcc4c/src/sillyhub-mcp/client.js +0 -597
  1168. package/.worktrees/e58fcc4c/src/sillyhub-mcp/config.js +0 -62
  1169. package/.worktrees/e58fcc4c/src/spec-dir-typo.js +0 -50
  1170. package/.worktrees/e58fcc4c/src/spec-sync.js +0 -358
  1171. package/.worktrees/e58fcc4c/src/stage-contract-engine.js +0 -171
  1172. package/.worktrees/e58fcc4c/src/stage-contract-spec.js +0 -551
  1173. package/.worktrees/e58fcc4c/src/stage-contract.js +0 -948
  1174. package/.worktrees/e58fcc4c/src/stage-review.js +0 -597
  1175. package/.worktrees/e58fcc4c/src/stages/archive.js +0 -199
  1176. package/.worktrees/e58fcc4c/src/stages/brainstorm-auto.js +0 -285
  1177. package/.worktrees/e58fcc4c/src/stages/brainstorm.js +0 -624
  1178. package/.worktrees/e58fcc4c/src/stages/cmd-existence.js +0 -145
  1179. package/.worktrees/e58fcc4c/src/stages/doctor.js +0 -540
  1180. package/.worktrees/e58fcc4c/src/stages/execute.js +0 -1277
  1181. package/.worktrees/e58fcc4c/src/stages/explore.js +0 -43
  1182. package/.worktrees/e58fcc4c/src/stages/index.js +0 -29
  1183. package/.worktrees/e58fcc4c/src/stages/knowledge.js +0 -514
  1184. package/.worktrees/e58fcc4c/src/stages/plan-postcheck.js +0 -1398
  1185. package/.worktrees/e58fcc4c/src/stages/plan.js +0 -655
  1186. package/.worktrees/e58fcc4c/src/stages/quick.js +0 -167
  1187. package/.worktrees/e58fcc4c/src/stages/scan.js +0 -608
  1188. package/.worktrees/e58fcc4c/src/stages/status.js +0 -64
  1189. package/.worktrees/e58fcc4c/src/stages/verify.js +0 -246
  1190. package/.worktrees/e58fcc4c/src/sync.js +0 -1470
  1191. package/.worktrees/e58fcc4c/src/task-review.js +0 -1498
  1192. package/.worktrees/e58fcc4c/src/taskcard-placeholders.js +0 -21
  1193. package/.worktrees/e58fcc4c/src/taskcard.js +0 -250
  1194. package/.worktrees/e58fcc4c/src/verify-postcheck.js +0 -1718
  1195. package/.worktrees/e58fcc4c/src/verify-probes.js +0 -327
  1196. package/.worktrees/e58fcc4c/src/version.js +0 -19
  1197. package/.worktrees/e58fcc4c/src/workflow.js +0 -600
  1198. package/.worktrees/e58fcc4c/src/workspace.js +0 -125
  1199. package/.worktrees/e58fcc4c/src/worktree-apply.js +0 -1611
  1200. package/.worktrees/e58fcc4c/src/worktree-deps.js +0 -668
  1201. package/.worktrees/e58fcc4c/src/worktree.js +0 -1849
  1202. package/.worktrees/e58fcc4c/templates/claude-instruction.md +0 -23
  1203. package/.worktrees/e58fcc4c/templates/prompts/taskcard-rules.md +0 -29
  1204. package/.worktrees/e58fcc4c/templates/prompts/testcase-design.md +0 -12
  1205. package/.worktrees/e58fcc4c/templates/prompts/verify-probes.md +0 -32
  1206. package/.worktrees/e58fcc4c/templates/workflows/archive-impact.yaml +0 -79
  1207. package/.worktrees/e58fcc4c/templates/workflows/scan-docs.yaml +0 -132
@@ -1,1094 +0,0 @@
1
- /**
2
- * run/gates.js(W6 Step4 从 run.js 抽出)。
3
- *
4
- * 阶段完成校验 gate 级联 + execute deps 硬门 + 完成回滚(自洽叶子模块,仅被 completeStep 调用):
5
- * - runStageCompletionGates:runValidators → verify-test 对账 → Plan→Execute contract →
6
- * Stage Review Gate → Execute Task Review Gate,任一失败走 rollbackCompletionAndReturn
7
- * - enforceDepsGate:execute depsStatus 不达标且非 wave 级 opt-out 时阻断 --done(exit 1)
8
- * - rollbackCompletionAndReturn / rollbackStageCompletion:统一回滚 stage/step 状态 + 落盘 + sync
9
- * - isCurrentWaveAllNoDepsVerify:enforceDepsGate 的私有 helper(wave 级 no_deps_verify opt-out 判定)
10
- *
11
- * 安全锚:run.js 始终 barrel。enforceDepsGate + runStageCompletionGates 由 run.js import 回来;
12
- * 无 test 直接 import(与 parsePorcelainPath/applyRootPlaceholders 不同),无需 barrel re-export。
13
- * completeStep(Step7 搬)将把这行 import 一起带走。
14
- *
15
- * 路径修正(相对 src/run/):
16
- * - triggerSync/resolveChangeDir 从 './shared.js';runValidators 从 '../stage-contract.js'
17
- * - 动态 import ./worktree.js / ./verify-postcheck.js / ./stages/execute.js / ./review-tier.js /
18
- * ./stage-review.js / ./task-review.js → '../X.js'(src/ 下,退一层;真环依赖保留动态)
19
- *
20
- * 不搬:ensureDepsFreshness(execute 入口 deps 自检,调用方 runStage 非 completeStep,归属未来 execute-handler)
21
- */
22
- import { basename, join, relative, dirname } from 'node:path'
23
- import { createHash } from 'node:crypto'
24
- import { existsSync, readFileSync, readdirSync, statSync, mkdirSync, unlinkSync, writeFileSync } from 'node:fs'
25
- import { writeAtomicSync } from '../fs-atomic.js'
26
- import { triggerSync, resolveChangeDir, resolveRuntimeRoot } from './shared.js'
27
- import { runValidators } from '../stage-contract.js'
28
- import { handleScanStageCompleted, handleExecuteWorktreeCleanup } from './complete-handlers.js'
29
- import { detectConcurrentChanges, formatConcurrentWarning } from './concurrent-detect.js'
30
- import { stageRegistry } from '../stages/index.js'
31
- import { normalizeTaskId } from '../taskcard.js'
32
-
33
- /**
34
- * 从任务注册表(tasks.md)提取全部 task id(task-XX)——符号影响面覆盖度校验用。
35
- * 只认 checkbox 行 `- [ ] task-XX:` / `- [x] task-XX:`(与 execute.js parseTaskRegistry 同口径)。
36
- * 2026-08-20-task-truth-unify:源从 plan.md 迁 tasks.md(任务唯一真相);ql-xxx 行不收。
37
- */
38
- function extractTaskIdsFromRegistry(tasksContent) {
39
- if (!tasksContent) return []
40
- return [...String(tasksContent).matchAll(/^[-*]\s*\[[ xX]\]\s*task-(\d+)\b/gim)]
41
- .map(m => `task-${m[1].padStart(2, '0')}`)
42
- }
43
-
44
- /**
45
- * 符号影响面报告结构校验(纯函数):execute「加载上下文」步的产出落盘核验。
46
- *
47
- * 治 persuasion-only 失效现场(ql-20260816-005-3d7f):execute 前缀 4 步无任何 gate,agent 可
48
- * <1s 连发 4 次 --done 盖章跳过,「符号影响面扫描」(execute.js 操作 11)被一句「上下文在会话内」
49
- * 带过(输出契约只写「上下文摘要」,操作与输出脱节)。修法 = 报告落盘
50
- * {SPEC_ROOT}/changes/<change>/symbol-impact.md + 本函数校验:plan.md 每个 task-XX 在报告中出现
51
- * (逐 task 结论,「无签名级变更」也要显式写,治整体一句话带过)。语义质量(调用点找没找全)
52
- * 仍归 agent,CLI 只核结构覆盖度——符合债单「persuasion-only → 补最小硬门」原则。
53
- *
54
- * @param {{reportContent: string|null, planContent: string|null}} params
55
- * @returns {{ok: boolean, errors: string[]}}
56
- */
57
- export function validateSymbolImpactReport({ reportContent, planContent }) {
58
- const errors = []
59
- if (!reportContent || !String(reportContent).trim()) {
60
- return { ok: false, errors: ['symbol-impact.md 不存在或内容为空——「加载上下文」步的符号影响面报告必须落盘(逐 task 一行结论,「无签名级变更」也要显式写)'] }
61
- }
62
- // 2026-08-20-task-truth-unify:task 清单源迁 tasks.md(参数名 planContent 保持兼容既有调用,
63
- // 语义=任务注册表内容;调用方 enforceSymbolImpactGate 已改读 tasks.md)
64
- const taskIds = extractTaskIdsFromRegistry(planContent)
65
- if (taskIds.length === 0) return { ok: true, errors } // 注册表无 task 可列(默认兜底形态)→ 无可校验对象
66
- const missing = taskIds.filter(id => !String(reportContent).includes(id))
67
- for (const id of missing) {
68
- errors.push(`${id} 未在 symbol-impact.md 中出现——每个 task 都要有一行结论(含「无签名级变更」的显式声明)`)
69
- }
70
- // 防骨架直接过门(2026-08-21 agent-手工产出审计项⑤):CLI 会代生成逐 task TODO 骨架
71
- //(generateSymbolImpactSkeleton),占位未替换即拦——骨架消灭的是「从零手写/漏 task」错误面,
72
- // 不是把「逐 task 结论」本身变成走过场。
73
- const report = String(reportContent)
74
- const todoPending = taskIds.filter(id => new RegExp(`^[-*]\\s*${id}[^\\n]*<!--TODO-->`, 'm').test(report))
75
- for (const id of todoPending) {
76
- errors.push(`${id} 的结论仍是骨架 <!--TODO--> 占位——替换为真实结论(无签名级变更也显式写「无」)`)
77
- }
78
- return { ok: errors.length === 0, errors }
79
- }
80
-
81
- /**
82
- * 生成 symbol-impact.md 逐 task TODO 骨架(2026-08-21 审计项⑤「报错即生成」)。
83
- *
84
- * gate 此前只报错不代填 → agent 从零手写整份报告,忘一个 task 就被拦、再补再撞。
85
- * 骨架从 tasks.md 注册表生成逐 task 占位行,agent 只需逐行填结论;占位 <!--TODO-->
86
- * 由 validateSymbolImpactReport 拒绝,骨架不能直接过门(防偷懒)。
87
- *
88
- * @param {string} tasksContent - 任务注册表(tasks.md,回退 plan.md)内容
89
- * @returns {string|null} 骨架全文(LF);注册表无 task 行 → null
90
- */
91
- export function generateSymbolImpactSkeleton(tasksContent) {
92
- const taskIds = extractTaskIdsFromRegistry(tasksContent)
93
- if (taskIds.length === 0) return null
94
- // tasks.md 内容指纹(token 成本优化 P2a):中断续跑/阶段重开时若指纹一致且结论完整,
95
- // 「加载上下文」步按 prompt 指引直接沿用既有报告,不重做调用点扫描(team-session-unify
96
- // 实测该步 3h06min,重入重做是纯浪费)。指纹只作提示锚,gate 校验逻辑不变。
97
- let fingerprint = ''
98
- try {
99
- fingerprint = createHash('sha256').update(String(tasksContent)).digest('hex').slice(0, 16)
100
- } catch { /* 指纹失败不阻断骨架生成 */ }
101
- const lines = [
102
- '# 符号影响面报告',
103
- '',
104
- `> tasks.md 内容指纹(生成时): ${fingerprint}——重入本步时若与当前 tasks.md 指纹一致且结论已填全,直接沿用不重做扫描。`,
105
- '> 骨架由 CLI 生成(`sillyspec symbol-impact --change <变更名>`,gate 失败时也会自动落一份)。',
106
- '> 逐行把 `<!--TODO-->` 替换为真实结论:涉及签名级变更(构造函数参数/接口/DTO/方法签名增删改)',
107
- '> 写变更类型 + 受影响调用点 + 是否在任务范围内;无签名级变更也要显式写「无签名级变更」。',
108
- '> **gate 拒绝仍含 <!--TODO--> 的行**——骨架不能直接过门。',
109
- '',
110
- ]
111
- for (const id of taskIds) lines.push(`- ${id}: <!--TODO-->`)
112
- return lines.join('\n') + '\n'
113
- }
114
-
115
- /**
116
- * 符号影响面报告硬门:execute「加载上下文」步 --done 时校验 symbol-impact.md 落盘 + task 覆盖度。
117
- * fail-closed:不通过 → exit 1(进度不推进;步骤状态保持 pending,无 steps 句柄不标 blocked)。
118
- * 非目标步骤/阶段直接放行。
119
- */
120
- export async function enforceSymbolImpactGate(stageName, changeName, currentStepName, specBase) {
121
- if (stageName !== 'execute') return
122
- if (!currentStepName || !currentStepName.includes('加载上下文')) return
123
- const tasksPath = join(specBase, 'changes', changeName || '', 'tasks.md')
124
- const reportPath = join(specBase, 'changes', changeName || '', 'symbol-impact.md')
125
- if (!existsSync(tasksPath)) return // 注册表缺失场景已有 plan 阶段 gate 把关,此处不重复拦
126
- let tasksContent = ''
127
- try { tasksContent = readFileSync(tasksPath, 'utf8') } catch { return }
128
- let reportContent = null
129
- try { reportContent = readFileSync(reportPath, 'utf8') } catch { /* 缺失由 validate 报 */ }
130
- const result = validateSymbolImpactReport({ reportContent, planContent: tasksContent })
131
- if (result.ok) return
132
- console.error('❌ ── 符号影响面报告校验阻断(本次 --done 未完成,进度未推进)──')
133
- console.error(` 「加载上下文」步的符号影响面检查报告未落盘或不完整:`)
134
- console.error(` 期望路径:${reportPath}`)
135
- for (const e of result.errors) console.error(` • ${e}`)
136
- // 报错即生成(2026-08-21 审计项⑤):报告缺失时自动落一份逐 task TODO 骨架,agent 从
137
- // 「从零手写整份」变「逐行填结论」;TODO 占位由 validate 拒绝,骨架不能直接过门。
138
- let skeletonNote = ''
139
- if (!existsSync(reportPath)) {
140
- const skeleton = generateSymbolImpactSkeleton(tasksContent)
141
- if (skeleton) {
142
- try {
143
- writeAtomicSync(reportPath, skeleton)
144
- skeletonNote = `\n 📄 已代生成逐 task 骨架:${reportPath}(逐行替换 <!--TODO--> 为结论,无签名级变更也显式写「无」)`
145
- } catch { /* 写失败只影响提示,不掩盖原始错误 */ }
146
- }
147
- }
148
- console.error(` 修复:按「加载上下文」步操作 11 完成符号影响面扫描,逐 task 写结论后重跑 execute --done。${skeletonNote}`)
149
- process.exit(1)
150
- }
151
-
152
- /**
153
- * UI 原型软提醒(非阻断):brainstorm「生成规范文件」步 --done 时,design.md 命中前端文件
154
- * 但变更目录无 prototype-*.html → console.warn 一行,用户可否决。程度判断(布局级才必须出)
155
- * 是语义判断,CLI 不硬卡只提示——治 agent 对明显 UI 改造静默跳过原型的坑。
156
- */
157
- export function warnMissingUiPrototype(stageName, changeName, currentStepName, specBase) {
158
- if (stageName !== 'brainstorm' || !currentStepName || !currentStepName.includes('生成规范文件')) return
159
- if (!changeName || !specBase) return
160
- const changeDir = join(specBase, 'changes', changeName)
161
- const designPath = join(changeDir, 'design.md')
162
- if (!existsSync(designPath)) return
163
- try {
164
- if (readdirSync(changeDir).some(f => /^prototype-.*\.html$/i.test(f))) return
165
- } catch { return } // 目录不可读(平台模式 specRoot 差异等)→ 静默跳过,不制造噪音
166
- const design = readFileSync(designPath, 'utf8')
167
- const feExts = [...new Set((design.match(/\.(vue|svelte|astro|tsx|jsx|css|scss|sass|less|styl|html)\b/gi) || []).map(s => s.replace('.', '').toLowerCase()))]
168
- if (feExts.length === 0) return
169
- console.warn(` ⚠️ design.md 命中前端文件类型(${feExts.join('/')})但变更目录无 prototype-*.html——轻微样式改动可忽略;布局/交互流程级变化应补原型(sillyspec run brainstorm --reopen 回到「分段展示设计」,或直接让 agent 补生成)`)
170
- }
171
-
172
- /**
173
- * 判断当前 execute step 所在 wave 是否全部 task 都声明 no_deps_verify: true(D-006@v2)。
174
- * 仅 wave 执行步骤(名如 "Wave N 执行")可 opt-out;非 wave 步骤恒返回 false(保守过门)。
175
- */
176
- function isCurrentWaveAllNoDepsVerify(stepName, changeDir) {
177
- if (!stepName) return false
178
- const m = String(stepName).match(/^Wave\s+(\d+)/i)
179
- if (!m) return false
180
- const waveN = parseInt(m[1], 10)
181
- if (!changeDir) return false
182
- const planPath = join(changeDir, 'plan.md')
183
- if (!existsSync(planPath)) return false
184
- const plan = readFileSync(planPath, 'utf8')
185
- const waveRe = new RegExp(`^##\\s*Wave\\s+${waveN}\\b[^\\n]*\\n([\\s\\S]*?)(?=\\n##\\s|\\n#\\s|$)`, 'm')
186
- const waveMatch = plan.match(waveRe)
187
- if (!waveMatch) return false
188
- // 2026-08-20-task-truth-unify:Wave 段任务为纯 ID 引用行("- task-XX"),不再有 checkbox
189
- const taskIds = [...waveMatch[1].matchAll(/^[-*]\s+(task-\d+)\s*$/gim)].map(x => x[1])
190
- if (taskIds.length === 0) return false
191
- for (const id of taskIds) {
192
- // 体检 BUG-19:plan 常态写补零 task-01,但 AI 写出 task-3 时卡片实际是 task-03.md——
193
- // 未归一则 existsSync 恒 false,wave 级 no_deps_verify 豁免静默失效(保守方向)
194
- const cardPath = join(changeDir, 'tasks', `${normalizeTaskId(id)}.md`)
195
- if (!existsSync(cardPath)) return false // 卡片缺失 → 保守不跳
196
- const card = readFileSync(cardPath, 'utf8')
197
- const fm = card.match(/^---\n([\s\S]*?)\n---/)
198
- if (!fm) return false
199
- if (!/no_deps_verify:\s*true/i.test(fm[1])) return false
200
- }
201
- return true
202
- }
203
-
204
- /**
205
- * doctor --align-execute-progress --confirm 的前置 review 门(坑 doctor-align-bypass-review-gate,
206
- * 2026-08-20 实证):alignExecuteToPlan 直写 completed「绕过 completeStep 推导」,此前 execute 的
207
- * Stage Review Gate 与 Task Review Gate 被整体跳过——而 worktree 清理后的恢复场景恰是最需要
208
- * review 审计的时刻(实证靠 15 份 task review + verify 全程补足覆盖才没出事)。
209
- *
210
- * 本函数供 CLI 层(index.js doctor align 分支)在 confirm 落盘前调用,跑与正常完成路径同源的
211
- * 只读校验(不自动生成 marker/runId——恢复读场景缺失就是缺失,如实报告):
212
- * 1. Stage Review:tier=independent 时须存在有效 execute stage review.json(verdict 非 fail);
213
- * tier=self 放行(与正常 gate 分级一致)。
214
- * 2. Task Review:所有 task 的 review.json 齐备且 verdict 非 fail(runId 解析同 Task Review Gate:
215
- * marker → 含 tasks/ 目录扫描;不 generate)。
216
- *
217
- * @param {{ cwd: string, changeName: string, specBase: string, platformOpts?: object }} opts
218
- * @returns {Promise<boolean>} true=被门阻断(CLI 应放弃 align 并 exit 1);false=校验通过可继续
219
- */
220
- export async function enforceAlignExecuteReviewGate({ cwd, changeName, specBase, platformOpts = {} }) {
221
- const effectiveSpecBase = platformOpts?.specRoot || specBase
222
- const runtimeRoot = resolveRuntimeRoot(platformOpts, effectiveSpecBase)
223
- const reviewChangeDir = resolveChangeDir(cwd, { currentChange: changeName }, platformOpts?.specRoot || null)
224
- const blocked = (msgs) => {
225
- console.error('\n❌ doctor --align-execute-progress 前置 review 校验未过——execute 完成审计不能绕过:')
226
- for (const m of msgs) console.error(' - ' + m)
227
- console.error(' 解法:补齐上述 review 后重跑 align(stage review:sillyspec register-stage-review --change ' + changeName + ' --stage execute;task review:按报错路径补 review.json)')
228
- return true
229
- }
230
-
231
- // 1. Stage Review(tier 分级同正常 gate)
232
- try {
233
- const { classifyReviewTier } = await import('../review-tier.js')
234
- const { validateStageReview, getLatestStageReviewRunId, printStageReviewResult } = await import('../stage-review.js')
235
- const designPath = reviewChangeDir ? join(reviewChangeDir, 'design.md') : null
236
- let planLevel = null
237
- if (reviewChangeDir) {
238
- const planPath = join(reviewChangeDir, 'plan.md')
239
- if (existsSync(planPath)) {
240
- const fmLine = readFileSync(planPath, 'utf8').split('\n').find(l => l.trim().startsWith('plan_level:'))
241
- if (fmLine) planLevel = fmLine.split(':')[1].trim()
242
- }
243
- }
244
- const tier = classifyReviewTier({ planLevel, designPath })
245
- if (tier.tier === 'self') {
246
- console.log('ℹ️ Stage Review: execute tier=self(' + tier.reason + '),align 前置门放行(不强制独立审查)')
247
- } else {
248
- // 只读解析(不 generate/写 marker):恢复场景下缺失即缺失
249
- const reviewRunId = getLatestStageReviewRunId(runtimeRoot, 'execute', changeName)
250
- if (!reviewRunId) {
251
- return blocked(['execute stage review runId 无法定位(marker 缺失且 stage-reviews/ 无含 review 的 run 目录)'])
252
- }
253
- const searchDirs = [effectiveSpecBase, reviewChangeDir, cwd].filter(Boolean)
254
- const reviewResult = validateStageReview({ stage: 'execute', reviewType: 'acceptance', runtimeRoot, reviewRunId, searchDirs })
255
- printStageReviewResult(reviewResult, { stage: 'execute', reviewRunId, runtimeRoot, changeName })
256
- if (!reviewResult.ok) return true // printStageReviewResult 已给明细,不再重复列
257
- }
258
- } catch (e) {
259
- // fail-closed:门自身异常阻断 align(与正常 gate 一致),不静默放行
260
- console.error('❌ align 前置 Stage Review 校验异常,阻断对齐: ' + e.message)
261
- return true
262
- }
263
-
264
- // 2. Task Review(runId 只读解析:marker → 含 tasks/ 扫描;不 generate)
265
- try {
266
- const { validateTaskReviews, printReviewResult, resolveLatestExecuteRunIdWithTasks, isValidExecuteRunId } = await import('../task-review.js')
267
- const planPath = reviewChangeDir ? join(reviewChangeDir, 'plan.md') : null
268
- if (!planPath || !existsSync(planPath)) {
269
- return blocked(['plan.md 不存在,Task Review 无从校验(align 的 checkbox 判定依赖同目录,疑似路径解析异常)'])
270
- }
271
- const planContent = readFileSync(planPath, 'utf8')
272
- const runIdFile = join(runtimeRoot, `current-execute-run-id-${changeName}`)
273
- let executeRunId = ''
274
- try {
275
- if (existsSync(runIdFile)) {
276
- const c = readFileSync(runIdFile, 'utf8').trim()
277
- if (c && isValidExecuteRunId(c)) executeRunId = c
278
- }
279
- } catch {}
280
- if (!executeRunId) {
281
- executeRunId = resolveLatestExecuteRunIdWithTasks({ runtimeRoot, changeName }) || ''
282
- }
283
- if (!executeRunId) {
284
- return blocked(['execute runId 无法定位(marker 缺失且 execute-runs/ 无含 review 的 run 目录)——15/N 份 task review 所在 run 不可寻,无法对账'])
285
- }
286
- const reviewResult = validateTaskReviews({ planContent, runtimeRoot, executeRunId, changeDir: reviewChangeDir, gitDir: cwd })
287
- printReviewResult(reviewResult, { runtimeRoot, executeRunId })
288
- if (!reviewResult.ok) return true // 报错明细已在 printReviewResult 输出
289
- console.log('✅ align 前置 review 校验通过(stage review + task review 均齐备),继续对齐')
290
- } catch (e) {
291
- console.error('❌ align 前置 Task Review 校验异常,阻断对齐: ' + e.message)
292
- return true
293
- }
294
- return false
295
- }
296
-
297
- /**
298
- * execute deps 验证硬门(change 2026-06-28-worktree-deps-provision / D-001@v1, D-003@v1, D-006@v2)。
299
- * depsStatus 不达标且非 wave 级 opt-out 时阻断 --done:置 step=blocked + exit(1),与 requiresWait 同范式。
300
- * 放行返回 true;阻断时经 persist 回调落盘 blocked 后 exit(1)(此前只改内存不落库,
301
- * progress show/doctor 看到的仍是 pending,与 docstring 承诺不符、误导诊断)。
302
- */
303
- export async function enforceDepsGate(stageName, cwd, changeName, step, steps, currentIdx, specBase, platformOpts, persist) {
304
- if (stageName !== 'execute') return true
305
- let meta = null
306
- let wm = null
307
- try {
308
- const { WorktreeManager } = await import('../worktree.js')
309
- wm = new WorktreeManager({ cwd })
310
- meta = wm.getMeta(changeName)
311
- } catch (e) {
312
- // WorktreeManager 构造/读取失败(git 不可用 / worktree 元数据损坏)不阻断 deps gate;
313
- // 下游已有物理目录存在性判定兜底(G2/R3),这里 warn 留下根因线索,避免静默误诊。
314
- console.warn(`⚠️ worktree meta 读取失败(deps gate 将走物理目录判定): ${e.message}`)
315
- }
316
- const depsStatus = meta?.depsStatus
317
- if (['linked', 'installed', 'n/a'].includes(depsStatus)) return true
318
- const changeDir = changeName ? join(specBase, 'changes', changeName) : null
319
- if (isCurrentWaveAllNoDepsVerify(step?.name, changeDir)) return true
320
- if (steps && steps[currentIdx]) steps[currentIdx].status = 'blocked'
321
- // ── 诊断分支(Phase 2,G2/R3 修正:判定基于物理目录而非 !meta)──
322
- // getMeta 对"目录不存在"与"meta 损坏"都返回 null,后者会误判终态 → 用物理目录存在性判定。
323
- let worktreeGone = true
324
- try {
325
- worktreeGone = !!(wm && changeName) && !existsSync(wm.getWorktreePath(changeName))
326
- } catch {}
327
- // ── fail-loud 块(Phase 3,D-005@v1:仅改拒绝侧 stderr)──
328
- console.error('❌ ── deps 门控阻断(本次 --done 未完成,进度未推进)──')
329
- if (worktreeGone) {
330
- console.error(' worktree 不可用(已 cleanup 或目录不存在)。')
331
- console.error(` 修复:sillyspec doctor --align-execute-progress${changeName ? ` --change ${changeName}` : ''} 按 plan.md 对齐进度`)
332
- console.error(` 或: sillyspec worktree create ${changeName || '<change>'} 重建 worktree 继续跑`)
333
- } else {
334
- console.error(` 原因:依赖未就绪(depsStatus=${depsStatus || 'unknown'}),不得在无构建/测试能力时声称完成。`)
335
- console.error(` 修复:sillyspec worktree doctor --fix${changeName ? ` --change ${changeName}` : ''}`)
336
- console.error(' 或在 worktree 内手动安装依赖后重试。')
337
- if (meta?.depsError) console.error(` 上次供给错误:${meta.depsError}`)
338
- }
339
- if (persist) { try { await persist() } catch { /* 落盘失败不吞阻断语义 */ } }
340
- process.exit(1)
341
- }
342
-
343
- /**
344
- * execute --done 硬门:已勾 [x] task 的 review.json 必须 schema 完整(坑 review-json-field-gap)。
345
- *
346
- * Task Review Gate(validateTaskReviews)只在 execute 整阶段完成时跑(complete.js 阶段完成分支的
347
- * actualCompleted===actualTotal 守卫),单 task --done 不校验 → 子代理勾 checkbox 却漏写/漏字段
348
- * review.json,要到收尾才暴露,用户被迫事后批量补。本门提前到每次 --done:校验 plan 里所有已勾
349
- * task 的 review.json,缺字段/不存在/JSON 坏 → 置 step=blocked + exit(1),与 enforceDepsGate 同范式
350
- * (阻断前经 persist 回调落盘 blocked)。
351
- * 未勾 task 不校验(还没做)。平台模式/无 marker/无 plan 时放行(下游 Task Review Gate 兜底)。
352
- */
353
- export async function enforceReviewJsonGate(stageName, cwd, changeName, step, steps, currentIdx, specBase, platformOpts, persist) {
354
- if (stageName !== 'execute' || !changeName) return true
355
- // head 锡点自动落盘(2026-08-21 审计项③,D-010 补对称):跨仓 task base_commit 已在派发时
356
- // CLI 落盘,head_commit 此前靠主 agent 按 prompt 手跑 rev-parse 手写(漏抄/抄错炸 review gate)。
357
- // 每次 --done 时机幂等补齐(已存在不覆盖)。best-effort:失败只 warn,不阻断 --done 主流程。
358
- try {
359
- const { stampCrossRepoHeadCommits } = await import('../stages/execute.js')
360
- const stamped = await stampCrossRepoHeadCommits({ changeName, cwd, specBase, platformOpts })
361
- if (stamped && stamped.stamped > 0) {
362
- console.log(`📌 已自动落盘跨仓 task head_commit 锡点:${stamped.stampedTasks.join(', ')}(幂等,此后 --done 不再重复写)`)
363
- }
364
- } catch (e) {
365
- console.warn(`⚠️ head_commit 锡点自动落盘失败(降级留给 agent 手写): ${e.message}`)
366
- }
367
- const runtimeRoot = resolveRuntimeRoot(platformOpts, specBase)
368
- const runIdFile = join(runtimeRoot, `current-execute-run-id-${changeName}`)
369
- const planPath = join(specBase, 'changes', changeName, 'plan.md')
370
- if (!existsSync(runIdFile) || !existsSync(planPath)) return true
371
- const { validateCheckedTaskReviews, resolveLatestExecuteRunIdWithTasks, isValidExecuteRunId } = await import('../task-review.js')
372
- // existsSync 与 read 之间 marker 可能被并发 cleanup/归档删除(多 agent 场景):读失败按
373
- //「marker 缺失」处理,走漂移兜底重定位,不让 ENOENT 冒成顶层 stack(与 :426-435 口径对齐)
374
- let executeRunId = ''
375
- try {
376
- executeRunId = readFileSync(runIdFile, 'utf8').trim()
377
- } catch {
378
- console.warn('⚠️ execute run marker 读取失败(可能被并发清理),改扫真实 run 目录')
379
- executeRunId = resolveLatestExecuteRunIdWithTasks({ runtimeRoot, changeName }) || ''
380
- }
381
- // marker 是 agent 可写内容:格式校验防注入/穿越,非法视为缺失走漂移兜底重定位
382
- if (executeRunId && !isValidExecuteRunId(executeRunId)) {
383
- console.warn(`⚠️ execute run marker 内容非法(期望 exec-YYYY-MM-DD-HHMMSS,实得 ${JSON.stringify(executeRunId.slice(0, 60))}),改扫真实 run 目录`)
384
- executeRunId = ''
385
- }
386
- // 2026-08-20-task-truth-unify:已勾 task 清单源迁 tasks.md(勾选唯一落点);tasks.md 缺失
387
- // 回退 planPath 内容(旧变更兼容读侧)。planPath 存在性已在上方把关。
388
- const tasksRegistryPath = join(specBase, 'changes', changeName, 'tasks.md')
389
- const planContent = existsSync(tasksRegistryPath)
390
- ? readFileSync(tasksRegistryPath, 'utf8')
391
- : readFileSync(planPath, 'utf8')
392
- // marker 读失败且重定位无果(无任何含 tasks/ 的 run):无 run 可校验,放行(下游 Task Review Gate 兜底)
393
- if (!executeRunId) return true
394
- // marker 漂移兜底(gate-atom-a 正确修法):marker 指向的 run 缺 tasks/(generateExecuteRunId 只写
395
- // marker 不建目录,漂移后新 run 不继承旧 review)时,无视 marker 改扫 execute-runs/ 取 mtime 最新
396
- // 且真正含 tasks/ 的 run,用其齐备的 review.json 校验,避免误报「review.json 不存在」。注意不能用
397
- // resolveLatestExecuteRunId——它见 marker 非空即原样返回(不校验目录),恰是本场景要绕开的值。
398
- if (executeRunId && !existsSync(join(runtimeRoot, 'execute-runs', executeRunId, 'tasks'))) {
399
- const relocated = resolveLatestExecuteRunIdWithTasks({ runtimeRoot, changeName })
400
- if (relocated && relocated !== executeRunId) {
401
- console.warn(`⚠️ execute run marker 漂移:${executeRunId} 无 tasks/,改用真实含 review 的 run ${relocated}`)
402
- executeRunId = relocated
403
- }
404
- }
405
- const result = validateCheckedTaskReviews({ planContent, runtimeRoot, executeRunId })
406
- if (result.ok) return true
407
- if (steps && steps[currentIdx]) steps[currentIdx].status = 'blocked'
408
- console.error('❌ ── review.json 字段校验阻断(本次 --done 未完成,进度未推进)──')
409
- console.error(' 已勾选 [x] 的 task review.json 不完整(铁律:勾 checkbox 前必须先写完整 review.json):')
410
- for (const f of result.failures) {
411
- const kindLabel = f.kind === 'missing' ? 'review.json 不存在' : (f.kind === 'parseError' ? 'JSON 解析失败' : '字段缺失')
412
- console.error(` • ${f.taskId}(${kindLabel}): ${f.reviewPath}`)
413
- for (const e of f.errors) console.error(` - ${e}`)
414
- }
415
- console.error(' 修复:mechanics 字段(base/head/changedFiles/schemaVersion)缺错可跑 sillyspec backfill-reviews --change ' + changeName + ' --adopt 一键代填(verdict 保留);verdict/证据缺失需人工补全后重跑 execute --done。')
416
- if (persist) { try { await persist() } catch { /* 落盘失败不吞阻断语义 */ } }
417
- process.exit(1)
418
- }
419
-
420
- /**
421
- * 阶段完成校验失败时回滚状态。
422
- *
423
- * completeStep 在跑 validator 之前就把 stageData.status 写成 'completed',
424
- * 若校验失败不回滚,DB 会与真实产物不一致(hook/doctor/下游阶段全部误判),
425
- * 且所有步骤都是 completed 时 agent 无法重新 --done("没有待完成的步骤")。
426
- * 此处将 stage 回滚为 in-progress,最后一步重置为 pending,供修复产物后重做。
427
- */
428
- function rollbackStageCompletion(stageData, steps, currentIdx) {
429
- // 辅助阶段在 validator 前已被重置为 pending(steps 也换成了新数组),不要覆盖
430
- if (stageData.status === 'completed') {
431
- stageData.status = 'in-progress'
432
- stageData.completedAt = null
433
- }
434
- if (steps[currentIdx] && steps[currentIdx].status === 'completed') {
435
- steps[currentIdx].status = 'pending'
436
- steps[currentIdx].completedAt = null
437
- }
438
- }
439
-
440
- /**
441
- * 阶段完成校验失败后的统一收尾:回滚 stage/step 状态 + 落盘 + sync + 返回「未完成」。
442
- *
443
- * completeStep 的各 gate(runValidators / verify-test 对账 / plan→execute contract /
444
- * Stage Review / Execute Task Review)失败时都走这套动作;原先每个失败分支手写重复
445
- * ~7 次(含 lastActive 落盘 + triggerSync + return 结构),统一进来消坑,避免某分支
446
- * 漏写 triggerSync / 写错 return 结构导致行为分裂。返回 nextPendingIdx=currentIdx,
447
- * 让上层走「完成但不推进」分支,--done 被拒、agent 修复产物后重跑。
448
- */
449
- function rollbackCompletionAndReturn(pm, progress, stageData, steps, currentIdx, cwd, changeName, platformOpts) {
450
- rollbackStageCompletion(stageData, steps, currentIdx)
451
- progress.lastActive = new Date().toLocaleString('zh-CN', { hour12: false })
452
- pm._write(cwd, progress, changeName)
453
- triggerSync(cwd, changeName, platformOpts)
454
- return { stageCompleted: false, currentIdx, nextPendingIdx: currentIdx }
455
- }
456
- /**
457
- * 阶段完成校验 gate 级联(从 completeStep 抽出,行为保持)。仅当所有步骤确实标记为 completed 时
458
- * 由 completeStep 调用。顺序:runValidators → verify-test 对账 → Plan→Execute contract →
459
- * Stage Review Gate → Execute Task Review Gate。任一 gate 失败 → rollbackCompletionAndReturn
460
- * (统一回滚 + 返回 early-return 对象);全部通过 → 返回 null(completeStep 继续收尾)。
461
- *
462
- * @returns {{stageCompleted:false,currentIdx,nextPendingIdx:number}|null}
463
- */
464
- export async function runStageCompletionGates({ stageName, cwd, changeName, platformOpts, specBase, progress, pm, stageData, steps, currentIdx, ctx = null }) {
465
- const projectName = progress.project || basename(cwd)
466
- // decisions.md header 自动补齐(坑 decisions-header-late-warning,2026-08-24 用户反馈二期):
467
- // brainstorm step8 旧模板自带无 frontmatter 的 decisions 样例,存量变更照抄必缺 author/created_at,
468
- // 拖到平台同步/后续环节才提示。gate 前幂等补机械字段(先例:autoCheckPlanFromReviews 同层写
469
- // tasks.md),validator 读到的即已补齐版——补的是 CLI 可自证的机械字段,不替 agent 产出语义内容。
470
- if (['brainstorm', 'plan', 'verify'].includes(stageName) && changeName) {
471
- try {
472
- const { ensureDecisionDocHeader } = await import('../stage-contract.js')
473
- ensureDecisionDocHeader(resolveChangeDir(cwd, changeName, platformOpts?.specRoot))
474
- } catch { /* 补齐失败不阻断 gate */ }
475
- }
476
- const contractResult = runValidators(stageName, cwd, changeName, { projectName, specRoot: platformOpts?.specRoot })
477
- if (contractResult.errors.length > 0) {
478
- console.error(`\n❌ 阶段 ${stageName} 校验失败:`)
479
- for (const err of contractResult.errors) {
480
- console.error(` - ${err}`)
481
- }
482
- // 出路提示常放在 warnings(如「写明不改理由即可豁免」),此处即将阻断 return,
483
- // 必须一并打出,否则 agent 只看到症状看不到怎么过。
484
- for (const w of (contractResult.warnings || [])) {
485
- console.error(` · ${w}`)
486
- }
487
- console.error(`\n 提示:修复缺失产物后重新完成此步骤(--skip-approval 只跳过阶段转换/审批检查,不能跳过产物校验)`)
488
- // 产物校验失败必须阻断完成 —— 否则 validator 形同虚设,
489
- // verify 会带着 FAIL/缺 verify-result.md 被 ✅ 标记完成(历史教训)。
490
- // plan/execute 的专项契约校验(下方)在产物齐全后才需要继续跑,故此处先 return。
491
- return await rollbackCompletionAndReturn(pm, progress, stageData, steps, currentIdx, cwd, changeName, platformOpts)
492
- }
493
- if (contractResult.warnings.length > 0) {
494
- console.warn(`\n⚠️ 阶段 ${stageName} 校验警告:`)
495
- for (const w of contractResult.warnings) {
496
- console.warn(` - ${w}`)
497
- }
498
- }
499
-
500
- // verify 产物校验通过 + 结论非 FAIL(否则上面已阻断)。
501
- // 再由 CLI 亲自执行 local.yaml 的测试命令,与 verify-result.md 的自报告对账:
502
- // 自报告 PASS 但实测失败 → 阻断(防止"文案通过"绕过验证)。
503
- if (stageName === 'verify') {
504
- const { runVerifyTestCheck, printVerifyTestCheck } = await import('../verify-postcheck.js')
505
- // 测试实测是同步 execSync,长套件可跑 2~10min 且中途无输出——先预告避免 agent 误判卡死
506
- console.log(`\n⏳ Verify 测试对账:CLI 亲自执行 local.yaml 的 commands.test(同步,耗时可能较长,请等待…)`)
507
- const testCheck = runVerifyTestCheck({ cwd, specBase, changeName, ctx })
508
- printVerifyTestCheck(testCheck)
509
- if (testCheck.status === 'failed') {
510
- console.error('\n❌ verify 阶段被阻断:verify-result.md 自报告通过,但 CLI 实测测试失败。')
511
- // 并行 WIP 归因鉴别(坑 verify-reconcile-foreign-wip):实测跑在主仓共享工作区,并行会话
512
- // 在途 WIP 物理在场——他者文件命中声明集时提示复验归因(EADDRINUSE 鉴别同款风格),不静默背锅。
513
- try {
514
- const { collectForeignDeclaredFiles } = await import('../verify-postcheck.js')
515
- const { gitQuiet } = await import('../git-helper.js')
516
- const foreignMap = collectForeignDeclaredFiles(cwd, changeName)
517
- if (foreignMap.size > 0) {
518
- const dirty = (gitQuiet(cwd, ['diff', '--name-only', 'HEAD']) || '')
519
- .split('\n').filter(Boolean).map(f => f.replace(/\\/g, '/'))
520
- const hitForeign = dirty.filter(f => foreignMap.has(f))
521
- if (hitForeign.length > 0) {
522
- console.error(` ℹ️ 归因提示:主仓检出 ${hitForeign.length} 个并行会话声明的在途文件(${hitForeign.slice(0, 5).join(', ')}${hitForeign.length > 5 ? ' 等' : ''})——实测失败可能混入他者 WIP 而非本变更问题。待其提交/收尾后复验,仍失败才是本变更的。`)
523
- }
524
- }
525
- // 第二判据(坑 derived-artifact-stale-baseline):本变更 apply 的文件(apply-pathspec 落盘)
526
- // 与主仓近期提交重叠——本变更旧基线的生成产物可能覆盖了已合入内容,先在新基线重跑生成命令再复验
527
- try {
528
- const pathspecFile = join(resolveRuntimeRoot(platformOpts, specBase), `apply-pathspec-${changeName}.txt`)
529
- if (changeName && existsSync(pathspecFile)) {
530
- const ownFiles = new Set(readFileSync(pathspecFile, 'utf8').split('\n').map(l => l.trim()).filter(Boolean).map(f => f.replace(/\\/g, '/')))
531
- if (ownFiles.size > 0) {
532
- const recent = (gitQuiet(cwd, ['log', '-n', '10', '--name-only', '--pretty=format:']) || '')
533
- .split('\n').map(l => l.trim().replace(/\\/g, '/')).filter(Boolean)
534
- const overlap = [...new Set(recent)].filter(f => ownFiles.has(f))
535
- if (overlap.length > 0) {
536
- console.error(` ℹ️ 归因提示②:本变更有 ${overlap.length} 个文件与主仓最近 10 条提交重叠(${overlap.slice(0, 5).join(', ')}${overlap.length > 5 ? ' 等' : ''})——若为生成产物(api-types 等),本变更可能在旧基线生成并覆盖了已合入内容;先在新基线重跑生成命令(如 gen:types)再复验。`)
537
- }
538
- }
539
- }
540
- } catch { /* 判据②失败不影响主流程 */ }
541
- } catch { /* 归因提示失败不影响阻断语义 */ }
542
- console.error(' 请修复失败的测试并更新 verify-result.md 后重新完成此步骤。')
543
- return await rollbackCompletionAndReturn(pm, progress, stageData, steps, currentIdx, cwd, changeName, platformOpts)
544
- }
545
- // lint 对账(2026-08-21 审查 CLI-1):test 侧"自报告 PASS 但实测失败→阻断"已闭环,
546
- // lint 侧此前纯口头——CLI 亲自执行 commands.lint,advisory 起步(失败打印不阻断,观察期后升级)
547
- const { runVerifyLintCheck, printVerifyLintCheck } = await import('../verify-postcheck.js')
548
- const lintCheck = runVerifyLintCheck({ cwd, specBase })
549
- if (lintCheck.status !== 'skipped') {
550
- console.log(`\n⏳ Verify lint 对账:CLI 亲自执行 local.yaml 的 commands.lint…`)
551
- }
552
- printVerifyLintCheck(lintCheck)
553
- // 契约 parity 对账:扫前端 API 调用 vs execute 提取的 provider endpoint artifact。
554
- // 接线自 contract-matrix pipeline(verifyApiParity 的 CLI 入口)。
555
- const { runVerifyParityCheck, printVerifyParityCheck } = await import('../verify-postcheck.js')
556
- const parityRuntimeRoot = resolveRuntimeRoot(platformOpts, specBase)
557
- const parityCheck = runVerifyParityCheck({ cwd, specBase, changeName, runtimeRoot: parityRuntimeRoot })
558
- printVerifyParityCheck(parityCheck)
559
- // ── 删除探针(advisory,不阻断):切斯特顿栅栏护栏,用 git 事实对账静默删除代码 ──
560
- const { runVerifyDeletionCheck, printVerifyDeletionCheck } = await import('../verify-postcheck.js')
561
- const deletionCheck = runVerifyDeletionCheck({ cwd, specBase, changeName })
562
- printVerifyDeletionCheck(deletionCheck)
563
- // ── required-evidence 对账(advisory,不阻断):闭合 execute→verify evidence 死链 ──
564
- // execute Task Review Gate 把 cannot_verify 任务的 evidence 落盘 verify-required-evidence.json,
565
- // 本探针查每个 cannot_verify 任务是否在 verify-result.md 体现(CLI 只查提及,满足度 agent 自报告)。
566
- const { runVerifyRequiredEvidenceCheck, printVerifyRequiredEvidenceCheck } = await import('../verify-postcheck.js')
567
- const evidenceCheck = runVerifyRequiredEvidenceCheck({ cwd, specBase, changeName })
568
- printVerifyRequiredEvidenceCheck(evidenceCheck)
569
- // ── module-impact 死信探针(blocking,债单 D-1/D-5):更新结果表 pending/待办行 → 阻断 verify ──
570
- // 与 archive 移动前校验(extractPendingDocSyncRows)同一口径,把死信号从 archive 提前到 verify:
571
- // agent 在 verify 阶段就须完成文档同步并回填 done/skipped,而非拖到归档被拦(修复 perf-remediation
572
- // 类「verify PASS → archive 才发现 pending」的时序漏洞)。
573
- const verifyChangeDir = resolveChangeDir(cwd, progress, platformOpts?.specRoot)
574
- if (verifyChangeDir) {
575
- const impactPath = join(verifyChangeDir, 'module-impact.md')
576
- if (existsSync(impactPath)) {
577
- const { extractPendingDocSyncRows } = await import('./complete-handlers.js')
578
- const pendingRows = extractPendingDocSyncRows(readFileSync(impactPath, 'utf8'))
579
- if (pendingRows.length > 0) {
580
- console.error(`\n❌ verify 阶段被阻断:module-impact.md「更新结果」表存在 ${pendingRows.length} 个未清 pending/待办项(死信)`)
581
- for (const row of pendingRows) console.error(` - ${row}`)
582
- console.error(' 文档同步是 verify 的收尾义务:请完成模块文档同步并回填状态为 done/skipped(说明原因),再重新完成 verify。')
583
- return rollbackCompletionAndReturn(pm, progress, stageData, steps, currentIdx, cwd, changeName, platformOpts)
584
- }
585
- }
586
- }
587
- // ── verify 服务进程回收(坑 verify-service-process-leak;坑 verify-pids-cross-session-kill
588
- // 见 reapVerifyServices 注释)──
589
- try {
590
- reapVerifyServices(platformOpts, specBase, changeName)
591
- } catch (e) { console.warn(`⚠️ verify 服务进程回收异常(不阻断): ${e.message}`) }
592
-
593
- console.log('\n✅ 验证通过,下一步:sillyspec run archive')
594
- }
595
-
596
- // ── Plan postcheck contract:tasks.md(注册表)× plan.md(Wave 引用)须满足 execute 契约 ──
597
- if (stageName === 'plan') {
598
- const planFile = resolveChangeDir(cwd, progress, platformOpts?.specRoot)
599
- const planPath = planFile ? join(planFile, 'plan.md') : null
600
- if (planPath && existsSync(planPath)) {
601
- const { validatePlanForExecute } = await import('../stages/execute.js')
602
- // CRLF 归一:Windows 编辑器/python 写文件可产生 CRLF,归一后交校验(与 plan-postcheck.js 同口径)
603
- const planContent = readFileSync(planPath, 'utf8').replace(/\r\n/g, '\n')
604
- const tasksPath = join(planFile, 'tasks.md')
605
- const tasksContent = existsSync(tasksPath) ? readFileSync(tasksPath, 'utf8').replace(/\r\n/g, '\n') : ''
606
- const planValidation = validatePlanForExecute(tasksContent, planContent)
607
- if (!planValidation.ok) {
608
- console.error(`\n❌ Plan → Execute Contract 校验失败:`)
609
- for (const err of planValidation.errors) console.error(` - ${err}`)
610
- console.error(`\n tasks.md/plan.md 不满足 execute 契约,请修复后重新完成此步骤。`)
611
- // 阻断 completed
612
- return await rollbackCompletionAndReturn(pm, progress, stageData, steps, currentIdx, cwd, changeName, platformOpts)
613
- }
614
- if (planValidation.warnings.length > 0) {
615
- console.warn(`\n⚠️ Plan contract 警告(不阻断完成):`)
616
- for (const w of planValidation.warnings) console.warn(` - ${w}`)
617
- }
618
- if (planValidation.ok) {
619
- console.log(`\n✅ Plan → Execute Contract 校验通过(${planValidation.tasks.length} tasks, ${planValidation.waves.length} waves)`)
620
- }
621
- }
622
- }
623
-
624
- // ── Stage Review Gate:brainstorm/plan/execute 独立审查(按 tier 分级)──
625
- // tier=self 放行+审计打印;tier=independent 必须 review.json 且 verdict 非 fail,fail-closed
626
- if (['brainstorm', 'plan', 'execute'].includes(stageName)) {
627
- try {
628
- const { classifyReviewTier } = await import('../review-tier.js')
629
- const { validateStageReview, getLatestStageReviewRunId, printStageReviewResult, generateStageReviewRunId, stageReviewMarkerPath } = await import('../stage-review.js')
630
- const effectiveSpecBase = platformOpts?.specRoot || specBase
631
- const reviewChangeDir = resolveChangeDir(cwd, progress, platformOpts?.specRoot)
632
- const designPath = reviewChangeDir ? join(reviewChangeDir, 'design.md') : null
633
- let planLevel = null
634
- if (reviewChangeDir) {
635
- const planPath = join(reviewChangeDir, 'plan.md')
636
- if (existsSync(planPath)) {
637
- const fmLine = readFileSync(planPath, 'utf8').split('\n').find(l => l.trim().startsWith('plan_level:'))
638
- if (fmLine) planLevel = fmLine.split(':')[1].trim()
639
- }
640
- }
641
- const tier = classifyReviewTier({ planLevel, designPath })
642
- const runtimeRoot = resolveRuntimeRoot(platformOpts, effectiveSpecBase)
643
-
644
- if (tier.tier === 'self') {
645
- console.log('\nℹ️ Stage Review: ' + stageName + ' tier=self(' + tier.reason + '),已降级为当前 agent 自审,不强制独立子代理。')
646
- } else {
647
- let reviewRunId = getLatestStageReviewRunId(runtimeRoot, stageName, changeName)
648
- if (!reviewRunId) {
649
- // marker 缺失(execute 批量完成跳过 prompt 渲染等场景)→ 自生 + 写盘
650
- // 让 gate 读到确定 ID,错误从 execute-null 变 execute-review-<id>(可执行)
651
- reviewRunId = generateStageReviewRunId()
652
- try {
653
- mkdirSync(runtimeRoot, { recursive: true })
654
- writeAtomicSync(stageReviewMarkerPath(runtimeRoot, stageName, changeName), reviewRunId + '\n')
655
- } catch {}
656
- }
657
- const reviewType = stageName === 'brainstorm' ? 'design'
658
- : stageName === 'plan' ? 'plan'
659
- : 'acceptance'
660
- const searchDirs = [effectiveSpecBase, reviewChangeDir, cwd].filter(Boolean)
661
- const reviewResult = validateStageReview({ stage: stageName, reviewType, runtimeRoot, reviewRunId, searchDirs })
662
- printStageReviewResult(reviewResult, { stage: stageName, reviewRunId, runtimeRoot, changeName })
663
- if (!reviewResult.ok) {
664
- return await rollbackCompletionAndReturn(pm, progress, stageData, steps, currentIdx, cwd, changeName, platformOpts)
665
- }
666
- }
667
- } catch (e) {
668
- // fail-closed:Gate 自身异常阻断完成,不静默放行(与 Task Review Gate 一致)
669
- console.error('❌ Stage Review Gate 异常,阻断 ' + stageName + ' 完成: ' + e.message)
670
- return await rollbackCompletionAndReturn(pm, progress, stageData, steps, currentIdx, cwd, changeName, platformOpts)
671
- }
672
- }
673
-
674
- // ── module-impact pending 死信 execute 收尾提示(坑 module-impact-debt-late-warn,
675
- // 2026-08-22 实证:死信门在 verify 才硬拦,文档债拖到 verify 末尾才暴露、上次也拦)。
676
- // execute --done 即 advisory 提示(不阻断 execute——execute 期间可能仍在迭代模块文档;
677
- // verify 的硬拦不变),让 agent 当场清债而非攒到 verify 撞门。
678
- if (stageName === 'execute') {
679
- try {
680
- const execChangeDir = resolveChangeDir(cwd, progress, platformOpts?.specRoot)
681
- const execImpactPath = execChangeDir ? join(execChangeDir, 'module-impact.md') : null
682
- if (execImpactPath && existsSync(execImpactPath)) {
683
- const { extractPendingDocSyncRows } = await import('./complete-handlers.js')
684
- const execPendingRows = extractPendingDocSyncRows(readFileSync(execImpactPath, 'utf8'))
685
- if (execPendingRows.length > 0) {
686
- console.warn(`\n⚠️ module-impact.md「更新结果」表有 ${execPendingRows.length} 个 pending/待办项(文档同步债)——verify 阶段会硬拦:`)
687
- for (const row of execPendingRows) console.warn(` - ${row}`)
688
- console.warn(' 建议 execute 收尾就完成模块文档同步并回填 done/skipped(说明原因),别把债拖到 verify 末尾。')
689
- }
690
- }
691
- } catch { /* 提示失败不阻断 execute */ }
692
- }
693
-
694
- // ── Execute Task Review Gate:所有 task 必须有 review.json 且 verdict 通过 ──
695
- if (stageName === 'execute') {
696
- try {
697
- const { validateTaskReviews, printReviewResult, writeVerifyRequiredEvidence } = await import('../task-review.js')
698
- const effectiveSpecBase = platformOpts?.specRoot || specBase
699
- const planFile = resolveChangeDir(cwd, progress, platformOpts?.specRoot)
700
- const planPath = planFile ? join(planFile, 'plan.md') : null
701
-
702
- if (planPath && existsSync(planPath)) {
703
- // 2026-08-20-task-truth-unify:任务清单源迁 tasks.md(validateTaskReviews 内按
704
- // checkbox 行解析,tasks.md 行格式兼容原正则);缺失回退 plan.md(旧变更兼容读侧)
705
- const tasksRegistryPath = join(planFile, 'tasks.md')
706
- const planContent = existsSync(tasksRegistryPath)
707
- ? readFileSync(tasksRegistryPath, 'utf8')
708
- : readFileSync(planPath, 'utf8')
709
- const runtimeRoot = resolveRuntimeRoot(platformOpts, effectiveSpecBase)
710
-
711
- // execute run id:从变更专属标记文件读取(agent 可写内容,格式校验防注入/穿越)
712
- const runIdFile = join(runtimeRoot, `current-execute-run-id-${changeName}`)
713
- let executeRunId = ''
714
- try {
715
- if (existsSync(runIdFile)) {
716
- const c = readFileSync(runIdFile, 'utf8').trim()
717
- const { isValidExecuteRunId } = await import('../task-review.js')
718
- if (c && !isValidExecuteRunId(c)) {
719
- console.warn(`⚠️ execute run marker 内容非法(期望 exec-YYYY-MM-DD-HHMMSS,实得 ${JSON.stringify(c.slice(0, 60))}),视为缺失回退扫描`)
720
- } else {
721
- executeRunId = c
722
- }
723
- }
724
- } catch {}
725
- if (!executeRunId) {
726
- // marker 缺失:先扫描 execute-runs/ 既有目录找回真实 runId(与 getLatestStageReviewRunId
727
- // 目录扫描兜底同语义),避免 marker 丢失而 agent 已用旧 runId 落盘时,直接 generate 新 ID
728
- // 找不到旧 review、误判缺 review.json。仅当确实无既有 run 才 generate 新 ID 并落盘。
729
- const { generateExecuteRunId, resolveLatestExecuteRunId, stampExecuteRunChange } = await import('../task-review.js')
730
- executeRunId = resolveLatestExecuteRunId({ runtimeRoot, changeName }) || ''
731
- if (!executeRunId) {
732
- executeRunId = generateExecuteRunId()
733
- // 落盘(marker 缺失时 fallback 生成后写盘,保证后续 checkbox/gate 读到同一 ID)
734
- // D-001#1 fallback 写入点:mkdir execute-runs/<runId>/tasks 先于 marker(不变量:
735
- // marker 在则目录在)。不 try/catch——异常直穿外层 catch 走 fail-closed 阻断
736
- //(gate 自身写 run 目录失败不能静默放行完成)。
737
- mkdirSync(join(runtimeRoot, 'execute-runs', executeRunId, 'tasks'), { recursive: true })
738
- writeAtomicSync(runIdFile, executeRunId + '\n')
739
- stampExecuteRunChange(runtimeRoot, executeRunId, changeName)
740
- }
741
- }
742
-
743
- // git 真实性校验目录:worktree 存在则用 worktree(base/head commit 在其中),否则主仓库。
744
- // 跨仓支持(task-07 / design §6 gates 行 + D-013):
745
- // - 有 ctx(execute 启动入口 task-09 构造的 MultiRepoContext 实例)→ 用
746
- // ctx.resolve('main').gitDir 作为主仓 task 的校验 cwd。ctx 的 main entry 已在
747
- // _buildMainEntry 内统一编码 worktreePath/cwd + in-place-fallback 兜底(与 task-review.js:724
748
- // generateTaskReviewDrafts 的 in-place 逻辑同源),避免两处漂移。Task Review Gate 内部循环
749
- // 再按 review.repo ?? 'main' 从 ctx.resolve(repo).gitDir 切跨仓 task 的 gitDir(task-04 实现)。
750
- // - 无 ctx(ctx=null 缺省,单仓 / 旧调用链)→ 走原逻辑(meta.worktreePath 或 cwd),零回归。
751
- let reviewGitDir = cwd
752
- if (ctx) {
753
- const mainEntry = ctx.resolve('main')
754
- if (mainEntry?.gitDir) reviewGitDir = mainEntry.gitDir
755
- } else {
756
- try {
757
- const { WorktreeManager } = await import('../worktree.js')
758
- const wm = new WorktreeManager({ cwd })
759
- const meta = wm.getMeta(changeName)
760
- if (meta?.worktreePath && meta.mode !== 'in-place-fallback' && existsSync(meta.worktreePath)) {
761
- reviewGitDir = meta.worktreePath
762
- }
763
- } catch {}
764
- }
765
-
766
- const reviewResult = validateTaskReviews({ planContent, runtimeRoot, executeRunId, changeDir: planFile, gitDir: reviewGitDir, ctx })
767
- printReviewResult(reviewResult, { runtimeRoot, executeRunId })
768
-
769
- if (!reviewResult.ok) {
770
- // Task review 校验失败,阻断 execute 完成
771
- // 检查是否存在 checkbox 已勾但 review 不通过的情况
772
- const uncheckedTasks = reviewResult.errors.filter(e => e.includes('缺少 review.json'))
773
- if (uncheckedTasks.length > 0) {
774
- console.error('\n⚠️ 部分任务已在 tasks.md 中勾选,但 review.json 不存在。')
775
- console.error(` 请取消勾选这些任务的 checkbox,或补充对应的 review.json(execute run ID: ${executeRunId})。`)
776
- }
777
- return await rollbackCompletionAndReturn(pm, progress, stageData, steps, currentIdx, cwd, changeName, platformOpts)
778
- }
779
-
780
- // cannot_verify 的 requiredEvidence 写入 change 目录,供 verify 阶段消费
781
- if (reviewResult.requiredEvidence.length > 0) {
782
- const evidencePath = writeVerifyRequiredEvidence(join(effectiveSpecBase, 'changes', changeName), reviewResult.requiredEvidence)
783
- if (evidencePath) {
784
- console.log(`📄 verify-required-evidence.json 已写入: ${evidencePath}`)
785
- console.log(' verify 阶段必须满足这些证据要求。')
786
- }
787
- }
788
- }
789
- } catch (e) {
790
- // fail-closed:Gate 自身异常时不能默认放行,否则异常成了绕过评审的通道
791
- console.error(`❌ Task Review Gate 异常,阻断 execute 完成: ${e.message}`)
792
- console.error(' 请检查 review.json / plan.md 是否可读,修复后重新完成此步骤。')
793
- return await rollbackCompletionAndReturn(pm, progress, stageData, steps, currentIdx, cwd, changeName, platformOpts)
794
- }
795
- }
796
- return null
797
- }
798
-
799
- /**
800
- * 读取 design.md frontmatter 的 scale 字段(brainstorm 末步写入 'small'|'large')。
801
- * completeStep 的下一步提示据此分叉:small→quick,large/读不到→plan(fail-safe 走重流程)。
802
- * 只解析首个 YAML frontmatter 块,避免误读正文里的 "scale:"。
803
- * 从 complete.js 迁入(completeStageGates 共享收尾管线 + completeStep brainstorm 提示消费)。
804
- */
805
- export function readDesignScale(specBase, changeName) {
806
- if (!changeName) return null
807
- const designPath = join(specBase, 'changes', changeName, 'design.md')
808
- if (!existsSync(designPath)) return null
809
- const text = readFileSync(designPath, 'utf8')
810
- const fm = text.match(/^---[ \t]*\r?\n([\s\S]*?)\r?\n---[ \t]*\r?\n/)
811
- if (!fm) return null
812
- const m = fm[1].match(/^scale:[ \t]*['"]?(\w+)/m)
813
- return m ? m[1] : null
814
- }
815
-
816
- /**
817
- * 校验变更目录下近 10 分钟新增的 .md/.yaml/.yml 文件含 author/created_at 元数据(advisory 打印)。
818
- * 从 complete.js 迁入(completeStageGates 共享收尾管线消费)。
819
- */
820
- export function validateMetadata(cwd, stageName, specBase) {
821
- const changesDir = join(specBase, 'changes')
822
- if (!existsSync(changesDir)) return
823
-
824
- const cutoff = Date.now() - 10 * 60 * 1000
825
- const missing = []
826
-
827
- function walk(dir) {
828
- for (const entry of readdirSync(dir, { withFileTypes: true })) {
829
- const full = join(dir, entry.name)
830
- try {
831
- if (entry.isDirectory()) { walk(full); continue }
832
- if (!/\.(md|yaml|yml)$/.test(entry.name)) continue
833
- const mtime = statSync(full).mtimeMs
834
- if (mtime < cutoff) continue
835
- const content = readFileSync(full, 'utf-8')
836
- if (!content.includes('author:') && !content.includes('author:')) missing.push(full)
837
- if (!content.includes('created_at:') && !content.includes('created_at:')) missing.push(full)
838
- } catch (e) { /* skip unreadable files */ }
839
- }
840
- }
841
-
842
- walk(changesDir)
843
- const unique = [...new Set(missing)]
844
- if (unique.length > 0) {
845
- console.log(`\n⚠️ 以下文件缺少 author 或 created_at 元数据:`)
846
- unique.forEach(f => console.log(` - ${relative(cwd, f) || f}`))
847
- console.log('请在文件头部添加 author(git 用户名)和 created_at(精确到秒)')
848
- }
849
- }
850
-
851
- /**
852
- * 验证关键文件是否存在于正确的变更目录下(advisory 打印,防 AI 写错路径)。
853
- * 从 complete.js 迁入(completeStageGates 共享收尾管线消费)。
854
- */
855
- export function validateFileLocations(cwd, stageName, progress, changeName, specBase) {
856
- const effectiveChange = changeName || progress.currentChange
857
- if (!effectiveChange) return
858
-
859
- const changeDir = join(specBase, 'changes', effectiveChange)
860
- if (!existsSync(changeDir)) return
861
-
862
- // 每个阶段完成后预期存在的文件
863
- // brainstorm:scale=small(小变更)只必产 design.md;large/未标 scale → 四件套全。
864
- // 与 validateBrainstormOutputs 的 BRAINSTORM_RULES condition(scale≠small)同源,避免对合法 small 变更
865
- // 误报"⬜ proposal/requirements/tasks 未找到"(本检查仅 advisory 打印不 gate,但误导输出仍要消除)。
866
- const brainstormExpected = readDesignScale(specBase, effectiveChange) === 'small'
867
- ? ['design.md']
868
- : ['design.md', 'proposal.md', 'requirements.md', 'tasks.md']
869
- const expectedFiles = {
870
- brainstorm: brainstormExpected,
871
- plan: ['plan.md'],
872
- archive: ['module-impact.md'],
873
- }
874
-
875
- const expected = expectedFiles[stageName]
876
- if (!expected) return
877
-
878
- const missing = []
879
- for (const file of expected) {
880
- if (!existsSync(join(changeDir, file))) {
881
- missing.push(file)
882
- }
883
- }
884
-
885
- if (missing.length > 0) {
886
- console.log(`\n⚠️ 文件位置验证:以下文件未在变更目录中找到`)
887
- // relative(cwd, x):Windows 下 join() 产物是反斜杠绝对路径,正斜杠拼接的 cwd 前缀裁剪永不命中
888
- console.log(` 变更目录:${relative(cwd, changeDir) || changeDir}/`)
889
- for (const f of missing) {
890
- // 检查是否写到了错误的位置
891
- const wrongPath = join(specBase, 'changes', 'change', effectiveChange, f)
892
- if (existsSync(wrongPath)) {
893
- console.log(` ❌ ${f} — 不存在,但发现了错误路径:${relative(cwd, wrongPath) || wrongPath}`)
894
- console.log(` 提示:应该写入 ${relative(cwd, changeDir) || changeDir}/${f}`)
895
- } else {
896
- console.log(` ⬜ ${f} — 未找到(该阶段可能未产出此文件)`)
897
- }
898
- }
899
- } else {
900
- console.log(`\n✅ 文件位置验证:所有 ${expected.length} 个预期文件均在变更目录中`)
901
- }
902
- }
903
-
904
- /**
905
- * 读本变更 design.md §6「文件变更清单」表格,提取声明交付的文件路径(concurrent 预检 ownFiles 源,D-002)。
906
- *
907
- * 用途:execute --done 并发预检在 in-place-fallback 模式下,需把本变更交付文件从 foreignFiles 排除
908
- * (否则自己产出的脏文件会被当他者)。worktree 模式下交付文件不在主仓 git status,ownFiles 用空数组即可。
909
- *
910
- * 解析:定位 `## 6.` 段(到下一个 `## N.` 前),逐行扫表格行第 2 列的反引号文件路径,跳过表头/分隔行。
911
- * 设计容错(design §9 / R-02):design.md 缺失 / 无 §6 / 解析空 → 返回 [],foreignFiles 退化为保守噪音,
912
- * otherActiveChanges 仍可靠。
913
- *
914
- * @param {string} specBase 规范根(.sillyspec/ 所在)
915
- * @param {string} changeName 当前变更名
916
- * @returns {string[]} 本变更声明交付的文件路径(git 路径,正斜杠)
917
- */
918
- function readDesignOwnFiles(specBase, changeName) {
919
- if (!specBase || !changeName) return []
920
- let content
921
- try {
922
- content = readFileSync(join(specBase, 'changes', changeName, 'design.md'), 'utf8')
923
- } catch {
924
- return []
925
- }
926
- const files = []
927
- let inSection6 = false
928
- for (const line of content.split('\n')) {
929
- const heading = line.match(/^##\s+(\d+)\./)
930
- if (heading) {
931
- inSection6 = heading[1] === '6'
932
- continue
933
- }
934
- if (!inSection6 || !line.startsWith('|')) continue
935
- // 跳过表头分隔行(|---|---|)
936
- if (/^\|[\s:|-]+\|?$/.test(line.trim())) continue
937
- // 表格第 2 列反引号文件路径:`| 新增 | \`src/.../x.js\` | 说明 |`
938
- const m = line.match(/^\|[^|]+\|\s*`([^`]+)`/)
939
- if (m) files.push(m[1].trim())
940
- }
941
- return files
942
- }
943
-
944
- /**
945
- * 阶段完成收尾共享管线(从 completeStep 抽出,消除 noAI 末步 / continueStep 完成分支绕过 gate 的
946
- * S1/S2/S3 三处不对称)。调用方已自行标记 stageData.status='completed' 并 pm._write 落盘后调用本函数。
947
- *
948
- * 序列:handleScanStageCompleted → validateMetadata → validateFileLocations[completed‖skipped 守卫] →
949
- * auxiliary 重置 → runStageCompletionGates[同守卫] → handleExecuteWorktreeCleanup。
950
- *
951
- * 关键陷阱(design §5.4):auxiliary 重置把 stageData.steps 换成 freshSteps(全 pending);下方
952
- * runStageCompletionGates 守卫与 rollbackStageCompletion 必须用入参 steps(pre-reset 原数组),
953
- * 不得重读 stageData.steps(否则计数恒 0 → gate 永跳过)。本函数全程用入参 steps,未重读。
954
- *
955
- * @returns {Promise<{stageCompleted:false,currentIdx,nextPendingIdx:number}|null>}
956
- * null = 全部通过,调用方继续自管收尾(如下一步提示);
957
- * 非 null = gate/handler 失败已 rollback,调用方直接 return。
958
- */
959
- export async function completeStageGates({ stageName, cwd, changeName, platformOpts, specBase, progress, pm, stageData, steps, currentIdx, outputText, ctx = null }) {
960
- // 整体 try/catch(task-04 / review-2026-08-09 #2):收尾段(execute 预检 + scan handler + validate* +
961
- // auxiliary 重置 + runStageCompletionGates)任一段抛非结构化异常 → rollbackCompletionAndReturn
962
- // (回滚 in-progress + 落盘 + 返回未完成对象),不冒顶 exit 1。正常的 _scanResult/_gateEarlyReturn
963
- // early-return 是 return 非 throw,不被 catch 拦;下方 handleExecuteWorktreeCleanup 在 try 外(副作用独立,失败不 rollback stage 状态)。
964
- try {
965
- // ── execute --done 并发他者改动预检(FR-06/FR-07,非阻断 advisory)──
966
- // 仅 execute 触发,不影响 scan/plan/verify/archive 等 stage 的 completeStageGates。
967
- // 纯副作用:console.warn 后照常推进,不改 stageData / 不阻断级联(FR-07)。
968
- // 整个钩子 try/catch 兜底——任何异常吞掉,绝不影响 gate 级联(FR-07 不阻断铁律)。
969
- if (stageName === 'execute') {
970
- try {
971
- // ownFiles 源(D-002 + B-002,钉死):动态 import WorktreeManager 取 meta.mode(复用上方
972
- // Task Review Gate 的 ../worktree.js 动态 import 先例)。WorktreeManager 无 appliedFiles
973
- // 字段(B-002 已证),不用模糊的「worktree applied 文件」。
974
- // - worktree 模式(meta.mode 非 in-place-fallback):主仓 git status 看不见本变更交付文件
975
- // → ownFiles=[](无害,dogfood 当前实际模式)
976
- // - in-place-fallback 模式:交付文件就在主仓 dirty → ownFiles 读 design.md §6 文件清单排除
977
- let ownFiles = []
978
- // linkedChanges:execute 通常无(quick 管线概念,存 quick guard 文件);stageData 取不到则 []。
979
- const linkedChanges = Array.isArray(stageData?.linkedChanges) ? stageData.linkedChanges : []
980
- try {
981
- const { WorktreeManager } = await import('../worktree.js')
982
- const wm = new WorktreeManager({ cwd })
983
- const meta = wm.getMeta(changeName)
984
- if (meta?.mode === 'in-place-fallback') {
985
- ownFiles = readDesignOwnFiles(specBase, changeName)
986
- }
987
- } catch {
988
- // getMeta 抛(meta.json 缺 / worktree 损坏)→ ownFiles=[] 兜底,不崩(FR-07)。
989
- ownFiles = []
990
- }
991
- const detected = detectConcurrentChanges(cwd, { changeName, linkedChanges, ownFiles })
992
- const warn = formatConcurrentWarning(detected)
993
- if (warn) console.warn(warn)
994
- } catch {
995
- // FR-07 不阻断:钩子任何意外异常静默吞掉,gate 级联照常推进。
996
- }
997
- }
998
-
999
- // scan 平台 manifest + post-check(S1 平台受害者:noAI scanPostcheck 末步 / continueStep 现也走这里)
1000
- const _scanResult = await handleScanStageCompleted({ stageName, currentIdx, cwd, progress, pm, stageData, changeName, outputText, platformOpts })
1001
- if (_scanResult) return _scanResult
1002
-
1003
- // 守卫计数:completed‖skipped === total(修 S3);用入参 steps(pre-reset 原数组,design §5.4)
1004
- const settledCount = steps.filter(s => s.status === 'completed' || s.status === 'skipped').length
1005
- const total = steps.length
1006
-
1007
- validateMetadata(cwd, stageName, specBase)
1008
-
1009
- // 验证关键文件位置(仅当所有步骤已结案 completed‖skipped 时才校验)
1010
- if (settledCount === total && total > 0) {
1011
- validateFileLocations(cwd, stageName, progress, changeName, specBase)
1012
- }
1013
-
1014
- // 辅助阶段完成后重置步骤(scan 等 auxiliary 阶段重置回 pending 可重跑)
1015
- const stageDef = stageRegistry[stageName]
1016
- if (stageDef?.auxiliary) {
1017
- const freshSteps = (stageDef.steps || []).map(s => ({
1018
- name: s.name,
1019
- status: 'pending',
1020
- output: null,
1021
- completedAt: null
1022
- }))
1023
- stageData.steps = freshSteps
1024
- stageData.status = 'pending'
1025
- stageData.completedAt = null
1026
- // scan 的 quick 档 profile 随步骤表一并失效(坑 scan-quick-profile-step-mismatch 收尾):
1027
- // getStageSteps 感知 scanProfile 返回 3 步表,重置后 DB 是 11 步注册表,残留 profile 会让
1028
- // 下次 --status 走 ensureStageSteps 时 11 vs 3 误报漂移重播种。下次 run scan 会重算 profile。
1029
- if (stageName === 'scan' && stageData.scanProfile) delete stageData.scanProfile
1030
- if (progress.currentStage === stageName) progress.currentStage = ''
1031
- pm._write(cwd, progress, changeName)
1032
- }
1033
-
1034
- // 阶段完成校验 gate 级联(runValidators → verify-test → Plan→Execute → Stage Review → Task Review)
1035
- if (settledCount === total && total > 0) {
1036
- const _gateEarlyReturn = await runStageCompletionGates({ stageName, cwd, changeName, platformOpts, specBase, progress, pm, stageData, steps, currentIdx, ctx })
1037
- if (_gateEarlyReturn) return _gateEarlyReturn
1038
- } else if (settledCount < total) {
1039
- console.log(`\n⚠️ 阶段校验跳过:${total} 步中仅 ${settledCount} 步标记为已结案(completed‖skipped),可能存在状态不同步。如确认阶段已完成,请运行 --status 确认。`)
1040
- }
1041
- } catch (e) {
1042
- console.error(`\n❌ ${stageName} 阶段完成收尾异常(已 rollback 为 in-progress,请修复后重新 --done):${e?.message || e}`)
1043
- return await rollbackCompletionAndReturn(pm, progress, stageData, steps, currentIdx, cwd, changeName, platformOpts)
1044
- }
1045
-
1046
- // execute worktree cleanup(completeStep / continueStep 完成分支统一调用,避免双清理)
1047
- await handleExecuteWorktreeCleanup({ stageName, changeName, cwd })
1048
-
1049
- return null
1050
- }
1051
-
1052
-
1053
- /**
1054
- * verify 服务进程回收(verify --done 收尾调用)。
1055
- *
1056
- * 坑 verify-service-process-leak(2026-08-21):真实启动验证起的长驻服务(uvicorn 等)漏挂
1057
- * 一天多——verify prompt 要求 PID 按变更分片登记 .runtime/verify-services-<change>.pids。
1058
- * 坑 verify-pids-cross-session-kill(2026-08-23):原单文件无归属,A 会话 --done 会把 B 正在
1059
- * 收集 Runtime Evidence 的服务一并杀掉——分片后各回收各的;旧单文件兼容回收(升级过渡期)。
1060
- * 回执同样按变更分片(原单份被并行会话后写覆盖),checkIntegrationEvidence(stage-contract)
1061
- * 读分片名注入证据匹配。best-effort:ESRCH(已退出)静默,kill 失败 warn 不阻断 verify。
1062
- *
1063
- * @returns {{ reaped: number, receiptPath: string|null }}
1064
- */
1065
- export function reapVerifyServices(platformOpts, specBase, changeName) {
1066
- const runtimeDir = resolveRuntimeRoot(platformOpts, specBase)
1067
- const reapFile = (path, label) => {
1068
- if (!existsSync(path)) return null
1069
- const pids = readFileSync(path, 'utf8').split('\n').map(l => l.trim()).filter(l => /^\d+$/.test(l))
1070
- const reaped = []; const failed = []
1071
- for (const pid of pids) {
1072
- try { process.kill(parseInt(pid, 10), 'SIGTERM'); reaped.push(pid) }
1073
- catch (e) { if (e.code !== 'ESRCH') failed.push(`${pid}(${e.code || e.message})`) }
1074
- }
1075
- try { unlinkSync(path) } catch {}
1076
- if (reaped.length > 0) console.log(`🧹 verify 服务进程已回收 ${reaped.length} 个${label}(PID: ${reaped.join(', ')})`)
1077
- return { reaped: reaped.length, failed }
1078
- }
1079
- const own = reapFile(join(runtimeDir, `verify-services-${changeName}.pids`), '')
1080
- const legacy = reapFile(join(runtimeDir, 'verify-services.pids'), '(旧格式单文件,兼容回收)')
1081
- const reapedTotal = (own?.reaped || 0) + (legacy?.reaped || 0)
1082
- const failedAll = [...(own?.failed || []), ...(legacy?.failed || [])]
1083
- let receiptPath = null
1084
- if (reapedTotal > 0) {
1085
- try {
1086
- receiptPath = join(runtimeDir, `verify-services-${changeName}.receipt.json`)
1087
- writeFileSync(receiptPath, JSON.stringify({
1088
- change: changeName || null, reapedPidCount: reapedTotal, reapedAt: new Date().toISOString(),
1089
- }, null, 2) + '\n')
1090
- } catch { receiptPath = null }
1091
- }
1092
- if (failedAll.length > 0) console.warn(`⚠️ 服务进程回收失败 ${failedAll.length} 个:${failedAll.join(', ')} — 手动处理:taskkill /PID <pid> /F(Windows)/ kill -9 <pid>`)
1093
- return { reaped: reapedTotal, receiptPath }
1094
- }