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
@@ -7,6 +7,24 @@ import { sendSuccess, sendError, sendMethodNotAllowed, sendBadRequest, sendNotFo
7
7
  import { appendUpdateHistory } from './update-history.js';
8
8
  import { checkOpenClawGateway, stopOpenClawGateway, restartOpenClawGateway, } from '../utils/gateway.js';
9
9
  import { migrateLegacyExtensionBackups, reservePdBackupDestination, resolvePdBackupsRoot, } from '../utils/pd-backups.js';
10
+ import { ActivationCompatibilityReadModel } from '@principles/core/runtime-v2';
11
+ /**
12
+ * Legacy rule contract preflight (2026-08-19): refuse to swap the runtime
13
+ * while an ACTIVE owner-approved rule still depends on a RuleHost contract
14
+ * symbol the new runtime removed (recentThinking, planStatus, hasPlanFile,
15
+ * ...). Executing such a rule against the new contract silently changes its
16
+ * semantics; refusing before any mutation leaves the installation untouched.
17
+ */
18
+ function runLegacyRuleContractPreflight(workspaceDir) {
19
+ const scan = new ActivationCompatibilityReadModel({ workspaceDir }).scan();
20
+ if (scan.ok)
21
+ return { ok: true };
22
+ return {
23
+ ok: false,
24
+ reason: scan.reason ?? 'legacy_rule_contract_dependency',
25
+ nextAction: scan.nextAction ?? 'Migrate or deactivate the listed rules before updating.',
26
+ };
27
+ }
10
28
  // ---------------------------------------------------------------------------
11
29
  // Constants
12
30
  // ---------------------------------------------------------------------------
@@ -418,6 +436,18 @@ async function doApplyUpdate(options, workspaceDir) {
418
436
  let appliedChanges = false;
419
437
  let gatewayWasStopped = false;
420
438
  const codexInstalled = detectCodexInstall();
439
+ // Legacy-contract preflight BEFORE the gateway stop and any file mutation:
440
+ // an active rule depending on a removed RuleHost contract symbol must
441
+ // block the update while the installation is still untouched.
442
+ const compat = runLegacyRuleContractPreflight(workspaceDir);
443
+ if (!compat.ok) {
444
+ return {
445
+ success: false,
446
+ message: compat.reason,
447
+ reason: 'legacy_rule_contract_dependency',
448
+ nextAction: compat.nextAction,
449
+ };
450
+ }
421
451
  // Fix 5: stop the OpenClaw gateway before file mutations to release file
422
452
  // locks on native modules. Best-effort — if `openclaw` is not in PATH or
423
453
  // the gateway isn't running, we proceed (dist/*.js files are not locked).
@@ -630,6 +660,19 @@ function depsMeaningfullyChanged(oldDeps, newDeps) {
630
660
  }
631
661
  async function doInlineFullUpdate(workspaceDir) {
632
662
  const extDir = resolvePluginDir(workspaceDir);
663
+ // Legacy-contract preflight BEFORE stopping the gateway or touching files:
664
+ // refuse while an active rule still uses a removed RuleHost contract
665
+ // symbol — the running installation stays exactly as it was.
666
+ const compat = runLegacyRuleContractPreflight(workspaceDir);
667
+ if (!compat.ok) {
668
+ return {
669
+ success: false,
670
+ message: compat.reason,
671
+ reason: 'legacy_rule_contract_dependency',
672
+ nextAction: compat.nextAction,
673
+ requiresRestart: false,
674
+ };
675
+ }
633
676
  // 1. Stop gateway (releases native module locks held by the gateway process)
634
677
  const gatewayStatus = await checkOpenClawGateway();
635
678
  let gatewayWasStopped = false;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=activation-compatibility-read-model.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activation-compatibility-read-model.test.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/__tests__/activation-compatibility-read-model.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,148 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import * as fs from 'node:fs';
3
+ import * as path from 'node:path';
4
+ import * as os from 'node:os';
5
+ import { SqliteConnection } from '../store/sqlite-connection.js';
6
+ import { ActivationCompatibilityReadModel } from '../activation-compatibility-read-model.js';
7
+ import { createRuleArtifact, seedArtifactToDb } from '../activation/__tests__/helpers.js';
8
+ /**
9
+ * Persisted-workspace regression fixture (P1-3): a workspace upgraded from an
10
+ * older PD may hold an ACTIVE owner-approved rule whose RuleCode reads
11
+ * `input.session.recentThinking` — a contract symbol the current runtime
12
+ * removed. The compatibility read model must detect it; it must NOT silently
13
+ * report clean (which would let an upgrade change the rule's semantics), and
14
+ * it must never mutate the workspace.
15
+ */
16
+ function createBareWorkspace() {
17
+ // Local variant of the shared helper (avoids pulling the dispatcher deps
18
+ // we do not need here) — same real-SQLite production stores.
19
+ const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'pd-compat-scan-'));
20
+ fs.mkdirSync(path.join(tmpDir, '.pd'), { recursive: true });
21
+ const connection = new SqliteConnection({ workspaceDir: tmpDir });
22
+ connection.getDb();
23
+ return {
24
+ workspaceDir: tmpDir,
25
+ connection,
26
+ approvalStore: null,
27
+ stateStore: null,
28
+ artifactStore: null,
29
+ cleanup: () => {
30
+ connection.close();
31
+ fs.rmSync(tmpDir, { recursive: true, force: true });
32
+ },
33
+ };
34
+ }
35
+ const LEGACY_RECENT_THINKING_CODE = `function evaluate(input, helpers) {
36
+ var hasRecentDiagnosis = false;
37
+ if (input.session && input.session.recentThinking === true) { hasRecentDiagnosis = true; }
38
+ if (!hasRecentDiagnosis) {
39
+ return { decision: 'requireApproval', matched: true, reason: 'no recent diagnosis evidence' };
40
+ }
41
+ return { decision: 'allow', matched: false };
42
+ }`;
43
+ const CLEAN_V2_CODE = `function evaluate(input, helpers) {
44
+ var h = input.context && input.context.history;
45
+ if (h && h.status === 'available' && h.recentCalls.length > 0) {
46
+ return { decision: 'requireApproval', matched: true, reason: 'diagnosis evidence present' };
47
+ }
48
+ return { decision: 'allow', matched: false, reason: 'cannot verify: history unavailable' };
49
+ }`;
50
+ function seedActiveCodeToolHookRule(ws, spec) {
51
+ const { artifactId, ruleId, implementationCode, activationId } = spec;
52
+ const artifact = createRuleArtifact({
53
+ artifactId,
54
+ sourceRuleId: ruleId,
55
+ contentJson: JSON.stringify({
56
+ ruleId,
57
+ implementationCode,
58
+ ruleHostGateDecision: 'accepted_shadow',
59
+ affectedTools: ['write_file'],
60
+ }),
61
+ });
62
+ seedArtifactToDb(ws, artifact);
63
+ const db = ws.connection.getDb();
64
+ db.prepare(`
65
+ INSERT INTO activations (activation_id, idempotency_key, artifact_id, channel, action, target_ref, activated_at, promoted_at, deactivated_at)
66
+ VALUES (?, ?, ?, 'code_tool_hook', 'code_tool_hook_shadow_activate', ?, ?, NULL, NULL)
67
+ `).run(activationId, `idem-${activationId}`, artifactId, ruleId, new Date().toISOString());
68
+ }
69
+ describe('ActivationCompatibilityReadModel', () => {
70
+ it('detects an active rule that reads the retired recentThinking contract', () => {
71
+ const ws = createBareWorkspace();
72
+ try {
73
+ seedActiveCodeToolHookRule(ws, { artifactId: 'art-legacy-1', ruleId: 'rule-real-diagnosis-first', implementationCode: LEGACY_RECENT_THINKING_CODE, activationId: 'act-legacy-1' });
74
+ const result = new ActivationCompatibilityReadModel({ workspaceDir: ws.workspaceDir }).scan();
75
+ expect(result.ok).toBe(false);
76
+ expect(result.status).toBe('legacy_dependency');
77
+ expect(result.scannedActivations).toBe(1);
78
+ expect(result.findings).toHaveLength(1);
79
+ expect(result.findings[0]).toMatchObject({
80
+ symbol: 'recentThinking',
81
+ ruleId: 'rule-real-diagnosis-first',
82
+ activationId: 'act-legacy-1',
83
+ channel: 'code_tool_hook',
84
+ });
85
+ expect(result.reason).toBe('legacy_rule_contract_dependency');
86
+ expect(result.nextAction).toContain('Migrate or deactivate');
87
+ }
88
+ finally {
89
+ ws.cleanup();
90
+ }
91
+ });
92
+ it('passes a clean RuleContextV2-only active rule', () => {
93
+ const ws = createBareWorkspace();
94
+ try {
95
+ seedActiveCodeToolHookRule(ws, { artifactId: 'art-clean-1', ruleId: 'rule-clean-v2', implementationCode: CLEAN_V2_CODE, activationId: 'act-clean-1' });
96
+ const result = new ActivationCompatibilityReadModel({ workspaceDir: ws.workspaceDir }).scan();
97
+ expect(result.ok).toBe(true);
98
+ expect(result.status).toBe('clean');
99
+ expect(result.findings).toEqual([]);
100
+ }
101
+ finally {
102
+ ws.cleanup();
103
+ }
104
+ });
105
+ it('ignores deactivated rules (only active activations block upgrades)', () => {
106
+ const ws = createBareWorkspace();
107
+ try {
108
+ seedActiveCodeToolHookRule(ws, { artifactId: 'art-legacy-2', ruleId: 'rule-retired-old', implementationCode: LEGACY_RECENT_THINKING_CODE, activationId: 'act-legacy-2' });
109
+ ws.connection.getDb().prepare('UPDATE activations SET deactivated_at = ? WHERE activation_id = ?').run(new Date().toISOString(), 'act-legacy-2');
110
+ const result = new ActivationCompatibilityReadModel({ workspaceDir: ws.workspaceDir }).scan();
111
+ expect(result.status).toBe('clean');
112
+ expect(result.scannedActivations).toBe(0);
113
+ }
114
+ finally {
115
+ ws.cleanup();
116
+ }
117
+ });
118
+ it('treats a workspace without state.db as a clean pass (fresh install)', () => {
119
+ const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'pd-compat-empty-'));
120
+ try {
121
+ const result = new ActivationCompatibilityReadModel({ workspaceDir: tmpDir }).scan();
122
+ expect(result.ok).toBe(true);
123
+ expect(result.status).toBe('no_state_db');
124
+ // Side-effect-free: no state.db was created by the scan (EP-02).
125
+ expect(fs.existsSync(path.join(tmpDir, '.pd', 'state.db'))).toBe(false);
126
+ }
127
+ finally {
128
+ fs.rmSync(tmpDir, { recursive: true, force: true });
129
+ }
130
+ });
131
+ it('never mutates the scanned workspace (activations and artifacts intact)', () => {
132
+ const ws = createBareWorkspace();
133
+ try {
134
+ seedActiveCodeToolHookRule(ws, { artifactId: 'art-legacy-3', ruleId: 'rule-kept-3', implementationCode: LEGACY_RECENT_THINKING_CODE, activationId: 'act-legacy-3' });
135
+ const result = new ActivationCompatibilityReadModel({ workspaceDir: ws.workspaceDir }).scan();
136
+ expect(result.ok).toBe(false);
137
+ const db = ws.connection.getDb();
138
+ const activations = db.prepare('SELECT COUNT(*) AS n FROM activations').get();
139
+ const artifacts = db.prepare('SELECT COUNT(*) AS n FROM pi_artifacts').get();
140
+ expect(activations.n).toBe(1);
141
+ expect(artifacts.n).toBeGreaterThanOrEqual(1);
142
+ }
143
+ finally {
144
+ ws.cleanup();
145
+ }
146
+ });
147
+ });
148
+ //# sourceMappingURL=activation-compatibility-read-model.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activation-compatibility-read-model.test.js","sourceRoot":"","sources":["../../../src/runtime-v2/__tests__/activation-compatibility-read-model.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAC;AAC7F,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAsB,MAAM,oCAAoC,CAAC;AAE9G;;;;;;;GAOG;AAEH,SAAS,mBAAmB;IAC1B,yEAAyE;IACzE,6DAA6D;IAC7D,MAAM,MAAM,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,iBAAiB,CAAC,CAAC,CAAC;IACzE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5D,MAAM,UAAU,GAAG,IAAI,gBAAgB,CAAC,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,CAAC;IAClE,UAAU,CAAC,KAAK,EAAE,CAAC;IACnB,OAAO;QACL,YAAY,EAAE,MAAM;QACpB,UAAU;QACV,aAAa,EAAE,IAAa;QAC5B,UAAU,EAAE,IAAa;QACzB,aAAa,EAAE,IA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9B,MAAM,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;YACjC,MAAM,WAAW,GAAG,EAAE,CAAC,OAAO,CAAC,uCAAuC,CAAC,CAAC,GAAG,EAAmB,CAAC;YAC/F,MAAM,SAAS,GAAG,EAAE,CAAC,OAAO,CAAC,wCAAwC,CAAC,CAAC,GAAG,EAAmB,CAAC;YAC9F,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAC9B,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;QAChD,CAAC;gBAAS,CAAC;YACT,EAAE,CAAC,OAAO,EAAE,CAAC;QACf,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -303,10 +303,14 @@ const KNOWN_PLUGIN_CORE_FILES = new Set([
303
303
  'training-program.ts',
