create-principles-disciple 1.73.0 → 1.74.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 (272) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +24 -0
  3. package/console/dist/server/index.js +13 -1
  4. package/console/dist/server/routes/agents.js +3 -118
  5. package/console/dist/server/routes/update-history.d.ts +12 -0
  6. package/console/dist/server/routes/update-history.js +52 -0
  7. package/console/dist/server/routes/update.d.ts +10 -0
  8. package/console/dist/server/routes/update.js +435 -0
  9. package/console/dist/ui/App.js +2 -1
  10. package/console/dist/ui/components/UpdateBanner.d.ts +1 -0
  11. package/console/dist/ui/components/UpdateBanner.js +41 -0
  12. package/console/dist/ui/components/UpdateProgressDialog.d.ts +12 -0
  13. package/console/dist/ui/components/UpdateProgressDialog.js +28 -0
  14. package/console/dist/ui/i18n/en.json +0 -1
  15. package/console/dist/ui/i18n/zh-CN.json +0 -1
  16. package/console/dist/ui/pages/AgentsPage.js +3 -17
  17. package/console/dist/ui/pages/TasksPage.js +0 -1
  18. package/console/dist/ui/pages/UpdatePage.d.ts +1 -0
  19. package/console/dist/ui/pages/UpdatePage.js +142 -0
  20. package/console/dist/web/assets/app.css +7 -0
  21. package/console/dist/web/assets/app.js +456 -173
  22. package/console/package.json +2 -0
  23. package/core/dist/runtime-v2/adapter/__tests__/schema-prompt-adapter.test.d.ts +2 -0
  24. package/core/dist/runtime-v2/adapter/__tests__/schema-prompt-adapter.test.d.ts.map +1 -0
  25. package/core/dist/runtime-v2/adapter/__tests__/schema-prompt-adapter.test.js +270 -0
  26. package/core/dist/runtime-v2/adapter/__tests__/schema-prompt-adapter.test.js.map +1 -0
  27. package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.d.ts +1 -1
  28. package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.d.ts.map +1 -1
  29. package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.js +4 -3
  30. package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.js.map +1 -1
  31. package/core/dist/runtime-v2/adapter/schema-prompt-adapter.d.ts +13 -0
  32. package/core/dist/runtime-v2/adapter/schema-prompt-adapter.d.ts.map +1 -0
  33. package/core/dist/runtime-v2/adapter/schema-prompt-adapter.js +266 -0
  34. package/core/dist/runtime-v2/adapter/schema-prompt-adapter.js.map +1 -0
  35. package/core/dist/runtime-v2/adapter/tools/diagnostician-tool.d.ts +3 -7
  36. package/core/dist/runtime-v2/adapter/tools/diagnostician-tool.d.ts.map +1 -1
  37. package/core/dist/runtime-v2/adapter/tools/diagnostician-tool.js +7 -19
  38. package/core/dist/runtime-v2/adapter/tools/diagnostician-tool.js.map +1 -1
  39. package/core/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.test.js +97 -15
  40. package/core/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.test.js.map +1 -1
  41. package/core/dist/runtime-v2/diagnostician-output.d.ts +0 -10
  42. package/core/dist/runtime-v2/diagnostician-output.d.ts.map +1 -1
  43. package/core/dist/runtime-v2/diagnostician-output.js +5 -10
  44. package/core/dist/runtime-v2/diagnostician-output.js.map +1 -1
  45. package/core/dist/runtime-v2/diagnostician-prompt-builder.d.ts +6 -1
  46. package/core/dist/runtime-v2/diagnostician-prompt-builder.d.ts.map +1 -1
  47. package/core/dist/runtime-v2/diagnostician-prompt-builder.js +23 -15
  48. package/core/dist/runtime-v2/diagnostician-prompt-builder.js.map +1 -1
  49. package/dist/index.js +0 -0
  50. package/dist/installer.d.ts.map +1 -1
  51. package/dist/installer.js +67 -0
  52. package/dist/installer.js.map +1 -1
  53. package/dist/uninstaller.d.ts +0 -5
  54. package/dist/uninstaller.d.ts.map +1 -1
  55. package/dist/uninstaller.js +53 -8
  56. package/dist/uninstaller.js.map +1 -1
  57. package/dist/updater.d.ts +45 -0
  58. package/dist/updater.d.ts.map +1 -0
  59. package/dist/updater.js +333 -0
  60. package/dist/updater.js.map +1 -0
  61. package/dist/utils/env.d.ts +6 -0
  62. package/dist/utils/env.d.ts.map +1 -1
  63. package/dist/utils/env.js +54 -0
  64. package/dist/utils/env.js.map +1 -1
  65. package/package.json +6 -2
  66. package/pd-cli/dist/index.js +4 -1
  67. package/pd-cli/dist/index.js.map +1 -1
  68. package/pd-cli/package.json +2 -2
  69. package/plugin/templates/langs/en/skills/ai-sprint-orchestration/runtime/.gitignore +2 -2
  70. package/plugin/templates/langs/zh/skills/ai-sprint-orchestration/runtime/.gitignore +2 -2
  71. package/core/dist/runtime-v2/__tests__/nocturnal-compliance-trust-boundary.test.d.ts +0 -2
  72. package/core/dist/runtime-v2/__tests__/nocturnal-compliance-trust-boundary.test.d.ts.map +0 -1
  73. package/core/dist/runtime-v2/__tests__/nocturnal-compliance-trust-boundary.test.js +0 -215
  74. package/core/dist/runtime-v2/__tests__/nocturnal-compliance-trust-boundary.test.js.map +0 -1
  75. package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-config-resolve.test.d.ts +0 -2
  76. package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-config-resolve.test.d.ts.map +0 -1
  77. package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-config-resolve.test.js +0 -92
  78. package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-config-resolve.test.js.map +0 -1
  79. package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-decision.test.d.ts +0 -2
  80. package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-decision.test.d.ts.map +0 -1
  81. package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-decision.test.js +0 -134
  82. package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-decision.test.js.map +0 -1
  83. package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-edge-cases.test.d.ts +0 -2
  84. package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-edge-cases.test.d.ts.map +0 -1
  85. package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-edge-cases.test.js +0 -226
  86. package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-edge-cases.test.js.map +0 -1
  87. package/core/dist/runtime-v2/idle-trigger/idle-trigger-decision.d.ts +0 -3
  88. package/core/dist/runtime-v2/idle-trigger/idle-trigger-decision.d.ts.map +0 -1
  89. package/core/dist/runtime-v2/idle-trigger/idle-trigger-decision.js +0 -5
  90. package/core/dist/runtime-v2/idle-trigger/idle-trigger-decision.js.map +0 -1
  91. package/core/dist/runtime-v2/idle-trigger/idle-trigger-policy.d.ts +0 -4
  92. package/core/dist/runtime-v2/idle-trigger/idle-trigger-policy.d.ts.map +0 -1
  93. package/core/dist/runtime-v2/idle-trigger/idle-trigger-policy.js +0 -81
  94. package/core/dist/runtime-v2/idle-trigger/idle-trigger-policy.js.map +0 -1
  95. package/core/dist/runtime-v2/idle-trigger/idle-trigger-types.d.ts +0 -29
  96. package/core/dist/runtime-v2/idle-trigger/idle-trigger-types.d.ts.map +0 -1
  97. package/core/dist/runtime-v2/idle-trigger/idle-trigger-types.js +0 -15
  98. package/core/dist/runtime-v2/idle-trigger/idle-trigger-types.js.map +0 -1
  99. package/core/dist/runtime-v2/idle-trigger/index.d.ts +0 -5
  100. package/core/dist/runtime-v2/idle-trigger/index.d.ts.map +0 -1
  101. package/core/dist/runtime-v2/idle-trigger/index.js +0 -4
  102. package/core/dist/runtime-v2/idle-trigger/index.js.map +0 -1
  103. package/core/dist/runtime-v2/nocturnal/candidate-scoring.d.ts +0 -486
  104. package/core/dist/runtime-v2/nocturnal/candidate-scoring.d.ts.map +0 -1
  105. package/core/dist/runtime-v2/nocturnal/candidate-scoring.js +0 -493
  106. package/core/dist/runtime-v2/nocturnal/candidate-scoring.js.map +0 -1
  107. package/core/dist/runtime-v2/nocturnal/index.d.ts +0 -9
  108. package/core/dist/runtime-v2/nocturnal/index.d.ts.map +0 -1
  109. package/core/dist/runtime-v2/nocturnal/index.js +0 -5
  110. package/core/dist/runtime-v2/nocturnal/index.js.map +0 -1
  111. package/core/dist/runtime-v2/nocturnal/nocturnal-compliance.d.ts +0 -185
  112. package/core/dist/runtime-v2/nocturnal/nocturnal-compliance.d.ts.map +0 -1
  113. package/core/dist/runtime-v2/nocturnal/nocturnal-compliance.js +0 -912
  114. package/core/dist/runtime-v2/nocturnal/nocturnal-compliance.js.map +0 -1
  115. package/core/dist/runtime-v2/nocturnal/snapshot-contract.d.ts +0 -192
  116. package/core/dist/runtime-v2/nocturnal/snapshot-contract.d.ts.map +0 -1
  117. package/core/dist/runtime-v2/nocturnal/snapshot-contract.js +0 -185
  118. package/core/dist/runtime-v2/nocturnal/snapshot-contract.js.map +0 -1
  119. package/core/dist/runtime-v2/nocturnal/trinity-types.d.ts +0 -421
  120. package/core/dist/runtime-v2/nocturnal/trinity-types.d.ts.map +0 -1
  121. package/core/dist/runtime-v2/nocturnal/trinity-types.js +0 -182
  122. package/core/dist/runtime-v2/nocturnal/trinity-types.js.map +0 -1
  123. package/pd-cli/dist/commands/runtime-idle-trigger.d.ts +0 -12
  124. package/pd-cli/dist/commands/runtime-idle-trigger.d.ts.map +0 -1
  125. package/pd-cli/dist/commands/runtime-idle-trigger.js +0 -102
  126. package/pd-cli/dist/commands/runtime-idle-trigger.js.map +0 -1
  127. package/plugin/dist/bundle.js +0 -2424
  128. package/plugin/dist/core/trajectory/index.js +0 -1804
  129. package/plugin/dist/openclaw.plugin.json +0 -65
  130. package/plugin/dist/templates/langs/en/core/AGENTS.md +0 -205
  131. package/plugin/dist/templates/langs/en/core/BOOT.md +0 -60
  132. package/plugin/dist/templates/langs/en/core/BOOTSTRAP.md +0 -273
  133. package/plugin/dist/templates/langs/en/core/HEARTBEAT.md +0 -74
  134. package/plugin/dist/templates/langs/en/core/IDENTITY.md +0 -8
  135. package/plugin/dist/templates/langs/en/core/PRINCIPLES.md +0 -10
  136. package/plugin/dist/templates/langs/en/core/SOUL.md +0 -46
  137. package/plugin/dist/templates/langs/en/core/TOOLS.md +0 -15
  138. package/plugin/dist/templates/langs/en/core/USER.md +0 -10
  139. package/plugin/dist/templates/langs/en/pain/00_seed_samples.md +0 -23
  140. package/plugin/dist/templates/langs/en/pain_dictionary.json +0 -22
  141. package/plugin/dist/templates/langs/en/principles/THINKING_OS.md +0 -64
  142. package/plugin/dist/templates/langs/en/skills/admin/SKILL.md +0 -39
  143. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/EXAMPLES.md +0 -63
  144. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/REFERENCE.md +0 -136
  145. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/SKILL.md +0 -67
  146. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/references/agent-registry.json +0 -143
  147. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/references/specs/bugfix-complex-template.json +0 -107
  148. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/references/specs/feature-complex-template.json +0 -107
  149. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/references/specs/workflow-validation-minimal-verify.json +0 -95
  150. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/references/specs/workflow-validation-minimal.json +0 -98
  151. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/references/workflow-v1-acceptance-checklist.md +0 -58
  152. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/references/workflow-v1.4-work-unit-handoff.md +0 -190
  153. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/runtime/.gitignore +0 -2
  154. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/scripts/lib/archive.mjs +0 -310
  155. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/scripts/lib/contract-enforcement.mjs +0 -683
  156. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/scripts/lib/decision.mjs +0 -604
  157. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/scripts/lib/state-store.mjs +0 -32
  158. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/scripts/lib/task-specs.mjs +0 -707
  159. package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/scripts/run.mjs +0 -3455
  160. package/plugin/dist/templates/langs/en/skills/bootstrap-tools/SKILL.md +0 -53
  161. package/plugin/dist/templates/langs/en/skills/deductive-audit/SKILL.md +0 -36
  162. package/plugin/dist/templates/langs/en/skills/evolution-framework-update/SKILL.md +0 -31
  163. package/plugin/dist/templates/langs/en/skills/evolve-system/SKILL.md +0 -46
  164. package/plugin/dist/templates/langs/en/skills/evolve-task/SKILL.md +0 -83
  165. package/plugin/dist/templates/langs/en/skills/feedback/SKILL.md +0 -51
  166. package/plugin/dist/templates/langs/en/skills/init-strategy/SKILL.md +0 -54
  167. package/plugin/dist/templates/langs/en/skills/inject-rule/SKILL.md +0 -19
  168. package/plugin/dist/templates/langs/en/skills/manage-okr/SKILL.md +0 -96
  169. package/plugin/dist/templates/langs/en/skills/pd-auditor/SKILL.md +0 -61
  170. package/plugin/dist/templates/langs/en/skills/pd-cli-operator/SKILL.md +0 -67
  171. package/plugin/dist/templates/langs/en/skills/pd-daily/SKILL.md +0 -199
  172. package/plugin/dist/templates/langs/en/skills/pd-diagnostician/SKILL.md +0 -466
  173. package/plugin/dist/templates/langs/en/skills/pd-explorer/SKILL.md +0 -65
  174. package/plugin/dist/templates/langs/en/skills/pd-grooming/SKILL.md +0 -46
  175. package/plugin/dist/templates/langs/en/skills/pd-implementer/SKILL.md +0 -68
  176. package/plugin/dist/templates/langs/en/skills/pd-mentor/SKILL.md +0 -230
  177. package/plugin/dist/templates/langs/en/skills/pd-pain-signal/SKILL.md +0 -30
  178. package/plugin/dist/templates/langs/en/skills/pd-planner/SKILL.md +0 -65
  179. package/plugin/dist/templates/langs/en/skills/pd-runtime-v2/SKILL.md +0 -61
  180. package/plugin/dist/templates/langs/en/skills/plan-script/SKILL.md +0 -32
  181. package/plugin/dist/templates/langs/en/skills/profile/SKILL.md +0 -24
  182. package/plugin/dist/templates/langs/en/skills/reflection/SKILL.md +0 -40
  183. package/plugin/dist/templates/langs/en/skills/reflection-log/SKILL.md +0 -37
  184. package/plugin/dist/templates/langs/en/skills/report/SKILL.md +0 -13
  185. package/plugin/dist/templates/langs/en/skills/root-cause/SKILL.md +0 -33
  186. package/plugin/dist/templates/langs/en/skills/triage/SKILL.md +0 -29
  187. package/plugin/dist/templates/langs/en/skills/watch-evolution/SKILL.md +0 -33
  188. package/plugin/dist/templates/langs/zh/core/AGENTS.md +0 -197
  189. package/plugin/dist/templates/langs/zh/core/BOOT.md +0 -60
  190. package/plugin/dist/templates/langs/zh/core/BOOTSTRAP.md +0 -273
  191. package/plugin/dist/templates/langs/zh/core/HEARTBEAT.md +0 -98
  192. package/plugin/dist/templates/langs/zh/core/IDENTITY.md +0 -8
  193. package/plugin/dist/templates/langs/zh/core/PRINCIPLES.md +0 -7
  194. package/plugin/dist/templates/langs/zh/core/SOUL.md +0 -46
  195. package/plugin/dist/templates/langs/zh/core/TOOLS.md +0 -15
  196. package/plugin/dist/templates/langs/zh/core/USER.md +0 -10
  197. package/plugin/dist/templates/langs/zh/pain/00_seed_samples.md +0 -24
  198. package/plugin/dist/templates/langs/zh/pain_dictionary.json +0 -18
  199. package/plugin/dist/templates/langs/zh/principles/THINKING_OS.md +0 -64
  200. package/plugin/dist/templates/langs/zh/skills/admin/SKILL.md +0 -41
  201. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/EXAMPLES.md +0 -63
  202. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/REFERENCE.md +0 -136
  203. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/SKILL.md +0 -67
  204. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/references/agent-registry.json +0 -143
  205. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/references/specs/bugfix-complex-template.json +0 -107
  206. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/references/specs/feature-complex-template.json +0 -107
  207. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/references/specs/nocturnal-trinity-quality-enhancement.json +0 -111
  208. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/references/specs/workflow-validation-minimal-verify.json +0 -95
  209. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/references/specs/workflow-validation-minimal.json +0 -98
  210. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/references/workflow-v1-acceptance-checklist.md +0 -58
  211. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/references/workflow-v1.4-work-unit-handoff.md +0 -190
  212. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/runtime/.gitignore +0 -2
  213. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/scripts/lib/archive.mjs +0 -310
  214. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/scripts/lib/contract-enforcement.mjs +0 -683
  215. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/scripts/lib/decision.mjs +0 -604
  216. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/scripts/lib/state-store.mjs +0 -32
  217. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/scripts/lib/task-specs.mjs +0 -707
  218. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/scripts/run.mjs +0 -3455
  219. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/test/archive.test.mjs +0 -230
  220. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/test/contract-enforcement.test.mjs +0 -672
  221. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/test/decision.test.mjs +0 -1321
  222. package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/test/run.test.mjs +0 -1435
  223. package/plugin/dist/templates/langs/zh/skills/bootstrap-tools/SKILL.md +0 -52
  224. package/plugin/dist/templates/langs/zh/skills/deductive-audit/SKILL.md +0 -36
  225. package/plugin/dist/templates/langs/zh/skills/evolution-framework-update/SKILL.md +0 -31
  226. package/plugin/dist/templates/langs/zh/skills/evolve-system/SKILL.md +0 -46
  227. package/plugin/dist/templates/langs/zh/skills/evolve-task/SKILL.md +0 -83
  228. package/plugin/dist/templates/langs/zh/skills/feedback/SKILL.md +0 -53
  229. package/plugin/dist/templates/langs/zh/skills/init-strategy/SKILL.md +0 -54
  230. package/plugin/dist/templates/langs/zh/skills/inject-rule/SKILL.md +0 -19
  231. package/plugin/dist/templates/langs/zh/skills/manage-okr/SKILL.md +0 -109
  232. package/plugin/dist/templates/langs/zh/skills/pd-auditor/SKILL.md +0 -61
  233. package/plugin/dist/templates/langs/zh/skills/pd-cli-operator/SKILL.md +0 -67
  234. package/plugin/dist/templates/langs/zh/skills/pd-daily/SKILL.md +0 -283
  235. package/plugin/dist/templates/langs/zh/skills/pd-diagnostician/SKILL.md +0 -391
  236. package/plugin/dist/templates/langs/zh/skills/pd-explorer/SKILL.md +0 -65
  237. package/plugin/dist/templates/langs/zh/skills/pd-grooming/SKILL.md +0 -46
  238. package/plugin/dist/templates/langs/zh/skills/pd-implementer/SKILL.md +0 -68
  239. package/plugin/dist/templates/langs/zh/skills/pd-mentor/SKILL.md +0 -230
  240. package/plugin/dist/templates/langs/zh/skills/pd-pain-signal/SKILL.md +0 -30
  241. package/plugin/dist/templates/langs/zh/skills/pd-planner/SKILL.md +0 -65
  242. package/plugin/dist/templates/langs/zh/skills/pd-runtime-v2/SKILL.md +0 -61
  243. package/plugin/dist/templates/langs/zh/skills/plan-script/SKILL.md +0 -32
  244. package/plugin/dist/templates/langs/zh/skills/profile/SKILL.md +0 -24
  245. package/plugin/dist/templates/langs/zh/skills/reflection/SKILL.md +0 -40
  246. package/plugin/dist/templates/langs/zh/skills/reflection-log/SKILL.md +0 -37
  247. package/plugin/dist/templates/langs/zh/skills/report/SKILL.md +0 -13
  248. package/plugin/dist/templates/langs/zh/skills/root-cause/SKILL.md +0 -33
  249. package/plugin/dist/templates/langs/zh/skills/triage/SKILL.md +0 -29
  250. package/plugin/dist/templates/langs/zh/skills/watch-evolution/SKILL.md +0 -33
  251. package/plugin/dist/templates/pain_dictionary.json +0 -36
  252. package/plugin/dist/templates/pain_settings.json +0 -103
  253. package/plugin/dist/templates/workspace/.principles/DECISION_POLICY.json +0 -44
  254. package/plugin/dist/templates/workspace/.principles/PRINCIPLES.md +0 -20
  255. package/plugin/dist/templates/workspace/.principles/PROFILE.json +0 -54
  256. package/plugin/dist/templates/workspace/.principles/PROFILE.schema.json +0 -56
  257. package/plugin/dist/templates/workspace/.principles/THINKING_OS.md +0 -64
  258. package/plugin/dist/templates/workspace/.principles/THINKING_OS_ARCHIVE.md +0 -7
  259. package/plugin/dist/templates/workspace/.principles/THINKING_OS_CANDIDATES.md +0 -9
  260. package/plugin/dist/templates/workspace/.principles/models/_INDEX.md +0 -27
  261. package/plugin/dist/templates/workspace/.principles/models/first_principles.md +0 -62
  262. package/plugin/dist/templates/workspace/.principles/models/marketing_4p.md +0 -52
  263. package/plugin/dist/templates/workspace/.principles/models/porter_five.md +0 -63
  264. package/plugin/dist/templates/workspace/.principles/models/swot.md +0 -60
  265. package/plugin/dist/templates/workspace/.principles/models/user_story_map.md +0 -63
  266. package/plugin/dist/templates/workspace/.state/WORKBOARD.json +0 -4
  267. package/plugin/dist/templates/workspace/AUDIT.md +0 -15
  268. package/plugin/dist/templates/workspace/PLAN.md +0 -2
  269. package/plugin/dist/templates/workspace/okr/CURRENT_FOCUS.md +0 -57
  270. package/plugin/dist/templates/workspace/okr/RECOVERY_PROTOCOL.md +0 -56
  271. package/plugin/dist/templates/workspace/okr/TASK_CHANGES.jsonl +0 -6
  272. package/plugin/dist/templates/workspace/okr/WEEK_TASKS.json +0 -6
