create-principles-disciple 1.86.0 → 1.87.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 (1327) hide show
  1. package/console/dist/server/index.js +6 -50
  2. package/console/dist/server/models/ActivationsConsoleModel.d.ts +0 -4
  3. package/console/dist/server/models/ActivationsConsoleModel.js +64 -72
  4. package/console/dist/server/models/ApprovalsConsoleModel.d.ts +33 -7
  5. package/console/dist/server/models/ApprovalsConsoleModel.js +203 -57
  6. package/console/dist/server/models/ApprovalsGroupedConsoleModel.d.ts +4 -2
  7. package/console/dist/server/models/ApprovalsGroupedConsoleModel.js +179 -91
  8. package/console/dist/server/models/EvidenceChainConsoleModel.d.ts +4 -28
  9. package/console/dist/server/models/EvidenceChainConsoleModel.js +103 -298
  10. package/console/dist/server/models/GovernanceConsoleModel.d.ts +6 -4
  11. package/console/dist/server/models/GovernanceConsoleModel.js +269 -195
  12. package/console/dist/server/models/PrincipleClassifier.js +1 -1
  13. package/console/dist/server/models/PrincipleTrajectoryModel.d.ts +49 -0
  14. package/console/dist/server/models/PrincipleTrajectoryModel.js +485 -0
  15. package/console/dist/server/routes/approvals.js +65 -2
  16. package/console/dist/server/routes/principles.js +33 -0
  17. package/console/dist/server/routes/update.js +75 -26
  18. package/console/dist/ui/App.js +4 -2
  19. package/console/dist/ui/api.d.ts +6 -11
  20. package/console/dist/ui/api.js +19 -23
  21. package/console/dist/ui/components/focus/daily-thought-card.d.ts +1 -0
  22. package/console/dist/ui/components/focus/daily-thought-card.js +41 -0
  23. package/console/dist/ui/components/layout/app-sidebar.js +6 -4
  24. package/console/dist/ui/components/layout/page-loading.d.ts +13 -0
  25. package/console/dist/ui/components/layout/page-loading.js +14 -0
  26. package/console/dist/ui/components/layout/page-shell.d.ts +1 -0
  27. package/console/dist/ui/components/layout/page-shell.js +2 -1
  28. package/console/dist/ui/components/layout/section-title.js +1 -1
  29. package/console/dist/ui/components/notifications/NotificationProvider.d.ts +14 -0
  30. package/console/dist/ui/components/notifications/NotificationProvider.js +130 -0
  31. package/console/dist/ui/components/notifications/favicon-badge.d.ts +3 -0
  32. package/console/dist/ui/components/notifications/favicon-badge.js +68 -0
  33. package/console/dist/ui/components/notifications/notification-reducer.d.ts +9 -0
  34. package/console/dist/ui/components/notifications/notification-reducer.js +9 -0
  35. package/console/dist/ui/components/notifications/sound-storage.d.ts +3 -0
  36. package/console/dist/ui/components/notifications/sound-storage.js +37 -0
  37. package/console/dist/ui/components/notifications/useNotifications.d.ts +1 -0
  38. package/console/dist/ui/components/notifications/useNotifications.js +9 -0
  39. package/console/dist/ui/components/ui/badge.js +1 -1
  40. package/console/dist/ui/components/ui/button.d.ts +2 -2
  41. package/console/dist/ui/components/ui/button.js +1 -1
  42. package/console/dist/ui/components/ui/card.js +1 -1
  43. package/console/dist/ui/components/ui/input.js +1 -1
  44. package/console/dist/ui/components/ui/sheet.d.ts +1 -1
  45. package/console/dist/ui/data/daily-thoughts.d.ts +15 -0
  46. package/console/dist/ui/data/daily-thoughts.js +164 -0
  47. package/console/dist/ui/hooks/useNotificationSound.d.ts +12 -0
  48. package/console/dist/ui/hooks/useNotificationSound.js +74 -0
  49. package/console/dist/ui/i18n/en.json +94 -12
  50. package/console/dist/ui/i18n/zh-CN.json +94 -12
  51. package/console/dist/ui/pages/activation/ActivationPage.js +8 -15
  52. package/console/dist/ui/pages/control-center/ControlCenterPage.js +11 -9
  53. package/console/dist/ui/pages/focus/FocusPage.d.ts +13 -0
  54. package/console/dist/ui/pages/focus/FocusPage.js +140 -19
  55. package/console/dist/ui/pages/pain/PainPage.js +71 -32
  56. package/console/dist/ui/pages/pain/pain-card-helpers.d.ts +100 -0
  57. package/console/dist/ui/pages/pain/pain-card-helpers.js +103 -0
  58. package/console/dist/ui/pages/principles/PrincipleDetailPage.js +99 -20
  59. package/console/dist/ui/pages/principles/PrinciplesPage.js +8 -8
  60. package/console/dist/ui/pages/report-problem/ReportProblemPage.js +20 -18
  61. package/console/dist/ui/pages/settings/SettingsPage.js +9 -5
  62. package/console/dist/ui/pages/settings/UpdatePage.d.ts +0 -4
  63. package/console/dist/ui/pages/settings/UpdatePage.js +78 -75
  64. package/console/dist/ui/utils/control-center-helpers.d.ts +2 -0
  65. package/console/dist/ui/utils/enum-labels.d.ts +50 -0
  66. package/console/dist/ui/utils/enum-labels.js +164 -0
  67. package/console/dist/ui/utils/validators.d.ts +62 -6
  68. package/console/dist/ui/utils/validators.js +222 -22
  69. package/console/dist/web/assets/app.css +269 -122
  70. package/console/dist/web/assets/app.js +8134 -3177
  71. package/console/package.json +6 -3
  72. package/core/dist/evolution-store.js +0 -2
  73. package/core/dist/evolution-store.js.map +1 -1
  74. package/core/dist/index.d.ts +1 -10
  75. package/core/dist/index.d.ts.map +1 -1
  76. package/core/dist/index.js +1 -7
  77. package/core/dist/index.js.map +1 -1
  78. package/core/dist/io.d.ts +0 -1
  79. package/core/dist/io.d.ts.map +1 -1
  80. package/core/dist/io.js +0 -4
  81. package/core/dist/io.js.map +1 -1
  82. package/core/dist/principle-injector.d.ts +1 -1
  83. package/core/dist/principle-injector.d.ts.map +1 -1
  84. package/core/dist/prompt-builder/__tests__/prompt-builder-core.test.js.map +1 -1
  85. package/core/dist/quality-scorecard/__tests__/quality-scorecard.test.d.ts +2 -0
  86. package/core/dist/quality-scorecard/__tests__/quality-scorecard.test.d.ts.map +1 -0
  87. package/core/dist/quality-scorecard/__tests__/quality-scorecard.test.js +531 -0
  88. package/core/dist/quality-scorecard/__tests__/quality-scorecard.test.js.map +1 -0
  89. package/core/dist/quality-scorecard/index.d.ts +11 -0
  90. package/core/dist/quality-scorecard/index.d.ts.map +1 -0
  91. package/core/dist/quality-scorecard/index.js +4 -0
  92. package/core/dist/quality-scorecard/index.js.map +1 -0
  93. package/core/dist/quality-scorecard/report-generator.d.ts +11 -0
  94. package/core/dist/quality-scorecard/report-generator.d.ts.map +1 -0
  95. package/core/dist/quality-scorecard/report-generator.js +204 -0
  96. package/core/dist/quality-scorecard/report-generator.js.map +1 -0
  97. package/core/dist/quality-scorecard/types.d.ts +106 -0
  98. package/core/dist/quality-scorecard/types.d.ts.map +1 -0
  99. package/core/dist/quality-scorecard/types.js +51 -0
  100. package/core/dist/quality-scorecard/types.js.map +1 -0
  101. package/core/dist/quality-scorecard/validation.d.ts +73 -0
  102. package/core/dist/quality-scorecard/validation.d.ts.map +1 -0
  103. package/core/dist/quality-scorecard/validation.js +251 -0
  104. package/core/dist/quality-scorecard/validation.js.map +1 -0
  105. package/core/dist/runtime-v2/__tests__/activation-types-helpers.test.d.ts +20 -0
  106. package/core/dist/runtime-v2/__tests__/activation-types-helpers.test.d.ts.map +1 -0
  107. package/core/dist/runtime-v2/__tests__/activation-types-helpers.test.js +223 -0
  108. package/core/dist/runtime-v2/__tests__/activation-types-helpers.test.js.map +1 -0
  109. package/core/dist/runtime-v2/__tests__/admission-gate.test.js +56 -3
  110. package/core/dist/runtime-v2/__tests__/admission-gate.test.js.map +1 -1
  111. package/core/dist/runtime-v2/__tests__/adversarial-loop.test.d.ts +2 -0
  112. package/core/dist/runtime-v2/__tests__/adversarial-loop.test.d.ts.map +1 -0
  113. package/core/dist/runtime-v2/__tests__/adversarial-loop.test.js +381 -0
  114. package/core/dist/runtime-v2/__tests__/adversarial-loop.test.js.map +1 -0
  115. package/core/dist/runtime-v2/__tests__/architecture-regression.test.js +175 -83
  116. package/core/dist/runtime-v2/__tests__/architecture-regression.test.js.map +1 -1
  117. package/core/dist/runtime-v2/__tests__/artificer-runner-vslice.test.js +40 -80
  118. package/core/dist/runtime-v2/__tests__/artificer-runner-vslice.test.js.map +1 -1
  119. package/core/dist/runtime-v2/__tests__/attack-e2e-pipeline-smoke.test.js +126 -21
  120. package/core/dist/runtime-v2/__tests__/attack-e2e-pipeline-smoke.test.js.map +1 -1
  121. package/core/dist/runtime-v2/__tests__/build-golden-trace-from-artificer.test.d.ts +2 -0
  122. package/core/dist/runtime-v2/__tests__/build-golden-trace-from-artificer.test.d.ts.map +1 -0
  123. package/core/dist/runtime-v2/__tests__/build-golden-trace-from-artificer.test.js +169 -0
  124. package/core/dist/runtime-v2/__tests__/build-golden-trace-from-artificer.test.js.map +1 -0
  125. package/core/dist/runtime-v2/__tests__/build-l2-principle-reader.test.d.ts +2 -0
  126. package/core/dist/runtime-v2/__tests__/build-l2-principle-reader.test.d.ts.map +1 -0
  127. package/core/dist/runtime-v2/__tests__/build-l2-principle-reader.test.js +200 -0
  128. package/core/dist/runtime-v2/__tests__/build-l2-principle-reader.test.js.map +1 -0
  129. package/core/dist/runtime-v2/__tests__/chain-integrity-real-path.test.js +20 -3
  130. package/core/dist/runtime-v2/__tests__/chain-integrity-real-path.test.js.map +1 -1
  131. package/core/dist/runtime-v2/__tests__/dreamer-output-validator.test.js.map +1 -1
  132. package/core/dist/runtime-v2/__tests__/dreamer-runner-vslice.test.js +12 -0
  133. package/core/dist/runtime-v2/__tests__/dreamer-runner-vslice.test.js.map +1 -1
  134. package/core/dist/runtime-v2/__tests__/dreamer-runner.test.js +10 -5
  135. package/core/dist/runtime-v2/__tests__/dreamer-runner.test.js.map +1 -1
  136. package/core/dist/runtime-v2/__tests__/evaluator-runner-vslice-v2.test.d.ts +2 -0
  137. package/core/dist/runtime-v2/__tests__/evaluator-runner-vslice-v2.test.d.ts.map +1 -0
  138. package/core/dist/runtime-v2/__tests__/evaluator-runner-vslice-v2.test.js +831 -0
  139. package/core/dist/runtime-v2/__tests__/evaluator-runner-vslice-v2.test.js.map +1 -0
  140. package/core/dist/runtime-v2/__tests__/evaluator-runner-vslice.test.js +22 -0
  141. package/core/dist/runtime-v2/__tests__/evaluator-runner-vslice.test.js.map +1 -1
  142. package/core/dist/runtime-v2/__tests__/evidence-chain-contract.test.d.ts +2 -0
  143. package/core/dist/runtime-v2/__tests__/evidence-chain-contract.test.d.ts.map +1 -0
  144. package/core/dist/runtime-v2/__tests__/evidence-chain-contract.test.js +344 -0
  145. package/core/dist/runtime-v2/__tests__/evidence-chain-contract.test.js.map +1 -0
  146. package/core/dist/runtime-v2/__tests__/evidence-guards.test.d.ts +18 -0
  147. package/core/dist/runtime-v2/__tests__/evidence-guards.test.d.ts.map +1 -0
  148. package/core/dist/runtime-v2/__tests__/evidence-guards.test.js +155 -0
  149. package/core/dist/runtime-v2/__tests__/evidence-guards.test.js.map +1 -0
  150. package/core/dist/runtime-v2/__tests__/evidence-sanitizer.test.js +4 -3
  151. package/core/dist/runtime-v2/__tests__/evidence-sanitizer.test.js.map +1 -1
  152. package/core/dist/runtime-v2/__tests__/feedback/privacy-preview.test.js.map +1 -1
  153. package/core/dist/runtime-v2/__tests__/feedback/render-github-url.test.js.map +1 -1
  154. package/core/dist/runtime-v2/__tests__/feedback/render-markdown.test.js.map +1 -1
  155. package/core/dist/runtime-v2/__tests__/fixtures/llm-e2e-config.d.ts.map +1 -1
  156. package/core/dist/runtime-v2/__tests__/fixtures/llm-e2e-config.js +3 -2
  157. package/core/dist/runtime-v2/__tests__/fixtures/llm-e2e-config.js.map +1 -1
  158. package/core/dist/runtime-v2/__tests__/fixtures/llm-e2e-config.test.js +19 -29
  159. package/core/dist/runtime-v2/__tests__/fixtures/llm-e2e-config.test.js.map +1 -1
  160. package/core/dist/runtime-v2/__tests__/full-chain-real-llm.test.js +2 -2
  161. package/core/dist/runtime-v2/__tests__/full-chain-real-llm.test.js.map +1 -1
  162. package/core/dist/runtime-v2/__tests__/golden-path-diagnostician-e2e.test.d.ts +2 -0
  163. package/core/dist/runtime-v2/__tests__/golden-path-diagnostician-e2e.test.d.ts.map +1 -0
  164. package/core/dist/runtime-v2/__tests__/golden-path-diagnostician-e2e.test.js +372 -0
  165. package/core/dist/runtime-v2/__tests__/golden-path-diagnostician-e2e.test.js.map +1 -0
  166. package/core/dist/runtime-v2/__tests__/intake-to-internalization-bridge.test.js +219 -2
  167. package/core/dist/runtime-v2/__tests__/intake-to-internalization-bridge.test.js.map +1 -1
  168. package/core/dist/runtime-v2/__tests__/internalization-chain-integrity-read-model.test.js +96 -0
  169. package/core/dist/runtime-v2/__tests__/internalization-chain-integrity-read-model.test.js.map +1 -1
  170. package/core/dist/runtime-v2/__tests__/internalization-consumer-product-path.test.d.ts +2 -0
  171. package/core/dist/runtime-v2/__tests__/internalization-consumer-product-path.test.d.ts.map +1 -0
  172. package/core/dist/runtime-v2/__tests__/internalization-consumer-product-path.test.js +226 -0
  173. package/core/dist/runtime-v2/__tests__/internalization-consumer-product-path.test.js.map +1 -0
  174. package/core/dist/runtime-v2/__tests__/internalization-failure-persistence.test.d.ts +2 -0
  175. package/core/dist/runtime-v2/__tests__/internalization-failure-persistence.test.d.ts.map +1 -0
  176. package/core/dist/runtime-v2/__tests__/internalization-failure-persistence.test.js +153 -0
  177. package/core/dist/runtime-v2/__tests__/internalization-failure-persistence.test.js.map +1 -0
  178. package/core/dist/runtime-v2/__tests__/internalization-integrity-remediation.test.js +525 -5
  179. package/core/dist/runtime-v2/__tests__/internalization-integrity-remediation.test.js.map +1 -1
  180. package/core/dist/runtime-v2/__tests__/internalization-orchestrator.test.js +1 -3
  181. package/core/dist/runtime-v2/__tests__/internalization-orchestrator.test.js.map +1 -1
  182. package/core/dist/runtime-v2/__tests__/internalization-peer-runner-contracts.test.js +6 -0
  183. package/core/dist/runtime-v2/__tests__/internalization-peer-runner-contracts.test.js.map +1 -1
  184. package/core/dist/runtime-v2/__tests__/internalization-queue-read-model.test.js +0 -1
  185. package/core/dist/runtime-v2/__tests__/internalization-queue-read-model.test.js.map +1 -1
  186. package/core/dist/runtime-v2/__tests__/internalization-state-machine.test.js.map +1 -1
  187. package/core/dist/runtime-v2/__tests__/mainline-contract.test.d.ts +2 -0
  188. package/core/dist/runtime-v2/__tests__/mainline-contract.test.d.ts.map +1 -0
  189. package/core/dist/runtime-v2/__tests__/mainline-contract.test.js +194 -0
  190. package/core/dist/runtime-v2/__tests__/mainline-contract.test.js.map +1 -0
  191. package/core/dist/runtime-v2/__tests__/mainline-product-path.test.d.ts +2 -0
  192. package/core/dist/runtime-v2/__tests__/mainline-product-path.test.d.ts.map +1 -0
  193. package/core/dist/runtime-v2/__tests__/mainline-product-path.test.js +429 -0
  194. package/core/dist/runtime-v2/__tests__/mainline-product-path.test.js.map +1 -0
  195. package/core/dist/runtime-v2/__tests__/pain-chain-read-model.test.js +0 -1
  196. package/core/dist/runtime-v2/__tests__/pain-chain-read-model.test.js.map +1 -1
  197. package/core/dist/runtime-v2/__tests__/pain-evidence-contract.test.js +5 -2
  198. package/core/dist/runtime-v2/__tests__/pain-evidence-contract.test.js.map +1 -1
  199. package/core/dist/runtime-v2/__tests__/pain-signal-bridge-retried.test.js +10 -6
  200. package/core/dist/runtime-v2/__tests__/pain-signal-bridge-retried.test.js.map +1 -1
  201. package/core/dist/runtime-v2/__tests__/pain-signal-bridge-short-circuit.test.d.ts +2 -0
  202. package/core/dist/runtime-v2/__tests__/pain-signal-bridge-short-circuit.test.d.ts.map +1 -0
  203. package/core/dist/runtime-v2/__tests__/pain-signal-bridge-short-circuit.test.js +211 -0
  204. package/core/dist/runtime-v2/__tests__/pain-signal-bridge-short-circuit.test.js.map +1 -0
  205. package/core/dist/runtime-v2/__tests__/pain-signal-bridge-workspace-dir.test.d.ts +2 -0
  206. package/core/dist/runtime-v2/__tests__/pain-signal-bridge-workspace-dir.test.d.ts.map +1 -0
  207. package/core/dist/runtime-v2/__tests__/pain-signal-bridge-workspace-dir.test.js +182 -0
  208. package/core/dist/runtime-v2/__tests__/pain-signal-bridge-workspace-dir.test.js.map +1 -0
  209. package/core/dist/runtime-v2/__tests__/pain-signal-observability.test.js +53 -0
  210. package/core/dist/runtime-v2/__tests__/pain-signal-observability.test.js.map +1 -1
  211. package/core/dist/runtime-v2/__tests__/philosopher-runner-vslice.test.js +4 -0
  212. package/core/dist/runtime-v2/__tests__/philosopher-runner-vslice.test.js.map +1 -1
  213. package/core/dist/runtime-v2/__tests__/pitask-metadata.test.js +5 -1
  214. package/core/dist/runtime-v2/__tests__/pitask-metadata.test.js.map +1 -1
  215. package/core/dist/runtime-v2/__tests__/principle-compiler-core.test.js +85 -7
  216. package/core/dist/runtime-v2/__tests__/principle-compiler-core.test.js.map +1 -1
  217. package/core/dist/runtime-v2/__tests__/proven-channel-baseline.test.js +14 -1
  218. package/core/dist/runtime-v2/__tests__/proven-channel-baseline.test.js.map +1 -1
  219. package/core/dist/runtime-v2/__tests__/pruning-read-model.test.js +11 -6
  220. package/core/dist/runtime-v2/__tests__/pruning-read-model.test.js.map +1 -1
  221. package/core/dist/runtime-v2/__tests__/rollout-reviewer-runner-vslice.test.js +8 -0
  222. package/core/dist/runtime-v2/__tests__/rollout-reviewer-runner-vslice.test.js.map +1 -1
  223. package/core/dist/runtime-v2/__tests__/rulehost-oob-defense-simulation.test.js.map +1 -1
  224. package/core/dist/runtime-v2/__tests__/scribe-runner-vslice.test.js +4 -0
  225. package/core/dist/runtime-v2/__tests__/scribe-runner-vslice.test.js.map +1 -1
  226. package/core/dist/runtime-v2/__tests__/stalled-diagnostician-task.test.d.ts +2 -0
  227. package/core/dist/runtime-v2/__tests__/stalled-diagnostician-task.test.d.ts.map +1 -0
  228. package/core/dist/runtime-v2/__tests__/stalled-diagnostician-task.test.js +168 -0
  229. package/core/dist/runtime-v2/__tests__/stalled-diagnostician-task.test.js.map +1 -0
  230. package/core/dist/runtime-v2/__tests__/task-three-strikes.test.js.map +1 -1
  231. package/core/dist/runtime-v2/__tests__/trace-refiner-agent.test.js.map +1 -1
  232. package/core/dist/runtime-v2/__tests__/trainer-output-validator.test.js.map +1 -1
  233. package/core/dist/runtime-v2/__tests__/trainer-runner-vslice.test.js +8 -0
  234. package/core/dist/runtime-v2/__tests__/trainer-runner-vslice.test.js.map +1 -1
  235. package/core/dist/runtime-v2/activation/__tests__/activation-dispatcher.test.js +7 -1
  236. package/core/dist/runtime-v2/activation/__tests__/activation-dispatcher.test.js.map +1 -1
  237. package/core/dist/runtime-v2/activation/__tests__/approval-completion-service.test.d.ts +21 -0
  238. package/core/dist/runtime-v2/activation/__tests__/approval-completion-service.test.d.ts.map +1 -0
  239. package/core/dist/runtime-v2/activation/__tests__/approval-completion-service.test.js +363 -0
  240. package/core/dist/runtime-v2/activation/__tests__/approval-completion-service.test.js.map +1 -0
  241. package/core/dist/runtime-v2/activation/__tests__/approval-queue.test.d.ts +15 -0
  242. package/core/dist/runtime-v2/activation/__tests__/approval-queue.test.d.ts.map +1 -1
  243. package/core/dist/runtime-v2/activation/__tests__/approval-queue.test.js +339 -164
  244. package/core/dist/runtime-v2/activation/__tests__/approval-queue.test.js.map +1 -1
  245. package/core/dist/runtime-v2/activation/__tests__/approval-store-extended.test.js +0 -1
  246. package/core/dist/runtime-v2/activation/__tests__/approval-store-extended.test.js.map +1 -1
  247. package/core/dist/runtime-v2/activation/__tests__/edit-then-approve.test.d.ts +20 -0
  248. package/core/dist/runtime-v2/activation/__tests__/edit-then-approve.test.d.ts.map +1 -0
  249. package/core/dist/runtime-v2/activation/__tests__/edit-then-approve.test.js +145 -0
  250. package/core/dist/runtime-v2/activation/__tests__/edit-then-approve.test.js.map +1 -0
  251. package/core/dist/runtime-v2/activation/__tests__/low-risk-writers.test.d.ts +21 -0
  252. package/core/dist/runtime-v2/activation/__tests__/low-risk-writers.test.d.ts.map +1 -0
  253. package/core/dist/runtime-v2/activation/__tests__/low-risk-writers.test.js +468 -0
  254. package/core/dist/runtime-v2/activation/__tests__/low-risk-writers.test.js.map +1 -0
  255. package/core/dist/runtime-v2/activation/__tests__/production-gate-deps.test.d.ts +15 -0
  256. package/core/dist/runtime-v2/activation/__tests__/production-gate-deps.test.d.ts.map +1 -0
  257. package/core/dist/runtime-v2/activation/__tests__/production-gate-deps.test.js +272 -0
  258. package/core/dist/runtime-v2/activation/__tests__/production-gate-deps.test.js.map +1 -0
  259. package/core/dist/runtime-v2/activation/__tests__/prompt-activation-reader-contract.test.js +11 -0
  260. package/core/dist/runtime-v2/activation/__tests__/prompt-activation-reader-contract.test.js.map +1 -1
  261. package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-state-store.test.js +54 -1
  262. package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-state-store.test.js.map +1 -1
  263. package/core/dist/runtime-v2/activation/__tests__/story-a-acceptance.test.d.ts +35 -0
  264. package/core/dist/runtime-v2/activation/__tests__/story-a-acceptance.test.d.ts.map +1 -0
  265. package/core/dist/runtime-v2/activation/__tests__/story-a-acceptance.test.js +511 -0
  266. package/core/dist/runtime-v2/activation/__tests__/story-a-acceptance.test.js.map +1 -0
  267. package/core/dist/runtime-v2/activation/activation-dispatcher.d.ts.map +1 -1
  268. package/core/dist/runtime-v2/activation/activation-dispatcher.js +87 -1
  269. package/core/dist/runtime-v2/activation/activation-dispatcher.js.map +1 -1
  270. package/core/dist/runtime-v2/activation/activation-types.d.ts +49 -2
  271. package/core/dist/runtime-v2/activation/activation-types.d.ts.map +1 -1
  272. package/core/dist/runtime-v2/activation/activation-types.js +6 -0
  273. package/core/dist/runtime-v2/activation/activation-types.js.map +1 -1
  274. package/core/dist/runtime-v2/activation/approval-completion-service.d.ts +50 -0
  275. package/core/dist/runtime-v2/activation/approval-completion-service.d.ts.map +1 -0
  276. package/core/dist/runtime-v2/activation/approval-completion-service.js +160 -0
  277. package/core/dist/runtime-v2/activation/approval-completion-service.js.map +1 -0
  278. package/core/dist/runtime-v2/activation/approval-queue.d.ts +7 -1
  279. package/core/dist/runtime-v2/activation/approval-queue.d.ts.map +1 -1
  280. package/core/dist/runtime-v2/activation/approval-queue.js +14 -0
  281. package/core/dist/runtime-v2/activation/approval-queue.js.map +1 -1
  282. package/core/dist/runtime-v2/activation/index.d.ts +5 -2
  283. package/core/dist/runtime-v2/activation/index.d.ts.map +1 -1
  284. package/core/dist/runtime-v2/activation/index.js +8 -1
  285. package/core/dist/runtime-v2/activation/index.js.map +1 -1
  286. package/core/dist/runtime-v2/activation/memory-activation-state-store.d.ts +2 -1
  287. package/core/dist/runtime-v2/activation/memory-activation-state-store.d.ts.map +1 -1
  288. package/core/dist/runtime-v2/activation/memory-activation-state-store.js +11 -2
  289. package/core/dist/runtime-v2/activation/memory-activation-state-store.js.map +1 -1
  290. package/core/dist/runtime-v2/activation/memory-approval-store.d.ts +2 -1
  291. package/core/dist/runtime-v2/activation/memory-approval-store.d.ts.map +1 -1
  292. package/core/dist/runtime-v2/activation/memory-approval-store.js +18 -0
  293. package/core/dist/runtime-v2/activation/memory-approval-store.js.map +1 -1
  294. package/core/dist/runtime-v2/activation/production-gate-deps.d.ts +32 -0
  295. package/core/dist/runtime-v2/activation/production-gate-deps.d.ts.map +1 -0
  296. package/core/dist/runtime-v2/activation/production-gate-deps.js +213 -0
  297. package/core/dist/runtime-v2/activation/production-gate-deps.js.map +1 -0
  298. package/core/dist/runtime-v2/activation/sqlite-activation-state-store.d.ts +2 -1
  299. package/core/dist/runtime-v2/activation/sqlite-activation-state-store.d.ts.map +1 -1
  300. package/core/dist/runtime-v2/activation/sqlite-activation-state-store.js +21 -7
  301. package/core/dist/runtime-v2/activation/sqlite-activation-state-store.js.map +1 -1
  302. package/core/dist/runtime-v2/activation/sqlite-approval-store.d.ts +2 -1
  303. package/core/dist/runtime-v2/activation/sqlite-approval-store.d.ts.map +1 -1
  304. package/core/dist/runtime-v2/activation/sqlite-approval-store.js +24 -0
  305. package/core/dist/runtime-v2/activation/sqlite-approval-store.js.map +1 -1
  306. package/core/dist/runtime-v2/adapter/__tests__/artificer-l2-adapter.test.d.ts +2 -0
  307. package/core/dist/runtime-v2/adapter/__tests__/artificer-l2-adapter.test.d.ts.map +1 -0
  308. package/core/dist/runtime-v2/adapter/__tests__/artificer-l2-adapter.test.js +340 -0
  309. package/core/dist/runtime-v2/adapter/__tests__/artificer-l2-adapter.test.js.map +1 -0
  310. package/core/dist/runtime-v2/adapter/__tests__/l2-agent-loop-adapter.test.d.ts +2 -0
  311. package/core/dist/runtime-v2/adapter/__tests__/l2-agent-loop-adapter.test.d.ts.map +1 -0
  312. package/core/dist/runtime-v2/adapter/__tests__/l2-agent-loop-adapter.test.js +420 -0
  313. package/core/dist/runtime-v2/adapter/__tests__/l2-agent-loop-adapter.test.js.map +1 -0
  314. package/core/dist/runtime-v2/adapter/__tests__/pi-ai-runtime-adapter.test.js +283 -1
  315. package/core/dist/runtime-v2/adapter/__tests__/pi-ai-runtime-adapter.test.js.map +1 -1
  316. package/core/dist/runtime-v2/adapter/__tests__/schema-prompt-adapter.test.js +4 -4
  317. package/core/dist/runtime-v2/adapter/__tests__/schema-prompt-adapter.test.js.map +1 -1
  318. package/core/dist/runtime-v2/adapter/__tests__/structured-output-repair.test.js.map +1 -1
  319. package/core/dist/runtime-v2/adapter/__tests__/test-double-runtime-adapter.test.js +221 -0
  320. package/core/dist/runtime-v2/adapter/__tests__/test-double-runtime-adapter.test.js.map +1 -1
  321. package/core/dist/runtime-v2/adapter/artificer-l2-adapter.d.ts +49 -0
  322. package/core/dist/runtime-v2/adapter/artificer-l2-adapter.d.ts.map +1 -0
  323. package/core/dist/runtime-v2/adapter/artificer-l2-adapter.js +319 -0
  324. package/core/dist/runtime-v2/adapter/artificer-l2-adapter.js.map +1 -0
  325. package/core/dist/runtime-v2/adapter/l2-agent-loop-adapter.d.ts +78 -0
  326. package/core/dist/runtime-v2/adapter/l2-agent-loop-adapter.d.ts.map +1 -0
  327. package/core/dist/runtime-v2/adapter/l2-agent-loop-adapter.js +478 -0
  328. package/core/dist/runtime-v2/adapter/l2-agent-loop-adapter.js.map +1 -0
  329. package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.d.ts +6 -0
  330. package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.d.ts.map +1 -1
  331. package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.js +33 -9
  332. package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.js.map +1 -1
  333. package/core/dist/runtime-v2/adapter/structured-output-repair.js +0 -1
  334. package/core/dist/runtime-v2/adapter/structured-output-repair.js.map +1 -1
  335. package/core/dist/runtime-v2/adapter/test-double-runtime-adapter.d.ts +7 -0
  336. package/core/dist/runtime-v2/adapter/test-double-runtime-adapter.d.ts.map +1 -1
  337. package/core/dist/runtime-v2/adapter/test-double-runtime-adapter.js +40 -1
  338. package/core/dist/runtime-v2/adapter/test-double-runtime-adapter.js.map +1 -1
  339. package/core/dist/runtime-v2/admission-gate.d.ts +5 -1
  340. package/core/dist/runtime-v2/admission-gate.d.ts.map +1 -1
  341. package/core/dist/runtime-v2/admission-gate.js +12 -1
  342. package/core/dist/runtime-v2/admission-gate.js.map +1 -1
  343. package/core/dist/runtime-v2/adversarial-loop.d.ts +65 -0
  344. package/core/dist/runtime-v2/adversarial-loop.d.ts.map +1 -0
  345. package/core/dist/runtime-v2/adversarial-loop.js +181 -0
  346. package/core/dist/runtime-v2/adversarial-loop.js.map +1 -0
  347. package/core/dist/runtime-v2/agent-spec.d.ts +1 -1
  348. package/core/dist/runtime-v2/build-l2-principle-reader.d.ts +49 -0
  349. package/core/dist/runtime-v2/build-l2-principle-reader.d.ts.map +1 -0
  350. package/core/dist/runtime-v2/build-l2-principle-reader.js +70 -0
  351. package/core/dist/runtime-v2/build-l2-principle-reader.js.map +1 -0
  352. package/core/dist/runtime-v2/candidate-intake-service.js +0 -1
  353. package/core/dist/runtime-v2/candidate-intake-service.js.map +1 -1
  354. package/core/dist/runtime-v2/cli/diagnose.d.ts +8 -2
  355. package/core/dist/runtime-v2/cli/diagnose.d.ts.map +1 -1
  356. package/core/dist/runtime-v2/cli/diagnose.js +10 -0
  357. package/core/dist/runtime-v2/cli/diagnose.js.map +1 -1
  358. package/core/dist/runtime-v2/config/__tests__/pd-config-contract.test.js +46 -4
  359. package/core/dist/runtime-v2/config/__tests__/pd-config-contract.test.js.map +1 -1
  360. package/core/dist/runtime-v2/config/__tests__/pd-config-redaction-deep.test.js +2 -2
  361. package/core/dist/runtime-v2/config/__tests__/pd-config-redaction-deep.test.js.map +1 -1
  362. package/core/dist/runtime-v2/config/__tests__/pd-config-validation-edge-cases.test.js +1 -1
  363. package/core/dist/runtime-v2/config/__tests__/pd-config-validation-edge-cases.test.js.map +1 -1
  364. package/core/dist/runtime-v2/config/pd-config-agent-binding.d.ts +1 -0
  365. package/core/dist/runtime-v2/config/pd-config-agent-binding.d.ts.map +1 -1
  366. package/core/dist/runtime-v2/config/pd-config-agent-binding.js +3 -0
  367. package/core/dist/runtime-v2/config/pd-config-agent-binding.js.map +1 -1
  368. package/core/dist/runtime-v2/config/pd-config-defaults.d.ts.map +1 -1
  369. package/core/dist/runtime-v2/config/pd-config-defaults.js +8 -18
  370. package/core/dist/runtime-v2/config/pd-config-defaults.js.map +1 -1
  371. package/core/dist/runtime-v2/config/pd-config-effective.d.ts.map +1 -1
  372. package/core/dist/runtime-v2/config/pd-config-effective.js +16 -3
  373. package/core/dist/runtime-v2/config/pd-config-effective.js.map +1 -1
  374. package/core/dist/runtime-v2/config/pd-config-feature-flags.d.ts.map +1 -1
  375. package/core/dist/runtime-v2/config/pd-config-feature-flags.js +11 -2
  376. package/core/dist/runtime-v2/config/pd-config-feature-flags.js.map +1 -1
  377. package/core/dist/runtime-v2/config/pd-config-redaction.d.ts.map +1 -1
  378. package/core/dist/runtime-v2/config/pd-config-redaction.js +9 -0
  379. package/core/dist/runtime-v2/config/pd-config-redaction.js.map +1 -1
  380. package/core/dist/runtime-v2/config/pd-config-types.d.ts +11 -1
  381. package/core/dist/runtime-v2/config/pd-config-types.d.ts.map +1 -1
  382. package/core/dist/runtime-v2/config/pd-config-types.js +5 -1
  383. package/core/dist/runtime-v2/config/pd-config-types.js.map +1 -1
  384. package/core/dist/runtime-v2/config/pd-config-validate.d.ts.map +1 -1
  385. package/core/dist/runtime-v2/config/pd-config-validate.js +12 -0
  386. package/core/dist/runtime-v2/config/pd-config-validate.js.map +1 -1
  387. package/core/dist/runtime-v2/context-payload.d.ts +4 -6
  388. package/core/dist/runtime-v2/context-payload.d.ts.map +1 -1
  389. package/core/dist/runtime-v2/context-payload.js +0 -2
  390. package/core/dist/runtime-v2/context-payload.js.map +1 -1
  391. package/core/dist/runtime-v2/core-principles/__tests__/core-axiom-block.test.d.ts +5 -0
  392. package/core/dist/runtime-v2/core-principles/__tests__/core-axiom-block.test.d.ts.map +1 -0
  393. package/core/dist/runtime-v2/core-principles/__tests__/core-axiom-block.test.js +91 -0
  394. package/core/dist/runtime-v2/core-principles/__tests__/core-axiom-block.test.js.map +1 -0
  395. package/core/dist/runtime-v2/core-principles/__tests__/core-principle-registry.test.d.ts +2 -0
  396. package/core/dist/runtime-v2/core-principles/__tests__/core-principle-registry.test.d.ts.map +1 -0
  397. package/core/dist/runtime-v2/core-principles/__tests__/core-principle-registry.test.js +71 -0
  398. package/core/dist/runtime-v2/core-principles/__tests__/core-principle-registry.test.js.map +1 -0
  399. package/core/dist/runtime-v2/core-principles/__tests__/strip-fabricated-ids.test.d.ts +2 -0
  400. package/core/dist/runtime-v2/core-principles/__tests__/strip-fabricated-ids.test.d.ts.map +1 -0
  401. package/core/dist/runtime-v2/core-principles/__tests__/strip-fabricated-ids.test.js +78 -0
  402. package/core/dist/runtime-v2/core-principles/__tests__/strip-fabricated-ids.test.js.map +1 -0
  403. package/core/dist/runtime-v2/core-principles/core-axiom-block.d.ts +67 -0
  404. package/core/dist/runtime-v2/core-principles/core-axiom-block.d.ts.map +1 -0
  405. package/core/dist/runtime-v2/core-principles/core-axiom-block.js +76 -0
  406. package/core/dist/runtime-v2/core-principles/core-axiom-block.js.map +1 -0
  407. package/core/dist/runtime-v2/core-principles/core-principle-registry.d.ts +41 -0
  408. package/core/dist/runtime-v2/core-principles/core-principle-registry.d.ts.map +1 -0
  409. package/core/dist/runtime-v2/core-principles/core-principle-registry.js +112 -0
  410. package/core/dist/runtime-v2/core-principles/core-principle-registry.js.map +1 -0
  411. package/core/dist/runtime-v2/core-principles/index.d.ts +6 -0
  412. package/core/dist/runtime-v2/core-principles/index.d.ts.map +1 -0
  413. package/core/dist/runtime-v2/core-principles/index.js +4 -0
  414. package/core/dist/runtime-v2/core-principles/index.js.map +1 -0
  415. package/core/dist/runtime-v2/core-principles/strip-fabricated-ids.d.ts +15 -0
  416. package/core/dist/runtime-v2/core-principles/strip-fabricated-ids.d.ts.map +1 -0
  417. package/core/dist/runtime-v2/core-principles/strip-fabricated-ids.js +28 -0
  418. package/core/dist/runtime-v2/core-principles/strip-fabricated-ids.js.map +1 -0
  419. package/core/dist/runtime-v2/diagnostician/__tests__/diag-distiller-output.test.d.ts +2 -0
  420. package/core/dist/runtime-v2/diagnostician/__tests__/diag-distiller-output.test.d.ts.map +1 -0
  421. package/core/dist/runtime-v2/diagnostician/__tests__/diag-distiller-output.test.js +45 -0
  422. package/core/dist/runtime-v2/diagnostician/__tests__/diag-distiller-output.test.js.map +1 -0
  423. package/core/dist/runtime-v2/diagnostician/__tests__/diag-rootcause-output.test.d.ts +2 -0
  424. package/core/dist/runtime-v2/diagnostician/__tests__/diag-rootcause-output.test.d.ts.map +1 -0
  425. package/core/dist/runtime-v2/diagnostician/__tests__/diag-rootcause-output.test.js +91 -0
  426. package/core/dist/runtime-v2/diagnostician/__tests__/diag-rootcause-output.test.js.map +1 -0
  427. package/core/dist/runtime-v2/diagnostician/__tests__/distiller-prompt-builder.test.d.ts +2 -0
  428. package/core/dist/runtime-v2/diagnostician/__tests__/distiller-prompt-builder.test.d.ts.map +1 -0
  429. package/core/dist/runtime-v2/diagnostician/__tests__/distiller-prompt-builder.test.js +39 -0
  430. package/core/dist/runtime-v2/diagnostician/__tests__/distiller-prompt-builder.test.js.map +1 -0
  431. package/core/dist/runtime-v2/diagnostician/__tests__/rootcause-prompt-builder.test.d.ts +2 -0
  432. package/core/dist/runtime-v2/diagnostician/__tests__/rootcause-prompt-builder.test.d.ts.map +1 -0
  433. package/core/dist/runtime-v2/diagnostician/__tests__/rootcause-prompt-builder.test.js +34 -0
  434. package/core/dist/runtime-v2/diagnostician/__tests__/rootcause-prompt-builder.test.js.map +1 -0
  435. package/core/dist/runtime-v2/diagnostician/__tests__/router-prompt-builder.test.d.ts +2 -0
  436. package/core/dist/runtime-v2/diagnostician/__tests__/router-prompt-builder.test.d.ts.map +1 -0
  437. package/core/dist/runtime-v2/diagnostician/__tests__/router-prompt-builder.test.js +57 -0
  438. package/core/dist/runtime-v2/diagnostician/__tests__/router-prompt-builder.test.js.map +1 -0
  439. package/core/dist/runtime-v2/diagnostician/diag-distiller-output.d.ts +80 -0
  440. package/core/dist/runtime-v2/diagnostician/diag-distiller-output.d.ts.map +1 -0
  441. package/core/dist/runtime-v2/diagnostician/diag-distiller-output.js +103 -0
  442. package/core/dist/runtime-v2/diagnostician/diag-distiller-output.js.map +1 -0
  443. package/core/dist/runtime-v2/diagnostician/diag-rootcause-output.d.ts +117 -0
  444. package/core/dist/runtime-v2/diagnostician/diag-rootcause-output.d.ts.map +1 -0
  445. package/core/dist/runtime-v2/diagnostician/diag-rootcause-output.js +182 -0
  446. package/core/dist/runtime-v2/diagnostician/diag-rootcause-output.js.map +1 -0
  447. package/core/dist/runtime-v2/diagnostician/distiller-prompt-builder.d.ts +134 -0
  448. package/core/dist/runtime-v2/diagnostician/distiller-prompt-builder.d.ts.map +1 -0
  449. package/core/dist/runtime-v2/diagnostician/distiller-prompt-builder.js +149 -0
  450. package/core/dist/runtime-v2/diagnostician/distiller-prompt-builder.js.map +1 -0
  451. package/core/dist/runtime-v2/diagnostician/rootcause-prompt-builder.d.ts +96 -0
  452. package/core/dist/runtime-v2/diagnostician/rootcause-prompt-builder.d.ts.map +1 -0
  453. package/core/dist/runtime-v2/diagnostician/rootcause-prompt-builder.js +212 -0
  454. package/core/dist/runtime-v2/diagnostician/rootcause-prompt-builder.js.map +1 -0
  455. package/core/dist/runtime-v2/diagnostician/router-prompt-builder.d.ts +127 -0
  456. package/core/dist/runtime-v2/diagnostician/router-prompt-builder.d.ts.map +1 -0
  457. package/core/dist/runtime-v2/diagnostician/router-prompt-builder.js +131 -0
  458. package/core/dist/runtime-v2/diagnostician/router-prompt-builder.js.map +1 -0
  459. package/core/dist/runtime-v2/diagnostician-prompt-builder.d.ts +10 -50
  460. package/core/dist/runtime-v2/diagnostician-prompt-builder.d.ts.map +1 -1
  461. package/core/dist/runtime-v2/diagnostician-prompt-builder.js +0 -148
  462. package/core/dist/runtime-v2/diagnostician-prompt-builder.js.map +1 -1
  463. package/core/dist/runtime-v2/evidence-guards.d.ts +31 -0
  464. package/core/dist/runtime-v2/evidence-guards.d.ts.map +1 -0
  465. package/core/dist/runtime-v2/evidence-guards.js +29 -0
  466. package/core/dist/runtime-v2/evidence-guards.js.map +1 -0
  467. package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.js +106 -7
  468. package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.js.map +1 -1
  469. package/core/dist/runtime-v2/feature-flags/__tests__/plugin-surface-registry.test.js +3 -3
  470. package/core/dist/runtime-v2/feature-flags/__tests__/plugin-surface-registry.test.js.map +1 -1
  471. package/core/dist/runtime-v2/feature-flags/feature-flag-contract.d.ts.map +1 -1
  472. package/core/dist/runtime-v2/feature-flags/feature-flag-contract.js +39 -4
  473. package/core/dist/runtime-v2/feature-flags/feature-flag-contract.js.map +1 -1
  474. package/core/dist/runtime-v2/feature-flags/plugin-surface-registry.d.ts.map +1 -1
  475. package/core/dist/runtime-v2/feature-flags/plugin-surface-registry.js +27 -22
  476. package/core/dist/runtime-v2/feature-flags/plugin-surface-registry.js.map +1 -1
  477. package/core/dist/runtime-v2/feedback/redact-sensitive.js.map +1 -1
  478. package/core/dist/runtime-v2/feedback/safe-stringify.js.map +1 -1
  479. package/core/dist/runtime-v2/full-trace-contract.d.ts +3 -3
  480. package/core/dist/runtime-v2/golden-trace-replay-validator.d.ts +8 -0
  481. package/core/dist/runtime-v2/golden-trace-replay-validator.d.ts.map +1 -1
  482. package/core/dist/runtime-v2/golden-trace-replay-validator.js +3 -3
  483. package/core/dist/runtime-v2/golden-trace-replay-validator.js.map +1 -1
  484. package/core/dist/runtime-v2/golden-trace.d.ts +46 -1
  485. package/core/dist/runtime-v2/golden-trace.d.ts.map +1 -1
  486. package/core/dist/runtime-v2/golden-trace.js +70 -4
  487. package/core/dist/runtime-v2/golden-trace.js.map +1 -1
  488. package/core/dist/runtime-v2/index.d.ts +62 -31
  489. package/core/dist/runtime-v2/index.d.ts.map +1 -1
  490. package/core/dist/runtime-v2/index.js +54 -18
  491. package/core/dist/runtime-v2/index.js.map +1 -1
  492. package/core/dist/runtime-v2/internalization/__tests__/__fixtures__/split-pipeline-mock-outputs.d.ts +25 -0
  493. package/core/dist/runtime-v2/internalization/__tests__/__fixtures__/split-pipeline-mock-outputs.d.ts.map +1 -0
  494. package/core/dist/runtime-v2/internalization/__tests__/__fixtures__/split-pipeline-mock-outputs.js +123 -0
  495. package/core/dist/runtime-v2/internalization/__tests__/__fixtures__/split-pipeline-mock-outputs.js.map +1 -0
  496. package/core/dist/runtime-v2/internalization/__tests__/adversarial-case.test.d.ts +2 -0
  497. package/core/dist/runtime-v2/internalization/__tests__/adversarial-case.test.d.ts.map +1 -0
  498. package/core/dist/runtime-v2/internalization/__tests__/adversarial-case.test.js +139 -0
  499. package/core/dist/runtime-v2/internalization/__tests__/adversarial-case.test.js.map +1 -0
  500. package/core/dist/runtime-v2/internalization/__tests__/adversarial-feedback.test.d.ts +2 -0
  501. package/core/dist/runtime-v2/internalization/__tests__/adversarial-feedback.test.d.ts.map +1 -0
  502. package/core/dist/runtime-v2/internalization/__tests__/adversarial-feedback.test.js +62 -0
  503. package/core/dist/runtime-v2/internalization/__tests__/adversarial-feedback.test.js.map +1 -0
  504. package/core/dist/runtime-v2/internalization/__tests__/artificer-prompt-builder-v2.test.d.ts +2 -0
  505. package/core/dist/runtime-v2/internalization/__tests__/artificer-prompt-builder-v2.test.d.ts.map +1 -0
  506. package/core/dist/runtime-v2/internalization/__tests__/artificer-prompt-builder-v2.test.js +24 -0
  507. package/core/dist/runtime-v2/internalization/__tests__/artificer-prompt-builder-v2.test.js.map +1 -0
  508. package/core/dist/runtime-v2/internalization/__tests__/artificer-prompt-builder.test.js +5 -4
  509. package/core/dist/runtime-v2/internalization/__tests__/artificer-prompt-builder.test.js.map +1 -1
  510. package/core/dist/runtime-v2/internalization/__tests__/artificer-rule-output.test.d.ts +2 -0
  511. package/core/dist/runtime-v2/internalization/__tests__/artificer-rule-output.test.d.ts.map +1 -0
  512. package/core/dist/runtime-v2/internalization/__tests__/artificer-rule-output.test.js +248 -0
  513. package/core/dist/runtime-v2/internalization/__tests__/artificer-rule-output.test.js.map +1 -0
  514. package/core/dist/runtime-v2/internalization/__tests__/diag-chain-e2e.test.d.ts +2 -0
  515. package/core/dist/runtime-v2/internalization/__tests__/diag-chain-e2e.test.d.ts.map +1 -0
  516. package/core/dist/runtime-v2/internalization/__tests__/diag-chain-e2e.test.js +803 -0
  517. package/core/dist/runtime-v2/internalization/__tests__/diag-chain-e2e.test.js.map +1 -0
  518. package/core/dist/runtime-v2/internalization/__tests__/diag-distiller-runner.test.d.ts +2 -0
  519. package/core/dist/runtime-v2/internalization/__tests__/diag-distiller-runner.test.d.ts.map +1 -0
  520. package/core/dist/runtime-v2/internalization/__tests__/diag-distiller-runner.test.js +441 -0
  521. package/core/dist/runtime-v2/internalization/__tests__/diag-distiller-runner.test.js.map +1 -0
  522. package/core/dist/runtime-v2/internalization/__tests__/diag-rootcause-runner.test.d.ts +2 -0
  523. package/core/dist/runtime-v2/internalization/__tests__/diag-rootcause-runner.test.d.ts.map +1 -0
  524. package/core/dist/runtime-v2/internalization/__tests__/diag-rootcause-runner.test.js +340 -0
  525. package/core/dist/runtime-v2/internalization/__tests__/diag-rootcause-runner.test.js.map +1 -0
  526. package/core/dist/runtime-v2/internalization/__tests__/diag-router-runner.test.d.ts +2 -0
  527. package/core/dist/runtime-v2/internalization/__tests__/diag-router-runner.test.d.ts.map +1 -0
  528. package/core/dist/runtime-v2/internalization/__tests__/diag-router-runner.test.js +441 -0
  529. package/core/dist/runtime-v2/internalization/__tests__/diag-router-runner.test.js.map +1 -0
  530. package/core/dist/runtime-v2/internalization/__tests__/evaluator-output-v2.test.d.ts +2 -0
  531. package/core/dist/runtime-v2/internalization/__tests__/evaluator-output-v2.test.d.ts.map +1 -0
  532. package/core/dist/runtime-v2/internalization/__tests__/evaluator-output-v2.test.js +209 -0
  533. package/core/dist/runtime-v2/internalization/__tests__/evaluator-output-v2.test.js.map +1 -0
  534. package/core/dist/runtime-v2/internalization/__tests__/evaluator-prompt-builder-v2.test.d.ts +2 -0
  535. package/core/dist/runtime-v2/internalization/__tests__/evaluator-prompt-builder-v2.test.d.ts.map +1 -0
  536. package/core/dist/runtime-v2/internalization/__tests__/evaluator-prompt-builder-v2.test.js +125 -0
  537. package/core/dist/runtime-v2/internalization/__tests__/evaluator-prompt-builder-v2.test.js.map +1 -0
  538. package/core/dist/runtime-v2/internalization/__tests__/internalization-consumer-decision.test.d.ts +2 -0
  539. package/core/dist/runtime-v2/internalization/__tests__/internalization-consumer-decision.test.d.ts.map +1 -0
  540. package/core/dist/runtime-v2/internalization/__tests__/internalization-consumer-decision.test.js +223 -0
  541. package/core/dist/runtime-v2/internalization/__tests__/internalization-consumer-decision.test.js.map +1 -0
  542. package/core/dist/runtime-v2/internalization/__tests__/philosopher-runner-trust-boundary.test.js +4 -0
  543. package/core/dist/runtime-v2/internalization/__tests__/philosopher-runner-trust-boundary.test.js.map +1 -1
  544. package/core/dist/runtime-v2/internalization/__tests__/refiner-sandbox-wrapper.test.js.map +1 -1
  545. package/core/dist/runtime-v2/internalization/__tests__/rule-code-dialect.test.d.ts +2 -0
  546. package/core/dist/runtime-v2/internalization/__tests__/rule-code-dialect.test.d.ts.map +1 -0
  547. package/core/dist/runtime-v2/internalization/__tests__/rule-code-dialect.test.js +270 -0
  548. package/core/dist/runtime-v2/internalization/__tests__/rule-code-dialect.test.js.map +1 -0
  549. package/core/dist/runtime-v2/internalization/__tests__/rule-host-input-builder.test.d.ts +2 -0
  550. package/core/dist/runtime-v2/internalization/__tests__/rule-host-input-builder.test.d.ts.map +1 -0
  551. package/core/dist/runtime-v2/internalization/__tests__/rule-host-input-builder.test.js +180 -0
  552. package/core/dist/runtime-v2/internalization/__tests__/rule-host-input-builder.test.js.map +1 -0
  553. package/core/dist/runtime-v2/internalization/__tests__/runnerkind-seam.test.d.ts +2 -0
  554. package/core/dist/runtime-v2/internalization/__tests__/runnerkind-seam.test.d.ts.map +1 -0
  555. package/core/dist/runtime-v2/internalization/__tests__/runnerkind-seam.test.js +224 -0
  556. package/core/dist/runtime-v2/internalization/__tests__/runnerkind-seam.test.js.map +1 -0
  557. package/core/dist/runtime-v2/internalization/__tests__/scribe-prompt-builder.test.js +13 -8
  558. package/core/dist/runtime-v2/internalization/__tests__/scribe-prompt-builder.test.js.map +1 -1
  559. package/core/dist/runtime-v2/internalization/__tests__/scribe-prompt-language.test.js +4 -3
  560. package/core/dist/runtime-v2/internalization/__tests__/scribe-prompt-language.test.js.map +1 -1
  561. package/core/dist/runtime-v2/internalization/__tests__/split-diagnostician-runner-retry.test.d.ts +2 -0
  562. package/core/dist/runtime-v2/internalization/__tests__/split-diagnostician-runner-retry.test.d.ts.map +1 -0
  563. package/core/dist/runtime-v2/internalization/__tests__/split-diagnostician-runner-retry.test.js +227 -0
  564. package/core/dist/runtime-v2/internalization/__tests__/split-diagnostician-runner-retry.test.js.map +1 -0
  565. package/core/dist/runtime-v2/internalization/adversarial-case.d.ts +32 -0
  566. package/core/dist/runtime-v2/internalization/adversarial-case.d.ts.map +1 -0
  567. package/core/dist/runtime-v2/internalization/adversarial-case.js +68 -0
  568. package/core/dist/runtime-v2/internalization/adversarial-case.js.map +1 -0
  569. package/core/dist/runtime-v2/internalization/adversarial-feedback.d.ts +23 -0
  570. package/core/dist/runtime-v2/internalization/adversarial-feedback.d.ts.map +1 -0
  571. package/core/dist/runtime-v2/internalization/adversarial-feedback.js +20 -0
  572. package/core/dist/runtime-v2/internalization/adversarial-feedback.js.map +1 -0
  573. package/core/dist/runtime-v2/internalization/artificer-output.d.ts +54 -30
  574. package/core/dist/runtime-v2/internalization/artificer-output.d.ts.map +1 -1
  575. package/core/dist/runtime-v2/internalization/artificer-output.js +144 -36
  576. package/core/dist/runtime-v2/internalization/artificer-output.js.map +1 -1
  577. package/core/dist/runtime-v2/internalization/artificer-prompt-builder.d.ts +10 -2
  578. package/core/dist/runtime-v2/internalization/artificer-prompt-builder.d.ts.map +1 -1
  579. package/core/dist/runtime-v2/internalization/artificer-prompt-builder.js +37 -20
  580. package/core/dist/runtime-v2/internalization/artificer-prompt-builder.js.map +1 -1
  581. package/core/dist/runtime-v2/internalization/artificer-runner.d.ts +19 -9
  582. package/core/dist/runtime-v2/internalization/artificer-runner.d.ts.map +1 -1
  583. package/core/dist/runtime-v2/internalization/artificer-runner.js +21 -9
  584. package/core/dist/runtime-v2/internalization/artificer-runner.js.map +1 -1
  585. package/core/dist/runtime-v2/internalization/correction-proposal.d.ts.map +1 -1
  586. package/core/dist/runtime-v2/internalization/correction-proposal.js +27 -16
  587. package/core/dist/runtime-v2/internalization/correction-proposal.js.map +1 -1
  588. package/core/dist/runtime-v2/internalization/diag-distiller-runner.d.ts +83 -0
  589. package/core/dist/runtime-v2/internalization/diag-distiller-runner.d.ts.map +1 -0
  590. package/core/dist/runtime-v2/internalization/diag-distiller-runner.js +274 -0
  591. package/core/dist/runtime-v2/internalization/diag-distiller-runner.js.map +1 -0
  592. package/core/dist/runtime-v2/internalization/diag-rootcause-runner.d.ts +73 -0
  593. package/core/dist/runtime-v2/internalization/diag-rootcause-runner.d.ts.map +1 -0
  594. package/core/dist/runtime-v2/internalization/diag-rootcause-runner.js +229 -0
  595. package/core/dist/runtime-v2/internalization/diag-rootcause-runner.js.map +1 -0
  596. package/core/dist/runtime-v2/internalization/diag-router-runner.d.ts +85 -0
  597. package/core/dist/runtime-v2/internalization/diag-router-runner.d.ts.map +1 -0
  598. package/core/dist/runtime-v2/internalization/diag-router-runner.js +353 -0
  599. package/core/dist/runtime-v2/internalization/diag-router-runner.js.map +1 -0
  600. package/core/dist/runtime-v2/internalization/dreamer-prompt-builder.d.ts +19 -1
  601. package/core/dist/runtime-v2/internalization/dreamer-prompt-builder.d.ts.map +1 -1
  602. package/core/dist/runtime-v2/internalization/dreamer-prompt-builder.js +48 -8
  603. package/core/dist/runtime-v2/internalization/dreamer-prompt-builder.js.map +1 -1
  604. package/core/dist/runtime-v2/internalization/dreamer-runner.d.ts +7 -1
  605. package/core/dist/runtime-v2/internalization/dreamer-runner.d.ts.map +1 -1
  606. package/core/dist/runtime-v2/internalization/dreamer-runner.js +13 -3
  607. package/core/dist/runtime-v2/internalization/dreamer-runner.js.map +1 -1
  608. package/core/dist/runtime-v2/internalization/evaluator-output.d.ts +63 -0
  609. package/core/dist/runtime-v2/internalization/evaluator-output.d.ts.map +1 -1
  610. package/core/dist/runtime-v2/internalization/evaluator-output.js +158 -0
  611. package/core/dist/runtime-v2/internalization/evaluator-output.js.map +1 -1
  612. package/core/dist/runtime-v2/internalization/evaluator-prompt-builder.d.ts +8 -1
  613. package/core/dist/runtime-v2/internalization/evaluator-prompt-builder.d.ts.map +1 -1
  614. package/core/dist/runtime-v2/internalization/evaluator-prompt-builder.js +17 -4
  615. package/core/dist/runtime-v2/internalization/evaluator-prompt-builder.js.map +1 -1
  616. package/core/dist/runtime-v2/internalization/evaluator-runner.d.ts +114 -4
  617. package/core/dist/runtime-v2/internalization/evaluator-runner.d.ts.map +1 -1
  618. package/core/dist/runtime-v2/internalization/evaluator-runner.js +629 -7
  619. package/core/dist/runtime-v2/internalization/evaluator-runner.js.map +1 -1
  620. package/core/dist/runtime-v2/internalization/golden-dogfood-fixtures.d.ts +17 -0
  621. package/core/dist/runtime-v2/internalization/golden-dogfood-fixtures.d.ts.map +1 -0
  622. package/core/dist/runtime-v2/internalization/golden-dogfood-fixtures.js +451 -0
  623. package/core/dist/runtime-v2/internalization/golden-dogfood-fixtures.js.map +1 -0
  624. package/core/dist/runtime-v2/internalization/index.d.ts +21 -9
  625. package/core/dist/runtime-v2/internalization/index.d.ts.map +1 -1
  626. package/core/dist/runtime-v2/internalization/index.js +16 -6
  627. package/core/dist/runtime-v2/internalization/index.js.map +1 -1
  628. package/core/dist/runtime-v2/internalization/intake-to-internalization-bridge.d.ts +25 -0
  629. package/core/dist/runtime-v2/internalization/intake-to-internalization-bridge.d.ts.map +1 -1
  630. package/core/dist/runtime-v2/internalization/intake-to-internalization-bridge.js +67 -12
  631. package/core/dist/runtime-v2/internalization/intake-to-internalization-bridge.js.map +1 -1
  632. package/core/dist/runtime-v2/internalization/internalization-consumer-decision.d.ts +17 -0
  633. package/core/dist/runtime-v2/internalization/internalization-consumer-decision.d.ts.map +1 -0
  634. package/core/dist/runtime-v2/internalization/internalization-consumer-decision.js +28 -0
  635. package/core/dist/runtime-v2/internalization/internalization-consumer-decision.js.map +1 -0
  636. package/core/dist/runtime-v2/internalization/internalization-job-graph.d.ts +14 -1
  637. package/core/dist/runtime-v2/internalization/internalization-job-graph.d.ts.map +1 -1
  638. package/core/dist/runtime-v2/internalization/internalization-job-graph.js +22 -0
  639. package/core/dist/runtime-v2/internalization/internalization-job-graph.js.map +1 -1
  640. package/core/dist/runtime-v2/internalization/internalization-orchestrator.d.ts +9 -9
  641. package/core/dist/runtime-v2/internalization/internalization-orchestrator.d.ts.map +1 -1
  642. package/core/dist/runtime-v2/internalization/internalization-orchestrator.js +32 -9
  643. package/core/dist/runtime-v2/internalization/internalization-orchestrator.js.map +1 -1
  644. package/core/dist/runtime-v2/internalization/internalization-state-machine.d.ts +2 -2
  645. package/core/dist/runtime-v2/internalization/internalization-state-machine.d.ts.map +1 -1
  646. package/core/dist/runtime-v2/internalization/internalization-state-machine.js +35 -4
  647. package/core/dist/runtime-v2/internalization/internalization-state-machine.js.map +1 -1
  648. package/core/dist/runtime-v2/internalization/peer-runner-contracts.d.ts +31 -4
  649. package/core/dist/runtime-v2/internalization/peer-runner-contracts.d.ts.map +1 -1
  650. package/core/dist/runtime-v2/internalization/peer-runner-contracts.js +42 -12
  651. package/core/dist/runtime-v2/internalization/peer-runner-contracts.js.map +1 -1
  652. package/core/dist/runtime-v2/internalization/philosopher-prompt-builder.d.ts +20 -1
  653. package/core/dist/runtime-v2/internalization/philosopher-prompt-builder.d.ts.map +1 -1
  654. package/core/dist/runtime-v2/internalization/philosopher-prompt-builder.js +47 -6
  655. package/core/dist/runtime-v2/internalization/philosopher-prompt-builder.js.map +1 -1
  656. package/core/dist/runtime-v2/internalization/philosopher-runner.d.ts +6 -1
  657. package/core/dist/runtime-v2/internalization/philosopher-runner.d.ts.map +1 -1
  658. package/core/dist/runtime-v2/internalization/philosopher-runner.js +10 -3
  659. package/core/dist/runtime-v2/internalization/philosopher-runner.js.map +1 -1
  660. package/core/dist/runtime-v2/internalization/pitask-metadata.d.ts +9 -2
  661. package/core/dist/runtime-v2/internalization/pitask-metadata.d.ts.map +1 -1
  662. package/core/dist/runtime-v2/internalization/pitask-metadata.js +22 -11
  663. package/core/dist/runtime-v2/internalization/pitask-metadata.js.map +1 -1
  664. package/core/dist/runtime-v2/internalization/prompt-serializer.d.ts +3 -0
  665. package/core/dist/runtime-v2/internalization/prompt-serializer.d.ts.map +1 -0
  666. package/core/dist/runtime-v2/internalization/prompt-serializer.js +22 -0
  667. package/core/dist/runtime-v2/internalization/prompt-serializer.js.map +1 -0
  668. package/core/dist/runtime-v2/internalization/queue-actionability.d.ts +3 -3
  669. package/core/dist/runtime-v2/internalization/queue-actionability.d.ts.map +1 -1
  670. package/core/dist/runtime-v2/internalization/refiner-sandbox-wrapper.d.ts.map +1 -1
  671. package/core/dist/runtime-v2/internalization/refiner-sandbox-wrapper.js +16 -1
  672. package/core/dist/runtime-v2/internalization/refiner-sandbox-wrapper.js.map +1 -1
  673. package/core/dist/runtime-v2/internalization/rollout-reviewer-prompt-builder.d.ts +1 -1
  674. package/core/dist/runtime-v2/internalization/rollout-reviewer-prompt-builder.d.ts.map +1 -1
  675. package/core/dist/runtime-v2/internalization/rollout-reviewer-prompt-builder.js +2 -2
  676. package/core/dist/runtime-v2/internalization/rule-code-validator.d.ts +29 -0
  677. package/core/dist/runtime-v2/internalization/rule-code-validator.d.ts.map +1 -1
  678. package/core/dist/runtime-v2/internalization/rule-code-validator.js +87 -1
  679. package/core/dist/runtime-v2/internalization/rule-code-validator.js.map +1 -1
  680. package/core/dist/runtime-v2/internalization/rule-host-evaluator.d.ts +1 -0
  681. package/core/dist/runtime-v2/internalization/rule-host-evaluator.d.ts.map +1 -1
  682. package/core/dist/runtime-v2/internalization/rule-host-evaluator.js +15 -1
  683. package/core/dist/runtime-v2/internalization/rule-host-evaluator.js.map +1 -1
  684. package/core/dist/runtime-v2/internalization/rule-host-input-builder.d.ts +62 -0
  685. package/core/dist/runtime-v2/internalization/rule-host-input-builder.d.ts.map +1 -0
  686. package/core/dist/runtime-v2/internalization/rule-host-input-builder.js +182 -0
  687. package/core/dist/runtime-v2/internalization/rule-host-input-builder.js.map +1 -0
  688. package/core/dist/runtime-v2/internalization/rule-host-validator.d.ts +37 -0
  689. package/core/dist/runtime-v2/internalization/rule-host-validator.d.ts.map +1 -0
  690. package/core/dist/runtime-v2/internalization/rule-host-validator.js +154 -0
  691. package/core/dist/runtime-v2/internalization/rule-host-validator.js.map +1 -0
  692. package/core/dist/runtime-v2/internalization/scribe-prompt-builder.d.ts +20 -6
  693. package/core/dist/runtime-v2/internalization/scribe-prompt-builder.d.ts.map +1 -1
  694. package/core/dist/runtime-v2/internalization/scribe-prompt-builder.js +31 -15
  695. package/core/dist/runtime-v2/internalization/scribe-prompt-builder.js.map +1 -1
  696. package/core/dist/runtime-v2/internalization/scribe-runner.d.ts +6 -1
  697. package/core/dist/runtime-v2/internalization/scribe-runner.d.ts.map +1 -1
  698. package/core/dist/runtime-v2/internalization/scribe-runner.js +10 -3
  699. package/core/dist/runtime-v2/internalization/scribe-runner.js.map +1 -1
  700. package/core/dist/runtime-v2/internalization/split-diagnostician-runner.d.ts +103 -0
  701. package/core/dist/runtime-v2/internalization/split-diagnostician-runner.d.ts.map +1 -0
  702. package/core/dist/runtime-v2/internalization/split-diagnostician-runner.js +286 -0
  703. package/core/dist/runtime-v2/internalization/split-diagnostician-runner.js.map +1 -0
  704. package/core/dist/runtime-v2/internalization/template-generator.d.ts +7 -2
  705. package/core/dist/runtime-v2/internalization/template-generator.d.ts.map +1 -1
  706. package/core/dist/runtime-v2/internalization/template-generator.js +10 -5
  707. package/core/dist/runtime-v2/internalization/template-generator.js.map +1 -1
  708. package/core/dist/runtime-v2/internalization/trainer-prompt-builder.d.ts +1 -1
  709. package/core/dist/runtime-v2/internalization/trainer-prompt-builder.d.ts.map +1 -1
  710. package/core/dist/runtime-v2/internalization/trainer-prompt-builder.js +2 -2
  711. package/core/dist/runtime-v2/internalization-chain-integrity-read-model.d.ts +5 -0
  712. package/core/dist/runtime-v2/internalization-chain-integrity-read-model.d.ts.map +1 -1
  713. package/core/dist/runtime-v2/internalization-chain-integrity-read-model.js +48 -2
  714. package/core/dist/runtime-v2/internalization-chain-integrity-read-model.js.map +1 -1
  715. package/core/dist/runtime-v2/internalization-integrity-remediation.d.ts +67 -0
  716. package/core/dist/runtime-v2/internalization-integrity-remediation.d.ts.map +1 -1
  717. package/core/dist/runtime-v2/internalization-integrity-remediation.js +802 -0
  718. package/core/dist/runtime-v2/internalization-integrity-remediation.js.map +1 -1
  719. package/core/dist/runtime-v2/internalization-queue-read-model.d.ts +7 -7
  720. package/core/dist/runtime-v2/internalization-queue-read-model.d.ts.map +1 -1
  721. package/core/dist/runtime-v2/internalization-queue-read-model.js +4 -4
  722. package/core/dist/runtime-v2/internalization-queue-read-model.js.map +1 -1
  723. package/core/dist/runtime-v2/mainline-contract.d.ts +138 -0
  724. package/core/dist/runtime-v2/mainline-contract.d.ts.map +1 -0
  725. package/core/dist/runtime-v2/mainline-contract.js +224 -0
  726. package/core/dist/runtime-v2/mainline-contract.js.map +1 -0
  727. package/core/dist/runtime-v2/observer/__tests__/empathy-observer.real-e2e.test.js +29 -22
  728. package/core/dist/runtime-v2/observer/__tests__/empathy-observer.real-e2e.test.js.map +1 -1
  729. package/core/dist/runtime-v2/observer/agent-scheduler.js.map +1 -1
  730. package/core/dist/runtime-v2/observer/empathy-observer.js +1 -1
  731. package/core/dist/runtime-v2/observer/empathy-observer.js.map +1 -1
  732. package/core/dist/runtime-v2/pain-signal-bridge.d.ts +36 -4
  733. package/core/dist/runtime-v2/pain-signal-bridge.d.ts.map +1 -1
  734. package/core/dist/runtime-v2/pain-signal-bridge.js +81 -37
  735. package/core/dist/runtime-v2/pain-signal-bridge.js.map +1 -1
  736. package/core/dist/runtime-v2/pain-signal-observability.d.ts +4 -0
  737. package/core/dist/runtime-v2/pain-signal-observability.d.ts.map +1 -1
  738. package/core/dist/runtime-v2/pain-signal-observability.js +58 -8
  739. package/core/dist/runtime-v2/pain-signal-observability.js.map +1 -1
  740. package/core/dist/runtime-v2/pain-signal-runtime-factory.d.ts +20 -1
  741. package/core/dist/runtime-v2/pain-signal-runtime-factory.d.ts.map +1 -1
  742. package/core/dist/runtime-v2/pain-signal-runtime-factory.js +80 -23
  743. package/core/dist/runtime-v2/pain-signal-runtime-factory.js.map +1 -1
  744. package/core/dist/runtime-v2/pain-to-principle-service.d.ts +5 -1
  745. package/core/dist/runtime-v2/pain-to-principle-service.d.ts.map +1 -1
  746. package/core/dist/runtime-v2/pain-to-principle-service.js +39 -0
  747. package/core/dist/runtime-v2/pain-to-principle-service.js.map +1 -1
  748. package/core/dist/runtime-v2/proven-channel-baseline.d.ts.map +1 -1
  749. package/core/dist/runtime-v2/proven-channel-baseline.js +14 -0
  750. package/core/dist/runtime-v2/proven-channel-baseline.js.map +1 -1
  751. package/core/dist/runtime-v2/recovery-sweep-service.d.ts +18 -0
  752. package/core/dist/runtime-v2/recovery-sweep-service.d.ts.map +1 -1
  753. package/core/dist/runtime-v2/recovery-sweep-service.js +46 -0
  754. package/core/dist/runtime-v2/recovery-sweep-service.js.map +1 -1
  755. package/core/dist/runtime-v2/runner/__tests__/base-peer-runner-trust-boundary.test.js +11 -2
  756. package/core/dist/runtime-v2/runner/__tests__/base-peer-runner-trust-boundary.test.js.map +1 -1
  757. package/core/dist/runtime-v2/runner/__tests__/diagnose.test.js.map +1 -1
  758. package/core/dist/runtime-v2/runner/__tests__/pain-signal-bridge-admission.test.js +6 -0
  759. package/core/dist/runtime-v2/runner/__tests__/pain-signal-bridge-admission.test.js.map +1 -1
  760. package/core/dist/runtime-v2/runner/__tests__/pain-signal-bridge.test.js.map +1 -1
  761. package/core/dist/runtime-v2/runner/base-peer-runner.d.ts +10 -3
  762. package/core/dist/runtime-v2/runner/base-peer-runner.d.ts.map +1 -1
  763. package/core/dist/runtime-v2/runner/base-peer-runner.js +58 -15
  764. package/core/dist/runtime-v2/runner/base-peer-runner.js.map +1 -1
  765. package/core/dist/runtime-v2/runner/peer-runner-types.d.ts +10 -3
  766. package/core/dist/runtime-v2/runner/peer-runner-types.d.ts.map +1 -1
  767. package/core/dist/runtime-v2/runtime-protocol.d.ts +3 -3
  768. package/core/dist/runtime-v2/runtime-protocol.d.ts.map +1 -1
  769. package/core/dist/runtime-v2/runtime-protocol.js +1 -0
  770. package/core/dist/runtime-v2/runtime-protocol.js.map +1 -1
  771. package/core/dist/runtime-v2/runtime-selector.d.ts +3 -3
  772. package/core/dist/runtime-v2/stalled-diagnostician-task-read-model.d.ts +26 -0
  773. package/core/dist/runtime-v2/stalled-diagnostician-task-read-model.d.ts.map +1 -0
  774. package/core/dist/runtime-v2/stalled-diagnostician-task-read-model.js +59 -0
  775. package/core/dist/runtime-v2/stalled-diagnostician-task-read-model.js.map +1 -0
  776. package/core/dist/runtime-v2/store/candidate/sqlite-candidate-store.js +2 -2
  777. package/core/dist/runtime-v2/store/candidate/sqlite-candidate-store.js.map +1 -1
  778. package/core/dist/runtime-v2/store/concurrent-lease.test.js +13 -13
  779. package/core/dist/runtime-v2/store/concurrent-lease.test.js.map +1 -1
  780. package/core/dist/runtime-v2/store/context/index.d.ts +1 -0
  781. package/core/dist/runtime-v2/store/context/index.d.ts.map +1 -1
  782. package/core/dist/runtime-v2/store/context/sqlite-context-assembler.d.ts +8 -0
  783. package/core/dist/runtime-v2/store/context/sqlite-context-assembler.d.ts.map +1 -1
  784. package/core/dist/runtime-v2/store/context/sqlite-context-assembler.js +54 -3
  785. package/core/dist/runtime-v2/store/context/sqlite-context-assembler.js.map +1 -1
  786. package/core/dist/runtime-v2/store/context/sqlite-context-assembler.test.js +373 -2
  787. package/core/dist/runtime-v2/store/context/sqlite-context-assembler.test.js.map +1 -1
  788. package/core/dist/runtime-v2/store/context/trajectory-turn-reader.d.ts +32 -0
  789. package/core/dist/runtime-v2/store/context/trajectory-turn-reader.d.ts.map +1 -0
  790. package/core/dist/runtime-v2/store/context/trajectory-turn-reader.js +12 -0
  791. package/core/dist/runtime-v2/store/context/trajectory-turn-reader.js.map +1 -0
  792. package/core/dist/runtime-v2/store/event-emitter.js +0 -1
  793. package/core/dist/runtime-v2/store/event-emitter.js.map +1 -1
  794. package/core/dist/runtime-v2/store/history/sqlite-history-query.test.js +1 -1
  795. package/core/dist/runtime-v2/store/history/sqlite-history-query.test.js.map +1 -1
  796. package/core/dist/runtime-v2/store/idempotent-transitions.test.js +0 -5
  797. package/core/dist/runtime-v2/store/idempotent-transitions.test.js.map +1 -1
  798. package/core/dist/runtime-v2/store/lifecycle/lease-manager.d.ts.map +1 -1
  799. package/core/dist/runtime-v2/store/lifecycle/lease-manager.js +5 -0
  800. package/core/dist/runtime-v2/store/lifecycle/lease-manager.js.map +1 -1
  801. package/core/dist/runtime-v2/store/lifecycle/lease-manager.test.js +0 -2
  802. package/core/dist/runtime-v2/store/lifecycle/lease-manager.test.js.map +1 -1
  803. package/core/dist/runtime-v2/store/lifecycle/recovery-sweep.test.js +0 -2
  804. package/core/dist/runtime-v2/store/lifecycle/recovery-sweep.test.js.map +1 -1
  805. package/core/dist/runtime-v2/store/run/memory-run-store.d.ts +2 -1
  806. package/core/dist/runtime-v2/store/run/memory-run-store.d.ts.map +1 -1
  807. package/core/dist/runtime-v2/store/run/memory-run-store.js +5 -0
  808. package/core/dist/runtime-v2/store/run/memory-run-store.js.map +1 -1
  809. package/core/dist/runtime-v2/store/run/run-store.d.ts +27 -0
  810. package/core/dist/runtime-v2/store/run/run-store.d.ts.map +1 -1
  811. package/core/dist/runtime-v2/store/run/sqlite-run-store.d.ts +26 -2
  812. package/core/dist/runtime-v2/store/run/sqlite-run-store.d.ts.map +1 -1
  813. package/core/dist/runtime-v2/store/run/sqlite-run-store.js +134 -20
  814. package/core/dist/runtime-v2/store/run/sqlite-run-store.js.map +1 -1
  815. package/core/dist/runtime-v2/store/runtime-state-manager-malformed-run-tolerance.test.d.ts +2 -0
  816. package/core/dist/runtime-v2/store/runtime-state-manager-malformed-run-tolerance.test.d.ts.map +1 -0
  817. package/core/dist/runtime-v2/store/runtime-state-manager-malformed-run-tolerance.test.js +160 -0
  818. package/core/dist/runtime-v2/store/runtime-state-manager-malformed-run-tolerance.test.js.map +1 -0
  819. package/core/dist/runtime-v2/store/runtime-state-manager.d.ts +25 -3
  820. package/core/dist/runtime-v2/store/runtime-state-manager.d.ts.map +1 -1
  821. package/core/dist/runtime-v2/store/runtime-state-manager.js +55 -7
  822. package/core/dist/runtime-v2/store/runtime-state-manager.js.map +1 -1
  823. package/core/dist/runtime-v2/store/schema-conformance.test.js +0 -10
  824. package/core/dist/runtime-v2/store/schema-conformance.test.js.map +1 -1
  825. package/core/dist/runtime-v2/store/sqlite-connection-pragma.test.js +2 -2
  826. package/core/dist/runtime-v2/store/sqlite-connection-pragma.test.js.map +1 -1
  827. package/core/dist/runtime-v2/store/sqlite-connection.d.ts.map +1 -1
  828. package/core/dist/runtime-v2/store/sqlite-connection.js +12 -0
  829. package/core/dist/runtime-v2/store/sqlite-connection.js.map +1 -1
  830. package/core/dist/runtime-v2/store/sqlite-run-store.test.js +172 -2
  831. package/core/dist/runtime-v2/store/sqlite-run-store.test.js.map +1 -1
  832. package/core/dist/runtime-v2/store/sqlite-task-store.test.js +0 -2
  833. package/core/dist/runtime-v2/store/sqlite-task-store.test.js.map +1 -1
  834. package/core/dist/runtime-v2/store/trajectory/source-trace-locator.test.js +0 -1
  835. package/core/dist/runtime-v2/store/trajectory/source-trace-locator.test.js.map +1 -1
  836. package/core/dist/runtime-v2/store/trajectory/sqlite-trajectory-locator.test.js +1 -1
  837. package/core/dist/runtime-v2/store/trajectory/sqlite-trajectory-locator.test.js.map +1 -1
  838. package/core/dist/runtime-v2/store/workspace-isolation.test.js +0 -2
  839. package/core/dist/runtime-v2/store/workspace-isolation.test.js.map +1 -1
  840. package/core/dist/runtime-v2/tools/__tests__/agent-tool-contract.test.d.ts +2 -0
  841. package/core/dist/runtime-v2/tools/__tests__/agent-tool-contract.test.d.ts.map +1 -0
  842. package/core/dist/runtime-v2/tools/__tests__/agent-tool-contract.test.js +171 -0
  843. package/core/dist/runtime-v2/tools/__tests__/agent-tool-contract.test.js.map +1 -0
  844. package/core/dist/runtime-v2/tools/__tests__/artificer-l2-tool-contract.test.d.ts +2 -0
  845. package/core/dist/runtime-v2/tools/__tests__/artificer-l2-tool-contract.test.d.ts.map +1 -0
  846. package/core/dist/runtime-v2/tools/__tests__/artificer-l2-tool-contract.test.js +322 -0
  847. package/core/dist/runtime-v2/tools/__tests__/artificer-l2-tool-contract.test.js.map +1 -0
  848. package/core/dist/runtime-v2/tools/__tests__/artificer-output-typebox.test.d.ts +2 -0
  849. package/core/dist/runtime-v2/tools/__tests__/artificer-output-typebox.test.d.ts.map +1 -0
  850. package/core/dist/runtime-v2/tools/__tests__/artificer-output-typebox.test.js +149 -0
  851. package/core/dist/runtime-v2/tools/__tests__/artificer-output-typebox.test.js.map +1 -0
  852. package/core/dist/runtime-v2/tools/__tests__/dreamer-output-typebox.test.d.ts +2 -0
  853. package/core/dist/runtime-v2/tools/__tests__/dreamer-output-typebox.test.d.ts.map +1 -0
  854. package/core/dist/runtime-v2/tools/__tests__/dreamer-output-typebox.test.js +109 -0
  855. package/core/dist/runtime-v2/tools/__tests__/dreamer-output-typebox.test.js.map +1 -0
  856. package/core/dist/runtime-v2/tools/agent-tool-contract.d.ts +76 -0
  857. package/core/dist/runtime-v2/tools/agent-tool-contract.d.ts.map +1 -0
  858. package/core/dist/runtime-v2/tools/agent-tool-contract.js +136 -0
  859. package/core/dist/runtime-v2/tools/agent-tool-contract.js.map +1 -0
  860. package/core/dist/runtime-v2/tools/artificer-l2-tool-contract.d.ts +72 -0
  861. package/core/dist/runtime-v2/tools/artificer-l2-tool-contract.d.ts.map +1 -0
  862. package/core/dist/runtime-v2/tools/artificer-l2-tool-contract.js +275 -0
  863. package/core/dist/runtime-v2/tools/artificer-l2-tool-contract.js.map +1 -0
  864. package/core/dist/runtime-v2/tools/artificer-output-typebox.d.ts +78 -0
  865. package/core/dist/runtime-v2/tools/artificer-output-typebox.d.ts.map +1 -0
  866. package/core/dist/runtime-v2/tools/artificer-output-typebox.js +70 -0
  867. package/core/dist/runtime-v2/tools/artificer-output-typebox.js.map +1 -0
  868. package/core/dist/runtime-v2/tools/dreamer-output-typebox.d.ts +63 -0
  869. package/core/dist/runtime-v2/tools/dreamer-output-typebox.d.ts.map +1 -0
  870. package/core/dist/runtime-v2/tools/dreamer-output-typebox.js +55 -0
  871. package/core/dist/runtime-v2/tools/dreamer-output-typebox.js.map +1 -0
  872. package/core/dist/runtime-v2/types/event-types.d.ts +32 -3
  873. package/core/dist/runtime-v2/types/event-types.d.ts.map +1 -1
  874. package/core/dist/runtime-v2/types/event-types.js +8 -0
  875. package/core/dist/runtime-v2/types/event-types.js.map +1 -1
  876. package/core/dist/runtime-v2/types/evidence-chain-contract.d.ts +213 -0
  877. package/core/dist/runtime-v2/types/evidence-chain-contract.d.ts.map +1 -0
  878. package/core/dist/runtime-v2/types/evidence-chain-contract.js +1064 -0
  879. package/core/dist/runtime-v2/types/evidence-chain-contract.js.map +1 -0
  880. package/core/dist/runtime-v2/types/index.d.ts +4 -2
  881. package/core/dist/runtime-v2/types/index.d.ts.map +1 -1
  882. package/core/dist/runtime-v2/types/index.js +2 -1
  883. package/core/dist/runtime-v2/types/index.js.map +1 -1
  884. package/core/dist/runtime-v2/types/principle-enums.d.ts +2 -2
  885. package/core/dist/runtime-v2/types/principle-enums.d.ts.map +1 -1
  886. package/core/dist/runtime-v2/types/principle-enums.js +1 -0
  887. package/core/dist/runtime-v2/types/principle-enums.js.map +1 -1
  888. package/core/dist/runtime-v2/types/principle-schema.d.ts +1 -1
  889. package/core/dist/runtime-v2/types/principle-tree-store.d.ts +1 -1
  890. package/core/dist/runtime-v2/utils/cli-process-runner.d.ts.map +1 -1
  891. package/core/dist/runtime-v2/utils/cli-process-runner.js +5 -2
  892. package/core/dist/runtime-v2/utils/cli-process-runner.js.map +1 -1
  893. package/core/dist/runtime-v2/utils/cli-process-runner.test.js +7 -5
  894. package/core/dist/runtime-v2/utils/cli-process-runner.test.js.map +1 -1
  895. package/core/dist/telemetry-event.d.ts +3 -3
  896. package/core/dist/telemetry-event.d.ts.map +1 -1
  897. package/core/dist/telemetry-event.js +34 -1
  898. package/core/dist/telemetry-event.js.map +1 -1
  899. package/core/dist/trajectory-store.js +0 -2
  900. package/core/dist/trajectory-store.js.map +1 -1
  901. package/core/package.json +10 -1
  902. package/dist/installer.d.ts +11 -0
  903. package/dist/installer.d.ts.map +1 -1
  904. package/dist/installer.js +47 -2
  905. package/dist/installer.js.map +1 -1
  906. package/dist/mvp-config.d.ts.map +1 -1
  907. package/dist/mvp-config.js +2 -0
  908. package/dist/mvp-config.js.map +1 -1
  909. package/package.json +3 -2
  910. package/pd-cli/dist/commands/__tests__/legacy-cleanup.test.d.ts +18 -0
  911. package/pd-cli/dist/commands/__tests__/legacy-cleanup.test.d.ts.map +1 -0
  912. package/pd-cli/dist/commands/__tests__/legacy-cleanup.test.js +459 -0
  913. package/pd-cli/dist/commands/__tests__/legacy-cleanup.test.js.map +1 -0
  914. package/pd-cli/dist/commands/__tests__/mvp-smoke.test.d.ts +15 -0
  915. package/pd-cli/dist/commands/__tests__/mvp-smoke.test.d.ts.map +1 -0
  916. package/pd-cli/dist/commands/__tests__/mvp-smoke.test.js +262 -0
  917. package/pd-cli/dist/commands/__tests__/mvp-smoke.test.js.map +1 -0
  918. package/pd-cli/dist/commands/__tests__/rulecode-flag-wiring.test.d.ts +21 -0
  919. package/pd-cli/dist/commands/__tests__/rulecode-flag-wiring.test.d.ts.map +1 -0
  920. package/pd-cli/dist/commands/__tests__/rulecode-flag-wiring.test.js +179 -0
  921. package/pd-cli/dist/commands/__tests__/rulecode-flag-wiring.test.js.map +1 -0
  922. package/pd-cli/dist/commands/__tests__/rulecode-handler.test.d.ts +16 -0
  923. package/pd-cli/dist/commands/__tests__/rulecode-handler.test.d.ts.map +1 -0
  924. package/pd-cli/dist/commands/__tests__/rulecode-handler.test.js +285 -0
  925. package/pd-cli/dist/commands/__tests__/rulecode-handler.test.js.map +1 -0
  926. package/pd-cli/dist/commands/__tests__/run-rulehost-flag-wiring.test.d.ts +24 -0
  927. package/pd-cli/dist/commands/__tests__/run-rulehost-flag-wiring.test.d.ts.map +1 -0
  928. package/pd-cli/dist/commands/__tests__/run-rulehost-flag-wiring.test.js +223 -0
  929. package/pd-cli/dist/commands/__tests__/run-rulehost-flag-wiring.test.js.map +1 -0
  930. package/pd-cli/dist/commands/__tests__/runtime-probe-config.test.d.ts +20 -0
  931. package/pd-cli/dist/commands/__tests__/runtime-probe-config.test.d.ts.map +1 -0
  932. package/pd-cli/dist/commands/__tests__/runtime-probe-config.test.js +388 -0
  933. package/pd-cli/dist/commands/__tests__/runtime-probe-config.test.js.map +1 -0
  934. package/pd-cli/dist/commands/build-trajectory-evidence.d.ts +21 -0
  935. package/pd-cli/dist/commands/build-trajectory-evidence.d.ts.map +1 -0
  936. package/pd-cli/dist/commands/build-trajectory-evidence.js +161 -0
  937. package/pd-cli/dist/commands/build-trajectory-evidence.js.map +1 -0
  938. package/pd-cli/dist/commands/candidate.d.ts +24 -0
  939. package/pd-cli/dist/commands/candidate.d.ts.map +1 -1
  940. package/pd-cli/dist/commands/candidate.js +147 -75
  941. package/pd-cli/dist/commands/candidate.js.map +1 -1
  942. package/pd-cli/dist/commands/command-helpers.d.ts +19 -0
  943. package/pd-cli/dist/commands/command-helpers.d.ts.map +1 -0
  944. package/pd-cli/dist/commands/command-helpers.js +22 -0
  945. package/pd-cli/dist/commands/command-helpers.js.map +1 -0
  946. package/pd-cli/dist/commands/config-doctor.d.ts.map +1 -1
  947. package/pd-cli/dist/commands/config-doctor.js +4 -0
  948. package/pd-cli/dist/commands/config-doctor.js.map +1 -1
  949. package/pd-cli/dist/commands/diagnose.d.ts +1 -0
  950. package/pd-cli/dist/commands/diagnose.d.ts.map +1 -1
  951. package/pd-cli/dist/commands/diagnose.js +252 -149
  952. package/pd-cli/dist/commands/diagnose.js.map +1 -1
  953. package/pd-cli/dist/commands/evolution-tasks-show.js +0 -1
  954. package/pd-cli/dist/commands/evolution-tasks-show.js.map +1 -1
  955. package/pd-cli/dist/commands/legacy-cleanup.d.ts +72 -6
  956. package/pd-cli/dist/commands/legacy-cleanup.d.ts.map +1 -1
  957. package/pd-cli/dist/commands/legacy-cleanup.js +243 -23
  958. package/pd-cli/dist/commands/legacy-cleanup.js.map +1 -1
  959. package/pd-cli/dist/commands/mvp-smoke.d.ts +30 -0
  960. package/pd-cli/dist/commands/mvp-smoke.d.ts.map +1 -0
  961. package/pd-cli/dist/commands/mvp-smoke.js +139 -0
  962. package/pd-cli/dist/commands/mvp-smoke.js.map +1 -0
  963. package/pd-cli/dist/commands/pain-record.d.ts +2 -0
  964. package/pd-cli/dist/commands/pain-record.d.ts.map +1 -1
  965. package/pd-cli/dist/commands/pain-record.js +45 -7
  966. package/pd-cli/dist/commands/pain-record.js.map +1 -1
  967. package/pd-cli/dist/commands/pain-retry.d.ts.map +1 -1
  968. package/pd-cli/dist/commands/pain-retry.js +46 -43
  969. package/pd-cli/dist/commands/pain-retry.js.map +1 -1
  970. package/pd-cli/dist/commands/quality-scorecard.d.ts +9 -0
  971. package/pd-cli/dist/commands/quality-scorecard.d.ts.map +1 -0
  972. package/pd-cli/dist/commands/quality-scorecard.js +241 -0
  973. package/pd-cli/dist/commands/quality-scorecard.js.map +1 -0
  974. package/pd-cli/dist/commands/rulecode.d.ts +85 -0
  975. package/pd-cli/dist/commands/rulecode.d.ts.map +1 -0
  976. package/pd-cli/dist/commands/rulecode.js +356 -0
  977. package/pd-cli/dist/commands/rulecode.js.map +1 -0
  978. package/pd-cli/dist/commands/runtime-activation.d.ts +37 -0
  979. package/pd-cli/dist/commands/runtime-activation.d.ts.map +1 -1
  980. package/pd-cli/dist/commands/runtime-activation.js +416 -2
  981. package/pd-cli/dist/commands/runtime-activation.js.map +1 -1
  982. package/pd-cli/dist/commands/runtime-features.d.ts.map +1 -1
  983. package/pd-cli/dist/commands/runtime-features.js +2 -7
  984. package/pd-cli/dist/commands/runtime-features.js.map +1 -1
  985. package/pd-cli/dist/commands/runtime-internalization-integrity-repair.d.ts.map +1 -1
  986. package/pd-cli/dist/commands/runtime-internalization-integrity-repair.js +25 -15
  987. package/pd-cli/dist/commands/runtime-internalization-integrity-repair.js.map +1 -1
  988. package/pd-cli/dist/commands/runtime-internalization-integrity.d.ts.map +1 -1
  989. package/pd-cli/dist/commands/runtime-internalization-integrity.js +42 -1
  990. package/pd-cli/dist/commands/runtime-internalization-integrity.js.map +1 -1
  991. package/pd-cli/dist/commands/runtime-internalization-queue.d.ts.map +1 -1
  992. package/pd-cli/dist/commands/runtime-internalization-queue.js +35 -3
  993. package/pd-cli/dist/commands/runtime-internalization-queue.js.map +1 -1
  994. package/pd-cli/dist/commands/runtime-internalization-run-once.d.ts.map +1 -1
  995. package/pd-cli/dist/commands/runtime-internalization-run-once.js +316 -320
  996. package/pd-cli/dist/commands/runtime-internalization-run-once.js.map +1 -1
  997. package/pd-cli/dist/commands/runtime-internalization-run-rulehost.d.ts +23 -0
  998. package/pd-cli/dist/commands/runtime-internalization-run-rulehost.d.ts.map +1 -0
  999. package/pd-cli/dist/commands/runtime-internalization-run-rulehost.js +361 -0
  1000. package/pd-cli/dist/commands/runtime-internalization-run-rulehost.js.map +1 -0
  1001. package/pd-cli/dist/commands/runtime-recovery-failed-tasks.d.ts +10 -0
  1002. package/pd-cli/dist/commands/runtime-recovery-failed-tasks.d.ts.map +1 -0
  1003. package/pd-cli/dist/commands/runtime-recovery-failed-tasks.js +164 -0
  1004. package/pd-cli/dist/commands/runtime-recovery-failed-tasks.js.map +1 -0
  1005. package/pd-cli/dist/commands/runtime-recovery.d.ts.map +1 -1
  1006. package/pd-cli/dist/commands/runtime-recovery.js +9 -8
  1007. package/pd-cli/dist/commands/runtime-recovery.js.map +1 -1
  1008. package/pd-cli/dist/commands/runtime.d.ts +7 -1
  1009. package/pd-cli/dist/commands/runtime.d.ts.map +1 -1
  1010. package/pd-cli/dist/commands/runtime.js +223 -30
  1011. package/pd-cli/dist/commands/runtime.js.map +1 -1
  1012. package/pd-cli/dist/commands/samples-list.js +0 -1
  1013. package/pd-cli/dist/commands/samples-list.js.map +1 -1
  1014. package/pd-cli/dist/commands/task.d.ts +11 -0
  1015. package/pd-cli/dist/commands/task.d.ts.map +1 -1
  1016. package/pd-cli/dist/commands/task.js +148 -6
  1017. package/pd-cli/dist/commands/task.js.map +1 -1
  1018. package/pd-cli/dist/index.d.ts +1 -1
  1019. package/pd-cli/dist/index.js +155 -70
  1020. package/pd-cli/dist/index.js.map +1 -1
  1021. package/pd-cli/dist/legacy/session-history-import.js +0 -19
  1022. package/pd-cli/dist/legacy/session-history-import.js.map +1 -1
  1023. package/pd-cli/dist/services/__tests__/cli-output.test.d.ts +18 -0
  1024. package/pd-cli/dist/services/__tests__/cli-output.test.d.ts.map +1 -0
  1025. package/pd-cli/dist/services/__tests__/cli-output.test.js +103 -0
  1026. package/pd-cli/dist/services/__tests__/cli-output.test.js.map +1 -0
  1027. package/pd-cli/dist/services/__tests__/runtime-adapter-resolver.test.d.ts +18 -0
  1028. package/pd-cli/dist/services/__tests__/runtime-adapter-resolver.test.d.ts.map +1 -0
  1029. package/pd-cli/dist/services/__tests__/runtime-adapter-resolver.test.js +651 -0
  1030. package/pd-cli/dist/services/__tests__/runtime-adapter-resolver.test.js.map +1 -0
  1031. package/pd-cli/dist/services/cli-output.d.ts +61 -0
  1032. package/pd-cli/dist/services/cli-output.d.ts.map +1 -0
  1033. package/pd-cli/dist/services/cli-output.js +72 -0
  1034. package/pd-cli/dist/services/cli-output.js.map +1 -0
  1035. package/pd-cli/dist/services/config-doctor.d.ts +2 -0
  1036. package/pd-cli/dist/services/config-doctor.d.ts.map +1 -1
  1037. package/pd-cli/dist/services/config-doctor.js +11 -8
  1038. package/pd-cli/dist/services/config-doctor.js.map +1 -1
  1039. package/pd-cli/dist/services/console-launcher.js +1 -1
  1040. package/pd-cli/dist/services/console-launcher.js.map +1 -1
  1041. package/pd-cli/dist/services/demo-rule-compiler.d.ts +24 -0
  1042. package/pd-cli/dist/services/demo-rule-compiler.d.ts.map +1 -0
  1043. package/pd-cli/dist/services/demo-rule-compiler.js +58 -0
  1044. package/pd-cli/dist/services/demo-rule-compiler.js.map +1 -0
  1045. package/pd-cli/dist/services/feature-flag-loader.js +0 -1
  1046. package/pd-cli/dist/services/feature-flag-loader.js.map +1 -1
  1047. package/pd-cli/dist/services/mainline-snapshot-assembler.d.ts +35 -0
  1048. package/pd-cli/dist/services/mainline-snapshot-assembler.d.ts.map +1 -0
  1049. package/pd-cli/dist/services/mainline-snapshot-assembler.js +428 -0
  1050. package/pd-cli/dist/services/mainline-snapshot-assembler.js.map +1 -0
  1051. package/pd-cli/dist/services/pain-flood-simulation-runner.d.ts.map +1 -1
  1052. package/pd-cli/dist/services/pain-flood-simulation-runner.js +95 -10
  1053. package/pd-cli/dist/services/pain-flood-simulation-runner.js.map +1 -1
  1054. package/pd-cli/dist/services/pd-config-loader.d.ts +4 -0
  1055. package/pd-cli/dist/services/pd-config-loader.d.ts.map +1 -1
  1056. package/pd-cli/dist/services/pd-config-loader.js +12 -0
  1057. package/pd-cli/dist/services/pd-config-loader.js.map +1 -1
  1058. package/pd-cli/dist/services/quality-scorecard/data-extractor.d.ts +28 -0
  1059. package/pd-cli/dist/services/quality-scorecard/data-extractor.d.ts.map +1 -0
  1060. package/pd-cli/dist/services/quality-scorecard/data-extractor.js +118 -0
  1061. package/pd-cli/dist/services/quality-scorecard/data-extractor.js.map +1 -0
  1062. package/pd-cli/dist/services/quality-scorecard/local-evaluator.d.ts +18 -0
  1063. package/pd-cli/dist/services/quality-scorecard/local-evaluator.d.ts.map +1 -0
  1064. package/pd-cli/dist/services/quality-scorecard/local-evaluator.js +112 -0
  1065. package/pd-cli/dist/services/quality-scorecard/local-evaluator.js.map +1 -0
  1066. package/pd-cli/dist/services/quality-scorecard/strong-model-gate.d.ts +14 -0
  1067. package/pd-cli/dist/services/quality-scorecard/strong-model-gate.d.ts.map +1 -0
  1068. package/pd-cli/dist/services/quality-scorecard/strong-model-gate.js +128 -0
  1069. package/pd-cli/dist/services/quality-scorecard/strong-model-gate.js.map +1 -0
  1070. package/pd-cli/dist/services/resolve-runtime-from-pd-config.d.ts +70 -0
  1071. package/pd-cli/dist/services/resolve-runtime-from-pd-config.d.ts.map +1 -0
  1072. package/pd-cli/dist/services/resolve-runtime-from-pd-config.js +138 -0
  1073. package/pd-cli/dist/services/resolve-runtime-from-pd-config.js.map +1 -0
  1074. package/pd-cli/dist/services/rulehost-pipeline-runner.d.ts +132 -0
  1075. package/pd-cli/dist/services/rulehost-pipeline-runner.d.ts.map +1 -0
  1076. package/pd-cli/dist/services/rulehost-pipeline-runner.js +392 -0
  1077. package/pd-cli/dist/services/rulehost-pipeline-runner.js.map +1 -0
  1078. package/pd-cli/dist/services/runtime-adapter-resolver.d.ts +105 -0
  1079. package/pd-cli/dist/services/runtime-adapter-resolver.d.ts.map +1 -0
  1080. package/pd-cli/dist/services/runtime-adapter-resolver.js +188 -0
  1081. package/pd-cli/dist/services/runtime-adapter-resolver.js.map +1 -0
  1082. package/pd-cli/dist/services/synthetic-baseline-runner.d.ts.map +1 -1
  1083. package/pd-cli/dist/services/synthetic-baseline-runner.js +97 -6
  1084. package/pd-cli/dist/services/synthetic-baseline-runner.js.map +1 -1
  1085. package/pd-cli/dist/utils/production-workspace-guard.d.ts +0 -7
  1086. package/pd-cli/dist/utils/production-workspace-guard.d.ts.map +1 -1
  1087. package/pd-cli/dist/utils/production-workspace-guard.js +0 -11
  1088. package/pd-cli/dist/utils/production-workspace-guard.js.map +1 -1
  1089. package/pd-cli/dist/utils/production-workspace-guard.test.js +9 -2
  1090. package/pd-cli/dist/utils/production-workspace-guard.test.js.map +1 -1
  1091. package/pd-cli/package.json +3 -2
  1092. package/plugin/dist/config/defaults/runtime.d.ts +0 -6
  1093. package/plugin/dist/config/defaults/runtime.js +0 -7
  1094. package/plugin/dist/core/code-implementation-storage.d.ts +0 -9
  1095. package/plugin/dist/core/code-implementation-storage.js +0 -34
  1096. package/plugin/dist/core/config-health.d.ts +27 -0
  1097. package/plugin/dist/core/config-health.js +60 -0
  1098. package/plugin/dist/core/event-log.d.ts +10 -1
  1099. package/plugin/dist/core/event-log.js +11 -0
  1100. package/plugin/dist/core/init.d.ts +1 -1
  1101. package/plugin/dist/core/init.js +10 -14
  1102. package/plugin/dist/core/paths.d.ts +0 -6
  1103. package/plugin/dist/core/paths.js +0 -6
  1104. package/plugin/dist/core/principle-compiler/code-validator.js +4 -1
  1105. package/plugin/dist/core/principle-tree-ledger.d.ts +0 -4
  1106. package/plugin/dist/core/principle-tree-ledger.js +0 -7
  1107. package/plugin/dist/core/rule-host.d.ts +45 -15
  1108. package/plugin/dist/core/rule-host.js +240 -81
  1109. package/plugin/dist/core/rule-implementation-runtime.d.ts +13 -0
  1110. package/plugin/dist/core/rule-implementation-runtime.js +91 -3
  1111. package/plugin/dist/core/runtime-v2-prompt-activation-reader.js +2 -2
  1112. package/plugin/dist/core/thinking-models.d.ts +3 -2
  1113. package/plugin/dist/core/thinking-models.js +9 -29
  1114. package/plugin/dist/core/trajectory-types.d.ts +4 -0
  1115. package/plugin/dist/core/trajectory.js +55 -5
  1116. package/plugin/dist/core/workspace-dir-validation.d.ts +2 -2
  1117. package/plugin/dist/core/workspace-dir-validation.js +2 -2
  1118. package/plugin/dist/hooks/after-tool-call-helpers.d.ts +8 -9
  1119. package/plugin/dist/hooks/after-tool-call-helpers.js +89 -100
  1120. package/plugin/dist/hooks/after-tool-call-types.d.ts +2 -8
  1121. package/plugin/dist/hooks/gate.js +1 -1
  1122. package/plugin/dist/hooks/llm.js +11 -2
  1123. package/plugin/dist/hooks/pain.d.ts +0 -1
  1124. package/plugin/dist/hooks/pain.js +3 -2
  1125. package/plugin/dist/hooks/raw-observation-adapter.d.ts +57 -0
  1126. package/plugin/dist/hooks/raw-observation-adapter.js +170 -0
  1127. package/plugin/dist/hooks/raw-observation-types.d.ts +62 -0
  1128. package/plugin/dist/hooks/raw-observation-types.js +15 -0
  1129. package/plugin/dist/hooks/trajectory-collector.d.ts +17 -28
  1130. package/plugin/dist/hooks/trajectory-collector.js +71 -104
  1131. package/plugin/dist/hooks/trajectory-evidence.js +23 -0
  1132. package/plugin/dist/hooks/triage-adapter.d.ts +7 -31
  1133. package/plugin/dist/hooks/triage-adapter.js +32 -61
  1134. package/plugin/dist/hooks/trigger-cooldown-tracker.d.ts +30 -0
  1135. package/plugin/dist/hooks/trigger-cooldown-tracker.js +55 -0
  1136. package/plugin/dist/index.d.ts +11 -0
  1137. package/plugin/dist/index.js +73 -27
  1138. package/plugin/dist/openclaw-sdk.d.ts +1 -0
  1139. package/plugin/dist/service/evolution-worker.d.ts +1 -1
  1140. package/plugin/dist/service/internalization-auto-consumer-service.d.ts +8 -0
  1141. package/plugin/dist/service/internalization-auto-consumer-service.js +322 -0
  1142. package/plugin/dist/types/event-types.d.ts +1 -1
  1143. package/plugin/dist/utils/io.js +24 -3
  1144. package/plugin/package.json +4 -3
  1145. package/plugin/scripts/sync-plugin.mjs +43 -0
  1146. package/plugin/templates/langs/en/principles/THINKING_OS.md +12 -0
  1147. package/plugin/templates/langs/en/skills/pd-runtime-v2/SKILL.md +1 -1
  1148. package/plugin/templates/langs/zh/principles/THINKING_OS.md +12 -0
  1149. package/plugin/templates/langs/zh/skills/pd-runtime-v2/SKILL.md +1 -1
  1150. package/templates/langs/en/principles/THINKING_OS.md +12 -0
  1151. package/templates/langs/zh/principles/THINKING_OS.md +12 -0
  1152. package/console/dist/server/routes/state.d.ts +0 -11
  1153. package/console/dist/server/routes/state.js +0 -97
  1154. package/console/dist/ui/components/UpdateBanner.d.ts +0 -1
  1155. package/console/dist/ui/components/UpdateBanner.js +0 -41
  1156. package/console/dist/ui/components/UpdateProgressDialog.d.ts +0 -12
  1157. package/console/dist/ui/components/UpdateProgressDialog.js +0 -28
  1158. package/console/dist/ui/components/approval-card.d.ts +0 -8
  1159. package/console/dist/ui/components/approval-card.js +0 -39
  1160. package/console/dist/ui/components/approval-detail-dialog.d.ts +0 -9
  1161. package/console/dist/ui/components/approval-detail-dialog.js +0 -20
  1162. package/console/dist/ui/components/rejection-reason-dialog.d.ts +0 -6
  1163. package/console/dist/ui/components/rejection-reason-dialog.js +0 -23
  1164. package/core/dist/evolution-hook.d.ts +0 -70
  1165. package/core/dist/evolution-hook.d.ts.map +0 -1
  1166. package/core/dist/evolution-hook.js +0 -10
  1167. package/core/dist/evolution-hook.js.map +0 -1
  1168. package/core/dist/pain-flag-resolver.d.ts +0 -18
  1169. package/core/dist/pain-flag-resolver.d.ts.map +0 -1
  1170. package/core/dist/pain-flag-resolver.js +0 -21
  1171. package/core/dist/pain-flag-resolver.js.map +0 -1
  1172. package/core/dist/pain-recorder.d.ts +0 -38
  1173. package/core/dist/pain-recorder.d.ts.map +0 -1
  1174. package/core/dist/pain-recorder.js +0 -62
  1175. package/core/dist/pain-recorder.js.map +0 -1
  1176. package/core/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.integration.test.d.ts +0 -2
  1177. package/core/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.integration.test.d.ts.map +0 -1
  1178. package/core/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.integration.test.js +0 -170
  1179. package/core/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.integration.test.js.map +0 -1
  1180. package/core/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.test.d.ts +0 -2
  1181. package/core/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.test.d.ts.map +0 -1
  1182. package/core/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.test.js +0 -396
  1183. package/core/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.test.js.map +0 -1
  1184. package/core/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-language.test.d.ts +0 -13
  1185. package/core/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-language.test.d.ts.map +0 -1
  1186. package/core/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-language.test.js +0 -97
  1187. package/core/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-language.test.js.map +0 -1
  1188. package/core/dist/runtime-v2/runner/__tests__/diagnostician-runner.integration.test.d.ts +0 -2
  1189. package/core/dist/runtime-v2/runner/__tests__/diagnostician-runner.integration.test.d.ts.map +0 -1
  1190. package/core/dist/runtime-v2/runner/__tests__/diagnostician-runner.integration.test.js +0 -378
  1191. package/core/dist/runtime-v2/runner/__tests__/diagnostician-runner.integration.test.js.map +0 -1
  1192. package/core/dist/runtime-v2/runner/__tests__/diagnostician-runner.test.d.ts +0 -2
  1193. package/core/dist/runtime-v2/runner/__tests__/diagnostician-runner.test.d.ts.map +0 -1
  1194. package/core/dist/runtime-v2/runner/__tests__/diagnostician-runner.test.js +0 -682
  1195. package/core/dist/runtime-v2/runner/__tests__/diagnostician-runner.test.js.map +0 -1
  1196. package/core/dist/runtime-v2/runner/__tests__/diagnostician-telemetry.test.d.ts +0 -2
  1197. package/core/dist/runtime-v2/runner/__tests__/diagnostician-telemetry.test.d.ts.map +0 -1
  1198. package/core/dist/runtime-v2/runner/__tests__/diagnostician-telemetry.test.js +0 -286
  1199. package/core/dist/runtime-v2/runner/__tests__/diagnostician-telemetry.test.js.map +0 -1
  1200. package/core/dist/runtime-v2/runner/__tests__/dual-track-e2e.test.d.ts +0 -2
  1201. package/core/dist/runtime-v2/runner/__tests__/dual-track-e2e.test.d.ts.map +0 -1
  1202. package/core/dist/runtime-v2/runner/__tests__/dual-track-e2e.test.js +0 -320
  1203. package/core/dist/runtime-v2/runner/__tests__/dual-track-e2e.test.js.map +0 -1
  1204. package/core/dist/runtime-v2/runner/__tests__/lease-expiration-recovery.integration.test.d.ts +0 -2
  1205. package/core/dist/runtime-v2/runner/__tests__/lease-expiration-recovery.integration.test.d.ts.map +0 -1
  1206. package/core/dist/runtime-v2/runner/__tests__/lease-expiration-recovery.integration.test.js +0 -261
  1207. package/core/dist/runtime-v2/runner/__tests__/lease-expiration-recovery.integration.test.js.map +0 -1
  1208. package/core/dist/runtime-v2/runner/__tests__/m5-05-e2e.test.d.ts +0 -2
  1209. package/core/dist/runtime-v2/runner/__tests__/m5-05-e2e.test.d.ts.map +0 -1
  1210. package/core/dist/runtime-v2/runner/__tests__/m5-05-e2e.test.js +0 -405
  1211. package/core/dist/runtime-v2/runner/__tests__/m5-05-e2e.test.js.map +0 -1
  1212. package/core/dist/runtime-v2/runner/__tests__/m6-06-e2e.test.d.ts +0 -2
  1213. package/core/dist/runtime-v2/runner/__tests__/m6-06-e2e.test.d.ts.map +0 -1
  1214. package/core/dist/runtime-v2/runner/__tests__/m6-06-e2e.test.js +0 -347
  1215. package/core/dist/runtime-v2/runner/__tests__/m6-06-e2e.test.js.map +0 -1
  1216. package/core/dist/runtime-v2/runner/__tests__/m6-06-legacy.test.d.ts +0 -2
  1217. package/core/dist/runtime-v2/runner/__tests__/m6-06-legacy.test.d.ts.map +0 -1
  1218. package/core/dist/runtime-v2/runner/__tests__/m6-06-legacy.test.js +0 -186
  1219. package/core/dist/runtime-v2/runner/__tests__/m6-06-legacy.test.js.map +0 -1
  1220. package/core/dist/runtime-v2/runner/__tests__/m6-06-real-path.test.d.ts +0 -2
  1221. package/core/dist/runtime-v2/runner/__tests__/m6-06-real-path.test.d.ts.map +0 -1
  1222. package/core/dist/runtime-v2/runner/__tests__/m6-06-real-path.test.js +0 -355
  1223. package/core/dist/runtime-v2/runner/__tests__/m6-06-real-path.test.js.map +0 -1
  1224. package/core/dist/runtime-v2/runner/__tests__/m8-02-e2e.test.d.ts +0 -2
  1225. package/core/dist/runtime-v2/runner/__tests__/m8-02-e2e.test.d.ts.map +0 -1
  1226. package/core/dist/runtime-v2/runner/__tests__/m8-02-e2e.test.js +0 -488
  1227. package/core/dist/runtime-v2/runner/__tests__/m8-02-e2e.test.js.map +0 -1
  1228. package/core/dist/runtime-v2/runner/__tests__/m9-adapter-integration.test.d.ts +0 -2
  1229. package/core/dist/runtime-v2/runner/__tests__/m9-adapter-integration.test.d.ts.map +0 -1
  1230. package/core/dist/runtime-v2/runner/__tests__/m9-adapter-integration.test.js +0 -171
  1231. package/core/dist/runtime-v2/runner/__tests__/m9-adapter-integration.test.js.map +0 -1
  1232. package/core/dist/runtime-v2/runner/__tests__/m9-e2e.test.d.ts +0 -2
  1233. package/core/dist/runtime-v2/runner/__tests__/m9-e2e.test.d.ts.map +0 -1
  1234. package/core/dist/runtime-v2/runner/__tests__/m9-e2e.test.js +0 -182
  1235. package/core/dist/runtime-v2/runner/__tests__/m9-e2e.test.js.map +0 -1
  1236. package/core/dist/runtime-v2/runner/__tests__/max-attempts-exceeded.integration.test.d.ts +0 -2
  1237. package/core/dist/runtime-v2/runner/__tests__/max-attempts-exceeded.integration.test.d.ts.map +0 -1
  1238. package/core/dist/runtime-v2/runner/__tests__/max-attempts-exceeded.integration.test.js +0 -276
  1239. package/core/dist/runtime-v2/runner/__tests__/max-attempts-exceeded.integration.test.js.map +0 -1
  1240. package/core/dist/runtime-v2/runner/__tests__/retry-wait-recovery.integration.test.d.ts +0 -2
  1241. package/core/dist/runtime-v2/runner/__tests__/retry-wait-recovery.integration.test.d.ts.map +0 -1
  1242. package/core/dist/runtime-v2/runner/__tests__/retry-wait-recovery.integration.test.js +0 -272
  1243. package/core/dist/runtime-v2/runner/__tests__/retry-wait-recovery.integration.test.js.map +0 -1
  1244. package/core/dist/runtime-v2/runner/__tests__/start-run-input.test.d.ts +0 -2
  1245. package/core/dist/runtime-v2/runner/__tests__/start-run-input.test.d.ts.map +0 -1
  1246. package/core/dist/runtime-v2/runner/__tests__/start-run-input.test.js +0 -67
  1247. package/core/dist/runtime-v2/runner/__tests__/start-run-input.test.js.map +0 -1
  1248. package/core/dist/runtime-v2/runner/diagnostician-runner-options.d.ts +0 -47
  1249. package/core/dist/runtime-v2/runner/diagnostician-runner-options.d.ts.map +0 -1
  1250. package/core/dist/runtime-v2/runner/diagnostician-runner-options.js +0 -20
  1251. package/core/dist/runtime-v2/runner/diagnostician-runner-options.js.map +0 -1
  1252. package/core/dist/runtime-v2/runner/diagnostician-runner.d.ts +0 -87
  1253. package/core/dist/runtime-v2/runner/diagnostician-runner.d.ts.map +0 -1
  1254. package/core/dist/runtime-v2/runner/diagnostician-runner.js +0 -441
  1255. package/core/dist/runtime-v2/runner/diagnostician-runner.js.map +0 -1
  1256. package/core/dist/storage-adapter.d.ts +0 -59
  1257. package/core/dist/storage-adapter.d.ts.map +0 -1
  1258. package/core/dist/storage-adapter.js +0 -2
  1259. package/core/dist/storage-adapter.js.map +0 -1
  1260. package/core/dist/types/workspace-resolver.d.ts +0 -25
  1261. package/core/dist/types/workspace-resolver.d.ts.map +0 -1
  1262. package/core/dist/types/workspace-resolver.js +0 -10
  1263. package/core/dist/types/workspace-resolver.js.map +0 -1
  1264. package/core/dist/types.d.ts +0 -56
  1265. package/core/dist/types.d.ts.map +0 -1
  1266. package/core/dist/types.js +0 -16
  1267. package/core/dist/types.js.map +0 -1
  1268. package/pd-cli/dist/principle-tree-ledger-adapter.d.ts +0 -12
  1269. package/pd-cli/dist/principle-tree-ledger-adapter.d.ts.map +0 -1
  1270. package/pd-cli/dist/principle-tree-ledger-adapter.js +0 -12
  1271. package/pd-cli/dist/principle-tree-ledger-adapter.js.map +0 -1
  1272. package/plugin/dist/core/evolution-hook.d.ts +0 -54
  1273. package/plugin/dist/core/evolution-hook.js +0 -9
  1274. package/plugin/dist/core/file-storage-adapter.d.ts +0 -43
  1275. package/plugin/dist/core/file-storage-adapter.js +0 -158
  1276. package/plugin/dist/core/merge-gate-audit.d.ts +0 -21
  1277. package/plugin/dist/core/merge-gate-audit.js +0 -241
  1278. package/plugin/dist/core/pain-context-extractor.d.ts +0 -31
  1279. package/plugin/dist/core/pain-context-extractor.js +0 -278
  1280. package/plugin/dist/core/pain-lifecycle.d.ts +0 -15
  1281. package/plugin/dist/core/pain-lifecycle.js +0 -37
  1282. package/plugin/dist/core/pain-signal-adapter.d.ts +0 -37
  1283. package/plugin/dist/core/pain-signal-adapter.js +0 -1
  1284. package/plugin/dist/core/pain-signal.d.ts +0 -6
  1285. package/plugin/dist/core/pain-signal.js +0 -3
  1286. package/plugin/dist/core/principle-injector.d.ts +0 -55
  1287. package/plugin/dist/core/principle-injector.js +0 -17
  1288. package/plugin/dist/core/principle-tree-migration.d.ts +0 -35
  1289. package/plugin/dist/core/principle-tree-migration.js +0 -137
  1290. package/plugin/dist/core/storage-adapter.d.ts +0 -58
  1291. package/plugin/dist/core/storage-adapter.js +0 -1
  1292. package/plugin/dist/core/telemetry-event.d.ts +0 -66
  1293. package/plugin/dist/core/telemetry-event.js +0 -86
  1294. package/plugin/dist/core/training-program.d.ts +0 -233
  1295. package/plugin/dist/core/training-program.js +0 -435
  1296. package/plugin/dist/core/workspace-dir-service.d.ts +0 -33
  1297. package/plugin/dist/core/workspace-dir-service.js +0 -71
  1298. package/plugin/dist/hooks/lifecycle-routing.d.ts +0 -24
  1299. package/plugin/dist/hooks/lifecycle-routing.js +0 -110
  1300. package/plugin/dist/service/event-log-auditor.d.ts +0 -46
  1301. package/plugin/dist/service/event-log-auditor.js +0 -236
  1302. package/plugin/dist/service/evolution-queue-lock.d.ts +0 -18
  1303. package/plugin/dist/service/evolution-queue-lock.js +0 -36
  1304. package/plugin/dist/service/failure-classifier.d.ts +0 -46
  1305. package/plugin/dist/service/failure-classifier.js +0 -57
  1306. package/plugin/dist/service/internalization-trigger-adapter.d.ts +0 -51
  1307. package/plugin/dist/service/internalization-trigger-adapter.js +0 -184
  1308. package/plugin/dist/service/monitoring-query-service.d.ts +0 -21
  1309. package/plugin/dist/service/monitoring-query-service.js +0 -45
  1310. package/plugin/dist/service/subagent-workflow/index.d.ts +0 -3
  1311. package/plugin/dist/service/subagent-workflow/index.js +0 -2
  1312. package/plugin/dist/tools/critique-prompt.d.ts +0 -1
  1313. package/plugin/dist/tools/critique-prompt.js +0 -1
  1314. package/plugin/dist/tools/deep-reflect.d.ts +0 -1
  1315. package/plugin/dist/tools/deep-reflect.js +0 -1
  1316. package/plugin/dist/tools/model-index.d.ts +0 -1
  1317. package/plugin/dist/tools/model-index.js +0 -1
  1318. package/plugin/dist/types/event-payload.d.ts +0 -2
  1319. package/plugin/dist/types/event-payload.js +0 -1
  1320. package/plugin/dist/utils/glob-match.d.ts +0 -28
  1321. package/plugin/dist/utils/glob-match.js +0 -49
  1322. package/plugin/dist/utils/nlp.d.ts +0 -4
  1323. package/plugin/dist/utils/nlp.js +0 -21
  1324. package/plugin/dist/utils/plugin-logger.d.ts +0 -39
  1325. package/plugin/dist/utils/plugin-logger.js +0 -70
  1326. package/plugin/dist/utils/subagent-probe.d.ts +0 -35
  1327. package/plugin/dist/utils/subagent-probe.js +0 -67
