create-principles-disciple 1.112.2 → 1.113.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 (347) hide show
  1. package/console/dist/server/routes/update.js +43 -0
  2. package/core/dist/runtime-v2/__tests__/activation-compatibility-read-model.test.d.ts +2 -0
  3. package/core/dist/runtime-v2/__tests__/activation-compatibility-read-model.test.d.ts.map +1 -0
  4. package/core/dist/runtime-v2/__tests__/activation-compatibility-read-model.test.js +148 -0
  5. package/core/dist/runtime-v2/__tests__/activation-compatibility-read-model.test.js.map +1 -0
  6. package/core/dist/runtime-v2/__tests__/architecture-regression.test.js +13 -3
  7. package/core/dist/runtime-v2/__tests__/architecture-regression.test.js.map +1 -1
  8. package/core/dist/runtime-v2/__tests__/evaluator-repair-loop.test.js +14 -6
  9. package/core/dist/runtime-v2/__tests__/evaluator-repair-loop.test.js.map +1 -1
  10. package/core/dist/runtime-v2/__tests__/evaluator-runner-vslice-v2.test.js +1 -0
  11. package/core/dist/runtime-v2/__tests__/evaluator-runner-vslice-v2.test.js.map +1 -1
  12. package/core/dist/runtime-v2/__tests__/evaluator-runner-vslice.test.js +5 -0
  13. package/core/dist/runtime-v2/__tests__/evaluator-runner-vslice.test.js.map +1 -1
  14. package/core/dist/runtime-v2/__tests__/golden-trace.test.js +2 -2
  15. package/core/dist/runtime-v2/__tests__/golden-trace.test.js.map +1 -1
  16. package/core/dist/runtime-v2/__tests__/internalization-contracts.test.js +4 -6
  17. package/core/dist/runtime-v2/__tests__/internalization-contracts.test.js.map +1 -1
  18. package/core/dist/runtime-v2/__tests__/internalization-orchestrator.test.js +4 -1
  19. package/core/dist/runtime-v2/__tests__/internalization-orchestrator.test.js.map +1 -1
  20. package/core/dist/runtime-v2/__tests__/internalization-state-machine.test.js +3 -2
  21. package/core/dist/runtime-v2/__tests__/internalization-state-machine.test.js.map +1 -1
  22. package/core/dist/runtime-v2/__tests__/pain-to-principle-service.test.js +47 -0
  23. package/core/dist/runtime-v2/__tests__/pain-to-principle-service.test.js.map +1 -1
  24. package/core/dist/runtime-v2/__tests__/rollout-reviewer-runner-vslice.test.js +66 -1
  25. package/core/dist/runtime-v2/__tests__/rollout-reviewer-runner-vslice.test.js.map +1 -1
  26. package/core/dist/runtime-v2/__tests__/rollout-reviewer-verdict-paths.test.d.ts +2 -0
  27. package/core/dist/runtime-v2/__tests__/rollout-reviewer-verdict-paths.test.d.ts.map +1 -0
  28. package/core/dist/runtime-v2/__tests__/rollout-reviewer-verdict-paths.test.js +234 -0
  29. package/core/dist/runtime-v2/__tests__/rollout-reviewer-verdict-paths.test.js.map +1 -0
  30. package/core/dist/runtime-v2/__tests__/rule-host-evaluator.test.js +4 -4
  31. package/core/dist/runtime-v2/__tests__/rule-host-evaluator.test.js.map +1 -1
  32. package/core/dist/runtime-v2/__tests__/story-a-demo.test.js +8 -8
  33. package/core/dist/runtime-v2/__tests__/story-a-demo.test.js.map +1 -1
  34. package/core/dist/runtime-v2/activation/__tests__/prompt-activation-reader-contract.test.js +23 -1
  35. package/core/dist/runtime-v2/activation/__tests__/prompt-activation-reader-contract.test.js.map +1 -1
  36. package/core/dist/runtime-v2/activation/prompt-activation-reader-contract.d.ts +11 -0
  37. package/core/dist/runtime-v2/activation/prompt-activation-reader-contract.d.ts.map +1 -1
  38. package/core/dist/runtime-v2/activation/prompt-activation-reader-contract.js +11 -4
  39. package/core/dist/runtime-v2/activation/prompt-activation-reader-contract.js.map +1 -1
  40. package/core/dist/runtime-v2/activation/writers/__tests__/rule-host-writer.test.js +31 -0
  41. package/core/dist/runtime-v2/activation/writers/__tests__/rule-host-writer.test.js.map +1 -1
  42. package/core/dist/runtime-v2/activation-compatibility-read-model.d.ts +24 -0
  43. package/core/dist/runtime-v2/activation-compatibility-read-model.d.ts.map +1 -0
  44. package/core/dist/runtime-v2/activation-compatibility-read-model.js +132 -0
  45. package/core/dist/runtime-v2/activation-compatibility-read-model.js.map +1 -0
  46. package/core/dist/runtime-v2/adapter/output-schema-registry.d.ts.map +1 -1
  47. package/core/dist/runtime-v2/adapter/output-schema-registry.js +2 -0
  48. package/core/dist/runtime-v2/adapter/output-schema-registry.js.map +1 -1
  49. package/core/dist/runtime-v2/config/__tests__/pd-validate-profile-legacy-keys.test.d.ts +13 -0
  50. package/core/dist/runtime-v2/config/__tests__/pd-validate-profile-legacy-keys.test.d.ts.map +1 -0
  51. package/core/dist/runtime-v2/config/__tests__/pd-validate-profile-legacy-keys.test.js +73 -0
  52. package/core/dist/runtime-v2/config/__tests__/pd-validate-profile-legacy-keys.test.js.map +1 -0
  53. package/core/dist/runtime-v2/config/pd-config-types.d.ts +0 -23
  54. package/core/dist/runtime-v2/config/pd-config-types.d.ts.map +1 -1
  55. package/core/dist/runtime-v2/config/pd-config-types.js.map +1 -1
  56. package/core/dist/runtime-v2/config/pd-profile-constants.d.ts +11 -5
  57. package/core/dist/runtime-v2/config/pd-profile-constants.d.ts.map +1 -1
  58. package/core/dist/runtime-v2/config/pd-profile-constants.js +10 -45
  59. package/core/dist/runtime-v2/config/pd-profile-constants.js.map +1 -1
  60. package/core/dist/runtime-v2/config/pd-validate-profile.d.ts.map +1 -1
  61. package/core/dist/runtime-v2/config/pd-validate-profile.js +27 -135
  62. package/core/dist/runtime-v2/config/pd-validate-profile.js.map +1 -1
  63. package/core/dist/runtime-v2/core-principles/core-principle-registry.d.ts +4 -4
  64. package/core/dist/runtime-v2/core-principles/core-principle-registry.d.ts.map +1 -1
  65. package/core/dist/runtime-v2/core-principles/core-principle-registry.js +2 -2
  66. package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.js +7 -2
  67. package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.js.map +1 -1
  68. package/core/dist/runtime-v2/feature-flags/feature-flag-contract.d.ts.map +1 -1
  69. package/core/dist/runtime-v2/feature-flags/feature-flag-contract.js +9 -5
  70. package/core/dist/runtime-v2/feature-flags/feature-flag-contract.js.map +1 -1
  71. package/core/dist/runtime-v2/golden-trace-replay-validator.d.ts.map +1 -1
  72. package/core/dist/runtime-v2/golden-trace-replay-validator.js +0 -2
  73. package/core/dist/runtime-v2/golden-trace-replay-validator.js.map +1 -1
  74. package/core/dist/runtime-v2/golden-trace.d.ts.map +1 -1
  75. package/core/dist/runtime-v2/golden-trace.js +0 -3
  76. package/core/dist/runtime-v2/golden-trace.js.map +1 -1
  77. package/core/dist/runtime-v2/index.d.ts +16 -10
  78. package/core/dist/runtime-v2/index.d.ts.map +1 -1
  79. package/core/dist/runtime-v2/index.js +10 -7
  80. package/core/dist/runtime-v2/index.js.map +1 -1
  81. package/core/dist/runtime-v2/internalization/__tests__/a-liveness-reconciliation.test.d.ts +2 -0
  82. package/core/dist/runtime-v2/internalization/__tests__/a-liveness-reconciliation.test.d.ts.map +1 -0
  83. package/core/dist/runtime-v2/internalization/__tests__/a-liveness-reconciliation.test.js +157 -0
  84. package/core/dist/runtime-v2/internalization/__tests__/a-liveness-reconciliation.test.js.map +1 -0
  85. package/core/dist/runtime-v2/internalization/__tests__/c2-live-runner-chain.test.js +29 -0
  86. package/core/dist/runtime-v2/internalization/__tests__/c2-live-runner-chain.test.js.map +1 -1
  87. package/core/dist/runtime-v2/internalization/__tests__/crash-liveness-regressions.test.d.ts +2 -0
  88. package/core/dist/runtime-v2/internalization/__tests__/crash-liveness-regressions.test.d.ts.map +1 -0
  89. package/core/dist/runtime-v2/internalization/__tests__/crash-liveness-regressions.test.js +311 -0
  90. package/core/dist/runtime-v2/internalization/__tests__/crash-liveness-regressions.test.js.map +1 -0
  91. package/core/dist/runtime-v2/internalization/__tests__/external-review-p0-regressions.test.d.ts +2 -0
  92. package/core/dist/runtime-v2/internalization/__tests__/external-review-p0-regressions.test.d.ts.map +1 -0
  93. package/core/dist/runtime-v2/internalization/__tests__/external-review-p0-regressions.test.js +171 -0
  94. package/core/dist/runtime-v2/internalization/__tests__/external-review-p0-regressions.test.js.map +1 -0
  95. package/core/dist/runtime-v2/internalization/__tests__/internalization-task-guards.test.js +11 -2
  96. package/core/dist/runtime-v2/internalization/__tests__/internalization-task-guards.test.js.map +1 -1
  97. package/core/dist/runtime-v2/internalization/__tests__/internalization-transition-decision.test.d.ts +2 -0
  98. package/core/dist/runtime-v2/internalization/__tests__/internalization-transition-decision.test.d.ts.map +1 -0
  99. package/core/dist/runtime-v2/internalization/__tests__/internalization-transition-decision.test.js +335 -0
  100. package/core/dist/runtime-v2/internalization/__tests__/internalization-transition-decision.test.js.map +1 -0
  101. package/core/dist/runtime-v2/internalization/__tests__/legacy-rule-contract-scanner.test.d.ts +2 -0
  102. package/core/dist/runtime-v2/internalization/__tests__/legacy-rule-contract-scanner.test.d.ts.map +1 -0
  103. package/core/dist/runtime-v2/internalization/__tests__/legacy-rule-contract-scanner.test.js +101 -0
  104. package/core/dist/runtime-v2/internalization/__tests__/legacy-rule-contract-scanner.test.js.map +1 -0
  105. package/core/dist/runtime-v2/internalization/__tests__/mvp-core-loop-journeys.test.d.ts +2 -0
  106. package/core/dist/runtime-v2/internalization/__tests__/mvp-core-loop-journeys.test.d.ts.map +1 -0
  107. package/core/dist/runtime-v2/internalization/__tests__/mvp-core-loop-journeys.test.js +515 -0
  108. package/core/dist/runtime-v2/internalization/__tests__/mvp-core-loop-journeys.test.js.map +1 -0
  109. package/core/dist/runtime-v2/internalization/__tests__/restart-safety.e2e.test.d.ts +2 -0
  110. package/core/dist/runtime-v2/internalization/__tests__/restart-safety.e2e.test.d.ts.map +1 -0
  111. package/core/dist/runtime-v2/internalization/__tests__/restart-safety.e2e.test.js +167 -0
  112. package/core/dist/runtime-v2/internalization/__tests__/restart-safety.e2e.test.js.map +1 -0
  113. package/core/dist/runtime-v2/internalization/__tests__/verdict-drift-regressions.test.d.ts +2 -0
  114. package/core/dist/runtime-v2/internalization/__tests__/verdict-drift-regressions.test.d.ts.map +1 -0
  115. package/core/dist/runtime-v2/internalization/__tests__/verdict-drift-regressions.test.js +601 -0
  116. package/core/dist/runtime-v2/internalization/__tests__/verdict-drift-regressions.test.js.map +1 -0
  117. package/core/dist/runtime-v2/internalization/artificer-runner.d.ts +7 -0
  118. package/core/dist/runtime-v2/internalization/artificer-runner.d.ts.map +1 -1
  119. package/core/dist/runtime-v2/internalization/artificer-runner.js +18 -2
  120. package/core/dist/runtime-v2/internalization/artificer-runner.js.map +1 -1
  121. package/core/dist/runtime-v2/internalization/evaluator-runner.d.ts +49 -0
  122. package/core/dist/runtime-v2/internalization/evaluator-runner.d.ts.map +1 -1
  123. package/core/dist/runtime-v2/internalization/evaluator-runner.js +390 -98
  124. package/core/dist/runtime-v2/internalization/evaluator-runner.js.map +1 -1
  125. package/core/dist/runtime-v2/internalization/index.d.ts +2 -0
  126. package/core/dist/runtime-v2/internalization/index.d.ts.map +1 -1
  127. package/core/dist/runtime-v2/internalization/index.js +1 -0
  128. package/core/dist/runtime-v2/internalization/index.js.map +1 -1
  129. package/core/dist/runtime-v2/internalization/internalization-orchestrator.d.ts +127 -0
  130. package/core/dist/runtime-v2/internalization/internalization-orchestrator.d.ts.map +1 -1
  131. package/core/dist/runtime-v2/internalization/internalization-orchestrator.js +345 -1
  132. package/core/dist/runtime-v2/internalization/internalization-orchestrator.js.map +1 -1
  133. package/core/dist/runtime-v2/internalization/internalization-task-guards.d.ts +9 -2
  134. package/core/dist/runtime-v2/internalization/internalization-task-guards.d.ts.map +1 -1
  135. package/core/dist/runtime-v2/internalization/internalization-task-guards.js +14 -3
  136. package/core/dist/runtime-v2/internalization/internalization-task-guards.js.map +1 -1
  137. package/core/dist/runtime-v2/internalization/internalization-transition-decision.d.ts +61 -0
  138. package/core/dist/runtime-v2/internalization/internalization-transition-decision.d.ts.map +1 -0
  139. package/core/dist/runtime-v2/internalization/internalization-transition-decision.js +84 -0
  140. package/core/dist/runtime-v2/internalization/internalization-transition-decision.js.map +1 -0
  141. package/core/dist/runtime-v2/internalization/legacy-rule-contract-scanner.d.ts +51 -0
  142. package/core/dist/runtime-v2/internalization/legacy-rule-contract-scanner.d.ts.map +1 -0
  143. package/core/dist/runtime-v2/internalization/legacy-rule-contract-scanner.js +81 -0
  144. package/core/dist/runtime-v2/internalization/legacy-rule-contract-scanner.js.map +1 -0
  145. package/core/dist/runtime-v2/internalization/peer-runner-contracts.d.ts +17 -1
  146. package/core/dist/runtime-v2/internalization/peer-runner-contracts.d.ts.map +1 -1
  147. package/core/dist/runtime-v2/internalization/peer-runner-contracts.js.map +1 -1
  148. package/core/dist/runtime-v2/internalization/pitask-metadata.d.ts +99 -2
  149. package/core/dist/runtime-v2/internalization/pitask-metadata.d.ts.map +1 -1
  150. package/core/dist/runtime-v2/internalization/pitask-metadata.js +148 -0
  151. package/core/dist/runtime-v2/internalization/pitask-metadata.js.map +1 -1
  152. package/core/dist/runtime-v2/internalization/refiner-sandbox-wrapper.d.ts.map +1 -1
  153. package/core/dist/runtime-v2/internalization/refiner-sandbox-wrapper.js +0 -2
  154. package/core/dist/runtime-v2/internalization/refiner-sandbox-wrapper.js.map +1 -1
  155. package/core/dist/runtime-v2/internalization/rollout-reviewer-runner.d.ts +147 -0
  156. package/core/dist/runtime-v2/internalization/rollout-reviewer-runner.d.ts.map +1 -1
  157. package/core/dist/runtime-v2/internalization/rollout-reviewer-runner.js +672 -1
  158. package/core/dist/runtime-v2/internalization/rollout-reviewer-runner.js.map +1 -1
  159. package/core/dist/runtime-v2/internalization/rule-host-contracts.d.ts +0 -3
  160. package/core/dist/runtime-v2/internalization/rule-host-contracts.d.ts.map +1 -1
  161. package/core/dist/runtime-v2/internalization/rule-host-helpers.d.ts +4 -2
  162. package/core/dist/runtime-v2/internalization/rule-host-helpers.d.ts.map +1 -1
  163. package/core/dist/runtime-v2/internalization/rule-host-helpers.js +4 -2
  164. package/core/dist/runtime-v2/internalization/rule-host-helpers.js.map +1 -1
  165. package/core/dist/runtime-v2/internalization/scribe-runner.d.ts +2 -0
  166. package/core/dist/runtime-v2/internalization/scribe-runner.d.ts.map +1 -1
  167. package/core/dist/runtime-v2/internalization/scribe-runner.js +21 -1
  168. package/core/dist/runtime-v2/internalization/scribe-runner.js.map +1 -1
  169. package/core/dist/runtime-v2/pain-signal-observability.js +3 -3
  170. package/core/dist/runtime-v2/pain-signal-observability.js.map +1 -1
  171. package/core/dist/runtime-v2/runner/base-peer-runner.d.ts +9 -0
  172. package/core/dist/runtime-v2/runner/base-peer-runner.d.ts.map +1 -1
  173. package/core/dist/runtime-v2/runner/base-peer-runner.js +22 -0
  174. package/core/dist/runtime-v2/runner/base-peer-runner.js.map +1 -1
  175. package/core/dist/runtime-v2/signal-collector/__tests__/llm-payload-contract.test.d.ts +2 -0
  176. package/core/dist/runtime-v2/signal-collector/__tests__/llm-payload-contract.test.d.ts.map +1 -0
  177. package/core/dist/runtime-v2/signal-collector/__tests__/llm-payload-contract.test.js +130 -0
  178. package/core/dist/runtime-v2/signal-collector/__tests__/llm-payload-contract.test.js.map +1 -0
  179. package/core/dist/runtime-v2/signal-collector/index.d.ts +1 -1
  180. package/core/dist/runtime-v2/signal-collector/index.d.ts.map +1 -1
  181. package/core/dist/runtime-v2/signal-collector/index.js +1 -1
  182. package/core/dist/runtime-v2/signal-collector/index.js.map +1 -1
  183. package/core/dist/runtime-v2/signal-collector/llm-stage.d.ts +15 -0
  184. package/core/dist/runtime-v2/signal-collector/llm-stage.d.ts.map +1 -1
  185. package/core/dist/runtime-v2/signal-collector/llm-stage.js +28 -0
  186. package/core/dist/runtime-v2/signal-collector/llm-stage.js.map +1 -1
  187. package/core/dist/runtime-v2/signal-collector/types.d.ts +9 -1
  188. package/core/dist/runtime-v2/signal-collector/types.d.ts.map +1 -1
  189. package/core/dist/runtime-v2/signal-collector/types.js +13 -1
  190. package/core/dist/runtime-v2/signal-collector/types.js.map +1 -1
  191. package/core/dist/runtime-v2/store/reconciliation-cursor-store.d.ts +23 -0
  192. package/core/dist/runtime-v2/store/reconciliation-cursor-store.d.ts.map +1 -0
  193. package/core/dist/runtime-v2/store/reconciliation-cursor-store.js +34 -0
  194. package/core/dist/runtime-v2/store/reconciliation-cursor-store.js.map +1 -0
  195. package/core/dist/runtime-v2/store/sqlite-connection.d.ts.map +1 -1
  196. package/core/dist/runtime-v2/store/sqlite-connection.js +7 -0
  197. package/core/dist/runtime-v2/store/sqlite-connection.js.map +1 -1
  198. package/core/dist/runtime-v2/store/task/memory-task-store.d.ts.map +1 -1
  199. package/core/dist/runtime-v2/store/task/memory-task-store.js +22 -0
  200. package/core/dist/runtime-v2/store/task/memory-task-store.js.map +1 -1
  201. package/core/dist/runtime-v2/store/task/sqlite-task-store.d.ts.map +1 -1
  202. package/core/dist/runtime-v2/store/task/sqlite-task-store.js +20 -0
  203. package/core/dist/runtime-v2/store/task/sqlite-task-store.js.map +1 -1
  204. package/core/dist/runtime-v2/store/task/task-store.d.ts +14 -0
  205. package/core/dist/runtime-v2/store/task/task-store.d.ts.map +1 -1
  206. package/core/dist/runtime-v2/story-a-demo.d.ts.map +1 -1
  207. package/core/dist/runtime-v2/story-a-demo.js +2 -0
  208. package/core/dist/runtime-v2/story-a-demo.js.map +1 -1
  209. package/core/dist/runtime-v2/tools/artificer-l2-tool-contract.d.ts.map +1 -1
  210. package/core/dist/runtime-v2/tools/artificer-l2-tool-contract.js +0 -4
  211. package/core/dist/runtime-v2/tools/artificer-l2-tool-contract.js.map +1 -1
  212. package/core/dist/runtime-v2/types/event-payload.d.ts +1 -20
  213. package/core/dist/runtime-v2/types/event-payload.d.ts.map +1 -1
  214. package/core/dist/runtime-v2/types/event-payload.js +0 -12
  215. package/core/dist/runtime-v2/types/event-payload.js.map +1 -1
  216. package/core/dist/runtime-v2/types/event-types.d.ts +3 -18
  217. package/core/dist/runtime-v2/types/event-types.d.ts.map +1 -1
  218. package/core/dist/runtime-v2/types/event-types.js +0 -8
  219. package/core/dist/runtime-v2/types/event-types.js.map +1 -1
  220. package/core/dist/runtime-v2/types/index.d.ts +3 -3
  221. package/core/dist/runtime-v2/types/index.d.ts.map +1 -1
  222. package/core/dist/runtime-v2/types/index.js +2 -2
  223. package/core/dist/runtime-v2/types/index.js.map +1 -1
  224. package/dist/installer.d.ts +49 -0
  225. package/dist/installer.d.ts.map +1 -1
  226. package/dist/installer.js +215 -3
  227. package/dist/installer.js.map +1 -1
  228. package/host-runtime/dist/legacy-rule-contract-symbols.d.ts +20 -0
  229. package/host-runtime/dist/legacy-rule-contract-symbols.js +37 -0
  230. package/host-runtime/dist/production-rulehost-gate.d.ts +0 -1
  231. package/host-runtime/dist/production-rulehost-gate.js +29 -5
  232. package/host-runtime/dist/rule-implementation-runtime.js +0 -2
  233. package/package.json +2 -2
  234. package/pd-cli/dist/commands/demo-story-a.d.ts +2 -0
  235. package/pd-cli/dist/commands/demo-story-a.d.ts.map +1 -1
  236. package/pd-cli/dist/commands/demo-story-a.js +41 -0
  237. package/pd-cli/dist/commands/demo-story-a.js.map +1 -1
  238. package/pd-cli/dist/commands/runtime-activation.d.ts.map +1 -1
  239. package/pd-cli/dist/commands/runtime-activation.js +36 -7
  240. package/pd-cli/dist/commands/runtime-activation.js.map +1 -1
  241. package/pd-cli/dist/commands/runtime-compatibility-scan.d.ts +32 -0
  242. package/pd-cli/dist/commands/runtime-compatibility-scan.d.ts.map +1 -0
  243. package/pd-cli/dist/commands/runtime-compatibility-scan.js +94 -0
  244. package/pd-cli/dist/commands/runtime-compatibility-scan.js.map +1 -0
  245. package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.d.ts.map +1 -1
  246. package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.js +48 -0
  247. package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.js.map +1 -1
  248. package/pd-cli/dist/commands/runtime-internalization-retry.d.ts +38 -0
  249. package/pd-cli/dist/commands/runtime-internalization-retry.d.ts.map +1 -0
  250. package/pd-cli/dist/commands/runtime-internalization-retry.js +143 -0
  251. package/pd-cli/dist/commands/runtime-internalization-retry.js.map +1 -0
  252. package/pd-cli/dist/index.js +15 -0
  253. package/pd-cli/dist/index.js.map +1 -1
  254. package/pd-cli/dist/services/__tests__/evaluator-runner-deps.test.js +19 -7
  255. package/pd-cli/dist/services/__tests__/evaluator-runner-deps.test.js.map +1 -1
  256. package/pd-cli/dist/services/rulehost-pipeline-runner.d.ts.map +1 -1
  257. package/pd-cli/dist/services/rulehost-pipeline-runner.js +6 -2
  258. package/pd-cli/dist/services/rulehost-pipeline-runner.js.map +1 -1
  259. package/plugin/dist/bundle.js +517 -707
  260. package/plugin/dist/core/event-log.d.ts +1 -2
  261. package/plugin/dist/core/paths.d.ts +0 -2
  262. package/plugin/dist/core/profile.d.ts +0 -19
  263. package/plugin/dist/core/rule-host.d.ts +25 -0
  264. package/plugin/dist/core/runtime-v2-prompt-activation-reader.d.ts +8 -0
  265. package/plugin/dist/core/session-tracker.d.ts +0 -13
  266. package/plugin/dist/core/signal-collector-host.d.ts +7 -1
  267. package/plugin/dist/core/signal-keyword-store.d.ts +41 -0
  268. package/plugin/dist/core/thinking-os-parser.d.ts +0 -5
  269. package/plugin/dist/core/trajectory-types.d.ts +0 -1
  270. package/plugin/dist/core/trajectory.d.ts +0 -12
  271. package/plugin/dist/hooks/gate.d.ts +0 -1
  272. package/plugin/dist/service/auto-consumer-governance-wiring.d.ts +34 -0
  273. package/plugin/dist/templates/langs/en/skills/pd-mentor/SKILL.md +3 -4
  274. package/plugin/dist/templates/langs/zh/skills/pd-mentor/SKILL.md +3 -4
  275. package/plugin/dist/templates/workspace/.principles/PROFILE.json +0 -29
  276. package/plugin/dist/templates/workspace/.principles/PROFILE.schema.json +16 -25
  277. package/plugin/dist/templates/workspace/okr/CURRENT_FOCUS.md +0 -1
  278. package/plugin/dist/types/event-types.d.ts +1 -1
  279. package/plugin/openclaw.plugin.json +1 -1
  280. package/plugin/package.json +1 -1
  281. package/plugin/templates/langs/en/skills/pd-mentor/SKILL.md +3 -4
  282. package/plugin/templates/langs/zh/skills/pd-mentor/SKILL.md +3 -4
  283. package/plugin/templates/workspace/.principles/PROFILE.json +0 -29
  284. package/plugin/templates/workspace/.principles/PROFILE.schema.json +16 -25
  285. package/plugin/templates/workspace/okr/CURRENT_FOCUS.md +0 -1
  286. package/templates/workspace/okr/CURRENT_FOCUS.md +0 -1
  287. package/core/dist/runtime-v2/thinking-models/__tests__/thinking-models-policy.test.d.ts +0 -2
  288. package/core/dist/runtime-v2/thinking-models/__tests__/thinking-models-policy.test.d.ts.map +0 -1
  289. package/core/dist/runtime-v2/thinking-models/__tests__/thinking-models-policy.test.js +0 -149
  290. package/core/dist/runtime-v2/thinking-models/__tests__/thinking-models-policy.test.js.map +0 -1
  291. package/core/dist/runtime-v2/thinking-models/index.d.ts +0 -3
  292. package/core/dist/runtime-v2/thinking-models/index.d.ts.map +0 -1
  293. package/core/dist/runtime-v2/thinking-models/index.js +0 -3
  294. package/core/dist/runtime-v2/thinking-models/index.js.map +0 -1
  295. package/core/dist/runtime-v2/thinking-models/thinking-models-policy.d.ts +0 -73
  296. package/core/dist/runtime-v2/thinking-models/thinking-models-policy.d.ts.map +0 -1
  297. package/core/dist/runtime-v2/thinking-models/thinking-models-policy.js +0 -227
  298. package/core/dist/runtime-v2/thinking-models/thinking-models-policy.js.map +0 -1
  299. package/plugin/dist/commands/thinking-os.d.ts +0 -2
  300. package/plugin/dist/core/control-ui-db.d.ts +0 -117
  301. package/plugin/dist/core/thinking-models.d.ts +0 -25
  302. package/plugin/dist/templates/workspace/.principles/THINKING_OS_CANDIDATES.md +0 -9
  303. package/plugin/templates/workspace/.principles/THINKING_OS_CANDIDATES.md +0 -9
  304. package/templates/langs/en/skills/admin/SKILL.md +0 -39
  305. package/templates/langs/en/skills/bootstrap-tools/SKILL.md +0 -53
  306. package/templates/langs/en/skills/deductive-audit/SKILL.md +0 -36
  307. package/templates/langs/en/skills/evolution-framework-update/SKILL.md +0 -31
  308. package/templates/langs/en/skills/evolve-system/SKILL.md +0 -46
  309. package/templates/langs/en/skills/evolve-task/SKILL.md +0 -83
  310. package/templates/langs/en/skills/feedback/SKILL.md +0 -51
  311. package/templates/langs/en/skills/init-strategy/SKILL.md +0 -54
  312. package/templates/langs/en/skills/inject-rule/SKILL.md +0 -19
  313. package/templates/langs/en/skills/manage-okr/SKILL.md +0 -96
  314. package/templates/langs/en/skills/pain/SKILL.md +0 -19
  315. package/templates/langs/en/skills/pd-mentor/SKILL.md +0 -211
  316. package/templates/langs/en/skills/profile/SKILL.md +0 -24
  317. package/templates/langs/en/skills/reflection/SKILL.md +0 -40
  318. package/templates/langs/en/skills/reflection-log/SKILL.md +0 -37
  319. package/templates/langs/en/skills/report/SKILL.md +0 -13
  320. package/templates/langs/en/skills/root-cause/SKILL.md +0 -33
  321. package/templates/langs/en/skills/triage/SKILL.md +0 -29
  322. package/templates/langs/en/skills/watch-evolution/SKILL.md +0 -33
  323. package/templates/langs/zh/skills/admin/SKILL.md +0 -41
  324. package/templates/langs/zh/skills/bootstrap-tools/SKILL.md +0 -52
  325. package/templates/langs/zh/skills/deductive-audit/SKILL.md +0 -36
  326. package/templates/langs/zh/skills/evolution-framework-update/SKILL.md +0 -31
  327. package/templates/langs/zh/skills/evolve-system/SKILL.md +0 -46
  328. package/templates/langs/zh/skills/evolve-task/SKILL.md +0 -83
  329. package/templates/langs/zh/skills/feedback/SKILL.md +0 -53
  330. package/templates/langs/zh/skills/init-strategy/SKILL.md +0 -54
  331. package/templates/langs/zh/skills/inject-rule/SKILL.md +0 -19
  332. package/templates/langs/zh/skills/manage-okr/SKILL.md +0 -109
  333. package/templates/langs/zh/skills/pain/SKILL.md +0 -30
  334. package/templates/langs/zh/skills/pd-auditor/SKILL.md +0 -61
  335. package/templates/langs/zh/skills/pd-explorer/SKILL.md +0 -65
  336. package/templates/langs/zh/skills/pd-implementer/SKILL.md +0 -68
  337. package/templates/langs/zh/skills/pd-mentor/SKILL.md +0 -211
  338. package/templates/langs/zh/skills/pd-planner/SKILL.md +0 -65
  339. package/templates/langs/zh/skills/pd-reporter/SKILL.md +0 -78
  340. package/templates/langs/zh/skills/pd-reviewer/SKILL.md +0 -66
  341. package/templates/langs/zh/skills/profile/SKILL.md +0 -24
  342. package/templates/langs/zh/skills/reflection/SKILL.md +0 -40
  343. package/templates/langs/zh/skills/reflection-log/SKILL.md +0 -37
  344. package/templates/langs/zh/skills/report/SKILL.md +0 -13
  345. package/templates/langs/zh/skills/root-cause/SKILL.md +0 -33
  346. package/templates/langs/zh/skills/triage/SKILL.md +0 -29
  347. package/templates/langs/zh/skills/watch-evolution/SKILL.md +0 -33
