agentic-qe 3.9.0 → 3.9.2

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 (416) hide show
  1. package/.claude/skills/skills-manifest.json +1 -1
  2. package/CHANGELOG.md +43 -0
  3. package/dist/audit/witness-chain.d.ts +1 -1
  4. package/dist/cli/bundle.js +8 -8
  5. package/dist/cli/chunks/adapter-53WBPKXU.js +2 -0
  6. package/dist/cli/chunks/{agent-booster-wasm-PQYB7VRU.js → agent-booster-wasm-AKAOHSCX.js} +2 -2
  7. package/dist/cli/chunks/{agent-handler-QDAB5NQS.js → agent-handler-MTGPOUVP.js} +2 -2
  8. package/dist/cli/chunks/agent-memory-branch-UFPKWUFK.js +2 -0
  9. package/dist/cli/chunks/aqe-learning-engine-MV7NGY24.js +2 -0
  10. package/dist/cli/chunks/{audit-S7JUYYVP.js → audit-VBEZHNHO.js} +2 -2
  11. package/dist/cli/chunks/base-DZVGMQN2.js +2 -0
  12. package/dist/cli/chunks/better-sqlite3-IRPHIXRU.js +2 -0
  13. package/dist/cli/chunks/brain-handler-7EO3FFRZ.js +68 -0
  14. package/dist/cli/chunks/{branch-enumerator-XK4V5W7L.js → branch-enumerator-MZRGP35N.js} +2 -2
  15. package/dist/cli/chunks/{browser-PALA5PL3.js → browser-VSIWQE7J.js} +2 -2
  16. package/dist/cli/chunks/browser-workflow-3J5YNMEI.js +2 -0
  17. package/dist/cli/chunks/chunk-25LFUL2K.js +79 -0
  18. package/dist/cli/chunks/{chunk-LHJQD2VU.js → chunk-2EC5Z2J4.js} +68 -68
  19. package/dist/cli/chunks/{chunk-4YOMLWEK.js → chunk-2VVV73PW.js} +1 -1
  20. package/dist/cli/chunks/{chunk-BPWXXEH2.js → chunk-2WBCYSUN.js} +128 -128
  21. package/dist/cli/chunks/{chunk-X3KI6JOY.js → chunk-2Z2TFEOL.js} +2 -2
  22. package/dist/cli/chunks/chunk-34U7JDCN.js +2 -0
  23. package/dist/cli/chunks/{chunk-24FKIJNC.js → chunk-3GZKAORV.js} +2 -2
  24. package/dist/cli/chunks/{chunk-72WOAVK6.js → chunk-4D2ZG2QO.js} +1 -1
  25. package/dist/cli/chunks/{chunk-B36CDR4U.js → chunk-4DAOZQ3V.js} +2 -2
  26. package/dist/cli/chunks/{chunk-CL6POIX4.js → chunk-4FMHBBG5.js} +1 -1
  27. package/dist/cli/chunks/{chunk-BXAXGEFC.js → chunk-4FT3PND7.js} +5 -5
  28. package/dist/cli/chunks/{chunk-IGJPMN4I.js → chunk-4LA7IW3V.js} +1 -1
  29. package/dist/cli/chunks/{chunk-JRYGQO2W.js → chunk-4PKXIBX2.js} +1 -1
  30. package/dist/cli/chunks/{chunk-YPFOCNOE.js → chunk-4UH25U4O.js} +1 -1
  31. package/dist/cli/chunks/{chunk-U5RN7YQW.js → chunk-4Z27TRQF.js} +2 -2
  32. package/dist/cli/chunks/{chunk-YW2THB5Q.js → chunk-563PJBDM.js} +2 -2
  33. package/dist/cli/chunks/{chunk-BDIEMZ22.js → chunk-56IWS2KY.js} +2 -2
  34. package/dist/cli/chunks/chunk-5AUKULWO.js +2 -0
  35. package/dist/cli/chunks/{chunk-VSVXUTJN.js → chunk-5L6AU3QK.js} +2 -2
  36. package/dist/cli/chunks/{chunk-RTGGL7D7.js → chunk-5RL66XSH.js} +2 -2
  37. package/dist/cli/chunks/{chunk-YANUP2RO.js → chunk-65M7C6SH.js} +1 -1
  38. package/dist/cli/chunks/{chunk-ESVQ6MEB.js → chunk-6SOJVEU7.js} +2 -2
  39. package/dist/cli/chunks/{chunk-UFUVUO3J.js → chunk-727BDQ3K.js} +2 -2
  40. package/dist/cli/chunks/{chunk-TLHP5EII.js → chunk-7NOIIC7G.js} +1 -1
  41. package/dist/cli/chunks/{chunk-N4TL73TH.js → chunk-7SLN2JGP.js} +8 -8
  42. package/dist/cli/chunks/{chunk-NZ2VCPN4.js → chunk-AA33R5U4.js} +2 -2
  43. package/dist/cli/chunks/{chunk-Y7BHKZFJ.js → chunk-AKSJQ6B3.js} +2 -2
  44. package/dist/cli/chunks/{chunk-3ZOONQG6.js → chunk-BIVIPF4O.js} +1 -1
  45. package/dist/cli/chunks/{chunk-VOS4NQSF.js → chunk-BKCTNRC5.js} +2 -2
  46. package/dist/cli/chunks/{chunk-B6LLWYQ6.js → chunk-BOH22AKC.js} +2 -2
  47. package/dist/cli/chunks/{chunk-OI5NGQO2.js → chunk-BY47GV4T.js} +2 -2
  48. package/dist/cli/chunks/chunk-CCYMJKWX.js +2 -0
  49. package/dist/cli/chunks/chunk-CL3K5EJK.js +2 -0
  50. package/dist/cli/chunks/{chunk-GPQ57KA4.js → chunk-CQBSGYRA.js} +2 -2
  51. package/dist/cli/chunks/{chunk-MZOFWJTM.js → chunk-CQP7ZFME.js} +2 -2
  52. package/dist/cli/chunks/chunk-DBE34QES.js +2 -0
  53. package/dist/cli/chunks/chunk-DHE66JRR.js +12 -0
  54. package/dist/cli/chunks/{chunk-2BZFNEN2.js → chunk-DNLMZTE2.js} +1 -1
  55. package/dist/cli/chunks/{chunk-XLRQYLWW.js → chunk-DSE57A5N.js} +1 -1
  56. package/dist/cli/chunks/{chunk-SUSEVMZT.js → chunk-E25S5E2D.js} +1 -1
  57. package/dist/cli/chunks/{chunk-FEKY7T6Q.js → chunk-FAXVVLPL.js} +2 -2
  58. package/dist/cli/chunks/chunk-FRJLP7IB.js +2 -0
  59. package/dist/cli/chunks/{chunk-CS2KS7LP.js → chunk-FUIHWBVF.js} +1 -1
  60. package/dist/cli/chunks/{chunk-LNQIY6BP.js → chunk-GCMVJS5X.js} +2 -2
  61. package/dist/cli/chunks/{chunk-XT2V2322.js → chunk-GITD7SRQ.js} +2 -2
  62. package/dist/cli/chunks/{chunk-JJO7Y4H3.js → chunk-GK72GUHA.js} +3 -3
  63. package/dist/cli/chunks/{chunk-6EOS7KX2.js → chunk-GPLERTZU.js} +2 -2
  64. package/dist/cli/chunks/{chunk-2E5NQNSU.js → chunk-HW4ISY5B.js} +11 -11
  65. package/dist/cli/chunks/{chunk-HRO6OZQD.js → chunk-ICDXWIFZ.js} +1 -1
  66. package/dist/cli/chunks/{chunk-3NZLZHJI.js → chunk-J4BS6IWE.js} +1 -1
  67. package/dist/cli/chunks/{chunk-4VUPRTVX.js → chunk-JOVINE23.js} +2 -2
  68. package/dist/cli/chunks/chunk-JV7LX6OT.js +95 -0
  69. package/dist/cli/chunks/{chunk-6SVX4DJC.js → chunk-KBA7FBK3.js} +3 -3
  70. package/dist/cli/chunks/chunk-KDDZYXP4.js +2 -0
  71. package/dist/cli/chunks/{chunk-GAOJV3OX.js → chunk-KNVAAVHH.js} +2 -2
  72. package/dist/cli/chunks/{chunk-CWFB6BSA.js → chunk-KQTJ2YLI.js} +4 -4
  73. package/dist/cli/chunks/{chunk-FGA7VIFR.js → chunk-KTYUCZEM.js} +3 -3
  74. package/dist/cli/chunks/{chunk-RU5WAHB7.js → chunk-KZTO5EVM.js} +2 -2
  75. package/dist/cli/chunks/{chunk-IFNIIK34.js → chunk-KZUJBZ7B.js} +3 -3
  76. package/dist/cli/chunks/{chunk-GKNNSCLC.js → chunk-L5WZUPZF.js} +2 -2
  77. package/dist/cli/chunks/{chunk-MDUHYUHF.js → chunk-L5YEPSDU.js} +2 -2
  78. package/dist/cli/chunks/chunk-LCAA6H4J.js +2 -0
  79. package/dist/cli/chunks/{chunk-XRE2HCWG.js → chunk-LMMEUVE5.js} +1 -1
  80. package/dist/cli/chunks/{chunk-7VDBAVTY.js → chunk-MN742FIH.js} +2 -2
  81. package/dist/cli/chunks/chunk-MY4LMIG7.js +180 -0
  82. package/dist/cli/chunks/{chunk-WGMPEW2T.js → chunk-N3F3CX4V.js} +2 -2
  83. package/dist/cli/chunks/{chunk-YVA65UZL.js → chunk-NJY7ZA77.js} +1 -1
  84. package/dist/cli/chunks/{chunk-3IHG3WOY.js → chunk-NM6TIEJ3.js} +3 -3
  85. package/dist/cli/chunks/{chunk-KP5NUODU.js → chunk-NRCKGXJJ.js} +1 -1
  86. package/dist/cli/chunks/{chunk-3ADGXLTM.js → chunk-PFNFC43Q.js} +1 -1
  87. package/dist/cli/chunks/{chunk-4VBTXZRM.js → chunk-PJFLO37I.js} +2 -2
  88. package/dist/cli/chunks/{chunk-XIBDETCS.js → chunk-PNL5G6TE.js} +2 -2
  89. package/dist/cli/chunks/{chunk-AFLLQ5PP.js → chunk-Q4A72ZTV.js} +2 -2
  90. package/dist/cli/chunks/{chunk-EHDQJQ6Y.js → chunk-QEQTC4WQ.js} +5 -5
  91. package/dist/cli/chunks/{chunk-IAV2JMIX.js → chunk-QIH3E775.js} +2 -2
  92. package/dist/cli/chunks/{chunk-GRUUQAR6.js → chunk-QNBQBSAI.js} +2 -2
  93. package/dist/cli/chunks/{chunk-WIEC7VKK.js → chunk-QODE4LM6.js} +2 -2
  94. package/dist/cli/chunks/{chunk-HY6PMO5W.js → chunk-QPRVX4H2.js} +2 -2
  95. package/dist/cli/chunks/chunk-RC5CPXON.js +2 -0
  96. package/dist/cli/chunks/{chunk-TWUWL5EJ.js → chunk-RITN3XR4.js} +2 -2
  97. package/dist/cli/chunks/{chunk-WBQSXPBI.js → chunk-RJROC5M3.js} +2 -2
  98. package/dist/cli/chunks/chunk-RQGYJK7H.js +2 -0
  99. package/dist/cli/chunks/{chunk-XO6PVK2P.js → chunk-S3RDH5CI.js} +2 -2
  100. package/dist/cli/chunks/{chunk-3IUNFTIF.js → chunk-SCF7NRVE.js} +1 -1
  101. package/dist/cli/chunks/chunk-SDTVHR63.js +2 -0
  102. package/dist/cli/chunks/chunk-SGAW2WLI.js +65 -0
  103. package/dist/cli/chunks/{chunk-N2NS2PHA.js → chunk-SNVM4YJS.js} +2 -2
  104. package/dist/cli/chunks/{chunk-JXM26HEE.js → chunk-SRRFWTNF.js} +2 -2
  105. package/dist/cli/chunks/{chunk-UQHYFOBX.js → chunk-STE42EMB.js} +2 -2
  106. package/dist/cli/chunks/{chunk-WJ3DLOXF.js → chunk-T5GV6UIO.js} +2 -2
  107. package/dist/cli/chunks/{chunk-4YS3IJ45.js → chunk-TKF447CW.js} +1 -1
  108. package/dist/cli/chunks/{chunk-ZAPS3UGQ.js → chunk-TTOE336G.js} +3 -3
  109. package/dist/cli/chunks/{chunk-YAGODYIG.js → chunk-UKDOMLBI.js} +3 -3
  110. package/dist/cli/chunks/{chunk-JBANAPWG.js → chunk-V6XBAZNH.js} +1 -1
  111. package/dist/cli/chunks/{chunk-BULKFVYX.js → chunk-VHVWAXCF.js} +1 -1
  112. package/dist/cli/chunks/{chunk-5SKGFSKD.js → chunk-VL7YOOC2.js} +2 -2
  113. package/dist/cli/chunks/{chunk-AKE543X2.js → chunk-VUAO4VFC.js} +2 -2
  114. package/dist/cli/chunks/{chunk-7R6YMLVS.js → chunk-WG4GHAML.js} +2 -2
  115. package/dist/cli/chunks/{chunk-BTREG4IW.js → chunk-WXWY2GAF.js} +2 -2
  116. package/dist/cli/chunks/chunk-X35GP7TR.js +1 -0
  117. package/dist/cli/chunks/chunk-X6LCMOGC.js +2 -0
  118. package/dist/cli/chunks/{chunk-BGXNSCXX.js → chunk-XFMKJ3UD.js} +1 -1
  119. package/dist/cli/chunks/{chunk-BLBRY5UD.js → chunk-XH53ARZD.js} +2 -2
  120. package/dist/cli/chunks/chunk-XIBVVZGB.js +2 -0
  121. package/dist/cli/chunks/chunk-XYJL6DKI.js +2 -0
  122. package/dist/cli/chunks/{chunk-5T2ZQWKF.js → chunk-Y6O7CDLI.js} +2 -2
  123. package/dist/cli/chunks/{chunk-4I2IOUS4.js → chunk-YXCU4CJX.js} +1 -1
  124. package/dist/cli/chunks/{chunk-YR6ZZGH7.js → chunk-Z2IKNC5M.js} +1 -1
  125. package/dist/cli/chunks/{chunk-OLHKGP35.js → chunk-Z54EO6E6.js} +2 -2
  126. package/dist/cli/chunks/{chunk-ZDATDCYN.js → chunk-Z5HXGVXZ.js} +1 -1
  127. package/dist/cli/chunks/{ci-J374KDLI.js → ci-2BCOBWFG.js} +2 -2
  128. package/dist/cli/chunks/ci-output-FB4OJHAC.js +2 -0
  129. package/dist/cli/chunks/{claude-flow-setup-245JLJCN.js → claude-flow-setup-NEEFZTMB.js} +2 -2
  130. package/dist/cli/chunks/client-EF555KYW.js +2 -0
  131. package/dist/cli/chunks/{cline-installer-LBA2M5N3.js → cline-installer-ODO2PS4K.js} +2 -2
  132. package/dist/cli/chunks/{code-U4N4WONM.js → code-NSOF62VE.js} +2 -2
  133. package/dist/cli/chunks/{code-index-extractor-A57Z6BO4.js → code-index-extractor-YQL5XN52.js} +2 -2
  134. package/dist/cli/chunks/{codex-installer-UXMK2N4T.js → codex-installer-SPEY6VYT.js} +2 -2
  135. package/dist/cli/chunks/{completions-W66BSCOE.js → completions-OWKBUMBE.js} +2 -2
  136. package/dist/cli/chunks/complexity-analyzer-PGTXKP73.js +2 -0
  137. package/dist/cli/chunks/{continuedev-installer-LRFZ2SJM.js → continuedev-installer-KGOXAC7L.js} +2 -2
  138. package/dist/cli/chunks/{copilot-installer-CQ3JYBIB.js → copilot-installer-BF3UA3TG.js} +2 -2
  139. package/dist/cli/chunks/cost-tracker-2HDJ66E2.js +2 -0
  140. package/dist/cli/chunks/{coverage-4PUEQXAY.js → coverage-KPA2PHIN.js} +3 -3
  141. package/dist/cli/chunks/cross-domain-router-GXFNK5TS.js +2 -0
  142. package/dist/cli/chunks/{cursor-installer-JZEDEDHA.js → cursor-installer-7CDZFHTV.js} +2 -2
  143. package/dist/cli/chunks/{daemon-B7TWGHXQ.js → daemon-4BPGCKDJ.js} +3 -3
  144. package/dist/cli/chunks/dag-attention-scheduler-2MAVGSBB.js +2 -0
  145. package/dist/cli/chunks/detect-WRPWTGP5.js +2 -0
  146. package/dist/cli/chunks/{domain-handler-FT5FLZWL.js → domain-handler-JZVSJ7AG.js} +2 -2
  147. package/dist/cli/chunks/domain-transfer-XGIZOR2X.js +2 -0
  148. package/dist/cli/chunks/dream-3IKF5XH4.js +2 -0
  149. package/dist/cli/chunks/esm-node-DHAE52OW.js +2 -0
  150. package/dist/cli/chunks/{eval-GHMPFGWV.js → eval-T7YPAS4G.js} +2 -2
  151. package/dist/cli/chunks/{fast-paths-B3R647KN.js → fast-paths-QECJTKCQ.js} +2 -2
  152. package/dist/cli/chunks/{feature-flags-DWS7ARSX.js → feature-flags-LIFURSFZ.js} +2 -2
  153. package/dist/cli/chunks/feature-flags-R4QZYTIW.js +2 -0
  154. package/dist/cli/chunks/file-discovery-4W3K3W4C.js +2 -0
  155. package/dist/cli/chunks/{fleet-EKOKMOMW.js → fleet-NLLQWCI5.js} +3 -3
  156. package/dist/cli/chunks/gnn-wrapper-XEII72LN.js +2 -0
  157. package/dist/cli/chunks/{heartbeat-handler-MBBS4IBU.js → heartbeat-handler-DJ65RE5D.js} +4 -4
  158. package/dist/cli/chunks/{heartbeat-scheduler-XDGMOT7X.js → heartbeat-scheduler-H664265Q.js} +2 -2
  159. package/dist/cli/chunks/hnsw-adapter-DML5KXQR.js +2 -0
  160. package/dist/cli/chunks/hnsw-index-BUPPGVR6.js +2 -0
  161. package/dist/cli/chunks/hnsw-legacy-bridge-SQIDTWAA.js +2 -0
  162. package/dist/cli/chunks/hnswlib-node-WICYCU5U.js +2 -0
  163. package/dist/cli/chunks/{hooks-L5VLZGEK.js → hooks-GZUHUD63.js} +6 -6
  164. package/dist/cli/chunks/hypergraph-engine-MLCDZ6BL.js +2 -0
  165. package/dist/cli/chunks/{hypergraph-handler-3HDGB5SZ.js → hypergraph-handler-NNDDI4R3.js} +3 -3
  166. package/dist/cli/chunks/impact-analyzer-DPTMJRYS.js +2 -0
  167. package/dist/cli/chunks/{init-handler-JDET6WUN.js → init-handler-IJ6BHE6A.js} +6 -6
  168. package/dist/cli/chunks/init-wizard-35PUDJPW.js +2 -0
  169. package/dist/cli/chunks/kernel-2HZ44ZJ4.js +2 -0
  170. package/dist/cli/chunks/{kilocode-installer-GZZG5AFW.js → kilocode-installer-EPZFFPFE.js} +2 -2
  171. package/dist/cli/chunks/{kiro-installer-IWNY5TKH.js → kiro-installer-5VACG3HU.js} +2 -2
  172. package/dist/cli/chunks/knowledge-graph-JL62G72U.js +2 -0
  173. package/dist/cli/chunks/{learning-722ZNSZ6.js → learning-6FITK6XY.js} +3 -3
  174. package/dist/cli/chunks/{llm-router-DNAV746L.js → llm-router-4DDC6AKJ.js} +2 -2
  175. package/dist/cli/chunks/{load-Y3GCUFM4.js → load-KGDNVUBX.js} +2 -2
  176. package/dist/cli/chunks/load-test-LN245SSD.js +2 -0
  177. package/dist/cli/chunks/{mcp-LKPIBZ3W.js → mcp-4LETGVIV.js} +2 -2
  178. package/dist/cli/chunks/{memory-L57MLFOP.js → memory-II4I4QMO.js} +5 -5
  179. package/dist/cli/chunks/memory-backend-SVM7YRIE.js +2 -0
  180. package/dist/cli/chunks/memory-handlers-TQXTOJGQ.js +2 -0
  181. package/dist/cli/chunks/opencode-installer-EU6JCWBW.js +3 -0
  182. package/dist/cli/chunks/{orchestrator-QHSBB2UC.js → orchestrator-YLMGJVSP.js} +5 -5
  183. package/dist/cli/chunks/{pipeline-D3QER35Z.js → pipeline-MPZJWYKK.js} +2 -2
  184. package/dist/cli/chunks/{platform-T4E7Q3RD.js → platform-YH35ZZFZ.js} +2 -2
  185. package/dist/cli/chunks/{plugin-JHW2YPRC.js → plugin-B7JYZFNQ.js} +2 -2
  186. package/dist/cli/chunks/{prime-radiant-advanced-wasm-G7CFNNQV.js → prime-radiant-advanced-wasm-KTUK6UE2.js} +2 -2
  187. package/dist/cli/chunks/protocol-executor-IEN2XB4L.js +2 -0
  188. package/dist/cli/chunks/{protocol-handler-2BQQ4HDM.js → protocol-handler-3NXMVU34.js} +2 -2
  189. package/dist/cli/chunks/{prove-UQ6JFT73.js → prove-H5LMGSUC.js} +2 -2
  190. package/dist/cli/chunks/qe-reasoning-bank-Q3ZV3JRG.js +2 -0
  191. package/dist/cli/chunks/{quality-JRZYMC77.js → quality-RCWHY6GO.js} +2 -2
  192. package/dist/cli/chunks/queen-coordinator-E6ON3JUR.js +2 -0
  193. package/dist/cli/chunks/real-embeddings-NKH4VURF.js +2 -0
  194. package/dist/cli/chunks/{roocode-installer-F4E2LAYR.js → roocode-installer-SB7QJYM3.js} +2 -2
  195. package/dist/cli/chunks/router-WMC3LZ3C.js +2 -0
  196. package/dist/cli/chunks/routing-feedback-VKCZRCE3.js +2 -0
  197. package/dist/cli/chunks/{routing-handler-VNKFUUGB.js → routing-handler-SY7GKG2W.js} +2 -2
  198. package/dist/cli/chunks/ruvector-commands-HATTO3UQ.js +8 -0
  199. package/dist/cli/chunks/rvf-dual-writer-D57EXQUD.js +2 -0
  200. package/dist/cli/chunks/rvf-migration-adapter-OWDYN6KD.js +2 -0
  201. package/dist/cli/chunks/rvf-migration-coordinator-SIQVJB5S.js +2 -0
  202. package/dist/cli/chunks/rvf-native-adapter-C7NBH5UN.js +2 -0
  203. package/dist/cli/chunks/safe-db-5KLXCNXN.js +2 -0
  204. package/dist/cli/chunks/schedule-HAWWOXWB.js +2 -0
  205. package/dist/cli/chunks/scheduler-HTRDY5BC.js +2 -0
  206. package/dist/cli/chunks/{security-EBEG2OPU.js → security-DS3XLZWN.js} +3 -3
  207. package/dist/cli/chunks/shared-rvf-adapter-6I2Z5UGL.js +2 -0
  208. package/dist/cli/chunks/shared-rvf-dual-writer-YB7AH6XJ.js +2 -0
  209. package/dist/cli/chunks/sqlite-persistence-WNNRGTGG.js +2 -0
  210. package/dist/cli/chunks/{status-handler-VZ32M4G4.js → status-handler-TUYHE4FT.js} +2 -2
  211. package/dist/cli/chunks/{structural-health-K6LRCKV6.js → structural-health-XNGBNRRD.js} +2 -2
  212. package/dist/cli/chunks/{sync-MHSHNLIM.js → sync-K6CIRKBB.js} +2 -2
  213. package/dist/cli/chunks/{task-handler-JNOIBZ2G.js → task-handler-7PJY67DR.js} +2 -2
  214. package/dist/cli/chunks/task-handlers-WB5CDWUR.js +2 -0
  215. package/dist/cli/chunks/{test-DO22BNIL.js → test-WV5ALEBB.js} +4 -4
  216. package/dist/cli/chunks/{test-scheduling-VLRQZEFL.js → test-scheduling-N55ZGGA2.js} +3 -3
  217. package/dist/cli/chunks/token-bootstrap-SINWHAKR.js +2 -0
  218. package/dist/cli/chunks/{token-usage-LG3PXRXH.js → token-usage-R7TGEVGL.js} +2 -2
  219. package/dist/cli/chunks/transformers-6DBLXPV7.js +2 -0
  220. package/dist/cli/chunks/{tree-sitter-wasm-parser-FT2KB66N.js → tree-sitter-wasm-parser-7C7FKMQW.js} +2 -2
  221. package/dist/cli/chunks/types-VNPMOKQT.js +2 -0
  222. package/dist/cli/chunks/unified-memory-72SKVZ7Y.js +2 -0
  223. package/dist/cli/chunks/unified-memory-hnsw-TMN2L77W.js +2 -0
  224. package/dist/cli/chunks/unified-persistence-MDN3SRCR.js +2 -0
  225. package/dist/cli/chunks/{validate-VQCRSVNQ.js → validate-53MNIRAF.js} +2 -2
  226. package/dist/cli/chunks/{validate-swarm-A5DHAWTP.js → validate-swarm-ZY4RGUFO.js} +2 -2
  227. package/dist/cli/chunks/{vibium-RZBSL4EB.js → vibium-PBADBIV6.js} +2 -2
  228. package/dist/cli/chunks/visual-security-TRBCXPIB.js +2 -0
  229. package/dist/cli/chunks/{web-tree-sitter-7C4NXEOF.js → web-tree-sitter-O7VI6RLB.js} +2 -2
  230. package/dist/cli/chunks/{windsurf-installer-ES3KPQG3.js → windsurf-installer-HV3C3TAD.js} +2 -2
  231. package/dist/cli/chunks/witness-chain-4WIMYP4X.js +2 -0
  232. package/dist/cli/chunks/witness-chain-JOI2YYGK.js +2 -0
  233. package/dist/cli/chunks/{workflow-JETHX4ML.js → workflow-5RVAQ4TM.js} +4 -4
  234. package/dist/cli/chunks/workflow-orchestrator-2NQ72S3C.js +2 -0
  235. package/dist/cli/chunks/{wrappers-WP5RH745.js → wrappers-RRHCCA3E.js} +2 -2
  236. package/dist/cli/commands/ruvector-commands.js +14 -2
  237. package/dist/cli/index.js +10 -15
  238. package/dist/coordination/agent-memory-branch.d.ts +117 -0
  239. package/dist/coordination/agent-memory-branch.js +213 -0
  240. package/dist/coordination/agent-teams/mailbox.d.ts +43 -0
  241. package/dist/coordination/agent-teams/mailbox.js +130 -4
  242. package/dist/coordination/handlers/handler-utils.d.ts +1 -0
  243. package/dist/coordination/handlers/handler-utils.js +9 -2
  244. package/dist/coordination/handlers/quality-handlers.js +7 -1
  245. package/dist/domains/contract-testing/coordinator.js +11 -0
  246. package/dist/domains/quality-assessment/coherence/gate-controller.d.ts +20 -1
  247. package/dist/domains/quality-assessment/coherence/gate-controller.js +64 -0
  248. package/dist/domains/quality-assessment/coherence/index.d.ts +3 -3
  249. package/dist/domains/quality-assessment/coherence/index.js +2 -2
  250. package/dist/domains/quality-assessment/coherence/types.d.ts +39 -0
  251. package/dist/domains/quality-assessment/coherence/types.js +11 -0
  252. package/dist/domains/quality-assessment/coordinator.d.ts +14 -0
  253. package/dist/domains/quality-assessment/coordinator.js +92 -0
  254. package/dist/domains/test-execution/coordinator.d.ts +19 -0
  255. package/dist/domains/test-execution/coordinator.js +102 -5
  256. package/dist/domains/test-generation/coordinator.js +11 -0
  257. package/dist/domains/test-generation/interfaces.d.ts +2 -0
  258. package/dist/domains/test-generation/services/test-generator.d.ts +9 -0
  259. package/dist/domains/test-generation/services/test-generator.js +37 -0
  260. package/dist/init/agents-installer.d.ts +5 -3
  261. package/dist/init/agents-installer.js +17 -43
  262. package/dist/init/find-package-root.d.ts +22 -0
  263. package/dist/init/find-package-root.js +46 -0
  264. package/dist/init/n8n-installer.d.ts +4 -2
  265. package/dist/init/n8n-installer.js +23 -23
  266. package/dist/init/opencode-installer.d.ts +0 -5
  267. package/dist/init/opencode-installer.js +12 -39
  268. package/dist/init/skills-installer.d.ts +5 -2
  269. package/dist/init/skills-installer.js +15 -37
  270. package/dist/integrations/embeddings/index/HNSWIndex.d.ts +9 -2
  271. package/dist/integrations/embeddings/index/HNSWIndex.js +110 -35
  272. package/dist/integrations/ruvector/cognitive-routing.d.ts +67 -0
  273. package/dist/integrations/ruvector/cognitive-routing.js +208 -0
  274. package/dist/integrations/ruvector/feature-flags.d.ts +84 -0
  275. package/dist/integrations/ruvector/feature-flags.js +59 -0
  276. package/dist/integrations/ruvector/hdc-fingerprint.d.ts +76 -0
  277. package/dist/integrations/ruvector/hdc-fingerprint.js +217 -0
  278. package/dist/integrations/ruvector/hyperbolic-hnsw.d.ts +59 -0
  279. package/dist/integrations/ruvector/hyperbolic-hnsw.js +194 -0
  280. package/dist/integrations/ruvector/index.d.ts +5 -2
  281. package/dist/integrations/ruvector/index.js +13 -2
  282. package/dist/integrations/ruvector/shared-rvf-adapter.d.ts +24 -0
  283. package/dist/integrations/ruvector/shared-rvf-adapter.js +55 -0
  284. package/dist/integrations/ruvector/shared-rvf-dual-writer.d.ts +6 -0
  285. package/dist/integrations/ruvector/shared-rvf-dual-writer.js +38 -0
  286. package/dist/integrations/ruvector/sona-persistence.d.ts +8 -0
  287. package/dist/integrations/ruvector/sona-persistence.js +10 -0
  288. package/dist/integrations/ruvector/vector-delta-tracker.d.ts +96 -0
  289. package/dist/integrations/ruvector/vector-delta-tracker.js +226 -0
  290. package/dist/kernel/agent-coordinator.d.ts +75 -1
  291. package/dist/kernel/agent-coordinator.js +250 -1
  292. package/dist/kernel/hnsw-legacy-bridge.d.ts +38 -0
  293. package/dist/kernel/hnsw-legacy-bridge.js +88 -0
  294. package/dist/kernel/hnsw-shadow-validator.d.ts +91 -0
  295. package/dist/kernel/hnsw-shadow-validator.js +139 -0
  296. package/dist/kernel/index.d.ts +1 -1
  297. package/dist/kernel/index.js +1 -1
  298. package/dist/kernel/interfaces.d.ts +39 -0
  299. package/dist/kernel/kernel.d.ts +23 -0
  300. package/dist/kernel/kernel.js +106 -1
  301. package/dist/kernel/unified-memory.d.ts +1 -1
  302. package/dist/kernel/unified-memory.js +7 -3
  303. package/dist/learning/aqe-learning-engine.d.ts +65 -0
  304. package/dist/learning/aqe-learning-engine.js +134 -0
  305. package/dist/learning/dream/dream-engine.d.ts +6 -1
  306. package/dist/learning/dream/dream-engine.js +37 -2
  307. package/dist/learning/dream/dream-scheduler.d.ts +25 -0
  308. package/dist/learning/dream/dream-scheduler.js +120 -0
  309. package/dist/learning/dream/rvcow-branch-manager.d.ts +6 -3
  310. package/dist/learning/dream/rvcow-branch-manager.js +60 -5
  311. package/dist/learning/experience-capture.d.ts +3 -3
  312. package/dist/learning/hyperbolic-pattern-index.d.ts +82 -0
  313. package/dist/learning/hyperbolic-pattern-index.js +142 -0
  314. package/dist/learning/index.d.ts +3 -3
  315. package/dist/learning/index.js +1 -1
  316. package/dist/learning/metrics-tracker.d.ts +44 -0
  317. package/dist/learning/metrics-tracker.js +37 -0
  318. package/dist/learning/pattern-promotion.d.ts +3 -3
  319. package/dist/learning/pattern-store.d.ts +45 -2
  320. package/dist/learning/pattern-store.js +239 -4
  321. package/dist/learning/qe-patterns.d.ts +1 -1
  322. package/dist/learning/qe-reasoning-bank.js +1 -1
  323. package/dist/learning/rvf-pattern-migration.d.ts +50 -0
  324. package/dist/learning/rvf-pattern-migration.js +106 -0
  325. package/dist/learning/rvf-pattern-store.d.ts +69 -0
  326. package/dist/learning/rvf-pattern-store.js +449 -0
  327. package/dist/mcp/bundle.js +1894 -1804
  328. package/dist/mcp/handlers/index.d.ts +1 -0
  329. package/dist/mcp/handlers/index.js +2 -0
  330. package/dist/mcp/handlers/migration-handlers.d.ts +52 -0
  331. package/dist/mcp/handlers/migration-handlers.js +85 -0
  332. package/dist/mcp/protocol-server.d.ts +1 -0
  333. package/dist/mcp/protocol-server.js +63 -2
  334. package/dist/mcp/types.d.ts +1 -1
  335. package/dist/optimization/early-exit-token-optimizer.d.ts +7 -7
  336. package/dist/optimization/early-exit-token-optimizer.js +3 -3
  337. package/dist/persistence/rvf-consistency-validator.d.ts +85 -0
  338. package/dist/persistence/rvf-consistency-validator.js +182 -0
  339. package/dist/persistence/rvf-migration-adapter.d.ts +125 -0
  340. package/dist/persistence/rvf-migration-adapter.js +303 -0
  341. package/dist/persistence/rvf-migration-coordinator.d.ts +115 -0
  342. package/dist/persistence/rvf-migration-coordinator.js +224 -0
  343. package/dist/persistence/rvf-stage-gate.d.ts +70 -0
  344. package/dist/persistence/rvf-stage-gate.js +163 -0
  345. package/package.json +10 -10
  346. package/dist/cli/chunks/adapter-WBR5NXS3.js +0 -2
  347. package/dist/cli/chunks/aqe-learning-engine-TK4JQCGT.js +0 -2
  348. package/dist/cli/chunks/base-2WXOSMBQ.js +0 -2
  349. package/dist/cli/chunks/better-sqlite3-7KY2RDXO.js +0 -2
  350. package/dist/cli/chunks/brain-handler-PPEGDCN4.js +0 -68
  351. package/dist/cli/chunks/browser-workflow-42F7GK5T.js +0 -2
  352. package/dist/cli/chunks/chunk-263XS447.js +0 -2
  353. package/dist/cli/chunks/chunk-2I7J3O6V.js +0 -2
  354. package/dist/cli/chunks/chunk-3JPRUND5.js +0 -2
  355. package/dist/cli/chunks/chunk-3THRQEZ2.js +0 -95
  356. package/dist/cli/chunks/chunk-4B6NCELM.js +0 -2
  357. package/dist/cli/chunks/chunk-62ADTHV7.js +0 -2
  358. package/dist/cli/chunks/chunk-BR26T7ZS.js +0 -180
  359. package/dist/cli/chunks/chunk-DRT3WKQW.js +0 -2
  360. package/dist/cli/chunks/chunk-FIA6X7UL.js +0 -2
  361. package/dist/cli/chunks/chunk-J3KWWR6Z.js +0 -1
  362. package/dist/cli/chunks/chunk-JZSDOIXA.js +0 -2
  363. package/dist/cli/chunks/chunk-MV6CMOJQ.js +0 -65
  364. package/dist/cli/chunks/chunk-N5UXCLFI.js +0 -2
  365. package/dist/cli/chunks/chunk-OF4D7MYI.js +0 -2
  366. package/dist/cli/chunks/chunk-QOVHWZEP.js +0 -1
  367. package/dist/cli/chunks/chunk-RFSN6IDA.js +0 -79
  368. package/dist/cli/chunks/chunk-X5IJGWYG.js +0 -2
  369. package/dist/cli/chunks/ci-output-7JN7F6CI.js +0 -2
  370. package/dist/cli/chunks/client-MCSNSH2C.js +0 -2
  371. package/dist/cli/chunks/complexity-analyzer-AB4OZARV.js +0 -2
  372. package/dist/cli/chunks/cost-tracker-4F723RB6.js +0 -2
  373. package/dist/cli/chunks/cross-domain-router-OWR5IJ5G.js +0 -2
  374. package/dist/cli/chunks/dag-attention-scheduler-JWO6XI6A.js +0 -2
  375. package/dist/cli/chunks/detect-L6ZZHUSX.js +0 -2
  376. package/dist/cli/chunks/domain-transfer-5Y4FGJAJ.js +0 -2
  377. package/dist/cli/chunks/dream-4TDBIYED.js +0 -2
  378. package/dist/cli/chunks/esm-node-2PKHKOTS.js +0 -2
  379. package/dist/cli/chunks/feature-flags-IVQ3AL4Q.js +0 -2
  380. package/dist/cli/chunks/file-discovery-QFPA6GMV.js +0 -2
  381. package/dist/cli/chunks/gnn-wrapper-OYC55N5E.js +0 -2
  382. package/dist/cli/chunks/hnsw-index-YO7CT23I.js +0 -2
  383. package/dist/cli/chunks/hnswlib-node-56YWVXFE.js +0 -2
  384. package/dist/cli/chunks/hypergraph-engine-A4Y2ZRAG.js +0 -2
  385. package/dist/cli/chunks/impact-analyzer-UEIGXSZ4.js +0 -2
  386. package/dist/cli/chunks/init-wizard-JWZUGIPJ.js +0 -2
  387. package/dist/cli/chunks/kernel-YNDTVKIW.js +0 -2
  388. package/dist/cli/chunks/knowledge-graph-NGJKFTSN.js +0 -2
  389. package/dist/cli/chunks/load-test-GZUBXFF3.js +0 -2
  390. package/dist/cli/chunks/memory-backend-3NQIZUXE.js +0 -2
  391. package/dist/cli/chunks/memory-handlers-MDZQ7HVW.js +0 -2
  392. package/dist/cli/chunks/opencode-installer-4HUB36H5.js +0 -3
  393. package/dist/cli/chunks/protocol-executor-SPUVRDWT.js +0 -2
  394. package/dist/cli/chunks/qe-reasoning-bank-3HBK2FVD.js +0 -2
  395. package/dist/cli/chunks/queen-coordinator-RW3NKO5A.js +0 -2
  396. package/dist/cli/chunks/real-embeddings-GK63VF35.js +0 -2
  397. package/dist/cli/chunks/router-RJGHWDQ3.js +0 -2
  398. package/dist/cli/chunks/routing-feedback-ZXBXFKX6.js +0 -2
  399. package/dist/cli/chunks/ruvector-commands-2TLNHC3A.js +0 -8
  400. package/dist/cli/chunks/rvf-dual-writer-MQW2SJLT.js +0 -2
  401. package/dist/cli/chunks/rvf-native-adapter-LKFKTMUN.js +0 -2
  402. package/dist/cli/chunks/safe-db-G22E5ROA.js +0 -2
  403. package/dist/cli/chunks/schedule-Y7VVCPYV.js +0 -2
  404. package/dist/cli/chunks/scheduler-AUQIFQB7.js +0 -2
  405. package/dist/cli/chunks/shared-rvf-dual-writer-BVSCQAFS.js +0 -2
  406. package/dist/cli/chunks/sqlite-persistence-JAVHUGGL.js +0 -2
  407. package/dist/cli/chunks/task-handlers-P5DSUKND.js +0 -2
  408. package/dist/cli/chunks/token-bootstrap-4VJKGVMK.js +0 -2
  409. package/dist/cli/chunks/transformers-GY7SIKEU.js +0 -2
  410. package/dist/cli/chunks/types-QJGNBKP2.js +0 -2
  411. package/dist/cli/chunks/unified-memory-XYGENQUT.js +0 -2
  412. package/dist/cli/chunks/unified-memory-hnsw-MVEGQBF3.js +0 -2
  413. package/dist/cli/chunks/unified-persistence-PFRCWEUG.js +0 -2
  414. package/dist/cli/chunks/visual-security-V47BLGJM.js +0 -2
  415. package/dist/cli/chunks/witness-chain-BR63P4A7.js +0 -2
  416. package/dist/cli/chunks/workflow-orchestrator-7PZMX3JZ.js +0 -2