@@ -1,230 +0,0 @@
1
- import test from 'node:test';
2
- import assert from 'node:assert/strict';
3
- import fs from 'fs';
4
- import path from 'path';
5
- import os from 'os';
6
- import { fileURLToPath } from 'url';
7
- import { archiveRunById } from '../scripts/lib/archive.mjs';
8
-
9
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
10
-
11
- function makeMockRunDir() {
12
- const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'archive-test-'));
13
- const runDir = path.join(tmpDir, 'run');
14
-
15
- // Create minimal sprint structure
16
- fs.mkdirSync(path.join(runDir, 'stages', '01-investigate'), { recursive: true });
17
-
18
- const state = {
19
- runId: 'test-run-001',
20
- taskId: 'test-task',
21
- title: 'Test sprint',
22
- status: 'completed',
23
- currentStageIndex: 0,
24
- currentStage: 'investigate',
25
- currentRound: 1,
26
- createdAt: '2026-04-01T00:00:00.000Z',
27
- updatedAt: '2026-04-01T00:10:00.000Z',
28
- };
29
- fs.writeFileSync(path.join(runDir, 'sprint.json'), JSON.stringify(state, null, 2));
30
-
31
- // Scorecard
32
- fs.writeFileSync(path.join(runDir, 'stages', '01-investigate', 'scorecard.json'), JSON.stringify({
33
- stage: 'investigate',
34
- round: 1,
35
- outcome: 'advance',
36
- approvalCount: 2,
37
- blockerCount: 0,
38
- reviewerAVerdict: 'APPROVE',
39
- reviewerBVerdict: 'APPROVE',
40
- }));
41
-
42
- // Timeline
43
- fs.writeFileSync(path.join(runDir, 'timeline.md'), '# Timeline\n\n- 2026-04-01T00:00:00Z Started\n');
44
-
45
- return { tmpDir, runDir, state };
46
- }
47
-
48
- function cleanup(tmpDir) {
49
- fs.rmSync(tmpDir, { recursive: true, force: true });
50
- }
51
-
52
- test('archiveRun creates archive with all expected files', () => {
53
- const { tmpDir, runDir } = makeMockRunDir();
54
- const archiveDest = path.join(tmpDir, 'archive', 'test-run-001');
55
-
56
- try {
57
- // Monkey-patch sprintRoot to use our temp dir
58
- const result = archiveRunWithTmpRoot(runDir, 'test-run-001', tmpDir);
59
-
60
- assert.ok(fs.existsSync(result));
61
- assert.ok(fs.existsSync(path.join(result, 'archive-summary.md')));
62
- assert.ok(fs.existsSync(path.join(result, 'archive-meta.json')));
63
- assert.ok(fs.existsSync(path.join(result, 'sprint.json')));
64
- assert.ok(fs.existsSync(path.join(result, 'timeline.md')));
65
- assert.ok(fs.existsSync(path.join(result, 'stages', '01-investigate', 'scorecard.json')));
66
- assert.ok(fs.existsSync(path.join(result, 'git', 'branch.txt')));
67
-
68
- // Verify meta
69
- const meta = JSON.parse(fs.readFileSync(path.join(result, 'archive-meta.json'), 'utf8'));
70
- assert.equal(meta.status, 'completed');
71
- assert.equal(meta.runId, 'test-run-001');
72
- } finally {
73
- cleanup(tmpDir);
74
- }
75
- });
76
-
77
- test('archiveRun rejects second archive (idempotency)', () => {
78
- const { tmpDir, runDir } = makeMockRunDir();
79
-
80
- try {
81
- archiveRunWithTmpRoot(runDir, 'test-run-001', tmpDir);
82
- // Second call should throw
83
- let threw = false;
84
- try {
85
- archiveRunWithTmpRoot(runDir, 'test-run-001', tmpDir);
86
- } catch (e) {
87
- threw = true;
88
- assert.match(e.message, /Already archived/);
89
- }
90
- assert.ok(threw, 'Expected "Already archived" error on second archive');
91
- } finally {
92
- cleanup(tmpDir);
93
- }
94
- });
95
-
96
- test('archiveRunById throws for non-existent run', () => {
97
- assert.throws(() => archiveRunById('nonexistent-run-99999'), /Run not found/);
98
- });
99
-
100
- test('archive-summary.md contains stage progress table', () => {
101
- const { tmpDir, runDir } = makeMockRunDir();
102
-
103
- try {
104
- const result = archiveRunWithTmpRoot(runDir, 'test-run-001', tmpDir);
105
- const summary = fs.readFileSync(path.join(result, 'archive-summary.md'), 'utf8');
106
-
107
- assert.ok(summary.includes('Stage Progress'));
108
- assert.ok(summary.includes('investigate'));
109
- assert.ok(summary.includes('advance'));
110
- assert.ok(summary.includes('APPROVE'));
111
- assert.ok(summary.includes('Total wall time'));
112
- } finally {
113
- cleanup(tmpDir);
114
- }
115
- });
116
-
117
- test('archive handles empty stages gracefully', () => {
118
- const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'archive-test-'));
119
- const runDir = path.join(tmpDir, 'run');
120
-
121
- fs.mkdirSync(path.join(runDir, 'stages'), { recursive: true });
122
- fs.writeFileSync(path.join(runDir, 'sprint.json'), JSON.stringify({
123
- runId: 'empty-stages',
124
- taskId: 'test',
125
- title: 'Empty stages test',
126
- status: 'halted',
127
- currentStageIndex: 0,
128
- currentStage: 'investigate',
129
- currentRound: 1,
130
- haltReason: { type: 'test', details: 'just testing', blockers: [] },
131
- createdAt: '2026-04-01T00:00:00.000Z',
132
- updatedAt: '2026-04-01T00:05:00.000Z',
133
- }));
134
- fs.writeFileSync(path.join(runDir, 'timeline.md'), '# Timeline\n');
135
-
136
- try {
137
- const result = archiveRunWithTmpRoot(runDir, 'empty-stages', tmpDir);
138
- const summary = fs.readFileSync(path.join(result, 'archive-summary.md'), 'utf8');
139
- assert.ok(summary.includes('No stage scorecards found'));
140
- assert.ok(summary.includes('Halt Reason'));
141
- } finally {
142
- cleanup(tmpDir);
143
- }
144
- });
145
-
146
- /**
147
- * Helper: run archiveRun with a custom archive root (temp dir).
148
- * We directly call the module's archiveRun but override the archiveRoot.
149
- */
150
- function archiveRunWithTmpRoot(runDir, runId, tmpRoot) {
151
- const destDir = path.join(tmpRoot, 'archive', runId);
152
-
153
- // Check idempotency
154
- const metaPath = path.join(destDir, 'archive-meta.json');
155
- if (fs.existsSync(metaPath)) {
156
- const meta = JSON.parse(fs.readFileSync(metaPath, 'utf8'));
157
- if (meta.status === 'completed') {
158
- throw new Error(`Already archived: ${destDir}`);
159
- }
160
- fs.rmSync(destDir, { recursive: true, force: true });
161
- }
162
-
163
- const state = JSON.parse(fs.readFileSync(path.join(runDir, 'sprint.json'), 'utf8'));
164
-
165
- fs.mkdirSync(destDir, { recursive: true });
166
- try {
167
- fs.cpSync(runDir, destDir, { recursive: true });
168
- } catch {
169
- // Fallback
170
- }
171
-
172
- // Simulate git capture (just write a placeholder)
173
- const gitDir = path.join(destDir, 'git');
174
- fs.mkdirSync(gitDir, { recursive: true });
175
- fs.writeFileSync(path.join(gitDir, 'branch.txt'), 'test-branch\n');
176
- fs.writeFileSync(path.join(gitDir, 'log.txt'), 'abc123 test commit\n');
177
- fs.writeFileSync(path.join(gitDir, 'modified-files.txt'), 'src/test.ts\n');
178
- fs.writeFileSync(path.join(gitDir, 'diff.patch'), '');
179
- fs.writeFileSync(path.join(gitDir, 'status.txt'), 'M src/test.ts\n');
180
-
181
- // Generate summary inline (same logic as archive.mjs)
182
- const lines = [
183
- `# Sprint Archive: ${state.title || state.taskId}`,
184
- '',
185
- '## Identity',
186
- `- Run ID: ${state.runId}`,
187
- `- Task: ${state.taskId}`,
188
- `- Status: ${state.status}`,
189
- `- Archived at: ${new Date().toISOString()}`,
190
- '',
191
- '## Timeline',
192
- `- Created: ${state.createdAt}`,
193
- `- Updated: ${state.updatedAt}`,
194
- `- Total wall time: ${((Date.parse(state.updatedAt) - Date.parse(state.createdAt)) / 60000).toFixed(1)} minutes`,
195
- '',
196
- ];
197
-
198
- // Stage progress
199
- const stagesDir = path.join(destDir, 'stages');
200
- const stageEntries = [];
201
- if (fs.existsSync(stagesDir)) {
202
- for (const dir of fs.readdirSync(stagesDir).sort()) {
203
- const scPath = path.join(stagesDir, dir, 'scorecard.json');
204
- if (fs.existsSync(scPath)) {
205
- const sc = JSON.parse(fs.readFileSync(scPath, 'utf8'));
206
- stageEntries.push({ dir, ...sc });
207
- }
208
- }
209
- }
210
-
211
- lines.push('## Stage Progress');
212
- if (stageEntries.length > 0) {
213
- lines.push('| Stage | Outcome | Round | Approvals | Blockers | Reviewer A | Reviewer B |');
214
- lines.push('|-------|---------|-------|-----------|----------|-----------|-----------|');
215
- for (const s of stageEntries) {
216
- lines.push(`| ${s.dir} | ${s.outcome} | ${s.round} | ${s.approvalCount}/2 | ${s.blockerCount ?? 0} | ${s.reviewerAVerdict} | ${s.reviewerBVerdict} |`);
217
- }
218
- } else {
219
- lines.push('No stage scorecards found.');
220
- }
221
-
222
- if (state.haltReason) {
223
- lines.push('', '## Halt Reason', `- Type: ${state.haltReason.type}`, `- Details: ${state.haltReason.details}`);
224
- }
225
-
226
- fs.writeFileSync(path.join(destDir, 'archive-summary.md'), lines.join('\n') + '\n');
227
- fs.writeFileSync(metaPath, JSON.stringify({ runId, archivedAt: new Date().toISOString(), status: 'completed' }));
228
-
229
- return destDir;
230
- }