create-principles-disciple 1.121.7 → 1.121.9

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 (461) hide show
  1. package/README.md +13 -1
  2. package/console/dist/server/config/pd-config-store.d.ts +1 -3
  3. package/console/dist/server/config/pd-config-store.js +4 -4
  4. package/console/dist/server/feedback/channels.d.ts +2 -8
  5. package/console/dist/server/feedback/channels.js +0 -11
  6. package/console/dist/server/index.js +34 -5
  7. package/console/dist/server/models/ActivationsConsoleModel.d.ts +28 -1
  8. package/console/dist/server/models/ActivationsConsoleModel.js +72 -30
  9. package/console/dist/server/models/GovernanceExperienceCollector.d.ts +28 -0
  10. package/console/dist/server/models/GovernanceExperienceCollector.js +305 -0
  11. package/console/dist/server/models/GovernanceProjectionCollector.d.ts +60 -2
  12. package/console/dist/server/models/GovernanceProjectionCollector.js +323 -285
  13. package/console/dist/server/models/PrincipleClassifier.d.ts +1 -1
  14. package/console/dist/server/models/PrincipleClassifier.js +7 -4
  15. package/console/dist/server/models/PrinciplesConsoleModel.d.ts +2 -1
  16. package/console/dist/server/models/ReceiptsConsoleModel.d.ts +5 -0
  17. package/console/dist/server/models/ReceiptsConsoleModel.js +140 -13
  18. package/console/dist/server/routes/activations.js +1 -1
  19. package/console/dist/server/routes/failed-tasks.js +28 -11
  20. package/console/dist/server/routes/governance.d.ts +26 -0
  21. package/console/dist/server/routes/governance.js +51 -0
  22. package/console/dist/server/routes/owner-identity.d.ts +31 -0
  23. package/console/dist/server/routes/owner-identity.js +76 -0
  24. package/console/dist/server/routes/update-history.d.ts +5 -0
  25. package/console/dist/server/routes/update-history.js +50 -4
  26. package/console/dist/server/routes/update.js +186 -32
  27. package/console/dist/shared/feedback-channel-ids.d.ts +13 -0
  28. package/console/dist/shared/feedback-channel-ids.js +12 -0
  29. package/console/dist/shared/feedback-contract.d.ts +46 -0
  30. package/console/dist/shared/feedback-contract.js +45 -0
  31. package/console/dist/ui/App.js +1 -1
  32. package/console/dist/ui/api.d.ts +22 -3
  33. package/console/dist/ui/api.js +63 -3
  34. package/console/dist/ui/components/receipts/ReceiptCoverageDisclosure.d.ts +6 -0
  35. package/console/dist/ui/components/receipts/ReceiptCoverageDisclosure.js +66 -0
  36. package/console/dist/ui/i18n/en.json +198 -2
  37. package/console/dist/ui/i18n/zh-CN.json +196 -0
  38. package/console/dist/ui/pages/activation/ActivationPage.js +14 -2
  39. package/console/dist/ui/pages/failed-tasks/FailedTasksPage.js +25 -5
  40. package/console/dist/ui/pages/focus/FocusPage.d.ts +28 -1
  41. package/console/dist/ui/pages/focus/FocusPage.js +128 -15
  42. package/console/dist/ui/pages/principles/PrincipleDetailPage.d.ts +30 -0
  43. package/console/dist/ui/pages/principles/PrincipleDetailPage.js +49 -6
  44. package/console/dist/ui/pages/settings/SettingsPage.js +67 -2
  45. package/console/dist/ui/pages/settings/UpdatePage.js +7 -7
  46. package/console/dist/ui/utils/enum-labels.js +0 -1
  47. package/console/dist/ui/utils/validators.d.ts +53 -21
  48. package/console/dist/ui/utils/validators.js +248 -21
  49. package/console/dist/web/assets/app.css +6 -0
  50. package/console/dist/web/assets/app.js +2721 -1664
  51. package/console/package.json +4 -2
  52. package/core/dist/host/host-adapter.d.ts +1 -1
  53. package/core/dist/host/host-adapter.d.ts.map +1 -1
  54. package/core/dist/host/host-adapter.js +1 -0
  55. package/core/dist/host/host-adapter.js.map +1 -1
  56. package/core/dist/runtime-v2/__tests__/architecture-regression.test.js +12 -2
  57. package/core/dist/runtime-v2/__tests__/architecture-regression.test.js.map +1 -1
  58. package/core/dist/runtime-v2/__tests__/attack-e2e-pipeline-smoke.test.js +1 -1
  59. package/core/dist/runtime-v2/__tests__/attack-e2e-pipeline-smoke.test.js.map +1 -1
  60. package/core/dist/runtime-v2/__tests__/governance-experience.test.d.ts +2 -0
  61. package/core/dist/runtime-v2/__tests__/governance-experience.test.d.ts.map +1 -0
  62. package/core/dist/runtime-v2/__tests__/governance-experience.test.js +300 -0
  63. package/core/dist/runtime-v2/__tests__/governance-experience.test.js.map +1 -0
  64. package/core/dist/runtime-v2/__tests__/owner-identity.test.d.ts +2 -0
  65. package/core/dist/runtime-v2/__tests__/owner-identity.test.d.ts.map +1 -0
  66. package/core/dist/runtime-v2/__tests__/owner-identity.test.js +147 -0
  67. package/core/dist/runtime-v2/__tests__/owner-identity.test.js.map +1 -0
  68. package/core/dist/runtime-v2/__tests__/product-telemetry-contract.test.d.ts +18 -0
  69. package/core/dist/runtime-v2/__tests__/product-telemetry-contract.test.d.ts.map +1 -0
  70. package/core/dist/runtime-v2/__tests__/product-telemetry-contract.test.js +303 -0
  71. package/core/dist/runtime-v2/__tests__/product-telemetry-contract.test.js.map +1 -0
  72. package/core/dist/runtime-v2/__tests__/recovery-actions-log.test.js +40 -0
  73. package/core/dist/runtime-v2/__tests__/recovery-actions-log.test.js.map +1 -1
  74. package/core/dist/runtime-v2/__tests__/status-contract.test.d.ts +2 -0
  75. package/core/dist/runtime-v2/__tests__/status-contract.test.d.ts.map +1 -0
  76. package/core/dist/runtime-v2/__tests__/status-contract.test.js +107 -0
  77. package/core/dist/runtime-v2/__tests__/status-contract.test.js.map +1 -0
  78. package/core/dist/runtime-v2/activation/__tests__/promotion-evidence-snapshot.test.d.ts +2 -0
  79. package/core/dist/runtime-v2/activation/__tests__/promotion-evidence-snapshot.test.d.ts.map +1 -0
  80. package/core/dist/runtime-v2/activation/__tests__/promotion-evidence-snapshot.test.js +104 -0
  81. package/core/dist/runtime-v2/activation/__tests__/promotion-evidence-snapshot.test.js.map +1 -0
  82. package/core/dist/runtime-v2/activation/__tests__/promotion-readiness-evaluator.test.js +19 -0
  83. package/core/dist/runtime-v2/activation/__tests__/promotion-readiness-evaluator.test.js.map +1 -1
  84. package/core/dist/runtime-v2/activation/__tests__/rulecode-owner-decision-service.test.js +20 -0
  85. package/core/dist/runtime-v2/activation/__tests__/rulecode-owner-decision-service.test.js.map +1 -1
  86. package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-safety-store.test.js +40 -0
  87. package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-safety-store.test.js.map +1 -1
  88. package/core/dist/runtime-v2/activation/index.d.ts +2 -0
  89. package/core/dist/runtime-v2/activation/index.d.ts.map +1 -1
  90. package/core/dist/runtime-v2/activation/index.js +1 -0
  91. package/core/dist/runtime-v2/activation/index.js.map +1 -1
  92. package/core/dist/runtime-v2/activation/promotion-evidence-snapshot.d.ts +30 -0
  93. package/core/dist/runtime-v2/activation/promotion-evidence-snapshot.d.ts.map +1 -0
  94. package/core/dist/runtime-v2/activation/promotion-evidence-snapshot.js +87 -0
  95. package/core/dist/runtime-v2/activation/promotion-evidence-snapshot.js.map +1 -0
  96. package/core/dist/runtime-v2/activation/promotion-readiness-evaluator.d.ts.map +1 -1
  97. package/core/dist/runtime-v2/activation/promotion-readiness-evaluator.js +3 -0
  98. package/core/dist/runtime-v2/activation/promotion-readiness-evaluator.js.map +1 -1
  99. package/core/dist/runtime-v2/activation/promotion-readiness-reader.d.ts +1 -1
  100. package/core/dist/runtime-v2/activation/promotion-readiness-reader.d.ts.map +1 -1
  101. package/core/dist/runtime-v2/activation/promotion-readiness-reader.js +2 -2
  102. package/core/dist/runtime-v2/activation/promotion-readiness-reader.js.map +1 -1
  103. package/core/dist/runtime-v2/activation/rulecode-owner-decision-service.d.ts.map +1 -1
  104. package/core/dist/runtime-v2/activation/rulecode-owner-decision-service.js +18 -9
  105. package/core/dist/runtime-v2/activation/rulecode-owner-decision-service.js.map +1 -1
  106. package/core/dist/runtime-v2/adapter/__tests__/chaos-json-repair.test.js +1 -1
  107. package/core/dist/runtime-v2/adapter/__tests__/chaos-json-repair.test.js.map +1 -1
  108. package/core/dist/runtime-v2/adapter/__tests__/json-extractor.test.js +91 -1
  109. package/core/dist/runtime-v2/adapter/__tests__/json-extractor.test.js.map +1 -1
  110. package/core/dist/runtime-v2/adapter/__tests__/pi-ai-runtime-adapter.test.js +59 -12
  111. package/core/dist/runtime-v2/adapter/__tests__/pi-ai-runtime-adapter.test.js.map +1 -1
  112. package/core/dist/runtime-v2/adapter/__tests__/runtime-config-contract.test.js +10 -9
  113. package/core/dist/runtime-v2/adapter/__tests__/runtime-config-contract.test.js.map +1 -1
  114. package/core/dist/runtime-v2/adapter/__tests__/structured-output-repair.test.js +42 -1
  115. package/core/dist/runtime-v2/adapter/__tests__/structured-output-repair.test.js.map +1 -1
  116. package/core/dist/runtime-v2/adapter/json-extractor.d.ts +25 -0
  117. package/core/dist/runtime-v2/adapter/json-extractor.d.ts.map +1 -1
  118. package/core/dist/runtime-v2/adapter/json-extractor.js +126 -0
  119. package/core/dist/runtime-v2/adapter/json-extractor.js.map +1 -1
  120. package/core/dist/runtime-v2/adapter/l2-agent-loop-adapter.d.ts +9 -4
  121. package/core/dist/runtime-v2/adapter/l2-agent-loop-adapter.d.ts.map +1 -1
  122. package/core/dist/runtime-v2/adapter/l2-agent-loop-adapter.js +9 -4
  123. package/core/dist/runtime-v2/adapter/l2-agent-loop-adapter.js.map +1 -1
  124. package/core/dist/runtime-v2/adapter/output-repair-contract.d.ts +5 -1
  125. package/core/dist/runtime-v2/adapter/output-repair-contract.d.ts.map +1 -1
  126. package/core/dist/runtime-v2/adapter/output-repair-contract.js +4 -1
  127. package/core/dist/runtime-v2/adapter/output-repair-contract.js.map +1 -1
  128. package/core/dist/runtime-v2/adapter/pi-ai-catalog.d.ts +7 -0
  129. package/core/dist/runtime-v2/adapter/pi-ai-catalog.d.ts.map +1 -0
  130. package/core/dist/runtime-v2/adapter/pi-ai-catalog.js +19 -0
  131. package/core/dist/runtime-v2/adapter/pi-ai-catalog.js.map +1 -0
  132. package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.d.ts +13 -15
  133. package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.d.ts.map +1 -1
  134. package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.js +104 -37
  135. package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.js.map +1 -1
  136. package/core/dist/runtime-v2/adapter/structured-output-repair.d.ts +16 -1
  137. package/core/dist/runtime-v2/adapter/structured-output-repair.d.ts.map +1 -1
  138. package/core/dist/runtime-v2/adapter/structured-output-repair.js +38 -6
  139. package/core/dist/runtime-v2/adapter/structured-output-repair.js.map +1 -1
  140. package/core/dist/runtime-v2/adapter/tools/diagnostician-tool.d.ts +1 -1
  141. package/core/dist/runtime-v2/adapter/tools/diagnostician-tool.d.ts.map +1 -1
  142. package/core/dist/runtime-v2/config/__tests__/pd-config-agent-binding.test.js +8 -9
  143. package/core/dist/runtime-v2/config/__tests__/pd-config-agent-binding.test.js.map +1 -1
  144. package/core/dist/runtime-v2/config/__tests__/pd-config-contract.test.js +27 -3
  145. package/core/dist/runtime-v2/config/__tests__/pd-config-contract.test.js.map +1 -1
  146. package/core/dist/runtime-v2/config/__tests__/pd-config-principles.test.d.ts +11 -0
  147. package/core/dist/runtime-v2/config/__tests__/pd-config-principles.test.d.ts.map +1 -0
  148. package/core/dist/runtime-v2/config/__tests__/pd-config-principles.test.js +93 -0
  149. package/core/dist/runtime-v2/config/__tests__/pd-config-principles.test.js.map +1 -0
  150. package/core/dist/runtime-v2/config/__tests__/pd-config-workspace.test.js +41 -0
  151. package/core/dist/runtime-v2/config/__tests__/pd-config-workspace.test.js.map +1 -1
  152. package/core/dist/runtime-v2/config/index.d.ts +2 -2
  153. package/core/dist/runtime-v2/config/index.d.ts.map +1 -1
  154. package/core/dist/runtime-v2/config/index.js +2 -0
  155. package/core/dist/runtime-v2/config/index.js.map +1 -1
  156. package/core/dist/runtime-v2/config/pd-config-agent-binding.d.ts.map +1 -1
  157. package/core/dist/runtime-v2/config/pd-config-agent-binding.js +4 -13
  158. package/core/dist/runtime-v2/config/pd-config-agent-binding.js.map +1 -1
  159. package/core/dist/runtime-v2/config/pd-config-effective.d.ts.map +1 -1
  160. package/core/dist/runtime-v2/config/pd-config-effective.js +14 -7
  161. package/core/dist/runtime-v2/config/pd-config-effective.js.map +1 -1
  162. package/core/dist/runtime-v2/config/pd-config-feature-flags.d.ts.map +1 -1
  163. package/core/dist/runtime-v2/config/pd-config-feature-flags.js +5 -12
  164. package/core/dist/runtime-v2/config/pd-config-feature-flags.js.map +1 -1
  165. package/core/dist/runtime-v2/config/pd-config-types.d.ts +8 -0
  166. package/core/dist/runtime-v2/config/pd-config-types.d.ts.map +1 -1
  167. package/core/dist/runtime-v2/config/pd-config-types.js +2 -0
  168. package/core/dist/runtime-v2/config/pd-config-types.js.map +1 -1
  169. package/core/dist/runtime-v2/config/pd-config-validate.d.ts.map +1 -1
  170. package/core/dist/runtime-v2/config/pd-config-validate.js +48 -3
  171. package/core/dist/runtime-v2/config/pd-config-validate.js.map +1 -1
  172. package/core/dist/runtime-v2/core-principles/__tests__/core-axiom-block.test.js +36 -8
  173. package/core/dist/runtime-v2/core-principles/__tests__/core-axiom-block.test.js.map +1 -1
  174. package/core/dist/runtime-v2/core-principles/__tests__/core-principle-registry.test.js +36 -12
  175. package/core/dist/runtime-v2/core-principles/__tests__/core-principle-registry.test.js.map +1 -1
  176. package/core/dist/runtime-v2/core-principles/core-axiom-block.d.ts +22 -8
  177. package/core/dist/runtime-v2/core-principles/core-axiom-block.d.ts.map +1 -1
  178. package/core/dist/runtime-v2/core-principles/core-axiom-block.js +28 -13
  179. package/core/dist/runtime-v2/core-principles/core-axiom-block.js.map +1 -1
  180. package/core/dist/runtime-v2/core-principles/core-principle-registry.d.ts +29 -4
  181. package/core/dist/runtime-v2/core-principles/core-principle-registry.d.ts.map +1 -1
  182. package/core/dist/runtime-v2/core-principles/core-principle-registry.js +68 -33
  183. package/core/dist/runtime-v2/core-principles/core-principle-registry.js.map +1 -1
  184. package/core/dist/runtime-v2/core-principles/index.d.ts +3 -3
  185. package/core/dist/runtime-v2/core-principles/index.d.ts.map +1 -1
  186. package/core/dist/runtime-v2/core-principles/index.js +1 -1
  187. package/core/dist/runtime-v2/core-principles/index.js.map +1 -1
  188. package/core/dist/runtime-v2/evolution/evolution-types.d.ts +2 -1
  189. package/core/dist/runtime-v2/evolution/evolution-types.d.ts.map +1 -1
  190. package/core/dist/runtime-v2/evolution/evolution-types.js.map +1 -1
  191. package/core/dist/runtime-v2/feature-flags/__tests__/anonymous-product-telemetry-flag.test.d.ts +2 -0
  192. package/core/dist/runtime-v2/feature-flags/__tests__/anonymous-product-telemetry-flag.test.d.ts.map +1 -0
  193. package/core/dist/runtime-v2/feature-flags/__tests__/anonymous-product-telemetry-flag.test.js +48 -0
  194. package/core/dist/runtime-v2/feature-flags/__tests__/anonymous-product-telemetry-flag.test.js.map +1 -0
  195. package/core/dist/runtime-v2/feature-flags/__tests__/codex-conversation-ingestion-flag.test.d.ts +2 -0
  196. package/core/dist/runtime-v2/feature-flags/__tests__/codex-conversation-ingestion-flag.test.d.ts.map +1 -0
  197. package/core/dist/runtime-v2/feature-flags/__tests__/codex-conversation-ingestion-flag.test.js +46 -0
  198. package/core/dist/runtime-v2/feature-flags/__tests__/codex-conversation-ingestion-flag.test.js.map +1 -0
  199. package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.js +86 -31
  200. package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.js.map +1 -1
  201. package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-lifecycle.test.d.ts +2 -0
  202. package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-lifecycle.test.d.ts.map +1 -0
  203. package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-lifecycle.test.js +83 -0
  204. package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-lifecycle.test.js.map +1 -0
  205. package/core/dist/runtime-v2/feature-flags/feature-flag-contract.d.ts +19 -1
  206. package/core/dist/runtime-v2/feature-flags/feature-flag-contract.d.ts.map +1 -1
  207. package/core/dist/runtime-v2/feature-flags/feature-flag-contract.js +128 -10
  208. package/core/dist/runtime-v2/feature-flags/feature-flag-contract.js.map +1 -1
  209. package/core/dist/runtime-v2/feature-flags/feature-flag-lifecycle.d.ts +37 -0
  210. package/core/dist/runtime-v2/feature-flags/feature-flag-lifecycle.d.ts.map +1 -0
  211. package/core/dist/runtime-v2/feature-flags/feature-flag-lifecycle.js +304 -0
  212. package/core/dist/runtime-v2/feature-flags/feature-flag-lifecycle.js.map +1 -0
  213. package/core/dist/runtime-v2/feature-flags/index.d.ts +4 -2
  214. package/core/dist/runtime-v2/feature-flags/index.d.ts.map +1 -1
  215. package/core/dist/runtime-v2/feature-flags/index.js +3 -1
  216. package/core/dist/runtime-v2/feature-flags/index.js.map +1 -1
  217. package/core/dist/runtime-v2/governance-experience-contract.d.ts +468 -0
  218. package/core/dist/runtime-v2/governance-experience-contract.d.ts.map +1 -0
  219. package/core/dist/runtime-v2/governance-experience-contract.js +208 -0
  220. package/core/dist/runtime-v2/governance-experience-contract.js.map +1 -0
  221. package/core/dist/runtime-v2/governance-experience.d.ts +11 -0
  222. package/core/dist/runtime-v2/governance-experience.d.ts.map +1 -0
  223. package/core/dist/runtime-v2/governance-experience.js +276 -0
  224. package/core/dist/runtime-v2/governance-experience.js.map +1 -0
  225. package/core/dist/runtime-v2/index.d.ts +20 -8
  226. package/core/dist/runtime-v2/index.d.ts.map +1 -1
  227. package/core/dist/runtime-v2/index.js +20 -6
  228. package/core/dist/runtime-v2/index.js.map +1 -1
  229. package/core/dist/runtime-v2/internalization/__tests__/artificer-output-retry-flag.test.js +29 -10
  230. package/core/dist/runtime-v2/internalization/__tests__/artificer-output-retry-flag.test.js.map +1 -1
  231. package/core/dist/runtime-v2/owner-identity.d.ts +69 -0
  232. package/core/dist/runtime-v2/owner-identity.d.ts.map +1 -0
  233. package/core/dist/runtime-v2/owner-identity.js +179 -0
  234. package/core/dist/runtime-v2/owner-identity.js.map +1 -0
  235. package/core/dist/runtime-v2/pain-signal-runtime-factory.d.ts.map +1 -1
  236. package/core/dist/runtime-v2/pain-signal-runtime-factory.js +2 -3
  237. package/core/dist/runtime-v2/pain-signal-runtime-factory.js.map +1 -1
  238. package/core/dist/runtime-v2/product-telemetry/daily-identity.d.ts +70 -0
  239. package/core/dist/runtime-v2/product-telemetry/daily-identity.d.ts.map +1 -0
  240. package/core/dist/runtime-v2/product-telemetry/daily-identity.js +89 -0
  241. package/core/dist/runtime-v2/product-telemetry/daily-identity.js.map +1 -0
  242. package/core/dist/runtime-v2/product-telemetry/snapshot-contract.d.ts +110 -0
  243. package/core/dist/runtime-v2/product-telemetry/snapshot-contract.d.ts.map +1 -0
  244. package/core/dist/runtime-v2/product-telemetry/snapshot-contract.js +250 -0
  245. package/core/dist/runtime-v2/product-telemetry/snapshot-contract.js.map +1 -0
  246. package/core/dist/runtime-v2/pruning-read-model.d.ts +2 -1
  247. package/core/dist/runtime-v2/pruning-read-model.d.ts.map +1 -1
  248. package/core/dist/runtime-v2/pruning-read-model.js.map +1 -1
  249. package/core/dist/runtime-v2/receipt-coverage.d.ts +63 -0
  250. package/core/dist/runtime-v2/receipt-coverage.d.ts.map +1 -0
  251. package/core/dist/runtime-v2/receipt-coverage.js +19 -0
  252. package/core/dist/runtime-v2/receipt-coverage.js.map +1 -0
  253. package/core/dist/runtime-v2/recovery-actions-log.d.ts +7 -0
  254. package/core/dist/runtime-v2/recovery-actions-log.d.ts.map +1 -1
  255. package/core/dist/runtime-v2/recovery-actions-log.js +6 -0
  256. package/core/dist/runtime-v2/recovery-actions-log.js.map +1 -1
  257. package/core/dist/runtime-v2/runtime-protocol.js +1 -1
  258. package/core/dist/runtime-v2/runtime-protocol.js.map +1 -1
  259. package/core/dist/runtime-v2/store/task/__tests__/sqlite-task-store.failed-tasks.test.js +17 -1
  260. package/core/dist/runtime-v2/store/task/__tests__/sqlite-task-store.failed-tasks.test.js.map +1 -1
  261. package/core/dist/runtime-v2/store/task/sqlite-task-store.d.ts.map +1 -1
  262. package/core/dist/runtime-v2/store/task/sqlite-task-store.js +10 -0
  263. package/core/dist/runtime-v2/store/task/sqlite-task-store.js.map +1 -1
  264. package/core/dist/runtime-v2/store/task/task-types.d.ts +2 -0
  265. package/core/dist/runtime-v2/store/task/task-types.d.ts.map +1 -1
  266. package/core/dist/runtime-v2/task-status.d.ts +9 -5
  267. package/core/dist/runtime-v2/task-status.d.ts.map +1 -1
  268. package/core/dist/runtime-v2/task-status.js +15 -7
  269. package/core/dist/runtime-v2/task-status.js.map +1 -1
  270. package/core/dist/runtime-v2/types/event-types.d.ts +4 -0
  271. package/core/dist/runtime-v2/types/event-types.d.ts.map +1 -1
  272. package/core/dist/runtime-v2/types/event-types.js.map +1 -1
  273. package/core/dist/runtime-v2/types/index.d.ts +1 -1
  274. package/core/dist/runtime-v2/types/index.d.ts.map +1 -1
  275. package/core/dist/runtime-v2/types/index.js +1 -1
  276. package/core/dist/runtime-v2/types/index.js.map +1 -1
  277. package/core/dist/runtime-v2/types/principle-enums.d.ts +3 -2
  278. package/core/dist/runtime-v2/types/principle-enums.d.ts.map +1 -1
  279. package/core/dist/runtime-v2/types/principle-enums.js +11 -5
  280. package/core/dist/runtime-v2/types/principle-enums.js.map +1 -1
  281. package/core/dist/runtime-v2/types/principle-schema.d.ts +1 -1
  282. package/core/dist/runtime-v2/types/principle-tree-store.d.ts +1 -1
  283. package/core/dist/runtime-v2/utils/cli-process-runner.d.ts.map +1 -1
  284. package/core/dist/runtime-v2/utils/cli-process-runner.js +3 -2
  285. package/core/dist/runtime-v2/utils/cli-process-runner.js.map +1 -1
  286. package/core/package.json +4 -5
  287. package/dist/i18n.d.ts.map +1 -1
  288. package/dist/i18n.js +4 -2
  289. package/dist/i18n.js.map +1 -1
  290. package/dist/index.d.ts +2 -0
  291. package/dist/index.d.ts.map +1 -1
  292. package/dist/index.js +47 -11
  293. package/dist/index.js.map +1 -1
  294. package/dist/installer.d.ts +31 -5
  295. package/dist/installer.d.ts.map +1 -1
  296. package/dist/installer.js +472 -161
  297. package/dist/installer.js.map +1 -1
  298. package/dist/installers/codex-host-installer.d.ts.map +1 -1
  299. package/dist/installers/codex-host-installer.js +4 -0
  300. package/dist/installers/codex-host-installer.js.map +1 -1
  301. package/dist/mvp-config.d.ts +10 -0
  302. package/dist/mvp-config.d.ts.map +1 -1
  303. package/dist/mvp-config.js +30 -3
  304. package/dist/mvp-config.js.map +1 -1
  305. package/dist/uninstaller.d.ts +9 -1
  306. package/dist/uninstaller.d.ts.map +1 -1
  307. package/dist/uninstaller.js +103 -23
  308. package/dist/uninstaller.js.map +1 -1
  309. package/dist/update/atomic-file.d.ts +35 -0
  310. package/dist/update/atomic-file.d.ts.map +1 -0
  311. package/dist/update/atomic-file.js +120 -0
  312. package/dist/update/atomic-file.js.map +1 -0
  313. package/dist/update/bootstrap-protocol.d.ts +55 -0
  314. package/dist/update/bootstrap-protocol.d.ts.map +1 -0
  315. package/dist/update/bootstrap-protocol.js +132 -0
  316. package/dist/update/bootstrap-protocol.js.map +1 -0
  317. package/dist/update/channel-metadata.d.ts +28 -0
  318. package/dist/update/channel-metadata.d.ts.map +1 -0
  319. package/dist/update/channel-metadata.js +90 -0
  320. package/dist/update/channel-metadata.js.map +1 -0
  321. package/dist/update/channel-promotion.d.ts +39 -0
  322. package/dist/update/channel-promotion.d.ts.map +1 -0
  323. package/dist/update/channel-promotion.js +55 -0
  324. package/dist/update/channel-promotion.js.map +1 -0
  325. package/dist/update/data-compatibility.d.ts +35 -0
  326. package/dist/update/data-compatibility.d.ts.map +1 -0
  327. package/dist/update/data-compatibility.js +45 -0
  328. package/dist/update/data-compatibility.js.map +1 -0
  329. package/dist/update/install-layout.d.ts +59 -0
  330. package/dist/update/install-layout.d.ts.map +1 -0
  331. package/dist/update/install-layout.js +127 -0
  332. package/dist/update/install-layout.js.map +1 -0
  333. package/dist/update/legacy-migration.d.ts +56 -0
  334. package/dist/update/legacy-migration.d.ts.map +1 -0
  335. package/dist/update/legacy-migration.js +254 -0
  336. package/dist/update/legacy-migration.js.map +1 -0
  337. package/dist/update/product-identity.d.ts +50 -0
  338. package/dist/update/product-identity.d.ts.map +1 -0
  339. package/dist/update/product-identity.js +63 -0
  340. package/dist/update/product-identity.js.map +1 -0
  341. package/dist/update/release-asset-manifest.d.ts +31 -0
  342. package/dist/update/release-asset-manifest.d.ts.map +1 -0
  343. package/dist/update/release-asset-manifest.js +161 -0
  344. package/dist/update/release-asset-manifest.js.map +1 -0
  345. package/dist/update/release-identity.d.ts +33 -0
  346. package/dist/update/release-identity.d.ts.map +1 -0
  347. package/dist/update/release-identity.js +108 -0
  348. package/dist/update/release-identity.js.map +1 -0
  349. package/dist/update/release-manager.d.ts +96 -0
  350. package/dist/update/release-manager.d.ts.map +1 -0
  351. package/dist/update/release-manager.js +253 -0
  352. package/dist/update/release-manager.js.map +1 -0
  353. package/dist/update/release-metadata.d.ts +57 -0
  354. package/dist/update/release-metadata.d.ts.map +1 -0
  355. package/dist/update/release-metadata.js +200 -0
  356. package/dist/update/release-metadata.js.map +1 -0
  357. package/dist/update/release-policy.d.ts +51 -0
  358. package/dist/update/release-policy.d.ts.map +1 -0
  359. package/dist/update/release-policy.js +103 -0
  360. package/dist/update/release-policy.js.map +1 -0
  361. package/dist/update/rollback-policy.d.ts +56 -0
  362. package/dist/update/rollback-policy.d.ts.map +1 -0
  363. package/dist/update/rollback-policy.js +61 -0
  364. package/dist/update/rollback-policy.js.map +1 -0
  365. package/dist/update/transaction-journal.d.ts +121 -0
  366. package/dist/update/transaction-journal.d.ts.map +1 -0
  367. package/dist/update/transaction-journal.js +333 -0
  368. package/dist/update/transaction-journal.js.map +1 -0
  369. package/dist/update/trust-metadata.d.ts +55 -0
  370. package/dist/update/trust-metadata.d.ts.map +1 -0
  371. package/dist/update/trust-metadata.js +170 -0
  372. package/dist/update/trust-metadata.js.map +1 -0
  373. package/dist/update/update-history.d.ts +46 -0
  374. package/dist/update/update-history.d.ts.map +1 -0
  375. package/dist/update/update-history.js +123 -0
  376. package/dist/update/update-history.js.map +1 -0
  377. package/dist/utils/env.d.ts +7 -0
  378. package/dist/utils/env.d.ts.map +1 -1
  379. package/dist/utils/env.js +134 -44
  380. package/dist/utils/env.js.map +1 -1
  381. package/host-runtime/dist/governance-observation-store.d.ts +172 -0
  382. package/host-runtime/dist/governance-observation-store.js +649 -0
  383. package/host-runtime/dist/index.d.ts +6 -0
  384. package/host-runtime/dist/index.js +8 -0
  385. package/host-runtime/dist/product-telemetry/consent-store.d.ts +107 -0
  386. package/host-runtime/dist/product-telemetry/consent-store.js +329 -0
  387. package/host-runtime/dist/product-telemetry/eligibility.d.ts +53 -0
  388. package/host-runtime/dist/product-telemetry/eligibility.js +69 -0
  389. package/host-runtime/dist/product-telemetry/exporter.d.ts +46 -0
  390. package/host-runtime/dist/product-telemetry/exporter.js +71 -0
  391. package/host-runtime/dist/product-telemetry/milestone-readers.d.ts +61 -0
  392. package/host-runtime/dist/product-telemetry/milestone-readers.js +234 -0
  393. package/host-runtime/dist/product-telemetry/service.d.ts +142 -0
  394. package/host-runtime/dist/product-telemetry/service.js +532 -0
  395. package/host-runtime/dist/product-telemetry/workspace-scope.d.ts +38 -0
  396. package/host-runtime/dist/product-telemetry/workspace-scope.js +64 -0
  397. package/host-runtime/package.json +7 -2
  398. package/install-layout/dist/index.d.ts +48 -0
  399. package/install-layout/dist/index.js +81 -0
  400. package/install-layout/dist/index.test.d.ts +1 -0
  401. package/install-layout/dist/index.test.js +34 -0
  402. package/install-layout/package.json +33 -0
  403. package/package.json +16 -6
  404. package/pd-cli/dist/commands/__tests__/telemetry-flag-wiring.test.d.ts +9 -0
  405. package/pd-cli/dist/commands/__tests__/telemetry-flag-wiring.test.d.ts.map +1 -0
  406. package/pd-cli/dist/commands/__tests__/telemetry-flag-wiring.test.js +76 -0
  407. package/pd-cli/dist/commands/__tests__/telemetry-flag-wiring.test.js.map +1 -0
  408. package/pd-cli/dist/commands/__tests__/version.test.d.ts +2 -0
  409. package/pd-cli/dist/commands/__tests__/version.test.d.ts.map +1 -0
  410. package/pd-cli/dist/commands/__tests__/version.test.js +134 -0
  411. package/pd-cli/dist/commands/__tests__/version.test.js.map +1 -0
  412. package/pd-cli/dist/commands/console.d.ts.map +1 -1
  413. package/pd-cli/dist/commands/console.js +29 -10
  414. package/pd-cli/dist/commands/console.js.map +1 -1
  415. package/pd-cli/dist/commands/pain-record.d.ts.map +1 -1
  416. package/pd-cli/dist/commands/pain-record.js +6 -15
  417. package/pd-cli/dist/commands/pain-record.js.map +1 -1
  418. package/pd-cli/dist/commands/runtime-activation.d.ts +29 -0
  419. package/pd-cli/dist/commands/runtime-activation.d.ts.map +1 -1
  420. package/pd-cli/dist/commands/runtime-activation.js +70 -31
  421. package/pd-cli/dist/commands/runtime-activation.js.map +1 -1
  422. package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.d.ts.map +1 -1
  423. package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.js +2 -2
  424. package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.js.map +1 -1
  425. package/pd-cli/dist/commands/telemetry.d.ts +82 -0
  426. package/pd-cli/dist/commands/telemetry.d.ts.map +1 -0
  427. package/pd-cli/dist/commands/telemetry.js +268 -0
  428. package/pd-cli/dist/commands/telemetry.js.map +1 -0
  429. package/pd-cli/dist/commands/version.d.ts +11 -0
  430. package/pd-cli/dist/commands/version.d.ts.map +1 -0
  431. package/pd-cli/dist/commands/version.js +48 -0
  432. package/pd-cli/dist/commands/version.js.map +1 -0
  433. package/pd-cli/dist/index.js +35 -2
  434. package/pd-cli/dist/index.js.map +1 -1
  435. package/pd-cli/dist/services/version-report.d.ts +44 -0
  436. package/pd-cli/dist/services/version-report.d.ts.map +1 -0
  437. package/pd-cli/dist/services/version-report.js +152 -0
  438. package/pd-cli/dist/services/version-report.js.map +1 -0
  439. package/pd-cli/package.json +3 -2
  440. package/plugin/dist/bundle.js +870 -932
  441. package/plugin/dist/core/init.d.ts +2 -1
  442. package/plugin/dist/core/principle-application-ledger.d.ts +10 -0
  443. package/plugin/dist/core/product-telemetry-trigger.d.ts +14 -0
  444. package/plugin/dist/core/thinking-os-parser.d.ts +5 -2
  445. package/plugin/dist/governance-audit.js +386 -0
  446. package/plugin/dist/hooks/gate-block-helper.d.ts +25 -1
  447. package/plugin/dist/hooks/gate.d.ts +22 -0
  448. package/plugin/dist/openclaw.plugin.json +1 -1
  449. package/plugin/dist/rulehost-evidence.js +832 -0
  450. package/plugin/dist/templates/langs/en/principles/THINKING_OS.md +53 -45
  451. package/plugin/dist/templates/langs/en/skills/pd-mentor/SKILL.md +1 -1
  452. package/plugin/dist/templates/langs/zh/principles/THINKING_OS.md +62 -46
  453. package/plugin/dist/templates/langs/zh/skills/pd-mentor/SKILL.md +1 -1
  454. package/plugin/dist/templates/workspace/.principles/THINKING_OS.md +66 -38
  455. package/plugin/openclaw.plugin.json +1 -1
  456. package/plugin/package.json +1 -1
  457. package/plugin/templates/langs/en/principles/THINKING_OS.md +53 -45
  458. package/plugin/templates/langs/en/skills/pd-mentor/SKILL.md +1 -1
  459. package/plugin/templates/langs/zh/principles/THINKING_OS.md +62 -46
  460. package/plugin/templates/langs/zh/skills/pd-mentor/SKILL.md +1 -1
  461. package/plugin/templates/workspace/.principles/THINKING_OS.md +66 -38