@@ -76,6 +76,80 @@ export class ActivationDispatcher {
76
76
  if (input.rolloutDecision === 'reject') {
77
77
  return { decision: 'refused', reason: 'rollout_rejected', channel: input.channel };
78
78
  }
79
+ // 'approved' = approval already granted externally (ApprovalCompletionService).
80
+ // Bypass the approval queue check and activate directly. This is the
81
+ // post-approval dispatch path for high-risk channels (code_tool_hook).
82
+ //
83
+ // Security boundary (P1 fix): the dispatcher independently verifies the
84
+ // approval record — it does NOT trust the caller's rolloutDecision alone.
85
+ // Any caller passing rolloutDecision='approved' must also supply an
86
+ // approvalId that resolves to an approved record matching the artifact
87
+ // and channel. This prevents bypassing the owner approval boundary.
88
+ if (input.rolloutDecision === 'approved') {
89
+ if (!input.approvalId) {
90
+ return {
91
+ decision: 'refused',
92
+ reason: 'approved_dispatch_requires_approval_id',
93
+ nextAction: 'provide approvalId from a verified owner approval record',
94
+ channel: input.channel,
95
+ };
96
+ }
97
+ if (!this.approvalQueueStore) {
98
+ return {
99
+ decision: 'refused',
100
+ reason: 'approved_dispatch_without_approval_store',
101
+ nextAction: 'configure dispatcher with approvalQueueStore to verify approvals',
102
+ channel: input.channel,
103
+ };
104
+ }
105
+ let approvalRecord;
106
+ try {
107
+ approvalRecord = await this.approvalQueueStore.getById(input.approvalId);
108
+ }
109
+ catch {
110
+ return {
111
+ decision: 'refused',
112
+ reason: 'approval_record_read_failed',
113
+ nextAction: 'check_approval_store_availability',
114
+ channel: input.channel,
115
+ };
116
+ }
117
+ if (!approvalRecord) {
118
+ return {
119
+ decision: 'refused',
120
+ reason: `approval_record_not_found: ${input.approvalId}`,
121
+ nextAction: 'verify_approval_id',
122
+ channel: input.channel,
123
+ };
124
+ }
125
+ if (approvalRecord.status !== 'approved') {
126
+ return {
127
+ decision: 'refused',
128
+ reason: `approval_status_is_${approvalRecord.status}_expected_approved`,
129
+ nextAction: approvalRecord.status === 'pending'
130
+ ? 'owner_must_approve_before_dispatch'
131
+ : 'rejected_or_expired_approvals_cannot_be_activated',
132
+ channel: input.channel,
133
+ };
134
+ }
135
+ if (approvalRecord.artifactId !== input.artifactId) {
136
+ return {
137
+ decision: 'refused',
138
+ reason: `approval_artifact_mismatch: approval=${approvalRecord.artifactId} dispatch=${input.artifactId}`,
139
+ nextAction: 'ensure_dispatch_artifact_matches_approved_artifact',
140
+ channel: input.channel,
141
+ };
142
+ }
143
+ if (approvalRecord.channel !== input.channel) {
144
+ return {
145
+ decision: 'refused',
146
+ reason: `approval_channel_mismatch: approval=${approvalRecord.channel} dispatch=${input.channel}`,
147
+ nextAction: 'ensure_dispatch_channel_matches_approved_channel',
148
+ channel: input.channel,
149
+ };
150
+ }
151
+ return this.activateArtifact(input, artifact, idempotencyKey);
152
+ }
79
153
  // Auto-promotion bypasses both channel-risk gating AND explicit require_approval from the rollout gate.
80
154
  // This is intentional: high-confidence skill artifacts are safe enough to activate without human review.
81
155
  const needsApproval = input.rolloutDecision === 'require_approval' || !isLowRiskChannel(input.channel);
@@ -141,6 +215,11 @@ export class ActivationDispatcher {
141
215
  }
142
216
  }