@@ -0,0 +1,69 @@
1
+ /**
2
+ * RVF-Backed Pattern Store (ADR-066)
3
+ *
4
+ * Implements IPatternStore using @ruvector/rvf-node for persistent HNSW
5
+ * vector indexing. Eliminates cold-start index rebuild (SQLite BLOB →
6
+ * in-memory HNSW) by storing vectors in the RVF native format with
7
+ * progressive 3-layer indexing.
8
+ *
9
+ * Pattern metadata remains in SQLite (via the existing SQLitePatternStore);
10
+ * only vector storage and search moves to RVF.
11
+ *
12
+ * @module learning/rvf-pattern-store
13
+ */
14
+ import type { Result } from '../shared/types/index.js';
15
+ import type { RvfNativeAdapter } from '../integrations/ruvector/rvf-native-adapter.js';
16
+ import { type QEPattern, type CreateQEPatternOptions } from './qe-patterns.js';
17
+ import type { IPatternStore, PatternStoreConfig, PatternStoreStats, PatternSearchOptions, PatternSearchResult } from './pattern-store.js';
18
+ export interface RvfPatternStoreConfig {
19
+ /** Path to the .rvf file for vector storage */
20
+ rvfPath: string;
21
+ /** Base PatternStore config (for metadata, thresholds) */
22
+ base: PatternStoreConfig;
23
+ /** When true, dispose() will not close the adapter (shared singleton) */
24
+ skipCloseOnDispose?: boolean;
25
+ }
26
+ /**
27
+ * Pattern store backed by @ruvector/rvf-node for persistent HNSW.
28
+ *
29
+ * Vectors live in a .rvf file (persistent HNSW, no cold-start rebuild).
30
+ * Metadata (pattern fields, FTS5) lives in SQLite via sqliteStore delegate.
31
+ */
32
+ export declare class RvfPatternStore implements IPatternStore {
33
+ private readonly createAdapter;
34
+ private readonly config;
35
+ private readonly rvfPath;
36
+ private readonly skipCloseOnDispose;
37
+ private adapter;
38
+ private sqliteStore;
39
+ private initialized;
40
+ private rvfInitError;
41
+ private searchOps;
42
+ private totalSearchMs;
43
+ constructor(createAdapter: (path: string, dim: number) => RvfNativeAdapter, config?: Partial<RvfPatternStoreConfig>);
44
+ /**
45
+ * Attach SQLite persistence for metadata (pattern fields, FTS5).
46
+ * Must be called before initialize() if SQLite metadata is desired.
47
+ */
48
+ setSqliteStore(store: import('./sqlite-persistence.js').SQLitePatternStore): void;
49
+ /** Get the underlying RVF adapter (for COW branching, migration, etc.) */
50
+ getAdapter(): RvfNativeAdapter | null;
51
+ initialize(): Promise<void>;
52
+ dispose(): Promise<void>;
53
+ store(pattern: QEPattern): Promise<Result<string>>;
54
+ create(options: CreateQEPatternOptions): Promise<Result<QEPattern>>;
55
+ get(id: string): Promise<QEPattern | null>;
56
+ search(query: string | number[], options?: PatternSearchOptions): Promise<Result<PatternSearchResult[]>>;
57
+ recordUsage(id: string, success: boolean): Promise<Result<void>>;
58
+ promote(id: string): Promise<Result<void>>;
59
+ delete(id: string): Promise<Result<void>>;
60
+ getStats(): Promise<PatternStoreStats>;
61
+ cleanup(): Promise<{
62
+ removed: number;
63
+ promoted: number;
64
+ }>;
65
+ private ensureInitialized;
66
+ private matchesFilters;
67
+ private calculateReuseInfo;
68
+ }
69
+ //# sourceMappingURL=rvf-pattern-store.d.ts.map
@@ -0,0 +1,449 @@
1
+ /**
2
+ * RVF-Backed Pattern Store (ADR-066)
3
+ *
4
+ * Implements IPatternStore using @ruvector/rvf-node for persistent HNSW
5
+ * vector indexing. Eliminates cold-start index rebuild (SQLite BLOB →
6
+ * in-memory HNSW) by storing vectors in the RVF native format with
7
+ * progressive 3-layer indexing.
8
+ *
9
+ * Pattern metadata remains in SQLite (via the existing SQLitePatternStore);
10
+ * only vector storage and search moves to RVF.
11
+ *
12
+ * @module learning/rvf-pattern-store
13
+ */
14
+ import { v4 as uuidv4 } from 'uuid';
15
+ import { ok, err } from '../shared/types/index.js';
16
+ import { toErrorMessage } from '../shared/error-utils.js';
17
+ import { calculateQualityScore, validateQEPattern, mapQEDomainToAQE, PROMOTION_THRESHOLD, } from './qe-patterns.js';
18
+ import { DEFAULT_PATTERN_STORE_CONFIG } from './pattern-store.js';
19
+ // ============================================================================
20
+ // RVF Pattern Store Implementation
21
+ // ============================================================================
22
+ /**
23
+ * Pattern store backed by @ruvector/rvf-node for persistent HNSW.
24
+ *
25
+ * Vectors live in a .rvf file (persistent HNSW, no cold-start rebuild).
26
+ * Metadata (pattern fields, FTS5) lives in SQLite via sqliteStore delegate.
27
+ */
28
+ export class RvfPatternStore {
29
+ createAdapter;
30
+ config;
31
+ rvfPath;
32
+ skipCloseOnDispose;
33
+ adapter = null;
34
+ sqliteStore = null;
35
+ initialized = false;
36
+ rvfInitError = null;
37
+ searchOps = 0;
38
+ totalSearchMs = 0;
39
+ constructor(createAdapter, config) {
40
+ this.createAdapter = createAdapter;
41
+ this.config = config?.base ?? DEFAULT_PATTERN_STORE_CONFIG;
42
+ this.rvfPath = config?.rvfPath ?? '.agentic-qe/patterns.rvf';
43
+ this.skipCloseOnDispose = config?.skipCloseOnDispose ?? false;
44
+ }
45
+ /**
46
+ * Attach SQLite persistence for metadata (pattern fields, FTS5).
47
+ * Must be called before initialize() if SQLite metadata is desired.
48
+ */
49
+ setSqliteStore(store) {
50
+ this.sqliteStore = store;
51
+ }
52
+ /** Get the underlying RVF adapter (for COW branching, migration, etc.) */
53
+ getAdapter() {
54
+ return this.adapter;
55
+ }
56
+ // --------------------------------------------------------------------------
57
+ // IPatternStore — Lifecycle
58
+ // --------------------------------------------------------------------------
59
+ async initialize() {
60
+ if (this.initialized)
61
+ return;
62
+ try {
63
+ this.adapter = this.createAdapter(this.rvfPath, this.config.embeddingDimension);
64
+ this.initialized = true;
65
+ console.log(`[RvfPatternStore] Initialized: ${this.rvfPath} (dim=${this.config.embeddingDimension})`);
66
+ }
67
+ catch (error) {
68
+ // Do NOT silently swallow — the user chose useRVFPatternStore=true,
69
+ // so they need to know RVF is not working. Log a clear error, set
70
+ // adapter to null, and mark nativeAvailable=false in stats.
71
+ this.rvfInitError = toErrorMessage(error);
72
+ console.error(`[RvfPatternStore] ERROR: RVF native init failed — vector search is DISABLED. ` +
73
+ `Cause: ${this.rvfInitError}. ` +
74
+ `Fix: install @ruvector/rvf-node native bindings, or set useRVFPatternStore=false to use SQLite HNSW.`);
75
+ this.adapter = null;
76
+ this.initialized = true; // mark initialized to prevent retry loops
77
+ }
78
+ // Auto-attach SQLitePatternStore if not explicitly set.
79
+ // This ensures metadata persistence and FTS5 search work even when
80
+ // the RVF adapter is unavailable (e.g. native bindings not installed).
81
+ if (!this.sqliteStore) {
82
+ try {
83
+ const { createSQLitePatternStore } = await import('./sqlite-persistence.js');
84
+ const store = createSQLitePatternStore();
85
+ await store.initialize();
86
+ this.sqliteStore = store;
87
+ }
88
+ catch {
89
+ // SQLite auto-attach is best-effort
90
+ }
91
+ }
92
+ }
93
+ async dispose() {
94
+ if (this.adapter && !this.skipCloseOnDispose) {
95
+ try {
96
+ this.adapter.close();
97
+ }
98
+ catch { /* best effort */ }
99
+ }
100
+ this.adapter = null;
101
+ this.initialized = false;
102
+ }
103
+ // --------------------------------------------------------------------------
104
+ // IPatternStore — Write operations
105
+ // --------------------------------------------------------------------------
106
+ async store(pattern) {
107
+ await this.ensureInitialized();
108
+ const validation = validateQEPattern(pattern);
109
+ if (!validation.valid) {
110
+ return err(new Error(`Invalid pattern: ${validation.errors.join(', ')}`));
111
+ }
112
+ if (pattern.confidence < this.config.minConfidence) {
113
+ return err(new Error(`Pattern confidence ${pattern.confidence} below threshold ${this.config.minConfidence}`));
114
+ }
115
+ // Persist metadata to SQLite
116
+ if (this.sqliteStore) {
117
+ try {
118
+ this.sqliteStore.storePattern(pattern, pattern.embedding);
119
+ }
120
+ catch (error) {
121
+ console.warn(`[RvfPatternStore] SQLite persist failed for ${pattern.id}:`, toErrorMessage(error));
122
+ }
123
+ }
124
+ // Ingest vector into RVF
125
+ if (pattern.embedding && this.adapter) {
126
+ try {
127
+ const vec = pattern.embedding instanceof Float32Array
128
+ ? pattern.embedding
129
+ : new Float32Array(pattern.embedding);
130
+ this.adapter.ingest([{ id: pattern.id, vector: vec }]);
131
+ }
132
+ catch (error) {
133
+ console.warn(`[RvfPatternStore] RVF ingest failed for ${pattern.id}:`, toErrorMessage(error));
134
+ }
135
+ }
136
+ return ok(pattern.id);
137
+ }
138
+ async create(options) {
139
+ const confidence = options.confidence ?? 0.5;
140
+ const qeDomain = options.qeDomain ?? 'test-generation';
141
+ const pattern = {
142
+ id: uuidv4(),
143
+ patternType: options.patternType,
144
+ qeDomain,
145
+ domain: mapQEDomainToAQE(qeDomain),
146
+ name: options.name,
147
+ description: options.description,
148
+ confidence,
149
+ usageCount: 0,
150
+ successRate: 0,
151
+ qualityScore: calculateQualityScore({ confidence, usageCount: 0, successRate: 0 }),
152
+ context: { tags: [], ...options.context },
153
+ template: { example: '', ...options.template },
154
+ embedding: options.embedding,
155
+ tier: 'short-term',
156
+ createdAt: new Date(),
157
+ lastUsedAt: new Date(),
158
+ successfulUses: 0,
159
+ reusable: false,
160
+ reuseCount: 0,
161
+ averageTokenSavings: 0,
162
+ };
163
+ const result = await this.store(pattern);
164
+ if (!result.success) {
165
+ return err(result.error);
166
+ }
167
+ return ok(pattern);
168
+ }
169
+ // --------------------------------------------------------------------------
170
+ // IPatternStore — Read operations
171
+ // --------------------------------------------------------------------------
172
+ async get(id) {
173
+ if (this.sqliteStore) {
174
+ try {
175
+ return this.sqliteStore.getPattern(id) ?? null;
176
+ }
177
+ catch {
178
+ return null;
179
+ }
180
+ }
181
+ return null;
182
+ }
183
+ async search(query, options = {}) {
184
+ await this.ensureInitialized();
185
+ const startTime = performance.now();
186
+ const limit = options.limit ?? 10;
187
+ const results = [];
188
+ // Vector search via RVF native HNSW
189
+ if (Array.isArray(query) && this.adapter) {
190
+ try {
191
+ const queryVec = query instanceof Float32Array
192
+ ? query
193
+ : new Float32Array(query);
194
+ const rvfResults = this.adapter.search(queryVec, limit * 2);
195
+ for (const hit of rvfResults) {
196
+ const pattern = await this.get(hit.id);
197
+ if (pattern && this.matchesFilters(pattern, options)) {
198
+ const reuseInfo = this.calculateReuseInfo(pattern, hit.score);
199
+ results.push({
200
+ pattern,
201
+ score: hit.score,
202
+ matchType: 'vector',
203
+ similarity: hit.score,
204
+ canReuse: reuseInfo.canReuse,
205
+ estimatedTokenSavings: reuseInfo.estimatedTokenSavings,
206
+ reuseConfidence: reuseInfo.reuseConfidence,
207
+ });
208
+ }
209
+ }
210
+ }
211
+ catch (error) {
212
+ console.warn('[RvfPatternStore] RVF search failed:', toErrorMessage(error));
213
+ }
214
+ }
215
+ // Fallback: when query is a vector but RVF adapter is unavailable,
216
+ // compute cosine similarity over SQLite-stored embeddings in memory.
217
+ // Uses getPattern(id) which joins the embedding from qe_pattern_embeddings.
218
+ if (Array.isArray(query) && !this.adapter && this.sqliteStore && results.length === 0) {
219
+ try {
220
+ const allPatterns = this.sqliteStore.getPatterns({ limit: limit * 4 });
221
+ const qArr = query;
222
+ const qMag = Math.sqrt(qArr.reduce((s, v) => s + v * v, 0));
223
+ if (qMag > 0) {
224
+ for (const pat of allPatterns) {
225
+ if (!this.matchesFilters(pat, options))
226
+ continue;
227
+ // getPattern() joins the embedding; getPatterns() does not
228
+ const full = this.sqliteStore.getPattern(pat.id);
229
+ const emb = full?.embedding;
230
+ if (!emb || emb.length !== qArr.length)
231
+ continue;
232
+ let dot = 0, eMag = 0;
233
+ for (let i = 0; i < qArr.length; i++) {
234
+ dot += qArr[i] * emb[i];
235
+ eMag += emb[i] * emb[i];
236
+ }
237
+ eMag = Math.sqrt(eMag);
238
+ if (eMag === 0)
239
+ continue;
240
+ const score = dot / (qMag * eMag);
241
+ const reuseInfo = this.calculateReuseInfo(full, score);
242
+ results.push({
243
+ pattern: full,
244
+ score,
245
+ matchType: 'vector',
246
+ similarity: score,
247
+ canReuse: reuseInfo.canReuse,
248
+ estimatedTokenSavings: reuseInfo.estimatedTokenSavings,
249
+ reuseConfidence: reuseInfo.reuseConfidence,
250
+ });
251
+ }
252
+ }
253
+ }
254
+ catch { /* SQLite fallback best-effort */ }
255
+ }
256
+ // Empty string query = return all patterns sorted by quality score
257
+ if (typeof query === 'string' && !query.trim() && this.sqliteStore) {
258
+ try {
259
+ const allPatterns = this.sqliteStore.getPatterns({ limit: limit * 2 });
260
+ const existingIds = new Set(results.map(r => r.pattern.id));
261
+ for (const pattern of allPatterns) {
262
+ if (existingIds.has(pattern.id))
263
+ continue;
264
+ if (!this.matchesFilters(pattern, options))
265
+ continue;
266
+ const reuseInfo = this.calculateReuseInfo(pattern, pattern.confidence);
267
+ results.push({
268
+ pattern,
269
+ score: pattern.confidence,
270
+ matchType: 'exact',
271
+ similarity: pattern.confidence,
272
+ canReuse: reuseInfo.canReuse,
273
+ estimatedTokenSavings: reuseInfo.estimatedTokenSavings,
274
+ reuseConfidence: reuseInfo.reuseConfidence,
275
+ });
276
+ }
277
+ }
278
+ catch { /* SQLite unavailable */ }
279
+ }
280
+ // FTS5 text search fallback via SQLite
281
+ if (typeof query === 'string' && query.trim() && this.sqliteStore) {
282
+ try {
283
+ const ftsResults = this.sqliteStore.searchFTS(query, limit * 2);
284
+ const existingIds = new Set(results.map(r => r.pattern.id));
285
+ for (const ftsResult of ftsResults) {
286
+ if (existingIds.has(ftsResult.id))
287
+ continue;
288
+ const pattern = await this.get(ftsResult.id);
289
+ if (pattern && this.matchesFilters(pattern, options)) {
290
+ const reuseInfo = this.calculateReuseInfo(pattern, ftsResult.ftsScore);
291
+ results.push({
292
+ pattern,
293
+ score: 0.5 * ftsResult.ftsScore,
294
+ matchType: 'exact',
295
+ similarity: ftsResult.ftsScore,
296
+ canReuse: reuseInfo.canReuse,
297
+ estimatedTokenSavings: reuseInfo.estimatedTokenSavings,
298
+ reuseConfidence: reuseInfo.reuseConfidence,
299
+ });
300
+ }
301
+ }
302
+ }
303
+ catch { /* FTS5 unavailable */ }
304
+ }
305
+ // Sort by score descending, apply limit
306
+ results.sort((a, b) => b.score - a.score);
307
+ const elapsed = performance.now() - startTime;
308
+ this.searchOps++;
309
+ this.totalSearchMs += elapsed;
310
+ return ok(results.slice(0, limit));
311
+ }
312
+ // --------------------------------------------------------------------------
313
+ // IPatternStore — Mutation operations
314
+ // --------------------------------------------------------------------------
315
+ async recordUsage(id, success) {
316
+ if (!this.sqliteStore) {
317
+ return err(new Error('No SQLite store attached'));
318
+ }
319
+ try {
320
+ this.sqliteStore.recordUsage(id, success);
321
+ return ok(undefined);
322
+ }
323
+ catch (error) {
324
+ return err(new Error(`recordUsage failed: ${toErrorMessage(error)}`));
325
+ }
326
+ }
327
+ async promote(id) {
328
+ if (!this.sqliteStore) {
329
+ return err(new Error('No SQLite store attached'));
330
+ }
331
+ try {
332
+ this.sqliteStore.promotePattern(id);
333
+ return ok(undefined);
334
+ }
335
+ catch (error) {
336
+ return err(new Error(`promote failed: ${toErrorMessage(error)}`));
337
+ }
338
+ }
339
+ async delete(id) {
340
+ // Delete from RVF
341
+ if (this.adapter) {
342
+ try {
343
+ this.adapter.delete([id]);
344
+ }
345
+ catch (error) {
346
+ console.warn(`[RvfPatternStore] RVF delete failed for ${id}:`, toErrorMessage(error));
347
+ }
348
+ }
349
+ // Delete from SQLite
350
+ if (this.sqliteStore) {
351
+ try {
352
+ this.sqliteStore.deletePattern(id);
353
+ }
354
+ catch (error) {
355
+ return err(new Error(`SQLite delete failed: ${toErrorMessage(error)}`));
356
+ }
357
+ }
358
+ return ok(undefined);
359
+ }
360
+ async getStats() {
361
+ const rvfStatus = this.adapter?.status();
362
+ // Get pattern count from RVF if available, otherwise fall back to SQLite
363
+ let totalPatterns = rvfStatus?.totalVectors ?? 0;
364
+ if (totalPatterns === 0 && this.sqliteStore) {
365
+ try {
366
+ totalPatterns = this.sqliteStore.getStats().totalPatterns;
367
+ }
368
+ catch { /* best effort */ }
369
+ }
370
+ return {
371
+ totalPatterns,
372
+ byTier: { shortTerm: 0, longTerm: 0 },
373
+ byDomain: {},
374
+ byType: {},
375
+ avgConfidence: 0,
376
+ avgQualityScore: 0,
377
+ avgSuccessRate: 0,
378
+ searchOperations: this.searchOps,
379
+ avgSearchLatencyMs: this.searchOps > 0
380
+ ? this.totalSearchMs / this.searchOps
381
+ : 0,
382
+ hnswStats: {
383
+ nativeAvailable: this.adapter !== null,
384
+ vectorCount: rvfStatus?.totalVectors ?? 0,
385
+ indexSizeBytes: rvfStatus?.fileSizeBytes ?? 0,
386
+ ...(this.rvfInitError ? { rvfInitError: this.rvfInitError } : {}),
387
+ },
388
+ };
389
+ }
390
+ async cleanup() {
391
+ if (!this.sqliteStore) {
392
+ return { removed: 0, promoted: 0 };
393
+ }
394
+ let removed = 0;
395
+ let promoted = 0;
396
+ try {
397
+ // Scan patterns and remove low-quality, promote high-quality
398
+ const patterns = this.sqliteStore.getPatterns({ limit: 10000 });
399
+ for (const pattern of patterns) {
400
+ if (pattern.confidence < this.config.minConfidence && pattern.usageCount > 3) {
401
+ await this.delete(pattern.id);
402
+ removed++;
403
+ }
404
+ else if (pattern.tier === 'short-term'
405
+ && pattern.successfulUses >= PROMOTION_THRESHOLD) {
406
+ await this.promote(pattern.id);
407
+ promoted++;
408
+ }
409
+ }
410
+ }
411
+ catch (error) {
412
+ console.warn('[RvfPatternStore] Cleanup error:', toErrorMessage(error));
413
+ }
414
+ return { removed, promoted };
415
+ }
416
+ // --------------------------------------------------------------------------
417
+ // Private helpers
418
+ // --------------------------------------------------------------------------
419
+ async ensureInitialized() {
420
+ if (!this.initialized) {
421
+ await this.initialize();
422
+ }
423
+ }
424
+ matchesFilters(pattern, options) {
425
+ if (options.patternType && pattern.patternType !== options.patternType)
426
+ return false;
427
+ if (options.domain && pattern.qeDomain !== options.domain)
428
+ return false;
429
+ if (options.tier && pattern.tier !== options.tier)
430
+ return false;
431
+ if (options.minConfidence && pattern.confidence < options.minConfidence)
432
+ return false;
433
+ if (options.minQualityScore && pattern.qualityScore < options.minQualityScore)
434
+ return false;
435
+ return true;
436
+ }
437
+ calculateReuseInfo(pattern, similarity) {
438
+ const reuseCfg = this.config.reuseOptimization;
439
+ const canReuse = reuseCfg.enabled
440
+ && similarity >= reuseCfg.minSimilarityForReuse
441
+ && pattern.successRate >= reuseCfg.minSuccessRateForReuse;
442
+ return {
443
+ canReuse,
444
+ estimatedTokenSavings: canReuse ? 500 : 0,
445
+ reuseConfidence: canReuse ? similarity * pattern.successRate : 0,
446
+ };
447
+ }
448
+ }
449
+ //# sourceMappingURL=rvf-pattern-store.js.map