@@ -0,0 +1,208 @@
1
+ import { Type } from '@sinclair/typebox';
2
+ import { LineageConfidenceSchema, OwnerGovernanceViewSchema, SourceRefSchema, } from './governance-projection-contract.js';
3
+ // Governance Experience Snapshot v1.5.1 contract (PRI-584).
4
+ //
5
+ // Read-only experience layer OVER the existing governance projection
6
+ // (GovernanceFacts -> deriveOwnerGovernanceView -> OwnerGovernanceView).
7
+ // This layer explains; it never authorizes (ERR-102) and never introduces a
8
+ // second lifecycle model: every activity judgment below is derived from
9
+ // fields the projection already computed.
10
+ const NonEmptyStringSchema = Type.String({ minLength: 1 });
11
+ // Reuses the ISO-8601 UTC format registered by governance-projection-contract.js
12
+ // at import time; Value.Check fails loud if the two registrations ever diverge.
13
+ const TimestampSchema = Type.String({ format: 'governance-iso-utc' });
14
+ export const GovernancePrimaryAttentionSchema = Type.Union([
15
+ Type.Literal('setup_required'),
16
+ Type.Literal('owner_decision_required'),
17
+ Type.Literal('recovery_required'),
18
+ Type.Literal('degraded'),
19
+ Type.Literal('background_processing'),
20
+ Type.Literal('all_clear'),
21
+ ]);
22
+ export const GovernanceExperienceReasonCodeSchema = Type.Union([
23
+ Type.Literal('governance.exp.reason.owner_identity_missing'),
24
+ Type.Literal('governance.exp.reason.approval_pending'),
25
+ Type.Literal('governance.exp.reason.rulecode_owner_decision'),
26
+ Type.Literal('governance.exp.reason.no_pending_decision'),
27
+ Type.Literal('governance.exp.reason.owner_decision_available'),
28
+ Type.Literal('governance.exp.reason.break_glass_entry'),
29
+ Type.Literal('governance.exp.reason.recovery_required'),
30
+ Type.Literal('governance.exp.reason.source_unavailable'),
31
+ Type.Literal('governance.exp.reason.config_invalid'),
32
+ Type.Literal('governance.exp.reason.processing'),
33
+ Type.Literal('governance.exp.reason.workspace_clear'),
34
+ Type.Literal('governance.exp.reason.workspace_empty'),
35
+ ]);
36
+ export const GovernanceExperienceNextActionCodeSchema = Type.Union([
37
+ Type.Literal('governance.exp.next.configure_owner'),
38
+ Type.Literal('governance.exp.next.review_approvals'),
39
+ Type.Literal('governance.exp.next.inspect_recovery'),
40
+ Type.Literal('governance.exp.next.inspect_sources'),
41
+ Type.Literal('governance.exp.next.fix_config'),
42
+ Type.Literal('governance.exp.next.monitor'),
43
+ Type.Literal('governance.exp.next.none'),
44
+ ]);
45
+ // ── Inputs (request-scoped validated envelope, SPEC §5) ─────────────────────
46
+ export const WorkspaceEnvironmentSchema = Type.Union([
47
+ Type.Literal('production'),
48
+ Type.Literal('development'),
49
+ Type.Literal('demo'),
50
+ Type.Literal('test'),
51
+ ]);
52
+ export const EnvironmentContextInputSchema = Type.Object({
53
+ environment: Type.Union([WorkspaceEnvironmentSchema, Type.Literal('unknown')]),
54
+ source: Type.Union([Type.Literal('workspace_config'), Type.Literal('missing')]),
55
+ configIssue: Type.Optional(NonEmptyStringSchema),
56
+ }, { additionalProperties: false });
57
+ export const SourceAvailabilityInputSchema = Type.Object({
58
+ sourceId: Type.Union([Type.Literal('state_db'), Type.Literal('principle_ledger')]),
59
+ available: Type.Boolean(),
60
+ reasonCode: Type.Optional(NonEmptyStringSchema),
61
+ }, { additionalProperties: false });
62
+ export const UnlinkedRecordGroupSchema = Type.Object({
63
+ source: Type.Union([
64
+ Type.Literal('approval'),
65
+ Type.Literal('task'),
66
+ Type.Literal('artifact'),
67
+ Type.Literal('principle'),
68
+ Type.Literal('activation'),
69
+ ]),
70
+ reasonCode: NonEmptyStringSchema,
71
+ count: Type.Integer({ minimum: 0 }),
72
+ sampleRefs: Type.Array(SourceRefSchema, { maxItems: 10 }),
73
+ }, { additionalProperties: false });
74
+ export const OwnerConfigSnapshotSchema = Type.Object({
75
+ authenticationMode: Type.Union([Type.Literal('authenticated'), Type.Literal('no_auth')]),
76
+ ownerIdentityConfiguration: Type.Union([Type.Literal('configured'), Type.Literal('missing')]),
77
+ }, { additionalProperties: false });
78
+ export const GovernanceViewInputSchema = Type.Object({
79
+ view: OwnerGovernanceViewSchema,
80
+ lineageConfidence: LineageConfidenceSchema,
81
+ }, { additionalProperties: false });
82
+ /**
83
+ * Frontier evidence read directly from the tasks table. Present only when
84
+ * state_db is readable. Used exclusively for the `blocked` classification:
85
+ * blocked requires BOTH current-frontier evidence and a blocking source
86
+ * (SPEC §8.1/§9.1) — orphan rows alone can never produce `blocked`.
87
+ */
88
+ export const FrontierEvidenceSchema = Type.Object({
89
+ sourceId: Type.Literal('state_db'),
90
+ activeTaskCount: Type.Integer({ minimum: 0 }),
91
+ sampleRefs: Type.Array(SourceRefSchema, { maxItems: 10 }),
92
+ }, { additionalProperties: false });
93
+ export const GovernanceExperienceInputsSchema = Type.Object({
94
+ schemaVersion: Type.Literal('1'),
95
+ asOf: TimestampSchema,
96
+ workspaceHash: NonEmptyStringSchema,
97
+ governanceViews: Type.Array(GovernanceViewInputSchema),
98
+ ownerConfigSnapshot: OwnerConfigSnapshotSchema,
99
+ environmentContext: EnvironmentContextInputSchema,
100
+ sourceAvailability: Type.Array(SourceAvailabilityInputSchema),
101
+ dataQualityInputs: Type.Array(UnlinkedRecordGroupSchema),
102
+ frontierEvidence: Type.Optional(FrontierEvidenceSchema),
103
+ /**
104
+ * RuleCode owner decisions awaiting action (SPEC §8.3 needs_decision source).
105
+ * Counted from non-deactivated shadow activations in the same batched
106
+ * `activations` rows — no extra query. Absent when state_db is unavailable.
107
+ */
108
+ rulecodeDecisionEvidence: Type.Optional(Type.Object({
109
+ pendingCount: Type.Integer({ minimum: 0 }),
110
+ sampleRefs: Type.Array(SourceRefSchema, { maxItems: 10 }),
111
+ }, { additionalProperties: false })),
112
+ }, { additionalProperties: false });
113
+ // ── Readiness (SPEC §6) ──────────────────────────────────────────────────────
114
+ export const GovernanceActionKindSchema = Type.Union([
115
+ Type.Literal('principle_approval'),
116
+ Type.Literal('rulecode_owner_decision'),
117
+ Type.Literal('emergency_pause'),
118
+ ]);
119
+ export const GovernanceObservedAuthoritySchema = Type.Union([
120
+ Type.Literal('operator_legacy'),
121
+ Type.Literal('configured_owner'),
122
+ Type.Literal('break_glass'),
123
+ ]);
124
+ export const GovernanceActionReadinessSchema = Type.Object({
125
+ kind: GovernanceActionKindSchema,
126
+ observedAuthority: GovernanceObservedAuthoritySchema,
127
+ status: Type.Union([Type.Literal('entry_conditions_met'), Type.Literal('blocked')]),
128
+ reasonCode: GovernanceExperienceReasonCodeSchema,
129
+ nextActionCode: GovernanceExperienceNextActionCodeSchema,
130
+ }, { additionalProperties: false });
131
+ export const OwnerGovernanceReadinessSchema = Type.Object({
132
+ authenticationMode: OwnerConfigSnapshotSchema.properties.authenticationMode,
133
+ ownerIdentityConfiguration: OwnerConfigSnapshotSchema.properties.ownerIdentityConfiguration,
134
+ governanceActions: Type.Array(GovernanceActionReadinessSchema, { minItems: 3, maxItems: 3 }),
135
+ }, { additionalProperties: false });
136
+ // ── Activity (SPEC §7-§9) ────────────────────────────────────────────────────
137
+ export const GovernanceActivityCategorySchema = Type.Union([
138
+ Type.Literal('blocked'),
139
+ Type.Literal('needs_recovery'),
140
+ Type.Literal('needs_decision'),
141
+ Type.Literal('processing'),
142
+ ]);
143
+ export const GovernanceActivityItemSchema = Type.Object({
144
+ principleId: Type.Optional(NonEmptyStringSchema),
145
+ category: GovernanceActivityCategorySchema,
146
+ reasonCode: NonEmptyStringSchema,
147
+ sourceRefs: Type.Array(SourceRefSchema, { maxItems: 10 }),
148
+ }, { additionalProperties: false });
149
+ export const GovernanceActivityCategorySummarySchema = Type.Object({
150
+ category: GovernanceActivityCategorySchema,
151
+ count: Type.Integer({ minimum: 0 }),
152
+ items: Type.Array(GovernanceActivityItemSchema, { maxItems: 10 }),
153
+ hasMore: Type.Boolean(),
154
+ }, { additionalProperties: false });
155
+ export const GovernanceActivitySnapshotSchema = Type.Object({
156
+ primaryAttention: GovernancePrimaryAttentionSchema,
157
+ categories: Type.Array(GovernanceActivityCategorySummarySchema),
158
+ }, { additionalProperties: false });
159
+ // ── Trust & data quality (SPEC §11-§15) ──────────────────────────────────────
160
+ export const GovernanceLineageTransparencySchema = Type.Object({
161
+ confidence: LineageConfidenceSchema,
162
+ strongViewCount: Type.Integer({ minimum: 0 }),
163
+ weakViewCount: Type.Integer({ minimum: 0 }),
164
+ unknownViewCount: Type.Integer({ minimum: 0 }),
165
+ }, { additionalProperties: false });
166
+ export const GovernanceTrustContextSchema = Type.Object({
167
+ environmentContext: EnvironmentContextInputSchema,
168
+ lineageTransparency: GovernanceLineageTransparencySchema,
169
+ }, { additionalProperties: false });
170
+ export const GovernanceDataQualityIssueGroupSchema = Type.Object({
171
+ source: Type.Union([
172
+ Type.Literal('ledger'),
173
+ Type.Literal('artifact'),
174
+ Type.Literal('task'),
175
+ Type.Literal('approval'),
176
+ Type.Literal('activation'),
177
+ Type.Literal('trajectory'),
178
+ Type.Literal('lineage'),
179
+ Type.Literal('workspace'),
180
+ ]),
181
+ reasonCode: NonEmptyStringSchema,
182
+ nextActionCode: NonEmptyStringSchema,
183
+ count: Type.Integer({ minimum: 1 }),
184
+ sampleRefs: Type.Array(SourceRefSchema, { maxItems: 3 }),
185
+ }, { additionalProperties: false });
186
+ export const GovernanceDataQualitySchema = Type.Object({
187
+ degraded: Type.Boolean(),
188
+ issueGroups: Type.Array(GovernanceDataQualityIssueGroupSchema, { maxItems: 10 }),
189
+ hasMore: Type.Boolean(),
190
+ }, { additionalProperties: false });
191
+ // ── Snapshot (SPEC §12) ──────────────────────────────────────────────────────
192
+ export const GovernanceExperienceSummarySchema = Type.Object({
193
+ primaryAttention: GovernancePrimaryAttentionSchema,
194
+ headlineCode: NonEmptyStringSchema,
195
+ reasonCode: GovernanceExperienceReasonCodeSchema,
196
+ nextActionCode: GovernanceExperienceNextActionCodeSchema,
197
+ }, { additionalProperties: false });
198
+ export const GovernanceExperienceSnapshotSchema = Type.Object({
199
+ schemaVersion: Type.Literal('1'),
200
+ snapshotId: NonEmptyStringSchema,
201
+ asOf: TimestampSchema,
202
+ summary: GovernanceExperienceSummarySchema,
203
+ readiness: OwnerGovernanceReadinessSchema,
204
+ activity: GovernanceActivitySnapshotSchema,
205
+ trustContext: GovernanceTrustContextSchema,
206
+ dataQuality: GovernanceDataQualitySchema,
207
+ }, { additionalProperties: false });
208
+ //# sourceMappingURL=governance-experience-contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"governance-experience-contract.js","sourceRoot":"","sources":["../../src/runtime-v2/governance-experience-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAe,MAAM,mBAAmB,CAAC;AACtD,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,eAAe,GAChB,MAAM,qCAAqC,CAAC;AAE7C,4DAA4D;AAC5D,EAAE;AACF,qEAAqE;AACrE,yEAAyE;AACzE,4EAA4E;AAC5E,wEAAwE;AACxE,0CAA0C;AAE1C,MAAM,oBAAoB,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC;AAC3D,iFAAiF;AACjF,gFAAgF;AAChF,MAAM,eAAe,GAAG,IAAI,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K,CAAC,qCAAqC,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IAChF,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE;CACxB,EAAE,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC,CAAC;AAEpC,gFAAgF;AAEhF,MAAM,CAAC,MAAM,iCAAiC,GAAG,IAAI,CAAC,MAAM,CAAC;IAC3D,gBAAgB,EAAE,gCAAgC;IAClD,YAAY,EAAE,oBAAoB;IAClC,UAAU,EAAE,oCAAoC;IAChD,cAAc,EAAE,wCAAwC;CACzD,EAAE,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC,CAAC;AACpC,MAAM,CAAC,MAAM,kCAAkC,GAAG,IAAI,CAAC,MAAM,CAAC;IAC5D,aAAa,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC;IAChC,UAAU,EAAE,oBAAoB;IAChC,IAAI,EAAE,eAAe;IACrB,OAAO,EAAE,iCAAiC;IAC1C,SAAS,EAAE,8BAA8B;IACzC,QAAQ,EAAE,gCAAgC;IAC1C,YAAY,EAAE,4BAA4B;IAC1C,WAAW,EAAE,2BAA2B;CACzC,EAAE,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { GovernanceExperienceSnapshot } from './governance-experience-contract.js';
2
+ /** Bounded list contract (SPEC §15): at most 10 items per category / issue group list. */
3
+ export declare const GOVERNANCE_EXPERIENCE_ITEMS_LIMIT = 10;
4
+ export declare const GOVERNANCE_EXPERIENCE_ISSUE_GROUPS_LIMIT = 10;
5
+ /**
6
+ * Derives the workspace-level governance experience snapshot from validated
7
+ * inputs. Pure: no clock, no I/O, deterministic for identical inputs.
8
+ * Throws `invalid_governance_experience_inputs` / `invalid_governance_experience_snapshot`.
9
+ */
10
+ export declare function deriveGovernanceExperienceSnapshot(input: unknown): GovernanceExperienceSnapshot;
11
+ //# sourceMappingURL=governance-experience.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"governance-experience.d.ts","sourceRoot":"","sources":["../../src/runtime-v2/governance-experience.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkG,4BAA4B,EAAgL,MAAM,qCAAqC,CAAC;AAOtW,0FAA0F;AAC1F,eAAO,MAAM,iCAAiC,KAAK,CAAC;AACpD,eAAO,MAAM,wCAAwC,KAAK,CAAC;AAkJ3D;;;;GAIG;AACH,wBAAgB,kCAAkC,CAAC,KAAK,EAAE,OAAO,GAAG,4BAA4B,CAuH/F"}
@@ -0,0 +1,276 @@
1
+ import { Value } from '@sinclair/typebox/value';
2
+ import { GovernanceExperienceInputsSchema, GovernanceExperienceSnapshotSchema, } from './governance-experience-contract.js';
3
+ /** Bounded list contract (SPEC §15): at most 10 items per category / issue group list. */
4
+ export const GOVERNANCE_EXPERIENCE_ITEMS_LIMIT = 10;
5
+ export const GOVERNANCE_EXPERIENCE_ISSUE_GROUPS_LIMIT = 10;
6
+ /**
7
+ * Active execution evidence (SPEC §8.4): `running` (leased with a live lease or
8
+ * pending completion intent) and `retry_scheduled` (a prior execution exists,
9
+ * retry pending). `queued` (never-started pending frontier) is deliberately
10
+ * EXCLUDED — pending artifact/work is not processing.
11
+ */
12
+ const PROCESSING_AUTOMATION_STATES = new Set(['running', 'retry_scheduled']);
13
+ /** Category priority (SPEC §7.3): blocked > needs_recovery > needs_decision > processing. */
14
+ const CATEGORY_ORDER = ['blocked', 'needs_recovery', 'needs_decision', 'processing'];
15
+ const UNLINKED_NEXT_ACTION = 'inspect_workspace_data';
16
+ function classifyView(view) {
17
+ // Per-principle category is mutually exclusive with SPEC §7.3 priority:
18
+ // recovery outranks decision (a principle with a failed task AND a pending
19
+ // approval is classified needs_recovery; the workspace-level
20
+ // primaryAttention headline still surfaces the decision first per SPEC
21
+ // Phase 4 UI priority "1. Owner decision 2. Recovery").
22
+ const hasRecovery = view.attention.primary === 'recovery_required'
23
+ || view.attention.items.some(item => item.kind === 'recovery')
24
+ || view.automation.state === 'stalled';
25
+ if (hasRecovery)
26
+ return 'needs_recovery';
27
+ if (view.attention.primary === 'owner_required')
28
+ return 'needs_decision';
29
+ if (PROCESSING_AUTOMATION_STATES.has(view.automation.state))
30
+ return 'processing';
31
+ return 'idle';
32
+ }
33
+ function activityItem(category, view) {
34
+ return {
35
+ principleId: view.principleId,
36
+ category,
37
+ reasonCode: view.summary.reasonCode,
38
+ sourceRefs: view.summary.sourceRefs.slice(0, GOVERNANCE_EXPERIENCE_ITEMS_LIMIT),
39
+ };
40
+ }
41
+ function buildReadiness(inputs, decisionCount) {
42
+ const ownerConfigured = inputs.ownerConfigSnapshot.ownerIdentityConfiguration === 'configured';
43
+ const principleApprovalReason = decisionCount > 0
44
+ ? 'governance.exp.reason.approval_pending'
45
+ : 'governance.exp.reason.no_pending_decision';
46
+ // principle approvals: the live mutation route has no owner-identity gate —
47
+ // the real entry acts with operator authority even when an Owner is
48
+ // configured (SPEC §6.4). rulecode governance decisions require the
49
+ // configured Owner (routes/activations.ts governance actor). emergency
50
+ // pause resolves to the configured Owner when present, otherwise to the
51
+ // always-constructed break-glass actor (server/index.ts authority wiring).
52
+ return {
53
+ authenticationMode: inputs.ownerConfigSnapshot.authenticationMode,
54
+ ownerIdentityConfiguration: inputs.ownerConfigSnapshot.ownerIdentityConfiguration,
55
+ governanceActions: [
56
+ {
57
+ kind: 'principle_approval',
58
+ observedAuthority: 'operator_legacy',
59
+ status: 'entry_conditions_met',
60
+ reasonCode: principleApprovalReason,
61
+ nextActionCode: decisionCount > 0 ? 'governance.exp.next.review_approvals' : 'governance.exp.next.none',
62
+ },
63
+ ownerConfigured
64
+ ? {
65
+ kind: 'rulecode_owner_decision',
66
+ observedAuthority: 'configured_owner',
67
+ status: 'entry_conditions_met',
68
+ reasonCode: 'governance.exp.reason.owner_decision_available',
69
+ nextActionCode: 'governance.exp.next.none',
70
+ }
71
+ : {
72
+ kind: 'rulecode_owner_decision',
73
+ observedAuthority: 'configured_owner',
74
+ status: 'blocked',
75
+ reasonCode: 'governance.exp.reason.owner_identity_missing',
76
+ nextActionCode: 'governance.exp.next.configure_owner',
77
+ },
78
+ ownerConfigured
79
+ ? {
80
+ kind: 'emergency_pause',
81
+ observedAuthority: 'configured_owner',
82
+ status: 'entry_conditions_met',
83
+ reasonCode: 'governance.exp.reason.owner_decision_available',
84
+ nextActionCode: 'governance.exp.next.none',
85
+ }
86
+ : {
87
+ kind: 'emergency_pause',
88
+ observedAuthority: 'break_glass',
89
+ status: 'entry_conditions_met',
90
+ reasonCode: 'governance.exp.reason.break_glass_entry',
91
+ nextActionCode: 'governance.exp.next.none',
92
+ },
93
+ ],
94
+ };
95
+ }
96
+ function pushUniqueRef(refs, ref, max) {
97
+ if (refs.length < max && !refs.some(existing => existing.type === ref.type && existing.id === ref.id))
98
+ refs.push(ref);
99
+ }
100
+ function groupIssues(inputs) {
101
+ const groups = new Map();
102
+ const bump = (issue) => {
103
+ const { source, reasonCode, nextActionCode, sourceRef: ref } = issue;
104
+ const key = `${source}:${reasonCode}`;
105
+ const existing = groups.get(key);
106
+ if (existing === undefined) {
107
+ groups.set(key, { source, reasonCode, nextActionCode, count: 1, refs: ref === undefined ? [] : [ref] });
108
+ return;
109
+ }
110
+ existing.count += 1;
111
+ if (ref !== undefined)
112
+ pushUniqueRef(existing.refs, ref, 3);
113
+ };
114
+ // Unlinked record families map onto the projection's data-quality sources;
115
+ // 'principle' (ledger entries without a principle) surfaces as 'ledger'.
116
+ const unlinkedSource = (source) => source === 'principle' ? 'ledger' : source;
117
+ for (const input of inputs.dataQualityInputs) {
118
+ if (input.count <= 0)
119
+ continue;
120
+ const source = unlinkedSource(input.source);
121
+ const key = `${source}:${input.reasonCode}`;
122
+ const existing = groups.get(key);
123
+ if (existing === undefined) {
124
+ groups.set(key, { source, reasonCode: input.reasonCode, nextActionCode: UNLINKED_NEXT_ACTION, count: input.count, refs: [...input.sampleRefs].slice(0, 3) });
125
+ }
126
+ else {
127
+ existing.count += input.count;
128
+ for (const ref of input.sampleRefs)
129
+ pushUniqueRef(existing.refs, ref, 3);
130
+ }
131
+ }
132
+ for (const viewInput of inputs.governanceViews) {
133
+ for (const issue of viewInput.view.dataQuality.issues) {
134
+ bump({ source: issue.source, reasonCode: issue.reasonCode, nextActionCode: issue.nextActionCode, ...(issue.sourceRef === undefined ? {} : { sourceRef: issue.sourceRef }) });
135
+ }
136
+ }
137
+ if (inputs.environmentContext.configIssue !== undefined) {
138
+ bump({ source: 'workspace', reasonCode: 'config_invalid', nextActionCode: 'fix_workspace_config' });
139
+ }
140
+ const sorted = [...groups.values()]
141
+ .map(group => ({ source: group.source, reasonCode: group.reasonCode, nextActionCode: group.nextActionCode, count: group.count, sampleRefs: group.refs.slice(0, 3) }))
142
+ .sort((a, b) => b.count - a.count || a.source.localeCompare(b.source) || a.reasonCode.localeCompare(b.reasonCode));
143
+ return {
144
+ degraded: sorted.length > 0,
145
+ issueGroups: sorted.slice(0, GOVERNANCE_EXPERIENCE_ISSUE_GROUPS_LIMIT),
146
+ hasMore: sorted.length > GOVERNANCE_EXPERIENCE_ISSUE_GROUPS_LIMIT,
147
+ };
148
+ }
149
+ /**
150
+ * Derives the workspace-level governance experience snapshot from validated
151
+ * inputs. Pure: no clock, no I/O, deterministic for identical inputs.
152
+ * Throws `invalid_governance_experience_inputs` / `invalid_governance_experience_snapshot`.
153
+ */
154
+ export function deriveGovernanceExperienceSnapshot(input) {
155
+ if (!Value.Check(GovernanceExperienceInputsSchema, input))
156
+ throw new Error('invalid_governance_experience_inputs');
157
+ const inputs = input;
158
+ const sortedViews = [...inputs.governanceViews].sort((a, b) => a.view.principleId.localeCompare(b.view.principleId));
159
+ const buckets = new Map([['blocked', []], ['needs_recovery', []], ['needs_decision', []], ['processing', []]]);
160
+ for (const { view } of sortedViews) {
161
+ const category = classifyView(view);
162
+ if (category === 'idle')
163
+ continue;
164
+ buckets.get(category)?.push(activityItem(category, view));
165
+ }
166
+ // RuleCode owner decisions are a workspace-level needs_decision marker (SPEC
167
+ // §8.3) — listed first so bounded lists surface it before principle items.
168
+ if (inputs.rulecodeDecisionEvidence !== undefined && inputs.rulecodeDecisionEvidence.pendingCount > 0) {
169
+ buckets.get('needs_decision')?.unshift({
170
+ category: 'needs_decision',
171
+ reasonCode: 'governance.exp.reason.rulecode_owner_decision',
172
+ sourceRefs: inputs.rulecodeDecisionEvidence.sampleRefs.slice(0, GOVERNANCE_EXPERIENCE_ITEMS_LIMIT),
173
+ });
174
+ }
175
+ const unavailableSources = inputs.sourceAvailability.filter(source => !source.available);
176
+ // blocked needs current-frontier evidence AND blocking evidence together
177
+ // (SPEC §8.1). With state_db itself down there is no frontier evidence and
178
+ // the snapshot reports `degraded` instead of guessing. "Progress cannot be
179
+ // established" is inherent to the condition: an unavailable required source
180
+ // is exactly what prevents views/progress from being built — the marker
181
+ // carries the frontier evidence refs, never a bare count.
182
+ const frontierActive = inputs.frontierEvidence !== undefined && inputs.frontierEvidence.activeTaskCount > 0;
183
+ const blocked = unavailableSources.length > 0 && frontierActive;
184
+ if (blocked && inputs.frontierEvidence !== undefined) {
185
+ buckets.set('blocked', [{
186
+ category: 'blocked',
187
+ reasonCode: 'governance.exp.reason.source_unavailable',
188
+ sourceRefs: inputs.frontierEvidence.sampleRefs.slice(0, GOVERNANCE_EXPERIENCE_ITEMS_LIMIT),
189
+ }]);
190
+ }
191
+ const categories = [];
192
+ for (const category of CATEGORY_ORDER) {
193
+ const items = buckets.get(category) ?? [];
194
+ if (items.length === 0)
195
+ continue;
196
+ categories.push({
197
+ category,
198
+ count: items.length,
199
+ items: items.slice(0, GOVERNANCE_EXPERIENCE_ITEMS_LIMIT),
200
+ hasMore: items.length > GOVERNANCE_EXPERIENCE_ITEMS_LIMIT,
201
+ });
202
+ }
203
+ const decisionCount = buckets.get('needs_decision')?.length ?? 0;
204
+ const approvalDecisionCount = buckets.get('needs_decision')?.filter(item => item.principleId !== undefined).length ?? 0;
205
+ const recoveryCount = buckets.get('needs_recovery')?.length ?? 0;
206
+ const processingCount = buckets.get('processing')?.length ?? 0;
207
+ const dataQuality = groupIssues(inputs);
208
+ const configInvalid = inputs.environmentContext.configIssue !== undefined;
209
+ let primaryAttention;
210
+ if (decisionCount > 0)
211
+ primaryAttention = 'owner_decision_required';
212
+ else if (recoveryCount > 0 || blocked)
213
+ primaryAttention = 'recovery_required';
214
+ else if (unavailableSources.length > 0 || dataQuality.degraded)
215
+ primaryAttention = 'degraded';
216
+ else if (inputs.ownerConfigSnapshot.ownerIdentityConfiguration === 'missing')
217
+ primaryAttention = 'setup_required';
218
+ else if (processingCount > 0)
219
+ primaryAttention = 'background_processing';
220
+ else
221
+ primaryAttention = 'all_clear';
222
+ let reasonCode;
223
+ let nextActionCode;
224
+ switch (primaryAttention) {
225
+ case 'owner_decision_required':
226
+ reasonCode = approvalDecisionCount > 0 ? 'governance.exp.reason.approval_pending' : 'governance.exp.reason.rulecode_owner_decision';
227
+ nextActionCode = 'governance.exp.next.review_approvals';
228
+ break;
229
+ case 'recovery_required':
230
+ reasonCode = blocked ? 'governance.exp.reason.source_unavailable' : 'governance.exp.reason.recovery_required';
231
+ nextActionCode = blocked ? 'governance.exp.next.inspect_sources' : 'governance.exp.next.inspect_recovery';
232
+ break;
233
+ case 'degraded':
234
+ reasonCode = configInvalid && unavailableSources.length === 0 ? 'governance.exp.reason.config_invalid' : 'governance.exp.reason.source_unavailable';
235
+ nextActionCode = configInvalid && unavailableSources.length === 0 ? 'governance.exp.next.fix_config' : 'governance.exp.next.inspect_sources';
236
+ break;
237
+ case 'setup_required':
238
+ reasonCode = 'governance.exp.reason.owner_identity_missing';
239
+ nextActionCode = 'governance.exp.next.configure_owner';
240
+ break;
241
+ case 'background_processing':
242
+ reasonCode = 'governance.exp.reason.processing';
243
+ nextActionCode = 'governance.exp.next.monitor';
244
+ break;
245
+ default:
246
+ reasonCode = sortedViews.length === 0 ? 'governance.exp.reason.workspace_empty' : 'governance.exp.reason.workspace_clear';
247
+ nextActionCode = 'governance.exp.next.none';
248
+ break;
249
+ }
250
+ const strongViewCount = sortedViews.filter(item => item.lineageConfidence === 'strong').length;
251
+ const weakViewCount = sortedViews.filter(item => item.lineageConfidence === 'weak').length;
252
+ const unknownViewCount = sortedViews.filter(item => item.lineageConfidence === 'unknown').length;
253
+ const lineageConfidence = sortedViews.length === 0 || unknownViewCount > 0 ? 'unknown' : weakViewCount > 0 ? 'weak' : 'strong';
254
+ const snapshot = {
255
+ schemaVersion: '1',
256
+ snapshotId: `gov-exp:${inputs.workspaceHash}:${inputs.asOf}`,
257
+ asOf: inputs.asOf,
258
+ summary: {
259
+ primaryAttention,
260
+ headlineCode: `govexp.headline.${primaryAttention}`,
261
+ reasonCode,
262
+ nextActionCode,
263
+ },
264
+ readiness: buildReadiness(inputs, approvalDecisionCount),
265
+ activity: { primaryAttention, categories },
266
+ trustContext: {
267
+ environmentContext: inputs.environmentContext,
268
+ lineageTransparency: { confidence: lineageConfidence, strongViewCount, weakViewCount, unknownViewCount },
269
+ },
270
+ dataQuality,
271
+ };
272
+ if (!Value.Check(GovernanceExperienceSnapshotSchema, snapshot))
273
+ throw new Error('invalid_governance_experience_snapshot');
274
+ return snapshot;
275
+ }
276
+ //# sourceMappingURL=governance-experience.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"governance-experience.js","sourceRoot":"","sources":["../../src/runtime-v2/governance-experience.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAEhD,OAAO,EACL,gCAAgC,EAChC,kCAAkC,GACnC,MAAM,qCAAqC,CAAC;AAG7C,0FAA0F;AAC1F,MAAM,CAAC,MAAM,iCAAiC,GAAG,EAAE,CAAC;AACpD,MAAM,CAAC,MAAM,wCAAwC,GAAG,EAAE,CAAC;AAC3D;;;;;GAKG;AACH,MAAM,4BAA4B,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAC7E,6FAA6F;AAC7F,MAAM,cAAc,GAA0C,CAAC,SAAS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C,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;IAE/H,MAAM,QAAQ,GAAiC;QAC7C,aAAa,EAAE,GAAG;QAClB,UAAU,EAAE,WAAW,MAAM,CAAC,aAAa,IAAI,MAAM,CAAC,IAAI,EAAE;QAC5D,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,OAAO,EAAE;YACP,gBAAgB;YAChB,YAAY,EAAE,mBAAmB,gBAAgB,EAAE;YACnD,UAAU;YACV,cAAc;SACf;QACD,SAAS,EAAE,cAAc,CAAC,MAAM,EAAE,qBAAqB,CAAC;QACxD,QAAQ,EAAE,EAAE,gBAAgB,EAAE,UAAU,EAAE;QAC1C,YAAY,EAAE;YACZ,kBAAkB,EAAE,MAAM,CAAC,kBAAkB;YAC7C,mBAAmB,EAAE,EAAE,UAAU,EAAE,iBAAiB,EAAE,eAAe,EAAE,aAAa,EAAE,gBAAgB,EAAE;SACzG;QACD,WAAW;KACZ,CAAC;IACF,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,kCAAkC,EAAE,QAAQ,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC1H,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -19,10 +19,21 @@ export { PDErrorCategorySchema } from './error-categories.js';
19
19
  export { GovernanceChannelSchema, LineageConfidenceSchema, SourceRefSchema, RevisionIdentitySchema, PrincipleFactSchema, TaskFactSchema, RunnerVerdictFactSchema, ApprovalFactSchema, ActivationFactSchema, DerivedRelationFactSchema, TimelineEventSchema, DataQualityIssueSchema, LineageContextSchema, GovernanceFactsSchema, PrincipleStateSchema, ProcessViewSchema, AutomationViewSchema, AttentionItemSchema, AttentionViewSchema, ActivationSummarySchema, OwnerGovernanceSummarySchema, DataQualitySchema, OwnerGovernanceViewSchema } from './governance-projection-contract.js';