@@ -1,117 +0,0 @@
1
- /**
2
- * Control UI database stores ANALYTICS READ MODELS.
3
- *
4
- * PURPOSE: Aggregated data for dashboard visualization and historical insights.
5
- * USAGE: Control UI queries and dashboard displays.
6
- * NOT FOR: Control decisions, Phase 3 eligibility, or real-time operations.
7
- *
8
- * Runtime truth comes from: queue state, workspace trust scorecard, active sessions
9
- */
10
- export interface ThinkingModelEventInput {
11
- sessionId: string;
12
- runId: string;
13
- assistantTurnId: number;
14
- modelId: string;
15
- matchedPattern: string;
16
- scenarioJson: unknown;
17
- toolContextJson: unknown;
18
- painContextJson: unknown;
19
- principleContextJson: unknown;
20
- triggerExcerpt: string;
21
- createdAt: string;
22
- }
23
- export interface ControlUiDatabaseOptions {
24
- workspaceDir: string;
25
- busyTimeoutMs?: number;
26
- }
27
- export interface RecentThinkingContext {
28
- toolCalls: {
29
- id: number;
30
- toolName: string;
31
- outcome: 'success' | 'failure' | 'blocked';
32
- errorType: string | null;
33
- errorMessage: string | null;
34
- createdAt: string;
35
- }[];
36
- painEvents: {
37
- id: number;
38
- source: string;
39
- score: number;
40
- reason: string | null;
41
- createdAt: string;
42
- }[];
43
- gateBlocks: {
44
- id: number;
45
- toolName: string;
46
- reason: string;
47
- filePath: string | null;
48
- createdAt: string;
49
- }[];
50
- userCorrections: {
51
- id: number;
52
- correctionCue: string | null;
53
- rawExcerpt: string | null;
54
- createdAt: string;
55
- }[];
56
- principleEvents: {
57
- id: number;
58
- principleId: string | null;
59
- eventType: string;
60
- createdAt: string;
61
- }[];
62
- }
63
- export declare class ControlUiDatabase {
64
- private readonly workspaceDir;
65
- private readonly dbPath;
66
- private readonly blobDir;
67
- private readonly db;
68
- constructor(opts: ControlUiDatabaseOptions);
69
- dispose(): void;
70
- recordThinkingModelEvent(input: ThinkingModelEventInput): number;
71
- /**
72
- * Get recent thinking context for a session.
73
- *
74
- * Returns: Analytics data (read model) aggregated from trajectory database.
75
- * Not: Runtime truth or real-time queue state.
76
- */
77
- getRecentThinkingContext(sessionId: string, beforeCreatedAt: string, limit?: number): RecentThinkingContext;
78
- /**
79
- * Execute SQL query and return all rows.
80
- *
81
- * Returns: Analytics data (read model) aggregated from trajectory database.
82
- * Not: Runtime truth or real-time queue state.
83
- */
84
- all<T>(sql: string, ...params: unknown[]): T[];
85
- /**
86
- * Execute SQL query and return first row.
87
- *
88
- * Returns: Analytics data (read model) aggregated from trajectory database.
89
- * Not: Runtime truth or real-time queue state.
90
- */
91
- get<T>(sql: string, ...params: unknown[]): T | undefined;
92
- /**
93
- * Execute SQL statement that does not return rows (DDL, CREATE TABLE, etc.).
94
- *
95
- * Returns: void (executes directly)
96
- * Not for: SELECT queries (use all() or get() instead)
97
- */
98
- execute(sql: string): void;
99
- /**
100
- * Execute a parameterized write statement (INSERT, UPDATE, DELETE).
101
- */
102
- run(sql: string, ...params: unknown[]): void;
103
- restoreRawText(inlineText?: string | null, blobRef?: string | null): string;
104
- private initSchema;
105
- /**
106
- * Create or replace a view, tolerating missing dependency tables.
107
- *
108
- * Views in ControlUiDatabase depend on tables created by TrajectoryDatabase
109
- * (assistant_turns, tool_calls, pain_events, user_turns, correction_samples).
110
- * If ControlUiDatabase is constructed before TrajectoryDatabase has created
111
- * those tables, CREATE VIEW would throw. We DROP+CREATE with try/catch so
112
- * missing-dependency views are skipped with a warning (rc-9: surfaced via
113
- * console.info) rather than aborting schema initialization.
114
- */
115
- private createViewSafely;
116
- private withWrite;
117
- }
@@ -1,25 +0,0 @@
1
- /**
2
- * Thinking Models — Plugin I/O Adapter (Stage 3 slim)
3
- *
4
- * Pure logic (BUILTIN_PATTERNS, BUILTIN_PATTERN_MAP, getFallbackName,
5
- * getFallbackDescription, deriveThinkingScenarios, types) lives in
6
- * @principles/core/runtime-v2/thinking-models.
7
- *
8
- * This file owns only the I/O boundary: reading THINKING_OS.md from a
9
- * workspace dir and merging it with the builtin patterns. It re-exports
10
- * the pure functions and types so existing relative imports
11
- * (../core/thinking-models.js) continue to resolve.
12
- */
13
- import { type ThinkingModelDefinition, type ThinkingModelMatch } from '@principles/core/runtime-v2';
14
- export { BUILTIN_PATTERN_MAP, getFallbackName, getFallbackDescription, } from '@principles/core/runtime-v2';
15
- export { deriveThinkingScenarios } from '@principles/core/runtime-v2';
16
- export type { ThinkingModelDefinition, ThinkingModelMatch, ThinkingScenarioContext, } from '@principles/core/runtime-v2';
17
- /**
18
- * Load thinking model definitions dynamically from THINKING_OS.md.
19
- * Falls back to built-in definitions if parsing fails.
20
- *
21
- * @param workspaceDir Optional. If provided, loads from that workspace's THINKING_OS.md.
22
- */
23
- export declare function listThinkingModels(workspaceDir?: string): ThinkingModelDefinition[];
24
- export declare function getThinkingModel(modelId: string, workspaceDir?: string): ThinkingModelDefinition | undefined;
25
- export declare function detectThinkingModelMatches(text: string, workspaceDir?: string): ThinkingModelMatch[];
@@ -1,9 +0,0 @@
1
- # Thinking OS — 候选思维模型池
2
-
3
- > 本文件由智能体在反思过程中自动追加候选条目。
4
- > 晋升为正式模型需满足:≥3 种任务验证有效 + ≤3 行可描述 + 非冗余 + 人类批准。
5
- > 使用 `/thinking-os propose` 手动提议,或 `/thinking-os audit` 审计候选池。
6
-
7
- ---
8
-
9
- <!-- 候选条目从这里开始 -->
@@ -1,9 +0,0 @@
1
- # Thinking OS — 候选思维模型池
2
-
3
- > 本文件由智能体在反思过程中自动追加候选条目。
4
- > 晋升为正式模型需满足:≥3 种任务验证有效 + ≤3 行可描述 + 非冗余 + 人类批准。
5
- > 使用 `/thinking-os propose` 手动提议,或 `/thinking-os audit` 审计候选池。
6
-
7
- ---
8
-
9
- <!-- 候选条目从这里开始 -->
@@ -1,39 +0,0 @@
1
- ---
2
- name: admin
3
- description: System administration and recovery tool for humans. Use to init, repair, or reset the evolutionary agent framework.
4
- disable-model-invocation: true
5
- ---
6
-
7
- # Admin Console
8
-
9
- You are now the "Evolutionary System Administrator". Your responsibility is to maintain, repair, or initialize the system's "bare-bones" architecture based on user-provided parameters `$ARGUMENTS`.
10
-
11
- ---
12
-
13
- ## Core Functions
14
-
15
- ### 1. `diagnose` (System Diagnosis)
16
- **Action**: Check the integrity of the "bare-bones" architecture.
17
- - **Core Components**: Check if `.claude/hooks/hook_runner.py` exists and is executable.
18
- - **Documentation Integrity**: Check if `.principles/PROFILE.json` etc. exist.
19
- - **Tool Awareness**: Check `.state/SYSTEM_CAPABILITIES.json`. If missing, prompt user: "⚠️ Toolchain upgrade not performed. Recommend running `/bootstrap-tools` to significantly enhance system capabilities."
20
- - **Memory Mount**: Check if `CLAUDE.md` contains `System Integration` section.
21
- - **Output**: Generate a health report listing missing or abnormal items.
22
-
23
- ### 2. `repair` (System Repair)
24
- **Action**:
25
- - **Config Recovery**: If `PROFILE.json` is missing or corrupted, attempt recovery from `.claude/templates/PROFILE.json`.
26
- - **Structure Completion**: Ensure workspace structure is complete.
27
- - **Forced Cleanup**: Delete `.pain_flag`, `.verdict.json`, `.user_verdict.json`, `.pending_reflection` and other temporary markers.
28
-
29
- ### 3. `reset` (Force Reset)
30
- **Action**: After explicit user confirmation, reset `USER_PROFILE.json` and `AGENT_SCORECARD.json` to zero.
31
-
32
- ### 4. `status` (Status Report)
33
- **Action**: Report current Risk Paths, user's highest/lowest scoring domains, and Agent rankings.
34
-
35
- ---
36
-
37
- ## Execution Guidelines
38
- - You will only see this instruction when a human user enters `/admin`.
39
- - Briefly describe the plan before execution, output "✅ System hardened/initialized" after completion.
@@ -1,53 +0,0 @@
1
- ---
2
- name: bootstrap-tools
3
- description: Scans project tech stack and searches the web for the latest, most effective CLI tools to augment agent capabilities. Suggests and installs tools upon user approval.
4
- disable-model-invocation: true
5
- ---
6
-
7
- # /bootstrap-tools: Equipment Upgrade Officer
8
-
9
- Your goal is to equip the agent team with the most advanced weapons. By analyzing the current project stack and **real-time web search**, find the best CLI tools to improve development, refactoring, and testing efficiency.
10
-
11
- ## Execution Flow
12
-
13
- ### 1. Recon
14
- - **Analyze Tech Stack**: Read `package.json`, `Cargo.toml`, `requirements.txt` etc. Identify core frameworks (e.g., Next.js, FastAPI).
15
- - **Inventory Status**: Run `npm list -g --depth=0` and `command -v` to check installed tools.
16
-
17
- ### 2. Hunt
18
- - **Web Search**: Search for the latest CLI power tools for the current stack.
19
- - *Query Examples*: "best CLI tools for Next.js 15 development 2025", "fastest rust-based grep alternative", "modern linter for python".
20
- - **Selection Criteria**:
21
- - **Headless**: Must be CLI tools.
22
- - **Performance**: Prioritize high-performance tools written in Rust/Go (e.g., `ripgrep`, `ast-grep`, `oxc`).
23
- - **Relevance**: Must solve real pain points (e.g., `knip` for dead code, `depcheck` for dependencies).
24
-
25
- ### 3. Pitch
26
- - Use `AskUserQuestion` to present recommendations to user.
27
- - **Format**:
28
- - **Tool Name**: [Name]
29
- - **Recommendation Reason**: [Why it helps the agent/project]
30
- - **Install Command**: `npm i -g ...` or `apt-get ...`
31
- - **Demo**: Provide a simple usage example.
32
-
33
- ### 4. Deploy & Register
34
- - After approval, execute installation command.
35
- - **Verification (Mandatory)**:
36
- - After installation, **must** run `<tool> --version` or `command -v <tool>` to verify successful installation.
37
- - **If Failed**: Inform user (possibly permission issue), request manual installation, **do not** update capabilities file.
38
- - **If Successful**:
39
- - Update `.state/SYSTEM_CAPABILITIES.json`. Record the new tool's path.
40
- - **Broadcast to All Agents**:
41
- - Scan `.claude/agents/*.md`.
42
- - Check if each file contains `@.state/SYSTEM_CAPABILITIES.json`.
43
- - If not, append to end of file:
44
- ```markdown
45
-
46
- ## Environment Capabilities
47
- Check @.state/SYSTEM_CAPABILITIES.json for high-performance tools (e.g., ripgrep, ast-grep) available in this environment. Use them!
48
- ```
49
- - Prompt user to run `/manage-okr` or `/admin diagnose` to let Agent perceive new capabilities.
50
-
51
- ## Core Principles
52
- - **Prefer New Over Old**: Dare to recommend new tools to replace old ones (e.g., recommend `pnpm` over `npm`, `vitest` over `jest`), but explain the reasoning.
53
- - **Safety First**: Must obtain explicit user authorization before installation.
@@ -1,36 +0,0 @@
1
- ---
2
- name: deductive-audit
3
- description: Rigorous safety and logic check of a proposed solution. Evaluates against axioms, system impact, and edge cases.
4
- disable-model-invocation: true
5
- ---
6
-
7
- # Deductive Audit
8
-
9
- **Goal**: Intercept logic errors and potential risks before execution.
10
-
11
- Please conduct a three-phase review of the proposed fix:
12
-
13
- ## 1. Axiom Test
14
- - Are language specifications, library API contracts, or project conventions violated?
15
- - Are input/output types aligned?
16
-
17
- ## 2. System Test
18
- - Does it introduce new technical debt?
19
- - Does it affect performance, latency, or stability?
20
- - Does it introduce circular dependencies?
21
-
22
- ## 3. Entropy Audit - *New*
23
- - **Necessity**: Is this modification absolutely necessary? Is there a simpler solution?
24
- - **Minimization**: Does it touch files it shouldn't? (Principle of minimal surface area)
25
- - **Anti-gaming**: Is this a genuine fix, or "formalism" just to pass the gate?
26
-
27
- ## 4. Via Negativa
28
- - What happens in the worst case (network down, disk full, malicious input)?
29
- - Are there security red line risks (token leak, privilege escalation)?
30
-
31
- ## 5. Verdict
32
- - **RESULT**: PASS | FAIL
33
- - **Must Fix**: If failed, list points that must be corrected.
34
-
35
- ---
36
- **Action**: Update the above results to `AUDIT.md`.
@@ -1,31 +0,0 @@
1
- ---
2
- name: evolution-framework-update
3
- description: Pull the latest updates for the Principles Disciple evolution framework (including Orchestrator mode, async queue, and map-first protocol).
4
- ---
5
-
6
- # /evolution-framework-update: Evolution Framework Self-Update
7
-
8
- **Goal**: Sync latest code from upstream framework (Hooks, Skills, Agents, Daemon) to maintain system evolution capability.
9
-
10
- ## 1. Execute Update
11
- Run the following script to pull latest code:
12
-
13
- ```bash
14
- bash scripts/update_agent_framework.sh
15
- ```
16
-
17
- ## 2. Conflict Handling (Smart Merge)
18
- After script runs, check output:
19
- - **No Conflict**: If shows "✅ Update complete", no action needed.
20
- - **Conflict**: If shows "⚠️ Updates found with conflicts":
21
- 1. Find all `.update` files:
22
- ```bash
23
- find .claude -name "*.update"
24
- ```
25
- 2. For each conflicting file (e.g., `THINKING_OS.md` vs `THINKING_OS.md.update`):
26
- - **Read** original file and `.update` file.
27
- - **Analyze** differences: merge upstream new features, preserve local personalized config.
28
- - **Cleanup**: Delete `.update` file after merge.
29
-
30
- ## 3. Restart to Apply
31
- After update completes, recommend restarting Session to load latest neural hub logic.
@@ -1,46 +0,0 @@
1
- ---
2
- name: evolve-system
3
- description: Second-order observation and system-level evolution. Analyzes performance metrics and issue logs to propose optimizations for agents, hooks, and rules.
4
- disable-model-invocation: true
5
- ---
6
-
7
- # /evolve-system: The Digital Architect (Second-Order Observation)
8
-
9
- Your identity is now the system's **Digital Architect**. Your responsibility is not to fix business code, but to optimize the system's own "genes" (Prompts, Hooks, Rules) by analyzing system runtime data.
10
-
11
- ## 1. Metrics Analysis
12
- - **Read Data**:
13
- - `.state/AGENT_SCORECARD.json`: Calculate each Agent's win rate (wins / (wins + losses)).
14
- - `memory/ISSUE_LOG.md`: Identify repeated patterns in the last 10 records (Pain Patterns).
15
- - **Identify Anomalies**:
16
- - **Inefficient Agent**: Agents with win rate below 50% and sample size >= 3.
17
- - **Systemic Issues**: Same type of systemic errors appearing more than 2 times in Issue Log.
18
-
19
- ## 2. Systemic Diagnosis
20
- - For identified anomalies, analyze their definitions in `.claude/agents/` or `.claude/hooks/`.
21
- - **Think**:
22
- - Is the Prompt description too vague causing hallucinations?
23
- - Does the Hook logic have boundary blind spots?
24
- - Is a critical Guardrail missing?
25
-
26
- ## 2.5 Clinical Trial - *Optional*
27
- **If root cause is unclear**, conduct empirical testing:
28
- - **Consult**: Use `AskUserQuestion` to ask: "To confirm the issue, I need to run an automatic diagnostic task for [Agent], which may consume some tokens. Continue?"
29
- - **Silent Execution**:
30
- - If user agrees, directly call ``pd_spawn_agent` 工具` to initiate test.
31
- - **Instruction**: "You are being diagnosed. Please execute the following task: [Test Scenario]. Keep output extremely concise, only return final result or error message."
32
- - **Observe**: Check if its tool call chain meets expectations (e.g., did it use the correct Search tool).
33
- - **Diagnose**: Based on test performance, pinpoint the issue.
34
-
35
- ## 3. Optimization Proposal
36
- **If root cause is confirmed**, generate `SYSTEM_OPTIMIZATION_PLAN.md`, including:
37
- - **Diagnosis Conclusion**: Clearly state which part of the system is "sick".
38
- - **Modification Suggestion**: Provide specific code/Prompt modification diffs.
39
- - **Expected Benefits**: Explain how this modification improves win rate or reduces pain.
40
-
41
- ## 4. Safety Gate
42
- - **Mandatory Confirmation**: Before modifying any system files (under `.claude/` directory), must use `AskUserQuestion` to present the proposal and obtain explicit user authorization.
43
- - **Atomicity**: Only suggest one high-leverage optimization point at a time, don't attempt to refactor the entire system at once.
44
-
45
- ## Completion
46
- Output: "✅ System self-diagnosis complete. Proposal submitted, awaiting boss decision."
@@ -1,83 +0,0 @@
1
- ---
2
- name: evolve-task
3
- description: Run the full evolution loop (triage → diagnosis → audit → plan → execute → review → log)
4
- disable-model-invocation: true
5
- ---
6
-
7
- You must execute the following steps in order (no skipping). ARGUMENTS: $ARGUMENTS
8
-
9
- ## Step 0: Restore Context (Mandatory)
10
- - Read the last entry in memory/CHECKPOINT.md
11
- - Read the last 3 entries in memory/ISSUE_LOG.md
12
- - Read recent decisions in memory/DECISIONS.md
13
- - Runtime V2 pain diagnosis uses task input/context, not `.state/.pain_flag`
14
-
15
- ## Step 1: Read Runtime Parameters & Self-Check
16
- - Read .principles/PROFILE.json, understand risk_paths, gate, tests.commands.
17
- - **Capability Self-Check**: Quickly scan `skills/` and `agents/` under plugin directory. If there's a specialized Skill (like `/deep-search`) or Agent (like `security-expert`) for the current task, prioritize using them in subsequent steps.
18
-
19
- ## Step 1.5: Full-Spectrum Awareness
20
- - **Local**: Run `git status` and `git log -n 5` to understand code status.
21
- - **Remote**: If `gh` is available, must run `gh issue list --limit 5` and `gh pr list --limit 5`.
22
- - **Correlation**: If related Issues found, must record their IDs in current task context.
23
-
24
- ## Step 2: TRIAGE (Fill Information Gaps)
25
- - **Map First**: Must read architecture diagrams under `codemaps/` or `docs/SYSTEM_PANORAMA.md` to accurately assess modification risk.
26
- Output:
27
- - Goal (one sentence)
28
- - Problem (reproducible description)
29
- - Evidence (files/commands/logs)
30
- - Risk level (low/medium/high)
31
-
32
- ## Step 3: Delegate Explorer (Evidence Collection)
33
- - Let Explorer sub-agent output: Evidence list / Repro / Hypotheses(<=3)
34
- - **Performance Evaluation**: After task completion, evaluate Explorer performance and write to `.state/.verdict.json`. Format must strictly follow `@.principles/schemas/agent_verdict_schema.json`.
35
-
36
- ## Step 4: Delegate Diagnostician (Root Cause)
37
- - Let Diagnostician output: Proximal cause / Root cause / 5 Whys / Category
38
- - **Performance Evaluation**: After task completion, write to `.state/.verdict.json`. Format follows `@.principles/schemas/agent_verdict_schema.json`.
39
-
40
- ## Step 5: Delegate Auditor (Deductive Audit)
41
- - Let Auditor output: Axiom/System/Via negativa / RESULT: PASS/FAIL
42
- - Write audit result to AUDIT.md (RESULT line must exist).
43
- - **Performance Evaluation**: After task completion, write to `.state/.verdict.json`. Format follows `@.principles/schemas/agent_verdict_schema.json`.
44
-
45
- ### Branch Handling (Must Follow)
46
- - If RESULT = FAIL:
47
- 1. Write Must-fix list to AUDIT.md
48
- 2. Go back to Step 4 to re-delegate Diagnostician, request supplemental root cause
49
- 3. Max 2 retries; if still FAIL, write to memory/DECISIONS.md and request user intervention
50
- - If RESULT = PASS: Continue to Step 6
51
-
52
- ## Step 6: Delegate Planner (Movie Script Plan)
53
- - Planner outputs Plan (steps/commands/metrics/rollback).
54
- - Write plan to a planning document for owner review.
55
- - **Task Sync**:
56
- - If `CLAUDE_CODE_TASK_LIST_ID` is set, you must convert the Plan's core steps to Native Tasks (via natural language command "Add task..." or related tools).
57
- - If not set and in interactive mode, prompt user: "Recommend running `export CLAUDE_CODE_TASK_LIST_ID=task-$(date +%s)` to enable persistent task tracking."
58
- - If in background/headless mode, skip prompt.
59
- - **Performance Evaluation**: After task completion, write to `.state/.verdict.json`. Format follows `@.principles/schemas/agent_verdict_schema.json`.
60
-
61
- ## Step 7: Delegate Implementer (Execution)
62
- - Implementer executes according to the plan from Step 6. Any deviation must first be approved by updating the plan.
63
- - **Performance Evaluation**: After task completion, write to `.state/.verdict.json` based on verification results. Format follows `@.principles/schemas/agent_verdict_schema.json`.
64
-
65
- ## Step 8: Delegate Reviewer (Review)
66
- - Reviewer outputs: Critical/Warning/Suggestion.
67
- - **Performance Evaluation**: After task completion, write to `.state/.verdict.json`. Format follows `@.principles/schemas/agent_verdict_schema.json`.
68
-
69
- ### Branch Handling
70
- - If Critical exists: Go back to Step 6 to revise plan, max 2 retries
71
- - If no Critical: Continue to Step 9
72
-
73
- ## Step 9: Reflection & Persistence
74
- 1. **System Evolution**: Append Pain/Root cause/New principle candidates/Gate suggestions to memory/ISSUE_LOG.md, and update memory/DECISIONS.md.
75
- 2. **User Profile Update (Mandatory)**:
76
- - Review user's performance in this task (instruction quality, domain knowledge, preferences) and system highlights.
77
- - **Must** write to `.state/.user_verdict.json` (incremental update). Format must strictly follow `@.principles/schemas/user_verdict_schema.json`.
78
- - Note: If user shows no obvious characteristics or preferences, corresponding fields can be empty.
79
-
80
- ## Step 10: Final Briefing
81
- - **Action**: Delegate ``pd_spawn_agent(reporter)`` for closing statement.
82
- - **Requirement**: Pass Implementer and Reviewer's final outputs as input. Let it decide report depth and style based on `USER_CONTEXT.md`.
83
- - **Goal**: Ensure the boss (user) clearly understands task outcomes and potential risks without cognitive load.
@@ -1,51 +0,0 @@
1
- ---
2
- name: feedback
3
- description: Standardized bug reporting and feedback mechanism. Collects system logs and profile data to generate a structured issue report for the Principles Disciple engineering team.
4
- disable-model-invocation: true
5
- ---
6
-
7
- # /feedback: Submit System Feedback
8
-
9
- Encountered a system bug or design flaw? Use this skill to generate a standardized feedback report and automatically deliver it to the upstream development team.
10
-
11
- ## Execution Flow
12
-
13
- ### 1. Evidence Collection
14
- - **Log Analysis**: Read `memory/ISSUE_LOG.md` (last 20 lines) and `memory/logs/SYSTEM.log` (if there are error stacks).
15
- - **Config Check**: Read `.principles/PROFILE.json` to confirm current configuration.
16
- - **Version Check**: Attempt to get current version information (if available).
17
-
18
- ### 2. Report Generation
19
- Generate `feedback-YYYYMMDD-HHMMSS.md` in `temp/` directory.
20
- **Content Template**:
21
- ```markdown
22
- # Bug Report / Feature Request
23
-
24
- **Severity**: HIGH | MEDIUM | LOW
25
- **Component**: Agent | Hook | Skill | Installer
26
- **Context**: [Brief description of what you were doing when the issue occurred]
27
-
28
- ## Evidence
29
- ### Log Snippet
30
- ```
31
- [Paste logs here]
32
- ```
33
-
34
- ### Diagnosis (Self-Correction)
35
- I analyzed this problem may be caused by [reason].
36
- Suggested modification: [logic] in [file].
37
-
38
- ## Environment
39
- - OS: [OS]
40
- - Project: [Project Name]
41
- ```
42
-
43
- ### 3. Auto-Delivery
44
- - **Check Upstream**: Check the `SOURCE_REPO` path defined in `scripts/update_agent_framework.sh`.
45
- - **Deliver**:
46
- - If upstream directory exists and is writable, **copy** the report to `$SOURCE_REPO/docs/feedback/`.
47
- - Output: "✅ Report delivered directly to architect's desk (docs/feedback/)".
48
- - **Fallback**: If unreachable, output file path and ask user to send manually.
49
-
50
- ## Interaction
51
- - Use `AskUserQuestion` to ask user about severity and brief description of the issue.
@@ -1,54 +0,0 @@
1
- ---
2
- name: init-strategy
3
- description: Initialize project-level strategy and vision. Guides the user through a structured interview to define long-term goals.
4
- disable-model-invocation: true
5
- ---
6
-
7
- # /init-strategy: Strategic Anchor Initialization
8
-
9
- You are a top-tier strategic consultant. Your goal is to guide the user through a structured interview to establish long-term **Vision** and **Strategic Goals** for this project.
10
-
11
- ## Execution Principles
12
- 1. **Deep Interaction**: Never list all questions at once. You must use `AskUserQuestion` to conduct the interview step by step.
13
- 2. **Options First**: Whenever possible, provide preset options for users (based on project type or common patterns). Reduce typing burden.
14
- - *Example*: When asking about bottlenecks, provide ["Technical Debt", "Delivery Speed", "Quality Instability"] as choices.
15
- 3. **Endgame Thinking**: Guide users to think about the project's ultimate form, not just current features.
16
- 4. **Layered Progression**: Use "Five-Step Method" logic:
17
- - Step 1: Vision Exploration
18
- - Step 2: Reality Check
19
- - Step 3: Critical Success Factors
20
- - Step 4: Strategy Definition
21
- - Step 5: Consensus Confirmation
22
-
23
- ## Operation Guide
24
-
25
- ### Phase 1: Vision & Current State
26
- Use `AskUserQuestion` single-choice/multi-choice or input box to ask:
27
- - Long-term vision for the project (what success looks like in one year).
28
- - Current most severe challenges or technical debt bottlenecks.
29
-
30
- ### Phase 2: Goal Modeling
31
- Based on user's responses, extract 1-3 macro **Objectives (O)**.
32
- - Guide user to confirm: "Do these O's cover the key factors to solve the above bottlenecks?"
33
-
34
- ### Phase 3: Persistence
35
- **Mandatory Action**: Compile interview results and write to `memory/STRATEGY.md`.
36
-
37
- **`memory/STRATEGY.md` Template**:
38
- ```markdown
39
- # Project Strategy & Vision
40
- > Last Updated: [ISO Timestamp]
41
-
42
- ## 1. Vision
43
- - [Qualitative description of project's ultimate goal]
44
-
45
- ## 2. Strategic Objectives
46
- - **Objective 1**: ...
47
- - **Objective 2**: ...
48
-
49
- ## 3. Guiding Principles
50
- - [Engineering values extracted from this interview]
51
- ```
52
-
53
- ## Completion
54
- After writing, prompt user: "✅ Strategic anchor locked. Recommend running `/manage-okr` for quarterly/iteration-level task breakdown."
@@ -1,19 +0,0 @@
1
- ---
2
- name: inject-rule
3
- description: Inject a temporary, ad-hoc rule into the system context. Use for immediate course correction without modifying kernel rules.
4
- disable-model-invocation: true
5
- ---
6
-
7
- # Rule Injector
8
-
9
- You are now the "Manual Intervention Rule" component.
10
-
11
- **Task**:
12
- 1. Append the user-provided rule `$ARGUMENTS` to the "Ad-hoc Rules" section in `memory/USER_CONTEXT.md`.
13
- 2. If this section doesn't exist, create it first.
14
-
15
- **Append Format**:
16
- ```markdown
17
- ## Ad-hoc Rules (User Injected)
18
- - [Time] $ARGUMENTS
19
- ```