143
217
  async activateArtifact(input, artifact, idempotencyKey) {
218
+ // Resolve the principle ID for WriterInput.principleId. Rule artifacts
219
+ // (code_tool_hook channel) MUST carry sourcePrincipleId — without it,
220
+ // the activated rule cannot be traced back to the owner-approved principle,
221
+ // producing an untraceable behavior change (P1 #3 fix: removed the
222
+ // sourceRuleId/artifactId fallback that allowed untraceable activation).
144
223
  const principleId = extractPrincipleId(artifact);
145
224
  if (!principleId) {
146
225
  return { decision: 'invalid_artifact', reason: 'no_principle_id' };
@@ -200,7 +279,14 @@ export class ActivationDispatcher {
200
279
  try {
201
280
  const result = await this.artifactReadModel.getArtifactById(artifactId);
202
281
  if (!result) {
203
- return { artifact: null, decision: { decision: 'invalid_artifact', reason: 'artifact_not_found' } };
282
+ return {
283
+ artifact: null,
284
+ decision: {
285
+ decision: 'invalid_artifact',
286
+ reason: 'artifact_not_found',
287
+ nextAction: 'check_pi_artifacts_table_or_remove_stale_activation',
288
+ },
289
+ };
204
290
  }
205
291
  return { artifact: result, decision: null };
206
292
  }
@@ -1 +1 @@
1
- {"version":3,"file":"activation-dispatcher.js","sourceRoot":"","sources":["../../../src/runtime-v2/activation/activation-dispatcher.ts"],"names":[],"mappings":"AAeA,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MA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AQ,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QAC9C,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,sBAAsB,EAAE,EAAE,CAAC;QAC/F,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,gBAAgB,CAAC,cAAsB;QACnD,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;YAC/E,IAAI,QAAQ,EAAE,CAAC;gBACb,OAAO;oBACL,QAAQ,EAAE;wBACR,QAAQ,EAAE,mBAAmB;wBAC7B,YAAY,EAAE,QAAQ,CAAC,YAAY;wBACnC,MAAM,EAAE,QAAQ,CAAC,MAAM;wBACvB,SAAS,EAAE,QAAQ,CAAC,SAAS;qBAC9B;iBACF,CAAC;YACJ,CAAC;YACD,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QAC5B,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,8BAA8B,EAAE,EAAE,CAAC;QACvF,CAAC;IACH,CAAC;CACF"}
@@ -15,7 +15,16 @@ export type ActivationActor = {
15
15
  kind: 'human';
16
16
  userId: string;
17
17
  };
18
- export type RolloutActivationDecision = 'auto_activate' | 'require_approval' | 'reject';
18
+ /**
19
+ * Rollout activation decision from the rollout reviewer.
20
+ * - 'auto_activate': low-risk channel, activate directly
21
+ * - 'require_approval': enqueue for owner approval
22
+ * - 'reject': refuse activation
23
+ * - 'approved': approval already granted externally (ApprovalCompletionService).
24
+ * Bypasses the approval queue check and activates directly. This is the
25
+ * post-approval dispatch path for high-risk channels.
26
+ */
27
+ export type RolloutActivationDecision = 'auto_activate' | 'require_approval' | 'reject' | 'approved';
19
28
  export interface DispatchInput {
20
29
  artifactId: string;
21
30
  channel: InternalizationChannel;
@@ -25,6 +34,13 @@ export interface DispatchInput {
25
34
  now: string;
26
35
  confirm: boolean;
27
36
  confidence?: number;
37
+ /**
38
+ * Required when rolloutDecision === 'approved'.
39
+ * The dispatcher independently verifies this approval record exists,
40
+ * is in 'approved' status, and matches the artifactId + channel.
41
+ * This prevents callers from bypassing the owner approval boundary.
42
+ */
43
+ approvalId?: string;
28
44
  }
29
45
  export type ActivationDecision = {
30
46
  decision: 'would_activate';
@@ -50,11 +66,13 @@ export type ActivationDecision = {
50
66
  } | {
51
67
  decision: 'refused';
52
68
  reason: string;
69
+ nextAction?: string;
53
70
  riskLevel?: ActivationRiskLevel;
54
71
  channel?: InternalizationChannel;
55
72
  } | {
56
73
  decision: 'invalid_artifact';
57
74
  reason: string;
75
+ nextAction?: string;
58
76
  };
59
77
  export interface PIArtifactSnapshot {
60
78
  artifactId: string;
@@ -84,7 +102,8 @@ export interface ActivationStatusRecord {
84
102
  export interface ActivationStateReadModel {
85
103
  getActivationStatus(idempotencyKey: string): Promise<ActivationStatusRecord | null>;
86
104
  recordActivation(record: ActivationStatusRecord): Promise<void>;
87
- listPromptActivations(): Promise<ActivationStatusRecord[]>;
105
+ listPromptActivations(includeDeactivated?: boolean): Promise<ActivationStatusRecord[]>;
106
+ listCodeToolHookActivations(includeDeactivated?: boolean): Promise<ActivationStatusRecord[]>;
88
107
  listAllActivations(): Promise<ActivationStatusRecord[]>;
89
108
  deactivateActivation(activationId: string, deactivatedAt: string): Promise<boolean>;
90
109
  }
@@ -129,6 +148,12 @@ export interface ApprovalRecord {
129
148
  confidenceExplanation?: string;
130
149
  effectDescription?: string;
131
150
  rejectionEffect?: string;
151
+ /** Story A (PRI-408): Edit tracking — when owner edits the principle/rule before approving */
152
+ editedAt?: string;
153
+ editedBy?: string;
154
+ editReason?: string;
155
+ /** The previous artifactId before the edit (for lineage tracking) */
156
+ previousArtifactId?: string;
132
157
  }
133
158
  export type ConfidenceLabel = 'high' | 'medium' | 'low';
134
159
  export declare function mapConfidenceToLabel(confidence: number | undefined): ConfidenceLabel;
@@ -198,7 +223,29 @@ export interface ApprovalQueueStore {
198
223
  ok: false;
199
224
  error: 'not_found' | 'not_approved';
200
225
  }>;
226
+ /**
227
+ * Story A (PRI-408): Edit a pending approval's artifact to a new version.
228
+ * Updates artifactId, records edit metadata, keeps status as pending.
229
+ * The caller is responsible for creating the new artifact and performing
230
+ * schema validation + sandbox replay BEFORE calling this method.
231
+ * Returns error if the approval is not in 'pending' status.
232
+ */
233
+ edit(input: ApprovalEditInput): Promise<ApprovalDecisionResult>;
234
+ }
235
+ export interface ApprovalEditInput {
236
+ approvalId: string;
237
+ editedBy: string;
238
+ newArtifactId: string;
239
+ editReason: string;
240
+ now: string;
241
+ }
242
+ export interface ArtifactLineageIdentity {
243
+ artifactId: string;
244
+ sourceTaskId: string;
245
+ sourcePrincipleId?: string;
246
+ lineageArtifactIds: string[];
201
247
  }
248
+ export declare function isArtifactRevisionOf(candidate: ArtifactLineageIdentity, original: ArtifactLineageIdentity): boolean;
202
249
  export declare function makeIdempotencyKey(artifactId: string, channel: InternalizationChannel): string;
203
250
  export declare function isLowRiskChannel(channel: InternalizationChannel): boolean;
204
251
  export declare function getChannelRiskLevel(channel: InternalizationChannel): ActivationRiskLevel;
@@ -1 +1 @@
1
- {"version":3,"file":"activation-types.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/activation/activation-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AAEtI,YAAY,EAAE,sBAAsB,EAAE,cAAc,EAAE,0BAA0B,EAAE,CAAC;AAEnF,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;AAEzE,eAAO,MAAM,iBAAiB,EAAE,SAAS,sBAAsB,EAAyC,CAAC;AAEzG,eAAO,MAA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AE,GAAG;QAAE,EAAE,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,WAAW,GAAG,cAAc,CAAA;KAAE,CAAC,CAAC;IAC/G;;;;;;OAMG;IACH,IAAI,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACjE;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,uBAAuB,EAAE,QAAQ,EAAE,uBAAuB,GAAG,OAAO,CAKnH;AACD,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,sBAAsB,GAAG,MAAM,CAE9F;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAEzE;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,sBAAsB,GAAG,mBAAmB,CAGxF"}
@@ -15,6 +15,12 @@ export function mapConfidenceToLabel(confidence) {
15
15
  return 'medium';
16
16
  return 'low';
17
17
  }
18
+ export function isArtifactRevisionOf(candidate, original) {
19
+ const referencesOriginal = candidate.lineageArtifactIds.includes(original.artifactId);
20
+ const samePrinciple = Boolean(candidate.sourcePrincipleId)
21
+ && candidate.sourcePrincipleId === original.sourcePrincipleId;
22
+ return candidate.sourceTaskId === original.sourceTaskId || referencesOriginal || samePrinciple;
23
+ }
18
24
  export function makeIdempotencyKey(artifactId, channel) {
19
25
  return `${artifactId}::${channel}`;
20
26
  }
@@ -1 +1 @@
1
- {"version":3,"file":"activation-types.js","sourceRoot":"","sources":["../../../src/runtime-v2/activation/activation-types.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,iBAAiB,GAAsC,CAAC,QAAQ,EAAE,eAAe,CAAU,CAAC;AAEzG,MAAM,CAAC,MAAM,qBAAqB,GAAkD;IAClF,KAAK,EAAE,QAAQ;IACf,cAAc,EAAE,MAAM;IACtB,cAAc,EAAE,UAAU;CAClB,CAAC;AAEX,MAAM,CAAC,MAAM,mCAAmC,GAAG,IAAI,CAAC;AAExD,MAAM,CAAC,MAAM,wBAAwB,GAAsC,CAAC,OAAO,CAAU,CAAC;AAwH9F,MAAM,UAAU,oBAAoB,CAAC,UAA8B;IACjE,IAAI,UAAU,KAAK,SAAS,IAAI,UAAU,KAAK,IAAI;QAAE,OAAO,QAAQ,CAAC;IACrE,IAAI,UAAU,IAAI,GAAG;QAAE,OAAO,MAAM,CAAC;IACrC,IAAI,UAAU,IAAI,GAAG;QAAE,OAAO,QAAQ,CAAC;IACvC,OAAO,KAAK,CAAC;AACf,CAAC;AAiED,MAAM,UAAU,kBAAkB,CAAC,UAAkB,EAAE,OAA+B;IACpF,OAAO,GAAG,UAAU,KAAK,OAAO,EAAE,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAA+B;IAC9D,OAAO,iBAAiB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,OAA+B;IACjE,IAAI,gBAAgB,CAAC,OAAO,CAAC;QAAE,OAAO,KAAK,CAAC;IAC5C,OAAO,qBAAqB,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC;AAClD,CAAC"}
1
+ {"version":3,"file":"activation-types.js","sourceRoot":"","sources":["../../../src/runtime-v2/activation/activation-types.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,iBAAiB,GAAsC,CAAC,QAAQ,EAAE,eAAe,C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qB,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC;AAClD,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Approval Completion Service — Story A (PRI-408)
3
+ *
4
+ * Formal production service that orchestrates activation AFTER an owner
5
+ * approves an approval record. Replaces the demo "approve → direct writer"
6
+ * pattern with a structured, idempotent, validated completion path.
7
+ *
8
+ * Product Contract B requirements:
9
+ * - Reads the approved approval record
10
+ * - Validates artifact/version/channel consistency
11
+ * - Prevents unapproved, rejected, or expired records from activating
12
+ * - Idempotent activation (duplicate submissions = no duplicate activation)
13
+ * - Calls the ActivationDispatcher with rolloutDecision='approved'
14
+ * - Records activation state (via dispatcher)
15
+ * - Returns structured decision/reason/nextAction
16
+ *
17
+ * ERR checklist:
18
+ * - ERR-001: Approval record fields validated at runtime, not via `as`
19
+ * - ERR-002: Every failure path carries reason + nextAction
20
+ * - ERR-009: Required fields fail loud when missing
21
+ * - ERR-015: Idempotency state distinguished from current dispatch state
22
+ * - ERR-025: Production-path service, not demo helper
23
+ */
24
+ import type { ActivationActor, ActivationDecision, ActivationStateReadModel, ApprovalQueueStore } from './activation-types.js';
25
+ import type { ActivationDispatcher } from './activation-dispatcher.js';
26
+ export interface ApprovalCompletionInput {
27
+ approvalId: string;
28
+ actor: ActivationActor;
29
+ now: string;
30
+ }
31
+ export type ApprovalCompletionResult = {
32
+ ok: true;
33
+ decision: ActivationDecision;
34
+ activationId?: string;
35
+ approvalId: string;
36
+ } | {
37
+ ok: false;
38
+ error: 'not_found' | 'not_approved' | 'already_activated';
39
+ reason: string;
40
+ nextAction: string;
41
+ approvalId: string;
42
+ };
43
+ export declare class ApprovalCompletionService {
44
+ private readonly approvalStore;
45
+ private readonly dispatcher;
46
+ private readonly stateReadModel;
47
+ constructor(approvalStore: ApprovalQueueStore, dispatcher: ActivationDispatcher, stateReadModel: ActivationStateReadModel);
48
+ completeApproval(input: ApprovalCompletionInput): Promise<ApprovalCompletionResult>;
49
+ }
50
+ //# sourceMappingURL=approval-completion-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"approval-completion-service.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/activation/approval-completion-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,EAEnB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,eAAe,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,MAAM,wBAAwB,GAChC;IACE,EAAE,EAAE,IAAI,CAAC;IACT,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB,GACD;IACE,EAAE,EAAE,KAAK,CAAC;IACV,KAAK,EAAE,WAAW,GAAG,cAAc,GAAG,mBAAmB,CAAC;IAC1D,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEN,qBAAa,yBAAyB;IAElC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAFd,aAAa,EAAE,kBAAkB,EACjC,UAAU,EAAE,oBAAoB,EAChC,cAAc,EAAE,wBAAwB;IAGrD,gBAAgB,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,wBAAwB,CAAC;CAkI1F"}
@@ -0,0 +1,160 @@
1
+ /**
2
+ * Approval Completion Service — Story A (PRI-408)
3
+ *
4
+ * Formal production service that orchestrates activation AFTER an owner
5
+ * approves an approval record. Replaces the demo "approve → direct writer"
6
+ * pattern with a structured, idempotent, validated completion path.
7
+ *
8
+ * Product Contract B requirements:
9
+ * - Reads the approved approval record
10
+ * - Validates artifact/version/channel consistency
11
+ * - Prevents unapproved, rejected, or expired records from activating
12
+ * - Idempotent activation (duplicate submissions = no duplicate activation)
13
+ * - Calls the ActivationDispatcher with rolloutDecision='approved'
14
+ * - Records activation state (via dispatcher)
15
+ * - Returns structured decision/reason/nextAction
16
+ *
17
+ * ERR checklist:
18
+ * - ERR-001: Approval record fields validated at runtime, not via `as`
19
+ * - ERR-002: Every failure path carries reason + nextAction
20
+ * - ERR-009: Required fields fail loud when missing
21
+ * - ERR-015: Idempotency state distinguished from current dispatch state
22
+ * - ERR-025: Production-path service, not demo helper
23
+ */
24
+ import { makeIdempotencyKey } from './activation-types.js';
25
+ export class ApprovalCompletionService {
26
+ approvalStore;
27
+ dispatcher;
28
+ stateReadModel;
29
+ constructor(approvalStore, dispatcher, stateReadModel) {
30
+ this.approvalStore = approvalStore;
31
+ this.dispatcher = dispatcher;
32
+ this.stateReadModel = stateReadModel;
33
+ }
34
+ async completeApproval(input) {
35
+ // 1. Read the approval record
36
+ let record;
37
+ try {
38
+ record = await this.approvalStore.getById(input.approvalId);
39
+ }
40
+ catch {
41
+ return {
42
+ ok: false,
43
+ error: 'not_found',
44
+ reason: 'approval_record_read_failed',
45
+ nextAction: 'check_approval_store_or_retry',
46
+ approvalId: input.approvalId,
47
+ };
48
+ }
49
+ if (!record) {
50
+ return {
51
+ ok: false,
52
+ error: 'not_found',
53
+ reason: `approval record ${input.approvalId} not found`,
54
+ nextAction: 'verify_approval_id_or_check_store',
55
+ approvalId: input.approvalId,
56
+ };
57
+ }
58
+ // 2. Validate the approval is in 'approved' status
59
+ if (record.status !== 'approved') {
60
+ return {
61
+ ok: false,
62
+ error: 'not_approved',
63
+ reason: `approval status is ${record.status}, expected approved`,
64
+ nextAction: record.status === 'pending'
65
+ ? 'owner_must_approve_before_completion'
66
+ : record.status === 'rejected'
67
+ ? 'rejected_approvals_cannot_be_activated'
68
+ : 'check_approval_status',
69
+ approvalId: input.approvalId,
70
+ };
71
+ }
72
+ // 2b. Validate required fields before generating idempotency key (EP-01)
73
+ if (!record.artifactId || typeof record.artifactId !== 'string') {
74
+ return {
75
+ ok: false,
76
+ error: 'not_approved',
77
+ reason: 'approval record has missing or invalid artifactId',
78
+ nextAction: 'check_artifact_store_integrity',
79
+ approvalId: input.approvalId,
80
+ };
81
+ }
82
+ if (!record.channel || typeof record.channel !== 'string') {
83
+ return {
84
+ ok: false,
85
+ error: 'not_approved',
86
+ reason: 'approval record has missing or invalid channel',
87
+ nextAction: 'check_approval_store_integrity',
88
+ approvalId: input.approvalId,
89
+ };
90
+ }
91
+ // 3. Check idempotency — has this already been activated?
92
+ const idempotencyKey = makeIdempotencyKey(record.artifactId, record.channel);
93
+ let existingActivation;
94
+ try {
95
+ existingActivation = await this.stateReadModel.getActivationStatus(idempotencyKey);
96
+ }
97
+ catch (err) {
98
+ // If state read fails, proceed to dispatch — the dispatcher will
99
+ // also check idempotency and handle errors. Log the failure for
100
+ // observability (ERR-002: graceful degradation must include a reason).
101
+ const readErr = err instanceof Error ? err.message : String(err);
102
+ console.warn(`[ApprovalCompletionService] idempotency state read failed for key ${idempotencyKey}: ${readErr}; proceeding to dispatch`);
103
+ existingActivation = null;
104
+ }
105
+ if (existingActivation) {
106
+ return {
107
+ ok: true,
108
+ decision: {
109
+ decision: 'already_activated',
110
+ activationId: existingActivation.activationId,
111
+ action: existingActivation.action,
112
+ targetRef: existingActivation.targetRef,
113
+ },
114
+ activationId: existingActivation.activationId,
115
+ approvalId: input.approvalId,
116
+ };
117
+ }
118
+ // 4. Dispatch with 'approved' — the dispatcher independently verifies
119
+ // the approval record via approvalId (security boundary, P1 #3 fix).
120
+ let dispatchDecision;
121
+ try {
122
+ dispatchDecision = await this.dispatcher.dispatch({
123
+ artifactId: record.artifactId,
124
+ channel: record.channel,
125
+ rolloutDecision: 'approved',
126
+ approvalId: input.approvalId,
127
+ actor: input.actor,
128
+ now: input.now,
129
+ confirm: true,
130
+ });
131
+ }
132
+ catch (err) {
133
+ const message = err instanceof Error ? err.message : String(err);
134
+ return {
135
+ ok: false,
136
+ error: 'not_approved',
137
+ reason: `dispatch_failed: ${message}`,
138
+ nextAction: 'check_dispatcher_writers_and_artifact_store',
139
+ approvalId: input.approvalId,
140
+ };
141
+ }
142
+ // 5. Return structured result
143
+ if (dispatchDecision.decision === 'activated' || dispatchDecision.decision === 'already_activated') {
144
+ return {
145
+ ok: true,
146
+ decision: dispatchDecision,
147
+ activationId: dispatchDecision.activationId,
148
+ approvalId: input.approvalId,
149
+ };
150
+ }
151
+ // The dispatch returned a non-activation decision (refused, invalid_artifact, etc.)
152
+ // This is not a service-level failure — the caller gets the dispatch decision.
153
+ return {
154
+ ok: true,
155
+ decision: dispatchDecision,
156
+ approvalId: input.approvalId,
157
+ };
158
+ }
159
+ }
160
+ //# sourceMappingURL=approval-completion-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"approval-completion-service.js","sourceRoot":"","sources":["../../../src/runtime-v2/activation/approval-completion-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AASH,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAwB3D,MAAM,OAAO,yBAAyB;IAEjB;IACA;IACA;IAHnB,YACmB,aAAiC,EACjC,UAAgC,EAChC,cAAwC;QAFxC,kBAAa,GAAb,aAAa,CAAoB;QACjC,eAAU,GAAV,UAAU,CAAsB;QAChC,mBAAc,GAAd,cAAc,CAA0B;IACxD,CAAC;IAEJ,KAAK,CAAC,gBAAgB,CAAC,KAA8B;QACnD,8BAA8B;QAC9B,IAAI,MAA6B,CAAC;QAClC,IAAI,CAAC;YACH,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAC9D,CAAC;QAAC,MAAM,CAAC;YACP,OAAO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M,CAAC,UAAU;gBAC7B,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,eAAe,EAAE,UAAU;gBAC3B,UAAU,EAAE,KAAK,CAAC,UAAU;gBAC5B,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,GAAG,EAAE,KAAK,CAAC,GAAG;gBACd,OAAO,EAAE,IAAI;aACd,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,GAAY,EAAE,CAAC;YACtB,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACjE,OAAO;gBACL,EAAE,EAAE,KAAK;gBACT,KAAK,EAAE,cAAc;gBACrB,MAAM,EAAE,oBAAoB,OAAO,EAAE;gBACrC,UAAU,EAAE,6CAA6C;gBACzD,UAAU,EAAE,KAAK,CAAC,UAAU;aAC7B,CAAC;QACJ,CAAC;QAED,8BAA8B;QAC9B,IAAI,gBAAgB,CAAC,QAAQ,KAAK,WAAW,IAAI,gBAAgB,CAAC,QAAQ,KAAK,mBAAmB,EAAE,CAAC;YACnG,OAAO;gBACL,EAAE,EAAE,IAAI;gBACR,QAAQ,EAAE,gBAAgB;gBAC1B,YAAY,EAAE,gBAAgB,CAAC,YAAY;gBAC3C,UAAU,EAAE,KAAK,CAAC,UAAU;aAC7B,CAAC;QACJ,CAAC;QAED,oFAAoF;QACpF,+EAA+E;QAC/E,OAAO;YACL,EAAE,EAAE,IAAI;YACR,QAAQ,EAAE,gBAAgB;YAC1B,UAAU,EAAE,KAAK,CAAC,UAAU;SAC7B,CAAC;IACJ,CAAC;CACF"}
@@ -1,5 +1,5 @@
1
1
  import type { InternalizationChannel } from '../internalization/peer-runner-contracts.js';
2
- import type { ApprovalDecisionResult, ApprovalEnqueueInput, ApprovalFilter, ApprovalListFilter, ApprovalQueueStore, ApprovalRecord, ApprovalStats } from './activation-types.js';
2
+ import type { ApprovalDecisionResult, ApprovalEditInput, ApprovalEnqueueInput, ApprovalFilter, ApprovalListFilter, ApprovalQueueStore, ApprovalRecord, ApprovalStats } from './activation-types.js';
3
3
  export declare function decideAutoPromotion(channel: InternalizationChannel, confidence: number | undefined): boolean;
4
4
  export declare class ApprovalQueue {
5
5
  private readonly store;
@@ -17,5 +17,11 @@ export declare class ApprovalQueue {
17
17
  ok: false;
18
18
  error: 'not_found' | 'not_approved';
19
19
  }>;
20
+ /**
21
+ * Story A (PRI-408): Edit a pending approval's artifact to a new version.
22
+ * The caller must create the new artifact and perform schema validation +
23
+ * sandbox replay BEFORE calling this method.
24
+ */
25
+ edit(input: ApprovalEditInput): Promise<ApprovalDecisionResult>;
20
26
  }
21
27
  //# sourceMappingURL=approval-queue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"approval-queue.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/activation/approval-queue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,KAAK,EACV,sBAAsB,EACtB,oBAAoB,EACpB,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,aAAa,EACd,MAAM,uBAAuB,CAAC;AAM/B,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAK5G;AAED,qBAAa,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,kBAAkB;IAEhD,OAAO,CAAC,KAAK,EAAE,oBAAoB,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAI1E,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IAI3D,WAAW,CAAC,MAAM,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAI/D,OAAO,CAAC,UAAU,E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c,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAI/D,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAS9F,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAS9F,OAAO,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAI/D,aAAa,IAAI,OAAO,CAAC,aAAa,CAAC;IAIvC,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,IAAI,CAAA;KAAE,GAAG;QAAE,EAAE,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,WAAW,GAAG,cAAc,CAAA;KAAE,CAAC;IAIpH;;;;OAIG;IACG,IAAI,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAQtE"}
@@ -49,5 +49,19 @@ export class ApprovalQueue {
49
49
  async resetToPending(approvalId) {
50
50
  return this.store.resetToPending(approvalId);
51
51
  }
52
+ /**
53
+ * Story A (PRI-408): Edit a pending approval's artifact to a new version.
54
+ * The caller must create the new artifact and perform schema validation +
55
+ * sandbox replay BEFORE calling this method.
56
+ */
57
+ async edit(input) {
58
+ const existing = await this.store.getById(input.approvalId);
59
+ if (!existing)
60
+ return { ok: false, error: 'not_found' };
61
+ if (existing.status !== 'pending') {
62
+ return { ok: false, error: 'already_decided', status: existing.status };
63
+ }
64
+ return this.store.edit(input);
65
+ }
52
66
  }
53
67
  //# sourceMappingURL=approval-queue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"approval-queue.js","sourceRoot":"","sources":["../../../src/runtime-v2/activation/approval-queue.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,wBAAwB,EACxB,mCAAm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AAE,QAAQ,CAAC,MAAM,EAAE,CAAC;QAC1E,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;CACF"}
@@ -1,5 +1,5 @@
1
- export type { ActivationRiskLevel, ActivationActor, RolloutActivationDecision, DispatchInput, ActivationDecision, PIArtifactSnapshot, ActivationArtifactReadModel, ActivationStatusRecord, ActivationStateReadModel, WriterInput, WriterResult, CanActivateResult, ChannelWriter, InternalizationChannel, PIArtifactKind, PIArtifactValidationStatus, ApprovalStatus, ApprovalRecord, ApprovalEnqueueInput, ApprovalFilter, ApprovalDecisionResult, ApprovalQueueStore, ConfidenceLabel, ApprovalWithContext, ApprovalListFilter, ApprovalStats, ApprovalListResult, } from './activation-types.js';
2
- export { LOW_RISK_CHANNELS, HIGH_RISK_CHANNEL_MAP, makeIdempotencyKey, isLowRiskChannel, getChannelRiskLevel, AUTO_PROMOTION_CONFIDENCE_THRESHOLD, AUTO_PROMOTABLE_CHANNELS, mapConfidenceToLabel, } from './activation-types.js';
1
+ export type { ActivationRiskLevel, ActivationActor, RolloutActivationDecision, DispatchInput, ActivationDecision, PIArtifactSnapshot, ActivationArtifactReadModel, ActivationStatusRecord, ActivationStateReadModel, WriterInput, WriterResult, CanActivateResult, ChannelWriter, InternalizationChannel, PIArtifactKind, PIArtifactValidationStatus, ApprovalStatus, ApprovalRecord, ApprovalEnqueueInput, ApprovalFilter, ApprovalDecisionResult, ApprovalQueueStore, ConfidenceLabel, ApprovalWithContext, ApprovalListFilter, ArtifactLineageIdentity, ApprovalStats, ApprovalListResult, } from './activation-types.js';
2
+ export { isArtifactRevisionOf, LOW_RISK_CHANNELS, HIGH_RISK_CHANNEL_MAP, makeIdempotencyKey, isLowRiskChannel, getChannelRiskLevel, AUTO_PROMOTION_CONFIDENCE_THRESHOLD, AUTO_PROMOTABLE_CHANNELS, mapConfidenceToLabel, } from './activation-types.js';
3
3
  export { ActivationDispatcher } from './activation-dispatcher.js';
4
4
  export type { DispatcherConfig } from './activation-dispatcher.js';
5
5
  export { PromptWriter, DeferArchiveWriter, extractPrincipleId, } from './low-risk-writers.js';
@@ -10,6 +10,9 @@ export { MemoryApprovalQueueStore } from './memory-approval-store.js';
10
10
  export { SqliteApprovalQueueStore } from './sqlite-approval-store.js';
11
11
  export { RuleHostWriter } from './writers/rule-host-writer.js';
12
12
  export type { RuleHostWriterConfig } from './writers/rule-host-writer.js';
13
+ export { createProductionGateDeps } from './production-gate-deps.js';
14
+ export { ApprovalCompletionService } from './approval-completion-service.js';
15
+ export type { ApprovalCompletionInput, ApprovalCompletionResult } from './approval-completion-service.js';
13
16
  export { RUNTIME_V2_PRINCIPLE_BUDGET, isRecord as isArtifactRecord, filterPromptActivations, resolvePrincipleFromArtifact, trimToBudget, renderPrinciplesToDirectives, } from './prompt-activation-reader-contract.js';
14
17
  export type { ActivatedPrinciple, PromptActivationReaderResult, } from './prompt-activation-reader-contract.js';
15
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/activation/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,mBAAmB,EACnB,eAAe,EACf,yBAAyB,EACzB,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,2BAA2B,EAC3B,sBAAsB,EACtB,wBAAwB,EACxB,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,sBAAsB,EACtB,cAAc,EACd,0BAA0B,EAC1B,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,sBAAsB,EACtB,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,kBAAkB,GACnB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,mCAAmC,EACnC,wBAAwB,EACxB,oB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