create-principles-disciple 1.94.0 → 1.96.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 (530) hide show
  1. package/console/dist/server/config/WorkspaceConfigStore.js +2 -1
  2. package/console/dist/server/config/pd-config-store.d.ts +33 -0
  3. package/console/dist/server/config/pd-config-store.js +196 -0
  4. package/console/dist/server/index.js +19 -4
  5. package/console/dist/server/models/EvidenceChainConsoleModel.d.ts +0 -2
  6. package/console/dist/server/models/EvidenceChainConsoleModel.js +36 -2
  7. package/console/dist/server/models/HealthCheckModel.js +5 -3
  8. package/console/dist/server/models/IntentDecisionModel.d.ts +66 -0
  9. package/console/dist/server/models/IntentDecisionModel.js +207 -0
  10. package/console/dist/server/models/IntentPageModel.d.ts +52 -0
  11. package/console/dist/server/models/IntentPageModel.js +292 -0
  12. package/console/dist/server/models/PrinciplesConsoleModel.d.ts +2 -0
  13. package/console/dist/server/models/PrinciplesConsoleModel.js +37 -1
  14. package/console/dist/server/models/WorkspaceService.d.ts +0 -28
  15. package/console/dist/server/models/WorkspaceService.js +0 -115
  16. package/console/dist/server/routes/config.js +55 -1
  17. package/console/dist/server/routes/intent-decisions.d.ts +33 -0
  18. package/console/dist/server/routes/intent-decisions.js +499 -0
  19. package/console/dist/server/routes/intent.d.ts +7 -0
  20. package/console/dist/server/routes/intent.js +223 -0
  21. package/console/dist/server/routes/principles.js +67 -1
  22. package/console/dist/server/routes/update.d.ts +0 -1
  23. package/console/dist/server/routes/update.js +14 -11
  24. package/console/dist/types.d.ts +1 -0
  25. package/console/dist/ui/App.js +2 -60
  26. package/console/dist/ui/api.d.ts +58 -18
  27. package/console/dist/ui/api.js +78 -6
  28. package/console/dist/ui/components/layout/app-sidebar.js +13 -12
  29. package/console/dist/ui/components/ui/badge.d.ts +1 -1
  30. package/console/dist/ui/components/ui/button.d.ts +1 -1
  31. package/console/dist/ui/components/ui/shiny-text.d.ts +28 -0
  32. package/console/dist/ui/components/ui/shiny-text.js +46 -0
  33. package/console/dist/ui/i18n/en.json +306 -3
  34. package/console/dist/ui/i18n/zh-CN.json +306 -3
  35. package/console/dist/ui/pages/activation/ActivationPage.js +2 -1
  36. package/console/dist/ui/pages/control-center/AgentCard.d.ts +31 -0
  37. package/console/dist/ui/pages/control-center/AgentCard.js +156 -0
  38. package/console/dist/ui/pages/control-center/AgentGroup.d.ts +26 -0
  39. package/console/dist/ui/pages/control-center/AgentGroup.js +38 -0
  40. package/console/dist/ui/pages/control-center/ControlCenterPage.js +103 -41
  41. package/console/dist/ui/pages/control-center/EmpathyObserverCostHint.d.ts +28 -0
  42. package/console/dist/ui/pages/control-center/EmpathyObserverCostHint.js +38 -0
  43. package/console/dist/ui/pages/control-center/WorkflowDiagram.d.ts +17 -0
  44. package/console/dist/ui/pages/control-center/WorkflowDiagram.js +55 -0
  45. package/console/dist/ui/pages/debt/DebtPage.js +219 -2
  46. package/console/dist/ui/pages/focus/FocusPage.js +2 -1
  47. package/console/dist/ui/pages/intent/IntentOnboarding.d.ts +67 -0
  48. package/console/dist/ui/pages/intent/IntentOnboarding.js +289 -0
  49. package/console/dist/ui/pages/intent/IntentPage.d.ts +1 -0
  50. package/console/dist/ui/pages/intent/IntentPage.js +258 -0
  51. package/console/dist/ui/pages/pain/PainPage.js +234 -4
  52. package/console/dist/ui/pages/pain/pain-card-helpers.d.ts +75 -0
  53. package/console/dist/ui/pages/pain/pain-card-helpers.js +78 -0
  54. package/console/dist/ui/pages/principles/PrinciplesPage.js +2 -1
  55. package/console/dist/ui/utils/agent-metadata.d.ts +58 -0
  56. package/console/dist/ui/utils/agent-metadata.js +275 -0
  57. package/console/dist/ui/utils/control-center-helpers.d.ts +19 -0
  58. package/console/dist/ui/utils/control-center-helpers.js +37 -0
  59. package/console/dist/ui/utils/validators.d.ts +200 -0
  60. package/console/dist/ui/utils/validators.js +563 -0
  61. package/console/dist/web/assets/app.css +498 -3
  62. package/console/dist/web/assets/app.js +5063 -1418
  63. package/console/package.json +3 -0
  64. package/core/dist/principle-tree-ledger.d.ts +55 -4
  65. package/core/dist/principle-tree-ledger.d.ts.map +1 -1
  66. package/core/dist/principle-tree-ledger.js +472 -13
  67. package/core/dist/principle-tree-ledger.js.map +1 -1
  68. package/core/dist/prompt-builder/__tests__/prompt-builder-core.test.js +58 -0
  69. package/core/dist/prompt-builder/__tests__/prompt-builder-core.test.js.map +1 -1
  70. package/core/dist/prompt-builder/empathy-keyword-matching.d.ts.map +1 -1
  71. package/core/dist/prompt-builder/empathy-keyword-matching.js +9 -6
  72. package/core/dist/prompt-builder/empathy-keyword-matching.js.map +1 -1
  73. package/core/dist/prompt-builder/size-guard.d.ts +1 -0
  74. package/core/dist/prompt-builder/size-guard.d.ts.map +1 -1
  75. package/core/dist/prompt-builder/size-guard.js +21 -0
  76. package/core/dist/prompt-builder/size-guard.js.map +1 -1
  77. package/core/dist/prompt-builder/types.d.ts +2 -0
  78. package/core/dist/prompt-builder/types.d.ts.map +1 -1
  79. package/core/dist/runtime-v2/__tests__/architecture-regression.test.js +143 -65
  80. package/core/dist/runtime-v2/__tests__/architecture-regression.test.js.map +1 -1
  81. package/core/dist/runtime-v2/__tests__/evaluator-runner-vslice-v2.test.js +85 -7
  82. package/core/dist/runtime-v2/__tests__/evaluator-runner-vslice-v2.test.js.map +1 -1
  83. package/core/dist/runtime-v2/__tests__/evidence-chain-intent-tension.test.d.ts +2 -0
  84. package/core/dist/runtime-v2/__tests__/evidence-chain-intent-tension.test.d.ts.map +1 -0
  85. package/core/dist/runtime-v2/__tests__/evidence-chain-intent-tension.test.js +284 -0
  86. package/core/dist/runtime-v2/__tests__/evidence-chain-intent-tension.test.js.map +1 -0
  87. package/core/dist/runtime-v2/__tests__/golden-trace-replay-validator.test.js +70 -0
  88. package/core/dist/runtime-v2/__tests__/golden-trace-replay-validator.test.js.map +1 -1
  89. package/core/dist/runtime-v2/__tests__/golden-trace.test.js +136 -1
  90. package/core/dist/runtime-v2/__tests__/golden-trace.test.js.map +1 -1
  91. package/core/dist/runtime-v2/__tests__/pain-signal-bridge-result-shaping.test.js +105 -0
  92. package/core/dist/runtime-v2/__tests__/pain-signal-bridge-result-shaping.test.js.map +1 -1
  93. package/core/dist/runtime-v2/__tests__/pain-signal-observability.test.js +7 -5
  94. package/core/dist/runtime-v2/__tests__/pain-signal-observability.test.js.map +1 -1
  95. package/core/dist/runtime-v2/__tests__/pi-artifact-store.test.js +11 -0
  96. package/core/dist/runtime-v2/__tests__/pi-artifact-store.test.js.map +1 -1
  97. package/core/dist/runtime-v2/__tests__/proven-channel-baseline.test.js +15 -2
  98. package/core/dist/runtime-v2/__tests__/proven-channel-baseline.test.js.map +1 -1
  99. package/core/dist/runtime-v2/__tests__/schema-float-precision.test.d.ts +2 -0
  100. package/core/dist/runtime-v2/__tests__/schema-float-precision.test.d.ts.map +1 -0
  101. package/core/dist/runtime-v2/__tests__/schema-float-precision.test.js +290 -0
  102. package/core/dist/runtime-v2/__tests__/schema-float-precision.test.js.map +1 -0
  103. package/core/dist/runtime-v2/__tests__/schema-orphan-detection.test.d.ts +2 -0
  104. package/core/dist/runtime-v2/__tests__/schema-orphan-detection.test.d.ts.map +1 -0
  105. package/core/dist/runtime-v2/__tests__/schema-orphan-detection.test.js +158 -0
  106. package/core/dist/runtime-v2/__tests__/schema-orphan-detection.test.js.map +1 -0
  107. package/core/dist/runtime-v2/__tests__/v2-adversarial-cases.test.d.ts +2 -0
  108. package/core/dist/runtime-v2/__tests__/v2-adversarial-cases.test.d.ts.map +1 -0
  109. package/core/dist/runtime-v2/__tests__/v2-adversarial-cases.test.js +211 -0
  110. package/core/dist/runtime-v2/__tests__/v2-adversarial-cases.test.js.map +1 -0
  111. package/core/dist/runtime-v2/activation/__tests__/approval-store-extended.test.js +15 -1
  112. package/core/dist/runtime-v2/activation/__tests__/approval-store-extended.test.js.map +1 -1
  113. package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-state-store-fk.test.d.ts +2 -0
  114. package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-state-store-fk.test.d.ts.map +1 -0
  115. package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-state-store-fk.test.js +62 -0
  116. package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-state-store-fk.test.js.map +1 -0
  117. package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-state-store.test.js +12 -2
  118. package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-state-store.test.js.map +1 -1
  119. package/core/dist/runtime-v2/activation/__tests__/sqlite-approval-store-fk.test.d.ts +2 -0
  120. package/core/dist/runtime-v2/activation/__tests__/sqlite-approval-store-fk.test.d.ts.map +1 -0
  121. package/core/dist/runtime-v2/activation/__tests__/sqlite-approval-store-fk.test.js +56 -0
  122. package/core/dist/runtime-v2/activation/__tests__/sqlite-approval-store-fk.test.js.map +1 -0
  123. package/core/dist/runtime-v2/activation/__tests__/sqlite-approval-store.test.js +8 -0
  124. package/core/dist/runtime-v2/activation/__tests__/sqlite-approval-store.test.js.map +1 -1
  125. package/core/dist/runtime-v2/activation/__tests__/story-a-acceptance.test.js +20 -0
  126. package/core/dist/runtime-v2/activation/__tests__/story-a-acceptance.test.js.map +1 -1
  127. package/core/dist/runtime-v2/activation/sqlite-activation-state-store.d.ts.map +1 -1
  128. package/core/dist/runtime-v2/activation/sqlite-activation-state-store.js +6 -0
  129. package/core/dist/runtime-v2/activation/sqlite-activation-state-store.js.map +1 -1
  130. package/core/dist/runtime-v2/activation/sqlite-approval-store.d.ts.map +1 -1
  131. package/core/dist/runtime-v2/activation/sqlite-approval-store.js +86 -32
  132. package/core/dist/runtime-v2/activation/sqlite-approval-store.js.map +1 -1
  133. package/core/dist/runtime-v2/activation/writers/__tests__/rule-host-writer.test.js +158 -1
  134. package/core/dist/runtime-v2/activation/writers/__tests__/rule-host-writer.test.js.map +1 -1
  135. package/core/dist/runtime-v2/activation/writers/rule-host-writer.d.ts +11 -0
  136. package/core/dist/runtime-v2/activation/writers/rule-host-writer.d.ts.map +1 -1
  137. package/core/dist/runtime-v2/activation/writers/rule-host-writer.js +55 -11
  138. package/core/dist/runtime-v2/activation/writers/rule-host-writer.js.map +1 -1
  139. package/core/dist/runtime-v2/diagnostician/__tests__/diag-rootcause-output.test.js +134 -15
  140. package/core/dist/runtime-v2/diagnostician/__tests__/diag-rootcause-output.test.js.map +1 -1
  141. package/core/dist/runtime-v2/diagnostician/__tests__/intent-tension-schema.test.d.ts +18 -0
  142. package/core/dist/runtime-v2/diagnostician/__tests__/intent-tension-schema.test.d.ts.map +1 -0
  143. package/core/dist/runtime-v2/diagnostician/__tests__/intent-tension-schema.test.js +251 -0
  144. package/core/dist/runtime-v2/diagnostician/__tests__/intent-tension-schema.test.js.map +1 -0
  145. package/core/dist/runtime-v2/diagnostician/__tests__/rootcause-prompt-builder.test.js +73 -0
  146. package/core/dist/runtime-v2/diagnostician/__tests__/rootcause-prompt-builder.test.js.map +1 -1
  147. package/core/dist/runtime-v2/diagnostician/diag-rootcause-output.d.ts +98 -0
  148. package/core/dist/runtime-v2/diagnostician/diag-rootcause-output.d.ts.map +1 -1
  149. package/core/dist/runtime-v2/diagnostician/diag-rootcause-output.js +131 -0
  150. package/core/dist/runtime-v2/diagnostician/diag-rootcause-output.js.map +1 -1
  151. package/core/dist/runtime-v2/diagnostician/rootcause-prompt-builder.d.ts +8 -0
  152. package/core/dist/runtime-v2/diagnostician/rootcause-prompt-builder.d.ts.map +1 -1
  153. package/core/dist/runtime-v2/diagnostician/rootcause-prompt-builder.js +66 -3
  154. package/core/dist/runtime-v2/diagnostician/rootcause-prompt-builder.js.map +1 -1
  155. package/core/dist/runtime-v2/diagnostician-output.d.ts +23 -0
  156. package/core/dist/runtime-v2/diagnostician-output.d.ts.map +1 -1
  157. package/core/dist/runtime-v2/diagnostician-output.js +16 -0
  158. package/core/dist/runtime-v2/diagnostician-output.js.map +1 -1
  159. package/core/dist/runtime-v2/diagnostician-prompt-builder.d.ts +32 -0
  160. package/core/dist/runtime-v2/diagnostician-prompt-builder.d.ts.map +1 -1
  161. package/core/dist/runtime-v2/diagnostician-prompt-builder.js.map +1 -1
  162. package/core/dist/runtime-v2/evidence-triage/source-descriptors.d.ts +1 -1
  163. package/core/dist/runtime-v2/evidence-triage/source-descriptors.js +1 -1
  164. package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.js +23 -0
  165. package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.js.map +1 -1
  166. package/core/dist/runtime-v2/feature-flags/__tests__/intent-engineering-flag.test.d.ts +2 -0
  167. package/core/dist/runtime-v2/feature-flags/__tests__/intent-engineering-flag.test.d.ts.map +1 -0
  168. package/core/dist/runtime-v2/feature-flags/__tests__/intent-engineering-flag.test.js +30 -0
  169. package/core/dist/runtime-v2/feature-flags/__tests__/intent-engineering-flag.test.js.map +1 -0
  170. package/core/dist/runtime-v2/feature-flags/__tests__/rulecode-context-v2-flag.test.d.ts +2 -0
  171. package/core/dist/runtime-v2/feature-flags/__tests__/rulecode-context-v2-flag.test.d.ts.map +1 -0
  172. package/core/dist/runtime-v2/feature-flags/__tests__/rulecode-context-v2-flag.test.js +74 -0
  173. package/core/dist/runtime-v2/feature-flags/__tests__/rulecode-context-v2-flag.test.js.map +1 -0
  174. package/core/dist/runtime-v2/feature-flags/__tests__/surface-guard-policy.test.d.ts +2 -0
  175. package/core/dist/runtime-v2/feature-flags/__tests__/surface-guard-policy.test.d.ts.map +1 -0
  176. package/core/dist/runtime-v2/feature-flags/__tests__/surface-guard-policy.test.js +246 -0
  177. package/core/dist/runtime-v2/feature-flags/__tests__/surface-guard-policy.test.js.map +1 -0
  178. package/core/dist/runtime-v2/feature-flags/feature-flag-contract.d.ts.map +1 -1
  179. package/core/dist/runtime-v2/feature-flags/feature-flag-contract.js +9 -0
  180. package/core/dist/runtime-v2/feature-flags/feature-flag-contract.js.map +1 -1
  181. package/core/dist/runtime-v2/feature-flags/index.d.ts +2 -0
  182. package/core/dist/runtime-v2/feature-flags/index.d.ts.map +1 -1
  183. package/core/dist/runtime-v2/feature-flags/index.js +2 -0
  184. package/core/dist/runtime-v2/feature-flags/index.js.map +1 -1
  185. package/core/dist/runtime-v2/feature-flags/plugin-surface-registry.d.ts.map +1 -1
  186. package/core/dist/runtime-v2/feature-flags/plugin-surface-registry.js +0 -9
  187. package/core/dist/runtime-v2/feature-flags/plugin-surface-registry.js.map +1 -1
  188. package/{plugin/dist/core/surface-guard.d.ts → core/dist/runtime-v2/feature-flags/surface-guard-policy.d.ts} +15 -5
  189. package/core/dist/runtime-v2/feature-flags/surface-guard-policy.d.ts.map +1 -0
  190. package/{plugin/dist/core/surface-guard.js → core/dist/runtime-v2/feature-flags/surface-guard-policy.js} +14 -2
  191. package/core/dist/runtime-v2/feature-flags/surface-guard-policy.js.map +1 -0
  192. package/core/dist/runtime-v2/golden-trace-replay-validator.js +1 -1
  193. package/core/dist/runtime-v2/golden-trace-replay-validator.js.map +1 -1
  194. package/core/dist/runtime-v2/golden-trace.d.ts +19 -3
  195. package/core/dist/runtime-v2/golden-trace.d.ts.map +1 -1
  196. package/core/dist/runtime-v2/golden-trace.js +2 -0
  197. package/core/dist/runtime-v2/golden-trace.js.map +1 -1
  198. package/core/dist/runtime-v2/index.d.ts +21 -4
  199. package/core/dist/runtime-v2/index.d.ts.map +1 -1
  200. package/core/dist/runtime-v2/index.js +21 -3
  201. package/core/dist/runtime-v2/index.js.map +1 -1
  202. package/core/dist/runtime-v2/intent/__tests__/intent-decision-record.test.d.ts +2 -0
  203. package/core/dist/runtime-v2/intent/__tests__/intent-decision-record.test.d.ts.map +1 -0
  204. package/core/dist/runtime-v2/intent/__tests__/intent-decision-record.test.js +185 -0
  205. package/core/dist/runtime-v2/intent/__tests__/intent-decision-record.test.js.map +1 -0
  206. package/core/dist/runtime-v2/intent/__tests__/intent-doc-version.test.d.ts +2 -0
  207. package/core/dist/runtime-v2/intent/__tests__/intent-doc-version.test.d.ts.map +1 -0
  208. package/core/dist/runtime-v2/intent/__tests__/intent-doc-version.test.js +88 -0
  209. package/core/dist/runtime-v2/intent/__tests__/intent-doc-version.test.js.map +1 -0
  210. package/core/dist/runtime-v2/intent/__tests__/intent-doc.test.d.ts +2 -0
  211. package/core/dist/runtime-v2/intent/__tests__/intent-doc.test.d.ts.map +1 -0
  212. package/core/dist/runtime-v2/intent/__tests__/intent-doc.test.js +181 -0
  213. package/core/dist/runtime-v2/intent/__tests__/intent-doc.test.js.map +1 -0
  214. package/core/dist/runtime-v2/intent/__tests__/intent-friction-block.test.d.ts +2 -0
  215. package/core/dist/runtime-v2/intent/__tests__/intent-friction-block.test.d.ts.map +1 -0
  216. package/core/dist/runtime-v2/intent/__tests__/intent-friction-block.test.js +168 -0
  217. package/core/dist/runtime-v2/intent/__tests__/intent-friction-block.test.js.map +1 -0
  218. package/core/dist/runtime-v2/intent/__tests__/intent-patch-proposal.test.d.ts +2 -0
  219. package/core/dist/runtime-v2/intent/__tests__/intent-patch-proposal.test.d.ts.map +1 -0
  220. package/core/dist/runtime-v2/intent/__tests__/intent-patch-proposal.test.js +121 -0
  221. package/core/dist/runtime-v2/intent/__tests__/intent-patch-proposal.test.js.map +1 -0
  222. package/core/dist/runtime-v2/intent/index.d.ts +8 -0
  223. package/core/dist/runtime-v2/intent/index.d.ts.map +1 -0
  224. package/core/dist/runtime-v2/intent/index.js +8 -0
  225. package/core/dist/runtime-v2/intent/index.js.map +1 -0
  226. package/core/dist/runtime-v2/intent/intent-browser.d.ts +23 -0
  227. package/core/dist/runtime-v2/intent/intent-browser.d.ts.map +1 -0
  228. package/core/dist/runtime-v2/intent/intent-browser.js +21 -0
  229. package/core/dist/runtime-v2/intent/intent-browser.js.map +1 -0
  230. package/core/dist/runtime-v2/intent/intent-decision-record.d.ts +125 -0
  231. package/core/dist/runtime-v2/intent/intent-decision-record.d.ts.map +1 -0
  232. package/core/dist/runtime-v2/intent/intent-decision-record.js +21 -0
  233. package/core/dist/runtime-v2/intent/intent-decision-record.js.map +1 -0
  234. package/core/dist/runtime-v2/intent/intent-doc-reader-port.d.ts +95 -0
  235. package/core/dist/runtime-v2/intent/intent-doc-reader-port.d.ts.map +1 -0
  236. package/core/dist/runtime-v2/intent/intent-doc-reader-port.js +43 -0
  237. package/core/dist/runtime-v2/intent/intent-doc-reader-port.js.map +1 -0
  238. package/core/dist/runtime-v2/intent/intent-doc-version.d.ts +28 -0
  239. package/core/dist/runtime-v2/intent/intent-doc-version.d.ts.map +1 -0
  240. package/core/dist/runtime-v2/intent/intent-doc-version.js +21 -0
  241. package/core/dist/runtime-v2/intent/intent-doc-version.js.map +1 -0
  242. package/core/dist/runtime-v2/intent/intent-doc.d.ts +35 -0
  243. package/core/dist/runtime-v2/intent/intent-doc.d.ts.map +1 -0
  244. package/core/dist/runtime-v2/intent/intent-doc.js +158 -0
  245. package/core/dist/runtime-v2/intent/intent-doc.js.map +1 -0
  246. package/core/dist/runtime-v2/intent/intent-friction-block.d.ts +63 -0
  247. package/core/dist/runtime-v2/intent/intent-friction-block.d.ts.map +1 -0
  248. package/core/dist/runtime-v2/intent/intent-friction-block.js +129 -0
  249. package/core/dist/runtime-v2/intent/intent-friction-block.js.map +1 -0
  250. package/core/dist/runtime-v2/intent/intent-hash.d.ts +2 -0
  251. package/core/dist/runtime-v2/intent/intent-hash.d.ts.map +1 -0
  252. package/core/dist/runtime-v2/intent/intent-hash.js +10 -0
  253. package/core/dist/runtime-v2/intent/intent-hash.js.map +1 -0
  254. package/core/dist/runtime-v2/intent/intent-patch-proposal.d.ts +42 -0
  255. package/core/dist/runtime-v2/intent/intent-patch-proposal.d.ts.map +1 -0
  256. package/core/dist/runtime-v2/intent/intent-patch-proposal.js +81 -0
  257. package/core/dist/runtime-v2/intent/intent-patch-proposal.js.map +1 -0
  258. package/core/dist/runtime-v2/internalization/__tests__/__fixtures__/intent-tension-cases.d.ts +54 -0
  259. package/core/dist/runtime-v2/internalization/__tests__/__fixtures__/intent-tension-cases.d.ts.map +1 -0
  260. package/core/dist/runtime-v2/internalization/__tests__/__fixtures__/intent-tension-cases.js +219 -0
  261. package/core/dist/runtime-v2/internalization/__tests__/__fixtures__/intent-tension-cases.js.map +1 -0
  262. package/core/dist/runtime-v2/internalization/__tests__/artificer-prompt-builder.test.js +41 -1
  263. package/core/dist/runtime-v2/internalization/__tests__/artificer-prompt-builder.test.js.map +1 -1
  264. package/core/dist/runtime-v2/internalization/__tests__/artificer-rule-output.test.js +130 -2
  265. package/core/dist/runtime-v2/internalization/__tests__/artificer-rule-output.test.js.map +1 -1
  266. package/core/dist/runtime-v2/internalization/__tests__/behavior-example-pack.test.d.ts +2 -0
  267. package/core/dist/runtime-v2/internalization/__tests__/behavior-example-pack.test.d.ts.map +1 -0
  268. package/core/dist/runtime-v2/internalization/__tests__/behavior-example-pack.test.js +228 -0
  269. package/core/dist/runtime-v2/internalization/__tests__/behavior-example-pack.test.js.map +1 -0
  270. package/core/dist/runtime-v2/internalization/__tests__/diag-chain-e2e.test.js +41 -11
  271. package/core/dist/runtime-v2/internalization/__tests__/diag-chain-e2e.test.js.map +1 -1
  272. package/core/dist/runtime-v2/internalization/__tests__/diag-rootcause-intent-tension.test.d.ts +2 -0
  273. package/core/dist/runtime-v2/internalization/__tests__/diag-rootcause-intent-tension.test.d.ts.map +1 -0
  274. package/core/dist/runtime-v2/internalization/__tests__/diag-rootcause-intent-tension.test.js +360 -0
  275. package/core/dist/runtime-v2/internalization/__tests__/diag-rootcause-intent-tension.test.js.map +1 -0
  276. package/core/dist/runtime-v2/internalization/__tests__/diag-router-intent-tension.test.d.ts +2 -0
  277. package/core/dist/runtime-v2/internalization/__tests__/diag-router-intent-tension.test.d.ts.map +1 -0
  278. package/core/dist/runtime-v2/internalization/__tests__/diag-router-intent-tension.test.js +333 -0
  279. package/core/dist/runtime-v2/internalization/__tests__/diag-router-intent-tension.test.js.map +1 -0
  280. package/core/dist/runtime-v2/internalization/__tests__/intent-tension-cases.test.d.ts +2 -0
  281. package/core/dist/runtime-v2/internalization/__tests__/intent-tension-cases.test.d.ts.map +1 -0
  282. package/core/dist/runtime-v2/internalization/__tests__/intent-tension-cases.test.js +113 -0
  283. package/core/dist/runtime-v2/internalization/__tests__/intent-tension-cases.test.js.map +1 -0
  284. package/core/dist/runtime-v2/internalization/__tests__/refiner-sandbox-wrapper.test.js +135 -0
  285. package/core/dist/runtime-v2/internalization/__tests__/refiner-sandbox-wrapper.test.js.map +1 -1
  286. package/core/dist/runtime-v2/internalization/__tests__/rule-context-v2.test.d.ts +2 -0
  287. package/core/dist/runtime-v2/internalization/__tests__/rule-context-v2.test.d.ts.map +1 -0
  288. package/core/dist/runtime-v2/internalization/__tests__/rule-context-v2.test.js +449 -0
  289. package/core/dist/runtime-v2/internalization/__tests__/rule-context-v2.test.js.map +1 -0
  290. package/core/dist/runtime-v2/internalization/adversarial-case.d.ts.map +1 -1
  291. package/core/dist/runtime-v2/internalization/adversarial-case.js +24 -0
  292. package/core/dist/runtime-v2/internalization/adversarial-case.js.map +1 -1
  293. package/core/dist/runtime-v2/internalization/artificer-output.d.ts +10 -0
  294. package/core/dist/runtime-v2/internalization/artificer-output.d.ts.map +1 -1
  295. package/core/dist/runtime-v2/internalization/artificer-output.js +45 -0
  296. package/core/dist/runtime-v2/internalization/artificer-output.js.map +1 -1
  297. package/core/dist/runtime-v2/internalization/artificer-prompt-builder.d.ts +2 -2
  298. package/core/dist/runtime-v2/internalization/artificer-prompt-builder.d.ts.map +1 -1
  299. package/core/dist/runtime-v2/internalization/artificer-prompt-builder.js +7 -2
  300. package/core/dist/runtime-v2/internalization/artificer-prompt-builder.js.map +1 -1
  301. package/core/dist/runtime-v2/internalization/behavior-example-pack.d.ts +66 -0
  302. package/core/dist/runtime-v2/internalization/behavior-example-pack.d.ts.map +1 -0
  303. package/core/dist/runtime-v2/internalization/behavior-example-pack.js +183 -0
  304. package/core/dist/runtime-v2/internalization/behavior-example-pack.js.map +1 -0
  305. package/core/dist/runtime-v2/internalization/diag-rootcause-runner.d.ts +13 -0
  306. package/core/dist/runtime-v2/internalization/diag-rootcause-runner.d.ts.map +1 -1
  307. package/core/dist/runtime-v2/internalization/diag-rootcause-runner.js +42 -0
  308. package/core/dist/runtime-v2/internalization/diag-rootcause-runner.js.map +1 -1
  309. package/core/dist/runtime-v2/internalization/diag-router-runner.d.ts.map +1 -1
  310. package/core/dist/runtime-v2/internalization/diag-router-runner.js +27 -0
  311. package/core/dist/runtime-v2/internalization/diag-router-runner.js.map +1 -1
  312. package/core/dist/runtime-v2/internalization/evaluator-output.d.ts +8 -0
  313. package/core/dist/runtime-v2/internalization/evaluator-output.d.ts.map +1 -1
  314. package/core/dist/runtime-v2/internalization/evaluator-output.js +10 -0
  315. package/core/dist/runtime-v2/internalization/evaluator-output.js.map +1 -1
  316. package/core/dist/runtime-v2/internalization/evaluator-runner.d.ts +17 -0
  317. package/core/dist/runtime-v2/internalization/evaluator-runner.d.ts.map +1 -1
  318. package/core/dist/runtime-v2/internalization/evaluator-runner.js +118 -24
  319. package/core/dist/runtime-v2/internalization/evaluator-runner.js.map +1 -1
  320. package/core/dist/runtime-v2/internalization/refiner-sandbox-wrapper.d.ts.map +1 -1
  321. package/core/dist/runtime-v2/internalization/refiner-sandbox-wrapper.js +1 -1
  322. package/core/dist/runtime-v2/internalization/refiner-sandbox-wrapper.js.map +1 -1
  323. package/core/dist/runtime-v2/internalization/rule-context-v2.d.ts +61 -0
  324. package/core/dist/runtime-v2/internalization/rule-context-v2.d.ts.map +1 -0
  325. package/core/dist/runtime-v2/internalization/rule-context-v2.js +301 -0
  326. package/core/dist/runtime-v2/internalization/rule-context-v2.js.map +1 -0
  327. package/core/dist/runtime-v2/internalization/rule-host-contracts.d.ts +9 -0
  328. package/core/dist/runtime-v2/internalization/rule-host-contracts.d.ts.map +1 -1
  329. package/core/dist/runtime-v2/internalization/v2-adversarial-cases.d.ts +55 -0
  330. package/core/dist/runtime-v2/internalization/v2-adversarial-cases.d.ts.map +1 -0
  331. package/core/dist/runtime-v2/internalization/v2-adversarial-cases.js +131 -0
  332. package/core/dist/runtime-v2/internalization/v2-adversarial-cases.js.map +1 -0
  333. package/core/dist/runtime-v2/pain-signal-observability.d.ts.map +1 -1
  334. package/core/dist/runtime-v2/pain-signal-observability.js +280 -56
  335. package/core/dist/runtime-v2/pain-signal-observability.js.map +1 -1
  336. package/core/dist/runtime-v2/pain-signal-runtime-factory.d.ts +12 -0
  337. package/core/dist/runtime-v2/pain-signal-runtime-factory.d.ts.map +1 -1
  338. package/core/dist/runtime-v2/pain-signal-runtime-factory.js +1 -1
  339. package/core/dist/runtime-v2/pain-signal-runtime-factory.js.map +1 -1
  340. package/core/dist/runtime-v2/pain-to-principle-service.d.ts +6 -0
  341. package/core/dist/runtime-v2/pain-to-principle-service.d.ts.map +1 -1
  342. package/core/dist/runtime-v2/pain-to-principle-service.js +2 -0
  343. package/core/dist/runtime-v2/pain-to-principle-service.js.map +1 -1
  344. package/core/dist/runtime-v2/principle-tree/ledger-codec.js.map +1 -1
  345. package/core/dist/runtime-v2/proven-channel-baseline.js +1 -1
  346. package/core/dist/runtime-v2/proven-channel-baseline.js.map +1 -1
  347. package/core/dist/runtime-v2/risk/__tests__/risk-calculator-policy.test.d.ts +2 -0
  348. package/core/dist/runtime-v2/risk/__tests__/risk-calculator-policy.test.d.ts.map +1 -0
  349. package/core/dist/runtime-v2/risk/__tests__/risk-calculator-policy.test.js +95 -0
  350. package/core/dist/runtime-v2/risk/__tests__/risk-calculator-policy.test.js.map +1 -0
  351. package/core/dist/runtime-v2/risk/index.d.ts +7 -0
  352. package/core/dist/runtime-v2/risk/index.d.ts.map +1 -0
  353. package/core/dist/runtime-v2/risk/index.js +6 -0
  354. package/core/dist/runtime-v2/risk/index.js.map +1 -0
  355. package/core/dist/runtime-v2/risk/risk-calculator-policy.d.ts +18 -0
  356. package/core/dist/runtime-v2/risk/risk-calculator-policy.d.ts.map +1 -0
  357. package/core/dist/runtime-v2/risk/risk-calculator-policy.js +47 -0
  358. package/core/dist/runtime-v2/risk/risk-calculator-policy.js.map +1 -0
  359. package/core/dist/runtime-v2/store/artifact/__tests__/sqlite-pi-artifact-store-fk.test.d.ts +2 -0
  360. package/core/dist/runtime-v2/store/artifact/__tests__/sqlite-pi-artifact-store-fk.test.d.ts.map +1 -0
  361. package/core/dist/runtime-v2/store/artifact/__tests__/sqlite-pi-artifact-store-fk.test.js +55 -0
  362. package/core/dist/runtime-v2/store/artifact/__tests__/sqlite-pi-artifact-store-fk.test.js.map +1 -0
  363. package/core/dist/runtime-v2/store/artifact/sqlite-pi-artifact-store.d.ts.map +1 -1
  364. package/core/dist/runtime-v2/store/artifact/sqlite-pi-artifact-store.js +6 -0
  365. package/core/dist/runtime-v2/store/artifact/sqlite-pi-artifact-store.js.map +1 -1
  366. package/core/dist/runtime-v2/store/intent/__tests__/sqlite-intent-decision-store.test.d.ts +2 -0
  367. package/core/dist/runtime-v2/store/intent/__tests__/sqlite-intent-decision-store.test.d.ts.map +1 -0
  368. package/core/dist/runtime-v2/store/intent/__tests__/sqlite-intent-decision-store.test.js +272 -0
  369. package/core/dist/runtime-v2/store/intent/__tests__/sqlite-intent-decision-store.test.js.map +1 -0
  370. package/core/dist/runtime-v2/store/intent/__tests__/sqlite-intent-doc-version-store.test.d.ts +2 -0
  371. package/core/dist/runtime-v2/store/intent/__tests__/sqlite-intent-doc-version-store.test.d.ts.map +1 -0
  372. package/core/dist/runtime-v2/store/intent/__tests__/sqlite-intent-doc-version-store.test.js +83 -0
  373. package/core/dist/runtime-v2/store/intent/__tests__/sqlite-intent-doc-version-store.test.js.map +1 -0
  374. package/core/dist/runtime-v2/store/intent/index.d.ts +7 -0
  375. package/core/dist/runtime-v2/store/intent/index.d.ts.map +1 -0
  376. package/core/dist/runtime-v2/store/intent/index.js +6 -0
  377. package/core/dist/runtime-v2/store/intent/index.js.map +1 -0
  378. package/core/dist/runtime-v2/store/intent/sqlite-intent-decision-store.d.ts +51 -0
  379. package/core/dist/runtime-v2/store/intent/sqlite-intent-decision-store.d.ts.map +1 -0
  380. package/core/dist/runtime-v2/store/intent/sqlite-intent-decision-store.js +306 -0
  381. package/core/dist/runtime-v2/store/intent/sqlite-intent-decision-store.js.map +1 -0
  382. package/core/dist/runtime-v2/store/intent/sqlite-intent-doc-version-store.d.ts +28 -0
  383. package/core/dist/runtime-v2/store/intent/sqlite-intent-doc-version-store.d.ts.map +1 -0
  384. package/core/dist/runtime-v2/store/intent/sqlite-intent-doc-version-store.js +88 -0
  385. package/core/dist/runtime-v2/store/intent/sqlite-intent-doc-version-store.js.map +1 -0
  386. package/core/dist/runtime-v2/store/sqlite-connection-pragma.test.js +14 -3
  387. package/core/dist/runtime-v2/store/sqlite-connection-pragma.test.js.map +1 -1
  388. package/core/dist/runtime-v2/store/sqlite-connection-schema-version.test.d.ts +2 -0
  389. package/core/dist/runtime-v2/store/sqlite-connection-schema-version.test.d.ts.map +1 -0
  390. package/core/dist/runtime-v2/store/sqlite-connection-schema-version.test.js +72 -0
  391. package/core/dist/runtime-v2/store/sqlite-connection-schema-version.test.js.map +1 -0
  392. package/core/dist/runtime-v2/store/sqlite-connection.d.ts +27 -0
  393. package/core/dist/runtime-v2/store/sqlite-connection.d.ts.map +1 -1
  394. package/core/dist/runtime-v2/store/sqlite-connection.js +138 -12
  395. package/core/dist/runtime-v2/store/sqlite-connection.js.map +1 -1
  396. package/core/dist/runtime-v2/thinking-models/__tests__/thinking-models-policy.test.d.ts +2 -0
  397. package/core/dist/runtime-v2/thinking-models/__tests__/thinking-models-policy.test.d.ts.map +1 -0
  398. package/core/dist/runtime-v2/thinking-models/__tests__/thinking-models-policy.test.js +149 -0
  399. package/core/dist/runtime-v2/thinking-models/__tests__/thinking-models-policy.test.js.map +1 -0
  400. package/core/dist/runtime-v2/thinking-models/index.d.ts +3 -0
  401. package/core/dist/runtime-v2/thinking-models/index.d.ts.map +1 -0
  402. package/core/dist/runtime-v2/thinking-models/index.js +3 -0
  403. package/core/dist/runtime-v2/thinking-models/index.js.map +1 -0
  404. package/core/dist/runtime-v2/thinking-models/thinking-models-policy.d.ts +73 -0
  405. package/core/dist/runtime-v2/thinking-models/thinking-models-policy.d.ts.map +1 -0
  406. package/core/dist/runtime-v2/thinking-models/thinking-models-policy.js +227 -0
  407. package/core/dist/runtime-v2/thinking-models/thinking-models-policy.js.map +1 -0
  408. package/core/dist/runtime-v2/tools/__tests__/artificer-l2-tool-contract.test.js +40 -1
  409. package/core/dist/runtime-v2/tools/__tests__/artificer-l2-tool-contract.test.js.map +1 -1
  410. package/core/dist/runtime-v2/tools/artificer-l2-tool-contract.d.ts.map +1 -1
  411. package/core/dist/runtime-v2/tools/artificer-l2-tool-contract.js +28 -1
  412. package/core/dist/runtime-v2/tools/artificer-l2-tool-contract.js.map +1 -1
  413. package/core/dist/runtime-v2/tools/artificer-output-typebox.d.ts +3 -0
  414. package/core/dist/runtime-v2/tools/artificer-output-typebox.d.ts.map +1 -1
  415. package/core/dist/runtime-v2/tools/artificer-output-typebox.js +3 -0
  416. package/core/dist/runtime-v2/tools/artificer-output-typebox.js.map +1 -1
  417. package/core/dist/runtime-v2/types/event-payload.d.ts +1 -20
  418. package/core/dist/runtime-v2/types/event-payload.d.ts.map +1 -1
  419. package/core/dist/runtime-v2/types/event-payload.js +0 -12
  420. package/core/dist/runtime-v2/types/event-payload.js.map +1 -1
  421. package/core/dist/runtime-v2/types/event-types.d.ts +5 -34
  422. package/core/dist/runtime-v2/types/event-types.d.ts.map +1 -1
  423. package/core/dist/runtime-v2/types/event-types.js +0 -19
  424. package/core/dist/runtime-v2/types/event-types.js.map +1 -1
  425. package/core/dist/runtime-v2/types/evidence-chain-contract.d.ts +63 -0
  426. package/core/dist/runtime-v2/types/evidence-chain-contract.d.ts.map +1 -1
  427. package/core/dist/runtime-v2/types/evidence-chain-contract.js +234 -9
  428. package/core/dist/runtime-v2/types/evidence-chain-contract.js.map +1 -1
  429. package/core/dist/runtime-v2/types/index.d.ts +5 -5
  430. package/core/dist/runtime-v2/types/index.d.ts.map +1 -1
  431. package/core/dist/runtime-v2/types/index.js +5 -3
  432. package/core/dist/runtime-v2/types/index.js.map +1 -1
  433. package/core/dist/runtime-v2/types/ledger-store.d.ts +30 -30
  434. package/core/dist/runtime-v2/types/ledger-store.d.ts.map +1 -1
  435. package/core/dist/runtime-v2/types/ledger-store.js +10 -5
  436. package/core/dist/runtime-v2/types/ledger-store.js.map +1 -1
  437. package/core/dist/workflow-funnel-loader.d.ts +2 -2
  438. package/core/dist/workflow-funnel-loader.d.ts.map +1 -1
  439. package/core/package.json +4 -0
  440. package/dist/installer.d.ts.map +1 -1
  441. package/dist/installer.js +16 -0
  442. package/dist/installer.js.map +1 -1
  443. package/package.json +1 -1
  444. package/pd-cli/dist/commands/__tests__/intent-flag-wiring.test.d.ts +9 -0
  445. package/pd-cli/dist/commands/__tests__/intent-flag-wiring.test.d.ts.map +1 -0
  446. package/pd-cli/dist/commands/__tests__/intent-flag-wiring.test.js +237 -0
  447. package/pd-cli/dist/commands/__tests__/intent-flag-wiring.test.js.map +1 -0
  448. package/pd-cli/dist/commands/intent.d.ts +76 -0
  449. package/pd-cli/dist/commands/intent.d.ts.map +1 -0
  450. package/pd-cli/dist/commands/intent.js +411 -0
  451. package/pd-cli/dist/commands/intent.js.map +1 -0
  452. package/pd-cli/dist/commands/runtime-init.d.ts +43 -0
  453. package/pd-cli/dist/commands/runtime-init.d.ts.map +1 -0
  454. package/pd-cli/dist/commands/runtime-init.js +264 -0
  455. package/pd-cli/dist/commands/runtime-init.js.map +1 -0
  456. package/pd-cli/dist/index.js +25 -0
  457. package/pd-cli/dist/index.js.map +1 -1
  458. package/pd-cli/dist/services/demo-story-a-runner.d.ts.map +1 -1
  459. package/pd-cli/dist/services/demo-story-a-runner.js +6 -0
  460. package/pd-cli/dist/services/demo-story-a-runner.js.map +1 -1
  461. package/pd-cli/package.json +1 -0
  462. package/plugin/dist/commands/pain.js +2 -0
  463. package/plugin/dist/core/behavior-example-pack-assembler.d.ts +43 -0
  464. package/plugin/dist/core/behavior-example-pack-assembler.js +247 -0
  465. package/plugin/dist/core/control-ui-db.d.ts +11 -0
  466. package/plugin/dist/core/control-ui-db.js +40 -16
  467. package/plugin/dist/core/event-log.js +0 -5
  468. package/plugin/dist/core/intent-doc-reader-adapter.d.ts +36 -0
  469. package/plugin/dist/core/intent-doc-reader-adapter.js +76 -0
  470. package/plugin/dist/core/intent-doc-reader.d.ts +89 -0
  471. package/plugin/dist/core/intent-doc-reader.js +210 -0
  472. package/plugin/dist/core/principle-tree-ledger.d.ts +27 -79
  473. package/plugin/dist/core/principle-tree-ledger.js +39 -524
  474. package/plugin/dist/core/reflection/reflection-context.d.ts +2 -2
  475. package/plugin/dist/core/rule-context-assembler.d.ts +45 -0
  476. package/plugin/dist/core/rule-context-assembler.js +148 -0
  477. package/plugin/dist/core/thinking-models.d.ts +12 -57
  478. package/plugin/dist/core/thinking-models.js +18 -224
  479. package/plugin/dist/core/trajectory-types.d.ts +18 -0
  480. package/plugin/dist/core/trajectory.d.ts +50 -2
  481. package/plugin/dist/core/trajectory.js +435 -254
  482. package/plugin/dist/core/workspace-context.d.ts +2 -3
  483. package/plugin/dist/hooks/gate.js +59 -2
  484. package/plugin/dist/hooks/pain.js +5 -0
  485. package/plugin/dist/hooks/prompt-helpers.d.ts +19 -1
  486. package/plugin/dist/hooks/prompt-helpers.js +39 -2
  487. package/plugin/dist/hooks/prompt-types.d.ts +8 -0
  488. package/plugin/dist/hooks/prompt.js +81 -21
  489. package/plugin/dist/index.d.ts +3 -1
  490. package/plugin/dist/index.js +10 -6
  491. package/plugin/dist/service/runtime-summary-service.js +1 -1
  492. package/plugin/dist/service/subagent-workflow/workflow-store.d.ts +14 -0
  493. package/plugin/dist/service/subagent-workflow/workflow-store.js +91 -2
  494. package/plugin/dist/types/event-types.d.ts +1 -1
  495. package/plugin/package.json +6 -3
  496. package/plugin/scripts/acceptance-test.mjs +3 -3
  497. package/plugin/dist/core/evolution-migration.d.ts +0 -5
  498. package/plugin/dist/core/evolution-migration.js +0 -65
  499. package/plugin/dist/core/principle-tree-ledger-adapter.d.ts +0 -32
  500. package/plugin/dist/core/principle-tree-ledger-adapter.js +0 -125
  501. package/plugin/dist/core/risk-calculator.d.ts +0 -22
  502. package/plugin/dist/core/risk-calculator.js +0 -88
  503. package/plugin/dist/core/rule-host-helpers.d.ts +0 -8
  504. package/plugin/dist/core/rule-host-helpers.js +0 -7
  505. package/plugin/dist/core/rule-host-types.d.ts +0 -7
  506. package/plugin/dist/core/rule-host-types.js +0 -7
  507. package/plugin/dist/core/schema/db-types.d.ts +0 -11
  508. package/plugin/dist/core/schema/db-types.js +0 -5
  509. package/plugin/dist/core/schema/index.d.ts +0 -17
  510. package/plugin/dist/core/schema/index.js +0 -15
  511. package/plugin/dist/core/schema/migration-runner.d.ts +0 -53
  512. package/plugin/dist/core/schema/migration-runner.js +0 -170
  513. package/plugin/dist/core/schema/migrations/001-init-trajectory.d.ts +0 -6
  514. package/plugin/dist/core/schema/migrations/001-init-trajectory.js +0 -190
  515. package/plugin/dist/core/schema/migrations/002-init-central.d.ts +0 -5
  516. package/plugin/dist/core/schema/migrations/002-init-central.js +0 -108
  517. package/plugin/dist/core/schema/migrations/003-init-workflow.d.ts +0 -5
  518. package/plugin/dist/core/schema/migrations/003-init-workflow.js +0 -50
  519. package/plugin/dist/core/schema/migrations/004-add-thinking-and-gfi.d.ts +0 -8
  520. package/plugin/dist/core/schema/migrations/004-add-thinking-and-gfi.js +0 -66
  521. package/plugin/dist/core/schema/migrations/index.d.ts +0 -16
  522. package/plugin/dist/core/schema/migrations/index.js +0 -27
  523. package/plugin/dist/core/schema/schema-definitions.d.ts +0 -46
  524. package/plugin/dist/core/schema/schema-definitions.js +0 -599
  525. package/plugin/dist/service/central-database.d.ts +0 -138
  526. package/plugin/dist/service/central-database.js +0 -731
  527. package/plugin/dist/service/central-sync-service.d.ts +0 -8
  528. package/plugin/dist/service/central-sync-service.js +0 -71
  529. package/plugin/scripts/db-migrate.mjs +0 -170
  530. package/plugin/scripts/validate-live-path.ts +0 -462
