create-principles-disciple 1.0.0 → 1.74.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2612) hide show
  1. package/README.md +109 -7
  2. package/console/dist/lib/utils.d.ts +2 -0
  3. package/console/dist/lib/utils.js +5 -0
  4. package/console/dist/server/config/AuthConfig.d.ts +14 -0
  5. package/console/dist/server/config/AuthConfig.js +36 -0
  6. package/console/dist/server/config/WorkspaceConfigStore.d.ts +15 -0
  7. package/console/dist/server/config/WorkspaceConfigStore.js +100 -0
  8. package/console/dist/server/index.d.ts +1 -0
  9. package/console/dist/server/index.js +734 -0
  10. package/console/dist/server/models/ApprovalsConsoleModel.d.ts +48 -0
  11. package/console/dist/server/models/ApprovalsConsoleModel.js +208 -0
  12. package/console/dist/server/models/EventLogReadModel.d.ts +33 -0
  13. package/console/dist/server/models/EventLogReadModel.js +218 -0
  14. package/console/dist/server/models/EvolutionConsoleModel.d.ts +79 -0
  15. package/console/dist/server/models/EvolutionConsoleModel.js +179 -0
  16. package/console/dist/server/models/FeedbackConsoleModel.d.ts +38 -0
  17. package/console/dist/server/models/FeedbackConsoleModel.js +129 -0
  18. package/console/dist/server/models/GateConsoleModel.d.ts +50 -0
  19. package/console/dist/server/models/GateConsoleModel.js +151 -0
  20. package/console/dist/server/models/HealthCheckModel.d.ts +43 -0
  21. package/console/dist/server/models/HealthCheckModel.js +341 -0
  22. package/console/dist/server/models/OverviewConsoleModel.d.ts +22 -0
  23. package/console/dist/server/models/OverviewConsoleModel.js +202 -0
  24. package/console/dist/server/models/PipelineStatsModel.d.ts +35 -0
  25. package/console/dist/server/models/PipelineStatsModel.js +129 -0
  26. package/console/dist/server/models/PrinciplesConsoleModel.d.ts +69 -0
  27. package/console/dist/server/models/PrinciplesConsoleModel.js +200 -0
  28. package/console/dist/server/models/SampleConsoleModel.d.ts +21 -0
  29. package/console/dist/server/models/SampleConsoleModel.js +188 -0
  30. package/console/dist/server/models/ThinkingModelsConsoleModel.d.ts +22 -0
  31. package/console/dist/server/models/ThinkingModelsConsoleModel.js +75 -0
  32. package/console/dist/server/models/WorkspaceService.d.ts +34 -0
  33. package/console/dist/server/models/WorkspaceService.js +105 -0
  34. package/console/dist/server/routes/agents.d.ts +3 -0
  35. package/console/dist/server/routes/agents.js +442 -0
  36. package/console/dist/server/routes/approvals.d.ts +3 -0
  37. package/console/dist/server/routes/approvals.js +184 -0
  38. package/console/dist/server/routes/central.d.ts +5 -0
  39. package/console/dist/server/routes/central.js +31 -0
  40. package/console/dist/server/routes/events.d.ts +10 -0
  41. package/console/dist/server/routes/events.js +99 -0
  42. package/console/dist/server/routes/evolution.d.ts +3 -0
  43. package/console/dist/server/routes/evolution.js +73 -0
  44. package/console/dist/server/routes/feedback.d.ts +3 -0
  45. package/console/dist/server/routes/feedback.js +65 -0
  46. package/console/dist/server/routes/gates.d.ts +3 -0
  47. package/console/dist/server/routes/gates.js +52 -0
  48. package/console/dist/server/routes/health.d.ts +3 -0
  49. package/console/dist/server/routes/health.js +33 -0
  50. package/console/dist/server/routes/overview.d.ts +3 -0
  51. package/console/dist/server/routes/overview.js +49 -0
  52. package/console/dist/server/routes/pipeline.d.ts +3 -0
  53. package/console/dist/server/routes/pipeline.js +33 -0
  54. package/console/dist/server/routes/principles.d.ts +10 -0
  55. package/console/dist/server/routes/principles.js +48 -0
  56. package/console/dist/server/routes/samples.d.ts +3 -0
  57. package/console/dist/server/routes/samples.js +101 -0
  58. package/console/dist/server/routes/state.d.ts +11 -0
  59. package/console/dist/server/routes/state.js +97 -0
  60. package/console/dist/server/routes/thinking-models.d.ts +3 -0
  61. package/console/dist/server/routes/thinking-models.js +54 -0
  62. package/console/dist/server/routes/update-history.d.ts +12 -0
  63. package/console/dist/server/routes/update-history.js +52 -0
  64. package/console/dist/server/routes/update.d.ts +10 -0
  65. package/console/dist/server/routes/update.js +435 -0
  66. package/console/dist/server/routes/workspaces.d.ts +6 -0
  67. package/console/dist/server/routes/workspaces.js +105 -0
  68. package/console/dist/server/types/index.d.ts +248 -0
  69. package/console/dist/server/types/index.js +1 -0
  70. package/console/dist/server/utils/diagnostic-parser.d.ts +6 -0
  71. package/console/dist/server/utils/diagnostic-parser.js +81 -0
  72. package/console/dist/server/utils/request.d.ts +4 -0
  73. package/console/dist/server/utils/request.js +43 -0
  74. package/console/dist/server/utils/response.d.ts +8 -0
  75. package/console/dist/server/utils/response.js +31 -0
  76. package/console/dist/server.d.ts +1 -0
  77. package/console/dist/server.js +1 -0
  78. package/console/dist/types.d.ts +85 -0
  79. package/console/dist/types.js +1 -0
  80. package/console/dist/ui/App.d.ts +1 -0
  81. package/console/dist/ui/App.js +53 -0
  82. package/console/dist/ui/api.d.ts +498 -0
  83. package/console/dist/ui/api.js +243 -0
  84. package/console/dist/ui/components/UpdateBanner.d.ts +1 -0
  85. package/console/dist/ui/components/UpdateBanner.js +41 -0
  86. package/console/dist/ui/components/UpdateProgressDialog.d.ts +12 -0
  87. package/console/dist/ui/components/UpdateProgressDialog.js +28 -0
  88. package/console/dist/ui/components/app-sidebar.d.ts +7 -0
  89. package/console/dist/ui/components/app-sidebar.js +74 -0
  90. package/console/dist/ui/components/approval-card.d.ts +8 -0
  91. package/console/dist/ui/components/approval-card.js +39 -0
  92. package/console/dist/ui/components/approval-detail-dialog.d.ts +9 -0
  93. package/console/dist/ui/components/approval-detail-dialog.js +20 -0
  94. package/console/dist/ui/components/compare-view.d.ts +7 -0
  95. package/console/dist/ui/components/compare-view.js +32 -0
  96. package/console/dist/ui/components/data-freshness-indicator.d.ts +10 -0
  97. package/console/dist/ui/components/data-freshness-indicator.js +63 -0
  98. package/console/dist/ui/components/error-boundary.d.ts +15 -0
  99. package/console/dist/ui/components/error-boundary.js +23 -0
  100. package/console/dist/ui/components/health-diagnostic-card.d.ts +15 -0
  101. package/console/dist/ui/components/health-diagnostic-card.js +42 -0
  102. package/console/dist/ui/components/language-switcher.d.ts +1 -0
  103. package/console/dist/ui/components/language-switcher.js +17 -0
  104. package/console/dist/ui/components/page-header.d.ts +10 -0
  105. package/console/dist/ui/components/page-header.js +37 -0
  106. package/console/dist/ui/components/rejection-reason-dialog.d.ts +6 -0
  107. package/console/dist/ui/components/rejection-reason-dialog.js +23 -0
  108. package/console/dist/ui/components/theme-provider.d.ts +14 -0
  109. package/console/dist/ui/components/theme-provider.js +35 -0
  110. package/console/dist/ui/components/theme-toggle.d.ts +1 -0
  111. package/console/dist/ui/components/theme-toggle.js +30 -0
  112. package/console/dist/ui/components/ui/alert-dialog.d.ts +20 -0
  113. package/console/dist/ui/components/ui/alert-dialog.js +26 -0
  114. package/console/dist/ui/components/ui/badge.d.ts +9 -0
  115. package/console/dist/ui/components/ui/badge.js +20 -0
  116. package/console/dist/ui/components/ui/button.d.ts +11 -0
  117. package/console/dist/ui/components/ui/button.js +33 -0
  118. package/console/dist/ui/components/ui/card.d.ts +8 -0
  119. package/console/dist/ui/components/ui/card.js +16 -0
  120. package/console/dist/ui/components/ui/charts.d.ts +51 -0
  121. package/console/dist/ui/components/ui/charts.js +69 -0
  122. package/console/dist/ui/components/ui/dialog.d.ts +19 -0
  123. package/console/dist/ui/components/ui/dialog.js +22 -0
  124. package/console/dist/ui/components/ui/input.d.ts +3 -0
  125. package/console/dist/ui/components/ui/input.js +8 -0
  126. package/console/dist/ui/components/ui/markdown.d.ts +24 -0
  127. package/console/dist/ui/components/ui/markdown.js +115 -0
  128. package/console/dist/ui/components/ui/progress-bar.d.ts +20 -0
  129. package/console/dist/ui/components/ui/progress-bar.js +38 -0
  130. package/console/dist/ui/components/ui/select.d.ts +13 -0
  131. package/console/dist/ui/components/ui/select.js +26 -0
  132. package/console/dist/ui/components/ui/separator.d.ts +3 -0
  133. package/console/dist/ui/components/ui/separator.js +6 -0
  134. package/console/dist/ui/components/ui/sheet.d.ts +25 -0
  135. package/console/dist/ui/components/ui/sheet.js +36 -0
  136. package/console/dist/ui/components/ui/skeleton.d.ts +3 -0
  137. package/console/dist/ui/components/ui/skeleton.js +6 -0
  138. package/console/dist/ui/components/ui/sonner.d.ts +3 -0
  139. package/console/dist/ui/components/ui/sonner.js +13 -0
  140. package/console/dist/ui/components/ui/tooltip.d.ts +7 -0
  141. package/console/dist/ui/components/ui/tooltip.js +10 -0
  142. package/console/dist/ui/hooks/useAutoRefresh.d.ts +13 -0
  143. package/console/dist/ui/hooks/useAutoRefresh.js +64 -0
  144. package/console/dist/ui/hooks/useBookmarks.d.ts +6 -0
  145. package/console/dist/ui/hooks/useBookmarks.js +43 -0
  146. package/console/dist/ui/hooks/useDebounce.d.ts +2 -0
  147. package/console/dist/ui/hooks/useDebounce.js +32 -0
  148. package/console/dist/ui/hooks/useKeyboardNavigation.d.ts +14 -0
  149. package/console/dist/ui/hooks/useKeyboardNavigation.js +75 -0
  150. package/console/dist/ui/i18n/en.json +530 -0
  151. package/console/dist/ui/i18n/index.d.ts +2 -0
  152. package/console/dist/ui/i18n/index.js +21 -0
  153. package/console/dist/ui/i18n/zh-CN.json +530 -0
  154. package/console/dist/ui/main.d.ts +1 -0
  155. package/console/dist/ui/main.js +8 -0
  156. package/console/dist/ui/pages/AgentsPage.d.ts +1 -0
  157. package/console/dist/ui/pages/AgentsPage.js +167 -0
  158. package/console/dist/ui/pages/ApprovalsPage.d.ts +1 -0
  159. package/console/dist/ui/pages/ApprovalsPage.js +123 -0
  160. package/console/dist/ui/pages/CentralPage.d.ts +1 -0
  161. package/console/dist/ui/pages/CentralPage.js +57 -0
  162. package/console/dist/ui/pages/DataFlowPage.d.ts +1 -0
  163. package/console/dist/ui/pages/DataFlowPage.js +158 -0
  164. package/console/dist/ui/pages/EventLogPage.d.ts +1 -0
  165. package/console/dist/ui/pages/EventLogPage.js +176 -0
  166. package/console/dist/ui/pages/EvolutionPage.d.ts +1 -0
  167. package/console/dist/ui/pages/EvolutionPage.js +118 -0
  168. package/console/dist/ui/pages/FeedbackPage.d.ts +1 -0
  169. package/console/dist/ui/pages/FeedbackPage.js +46 -0
  170. package/console/dist/ui/pages/GatesPage.d.ts +1 -0
  171. package/console/dist/ui/pages/GatesPage.js +31 -0
  172. package/console/dist/ui/pages/LoginPage.d.ts +5 -0
  173. package/console/dist/ui/pages/LoginPage.js +39 -0
  174. package/console/dist/ui/pages/OverviewPage.d.ts +1 -0
  175. package/console/dist/ui/pages/OverviewPage.js +50 -0
  176. package/console/dist/ui/pages/PainPage.d.ts +1 -0
  177. package/console/dist/ui/pages/PainPage.js +50 -0
  178. package/console/dist/ui/pages/PrincipleDetailPage.d.ts +1 -0
  179. package/console/dist/ui/pages/PrincipleDetailPage.js +145 -0
  180. package/console/dist/ui/pages/PrinciplesPage.d.ts +1 -0
  181. package/console/dist/ui/pages/PrinciplesPage.js +322 -0
  182. package/console/dist/ui/pages/SamplesPage.d.ts +1 -0
  183. package/console/dist/ui/pages/SamplesPage.js +105 -0
  184. package/console/dist/ui/pages/SettingsPage.d.ts +1 -0
  185. package/console/dist/ui/pages/SettingsPage.js +86 -0
  186. package/console/dist/ui/pages/TasksPage.d.ts +1 -0
  187. package/console/dist/ui/pages/TasksPage.js +373 -0
  188. package/console/dist/ui/pages/ThinkingModelsPage.d.ts +1 -0
  189. package/console/dist/ui/pages/ThinkingModelsPage.js +32 -0
  190. package/console/dist/ui/pages/UpdatePage.d.ts +1 -0
  191. package/console/dist/ui/pages/UpdatePage.js +142 -0
  192. package/console/dist/ui/utils/format.d.ts +3 -0
  193. package/console/dist/ui/utils/format.js +20 -0
  194. package/console/dist/ui/utils/navigation.d.ts +9 -0
  195. package/console/dist/ui/utils/navigation.js +7 -0
  196. package/console/dist/web/assets/app.css +2828 -0
  197. package/console/dist/web/assets/app.js +46353 -0
  198. package/console/dist/web/index.html +13 -0
  199. package/console/package.json +53 -0
  200. package/core/dist/adapters/code-review/code-review-pain-adapter.d.ts +13 -0
  201. package/core/dist/adapters/code-review/code-review-pain-adapter.d.ts.map +1 -0
  202. package/core/dist/adapters/code-review/code-review-pain-adapter.js +139 -0
  203. package/core/dist/adapters/code-review/code-review-pain-adapter.js.map +1 -0
  204. package/core/dist/adapters/code-review/index.d.ts +6 -0
  205. package/core/dist/adapters/code-review/index.d.ts.map +1 -0
  206. package/core/dist/adapters/code-review/index.js +2 -0
  207. package/core/dist/adapters/code-review/index.js.map +1 -0
  208. package/core/dist/adapters/code-review/review-event-types.d.ts +54 -0
  209. package/core/dist/adapters/code-review/review-event-types.d.ts.map +1 -0
  210. package/core/dist/adapters/code-review/review-event-types.js +8 -0
  211. package/core/dist/adapters/code-review/review-event-types.js.map +1 -0
  212. package/core/dist/adapters/coding/index.d.ts +6 -0
  213. package/core/dist/adapters/coding/index.d.ts.map +1 -0
  214. package/core/dist/adapters/coding/index.js +5 -0
  215. package/core/dist/adapters/coding/index.js.map +1 -0
  216. package/core/dist/adapters/coding/openclaw-event-types.d.ts +26 -0
  217. package/core/dist/adapters/coding/openclaw-event-types.d.ts.map +1 -0
  218. package/core/dist/adapters/coding/openclaw-event-types.js +9 -0
  219. package/core/dist/adapters/coding/openclaw-event-types.js.map +1 -0
  220. package/core/dist/adapters/coding/openclaw-pain-adapter.d.ts +27 -0
  221. package/core/dist/adapters/coding/openclaw-pain-adapter.d.ts.map +1 -0
  222. package/core/dist/adapters/coding/openclaw-pain-adapter.js +102 -0
  223. package/core/dist/adapters/coding/openclaw-pain-adapter.js.map +1 -0
  224. package/core/dist/adapters/writing/index.d.ts +6 -0
  225. package/core/dist/adapters/writing/index.d.ts.map +1 -0
  226. package/core/dist/adapters/writing/index.js +5 -0
  227. package/core/dist/adapters/writing/index.js.map +1 -0
  228. package/core/dist/adapters/writing/writing-pain-adapter.d.ts +22 -0
  229. package/core/dist/adapters/writing/writing-pain-adapter.d.ts.map +1 -0
  230. package/core/dist/adapters/writing/writing-pain-adapter.js +62 -0
  231. package/core/dist/adapters/writing/writing-pain-adapter.js.map +1 -0
  232. package/core/dist/adapters/writing/writing-types.d.ts +34 -0
  233. package/core/dist/adapters/writing/writing-types.d.ts.map +1 -0
  234. package/core/dist/adapters/writing/writing-types.js +9 -0
  235. package/core/dist/adapters/writing/writing-types.js.map +1 -0
  236. package/core/dist/evolution-hook.d.ts +70 -0
  237. package/core/dist/evolution-hook.d.ts.map +1 -0
  238. package/core/dist/evolution-hook.js +10 -0
  239. package/core/dist/evolution-hook.js.map +1 -0
  240. package/core/dist/evolution-store.d.ts +56 -0
  241. package/core/dist/evolution-store.d.ts.map +1 -0
  242. package/core/dist/evolution-store.js +150 -0
  243. package/core/dist/evolution-store.js.map +1 -0
  244. package/core/dist/index.d.ts +62 -0
  245. package/core/dist/index.d.ts.map +1 -0
  246. package/core/dist/index.js +64 -0
  247. package/core/dist/index.js.map +1 -0
  248. package/core/dist/io.d.ts +36 -0
  249. package/core/dist/io.d.ts.map +1 -0
  250. package/core/dist/io.js +99 -0
  251. package/core/dist/io.js.map +1 -0
  252. package/core/dist/pain-flag-resolver.d.ts +18 -0
  253. package/core/dist/pain-flag-resolver.d.ts.map +1 -0
  254. package/core/dist/pain-flag-resolver.js +21 -0
  255. package/core/dist/pain-flag-resolver.js.map +1 -0
  256. package/core/dist/pain-recorder.d.ts +38 -0
  257. package/core/dist/pain-recorder.d.ts.map +1 -0
  258. package/core/dist/pain-recorder.js +62 -0
  259. package/core/dist/pain-recorder.js.map +1 -0
  260. package/core/dist/pain-signal-adapter.d.ts +37 -0
  261. package/core/dist/pain-signal-adapter.d.ts.map +1 -0
  262. package/core/dist/pain-signal-adapter.js +2 -0
  263. package/core/dist/pain-signal-adapter.js.map +1 -0
  264. package/core/dist/pain-signal.d.ts +76 -0
  265. package/core/dist/pain-signal.d.ts.map +1 -0
  266. package/core/dist/pain-signal.js +125 -0
  267. package/core/dist/pain-signal.js.map +1 -0
  268. package/core/dist/principle-injector.d.ts +67 -0
  269. package/core/dist/principle-injector.d.ts.map +1 -0
  270. package/core/dist/principle-injector.js +89 -0
  271. package/core/dist/principle-injector.js.map +1 -0
  272. package/core/dist/principle-tree-ledger.d.ts +106 -0
  273. package/core/dist/principle-tree-ledger.d.ts.map +1 -0
  274. package/core/dist/principle-tree-ledger.js +254 -0
  275. package/core/dist/principle-tree-ledger.js.map +1 -0
  276. package/core/dist/prompt-builder/__tests__/empathy-keyword-matching.test.d.ts +2 -0
  277. package/core/dist/prompt-builder/__tests__/empathy-keyword-matching.test.d.ts.map +1 -0
  278. package/core/dist/prompt-builder/__tests__/empathy-keyword-matching.test.js +380 -0
  279. package/core/dist/prompt-builder/__tests__/empathy-keyword-matching.test.js.map +1 -0
  280. package/core/dist/prompt-builder/__tests__/focus-compression.test.d.ts +2 -0
  281. package/core/dist/prompt-builder/__tests__/focus-compression.test.d.ts.map +1 -0
  282. package/core/dist/prompt-builder/__tests__/focus-compression.test.js +265 -0
  283. package/core/dist/prompt-builder/__tests__/focus-compression.test.js.map +1 -0
  284. package/core/dist/prompt-builder/__tests__/principle-selection.test.d.ts +7 -0
  285. package/core/dist/prompt-builder/__tests__/principle-selection.test.d.ts.map +1 -0
  286. package/core/dist/prompt-builder/__tests__/principle-selection.test.js +214 -0
  287. package/core/dist/prompt-builder/__tests__/principle-selection.test.js.map +1 -0
  288. package/core/dist/prompt-builder/__tests__/prompt-builder-core.test.d.ts +7 -0
  289. package/core/dist/prompt-builder/__tests__/prompt-builder-core.test.d.ts.map +1 -0
  290. package/core/dist/prompt-builder/__tests__/prompt-builder-core.test.js +283 -0
  291. package/core/dist/prompt-builder/__tests__/prompt-builder-core.test.js.map +1 -0
  292. package/core/dist/prompt-builder/__tests__/routing-guidance.test.d.ts +11 -0
  293. package/core/dist/prompt-builder/__tests__/routing-guidance.test.d.ts.map +1 -0
  294. package/core/dist/prompt-builder/__tests__/routing-guidance.test.js +305 -0
  295. package/core/dist/prompt-builder/__tests__/routing-guidance.test.js.map +1 -0
  296. package/core/dist/prompt-builder/attitude-directive.d.ts +7 -0
  297. package/core/dist/prompt-builder/attitude-directive.d.ts.map +1 -0
  298. package/core/dist/prompt-builder/attitude-directive.js +39 -0
  299. package/core/dist/prompt-builder/attitude-directive.js.map +1 -0
  300. package/core/dist/prompt-builder/correction-cue.d.ts +15 -0
  301. package/core/dist/prompt-builder/correction-cue.d.ts.map +1 -0
  302. package/core/dist/prompt-builder/correction-cue.js +39 -0
  303. package/core/dist/prompt-builder/correction-cue.js.map +1 -0
  304. package/core/dist/prompt-builder/empathy-keyword-matching.d.ts +30 -0
  305. package/core/dist/prompt-builder/empathy-keyword-matching.d.ts.map +1 -0
  306. package/core/dist/prompt-builder/empathy-keyword-matching.js +142 -0
  307. package/core/dist/prompt-builder/empathy-keyword-matching.js.map +1 -0
  308. package/core/dist/prompt-builder/empathy-types.d.ts +62 -0
  309. package/core/dist/prompt-builder/empathy-types.d.ts.map +1 -0
  310. package/core/dist/prompt-builder/empathy-types.js +88 -0
  311. package/core/dist/prompt-builder/empathy-types.js.map +1 -0
  312. package/core/dist/prompt-builder/focus-compression.d.ts +63 -0
  313. package/core/dist/prompt-builder/focus-compression.d.ts.map +1 -0
  314. package/core/dist/prompt-builder/focus-compression.js +448 -0
  315. package/core/dist/prompt-builder/focus-compression.js.map +1 -0
  316. package/core/dist/prompt-builder/index.d.ts +29 -0
  317. package/core/dist/prompt-builder/index.d.ts.map +1 -0
  318. package/core/dist/prompt-builder/index.js +27 -0
  319. package/core/dist/prompt-builder/index.js.map +1 -0
  320. package/core/dist/prompt-builder/message-extraction.d.ts +7 -0
  321. package/core/dist/prompt-builder/message-extraction.d.ts.map +1 -0
  322. package/core/dist/prompt-builder/message-extraction.js +23 -0
  323. package/core/dist/prompt-builder/message-extraction.js.map +1 -0
  324. package/core/dist/prompt-builder/minimal-trigger.d.ts +7 -0
  325. package/core/dist/prompt-builder/minimal-trigger.d.ts.map +1 -0
  326. package/core/dist/prompt-builder/minimal-trigger.js +11 -0
  327. package/core/dist/prompt-builder/minimal-trigger.js.map +1 -0
  328. package/core/dist/prompt-builder/principle-selection.d.ts +68 -0
  329. package/core/dist/prompt-builder/principle-selection.d.ts.map +1 -0
  330. package/core/dist/prompt-builder/principle-selection.js +140 -0
  331. package/core/dist/prompt-builder/principle-selection.js.map +1 -0
  332. package/core/dist/prompt-builder/routing-guidance.d.ts +64 -0
  333. package/core/dist/prompt-builder/routing-guidance.d.ts.map +1 -0
  334. package/core/dist/prompt-builder/routing-guidance.js +227 -0
  335. package/core/dist/prompt-builder/routing-guidance.js.map +1 -0
  336. package/core/dist/prompt-builder/size-guard.d.ts +35 -0
  337. package/core/dist/prompt-builder/size-guard.d.ts.map +1 -0
  338. package/core/dist/prompt-builder/size-guard.js +144 -0
  339. package/core/dist/prompt-builder/size-guard.js.map +1 -0
  340. package/core/dist/prompt-builder/types.d.ts +28 -0
  341. package/core/dist/prompt-builder/types.d.ts.map +1 -0
  342. package/core/dist/prompt-builder/types.js +7 -0
  343. package/core/dist/prompt-builder/types.js.map +1 -0
  344. package/core/dist/runtime-v2/__tests__/admission-gate.test.d.ts +2 -0
  345. package/core/dist/runtime-v2/__tests__/admission-gate.test.d.ts.map +1 -0
  346. package/core/dist/runtime-v2/__tests__/admission-gate.test.js +126 -0
  347. package/core/dist/runtime-v2/__tests__/admission-gate.test.js.map +1 -0
  348. package/core/dist/runtime-v2/__tests__/architecture-regression.test.d.ts +2 -0
  349. package/core/dist/runtime-v2/__tests__/architecture-regression.test.d.ts.map +1 -0
  350. package/core/dist/runtime-v2/__tests__/architecture-regression.test.js +2990 -0
  351. package/core/dist/runtime-v2/__tests__/architecture-regression.test.js.map +1 -0
  352. package/core/dist/runtime-v2/__tests__/artificer-runner-vslice.test.d.ts +2 -0
  353. package/core/dist/runtime-v2/__tests__/artificer-runner-vslice.test.d.ts.map +1 -0
  354. package/core/dist/runtime-v2/__tests__/artificer-runner-vslice.test.js +608 -0
  355. package/core/dist/runtime-v2/__tests__/artificer-runner-vslice.test.js.map +1 -0
  356. package/core/dist/runtime-v2/__tests__/attack-e2e-pipeline-smoke.test.d.ts +20 -0
  357. package/core/dist/runtime-v2/__tests__/attack-e2e-pipeline-smoke.test.d.ts.map +1 -0
  358. package/core/dist/runtime-v2/__tests__/attack-e2e-pipeline-smoke.test.js +473 -0
  359. package/core/dist/runtime-v2/__tests__/attack-e2e-pipeline-smoke.test.js.map +1 -0
  360. package/core/dist/runtime-v2/__tests__/candidate-audit.test.d.ts +2 -0
  361. package/core/dist/runtime-v2/__tests__/candidate-audit.test.d.ts.map +1 -0
  362. package/core/dist/runtime-v2/__tests__/candidate-audit.test.js +100 -0
  363. package/core/dist/runtime-v2/__tests__/candidate-audit.test.js.map +1 -0
  364. package/core/dist/runtime-v2/__tests__/chain-integrity-attack.test.d.ts +2 -0
  365. package/core/dist/runtime-v2/__tests__/chain-integrity-attack.test.d.ts.map +1 -0
  366. package/core/dist/runtime-v2/__tests__/chain-integrity-attack.test.js +276 -0
  367. package/core/dist/runtime-v2/__tests__/chain-integrity-attack.test.js.map +1 -0
  368. package/core/dist/runtime-v2/__tests__/chain-integrity-real-path.test.d.ts +2 -0
  369. package/core/dist/runtime-v2/__tests__/chain-integrity-real-path.test.d.ts.map +1 -0
  370. package/core/dist/runtime-v2/__tests__/chain-integrity-real-path.test.js +561 -0
  371. package/core/dist/runtime-v2/__tests__/chain-integrity-real-path.test.js.map +1 -0
  372. package/core/dist/runtime-v2/__tests__/control-plane-triage.test.d.ts +2 -0
  373. package/core/dist/runtime-v2/__tests__/control-plane-triage.test.d.ts.map +1 -0
  374. package/core/dist/runtime-v2/__tests__/control-plane-triage.test.js +107 -0
  375. package/core/dist/runtime-v2/__tests__/control-plane-triage.test.js.map +1 -0
  376. package/core/dist/runtime-v2/__tests__/correction-proposal.test.d.ts +2 -0
  377. package/core/dist/runtime-v2/__tests__/correction-proposal.test.d.ts.map +1 -0
  378. package/core/dist/runtime-v2/__tests__/correction-proposal.test.js +486 -0
  379. package/core/dist/runtime-v2/__tests__/correction-proposal.test.js.map +1 -0
  380. package/core/dist/runtime-v2/__tests__/dreamer-output-validator.test.d.ts +2 -0
  381. package/core/dist/runtime-v2/__tests__/dreamer-output-validator.test.d.ts.map +1 -0
  382. package/core/dist/runtime-v2/__tests__/dreamer-output-validator.test.js +171 -0
  383. package/core/dist/runtime-v2/__tests__/dreamer-output-validator.test.js.map +1 -0
  384. package/core/dist/runtime-v2/__tests__/dreamer-runner-real-llm.test.d.ts +2 -0
  385. package/core/dist/runtime-v2/__tests__/dreamer-runner-real-llm.test.d.ts.map +1 -0
  386. package/core/dist/runtime-v2/__tests__/dreamer-runner-real-llm.test.js +155 -0
  387. package/core/dist/runtime-v2/__tests__/dreamer-runner-real-llm.test.js.map +1 -0
  388. package/core/dist/runtime-v2/__tests__/dreamer-runner-vslice.test.d.ts +2 -0
  389. package/core/dist/runtime-v2/__tests__/dreamer-runner-vslice.test.d.ts.map +1 -0
  390. package/core/dist/runtime-v2/__tests__/dreamer-runner-vslice.test.js +515 -0
  391. package/core/dist/runtime-v2/__tests__/dreamer-runner-vslice.test.js.map +1 -0
  392. package/core/dist/runtime-v2/__tests__/dreamer-runner.test.d.ts +2 -0
  393. package/core/dist/runtime-v2/__tests__/dreamer-runner.test.d.ts.map +1 -0
  394. package/core/dist/runtime-v2/__tests__/dreamer-runner.test.js +348 -0
  395. package/core/dist/runtime-v2/__tests__/dreamer-runner.test.js.map +1 -0
  396. package/core/dist/runtime-v2/__tests__/error-categories.test.d.ts +2 -0
  397. package/core/dist/runtime-v2/__tests__/error-categories.test.d.ts.map +1 -0
  398. package/core/dist/runtime-v2/__tests__/error-categories.test.js +149 -0
  399. package/core/dist/runtime-v2/__tests__/error-categories.test.js.map +1 -0
  400. package/core/dist/runtime-v2/__tests__/evaluator-runner-vslice.test.d.ts +2 -0
  401. package/core/dist/runtime-v2/__tests__/evaluator-runner-vslice.test.d.ts.map +1 -0
  402. package/core/dist/runtime-v2/__tests__/evaluator-runner-vslice.test.js +1047 -0
  403. package/core/dist/runtime-v2/__tests__/evaluator-runner-vslice.test.js.map +1 -0
  404. package/core/dist/runtime-v2/__tests__/fixtures/index.d.ts +4 -0
  405. package/core/dist/runtime-v2/__tests__/fixtures/index.d.ts.map +1 -0
  406. package/core/dist/runtime-v2/__tests__/fixtures/index.js +3 -0
  407. package/core/dist/runtime-v2/__tests__/fixtures/index.js.map +1 -0
  408. package/core/dist/runtime-v2/__tests__/fixtures/llm-e2e-config.d.ts +20 -0
  409. package/core/dist/runtime-v2/__tests__/fixtures/llm-e2e-config.d.ts.map +1 -0
  410. package/core/dist/runtime-v2/__tests__/fixtures/llm-e2e-config.js +39 -0
  411. package/core/dist/runtime-v2/__tests__/fixtures/llm-e2e-config.js.map +1 -0
  412. package/core/dist/runtime-v2/__tests__/fixtures/llm-e2e-config.test.d.ts +2 -0
  413. package/core/dist/runtime-v2/__tests__/fixtures/llm-e2e-config.test.d.ts.map +1 -0
  414. package/core/dist/runtime-v2/__tests__/fixtures/llm-e2e-config.test.js +111 -0
  415. package/core/dist/runtime-v2/__tests__/fixtures/llm-e2e-config.test.js.map +1 -0
  416. package/core/dist/runtime-v2/__tests__/fixtures/test-helpers.d.ts +20 -0
  417. package/core/dist/runtime-v2/__tests__/fixtures/test-helpers.d.ts.map +1 -0
  418. package/core/dist/runtime-v2/__tests__/fixtures/test-helpers.js +37 -0
  419. package/core/dist/runtime-v2/__tests__/fixtures/test-helpers.js.map +1 -0
  420. package/core/dist/runtime-v2/__tests__/full-chain-real-llm.test.d.ts +2 -0
  421. package/core/dist/runtime-v2/__tests__/full-chain-real-llm.test.d.ts.map +1 -0
  422. package/core/dist/runtime-v2/__tests__/full-chain-real-llm.test.js +152 -0
  423. package/core/dist/runtime-v2/__tests__/full-chain-real-llm.test.js.map +1 -0
  424. package/core/dist/runtime-v2/__tests__/full-trace-contract.test.d.ts +2 -0
  425. package/core/dist/runtime-v2/__tests__/full-trace-contract.test.d.ts.map +1 -0
  426. package/core/dist/runtime-v2/__tests__/full-trace-contract.test.js +552 -0
  427. package/core/dist/runtime-v2/__tests__/full-trace-contract.test.js.map +1 -0
  428. package/core/dist/runtime-v2/__tests__/gfi-workspace-health.test.d.ts +2 -0
  429. package/core/dist/runtime-v2/__tests__/gfi-workspace-health.test.d.ts.map +1 -0
  430. package/core/dist/runtime-v2/__tests__/gfi-workspace-health.test.js +128 -0
  431. package/core/dist/runtime-v2/__tests__/gfi-workspace-health.test.js.map +1 -0
  432. package/core/dist/runtime-v2/__tests__/golden-trace-candidate-builder.test.d.ts +2 -0
  433. package/core/dist/runtime-v2/__tests__/golden-trace-candidate-builder.test.d.ts.map +1 -0
  434. package/core/dist/runtime-v2/__tests__/golden-trace-candidate-builder.test.js +759 -0
  435. package/core/dist/runtime-v2/__tests__/golden-trace-candidate-builder.test.js.map +1 -0
  436. package/core/dist/runtime-v2/__tests__/golden-trace-replay-validator.test.d.ts +2 -0
  437. package/core/dist/runtime-v2/__tests__/golden-trace-replay-validator.test.d.ts.map +1 -0
  438. package/core/dist/runtime-v2/__tests__/golden-trace-replay-validator.test.js +231 -0
  439. package/core/dist/runtime-v2/__tests__/golden-trace-replay-validator.test.js.map +1 -0
  440. package/core/dist/runtime-v2/__tests__/golden-trace.test.d.ts +2 -0
  441. package/core/dist/runtime-v2/__tests__/golden-trace.test.d.ts.map +1 -0
  442. package/core/dist/runtime-v2/__tests__/golden-trace.test.js +335 -0
  443. package/core/dist/runtime-v2/__tests__/golden-trace.test.js.map +1 -0
  444. package/core/dist/runtime-v2/__tests__/intake-to-internalization-bridge.test.d.ts +2 -0
  445. package/core/dist/runtime-v2/__tests__/intake-to-internalization-bridge.test.d.ts.map +1 -0
  446. package/core/dist/runtime-v2/__tests__/intake-to-internalization-bridge.test.js +307 -0
  447. package/core/dist/runtime-v2/__tests__/intake-to-internalization-bridge.test.js.map +1 -0
  448. package/core/dist/runtime-v2/__tests__/internalization-chain-integrity-read-model.test.d.ts +2 -0
  449. package/core/dist/runtime-v2/__tests__/internalization-chain-integrity-read-model.test.d.ts.map +1 -0
  450. package/core/dist/runtime-v2/__tests__/internalization-chain-integrity-read-model.test.js +268 -0
  451. package/core/dist/runtime-v2/__tests__/internalization-chain-integrity-read-model.test.js.map +1 -0
  452. package/core/dist/runtime-v2/__tests__/internalization-contracts.test.d.ts +2 -0
  453. package/core/dist/runtime-v2/__tests__/internalization-contracts.test.d.ts.map +1 -0
  454. package/core/dist/runtime-v2/__tests__/internalization-contracts.test.js +78 -0
  455. package/core/dist/runtime-v2/__tests__/internalization-contracts.test.js.map +1 -0
  456. package/core/dist/runtime-v2/__tests__/internalization-integrity-remediation.test.d.ts +2 -0
  457. package/core/dist/runtime-v2/__tests__/internalization-integrity-remediation.test.d.ts.map +1 -0
  458. package/core/dist/runtime-v2/__tests__/internalization-integrity-remediation.test.js +218 -0
  459. package/core/dist/runtime-v2/__tests__/internalization-integrity-remediation.test.js.map +1 -0
  460. package/core/dist/runtime-v2/__tests__/internalization-orchestrator.test.d.ts +2 -0
  461. package/core/dist/runtime-v2/__tests__/internalization-orchestrator.test.d.ts.map +1 -0
  462. package/core/dist/runtime-v2/__tests__/internalization-orchestrator.test.js +569 -0
  463. package/core/dist/runtime-v2/__tests__/internalization-orchestrator.test.js.map +1 -0
  464. package/core/dist/runtime-v2/__tests__/internalization-peer-runner-contracts.test.d.ts +2 -0
  465. package/core/dist/runtime-v2/__tests__/internalization-peer-runner-contracts.test.d.ts.map +1 -0
  466. package/core/dist/runtime-v2/__tests__/internalization-peer-runner-contracts.test.js +448 -0
  467. package/core/dist/runtime-v2/__tests__/internalization-peer-runner-contracts.test.js.map +1 -0
  468. package/core/dist/runtime-v2/__tests__/internalization-queue-read-model.test.d.ts +2 -0
  469. package/core/dist/runtime-v2/__tests__/internalization-queue-read-model.test.d.ts.map +1 -0
  470. package/core/dist/runtime-v2/__tests__/internalization-queue-read-model.test.js +415 -0
  471. package/core/dist/runtime-v2/__tests__/internalization-queue-read-model.test.js.map +1 -0
  472. package/core/dist/runtime-v2/__tests__/internalization-route.test.d.ts +2 -0
  473. package/core/dist/runtime-v2/__tests__/internalization-route.test.d.ts.map +1 -0
  474. package/core/dist/runtime-v2/__tests__/internalization-route.test.js +136 -0
  475. package/core/dist/runtime-v2/__tests__/internalization-route.test.js.map +1 -0
  476. package/core/dist/runtime-v2/__tests__/internalization-state-machine.test.d.ts +2 -0
  477. package/core/dist/runtime-v2/__tests__/internalization-state-machine.test.d.ts.map +1 -0
  478. package/core/dist/runtime-v2/__tests__/internalization-state-machine.test.js +679 -0
  479. package/core/dist/runtime-v2/__tests__/internalization-state-machine.test.js.map +1 -0
  480. package/core/dist/runtime-v2/__tests__/l1-hard-cap.test.d.ts +2 -0
  481. package/core/dist/runtime-v2/__tests__/l1-hard-cap.test.d.ts.map +1 -0
  482. package/core/dist/runtime-v2/__tests__/l1-hard-cap.test.js +157 -0
  483. package/core/dist/runtime-v2/__tests__/l1-hard-cap.test.js.map +1 -0
  484. package/core/dist/runtime-v2/__tests__/operator-health-cold-start-guard.test.d.ts +2 -0
  485. package/core/dist/runtime-v2/__tests__/operator-health-cold-start-guard.test.d.ts.map +1 -0
  486. package/core/dist/runtime-v2/__tests__/operator-health-cold-start-guard.test.js +102 -0
  487. package/core/dist/runtime-v2/__tests__/operator-health-cold-start-guard.test.js.map +1 -0
  488. package/core/dist/runtime-v2/__tests__/operator-health-gfi-degraded.test.d.ts +2 -0
  489. package/core/dist/runtime-v2/__tests__/operator-health-gfi-degraded.test.d.ts.map +1 -0
  490. package/core/dist/runtime-v2/__tests__/operator-health-gfi-degraded.test.js +148 -0
  491. package/core/dist/runtime-v2/__tests__/operator-health-gfi-degraded.test.js.map +1 -0
  492. package/core/dist/runtime-v2/__tests__/operator-health-gfi.test.d.ts +2 -0
  493. package/core/dist/runtime-v2/__tests__/operator-health-gfi.test.d.ts.map +1 -0
  494. package/core/dist/runtime-v2/__tests__/operator-health-gfi.test.js +113 -0
  495. package/core/dist/runtime-v2/__tests__/operator-health-gfi.test.js.map +1 -0
  496. package/core/dist/runtime-v2/__tests__/operator-health-read-model.test.d.ts +2 -0
  497. package/core/dist/runtime-v2/__tests__/operator-health-read-model.test.d.ts.map +1 -0
  498. package/core/dist/runtime-v2/__tests__/operator-health-read-model.test.js +136 -0
  499. package/core/dist/runtime-v2/__tests__/operator-health-read-model.test.js.map +1 -0
  500. package/core/dist/runtime-v2/__tests__/pain-chain-read-model.test.d.ts +2 -0
  501. package/core/dist/runtime-v2/__tests__/pain-chain-read-model.test.d.ts.map +1 -0
  502. package/core/dist/runtime-v2/__tests__/pain-chain-read-model.test.js +248 -0
  503. package/core/dist/runtime-v2/__tests__/pain-chain-read-model.test.js.map +1 -0
  504. package/core/dist/runtime-v2/__tests__/pain-evidence-contract.test.d.ts +2 -0
  505. package/core/dist/runtime-v2/__tests__/pain-evidence-contract.test.d.ts.map +1 -0
  506. package/core/dist/runtime-v2/__tests__/pain-evidence-contract.test.js +328 -0
  507. package/core/dist/runtime-v2/__tests__/pain-evidence-contract.test.js.map +1 -0
  508. package/core/dist/runtime-v2/__tests__/pain-flood-simulation.test.d.ts +2 -0
  509. package/core/dist/runtime-v2/__tests__/pain-flood-simulation.test.d.ts.map +1 -0
  510. package/core/dist/runtime-v2/__tests__/pain-flood-simulation.test.js +267 -0
  511. package/core/dist/runtime-v2/__tests__/pain-flood-simulation.test.js.map +1 -0
  512. package/core/dist/runtime-v2/__tests__/pain-signal-bridge-retried.test.d.ts +2 -0
  513. package/core/dist/runtime-v2/__tests__/pain-signal-bridge-retried.test.d.ts.map +1 -0
  514. package/core/dist/runtime-v2/__tests__/pain-signal-bridge-retried.test.js +147 -0
  515. package/core/dist/runtime-v2/__tests__/pain-signal-bridge-retried.test.js.map +1 -0
  516. package/core/dist/runtime-v2/__tests__/pain-signal-observability.test.d.ts +2 -0
  517. package/core/dist/runtime-v2/__tests__/pain-signal-observability.test.d.ts.map +1 -0
  518. package/core/dist/runtime-v2/__tests__/pain-signal-observability.test.js +151 -0
  519. package/core/dist/runtime-v2/__tests__/pain-signal-observability.test.js.map +1 -0
  520. package/core/dist/runtime-v2/__tests__/pain-to-principle-service.test.d.ts +2 -0
  521. package/core/dist/runtime-v2/__tests__/pain-to-principle-service.test.d.ts.map +1 -0
  522. package/core/dist/runtime-v2/__tests__/pain-to-principle-service.test.js +209 -0
  523. package/core/dist/runtime-v2/__tests__/pain-to-principle-service.test.js.map +1 -0
  524. package/core/dist/runtime-v2/__tests__/philosopher-runner-real-llm.test.d.ts +2 -0
  525. package/core/dist/runtime-v2/__tests__/philosopher-runner-real-llm.test.d.ts.map +1 -0
  526. package/core/dist/runtime-v2/__tests__/philosopher-runner-real-llm.test.js +167 -0
  527. package/core/dist/runtime-v2/__tests__/philosopher-runner-real-llm.test.js.map +1 -0
  528. package/core/dist/runtime-v2/__tests__/philosopher-runner-vslice.test.d.ts +2 -0
  529. package/core/dist/runtime-v2/__tests__/philosopher-runner-vslice.test.d.ts.map +1 -0
  530. package/core/dist/runtime-v2/__tests__/philosopher-runner-vslice.test.js +338 -0
  531. package/core/dist/runtime-v2/__tests__/philosopher-runner-vslice.test.js.map +1 -0
  532. package/core/dist/runtime-v2/__tests__/pi-artifact-store.test.d.ts +2 -0
  533. package/core/dist/runtime-v2/__tests__/pi-artifact-store.test.d.ts.map +1 -0
  534. package/core/dist/runtime-v2/__tests__/pi-artifact-store.test.js +247 -0
  535. package/core/dist/runtime-v2/__tests__/pi-artifact-store.test.js.map +1 -0
  536. package/core/dist/runtime-v2/__tests__/pitask-metadata.test.d.ts +8 -0
  537. package/core/dist/runtime-v2/__tests__/pitask-metadata.test.d.ts.map +1 -0
  538. package/core/dist/runtime-v2/__tests__/pitask-metadata.test.js +333 -0
  539. package/core/dist/runtime-v2/__tests__/pitask-metadata.test.js.map +1 -0
  540. package/core/dist/runtime-v2/__tests__/principle-compiler-core.test.d.ts +2 -0
  541. package/core/dist/runtime-v2/__tests__/principle-compiler-core.test.d.ts.map +1 -0
  542. package/core/dist/runtime-v2/__tests__/principle-compiler-core.test.js +141 -0
  543. package/core/dist/runtime-v2/__tests__/principle-compiler-core.test.js.map +1 -0
  544. package/core/dist/runtime-v2/__tests__/production-canary-fixture-gate.test.d.ts +2 -0
  545. package/core/dist/runtime-v2/__tests__/production-canary-fixture-gate.test.d.ts.map +1 -0
  546. package/core/dist/runtime-v2/__tests__/production-canary-fixture-gate.test.js +524 -0
  547. package/core/dist/runtime-v2/__tests__/production-canary-fixture-gate.test.js.map +1 -0
  548. package/core/dist/runtime-v2/__tests__/proven-channel-baseline.test.d.ts +2 -0
  549. package/core/dist/runtime-v2/__tests__/proven-channel-baseline.test.d.ts.map +1 -0
  550. package/core/dist/runtime-v2/__tests__/proven-channel-baseline.test.js +428 -0
  551. package/core/dist/runtime-v2/__tests__/proven-channel-baseline.test.js.map +1 -0
  552. package/core/dist/runtime-v2/__tests__/pruning-read-model.test.d.ts +2 -0
  553. package/core/dist/runtime-v2/__tests__/pruning-read-model.test.d.ts.map +1 -0
  554. package/core/dist/runtime-v2/__tests__/pruning-read-model.test.js +783 -0
  555. package/core/dist/runtime-v2/__tests__/pruning-read-model.test.js.map +1 -0
  556. package/core/dist/runtime-v2/__tests__/pruning-review-log.test.d.ts +2 -0
  557. package/core/dist/runtime-v2/__tests__/pruning-review-log.test.d.ts.map +1 -0
  558. package/core/dist/runtime-v2/__tests__/pruning-review-log.test.js +159 -0
  559. package/core/dist/runtime-v2/__tests__/pruning-review-log.test.js.map +1 -0
  560. package/core/dist/runtime-v2/__tests__/recovery-sweep-service.test.d.ts +2 -0
  561. package/core/dist/runtime-v2/__tests__/recovery-sweep-service.test.d.ts.map +1 -0
  562. package/core/dist/runtime-v2/__tests__/recovery-sweep-service.test.js +83 -0
  563. package/core/dist/runtime-v2/__tests__/recovery-sweep-service.test.js.map +1 -0
  564. package/core/dist/runtime-v2/__tests__/remediation-contract.test.d.ts +2 -0
  565. package/core/dist/runtime-v2/__tests__/remediation-contract.test.d.ts.map +1 -0
  566. package/core/dist/runtime-v2/__tests__/remediation-contract.test.js +39 -0
  567. package/core/dist/runtime-v2/__tests__/remediation-contract.test.js.map +1 -0
  568. package/core/dist/runtime-v2/__tests__/rollout-reviewer-runner-vslice.test.d.ts +2 -0
  569. package/core/dist/runtime-v2/__tests__/rollout-reviewer-runner-vslice.test.d.ts.map +1 -0
  570. package/core/dist/runtime-v2/__tests__/rollout-reviewer-runner-vslice.test.js +658 -0
  571. package/core/dist/runtime-v2/__tests__/rollout-reviewer-runner-vslice.test.js.map +1 -0
  572. package/core/dist/runtime-v2/__tests__/rule-host-evaluator.test.d.ts +2 -0
  573. package/core/dist/runtime-v2/__tests__/rule-host-evaluator.test.d.ts.map +1 -0
  574. package/core/dist/runtime-v2/__tests__/rule-host-evaluator.test.js +509 -0
  575. package/core/dist/runtime-v2/__tests__/rule-host-evaluator.test.js.map +1 -0
  576. package/core/dist/runtime-v2/__tests__/rulehost-oob-defense-simulation.test.d.ts +2 -0
  577. package/core/dist/runtime-v2/__tests__/rulehost-oob-defense-simulation.test.d.ts.map +1 -0
  578. package/core/dist/runtime-v2/__tests__/rulehost-oob-defense-simulation.test.js +535 -0
  579. package/core/dist/runtime-v2/__tests__/rulehost-oob-defense-simulation.test.js.map +1 -0
  580. package/core/dist/runtime-v2/__tests__/runtime-config-boundary.test.d.ts +2 -0
  581. package/core/dist/runtime-v2/__tests__/runtime-config-boundary.test.d.ts.map +1 -0
  582. package/core/dist/runtime-v2/__tests__/runtime-config-boundary.test.js +256 -0
  583. package/core/dist/runtime-v2/__tests__/runtime-config-boundary.test.js.map +1 -0
  584. package/core/dist/runtime-v2/__tests__/runtime-state-handle.test.d.ts +2 -0
  585. package/core/dist/runtime-v2/__tests__/runtime-state-handle.test.d.ts.map +1 -0
  586. package/core/dist/runtime-v2/__tests__/runtime-state-handle.test.js +76 -0
  587. package/core/dist/runtime-v2/__tests__/runtime-state-handle.test.js.map +1 -0
  588. package/core/dist/runtime-v2/__tests__/schema-conformance-read-model.test.d.ts +2 -0
  589. package/core/dist/runtime-v2/__tests__/schema-conformance-read-model.test.d.ts.map +1 -0
  590. package/core/dist/runtime-v2/__tests__/schema-conformance-read-model.test.js +208 -0
  591. package/core/dist/runtime-v2/__tests__/schema-conformance-read-model.test.js.map +1 -0
  592. package/core/dist/runtime-v2/__tests__/scribe-runner-real-llm.test.d.ts +2 -0
  593. package/core/dist/runtime-v2/__tests__/scribe-runner-real-llm.test.d.ts.map +1 -0
  594. package/core/dist/runtime-v2/__tests__/scribe-runner-real-llm.test.js +156 -0
  595. package/core/dist/runtime-v2/__tests__/scribe-runner-real-llm.test.js.map +1 -0
  596. package/core/dist/runtime-v2/__tests__/scribe-runner-vslice.test.d.ts +2 -0
  597. package/core/dist/runtime-v2/__tests__/scribe-runner-vslice.test.d.ts.map +1 -0
  598. package/core/dist/runtime-v2/__tests__/scribe-runner-vslice.test.js +430 -0
  599. package/core/dist/runtime-v2/__tests__/scribe-runner-vslice.test.js.map +1 -0
  600. package/core/dist/runtime-v2/__tests__/sqlite-confirm-first-state-store.test.d.ts +2 -0
  601. package/core/dist/runtime-v2/__tests__/sqlite-confirm-first-state-store.test.d.ts.map +1 -0
  602. package/core/dist/runtime-v2/__tests__/sqlite-confirm-first-state-store.test.js +148 -0
  603. package/core/dist/runtime-v2/__tests__/sqlite-confirm-first-state-store.test.js.map +1 -0
  604. package/core/dist/runtime-v2/__tests__/sqlite-connection-readonly.test.d.ts +2 -0
  605. package/core/dist/runtime-v2/__tests__/sqlite-connection-readonly.test.d.ts.map +1 -0
  606. package/core/dist/runtime-v2/__tests__/sqlite-connection-readonly.test.js +95 -0
  607. package/core/dist/runtime-v2/__tests__/sqlite-connection-readonly.test.js.map +1 -0
  608. package/core/dist/runtime-v2/__tests__/story-a-demo.test.d.ts +2 -0
  609. package/core/dist/runtime-v2/__tests__/story-a-demo.test.d.ts.map +1 -0
  610. package/core/dist/runtime-v2/__tests__/story-a-demo.test.js +257 -0
  611. package/core/dist/runtime-v2/__tests__/story-a-demo.test.js.map +1 -0
  612. package/core/dist/runtime-v2/__tests__/synthetic-baseline.test.d.ts +2 -0
  613. package/core/dist/runtime-v2/__tests__/synthetic-baseline.test.d.ts.map +1 -0
  614. package/core/dist/runtime-v2/__tests__/synthetic-baseline.test.js +155 -0
  615. package/core/dist/runtime-v2/__tests__/synthetic-baseline.test.js.map +1 -0
  616. package/core/dist/runtime-v2/__tests__/task-state-semantics.test.d.ts +2 -0
  617. package/core/dist/runtime-v2/__tests__/task-state-semantics.test.d.ts.map +1 -0
  618. package/core/dist/runtime-v2/__tests__/task-state-semantics.test.js +145 -0
  619. package/core/dist/runtime-v2/__tests__/task-state-semantics.test.js.map +1 -0
  620. package/core/dist/runtime-v2/__tests__/task-three-strikes.test.d.ts +2 -0
  621. package/core/dist/runtime-v2/__tests__/task-three-strikes.test.d.ts.map +1 -0
  622. package/core/dist/runtime-v2/__tests__/task-three-strikes.test.js +268 -0
  623. package/core/dist/runtime-v2/__tests__/task-three-strikes.test.js.map +1 -0
  624. package/core/dist/runtime-v2/__tests__/trace-refiner-agent.test.d.ts +2 -0
  625. package/core/dist/runtime-v2/__tests__/trace-refiner-agent.test.d.ts.map +1 -0
  626. package/core/dist/runtime-v2/__tests__/trace-refiner-agent.test.js +726 -0
  627. package/core/dist/runtime-v2/__tests__/trace-refiner-agent.test.js.map +1 -0
  628. package/core/dist/runtime-v2/__tests__/trace-refiner.test.d.ts +2 -0
  629. package/core/dist/runtime-v2/__tests__/trace-refiner.test.d.ts.map +1 -0
  630. package/core/dist/runtime-v2/__tests__/trace-refiner.test.js +527 -0
  631. package/core/dist/runtime-v2/__tests__/trace-refiner.test.js.map +1 -0
  632. package/core/dist/runtime-v2/__tests__/trainer-output-validator.test.d.ts +2 -0
  633. package/core/dist/runtime-v2/__tests__/trainer-output-validator.test.d.ts.map +1 -0
  634. package/core/dist/runtime-v2/__tests__/trainer-output-validator.test.js +257 -0
  635. package/core/dist/runtime-v2/__tests__/trainer-output-validator.test.js.map +1 -0
  636. package/core/dist/runtime-v2/__tests__/trainer-runner-vslice.test.d.ts +2 -0
  637. package/core/dist/runtime-v2/__tests__/trainer-runner-vslice.test.d.ts.map +1 -0
  638. package/core/dist/runtime-v2/__tests__/trainer-runner-vslice.test.js +506 -0
  639. package/core/dist/runtime-v2/__tests__/trainer-runner-vslice.test.js.map +1 -0
  640. package/core/dist/runtime-v2/__tests__/trajectory-store.test.d.ts +2 -0
  641. package/core/dist/runtime-v2/__tests__/trajectory-store.test.d.ts.map +1 -0
  642. package/core/dist/runtime-v2/__tests__/trajectory-store.test.js +127 -0
  643. package/core/dist/runtime-v2/__tests__/trajectory-store.test.js.map +1 -0
  644. package/core/dist/runtime-v2/activation/__tests__/activation-dispatcher.test.d.ts +2 -0
  645. package/core/dist/runtime-v2/activation/__tests__/activation-dispatcher.test.d.ts.map +1 -0
  646. package/core/dist/runtime-v2/activation/__tests__/activation-dispatcher.test.js +510 -0
  647. package/core/dist/runtime-v2/activation/__tests__/activation-dispatcher.test.js.map +1 -0
  648. package/core/dist/runtime-v2/activation/__tests__/approval-context-types.test.d.ts +2 -0
  649. package/core/dist/runtime-v2/activation/__tests__/approval-context-types.test.d.ts.map +1 -0
  650. package/core/dist/runtime-v2/activation/__tests__/approval-context-types.test.js +117 -0
  651. package/core/dist/runtime-v2/activation/__tests__/approval-context-types.test.js.map +1 -0
  652. package/core/dist/runtime-v2/activation/__tests__/approval-queue.test.d.ts +2 -0
  653. package/core/dist/runtime-v2/activation/__tests__/approval-queue.test.d.ts.map +1 -0
  654. package/core/dist/runtime-v2/activation/__tests__/approval-queue.test.js +179 -0
  655. package/core/dist/runtime-v2/activation/__tests__/approval-queue.test.js.map +1 -0
  656. package/core/dist/runtime-v2/activation/__tests__/approval-store-extended.test.d.ts +2 -0
  657. package/core/dist/runtime-v2/activation/__tests__/approval-store-extended.test.d.ts.map +1 -0
  658. package/core/dist/runtime-v2/activation/__tests__/approval-store-extended.test.js +174 -0
  659. package/core/dist/runtime-v2/activation/__tests__/approval-store-extended.test.js.map +1 -0
  660. package/core/dist/runtime-v2/activation/__tests__/memory-activation-state-store.test.d.ts +2 -0
  661. package/core/dist/runtime-v2/activation/__tests__/memory-activation-state-store.test.d.ts.map +1 -0
  662. package/core/dist/runtime-v2/activation/__tests__/memory-activation-state-store.test.js +244 -0
  663. package/core/dist/runtime-v2/activation/__tests__/memory-activation-state-store.test.js.map +1 -0
  664. package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-state-store.test.d.ts +2 -0
  665. package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-state-store.test.d.ts.map +1 -0
  666. package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-state-store.test.js +109 -0
  667. package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-state-store.test.js.map +1 -0
  668. package/core/dist/runtime-v2/activation/__tests__/sqlite-approval-store.test.d.ts +2 -0
  669. package/core/dist/runtime-v2/activation/__tests__/sqlite-approval-store.test.d.ts.map +1 -0
  670. package/core/dist/runtime-v2/activation/__tests__/sqlite-approval-store.test.js +124 -0
  671. package/core/dist/runtime-v2/activation/__tests__/sqlite-approval-store.test.js.map +1 -0
  672. package/core/dist/runtime-v2/activation/activation-dispatcher.d.ts +18 -0
  673. package/core/dist/runtime-v2/activation/activation-dispatcher.d.ts.map +1 -0
  674. package/core/dist/runtime-v2/activation/activation-dispatcher.js +231 -0
  675. package/core/dist/runtime-v2/activation/activation-dispatcher.js.map +1 -0
  676. package/core/dist/runtime-v2/activation/activation-types.d.ts +195 -0
  677. package/core/dist/runtime-v2/activation/activation-types.d.ts.map +1 -0
  678. package/core/dist/runtime-v2/activation/activation-types.js +29 -0
  679. package/core/dist/runtime-v2/activation/activation-types.js.map +1 -0
  680. package/core/dist/runtime-v2/activation/approval-queue.d.ts +15 -0
  681. package/core/dist/runtime-v2/activation/approval-queue.d.ts.map +1 -0
  682. package/core/dist/runtime-v2/activation/approval-queue.js +50 -0
  683. package/core/dist/runtime-v2/activation/approval-queue.js.map +1 -0
  684. package/core/dist/runtime-v2/activation/index.d.ts +15 -0
  685. package/core/dist/runtime-v2/activation/index.d.ts.map +1 -0
  686. package/core/dist/runtime-v2/activation/index.js +11 -0
  687. package/core/dist/runtime-v2/activation/index.js.map +1 -0
  688. package/core/dist/runtime-v2/activation/low-risk-writers.d.ts +14 -0
  689. package/core/dist/runtime-v2/activation/low-risk-writers.d.ts.map +1 -0
  690. package/core/dist/runtime-v2/activation/low-risk-writers.js +83 -0
  691. package/core/dist/runtime-v2/activation/low-risk-writers.js.map +1 -0
  692. package/core/dist/runtime-v2/activation/memory-activation-state-store.d.ts +13 -0
  693. package/core/dist/runtime-v2/activation/memory-activation-state-store.d.ts.map +1 -0
  694. package/core/dist/runtime-v2/activation/memory-activation-state-store.js +28 -0
  695. package/core/dist/runtime-v2/activation/memory-activation-state-store.js.map +1 -0
  696. package/core/dist/runtime-v2/activation/memory-approval-store.d.ts +12 -0
  697. package/core/dist/runtime-v2/activation/memory-approval-store.d.ts.map +1 -0
  698. package/core/dist/runtime-v2/activation/memory-approval-store.js +102 -0
  699. package/core/dist/runtime-v2/activation/memory-approval-store.js.map +1 -0
  700. package/core/dist/runtime-v2/activation/sqlite-activation-state-store.d.ts +10 -0
  701. package/core/dist/runtime-v2/activation/sqlite-activation-state-store.d.ts.map +1 -0
  702. package/core/dist/runtime-v2/activation/sqlite-activation-state-store.js +87 -0
  703. package/core/dist/runtime-v2/activation/sqlite-activation-state-store.js.map +1 -0
  704. package/core/dist/runtime-v2/activation/sqlite-approval-store.d.ts +14 -0
  705. package/core/dist/runtime-v2/activation/sqlite-approval-store.d.ts.map +1 -0
  706. package/core/dist/runtime-v2/activation/sqlite-approval-store.js +138 -0
  707. package/core/dist/runtime-v2/activation/sqlite-approval-store.js.map +1 -0
  708. package/core/dist/runtime-v2/activation/sqlite-confirm-first-state-store.d.ts +22 -0
  709. package/core/dist/runtime-v2/activation/sqlite-confirm-first-state-store.d.ts.map +1 -0
  710. package/core/dist/runtime-v2/activation/sqlite-confirm-first-state-store.js +136 -0
  711. package/core/dist/runtime-v2/activation/sqlite-confirm-first-state-store.js.map +1 -0
  712. package/core/dist/runtime-v2/activation/writers/__tests__/rule-host-writer.test.d.ts +2 -0
  713. package/core/dist/runtime-v2/activation/writers/__tests__/rule-host-writer.test.d.ts.map +1 -0
  714. package/core/dist/runtime-v2/activation/writers/__tests__/rule-host-writer.test.js +615 -0
  715. package/core/dist/runtime-v2/activation/writers/__tests__/rule-host-writer.test.js.map +1 -0
  716. package/core/dist/runtime-v2/activation/writers/index.d.ts +3 -0
  717. package/core/dist/runtime-v2/activation/writers/index.d.ts.map +1 -0
  718. package/core/dist/runtime-v2/activation/writers/index.js +2 -0
  719. package/core/dist/runtime-v2/activation/writers/index.js.map +1 -0
  720. package/core/dist/runtime-v2/activation/writers/rule-host-writer.d.ts +14 -0
  721. package/core/dist/runtime-v2/activation/writers/rule-host-writer.d.ts.map +1 -0
  722. package/core/dist/runtime-v2/activation/writers/rule-host-writer.js +135 -0
  723. package/core/dist/runtime-v2/activation/writers/rule-host-writer.js.map +1 -0
  724. package/core/dist/runtime-v2/adapter/__tests__/chaos-json-repair.test.d.ts +2 -0
  725. package/core/dist/runtime-v2/adapter/__tests__/chaos-json-repair.test.d.ts.map +1 -0
  726. package/core/dist/runtime-v2/adapter/__tests__/chaos-json-repair.test.js +553 -0
  727. package/core/dist/runtime-v2/adapter/__tests__/chaos-json-repair.test.js.map +1 -0
  728. package/core/dist/runtime-v2/adapter/__tests__/json-extractor.test.d.ts +2 -0
  729. package/core/dist/runtime-v2/adapter/__tests__/json-extractor.test.d.ts.map +1 -0
  730. package/core/dist/runtime-v2/adapter/__tests__/json-extractor.test.js +148 -0
  731. package/core/dist/runtime-v2/adapter/__tests__/json-extractor.test.js.map +1 -0
  732. package/core/dist/runtime-v2/adapter/__tests__/openclaw-cli-runtime-adapter.test.d.ts +2 -0
  733. package/core/dist/runtime-v2/adapter/__tests__/openclaw-cli-runtime-adapter.test.d.ts.map +1 -0
  734. package/core/dist/runtime-v2/adapter/__tests__/openclaw-cli-runtime-adapter.test.js +565 -0
  735. package/core/dist/runtime-v2/adapter/__tests__/openclaw-cli-runtime-adapter.test.js.map +1 -0
  736. package/core/dist/runtime-v2/adapter/__tests__/output-repair-contract.test.d.ts +2 -0
  737. package/core/dist/runtime-v2/adapter/__tests__/output-repair-contract.test.d.ts.map +1 -0
  738. package/core/dist/runtime-v2/adapter/__tests__/output-repair-contract.test.js +305 -0
  739. package/core/dist/runtime-v2/adapter/__tests__/output-repair-contract.test.js.map +1 -0
  740. package/core/dist/runtime-v2/adapter/__tests__/pi-ai-runtime-adapter.test.d.ts +2 -0
  741. package/core/dist/runtime-v2/adapter/__tests__/pi-ai-runtime-adapter.test.d.ts.map +1 -0
  742. package/core/dist/runtime-v2/adapter/__tests__/pi-ai-runtime-adapter.test.js +1362 -0
  743. package/core/dist/runtime-v2/adapter/__tests__/pi-ai-runtime-adapter.test.js.map +1 -0
  744. package/core/dist/runtime-v2/adapter/__tests__/runtime-config-contract.test.d.ts +2 -0
  745. package/core/dist/runtime-v2/adapter/__tests__/runtime-config-contract.test.d.ts.map +1 -0
  746. package/core/dist/runtime-v2/adapter/__tests__/runtime-config-contract.test.js +245 -0
  747. package/core/dist/runtime-v2/adapter/__tests__/runtime-config-contract.test.js.map +1 -0
  748. package/core/dist/runtime-v2/adapter/__tests__/schema-prompt-adapter.test.d.ts +2 -0
  749. package/core/dist/runtime-v2/adapter/__tests__/schema-prompt-adapter.test.d.ts.map +1 -0
  750. package/core/dist/runtime-v2/adapter/__tests__/schema-prompt-adapter.test.js +270 -0
  751. package/core/dist/runtime-v2/adapter/__tests__/schema-prompt-adapter.test.js.map +1 -0
  752. package/core/dist/runtime-v2/adapter/__tests__/structured-output-repair.test.d.ts +2 -0
  753. package/core/dist/runtime-v2/adapter/__tests__/structured-output-repair.test.d.ts.map +1 -0
  754. package/core/dist/runtime-v2/adapter/__tests__/structured-output-repair.test.js +494 -0
  755. package/core/dist/runtime-v2/adapter/__tests__/structured-output-repair.test.js.map +1 -0
  756. package/core/dist/runtime-v2/adapter/__tests__/test-double-runtime-adapter.test.d.ts +2 -0
  757. package/core/dist/runtime-v2/adapter/__tests__/test-double-runtime-adapter.test.d.ts.map +1 -0
  758. package/core/dist/runtime-v2/adapter/__tests__/test-double-runtime-adapter.test.js +123 -0
  759. package/core/dist/runtime-v2/adapter/__tests__/test-double-runtime-adapter.test.js.map +1 -0
  760. package/core/dist/runtime-v2/adapter/index.d.ts +10 -0
  761. package/core/dist/runtime-v2/adapter/index.d.ts.map +1 -0
  762. package/core/dist/runtime-v2/adapter/index.js +6 -0
  763. package/core/dist/runtime-v2/adapter/index.js.map +1 -0
  764. package/core/dist/runtime-v2/adapter/json-extractor.d.ts +14 -0
  765. package/core/dist/runtime-v2/adapter/json-extractor.d.ts.map +1 -0
  766. package/core/dist/runtime-v2/adapter/json-extractor.js +97 -0
  767. package/core/dist/runtime-v2/adapter/json-extractor.js.map +1 -0
  768. package/core/dist/runtime-v2/adapter/openclaw-cli-runtime-adapter.d.ts +66 -0
  769. package/core/dist/runtime-v2/adapter/openclaw-cli-runtime-adapter.d.ts.map +1 -0
  770. package/core/dist/runtime-v2/adapter/openclaw-cli-runtime-adapter.js +705 -0
  771. package/core/dist/runtime-v2/adapter/openclaw-cli-runtime-adapter.js.map +1 -0
  772. package/core/dist/runtime-v2/adapter/output-repair-contract.d.ts +50 -0
  773. package/core/dist/runtime-v2/adapter/output-repair-contract.d.ts.map +1 -0
  774. package/core/dist/runtime-v2/adapter/output-repair-contract.js +96 -0
  775. package/core/dist/runtime-v2/adapter/output-repair-contract.js.map +1 -0
  776. package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.d.ts +114 -0
  777. package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.d.ts.map +1 -0
  778. package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.js +1110 -0
  779. package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.js.map +1 -0
  780. package/core/dist/runtime-v2/adapter/principle-tree-ledger-adapter.d.ts +22 -0
  781. package/core/dist/runtime-v2/adapter/principle-tree-ledger-adapter.d.ts.map +1 -0
  782. package/core/dist/runtime-v2/adapter/principle-tree-ledger-adapter.js +84 -0
  783. package/core/dist/runtime-v2/adapter/principle-tree-ledger-adapter.js.map +1 -0
  784. package/core/dist/runtime-v2/adapter/schema-prompt-adapter.d.ts +13 -0
  785. package/core/dist/runtime-v2/adapter/schema-prompt-adapter.d.ts.map +1 -0
  786. package/core/dist/runtime-v2/adapter/schema-prompt-adapter.js +266 -0
  787. package/core/dist/runtime-v2/adapter/schema-prompt-adapter.js.map +1 -0
  788. package/core/dist/runtime-v2/adapter/structured-output-repair.d.ts +95 -0
  789. package/core/dist/runtime-v2/adapter/structured-output-repair.d.ts.map +1 -0
  790. package/core/dist/runtime-v2/adapter/structured-output-repair.js +259 -0
  791. package/core/dist/runtime-v2/adapter/structured-output-repair.js.map +1 -0
  792. package/core/dist/runtime-v2/adapter/test-double-runtime-adapter.d.ts +35 -0
  793. package/core/dist/runtime-v2/adapter/test-double-runtime-adapter.d.ts.map +1 -0
  794. package/core/dist/runtime-v2/adapter/test-double-runtime-adapter.js +94 -0
  795. package/core/dist/runtime-v2/adapter/test-double-runtime-adapter.js.map +1 -0
  796. package/core/dist/runtime-v2/adapter/tools/diagnostician-tool.d.ts +17 -0
  797. package/core/dist/runtime-v2/adapter/tools/diagnostician-tool.d.ts.map +1 -0
  798. package/core/dist/runtime-v2/adapter/tools/diagnostician-tool.js +8 -0
  799. package/core/dist/runtime-v2/adapter/tools/diagnostician-tool.js.map +1 -0
  800. package/core/dist/runtime-v2/admission-gate.d.ts +27 -0
  801. package/core/dist/runtime-v2/admission-gate.d.ts.map +1 -0
  802. package/core/dist/runtime-v2/admission-gate.js +57 -0
  803. package/core/dist/runtime-v2/admission-gate.js.map +1 -0
  804. package/core/dist/runtime-v2/agent-spec.d.ts +86 -0
  805. package/core/dist/runtime-v2/agent-spec.d.ts.map +1 -0
  806. package/core/dist/runtime-v2/agent-spec.js +74 -0
  807. package/core/dist/runtime-v2/agent-spec.js.map +1 -0
  808. package/core/dist/runtime-v2/candidate-audit.d.ts +8 -0
  809. package/core/dist/runtime-v2/candidate-audit.d.ts.map +1 -0
  810. package/core/dist/runtime-v2/candidate-audit.js +47 -0
  811. package/core/dist/runtime-v2/candidate-audit.js.map +1 -0
  812. package/core/dist/runtime-v2/candidate-intake-service.d.ts +43 -0
  813. package/core/dist/runtime-v2/candidate-intake-service.d.ts.map +1 -0
  814. package/core/dist/runtime-v2/candidate-intake-service.js +117 -0
  815. package/core/dist/runtime-v2/candidate-intake-service.js.map +1 -0
  816. package/core/dist/runtime-v2/candidate-intake.d.ts +219 -0
  817. package/core/dist/runtime-v2/candidate-intake.d.ts.map +1 -0
  818. package/core/dist/runtime-v2/candidate-intake.js +178 -0
  819. package/core/dist/runtime-v2/candidate-intake.js.map +1 -0
  820. package/core/dist/runtime-v2/cli/diagnose.d.ts +127 -0
  821. package/core/dist/runtime-v2/cli/diagnose.d.ts.map +1 -0
  822. package/core/dist/runtime-v2/cli/diagnose.js +113 -0
  823. package/core/dist/runtime-v2/cli/diagnose.js.map +1 -0
  824. package/core/dist/runtime-v2/cli/index.d.ts +5 -0
  825. package/core/dist/runtime-v2/cli/index.d.ts.map +1 -0
  826. package/core/dist/runtime-v2/cli/index.js +3 -0
  827. package/core/dist/runtime-v2/cli/index.js.map +1 -0
  828. package/core/dist/runtime-v2/cli/probe.d.ts +31 -0
  829. package/core/dist/runtime-v2/cli/probe.d.ts.map +1 -0
  830. package/core/dist/runtime-v2/cli/probe.js +58 -0
  831. package/core/dist/runtime-v2/cli/probe.js.map +1 -0
  832. package/core/dist/runtime-v2/context-payload.d.ts +298 -0
  833. package/core/dist/runtime-v2/context-payload.d.ts.map +1 -0
  834. package/core/dist/runtime-v2/context-payload.js +140 -0
  835. package/core/dist/runtime-v2/context-payload.js.map +1 -0
  836. package/core/dist/runtime-v2/control-plane-triage.d.ts +32 -0
  837. package/core/dist/runtime-v2/control-plane-triage.d.ts.map +1 -0
  838. package/core/dist/runtime-v2/control-plane-triage.js +220 -0
  839. package/core/dist/runtime-v2/control-plane-triage.js.map +1 -0
  840. package/core/dist/runtime-v2/correction/correction-types.d.ts +87 -0
  841. package/core/dist/runtime-v2/correction/correction-types.d.ts.map +1 -0
  842. package/core/dist/runtime-v2/correction/correction-types.js +66 -0
  843. package/core/dist/runtime-v2/correction/correction-types.js.map +1 -0
  844. package/core/dist/runtime-v2/correction/index.d.ts +2 -0
  845. package/core/dist/runtime-v2/correction/index.d.ts.map +1 -0
  846. package/core/dist/runtime-v2/correction/index.js +2 -0
  847. package/core/dist/runtime-v2/correction/index.js.map +1 -0
  848. package/core/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.integration.test.d.ts +2 -0
  849. package/core/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.integration.test.d.ts.map +1 -0
  850. package/core/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.integration.test.js +170 -0
  851. package/core/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.integration.test.js.map +1 -0
  852. package/core/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.test.d.ts +2 -0
  853. package/core/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.test.d.ts.map +1 -0
  854. package/core/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.test.js +396 -0
  855. package/core/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.test.js.map +1 -0
  856. package/core/dist/runtime-v2/diagnostician-output.d.ts +84 -0
  857. package/core/dist/runtime-v2/diagnostician-output.d.ts.map +1 -0
  858. package/core/dist/runtime-v2/diagnostician-output.js +60 -0
  859. package/core/dist/runtime-v2/diagnostician-output.js.map +1 -0
  860. package/core/dist/runtime-v2/diagnostician-prompt-builder.d.ts +130 -0
  861. package/core/dist/runtime-v2/diagnostician-prompt-builder.d.ts.map +1 -0
  862. package/core/dist/runtime-v2/diagnostician-prompt-builder.js +162 -0
  863. package/core/dist/runtime-v2/diagnostician-prompt-builder.js.map +1 -0
  864. package/core/dist/runtime-v2/error-categories.d.ts +42 -0
  865. package/core/dist/runtime-v2/error-categories.d.ts.map +1 -0
  866. package/core/dist/runtime-v2/error-categories.js +119 -0
  867. package/core/dist/runtime-v2/error-categories.js.map +1 -0
  868. package/core/dist/runtime-v2/evolution/evolution-types.d.ts +709 -0
  869. package/core/dist/runtime-v2/evolution/evolution-types.d.ts.map +1 -0
  870. package/core/dist/runtime-v2/evolution/evolution-types.js +410 -0
  871. package/core/dist/runtime-v2/evolution/evolution-types.js.map +1 -0
  872. package/core/dist/runtime-v2/evolution/index.d.ts +2 -0
  873. package/core/dist/runtime-v2/evolution/index.d.ts.map +1 -0
  874. package/core/dist/runtime-v2/evolution/index.js +2 -0
  875. package/core/dist/runtime-v2/evolution/index.js.map +1 -0
  876. package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.d.ts +2 -0
  877. package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.d.ts.map +1 -0
  878. package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.js +298 -0
  879. package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.js.map +1 -0
  880. package/core/dist/runtime-v2/feature-flags/feature-flag-contract.d.ts +35 -0
  881. package/core/dist/runtime-v2/feature-flags/feature-flag-contract.d.ts.map +1 -0
  882. package/core/dist/runtime-v2/feature-flags/feature-flag-contract.js +124 -0
  883. package/core/dist/runtime-v2/feature-flags/feature-flag-contract.js.map +1 -0
  884. package/core/dist/runtime-v2/feature-flags/index.d.ts +3 -0
  885. package/core/dist/runtime-v2/feature-flags/index.d.ts.map +1 -0
  886. package/core/dist/runtime-v2/feature-flags/index.js +2 -0
  887. package/core/dist/runtime-v2/feature-flags/index.js.map +1 -0
  888. package/core/dist/runtime-v2/full-trace-contract.d.ts +79 -0
  889. package/core/dist/runtime-v2/full-trace-contract.d.ts.map +1 -0
  890. package/core/dist/runtime-v2/full-trace-contract.js +464 -0
  891. package/core/dist/runtime-v2/full-trace-contract.js.map +1 -0
  892. package/core/dist/runtime-v2/gfi/__tests__/gfi-kernel.test.d.ts +2 -0
  893. package/core/dist/runtime-v2/gfi/__tests__/gfi-kernel.test.d.ts.map +1 -0
  894. package/core/dist/runtime-v2/gfi/__tests__/gfi-kernel.test.js +626 -0
  895. package/core/dist/runtime-v2/gfi/__tests__/gfi-kernel.test.js.map +1 -0
  896. package/core/dist/runtime-v2/gfi/__tests__/gfi-read-model.test.d.ts +2 -0
  897. package/core/dist/runtime-v2/gfi/__tests__/gfi-read-model.test.d.ts.map +1 -0
  898. package/core/dist/runtime-v2/gfi/__tests__/gfi-read-model.test.js +212 -0
  899. package/core/dist/runtime-v2/gfi/__tests__/gfi-read-model.test.js.map +1 -0
  900. package/core/dist/runtime-v2/gfi/gfi-kernel.d.ts +12 -0
  901. package/core/dist/runtime-v2/gfi/gfi-kernel.d.ts.map +1 -0
  902. package/core/dist/runtime-v2/gfi/gfi-kernel.js +148 -0
  903. package/core/dist/runtime-v2/gfi/gfi-kernel.js.map +1 -0
  904. package/core/dist/runtime-v2/gfi/gfi-policy.d.ts +3 -0
  905. package/core/dist/runtime-v2/gfi/gfi-policy.d.ts.map +1 -0
  906. package/core/dist/runtime-v2/gfi/gfi-policy.js +23 -0
  907. package/core/dist/runtime-v2/gfi/gfi-policy.js.map +1 -0
  908. package/core/dist/runtime-v2/gfi/gfi-read-model.d.ts +78 -0
  909. package/core/dist/runtime-v2/gfi/gfi-read-model.d.ts.map +1 -0
  910. package/core/dist/runtime-v2/gfi/gfi-read-model.js +129 -0
  911. package/core/dist/runtime-v2/gfi/gfi-read-model.js.map +1 -0
  912. package/core/dist/runtime-v2/gfi/gfi-types.d.ts +70 -0
  913. package/core/dist/runtime-v2/gfi/gfi-types.d.ts.map +1 -0
  914. package/core/dist/runtime-v2/gfi/gfi-types.js +2 -0
  915. package/core/dist/runtime-v2/gfi/gfi-types.js.map +1 -0
  916. package/core/dist/runtime-v2/gfi/index.d.ts +6 -0
  917. package/core/dist/runtime-v2/gfi/index.d.ts.map +1 -0
  918. package/core/dist/runtime-v2/gfi/index.js +4 -0
  919. package/core/dist/runtime-v2/gfi/index.js.map +1 -0
  920. package/core/dist/runtime-v2/golden-trace-candidate-builder.d.ts +23 -0
  921. package/core/dist/runtime-v2/golden-trace-candidate-builder.d.ts.map +1 -0
  922. package/core/dist/runtime-v2/golden-trace-candidate-builder.js +193 -0
  923. package/core/dist/runtime-v2/golden-trace-candidate-builder.js.map +1 -0
  924. package/core/dist/runtime-v2/golden-trace-replay-adapter.d.ts +18 -0
  925. package/core/dist/runtime-v2/golden-trace-replay-adapter.d.ts.map +1 -0
  926. package/core/dist/runtime-v2/golden-trace-replay-adapter.js +18 -0
  927. package/core/dist/runtime-v2/golden-trace-replay-adapter.js.map +1 -0
  928. package/core/dist/runtime-v2/golden-trace-replay-validator.d.ts +42 -0
  929. package/core/dist/runtime-v2/golden-trace-replay-validator.d.ts.map +1 -0
  930. package/core/dist/runtime-v2/golden-trace-replay-validator.js +220 -0
  931. package/core/dist/runtime-v2/golden-trace-replay-validator.js.map +1 -0
  932. package/core/dist/runtime-v2/golden-trace.d.ts +80 -0
  933. package/core/dist/runtime-v2/golden-trace.d.ts.map +1 -0
  934. package/core/dist/runtime-v2/golden-trace.js +158 -0
  935. package/core/dist/runtime-v2/golden-trace.js.map +1 -0
  936. package/core/dist/runtime-v2/index.d.ts +281 -0
  937. package/core/dist/runtime-v2/index.d.ts.map +1 -0
  938. package/core/dist/runtime-v2/index.js +224 -0
  939. package/core/dist/runtime-v2/index.js.map +1 -0
  940. package/core/dist/runtime-v2/internalization/__tests__/artificer-prompt-builder.test.d.ts +2 -0
  941. package/core/dist/runtime-v2/internalization/__tests__/artificer-prompt-builder.test.d.ts.map +1 -0
  942. package/core/dist/runtime-v2/internalization/__tests__/artificer-prompt-builder.test.js +57 -0
  943. package/core/dist/runtime-v2/internalization/__tests__/artificer-prompt-builder.test.js.map +1 -0
  944. package/core/dist/runtime-v2/internalization/__tests__/dreamer-prompt-builder.test.d.ts +2 -0
  945. package/core/dist/runtime-v2/internalization/__tests__/dreamer-prompt-builder.test.d.ts.map +1 -0
  946. package/core/dist/runtime-v2/internalization/__tests__/dreamer-prompt-builder.test.js +182 -0
  947. package/core/dist/runtime-v2/internalization/__tests__/dreamer-prompt-builder.test.js.map +1 -0
  948. package/core/dist/runtime-v2/internalization/__tests__/evaluator-prompt-builder.test.d.ts +2 -0
  949. package/core/dist/runtime-v2/internalization/__tests__/evaluator-prompt-builder.test.d.ts.map +1 -0
  950. package/core/dist/runtime-v2/internalization/__tests__/evaluator-prompt-builder.test.js +112 -0
  951. package/core/dist/runtime-v2/internalization/__tests__/evaluator-prompt-builder.test.js.map +1 -0
  952. package/core/dist/runtime-v2/internalization/__tests__/internalization-job-graph.test.d.ts +2 -0
  953. package/core/dist/runtime-v2/internalization/__tests__/internalization-job-graph.test.d.ts.map +1 -0
  954. package/core/dist/runtime-v2/internalization/__tests__/internalization-job-graph.test.js +176 -0
  955. package/core/dist/runtime-v2/internalization/__tests__/internalization-job-graph.test.js.map +1 -0
  956. package/core/dist/runtime-v2/internalization/__tests__/internalization-task-guards.test.d.ts +2 -0
  957. package/core/dist/runtime-v2/internalization/__tests__/internalization-task-guards.test.d.ts.map +1 -0
  958. package/core/dist/runtime-v2/internalization/__tests__/internalization-task-guards.test.js +297 -0
  959. package/core/dist/runtime-v2/internalization/__tests__/internalization-task-guards.test.js.map +1 -0
  960. package/core/dist/runtime-v2/internalization/__tests__/philosopher-prompt-builder.test.d.ts +2 -0
  961. package/core/dist/runtime-v2/internalization/__tests__/philosopher-prompt-builder.test.d.ts.map +1 -0
  962. package/core/dist/runtime-v2/internalization/__tests__/philosopher-prompt-builder.test.js +149 -0
  963. package/core/dist/runtime-v2/internalization/__tests__/philosopher-prompt-builder.test.js.map +1 -0
  964. package/core/dist/runtime-v2/internalization/__tests__/queue-actionability.test.d.ts +2 -0
  965. package/core/dist/runtime-v2/internalization/__tests__/queue-actionability.test.d.ts.map +1 -0
  966. package/core/dist/runtime-v2/internalization/__tests__/queue-actionability.test.js +92 -0
  967. package/core/dist/runtime-v2/internalization/__tests__/queue-actionability.test.js.map +1 -0
  968. package/core/dist/runtime-v2/internalization/__tests__/refiner-rulehost-gate.test.d.ts +2 -0
  969. package/core/dist/runtime-v2/internalization/__tests__/refiner-rulehost-gate.test.d.ts.map +1 -0
  970. package/core/dist/runtime-v2/internalization/__tests__/refiner-rulehost-gate.test.js +431 -0
  971. package/core/dist/runtime-v2/internalization/__tests__/refiner-rulehost-gate.test.js.map +1 -0
  972. package/core/dist/runtime-v2/internalization/__tests__/refiner-sandbox-wrapper.test.d.ts +2 -0
  973. package/core/dist/runtime-v2/internalization/__tests__/refiner-sandbox-wrapper.test.d.ts.map +1 -0
  974. package/core/dist/runtime-v2/internalization/__tests__/refiner-sandbox-wrapper.test.js +763 -0
  975. package/core/dist/runtime-v2/internalization/__tests__/refiner-sandbox-wrapper.test.js.map +1 -0
  976. package/core/dist/runtime-v2/internalization/__tests__/rollout-reviewer-prompt-builder.test.d.ts +2 -0
  977. package/core/dist/runtime-v2/internalization/__tests__/rollout-reviewer-prompt-builder.test.d.ts.map +1 -0
  978. package/core/dist/runtime-v2/internalization/__tests__/rollout-reviewer-prompt-builder.test.js +75 -0
  979. package/core/dist/runtime-v2/internalization/__tests__/rollout-reviewer-prompt-builder.test.js.map +1 -0
  980. package/core/dist/runtime-v2/internalization/__tests__/scribe-prompt-builder.test.d.ts +2 -0
  981. package/core/dist/runtime-v2/internalization/__tests__/scribe-prompt-builder.test.d.ts.map +1 -0
  982. package/core/dist/runtime-v2/internalization/__tests__/scribe-prompt-builder.test.js +56 -0
  983. package/core/dist/runtime-v2/internalization/__tests__/scribe-prompt-builder.test.js.map +1 -0
  984. package/core/dist/runtime-v2/internalization/__tests__/trainer-prompt-builder.test.d.ts +2 -0
  985. package/core/dist/runtime-v2/internalization/__tests__/trainer-prompt-builder.test.d.ts.map +1 -0
  986. package/core/dist/runtime-v2/internalization/__tests__/trainer-prompt-builder.test.js +141 -0
  987. package/core/dist/runtime-v2/internalization/__tests__/trainer-prompt-builder.test.js.map +1 -0
  988. package/core/dist/runtime-v2/internalization/artificer-output.d.ts +67 -0
  989. package/core/dist/runtime-v2/internalization/artificer-output.d.ts.map +1 -0
  990. package/core/dist/runtime-v2/internalization/artificer-output.js +103 -0
  991. package/core/dist/runtime-v2/internalization/artificer-output.js.map +1 -0
  992. package/core/dist/runtime-v2/internalization/artificer-prompt-builder.d.ts +24 -0
  993. package/core/dist/runtime-v2/internalization/artificer-prompt-builder.d.ts.map +1 -0
  994. package/core/dist/runtime-v2/internalization/artificer-prompt-builder.js +62 -0
  995. package/core/dist/runtime-v2/internalization/artificer-prompt-builder.js.map +1 -0
  996. package/core/dist/runtime-v2/internalization/artificer-runner.d.ts +77 -0
  997. package/core/dist/runtime-v2/internalization/artificer-runner.d.ts.map +1 -0
  998. package/core/dist/runtime-v2/internalization/artificer-runner.js +521 -0
  999. package/core/dist/runtime-v2/internalization/artificer-runner.js.map +1 -0
  1000. package/core/dist/runtime-v2/internalization/compile-result.d.ts +20 -0
  1001. package/core/dist/runtime-v2/internalization/compile-result.d.ts.map +1 -0
  1002. package/core/dist/runtime-v2/internalization/compile-result.js +8 -0
  1003. package/core/dist/runtime-v2/internalization/compile-result.js.map +1 -0
  1004. package/core/dist/runtime-v2/internalization/correction-proposal.d.ts +38 -0
  1005. package/core/dist/runtime-v2/internalization/correction-proposal.d.ts.map +1 -0
  1006. package/core/dist/runtime-v2/internalization/correction-proposal.js +322 -0
  1007. package/core/dist/runtime-v2/internalization/correction-proposal.js.map +1 -0
  1008. package/core/dist/runtime-v2/internalization/deprecated-readiness.d.ts +20 -0
  1009. package/core/dist/runtime-v2/internalization/deprecated-readiness.d.ts.map +1 -0
  1010. package/core/dist/runtime-v2/internalization/deprecated-readiness.js +75 -0
  1011. package/core/dist/runtime-v2/internalization/deprecated-readiness.js.map +1 -0
  1012. package/core/dist/runtime-v2/internalization/deprecated-readiness.test.d.ts +2 -0
  1013. package/core/dist/runtime-v2/internalization/deprecated-readiness.test.d.ts.map +1 -0
  1014. package/core/dist/runtime-v2/internalization/deprecated-readiness.test.js +127 -0
  1015. package/core/dist/runtime-v2/internalization/deprecated-readiness.test.js.map +1 -0
  1016. package/core/dist/runtime-v2/internalization/dreamer-output.d.ts +120 -0
  1017. package/core/dist/runtime-v2/internalization/dreamer-output.d.ts.map +1 -0
  1018. package/core/dist/runtime-v2/internalization/dreamer-output.js +92 -0
  1019. package/core/dist/runtime-v2/internalization/dreamer-output.js.map +1 -0
  1020. package/core/dist/runtime-v2/internalization/dreamer-prompt-builder.d.ts +41 -0
  1021. package/core/dist/runtime-v2/internalization/dreamer-prompt-builder.d.ts.map +1 -0
  1022. package/core/dist/runtime-v2/internalization/dreamer-prompt-builder.js +43 -0
  1023. package/core/dist/runtime-v2/internalization/dreamer-prompt-builder.js.map +1 -0
  1024. package/core/dist/runtime-v2/internalization/dreamer-runner.d.ts +134 -0
  1025. package/core/dist/runtime-v2/internalization/dreamer-runner.d.ts.map +1 -0
  1026. package/core/dist/runtime-v2/internalization/dreamer-runner.js +636 -0
  1027. package/core/dist/runtime-v2/internalization/dreamer-runner.js.map +1 -0
  1028. package/core/dist/runtime-v2/internalization/evaluator-output.d.ts +71 -0
  1029. package/core/dist/runtime-v2/internalization/evaluator-output.d.ts.map +1 -0
  1030. package/core/dist/runtime-v2/internalization/evaluator-output.js +113 -0
  1031. package/core/dist/runtime-v2/internalization/evaluator-output.js.map +1 -0
  1032. package/core/dist/runtime-v2/internalization/evaluator-prompt-builder.d.ts +24 -0
  1033. package/core/dist/runtime-v2/internalization/evaluator-prompt-builder.d.ts.map +1 -0
  1034. package/core/dist/runtime-v2/internalization/evaluator-prompt-builder.js +49 -0
  1035. package/core/dist/runtime-v2/internalization/evaluator-prompt-builder.js.map +1 -0
  1036. package/core/dist/runtime-v2/internalization/evaluator-runner.d.ts +80 -0
  1037. package/core/dist/runtime-v2/internalization/evaluator-runner.d.ts.map +1 -0
  1038. package/core/dist/runtime-v2/internalization/evaluator-runner.js +661 -0
  1039. package/core/dist/runtime-v2/internalization/evaluator-runner.js.map +1 -0
  1040. package/core/dist/runtime-v2/internalization/index.d.ts +81 -0
  1041. package/core/dist/runtime-v2/internalization/index.d.ts.map +1 -0
  1042. package/core/dist/runtime-v2/internalization/index.js +47 -0
  1043. package/core/dist/runtime-v2/internalization/index.js.map +1 -0
  1044. package/core/dist/runtime-v2/internalization/intake-to-internalization-bridge.d.ts +57 -0
  1045. package/core/dist/runtime-v2/internalization/intake-to-internalization-bridge.d.ts.map +1 -0
  1046. package/core/dist/runtime-v2/internalization/intake-to-internalization-bridge.js +99 -0
  1047. package/core/dist/runtime-v2/internalization/intake-to-internalization-bridge.js.map +1 -0
  1048. package/core/dist/runtime-v2/internalization/internalization-job-graph.d.ts +78 -0
  1049. package/core/dist/runtime-v2/internalization/internalization-job-graph.d.ts.map +1 -0
  1050. package/core/dist/runtime-v2/internalization/internalization-job-graph.js +153 -0
  1051. package/core/dist/runtime-v2/internalization/internalization-job-graph.js.map +1 -0
  1052. package/core/dist/runtime-v2/internalization/internalization-orchestrator.d.ts +182 -0
  1053. package/core/dist/runtime-v2/internalization/internalization-orchestrator.d.ts.map +1 -0
  1054. package/core/dist/runtime-v2/internalization/internalization-orchestrator.js +355 -0
  1055. package/core/dist/runtime-v2/internalization/internalization-orchestrator.js.map +1 -0
  1056. package/core/dist/runtime-v2/internalization/internalization-route.d.ts +28 -0
  1057. package/core/dist/runtime-v2/internalization/internalization-route.d.ts.map +1 -0
  1058. package/core/dist/runtime-v2/internalization/internalization-route.js +112 -0
  1059. package/core/dist/runtime-v2/internalization/internalization-route.js.map +1 -0
  1060. package/core/dist/runtime-v2/internalization/internalization-state-machine.d.ts +157 -0
  1061. package/core/dist/runtime-v2/internalization/internalization-state-machine.d.ts.map +1 -0
  1062. package/core/dist/runtime-v2/internalization/internalization-state-machine.js +274 -0
  1063. package/core/dist/runtime-v2/internalization/internalization-state-machine.js.map +1 -0
  1064. package/core/dist/runtime-v2/internalization/internalization-task-guards.d.ts +92 -0
  1065. package/core/dist/runtime-v2/internalization/internalization-task-guards.d.ts.map +1 -0
  1066. package/core/dist/runtime-v2/internalization/internalization-task-guards.js +152 -0
  1067. package/core/dist/runtime-v2/internalization/internalization-task-guards.js.map +1 -0
  1068. package/core/dist/runtime-v2/internalization/lifecycle-datasource.d.ts +18 -0
  1069. package/core/dist/runtime-v2/internalization/lifecycle-datasource.d.ts.map +1 -0
  1070. package/core/dist/runtime-v2/internalization/lifecycle-datasource.js +2 -0
  1071. package/core/dist/runtime-v2/internalization/lifecycle-datasource.js.map +1 -0
  1072. package/core/dist/runtime-v2/internalization/lifecycle-metrics.d.ts +24 -0
  1073. package/core/dist/runtime-v2/internalization/lifecycle-metrics.d.ts.map +1 -0
  1074. package/core/dist/runtime-v2/internalization/lifecycle-metrics.js +124 -0
  1075. package/core/dist/runtime-v2/internalization/lifecycle-metrics.js.map +1 -0
  1076. package/core/dist/runtime-v2/internalization/lifecycle-metrics.test.d.ts +2 -0
  1077. package/core/dist/runtime-v2/internalization/lifecycle-metrics.test.d.ts.map +1 -0
  1078. package/core/dist/runtime-v2/internalization/lifecycle-metrics.test.js +201 -0
  1079. package/core/dist/runtime-v2/internalization/lifecycle-metrics.test.js.map +1 -0
  1080. package/core/dist/runtime-v2/internalization/lifecycle-read-model.d.ts +11 -0
  1081. package/core/dist/runtime-v2/internalization/lifecycle-read-model.d.ts.map +1 -0
  1082. package/core/dist/runtime-v2/internalization/lifecycle-read-model.js +155 -0
  1083. package/core/dist/runtime-v2/internalization/lifecycle-read-model.js.map +1 -0
  1084. package/core/dist/runtime-v2/internalization/lifecycle-read-model.test.d.ts +2 -0
  1085. package/core/dist/runtime-v2/internalization/lifecycle-read-model.test.d.ts.map +1 -0
  1086. package/core/dist/runtime-v2/internalization/lifecycle-read-model.test.js +408 -0
  1087. package/core/dist/runtime-v2/internalization/lifecycle-read-model.test.js.map +1 -0
  1088. package/core/dist/runtime-v2/internalization/lifecycle-types.d.ts +75 -0
  1089. package/core/dist/runtime-v2/internalization/lifecycle-types.d.ts.map +1 -0
  1090. package/core/dist/runtime-v2/internalization/lifecycle-types.js +2 -0
  1091. package/core/dist/runtime-v2/internalization/lifecycle-types.js.map +1 -0
  1092. package/core/dist/runtime-v2/internalization/peer-runner-contracts.d.ts +140 -0
  1093. package/core/dist/runtime-v2/internalization/peer-runner-contracts.d.ts.map +1 -0
  1094. package/core/dist/runtime-v2/internalization/peer-runner-contracts.js +124 -0
  1095. package/core/dist/runtime-v2/internalization/peer-runner-contracts.js.map +1 -0
  1096. package/core/dist/runtime-v2/internalization/philosopher-output.d.ts +56 -0
  1097. package/core/dist/runtime-v2/internalization/philosopher-output.d.ts.map +1 -0
  1098. package/core/dist/runtime-v2/internalization/philosopher-output.js +69 -0
  1099. package/core/dist/runtime-v2/internalization/philosopher-output.js.map +1 -0
  1100. package/core/dist/runtime-v2/internalization/philosopher-prompt-builder.d.ts +41 -0
  1101. package/core/dist/runtime-v2/internalization/philosopher-prompt-builder.d.ts.map +1 -0
  1102. package/core/dist/runtime-v2/internalization/philosopher-prompt-builder.js +50 -0
  1103. package/core/dist/runtime-v2/internalization/philosopher-prompt-builder.js.map +1 -0
  1104. package/core/dist/runtime-v2/internalization/philosopher-runner.d.ts +103 -0
  1105. package/core/dist/runtime-v2/internalization/philosopher-runner.d.ts.map +1 -0
  1106. package/core/dist/runtime-v2/internalization/philosopher-runner.js +519 -0
  1107. package/core/dist/runtime-v2/internalization/philosopher-runner.js.map +1 -0
  1108. package/core/dist/runtime-v2/internalization/pi-artifact-store.d.ts +13 -0
  1109. package/core/dist/runtime-v2/internalization/pi-artifact-store.d.ts.map +1 -0
  1110. package/core/dist/runtime-v2/internalization/pi-artifact-store.js +65 -0
  1111. package/core/dist/runtime-v2/internalization/pi-artifact-store.js.map +1 -0
  1112. package/core/dist/runtime-v2/internalization/pi-artifact.d.ts +23 -0
  1113. package/core/dist/runtime-v2/internalization/pi-artifact.d.ts.map +1 -0
  1114. package/core/dist/runtime-v2/internalization/pi-artifact.js +2 -0
  1115. package/core/dist/runtime-v2/internalization/pi-artifact.js.map +1 -0
  1116. package/core/dist/runtime-v2/internalization/pitask-metadata.d.ts +80 -0
  1117. package/core/dist/runtime-v2/internalization/pitask-metadata.d.ts.map +1 -0
  1118. package/core/dist/runtime-v2/internalization/pitask-metadata.js +194 -0
  1119. package/core/dist/runtime-v2/internalization/pitask-metadata.js.map +1 -0
  1120. package/core/dist/runtime-v2/internalization/queue-actionability.d.ts +37 -0
  1121. package/core/dist/runtime-v2/internalization/queue-actionability.d.ts.map +1 -0
  1122. package/core/dist/runtime-v2/internalization/queue-actionability.js +50 -0
  1123. package/core/dist/runtime-v2/internalization/queue-actionability.js.map +1 -0
  1124. package/core/dist/runtime-v2/internalization/refiner-rulehost-gate.d.ts +20 -0
  1125. package/core/dist/runtime-v2/internalization/refiner-rulehost-gate.d.ts.map +1 -0
  1126. package/core/dist/runtime-v2/internalization/refiner-rulehost-gate.js +151 -0
  1127. package/core/dist/runtime-v2/internalization/refiner-rulehost-gate.js.map +1 -0
  1128. package/core/dist/runtime-v2/internalization/refiner-sandbox-wrapper.d.ts +36 -0
  1129. package/core/dist/runtime-v2/internalization/refiner-sandbox-wrapper.d.ts.map +1 -0
  1130. package/core/dist/runtime-v2/internalization/refiner-sandbox-wrapper.js +227 -0
  1131. package/core/dist/runtime-v2/internalization/refiner-sandbox-wrapper.js.map +1 -0
  1132. package/core/dist/runtime-v2/internalization/rollout-reviewer-output.d.ts +74 -0
  1133. package/core/dist/runtime-v2/internalization/rollout-reviewer-output.d.ts.map +1 -0
  1134. package/core/dist/runtime-v2/internalization/rollout-reviewer-output.js +117 -0
  1135. package/core/dist/runtime-v2/internalization/rollout-reviewer-output.js.map +1 -0
  1136. package/core/dist/runtime-v2/internalization/rollout-reviewer-prompt-builder.d.ts +24 -0
  1137. package/core/dist/runtime-v2/internalization/rollout-reviewer-prompt-builder.d.ts.map +1 -0
  1138. package/core/dist/runtime-v2/internalization/rollout-reviewer-prompt-builder.js +52 -0
  1139. package/core/dist/runtime-v2/internalization/rollout-reviewer-prompt-builder.js.map +1 -0
  1140. package/core/dist/runtime-v2/internalization/rollout-reviewer-runner.d.ts +76 -0
  1141. package/core/dist/runtime-v2/internalization/rollout-reviewer-runner.d.ts.map +1 -0
  1142. package/core/dist/runtime-v2/internalization/rollout-reviewer-runner.js +538 -0
  1143. package/core/dist/runtime-v2/internalization/rollout-reviewer-runner.js.map +1 -0
  1144. package/core/dist/runtime-v2/internalization/routing-policy.d.ts +24 -0
  1145. package/core/dist/runtime-v2/internalization/routing-policy.d.ts.map +1 -0
  1146. package/core/dist/runtime-v2/internalization/routing-policy.js +169 -0
  1147. package/core/dist/runtime-v2/internalization/routing-policy.js.map +1 -0
  1148. package/core/dist/runtime-v2/internalization/routing-policy.test.d.ts +2 -0
  1149. package/core/dist/runtime-v2/internalization/routing-policy.test.d.ts.map +1 -0
  1150. package/core/dist/runtime-v2/internalization/routing-policy.test.js +286 -0
  1151. package/core/dist/runtime-v2/internalization/routing-policy.test.js.map +1 -0
  1152. package/core/dist/runtime-v2/internalization/rule-code-validator.d.ts +21 -0
  1153. package/core/dist/runtime-v2/internalization/rule-code-validator.d.ts.map +1 -0
  1154. package/core/dist/runtime-v2/internalization/rule-code-validator.js +42 -0
  1155. package/core/dist/runtime-v2/internalization/rule-code-validator.js.map +1 -0
  1156. package/core/dist/runtime-v2/internalization/rule-host-adapter.d.ts +16 -0
  1157. package/core/dist/runtime-v2/internalization/rule-host-adapter.d.ts.map +1 -0
  1158. package/core/dist/runtime-v2/internalization/rule-host-adapter.js +13 -0
  1159. package/core/dist/runtime-v2/internalization/rule-host-adapter.js.map +1 -0
  1160. package/core/dist/runtime-v2/internalization/rule-host-contracts.d.ts +61 -0
  1161. package/core/dist/runtime-v2/internalization/rule-host-contracts.d.ts.map +1 -0
  1162. package/core/dist/runtime-v2/internalization/rule-host-contracts.js +14 -0
  1163. package/core/dist/runtime-v2/internalization/rule-host-contracts.js.map +1 -0
  1164. package/core/dist/runtime-v2/internalization/rule-host-evaluator.d.ts +36 -0
  1165. package/core/dist/runtime-v2/internalization/rule-host-evaluator.d.ts.map +1 -0
  1166. package/core/dist/runtime-v2/internalization/rule-host-evaluator.js +103 -0
  1167. package/core/dist/runtime-v2/internalization/rule-host-evaluator.js.map +1 -0
  1168. package/core/dist/runtime-v2/internalization/rule-host-helpers.d.ts +27 -0
  1169. package/core/dist/runtime-v2/internalization/rule-host-helpers.d.ts.map +1 -0
  1170. package/core/dist/runtime-v2/internalization/rule-host-helpers.js +27 -0
  1171. package/core/dist/runtime-v2/internalization/rule-host-helpers.js.map +1 -0
  1172. package/core/dist/runtime-v2/internalization/scribe-output.d.ts +74 -0
  1173. package/core/dist/runtime-v2/internalization/scribe-output.d.ts.map +1 -0
  1174. package/core/dist/runtime-v2/internalization/scribe-output.js +98 -0
  1175. package/core/dist/runtime-v2/internalization/scribe-output.js.map +1 -0
  1176. package/core/dist/runtime-v2/internalization/scribe-prompt-builder.d.ts +24 -0
  1177. package/core/dist/runtime-v2/internalization/scribe-prompt-builder.d.ts.map +1 -0
  1178. package/core/dist/runtime-v2/internalization/scribe-prompt-builder.js +60 -0
  1179. package/core/dist/runtime-v2/internalization/scribe-prompt-builder.js.map +1 -0
  1180. package/core/dist/runtime-v2/internalization/scribe-runner.d.ts +77 -0
  1181. package/core/dist/runtime-v2/internalization/scribe-runner.d.ts.map +1 -0
  1182. package/core/dist/runtime-v2/internalization/scribe-runner.js +518 -0
  1183. package/core/dist/runtime-v2/internalization/scribe-runner.js.map +1 -0
  1184. package/core/dist/runtime-v2/internalization/template-generator.d.ts +21 -0
  1185. package/core/dist/runtime-v2/internalization/template-generator.d.ts.map +1 -0
  1186. package/core/dist/runtime-v2/internalization/template-generator.js +61 -0
  1187. package/core/dist/runtime-v2/internalization/template-generator.js.map +1 -0
  1188. package/core/dist/runtime-v2/internalization/trainer-output.d.ts +122 -0
  1189. package/core/dist/runtime-v2/internalization/trainer-output.d.ts.map +1 -0
  1190. package/core/dist/runtime-v2/internalization/trainer-output.js +223 -0
  1191. package/core/dist/runtime-v2/internalization/trainer-output.js.map +1 -0
  1192. package/core/dist/runtime-v2/internalization/trainer-prompt-builder.d.ts +24 -0
  1193. package/core/dist/runtime-v2/internalization/trainer-prompt-builder.d.ts.map +1 -0
  1194. package/core/dist/runtime-v2/internalization/trainer-prompt-builder.js +57 -0
  1195. package/core/dist/runtime-v2/internalization/trainer-prompt-builder.js.map +1 -0
  1196. package/core/dist/runtime-v2/internalization/trainer-runner.d.ts +76 -0
  1197. package/core/dist/runtime-v2/internalization/trainer-runner.d.ts.map +1 -0
  1198. package/core/dist/runtime-v2/internalization/trainer-runner.js +538 -0
  1199. package/core/dist/runtime-v2/internalization/trainer-runner.js.map +1 -0
  1200. package/core/dist/runtime-v2/internalization-chain-integrity-read-model.d.ts +42 -0
  1201. package/core/dist/runtime-v2/internalization-chain-integrity-read-model.d.ts.map +1 -0
  1202. package/core/dist/runtime-v2/internalization-chain-integrity-read-model.js +413 -0
  1203. package/core/dist/runtime-v2/internalization-chain-integrity-read-model.js.map +1 -0
  1204. package/core/dist/runtime-v2/internalization-integrity-remediation.d.ts +17 -0
  1205. package/core/dist/runtime-v2/internalization-integrity-remediation.d.ts.map +1 -0
  1206. package/core/dist/runtime-v2/internalization-integrity-remediation.js +269 -0
  1207. package/core/dist/runtime-v2/internalization-integrity-remediation.js.map +1 -0
  1208. package/core/dist/runtime-v2/internalization-queue-read-model.d.ts +93 -0
  1209. package/core/dist/runtime-v2/internalization-queue-read-model.d.ts.map +1 -0
  1210. package/core/dist/runtime-v2/internalization-queue-read-model.js +217 -0
  1211. package/core/dist/runtime-v2/internalization-queue-read-model.js.map +1 -0
  1212. package/core/dist/runtime-v2/l1-hard-cap.d.ts +21 -0
  1213. package/core/dist/runtime-v2/l1-hard-cap.d.ts.map +1 -0
  1214. package/core/dist/runtime-v2/l1-hard-cap.js +51 -0
  1215. package/core/dist/runtime-v2/l1-hard-cap.js.map +1 -0
  1216. package/core/dist/runtime-v2/observer/__tests__/agent-scheduler.test.d.ts +2 -0
  1217. package/core/dist/runtime-v2/observer/__tests__/agent-scheduler.test.d.ts.map +1 -0
  1218. package/core/dist/runtime-v2/observer/__tests__/agent-scheduler.test.js +49 -0
  1219. package/core/dist/runtime-v2/observer/__tests__/agent-scheduler.test.js.map +1 -0
  1220. package/core/dist/runtime-v2/observer/__tests__/correction-observer.test.d.ts +2 -0
  1221. package/core/dist/runtime-v2/observer/__tests__/correction-observer.test.d.ts.map +1 -0
  1222. package/core/dist/runtime-v2/observer/__tests__/correction-observer.test.js +144 -0
  1223. package/core/dist/runtime-v2/observer/__tests__/correction-observer.test.js.map +1 -0
  1224. package/core/dist/runtime-v2/observer/__tests__/empathy-observer.real-e2e.test.d.ts +2 -0
  1225. package/core/dist/runtime-v2/observer/__tests__/empathy-observer.real-e2e.test.d.ts.map +1 -0
  1226. package/core/dist/runtime-v2/observer/__tests__/empathy-observer.real-e2e.test.js +67 -0
  1227. package/core/dist/runtime-v2/observer/__tests__/empathy-observer.real-e2e.test.js.map +1 -0
  1228. package/core/dist/runtime-v2/observer/__tests__/empathy-observer.test.d.ts +2 -0
  1229. package/core/dist/runtime-v2/observer/__tests__/empathy-observer.test.d.ts.map +1 -0
  1230. package/core/dist/runtime-v2/observer/__tests__/empathy-observer.test.js +84 -0
  1231. package/core/dist/runtime-v2/observer/__tests__/empathy-observer.test.js.map +1 -0
  1232. package/core/dist/runtime-v2/observer/agent-scheduler.d.ts +40 -0
  1233. package/core/dist/runtime-v2/observer/agent-scheduler.d.ts.map +1 -0
  1234. package/core/dist/runtime-v2/observer/agent-scheduler.js +30 -0
  1235. package/core/dist/runtime-v2/observer/agent-scheduler.js.map +1 -0
  1236. package/core/dist/runtime-v2/observer/correction-observer.d.ts +59 -0
  1237. package/core/dist/runtime-v2/observer/correction-observer.d.ts.map +1 -0
  1238. package/core/dist/runtime-v2/observer/correction-observer.js +178 -0
  1239. package/core/dist/runtime-v2/observer/correction-observer.js.map +1 -0
  1240. package/core/dist/runtime-v2/observer/empathy-observer.d.ts +35 -0
  1241. package/core/dist/runtime-v2/observer/empathy-observer.d.ts.map +1 -0
  1242. package/core/dist/runtime-v2/observer/empathy-observer.js +98 -0
  1243. package/core/dist/runtime-v2/observer/empathy-observer.js.map +1 -0
  1244. package/core/dist/runtime-v2/operator-health-read-model.d.ts +45 -0
  1245. package/core/dist/runtime-v2/operator-health-read-model.d.ts.map +1 -0
  1246. package/core/dist/runtime-v2/operator-health-read-model.js +189 -0
  1247. package/core/dist/runtime-v2/operator-health-read-model.js.map +1 -0
  1248. package/core/dist/runtime-v2/pain-chain-read-model.d.ts +40 -0
  1249. package/core/dist/runtime-v2/pain-chain-read-model.d.ts.map +1 -0
  1250. package/core/dist/runtime-v2/pain-chain-read-model.js +293 -0
  1251. package/core/dist/runtime-v2/pain-chain-read-model.js.map +1 -0
  1252. package/core/dist/runtime-v2/pain-flood-simulation.d.ts +62 -0
  1253. package/core/dist/runtime-v2/pain-flood-simulation.d.ts.map +1 -0
  1254. package/core/dist/runtime-v2/pain-flood-simulation.js +152 -0
  1255. package/core/dist/runtime-v2/pain-flood-simulation.js.map +1 -0
  1256. package/core/dist/runtime-v2/pain-signal-bridge.d.ts +72 -0
  1257. package/core/dist/runtime-v2/pain-signal-bridge.d.ts.map +1 -0
  1258. package/core/dist/runtime-v2/pain-signal-bridge.js +340 -0
  1259. package/core/dist/runtime-v2/pain-signal-bridge.js.map +1 -0
  1260. package/core/dist/runtime-v2/pain-signal-observability.d.ts +19 -0
  1261. package/core/dist/runtime-v2/pain-signal-observability.d.ts.map +1 -0
  1262. package/core/dist/runtime-v2/pain-signal-observability.js +161 -0
  1263. package/core/dist/runtime-v2/pain-signal-observability.js.map +1 -0
  1264. package/core/dist/runtime-v2/pain-signal-runtime-factory.d.ts +82 -0
  1265. package/core/dist/runtime-v2/pain-signal-runtime-factory.d.ts.map +1 -0
  1266. package/core/dist/runtime-v2/pain-signal-runtime-factory.js +279 -0
  1267. package/core/dist/runtime-v2/pain-signal-runtime-factory.js.map +1 -0
  1268. package/core/dist/runtime-v2/pain-to-principle-service.d.ts +53 -0
  1269. package/core/dist/runtime-v2/pain-to-principle-service.d.ts.map +1 -0
  1270. package/core/dist/runtime-v2/pain-to-principle-service.js +114 -0
  1271. package/core/dist/runtime-v2/pain-to-principle-service.js.map +1 -0
  1272. package/core/dist/runtime-v2/proven-channel-baseline.d.ts +56 -0
  1273. package/core/dist/runtime-v2/proven-channel-baseline.d.ts.map +1 -0
  1274. package/core/dist/runtime-v2/proven-channel-baseline.js +480 -0
  1275. package/core/dist/runtime-v2/proven-channel-baseline.js.map +1 -0
  1276. package/core/dist/runtime-v2/pruning-mask.d.ts +27 -0
  1277. package/core/dist/runtime-v2/pruning-mask.d.ts.map +1 -0
  1278. package/core/dist/runtime-v2/pruning-mask.js +59 -0
  1279. package/core/dist/runtime-v2/pruning-mask.js.map +1 -0
  1280. package/core/dist/runtime-v2/pruning-read-model.d.ts +76 -0
  1281. package/core/dist/runtime-v2/pruning-read-model.d.ts.map +1 -0
  1282. package/core/dist/runtime-v2/pruning-read-model.js +266 -0
  1283. package/core/dist/runtime-v2/pruning-read-model.js.map +1 -0
  1284. package/core/dist/runtime-v2/pruning-review-log.d.ts +41 -0
  1285. package/core/dist/runtime-v2/pruning-review-log.d.ts.map +1 -0
  1286. package/core/dist/runtime-v2/pruning-review-log.js +106 -0
  1287. package/core/dist/runtime-v2/pruning-review-log.js.map +1 -0
  1288. package/core/dist/runtime-v2/recovery-sweep-service.d.ts +14 -0
  1289. package/core/dist/runtime-v2/recovery-sweep-service.d.ts.map +1 -0
  1290. package/core/dist/runtime-v2/recovery-sweep-service.js +26 -0
  1291. package/core/dist/runtime-v2/recovery-sweep-service.js.map +1 -0
  1292. package/core/dist/runtime-v2/remediation-contract.d.ts +46 -0
  1293. package/core/dist/runtime-v2/remediation-contract.d.ts.map +1 -0
  1294. package/core/dist/runtime-v2/remediation-contract.js +29 -0
  1295. package/core/dist/runtime-v2/remediation-contract.js.map +1 -0
  1296. package/core/dist/runtime-v2/runner/__tests__/default-validator.test.d.ts +2 -0
  1297. package/core/dist/runtime-v2/runner/__tests__/default-validator.test.d.ts.map +1 -0
  1298. package/core/dist/runtime-v2/runner/__tests__/default-validator.test.js +526 -0
  1299. package/core/dist/runtime-v2/runner/__tests__/default-validator.test.js.map +1 -0
  1300. package/core/dist/runtime-v2/runner/__tests__/diagnose.test.d.ts +2 -0
  1301. package/core/dist/runtime-v2/runner/__tests__/diagnose.test.d.ts.map +1 -0
  1302. package/core/dist/runtime-v2/runner/__tests__/diagnose.test.js +81 -0
  1303. package/core/dist/runtime-v2/runner/__tests__/diagnose.test.js.map +1 -0
  1304. package/core/dist/runtime-v2/runner/__tests__/diagnostician-runner.integration.test.d.ts +2 -0
  1305. package/core/dist/runtime-v2/runner/__tests__/diagnostician-runner.integration.test.d.ts.map +1 -0
  1306. package/core/dist/runtime-v2/runner/__tests__/diagnostician-runner.integration.test.js +378 -0
  1307. package/core/dist/runtime-v2/runner/__tests__/diagnostician-runner.integration.test.js.map +1 -0
  1308. package/core/dist/runtime-v2/runner/__tests__/diagnostician-runner.test.d.ts +2 -0
  1309. package/core/dist/runtime-v2/runner/__tests__/diagnostician-runner.test.d.ts.map +1 -0
  1310. package/core/dist/runtime-v2/runner/__tests__/diagnostician-runner.test.js +642 -0
  1311. package/core/dist/runtime-v2/runner/__tests__/diagnostician-runner.test.js.map +1 -0
  1312. package/core/dist/runtime-v2/runner/__tests__/diagnostician-telemetry.test.d.ts +2 -0
  1313. package/core/dist/runtime-v2/runner/__tests__/diagnostician-telemetry.test.d.ts.map +1 -0
  1314. package/core/dist/runtime-v2/runner/__tests__/diagnostician-telemetry.test.js +286 -0
  1315. package/core/dist/runtime-v2/runner/__tests__/diagnostician-telemetry.test.js.map +1 -0
  1316. package/core/dist/runtime-v2/runner/__tests__/dual-track-e2e.test.d.ts +2 -0
  1317. package/core/dist/runtime-v2/runner/__tests__/dual-track-e2e.test.d.ts.map +1 -0
  1318. package/core/dist/runtime-v2/runner/__tests__/dual-track-e2e.test.js +320 -0
  1319. package/core/dist/runtime-v2/runner/__tests__/dual-track-e2e.test.js.map +1 -0
  1320. package/core/dist/runtime-v2/runner/__tests__/lease-expiration-recovery.integration.test.d.ts +2 -0
  1321. package/core/dist/runtime-v2/runner/__tests__/lease-expiration-recovery.integration.test.d.ts.map +1 -0
  1322. package/core/dist/runtime-v2/runner/__tests__/lease-expiration-recovery.integration.test.js +261 -0
  1323. package/core/dist/runtime-v2/runner/__tests__/lease-expiration-recovery.integration.test.js.map +1 -0
  1324. package/core/dist/runtime-v2/runner/__tests__/m5-05-e2e.test.d.ts +2 -0
  1325. package/core/dist/runtime-v2/runner/__tests__/m5-05-e2e.test.d.ts.map +1 -0
  1326. package/core/dist/runtime-v2/runner/__tests__/m5-05-e2e.test.js +405 -0
  1327. package/core/dist/runtime-v2/runner/__tests__/m5-05-e2e.test.js.map +1 -0
  1328. package/core/dist/runtime-v2/runner/__tests__/m6-06-e2e.test.d.ts +2 -0
  1329. package/core/dist/runtime-v2/runner/__tests__/m6-06-e2e.test.d.ts.map +1 -0
  1330. package/core/dist/runtime-v2/runner/__tests__/m6-06-e2e.test.js +347 -0
  1331. package/core/dist/runtime-v2/runner/__tests__/m6-06-e2e.test.js.map +1 -0
  1332. package/core/dist/runtime-v2/runner/__tests__/m6-06-legacy.test.d.ts +2 -0
  1333. package/core/dist/runtime-v2/runner/__tests__/m6-06-legacy.test.d.ts.map +1 -0
  1334. package/core/dist/runtime-v2/runner/__tests__/m6-06-legacy.test.js +186 -0
  1335. package/core/dist/runtime-v2/runner/__tests__/m6-06-legacy.test.js.map +1 -0
  1336. package/core/dist/runtime-v2/runner/__tests__/m6-06-real-path.test.d.ts +2 -0
  1337. package/core/dist/runtime-v2/runner/__tests__/m6-06-real-path.test.d.ts.map +1 -0
  1338. package/core/dist/runtime-v2/runner/__tests__/m6-06-real-path.test.js +355 -0
  1339. package/core/dist/runtime-v2/runner/__tests__/m6-06-real-path.test.js.map +1 -0
  1340. package/core/dist/runtime-v2/runner/__tests__/m8-02-e2e.test.d.ts +2 -0
  1341. package/core/dist/runtime-v2/runner/__tests__/m8-02-e2e.test.d.ts.map +1 -0
  1342. package/core/dist/runtime-v2/runner/__tests__/m8-02-e2e.test.js +488 -0
  1343. package/core/dist/runtime-v2/runner/__tests__/m8-02-e2e.test.js.map +1 -0
  1344. package/core/dist/runtime-v2/runner/__tests__/m9-adapter-integration.test.d.ts +2 -0
  1345. package/core/dist/runtime-v2/runner/__tests__/m9-adapter-integration.test.d.ts.map +1 -0
  1346. package/core/dist/runtime-v2/runner/__tests__/m9-adapter-integration.test.js +171 -0
  1347. package/core/dist/runtime-v2/runner/__tests__/m9-adapter-integration.test.js.map +1 -0
  1348. package/core/dist/runtime-v2/runner/__tests__/m9-e2e.test.d.ts +2 -0
  1349. package/core/dist/runtime-v2/runner/__tests__/m9-e2e.test.d.ts.map +1 -0
  1350. package/core/dist/runtime-v2/runner/__tests__/m9-e2e.test.js +182 -0
  1351. package/core/dist/runtime-v2/runner/__tests__/m9-e2e.test.js.map +1 -0
  1352. package/core/dist/runtime-v2/runner/__tests__/max-attempts-exceeded.integration.test.d.ts +2 -0
  1353. package/core/dist/runtime-v2/runner/__tests__/max-attempts-exceeded.integration.test.d.ts.map +1 -0
  1354. package/core/dist/runtime-v2/runner/__tests__/max-attempts-exceeded.integration.test.js +276 -0
  1355. package/core/dist/runtime-v2/runner/__tests__/max-attempts-exceeded.integration.test.js.map +1 -0
  1356. package/core/dist/runtime-v2/runner/__tests__/pain-signal-bridge-admission.test.d.ts +2 -0
  1357. package/core/dist/runtime-v2/runner/__tests__/pain-signal-bridge-admission.test.d.ts.map +1 -0
  1358. package/core/dist/runtime-v2/runner/__tests__/pain-signal-bridge-admission.test.js +462 -0
  1359. package/core/dist/runtime-v2/runner/__tests__/pain-signal-bridge-admission.test.js.map +1 -0
  1360. package/core/dist/runtime-v2/runner/__tests__/pain-signal-bridge.test.d.ts +2 -0
  1361. package/core/dist/runtime-v2/runner/__tests__/pain-signal-bridge.test.d.ts.map +1 -0
  1362. package/core/dist/runtime-v2/runner/__tests__/pain-signal-bridge.test.js +160 -0
  1363. package/core/dist/runtime-v2/runner/__tests__/pain-signal-bridge.test.js.map +1 -0
  1364. package/core/dist/runtime-v2/runner/__tests__/retry-wait-recovery.integration.test.d.ts +2 -0
  1365. package/core/dist/runtime-v2/runner/__tests__/retry-wait-recovery.integration.test.d.ts.map +1 -0
  1366. package/core/dist/runtime-v2/runner/__tests__/retry-wait-recovery.integration.test.js +272 -0
  1367. package/core/dist/runtime-v2/runner/__tests__/retry-wait-recovery.integration.test.js.map +1 -0
  1368. package/core/dist/runtime-v2/runner/__tests__/start-run-input.test.d.ts +2 -0
  1369. package/core/dist/runtime-v2/runner/__tests__/start-run-input.test.d.ts.map +1 -0
  1370. package/core/dist/runtime-v2/runner/__tests__/start-run-input.test.js +67 -0
  1371. package/core/dist/runtime-v2/runner/__tests__/start-run-input.test.js.map +1 -0
  1372. package/core/dist/runtime-v2/runner/default-validator.d.ts +10 -0
  1373. package/core/dist/runtime-v2/runner/default-validator.d.ts.map +1 -0
  1374. package/core/dist/runtime-v2/runner/default-validator.js +168 -0
  1375. package/core/dist/runtime-v2/runner/default-validator.js.map +1 -0
  1376. package/core/dist/runtime-v2/runner/diagnostician-runner-options.d.ts +37 -0
  1377. package/core/dist/runtime-v2/runner/diagnostician-runner-options.d.ts.map +1 -0
  1378. package/core/dist/runtime-v2/runner/diagnostician-runner-options.js +19 -0
  1379. package/core/dist/runtime-v2/runner/diagnostician-runner-options.js.map +1 -0
  1380. package/core/dist/runtime-v2/runner/diagnostician-runner.d.ts +87 -0
  1381. package/core/dist/runtime-v2/runner/diagnostician-runner.d.ts.map +1 -0
  1382. package/core/dist/runtime-v2/runner/diagnostician-runner.js +417 -0
  1383. package/core/dist/runtime-v2/runner/diagnostician-runner.js.map +1 -0
  1384. package/core/dist/runtime-v2/runner/diagnostician-validator.d.ts +56 -0
  1385. package/core/dist/runtime-v2/runner/diagnostician-validator.d.ts.map +1 -0
  1386. package/core/dist/runtime-v2/runner/diagnostician-validator.js +11 -0
  1387. package/core/dist/runtime-v2/runner/diagnostician-validator.js.map +1 -0
  1388. package/core/dist/runtime-v2/runner/runner-phase.d.ts +21 -0
  1389. package/core/dist/runtime-v2/runner/runner-phase.d.ts.map +1 -0
  1390. package/core/dist/runtime-v2/runner/runner-phase.js +22 -0
  1391. package/core/dist/runtime-v2/runner/runner-phase.js.map +1 -0
  1392. package/core/dist/runtime-v2/runner/runner-result.d.ts +20 -0
  1393. package/core/dist/runtime-v2/runner/runner-result.d.ts.map +1 -0
  1394. package/core/dist/runtime-v2/runner/runner-result.js +2 -0
  1395. package/core/dist/runtime-v2/runner/runner-result.js.map +1 -0
  1396. package/core/dist/runtime-v2/runtime-protocol.d.ts +165 -0
  1397. package/core/dist/runtime-v2/runtime-protocol.d.ts.map +1 -0
  1398. package/core/dist/runtime-v2/runtime-protocol.js +130 -0
  1399. package/core/dist/runtime-v2/runtime-protocol.js.map +1 -0
  1400. package/core/dist/runtime-v2/runtime-selector.d.ts +77 -0
  1401. package/core/dist/runtime-v2/runtime-selector.d.ts.map +1 -0
  1402. package/core/dist/runtime-v2/runtime-selector.js +23 -0
  1403. package/core/dist/runtime-v2/runtime-selector.js.map +1 -0
  1404. package/core/dist/runtime-v2/runtime-state-handle.d.ts +10 -0
  1405. package/core/dist/runtime-v2/runtime-state-handle.d.ts.map +1 -0
  1406. package/core/dist/runtime-v2/runtime-state-handle.js +30 -0
  1407. package/core/dist/runtime-v2/runtime-state-handle.js.map +1 -0
  1408. package/core/dist/runtime-v2/schema-conformance-read-model.d.ts +24 -0
  1409. package/core/dist/runtime-v2/schema-conformance-read-model.d.ts.map +1 -0
  1410. package/core/dist/runtime-v2/schema-conformance-read-model.js +178 -0
  1411. package/core/dist/runtime-v2/schema-conformance-read-model.js.map +1 -0
  1412. package/core/dist/runtime-v2/schema-version.d.ts +20 -0
  1413. package/core/dist/runtime-v2/schema-version.d.ts.map +1 -0
  1414. package/core/dist/runtime-v2/schema-version.js +20 -0
  1415. package/core/dist/runtime-v2/schema-version.js.map +1 -0
  1416. package/core/dist/runtime-v2/store/artifact/artifact-store.d.ts +28 -0
  1417. package/core/dist/runtime-v2/store/artifact/artifact-store.d.ts.map +1 -0
  1418. package/core/dist/runtime-v2/store/artifact/artifact-store.js +2 -0
  1419. package/core/dist/runtime-v2/store/artifact/artifact-store.js.map +1 -0
  1420. package/core/dist/runtime-v2/store/artifact/index.d.ts +4 -0
  1421. package/core/dist/runtime-v2/store/artifact/index.d.ts.map +1 -0
  1422. package/core/dist/runtime-v2/store/artifact/index.js +3 -0
  1423. package/core/dist/runtime-v2/store/artifact/index.js.map +1 -0
  1424. package/core/dist/runtime-v2/store/artifact/memory-artifact-store.d.ts +14 -0
  1425. package/core/dist/runtime-v2/store/artifact/memory-artifact-store.d.ts.map +1 -0
  1426. package/core/dist/runtime-v2/store/artifact/memory-artifact-store.js +25 -0
  1427. package/core/dist/runtime-v2/store/artifact/memory-artifact-store.js.map +1 -0
  1428. package/core/dist/runtime-v2/store/artifact/sqlite-artifact-store.d.ts +12 -0
  1429. package/core/dist/runtime-v2/store/artifact/sqlite-artifact-store.d.ts.map +1 -0
  1430. package/core/dist/runtime-v2/store/artifact/sqlite-artifact-store.js +51 -0
  1431. package/core/dist/runtime-v2/store/artifact/sqlite-artifact-store.js.map +1 -0
  1432. package/core/dist/runtime-v2/store/artifact/sqlite-pi-artifact-store.d.ts +13 -0
  1433. package/core/dist/runtime-v2/store/artifact/sqlite-pi-artifact-store.d.ts.map +1 -0
  1434. package/core/dist/runtime-v2/store/artifact/sqlite-pi-artifact-store.js +98 -0
  1435. package/core/dist/runtime-v2/store/artifact/sqlite-pi-artifact-store.js.map +1 -0
  1436. package/core/dist/runtime-v2/store/candidate/__tests__/recommendation-kind-resolver.test.d.ts +2 -0
  1437. package/core/dist/runtime-v2/store/candidate/__tests__/recommendation-kind-resolver.test.d.ts.map +1 -0
  1438. package/core/dist/runtime-v2/store/candidate/__tests__/recommendation-kind-resolver.test.js +34 -0
  1439. package/core/dist/runtime-v2/store/candidate/__tests__/recommendation-kind-resolver.test.js.map +1 -0
  1440. package/core/dist/runtime-v2/store/candidate/candidate-store.d.ts +42 -0
  1441. package/core/dist/runtime-v2/store/candidate/candidate-store.d.ts.map +1 -0
  1442. package/core/dist/runtime-v2/store/candidate/candidate-store.js +2 -0
  1443. package/core/dist/runtime-v2/store/candidate/candidate-store.js.map +1 -0
  1444. package/core/dist/runtime-v2/store/candidate/index.d.ts +4 -0
  1445. package/core/dist/runtime-v2/store/candidate/index.d.ts.map +1 -0
  1446. package/core/dist/runtime-v2/store/candidate/index.js +3 -0
  1447. package/core/dist/runtime-v2/store/candidate/index.js.map +1 -0
  1448. package/core/dist/runtime-v2/store/candidate/memory-candidate-store.d.ts +22 -0
  1449. package/core/dist/runtime-v2/store/candidate/memory-candidate-store.d.ts.map +1 -0
  1450. package/core/dist/runtime-v2/store/candidate/memory-candidate-store.js +36 -0
  1451. package/core/dist/runtime-v2/store/candidate/memory-candidate-store.js.map +1 -0
  1452. package/core/dist/runtime-v2/store/candidate/recommendation-kind-resolver.d.ts +4 -0
  1453. package/core/dist/runtime-v2/store/candidate/recommendation-kind-resolver.d.ts.map +1 -0
  1454. package/core/dist/runtime-v2/store/candidate/recommendation-kind-resolver.js +14 -0
  1455. package/core/dist/runtime-v2/store/candidate/recommendation-kind-resolver.js.map +1 -0
  1456. package/core/dist/runtime-v2/store/candidate/sqlite-candidate-store.d.ts +13 -0
  1457. package/core/dist/runtime-v2/store/candidate/sqlite-candidate-store.d.ts.map +1 -0
  1458. package/core/dist/runtime-v2/store/candidate/sqlite-candidate-store.js +61 -0
  1459. package/core/dist/runtime-v2/store/candidate/sqlite-candidate-store.js.map +1 -0
  1460. package/core/dist/runtime-v2/store/commit/commit-store.d.ts +19 -0
  1461. package/core/dist/runtime-v2/store/commit/commit-store.d.ts.map +1 -0
  1462. package/core/dist/runtime-v2/store/commit/commit-store.js +2 -0
  1463. package/core/dist/runtime-v2/store/commit/commit-store.js.map +1 -0
  1464. package/core/dist/runtime-v2/store/commit/diagnostician-committer.d.ts +47 -0
  1465. package/core/dist/runtime-v2/store/commit/diagnostician-committer.d.ts.map +1 -0
  1466. package/core/dist/runtime-v2/store/commit/diagnostician-committer.js +140 -0
  1467. package/core/dist/runtime-v2/store/commit/diagnostician-committer.js.map +1 -0
  1468. package/core/dist/runtime-v2/store/commit/index.d.ts +7 -0
  1469. package/core/dist/runtime-v2/store/commit/index.d.ts.map +1 -0
  1470. package/core/dist/runtime-v2/store/commit/index.js +4 -0
  1471. package/core/dist/runtime-v2/store/commit/index.js.map +1 -0
  1472. package/core/dist/runtime-v2/store/commit/memory-commit-store.d.ts +16 -0
  1473. package/core/dist/runtime-v2/store/commit/memory-commit-store.d.ts.map +1 -0
  1474. package/core/dist/runtime-v2/store/commit/memory-commit-store.js +18 -0
  1475. package/core/dist/runtime-v2/store/commit/memory-commit-store.js.map +1 -0
  1476. package/core/dist/runtime-v2/store/commit/sqlite-commit-store.d.ts +11 -0
  1477. package/core/dist/runtime-v2/store/commit/sqlite-commit-store.d.ts.map +1 -0
  1478. package/core/dist/runtime-v2/store/commit/sqlite-commit-store.js +25 -0
  1479. package/core/dist/runtime-v2/store/commit/sqlite-commit-store.js.map +1 -0
  1480. package/core/dist/runtime-v2/store/concurrent-lease.test.d.ts +2 -0
  1481. package/core/dist/runtime-v2/store/concurrent-lease.test.d.ts.map +1 -0
  1482. package/core/dist/runtime-v2/store/concurrent-lease.test.js +129 -0
  1483. package/core/dist/runtime-v2/store/concurrent-lease.test.js.map +1 -0
  1484. package/core/dist/runtime-v2/store/context/context-assembler.d.ts +19 -0
  1485. package/core/dist/runtime-v2/store/context/context-assembler.d.ts.map +1 -0
  1486. package/core/dist/runtime-v2/store/context/context-assembler.js +2 -0
  1487. package/core/dist/runtime-v2/store/context/context-assembler.js.map +1 -0
  1488. package/core/dist/runtime-v2/store/context/index.d.ts +4 -0
  1489. package/core/dist/runtime-v2/store/context/index.d.ts.map +1 -0
  1490. package/core/dist/runtime-v2/store/context/index.js +3 -0
  1491. package/core/dist/runtime-v2/store/context/index.js.map +1 -0
  1492. package/core/dist/runtime-v2/store/context/resilient-context-assembler.d.ts +13 -0
  1493. package/core/dist/runtime-v2/store/context/resilient-context-assembler.d.ts.map +1 -0
  1494. package/core/dist/runtime-v2/store/context/resilient-context-assembler.js +72 -0
  1495. package/core/dist/runtime-v2/store/context/resilient-context-assembler.js.map +1 -0
  1496. package/core/dist/runtime-v2/store/context/resilient-context-assembler.test.d.ts +2 -0
  1497. package/core/dist/runtime-v2/store/context/resilient-context-assembler.test.d.ts.map +1 -0
  1498. package/core/dist/runtime-v2/store/context/resilient-context-assembler.test.js +113 -0
  1499. package/core/dist/runtime-v2/store/context/resilient-context-assembler.test.js.map +1 -0
  1500. package/core/dist/runtime-v2/store/context/sqlite-context-assembler.d.ts +28 -0
  1501. package/core/dist/runtime-v2/store/context/sqlite-context-assembler.d.ts.map +1 -0
  1502. package/core/dist/runtime-v2/store/context/sqlite-context-assembler.js +277 -0
  1503. package/core/dist/runtime-v2/store/context/sqlite-context-assembler.js.map +1 -0
  1504. package/core/dist/runtime-v2/store/context/sqlite-context-assembler.test.d.ts +2 -0
  1505. package/core/dist/runtime-v2/store/context/sqlite-context-assembler.test.d.ts.map +1 -0
  1506. package/core/dist/runtime-v2/store/context/sqlite-context-assembler.test.js +1181 -0
  1507. package/core/dist/runtime-v2/store/context/sqlite-context-assembler.test.js.map +1 -0
  1508. package/core/dist/runtime-v2/store/diagnostician-committer.test.d.ts +2 -0
  1509. package/core/dist/runtime-v2/store/diagnostician-committer.test.d.ts.map +1 -0
  1510. package/core/dist/runtime-v2/store/diagnostician-committer.test.js +326 -0
  1511. package/core/dist/runtime-v2/store/diagnostician-committer.test.js.map +1 -0
  1512. package/core/dist/runtime-v2/store/event-emitter.d.ts +18 -0
  1513. package/core/dist/runtime-v2/store/event-emitter.d.ts.map +1 -0
  1514. package/core/dist/runtime-v2/store/event-emitter.js +78 -0
  1515. package/core/dist/runtime-v2/store/event-emitter.js.map +1 -0
  1516. package/core/dist/runtime-v2/store/history/history-query.d.ts +57 -0
  1517. package/core/dist/runtime-v2/store/history/history-query.d.ts.map +1 -0
  1518. package/core/dist/runtime-v2/store/history/history-query.js +7 -0
  1519. package/core/dist/runtime-v2/store/history/history-query.js.map +1 -0
  1520. package/core/dist/runtime-v2/store/history/index.d.ts +5 -0
  1521. package/core/dist/runtime-v2/store/history/index.d.ts.map +1 -0
  1522. package/core/dist/runtime-v2/store/history/index.js +4 -0
  1523. package/core/dist/runtime-v2/store/history/index.js.map +1 -0
  1524. package/core/dist/runtime-v2/store/history/resilient-history-query.d.ts +20 -0
  1525. package/core/dist/runtime-v2/store/history/resilient-history-query.d.ts.map +1 -0
  1526. package/core/dist/runtime-v2/store/history/resilient-history-query.js +40 -0
  1527. package/core/dist/runtime-v2/store/history/resilient-history-query.js.map +1 -0
  1528. package/core/dist/runtime-v2/store/history/resilient-history-query.test.d.ts +2 -0
  1529. package/core/dist/runtime-v2/store/history/resilient-history-query.test.d.ts.map +1 -0
  1530. package/core/dist/runtime-v2/store/history/resilient-history-query.test.js +128 -0
  1531. package/core/dist/runtime-v2/store/history/resilient-history-query.test.js.map +1 -0
  1532. package/core/dist/runtime-v2/store/history/sqlite-history-query.d.ts +24 -0
  1533. package/core/dist/runtime-v2/store/history/sqlite-history-query.d.ts.map +1 -0
  1534. package/core/dist/runtime-v2/store/history/sqlite-history-query.js +166 -0
  1535. package/core/dist/runtime-v2/store/history/sqlite-history-query.js.map +1 -0
  1536. package/core/dist/runtime-v2/store/history/sqlite-history-query.test.d.ts +2 -0
  1537. package/core/dist/runtime-v2/store/history/sqlite-history-query.test.d.ts.map +1 -0
  1538. package/core/dist/runtime-v2/store/history/sqlite-history-query.test.js +536 -0
  1539. package/core/dist/runtime-v2/store/history/sqlite-history-query.test.js.map +1 -0
  1540. package/core/dist/runtime-v2/store/idempotent-transitions.test.d.ts +2 -0
  1541. package/core/dist/runtime-v2/store/idempotent-transitions.test.d.ts.map +1 -0
  1542. package/core/dist/runtime-v2/store/idempotent-transitions.test.js +168 -0
  1543. package/core/dist/runtime-v2/store/idempotent-transitions.test.js.map +1 -0
  1544. package/core/dist/runtime-v2/store/lifecycle/index.d.ts +7 -0
  1545. package/core/dist/runtime-v2/store/lifecycle/index.d.ts.map +1 -0
  1546. package/core/dist/runtime-v2/store/lifecycle/index.js +4 -0
  1547. package/core/dist/runtime-v2/store/lifecycle/index.js.map +1 -0
  1548. package/core/dist/runtime-v2/store/lifecycle/lease-manager.d.ts +91 -0
  1549. package/core/dist/runtime-v2/store/lifecycle/lease-manager.d.ts.map +1 -0
  1550. package/core/dist/runtime-v2/store/lifecycle/lease-manager.js +154 -0
  1551. package/core/dist/runtime-v2/store/lifecycle/lease-manager.js.map +1 -0
  1552. package/core/dist/runtime-v2/store/lifecycle/lease-manager.test.d.ts +2 -0
  1553. package/core/dist/runtime-v2/store/lifecycle/lease-manager.test.d.ts.map +1 -0
  1554. package/core/dist/runtime-v2/store/lifecycle/lease-manager.test.js +243 -0
  1555. package/core/dist/runtime-v2/store/lifecycle/lease-manager.test.js.map +1 -0
  1556. package/core/dist/runtime-v2/store/lifecycle/recovery-sweep.d.ts +82 -0
  1557. package/core/dist/runtime-v2/store/lifecycle/recovery-sweep.d.ts.map +1 -0
  1558. package/core/dist/runtime-v2/store/lifecycle/recovery-sweep.js +145 -0
  1559. package/core/dist/runtime-v2/store/lifecycle/recovery-sweep.js.map +1 -0
  1560. package/core/dist/runtime-v2/store/lifecycle/recovery-sweep.test.d.ts +2 -0
  1561. package/core/dist/runtime-v2/store/lifecycle/recovery-sweep.test.d.ts.map +1 -0
  1562. package/core/dist/runtime-v2/store/lifecycle/recovery-sweep.test.js +318 -0
  1563. package/core/dist/runtime-v2/store/lifecycle/recovery-sweep.test.js.map +1 -0
  1564. package/core/dist/runtime-v2/store/lifecycle/retry-policy.d.ts +105 -0
  1565. package/core/dist/runtime-v2/store/lifecycle/retry-policy.d.ts.map +1 -0
  1566. package/core/dist/runtime-v2/store/lifecycle/retry-policy.js +48 -0
  1567. package/core/dist/runtime-v2/store/lifecycle/retry-policy.js.map +1 -0
  1568. package/core/dist/runtime-v2/store/lifecycle/retry-policy.test.d.ts +2 -0
  1569. package/core/dist/runtime-v2/store/lifecycle/retry-policy.test.d.ts.map +1 -0
  1570. package/core/dist/runtime-v2/store/lifecycle/retry-policy.test.js +86 -0
  1571. package/core/dist/runtime-v2/store/lifecycle/retry-policy.test.js.map +1 -0
  1572. package/core/dist/runtime-v2/store/run/index.d.ts +4 -0
  1573. package/core/dist/runtime-v2/store/run/index.d.ts.map +1 -0
  1574. package/core/dist/runtime-v2/store/run/index.js +3 -0
  1575. package/core/dist/runtime-v2/store/run/index.js.map +1 -0
  1576. package/core/dist/runtime-v2/store/run/memory-run-store.d.ts +15 -0
  1577. package/core/dist/runtime-v2/store/run/memory-run-store.d.ts.map +1 -0
  1578. package/core/dist/runtime-v2/store/run/memory-run-store.js +33 -0
  1579. package/core/dist/runtime-v2/store/run/memory-run-store.js.map +1 -0
  1580. package/core/dist/runtime-v2/store/run/run-store.d.ts +43 -0
  1581. package/core/dist/runtime-v2/store/run/run-store.d.ts.map +1 -0
  1582. package/core/dist/runtime-v2/store/run/run-store.js +2 -0
  1583. package/core/dist/runtime-v2/store/run/run-store.js.map +1 -0
  1584. package/core/dist/runtime-v2/store/run/sqlite-run-store.d.ts +14 -0
  1585. package/core/dist/runtime-v2/store/run/sqlite-run-store.d.ts.map +1 -0
  1586. package/core/dist/runtime-v2/store/run/sqlite-run-store.js +108 -0
  1587. package/core/dist/runtime-v2/store/run/sqlite-run-store.js.map +1 -0
  1588. package/core/dist/runtime-v2/store/runtime-state-manager.d.ts +116 -0
  1589. package/core/dist/runtime-v2/store/runtime-state-manager.d.ts.map +1 -0
  1590. package/core/dist/runtime-v2/store/runtime-state-manager.integration.test.d.ts +2 -0
  1591. package/core/dist/runtime-v2/store/runtime-state-manager.integration.test.d.ts.map +1 -0
  1592. package/core/dist/runtime-v2/store/runtime-state-manager.integration.test.js +187 -0
  1593. package/core/dist/runtime-v2/store/runtime-state-manager.integration.test.js.map +1 -0
  1594. package/core/dist/runtime-v2/store/runtime-state-manager.js +321 -0
  1595. package/core/dist/runtime-v2/store/runtime-state-manager.js.map +1 -0
  1596. package/core/dist/runtime-v2/store/schema-conformance.test.d.ts +2 -0
  1597. package/core/dist/runtime-v2/store/schema-conformance.test.d.ts.map +1 -0
  1598. package/core/dist/runtime-v2/store/schema-conformance.test.js +607 -0
  1599. package/core/dist/runtime-v2/store/schema-conformance.test.js.map +1 -0
  1600. package/core/dist/runtime-v2/store/sqlite-connection-close.test.d.ts +2 -0
  1601. package/core/dist/runtime-v2/store/sqlite-connection-close.test.d.ts.map +1 -0
  1602. package/core/dist/runtime-v2/store/sqlite-connection-close.test.js +57 -0
  1603. package/core/dist/runtime-v2/store/sqlite-connection-close.test.js.map +1 -0
  1604. package/core/dist/runtime-v2/store/sqlite-connection-pragma.test.d.ts +2 -0
  1605. package/core/dist/runtime-v2/store/sqlite-connection-pragma.test.d.ts.map +1 -0
  1606. package/core/dist/runtime-v2/store/sqlite-connection-pragma.test.js +261 -0
  1607. package/core/dist/runtime-v2/store/sqlite-connection-pragma.test.js.map +1 -0
  1608. package/core/dist/runtime-v2/store/sqlite-connection.d.ts +39 -0
  1609. package/core/dist/runtime-v2/store/sqlite-connection.d.ts.map +1 -0
  1610. package/core/dist/runtime-v2/store/sqlite-connection.js +364 -0
  1611. package/core/dist/runtime-v2/store/sqlite-connection.js.map +1 -0
  1612. package/core/dist/runtime-v2/store/sqlite-run-store.test.d.ts +2 -0
  1613. package/core/dist/runtime-v2/store/sqlite-run-store.test.d.ts.map +1 -0
  1614. package/core/dist/runtime-v2/store/sqlite-run-store.test.js +152 -0
  1615. package/core/dist/runtime-v2/store/sqlite-run-store.test.js.map +1 -0
  1616. package/core/dist/runtime-v2/store/sqlite-task-store.test.d.ts +2 -0
  1617. package/core/dist/runtime-v2/store/sqlite-task-store.test.d.ts.map +1 -0
  1618. package/core/dist/runtime-v2/store/sqlite-task-store.test.js +166 -0
  1619. package/core/dist/runtime-v2/store/sqlite-task-store.test.js.map +1 -0
  1620. package/core/dist/runtime-v2/store/task/index.d.ts +4 -0
  1621. package/core/dist/runtime-v2/store/task/index.d.ts.map +1 -0
  1622. package/core/dist/runtime-v2/store/task/index.js +3 -0
  1623. package/core/dist/runtime-v2/store/task/index.js.map +1 -0
  1624. package/core/dist/runtime-v2/store/task/memory-task-store.d.ts +15 -0
  1625. package/core/dist/runtime-v2/store/task/memory-task-store.d.ts.map +1 -0
  1626. package/core/dist/runtime-v2/store/task/memory-task-store.js +43 -0
  1627. package/core/dist/runtime-v2/store/task/memory-task-store.js.map +1 -0
  1628. package/core/dist/runtime-v2/store/task/sqlite-task-store.d.ts +14 -0
  1629. package/core/dist/runtime-v2/store/task/sqlite-task-store.d.ts.map +1 -0
  1630. package/core/dist/runtime-v2/store/task/sqlite-task-store.js +144 -0
  1631. package/core/dist/runtime-v2/store/task/sqlite-task-store.js.map +1 -0
  1632. package/core/dist/runtime-v2/store/task/task-store.d.ts +48 -0
  1633. package/core/dist/runtime-v2/store/task/task-store.d.ts.map +1 -0
  1634. package/core/dist/runtime-v2/store/task/task-store.js +2 -0
  1635. package/core/dist/runtime-v2/store/task/task-store.js.map +1 -0
  1636. package/core/dist/runtime-v2/store/task-migration.d.ts +89 -0
  1637. package/core/dist/runtime-v2/store/task-migration.d.ts.map +1 -0
  1638. package/core/dist/runtime-v2/store/task-migration.js +79 -0
  1639. package/core/dist/runtime-v2/store/task-migration.js.map +1 -0
  1640. package/core/dist/runtime-v2/store/trajectory/index.d.ts +5 -0
  1641. package/core/dist/runtime-v2/store/trajectory/index.d.ts.map +1 -0
  1642. package/core/dist/runtime-v2/store/trajectory/index.js +3 -0
  1643. package/core/dist/runtime-v2/store/trajectory/index.js.map +1 -0
  1644. package/core/dist/runtime-v2/store/trajectory/source-trace-locator.d.ts +40 -0
  1645. package/core/dist/runtime-v2/store/trajectory/source-trace-locator.d.ts.map +1 -0
  1646. package/core/dist/runtime-v2/store/trajectory/source-trace-locator.js +18 -0
  1647. package/core/dist/runtime-v2/store/trajectory/source-trace-locator.js.map +1 -0
  1648. package/core/dist/runtime-v2/store/trajectory/source-trace-locator.test.d.ts +2 -0
  1649. package/core/dist/runtime-v2/store/trajectory/source-trace-locator.test.d.ts.map +1 -0
  1650. package/core/dist/runtime-v2/store/trajectory/source-trace-locator.test.js +320 -0
  1651. package/core/dist/runtime-v2/store/trajectory/source-trace-locator.test.js.map +1 -0
  1652. package/core/dist/runtime-v2/store/trajectory/sqlite-source-trace-locator.d.ts +23 -0
  1653. package/core/dist/runtime-v2/store/trajectory/sqlite-source-trace-locator.d.ts.map +1 -0
  1654. package/core/dist/runtime-v2/store/trajectory/sqlite-source-trace-locator.js +140 -0
  1655. package/core/dist/runtime-v2/store/trajectory/sqlite-source-trace-locator.js.map +1 -0
  1656. package/core/dist/runtime-v2/store/trajectory/sqlite-trajectory-locator.d.ts +27 -0
  1657. package/core/dist/runtime-v2/store/trajectory/sqlite-trajectory-locator.d.ts.map +1 -0
  1658. package/core/dist/runtime-v2/store/trajectory/sqlite-trajectory-locator.js +183 -0
  1659. package/core/dist/runtime-v2/store/trajectory/sqlite-trajectory-locator.js.map +1 -0
  1660. package/core/dist/runtime-v2/store/trajectory/sqlite-trajectory-locator.test.d.ts +2 -0
  1661. package/core/dist/runtime-v2/store/trajectory/sqlite-trajectory-locator.test.d.ts.map +1 -0
  1662. package/core/dist/runtime-v2/store/trajectory/sqlite-trajectory-locator.test.js +328 -0
  1663. package/core/dist/runtime-v2/store/trajectory/sqlite-trajectory-locator.test.js.map +1 -0
  1664. package/core/dist/runtime-v2/store/trajectory/trajectory-locator.d.ts +30 -0
  1665. package/core/dist/runtime-v2/store/trajectory/trajectory-locator.d.ts.map +1 -0
  1666. package/core/dist/runtime-v2/store/trajectory/trajectory-locator.js +2 -0
  1667. package/core/dist/runtime-v2/store/trajectory/trajectory-locator.js.map +1 -0
  1668. package/core/dist/runtime-v2/store/workspace-isolation.test.d.ts +2 -0
  1669. package/core/dist/runtime-v2/store/workspace-isolation.test.d.ts.map +1 -0
  1670. package/core/dist/runtime-v2/store/workspace-isolation.test.js +139 -0
  1671. package/core/dist/runtime-v2/store/workspace-isolation.test.js.map +1 -0
  1672. package/core/dist/runtime-v2/story-a-demo.d.ts +67 -0
  1673. package/core/dist/runtime-v2/story-a-demo.d.ts.map +1 -0
  1674. package/core/dist/runtime-v2/story-a-demo.js +188 -0
  1675. package/core/dist/runtime-v2/story-a-demo.js.map +1 -0
  1676. package/core/dist/runtime-v2/synthetic-baseline.d.ts +28 -0
  1677. package/core/dist/runtime-v2/synthetic-baseline.d.ts.map +1 -0
  1678. package/core/dist/runtime-v2/synthetic-baseline.js +116 -0
  1679. package/core/dist/runtime-v2/synthetic-baseline.js.map +1 -0
  1680. package/core/dist/runtime-v2/task-status.d.ts +99 -0
  1681. package/core/dist/runtime-v2/task-status.d.ts.map +1 -0
  1682. package/core/dist/runtime-v2/task-status.js +88 -0
  1683. package/core/dist/runtime-v2/task-status.js.map +1 -0
  1684. package/core/dist/runtime-v2/trace-refiner-agent.d.ts +71 -0
  1685. package/core/dist/runtime-v2/trace-refiner-agent.d.ts.map +1 -0
  1686. package/core/dist/runtime-v2/trace-refiner-agent.js +239 -0
  1687. package/core/dist/runtime-v2/trace-refiner-agent.js.map +1 -0
  1688. package/core/dist/runtime-v2/trace-refiner.d.ts +47 -0
  1689. package/core/dist/runtime-v2/trace-refiner.d.ts.map +1 -0
  1690. package/core/dist/runtime-v2/trace-refiner.js +261 -0
  1691. package/core/dist/runtime-v2/trace-refiner.js.map +1 -0
  1692. package/core/dist/runtime-v2/types/artifact-lineage.d.ts +19 -0
  1693. package/core/dist/runtime-v2/types/artifact-lineage.d.ts.map +1 -0
  1694. package/core/dist/runtime-v2/types/artifact-lineage.js +6 -0
  1695. package/core/dist/runtime-v2/types/artifact-lineage.js.map +1 -0
  1696. package/core/dist/runtime-v2/types/event-payload.d.ts +232 -0
  1697. package/core/dist/runtime-v2/types/event-payload.d.ts.map +1 -0
  1698. package/core/dist/runtime-v2/types/event-payload.js +149 -0
  1699. package/core/dist/runtime-v2/types/event-payload.js.map +1 -0
  1700. package/core/dist/runtime-v2/types/event-types.d.ts +843 -0
  1701. package/core/dist/runtime-v2/types/event-types.d.ts.map +1 -0
  1702. package/core/dist/runtime-v2/types/event-types.js +486 -0
  1703. package/core/dist/runtime-v2/types/event-types.js.map +1 -0
  1704. package/core/dist/runtime-v2/types/hygiene-types.d.ts +40 -0
  1705. package/core/dist/runtime-v2/types/hygiene-types.d.ts.map +1 -0
  1706. package/core/dist/runtime-v2/types/hygiene-types.js +30 -0
  1707. package/core/dist/runtime-v2/types/hygiene-types.js.map +1 -0
  1708. package/core/dist/runtime-v2/types/index.d.ts +32 -0
  1709. package/core/dist/runtime-v2/types/index.d.ts.map +1 -0
  1710. package/core/dist/runtime-v2/types/index.js +17 -0
  1711. package/core/dist/runtime-v2/types/index.js.map +1 -0
  1712. package/core/dist/runtime-v2/types/pain-signal.d.ts +63 -0
  1713. package/core/dist/runtime-v2/types/pain-signal.d.ts.map +1 -0
  1714. package/core/dist/runtime-v2/types/pain-signal.js +118 -0
  1715. package/core/dist/runtime-v2/types/pain-signal.js.map +1 -0
  1716. package/core/dist/runtime-v2/types/pd-task-types.d.ts +139 -0
  1717. package/core/dist/runtime-v2/types/pd-task-types.d.ts.map +1 -0
  1718. package/core/dist/runtime-v2/types/pd-task-types.js +99 -0
  1719. package/core/dist/runtime-v2/types/pd-task-types.js.map +1 -0
  1720. package/core/dist/runtime-v2/types/principle-dependency.d.ts +15 -0
  1721. package/core/dist/runtime-v2/types/principle-dependency.d.ts.map +1 -0
  1722. package/core/dist/runtime-v2/types/principle-dependency.js +8 -0
  1723. package/core/dist/runtime-v2/types/principle-dependency.js.map +1 -0
  1724. package/core/dist/runtime-v2/types/principle-enums.d.ts +19 -0
  1725. package/core/dist/runtime-v2/types/principle-enums.d.ts.map +1 -0
  1726. package/core/dist/runtime-v2/types/principle-enums.js +59 -0
  1727. package/core/dist/runtime-v2/types/principle-enums.js.map +1 -0
  1728. package/core/dist/runtime-v2/types/principle-lifecycle-event.d.ts +28 -0
  1729. package/core/dist/runtime-v2/types/principle-lifecycle-event.d.ts.map +1 -0
  1730. package/core/dist/runtime-v2/types/principle-lifecycle-event.js +24 -0
  1731. package/core/dist/runtime-v2/types/principle-lifecycle-event.js.map +1 -0
  1732. package/core/dist/runtime-v2/types/principle-schema.d.ts +136 -0
  1733. package/core/dist/runtime-v2/types/principle-schema.d.ts.map +1 -0
  1734. package/core/dist/runtime-v2/types/principle-schema.js +71 -0
  1735. package/core/dist/runtime-v2/types/principle-schema.js.map +1 -0
  1736. package/core/dist/runtime-v2/types/principle-tree-store.d.ts +89 -0
  1737. package/core/dist/runtime-v2/types/principle-tree-store.d.ts.map +1 -0
  1738. package/core/dist/runtime-v2/types/principle-tree-store.js +11 -0
  1739. package/core/dist/runtime-v2/types/principle-tree-store.js.map +1 -0
  1740. package/core/dist/runtime-v2/types/principle-value-metrics.d.ts +27 -0
  1741. package/core/dist/runtime-v2/types/principle-value-metrics.d.ts.map +1 -0
  1742. package/core/dist/runtime-v2/types/principle-value-metrics.js +14 -0
  1743. package/core/dist/runtime-v2/types/principle-value-metrics.js.map +1 -0
  1744. package/core/dist/runtime-v2/types/queue-types.d.ts +51 -0
  1745. package/core/dist/runtime-v2/types/queue-types.d.ts.map +1 -0
  1746. package/core/dist/runtime-v2/types/queue-types.js +44 -0
  1747. package/core/dist/runtime-v2/types/queue-types.js.map +1 -0
  1748. package/core/dist/runtime-v2/types/replay-types.d.ts +40 -0
  1749. package/core/dist/runtime-v2/types/replay-types.d.ts.map +1 -0
  1750. package/core/dist/runtime-v2/types/replay-types.js +2 -0
  1751. package/core/dist/runtime-v2/types/replay-types.js.map +1 -0
  1752. package/core/dist/runtime-v2/types/runtime-summary-types.d.ts +93 -0
  1753. package/core/dist/runtime-v2/types/runtime-summary-types.d.ts.map +1 -0
  1754. package/core/dist/runtime-v2/types/runtime-summary-types.js +35 -0
  1755. package/core/dist/runtime-v2/types/runtime-summary-types.js.map +1 -0
  1756. package/core/dist/runtime-v2/utils/cli-process-runner.d.ts +35 -0
  1757. package/core/dist/runtime-v2/utils/cli-process-runner.d.ts.map +1 -0
  1758. package/core/dist/runtime-v2/utils/cli-process-runner.js +259 -0
  1759. package/core/dist/runtime-v2/utils/cli-process-runner.js.map +1 -0
  1760. package/core/dist/runtime-v2/utils/cli-process-runner.test.d.ts +2 -0
  1761. package/core/dist/runtime-v2/utils/cli-process-runner.test.d.ts.map +1 -0
  1762. package/core/dist/runtime-v2/utils/cli-process-runner.test.js +111 -0
  1763. package/core/dist/runtime-v2/utils/cli-process-runner.test.js.map +1 -0
  1764. package/core/dist/storage-adapter.d.ts +59 -0
  1765. package/core/dist/storage-adapter.d.ts.map +1 -0
  1766. package/core/dist/storage-adapter.js +2 -0
  1767. package/core/dist/storage-adapter.js.map +1 -0
  1768. package/core/dist/telemetry-event.d.ts +102 -0
  1769. package/core/dist/telemetry-event.d.ts.map +1 -0
  1770. package/core/dist/telemetry-event.js +186 -0
  1771. package/core/dist/telemetry-event.js.map +1 -0
  1772. package/core/dist/trajectory-store.d.ts +45 -0
  1773. package/core/dist/trajectory-store.d.ts.map +1 -0
  1774. package/core/dist/trajectory-store.js +139 -0
  1775. package/core/dist/trajectory-store.js.map +1 -0
  1776. package/core/dist/types/workspace-resolver.d.ts +25 -0
  1777. package/core/dist/types/workspace-resolver.d.ts.map +1 -0
  1778. package/core/dist/types/workspace-resolver.js +10 -0
  1779. package/core/dist/types/workspace-resolver.js.map +1 -0
  1780. package/core/dist/types.d.ts +56 -0
  1781. package/core/dist/types.d.ts.map +1 -0
  1782. package/core/dist/types.js +16 -0
  1783. package/core/dist/types.js.map +1 -0
  1784. package/core/dist/workflow-funnel-loader.d.ts +143 -0
  1785. package/core/dist/workflow-funnel-loader.d.ts.map +1 -0
  1786. package/core/dist/workflow-funnel-loader.js +174 -0
  1787. package/core/dist/workflow-funnel-loader.js.map +1 -0
  1788. package/core/package.json +100 -0
  1789. package/dist/i18n.d.ts +6 -0
  1790. package/dist/i18n.d.ts.map +1 -0
  1791. package/dist/i18n.js +176 -0
  1792. package/dist/i18n.js.map +1 -0
  1793. package/dist/index.d.ts +1 -1
  1794. package/dist/index.d.ts.map +1 -1
  1795. package/dist/index.js +203 -122
  1796. package/dist/index.js.map +1 -1
  1797. package/dist/installer.d.ts +21 -6
  1798. package/dist/installer.d.ts.map +1 -1
  1799. package/dist/installer.js +846 -178
  1800. package/dist/installer.js.map +1 -1
  1801. package/dist/mvp-config.d.ts +81 -0
  1802. package/dist/mvp-config.d.ts.map +1 -0
  1803. package/dist/mvp-config.js +265 -0
  1804. package/dist/mvp-config.js.map +1 -0
  1805. package/dist/prompts.d.ts +8 -11
  1806. package/dist/prompts.d.ts.map +1 -1
  1807. package/dist/prompts.js +52 -80
  1808. package/dist/prompts.js.map +1 -1
  1809. package/dist/uninstaller.d.ts +6 -4
  1810. package/dist/uninstaller.d.ts.map +1 -1
  1811. package/dist/uninstaller.js +238 -51
  1812. package/dist/uninstaller.js.map +1 -1
  1813. package/dist/updater.d.ts +45 -0
  1814. package/dist/updater.d.ts.map +1 -0
  1815. package/dist/updater.js +333 -0
  1816. package/dist/updater.js.map +1 -0
  1817. package/dist/utils/env.d.ts +8 -0
  1818. package/dist/utils/env.d.ts.map +1 -1
  1819. package/dist/utils/env.js +79 -3
  1820. package/dist/utils/env.js.map +1 -1
  1821. package/dist/utils/logger.d.ts +1 -0
  1822. package/dist/utils/logger.d.ts.map +1 -1
  1823. package/dist/utils/logger.js +16 -8
  1824. package/dist/utils/logger.js.map +1 -1
  1825. package/package.json +24 -9
  1826. package/pd-cli/dist/commands/artifact.d.ts +14 -0
  1827. package/pd-cli/dist/commands/artifact.d.ts.map +1 -0
  1828. package/pd-cli/dist/commands/artifact.js +67 -0
  1829. package/pd-cli/dist/commands/artifact.js.map +1 -0
  1830. package/pd-cli/dist/commands/candidate.d.ts +83 -0
  1831. package/pd-cli/dist/commands/candidate.d.ts.map +1 -0
  1832. package/pd-cli/dist/commands/candidate.js +891 -0
  1833. package/pd-cli/dist/commands/candidate.js.map +1 -0
  1834. package/pd-cli/dist/commands/central-sync.d.ts +10 -0
  1835. package/pd-cli/dist/commands/central-sync.d.ts.map +1 -0
  1836. package/pd-cli/dist/commands/central-sync.js +32 -0
  1837. package/pd-cli/dist/commands/central-sync.js.map +1 -0
  1838. package/pd-cli/dist/commands/console.d.ts +9 -0
  1839. package/pd-cli/dist/commands/console.d.ts.map +1 -0
  1840. package/pd-cli/dist/commands/console.js +114 -0
  1841. package/pd-cli/dist/commands/console.js.map +1 -0
  1842. package/pd-cli/dist/commands/context.d.ts +7 -0
  1843. package/pd-cli/dist/commands/context.d.ts.map +1 -0
  1844. package/pd-cli/dist/commands/context.js +55 -0
  1845. package/pd-cli/dist/commands/context.js.map +1 -0
  1846. package/pd-cli/dist/commands/demo-story-a.d.ts +12 -0
  1847. package/pd-cli/dist/commands/demo-story-a.d.ts.map +1 -0
  1848. package/pd-cli/dist/commands/demo-story-a.js +175 -0
  1849. package/pd-cli/dist/commands/demo-story-a.js.map +1 -0
  1850. package/pd-cli/dist/commands/diagnose.d.ts +35 -0
  1851. package/pd-cli/dist/commands/diagnose.d.ts.map +1 -0
  1852. package/pd-cli/dist/commands/diagnose.js +390 -0
  1853. package/pd-cli/dist/commands/diagnose.js.map +1 -0
  1854. package/pd-cli/dist/commands/evolution-tasks-list.d.ts +15 -0
  1855. package/pd-cli/dist/commands/evolution-tasks-list.d.ts.map +1 -0
  1856. package/pd-cli/dist/commands/evolution-tasks-list.js +34 -0
  1857. package/pd-cli/dist/commands/evolution-tasks-list.js.map +1 -0
  1858. package/pd-cli/dist/commands/evolution-tasks-show.d.ts +14 -0
  1859. package/pd-cli/dist/commands/evolution-tasks-show.d.ts.map +1 -0
  1860. package/pd-cli/dist/commands/evolution-tasks-show.js +52 -0
  1861. package/pd-cli/dist/commands/evolution-tasks-show.js.map +1 -0
  1862. package/pd-cli/dist/commands/flow.d.ts +7 -0
  1863. package/pd-cli/dist/commands/flow.d.ts.map +1 -0
  1864. package/pd-cli/dist/commands/flow.js +57 -0
  1865. package/pd-cli/dist/commands/flow.js.map +1 -0
  1866. package/pd-cli/dist/commands/health.d.ts +16 -0
  1867. package/pd-cli/dist/commands/health.d.ts.map +1 -0
  1868. package/pd-cli/dist/commands/health.js +150 -0
  1869. package/pd-cli/dist/commands/health.js.map +1 -0
  1870. package/pd-cli/dist/commands/history.d.ts +11 -0
  1871. package/pd-cli/dist/commands/history.d.ts.map +1 -0
  1872. package/pd-cli/dist/commands/history.js +50 -0
  1873. package/pd-cli/dist/commands/history.js.map +1 -0
  1874. package/pd-cli/dist/commands/legacy-cleanup.d.ts +27 -0
  1875. package/pd-cli/dist/commands/legacy-cleanup.d.ts.map +1 -0
  1876. package/pd-cli/dist/commands/legacy-cleanup.js +171 -0
  1877. package/pd-cli/dist/commands/legacy-cleanup.js.map +1 -0
  1878. package/pd-cli/dist/commands/legacy-import.d.ts +7 -0
  1879. package/pd-cli/dist/commands/legacy-import.d.ts.map +1 -0
  1880. package/pd-cli/dist/commands/legacy-import.js +86 -0
  1881. package/pd-cli/dist/commands/legacy-import.js.map +1 -0
  1882. package/pd-cli/dist/commands/pain-record.d.ts +10 -0
  1883. package/pd-cli/dist/commands/pain-record.d.ts.map +1 -0
  1884. package/pd-cli/dist/commands/pain-record.js +162 -0
  1885. package/pd-cli/dist/commands/pain-record.js.map +1 -0
  1886. package/pd-cli/dist/commands/proven-channel-baseline.d.ts +12 -0
  1887. package/pd-cli/dist/commands/proven-channel-baseline.d.ts.map +1 -0
  1888. package/pd-cli/dist/commands/proven-channel-baseline.js +97 -0
  1889. package/pd-cli/dist/commands/proven-channel-baseline.js.map +1 -0
  1890. package/pd-cli/dist/commands/remediation-output.d.ts +40 -0
  1891. package/pd-cli/dist/commands/remediation-output.d.ts.map +1 -0
  1892. package/pd-cli/dist/commands/remediation-output.js +23 -0
  1893. package/pd-cli/dist/commands/remediation-output.js.map +1 -0
  1894. package/pd-cli/dist/commands/run.d.ts +10 -0
  1895. package/pd-cli/dist/commands/run.d.ts.map +1 -0
  1896. package/pd-cli/dist/commands/run.js +68 -0
  1897. package/pd-cli/dist/commands/run.js.map +1 -0
  1898. package/pd-cli/dist/commands/runtime-activation.d.ts +11 -0
  1899. package/pd-cli/dist/commands/runtime-activation.d.ts.map +1 -0
  1900. package/pd-cli/dist/commands/runtime-activation.js +150 -0
  1901. package/pd-cli/dist/commands/runtime-activation.js.map +1 -0
  1902. package/pd-cli/dist/commands/runtime-canary.d.ts +30 -0
  1903. package/pd-cli/dist/commands/runtime-canary.d.ts.map +1 -0
  1904. package/pd-cli/dist/commands/runtime-canary.js +343 -0
  1905. package/pd-cli/dist/commands/runtime-canary.js.map +1 -0
  1906. package/pd-cli/dist/commands/runtime-diagnostics-export.d.ts +20 -0
  1907. package/pd-cli/dist/commands/runtime-diagnostics-export.d.ts.map +1 -0
  1908. package/pd-cli/dist/commands/runtime-diagnostics-export.js +177 -0
  1909. package/pd-cli/dist/commands/runtime-diagnostics-export.js.map +1 -0
  1910. package/pd-cli/dist/commands/runtime-features.d.ts +26 -0
  1911. package/pd-cli/dist/commands/runtime-features.d.ts.map +1 -0
  1912. package/pd-cli/dist/commands/runtime-features.js +70 -0
  1913. package/pd-cli/dist/commands/runtime-features.js.map +1 -0
  1914. package/pd-cli/dist/commands/runtime-gfi-snapshot.d.ts +7 -0
  1915. package/pd-cli/dist/commands/runtime-gfi-snapshot.d.ts.map +1 -0
  1916. package/pd-cli/dist/commands/runtime-gfi-snapshot.js +101 -0
  1917. package/pd-cli/dist/commands/runtime-gfi-snapshot.js.map +1 -0
  1918. package/pd-cli/dist/commands/runtime-health-snapshot.d.ts +7 -0
  1919. package/pd-cli/dist/commands/runtime-health-snapshot.d.ts.map +1 -0
  1920. package/pd-cli/dist/commands/runtime-health-snapshot.js +93 -0
  1921. package/pd-cli/dist/commands/runtime-health-snapshot.js.map +1 -0
  1922. package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.d.ts +9 -0
  1923. package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.d.ts.map +1 -0
  1924. package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.js +393 -0
  1925. package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.js.map +1 -0
  1926. package/pd-cli/dist/commands/runtime-internalization-integrity-repair.d.ts +9 -0
  1927. package/pd-cli/dist/commands/runtime-internalization-integrity-repair.d.ts.map +1 -0
  1928. package/pd-cli/dist/commands/runtime-internalization-integrity-repair.js +54 -0
  1929. package/pd-cli/dist/commands/runtime-internalization-integrity-repair.js.map +1 -0
  1930. package/pd-cli/dist/commands/runtime-internalization-integrity.d.ts +7 -0
  1931. package/pd-cli/dist/commands/runtime-internalization-integrity.d.ts.map +1 -0
  1932. package/pd-cli/dist/commands/runtime-internalization-integrity.js +53 -0
  1933. package/pd-cli/dist/commands/runtime-internalization-integrity.js.map +1 -0
  1934. package/pd-cli/dist/commands/runtime-internalization-queue.d.ts +7 -0
  1935. package/pd-cli/dist/commands/runtime-internalization-queue.d.ts.map +1 -0
  1936. package/pd-cli/dist/commands/runtime-internalization-queue.js +85 -0
  1937. package/pd-cli/dist/commands/runtime-internalization-queue.js.map +1 -0
  1938. package/pd-cli/dist/commands/runtime-internalization-run-once.d.ts +12 -0
  1939. package/pd-cli/dist/commands/runtime-internalization-run-once.d.ts.map +1 -0
  1940. package/pd-cli/dist/commands/runtime-internalization-run-once.js +546 -0
  1941. package/pd-cli/dist/commands/runtime-internalization-run-once.js.map +1 -0
  1942. package/pd-cli/dist/commands/runtime-internalization-wake-once.d.ts +8 -0
  1943. package/pd-cli/dist/commands/runtime-internalization-wake-once.d.ts.map +1 -0
  1944. package/pd-cli/dist/commands/runtime-internalization-wake-once.js +72 -0
  1945. package/pd-cli/dist/commands/runtime-internalization-wake-once.js.map +1 -0
  1946. package/pd-cli/dist/commands/runtime-pain-flood-simulation.d.ts +10 -0
  1947. package/pd-cli/dist/commands/runtime-pain-flood-simulation.d.ts.map +1 -0
  1948. package/pd-cli/dist/commands/runtime-pain-flood-simulation.js +104 -0
  1949. package/pd-cli/dist/commands/runtime-pain-flood-simulation.js.map +1 -0
  1950. package/pd-cli/dist/commands/runtime-pruning.d.ts +45 -0
  1951. package/pd-cli/dist/commands/runtime-pruning.d.ts.map +1 -0
  1952. package/pd-cli/dist/commands/runtime-pruning.js +355 -0
  1953. package/pd-cli/dist/commands/runtime-pruning.js.map +1 -0
  1954. package/pd-cli/dist/commands/runtime-recovery.d.ts +9 -0
  1955. package/pd-cli/dist/commands/runtime-recovery.d.ts.map +1 -0
  1956. package/pd-cli/dist/commands/runtime-recovery.js +94 -0
  1957. package/pd-cli/dist/commands/runtime-recovery.js.map +1 -0
  1958. package/pd-cli/dist/commands/runtime-synthetic-baseline.d.ts +7 -0
  1959. package/pd-cli/dist/commands/runtime-synthetic-baseline.d.ts.map +1 -0
  1960. package/pd-cli/dist/commands/runtime-synthetic-baseline.js +59 -0
  1961. package/pd-cli/dist/commands/runtime-synthetic-baseline.js.map +1 -0
  1962. package/pd-cli/dist/commands/runtime-uat.d.ts +52 -0
  1963. package/pd-cli/dist/commands/runtime-uat.d.ts.map +1 -0
  1964. package/pd-cli/dist/commands/runtime-uat.js +274 -0
  1965. package/pd-cli/dist/commands/runtime-uat.js.map +1 -0
  1966. package/pd-cli/dist/commands/runtime.d.ts +20 -0
  1967. package/pd-cli/dist/commands/runtime.d.ts.map +1 -0
  1968. package/pd-cli/dist/commands/runtime.js +256 -0
  1969. package/pd-cli/dist/commands/runtime.js.map +1 -0
  1970. package/pd-cli/dist/commands/samples-list.d.ts +11 -0
  1971. package/pd-cli/dist/commands/samples-list.d.ts.map +1 -0
  1972. package/pd-cli/dist/commands/samples-list.js +37 -0
  1973. package/pd-cli/dist/commands/samples-list.js.map +1 -0
  1974. package/pd-cli/dist/commands/samples-review.d.ts +14 -0
  1975. package/pd-cli/dist/commands/samples-review.d.ts.map +1 -0
  1976. package/pd-cli/dist/commands/samples-review.js +22 -0
  1977. package/pd-cli/dist/commands/samples-review.js.map +1 -0
  1978. package/pd-cli/dist/commands/task.d.ts +14 -0
  1979. package/pd-cli/dist/commands/task.d.ts.map +1 -0
  1980. package/pd-cli/dist/commands/task.js +92 -0
  1981. package/pd-cli/dist/commands/task.js.map +1 -0
  1982. package/pd-cli/dist/commands/trace.d.ts +19 -0
  1983. package/pd-cli/dist/commands/trace.d.ts.map +1 -0
  1984. package/pd-cli/dist/commands/trace.js +154 -0
  1985. package/pd-cli/dist/commands/trace.js.map +1 -0
  1986. package/pd-cli/dist/commands/trajectory.d.ts +11 -0
  1987. package/pd-cli/dist/commands/trajectory.d.ts.map +1 -0
  1988. package/pd-cli/dist/commands/trajectory.js +47 -0
  1989. package/pd-cli/dist/commands/trajectory.js.map +1 -0
  1990. package/pd-cli/dist/index.d.ts +9 -0
  1991. package/pd-cli/dist/index.d.ts.map +1 -0
  1992. package/pd-cli/dist/index.js +739 -0
  1993. package/pd-cli/dist/index.js.map +1 -0
  1994. package/pd-cli/dist/legacy/legacy-import.d.ts +15 -0
  1995. package/pd-cli/dist/legacy/legacy-import.d.ts.map +1 -0
  1996. package/pd-cli/dist/legacy/legacy-import.js +141 -0
  1997. package/pd-cli/dist/legacy/legacy-import.js.map +1 -0
  1998. package/pd-cli/dist/legacy/session-history-import.d.ts +26 -0
  1999. package/pd-cli/dist/legacy/session-history-import.d.ts.map +1 -0
  2000. package/pd-cli/dist/legacy/session-history-import.js +151 -0
  2001. package/pd-cli/dist/legacy/session-history-import.js.map +1 -0
  2002. package/pd-cli/dist/principle-tree-ledger-adapter.d.ts +12 -0
  2003. package/pd-cli/dist/principle-tree-ledger-adapter.d.ts.map +1 -0
  2004. package/pd-cli/dist/principle-tree-ledger-adapter.js +12 -0
  2005. package/pd-cli/dist/principle-tree-ledger-adapter.js.map +1 -0
  2006. package/pd-cli/dist/resolve-workspace.d.ts +12 -0
  2007. package/pd-cli/dist/resolve-workspace.d.ts.map +1 -0
  2008. package/pd-cli/dist/resolve-workspace.js +20 -0
  2009. package/pd-cli/dist/resolve-workspace.js.map +1 -0
  2010. package/pd-cli/dist/services/demo-story-a-runner.d.ts +8 -0
  2011. package/pd-cli/dist/services/demo-story-a-runner.d.ts.map +1 -0
  2012. package/pd-cli/dist/services/demo-story-a-runner.js +369 -0
  2013. package/pd-cli/dist/services/demo-story-a-runner.js.map +1 -0
  2014. package/pd-cli/dist/services/feature-flag-loader.d.ts +6 -0
  2015. package/pd-cli/dist/services/feature-flag-loader.d.ts.map +1 -0
  2016. package/pd-cli/dist/services/feature-flag-loader.js +54 -0
  2017. package/pd-cli/dist/services/feature-flag-loader.js.map +1 -0
  2018. package/pd-cli/dist/services/pain-flood-simulation-runner.d.ts +10 -0
  2019. package/pd-cli/dist/services/pain-flood-simulation-runner.d.ts.map +1 -0
  2020. package/pd-cli/dist/services/pain-flood-simulation-runner.js +289 -0
  2021. package/pd-cli/dist/services/pain-flood-simulation-runner.js.map +1 -0
  2022. package/pd-cli/dist/services/proven-channel-baseline-runner.d.ts +12 -0
  2023. package/pd-cli/dist/services/proven-channel-baseline-runner.d.ts.map +1 -0
  2024. package/pd-cli/dist/services/proven-channel-baseline-runner.js +114 -0
  2025. package/pd-cli/dist/services/proven-channel-baseline-runner.js.map +1 -0
  2026. package/pd-cli/dist/services/synthetic-baseline-runner.d.ts +8 -0
  2027. package/pd-cli/dist/services/synthetic-baseline-runner.d.ts.map +1 -0
  2028. package/pd-cli/dist/services/synthetic-baseline-runner.js +251 -0
  2029. package/pd-cli/dist/services/synthetic-baseline-runner.js.map +1 -0
  2030. package/pd-cli/package.json +35 -0
  2031. package/plugin/dist/commands/archive-impl.d.ts +18 -0
  2032. package/plugin/dist/commands/archive-impl.js +105 -0
  2033. package/plugin/dist/commands/capabilities.d.ts +3 -0
  2034. package/plugin/dist/commands/capabilities.js +76 -0
  2035. package/plugin/dist/commands/context.d.ts +5 -0
  2036. package/plugin/dist/commands/context.js +293 -0
  2037. package/plugin/dist/commands/disable-impl.d.ts +22 -0
  2038. package/plugin/dist/commands/disable-impl.js +118 -0
  2039. package/plugin/dist/commands/evolution-status.d.ts +4 -0
  2040. package/plugin/dist/commands/evolution-status.js +187 -0
  2041. package/plugin/dist/commands/export.d.ts +2 -0
  2042. package/plugin/dist/commands/export.js +53 -0
  2043. package/plugin/dist/commands/focus.d.ts +14 -0
  2044. package/plugin/dist/commands/focus.js +443 -0
  2045. package/plugin/dist/commands/pain.d.ts +6 -0
  2046. package/plugin/dist/commands/pain.js +309 -0
  2047. package/plugin/dist/commands/principle-rollback.d.ts +4 -0
  2048. package/plugin/dist/commands/principle-rollback.js +26 -0
  2049. package/plugin/dist/commands/promote-impl.d.ts +22 -0
  2050. package/plugin/dist/commands/promote-impl.js +194 -0
  2051. package/plugin/dist/commands/rollback-impl.d.ts +32 -0
  2052. package/plugin/dist/commands/rollback-impl.js +180 -0
  2053. package/plugin/dist/commands/rollback.d.ts +19 -0
  2054. package/plugin/dist/commands/rollback.js +126 -0
  2055. package/plugin/dist/commands/samples.d.ts +2 -0
  2056. package/plugin/dist/commands/samples.js +58 -0
  2057. package/plugin/dist/commands/strategy.d.ts +3 -0
  2058. package/plugin/dist/commands/strategy.js +30 -0
  2059. package/plugin/dist/commands/thinking-os.d.ts +2 -0
  2060. package/plugin/dist/commands/thinking-os.js +164 -0
  2061. package/plugin/dist/commands/workflow-debug.d.ts +6 -0
  2062. package/plugin/dist/commands/workflow-debug.js +111 -0
  2063. package/plugin/dist/config/defaults/runtime.d.ts +64 -0
  2064. package/plugin/dist/config/defaults/runtime.js +81 -0
  2065. package/plugin/dist/config/errors.d.ts +86 -0
  2066. package/plugin/dist/config/errors.js +107 -0
  2067. package/plugin/dist/config/index.d.ts +7 -0
  2068. package/plugin/dist/config/index.js +7 -0
  2069. package/plugin/dist/constants/diagnostician.d.ts +12 -0
  2070. package/plugin/dist/constants/diagnostician.js +65 -0
  2071. package/plugin/dist/constants/tools.d.ts +17 -0
  2072. package/plugin/dist/constants/tools.js +53 -0
  2073. package/plugin/dist/core/__tests__/focus-history.test.d.ts +1 -0
  2074. package/plugin/dist/core/__tests__/focus-history.test.js +160 -0
  2075. package/plugin/dist/core/bootstrap-rules.d.ts +50 -0
  2076. package/plugin/dist/core/bootstrap-rules.js +187 -0
  2077. package/plugin/dist/core/code-implementation-storage.d.ts +80 -0
  2078. package/plugin/dist/core/code-implementation-storage.js +173 -0
  2079. package/plugin/dist/core/config-service.d.ts +15 -0
  2080. package/plugin/dist/core/config-service.js +26 -0
  2081. package/plugin/dist/core/config.d.ts +111 -0
  2082. package/plugin/dist/core/config.js +191 -0
  2083. package/plugin/dist/core/confirm-first-gate.d.ts +59 -0
  2084. package/plugin/dist/core/confirm-first-gate.js +215 -0
  2085. package/plugin/dist/core/control-ui-db.d.ts +106 -0
  2086. package/plugin/dist/core/control-ui-db.js +309 -0
  2087. package/plugin/dist/core/correction-cue-learner.d.ts +33 -0
  2088. package/plugin/dist/core/correction-cue-learner.js +184 -0
  2089. package/plugin/dist/core/correction-types.d.ts +3 -0
  2090. package/plugin/dist/core/correction-types.js +1 -0
  2091. package/plugin/dist/core/detection-funnel.d.ts +33 -0
  2092. package/plugin/dist/core/detection-funnel.js +104 -0
  2093. package/plugin/dist/core/detection-service.d.ts +15 -0
  2094. package/plugin/dist/core/detection-service.js +28 -0
  2095. package/plugin/dist/core/dictionary-service.d.ts +15 -0
  2096. package/plugin/dist/core/dictionary-service.js +26 -0
  2097. package/plugin/dist/core/dictionary.d.ts +38 -0
  2098. package/plugin/dist/core/dictionary.js +148 -0
  2099. package/plugin/dist/core/empathy-keyword-matcher.d.ts +5 -0
  2100. package/plugin/dist/core/empathy-keyword-matcher.js +40 -0
  2101. package/plugin/dist/core/empathy-types.d.ts +2 -0
  2102. package/plugin/dist/core/empathy-types.js +1 -0
  2103. package/plugin/dist/core/event-log.d.ts +73 -0
  2104. package/plugin/dist/core/event-log.js +613 -0
  2105. package/plugin/dist/core/evolution-engine.d.ts +119 -0
  2106. package/plugin/dist/core/evolution-engine.js +460 -0
  2107. package/plugin/dist/core/evolution-hook.d.ts +54 -0
  2108. package/plugin/dist/core/evolution-hook.js +9 -0
  2109. package/plugin/dist/core/evolution-logger.d.ts +137 -0
  2110. package/plugin/dist/core/evolution-logger.js +261 -0
  2111. package/plugin/dist/core/evolution-migration.d.ts +5 -0
  2112. package/plugin/dist/core/evolution-migration.js +65 -0
  2113. package/plugin/dist/core/evolution-reducer.d.ts +124 -0
  2114. package/plugin/dist/core/evolution-reducer.js +730 -0
  2115. package/plugin/dist/core/evolution-types.d.ts +50 -0
  2116. package/plugin/dist/core/evolution-types.js +11 -0
  2117. package/plugin/dist/core/external-training-contract.d.ts +276 -0
  2118. package/plugin/dist/core/external-training-contract.js +269 -0
  2119. package/plugin/dist/core/file-storage-adapter.d.ts +43 -0
  2120. package/plugin/dist/core/file-storage-adapter.js +158 -0
  2121. package/plugin/dist/core/file-store.d.ts +41 -0
  2122. package/plugin/dist/core/file-store.js +46 -0
  2123. package/plugin/dist/core/focus-history.d.ts +50 -0
  2124. package/plugin/dist/core/focus-history.js +574 -0
  2125. package/plugin/dist/core/hygiene/tracker.d.ts +22 -0
  2126. package/plugin/dist/core/hygiene/tracker.js +110 -0
  2127. package/plugin/dist/core/init.d.ts +30 -0
  2128. package/plugin/dist/core/init.js +259 -0
  2129. package/plugin/dist/core/local-worker-routing.d.ts +124 -0
  2130. package/plugin/dist/core/local-worker-routing.js +216 -0
  2131. package/plugin/dist/core/merge-gate-audit.d.ts +21 -0
  2132. package/plugin/dist/core/merge-gate-audit.js +241 -0
  2133. package/plugin/dist/core/migration.d.ts +6 -0
  2134. package/plugin/dist/core/migration.js +87 -0
  2135. package/plugin/dist/core/model-deployment-registry.d.ts +218 -0
  2136. package/plugin/dist/core/model-deployment-registry.js +502 -0
  2137. package/plugin/dist/core/model-training-registry.d.ts +295 -0
  2138. package/plugin/dist/core/model-training-registry.js +474 -0
  2139. package/plugin/dist/core/observability.d.ts +40 -0
  2140. package/plugin/dist/core/observability.js +164 -0
  2141. package/plugin/dist/core/pain-context-extractor.d.ts +31 -0
  2142. package/plugin/dist/core/pain-context-extractor.js +278 -0
  2143. package/plugin/dist/core/pain-diagnostic-gate.d.ts +30 -0
  2144. package/plugin/dist/core/pain-diagnostic-gate.js +96 -0
  2145. package/plugin/dist/core/pain-lifecycle.d.ts +15 -0
  2146. package/plugin/dist/core/pain-lifecycle.js +37 -0
  2147. package/plugin/dist/core/pain-signal-adapter.d.ts +37 -0
  2148. package/plugin/dist/core/pain-signal-adapter.js +1 -0
  2149. package/plugin/dist/core/pain-signal.d.ts +6 -0
  2150. package/plugin/dist/core/pain-signal.js +3 -0
  2151. package/plugin/dist/core/pain.d.ts +87 -0
  2152. package/plugin/dist/core/pain.js +223 -0
  2153. package/plugin/dist/core/path-resolver.d.ts +60 -0
  2154. package/plugin/dist/core/path-resolver.js +359 -0
  2155. package/plugin/dist/core/paths.d.ts +67 -0
  2156. package/plugin/dist/core/paths.js +83 -0
  2157. package/plugin/dist/core/pd-task-reconciler.d.ts +89 -0
  2158. package/plugin/dist/core/pd-task-reconciler.js +262 -0
  2159. package/plugin/dist/core/pd-task-service.d.ts +2 -0
  2160. package/plugin/dist/core/pd-task-service.js +32 -0
  2161. package/plugin/dist/core/pd-task-store.d.ts +5 -0
  2162. package/plugin/dist/core/pd-task-store.js +62 -0
  2163. package/plugin/dist/core/pd-task-types.d.ts +8 -0
  2164. package/plugin/dist/core/pd-task-types.js +2 -0
  2165. package/plugin/dist/core/principle-compiler/__tests__/compiler-replay-gate.test.d.ts +1 -0
  2166. package/plugin/dist/core/principle-compiler/__tests__/compiler-replay-gate.test.js +132 -0
  2167. package/plugin/dist/core/principle-compiler/code-validator.d.ts +14 -0
  2168. package/plugin/dist/core/principle-compiler/code-validator.js +83 -0
  2169. package/plugin/dist/core/principle-compiler/compiler.d.ts +45 -0
  2170. package/plugin/dist/core/principle-compiler/compiler.js +287 -0
  2171. package/plugin/dist/core/principle-compiler/index.d.ts +12 -0
  2172. package/plugin/dist/core/principle-compiler/index.js +10 -0
  2173. package/plugin/dist/core/principle-compiler/ledger-registrar.d.ts +28 -0
  2174. package/plugin/dist/core/principle-compiler/ledger-registrar.js +95 -0
  2175. package/plugin/dist/core/principle-compiler/template-generator.d.ts +7 -0
  2176. package/plugin/dist/core/principle-compiler/template-generator.js +7 -0
  2177. package/plugin/dist/core/principle-injection.d.ts +10 -0
  2178. package/plugin/dist/core/principle-injection.js +10 -0
  2179. package/plugin/dist/core/principle-injector.d.ts +55 -0
  2180. package/plugin/dist/core/principle-injector.js +17 -0
  2181. package/plugin/dist/core/principle-internalization/filesystem-lifecycle-datasource.d.ts +15 -0
  2182. package/plugin/dist/core/principle-internalization/filesystem-lifecycle-datasource.js +34 -0
  2183. package/plugin/dist/core/principle-internalization/lifecycle-read-model.d.ts +17 -0
  2184. package/plugin/dist/core/principle-internalization/lifecycle-read-model.js +21 -0
  2185. package/plugin/dist/core/principle-internalization/lifecycle-refresh.d.ts +2 -0
  2186. package/plugin/dist/core/principle-internalization/lifecycle-refresh.js +4 -0
  2187. package/plugin/dist/core/principle-internalization/principle-lifecycle-service.d.ts +28 -0
  2188. package/plugin/dist/core/principle-internalization/principle-lifecycle-service.js +89 -0
  2189. package/plugin/dist/core/principle-training-state.d.ts +47 -0
  2190. package/plugin/dist/core/principle-training-state.js +113 -0
  2191. package/plugin/dist/core/principle-tree-ledger-adapter.d.ts +32 -0
  2192. package/plugin/dist/core/principle-tree-ledger-adapter.js +125 -0
  2193. package/plugin/dist/core/principle-tree-ledger.d.ts +86 -0
  2194. package/plugin/dist/core/principle-tree-ledger.js +534 -0
  2195. package/plugin/dist/core/principle-tree-migration.d.ts +35 -0
  2196. package/plugin/dist/core/principle-tree-migration.js +137 -0
  2197. package/plugin/dist/core/profile.d.ts +62 -0
  2198. package/plugin/dist/core/profile.js +211 -0
  2199. package/plugin/dist/core/promotion-gate.d.ts +243 -0
  2200. package/plugin/dist/core/promotion-gate.js +554 -0
  2201. package/plugin/dist/core/reflection/reflection-context.d.ts +31 -0
  2202. package/plugin/dist/core/reflection/reflection-context.js +91 -0
  2203. package/plugin/dist/core/replay-engine.d.ts +12 -0
  2204. package/plugin/dist/core/replay-engine.js +82 -0
  2205. package/plugin/dist/core/risk-calculator.d.ts +22 -0
  2206. package/plugin/dist/core/risk-calculator.js +88 -0
  2207. package/plugin/dist/core/rule-host-helpers.d.ts +8 -0
  2208. package/plugin/dist/core/rule-host-helpers.js +7 -0
  2209. package/plugin/dist/core/rule-host-types.d.ts +7 -0
  2210. package/plugin/dist/core/rule-host-types.js +7 -0
  2211. package/plugin/dist/core/rule-host.d.ts +56 -0
  2212. package/plugin/dist/core/rule-host.js +152 -0
  2213. package/plugin/dist/core/rule-implementation-runtime.d.ts +5 -0
  2214. package/plugin/dist/core/rule-implementation-runtime.js +24 -0
  2215. package/plugin/dist/core/runtime-v2-prompt-activation-reader.d.ts +27 -0
  2216. package/plugin/dist/core/runtime-v2-prompt-activation-reader.js +181 -0
  2217. package/plugin/dist/core/schema/db-types.d.ts +11 -0
  2218. package/plugin/dist/core/schema/db-types.js +5 -0
  2219. package/plugin/dist/core/schema/index.d.ts +17 -0
  2220. package/plugin/dist/core/schema/index.js +15 -0
  2221. package/plugin/dist/core/schema/migration-runner.d.ts +53 -0
  2222. package/plugin/dist/core/schema/migration-runner.js +170 -0
  2223. package/plugin/dist/core/schema/migrations/001-init-trajectory.d.ts +6 -0
  2224. package/plugin/dist/core/schema/migrations/001-init-trajectory.js +193 -0
  2225. package/plugin/dist/core/schema/migrations/002-init-central.d.ts +5 -0
  2226. package/plugin/dist/core/schema/migrations/002-init-central.js +108 -0
  2227. package/plugin/dist/core/schema/migrations/003-init-workflow.d.ts +5 -0
  2228. package/plugin/dist/core/schema/migrations/003-init-workflow.js +50 -0
  2229. package/plugin/dist/core/schema/migrations/004-add-thinking-and-gfi.d.ts +8 -0
  2230. package/plugin/dist/core/schema/migrations/004-add-thinking-and-gfi.js +66 -0
  2231. package/plugin/dist/core/schema/migrations/index.d.ts +16 -0
  2232. package/plugin/dist/core/schema/migrations/index.js +27 -0
  2233. package/plugin/dist/core/schema/schema-definitions.d.ts +46 -0
  2234. package/plugin/dist/core/schema/schema-definitions.js +601 -0
  2235. package/plugin/dist/core/session-tracker.d.ts +119 -0
  2236. package/plugin/dist/core/session-tracker.js +462 -0
  2237. package/plugin/dist/core/shadow-observation-registry.d.ts +217 -0
  2238. package/plugin/dist/core/shadow-observation-registry.js +280 -0
  2239. package/plugin/dist/core/storage-adapter.d.ts +58 -0
  2240. package/plugin/dist/core/storage-adapter.js +1 -0
  2241. package/plugin/dist/core/system-logger.d.ts +8 -0
  2242. package/plugin/dist/core/system-logger.js +113 -0
  2243. package/plugin/dist/core/telemetry-event.d.ts +66 -0
  2244. package/plugin/dist/core/telemetry-event.js +86 -0
  2245. package/plugin/dist/core/thinking-models.d.ts +69 -0
  2246. package/plugin/dist/core/thinking-models.js +320 -0
  2247. package/plugin/dist/core/thinking-os-parser.d.ts +35 -0
  2248. package/plugin/dist/core/thinking-os-parser.js +123 -0
  2249. package/plugin/dist/core/training-program.d.ts +233 -0
  2250. package/plugin/dist/core/training-program.js +435 -0
  2251. package/plugin/dist/core/trajectory-types.d.ts +216 -0
  2252. package/plugin/dist/core/trajectory-types.js +8 -0
  2253. package/plugin/dist/core/trajectory.d.ts +242 -0
  2254. package/plugin/dist/core/trajectory.js +1450 -0
  2255. package/plugin/dist/core/workflow-funnel-loader.d.ts +72 -0
  2256. package/plugin/dist/core/workflow-funnel-loader.js +135 -0
  2257. package/plugin/dist/core/workspace-context.d.ts +111 -0
  2258. package/plugin/dist/core/workspace-context.js +247 -0
  2259. package/plugin/dist/core/workspace-dir-service.d.ts +33 -0
  2260. package/plugin/dist/core/workspace-dir-service.js +71 -0
  2261. package/plugin/dist/core/workspace-dir-validation.d.ts +11 -0
  2262. package/plugin/dist/core/workspace-dir-validation.js +37 -0
  2263. package/plugin/dist/hooks/gate-block-helper.d.ts +44 -0
  2264. package/plugin/dist/hooks/gate-block-helper.js +168 -0
  2265. package/plugin/dist/hooks/gate.d.ts +16 -0
  2266. package/plugin/dist/hooks/gate.js +424 -0
  2267. package/plugin/dist/hooks/lifecycle-routing.d.ts +24 -0
  2268. package/plugin/dist/hooks/lifecycle-routing.js +110 -0
  2269. package/plugin/dist/hooks/lifecycle.d.ts +5 -0
  2270. package/plugin/dist/hooks/lifecycle.js +287 -0
  2271. package/plugin/dist/hooks/llm.d.ts +13 -0
  2272. package/plugin/dist/hooks/llm.js +353 -0
  2273. package/plugin/dist/hooks/message-sanitize.d.ts +3 -0
  2274. package/plugin/dist/hooks/message-sanitize.js +47 -0
  2275. package/plugin/dist/hooks/pain.d.ts +11 -0
  2276. package/plugin/dist/hooks/pain.js +553 -0
  2277. package/plugin/dist/hooks/prompt.d.ts +46 -0
  2278. package/plugin/dist/hooks/prompt.js +1108 -0
  2279. package/plugin/dist/hooks/subagent.d.ts +9 -0
  2280. package/plugin/dist/hooks/subagent.js +122 -0
  2281. package/plugin/dist/hooks/trajectory-collector.d.ts +36 -0
  2282. package/plugin/dist/hooks/trajectory-collector.js +258 -0
  2283. package/plugin/dist/i18n/commands.d.ts +26 -0
  2284. package/plugin/dist/i18n/commands.js +108 -0
  2285. package/plugin/dist/index.d.ts +8 -0
  2286. package/plugin/dist/index.js +692 -0
  2287. package/plugin/dist/openclaw-sdk.d.ts +292 -0
  2288. package/plugin/dist/openclaw-sdk.js +4 -0
  2289. package/plugin/dist/service/central-database.d.ts +138 -0
  2290. package/plugin/dist/service/central-database.js +731 -0
  2291. package/plugin/dist/service/central-sync-service.d.ts +8 -0
  2292. package/plugin/dist/service/central-sync-service.js +71 -0
  2293. package/plugin/dist/service/event-log-auditor.d.ts +46 -0
  2294. package/plugin/dist/service/event-log-auditor.js +236 -0
  2295. package/plugin/dist/service/evolution-dedup.d.ts +27 -0
  2296. package/plugin/dist/service/evolution-dedup.js +54 -0
  2297. package/plugin/dist/service/evolution-queue-lock.d.ts +18 -0
  2298. package/plugin/dist/service/evolution-queue-lock.js +36 -0
  2299. package/plugin/dist/service/evolution-queue-migration.d.ts +128 -0
  2300. package/plugin/dist/service/evolution-queue-migration.js +53 -0
  2301. package/plugin/dist/service/evolution-worker.d.ts +103 -0
  2302. package/plugin/dist/service/evolution-worker.js +760 -0
  2303. package/plugin/dist/service/failure-classifier.d.ts +46 -0
  2304. package/plugin/dist/service/failure-classifier.js +57 -0
  2305. package/plugin/dist/service/internalization-trigger-adapter.d.ts +51 -0
  2306. package/plugin/dist/service/internalization-trigger-adapter.js +184 -0
  2307. package/plugin/dist/service/keyword-optimization-service.d.ts +44 -0
  2308. package/plugin/dist/service/keyword-optimization-service.js +137 -0
  2309. package/plugin/dist/service/monitoring-query-service.d.ts +21 -0
  2310. package/plugin/dist/service/monitoring-query-service.js +45 -0
  2311. package/plugin/dist/service/phase3-input-filter.d.ts +73 -0
  2312. package/plugin/dist/service/phase3-input-filter.js +172 -0
  2313. package/plugin/dist/service/queue-io.d.ts +30 -0
  2314. package/plugin/dist/service/queue-io.js +79 -0
  2315. package/plugin/dist/service/queue-migration.d.ts +83 -0
  2316. package/plugin/dist/service/queue-migration.js +56 -0
  2317. package/plugin/dist/service/runtime-summary-service.d.ts +158 -0
  2318. package/plugin/dist/service/runtime-summary-service.js +636 -0
  2319. package/plugin/dist/service/subagent-workflow/index.d.ts +3 -0
  2320. package/plugin/dist/service/subagent-workflow/index.js +2 -0
  2321. package/plugin/dist/service/subagent-workflow/subagent-error-utils.d.ts +8 -0
  2322. package/plugin/dist/service/subagent-workflow/subagent-error-utils.js +23 -0
  2323. package/plugin/dist/service/subagent-workflow/types.d.ts +264 -0
  2324. package/plugin/dist/service/subagent-workflow/types.js +11 -0
  2325. package/plugin/dist/service/subagent-workflow/workflow-store.d.ts +30 -0
  2326. package/plugin/dist/service/subagent-workflow/workflow-store.js +209 -0
  2327. package/plugin/dist/service/trajectory-service.d.ts +2 -0
  2328. package/plugin/dist/service/trajectory-service.js +16 -0
  2329. package/plugin/dist/service/workflow-watchdog.d.ts +23 -0
  2330. package/plugin/dist/service/workflow-watchdog.js +103 -0
  2331. package/plugin/dist/tools/critique-prompt.d.ts +1 -0
  2332. package/plugin/dist/tools/critique-prompt.js +1 -0
  2333. package/plugin/dist/tools/deep-reflect.d.ts +1 -0
  2334. package/plugin/dist/tools/deep-reflect.js +1 -0
  2335. package/plugin/dist/tools/model-index.d.ts +1 -0
  2336. package/plugin/dist/tools/model-index.js +1 -0
  2337. package/plugin/dist/types/event-payload.d.ts +2 -0
  2338. package/plugin/dist/types/event-payload.js +1 -0
  2339. package/plugin/dist/types/event-types.d.ts +2 -0
  2340. package/plugin/dist/types/event-types.js +1 -0
  2341. package/plugin/dist/types/hygiene-types.d.ts +2 -0
  2342. package/plugin/dist/types/hygiene-types.js +1 -0
  2343. package/plugin/dist/types/principle-tree-schema.d.ts +29 -0
  2344. package/plugin/dist/types/principle-tree-schema.js +24 -0
  2345. package/plugin/dist/types/queue.d.ts +2 -0
  2346. package/plugin/dist/types/queue.js +1 -0
  2347. package/plugin/dist/types/runtime-summary.d.ts +1 -0
  2348. package/plugin/dist/types/runtime-summary.js +1 -0
  2349. package/plugin/dist/types.d.ts +33 -0
  2350. package/plugin/dist/types.js +16 -0
  2351. package/plugin/dist/utils/file-lock.d.ts +68 -0
  2352. package/plugin/dist/utils/file-lock.js +310 -0
  2353. package/plugin/dist/utils/glob-match.d.ts +28 -0
  2354. package/plugin/dist/utils/glob-match.js +49 -0
  2355. package/plugin/dist/utils/hashing.d.ts +9 -0
  2356. package/plugin/dist/utils/hashing.js +25 -0
  2357. package/plugin/dist/utils/io.d.ts +12 -0
  2358. package/plugin/dist/utils/io.js +176 -0
  2359. package/plugin/dist/utils/nlp.d.ts +4 -0
  2360. package/plugin/dist/utils/nlp.js +21 -0
  2361. package/plugin/dist/utils/node-vm-polyfill.d.ts +9 -0
  2362. package/plugin/dist/utils/node-vm-polyfill.js +9 -0
  2363. package/plugin/dist/utils/plugin-logger.d.ts +39 -0
  2364. package/plugin/dist/utils/plugin-logger.js +70 -0
  2365. package/plugin/dist/utils/retry.d.ts +210 -0
  2366. package/plugin/dist/utils/retry.js +375 -0
  2367. package/plugin/dist/utils/session-key.d.ts +10 -0
  2368. package/plugin/dist/utils/session-key.js +18 -0
  2369. package/plugin/dist/utils/shadow-fingerprint.d.ts +16 -0
  2370. package/plugin/dist/utils/shadow-fingerprint.js +34 -0
  2371. package/plugin/dist/utils/subagent-probe.d.ts +35 -0
  2372. package/plugin/dist/utils/subagent-probe.js +67 -0
  2373. package/plugin/dist/utils/workspace-resolver.d.ts +50 -0
  2374. package/plugin/dist/utils/workspace-resolver.js +109 -0
  2375. package/plugin/docs/COMMAND_REFERENCE.md +76 -0
  2376. package/plugin/docs/COMMAND_REFERENCE_EN.md +79 -0
  2377. package/plugin/openclaw.plugin.json +65 -0
  2378. package/plugin/package.json +79 -0
  2379. package/plugin/scripts/acceptance-test.mjs +257 -0
  2380. package/plugin/scripts/bootstrap-rules.mjs +66 -0
  2381. package/plugin/scripts/compile-principles.mjs +104 -0
  2382. package/plugin/scripts/db-migrate.mjs +170 -0
  2383. package/plugin/scripts/install-dependencies.cjs +47 -0
  2384. package/plugin/scripts/sync-plugin.mjs +1355 -0
  2385. package/plugin/scripts/validate-live-path.ts +480 -0
  2386. package/plugin/scripts/verify-build.mjs +109 -0
  2387. package/plugin/templates/langs/en/core/AGENTS.md +205 -0
  2388. package/plugin/templates/langs/en/core/BOOT.md +60 -0
  2389. package/plugin/templates/langs/en/core/BOOTSTRAP.md +273 -0
  2390. package/plugin/templates/langs/en/core/HEARTBEAT.md +74 -0
  2391. package/plugin/templates/langs/en/core/IDENTITY.md +8 -0
  2392. package/plugin/templates/langs/en/core/PRINCIPLES.md +10 -0
  2393. package/plugin/templates/langs/en/core/SOUL.md +46 -0
  2394. package/plugin/templates/langs/en/core/TOOLS.md +15 -0
  2395. package/plugin/templates/langs/en/core/USER.md +10 -0
  2396. package/plugin/templates/langs/en/pain/00_seed_samples.md +23 -0
  2397. package/plugin/templates/langs/en/pain_dictionary.json +22 -0
  2398. package/plugin/templates/langs/en/principles/THINKING_OS.md +64 -0
  2399. package/plugin/templates/langs/en/skills/admin/SKILL.md +39 -0
  2400. package/plugin/templates/langs/en/skills/ai-sprint-orchestration/EXAMPLES.md +63 -0
  2401. package/plugin/templates/langs/en/skills/ai-sprint-orchestration/REFERENCE.md +136 -0
  2402. package/plugin/templates/langs/en/skills/ai-sprint-orchestration/SKILL.md +67 -0
  2403. package/plugin/templates/langs/en/skills/ai-sprint-orchestration/references/agent-registry.json +143 -0
  2404. package/plugin/templates/langs/en/skills/ai-sprint-orchestration/references/specs/bugfix-complex-template.json +107 -0
  2405. package/plugin/templates/langs/en/skills/ai-sprint-orchestration/references/specs/feature-complex-template.json +107 -0
  2406. package/plugin/templates/langs/en/skills/ai-sprint-orchestration/references/specs/workflow-validation-minimal-verify.json +95 -0
  2407. package/plugin/templates/langs/en/skills/ai-sprint-orchestration/references/specs/workflow-validation-minimal.json +98 -0
  2408. package/plugin/templates/langs/en/skills/ai-sprint-orchestration/references/workflow-v1-acceptance-checklist.md +58 -0
  2409. package/plugin/templates/langs/en/skills/ai-sprint-orchestration/references/workflow-v1.4-work-unit-handoff.md +190 -0
  2410. package/plugin/templates/langs/en/skills/ai-sprint-orchestration/runtime/.gitignore +2 -0
  2411. package/plugin/templates/langs/en/skills/ai-sprint-orchestration/scripts/lib/archive.mjs +310 -0
  2412. package/plugin/templates/langs/en/skills/ai-sprint-orchestration/scripts/lib/contract-enforcement.mjs +683 -0
  2413. package/plugin/templates/langs/en/skills/ai-sprint-orchestration/scripts/lib/decision.mjs +604 -0
  2414. package/plugin/templates/langs/en/skills/ai-sprint-orchestration/scripts/lib/state-store.mjs +32 -0
  2415. package/plugin/templates/langs/en/skills/ai-sprint-orchestration/scripts/lib/task-specs.mjs +707 -0
  2416. package/plugin/templates/langs/en/skills/ai-sprint-orchestration/scripts/run.mjs +3455 -0
  2417. package/plugin/templates/langs/en/skills/bootstrap-tools/SKILL.md +53 -0
  2418. package/plugin/templates/langs/en/skills/deductive-audit/SKILL.md +36 -0
  2419. package/plugin/templates/langs/en/skills/evolution-framework-update/SKILL.md +31 -0
  2420. package/plugin/templates/langs/en/skills/evolve-system/SKILL.md +46 -0
  2421. package/plugin/templates/langs/en/skills/evolve-task/SKILL.md +83 -0
  2422. package/plugin/templates/langs/en/skills/feedback/SKILL.md +51 -0
  2423. package/plugin/templates/langs/en/skills/init-strategy/SKILL.md +54 -0
  2424. package/plugin/templates/langs/en/skills/inject-rule/SKILL.md +19 -0
  2425. package/plugin/templates/langs/en/skills/manage-okr/SKILL.md +96 -0
  2426. package/plugin/templates/langs/en/skills/pd-auditor/SKILL.md +61 -0
  2427. package/plugin/templates/langs/en/skills/pd-cli-operator/SKILL.md +67 -0
  2428. package/plugin/templates/langs/en/skills/pd-daily/SKILL.md +199 -0
  2429. package/plugin/templates/langs/en/skills/pd-diagnostician/SKILL.md +466 -0
  2430. package/plugin/templates/langs/en/skills/pd-explorer/SKILL.md +65 -0
  2431. package/plugin/templates/langs/en/skills/pd-grooming/SKILL.md +46 -0
  2432. package/plugin/templates/langs/en/skills/pd-implementer/SKILL.md +68 -0
  2433. package/plugin/templates/langs/en/skills/pd-mentor/SKILL.md +230 -0
  2434. package/plugin/templates/langs/en/skills/pd-pain-signal/SKILL.md +30 -0
  2435. package/plugin/templates/langs/en/skills/pd-planner/SKILL.md +65 -0
  2436. package/plugin/templates/langs/en/skills/pd-runtime-v2/SKILL.md +61 -0
  2437. package/plugin/templates/langs/en/skills/plan-script/SKILL.md +32 -0
  2438. package/plugin/templates/langs/en/skills/profile/SKILL.md +24 -0
  2439. package/plugin/templates/langs/en/skills/reflection/SKILL.md +40 -0
  2440. package/plugin/templates/langs/en/skills/reflection-log/SKILL.md +37 -0
  2441. package/plugin/templates/langs/en/skills/report/SKILL.md +13 -0
  2442. package/plugin/templates/langs/en/skills/root-cause/SKILL.md +33 -0
  2443. package/plugin/templates/langs/en/skills/triage/SKILL.md +29 -0
  2444. package/plugin/templates/langs/en/skills/watch-evolution/SKILL.md +33 -0
  2445. package/plugin/templates/langs/zh/core/AGENTS.md +197 -0
  2446. package/plugin/templates/langs/zh/core/BOOT.md +60 -0
  2447. package/plugin/templates/langs/zh/core/BOOTSTRAP.md +273 -0
  2448. package/plugin/templates/langs/zh/core/HEARTBEAT.md +98 -0
  2449. package/plugin/templates/langs/zh/core/IDENTITY.md +8 -0
  2450. package/plugin/templates/langs/zh/core/PRINCIPLES.md +7 -0
  2451. package/plugin/templates/langs/zh/core/SOUL.md +46 -0
  2452. package/plugin/templates/langs/zh/core/TOOLS.md +15 -0
  2453. package/plugin/templates/langs/zh/core/USER.md +10 -0
  2454. package/plugin/templates/langs/zh/pain/00_seed_samples.md +24 -0
  2455. package/plugin/templates/langs/zh/pain_dictionary.json +18 -0
  2456. package/plugin/templates/langs/zh/principles/THINKING_OS.md +64 -0
  2457. package/plugin/templates/langs/zh/skills/admin/SKILL.md +41 -0
  2458. package/plugin/templates/langs/zh/skills/ai-sprint-orchestration/EXAMPLES.md +63 -0
  2459. package/plugin/templates/langs/zh/skills/ai-sprint-orchestration/REFERENCE.md +136 -0
  2460. package/plugin/templates/langs/zh/skills/ai-sprint-orchestration/SKILL.md +67 -0
  2461. package/plugin/templates/langs/zh/skills/ai-sprint-orchestration/references/agent-registry.json +143 -0
  2462. package/plugin/templates/langs/zh/skills/ai-sprint-orchestration/references/specs/bugfix-complex-template.json +107 -0
  2463. package/plugin/templates/langs/zh/skills/ai-sprint-orchestration/references/specs/feature-complex-template.json +107 -0
  2464. package/plugin/templates/langs/zh/skills/ai-sprint-orchestration/references/specs/nocturnal-trinity-quality-enhancement.json +111 -0
  2465. package/plugin/templates/langs/zh/skills/ai-sprint-orchestration/references/specs/workflow-validation-minimal-verify.json +95 -0
  2466. package/plugin/templates/langs/zh/skills/ai-sprint-orchestration/references/specs/workflow-validation-minimal.json +98 -0
  2467. package/plugin/templates/langs/zh/skills/ai-sprint-orchestration/references/workflow-v1-acceptance-checklist.md +58 -0
  2468. package/plugin/templates/langs/zh/skills/ai-sprint-orchestration/references/workflow-v1.4-work-unit-handoff.md +190 -0
  2469. package/plugin/templates/langs/zh/skills/ai-sprint-orchestration/runtime/.gitignore +2 -0
  2470. package/plugin/templates/langs/zh/skills/ai-sprint-orchestration/scripts/lib/archive.mjs +310 -0
  2471. package/plugin/templates/langs/zh/skills/ai-sprint-orchestration/scripts/lib/contract-enforcement.mjs +683 -0
  2472. package/plugin/templates/langs/zh/skills/ai-sprint-orchestration/scripts/lib/decision.mjs +604 -0
  2473. package/plugin/templates/langs/zh/skills/ai-sprint-orchestration/scripts/lib/state-store.mjs +32 -0
  2474. package/plugin/templates/langs/zh/skills/ai-sprint-orchestration/scripts/lib/task-specs.mjs +707 -0
  2475. package/plugin/templates/langs/zh/skills/ai-sprint-orchestration/scripts/run.mjs +3455 -0
  2476. package/plugin/templates/langs/zh/skills/ai-sprint-orchestration/test/archive.test.mjs +230 -0
  2477. package/plugin/templates/langs/zh/skills/ai-sprint-orchestration/test/contract-enforcement.test.mjs +672 -0
  2478. package/plugin/templates/langs/zh/skills/ai-sprint-orchestration/test/decision.test.mjs +1321 -0
  2479. package/plugin/templates/langs/zh/skills/ai-sprint-orchestration/test/run.test.mjs +1435 -0
  2480. package/plugin/templates/langs/zh/skills/bootstrap-tools/SKILL.md +52 -0
  2481. package/plugin/templates/langs/zh/skills/deductive-audit/SKILL.md +36 -0
  2482. package/plugin/templates/langs/zh/skills/evolution-framework-update/SKILL.md +31 -0
  2483. package/plugin/templates/langs/zh/skills/evolve-system/SKILL.md +46 -0
  2484. package/plugin/templates/langs/zh/skills/evolve-task/SKILL.md +83 -0
  2485. package/plugin/templates/langs/zh/skills/feedback/SKILL.md +53 -0
  2486. package/plugin/templates/langs/zh/skills/init-strategy/SKILL.md +54 -0
  2487. package/plugin/templates/langs/zh/skills/inject-rule/SKILL.md +19 -0
  2488. package/plugin/templates/langs/zh/skills/manage-okr/SKILL.md +109 -0
  2489. package/plugin/templates/langs/zh/skills/pd-auditor/SKILL.md +61 -0
  2490. package/plugin/templates/langs/zh/skills/pd-cli-operator/SKILL.md +67 -0
  2491. package/plugin/templates/langs/zh/skills/pd-daily/SKILL.md +283 -0
  2492. package/plugin/templates/langs/zh/skills/pd-diagnostician/SKILL.md +391 -0
  2493. package/plugin/templates/langs/zh/skills/pd-explorer/SKILL.md +65 -0
  2494. package/plugin/templates/langs/zh/skills/pd-grooming/SKILL.md +46 -0
  2495. package/plugin/templates/langs/zh/skills/pd-implementer/SKILL.md +68 -0
  2496. package/plugin/templates/langs/zh/skills/pd-mentor/SKILL.md +230 -0
  2497. package/plugin/templates/langs/zh/skills/pd-pain-signal/SKILL.md +30 -0
  2498. package/plugin/templates/langs/zh/skills/pd-planner/SKILL.md +65 -0
  2499. package/plugin/templates/langs/zh/skills/pd-runtime-v2/SKILL.md +61 -0
  2500. package/plugin/templates/langs/zh/skills/plan-script/SKILL.md +32 -0
  2501. package/plugin/templates/langs/zh/skills/profile/SKILL.md +24 -0
  2502. package/plugin/templates/langs/zh/skills/reflection/SKILL.md +40 -0
  2503. package/plugin/templates/langs/zh/skills/reflection-log/SKILL.md +37 -0
  2504. package/plugin/templates/langs/zh/skills/report/SKILL.md +13 -0
  2505. package/plugin/templates/langs/zh/skills/root-cause/SKILL.md +33 -0
  2506. package/plugin/templates/langs/zh/skills/triage/SKILL.md +29 -0
  2507. package/plugin/templates/langs/zh/skills/watch-evolution/SKILL.md +33 -0
  2508. package/plugin/templates/pain_dictionary.json +36 -0
  2509. package/plugin/templates/pain_settings.json +103 -0
  2510. package/plugin/templates/workspace/.principles/DECISION_POLICY.json +44 -0
  2511. package/plugin/templates/workspace/.principles/PRINCIPLES.md +20 -0
  2512. package/plugin/templates/workspace/.principles/PROFILE.json +54 -0
  2513. package/plugin/templates/workspace/.principles/PROFILE.schema.json +56 -0
  2514. package/plugin/templates/workspace/.principles/THINKING_OS.md +64 -0
  2515. package/plugin/templates/workspace/.principles/THINKING_OS_ARCHIVE.md +7 -0
  2516. package/plugin/templates/workspace/.principles/THINKING_OS_CANDIDATES.md +9 -0
  2517. package/plugin/templates/workspace/.principles/models/_INDEX.md +27 -0
  2518. package/plugin/templates/workspace/.principles/models/first_principles.md +62 -0
  2519. package/plugin/templates/workspace/.principles/models/marketing_4p.md +52 -0
  2520. package/plugin/templates/workspace/.principles/models/porter_five.md +63 -0
  2521. package/plugin/templates/workspace/.principles/models/swot.md +60 -0
  2522. package/plugin/templates/workspace/.principles/models/user_story_map.md +63 -0
  2523. package/plugin/templates/workspace/.state/WORKBOARD.json +4 -0
  2524. package/plugin/templates/workspace/AUDIT.md +15 -0
  2525. package/plugin/templates/workspace/PLAN.md +2 -0
  2526. package/plugin/templates/workspace/okr/CURRENT_FOCUS.md +57 -0
  2527. package/plugin/templates/workspace/okr/RECOVERY_PROTOCOL.md +56 -0
  2528. package/plugin/templates/workspace/okr/TASK_CHANGES.jsonl +6 -0
  2529. package/plugin/templates/workspace/okr/WEEK_TASKS.json +6 -0
  2530. package/templates/langs/en/core/AGENTS.md +205 -0
  2531. package/templates/langs/en/core/BOOT.md +60 -0
  2532. package/templates/langs/en/core/BOOTSTRAP.md +273 -0
  2533. package/templates/langs/en/core/HEARTBEAT.md +74 -0
  2534. package/templates/langs/en/core/IDENTITY.md +8 -0
  2535. package/templates/langs/en/core/PRINCIPLES.md +10 -0
  2536. package/templates/langs/en/core/SOUL.md +46 -0
  2537. package/templates/langs/en/core/TOOLS.md +58 -0
  2538. package/templates/langs/en/core/USER.md +10 -0
  2539. package/templates/langs/en/pain/00_seed_samples.md +23 -0
  2540. package/templates/langs/en/pain_dictionary.json +22 -0
  2541. package/templates/langs/en/principles/THINKING_OS.md +64 -0
  2542. package/templates/langs/en/skills/admin/SKILL.md +39 -0
  2543. package/templates/langs/en/skills/bootstrap-tools/SKILL.md +53 -0
  2544. package/templates/langs/en/skills/deductive-audit/SKILL.md +36 -0
  2545. package/templates/langs/en/skills/evolution-framework-update/SKILL.md +31 -0
  2546. package/templates/langs/en/skills/evolve-system/SKILL.md +46 -0
  2547. package/templates/langs/en/skills/evolve-task/SKILL.md +83 -0
  2548. package/templates/langs/en/skills/feedback/SKILL.md +51 -0
  2549. package/templates/langs/en/skills/init-strategy/SKILL.md +54 -0
  2550. package/templates/langs/en/skills/inject-rule/SKILL.md +19 -0
  2551. package/templates/langs/en/skills/manage-okr/SKILL.md +96 -0
  2552. package/templates/langs/en/skills/pain/SKILL.md +19 -0
  2553. package/templates/langs/en/skills/pd-daily/SKILL.md +199 -0
  2554. package/templates/langs/en/skills/pd-grooming/SKILL.md +46 -0
  2555. package/templates/langs/en/skills/pd-mentor/SKILL.md +230 -0
  2556. package/templates/langs/en/skills/plan-script/SKILL.md +32 -0
  2557. package/templates/langs/en/skills/profile/SKILL.md +24 -0
  2558. package/templates/langs/en/skills/reflection/SKILL.md +40 -0
  2559. package/templates/langs/en/skills/reflection-log/SKILL.md +37 -0
  2560. package/templates/langs/en/skills/report/SKILL.md +13 -0
  2561. package/templates/langs/en/skills/root-cause/SKILL.md +33 -0
  2562. package/templates/langs/en/skills/triage/SKILL.md +29 -0
  2563. package/templates/langs/en/skills/watch-evolution/SKILL.md +33 -0
  2564. package/templates/langs/zh/core/AGENTS.md +197 -0
  2565. package/templates/langs/zh/core/BOOT.md +60 -0
  2566. package/templates/langs/zh/core/BOOTSTRAP.md +273 -0
  2567. package/templates/langs/zh/core/HEARTBEAT.md +98 -0
  2568. package/templates/langs/zh/core/IDENTITY.md +8 -0
  2569. package/templates/langs/zh/core/SOUL.md +46 -0
  2570. package/templates/langs/zh/core/TOOLS.md +58 -0
  2571. package/templates/langs/zh/core/USER.md +10 -0
  2572. package/templates/langs/zh/pain/00_seed_samples.md +24 -0
  2573. package/templates/langs/zh/pain_dictionary.json +18 -0
  2574. package/templates/langs/zh/principles/THINKING_OS.md +64 -0
  2575. package/templates/langs/zh/skills/admin/SKILL.md +41 -0
  2576. package/templates/langs/zh/skills/bootstrap-tools/SKILL.md +52 -0
  2577. package/templates/langs/zh/skills/deductive-audit/SKILL.md +36 -0
  2578. package/templates/langs/zh/skills/evolution-framework-update/SKILL.md +31 -0
  2579. package/templates/langs/zh/skills/evolve-system/SKILL.md +46 -0
  2580. package/templates/langs/zh/skills/evolve-task/SKILL.md +83 -0
  2581. package/templates/langs/zh/skills/feedback/SKILL.md +53 -0
  2582. package/templates/langs/zh/skills/init-strategy/SKILL.md +54 -0
  2583. package/templates/langs/zh/skills/inject-rule/SKILL.md +19 -0
  2584. package/templates/langs/zh/skills/manage-okr/SKILL.md +109 -0
  2585. package/templates/langs/zh/skills/pain/SKILL.md +30 -0
  2586. package/templates/langs/zh/skills/pd-auditor/SKILL.md +61 -0
  2587. package/templates/langs/zh/skills/pd-daily/SKILL.md +283 -0
  2588. package/templates/langs/zh/skills/pd-diagnostician/SKILL.md +287 -0
  2589. package/templates/langs/zh/skills/pd-explorer/SKILL.md +65 -0
  2590. package/templates/langs/zh/skills/pd-grooming/SKILL.md +46 -0
  2591. package/templates/langs/zh/skills/pd-implementer/SKILL.md +68 -0
  2592. package/templates/langs/zh/skills/pd-mentor/SKILL.md +230 -0
  2593. package/templates/langs/zh/skills/pd-planner/SKILL.md +65 -0
  2594. package/templates/langs/zh/skills/pd-reporter/SKILL.md +78 -0
  2595. package/templates/langs/zh/skills/pd-reviewer/SKILL.md +66 -0
  2596. package/templates/langs/zh/skills/plan-script/SKILL.md +32 -0
  2597. package/templates/langs/zh/skills/profile/SKILL.md +24 -0
  2598. package/templates/langs/zh/skills/reflection/SKILL.md +40 -0
  2599. package/templates/langs/zh/skills/reflection-log/SKILL.md +37 -0
  2600. package/templates/langs/zh/skills/report/SKILL.md +13 -0
  2601. package/templates/langs/zh/skills/root-cause/SKILL.md +33 -0
  2602. package/templates/langs/zh/skills/triage/SKILL.md +29 -0
  2603. package/templates/langs/zh/skills/watch-evolution/SKILL.md +33 -0
  2604. package/templates/pain_dictionary.json +36 -0
  2605. package/templates/pain_settings.json +129 -0
  2606. package/templates/workspace/.principles/THINKING_OS.md +64 -0
  2607. package/templates/workspace/AUDIT.md +15 -0
  2608. package/templates/workspace/PLAN.md +2 -0
  2609. package/templates/workspace/okr/CURRENT_FOCUS.md +57 -0
  2610. package/templates/workspace/okr/RECOVERY_PROTOCOL.md +56 -0
  2611. package/templates/workspace/okr/TASK_CHANGES.jsonl +6 -0
  2612. package/templates/workspace/okr/WEEK_TASKS.json +6 -0
@@ -0,0 +1,2990 @@
1
+ /**
2
+ * Architecture regression guard — verifies critical PRI-12/13/14/15/16/28
3
+ * module boundaries are present and exportable.
4
+ *
5
+ * Add entries here whenever a new service/read-model boundary is established.
6
+ */
7
+ import { describe, it, expect } from 'vitest';
8
+ // ── Source-file existence ──────────────────────────────────────────────────
9
+ const REQUIRED_SOURCE_FILES = [
10
+ 'pain-to-principle-service.ts',
11
+ 'pain-chain-read-model.ts',
12
+ 'pain-signal-bridge.ts',
13
+ 'pain-signal-runtime-factory.ts',
14
+ 'pain-signal-observability.ts',
15
+ 'pruning-read-model.ts',
16
+ 'pruning-review-log.ts',
17
+ // PRI-28
18
+ 'operator-health-read-model.ts',
19
+ 'candidate-audit.ts',
20
+ // PRI-42
21
+ 'internalization/rule-host-contracts.ts',
22
+ 'internalization/rule-host-helpers.ts',
23
+ 'internalization/index.ts',
24
+ // PRI-43
25
+ 'internalization/internalization-route.ts',
26
+ // PRI-44
27
+ 'internalization/template-generator.ts',
28
+ 'internalization/rule-code-validator.ts',
29
+ 'internalization/compile-result.ts',
30
+ // PRI-45
31
+ 'internalization/rule-host-evaluator.ts',
32
+ 'internalization/rule-host-adapter.ts',
33
+ // PRI-51
34
+ 'types/principle-enums.ts',
35
+ 'types/principle-schema.ts',
36
+ 'types/artifact-lineage.ts',
37
+ 'types/replay-types.ts',
38
+ 'types/index.ts',
39
+ 'internalization/lifecycle-types.ts',
40
+ // PRI-52
41
+ 'internalization/lifecycle-metrics.ts',
42
+ // PRI-53
43
+ 'internalization/deprecated-readiness.ts',
44
+ // PRI-54
45
+ 'internalization/routing-policy.ts',
46
+ // PRI-56
47
+ 'internalization/lifecycle-datasource.ts',
48
+ 'internalization/lifecycle-read-model.ts',
49
+ // PRI-61
50
+ 'internalization/peer-runner-contracts.ts',
51
+ 'internalization/internalization-job-graph.ts',
52
+ // PRI-62
53
+ 'internalization/internalization-task-guards.ts',
54
+ 'internalization/internalization-state-machine.ts',
55
+ // PRI-65
56
+ 'internalization/pitask-metadata.ts',
57
+ // PRI-67
58
+ 'internalization/dreamer-output.ts',
59
+ 'internalization/dreamer-runner.ts',
60
+ // PRI-109
61
+ 'internalization/scribe-output.ts',
62
+ 'internalization/scribe-runner.ts',
63
+ // PRI-111
64
+ 'internalization/artificer-output.ts',
65
+ 'internalization/artificer-runner.ts',
66
+ // PRI-EVAL
67
+ 'internalization/evaluator-output.ts',
68
+ 'internalization/evaluator-runner.ts',
69
+ 'internalization/evaluator-prompt-builder.ts',
70
+ // PRI-RR
71
+ 'internalization/rollout-reviewer-output.ts',
72
+ 'internalization/rollout-reviewer-runner.ts',
73
+ 'internalization/rollout-reviewer-prompt-builder.ts',
74
+ // PRI-74 (follow-up to PRI-75 Phase 3)
75
+ '../prompt-builder/routing-guidance.ts',
76
+ // PRI-81 Phase A
77
+ '../prompt-builder/empathy-keyword-matching.ts',
78
+ '../prompt-builder/empathy-types.ts',
79
+ // PRI-81 Phase B
80
+ '../prompt-builder/focus-compression.ts',
81
+ // PRI-76
82
+ 'gfi/gfi-types.ts',
83
+ 'gfi/gfi-policy.ts',
84
+ 'gfi/gfi-kernel.ts',
85
+ 'gfi/index.ts',
86
+ // PRI-84
87
+ 'internalization/pi-artifact.ts',
88
+ 'internalization/pi-artifact-store.ts',
89
+ // PRI-115
90
+ 'golden-trace-replay-validator.ts',
91
+ 'golden-trace-replay-adapter.ts',
92
+ // PRI-172
93
+ 'internalization/refiner-sandbox-wrapper.ts',
94
+ // PRI-173
95
+ 'internalization/refiner-rulehost-gate.ts',
96
+ // Phase 2 migration: evolution types
97
+ 'evolution/evolution-types.ts',
98
+ 'evolution/index.ts',
99
+ // Phase 2 migration: correction types
100
+ 'correction/correction-types.ts',
101
+ 'correction/index.ts',
102
+ // Phase 2 migration: types directory
103
+ 'types/queue-types.ts',
104
+ 'types/hygiene-types.ts',
105
+ 'types/runtime-summary-types.ts',
106
+ 'types/event-types.ts',
107
+ 'types/event-payload.ts',
108
+ 'types/pain-signal.ts',
109
+ 'types/pd-task-types.ts',
110
+ // Phase 2 migration: principle-tree data structures
111
+ 'types/principle-dependency.ts',
112
+ 'types/principle-value-metrics.ts',
113
+ 'types/principle-lifecycle-event.ts',
114
+ 'types/principle-tree-store.ts',
115
+ // PRI-140
116
+ 'store/sqlite-connection.ts',
117
+ // PRI-139
118
+ 'l1-hard-cap.ts',
119
+ // PRI-142
120
+ 'internalization/intake-to-internalization-bridge.ts',
121
+ // PRI-144
122
+ 'activation/activation-types.ts',
123
+ 'activation/activation-dispatcher.ts',
124
+ 'activation/low-risk-writers.ts',
125
+ 'activation/index.ts',
126
+ // PRI-145
127
+ 'activation/approval-queue.ts',
128
+ 'activation/memory-approval-store.ts',
129
+ 'activation/sqlite-approval-store.ts',
130
+ // PRI-189
131
+ 'store/trajectory/source-trace-locator.ts',
132
+ 'store/trajectory/sqlite-source-trace-locator.ts',
133
+ // PRI-190
134
+ 'full-trace-contract.ts',
135
+ // PRI-191
136
+ 'trace-refiner.ts',
137
+ // PRI-192
138
+ 'trace-refiner-agent.ts',
139
+ // PRI-193
140
+ 'golden-trace-candidate-builder.ts',
141
+ // PRI-149 Tier 2
142
+ 'recovery-sweep-service.ts',
143
+ // PRI-146
144
+ 'activation/writers/rule-host-writer.ts',
145
+ 'activation/writers/index.ts',
146
+ // PRI-215
147
+ 'synthetic-baseline.ts',
148
+ // PRI-239
149
+ 'feature-flags/feature-flag-contract.ts',
150
+ 'feature-flags/index.ts',
151
+ ];
152
+ // ── PRI-212: Plugin core anti-growth guard ────────────────────────────────────
153
+ //
154
+ // Baseline: PRI-211 inventory (docs/reviews/plugin-core-inventory-2026-05.md)
155
+ // Prevents silent growth of packages/openclaw-plugin/src/core/ by requiring
156
+ // explicit classification for every new file.
157
+ //
158
+ // New pure domain logic → @principles/core
159
+ // New I/O adapters → must be classified as plugin-specific
160
+ // ERR-011 reference: never bypass architecture boundary facades
161
+ // ERR-012 reference: stale-main PR rollback must not delete baseline entries
162
+ //
163
+ // To add a new plugin I/O adapter legitimately, add its relative path
164
+ // (from packages/openclaw-plugin/src/core/) to the KNOWN_PLUGIN_CORE_FILES
165
+ // set below with a comment explaining why it is plugin-specific.
166
+ const KNOWN_PLUGIN_CORE_FILES = new Set([
167
+ // ── Pure Domain Logic Candidates — exist today but new pure logic belongs in @principles/core ──
168
+ 'trajectory-types.ts',
169
+ 'profile.ts',
170
+ 'pain-signal.ts',
171
+ 'pd-task-types.ts',
172
+ 'evolution-types.ts',
173
+ 'telemetry-event.ts',
174
+ 'empathy-types.ts',
175
+ 'correction-types.ts',
176
+ 'principle-injection.ts',
177
+ 'principle-compiler/template-generator.ts',
178
+ // ── Thin Adapter Candidates — plugin I/O boundary wrappers ──────────────
179
+ 'local-worker-routing.ts',
180
+ 'principle-tree-migration.ts',
181
+ 'principle-internalization/principle-lifecycle-service.ts',
182
+ 'principle-tree-ledger-adapter.ts',
183
+ 'principle-compiler/ledger-registrar.ts',
184
+ 'principle-compiler/code-validator.ts',
185
+ 'principle-injector.ts',
186
+ 'pd-task-service.ts',
187
+ 'principle-internalization/lifecycle-read-model.ts',
188
+ 'principle-internalization/filesystem-lifecycle-datasource.ts',
189
+ 'config-service.ts',
190
+ 'principle-compiler/index.ts',
191
+ 'principle-internalization/lifecycle-refresh.ts',
192
+ // ── Do Not Move — intrinsically plugin-specific ─────────────────────────
193
+ 'event-log.ts',
194
+ 'schema/schema-definitions.ts',
195
+ 'path-resolver.ts',
196
+ 'init.ts',
197
+ 'workspace-context.ts',
198
+ 'reflection/reflection-context.ts',
199
+ 'bootstrap-rules.ts',
200
+ 'schema/migration-runner.ts',
201
+ 'rule-host.ts',
202
+ 'principle-training-state.ts',
203
+ 'pain-diagnostic-gate.ts',
204
+ 'hygiene/tracker.ts',
205
+ 'schema/migrations/002-init-central.ts',
206
+ 'workspace-dir-service.ts',
207
+ 'paths.ts',
208
+ 'schema/migrations/004-add-thinking-and-gfi.ts',
209
+ 'evolution-hook.ts',
210
+ 'storage-adapter.ts',
211
+ 'schema/migrations/003-init-workflow.ts',
212
+ 'workspace-dir-validation.ts',
213
+ 'pain-signal-adapter.ts',
214
+ 'rule-implementation-runtime.ts',
215
+ 'detection-service.ts',
216
+ 'schema/migrations/index.ts',
217
+ 'dictionary-service.ts',
218
+ 'schema/index.ts',
219
+ 'schema/db-types.ts',
220
+ 'rule-host-types.ts',
221
+ 'rule-host-helpers.ts',
222
+ 'schema/migrations/001-init-trajectory.ts',
223
+ // ── I/O Boundary ────────────────────────────────────────────────────────
224
+ 'confirm-first-gate.ts',
225
+ 'trajectory.ts',
226
+ 'evolution-reducer.ts',
227
+ 'promotion-gate.ts',
228
+ 'model-training-registry.ts',
229
+ 'focus-history.ts',
230
+ 'model-deployment-registry.ts',
231
+ 'training-program.ts',
232
+ 'replay-engine.ts',
233
+ 'external-training-contract.ts',
234
+ 'merge-gate-audit.ts',
235
+ 'shadow-observation-registry.ts',
236
+ 'control-ui-db.ts',
237
+ 'thinking-models.ts',
238
+ 'pd-task-reconciler.ts',
239
+ 'correction-cue-learner.ts',
240
+ 'principle-compiler/compiler.ts',
241
+ 'pain.ts',
242
+ 'pain-context-extractor.ts',
243
+ 'config.ts',
244
+ 'code-implementation-storage.ts',
245
+ 'observability.ts',
246
+ 'file-storage-adapter.ts',
247
+ 'workflow-funnel-loader.ts',
248
+ 'dictionary.ts',
249
+ 'thinking-os-parser.ts',
250
+ 'system-logger.ts',
251
+ 'detection-funnel.ts',
252
+ 'risk-calculator.ts',
253
+ 'migration.ts',
254
+ 'file-store.ts',
255
+ 'pd-task-store.ts',
256
+ 'evolution-migration.ts',
257
+ 'empathy-keyword-matcher.ts',
258
+ 'pain-lifecycle.ts',
259
+ 'session-tracker.ts',
260
+ 'principle-tree-ledger.ts',
261
+ 'evolution-logger.ts',
262
+ 'evolution-engine.ts',
263
+ // ── Runtime V2 ──────────────────────────────────────────────────────────
264
+ 'runtime-v2-prompt-activation-reader.ts',
265
+ // ── Test Files ──────────────────────────────────────────────────────────
266
+ '__tests__/focus-history.test.ts',
267
+ 'principle-compiler/__tests__/compiler-replay-gate.test.ts',
268
+ ]);
269
+ describe('PRI-212 plugin core anti-growth guard', () => {
270
+ const PLUGIN_CORE_RELPATH = '../../../../openclaw-plugin/src/core';
271
+ it('every plugin-core file is in the known baseline', async () => {
272
+ const { readdirSync, existsSync } = await import('node:fs');
273
+ const { resolve, relative, sep } = await import('node:path');
274
+ const pluginCoreDir = resolve(__dirname, PLUGIN_CORE_RELPATH);
275
+ expect(existsSync(pluginCoreDir)).toBe(true);
276
+ // Collect all .ts files recursively (relative to plugin-core root)
277
+ const allFiles = [];
278
+ function collectDir(dir) {
279
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
280
+ const fullPath = resolve(dir, entry.name);
281
+ if (entry.isDirectory()) {
282
+ collectDir(fullPath);
283
+ }
284
+ else if (entry.name.endsWith('.ts')) {
285
+ allFiles.push(relative(pluginCoreDir, fullPath).split(sep).join('/'));
286
+ }
287
+ }
288
+ }
289
+ collectDir(pluginCoreDir);
290
+ const unknownFiles = allFiles.filter((f) => !KNOWN_PLUGIN_CORE_FILES.has(f));
291
+ if (unknownFiles.length > 0) {
292
+ const msg = [
293
+ `Found ${unknownFiles.length} unclassified file(s) in packages/openclaw-plugin/src/core/:`,
294
+ ...unknownFiles.map((f) => ` ${f}`),
295
+ '',
296
+ 'Each new file in plugin core must be explicitly classified:',
297
+ ' 1. New pure domain logic → packages/principles-core (zero I/O, testable with no mocks)',
298
+ ' 2. New plugin I/O adapter → add to KNOWN_PLUGIN_CORE_FILES with classification comment',
299
+ ' 3. See docs/reviews/plugin-core-inventory-2026-05.md for the PRI-211 baseline',
300
+ 'ERR-011: never bypass architecture boundary facades',
301
+ 'ERR-012: baseline entries must survive rebase — check diff for unintended deletions',
302
+ ].join('\n');
303
+ expect.fail(msg);
304
+ }
305
+ });
306
+ it('known baseline count is self-consistent (109 files)', async () => {
307
+ // Sanity check: if the baseline grows, update this number.
308
+ // Prevents accidental baseline bloat from going unnoticed.
309
+ // See docs/reviews/plugin-core-inventory-2026-05.md §7
310
+ expect(KNOWN_PLUGIN_CORE_FILES.size).toBe(95);
311
+ });
312
+ });
313
+ const REQUIRED_TEST_FILES = [
314
+ 'pain-to-principle-service.test.ts',
315
+ 'pain-chain-read-model.test.ts',
316
+ 'pruning-read-model.test.ts',
317
+ 'pruning-review-log.test.ts',
318
+ // PRI-28
319
+ 'operator-health-read-model.test.ts',
320
+ 'candidate-audit.test.ts',
321
+ // PRI-56 (lifecycle-read-model.test.ts is at internalization/lifecycle-read-model.test.ts, not in __tests__/)
322
+ // Skipping — test file lives at ../internalization/ not __tests__/internalization/
323
+ // PRI-62
324
+ 'internalization-state-machine.test.ts',
325
+ // PRI-65
326
+ 'pitask-metadata.test.ts',
327
+ // PRI-67
328
+ 'dreamer-runner.test.ts',
329
+ // PRI-109
330
+ 'scribe-runner-vslice.test.ts',
331
+ // PRI-111
332
+ 'artificer-runner-vslice.test.ts',
333
+ // PRI-EVAL
334
+ 'evaluator-runner-vslice.test.ts',
335
+ // PRI-RR
336
+ 'rollout-reviewer-runner-vslice.test.ts',
337
+ // PRI-74 (follow-up to PRI-75 Phase 3)
338
+ '../../prompt-builder/__tests__/routing-guidance.test.ts',
339
+ // PRI-81 Phase A
340
+ '../../prompt-builder/__tests__/empathy-keyword-matching.test.ts',
341
+ // PRI-81 Phase B
342
+ '../../prompt-builder/__tests__/focus-compression.test.ts',
343
+ // PRI-76
344
+ '../gfi/__tests__/gfi-kernel.test.ts',
345
+ // PRI-115
346
+ 'golden-trace-replay-validator.test.ts',
347
+ // PRI-140
348
+ '../store/sqlite-connection-pragma.test.ts',
349
+ // PRI-141
350
+ 'task-three-strikes.test.ts',
351
+ // PRI-139
352
+ 'l1-hard-cap.test.ts',
353
+ // PRI-142
354
+ 'intake-to-internalization-bridge.test.ts',
355
+ // PRI-144
356
+ '../activation/__tests__/activation-dispatcher.test.ts',
357
+ // PRI-145
358
+ '../activation/__tests__/approval-queue.test.ts',
359
+ '../activation/__tests__/sqlite-approval-store.test.ts',
360
+ // PRI-190
361
+ 'full-trace-contract.test.ts',
362
+ // PRI-191
363
+ 'trace-refiner.test.ts',
364
+ // PRI-192
365
+ 'trace-refiner-agent.test.ts',
366
+ // PRI-193
367
+ 'golden-trace-candidate-builder.test.ts',
368
+ // PRI-173
369
+ '../internalization/__tests__/refiner-rulehost-gate.test.ts',
370
+ // PRI-146
371
+ '../activation/writers/__tests__/rule-host-writer.test.ts',
372
+ // PRI-215
373
+ 'synthetic-baseline.test.ts',
374
+ // PRI-239
375
+ '../feature-flags/__tests__/feature-flag-contract.test.ts',
376
+ ];
377
+ const REQUIRED_DOC_FILES = [];
378
+ for (const file of REQUIRED_SOURCE_FILES) {
379
+ it(`source file ${file} is present`, async () => {
380
+ const { existsSync } = await import('node:fs');
381
+ const { resolve } = await import('node:path');
382
+ expect(existsSync(resolve(__dirname, '..', file))).toBe(true);
383
+ });
384
+ }
385
+ for (const file of REQUIRED_TEST_FILES) {
386
+ it(`test file __tests__/${file} is present`, async () => {
387
+ const { existsSync } = await import('node:fs');
388
+ const { resolve } = await import('node:path');
389
+ expect(existsSync(resolve(__dirname, file))).toBe(true);
390
+ });
391
+ }
392
+ for (const file of REQUIRED_DOC_FILES) {
393
+ it(`doc file ${file} is present`, async () => {
394
+ const { existsSync } = await import('node:fs');
395
+ const { resolve } = await import('node:path');
396
+ expect(existsSync(resolve(__dirname, file))).toBe(true);
397
+ });
398
+ }
399
+ // ── Public API exports ─────────────────────────────────────────────────────
400
+ describe('runtime-v2 public API (index.ts barrel)', () => {
401
+ const barrel = import('../index.js');
402
+ const REQUIRED_EXPORTS = [
403
+ // PRI-12
404
+ 'PainToPrincipleService',
405
+ // PRI-14
406
+ 'PainChainReadModel',
407
+ // M8
408
+ 'PainSignalBridge',
409
+ 'createPainSignalBridge',
410
+ 'recordPainSignalObservability',
411
+ // PRI-15
412
+ 'PruningReadModel',
413
+ // PRI-13 → factory
414
+ 'resolveRuntimeConfig',
415
+ 'validateRuntimeConfig',
416
+ // PRI-28
417
+ 'OperatorHealthReadModel',
418
+ 'auditCandidateLedgerConsistency',
419
+ // PRI-43
420
+ 'decideInternalizationRoute',
421
+ // PRI-44
422
+ 'generateFromTemplate',
423
+ 'checkForbiddenPatterns',
424
+ // PRI-45
425
+ 'mergeDecisions',
426
+ // PRI-149 Tier 2
427
+ 'createRecoverySweepService',
428
+ // PRI-239
429
+ 'validateFeatureFlagRaw',
430
+ 'computeEffectiveFlags',
431
+ ];
432
+ for (const name of REQUIRED_EXPORTS) {
433
+ it(`exports ${name}`, async () => {
434
+ const mod = (await barrel);
435
+ expect(mod).toHaveProperty(name);
436
+ expect(typeof mod[name]).toBe('function');
437
+ }, 15_000);
438
+ }
439
+ // PRI-171: TypeBox schema exports (objects, not functions)
440
+ const REQUIRED_SCHEMA_EXPORTS = [
441
+ 'FullTracePayloadSchema',
442
+ 'ToolCallEntrySchema',
443
+ 'PainContextSchema',
444
+ // PRI-190
445
+ 'FullTracePayloadV2Schema',
446
+ 'TraceSourceRefSchema',
447
+ 'TraceTimelineEntrySchema',
448
+ 'TraceEventKindSchema',
449
+ 'SourceRefKindSchema',
450
+ ];
451
+ for (const name of REQUIRED_SCHEMA_EXPORTS) {
452
+ it(`exports schema ${name}`, async () => {
453
+ const mod = (await barrel);
454
+ expect(mod).toHaveProperty(name);
455
+ expect(typeof mod[name]).toBe('object');
456
+ }, 15_000);
457
+ }
458
+ });
459
+ // ── OpenClawPlugin pain hook integration ───────────────────────────────────
460
+ describe('openclaw-plugin pain hook integration', () => {
461
+ it('pain.ts uses PainToPrincipleService (not createPainSignalBridge)', async () => {
462
+ const { existsSync, readFileSync } = await import('node:fs');
463
+ const { resolve } = await import('node:path');
464
+ const painHookPath = resolve(__dirname, '../../../../openclaw-plugin/src/hooks/pain.ts');
465
+ expect(existsSync(painHookPath)).toBe(true);
466
+ const src = readFileSync(painHookPath, 'utf-8');
467
+ expect(src).toContain('PainToPrincipleService');
468
+ expect(src).not.toContain('createPainSignalBridge');
469
+ });
470
+ // PRI-29: emitPainDetectedEvent → PainToPrincipleService service contract
471
+ it('pain.ts emitPainDetectedEvent calls PainToPrincipleService.recordPain on pain_detected', async () => {
472
+ const { existsSync, readFileSync } = await import('node:fs');
473
+ const { resolve } = await import('node:path');
474
+ const painHookPath = resolve(__dirname, '../../../../openclaw-plugin/src/hooks/pain.ts');
475
+ expect(existsSync(painHookPath)).toBe(true);
476
+ const src = readFileSync(painHookPath, 'utf-8');
477
+ // Must call service.recordPain() inside emitPainDetectedEvent
478
+ expect(src).toMatch(/service\.recordPain\(/);
479
+ // Must log PAIN_SERVICE_FAILED for failure results
480
+ expect(src).toMatch(/PAIN_SERVICE_FAILED/);
481
+ // Must log PAIN_SERVICE_SKIPPED for skipped results
482
+ expect(src).toMatch(/PAIN_SERVICE_SKIPPED/);
483
+ // Must log PAIN_SERVICE_ERROR for exceptions
484
+ expect(src).toMatch(/PAIN_SERVICE_ERROR/);
485
+ // Must NOT use legacy createPainSignalBridge
486
+ expect(src).not.toMatch(/createPainSignalBridge/);
487
+ });
488
+ });
489
+ // ── PRI-42: Internalization boundary guards ──────────────────────────────────
490
+ describe('PRI-42 internalization boundary', () => {
491
+ const CONTRACT_TYPES = [
492
+ 'RuleHostInput',
493
+ 'RuleHostResult',
494
+ 'RuleHostDecision',
495
+ 'RuleHostMeta',
496
+ 'LoadedImplementation',
497
+ ];
498
+ it('core internalization has zero openclaw-plugin imports', async () => {
499
+ const { existsSync, readdirSync, readFileSync } = await import('node:fs');
500
+ const { resolve, join } = await import('node:path');
501
+ const intDir = resolve(__dirname, '..', 'internalization');
502
+ expect(existsSync(intDir)).toBe(true);
503
+ const files = readdirSync(intDir).filter((f) => f.endsWith('.ts') && !f.endsWith('.test.ts'));
504
+ for (const file of files) {
505
+ const src = readFileSync(join(intDir, file), 'utf-8');
506
+ expect(src).not.toContain('openclaw-plugin');
507
+ expect(src).not.toContain('../../../openclaw-plugin');
508
+ }
509
+ });
510
+ it('plugin does not re-define RuleHost contract types locally', async () => {
511
+ const { existsSync, readFileSync } = await import('node:fs');
512
+ const { resolve } = await import('node:path');
513
+ const typesPath = resolve(__dirname, '../../../../openclaw-plugin/src/core/rule-host-types.ts');
514
+ expect(existsSync(typesPath)).toBe(true);
515
+ const src = readFileSync(typesPath, 'utf-8');
516
+ // After PRI-42, rule-host-types.ts should re-export from core, not define interfaces
517
+ for (const typeName of CONTRACT_TYPES) {
518
+ expect(src).toContain(typeName);
519
+ expect(src).toContain("from '@principles/core/runtime-v2'");
520
+ }
521
+ });
522
+ it('plugin does not re-define RuleHostHelpers locally', async () => {
523
+ const { existsSync, readFileSync } = await import('node:fs');
524
+ const { resolve } = await import('node:path');
525
+ const helpersPath = resolve(__dirname, '../../../../openclaw-plugin/src/core/rule-host-helpers.ts');
526
+ expect(existsSync(helpersPath)).toBe(true);
527
+ const src = readFileSync(helpersPath, 'utf-8');
528
+ // After PRI-42, rule-host-helpers.ts should re-export from core, not define interface
529
+ expect(src).toContain('RuleHostHelpers');
530
+ expect(src).toContain('createRuleHostHelpers');
531
+ expect(src).toContain("from '@principles/core/runtime-v2'");
532
+ });
533
+ it('plugin rule-host.ts imports contracts from core barrel', async () => {
534
+ const { existsSync, readFileSync } = await import('node:fs');
535
+ const { resolve } = await import('node:path');
536
+ const ruleHostPath = resolve(__dirname, '../../../../openclaw-plugin/src/core/rule-host.ts');
537
+ expect(existsSync(ruleHostPath)).toBe(true);
538
+ const src = readFileSync(ruleHostPath, 'utf-8');
539
+ // Must import from @principles/core/runtime-v2, not local rule-host-types
540
+ expect(src).toContain('@principles/core/runtime-v2');
541
+ expect(src).not.toContain("from './rule-host-types.js'");
542
+ });
543
+ it('plugin gate.ts imports RuleHostInput from core barrel', async () => {
544
+ const { existsSync, readFileSync } = await import('node:fs');
545
+ const { resolve } = await import('node:path');
546
+ const gatePath = resolve(__dirname, '../../../../openclaw-plugin/src/hooks/gate.ts');
547
+ expect(existsSync(gatePath)).toBe(true);
548
+ const src = readFileSync(gatePath, 'utf-8');
549
+ expect(src).toContain('@principles/core/runtime-v2');
550
+ expect(src).not.toContain("from '../core/rule-host-types.js'");
551
+ });
552
+ it('plugin replay-engine.ts imports contracts from core barrel', async () => {
553
+ const { existsSync, readFileSync } = await import('node:fs');
554
+ const { resolve } = await import('node:path');
555
+ const replayPath = resolve(__dirname, '../../../../openclaw-plugin/src/core/replay-engine.ts');
556
+ expect(existsSync(replayPath)).toBe(true);
557
+ const src = readFileSync(replayPath, 'utf-8');
558
+ expect(src).toContain('@principles/core/runtime-v2');
559
+ expect(src).not.toContain("from './rule-host-types.js'");
560
+ expect(src).not.toContain("from './rule-host-helpers.js'");
561
+ });
562
+ });
563
+ // ── PRI-44: Principle-compiler core boundary ──────────────────────────────────
564
+ describe('PRI-44 principle-compiler core boundary', () => {
565
+ it('core template-generator.ts has zero infrastructure imports', async () => {
566
+ const { readFileSync } = await import('node:fs');
567
+ const { resolve } = await import('node:path');
568
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'template-generator.ts'), 'utf-8');
569
+ expect(src).not.toContain('node:vm');
570
+ expect(src).not.toContain('node:fs');
571
+ expect(src).not.toContain('openclaw-plugin');
572
+ });
573
+ it('core rule-code-validator.ts has zero infrastructure imports', async () => {
574
+ const { readFileSync } = await import('node:fs');
575
+ const { resolve } = await import('node:path');
576
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'rule-code-validator.ts'), 'utf-8');
577
+ expect(src).not.toContain('node:vm');
578
+ expect(src).not.toContain('node:fs');
579
+ expect(src).not.toContain('openclaw-plugin');
580
+ });
581
+ it('plugin template-generator.ts re-exports from core', async () => {
582
+ const { readFileSync } = await import('node:fs');
583
+ const { resolve } = await import('node:path');
584
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/core/principle-compiler/template-generator.ts'), 'utf-8');
585
+ expect(src).toContain('@principles/core/runtime-v2');
586
+ expect(src).toContain('generateFromTemplate');
587
+ });
588
+ it('plugin code-validator.ts imports checkForbiddenPatterns from core', async () => {
589
+ const { readFileSync } = await import('node:fs');
590
+ const { resolve } = await import('node:path');
591
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/core/principle-compiler/code-validator.ts'), 'utf-8');
592
+ expect(src).toContain('checkForbiddenPatterns');
593
+ expect(src).toContain('@principles/core/runtime-v2');
594
+ });
595
+ it('plugin compiler.ts imports CompileResult from core', async () => {
596
+ const { readFileSync } = await import('node:fs');
597
+ const { resolve } = await import('node:path');
598
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/core/principle-compiler/compiler.ts'), 'utf-8');
599
+ expect(src).toContain("import type { CompileResult } from '@principles/core/runtime-v2'");
600
+ });
601
+ });
602
+ // ── PRI-47: Store layer modularization Phase 3 ──────────────────────────────
603
+ describe('PRI-47 store modularization Phase 3', () => {
604
+ it('store/candidate/index.ts exists and re-exports CandidateStore + SqliteCandidateStore + MemoryCandidateStore', async () => {
605
+ const { existsSync, readFileSync } = await import('node:fs');
606
+ const { resolve } = await import('node:path');
607
+ const indexPath = resolve(__dirname, '..', 'store', 'candidate', 'index.ts');
608
+ expect(existsSync(indexPath)).toBe(true);
609
+ const src = readFileSync(indexPath, 'utf-8');
610
+ expect(src).toContain('CandidateStore');
611
+ expect(src).toContain('SqliteCandidateStore');
612
+ expect(src).toContain('MemoryCandidateStore');
613
+ });
614
+ it('store/artifact/index.ts exists and re-exports ArtifactStore + SqliteArtifactStore + MemoryArtifactStore', async () => {
615
+ const { existsSync, readFileSync } = await import('node:fs');
616
+ const { resolve } = await import('node:path');
617
+ const indexPath = resolve(__dirname, '..', 'store', 'artifact', 'index.ts');
618
+ expect(existsSync(indexPath)).toBe(true);
619
+ const src = readFileSync(indexPath, 'utf-8');
620
+ expect(src).toContain('ArtifactStore');
621
+ expect(src).toContain('SqliteArtifactStore');
622
+ expect(src).toContain('MemoryArtifactStore');
623
+ });
624
+ it('store/commit/index.ts re-exports CommitStore + SqliteCommitStore + MemoryCommitStore', async () => {
625
+ const { readFileSync } = await import('node:fs');
626
+ const { resolve } = await import('node:path');
627
+ const indexPath = resolve(__dirname, '..', 'store', 'commit', 'index.ts');
628
+ const src = readFileSync(indexPath, 'utf-8');
629
+ expect(src).toContain('CommitStore');
630
+ expect(src).toContain('SqliteCommitStore');
631
+ expect(src).toContain('MemoryCommitStore');
632
+ });
633
+ it('store/task/index.ts re-exports MemoryTaskStore', async () => {
634
+ const { readFileSync } = await import('node:fs');
635
+ const { resolve } = await import('node:path');
636
+ const indexPath = resolve(__dirname, '..', 'store', 'task', 'index.ts');
637
+ const src = readFileSync(indexPath, 'utf-8');
638
+ expect(src).toContain('MemoryTaskStore');
639
+ });
640
+ it('store/run/index.ts re-exports MemoryRunStore', async () => {
641
+ const { readFileSync } = await import('node:fs');
642
+ const { resolve } = await import('node:path');
643
+ const indexPath = resolve(__dirname, '..', 'store', 'run', 'index.ts');
644
+ const src = readFileSync(indexPath, 'utf-8');
645
+ expect(src).toContain('MemoryRunStore');
646
+ });
647
+ it('RuntimeStateManager has zero inline SQL (no db.prepare calls)', async () => {
648
+ const { readFileSync } = await import('node:fs');
649
+ const { resolve } = await import('node:path');
650
+ const src = readFileSync(resolve(__dirname, '..', 'store', 'runtime-state-manager.ts'), 'utf-8');
651
+ expect(src).not.toContain('db.prepare');
652
+ });
653
+ it('Memory*Store test double files exist', async () => {
654
+ const { existsSync } = await import('node:fs');
655
+ const { resolve } = await import('node:path');
656
+ const base = resolve(__dirname, '..', 'store');
657
+ expect(existsSync(resolve(base, 'task', 'memory-task-store.ts'))).toBe(true);
658
+ expect(existsSync(resolve(base, 'run', 'memory-run-store.ts'))).toBe(true);
659
+ expect(existsSync(resolve(base, 'commit', 'memory-commit-store.ts'))).toBe(true);
660
+ expect(existsSync(resolve(base, 'candidate', 'memory-candidate-store.ts'))).toBe(true);
661
+ expect(existsSync(resolve(base, 'artifact', 'memory-artifact-store.ts'))).toBe(true);
662
+ });
663
+ it('Phase 3 M5 types NOT defined inline in runtime-state-manager.ts', async () => {
664
+ const { readFileSync } = await import('node:fs');
665
+ const { resolve } = await import('node:path');
666
+ const src = readFileSync(resolve(__dirname, '..', 'store', 'runtime-state-manager.ts'), 'utf-8');
667
+ // CommitRecord, CandidateRecord, ArtifactRecord, ArtifactWithCandidates should be re-exported from submodules
668
+ expect(src).not.toMatch(/^export interface CommitRecord/m);
669
+ expect(src).not.toMatch(/^export interface CandidateRecord/m);
670
+ expect(src).not.toMatch(/^export interface ArtifactRecord/m);
671
+ expect(src).not.toMatch(/^export interface ArtifactWithCandidates/m);
672
+ });
673
+ });
674
+ describe('pd-cli command boundaries', () => {
675
+ it('pain-record.ts does not import createPainSignalBridge or recordPainSignalObservability', async () => {
676
+ const { existsSync, readFileSync } = await import('node:fs');
677
+ const { resolve } = await import('node:path');
678
+ const cmdPath = resolve(__dirname, '../../../../pd-cli/src/commands/pain-record.ts');
679
+ expect(existsSync(cmdPath)).toBe(true);
680
+ const src = readFileSync(cmdPath, 'utf-8');
681
+ expect(src).toContain('PainToPrincipleService');
682
+ expect(src).not.toContain('createPainSignalBridge');
683
+ expect(src).not.toContain('recordPainSignalObservability');
684
+ });
685
+ it('runtime-health-snapshot.ts uses OperatorHealthReadModel (public API)', async () => {
686
+ const { existsSync, readFileSync } = await import('node:fs');
687
+ const { resolve } = await import('node:path');
688
+ const cmdPath = resolve(__dirname, '../../../../pd-cli/src/commands/runtime-health-snapshot.ts');
689
+ expect(existsSync(cmdPath)).toBe(true);
690
+ const src = readFileSync(cmdPath, 'utf-8');
691
+ expect(src).toContain('OperatorHealthReadModel');
692
+ expect(src).not.toContain('auditCandidateLedgerConsistency');
693
+ expect(src).not.toContain('../candidate-audit');
694
+ });
695
+ it('trace.ts does not import RuntimeStateManager or loadLedger', async () => {
696
+ const { existsSync, readFileSync } = await import('node:fs');
697
+ const { resolve } = await import('node:path');
698
+ const cmdPath = resolve(__dirname, '../../../../pd-cli/src/commands/trace.ts');
699
+ expect(existsSync(cmdPath)).toBe(true);
700
+ const src = readFileSync(cmdPath, 'utf-8');
701
+ expect(src).not.toContain('RuntimeStateManager');
702
+ expect(src).not.toContain('loadLedger');
703
+ expect(src).toContain('PainChainReadModel');
704
+ });
705
+ it('health.ts does not import loadLedger', async () => {
706
+ const { existsSync, readFileSync } = await import('node:fs');
707
+ const { resolve } = await import('node:path');
708
+ const cmdPath = resolve(__dirname, '../../../../pd-cli/src/commands/health.ts');
709
+ expect(existsSync(cmdPath)).toBe(true);
710
+ const src = readFileSync(cmdPath, 'utf-8');
711
+ expect(src).not.toContain('loadLedger');
712
+ expect(src).not.toContain('RuntimeStateManager');
713
+ expect(src).toContain('PruningReadModel');
714
+ });
715
+ it('runtime-pruning.ts does not import loadLedger or saveLedger', async () => {
716
+ const { existsSync, readFileSync } = await import('node:fs');
717
+ const { resolve } = await import('node:path');
718
+ const cmdPath = resolve(__dirname, '../../../../pd-cli/src/commands/runtime-pruning.ts');
719
+ expect(existsSync(cmdPath)).toBe(true);
720
+ const src = readFileSync(cmdPath, 'utf-8');
721
+ expect(src).not.toContain('loadLedger');
722
+ expect(src).not.toContain('saveLedger');
723
+ expect(src).not.toContain('RuntimeStateManager');
724
+ expect(src).toContain('removeOrphanReferencesFromLedger');
725
+ });
726
+ it('runtime-internalization-queue.ts does not import RuntimeStateManager', async () => {
727
+ const { existsSync, readFileSync } = await import('node:fs');
728
+ const { resolve } = await import('node:path');
729
+ const cmdPath = resolve(__dirname, '../../../../pd-cli/src/commands/runtime-internalization-queue.ts');
730
+ expect(existsSync(cmdPath)).toBe(true);
731
+ const src = readFileSync(cmdPath, 'utf-8');
732
+ expect(src).not.toContain('RuntimeStateManager');
733
+ expect(src).not.toContain('loadLedger');
734
+ expect(src).toContain('createInternalizationQueueReadModel');
735
+ });
736
+ it('runtime-canary.ts does not import RuntimeStateManager', async () => {
737
+ const { existsSync, readFileSync } = await import('node:fs');
738
+ const { resolve } = await import('node:path');
739
+ const cmdPath = resolve(__dirname, '../../../../pd-cli/src/commands/runtime-canary.ts');
740
+ expect(existsSync(cmdPath)).toBe(true);
741
+ const src = readFileSync(cmdPath, 'utf-8');
742
+ expect(src).not.toContain('RuntimeStateManager');
743
+ expect(src).toContain('createInternalizationQueueReadModel');
744
+ });
745
+ it('runtime-diagnostics-export.ts does not import RuntimeStateManager', async () => {
746
+ const { existsSync, readFileSync } = await import('node:fs');
747
+ const { resolve } = await import('node:path');
748
+ const cmdPath = resolve(__dirname, '../../../../pd-cli/src/commands/runtime-diagnostics-export.ts');
749
+ expect(existsSync(cmdPath)).toBe(true);
750
+ const src = readFileSync(cmdPath, 'utf-8');
751
+ expect(src).not.toContain('RuntimeStateManager');
752
+ expect(src).toContain('createInternalizationQueueReadModel');
753
+ });
754
+ it('runtime-recovery.ts does not import RuntimeStateManager', async () => {
755
+ const { existsSync, readFileSync } = await import('node:fs');
756
+ const { resolve } = await import('node:path');
757
+ const cmdPath = resolve(__dirname, '../../../../pd-cli/src/commands/runtime-recovery.ts');
758
+ expect(existsSync(cmdPath)).toBe(true);
759
+ const src = readFileSync(cmdPath, 'utf-8');
760
+ expect(src).not.toContain('RuntimeStateManager');
761
+ expect(src).toContain('createRecoverySweepService');
762
+ });
763
+ });
764
+ // ── PRI-198: RuntimeStateHandle lifecycle facade ────────────────────────────
765
+ describe('PRI-198 RuntimeStateHandle lifecycle facade', () => {
766
+ it('runtime-state-handle.ts source file exists', async () => {
767
+ const { existsSync } = await import('node:fs');
768
+ const { resolve } = await import('node:path');
769
+ const filePath = resolve(__dirname, '..', 'runtime-state-handle.ts');
770
+ expect(existsSync(filePath)).toBe(true);
771
+ });
772
+ it('internalization-queue-read-model.ts does not import RuntimeStateManager directly', async () => {
773
+ const { readFileSync } = await import('node:fs');
774
+ const { resolve } = await import('node:path');
775
+ const src = readFileSync(resolve(__dirname, '..', 'internalization-queue-read-model.ts'), 'utf-8');
776
+ expect(src).not.toContain("from './store/runtime-state-manager.js'");
777
+ expect(src).toContain("from './runtime-state-handle.js'");
778
+ });
779
+ it('recovery-sweep-service.ts does not import RuntimeStateManager directly', async () => {
780
+ const { readFileSync } = await import('node:fs');
781
+ const { resolve } = await import('node:path');
782
+ const src = readFileSync(resolve(__dirname, '..', 'recovery-sweep-service.ts'), 'utf-8');
783
+ expect(src).not.toContain("from './store/runtime-state-manager.js'");
784
+ expect(src).toContain("from './runtime-state-handle.js'");
785
+ });
786
+ it('barrel exports createRuntimeStateHandle and RuntimeStateHandle', async () => {
787
+ const mod = (await import('../index.js'));
788
+ expect(mod).toHaveProperty('createRuntimeStateHandle');
789
+ });
790
+ });
791
+ // ── PRI-45: RuleHost adapter boundary ────────────────────────────────────────
792
+ describe('PRI-45 RuleHost adapter boundary', () => {
793
+ it('core rule-host-evaluator.ts has zero infrastructure imports', async () => {
794
+ const { readFileSync } = await import('node:fs');
795
+ const { resolve } = await import('node:path');
796
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'rule-host-evaluator.ts'), 'utf-8');
797
+ expect(src).not.toContain('node:vm');
798
+ expect(src).not.toContain('node:fs');
799
+ expect(src).not.toContain('openclaw-plugin');
800
+ });
801
+ it('core rule-host-adapter.ts has zero infrastructure imports', async () => {
802
+ const { readFileSync } = await import('node:fs');
803
+ const { resolve } = await import('node:path');
804
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'rule-host-adapter.ts'), 'utf-8');
805
+ expect(src).not.toContain('node:vm');
806
+ expect(src).not.toContain('node:fs');
807
+ expect(src).not.toContain('openclaw-plugin');
808
+ });
809
+ it('plugin rule-host.ts imports mergeDecisions from core barrel', async () => {
810
+ const { readFileSync } = await import('node:fs');
811
+ const { resolve } = await import('node:path');
812
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/core/rule-host.ts'), 'utf-8');
813
+ expect(src).toContain('mergeDecisions');
814
+ expect(src).toContain('@principles/core/runtime-v2');
815
+ });
816
+ it('plugin rule-host.ts evaluate method delegates to mergeDecisions', async () => {
817
+ const { readFileSync } = await import('node:fs');
818
+ const { resolve } = await import('node:path');
819
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/core/rule-host.ts'), 'utf-8');
820
+ expect(src).toMatch(/return mergeDecisions\(/);
821
+ });
822
+ });
823
+ // ── PRI-47: Store layer modularization Phase 1 ──────────────────────────────
824
+ describe('PRI-47 store modularization', () => {
825
+ it('store/task/index.ts exists and re-exports TaskStore + SqliteTaskStore', async () => {
826
+ const { existsSync, readFileSync } = await import('node:fs');
827
+ const { resolve } = await import('node:path');
828
+ const indexPath = resolve(__dirname, '..', 'store', 'task', 'index.ts');
829
+ expect(existsSync(indexPath)).toBe(true);
830
+ const src = readFileSync(indexPath, 'utf-8');
831
+ expect(src).toContain('TaskStore');
832
+ expect(src).toContain('SqliteTaskStore');
833
+ });
834
+ it('store/run/index.ts exists and re-exports RunStore + SqliteRunStore', async () => {
835
+ const { existsSync, readFileSync } = await import('node:fs');
836
+ const { resolve } = await import('node:path');
837
+ const indexPath = resolve(__dirname, '..', 'store', 'run', 'index.ts');
838
+ expect(existsSync(indexPath)).toBe(true);
839
+ const src = readFileSync(indexPath, 'utf-8');
840
+ expect(src).toContain('RunStore');
841
+ expect(src).toContain('SqliteRunStore');
842
+ });
843
+ it('store/commit/index.ts exists and re-exports DiagnosticianCommitter', async () => {
844
+ const { existsSync, readFileSync } = await import('node:fs');
845
+ const { resolve } = await import('node:path');
846
+ const indexPath = resolve(__dirname, '..', 'store', 'commit', 'index.ts');
847
+ expect(existsSync(indexPath)).toBe(true);
848
+ const src = readFileSync(indexPath, 'utf-8');
849
+ expect(src).toContain('DiagnosticianCommitter');
850
+ expect(src).toContain('CommitInput');
851
+ expect(src).toContain('CommitResult');
852
+ });
853
+ it('Phase 1 moved files are NOT in root store/ directory', async () => {
854
+ const { existsSync } = await import('node:fs');
855
+ const { resolve } = await import('node:path');
856
+ const storeDir = resolve(__dirname, '..', 'store');
857
+ // Phase 1: These files should have been moved to subdirectories
858
+ expect(existsSync(resolve(storeDir, 'task-store.ts'))).toBe(false);
859
+ expect(existsSync(resolve(storeDir, 'sqlite-task-store.ts'))).toBe(false);
860
+ expect(existsSync(resolve(storeDir, 'run-store.ts'))).toBe(false);
861
+ expect(existsSync(resolve(storeDir, 'sqlite-run-store.ts'))).toBe(false);
862
+ expect(existsSync(resolve(storeDir, 'diagnostician-committer.ts'))).toBe(false);
863
+ });
864
+ });
865
+ // ── PRI-47: Store layer modularization Phase 2 ──────────────────────────────
866
+ describe('PRI-47 store modularization Phase 2', () => {
867
+ it('store/context/index.ts exists and re-exports ContextAssembler + implementations', async () => {
868
+ const { existsSync, readFileSync } = await import('node:fs');
869
+ const { resolve } = await import('node:path');
870
+ const indexPath = resolve(__dirname, '..', 'store', 'context', 'index.ts');
871
+ expect(existsSync(indexPath)).toBe(true);
872
+ const src = readFileSync(indexPath, 'utf-8');
873
+ expect(src).toContain('ContextAssembler');
874
+ expect(src).toContain('SqliteContextAssembler');
875
+ expect(src).toContain('ResilientContextAssembler');
876
+ });
877
+ it('store/history/index.ts exists and re-exports HistoryQuery + implementations', async () => {
878
+ const { existsSync, readFileSync } = await import('node:fs');
879
+ const { resolve } = await import('node:path');
880
+ const indexPath = resolve(__dirname, '..', 'store', 'history', 'index.ts');
881
+ expect(existsSync(indexPath)).toBe(true);
882
+ const src = readFileSync(indexPath, 'utf-8');
883
+ expect(src).toContain('HistoryQuery');
884
+ expect(src).toContain('SqliteHistoryQuery');
885
+ expect(src).toContain('ResilientHistoryQuery');
886
+ });
887
+ it('store/trajectory/index.ts exists and re-exports TrajectoryLocator + implementation', async () => {
888
+ const { existsSync, readFileSync } = await import('node:fs');
889
+ const { resolve } = await import('node:path');
890
+ const indexPath = resolve(__dirname, '..', 'store', 'trajectory', 'index.ts');
891
+ expect(existsSync(indexPath)).toBe(true);
892
+ const src = readFileSync(indexPath, 'utf-8');
893
+ expect(src).toContain('TrajectoryLocator');
894
+ expect(src).toContain('SqliteTrajectoryLocator');
895
+ });
896
+ it('store/lifecycle/index.ts exists and re-exports lease/retry/recovery', async () => {
897
+ const { existsSync, readFileSync } = await import('node:fs');
898
+ const { resolve } = await import('node:path');
899
+ const indexPath = resolve(__dirname, '..', 'store', 'lifecycle', 'index.ts');
900
+ expect(existsSync(indexPath)).toBe(true);
901
+ const src = readFileSync(indexPath, 'utf-8');
902
+ expect(src).toContain('LeaseManager');
903
+ expect(src).toContain('DefaultLeaseManager');
904
+ expect(src).toContain('DefaultRetryPolicy');
905
+ expect(src).toContain('DefaultRecoverySweep');
906
+ });
907
+ it('Phase 2 moved files are NOT in root store/ directory', async () => {
908
+ const { existsSync } = await import('node:fs');
909
+ const { resolve } = await import('node:path');
910
+ const storeDir = resolve(__dirname, '..', 'store');
911
+ // Phase 2: context
912
+ expect(existsSync(resolve(storeDir, 'context-assembler.ts'))).toBe(false);
913
+ expect(existsSync(resolve(storeDir, 'sqlite-context-assembler.ts'))).toBe(false);
914
+ expect(existsSync(resolve(storeDir, 'resilient-context-assembler.ts'))).toBe(false);
915
+ // Phase 2: history
916
+ expect(existsSync(resolve(storeDir, 'history-query.ts'))).toBe(false);
917
+ expect(existsSync(resolve(storeDir, 'sqlite-history-query.ts'))).toBe(false);
918
+ expect(existsSync(resolve(storeDir, 'resilient-history-query.ts'))).toBe(false);
919
+ // Phase 2: trajectory
920
+ expect(existsSync(resolve(storeDir, 'trajectory-locator.ts'))).toBe(false);
921
+ expect(existsSync(resolve(storeDir, 'sqlite-trajectory-locator.ts'))).toBe(false);
922
+ // Phase 2: lifecycle
923
+ expect(existsSync(resolve(storeDir, 'lease-manager.ts'))).toBe(false);
924
+ expect(existsSync(resolve(storeDir, 'retry-policy.ts'))).toBe(false);
925
+ expect(existsSync(resolve(storeDir, 'recovery-sweep.ts'))).toBe(false);
926
+ });
927
+ it('barrel still exports all store symbols', async () => {
928
+ const mod = (await import('../index.js'));
929
+ const storeSymbols = [
930
+ 'SqliteTaskStore', 'SqliteRunStore', 'SqliteConnection',
931
+ 'SqliteTrajectoryLocator', 'SqliteHistoryQuery', 'SqliteContextAssembler',
932
+ 'SqliteDiagnosticianCommitter',
933
+ 'ResilientContextAssembler', 'ResilientHistoryQuery',
934
+ 'DefaultLeaseManager', 'DefaultRetryPolicy', 'DefaultRecoverySweep',
935
+ 'StoreEventEmitter', 'storeEmitter',
936
+ 'RuntimeStateManager', 'EvolutionQueueItemMigrator',
937
+ 'DEFAULT_HISTORY_PAGE_SIZE', 'MAX_HISTORY_PAGE_SIZE', 'DEFAULT_TIME_WINDOW_MS',
938
+ ];
939
+ for (const sym of storeSymbols) {
940
+ expect(mod).toHaveProperty(sym);
941
+ }
942
+ });
943
+ it('barrel exports Memory*Store test doubles', async () => {
944
+ const mod = (await import('../index.js'));
945
+ const memoryStores = [
946
+ 'MemoryTaskStore', 'MemoryRunStore', 'MemoryCommitStore',
947
+ 'MemoryCandidateStore', 'MemoryArtifactStore',
948
+ ];
949
+ for (const sym of memoryStores) {
950
+ expect(mod).toHaveProperty(sym);
951
+ }
952
+ });
953
+ });
954
+ // ── PRI-51: Lifecycle type extraction ────────────────────────────────────────
955
+ describe('PRI-51 lifecycle type extraction', () => {
956
+ const LIFECYCLE_TYPES = [
957
+ 'LifecycleClassificationTotals',
958
+ 'RuleReplayEvidence',
959
+ 'RuleLiveEvidence',
960
+ 'RuleLineageEvidence',
961
+ 'ImplementationLifecycleEvidence',
962
+ 'RuleLifecycleEvidence',
963
+ 'PrincipleLifecycleEvidence',
964
+ 'LifecycleReadModel',
965
+ ];
966
+ const ENUM_TYPES = [
967
+ 'PrinciplePriority',
968
+ 'PrincipleEvaluability',
969
+ 'RuleType',
970
+ 'RuleStatus',
971
+ 'ImplementationLifecycleState',
972
+ 'ImplementationType',
973
+ 'SampleClassification',
974
+ ];
975
+ it('core exports all lifecycle types from barrel', async () => {
976
+ const { readFileSync } = await import('node:fs');
977
+ const { resolve } = await import('node:path');
978
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
979
+ for (const name of LIFECYCLE_TYPES) {
980
+ expect(src).toContain(name);
981
+ }
982
+ });
983
+ it('core exports all enum types from barrel', async () => {
984
+ const { readFileSync } = await import('node:fs');
985
+ const { resolve } = await import('node:path');
986
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
987
+ for (const name of ENUM_TYPES) {
988
+ expect(src).toContain(name);
989
+ }
990
+ });
991
+ it('lifecycle-types.ts has zero infrastructure imports', async () => {
992
+ const { readFileSync } = await import('node:fs');
993
+ const { resolve } = await import('node:path');
994
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'lifecycle-types.ts'), 'utf-8');
995
+ expect(src).not.toContain('node:fs');
996
+ expect(src).not.toContain('node:path');
997
+ expect(src).not.toContain('openclaw-plugin');
998
+ });
999
+ it('plugin lifecycle-read-model.ts re-exports types from core', async () => {
1000
+ const { readFileSync } = await import('node:fs');
1001
+ const { resolve } = await import('node:path');
1002
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/core/principle-internalization/lifecycle-read-model.ts'), 'utf-8');
1003
+ expect(src).toContain('@principles/core/runtime-v2');
1004
+ expect(src).toContain('buildLifecycleReadModel');
1005
+ });
1006
+ it('plugin principle-tree-schema.ts re-exports enums from core', async () => {
1007
+ const { readFileSync } = await import('node:fs');
1008
+ const { resolve } = await import('node:path');
1009
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/types/principle-tree-schema.ts'), 'utf-8');
1010
+ expect(src).toContain("from '@principles/core/runtime-v2'");
1011
+ // Should no longer define these locally
1012
+ expect(src).not.toMatch(/^export type PrinciplePriority = /m);
1013
+ expect(src).not.toMatch(/^export type RuleType = /m);
1014
+ });
1015
+ it('plugin principle-tree-schema.ts re-exports Rule and Implementation from core (no local re-definition)', async () => {
1016
+ const { readFileSync } = await import('node:fs');
1017
+ const { resolve } = await import('node:path');
1018
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/types/principle-tree-schema.ts'), 'utf-8');
1019
+ expect(src).toContain("Rule");
1020
+ expect(src).toContain("Implementation");
1021
+ expect(src).not.toMatch(/^export interface Rule \{/m);
1022
+ expect(src).not.toMatch(/^export interface Implementation \{/m);
1023
+ });
1024
+ });
1025
+ // ── PRI-52: Lifecycle metrics extraction ──────────────────────────────────────
1026
+ describe('PRI-52 lifecycle metrics', () => {
1027
+ it('core exports all lifecycle metrics from barrel', async () => {
1028
+ const { readFileSync } = await import('node:fs');
1029
+ const { resolve } = await import('node:path');
1030
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
1031
+ expect(src).toContain('RuleMetricResult');
1032
+ expect(src).toContain('PrincipleAdherenceResult');
1033
+ expect(src).toContain('computeRuleMetrics');
1034
+ expect(src).toContain('computePrincipleAdherence');
1035
+ });
1036
+ it('lifecycle-metrics.ts has zero infrastructure imports', async () => {
1037
+ const { readFileSync } = await import('node:fs');
1038
+ const { resolve } = await import('node:path');
1039
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'lifecycle-metrics.ts'), 'utf-8');
1040
+ expect(src).not.toContain('node:fs');
1041
+ expect(src).not.toContain('node:path');
1042
+ expect(src).not.toContain('openclaw-plugin');
1043
+ });
1044
+ it('plugin principle-lifecycle-service.ts imports lifecycle metrics from core barrel', async () => {
1045
+ const { readFileSync } = await import('node:fs');
1046
+ const { resolve } = await import('node:path');
1047
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/core/principle-internalization/principle-lifecycle-service.ts'), 'utf-8');
1048
+ expect(src).toContain("from '@principles/core/runtime-v2'");
1049
+ expect(src).toContain('computeRuleMetrics');
1050
+ expect(src).toContain('computePrincipleAdherence');
1051
+ });
1052
+ });
1053
+ // ── PRI-53: Deprecated readiness extraction ──────────────────────────────────
1054
+ describe('PRI-53 deprecated readiness', () => {
1055
+ it('core exports all readiness types/functions from barrel', async () => {
1056
+ const { readFileSync } = await import('node:fs');
1057
+ const { resolve } = await import('node:path');
1058
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
1059
+ expect(src).toContain('DeprecatedReadinessStatus');
1060
+ expect(src).toContain('DeprecatedReadinessAssessment');
1061
+ expect(src).toContain('assessDeprecatedReadiness');
1062
+ });
1063
+ it('deprecated-readiness.ts has zero infrastructure imports', async () => {
1064
+ const { readFileSync } = await import('node:fs');
1065
+ const { resolve } = await import('node:path');
1066
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'deprecated-readiness.ts'), 'utf-8');
1067
+ expect(src).not.toContain('node:fs');
1068
+ expect(src).not.toContain('node:path');
1069
+ expect(src).not.toContain('openclaw-plugin');
1070
+ });
1071
+ it('plugin principle-lifecycle-service.ts imports deprecated readiness from core barrel', async () => {
1072
+ const { readFileSync } = await import('node:fs');
1073
+ const { resolve } = await import('node:path');
1074
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/core/principle-internalization/principle-lifecycle-service.ts'), 'utf-8');
1075
+ expect(src).toContain("from '@principles/core/runtime-v2'");
1076
+ expect(src).toContain('assessDeprecatedReadiness');
1077
+ expect(src).toContain('DeprecatedReadinessAssessment');
1078
+ });
1079
+ });
1080
+ // ── PRI-54: Routing policy extraction ──────────────────────────────────────────
1081
+ describe('PRI-54 routing policy', () => {
1082
+ it('core exports all routing policy types/functions from barrel', async () => {
1083
+ const { readFileSync } = await import('node:fs');
1084
+ const { resolve } = await import('node:path');
1085
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
1086
+ expect(src).toContain('LifecycleRoute');
1087
+ expect(src).toContain('LifecycleRouteRecommendation');
1088
+ expect(src).toContain('LifecycleRouteEvidenceSummary');
1089
+ expect(src).toContain('recommendLifecycleRoute');
1090
+ });
1091
+ it('routing-policy.ts has zero infrastructure imports', async () => {
1092
+ const { readFileSync } = await import('node:fs');
1093
+ const { resolve } = await import('node:path');
1094
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'routing-policy.ts'), 'utf-8');
1095
+ expect(src).not.toContain('node:fs');
1096
+ expect(src).not.toContain('node:path');
1097
+ expect(src).not.toContain('openclaw-plugin');
1098
+ });
1099
+ it('plugin principle-lifecycle-service.ts imports routing policy from core barrel', async () => {
1100
+ const { readFileSync } = await import('node:fs');
1101
+ const { resolve } = await import('node:path');
1102
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/core/principle-internalization/principle-lifecycle-service.ts'), 'utf-8');
1103
+ expect(src).toContain("from '@principles/core/runtime-v2'");
1104
+ expect(src).toContain('recommendLifecycleRoute');
1105
+ expect(src).toContain('LifecycleRouteRecommendation');
1106
+ });
1107
+ });
1108
+ // ── PRI-56: LifecycleDatasource adapter boundary ──────────────────────────────
1109
+ describe('PRI-56 LifecycleDatasource adapter boundary', () => {
1110
+ it('core exports LifecycleDatasource + buildLifecycleReadModel from barrel', async () => {
1111
+ const { readFileSync } = await import('node:fs');
1112
+ const { resolve } = await import('node:path');
1113
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
1114
+ expect(src).toContain('LifecycleDatasource');
1115
+ expect(src).toContain('buildLifecycleReadModel');
1116
+ });
1117
+ it('lifecycle-datasource.ts has zero infrastructure imports', async () => {
1118
+ const { readFileSync } = await import('node:fs');
1119
+ const { resolve } = await import('node:path');
1120
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'lifecycle-datasource.ts'), 'utf-8');
1121
+ expect(src).not.toContain('node:fs');
1122
+ expect(src).not.toContain('node:path');
1123
+ expect(src).not.toContain('openclaw-plugin');
1124
+ });
1125
+ it('lifecycle-read-model.ts has zero infrastructure imports', async () => {
1126
+ const { readFileSync } = await import('node:fs');
1127
+ const { resolve } = await import('node:path');
1128
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'lifecycle-read-model.ts'), 'utf-8');
1129
+ expect(src).not.toContain('node:fs');
1130
+ expect(src).not.toContain('node:path');
1131
+ expect(src).not.toContain('openclaw-plugin');
1132
+ });
1133
+ it('plugin lifecycle-read-model.ts re-exports from core and provides FilesystemLifecycleDatasource', async () => {
1134
+ const { readFileSync } = await import('node:fs');
1135
+ const { resolve } = await import('node:path');
1136
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/core/principle-internalization/lifecycle-read-model.ts'), 'utf-8');
1137
+ expect(src).toContain("from '@principles/core/runtime-v2'");
1138
+ expect(src).toContain('buildLifecycleReadModel');
1139
+ expect(src).toContain('FilesystemLifecycleDatasource');
1140
+ });
1141
+ it('plugin principle-lifecycle-service.ts delegates buildReadModel via datasource', async () => {
1142
+ const { readFileSync } = await import('node:fs');
1143
+ const { resolve } = await import('node:path');
1144
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/core/principle-internalization/principle-lifecycle-service.ts'), 'utf-8');
1145
+ expect(src).toContain('FilesystemLifecycleDatasource');
1146
+ expect(src).toContain('buildLifecycleReadModel');
1147
+ });
1148
+ });
1149
+ // ── PRI-61: Internalization Peer Runner Contracts ─────────────────────────────
1150
+ describe('PRI-61 Internalization Peer Runner Contracts', () => {
1151
+ it('core barrel exports PITaskRecord and related types', async () => {
1152
+ const { readFileSync } = await import('node:fs');
1153
+ const { resolve } = await import('node:path');
1154
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
1155
+ expect(src).toContain('PITaskRecord');
1156
+ expect(src).toContain('PeerRunnerKind');
1157
+ expect(src).toContain('InternalizationChannel');
1158
+ expect(src).toContain('PIArtifact');
1159
+ });
1160
+ it('core barrel exports job graph functions', async () => {
1161
+ const { readFileSync } = await import('node:fs');
1162
+ const { resolve } = await import('node:path');
1163
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
1164
+ expect(src).toContain('validateEdge');
1165
+ expect(src).toContain('isAcyclic');
1166
+ expect(src).toContain('getAllowedSuccessors');
1167
+ expect(src).toContain('ALLOWED_EDGES');
1168
+ });
1169
+ it('peer-runner-contracts.ts has zero infrastructure imports', async () => {
1170
+ const { readFileSync } = await import('node:fs');
1171
+ const { resolve } = await import('node:path');
1172
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'peer-runner-contracts.ts'), 'utf-8');
1173
+ expect(src).not.toContain('node:fs');
1174
+ expect(src).not.toContain('node:path');
1175
+ expect(src).not.toContain('openclaw-plugin');
1176
+ expect(src).not.toContain('node:cron');
1177
+ });
1178
+ it('internalization-job-graph.ts has zero infrastructure imports', async () => {
1179
+ const { readFileSync } = await import('node:fs');
1180
+ const { resolve } = await import('node:path');
1181
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'internalization-job-graph.ts'), 'utf-8');
1182
+ expect(src).not.toContain('node:fs');
1183
+ expect(src).not.toContain('node:path');
1184
+ expect(src).not.toContain('openclaw-plugin');
1185
+ expect(src).not.toContain('node:cron');
1186
+ });
1187
+ it('TASK_MODEL_REUSE: PITaskRecord extends TaskRecord (type-level check)', async () => {
1188
+ // PITaskRecord is an interface (type-only export). Type-level check:
1189
+ // if PITaskRecord didn't extend TaskRecord, TypeScript would error in the
1190
+ // peer-runner-contracts.ts definition at compile time.
1191
+ // We verify the module exports the type by checking the source file.
1192
+ const { readFileSync } = await import('node:fs');
1193
+ const { resolve } = await import('node:path');
1194
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'peer-runner-contracts.ts'), 'utf-8');
1195
+ // If PITaskRecord doesn't extend TaskRecord, this interface definition would fail
1196
+ expect(src).toContain('interface PITaskRecord extends TaskRecord');
1197
+ });
1198
+ it('PEER_NO_DIRECT_CHAINING: job graph defines edge validation only, no execution', async () => {
1199
+ const { validateEdge, ALLOWED_EDGES } = await import('../internalization/internalization-job-graph.js');
1200
+ // validateEdge is a pure function — no side effects, no execution
1201
+ expect(typeof validateEdge).toBe('function');
1202
+ expect(Array.isArray(ALLOWED_EDGES)).toBe(true);
1203
+ // Edge validation is read-only — no task creation or state mutation
1204
+ const result = validateEdge('dreamer', 'philosopher');
1205
+ expect(typeof result).toBe('boolean');
1206
+ });
1207
+ });
1208
+ // ── PRI-62: Internalization State Machine Guards ─────────────────────────────
1209
+ describe('PRI-62 Internalization State Machine Guards', () => {
1210
+ it('core barrel exports state machine guard functions', async () => {
1211
+ const { readFileSync } = await import('node:fs');
1212
+ const { resolve } = await import('node:path');
1213
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
1214
+ expect(src).toContain('validateInternalizationTaskReady');
1215
+ expect(src).toContain('validateTaskTransition');
1216
+ expect(src).toContain('decideArtifactRejectionFeedback');
1217
+ expect(src).toContain('createNextTaskProposal');
1218
+ expect(src).toContain('validateInternalizationGraph');
1219
+ });
1220
+ it('core barrel exports guard utility functions', async () => {
1221
+ const { readFileSync } = await import('node:fs');
1222
+ const { resolve } = await import('node:path');
1223
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
1224
+ expect(src).toContain('canAcquireLease');
1225
+ expect(src).toContain('areDependenciesMet');
1226
+ expect(src).toContain('canTransitionTo');
1227
+ expect(src).toContain('isResultRefImmutable');
1228
+ expect(src).toContain('canUpdateLastError');
1229
+ expect(src).toContain('isArtifactRejected');
1230
+ });
1231
+ it('internalization-task-guards.ts has zero infrastructure imports', async () => {
1232
+ const { readFileSync } = await import('node:fs');
1233
+ const { resolve } = await import('node:path');
1234
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'internalization-task-guards.ts'), 'utf-8');
1235
+ expect(src).not.toContain('node:fs');
1236
+ expect(src).not.toContain('node:path');
1237
+ expect(src).not.toContain('openclaw-plugin');
1238
+ expect(src).not.toContain('node:cron');
1239
+ });
1240
+ it('internalization-state-machine.ts has zero infrastructure imports', async () => {
1241
+ const { readFileSync } = await import('node:fs');
1242
+ const { resolve } = await import('node:path');
1243
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'internalization-state-machine.ts'), 'utf-8');
1244
+ expect(src).not.toContain('node:fs');
1245
+ expect(src).not.toContain('node:path');
1246
+ expect(src).not.toContain('openclaw-plugin');
1247
+ expect(src).not.toContain('node:cron');
1248
+ });
1249
+ it('TASK_MODEL_REUSE: guard functions work with PITaskRecord (type-level check)', async () => {
1250
+ // If PITaskRecord didn't properly extend TaskRecord, TypeScript would error
1251
+ // at compile time in peer-runner-contracts.ts and internalization-task-guards.ts
1252
+ const { readFileSync } = await import('node:fs');
1253
+ const { resolve } = await import('node:path');
1254
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'internalization-task-guards.ts'), 'utf-8');
1255
+ expect(src).toContain('task: PITaskRecord');
1256
+ });
1257
+ it('PEER_NO_DIRECT_CHAINING: state machine returns proposals, not execute calls', async () => {
1258
+ const { createNextTaskProposal } = await import('../internalization/internalization-state-machine.js');
1259
+ // Pure function — returns an object, no side effects
1260
+ const { createMinimalPITaskRecord } = await import('../internalization/peer-runner-contracts.js');
1261
+ const task = createMinimalPITaskRecord('t1', 'dreamer', 'prompt');
1262
+ task.status = 'succeeded';
1263
+ task.outputArtifactRefs = [];
1264
+ const result = createNextTaskProposal(task, []);
1265
+ expect(result === null || typeof result === 'object').toBe(true);
1266
+ });
1267
+ });
1268
+ // ── PRI-63: Internalization Dumb Trigger Adapter ─────────────────────────────
1269
+ describe('PRI-63 Internalization Dumb Trigger Adapter', () => {
1270
+ const PRI63_REQUIRED_FILES = [
1271
+ 'internalization-trigger-adapter.ts',
1272
+ ];
1273
+ it('adapter source file exists in plugin service directory', async () => {
1274
+ const { existsSync } = await import('node:fs');
1275
+ const { resolve } = await import('node:path');
1276
+ const pluginRoot = resolve(__dirname, '..', '..', '..', '..', 'openclaw-plugin', 'src', 'service');
1277
+ for (const file of PRI63_REQUIRED_FILES) {
1278
+ expect(existsSync(resolve(pluginRoot, file))).toBe(true);
1279
+ }
1280
+ });
1281
+ it('adapter does not import nocturnal-trinity', async () => {
1282
+ const { readFileSync } = await import('node:fs');
1283
+ const { resolve } = await import('node:path');
1284
+ const src = readFileSync(resolve(__dirname, '..', '..', '..', '..', 'openclaw-plugin', 'src', 'service', 'internalization-trigger-adapter.ts'), 'utf-8');
1285
+ expect(src).not.toContain('nocturnal-trinity');
1286
+ });
1287
+ it('adapter does not import runTrinity or runTrinityAsync', async () => {
1288
+ const { readFileSync } = await import('node:fs');
1289
+ const { resolve } = await import('node:path');
1290
+ const src = readFileSync(resolve(__dirname, '..', '..', '..', '..', 'openclaw-plugin', 'src', 'service', 'internalization-trigger-adapter.ts'), 'utf-8');
1291
+ expect(src).not.toContain('runTrinity');
1292
+ expect(src).not.toContain('runTrinityAsync');
1293
+ });
1294
+ it('adapter does not import Dreamer/Philosopher/Scribe executors', async () => {
1295
+ const { readFileSync } = await import('node:fs');
1296
+ const { resolve } = await import('node:path');
1297
+ const src = readFileSync(resolve(__dirname, '..', '..', '..', '..', 'openclaw-plugin', 'src', 'service', 'internalization-trigger-adapter.ts'), 'utf-8');
1298
+ expect(src).not.toContain("from 'dreamer'");
1299
+ expect(src).not.toContain("from 'philosopher'");
1300
+ expect(src).not.toContain("from 'scribe'");
1301
+ });
1302
+ it('adapter does not use PDRuntimeAdapter', async () => {
1303
+ const { readFileSync } = await import('node:fs');
1304
+ const { resolve } = await import('node:path');
1305
+ const src = readFileSync(resolve(__dirname, '..', '..', '..', '..', 'openclaw-plugin', 'src', 'service', 'internalization-trigger-adapter.ts'), 'utf-8');
1306
+ expect(src).not.toContain('PDRuntimeAdapter');
1307
+ });
1308
+ it('adapter imports TaskRecord from @principles/core/runtime-v2', async () => {
1309
+ const { readFileSync } = await import('node:fs');
1310
+ const { resolve } = await import('node:path');
1311
+ const src = readFileSync(resolve(__dirname, '..', '..', '..', '..', 'openclaw-plugin', 'src', 'service', 'internalization-trigger-adapter.ts'), 'utf-8');
1312
+ expect(src).toContain('TaskRecord');
1313
+ expect(src).toContain('@principles/core/runtime-v2');
1314
+ });
1315
+ it('PLUGIN_NO_INLINE_EXECUTION: adapter does not call mutating store methods (read-only probe)', async () => {
1316
+ const { readFileSync } = await import('node:fs');
1317
+ const { resolve } = await import('node:path');
1318
+ const src = readFileSync(resolve(__dirname, '..', '..', '..', '..', 'openclaw-plugin', 'src', 'service', 'internalization-trigger-adapter.ts'), 'utf-8');
1319
+ // wake() should only read, not update/create/delete tasks
1320
+ expect(src).not.toContain('updateTask');
1321
+ expect(src).not.toContain('createTask');
1322
+ expect(src).not.toContain('deleteTask');
1323
+ expect(src).not.toContain('leaseTask');
1324
+ });
1325
+ it('PLUGIN_NO_INLINE_EXECUTION: adapter does not use setInterval/setTimeout for scheduling (core responsibility)', async () => {
1326
+ const { readFileSync } = await import('node:fs');
1327
+ const { resolve } = await import('node:path');
1328
+ const src = readFileSync(resolve(__dirname, '..', '..', '..', '..', 'openclaw-plugin', 'src', 'service', 'internalization-trigger-adapter.ts'), 'utf-8');
1329
+ // setInterval is used in start() to trigger wake() periodically — this is plugin responsibility
1330
+ // Core state machine should NOT use setInterval (CORE_NO_SCHEDULING)
1331
+ expect(src).not.toContain('node:cron');
1332
+ });
1333
+ });
1334
+ describe('PRI-68 InternalizationOrchestrator', () => {
1335
+ it('orchestrator source file exists in internalization directory', async () => {
1336
+ const { existsSync } = await import('node:fs');
1337
+ const { resolve } = await import('node:path');
1338
+ expect(existsSync(resolve(__dirname, '..', 'internalization', 'internalization-orchestrator.ts'))).toBe(true);
1339
+ });
1340
+ it('orchestrator test file exists', async () => {
1341
+ const { existsSync } = await import('node:fs');
1342
+ const { resolve } = await import('node:path');
1343
+ expect(existsSync(resolve(__dirname, '..', '__tests__', 'internalization-orchestrator.test.ts'))).toBe(true);
1344
+ });
1345
+ it('CORE_NO_SCHEDULING: orchestrator has zero infrastructure imports', async () => {
1346
+ const { readFileSync } = await import('node:fs');
1347
+ const { resolve } = await import('node:path');
1348
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'internalization-orchestrator.ts'), 'utf-8');
1349
+ expect(src).not.toContain('openclaw-plugin');
1350
+ expect(src).not.toContain('node:cron');
1351
+ expect(src).not.toContain('setInterval');
1352
+ expect(src).not.toContain('setTimeout');
1353
+ expect(src).not.toContain('node:fs');
1354
+ expect(src).not.toContain('node:path');
1355
+ });
1356
+ it('CORE_NO_RUNTIME_ADAPTER: orchestrator does not import PDRuntimeAdapter or startRun', async () => {
1357
+ const { readFileSync } = await import('node:fs');
1358
+ const { resolve } = await import('node:path');
1359
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'internalization-orchestrator.ts'), 'utf-8');
1360
+ expect(src).not.toContain('PDRuntimeAdapter');
1361
+ expect(src).not.toContain('startRun');
1362
+ expect(src).not.toContain('DiagnosticianRunner');
1363
+ });
1364
+ it('BARREL_EXPORTS: internalization/index.ts exports InternalizationOrchestrator and result types', async () => {
1365
+ const { readFileSync } = await import('node:fs');
1366
+ const { resolve } = await import('node:path');
1367
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
1368
+ expect(src).toContain('InternalizationOrchestrator');
1369
+ expect(src).toContain('WakeOnceResult');
1370
+ expect(src).toContain('LeaseConflictResult');
1371
+ });
1372
+ });
1373
+ describe('PRI-67 DreamerRunner', () => {
1374
+ it('dreamer source files exist in internalization directory', async () => {
1375
+ const { existsSync } = await import('node:fs');
1376
+ const { resolve } = await import('node:path');
1377
+ expect(existsSync(resolve(__dirname, '..', 'internalization', 'dreamer-runner.ts'))).toBe(true);
1378
+ expect(existsSync(resolve(__dirname, '..', 'internalization', 'dreamer-output.ts'))).toBe(true);
1379
+ });
1380
+ it('dreamer test file exists', async () => {
1381
+ const { existsSync } = await import('node:fs');
1382
+ const { resolve } = await import('node:path');
1383
+ expect(existsSync(resolve(__dirname, '..', '__tests__', 'dreamer-runner.test.ts'))).toBe(true);
1384
+ });
1385
+ it('CORE_NO_FORBIDDEN_IMPORTS: dreamer-runner.ts has no openclaw-plugin, nocturnal-trinity, philosopher, scribe imports', async () => {
1386
+ const { readFileSync } = await import('node:fs');
1387
+ const { resolve } = await import('node:path');
1388
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'dreamer-runner.ts'), 'utf-8');
1389
+ expect(src).not.toContain('openclaw-plugin');
1390
+ expect(src).not.toContain('nocturnal-trinity');
1391
+ expect(src).not.toContain('runTrinity');
1392
+ expect(src).not.toContain('philosopher');
1393
+ expect(src).not.toContain('scribe');
1394
+ expect(src).not.toContain('InternalizationOrchestrator');
1395
+ expect(src).not.toContain('createTask');
1396
+ expect(src).not.toContain('enqueueTask');
1397
+ });
1398
+ it('CORE_NO_SCHEDULING: dreamer-runner.ts has no node:fs, node:cron, or cron-style scheduling', async () => {
1399
+ const { readFileSync } = await import('node:fs');
1400
+ const { resolve } = await import('node:path');
1401
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'dreamer-runner.ts'), 'utf-8');
1402
+ expect(src).not.toContain('node:fs');
1403
+ expect(src).not.toContain('node:cron');
1404
+ // setTimeout for sleep() in polling loop is allowed — no cron/interval scheduling
1405
+ });
1406
+ it('USES_RUNTIME_ADAPTER: dreamer-runner.ts imports and uses PDRuntimeAdapter', async () => {
1407
+ const { readFileSync } = await import('node:fs');
1408
+ const { resolve } = await import('node:path');
1409
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'dreamer-runner.ts'), 'utf-8');
1410
+ expect(src).toContain('PDRuntimeAdapter');
1411
+ expect(src).toContain('startRun');
1412
+ });
1413
+ it('BARREL_EXPORTS: internalization/index.ts exports DreamerRunner and DreamerOutput', async () => {
1414
+ const { readFileSync } = await import('node:fs');
1415
+ const { resolve } = await import('node:path');
1416
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'index.ts'), 'utf-8');
1417
+ expect(src).toContain('DreamerRunner');
1418
+ expect(src).toContain('DreamerOutput');
1419
+ expect(src).toContain('PassThroughDreamerValidator');
1420
+ expect(src).toContain('DefaultDreamerValidator');
1421
+ });
1422
+ });
1423
+ // ── PRI-87: DefaultDreamerValidator strict validation ───────────────────────────
1424
+ describe('PRI-87 DefaultDreamerValidator strict validation', () => {
1425
+ it('CORE_NO_FORBIDDEN_IMPORTS: dreamer-output.ts has no openclaw-plugin, nocturnal, fs, path, process imports', async () => {
1426
+ const { readFileSync } = await import('node:fs');
1427
+ const { resolve } = await import('node:path');
1428
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'dreamer-output.ts'), 'utf-8');
1429
+ expect(src).not.toContain('openclaw-plugin');
1430
+ expect(src).not.toContain('nocturnal');
1431
+ expect(src).not.toContain('node:fs');
1432
+ expect(src).not.toContain('node:path');
1433
+ expect(src).not.toContain('node:process');
1434
+ });
1435
+ it('PRODUCTION_USES_STRICT_VALIDATOR: run-once CLI uses DefaultDreamerValidator, not PassThroughDreamerValidator', async () => {
1436
+ const { readFileSync } = await import('node:fs');
1437
+ const { resolve } = await import('node:path');
1438
+ const src = readFileSync(resolve(__dirname, '..', '..', '..', '..', 'pd-cli', 'src', 'commands', 'runtime-internalization-run-once.ts'), 'utf-8');
1439
+ expect(src).toContain('DefaultDreamerValidator');
1440
+ expect(src).not.toContain('new PassThroughDreamerValidator()');
1441
+ });
1442
+ it('BARREL_EXPORTS: DefaultDreamerValidator is exported from internalization/index.ts', async () => {
1443
+ const { readFileSync } = await import('node:fs');
1444
+ const { resolve } = await import('node:path');
1445
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'index.ts'), 'utf-8');
1446
+ expect(src).toContain('DefaultDreamerValidator');
1447
+ });
1448
+ it('validator test file exists', async () => {
1449
+ const { existsSync } = await import('node:fs');
1450
+ const { resolve } = await import('node:path');
1451
+ expect(existsSync(resolve(__dirname, '..', '__tests__', 'dreamer-output-validator.test.ts'))).toBe(true);
1452
+ });
1453
+ });
1454
+ // ── PRI-75/PRI-74/PRI-81: Prompt-builder core boundary ─────────────────────────────────
1455
+ describe('PRI-75/PRI-74/PRI-81 prompt-builder core boundary', () => {
1456
+ const files = [
1457
+ 'prompt-builder/index.ts',
1458
+ 'prompt-builder/attitude-directive.ts',
1459
+ 'prompt-builder/correction-cue.ts',
1460
+ 'prompt-builder/message-extraction.ts',
1461
+ 'prompt-builder/minimal-trigger.ts',
1462
+ 'prompt-builder/size-guard.ts',
1463
+ 'prompt-builder/types.ts',
1464
+ 'prompt-builder/principle-selection.ts',
1465
+ // PRI-74
1466
+ 'prompt-builder/routing-guidance.ts',
1467
+ // PRI-81 Phase A
1468
+ 'prompt-builder/empathy-keyword-matching.ts',
1469
+ 'prompt-builder/empathy-types.ts',
1470
+ // PRI-81 Phase B
1471
+ 'prompt-builder/focus-compression.ts',
1472
+ ];
1473
+ for (const file of files) {
1474
+ it(`${file} has zero infrastructure imports`, async () => {
1475
+ const { readFileSync } = await import('node:fs');
1476
+ const { resolve } = await import('node:path');
1477
+ const src = readFileSync(resolve(__dirname, '../..', file), 'utf-8');
1478
+ expect(src).not.toContain('node:fs');
1479
+ expect(src).not.toContain('node:path');
1480
+ expect(src).not.toContain('node:process');
1481
+ expect(src).not.toContain('openclaw-plugin');
1482
+ });
1483
+ }
1484
+ it('prompt-builder/index.ts exports all functions', async () => {
1485
+ const { readFileSync } = await import('node:fs');
1486
+ const { resolve } = await import('node:path');
1487
+ const src = readFileSync(resolve(__dirname, '../..', 'prompt-builder/index.ts'), 'utf-8');
1488
+ // Phase 1
1489
+ expect(src).toContain('buildAttitudeDirective');
1490
+ expect(src).toContain('detectCorrectionCue');
1491
+ expect(src).toContain('extractMessageContent');
1492
+ expect(src).toContain('isMinimalTrigger');
1493
+ expect(src).toContain('truncateInjectionToBudget');
1494
+ // Phase 2
1495
+ expect(src).toContain('formatPrinciple');
1496
+ expect(src).toContain('selectPrinciplesForInjection');
1497
+ expect(src).toContain('DEFAULT_PRINCIPLE_BUDGET');
1498
+ // PRI-74 routing guidance
1499
+ expect(src).toContain('classifyTaskKind');
1500
+ expect(src).toContain('buildReason');
1501
+ expect(src).toContain('buildBlockers');
1502
+ expect(src).toContain('computeCombinedText');
1503
+ expect(src).toContain('containsKeyword');
1504
+ // PRI-81 Phase A: empathy keyword matching
1505
+ expect(src).toContain('matchEmpathyKeywords');
1506
+ expect(src).toContain('createDefaultKeywordStore');
1507
+ expect(src).toContain('applyKeywordUpdates');
1508
+ expect(src).toContain('shouldTriggerOptimization');
1509
+ expect(src).toContain('getKeywordStoreSummary');
1510
+ expect(src).toContain('EMPATHY_SEED_KEYWORDS');
1511
+ expect(src).toContain('DEFAULT_EMPATHY_KEYWORD_CONFIG');
1512
+ expect(src).toContain('scoreToSeverity');
1513
+ expect(src).toContain('severityToPenalty');
1514
+ expect(src).toContain('normalizeSeverity');
1515
+ // PRI-81 Phase B: focus compression
1516
+ expect(src).toContain('extractVersion');
1517
+ expect(src).toContain('extractDate');
1518
+ expect(src).toContain('extractSummary');
1519
+ expect(src).toContain('parseWorkingMemorySection');
1520
+ expect(src).toContain('workingMemoryToInjection');
1521
+ expect(src).toContain('extractMilestones');
1522
+ expect(src).toContain('validateCurrentFocus');
1523
+ expect(src).toContain('mergeWorkingMemory');
1524
+ expect(src).toContain('compressFocusContent');
1525
+ expect(src).toContain('DEFAULT_FOCUS_COMPRESSION_OPTIONS');
1526
+ });
1527
+ it('principle-selection.ts does not import EvolutionReducer or WorkspaceContext', async () => {
1528
+ const { readFileSync } = await import('node:fs');
1529
+ const { resolve } = await import('node:path');
1530
+ const src = readFileSync(resolve(__dirname, '../..', 'prompt-builder/principle-selection.ts'), 'utf-8');
1531
+ expect(src).not.toContain('EvolutionReducer');
1532
+ expect(src).not.toContain('WorkspaceContext');
1533
+ });
1534
+ it('plugin principle-injection.ts is a thin re-export of core', async () => {
1535
+ const { readFileSync } = await import('node:fs');
1536
+ const { resolve } = await import('node:path');
1537
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/core/principle-injection.ts'), 'utf-8');
1538
+ // Must re-export from core
1539
+ expect(src).toContain('@principles/core/prompt-builder');
1540
+ // Must NOT contain inline selectPrinciplesForInjection implementation
1541
+ expect(src).not.toMatch(/function selectPrinciplesForInjection/i);
1542
+ // Must NOT contain priority sorting logic
1543
+ expect(src).not.toMatch(/PRIORITY_ORDER/i);
1544
+ });
1545
+ it('plugin prompt.ts imports from @principles/core/prompt-builder', async () => {
1546
+ const { readFileSync } = await import('node:fs');
1547
+ const { resolve } = await import('node:path');
1548
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/hooks/prompt.ts'), 'utf-8');
1549
+ expect(src).toContain('@principles/core/prompt-builder');
1550
+ });
1551
+ it('plugin prompt.ts uses core truncateInjectionToBudget, not inline priority stripping', async () => {
1552
+ const { readFileSync } = await import('node:fs');
1553
+ const { resolve } = await import('node:path');
1554
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/hooks/prompt.ts'), 'utf-8');
1555
+ // Must call the core function
1556
+ expect(src).toMatch(/truncateInjectionToBudget\s*\(/);
1557
+ // Must NOT have inline priority stripping comment markers (old step comments)
1558
+ expect(src).not.toMatch(/\/\/ Step \d+.*strip (project_context|thinking_os|evolution_principles|reflection_log)/i);
1559
+ // Must NOT have inline regex-based fallback context block (the strip-by-regex pattern)
1560
+ expect(src).not.toMatch(/<reflection_log>\[\\s\\S\]\*?<\/reflection_log>/);
1561
+ // Must NOT have the old multi-line fallback block with attitudeDirective interpolation
1562
+ expect(src).not.toMatch(/## 【CONTEXT SECTIONS】\n\n\[WARNING: Context sections stripped/);
1563
+ });
1564
+ it('plugin empathy-keyword-matcher.ts is a thin adapter (re-exports from core)', async () => {
1565
+ const { readFileSync } = await import('node:fs');
1566
+ const { resolve } = await import('node:path');
1567
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/core/empathy-keyword-matcher.ts'), 'utf-8');
1568
+ expect(src).toContain('@principles/core/prompt-builder');
1569
+ expect(src).not.toMatch(/function matchEmpathyKeywords\s*\(/);
1570
+ expect(src).not.toMatch(/function createDefaultKeywordStore\s*\(/);
1571
+ expect(src).not.toMatch(/function applyKeywordUpdates\s*\(/);
1572
+ expect(src).not.toMatch(/function shouldTriggerOptimization\s*\(/);
1573
+ expect(src).not.toMatch(/function getKeywordStoreSummary\s*\(/);
1574
+ });
1575
+ it('plugin empathy-types.ts is a thin re-export (no inline definitions)', async () => {
1576
+ const { readFileSync } = await import('node:fs');
1577
+ const { resolve } = await import('node:path');
1578
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/core/empathy-types.ts'), 'utf-8');
1579
+ expect(src).toContain('@principles/core/prompt-builder');
1580
+ expect(src).not.toMatch(/interface EmpathyKeywordStore/);
1581
+ expect(src).not.toMatch(/const EMPATHY_SEED_KEYWORDS/);
1582
+ expect(src).not.toMatch(/function scoreToSeverity/);
1583
+ });
1584
+ it('plugin focus-history.ts delegates pure functions to core', async () => {
1585
+ const { readFileSync } = await import('node:fs');
1586
+ const { resolve } = await import('node:path');
1587
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/core/focus-history.ts'), 'utf-8');
1588
+ expect(src).toContain('@principles/core/prompt-builder');
1589
+ expect(src).not.toMatch(/function extractSummary\s*\(/);
1590
+ expect(src).not.toMatch(/function parseWorkingMemorySection\s*\(/);
1591
+ expect(src).not.toMatch(/function workingMemoryToInjection\s*\(/);
1592
+ expect(src).not.toMatch(/function extractMilestones\s*\(/);
1593
+ expect(src).not.toMatch(/function validateCurrentFocus\s*\(/);
1594
+ expect(src).not.toMatch(/function mergeWorkingMemory\s*\(/);
1595
+ });
1596
+ });
1597
+ // ── PRI-74: Routing guidance thin-adapter boundary ───────────────────────────
1598
+ describe('PRI-74 routing guidance thin-adapter boundary', () => {
1599
+ it('prompt-builder/routing-guidance.ts has zero infrastructure imports', async () => {
1600
+ const { readFileSync } = await import('node:fs');
1601
+ const { resolve } = await import('node:path');
1602
+ const src = readFileSync(resolve(__dirname, '../..', 'prompt-builder/routing-guidance.ts'), 'utf-8');
1603
+ expect(src).not.toContain('node:fs');
1604
+ expect(src).not.toContain('node:path');
1605
+ expect(src).not.toContain('node:process');
1606
+ expect(src).not.toContain('openclaw-plugin');
1607
+ });
1608
+ it('plugin local-worker-routing.ts imports classifyTaskKind/buildReason/buildBlockers from core', async () => {
1609
+ const { readFileSync } = await import('node:fs');
1610
+ const { resolve } = await import('node:path');
1611
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/core/local-worker-routing.ts'), 'utf-8');
1612
+ expect(src).toContain('@principles/core/prompt-builder');
1613
+ expect(src).toContain('classifyTaskKind');
1614
+ expect(src).toContain('buildReason');
1615
+ expect(src).toContain('buildBlockers');
1616
+ });
1617
+ it('plugin local-worker-routing.ts does NOT have inline keyword arrays or classifyTaskKind implementation', async () => {
1618
+ const { readFileSync } = await import('node:fs');
1619
+ const { resolve } = await import('node:path');
1620
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/core/local-worker-routing.ts'), 'utf-8');
1621
+ // Must NOT re-define the keyword constants locally
1622
+ expect(src).not.toMatch(/READER_KEYWORDS\s*=/);
1623
+ expect(src).not.toMatch(/EDITOR_KEYWORDS\s*=/);
1624
+ expect(src).not.toMatch(/HIGH_ENTROPY_KEYWORDS\s*=/);
1625
+ // Must NOT have inline classifyTaskKind function body
1626
+ expect(src).not.toMatch(/export\s+function\s+classifyTaskKind/);
1627
+ // Must delegate to coreClassifyTaskKind
1628
+ expect(src).toContain('coreClassifyTaskKind');
1629
+ expect(src).toContain('coreBuildReason');
1630
+ expect(src).toContain('coreBuildBlockers');
1631
+ });
1632
+ });
1633
+ // ── PRI-76: GFI core kernel boundary ───────────────────────────────────────
1634
+ describe('PRI-76 GFI core kernel boundary', () => {
1635
+ const gfiFiles = [
1636
+ 'gfi/gfi-types.ts',
1637
+ 'gfi/gfi-policy.ts',
1638
+ 'gfi/gfi-kernel.ts',
1639
+ 'gfi/gfi-read-model.ts',
1640
+ 'gfi/index.ts',
1641
+ ];
1642
+ for (const file of gfiFiles) {
1643
+ it(`${file} has zero infrastructure imports`, async () => {
1644
+ const { readFileSync } = await import('node:fs');
1645
+ const { resolve } = await import('node:path');
1646
+ const src = readFileSync(resolve(__dirname, '..', file), 'utf-8');
1647
+ expect(src).not.toContain('node:fs');
1648
+ expect(src).not.toContain('node:path');
1649
+ expect(src).not.toContain('node:process');
1650
+ expect(src).not.toContain('openclaw-plugin');
1651
+ expect(src).not.toContain('node:crypto');
1652
+ expect(src).not.toContain('node:async_hooks');
1653
+ });
1654
+ }
1655
+ // PRI-82: gfi-kernel.ts must not call Date.now() — nowMs is injected by caller
1656
+ it('gfi-kernel.ts does not call Date.now()', async () => {
1657
+ const { readFileSync } = await import('node:fs');
1658
+ const { resolve } = await import('node:path');
1659
+ const src = readFileSync(resolve(__dirname, '..', 'gfi/gfi-kernel.ts'), 'utf-8');
1660
+ expect(src).not.toContain('Date.now()');
1661
+ });
1662
+ it('gfi/index.ts exports all public symbols', async () => {
1663
+ const { readFileSync } = await import('node:fs');
1664
+ const { resolve } = await import('node:path');
1665
+ const src = readFileSync(resolve(__dirname, '..', 'gfi/index.ts'), 'utf-8');
1666
+ expect(src).toContain('applyFriction');
1667
+ expect(src).toContain('applyDecay');
1668
+ expect(src).toContain('applyRelief');
1669
+ expect(src).toContain('classifyGfiStage');
1670
+ expect(src).toContain('createGfiSnapshot');
1671
+ expect(src).toContain('DEFAULT_GFI_POLICY');
1672
+ expect(src).toContain('GfiState');
1673
+ expect(src).toContain('GfiEvent');
1674
+ expect(src).toContain('GfiPolicy');
1675
+ expect(src).toContain('GfiStage');
1676
+ expect(src).toContain('GfiSource');
1677
+ expect(src).toContain('GfiSnapshot');
1678
+ expect(src).toContain('buildGfiWorkspaceSnapshot');
1679
+ expect(src).toContain('GfiReadModelInput');
1680
+ expect(src).toContain('GfiWorkspaceSnapshot');
1681
+ });
1682
+ });
1683
+ // ── PRI-78: GFI observability boundary ──────────────────────────────────────
1684
+ describe('PRI-78 GFI observability boundary', () => {
1685
+ it('gfi-read-model.ts has zero infrastructure imports', async () => {
1686
+ const { readFileSync } = await import('node:fs');
1687
+ const { resolve } = await import('node:path');
1688
+ const src = readFileSync(resolve(__dirname, '..', 'gfi/gfi-read-model.ts'), 'utf-8');
1689
+ expect(src).not.toContain('node:fs');
1690
+ expect(src).not.toContain('node:path');
1691
+ expect(src).not.toContain('node:process');
1692
+ expect(src).not.toContain('openclaw-plugin');
1693
+ });
1694
+ it('pd-cli runtime-gfi-snapshot.ts imports from @principles/core/runtime-v2', async () => {
1695
+ const { readFileSync } = await import('node:fs');
1696
+ const { resolve } = await import('node:path');
1697
+ const src = readFileSync(resolve(__dirname, '../../../../pd-cli/src/commands/runtime-gfi-snapshot.ts'), 'utf-8');
1698
+ expect(src).toContain("from '@principles/core/runtime-v2'");
1699
+ });
1700
+ });
1701
+ // ── PRI-111: ArtificerRunner boundary guards ──────────────────────────────────
1702
+ describe('PRI-111 ArtificerRunner boundary', () => {
1703
+ it('artificer source files exist in internalization directory', async () => {
1704
+ const { existsSync } = await import('node:fs');
1705
+ const { resolve } = await import('node:path');
1706
+ expect(existsSync(resolve(__dirname, '..', 'internalization', 'artificer-runner.ts'))).toBe(true);
1707
+ expect(existsSync(resolve(__dirname, '..', 'internalization', 'artificer-output.ts'))).toBe(true);
1708
+ });
1709
+ it('artificer test file exists', async () => {
1710
+ const { existsSync } = await import('node:fs');
1711
+ const { resolve } = await import('node:path');
1712
+ expect(existsSync(resolve(__dirname, 'artificer-runner-vslice.test.ts'))).toBe(true);
1713
+ });
1714
+ it('CORE_NO_FORBIDDEN_IMPORTS: artificer-runner.ts has no openclaw-plugin, evaluator, nocturnal-trinity imports', async () => {
1715
+ const { readFileSync } = await import('node:fs');
1716
+ const { resolve } = await import('node:path');
1717
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'artificer-runner.ts'), 'utf-8');
1718
+ expect(src).not.toContain('openclaw-plugin');
1719
+ expect(src).not.toContain('EvaluatorRunner');
1720
+ expect(src).not.toContain('nocturnal-trinity');
1721
+ expect(src).not.toContain('InternalizationOrchestrator');
1722
+ expect(src).not.toContain('createTask');
1723
+ expect(src).not.toContain('enqueueTask');
1724
+ });
1725
+ it('CORE_NO_FORBIDDEN_IMPORTS: artificer-output.ts has no openclaw-plugin, fs, path imports', async () => {
1726
+ const { readFileSync } = await import('node:fs');
1727
+ const { resolve } = await import('node:path');
1728
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'artificer-output.ts'), 'utf-8');
1729
+ expect(src).not.toContain('openclaw-plugin');
1730
+ expect(src).not.toContain('node:fs');
1731
+ expect(src).not.toContain('node:path');
1732
+ });
1733
+ it('CORE_NO_SCHEDULING: artificer-runner.ts has no node:fs, node:cron, or cron-style scheduling', async () => {
1734
+ const { readFileSync } = await import('node:fs');
1735
+ const { resolve } = await import('node:path');
1736
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'artificer-runner.ts'), 'utf-8');
1737
+ expect(src).not.toContain('node:fs');
1738
+ expect(src).not.toContain('node:cron');
1739
+ });
1740
+ it('BARREL_EXPORTS: internalization/index.ts exports ArtificerRunner and ArtificerOutput', async () => {
1741
+ const { readFileSync } = await import('node:fs');
1742
+ const { resolve } = await import('node:path');
1743
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'index.ts'), 'utf-8');
1744
+ expect(src).toContain('ArtificerRunner');
1745
+ expect(src).toContain('ArtificerOutput');
1746
+ expect(src).toContain('DefaultArtificerValidator');
1747
+ });
1748
+ it('SCHEMA_REGISTRY: pi-ai-runtime-adapter.ts registers artificer-output-v1 schema', async () => {
1749
+ const { readFileSync } = await import('node:fs');
1750
+ const { resolve } = await import('node:path');
1751
+ const src = readFileSync(resolve(__dirname, '..', 'adapter', 'pi-ai-runtime-adapter.ts'), 'utf-8');
1752
+ expect(src).toContain('artificer-output-v1');
1753
+ expect(src).toContain('ArtificerOutputV1Schema');
1754
+ });
1755
+ });
1756
+ // ── PRI-EVAL: EvaluatorRunner boundary guards ──────────────────────────────────
1757
+ describe('PRI-EVAL EvaluatorRunner boundary', () => {
1758
+ it('evaluator source files exist in internalization directory', async () => {
1759
+ const { existsSync } = await import('node:fs');
1760
+ const { resolve } = await import('node:path');
1761
+ expect(existsSync(resolve(__dirname, '..', 'internalization', 'evaluator-runner.ts'))).toBe(true);
1762
+ expect(existsSync(resolve(__dirname, '..', 'internalization', 'evaluator-output.ts'))).toBe(true);
1763
+ expect(existsSync(resolve(__dirname, '..', 'internalization', 'evaluator-prompt-builder.ts'))).toBe(true);
1764
+ });
1765
+ it('evaluator test file exists', async () => {
1766
+ const { existsSync } = await import('node:fs');
1767
+ const { resolve } = await import('node:path');
1768
+ expect(existsSync(resolve(__dirname, 'evaluator-runner-vslice.test.ts'))).toBe(true);
1769
+ });
1770
+ it('CORE_NO_FORBIDDEN_IMPORTS: evaluator-output.ts has no openclaw-plugin, fs, path imports', async () => {
1771
+ const { readFileSync } = await import('node:fs');
1772
+ const { resolve } = await import('node:path');
1773
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'evaluator-output.ts'), 'utf-8');
1774
+ expect(src).not.toContain('openclaw-plugin');
1775
+ expect(src).not.toContain('node:fs');
1776
+ expect(src).not.toContain('node:path');
1777
+ });
1778
+ it('CORE_NO_FORBIDDEN_IMPORTS: evaluator-runner.ts has no openclaw-plugin, RolloutReviewerRunner, nocturnal-trinity imports', async () => {
1779
+ const { readFileSync } = await import('node:fs');
1780
+ const { resolve } = await import('node:path');
1781
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'evaluator-runner.ts'), 'utf-8');
1782
+ expect(src).not.toContain('openclaw-plugin');
1783
+ expect(src).not.toContain('RolloutReviewerRunner');
1784
+ expect(src).not.toContain('nocturnal-trinity');
1785
+ expect(src).not.toContain('InternalizationOrchestrator');
1786
+ expect(src).not.toContain('createTask');
1787
+ expect(src).not.toContain('enqueueTask');
1788
+ });
1789
+ it('CORE_NO_SCHEDULING: evaluator-runner.ts has no node:fs, node:cron imports', async () => {
1790
+ const { readFileSync } = await import('node:fs');
1791
+ const { resolve } = await import('node:path');
1792
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'evaluator-runner.ts'), 'utf-8');
1793
+ expect(src).not.toContain('node:fs');
1794
+ expect(src).not.toContain('node:cron');
1795
+ });
1796
+ it('BARREL_EXPORTS: internalization/index.ts exports EvaluatorRunner and EvaluatorOutput', async () => {
1797
+ const { readFileSync } = await import('node:fs');
1798
+ const { resolve } = await import('node:path');
1799
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'index.ts'), 'utf-8');
1800
+ expect(src).toContain('EvaluatorRunner');
1801
+ expect(src).toContain('EvaluatorOutput');
1802
+ expect(src).toContain('DefaultEvaluatorValidator');
1803
+ });
1804
+ it('SCHEMA_REGISTRY: pi-ai-runtime-adapter.ts registers evaluator-output-v1 schema', async () => {
1805
+ const { readFileSync } = await import('node:fs');
1806
+ const { resolve } = await import('node:path');
1807
+ const src = readFileSync(resolve(__dirname, '..', 'adapter', 'pi-ai-runtime-adapter.ts'), 'utf-8');
1808
+ expect(src).toContain('evaluator-output-v1');
1809
+ expect(src).toContain('EvaluatorOutputV1Schema');
1810
+ });
1811
+ });
1812
+ // ── PRI-RR: RolloutReviewerRunner boundary guards ──────────────────────────────
1813
+ describe('PRI-RR RolloutReviewerRunner boundary', () => {
1814
+ it('rollout_reviewer source files exist in internalization directory', async () => {
1815
+ const { existsSync } = await import('node:fs');
1816
+ const { resolve } = await import('node:path');
1817
+ expect(existsSync(resolve(__dirname, '..', 'internalization', 'rollout-reviewer-runner.ts'))).toBe(true);
1818
+ expect(existsSync(resolve(__dirname, '..', 'internalization', 'rollout-reviewer-output.ts'))).toBe(true);
1819
+ expect(existsSync(resolve(__dirname, '..', 'internalization', 'rollout-reviewer-prompt-builder.ts'))).toBe(true);
1820
+ });
1821
+ it('rollout_reviewer test file exists', async () => {
1822
+ const { existsSync } = await import('node:fs');
1823
+ const { resolve } = await import('node:path');
1824
+ expect(existsSync(resolve(__dirname, 'rollout-reviewer-runner-vslice.test.ts'))).toBe(true);
1825
+ });
1826
+ it('CORE_NO_FORBIDDEN_IMPORTS: rollout-reviewer-output.ts has no openclaw-plugin, fs, path imports', async () => {
1827
+ const { readFileSync } = await import('node:fs');
1828
+ const { resolve } = await import('node:path');
1829
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'rollout-reviewer-output.ts'), 'utf-8');
1830
+ expect(src).not.toContain('openclaw-plugin');
1831
+ expect(src).not.toContain('node:fs');
1832
+ expect(src).not.toContain('node:path');
1833
+ });
1834
+ it('CORE_NO_FORBIDDEN_IMPORTS: rollout-reviewer-runner.ts has no openclaw-plugin, TrainerRunner, nocturnal-trinity imports', async () => {
1835
+ const { readFileSync } = await import('node:fs');
1836
+ const { resolve } = await import('node:path');
1837
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'rollout-reviewer-runner.ts'), 'utf-8');
1838
+ expect(src).not.toContain('openclaw-plugin');
1839
+ expect(src).not.toContain('TrainerRunner');
1840
+ expect(src).not.toContain('nocturnal-trinity');
1841
+ expect(src).not.toContain('InternalizationOrchestrator');
1842
+ expect(src).not.toContain('createTask');
1843
+ expect(src).not.toContain('enqueueTask');
1844
+ });
1845
+ it('CORE_NO_SCHEDULING: rollout-reviewer-runner.ts has no node:fs, node:cron imports', async () => {
1846
+ const { readFileSync } = await import('node:fs');
1847
+ const { resolve } = await import('node:path');
1848
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'rollout-reviewer-runner.ts'), 'utf-8');
1849
+ expect(src).not.toContain('node:fs');
1850
+ expect(src).not.toContain('node:cron');
1851
+ });
1852
+ it('BARREL_EXPORTS: internalization/index.ts exports RolloutReviewerRunner and RolloutReviewerOutput', async () => {
1853
+ const { readFileSync } = await import('node:fs');
1854
+ const { resolve } = await import('node:path');
1855
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'index.ts'), 'utf-8');
1856
+ expect(src).toContain('RolloutReviewerRunner');
1857
+ expect(src).toContain('RolloutReviewerOutput');
1858
+ expect(src).toContain('DefaultRolloutReviewerValidator');
1859
+ });
1860
+ it('SCHEMA_REGISTRY: pi-ai-runtime-adapter.ts registers rollout-reviewer-output-v1 schema', async () => {
1861
+ const { readFileSync } = await import('node:fs');
1862
+ const { resolve } = await import('node:path');
1863
+ const src = readFileSync(resolve(__dirname, '..', 'adapter', 'pi-ai-runtime-adapter.ts'), 'utf-8');
1864
+ expect(src).toContain('rollout-reviewer-output-v1');
1865
+ expect(src).toContain('RolloutReviewerOutputV1Schema');
1866
+ });
1867
+ });
1868
+ // ── PRI-116: TrainerRunner boundary guards ──────────────────────────────────
1869
+ describe('PRI-116 TrainerRunner boundary', () => {
1870
+ it('trainer source files exist in internalization directory', async () => {
1871
+ const { existsSync } = await import('node:fs');
1872
+ const { resolve } = await import('node:path');
1873
+ expect(existsSync(resolve(__dirname, '..', 'internalization', 'trainer-runner.ts'))).toBe(true);
1874
+ expect(existsSync(resolve(__dirname, '..', 'internalization', 'trainer-output.ts'))).toBe(true);
1875
+ expect(existsSync(resolve(__dirname, '..', 'internalization', 'trainer-prompt-builder.ts'))).toBe(true);
1876
+ });
1877
+ it('trainer test file exists', async () => {
1878
+ const { existsSync } = await import('node:fs');
1879
+ const { resolve } = await import('node:path');
1880
+ expect(existsSync(resolve(__dirname, 'trainer-runner-vslice.test.ts'))).toBe(true);
1881
+ });
1882
+ it('CORE_NO_FORBIDDEN_IMPORTS: trainer-output.ts has no openclaw-plugin, fs, path imports', async () => {
1883
+ const { readFileSync } = await import('node:fs');
1884
+ const { resolve } = await import('node:path');
1885
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'trainer-output.ts'), 'utf-8');
1886
+ expect(src).not.toContain('openclaw-plugin');
1887
+ expect(src).not.toContain('node:fs');
1888
+ expect(src).not.toContain('node:path');
1889
+ });
1890
+ it('CORE_NO_FORBIDDEN_IMPORTS: trainer-runner.ts has no openclaw-plugin, RolloutReviewerRunner, nocturnal-trinity imports', async () => {
1891
+ const { readFileSync } = await import('node:fs');
1892
+ const { resolve } = await import('node:path');
1893
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'trainer-runner.ts'), 'utf-8');
1894
+ expect(src).not.toContain('openclaw-plugin');
1895
+ expect(src).not.toContain('RolloutReviewerRunner');
1896
+ expect(src).not.toContain('nocturnal-trinity');
1897
+ expect(src).not.toContain('InternalizationOrchestrator');
1898
+ expect(src).not.toContain('createTask');
1899
+ expect(src).not.toContain('enqueueTask');
1900
+ });
1901
+ it('CORE_NO_SCHEDULING: trainer-runner.ts has no node:fs, node:cron imports', async () => {
1902
+ const { readFileSync } = await import('node:fs');
1903
+ const { resolve } = await import('node:path');
1904
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'trainer-runner.ts'), 'utf-8');
1905
+ expect(src).not.toContain('node:fs');
1906
+ expect(src).not.toContain('node:cron');
1907
+ });
1908
+ it('BARREL_EXPORTS: internalization/index.ts exports TrainerRunner and TrainerOutput', async () => {
1909
+ const { readFileSync } = await import('node:fs');
1910
+ const { resolve } = await import('node:path');
1911
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'index.ts'), 'utf-8');
1912
+ expect(src).toContain('TrainerRunner');
1913
+ expect(src).toContain('TrainerOutput');
1914
+ expect(src).toContain('DefaultTrainerValidator');
1915
+ });
1916
+ it('BARREL_EXPORTS: runtime-v2/index.ts exports TrainerRunner and TrainerOutput', async () => {
1917
+ const { readFileSync } = await import('node:fs');
1918
+ const { resolve } = await import('node:path');
1919
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
1920
+ expect(src).toContain('TrainerRunner');
1921
+ expect(src).toContain('TrainerOutput');
1922
+ expect(src).toContain('DefaultTrainerValidator');
1923
+ });
1924
+ it('SCHEMA_REGISTRY: pi-ai-runtime-adapter.ts registers trainer-output-v1 schema', async () => {
1925
+ const { readFileSync } = await import('node:fs');
1926
+ const { resolve } = await import('node:path');
1927
+ const src = readFileSync(resolve(__dirname, '..', 'adapter', 'pi-ai-runtime-adapter.ts'), 'utf-8');
1928
+ expect(src).toContain('trainer-output-v1');
1929
+ expect(src).toContain('TrainerOutputV1Schema');
1930
+ });
1931
+ });
1932
+ describe('PRI-114: correction-proposal boundary', () => {
1933
+ it('CORE_PURE: correction-proposal.ts has zero infrastructure imports', async () => {
1934
+ const { readFileSync } = await import('node:fs');
1935
+ const { resolve } = await import('node:path');
1936
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'correction-proposal.ts'), 'utf-8');
1937
+ expect(src).not.toContain('node:vm');
1938
+ expect(src).not.toContain('node:fs');
1939
+ expect(src).not.toContain('openclaw-plugin');
1940
+ expect(src).not.toContain('require(');
1941
+ });
1942
+ it('CONTRACT_IMPORT: rule-host-contracts.ts imports CorrectionProposal from same directory', async () => {
1943
+ const { readFileSync } = await import('node:fs');
1944
+ const { resolve } = await import('node:path');
1945
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'rule-host-contracts.ts'), 'utf-8');
1946
+ expect(src).toContain("from './correction-proposal.js'");
1947
+ });
1948
+ it('EVALUATOR_IMPORT: rule-host-evaluator.ts imports validateCorrectionProposal from same directory', async () => {
1949
+ const { readFileSync } = await import('node:fs');
1950
+ const { resolve } = await import('node:path');
1951
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'rule-host-evaluator.ts'), 'utf-8');
1952
+ expect(src).toContain("from './correction-proposal.js'");
1953
+ expect(src).toContain('validateCorrectionProposal');
1954
+ });
1955
+ it('BARREL_EXPORTS: runtime-v2/index.ts exports CorrectionProposal and validators', async () => {
1956
+ const { readFileSync } = await import('node:fs');
1957
+ const { resolve } = await import('node:path');
1958
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
1959
+ expect(src).toContain('CorrectionProposal');
1960
+ expect(src).toContain('validateProposedParams');
1961
+ expect(src).toContain('validateCorrectionProposal');
1962
+ expect(src).toContain("from './internalization/correction-proposal.js'");
1963
+ });
1964
+ });
1965
+ // ── PRI-172: Refiner Sandbox Wrapper boundary ────────────────────────────
1966
+ describe('PRI-172: refiner-sandbox-wrapper boundary', () => {
1967
+ it('CORE_PURE: refiner-sandbox-wrapper.ts has zero infrastructure imports', async () => {
1968
+ const { readFileSync } = await import('node:fs');
1969
+ const { resolve } = await import('node:path');
1970
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'refiner-sandbox-wrapper.ts'), 'utf-8');
1971
+ const importLines = src.split('\n').filter((line) => line.trim().startsWith('import'));
1972
+ const vmImports = importLines.filter((line) => line.includes('node:vm'));
1973
+ expect(vmImports).toEqual([]);
1974
+ const fsImports = importLines.filter((line) => line.includes('node:fs'));
1975
+ expect(fsImports).toEqual([]);
1976
+ expect(src).not.toContain('openclaw-plugin');
1977
+ expect(src).not.toContain('eval(');
1978
+ expect(src).not.toContain('new Function');
1979
+ });
1980
+ it('BARREL_EXPORTS: runtime-v2/index.ts exports RefinerSandboxResult and evaluateInRefinerSandbox', async () => {
1981
+ const { readFileSync } = await import('node:fs');
1982
+ const { resolve } = await import('node:path');
1983
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
1984
+ expect(src).toContain('evaluateInRefinerSandbox');
1985
+ expect(src).toContain('RefinerSandboxResult');
1986
+ expect(src).toContain('RefinerSandboxFailedCase');
1987
+ expect(src).toContain("from './internalization/refiner-sandbox-wrapper.js'");
1988
+ });
1989
+ it('REUSES_REPLAY: refiner-sandbox-wrapper.ts imports ReplayEvaluateFn from replay validator', async () => {
1990
+ const { readFileSync } = await import('node:fs');
1991
+ const { resolve } = await import('node:path');
1992
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'refiner-sandbox-wrapper.ts'), 'utf-8');
1993
+ expect(src).toContain("from '../golden-trace-replay-validator.js'");
1994
+ expect(src).toContain('ReplayEvaluateFn');
1995
+ });
1996
+ it('REUSES_FORBIDDEN: refiner-sandbox-wrapper.ts imports checkForbiddenPatterns from rule-code-validator', async () => {
1997
+ const { readFileSync } = await import('node:fs');
1998
+ const { resolve } = await import('node:path');
1999
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'refiner-sandbox-wrapper.ts'), 'utf-8');
2000
+ expect(src).toContain("from './rule-code-validator.js'");
2001
+ expect(src).toContain('checkForbiddenPatterns');
2002
+ });
2003
+ });
2004
+ // ── PRI-173: Refiner RuleHost Gate boundary ────────────────────────────
2005
+ describe('PRI-173: refiner-rulehost-gate boundary', () => {
2006
+ it('CORE_PURE: refiner-rulehost-gate.ts has zero infrastructure imports', async () => {
2007
+ const { readFileSync } = await import('node:fs');
2008
+ const { resolve } = await import('node:path');
2009
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'refiner-rulehost-gate.ts'), 'utf-8');
2010
+ expect(src).not.toContain('node:vm');
2011
+ expect(src).not.toContain('node:fs');
2012
+ expect(src).not.toContain('node:path');
2013
+ expect(src).not.toContain('node:process');
2014
+ expect(src).not.toContain('openclaw-plugin');
2015
+ expect(src).not.toContain('eval(');
2016
+ expect(src).not.toContain('new Function');
2017
+ });
2018
+ it('BARREL_EXPORTS: runtime-v2/index.ts exports evaluateRefinerRuleHostGate and types', async () => {
2019
+ const { readFileSync } = await import('node:fs');
2020
+ const { resolve } = await import('node:path');
2021
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
2022
+ expect(src).toContain('evaluateRefinerRuleHostGate');
2023
+ expect(src).toContain('RefinerRuleHostGateDecision');
2024
+ expect(src).toContain('RefinerRuleHostGateInput');
2025
+ expect(src).toContain('RefinerRuleHostGateResult');
2026
+ expect(src).toContain("from './internalization/refiner-rulehost-gate.js'");
2027
+ });
2028
+ it('USES_SANDBOX: refiner-rulehost-gate.ts imports RefinerSandboxResult from refiner-sandbox-wrapper', async () => {
2029
+ const { readFileSync } = await import('node:fs');
2030
+ const { resolve } = await import('node:path');
2031
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'refiner-rulehost-gate.ts'), 'utf-8');
2032
+ expect(src).toContain("from './refiner-sandbox-wrapper.js'");
2033
+ expect(src).toContain('RefinerSandboxResult');
2034
+ });
2035
+ });
2036
+ describe('PRI-146: RuleHostWriter shadow activation boundary', () => {
2037
+ it('CORE_PURE: rule-host-writer.ts has zero infrastructure imports', async () => {
2038
+ const { readFileSync } = await import('node:fs');
2039
+ const { resolve } = await import('node:path');
2040
+ const src = readFileSync(resolve(__dirname, '..', 'activation', 'writers', 'rule-host-writer.ts'), 'utf-8');
2041
+ expect(src).not.toContain('node:vm');
2042
+ expect(src).not.toContain('node:fs');
2043
+ expect(src).not.toContain('node:path');
2044
+ expect(src).not.toContain('node:process');
2045
+ expect(src).not.toContain('openclaw-plugin');
2046
+ expect(src).not.toContain('eval(');
2047
+ expect(src).not.toContain('new Function');
2048
+ });
2049
+ it('SHADOW_ONLY: rule-host-writer.ts does not implement live mode', async () => {
2050
+ const { readFileSync } = await import('node:fs');
2051
+ const { resolve } = await import('node:path');
2052
+ const src = readFileSync(resolve(__dirname, '..', 'activation', 'writers', 'rule-host-writer.ts'), 'utf-8');
2053
+ expect(src).not.toContain('code_tool_hook_live_activate');
2054
+ expect(src).toContain('code_tool_hook_shadow_activate');
2055
+ expect(src).toContain('accepted_shadow');
2056
+ });
2057
+ it('USES_GATE: rule-host-writer.ts imports evaluateRefinerRuleHostGate', async () => {
2058
+ const { readFileSync } = await import('node:fs');
2059
+ const { resolve } = await import('node:path');
2060
+ const src = readFileSync(resolve(__dirname, '..', 'activation', 'writers', 'rule-host-writer.ts'), 'utf-8');
2061
+ expect(src).toContain('evaluateRefinerRuleHostGate');
2062
+ expect(src).toContain("from '../../internalization/refiner-rulehost-gate.js'");
2063
+ });
2064
+ it('IMPLEMENTS_CHANNEL_WRITER: rule-host-writer.ts implements ChannelWriter interface', async () => {
2065
+ const { readFileSync } = await import('node:fs');
2066
+ const { resolve } = await import('node:path');
2067
+ const src = readFileSync(resolve(__dirname, '..', 'activation', 'writers', 'rule-host-writer.ts'), 'utf-8');
2068
+ expect(src).toContain('implements ChannelWriter');
2069
+ expect(src).toContain("channel = 'code_tool_hook'");
2070
+ });
2071
+ it('BARREL_EXPORTS: activation/index.ts exports RuleHostWriter', async () => {
2072
+ const { readFileSync } = await import('node:fs');
2073
+ const { resolve } = await import('node:path');
2074
+ const src = readFileSync(resolve(__dirname, '..', 'activation', 'index.ts'), 'utf-8');
2075
+ expect(src).toContain('RuleHostWriter');
2076
+ expect(src).toContain("from './writers/rule-host-writer.js'");
2077
+ });
2078
+ it('CHANNEL_MAP: code_tool_hook is in HIGH_RISK_CHANNEL_MAP', async () => {
2079
+ const { readFileSync } = await import('node:fs');
2080
+ const { resolve } = await import('node:path');
2081
+ const src = readFileSync(resolve(__dirname, '..', 'activation', 'activation-types.ts'), 'utf-8');
2082
+ expect(src).toContain("code_tool_hook: 'high'");
2083
+ });
2084
+ });
2085
+ // ── PRI-117: Nocturnal god-class freeze — no Runtime V2 → Nocturnal reverse imports ─
2086
+ describe('PRI-117 Nocturnal god-class freeze', () => {
2087
+ const NOCTURNAL_GOD_CLASSES = [
2088
+ 'nocturnal-trinity',
2089
+ 'nocturnal-service',
2090
+ '../core/nocturnal-trinity.js',
2091
+ '../service/nocturnal-service.js',
2092
+ '../../core/nocturnal-trinity.js',
2093
+ '../../service/nocturnal-service.js',
2094
+ ];
2095
+ it('RUNTIME_V2_NO_NOCTURNAL_TRINITY_IMPORT: runtime-v2 must not import nocturnal-trinity', async () => {
2096
+ const { readdirSync, readFileSync } = await import('node:fs');
2097
+ const { resolve, join } = await import('node:path');
2098
+ const runtimeDir = resolve(__dirname, '..');
2099
+ const allFiles = [];
2100
+ function collectTsFiles(dir) {
2101
+ if (dir.includes('node_modules'))
2102
+ return;
2103
+ try {
2104
+ const entries = readdirSync(dir, { withFileTypes: true });
2105
+ for (const entry of entries) {
2106
+ const fullPath = join(dir, entry.name);
2107
+ if (entry.isDirectory()) {
2108
+ collectTsFiles(fullPath);
2109
+ }
2110
+ else if (entry.name.endsWith('.ts') && !entry.name.endsWith('.test.ts')) {
2111
+ allFiles.push(fullPath);
2112
+ }
2113
+ }
2114
+ }
2115
+ catch {
2116
+ // Skip inaccessible directories
2117
+ }
2118
+ }
2119
+ collectTsFiles(runtimeDir);
2120
+ for (const file of allFiles) {
2121
+ const src = readFileSync(file, 'utf-8');
2122
+ for (const badImport of NOCTURNAL_GOD_CLASSES) {
2123
+ expect(src).not.toContain(badImport);
2124
+ }
2125
+ }
2126
+ });
2127
+ it('OPENCLAW_TRINITY_RUNTIME_ADAPTER_IS_LEGACY: OpenClawTrinityRuntimeAdapter must not be referenced in runtime-v2', async () => {
2128
+ const { readdirSync, readFileSync } = await import('node:fs');
2129
+ const { resolve, join } = await import('node:path');
2130
+ const runtimeDir = resolve(__dirname, '..');
2131
+ const allFiles = [];
2132
+ function collectTsFiles(dir) {
2133
+ if (dir.includes('node_modules'))
2134
+ return;
2135
+ try {
2136
+ const entries = readdirSync(dir, { withFileTypes: true });
2137
+ for (const entry of entries) {
2138
+ const fullPath = join(dir, entry.name);
2139
+ if (entry.isDirectory()) {
2140
+ collectTsFiles(fullPath);
2141
+ }
2142
+ else if (entry.name.endsWith('.ts') && !entry.name.endsWith('.test.ts')) {
2143
+ allFiles.push(fullPath);
2144
+ }
2145
+ }
2146
+ }
2147
+ catch {
2148
+ // Skip inaccessible directories
2149
+ }
2150
+ }
2151
+ collectTsFiles(runtimeDir);
2152
+ for (const file of allFiles) {
2153
+ const src = readFileSync(file, 'utf-8');
2154
+ expect(src).not.toContain('OpenClawTrinityRuntimeAdapter');
2155
+ expect(src).not.toContain('TrinityRuntimeAdapter');
2156
+ expect(src).not.toContain('runTrinity');
2157
+ expect(src).not.toContain('runTrinityAsync');
2158
+ }
2159
+ });
2160
+ it('NOCTURNAL_TRINITY_STUBS_ARE_TEST_ONLY: invokeStub* functions must not appear in non-test runtime-v2 files', async () => {
2161
+ const { readdirSync, readFileSync } = await import('node:fs');
2162
+ const { resolve, join } = await import('node:path');
2163
+ const runtimeDir = resolve(__dirname, '..');
2164
+ const allFiles = [];
2165
+ function collectTsFiles(dir) {
2166
+ if (dir.includes('node_modules'))
2167
+ return;
2168
+ try {
2169
+ const entries = readdirSync(dir, { withFileTypes: true });
2170
+ for (const entry of entries) {
2171
+ const fullPath = join(dir, entry.name);
2172
+ if (entry.isDirectory()) {
2173
+ collectTsFiles(fullPath);
2174
+ }
2175
+ else if (entry.name.endsWith('.ts') && !entry.name.endsWith('.test.ts')) {
2176
+ allFiles.push(fullPath);
2177
+ }
2178
+ }
2179
+ }
2180
+ catch {
2181
+ // Skip inaccessible directories
2182
+ }
2183
+ }
2184
+ collectTsFiles(runtimeDir);
2185
+ for (const file of allFiles) {
2186
+ const src = readFileSync(file, 'utf-8');
2187
+ expect(src).not.toContain('invokeStubDreamer');
2188
+ expect(src).not.toContain('invokeStubPhilosopher');
2189
+ expect(src).not.toContain('invokeStubScribe');
2190
+ }
2191
+ });
2192
+ it('RUNTIME_V2_USES_PEER_RUNNERS: DreamerRunner/PhilosopherRunner/ScribeRunner are the canonical entry points', async () => {
2193
+ const { readFileSync } = await import('node:fs');
2194
+ const { resolve } = await import('node:path');
2195
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
2196
+ expect(src).toContain('DreamerRunner');
2197
+ expect(src).toContain('PhilosopherRunner');
2198
+ expect(src).toContain('ScribeRunner');
2199
+ expect(src).toContain('ArtificerRunner');
2200
+ });
2201
+ });
2202
+ // ── Phase 2 Migration: Evolution Types ────────────────────────────────────────
2203
+ describe('Phase 2.1 evolution types migration', () => {
2204
+ const CORE_FILES = [
2205
+ 'evolution/evolution-types.ts',
2206
+ 'evolution/index.ts',
2207
+ ];
2208
+ for (const file of CORE_FILES) {
2209
+ it(`core ${file} has zero infrastructure imports`, async () => {
2210
+ const { readFileSync } = await import('node:fs');
2211
+ const { resolve } = await import('node:path');
2212
+ const src = readFileSync(resolve(__dirname, '..', file), 'utf-8');
2213
+ expect(src).not.toContain('node:fs');
2214
+ expect(src).not.toContain('node:path');
2215
+ expect(src).not.toContain('openclaw-plugin');
2216
+ });
2217
+ }
2218
+ it('core barrel exports EvolutionTier, TIER_DEFINITIONS, getTierDefinition, getTierByPoints', async () => {
2219
+ const { readFileSync } = await import('node:fs');
2220
+ const { resolve } = await import('node:path');
2221
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
2222
+ expect(src).toContain('EvolutionTier');
2223
+ expect(src).toContain('TIER_DEFINITIONS');
2224
+ expect(src).toContain('getTierDefinition');
2225
+ expect(src).toContain('getTierByPoints');
2226
+ expect(src).toContain("from './evolution/evolution-types.js'");
2227
+ });
2228
+ it('core barrel exports EvolutionPrinciple, EvolutionPrincipleStatus, EvolutionPainDetectedData', async () => {
2229
+ const { readFileSync } = await import('node:fs');
2230
+ const { resolve } = await import('node:path');
2231
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
2232
+ expect(src).toContain('EvolutionPrinciple');
2233
+ expect(src).toContain('EvolutionPrincipleStatus');
2234
+ expect(src).toContain('EvolutionPainDetectedData');
2235
+ });
2236
+ it('plugin evolution-types.ts re-exports from core with backward-compatible aliases', async () => {
2237
+ const { readFileSync } = await import('node:fs');
2238
+ const { resolve } = await import('node:path');
2239
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/core/evolution-types.ts'), 'utf-8');
2240
+ expect(src).toContain("from '@principles/core/runtime-v2'");
2241
+ expect(src).toContain('EvolutionTier');
2242
+ expect(src).toContain('EvolutionPrinciple');
2243
+ expect(src).toContain('type Principle = EvolutionPrinciple');
2244
+ expect(src).toContain('type PrincipleStatus = EvolutionPrincipleStatus');
2245
+ expect(src).toContain('type PainDetectedData = EvolutionPainDetectedData');
2246
+ });
2247
+ it('plugin evolution-types.ts does NOT define EvolutionTier or TIER_DEFINITIONS locally', async () => {
2248
+ const { readFileSync } = await import('node:fs');
2249
+ const { resolve } = await import('node:path');
2250
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/core/evolution-types.ts'), 'utf-8');
2251
+ expect(src).not.toMatch(/^export enum EvolutionTier/m);
2252
+ expect(src).not.toMatch(/^export const TIER_DEFINITIONS/m);
2253
+ });
2254
+ });
2255
+ // ── Phase 2 Migration: Correction Types ───────────────────────────────────────
2256
+ describe('Phase 2.2 correction types migration', () => {
2257
+ const CORE_FILES = [
2258
+ 'correction/correction-types.ts',
2259
+ 'correction/index.ts',
2260
+ ];
2261
+ for (const file of CORE_FILES) {
2262
+ it(`core ${file} has zero infrastructure imports`, async () => {
2263
+ const { readFileSync } = await import('node:fs');
2264
+ const { resolve } = await import('node:path');
2265
+ const src = readFileSync(resolve(__dirname, '..', file), 'utf-8');
2266
+ expect(src).not.toContain('node:fs');
2267
+ expect(src).not.toContain('node:path');
2268
+ expect(src).not.toContain('openclaw-plugin');
2269
+ });
2270
+ }
2271
+ it('core barrel exports CorrectionKeyword, CorrectionKeywordStore, MAX_CORRECTION_KEYWORDS', async () => {
2272
+ const { readFileSync } = await import('node:fs');
2273
+ const { resolve } = await import('node:path');
2274
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
2275
+ expect(src).toContain('CorrectionKeyword');
2276
+ expect(src).toContain('CorrectionKeywordStore');
2277
+ expect(src).toContain('MAX_CORRECTION_KEYWORDS');
2278
+ expect(src).toContain("from './correction/correction-types.js'");
2279
+ });
2280
+ it('plugin correction-types.ts re-exports from core', async () => {
2281
+ const { readFileSync } = await import('node:fs');
2282
+ const { resolve } = await import('node:path');
2283
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/core/correction-types.ts'), 'utf-8');
2284
+ expect(src).toContain("from '@principles/core/runtime-v2'");
2285
+ expect(src).toContain('CorrectionKeyword');
2286
+ expect(src).toContain('MAX_CORRECTION_KEYWORDS');
2287
+ });
2288
+ it('plugin correction-types.ts does NOT define CorrectionKeyword interface locally', async () => {
2289
+ const { readFileSync } = await import('node:fs');
2290
+ const { resolve } = await import('node:path');
2291
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/core/correction-types.ts'), 'utf-8');
2292
+ expect(src).not.toMatch(/^export interface CorrectionKeyword/m);
2293
+ });
2294
+ });
2295
+ // ── Phase 2 Migration: Types Directory (queue, hygiene, runtime-summary, events) ──
2296
+ describe('Phase 2.4 types directory migration', () => {
2297
+ const CORE_TYPE_FILES = [
2298
+ 'types/queue-types.ts',
2299
+ 'types/hygiene-types.ts',
2300
+ 'types/runtime-summary-types.ts',
2301
+ 'types/event-types.ts',
2302
+ 'types/event-payload.ts',
2303
+ ];
2304
+ for (const file of CORE_TYPE_FILES) {
2305
+ it(`core ${file} has zero infrastructure imports`, async () => {
2306
+ const { readFileSync } = await import('node:fs');
2307
+ const { resolve } = await import('node:path');
2308
+ const src = readFileSync(resolve(__dirname, '..', file), 'utf-8');
2309
+ expect(src).not.toContain('node:fs');
2310
+ expect(src).not.toContain('node:path');
2311
+ expect(src).not.toContain('openclaw-plugin');
2312
+ });
2313
+ }
2314
+ it('core barrel exports QueueItemId, WorkflowId, SessionKey brand types', async () => {
2315
+ const { readFileSync } = await import('node:fs');
2316
+ const { resolve } = await import('node:path');
2317
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
2318
+ expect(src).toContain('QueueItemId');
2319
+ expect(src).toContain('WorkflowId');
2320
+ expect(src).toContain('SessionKey');
2321
+ expect(src).toContain("from './types/queue-types.js'");
2322
+ });
2323
+ it('core barrel exports HygieneStats, createEmptyHygieneStats', async () => {
2324
+ const { readFileSync } = await import('node:fs');
2325
+ const { resolve } = await import('node:path');
2326
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
2327
+ expect(src).toContain('HygieneStats');
2328
+ expect(src).toContain('createEmptyHygieneStats');
2329
+ expect(src).toContain("from './types/hygiene-types.js'");
2330
+ });
2331
+ it('core barrel exports RuntimeTruth, TrendMetrics', async () => {
2332
+ const { readFileSync } = await import('node:fs');
2333
+ const { resolve } = await import('node:path');
2334
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
2335
+ expect(src).toContain('RuntimeTruth');
2336
+ expect(src).toContain('TrendMetrics');
2337
+ expect(src).toContain("from './types/runtime-summary-types.js'");
2338
+ });
2339
+ it('core barrel exports EventType, EventLogEntry, EventEvolutionStats', async () => {
2340
+ const { readFileSync } = await import('node:fs');
2341
+ const { resolve } = await import('node:path');
2342
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
2343
+ expect(src).toContain('EventType');
2344
+ expect(src).toContain('EventLogEntry');
2345
+ expect(src).toContain('EventEvolutionStats');
2346
+ expect(src).toContain("from './types/event-types.js'");
2347
+ });
2348
+ it('core barrel exports DiscriminatedEventLogEntry, isToolCallEventEntry', async () => {
2349
+ const { readFileSync } = await import('node:fs');
2350
+ const { resolve } = await import('node:path');
2351
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
2352
+ expect(src).toContain('DiscriminatedEventLogEntry');
2353
+ expect(src).toContain('isToolCallEventEntry');
2354
+ expect(src).toContain("from './types/event-payload.js'");
2355
+ });
2356
+ it('plugin types/queue.ts re-exports from core', async () => {
2357
+ const { readFileSync } = await import('node:fs');
2358
+ const { resolve } = await import('node:path');
2359
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/types/queue.ts'), 'utf-8');
2360
+ expect(src).toContain("@principles/core/runtime-v2");
2361
+ });
2362
+ it('plugin types/hygiene-types.ts re-exports from core', async () => {
2363
+ const { readFileSync } = await import('node:fs');
2364
+ const { resolve } = await import('node:path');
2365
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/types/hygiene-types.ts'), 'utf-8');
2366
+ expect(src).toContain("@principles/core/runtime-v2");
2367
+ });
2368
+ it('plugin types/runtime-summary.ts re-exports from core', async () => {
2369
+ const { readFileSync } = await import('node:fs');
2370
+ const { resolve } = await import('node:path');
2371
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/types/runtime-summary.ts'), 'utf-8');
2372
+ expect(src).toContain("@principles/core/runtime-v2");
2373
+ });
2374
+ it('plugin types/event-types.ts re-exports from core', async () => {
2375
+ const { readFileSync } = await import('node:fs');
2376
+ const { resolve } = await import('node:path');
2377
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/types/event-types.ts'), 'utf-8');
2378
+ expect(src).toContain("@principles/core/runtime-v2");
2379
+ });
2380
+ it('plugin types/event-payload.ts re-exports from core', async () => {
2381
+ const { readFileSync } = await import('node:fs');
2382
+ const { resolve } = await import('node:path');
2383
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/types/event-payload.ts'), 'utf-8');
2384
+ expect(src).toContain("@principles/core/runtime-v2");
2385
+ });
2386
+ });
2387
+ // ── Phase 2 Migration: Principle-Tree Data Structures ─────────────────────────
2388
+ describe('Phase 2.6 principle-tree data structures migration', () => {
2389
+ const CORE_TYPE_FILES = [
2390
+ 'types/principle-dependency.ts',
2391
+ 'types/principle-value-metrics.ts',
2392
+ 'types/principle-lifecycle-event.ts',
2393
+ 'types/principle-tree-store.ts',
2394
+ ];
2395
+ for (const file of CORE_TYPE_FILES) {
2396
+ it(`core ${file} has zero infrastructure imports`, async () => {
2397
+ const { readFileSync } = await import('node:fs');
2398
+ const { resolve } = await import('node:path');
2399
+ const src = readFileSync(resolve(__dirname, '..', file), 'utf-8');
2400
+ expect(src).not.toContain('node:fs');
2401
+ expect(src).not.toContain('node:path');
2402
+ expect(src).not.toContain('openclaw-plugin');
2403
+ });
2404
+ }
2405
+ it('core barrel exports PrincipleDependency, PrincipleValueMetrics, PrincipleLifecycleEvent, PrincipleTreeStore', async () => {
2406
+ const { readFileSync } = await import('node:fs');
2407
+ const { resolve } = await import('node:path');
2408
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
2409
+ expect(src).toContain('PrincipleDependency');
2410
+ expect(src).toContain('PrincipleValueMetrics');
2411
+ expect(src).toContain('PrincipleLifecycleEvent');
2412
+ expect(src).toContain('PrincipleTreeStore');
2413
+ });
2414
+ it('plugin principle-tree-schema.ts re-exports PrincipleDependency, PrincipleValueMetrics, PrincipleLifecycleEvent, PrincipleTreeStore from core', async () => {
2415
+ const { readFileSync } = await import('node:fs');
2416
+ const { resolve } = await import('node:path');
2417
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/types/principle-tree-schema.ts'), 'utf-8');
2418
+ expect(src).toContain("from '@principles/core/runtime-v2'");
2419
+ expect(src).toContain('PrincipleDependency');
2420
+ expect(src).toContain('PrincipleValueMetrics');
2421
+ expect(src).toContain('PrincipleLifecycleEvent');
2422
+ expect(src).toContain('PrincipleTreeStore');
2423
+ });
2424
+ it('plugin principle-tree-schema.ts does NOT define PrincipleDependency or PrincipleTreeStore locally', async () => {
2425
+ const { readFileSync } = await import('node:fs');
2426
+ const { resolve } = await import('node:path');
2427
+ const src = readFileSync(resolve(__dirname, '../../../../openclaw-plugin/src/types/principle-tree-schema.ts'), 'utf-8');
2428
+ expect(src).not.toMatch(/^export interface PrincipleDependency/m);
2429
+ expect(src).not.toMatch(/^export interface PrincipleTreeStore/m);
2430
+ });
2431
+ });
2432
+ // ── PRI-141: Task Three Strikes Out Mechanism ──────────────────────────────────
2433
+ describe('PRI-141 Task Three Strikes Out Mechanism', () => {
2434
+ it('core barrel exports isUnresolvable, recordRejection, DEFAULT_UNRESOLVABLE_THRESHOLD', async () => {
2435
+ const { readFileSync } = await import('node:fs');
2436
+ const { resolve } = await import('node:path');
2437
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
2438
+ expect(src).toContain('isUnresolvable');
2439
+ expect(src).toContain('recordRejection');
2440
+ expect(src).toContain('DEFAULT_UNRESOLVABLE_THRESHOLD');
2441
+ });
2442
+ it('core barrel exports UnresolvableSample type', async () => {
2443
+ const { readFileSync } = await import('node:fs');
2444
+ const { resolve } = await import('node:path');
2445
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
2446
+ expect(src).toContain('UnresolvableSample');
2447
+ });
2448
+ it('internalization-task-guards.ts has zero infrastructure imports', async () => {
2449
+ const { readFileSync } = await import('node:fs');
2450
+ const { resolve } = await import('node:path');
2451
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'internalization-task-guards.ts'), 'utf-8');
2452
+ expect(src).not.toContain('node:fs');
2453
+ expect(src).not.toContain('node:path');
2454
+ expect(src).not.toContain('openclaw-plugin');
2455
+ expect(src).not.toContain('node:cron');
2456
+ });
2457
+ it('PITaskRecord includes rejectionCount field', async () => {
2458
+ const { readFileSync } = await import('node:fs');
2459
+ const { resolve } = await import('node:path');
2460
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'peer-runner-contracts.ts'), 'utf-8');
2461
+ expect(src).toContain('rejectionCount');
2462
+ });
2463
+ it('PITaskMetadata includes rejectionCount field', async () => {
2464
+ const { readFileSync } = await import('node:fs');
2465
+ const { resolve } = await import('node:path');
2466
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'pitask-metadata.ts'), 'utf-8');
2467
+ expect(src).toContain('rejectionCount');
2468
+ });
2469
+ });
2470
+ // ── PRI-139: L1 Hard Cap & LRU Eviction ──────────────────────────────────────
2471
+ describe('PRI-139 L1 Hard Cap & LRU Eviction', () => {
2472
+ it('core barrel exports enforceL1HardCap, validateL1CapConfig, DEFAULT_L1_HARD_CAP, MAX_L1_HARD_CAP', async () => {
2473
+ const { readFileSync } = await import('node:fs');
2474
+ const { resolve } = await import('node:path');
2475
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
2476
+ expect(src).toContain('enforceL1HardCap');
2477
+ expect(src).toContain('validateL1CapConfig');
2478
+ expect(src).toContain('DEFAULT_L1_HARD_CAP');
2479
+ expect(src).toContain('MAX_L1_HARD_CAP');
2480
+ });
2481
+ it('core barrel exports L1CapConfig, L1EvictionCandidate, L1EvictionResult types', async () => {
2482
+ const { readFileSync } = await import('node:fs');
2483
+ const { resolve } = await import('node:path');
2484
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
2485
+ expect(src).toContain('L1CapConfig');
2486
+ expect(src).toContain('L1EvictionCandidate');
2487
+ expect(src).toContain('L1EvictionResult');
2488
+ });
2489
+ it('l1-hard-cap.ts has zero infrastructure imports', async () => {
2490
+ const { readFileSync } = await import('node:fs');
2491
+ const { resolve } = await import('node:path');
2492
+ const src = readFileSync(resolve(__dirname, '..', 'l1-hard-cap.ts'), 'utf-8');
2493
+ expect(src).not.toContain('node:fs');
2494
+ expect(src).not.toContain('node:path');
2495
+ expect(src).not.toContain('openclaw-plugin');
2496
+ });
2497
+ it('LedgerPrinciple includes lastTriggeredAt field', async () => {
2498
+ const { readFileSync } = await import('node:fs');
2499
+ const { resolve } = await import('node:path');
2500
+ const src = readFileSync(resolve(__dirname, '..', '..', 'principle-tree-ledger.ts'), 'utf-8');
2501
+ expect(src).toContain('lastTriggeredAt');
2502
+ });
2503
+ it('PruningHealthSummary includes activeL1Count and l1Cap fields', async () => {
2504
+ const { readFileSync } = await import('node:fs');
2505
+ const { resolve } = await import('node:path');
2506
+ const src = readFileSync(resolve(__dirname, '..', 'pruning-read-model.ts'), 'utf-8');
2507
+ expect(src).toContain('activeL1Count');
2508
+ expect(src).toContain('l1Cap');
2509
+ });
2510
+ });
2511
+ // ── PRI-142: IntakeToInternalizationBridge ──────────────────────────────────────
2512
+ describe('PRI-142 IntakeToInternalizationBridge', () => {
2513
+ it('core barrel exports computeBridgeDecision, buildDreamerTaskSeed, seedIntakeTask, ROUTE_CHANNEL_MAP', async () => {
2514
+ const { readFileSync } = await import('node:fs');
2515
+ const { resolve } = await import('node:path');
2516
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
2517
+ expect(src).toContain('computeBridgeDecision');
2518
+ expect(src).toContain('buildDreamerTaskSeed');
2519
+ expect(src).toContain('seedIntakeTask');
2520
+ expect(src).toContain('ROUTE_CHANNEL_MAP');
2521
+ });
2522
+ it('core barrel exports IntakeToInternalizationBridgeInput, BridgeDecision, BridgeTaskSeed, BridgeTaskStore types', async () => {
2523
+ const { readFileSync } = await import('node:fs');
2524
+ const { resolve } = await import('node:path');
2525
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
2526
+ expect(src).toContain('IntakeToInternalizationBridgeInput');
2527
+ expect(src).toContain('BridgeDecision');
2528
+ expect(src).toContain('BridgeTaskSeed');
2529
+ expect(src).toContain('BridgeTaskStore');
2530
+ });
2531
+ it('intake-to-internalization-bridge.ts has zero infrastructure imports', async () => {
2532
+ const { readFileSync } = await import('node:fs');
2533
+ const { resolve } = await import('node:path');
2534
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'intake-to-internalization-bridge.ts'), 'utf-8');
2535
+ expect(src).not.toContain('node:fs');
2536
+ expect(src).not.toContain('node:path');
2537
+ expect(src).not.toContain('node:process');
2538
+ expect(src).not.toContain('openclaw-plugin');
2539
+ });
2540
+ it('internalization/index.ts exports bridge symbols', async () => {
2541
+ const { readFileSync } = await import('node:fs');
2542
+ const { resolve } = await import('node:path');
2543
+ const src = readFileSync(resolve(__dirname, '..', 'internalization', 'index.ts'), 'utf-8');
2544
+ expect(src).toContain('computeBridgeDecision');
2545
+ expect(src).toContain('buildDreamerTaskSeed');
2546
+ expect(src).toContain('seedIntakeTask');
2547
+ expect(src).toContain('ROUTE_CHANNEL_MAP');
2548
+ expect(src).toContain('IntakeToInternalizationBridgeInput');
2549
+ expect(src).toContain('BridgeDecision');
2550
+ expect(src).toContain('BridgeTaskSeed');
2551
+ expect(src).toContain('BridgeTaskStore');
2552
+ });
2553
+ });
2554
+ // ── PRI-144: ActivationDispatcher & Low-risk Writers ──────────────────────────
2555
+ describe('PRI-144 ActivationDispatcher & Low-risk Writers', () => {
2556
+ it('core barrel exports ActivationDispatcher, PromptWriter, DeferArchiveWriter, LOW_RISK_CHANNELS, makeIdempotencyKey, isLowRiskChannel, getChannelRiskLevel', async () => {
2557
+ const { readFileSync } = await import('node:fs');
2558
+ const { resolve } = await import('node:path');
2559
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
2560
+ expect(src).toContain('ActivationDispatcher');
2561
+ expect(src).toContain('PromptWriter');
2562
+ expect(src).toContain('DeferArchiveWriter');
2563
+ expect(src).toContain('LOW_RISK_CHANNELS');
2564
+ expect(src).toContain('makeIdempotencyKey');
2565
+ expect(src).toContain('isLowRiskChannel');
2566
+ expect(src).toContain('getChannelRiskLevel');
2567
+ });
2568
+ it('core barrel exports ActivationDecision, DispatchInput, PIArtifactSnapshot, ChannelWriter types', async () => {
2569
+ const { readFileSync } = await import('node:fs');
2570
+ const { resolve } = await import('node:path');
2571
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
2572
+ expect(src).toContain('ActivationDecision');
2573
+ expect(src).toContain('DispatchInput');
2574
+ expect(src).toContain('PIArtifactSnapshot');
2575
+ expect(src).toContain('ChannelWriter');
2576
+ });
2577
+ it('activation core files have zero infrastructure imports', async () => {
2578
+ const { readFileSync } = await import('node:fs');
2579
+ const { resolve } = await import('node:path');
2580
+ const files = [
2581
+ resolve(__dirname, '..', 'activation', 'activation-types.ts'),
2582
+ resolve(__dirname, '..', 'activation', 'activation-dispatcher.ts'),
2583
+ resolve(__dirname, '..', 'activation', 'low-risk-writers.ts'),
2584
+ resolve(__dirname, '..', 'activation', 'index.ts'),
2585
+ resolve(__dirname, '..', 'activation', 'approval-queue.ts'),
2586
+ resolve(__dirname, '..', 'activation', 'memory-approval-store.ts'),
2587
+ resolve(__dirname, '..', 'activation', 'sqlite-approval-store.ts'),
2588
+ ];
2589
+ for (const file of files) {
2590
+ const src = readFileSync(file, 'utf-8');
2591
+ expect(src).not.toContain('node:fs');
2592
+ expect(src).not.toContain('node:path');
2593
+ expect(src).not.toContain('node:process');
2594
+ expect(src).not.toContain('openclaw-plugin');
2595
+ }
2596
+ });
2597
+ it('activation/index.ts exports all public symbols', async () => {
2598
+ const { readFileSync } = await import('node:fs');
2599
+ const { resolve } = await import('node:path');
2600
+ const src = readFileSync(resolve(__dirname, '..', 'activation', 'index.ts'), 'utf-8');
2601
+ expect(src).toContain('ActivationDispatcher');
2602
+ expect(src).toContain('PromptWriter');
2603
+ expect(src).toContain('DeferArchiveWriter');
2604
+ expect(src).toContain('LOW_RISK_CHANNELS');
2605
+ expect(src).toContain('makeIdempotencyKey');
2606
+ expect(src).toContain('isLowRiskChannel');
2607
+ expect(src).toContain('getChannelRiskLevel');
2608
+ expect(src).toContain('MemoryActivationStateStore');
2609
+ expect(src).toContain('MemoryArtifactReadModel');
2610
+ expect(src).toContain('ApprovalQueue');
2611
+ expect(src).toContain('decideAutoPromotion');
2612
+ expect(src).toContain('MemoryApprovalQueueStore');
2613
+ expect(src).toContain('SqliteApprovalQueueStore');
2614
+ expect(src).toContain('ApprovalQueueStore');
2615
+ expect(src).toContain('AUTO_PROMOTION_CONFIDENCE_THRESHOLD');
2616
+ expect(src).toContain('AUTO_PROMOTABLE_CHANNELS');
2617
+ });
2618
+ });
2619
+ // ── PRI-189: SourceTraceLocator contract boundary ──────────────────────────────
2620
+ describe('PRI-189 SourceTraceLocator contract boundary', () => {
2621
+ it('source-trace-locator.ts has zero infrastructure imports', async () => {
2622
+ const { readFileSync } = await import('node:fs');
2623
+ const { resolve } = await import('node:path');
2624
+ const src = readFileSync(resolve(__dirname, '..', 'store', 'trajectory', 'source-trace-locator.ts'), 'utf-8');
2625
+ expect(src).not.toContain('node:fs');
2626
+ expect(src).not.toContain('node:path');
2627
+ expect(src).not.toContain('node:process');
2628
+ expect(src).not.toContain('openclaw-plugin');
2629
+ });
2630
+ it('sqlite-source-trace-locator.ts has zero infrastructure imports', async () => {
2631
+ const { readFileSync } = await import('node:fs');
2632
+ const { resolve } = await import('node:path');
2633
+ const src = readFileSync(resolve(__dirname, '..', 'store', 'trajectory', 'sqlite-source-trace-locator.ts'), 'utf-8');
2634
+ expect(src).not.toContain('node:fs');
2635
+ expect(src).not.toContain('node:path');
2636
+ expect(src).not.toContain('node:process');
2637
+ expect(src).not.toContain('openclaw-plugin');
2638
+ });
2639
+ it('core barrel exports SourceTraceLocator and SqliteSourceTraceLocator', async () => {
2640
+ const { readFileSync } = await import('node:fs');
2641
+ const { resolve } = await import('node:path');
2642
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
2643
+ expect(src).toContain('SourceTraceLocator');
2644
+ expect(src).toContain('SqliteSourceTraceLocator');
2645
+ expect(src).toContain('SourceTraceLocateDecision');
2646
+ expect(src).toContain('SourceTraceCandidate');
2647
+ });
2648
+ it('store/trajectory/index.ts re-exports SourceTraceLocator + SqliteSourceTraceLocator', async () => {
2649
+ const { existsSync, readFileSync } = await import('node:fs');
2650
+ const { resolve } = await import('node:path');
2651
+ const indexPath = resolve(__dirname, '..', 'store', 'trajectory', 'index.ts');
2652
+ expect(existsSync(indexPath)).toBe(true);
2653
+ const src = readFileSync(indexPath, 'utf-8');
2654
+ expect(src).toContain('SourceTraceLocator');
2655
+ expect(src).toContain('SqliteSourceTraceLocator');
2656
+ });
2657
+ });
2658
+ describe('PRI-190 FullTrace quality contract boundary', () => {
2659
+ it('full-trace-contract.ts has zero infrastructure imports', async () => {
2660
+ const { readFileSync } = await import('node:fs');
2661
+ const { resolve } = await import('node:path');
2662
+ const src = readFileSync(resolve(__dirname, '..', 'full-trace-contract.ts'), 'utf-8');
2663
+ expect(src).not.toContain('node:fs');
2664
+ expect(src).not.toContain('node:path');
2665
+ expect(src).not.toContain('node:process');
2666
+ expect(src).not.toContain('openclaw-plugin');
2667
+ });
2668
+ it('core barrel exports FullTracePayloadV2Schema and contract functions', async () => {
2669
+ const { readFileSync } = await import('node:fs');
2670
+ const { resolve } = await import('node:path');
2671
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
2672
+ expect(src).toContain('FullTracePayloadV2Schema');
2673
+ expect(src).toContain('TraceSourceRefSchema');
2674
+ expect(src).toContain('TraceTimelineEntrySchema');
2675
+ expect(src).toContain('validateFullTracePayload');
2676
+ expect(src).toContain('sanitizeFullTracePayload');
2677
+ expect(src).toContain('buildFullTraceTimeline');
2678
+ expect(src).toContain('buildSourceRefs');
2679
+ });
2680
+ it('context-payload.ts re-exports full-trace-contract types', async () => {
2681
+ const { readFileSync } = await import('node:fs');
2682
+ const { resolve } = await import('node:path');
2683
+ const src = readFileSync(resolve(__dirname, '..', 'context-payload.ts'), 'utf-8');
2684
+ expect(src).toContain('full-trace-contract');
2685
+ expect(src).toContain('FullTracePayloadV2Schema');
2686
+ expect(src).toContain('validateFullTracePayload');
2687
+ expect(src).toContain('sanitizeFullTracePayload');
2688
+ });
2689
+ it('DiagnosticianContextPayloadSchema accepts FullTracePayloadV2', async () => {
2690
+ const { readFileSync } = await import('node:fs');
2691
+ const { resolve } = await import('node:path');
2692
+ const src = readFileSync(resolve(__dirname, '..', 'context-payload.ts'), 'utf-8');
2693
+ expect(src).toContain('FullTracePayloadV2Schema');
2694
+ });
2695
+ });
2696
+ describe('PRI-191 TraceRefiner read model boundary', () => {
2697
+ it('trace-refiner.ts has zero infrastructure imports', async () => {
2698
+ const { readFileSync } = await import('node:fs');
2699
+ const { resolve } = await import('node:path');
2700
+ const src = readFileSync(resolve(__dirname, '..', 'trace-refiner.ts'), 'utf-8');
2701
+ expect(src).not.toContain('node:fs');
2702
+ expect(src).not.toContain('node:path');
2703
+ expect(src).not.toContain('node:process');
2704
+ expect(src).not.toContain('openclaw-plugin');
2705
+ });
2706
+ it('trace-refiner.ts has no LLM or network imports', async () => {
2707
+ const { readFileSync } = await import('node:fs');
2708
+ const { resolve } = await import('node:path');
2709
+ const src = readFileSync(resolve(__dirname, '..', 'trace-refiner.ts'), 'utf-8');
2710
+ expect(src).not.toContain('node:http');
2711
+ expect(src).not.toContain('node:https');
2712
+ expect(src).not.toContain('node:net');
2713
+ expect(src).not.toContain('fetch(');
2714
+ expect(src).not.toContain('openai');
2715
+ expect(src).not.toContain('anthropic');
2716
+ });
2717
+ it('core barrel exports refineFullTrace and RefinedTracePayload', async () => {
2718
+ const { readFileSync } = await import('node:fs');
2719
+ const { resolve } = await import('node:path');
2720
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
2721
+ expect(src).toContain('refineFullTrace');
2722
+ expect(src).toContain('RefinedTracePayload');
2723
+ expect(src).toContain('RefinedTraceEvent');
2724
+ expect(src).toContain('TraceRefinerOptions');
2725
+ expect(src).toContain('REFINED_EVENT_KINDS');
2726
+ expect(src).toContain('SEVERITY_LEVELS');
2727
+ });
2728
+ it('trace-refiner.ts imports only from full-trace-contract', async () => {
2729
+ const { readFileSync } = await import('node:fs');
2730
+ const { resolve } = await import('node:path');
2731
+ const src = readFileSync(resolve(__dirname, '..', 'trace-refiner.ts'), 'utf-8');
2732
+ const importLines = src.split('\n').filter((line) => line.trim().startsWith('import'));
2733
+ for (const line of importLines) {
2734
+ expect(line).toContain('full-trace-contract');
2735
+ }
2736
+ });
2737
+ });
2738
+ describe('PRI-192 TraceRefinerAgent shadow contract boundary', () => {
2739
+ it('trace-refiner-agent.ts has zero infrastructure imports', async () => {
2740
+ const { readFileSync } = await import('node:fs');
2741
+ const { resolve } = await import('node:path');
2742
+ const src = readFileSync(resolve(__dirname, '..', 'trace-refiner-agent.ts'), 'utf-8');
2743
+ expect(src).not.toContain('node:fs');
2744
+ expect(src).not.toContain('node:path');
2745
+ expect(src).not.toContain('node:process');
2746
+ expect(src).not.toContain('openclaw-plugin');
2747
+ });
2748
+ it('trace-refiner-agent.ts has no LLM or network imports', async () => {
2749
+ const { readFileSync } = await import('node:fs');
2750
+ const { resolve } = await import('node:path');
2751
+ const src = readFileSync(resolve(__dirname, '..', 'trace-refiner-agent.ts'), 'utf-8');
2752
+ expect(src).not.toContain('node:http');
2753
+ expect(src).not.toContain('node:https');
2754
+ expect(src).not.toContain('node:net');
2755
+ expect(src).not.toContain('fetch(');
2756
+ expect(src).not.toContain('openai');
2757
+ expect(src).not.toContain('anthropic');
2758
+ });
2759
+ it('core barrel exports TraceRefinerAgent types and functions', async () => {
2760
+ const { readFileSync } = await import('node:fs');
2761
+ const { resolve } = await import('node:path');
2762
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
2763
+ expect(src).toContain('createTraceRefinerAgentInput');
2764
+ expect(src).toContain('validateTraceRefinerAgentOutput');
2765
+ expect(src).toContain('applyTraceRefinerAgentShadowResult');
2766
+ expect(src).toContain('TraceRefinerAgentInput');
2767
+ expect(src).toContain('TraceRefinerAgentOutput');
2768
+ expect(src).toContain('TraceRefinerAgentObjective');
2769
+ expect(src).toContain('TraceRefinerAgentMode');
2770
+ expect(src).toContain('TraceRefinerEvidenceClaim');
2771
+ expect(src).toContain('TraceRefinerRejectedEvidence');
2772
+ expect(src).toContain('TraceRefinerAgentStatus');
2773
+ });
2774
+ it('trace-refiner-agent.ts imports only from full-trace-contract and trace-refiner', async () => {
2775
+ const { readFileSync } = await import('node:fs');
2776
+ const { resolve } = await import('node:path');
2777
+ const src = readFileSync(resolve(__dirname, '..', 'trace-refiner-agent.ts'), 'utf-8');
2778
+ const importLines = src.split('\n').filter((line) => line.trim().startsWith('import'));
2779
+ const allowedModules = ["'./full-trace-contract", "'./trace-refiner"];
2780
+ for (const line of importLines) {
2781
+ expect(allowedModules.some((mod) => line.includes(mod))).toBe(true);
2782
+ }
2783
+ });
2784
+ });
2785
+ // ── PRI-215: Synthetic baseline architecture boundary ──────────────────────
2786
+ //
2787
+ // After PRI-206, the architecture is:
2788
+ // Core: packages/principles-core/src/runtime-v2/synthetic-baseline.ts
2789
+ // (pure contract/helper code — zero I/O)
2790
+ // I/O Runner: packages/pd-cli/src/services/synthetic-baseline-runner.ts
2791
+ // CLI Command: packages/pd-cli/src/commands/runtime-synthetic-baseline.ts
2792
+ //
2793
+ // These guards prevent future PRs from moving I/O back into core.
2794
+ // ERR-011 reference: core must not import runtime orchestration classes
2795
+ // ERR-012 reference: guard against stale-main rollback of baseline
2796
+ // ERR-002 reference: not applicable — no degrade path in these tests
2797
+ const FORBIDDEN_NODE_IO_MODULES = new Set([
2798
+ 'fs',
2799
+ 'fs/promises',
2800
+ 'path',
2801
+ 'os',
2802
+ 'child_process',
2803
+ 'process',
2804
+ 'better-sqlite3',
2805
+ 'node:fs',
2806
+ 'node:path',
2807
+ 'node:os',
2808
+ 'node:child_process',
2809
+ 'node:process',
2810
+ ]);
2811
+ const FORBIDDEN_RUNTIME_ORCHESTRATION_CLASSES = new Set([
2812
+ 'RuntimeStateManager',
2813
+ 'SqliteContextAssembler',
2814
+ 'SqliteHistoryQuery',
2815
+ 'SqliteDiagnosticianCommitter',
2816
+ 'PainSignalBridge',
2817
+ 'DiagnosticianRunner',
2818
+ 'TestDoubleRuntimeAdapter',
2819
+ 'OperatorHealthReadModel',
2820
+ 'createInternalizationQueueReadModel',
2821
+ 'PrincipleTreeLedgerAdapter',
2822
+ 'CandidateIntakeService',
2823
+ ]);
2824
+ describe('PRI-215 synthetic baseline architecture boundary', () => {
2825
+ function extractImportModulePaths(src) {
2826
+ const paths = [];
2827
+ for (const m of src.matchAll(/import\s+[\s\S]*?from\s+['"]([^'"]+)['"]/g)) {
2828
+ if (m[1] != null)
2829
+ paths.push(m[1]);
2830
+ }
2831
+ for (const m of src.matchAll(/import\s+['"]([^'"]+)['"]/g)) {
2832
+ if (m[1] != null && !paths.includes(m[1]))
2833
+ paths.push(m[1]);
2834
+ }
2835
+ return paths;
2836
+ }
2837
+ function extractImportIdentifiers(src) {
2838
+ const ids = [];
2839
+ for (const block of src.matchAll(/import\s+([\s\S]*?)\s+from\s+['"][^'"]+['"]/g)) {
2840
+ if (block[1] == null)
2841
+ continue;
2842
+ const clause = block[1].trim();
2843
+ const defaultMatch = /^(\w+)/.exec(clause);
2844
+ if (defaultMatch?.[1])
2845
+ ids.push(defaultMatch[1]);
2846
+ const namedMatch = /\{([\s\S]*)\}/.exec(clause);
2847
+ if (namedMatch?.[1]) {
2848
+ namedMatch[1].split(',').forEach((part) => {
2849
+ const trimmed = part.trim();
2850
+ if (!trimmed)
2851
+ return;
2852
+ const asParts = trimmed.split(/\s+as\s+/);
2853
+ if (asParts[0])
2854
+ ids.push(asParts[0].trim());
2855
+ if (asParts.length > 1) {
2856
+ const alias = asParts[asParts.length - 1];
2857
+ if (alias)
2858
+ ids.push(alias.trim());
2859
+ }
2860
+ });
2861
+ }
2862
+ }
2863
+ return ids;
2864
+ }
2865
+ // ── Core boundary: no Node I/O imports ──────────────────────────────────
2866
+ it('CORE_NO_NODE_IO: synthetic-baseline.ts does not import Node I/O modules', async () => {
2867
+ const { readFileSync } = await import('node:fs');
2868
+ const { resolve } = await import('node:path');
2869
+ const src = readFileSync(resolve(__dirname, '..', 'synthetic-baseline.ts'), 'utf-8');
2870
+ const importModulePaths = extractImportModulePaths(src);
2871
+ for (const mod of FORBIDDEN_NODE_IO_MODULES) {
2872
+ const found = importModulePaths.filter((p) => p === mod || p.startsWith(mod + '/'));
2873
+ expect(found).toEqual([]);
2874
+ }
2875
+ });
2876
+ // ── Core boundary: no runtime orchestration imports ─────────────────────
2877
+ it('CORE_NO_RUNTIME_CLASSES: synthetic-baseline.ts does not import runtime orchestration classes', async () => {
2878
+ const { readFileSync } = await import('node:fs');
2879
+ const { resolve } = await import('node:path');
2880
+ const src = readFileSync(resolve(__dirname, '..', 'synthetic-baseline.ts'), 'utf-8');
2881
+ const importIdentifiers = extractImportIdentifiers(src);
2882
+ for (const cls of FORBIDDEN_RUNTIME_ORCHESTRATION_CLASSES) {
2883
+ expect(importIdentifiers).not.toContain(cls);
2884
+ }
2885
+ });
2886
+ // ── Import parsing: side-effect import detection ────────────────────────
2887
+ it('IMPORT_PARSING_SIDE_EFFECT: extractImportModulePaths catches side-effect imports like import "node:fs"', () => {
2888
+ const src = `import 'node:fs';\nimport { foo } from 'bar';\n`;
2889
+ const paths = extractImportModulePaths(src);
2890
+ expect(paths).toContain('node:fs');
2891
+ expect(paths).toContain('bar');
2892
+ });
2893
+ // ── Import parsing: multiline import detection ──────────────────────────
2894
+ it('IMPORT_PARSING_MULTILINE: extractImportModulePaths catches multiline imports from forbidden modules', () => {
2895
+ const src = `import {\n RuntimeStateManager,\n SqliteContextAssembler\n} from './runtime';\n`;
2896
+ const paths = extractImportModulePaths(src);
2897
+ expect(paths).toContain('./runtime');
2898
+ });
2899
+ // ── Import parsing: aliased named import detection ──────────────────────
2900
+ it('IMPORT_PARSING_ALIAS: extractImportIdentifiers catches both original and alias for "as" imports', () => {
2901
+ const src = `import { RuntimeStateManager as RSM, PainSignalBridge } from './runtime';\n`;
2902
+ const ids = extractImportIdentifiers(src);
2903
+ expect(ids).toContain('RuntimeStateManager');
2904
+ expect(ids).toContain('RSM');
2905
+ expect(ids).toContain('PainSignalBridge');
2906
+ });
2907
+ // ── I/O Runner location ─────────────────────────────────────────────────
2908
+ it('IO_RUNNER_OUTSIDE_CORE: I/O runner exists at pd-cli/src/services/synthetic-baseline-runner.ts', async () => {
2909
+ const { existsSync } = await import('node:fs');
2910
+ const { resolve } = await import('node:path');
2911
+ const runnerPath = resolve(__dirname, '../../../../pd-cli/src/services/synthetic-baseline-runner.ts');
2912
+ expect(existsSync(runnerPath)).toBe(true);
2913
+ });
2914
+ // ── CLI Command location ────────────────────────────────────────────────
2915
+ it('CLI_COMMAND_OUTSIDE_CORE: CLI command exists at pd-cli/src/commands/runtime-synthetic-baseline.ts', async () => {
2916
+ const { existsSync } = await import('node:fs');
2917
+ const { resolve } = await import('node:path');
2918
+ const cmdPath = resolve(__dirname, '../../../../pd-cli/src/commands/runtime-synthetic-baseline.ts');
2919
+ expect(existsSync(cmdPath)).toBe(true);
2920
+ });
2921
+ // ── Frozen legacy untouched ────────────────────────────────────────────
2922
+ it('FROZEN_LEGACY_UNTOUCHED: ADR-0005 frozen files are not imported by synthetic-baseline.ts', async () => {
2923
+ const { readFileSync } = await import('node:fs');
2924
+ const { resolve } = await import('node:path');
2925
+ const src = readFileSync(resolve(__dirname, '..', 'synthetic-baseline.ts'), 'utf-8');
2926
+ expect(src).not.toContain('nocturnal-trinity');
2927
+ expect(src).not.toContain('nocturnal-arbiter');
2928
+ expect(src).not.toContain('nocturnal-service');
2929
+ });
2930
+ });
2931
+ describe('PRI-225: No unsafe type assertions on untrusted metadata arrays', () => {
2932
+ it('INTEGRITY_READ_MODEL_NO_AS_STRING_ARRAY: internalization-chain-integrity-read-model.ts must not use `as string[]` on untrusted data', async () => {
2933
+ const { readFileSync } = await import('node:fs');
2934
+ const { resolve } = await import('node:path');
2935
+ const src = readFileSync(resolve(__dirname, '..', 'internalization-chain-integrity-read-model.ts'), 'utf-8');
2936
+ expect(src).not.toContain('as string[]');
2937
+ });
2938
+ });
2939
+ // ── PRI-239: Feature flag registry architecture boundary ──────────────────
2940
+ //
2941
+ // Core: packages/principles-core/src/runtime-v2/feature-flags/feature-flag-contract.ts
2942
+ // I/O Loader: packages/pd-cli/src/services/feature-flag-loader.ts
2943
+ // CLI Command: packages/pd-cli/src/commands/runtime-features.ts
2944
+ // Consumption: packages/pd-cli/src/commands/runtime-canary.ts (GFI check)
2945
+ describe('PRI-239: Feature flag registry architecture boundary', () => {
2946
+ it('CORE_NO_NODE_IO: feature-flag-contract.ts does not import Node I/O modules', async () => {
2947
+ const { readFileSync } = await import('node:fs');
2948
+ const { resolve } = await import('node:path');
2949
+ const src = readFileSync(resolve(__dirname, '..', 'feature-flags', 'feature-flag-contract.ts'), 'utf-8');
2950
+ expect(src).not.toMatch(/from\s+['"]node:fs['"]/);
2951
+ expect(src).not.toMatch(/from\s+['"]node:path['"]/);
2952
+ expect(src).not.toMatch(/from\s+['"]fs['"]/);
2953
+ expect(src).not.toMatch(/from\s+['"]path['"]/);
2954
+ expect(src).not.toMatch(/from\s+['"]js-yaml['"]/);
2955
+ });
2956
+ it('CORE_NO_RUNTIME_CLASSES: feature-flag-contract.ts does not import runtime orchestration classes', async () => {
2957
+ const { readFileSync } = await import('node:fs');
2958
+ const { resolve } = await import('node:path');
2959
+ const src = readFileSync(resolve(__dirname, '..', 'feature-flags', 'feature-flag-contract.ts'), 'utf-8');
2960
+ expect(src).not.toContain('RuntimeStateManager');
2961
+ expect(src).not.toContain('InternalizationOrchestrator');
2962
+ expect(src).not.toContain('SqliteConnection');
2963
+ });
2964
+ it('IO_LOADER_OUTSIDE_CORE: I/O loader exists at pd-cli/src/services/feature-flag-loader.ts', async () => {
2965
+ const { existsSync } = await import('node:fs');
2966
+ const { resolve } = await import('node:path');
2967
+ expect(existsSync(resolve(__dirname, '../../../../pd-cli/src/services/feature-flag-loader.ts'))).toBe(true);
2968
+ });
2969
+ it('CLI_COMMAND_OUTSIDE_CORE: CLI command exists at pd-cli/src/commands/runtime-features.ts', async () => {
2970
+ const { existsSync } = await import('node:fs');
2971
+ const { resolve } = await import('node:path');
2972
+ expect(existsSync(resolve(__dirname, '../../../../pd-cli/src/commands/runtime-features.ts'))).toBe(true);
2973
+ });
2974
+ it('FROZEN_LEGACY_UNTOUCHED: ADR-0005 frozen files are not imported by feature-flag-contract.ts', async () => {
2975
+ const { readFileSync } = await import('node:fs');
2976
+ const { resolve } = await import('node:path');
2977
+ const src = readFileSync(resolve(__dirname, '..', 'feature-flags', 'feature-flag-contract.ts'), 'utf-8');
2978
+ expect(src).not.toContain('nocturnal-trinity');
2979
+ expect(src).not.toContain('nocturnal-arbiter');
2980
+ expect(src).not.toContain('nocturnal-service');
2981
+ });
2982
+ it('CONSUMPTION_WIRED: runtime-canary.ts imports feature flag loader', async () => {
2983
+ const { readFileSync } = await import('node:fs');
2984
+ const { resolve } = await import('node:path');
2985
+ const src = readFileSync(resolve(__dirname, '../../../../pd-cli/src/commands/runtime-canary.ts'), 'utf-8');
2986
+ expect(src).toContain('feature-flag-loader');
2987
+ expect(src).toContain('loadEffectiveFeatureFlags');
2988
+ });
2989
+ });
2990
+ //# sourceMappingURL=architecture-regression.test.js.map