304
304
  'replay-engine.ts',
305
305
  'merge-gate-audit.ts',
306
- 'control-ui-db.ts',
307
- 'thinking-models.ts',
308
306
  'pd-task-reconciler.ts',
309
307
  'correction-cue-learner.ts',
308
+ // MVP core-loop closure (P0-B/P0-D/E/F): live correction-cue store projection
309
+ // (learn->detect feedback) and auto-consumer governance wiring (dispatcher +
310
+ // repair deps). Both are plugin I/O boundary modules; core logic lives in
311
+ // @principles/core.
312
+ 'signal-keyword-store.ts',
313
+ 'auto-consumer-governance-wiring.ts',
310
314
  'principle-compiler/compiler.ts',
311
315
  'pain.ts',
312
316
  'pain-context-extractor.ts',
@@ -400,7 +404,7 @@ describe('PRI-212 plugin core anti-growth guard', () => {
400
404
  expect.fail(msg);
401
405
  }
402
406
  });
403
- it('known baseline count is self-consistent (94 files)', async () => {
407
+ it('known baseline count is self-consistent (96 files)', async () => {
404
408
  // Sanity check: if the baseline grows, update this number.
405
409
  // Prevents accidental baseline bloat from going unnoticed.
406
410
  // See docs/archive/reviews/plugin-core-inventory-2026-05.md §7
@@ -440,6 +444,12 @@ describe('PRI-212 plugin core anti-growth guard', () => {
440
444
  // PRI-530: Added principle-receipt-metadata.ts (94 → 95) — plugin I/O boundary
441
445
  // for principle receipt attribution reads (readonly state.db joins).
442
446
  // PRI-531: Added principle-application-ledger.ts (95 → 96) — receipt ledger writer.
447
+ // 2026-08-19 retirement: Removed control-ui-db.ts and thinking-models.ts
448
+ // (96 → 94) — zero production consumers after the Thinking Activity
449
+ // writer retirement (census in the PR description).
450
+ // MVP core-loop closure (P0-B/P0-D): Added signal-keyword-store.ts +
451
+ // auto-consumer-governance-wiring.ts (94 → 96) — live correction-cue store
452
+ // projection + auto-consumer governance dispatcher/repair wiring (I/O boundary).
443
453
  expect(KNOWN_PLUGIN_CORE_FILES.size).toBe(96);
444
454
  });
445
455
  });