20
20
  export type { GovernanceChannel, LineageConfidence, SourceRef, RevisionIdentity, PrincipleFact, TaskFact, RunnerVerdictFact, ApprovalFact, ActivationFact, DerivedRelationFact, TimelineEvent, DataQualityIssue, LineageContext, GovernanceFacts, PrincipleState, ProcessView, AutomationView, AttentionItem, AttentionView, ActivationSummary, OwnerGovernanceSummary, DataQuality, OwnerGovernanceView } from './governance-projection-contract.js';
21
21
  export { GOVERNANCE_HEADLINE_CODES, deriveOwnerGovernanceView } from './governance-projection.js';
22
+ export { GovernancePrimaryAttentionSchema, GovernanceExperienceReasonCodeSchema, GovernanceExperienceNextActionCodeSchema, WorkspaceEnvironmentSchema, EnvironmentContextInputSchema, SourceAvailabilityInputSchema, UnlinkedRecordGroupSchema, OwnerConfigSnapshotSchema, GovernanceViewInputSchema, FrontierEvidenceSchema, GovernanceExperienceInputsSchema, GovernanceActionKindSchema, GovernanceObservedAuthoritySchema, GovernanceActionReadinessSchema, OwnerGovernanceReadinessSchema, GovernanceActivityCategorySchema, GovernanceActivityItemSchema, GovernanceActivityCategorySummarySchema, GovernanceActivitySnapshotSchema, GovernanceLineageTransparencySchema, GovernanceTrustContextSchema, GovernanceDataQualityIssueGroupSchema, GovernanceDataQualitySchema, GovernanceExperienceSummarySchema, GovernanceExperienceSnapshotSchema, } from './governance-experience-contract.js';
23
+ export type { WorkspaceEnvironment, EnvironmentContextInput, SourceAvailabilityInput, UnlinkedRecordGroup, OwnerConfigSnapshot, GovernanceViewInput, FrontierEvidence, GovernanceExperienceInputs, GovernanceActionKind, GovernanceObservedAuthority, GovernanceActionReadiness, OwnerGovernanceReadiness, GovernancePrimaryAttention, GovernanceActivityCategory, GovernanceActivityItem, GovernanceActivityCategorySummary, GovernanceActivitySnapshot, GovernanceLineageTransparency, GovernanceTrustContext, GovernanceDataQualityIssueGroup, GovernanceDataQuality, GovernanceExperienceReasonCode, GovernanceExperienceNextActionCode, GovernanceExperienceSummary, GovernanceExperienceSnapshot, } from './governance-experience-contract.js';
24
+ export { GOVERNANCE_EXPERIENCE_ITEMS_LIMIT, GOVERNANCE_EXPERIENCE_ISSUE_GROUPS_LIMIT, deriveGovernanceExperienceSnapshot } from './governance-experience.js';
25
+ export { RECEIPT_RETENTION_POLICY_DAYS } from './receipt-coverage.js';
26
+ export type { ReceiptSourceStatus, ReceiptValidationStatus, ReceiptEvidenceCoverage } from './receipt-coverage.js';
27
+ export { OWNER_IDENTITY_SCHEMA_VERSION, OWNER_IDENTITY_FILE_NAME, resolveOwnerIdentity, readOwnerIdentityFile, writeOwnerIdentityFile, deleteOwnerIdentityFile, ownerIdentityFilePath, defaultOwnerIdentityHomeDir, } from './owner-identity.js';
28
+ export type { OwnerIdentityRecord, OwnerIdentitySource, OwnerIdentityResolved, OwnerIdentityFileResult, OwnerIdentityDeleteResult } from './owner-identity.js';
29
+ export { generateTelemetrySecretHex, isValidTelemetrySecretHex, bucketDateFromTime, isValidBucketDate, deriveWorkspaceScopeId, deriveDailyTelemetryId, isValidDailyTelemetryId, TELEMETRY_SECRET_BYTES, DAILY_TELEMETRY_ID_HEX_LENGTH, WORKSPACE_SCOPE_ID_HEX_LENGTH, } from './product-telemetry/daily-identity.js';
30
+ export { ProductTelemetrySnapshotV1Schema, PRODUCT_TELEMETRY_SNAPSHOT_SCHEMA_VERSION, PRODUCT_TELEMETRY_CONSENT_VERSION, PRODUCT_TELEMETRY_HOST_KINDS, PRODUCT_TELEMETRY_TOP_LEVEL_FIELDS, PROHIBITED_TELEMETRY_FIELD_TOKENS, PRODUCT_TELEMETRY_PD_VERSION_MAX_LENGTH, assertTelemetrySchemaPrivacy, validateProductTelemetrySnapshot, buildProductTelemetrySnapshot, } from './product-telemetry/snapshot-contract.js';
31
+ export type { TelemetryFact } from './product-telemetry/snapshot-contract.js';
32
+ export type { ProductTelemetryHostKind, ProductTelemetrySnapshotV1, ProductTelemetryMilestoneInput, ProductTelemetryReliabilityInput, BuildSnapshotInput, SnapshotValidationResult, } from './product-telemetry/snapshot-contract.js';
22
33
  export { AgentCapabilityRequirementsSchema, AgentTimeoutPolicySchema, AgentRetryPolicySchema, AgentSpecSchema } from './agent-spec.js';