@@ -0,0 +1,411 @@
1
+ /**
2
+ * pd intent — Owner-authored INTENT.md management (PRI-466).
3
+ *
4
+ * Subcommands:
5
+ * - init : create .principles/INTENT.{lang}.md from the canonical template
6
+ * - show : display a read-only summary of INTENT.{lang}.md (sections, hash, warnings)
7
+ *
8
+ * `init` is not gated by the intent_engineering flag — the Owner can
9
+ * initialise the intent doc at any time. `show` IS gated: flag-off returns
10
+ * a structured `flag_disabled` result without touching the filesystem,
11
+ * matching the Console backend contract.
12
+ *
13
+ * Bilingual: --lang zh-CN|en (default zh-CN) selects the intent doc language.
14
+ * File naming: INTENT.zh-CN.md / INTENT.en.md via getIntentFilename(lang).
15
+ *
16
+ * JSON mode is strict: --json outputs exactly one parseable JSON object on
17
+ * stdout (CLI Operator Gate rule 1). Failure paths include structured
18
+ * reason + nextAction (rule 6).
19
+ *
20
+ * ERR refs:
21
+ * - ERR-001 (no any): all types explicit
22
+ * - ERR-005 (no as bypass): no type casts on untrusted data
23
+ * - ERR-002 (graceful degradation with reason): all failure paths include
24
+ * reason + nextAction
25
+ * - ERR-009 (fail loud): missing file / flag-off surfaced explicitly
26
+ */
27
+ import * as fs from 'node:fs';
28
+ import * as path from 'node:path';
29
+ import { INTENT_MAX_BYTES, getIntentFilename, createIntentTemplate, parseIntentDocSections, computeIntentContentHash, validateIntentDocSections, isFeatureEnabled, } from '@principles/core/runtime-v2';
30
+ import { resolveWorkspaceDir } from '../resolve-workspace.js';
31
+ import { loadPdConfig, computeFlagsFromLoadResult } from '../services/pd-config-loader.js';
32
+ import { emitResult } from '../services/cli-output.js';
33
+ // ── Constants ────────────────────────────────────────────────────────────────
34
+ const INTENT_DIR = '.principles';
35
+ /**
36
+ * Parse and validate the --lang option.
37
+ *
38
+ * Returns:
39
+ * - 'zh-CN' | 'en' when value is undefined (default zh-CN) or a valid lang.
40
+ * - null when value is a non-empty string that is neither 'zh-CN' nor 'en'.
41
+ *
42
+ * rc-9: invalid values MUST NOT silently fall back to zh-CN — that would
43
+ * let a typo like `--lang zh` quietly write to INTENT.zh-CN.md. Callers
44
+ * emit a structured `invalid_lang` error when null is returned.
45
+ */
46
+ export function parseLang(value) {
47
+ if (value === undefined)
48
+ return 'zh-CN';
49
+ if (value === 'zh-CN' || value === 'en')
50
+ return value;
51
+ return null;
52
+ }
53
+ // ── Helpers ──────────────────────────────────────────────────────────────────
54
+ function getIntentFilePath(workspaceDir, lang) {
55
+ return path.join(workspaceDir, INTENT_DIR, getIntentFilename(lang));
56
+ }
57
+ function sectionsToRecord(sections) {
58
+ const record = {};
59
+ if (sections.why !== undefined) {
60
+ record.why = sections.why;
61
+ }
62
+ if (sections.desiredOutcome !== undefined) {
63
+ record.desiredOutcome = sections.desiredOutcome;
64
+ }
65
+ if (sections.nonNegotiables !== undefined) {
66
+ record.nonNegotiables = sections.nonNegotiables;
67
+ }
68
+ if (sections.stopEscalation !== undefined) {
69
+ record.stopEscalation = sections.stopEscalation;
70
+ }
71
+ if (sections.currentStrategicFocus !== undefined) {
72
+ record.currentStrategicFocus = sections.currentStrategicFocus;
73
+ }
74
+ return record;
75
+ }
76
+ function formatIntentShowText(o, filename) {
77
+ const lines = [];
78
+ lines.push(`${filename} — ${o.path}`);
79
+ lines.push(`Content hash: ${o.contentHash}`);
80
+ lines.push(`Last edited: ${o.lastEditedAt}`);
81
+ lines.push('');
82
+ if (o.sections) {
83
+ if (o.sections.why) {
84
+ lines.push('## 1. Why');
85
+ lines.push(o.sections.why);
86
+ lines.push('');
87
+ }
88
+ if (o.sections.desiredOutcome) {
89
+ lines.push('## 2. Desired Outcome');
90
+ lines.push(o.sections.desiredOutcome);
91
+ lines.push('');
92
+ }
93
+ if (o.sections.nonNegotiables) {
94
+ lines.push('## 3. Non-negotiables');
95
+ lines.push(o.sections.nonNegotiables);
96
+ lines.push('');
97
+ }
98
+ if (o.sections.stopEscalation) {
99
+ lines.push('## 4. Stop / Escalation');
100
+ lines.push(o.sections.stopEscalation);
101
+ lines.push('');
102
+ }
103
+ if (o.sections.currentStrategicFocus) {
104
+ lines.push('## 5. Current Strategic Focus');
105
+ lines.push(o.sections.currentStrategicFocus);
106
+ lines.push('');
107
+ }
108
+ }
109
+ if (o.warnings.length > 0) {
110
+ lines.push('Warnings:');
111
+ for (const w of o.warnings) {
112
+ lines.push(` [${w.code}] ${w.message}`);
113
+ }
114
+ }
115
+ else {
116
+ lines.push('No warnings.');
117
+ }
118
+ return lines.join('\n');
119
+ }
120
+ export async function handleIntentInit(opts) {
121
+ const lang = parseLang(opts.lang);
122
+ // rc-9: invalid --lang must not silently fall back. Emit structured error.
123
+ if (lang === null) {
124
+ const output = {
125
+ status: 'skipped',
126
+ path: '',
127
+ overwritten: false,
128
+ reason: 'invalid_lang',
129
+ nextAction: `--lang must be 'zh-CN' or 'en'. Received: ${opts.lang ?? ''}`,
130
+ };
131
+ emitResult(output, {
132
+ json: opts.json ?? false,
133
+ formatText: (o) => `Error: ${o.reason}\n→ ${o.nextAction}`,
134
+ });
135
+ process.exitCode = 1;
136
+ return;
137
+ }
138
+ // CLI Gate rule 4: --dry-run and --confirm must be mutually exclusive.
139
+ if (opts.dryRun && opts.confirm) {
140
+ const output = {
141
+ status: 'skipped',
142
+ path: '',
143
+ overwritten: false,
144
+ reason: 'flag_conflict',
145
+ nextAction: 'Use either --dry-run or --confirm, not both.',
146
+ };
147
+ emitResult(output, {
148
+ json: opts.json ?? false,
149
+ formatText: (o) => `Error: ${o.reason}\n→ ${o.nextAction}`,
150
+ });
151
+ process.exitCode = 1;
152
+ return;
153
+ }
154
+ // CLI Gate rule 6: workspace resolution inside try/catch so failures emit
155
+ // structured JSON with reason + nextAction instead of an uncaught stack trace.
156
+ let workspaceDir;
157
+ let filePath;
158
+ let dir;
159
+ try {
160
+ workspaceDir = resolveWorkspaceDir(opts.workspace);
161
+ filePath = getIntentFilePath(workspaceDir, lang);
162
+ dir = path.dirname(filePath);
163
+ }
164
+ catch (err) {
165
+ const reason = err instanceof Error ? err.message : String(err);
166
+ const output = {
167
+ status: 'read_error',
168
+ path: '',
169
+ overwritten: false,
170
+ reason,
171
+ nextAction: 'Provide a valid --workspace <path> argument.',
172
+ };
173
+ emitResult(output, {
174
+ json: opts.json ?? false,
175
+ formatText: (o) => `Error: ${o.reason}\n→ ${o.nextAction}`,
176
+ });
177
+ process.exitCode = 1;
178
+ return;
179
+ }
180
+ const filename = getIntentFilename(lang);
181
+ // CLI Gate rule 4: state-mutating command defaults to dry-run unless --confirm.
182
+ const isDryRun = opts.dryRun === true || opts.confirm !== true;
183
+ try {
184
+ if (fs.existsSync(filePath) && !opts.force) {
185
+ const output = {
186
+ status: 'skipped',
187
+ path: filePath,
188
+ overwritten: false,
189
+ reason: 'file_exists',
190
+ nextAction: `Use --force to overwrite: pd intent init --force --confirm --lang ${lang} --workspace "${workspaceDir}"`,
191
+ };
192
+ emitResult(output, {
193
+ json: opts.json ?? false,
194
+ formatText: (o) => `${filename} already exists at ${o.path}\n→ ${o.nextAction}`,
195
+ });
196
+ process.exitCode = 1;
197
+ return;
198
+ }
199
+ if (isDryRun) {
200
+ const output = {
201
+ status: 'dry_run',
202
+ path: filePath,
203
+ overwritten: opts.force === true,
204
+ reason: 'dry_run',
205
+ nextAction: `Confirm write: pd intent init --confirm --lang ${lang}${opts.force ? ' --force' : ''} --workspace "${workspaceDir}"`,
206
+ };
207
+ emitResult(output, {
208
+ json: opts.json ?? false,
209
+ formatText: (o) => `[dry-run] Would create ${filename} at ${o.path}${o.overwritten ? ' (overwritten)' : ''}\n→ ${o.nextAction}`,
210
+ });
211
+ return;
212
+ }
213
+ fs.mkdirSync(dir, { recursive: true });
214
+ fs.writeFileSync(filePath, createIntentTemplate(lang), 'utf8');
215
+ const output = {
216
+ status: 'ok',
217
+ path: filePath,
218
+ overwritten: opts.force === true,
219
+ };
220
+ emitResult(output, {
221
+ json: opts.json ?? false,
222
+ formatText: (o) => `Created ${filename} at ${o.path}${o.overwritten ? ' (overwritten)' : ''}\nNext: edit the file to declare your project intent, then run "pd intent show --lang ${lang}".`,
223
+ });
224
+ }
225
+ catch (err) {
226
+ const reason = err instanceof Error ? err.message : String(err);
227
+ // CLI Gate rule 1: route through emitResult for consistent IntentInitOutput shape.
228
+ const output = {
229
+ status: 'read_error',
230
+ path: filePath,
231
+ overwritten: false,
232
+ reason,
233
+ nextAction: `Check filesystem permissions for ${filePath}`,
234
+ };
235
+ emitResult(output, {
236
+ json: opts.json ?? false,
237
+ formatText: (o) => `Error: ${o.reason}\n→ ${o.nextAction}`,
238
+ });
239
+ process.exitCode = 1;
240
+ }
241
+ }
242
+ export async function handleIntentShow(opts) {
243
+ const lang = parseLang(opts.lang);
244
+ // rc-9: invalid --lang must not silently fall back. Emit structured error.
245
+ if (lang === null) {
246
+ const output = {
247
+ status: 'skipped',
248
+ flagEnabled: false,
249
+ found: false,
250
+ warnings: [],
251
+ reason: 'invalid_lang',
252
+ nextAction: `--lang must be 'zh-CN' or 'en'. Received: ${opts.lang ?? ''}`,
253
+ };
254
+ emitResult(output, {
255
+ json: opts.json ?? false,
256
+ formatText: (o) => `Error: ${o.reason}\n→ ${o.nextAction}`,
257
+ });
258
+ process.exitCode = 1;
259
+ return;
260
+ }
261
+ // CLI Gate rule 6: workspace resolution inside try/catch for structured errors.
262
+ let workspaceDir;
263
+ try {
264
+ workspaceDir = resolveWorkspaceDir(opts.workspace);
265
+ }
266
+ catch (err) {
267
+ const reason = err instanceof Error ? err.message : String(err);
268
+ const output = {
269
+ status: 'read_error',
270
+ flagEnabled: false,
271
+ found: false,
272
+ warnings: [],
273
+ reason,
274
+ nextAction: 'Provide a valid --workspace <path> argument.',
275
+ };
276
+ emitResult(output, {
277
+ json: opts.json ?? false,
278
+ formatText: (o) => `Error: ${o.reason}\n→ ${o.nextAction}`,
279
+ });
280
+ process.exitCode = 1;
281
+ return;
282
+ }
283
+ // Flag check — flag-off short-circuits without fs access
284
+ const configResult = loadPdConfig(workspaceDir);
285
+ const flagsResult = computeFlagsFromLoadResult(configResult);
286
+ const flagEnabled = isFeatureEnabled(flagsResult, 'intent_engineering');
287
+ const filename = getIntentFilename(lang);
288
+ if (!flagEnabled) {
289
+ const output = {
290
+ status: 'flag_disabled',
291
+ flagEnabled: false,
292
+ found: false,
293
+ warnings: [],
294
+ reason: 'flag_disabled',
295
+ nextAction: `Enable the intent_engineering feature flag in .pd/config.yaml to read ${filename}.`,
296
+ };
297
+ emitResult(output, {
298
+ json: opts.json ?? false,
299
+ formatText: (o) => `Intent Engineering is disabled (flag off).\n→ ${o.nextAction}`,
300
+ });
301
+ return;
302
+ }
303
+ const filePath = getIntentFilePath(workspaceDir, lang);
304
+ try {
305
+ if (!fs.existsSync(filePath)) {
306
+ const output = {
307
+ status: 'not_found',
308
+ flagEnabled: true,
309
+ found: false,
310
+ warnings: [],
311
+ reason: 'not_found',
312
+ nextAction: `Create ${filename}: pd intent init --confirm --lang ${lang} --workspace "${workspaceDir}"`,
313
+ };
314
+ emitResult(output, {
315
+ json: opts.json ?? false,
316
+ formatText: (o) => `${filename} not found.\n→ ${o.nextAction}`,
317
+ });
318
+ return;
319
+ }
320
+ const stat = fs.statSync(filePath);
321
+ if (stat.size > INTENT_MAX_BYTES) {
322
+ const output = {
323
+ status: 'oversized',
324
+ flagEnabled: true,
325
+ found: true,
326
+ warnings: [],
327
+ reason: 'oversized',
328
+ nextAction: `${filename} exceeds ${INTENT_MAX_BYTES} bytes (${stat.size} bytes). Reduce content.`,
329
+ };
330
+ emitResult(output, {
331
+ json: opts.json ?? false,
332
+ formatText: (o) => `${filename} is too large.\n→ ${o.nextAction}`,
333
+ });
334
+ return;
335
+ }
336
+ const raw = fs.readFileSync(filePath, 'utf8');
337
+ const sections = parseIntentDocSections(raw);
338
+ const warnings = validateIntentDocSections(sections);
339
+ const contentHash = computeIntentContentHash(raw);
340
+ const output = {
341
+ status: 'ok',
342
+ flagEnabled: true,
343
+ found: true,
344
+ path: filePath,
345
+ contentHash,
346
+ lastEditedAt: stat.mtime.toISOString(),
347
+ sections: sectionsToRecord(sections),
348
+ warnings,
349
+ };
350
+ emitResult(output, {
351
+ json: opts.json ?? false,
352
+ formatText: (o) => formatIntentShowText(o, filename),
353
+ });
354
+ }
355
+ catch (err) {
356
+ const reason = err instanceof Error ? err.message : String(err);
357
+ const output = {
358
+ status: 'read_error',
359
+ flagEnabled: true,
360
+ found: false,
361
+ warnings: [],
362
+ reason,
363
+ nextAction: `Check filesystem permissions for ${filePath}`,
364
+ };
365
+ emitResult(output, {
366
+ json: opts.json ?? false,
367
+ formatText: (o) => `Error reading ${filename}: ${o.reason}\n→ ${o.nextAction}`,
368
+ });
369
+ process.exitCode = 1;
370
+ }
371
+ }
372
+ // ── Command registration ─────────────────────────────────────────────────────
373
+ export function registerIntentCommand(parentCmd) {
374
+ const intentCmd = parentCmd
375
+ .command('intent')
376
+ .description('Owner-authored INTENT.md management (init, show)');
377
+ intentCmd
378
+ .command('init')
379
+ .description('Create .principles/INTENT.{lang}.md from the canonical template')
380
+ .option('-w, --workspace <path>', 'Workspace directory')
381
+ .option('--force', 'Overwrite existing INTENT file')
382
+ .option('--dry-run', 'Show what would happen without writing (default)')
383
+ .option('--confirm', 'Actually write the file (required to create INTENT file)')
384
+ .option('--lang <lang>', 'Language: zh-CN or en (default: zh-CN)')
385
+ .option('--json', 'Output raw JSON')
386
+ .action(async (opts) => {
387
+ await handleIntentInit({
388
+ workspace: opts.workspace,
389
+ force: opts.force === true,
390
+ json: opts.json === true,
391
+ dryRun: opts.dryRun === true,
392
+ confirm: opts.confirm === true,
393
+ lang: opts.lang,
394
+ });
395
+ });
396
+ intentCmd
397
+ .command('show')
398
+ .description('Display a read-only summary of INTENT.{lang}.md (sections, hash, warnings)')
399
+ .option('-w, --workspace <path>', 'Workspace directory')
400
+ .option('--lang <lang>', 'Language: zh-CN or en (default: zh-CN)')
401
+ .option('--json', 'Output raw JSON')
402
+ .action(async (opts) => {
403
+ await handleIntentShow({
404
+ workspace: opts.workspace,
405
+ json: opts.json === true,
406
+ lang: opts.lang,
407
+ });
408
+ });
409
+ return intentCmd;
410
+ }
411
+ //# sourceMapp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,CAAC;YACrB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,KAAK,EAAE,IAAI,CAAC,KAAK,KAAK,IAAI;YAC1B,IAAI,EAAE,IAAI,CAAC,IAAI,KAAK,IAAI;YACxB,MAAM,EAAE,IAAI,CAAC,MAAM,KAAK,IAAI;YAC5B,OAAO,EAAE,IAAI,CAAC,OAAO,KAAK,IAAI;YAC9B,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEL,SAAS;SACN,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,4EAA4E,CAAC;SACzF,MAAM,CAAC,wBAAwB,EAAE,qBAAqB,CAAC;SACvD,MAAM,CAAC,eAAe,EAAE,wCAAwC,CAAC;SACjE,MAAM,CAAC,QAAQ,EAAE,iBAAiB,CAAC;SACnC,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QACrB,MAAM,gBAAgB,CAAC;YACrB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,IAAI,EAAE,IAAI,CAAC,IAAI,KAAK,IAAI;YACxB,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEL,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * pd runtime init — Initialize all PD SQLite databases for a workspace.
3
+ *
4
+ * Creates state.db, trajectory.db, and subagent_workflows.db with full schema
5
+ * (tables + indexes + views + migrations). Idempotent: safe to run on existing
6
+ * workspaces (all CREATE statements use IF NOT EXISTS).
7
+ *
8
+ * Output contract (cli-1 strict-json, cli-4 dry-run/confirm mutex, cli-6 nextAction):
9
+ * - Default mode is --dry-run (no writes); use --confirm to actually initialize.
10
+ * - --json emits a single parseable JSON object on stdout.
11
+ * - Failures emit { ok: false, reason, nextAction } with exit code 1.
12
+ *
13
+ * ERR refs:
14
+ * - ERR-001/ERR-005: no `as` casts; DB rows typed via type guards
15
+ * - ERR-002: degraded paths include reason + nextAction
16
+ * - ERR-009/ERR-010: missing required fields fail loud
17
+ * - ERR-014: safe JSON.stringify on known output shapes
18
+ */
19
+ export interface DatabaseInitResult {
20
+ name: string;
21
+ path: string;
22
+ tables: string[];
23
+ status: 'initialized' | 'verified' | 'skipped' | 'failed';
24
+ warnings: string[];
25
+ }
26
+ export interface RuntimeInitOutput {
27
+ ok: boolean;
28
+ mode: 'dry-run' | 'confirm';
29
+ workspace: string;
30
+ databases: DatabaseInitResult[];
31
+ warnings: string[];
32
+ reason?: string;
33
+ nextAction?: string;
34
+ }
35
+ export declare function buildRuntimeInitOutput(workspaceDir: string, confirm: boolean): RuntimeInitOutput;
36
+ export interface RuntimeInitOptions {
37
+ workspace?: string;
38
+ dryRun?: boolean;
39
+ confirm?: boolean;
40
+ json?: boolean;
41
+ }
42
+ export declare function handleRuntimeInit(opts: RuntimeInitOptions): Promise<void>;
43
+ //# sourceMappingURL=runtime-init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-init.d.ts","sourceRoot":"","sources":["../../src/commands/runtime-init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAWH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,aAAa,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;IAC1D,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,EAAE,SAAS,GAAG,SAAS,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,kBAAkB,EAAE,CAAC;IAChC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAUD,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,iBAAiB,CAwKhG;AA+CD,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CA2B/E"}