23
34
  export { SchemaVersionRefSchema, RuntimeV2SchemaVersionSchema } from './schema-version.js';
24
35
  export { RuntimeKindSchema, RuntimeCapabilitiesSchema, RuntimeHealthSchema, RunHandleSchema, RunExecutionStatusSchema, RunStatusSchema, ContextItemSchema, AgentSpecRefSchema, WorkflowRefSchema, TaskRefSchema, StartRunInputSchema, StructuredRunOutputSchema, RuntimeArtifactRefSchema } from './runtime-protocol.js';
25
- export { PDTaskStatusSchema, TaskRecordSchema, DiagnosticianTaskRecordSchema } from './task-status.js';
36
+ export { PDTaskStatusSchema, TaskRecordSchema, DiagnosticianTaskRecordSchema, PD_TASK_STATUSES, isPDTaskStatus } from './task-status.js';
26
37
  export { RuntimeSelectionCriteriaSchema } from './runtime-selector.js';
27
38
  export { HistoryQueryEntrySchema, TrajectoryLocateQuerySchema, TrajectoryCandidateSchema, TrajectoryLocateResultSchema, HistoryQueryResultSchema, DiagnosisTargetSchema, ContextPayloadSchema, DiagnosticianContextPayloadSchema, ToolCallEntrySchema, PainContextSchema, FullTracePayloadSchema, FullTracePayloadV2Schema, TraceSourceRefSchema, TraceTimelineEntrySchema, TraceEventKindSchema, SourceRefKindSchema, validateFullTracePayload, sanitizeFullTracePayload, buildFullTraceTimeline, buildSourceRefs, checkFullTracePayloadSchema, TRACE_EVENT_KINDS, SOURCE_REF_KINDS } from './context-payload.js';
28
39
  export { refineFullTrace, REFINED_EVENT_KINDS, SEVERITY_LEVELS } from './trace-refiner.js';
@@ -32,7 +43,7 @@ export type { TraceRefinerAgentObjective, TraceRefinerAgentMode, TraceRefinerAge
32
43
  export { buildGoldenTraceCandidate } from './golden-trace-candidate-builder.js';
33
44
  export type { GoldenTraceCandidateDecision, GoldenTraceCandidateBuilderInput, GoldenTraceCandidateRefusal, GoldenTraceCandidateCreated, GoldenTraceCandidateBuilderResult } from './golden-trace-candidate-builder.js';
34
45
  export { DiagnosticianViolatedPrincipleSchema, DiagnosticianEvidenceSchema, RecommendationKindSchema, DiagnosticianRecommendationSchema, DiagnosticianOutputV1Schema, DiagnosticianInvocationInputSchema } from './diagnostician-output.js';
35
- export { PrincipleStatusSchema, PrinciplePrioritySchema, PrincipleScopeSchema, PrincipleEvaluabilitySchema, RuleStatusSchema, RuleTypeSchema, ImplementationLifecycleStateSchema, ImplementationTypeSchema, SampleClassificationSchema, PrincipleSchema, RuleSchema, ImplementationSchema, PrincipleDependencySchema, PrincipleValueMetricsSchema, PrincipleEventTypeSchema, PrincipleLifecycleEventSchema, PrincipleTreeStoreSchema, EvidenceChainStateSchema, EvidenceChainRecordSchema, EvidenceChainResponseSchema } from './types/index.js';
46
+ export { PRINCIPLE_STATUSES, PrincipleStatusSchema, PrinciplePrioritySchema, PrincipleScopeSchema, PrincipleEvaluabilitySchema, RuleStatusSchema, RuleTypeSchema, ImplementationLifecycleStateSchema, ImplementationTypeSchema, SampleClassificationSchema, PrincipleSchema, RuleSchema, ImplementationSchema, PrincipleDependencySchema, PrincipleValueMetricsSchema, PrincipleEventTypeSchema, PrincipleLifecycleEventSchema, PrincipleTreeStoreSchema, EvidenceChainStateSchema, EvidenceChainRecordSchema, EvidenceChainResponseSchema } from './types/index.js';
36
47
  export { PersistenceActionSchema, HygieneStatsSchema } from './types/hygiene-types.js';
37
48
  export { RuntimeTruthSchema, AnalyticsTruthSchema, TrendMetricsSchema } from './types/runtime-summary-types.js';
38
49
  export { EventTypeSchema, EventCategorySchema, EventLogEntrySchema, ToolCallEventDataSchema, PainSignalEventDataSchema, RulePromotionEventDataSchema, GovernanceActionEventDataSchema, HookExecutionEventDataSchema, GateBlockEventDataSchema, GateBypassEventDataSchema, EvolutionTaskEventDataSchema, EmpathyRollbackEventDataSchema, HeartbeatDiagnosisEventDataSchema, DiagnosisTaskEventDataSchema, DiagnosticianReportEventDataSchema, PrincipleCandidateEventDataSchema, RuleEnforcedEventDataSchema, RuleHostEvaluatedEventDataSchema, RuleHostBlockedEventDataSchema, RuleHostRequireApprovalEventDataSchema, RuleHostAutoCorrectProposedEventDataSchema, RuleHostAutoCorrectAppliedEventDataSchema, RuntimeV2PromptActivationsInjectedEventDataSchema, RuleHostUnhealthyEventDataSchema, RuleHostSkippedEventDataSchema, ToolCallStatsSchema, ErrorStatsSchema, EmpathyEventStatsSchema, GfiStatsSchema, EventEvolutionStatsSchema, HookStatsSchema, DailyStatsSchema } from './types/event-types.js';
@@ -111,6 +122,7 @@ export { OpenClawCliRuntimeAdapter } from './adapter/index.js';
111
122
  export type { OpenClawCliRuntimeAdapterOptions } from './adapter/openclaw-cli-runtime-adapter.js';
112
123
  export { PiAiRuntimeAdapter } from './adapter/index.js';
113
124
  export type { PiAiRuntimeAdapterConfig } from './adapter/pi-ai-runtime-adapter.js';
125
+ export { builtinPiAiProviderIds, isBuiltinPiAiProvider } from './adapter/pi-ai-catalog.js';
114
126
  export { PrincipleTreeLedgerAdapter } from './adapter/principle-tree-ledger-adapter.js';
115
127
  export { summarizeConversationWindow } from './diagnostician-prompt-builder.js';
116
128
  export type { PromptInput, PromptBuildResult } from './diagnostician-prompt-builder.js';
@@ -161,10 +173,10 @@ export { StalledDiagnosticianTaskReadModel } from './stalled-diagnostician-task-
161
173
  export type { StalledDiagnosticianTaskInfo, StalledDiagnosticianTaskReadModelOptions } from './stalled-diagnostician-task-read-model.js';
162
174
  export { computeOverallStatus, boundedEvidence, safeStringify, truncateReason, makeDeterministicDiagnosticianOutput, recommendNextIssue } from './synthetic-baseline.js';
163
175
  export type { SyntheticBaselineSummary, SyntheticBaselineStage, SyntheticBaselineStageName, SyntheticBaselineFailStage, SyntheticBaselineOptions } from './synthetic-baseline.js';
164
- export { VALID_CATEGORIES, validateFeatureFlagRaw, computeEffectiveFlags, DEFAULT_FEATURE_FLAGS, } from './feature-flags/index.js';
165
- export type { FeatureFlagCategory, FeatureFlagDefinition, EffectiveFeatureFlags, ValidationResult as FeatureFlagValidationResult, ValidationResultOk as FeatureFlagValidationResultOk, ValidationResultErr as FeatureFlagValidationResultErr, } from './feature-flags/index.js';
166
- export { CORE_PRINCIPLES, CORE_PRINCIPLE_IDS, isCorePrincipleId, getCorePrinciple, CorePrincipleSchema, stripFabricatedCorePrincipleIds, } from './core-principles/index.js';
167
- export type { CorePrinciple } from './core-principles/index.js';
176
+ export { VALID_CATEGORIES, validateFeatureFlagRaw, computeEffectiveFlags, DEFAULT_FEATURE_FLAGS, FEATURE_FLAG_ALIASES, normalizeFeatureFlagOverrides, } from './feature-flags/index.js';
177
+ export type { FeatureFlagCategory, FeatureFlagDefinition, EffectiveFeatureFlags, FeatureFlagOverrideNormalization, ValidationResult as FeatureFlagValidationResult, ValidationResultOk as FeatureFlagValidationResultOk, ValidationResultErr as FeatureFlagValidationResultErr, } from './feature-flags/index.js';
178
+ export { CORE_PRINCIPLES, CORE_PRINCIPLE_IDS, getFoundationalPrinciples, getOperatingPrinciples, isCorePrincipleId, getCorePrinciple, CorePrincipleSchema, stripFabricatedCorePrincipleIds, formatCorePrinciplesList, buildCoreAxiomBlock, } from './core-principles/index.js';
179
+ export type { CorePrinciple, CorePrincipleLayer, CorePrincipleScope, } from './core-principles/index.js';
168
180
  export { VALID_SURFACE_KINDS, VALID_MVP_CATEGORIES, PLUGIN_SURFACE_REGISTRY, validateSurfaceRegistry, getEnabledSurfaces, getSurfacesByCategory, getSurfacesByKind, findUnclassifiedSurfaces, } from './feature-flags/index.js';
169
181
  export type { SurfaceKind, MvpCategory, PluginSurfaceEntry, SurfaceRegistryValidationResult, } from './feature-flags/index.js';
170
182
  export { checkSurfaceGuard, getSurfaceIdForHook, getSurfaceIdForService, isSurfaceEnabled, guardHook, guardService, __resetSurfaceGuardSkipLogStateForTests, } from './feature-flags/index.js';
@@ -292,8 +304,8 @@ export { ownerRetryNeedsHumanReviewTask } from './internalization/owner-retry.js
292
304
  export type { OwnerRetryOutcome } from './internalization/owner-retry.js';
293
305
  export { createRuntimeStateHandle } from './runtime-state-handle.js';
294
306
  export type { RuntimeStateHandle } from './runtime-state-handle.js';
295
- export type { ActivationRiskLevel, ActivationActor, RolloutActivationDecision, DispatchInput, ActivationDecision, PIArtifactSnapshot, ActivationArtifactReadModel, ActivationStatusRecord, ActivationStateReadModel, ActivationDecisionRecord, ActivationDecisionSubject, ActivationDecisionKind, ActivationControlState, GlobalRuleCodePause, PromotionEvidenceSnapshot, PromotionFailedCheck, PromotionReadinessResult, OwnerPromotionActor, OwnerPromotionRequest, PromotionCommitInput, OwnerPromotionResult, RuleCodeOwnerDecisionServiceDeps, PromotionCheckId, PromotionReadinessCheck, PromotionReadinessEvaluationInput, PromotionReadinessReaderDeps, RuleCodeSafetySample, RuleCodeSafetyCircuitState, RuleCodeSafetyTripReason, HostLivenessContract, WriterInput, WriterResult, CanActivateResult, ChannelWriter, ApprovalStatus, ApprovalRecord, ApprovalEnqueueInput, ApprovalFilter, ApprovalDecisionResult, ApprovalQueueStore, ApprovalListFilter, ApprovalStats, ApprovalListResult, ArtifactLineageIdentity, ApprovalWithContext, ConfidenceLabel, } from './activation/index.js';
296
- export { LOW_RISK_CHANNELS, isArtifactRevisionOf, HIGH_RISK_CHANNEL_MAP, makeIdempotencyKey, isLowRiskChannel, getChannelRiskLevel, ActivationDispatcher, PromptWriter, DeferArchiveWriter, RuleHostWriter, extractEvidenceRefs, extractPrincipleId, MemoryActivationStateStore, MemoryArtifactReadModel, SqliteActivationStateStore, SqliteActivationSafetyStore, RuleCodeOwnerDecisionService, REQUIRED_PROMOTION_CHECK_IDS, evaluateRuleCodePromotionReadiness, PromotionReadinessReader, evaluateRuleCodeSafetyCircuit, initialRuleCodeSafetyCircuitState, collectOpenClawPromotionChecks, summarizeRuleCodeShadowEvents, AUTO_PROMOTION_CONFIDENCE_THRESHOLD, AUTO_PROMOTABLE_CHANNELS, ApprovalQueue, decideAutoPromotion, MemoryApprovalQueueStore, SqliteApprovalQueueStore, mapConfidenceToLabel, RUNTIME_V2_PRINCIPLE_BUDGET, isArtifactRecord, filterPromptActivations, resolvePrincipleFromArtifact, trimToBudget, renderPrinciplesToDirectives, createProductionGateDeps, ApprovalCompletionService, } from './activation/index.js';
307
+ export type { ActivationRiskLevel, ActivationActor, RolloutActivationDecision, DispatchInput, ActivationDecision, PIArtifactSnapshot, ActivationArtifactReadModel, ActivationStatusRecord, ActivationStateReadModel, ActivationDecisionRecord, ActivationDecisionSubject, ActivationDecisionKind, ActivationControlState, GlobalRuleCodePause, PromotionEvidenceSnapshot, PromotionFailedCheck, PromotionReadinessResult, OwnerPromotionActor, OwnerPromotionRequest, PromotionCommitInput, OwnerPromotionResult, RuleCodeOwnerDecisionServiceDeps, PromotionCheckId, PromotionReadinessCheck, PromotionReadinessEvaluationInput, PromotionReadinessReaderDeps, RuleCodeSafetySample, RuleCodeSafetyCircuitState, RuleCodeSafetyTripReason, HostLivenessContract, WriterInput, WriterResult, CanActivateResult, ChannelWriter, ApprovalStatus, ApprovalRecord, ApprovalEnqueueInput, ApprovalFilter, ApprovalDecisionResult, ApprovalQueueStore, ApprovalListFilter, ApprovalStats, ApprovalListResult, ArtifactLineageIdentity, ApprovalWithContext, ConfidenceLabel, BuildPromotionEvidenceSnapshotInput, PromotionEvidenceOwnerIdentity, } from './activation/index.js';
308
+ export { LOW_RISK_CHANNELS, isArtifactRevisionOf, HIGH_RISK_CHANNEL_MAP, makeIdempotencyKey, isLowRiskChannel, getChannelRiskLevel, ActivationDispatcher, PromptWriter, DeferArchiveWriter, RuleHostWriter, extractEvidenceRefs, extractPrincipleId, MemoryActivationStateStore, MemoryArtifactReadModel, SqliteActivationStateStore, SqliteActivationSafetyStore, RuleCodeOwnerDecisionService, REQUIRED_PROMOTION_CHECK_IDS, evaluateRuleCodePromotionReadiness, PromotionReadinessReader, evaluateRuleCodeSafetyCircuit, initialRuleCodeSafetyCircuitState, collectOpenClawPromotionChecks, summarizeRuleCodeShadowEvents, AUTO_PROMOTION_CONFIDENCE_THRESHOLD, AUTO_PROMOTABLE_CHANNELS, ApprovalQueue, decideAutoPromotion, MemoryApprovalQueueStore, SqliteApprovalQueueStore, mapConfidenceToLabel, RUNTIME_V2_PRINCIPLE_BUDGET, isArtifactRecord, filterPromptActivations, resolvePrincipleFromArtifact, trimToBudget, renderPrinciplesToDirectives, createProductionGateDeps, ApprovalCompletionService, buildPromotionEvidenceSnapshot, computeArtifactDigest, normalizeOwnerIdentity, } from './activation/index.js';
297
309
  export type { ActivatedPrinciple, PromptActivationReaderResult, ApprovalCompletionInput, ApprovalCompletionResult, } from './activation/index.js';
298
310
  export { DEFAULT_GFI_POLICY, applyFriction, applyDecay, applyRelief, classifyGfiStage, createGfiSnapshot, } from './gfi/index.js';
299
311
  export type { GfiState, GfiEvent, GfiPolicy, GfiStage, GfiSource, GfiSnapshot, } from './gfi/index.js';