agentic-qe 3.13.12 → 3.14.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 (415) hide show
  1. package/.claude/skills/qe-court/SKILL.md +4 -4
  2. package/.claude/skills/qe-court/config-schema.json +38 -0
  3. package/.claude/skills/qe-court/evals/qe-court.yaml +8 -8
  4. package/.claude/skills/skills-manifest.json +1 -1
  5. package/CHANGELOG.md +53 -0
  6. package/assets/skills/qe-court/SKILL.md +4 -4
  7. package/assets/skills/qe-court/config-schema.json +38 -0
  8. package/assets/skills/qe-court/evals/qe-court.yaml +8 -8
  9. package/assets/skills/skills-manifest.json +1 -1
  10. package/dist/cli/brain-commands.d.ts +1 -0
  11. package/dist/cli/brain-commands.js +1 -0
  12. package/dist/cli/bundle.js +5 -5
  13. package/dist/cli/chunks/adapter-3VBXL7DO.js +2 -0
  14. package/dist/cli/chunks/{agent-booster-wasm-7I7LZFNC.js → agent-booster-wasm-JZO6VUW4.js} +2 -2
  15. package/dist/cli/chunks/{agent-handler-QZZT52BH.js → agent-handler-534KFGEJ.js} +2 -2
  16. package/dist/cli/chunks/{agent-memory-branch-MLQS5Y26.js → agent-memory-branch-B7KWLWY4.js} +2 -2
  17. package/dist/cli/chunks/aqe-learning-engine-NXRNKJNA.js +2 -0
  18. package/dist/cli/chunks/{arena-IM4CP6LP.js → arena-7CCD3S3I.js} +2 -2
  19. package/dist/cli/chunks/{arena-WRIY37EJ.js → arena-OW5MELJX.js} +4 -4
  20. package/dist/cli/chunks/{audit-BSAQ4EFN.js → audit-BHVKN4E2.js} +3 -3
  21. package/dist/cli/chunks/base-F6GMOKU2.js +2 -0
  22. package/dist/cli/chunks/{better-sqlite3-X2XZUXWZ.js → better-sqlite3-P5FA6WFK.js} +2 -2
  23. package/dist/cli/chunks/brain-handler-WNW5LOV7.js +90 -0
  24. package/dist/cli/chunks/{branch-enumerator-NI4Q7DSJ.js → branch-enumerator-TVZ2ODKH.js} +2 -2
  25. package/dist/cli/chunks/{browser-PXBLORUZ.js → browser-TCEB2W2F.js} +2 -2
  26. package/dist/cli/chunks/browser-workflow-QRDC46LR.js +2 -0
  27. package/dist/cli/chunks/{chunk-4FVOJBEU.js → chunk-2D7UBX5S.js} +1 -1
  28. package/dist/cli/chunks/{chunk-NG6A7LCG.js → chunk-2HYVOX6N.js} +1 -1
  29. package/dist/cli/chunks/{chunk-MGKH4LCM.js → chunk-2NO4H35K.js} +1 -1
  30. package/dist/cli/chunks/{chunk-UC4EIULB.js → chunk-2O4DDPEA.js} +19 -19
  31. package/dist/cli/chunks/{chunk-IT5QIUUA.js → chunk-3EM2MK3Z.js} +2 -2
  32. package/dist/cli/chunks/chunk-3GUO4ERR.js +24 -0
  33. package/dist/cli/chunks/{chunk-XIKYUBIV.js → chunk-3JIJBR4V.js} +2 -2
  34. package/dist/cli/chunks/{chunk-NL2SCAGJ.js → chunk-3QT6S3A3.js} +3 -3
  35. package/dist/cli/chunks/{chunk-SOS37ECY.js → chunk-3RYTAYR6.js} +1 -1
  36. package/dist/cli/chunks/chunk-43GPSYAL.js +14 -0
  37. package/dist/cli/chunks/{chunk-IPDM3CAK.js → chunk-4FEJEVG7.js} +1 -1
  38. package/dist/cli/chunks/{chunk-M3354CE4.js → chunk-4MK2G6TK.js} +2 -2
  39. package/dist/cli/chunks/{chunk-AM42ROKZ.js → chunk-4XTHRAUV.js} +1 -1
  40. package/dist/cli/chunks/{chunk-LRO74LPA.js → chunk-4ZVGSVHV.js} +4 -4
  41. package/dist/cli/chunks/{chunk-I5SXLV7D.js → chunk-52DFCV57.js} +2 -2
  42. package/dist/cli/chunks/{chunk-WYFAPA2G.js → chunk-5LEAGKX5.js} +2 -2
  43. package/dist/cli/chunks/{chunk-OZ53BIY5.js → chunk-5MZF4N4Q.js} +1 -1
  44. package/dist/cli/chunks/{chunk-NDRZZSD5.js → chunk-5VDVYTO5.js} +2 -2
  45. package/dist/cli/chunks/chunk-5XGVSQS2.js +11 -0
  46. package/dist/cli/chunks/{chunk-SXFSJJZF.js → chunk-6AOZU3UN.js} +2 -2
  47. package/dist/cli/chunks/{chunk-2VTX4SYW.js → chunk-6AYO3IR2.js} +2 -2
  48. package/dist/cli/chunks/{chunk-4AITMWFZ.js → chunk-6DPAMYLU.js} +2 -2
  49. package/dist/cli/chunks/{chunk-WE3VKDMK.js → chunk-6IJMD2ZL.js} +3 -3
  50. package/dist/cli/chunks/{chunk-5E76HULA.js → chunk-6IZQSLYZ.js} +2 -2
  51. package/dist/cli/chunks/{chunk-VBHA4SDU.js → chunk-6W42XWLL.js} +2 -2
  52. package/dist/cli/chunks/{chunk-ASWWBNX2.js → chunk-7BOPFN3Y.js} +2 -2
  53. package/dist/cli/chunks/{chunk-SCQNISGS.js → chunk-7OUMJCJT.js} +1 -1
  54. package/dist/cli/chunks/{chunk-M73KM3AZ.js → chunk-7RAB2BZY.js} +160 -26
  55. package/dist/cli/chunks/{chunk-4ANJV6I4.js → chunk-7RVAHJQZ.js} +3 -3
  56. package/dist/cli/chunks/{chunk-VQCLSX7T.js → chunk-A2WZEMWT.js} +1 -1
  57. package/dist/cli/chunks/{chunk-YQOQVSYU.js → chunk-A7SKM6JL.js} +1 -1
  58. package/dist/cli/chunks/chunk-AFGT26NR.js +2 -0
  59. package/dist/cli/chunks/{chunk-JVFZAJ5N.js → chunk-AR6SATU3.js} +2 -2
  60. package/dist/cli/chunks/{chunk-YL2GOJF6.js → chunk-AVLA5PBJ.js} +2 -2
  61. package/dist/cli/chunks/{chunk-R7LGVJMZ.js → chunk-B3H4K7CY.js} +2 -2
  62. package/dist/cli/chunks/{chunk-UWZYXI3R.js → chunk-BQCTO7UB.js} +2 -2
  63. package/dist/cli/chunks/{chunk-HAJG44BD.js → chunk-BZ4QVFP2.js} +2 -2
  64. package/dist/cli/chunks/{chunk-NNLZAVFH.js → chunk-CIUOC5F3.js} +1 -1
  65. package/dist/cli/chunks/{chunk-KRZYWVS3.js → chunk-CIZ6LSNV.js} +2 -2
  66. package/dist/cli/chunks/{chunk-HQWFZQMJ.js → chunk-DDPJUAXQ.js} +2 -2
  67. package/dist/cli/chunks/{chunk-X3JNFQW2.js → chunk-DJITEQYS.js} +2 -2
  68. package/dist/cli/chunks/{chunk-TB2N3CAK.js → chunk-DOWCOZDO.js} +2 -2
  69. package/dist/cli/chunks/{chunk-GJJWXRAD.js → chunk-E4NU4BJA.js} +2 -2
  70. package/dist/cli/chunks/{chunk-H3GAR4SV.js → chunk-E722WNWC.js} +2 -2
  71. package/dist/cli/chunks/chunk-ECTPFCON.js +2 -0
  72. package/dist/cli/chunks/{chunk-4YFXF5AQ.js → chunk-EJ6IP7DE.js} +5 -5
  73. package/dist/cli/chunks/{chunk-AN5CGTTJ.js → chunk-ENGKLFLY.js} +2 -2
  74. package/dist/cli/chunks/{chunk-7A4WTRWI.js → chunk-FF43SRP6.js} +1 -1
  75. package/dist/cli/chunks/{chunk-52VGZJSD.js → chunk-FOHYBR3O.js} +1 -1
  76. package/dist/cli/chunks/{chunk-6KI6LAAZ.js → chunk-FRL3X2QA.js} +2 -2
  77. package/dist/cli/chunks/{chunk-3ASVQILY.js → chunk-GKNDP5VK.js} +2 -2
  78. package/dist/cli/chunks/{chunk-2VY7FL6A.js → chunk-GVEJP5T7.js} +2 -2
  79. package/dist/cli/chunks/{chunk-VD53LBF7.js → chunk-H3YDDKBW.js} +3 -3
  80. package/dist/cli/chunks/{chunk-Z6DSYLAG.js → chunk-H6NFDOMK.js} +1 -1
  81. package/dist/cli/chunks/{chunk-BZIPYXSW.js → chunk-H76TV4UU.js} +3 -3
  82. package/dist/cli/chunks/{chunk-XT473WPO.js → chunk-HJIAVR6P.js} +2 -2
  83. package/dist/cli/chunks/{chunk-MLXLGBQZ.js → chunk-HLNQDRHA.js} +1 -1
  84. package/dist/cli/chunks/{chunk-DGFINXUE.js → chunk-HNKPLVYS.js} +1 -1
  85. package/dist/cli/chunks/{chunk-WXU7FAEB.js → chunk-HQ7243G3.js} +2 -2
  86. package/dist/cli/chunks/{chunk-VA2ORJB5.js → chunk-HQHLHSJO.js} +2 -2
  87. package/dist/cli/chunks/{chunk-2W3D5A4R.js → chunk-I3VHXA2W.js} +2 -2
  88. package/dist/cli/chunks/{chunk-EG73WYAW.js → chunk-IE5LC7MB.js} +2 -2
  89. package/dist/cli/chunks/{chunk-S6WHYOWV.js → chunk-IL4AEB3J.js} +27 -25
  90. package/dist/cli/chunks/{chunk-TWUWLSGQ.js → chunk-IL6QRXRP.js} +6 -6
  91. package/dist/cli/chunks/{chunk-5PNQNBDZ.js → chunk-IQ3JFHZN.js} +1 -1
  92. package/dist/cli/chunks/{chunk-MB2KLJ6Q.js → chunk-IQLRA4FV.js} +1 -1
  93. package/dist/cli/chunks/{chunk-A5RWLPVT.js → chunk-J3XSHJGK.js} +2 -2
  94. package/dist/cli/chunks/{chunk-U5G6OC2C.js → chunk-JAK5UUWH.js} +2 -2
  95. package/dist/cli/chunks/{chunk-E67ZXRG6.js → chunk-JGROLJ33.js} +1 -1
  96. package/dist/cli/chunks/{chunk-VNODKACB.js → chunk-JMKMDSXG.js} +2 -2
  97. package/dist/cli/chunks/{chunk-LXVT6JXO.js → chunk-JRKEBESE.js} +2 -2
  98. package/dist/cli/chunks/{chunk-AKUDUB3O.js → chunk-JTWJR2KY.js} +2 -2
  99. package/dist/cli/chunks/{chunk-IOJ34SXJ.js → chunk-JY4VZ6BN.js} +2 -2
  100. package/dist/cli/chunks/{chunk-AYH3DMW2.js → chunk-K6CGQR5R.js} +1 -1
  101. package/dist/cli/chunks/{chunk-QXO35J6F.js → chunk-KDIZQHG5.js} +2 -2
  102. package/dist/cli/chunks/{chunk-7LATB5IR.js → chunk-KTSCZ7AW.js} +2 -2
  103. package/dist/cli/chunks/{chunk-M7CPJW53.js → chunk-L4C42WYI.js} +2 -2
  104. package/dist/cli/chunks/{chunk-QG5L2JM5.js → chunk-LCSVROU7.js} +10 -10
  105. package/dist/cli/chunks/{chunk-6BSZHNOC.js → chunk-LKR7T3OZ.js} +1 -1
  106. package/dist/cli/chunks/{chunk-GJUGG6UR.js → chunk-LZHTCUCO.js} +2 -2
  107. package/dist/cli/chunks/{chunk-7RVLVIAI.js → chunk-M3HUZD2I.js} +1 -1
  108. package/dist/cli/chunks/{chunk-RP5VFZJO.js → chunk-MO7EITJK.js} +2 -2
  109. package/dist/cli/chunks/{chunk-44NPKZGI.js → chunk-N2YAUDAV.js} +2 -2
  110. package/dist/cli/chunks/{chunk-G6FJHDUG.js → chunk-NDPQ2WPU.js} +1 -1
  111. package/dist/cli/chunks/{chunk-UBOGJHWC.js → chunk-NKWO2X3T.js} +1 -1
  112. package/dist/cli/chunks/{chunk-NJ3QXJ54.js → chunk-NOPVFBQM.js} +2 -2
  113. package/dist/cli/chunks/{chunk-AOOCV56W.js → chunk-NYARYONH.js} +1 -1
  114. package/dist/cli/chunks/{chunk-6KKVMPPR.js → chunk-O2MZZL54.js} +2 -2
  115. package/dist/cli/chunks/{chunk-2JAC57JE.js → chunk-OIYUSWHX.js} +1 -1
  116. package/dist/cli/chunks/{chunk-BODFJ3DC.js → chunk-OONCRNFA.js} +2 -2
  117. package/dist/cli/chunks/{chunk-ZMYV4R32.js → chunk-PEW6FZ47.js} +1 -1
  118. package/dist/cli/chunks/{chunk-42AS3HPO.js → chunk-Q73RRTLE.js} +2 -2
  119. package/dist/cli/chunks/{chunk-IQH2RDN3.js → chunk-QKQZ4IJF.js} +5 -5
  120. package/dist/cli/chunks/{chunk-MYVKTG55.js → chunk-QMMDN4WX.js} +3 -3
  121. package/dist/cli/chunks/chunk-QQCENKCX.js +2 -0
  122. package/dist/cli/chunks/{chunk-7PCIN7UN.js → chunk-QSPRQPEL.js} +2 -2
  123. package/dist/cli/chunks/{chunk-ZSAGRDXA.js → chunk-QZPFUFZG.js} +2 -2
  124. package/dist/cli/chunks/chunk-R2B6EE45.js +2 -0
  125. package/dist/cli/chunks/{chunk-33YZGOT6.js → chunk-R6WJF4D5.js} +2 -2
  126. package/dist/cli/chunks/{chunk-QM4Z7TQH.js → chunk-RGVD6ZUX.js} +1 -1
  127. package/dist/cli/chunks/{chunk-VQD2ELNL.js → chunk-RKUYVVGJ.js} +2 -2
  128. package/dist/cli/chunks/{chunk-5VSS2RBD.js → chunk-S5YVLPXU.js} +2 -2
  129. package/dist/cli/chunks/{chunk-IPZEBALY.js → chunk-SROZXIMT.js} +37 -37
  130. package/dist/cli/chunks/{chunk-GMLRIZ4E.js → chunk-SSV6KSFT.js} +1 -1
  131. package/dist/cli/chunks/{chunk-PVINNJ4P.js → chunk-SUSMHSXT.js} +2 -2
  132. package/dist/cli/chunks/{chunk-KXSUDN46.js → chunk-T3BZAFLP.js} +1 -1
  133. package/dist/cli/chunks/{chunk-MLFELTJX.js → chunk-TGOGCA74.js} +2 -2
  134. package/dist/cli/chunks/{chunk-G45AOQDZ.js → chunk-TKYEP7OR.js} +1 -1
  135. package/dist/cli/chunks/{chunk-KYJBJ56M.js → chunk-TQJE7DNL.js} +2 -2
  136. package/dist/cli/chunks/{chunk-5PI75QYP.js → chunk-TRDEULS7.js} +2 -2
  137. package/dist/cli/chunks/{chunk-OG3DBHIV.js → chunk-U4GZWPKM.js} +2 -2
  138. package/dist/cli/chunks/{chunk-NJ4YVAG7.js → chunk-UI6WSPEK.js} +3 -3
  139. package/dist/cli/chunks/{chunk-4M7YZ2X7.js → chunk-UUJ5VQJM.js} +1 -1
  140. package/dist/cli/chunks/{chunk-UJUK6T4V.js → chunk-VESOYP6A.js} +2 -2
  141. package/dist/cli/chunks/{chunk-7ZVO7I4Q.js → chunk-VOSISOFD.js} +1 -1
  142. package/dist/cli/chunks/{chunk-HRTSYT4N.js → chunk-VPVZHJSU.js} +2 -2
  143. package/dist/cli/chunks/{chunk-66OQ7AB3.js → chunk-VRRG66XB.js} +1 -1
  144. package/dist/cli/chunks/{chunk-4Z4X2ND4.js → chunk-VXU53F7Z.js} +2 -2
  145. package/dist/cli/chunks/{chunk-XM5I7J5S.js → chunk-VYENTZ45.js} +2 -2
  146. package/dist/cli/chunks/chunk-WJXHE52V.js +65 -0
  147. package/dist/cli/chunks/{chunk-3XVZHJQT.js → chunk-WKNWRDA5.js} +1 -1
  148. package/dist/cli/chunks/{chunk-DFLASG3B.js → chunk-WTHAVFIC.js} +1 -1
  149. package/dist/cli/chunks/{chunk-NTALX2YC.js → chunk-WWWX76QB.js} +2 -2
  150. package/dist/cli/chunks/{chunk-L3GBNX7B.js → chunk-XITTURP2.js} +2 -2
  151. package/dist/cli/chunks/{chunk-FI6J3UHJ.js → chunk-XXFKN7LB.js} +1 -1
  152. package/dist/cli/chunks/{chunk-RP2BRRLX.js → chunk-YEAC3DC6.js} +2 -2
  153. package/dist/cli/chunks/{chunk-JTYCOFTD.js → chunk-YKWMKRYB.js} +1 -1
  154. package/dist/cli/chunks/chunk-YKZV7O65.js +2 -0
  155. package/dist/cli/chunks/{chunk-N4OQ4D4V.js → chunk-YW4RNZWT.js} +2 -2
  156. package/dist/cli/chunks/{chunk-P6EFKHNI.js → chunk-ZAAYOENS.js} +2 -2
  157. package/dist/cli/chunks/chunk-ZBKGX72B.js +13 -0
  158. package/dist/cli/chunks/{chunk-TJVTV3HP.js → chunk-ZBOWR4XT.js} +2 -2
  159. package/dist/cli/chunks/{chunk-4THFPRFM.js → chunk-ZCVJCCQQ.js} +2 -2
  160. package/dist/cli/chunks/{chunk-X2SZCVDA.js → chunk-ZI3UO7QR.js} +8 -7
  161. package/dist/cli/chunks/{chunk-DCVFHVPR.js → chunk-ZNSMVQCG.js} +2 -2
  162. package/dist/cli/chunks/{chunk-Z56BBX77.js → chunk-ZQSXG7FA.js} +2 -2
  163. package/dist/cli/chunks/{ci-QAUD62WH.js → ci-B432UH6N.js} +2 -2
  164. package/dist/cli/chunks/{ci-output-TZDVTNE7.js → ci-output-GTHH7WYG.js} +2 -2
  165. package/dist/cli/chunks/{circuit-breaker-ZWPHJ7YJ.js → circuit-breaker-VW75DLME.js} +2 -2
  166. package/dist/cli/chunks/{claude-flow-setup-SCB4EURN.js → claude-flow-setup-RE3IVT7U.js} +2 -2
  167. package/dist/cli/chunks/client-HNBZUEVV.js +2 -0
  168. package/dist/cli/chunks/{cline-installer-EHZLMLXF.js → cline-installer-NUBZZ55N.js} +2 -2
  169. package/dist/cli/chunks/{code-3N6PBJMK.js → code-K6JCWKNW.js} +2 -2
  170. package/dist/cli/chunks/{code-index-extractor-6DIKHNRI.js → code-index-extractor-I4ILB5JN.js} +2 -2
  171. package/dist/cli/chunks/{codex-installer-P7DPQMYL.js → codex-installer-AKQ5BCHU.js} +2 -2
  172. package/dist/cli/chunks/{completions-5MKWWCCE.js → completions-V3KJVJF4.js} +2 -2
  173. package/dist/cli/chunks/{complexity-analyzer-TPM4IPEK.js → complexity-analyzer-HRG7OOY3.js} +2 -2
  174. package/dist/cli/chunks/{continuedev-installer-VXODKGVX.js → continuedev-installer-CNTDONWG.js} +2 -2
  175. package/dist/cli/chunks/{copilot-installer-PVD5O56P.js → copilot-installer-XPWWIWYA.js} +2 -2
  176. package/dist/cli/chunks/core-handlers-TB7NLYXL.js +2 -0
  177. package/dist/cli/chunks/{cost-tracker-JOMZEQF3.js → cost-tracker-MFNLQ56K.js} +2 -2
  178. package/dist/cli/chunks/{coverage-HTXLEV3B.js → coverage-KOIK654V.js} +3 -3
  179. package/dist/cli/chunks/cross-domain-router-MDSI553U.js +2 -0
  180. package/dist/cli/chunks/{cursor-installer-SHKDTDDZ.js → cursor-installer-S5MKLRQQ.js} +2 -2
  181. package/dist/cli/chunks/{daemon-FCFEWVVJ.js → daemon-DUS6JYW6.js} +3 -3
  182. package/dist/cli/chunks/{daemon-PN4FEPLE.js → daemon-Z7VPGWHY.js} +4 -4
  183. package/dist/cli/chunks/{dag-attention-scheduler-PLOHU5SR.js → dag-attention-scheduler-7CQ3ARNI.js} +2 -2
  184. package/dist/cli/chunks/{detect-F3H4ZEZY.js → detect-WORBCAYF.js} +2 -2
  185. package/dist/cli/chunks/{dist-node-5TC665N6.js → dist-node-KRNI6OYW.js} +2 -2
  186. package/dist/cli/chunks/{domain-handler-ZIWVFXCU.js → domain-handler-KRUR2VQG.js} +2 -2
  187. package/dist/cli/chunks/{domain-transfer-7Q5JYMYR.js → domain-transfer-VEOVLV54.js} +2 -2
  188. package/dist/cli/chunks/dream-X7ISHFEE.js +2 -0
  189. package/dist/cli/chunks/embed-and-insert-pattern-QU3NQVA5.js +3 -0
  190. package/dist/cli/chunks/{eval-E2K2T75A.js → eval-AYQ7BSUP.js} +2 -2
  191. package/dist/cli/chunks/{experience-capture-middleware-Z5SE2O53.js → experience-capture-middleware-AWQBL6LT.js} +3 -3
  192. package/dist/cli/chunks/{fast-paths-3H52RSUK.js → fast-paths-V5EL4BYJ.js} +2 -2
  193. package/dist/cli/chunks/{feature-flags-LUHSMHPS.js → feature-flags-BXX7BP22.js} +2 -2
  194. package/dist/cli/chunks/{feature-flags-ONIKUZVK.js → feature-flags-P34BPRWU.js} +2 -2
  195. package/dist/cli/chunks/{file-discovery-FLYSYSS4.js → file-discovery-MS6BKQ2U.js} +2 -2
  196. package/dist/cli/chunks/{fleet-6OJUAAKV.js → fleet-7WVVPA4W.js} +3 -3
  197. package/dist/cli/chunks/{gnn-wrapper-PUL6B7KZ.js → gnn-wrapper-7WQ3LEPG.js} +2 -2
  198. package/dist/cli/chunks/{heartbeat-handler-HGHHDUDY.js → heartbeat-handler-P7QD3BZH.js} +4 -4
  199. package/dist/cli/chunks/heartbeat-scheduler-2C5XGFQT.js +2 -0
  200. package/dist/cli/chunks/hnsw-adapter-KCVMXLUL.js +2 -0
  201. package/dist/cli/chunks/hnsw-index-OGWZS6MP.js +2 -0
  202. package/dist/cli/chunks/{hnsw-legacy-bridge-NDZSNMYX.js → hnsw-legacy-bridge-Y3GAR3UP.js} +2 -2
  203. package/dist/cli/chunks/{hnswlib-node-PISLKSO2.js → hnswlib-node-5QUXZQWQ.js} +2 -2
  204. package/dist/cli/chunks/{hooks-WYG54MRI.js → hooks-2D64KPRY.js} +10 -10
  205. package/dist/cli/chunks/{hypergraph-engine-EDHKHZZ2.js → hypergraph-engine-5INXEZDP.js} +2 -2
  206. package/dist/cli/chunks/{hypergraph-handler-OCHZAPPL.js → hypergraph-handler-YJJJ3ESZ.js} +3 -3
  207. package/dist/cli/chunks/impact-analyzer-IBJ43GQL.js +2 -0
  208. package/dist/cli/chunks/{init-handler-5TCJ672H.js → init-handler-QSFYJN5Q.js} +6 -6
  209. package/dist/cli/chunks/init-wizard-6XMFD5LP.js +2 -0
  210. package/dist/cli/chunks/kernel-UDUMUPB3.js +2 -0
  211. package/dist/cli/chunks/{kilocode-installer-SWUQRCTZ.js → kilocode-installer-3N3QGTJU.js} +2 -2
  212. package/dist/cli/chunks/{kiro-installer-L22EBAM5.js → kiro-installer-GIWVTFZQ.js} +2 -2
  213. package/dist/cli/chunks/knowledge-graph-JRYTUG3W.js +2 -0
  214. package/dist/cli/chunks/learning-SGO2DQ5Q.js +122 -0
  215. package/dist/cli/chunks/{llm-router-F2L4LFT2.js → llm-router-HBBULO65.js} +14 -14
  216. package/dist/cli/chunks/llm-router-service-KF5ZALUQ.js +2 -0
  217. package/dist/cli/chunks/{load-A4ZF2KHC.js → load-B5OFYB4H.js} +2 -2
  218. package/dist/cli/chunks/load-test-LHMBCNCH.js +2 -0
  219. package/dist/cli/chunks/{mcp-T2Z46NNK.js → mcp-FG3LNQR4.js} +2 -2
  220. package/dist/cli/chunks/{memory-PUC3J6XC.js → memory-SPS7ZWLC.js} +5 -5
  221. package/dist/cli/chunks/memory-backend-WZHKHBZK.js +2 -0
  222. package/dist/cli/chunks/memory-handlers-P7FTPWP3.js +2 -0
  223. package/dist/cli/chunks/{multi-model-executor-U5L4FI4O.js → multi-model-executor-PUB7E6KH.js} +2 -2
  224. package/dist/cli/chunks/{opencode-installer-UWI6KHYH.js → opencode-installer-TGCSGVG2.js} +2 -2
  225. package/dist/cli/chunks/{orchestrator-3BEI7R5D.js → orchestrator-S5FTJFGB.js} +10 -13
  226. package/dist/cli/chunks/pattern-null-store-UZSHCRL2.js +2 -0
  227. package/dist/cli/chunks/{pattern-usage-recorder-EGWUI5LU.js → pattern-usage-recorder-LCXXGRAB.js} +2 -2
  228. package/dist/cli/chunks/{pipeline-JG6M4RHD.js → pipeline-ENOSRHKW.js} +2 -2
  229. package/dist/cli/chunks/{platform-F76G6RUI.js → platform-WCRBO3Z7.js} +2 -2
  230. package/dist/cli/chunks/{plugin-EEGN3PMK.js → plugin-JZ5ODJSU.js} +2 -2
  231. package/dist/cli/chunks/{prime-radiant-advanced-wasm-7KZAINFT.js → prime-radiant-advanced-wasm-DPJUPNCG.js} +2 -2
  232. package/dist/cli/chunks/protocol-executor-42NLVDTC.js +2 -0
  233. package/dist/cli/chunks/{protocol-handler-UCEHYK2R.js → protocol-handler-IP4NLVY3.js} +2 -2
  234. package/dist/cli/chunks/{prove-JSNG75VD.js → prove-P6FM4RU7.js} +2 -2
  235. package/dist/cli/chunks/qe-reasoning-bank-W74RSMMU.js +2 -0
  236. package/dist/cli/chunks/{quality-7SRM2HBM.js → quality-UHP4XO26.js} +2 -2
  237. package/dist/cli/chunks/{quality-gate-A5MPWHST.js → quality-gate-63DDBSGM.js} +3 -3
  238. package/dist/cli/chunks/queen-coordinator-XELKSRMS.js +2 -0
  239. package/dist/cli/chunks/real-embeddings-6SO5MFRQ.js +2 -0
  240. package/dist/cli/chunks/{roocode-installer-UYQK64BZ.js → roocode-installer-WTWUOFCH.js} +2 -2
  241. package/dist/cli/chunks/router-GTW2EQZV.js +2 -0
  242. package/dist/cli/chunks/routing-feedback-NVOBWEMK.js +2 -0
  243. package/dist/cli/chunks/{routing-handler-PY3KPDTH.js → routing-handler-IK7HYERQ.js} +2 -2
  244. package/dist/cli/chunks/{ruvector-commands-GCAOUTYS.js → ruvector-commands-THLB4NIM.js} +2 -2
  245. package/dist/cli/chunks/rvf-dual-writer-5OPVMXNL.js +2 -0
  246. package/dist/cli/chunks/rvf-migration-adapter-5S4YFTX4.js +2 -0
  247. package/dist/cli/chunks/rvf-migration-coordinator-BUKCSHBD.js +2 -0
  248. package/dist/cli/chunks/rvf-native-adapter-LYSJHEVX.js +2 -0
  249. package/dist/cli/chunks/{rvf-store-integrity-HNDKOM4L.js → rvf-store-integrity-ECTADZIN.js} +2 -2
  250. package/dist/cli/chunks/safe-db-AEB3JMLD.js +2 -0
  251. package/dist/cli/chunks/schedule-4QNPCQNT.js +2 -0
  252. package/dist/cli/chunks/scheduler-S3DFHX6A.js +2 -0
  253. package/dist/cli/chunks/{security-MQ2VB7PY.js → security-HN4UXFXX.js} +3 -3
  254. package/dist/cli/chunks/{shared-rvf-adapter-TAZEU6QK.js → shared-rvf-adapter-XJCPX5SN.js} +2 -2
  255. package/dist/cli/chunks/{shared-rvf-dual-writer-B7N6AOCY.js → shared-rvf-dual-writer-23X5PNY5.js} +2 -2
  256. package/dist/cli/chunks/sqlite-persistence-L2KISU2H.js +2 -0
  257. package/dist/cli/chunks/{status-handler-NZP7DFHE.js → status-handler-ZXANTHKT.js} +2 -2
  258. package/dist/cli/chunks/{structural-health-ALLUQ4X6.js → structural-health-LR6WI3AH.js} +2 -2
  259. package/dist/cli/chunks/{sync-WJJG5J6V.js → sync-4OEI3BC2.js} +2 -2
  260. package/dist/cli/chunks/{sync-MM7OCUYD.js → sync-I5IUJF33.js} +2 -2
  261. package/dist/cli/chunks/{task-handler-CAQUEEB4.js → task-handler-R3ATJKU5.js} +2 -2
  262. package/dist/cli/chunks/{task-handlers-25BJ7D3W.js → task-handlers-4X357AEW.js} +3 -3
  263. package/dist/cli/chunks/{test-HW7GVGVN.js → test-PR2B5H2F.js} +4 -4
  264. package/dist/cli/chunks/{test-scheduling-HTMFJMSP.js → test-scheduling-ZNOSQVLD.js} +3 -3
  265. package/dist/cli/chunks/token-bootstrap-LYXOI72S.js +2 -0
  266. package/dist/cli/chunks/{token-usage-RJZDMBDP.js → token-usage-R6EQZBX2.js} +2 -2
  267. package/dist/cli/chunks/{transformers-3YFW3EUO.js → transformers-COQWK27J.js} +2 -2
  268. package/dist/cli/chunks/{tree-sitter-wasm-parser-U3PQPIK7.js → tree-sitter-wasm-parser-LLIW2X3M.js} +2 -2
  269. package/dist/cli/chunks/{types-7Q762WDO.js → types-MEYTZITK.js} +2 -2
  270. package/dist/cli/chunks/unified-memory-5KQMA7FV.js +2 -0
  271. package/dist/cli/chunks/unified-memory-hnsw-PQRPTYOD.js +2 -0
  272. package/dist/cli/chunks/unified-persistence-YDONVPJB.js +2 -0
  273. package/dist/cli/chunks/{upgrade-F7MKJWBQ.js → upgrade-DVIJ456A.js} +2 -2
  274. package/dist/cli/chunks/{validate-B27AVRA6.js → validate-UYTSMJ5X.js} +2 -2
  275. package/dist/cli/chunks/{validate-swarm-GYZR3GNL.js → validate-swarm-P32WCJR6.js} +2 -2
  276. package/dist/cli/chunks/{vibium-W4XQMPJP.js → vibium-JGVOLM6X.js} +2 -2
  277. package/dist/cli/chunks/visual-security-RJ7RTNGJ.js +2 -0
  278. package/dist/cli/chunks/{web-tree-sitter-I7CDCFJU.js → web-tree-sitter-5ZGNCTPN.js} +2 -2
  279. package/dist/cli/chunks/{windsurf-installer-UYLHFDHU.js → windsurf-installer-IILSSQAE.js} +2 -2
  280. package/dist/cli/chunks/{witness-chain-B66SYZKU.js → witness-chain-JZMXCG3B.js} +2 -2
  281. package/dist/cli/chunks/witness-chain-YXXXNGAM.js +2 -0
  282. package/dist/cli/chunks/{witness-key-manager-U4JPAHVW.js → witness-key-manager-UUTLNUIH.js} +2 -2
  283. package/dist/cli/chunks/{workflow-DYMO47FF.js → workflow-NS7HXVHZ.js} +4 -4
  284. package/dist/cli/chunks/workflow-orchestrator-5KUAVSTH.js +2 -0
  285. package/dist/cli/chunks/{wrappers-7S6DQTEA.js → wrappers-XKEDSV5W.js} +2 -2
  286. package/dist/cli/commands/learning.js +44 -0
  287. package/dist/cli/commands/llm-router.js +27 -21
  288. package/dist/cli/handlers/brain-handler.js +2 -0
  289. package/dist/context/compaction/index.d.ts +1 -0
  290. package/dist/context/compaction/index.js +3 -0
  291. package/dist/context/compaction/instruction-provenance.d.ts +20 -0
  292. package/dist/context/compaction/instruction-provenance.js +18 -0
  293. package/dist/context/compaction/tier2-session-summary.d.ts +8 -0
  294. package/dist/context/compaction/tier2-session-summary.js +20 -0
  295. package/dist/context/compaction/tier3-llm-compact.d.ts +4 -0
  296. package/dist/context/compaction/tier3-llm-compact.js +32 -4
  297. package/dist/init/phases/07-hooks.js +0 -3
  298. package/dist/integrations/embeddings/base/EmbeddingGenerator.js +4 -2
  299. package/dist/integrations/ruvector/brain-exporter.d.ts +1 -1
  300. package/dist/integrations/ruvector/brain-exporter.js +15 -3
  301. package/dist/integrations/ruvector/brain-rvf-exporter.d.ts +4 -0
  302. package/dist/integrations/ruvector/brain-rvf-exporter.js +118 -37
  303. package/dist/integrations/ruvector/brain-search.d.ts +1 -1
  304. package/dist/integrations/ruvector/brain-search.js +1 -1
  305. package/dist/integrations/ruvector/brain-shared.d.ts +4 -2
  306. package/dist/integrations/ruvector/brain-shared.js +11 -4
  307. package/dist/integrations/ruvector/brain-table-ddl.d.ts +2 -2
  308. package/dist/integrations/ruvector/brain-table-ddl.js +20 -8
  309. package/dist/integrations/ruvector/cognitive-container.js +1 -1
  310. package/dist/integrations/ruvector/rvf-dual-writer.d.ts +4 -0
  311. package/dist/integrations/ruvector/rvf-dual-writer.js +57 -9
  312. package/dist/integrations/ruvector/rvf-store-integrity.js +1 -1
  313. package/dist/kernel/unified-memory-schemas.d.ts +4 -3
  314. package/dist/kernel/unified-memory-schemas.js +19 -9
  315. package/dist/kernel/unified-memory.d.ts +2 -0
  316. package/dist/kernel/unified-memory.js +19 -0
  317. package/dist/learning/embed-and-insert-pattern.js +6 -3
  318. package/dist/learning/embedding-space.d.ts +50 -0
  319. package/dist/learning/embedding-space.js +128 -0
  320. package/dist/learning/evidence-admission-store.d.ts +15 -0
  321. package/dist/learning/evidence-admission-store.js +68 -0
  322. package/dist/learning/index.d.ts +4 -0
  323. package/dist/learning/index.js +2 -0
  324. package/dist/learning/learning-evidence-admission.d.ts +44 -0
  325. package/dist/learning/learning-evidence-admission.js +97 -0
  326. package/dist/learning/pattern-store.d.ts +5 -0
  327. package/dist/learning/pattern-store.js +36 -7
  328. package/dist/learning/qe-flywheel/coupled-anchor.d.ts +8 -0
  329. package/dist/learning/qe-flywheel/coupled-anchor.js +46 -3
  330. package/dist/learning/qe-reasoning-bank.js +4 -0
  331. package/dist/learning/real-embeddings.d.ts +3 -0
  332. package/dist/learning/real-embeddings.js +40 -3
  333. package/dist/learning/real-qe-reasoning-bank.js +7 -3
  334. package/dist/learning/rvf-pattern-migration.d.ts +2 -0
  335. package/dist/learning/rvf-pattern-migration.js +5 -3
  336. package/dist/learning/rvf-pattern-store.d.ts +3 -0
  337. package/dist/learning/rvf-pattern-store.js +21 -1
  338. package/dist/learning/sqlite-persistence.d.ts +7 -2
  339. package/dist/learning/sqlite-persistence.js +58 -21
  340. package/dist/mcp/bundle.js +603 -447
  341. package/dist/mcp/handlers/memory-handlers.js +6 -2
  342. package/dist/migrations/20260830_add_learning_evidence_tables.d.ts +7 -0
  343. package/dist/migrations/20260830_add_learning_evidence_tables.js +173 -0
  344. package/dist/persistence/rvf-migration-adapter.d.ts +2 -0
  345. package/dist/persistence/rvf-migration-adapter.js +56 -12
  346. package/dist/shared/llm/llm-router-service.d.ts +8 -0
  347. package/dist/shared/llm/llm-router-service.js +21 -3
  348. package/dist/shared/sql-safety.js +4 -0
  349. package/dist/skills/qe-court/cli.d.ts +3 -0
  350. package/dist/skills/qe-court/cli.js +54 -0
  351. package/dist/verification/adversarial-verify/calibrate.d.ts +46 -2
  352. package/dist/verification/adversarial-verify/calibrate.js +104 -2
  353. package/dist/verification/adversarial-verify/index.d.ts +1 -1
  354. package/dist/verification/adversarial-verify/index.js +1 -1
  355. package/package.json +8 -3
  356. package/dist/cli/chunks/adapter-FUV6LBJT.js +0 -2
  357. package/dist/cli/chunks/aqe-learning-engine-QNFNA3J4.js +0 -2
  358. package/dist/cli/chunks/base-37W2XIXC.js +0 -2
  359. package/dist/cli/chunks/brain-handler-TVTTWZGP.js +0 -89
  360. package/dist/cli/chunks/browser-workflow-PDIUEK7B.js +0 -2
  361. package/dist/cli/chunks/chunk-EDRPTLAX.js +0 -2
  362. package/dist/cli/chunks/chunk-GEQWCK4F.js +0 -2
  363. package/dist/cli/chunks/chunk-GQLJYTXN.js +0 -2
  364. package/dist/cli/chunks/chunk-NLZUGANH.js +0 -11
  365. package/dist/cli/chunks/chunk-O4BWESH5.js +0 -2
  366. package/dist/cli/chunks/chunk-PGFCKE4G.js +0 -12
  367. package/dist/cli/chunks/chunk-RACWX2ZX.js +0 -9
  368. package/dist/cli/chunks/chunk-SNC73DWF.js +0 -2
  369. package/dist/cli/chunks/chunk-TDVMILKO.js +0 -2
  370. package/dist/cli/chunks/chunk-TK5XLF3Z.js +0 -65
  371. package/dist/cli/chunks/chunk-UQ4UCHO7.js +0 -2
  372. package/dist/cli/chunks/chunk-VZGP77YU.js +0 -12
  373. package/dist/cli/chunks/chunk-WA6CSEOX.js +0 -2
  374. package/dist/cli/chunks/chunk-WYIXNHPF.js +0 -2
  375. package/dist/cli/chunks/client-4W3KWTAU.js +0 -2
  376. package/dist/cli/chunks/core-handlers-BDU2XBLO.js +0 -2
  377. package/dist/cli/chunks/cross-domain-router-BPB6IHN4.js +0 -2
  378. package/dist/cli/chunks/dream-WFCZGFDY.js +0 -2
  379. package/dist/cli/chunks/embed-and-insert-pattern-VESJQSYD.js +0 -3
  380. package/dist/cli/chunks/heartbeat-scheduler-HWS4SHRM.js +0 -2
  381. package/dist/cli/chunks/hnsw-adapter-7QOBHKRB.js +0 -2
  382. package/dist/cli/chunks/hnsw-index-6WUKYJH7.js +0 -2
  383. package/dist/cli/chunks/hybrid-router-525JTRA5.js +0 -2
  384. package/dist/cli/chunks/impact-analyzer-GG6CJEOK.js +0 -2
  385. package/dist/cli/chunks/init-wizard-4VFAOK4Y.js +0 -2
  386. package/dist/cli/chunks/kernel-N3FQGOST.js +0 -2
  387. package/dist/cli/chunks/knowledge-graph-I5QIHB4G.js +0 -2
  388. package/dist/cli/chunks/learning-TQOGG3CR.js +0 -119
  389. package/dist/cli/chunks/llm-router-service-NCJZYJLG.js +0 -2
  390. package/dist/cli/chunks/load-test-DCJEYIXD.js +0 -2
  391. package/dist/cli/chunks/memory-backend-O6KO2KTX.js +0 -2
  392. package/dist/cli/chunks/memory-handlers-4Z43WEKD.js +0 -2
  393. package/dist/cli/chunks/pattern-null-store-5WIJKX2K.js +0 -2
  394. package/dist/cli/chunks/protocol-executor-5TPNAZTB.js +0 -2
  395. package/dist/cli/chunks/provider-manager-3VMOZ6HV.js +0 -2
  396. package/dist/cli/chunks/qe-reasoning-bank-BATV4NTT.js +0 -2
  397. package/dist/cli/chunks/queen-coordinator-EIHGYBUO.js +0 -2
  398. package/dist/cli/chunks/real-embeddings-ZBF5EQOG.js +0 -2
  399. package/dist/cli/chunks/router-EMVGY4HU.js +0 -2
  400. package/dist/cli/chunks/routing-feedback-JUP4OFB2.js +0 -2
  401. package/dist/cli/chunks/rvf-dual-writer-BUNP4SKD.js +0 -2
  402. package/dist/cli/chunks/rvf-migration-adapter-VSOAPLMB.js +0 -2
  403. package/dist/cli/chunks/rvf-migration-coordinator-LSWEHAWX.js +0 -2
  404. package/dist/cli/chunks/rvf-native-adapter-LOC42TQ6.js +0 -2
  405. package/dist/cli/chunks/safe-db-WQ62IQKV.js +0 -2
  406. package/dist/cli/chunks/schedule-XJRP57TE.js +0 -2
  407. package/dist/cli/chunks/scheduler-EZH5SDIM.js +0 -2
  408. package/dist/cli/chunks/sqlite-persistence-HPEVCTIB.js +0 -2
  409. package/dist/cli/chunks/token-bootstrap-F2DCLWGW.js +0 -2
  410. package/dist/cli/chunks/unified-memory-ATILROKR.js +0 -2
  411. package/dist/cli/chunks/unified-memory-hnsw-XJXAX7DW.js +0 -2
  412. package/dist/cli/chunks/unified-persistence-3TN5PBWE.js +0 -2
  413. package/dist/cli/chunks/visual-security-VFWRBCNA.js +0 -2
  414. package/dist/cli/chunks/witness-chain-JC5LEXRV.js +0 -2
  415. package/dist/cli/chunks/workflow-orchestrator-TKQUF2KN.js +0 -2
@@ -7,6 +7,7 @@
7
7
  */
8
8
  export { cosineSimilarity } from '../shared/utils/vector-math.js';
9
9
  import { type EndpointIdentity } from './embedder-endpoint-client.js';
10
+ import { type EmbeddingSpaceIdentity } from './embedding-space.js';
10
11
  /**
11
12
  * Embedding model configuration
12
13
  */
@@ -83,4 +84,6 @@ export declare function isUsingEndpoint(): boolean;
83
84
  * ADR-097: Returns the endpoint identity fingerprint, or null when not using an endpoint.
84
85
  */
85
86
  export declare function getEndpointIdentity(): EndpointIdentity | null;
87
+ /** Runtime-backed identity of the initialized embedding space. */
88
+ export declare function getActiveEmbeddingSpaceIdentity(): EmbeddingSpaceIdentity | null;
86
89
  //# sourceMappingURL=real-embeddings.d.ts.map
@@ -10,6 +10,7 @@ export { cosineSimilarity } from '../shared/utils/vector-math.js';
10
10
  import { toErrorMessage } from '../shared/error-utils.js';
11
11
  import { EmbedderEndpointClient, redactEndpoint, } from './embedder-endpoint-client.js';
12
12
  import { loadEmbedderIdentity, resetEmbedderIdentityStore, saveEmbedderIdentity, } from './embedder-identity-store.js';
13
+ import { EMBEDDING_SPACE_CANARY, deriveEmbeddingSpaceIdentity, fingerprintEmbeddingRuntime, } from './embedding-space.js';
13
14
  // Lazy-loaded transformer pipeline
14
15
  let pipeline = null;
15
16
  let embeddingModel = null;
@@ -22,6 +23,7 @@ let failureReason = '';
22
23
  */
23
24
  let endpointClient = null;
24
25
  let endpointIdentity = null;
26
+ let activeEmbeddingSpaceIdentity = null;
25
27
  export const DEFAULT_EMBEDDING_CONFIG = {
26
28
  modelName: 'Xenova/all-MiniLM-L6-v2',
27
29
  quantized: true,
@@ -100,6 +102,16 @@ async function initializeModel(config = {}) {
100
102
  });
101
103
  // Probe + identity fingerprint. Fails loud on dim mismatch.
102
104
  endpointIdentity = await endpointClient.probe();
105
+ activeEmbeddingSpaceIdentity = deriveEmbeddingSpaceIdentity({
106
+ provider: 'openai-compatible-endpoint',
107
+ model: fullConfig.modelName,
108
+ dimensions: endpointIdentity.dim,
109
+ pooling: 'mean',
110
+ normalized: true,
111
+ preprocessingVersion: 'aqe-text-v1',
112
+ implementation: endpointIdentity.endpoint,
113
+ runtimeFingerprint: endpointIdentity.fingerprint,
114
+ });
103
115
  console.log(`[RealEmbeddings] Endpoint identity: dim=${endpointIdentity.dim} fingerprint=${endpointIdentity.fingerprint}`);
104
116
  // Cross-run drift detection: compare against the last-known identity
105
117
  // for this endpoint (memory.db kv_store, namespace _system). If the
@@ -136,9 +148,11 @@ async function initializeModel(config = {}) {
136
148
  }
137
149
  catch {
138
150
  throw new Error('In-process embeddings require the optional package "@huggingface/transformers", ' +
139
- 'which is not installed. Either run `npm install @huggingface/transformers`, or ' +
140
- 'configure an embedding endpoint (EmbeddingConfig.endpoint / AQE_EMBEDDER_ENDPOINT) ' +
141
- 'so no local model is loaded.');
151
+ 'which is not installed. Configure an embedding endpoint ' +
152
+ '(EmbeddingConfig.endpoint / AQE_EMBEDDER_ENDPOINT) so no local model is loaded. ' +
153
+ 'Installing @huggingface/transformers@4.2.0 is an explicit security opt-in: ' +
154
+ 'its compatible dependency chain currently has unresolved HIGH advisories ' +
155
+ 'GHSA-xcpc-8h2w-3j85 and GHSA-f88m-g3jw-g9cj.');
142
156
  }
143
157
  pipeline = transformers.pipeline;
144
158
  console.log(`[RealEmbeddings] Loading model: ${fullConfig.modelName}`);
@@ -147,6 +161,24 @@ async function initializeModel(config = {}) {
147
161
  embeddingModel = await pipeline('feature-extraction', fullConfig.modelName, {
148
162
  quantized: fullConfig.quantized,
149
163
  });
164
+ const initializedModel = embeddingModel;
165
+ if (!initializedModel)
166
+ throw new Error('Transformer pipeline returned no embedding model');
167
+ const canary = await initializedModel(EMBEDDING_SPACE_CANARY, {
168
+ pooling: 'mean',
169
+ normalize: true,
170
+ });
171
+ const canaryVector = Array.from(canary.data);
172
+ activeEmbeddingSpaceIdentity = deriveEmbeddingSpaceIdentity({
173
+ provider: 'huggingface-transformers',
174
+ model: fullConfig.modelName,
175
+ dimensions: canaryVector.length,
176
+ pooling: 'mean',
177
+ normalized: true,
178
+ preprocessingVersion: 'aqe-text-v1',
179
+ implementation: `transformers:${fullConfig.quantized ? 'quantized' : 'full'}`,
180
+ runtimeFingerprint: fingerprintEmbeddingRuntime(canaryVector),
181
+ });
150
182
  const loadTime = performance.now() - startTime;
151
183
  console.log(`[RealEmbeddings] Model loaded in ${loadTime.toFixed(0)}ms`);
152
184
  }
@@ -356,6 +388,7 @@ export function resetInitialization() {
356
388
  }
357
389
  endpointClient = null;
358
390
  endpointIdentity = null;
391
+ activeEmbeddingSpaceIdentity = null;
359
392
  // Drop the identity-store's cached DB connection so tests that flip cwd or
360
393
  // AQE_MEMORY_PATH between runs don't write into a stale handle.
361
394
  resetEmbedderIdentityStore();
@@ -373,4 +406,8 @@ export function isUsingEndpoint() {
373
406
  export function getEndpointIdentity() {
374
407
  return endpointIdentity;
375
408
  }
409
+ /** Runtime-backed identity of the initialized embedding space. */
410
+ export function getActiveEmbeddingSpaceIdentity() {
411
+ return activeEmbeddingSpaceIdentity;
412
+ }
376
413
  //# sourceMappingURL=real-embeddings.js.map
@@ -19,8 +19,9 @@ import { v4 as uuidv4 } from 'uuid';
19
19
  import { LoggerFactory } from '../logging/index.js';
20
20
  import { toError, toErrorMessage } from '../shared/error-utils.js';
21
21
  import { maybeEnhanceRoutingWithPatterns } from './pattern-routing-guidance.js';
22
+ import { EMBEDDING_SPACE_CANARY } from './embedding-space.js';
22
23
  const logger = LoggerFactory.create('RealQEReasoningBank');
23
- import { computeRealEmbedding, isTransformerAvailable, getEmbeddingDimension, clearEmbeddingCache, } from './real-embeddings.js';
24
+ import { computeRealEmbedding, isTransformerAvailable, getEmbeddingDimension, clearEmbeddingCache, getActiveEmbeddingSpaceIdentity, } from './real-embeddings.js';
24
25
  import { createSQLitePatternStore, } from './sqlite-persistence.js';
25
26
  import { detectQEDomain, detectQEDomains, mapQEDomainToAQE, QE_DOMAIN_LIST, shouldPromotePattern, } from './qe-patterns.js';
26
27
  import { getGuidance, getCombinedGuidance, generateGuidanceContext, checkAntiPatterns, } from './qe-guidance.js';
@@ -164,6 +165,8 @@ export class RealQEReasoningBank {
164
165
  // Initialize SQLite persistence
165
166
  await this.sqliteStore.initialize();
166
167
  logger.info('SQLite persistence initialized');
168
+ // Establish executable provenance before any persisted vectors enter ANN.
169
+ await computeRealEmbedding(EMBEDDING_SPACE_CANARY, this.qeConfig.embeddings);
167
170
  // Initialize HNSW index
168
171
  await this.initializeHNSW();
169
172
  logger.info('HNSW index initialized');
@@ -228,9 +231,10 @@ export class RealQEReasoningBank {
228
231
  const expectedDim = getEmbeddingDimension();
229
232
  let loaded = 0;
230
233
  let skipped = 0;
231
- for (const { patternId, embedding } of embeddings) {
234
+ const activeSpaceId = getActiveEmbeddingSpaceIdentity()?.spaceId;
235
+ for (const { patternId, embedding, spaceId } of embeddings) {
232
236
  // Skip invalid or corrupted embeddings
233
- if (!embedding || !Array.isArray(embedding) || embedding.length !== expectedDim) {
237
+ if (!activeSpaceId || spaceId !== activeSpaceId || !embedding || !Array.isArray(embedding) || embedding.length !== expectedDim) {
234
238
  skipped++;
235
239
  continue;
236
240
  }
@@ -33,6 +33,8 @@ export interface MigrationOptions {
33
33
  dimension?: number;
34
34
  /** Log progress every N patterns (default: 1000) */
35
35
  progressInterval?: number;
36
+ /** Runtime embedding space that the destination RVF index is bound to. */
37
+ embeddingSpaceId?: string;
36
38
  }
37
39
  /**
38
40
  * Migrate pattern embeddings from SQLite to an RVF file.
@@ -12,6 +12,7 @@
12
12
  *
13
13
  * @module learning/rvf-pattern-migration
14
14
  */
15
+ import { getActiveEmbeddingSpaceIdentity } from './real-embeddings.js';
15
16
  // ============================================================================
16
17
  // Migration Function
17
18
  // ============================================================================
@@ -52,10 +53,11 @@ export function migratePatterns(sqliteStore, rvfAdapter, options = {}) {
52
53
  console.log(`[RVF Migration] Found ${allEmbeddings.length} embeddings to migrate (dim=${dimension})`);
53
54
  // Process in batches
54
55
  let batch = [];
56
+ const activeSpaceId = getActiveEmbeddingSpaceIdentity()?.spaceId ?? options.embeddingSpaceId;
55
57
  for (let i = 0; i < allEmbeddings.length; i++) {
56
- const { patternId, embedding } = allEmbeddings[i];
57
- // Skip if dimension doesn't match
58
- if (embedding.length !== dimension) {
58
+ const { patternId, embedding, spaceId } = allEmbeddings[i];
59
+ // Never mix unknown or incompatible spaces in an ANN file.
60
+ if (!activeSpaceId || spaceId !== activeSpaceId || embedding.length !== dimension) {
59
61
  result.totalSkipped++;
60
62
  continue;
61
63
  }
@@ -22,6 +22,8 @@ export interface RvfPatternStoreConfig {
22
22
  base: PatternStoreConfig;
23
23
  /** When true, dispose() will not close the adapter (shared singleton) */
24
24
  skipCloseOnDispose?: boolean;
25
+ /** Runtime provenance for an injected embedder. */
26
+ embeddingSpaceId?: string;
25
27
  }
26
28
  /**
27
29
  * Pattern store backed by @ruvector/rvf-node for persistent HNSW.
@@ -34,6 +36,7 @@ export declare class RvfPatternStore implements IPatternStore {
34
36
  private readonly config;
35
37
  private readonly rvfPath;
36
38
  private readonly skipCloseOnDispose;
39
+ private readonly embeddingSpaceId?;
37
40
  private adapter;
38
41
  private sqliteStore;
39
42
  private initialized;
@@ -16,6 +16,8 @@ import { ok, err } from '../shared/types/index.js';
16
16
  import { toErrorMessage } from '../shared/error-utils.js';
17
17
  import { calculateQualityScore, validateQEPattern, mapQEDomainToAQE, PROMOTION_THRESHOLD, } from './qe-patterns.js';
18
18
  import { DEFAULT_PATTERN_STORE_CONFIG } from './pattern-store.js';
19
+ import { getActiveEmbeddingSpaceIdentity } from './real-embeddings.js';
20
+ import { verifyOrCreateEmbeddingSpaceManifest } from './embedding-space.js';
19
21
  // ============================================================================
20
22
  // RVF Pattern Store Implementation
21
23
  // ============================================================================
@@ -30,6 +32,7 @@ export class RvfPatternStore {
30
32
  config;
31
33
  rvfPath;
32
34
  skipCloseOnDispose;
35
+ embeddingSpaceId;
33
36
  adapter = null;
34
37
  sqliteStore = null;
35
38
  initialized = false;
@@ -41,6 +44,7 @@ export class RvfPatternStore {
41
44
  this.config = config?.base ?? DEFAULT_PATTERN_STORE_CONFIG;
42
45
  this.rvfPath = config?.rvfPath ?? '.agentic-qe/patterns.rvf';
43
46
  this.skipCloseOnDispose = config?.skipCloseOnDispose ?? false;
47
+ this.embeddingSpaceId = config?.embeddingSpaceId;
44
48
  }
45
49
  /**
46
50
  * Attach SQLite persistence for metadata (pattern fields, FTS5).
@@ -69,6 +73,8 @@ export class RvfPatternStore {
69
73
  }
70
74
  try {
71
75
  this.adapter = this.createAdapter(this.rvfPath, this.config.embeddingDimension);
76
+ const activeSpaceId = getActiveEmbeddingSpaceIdentity()?.spaceId ?? this.embeddingSpaceId ?? null;
77
+ verifyOrCreateEmbeddingSpaceManifest(this.rvfPath, activeSpaceId, this.adapter.status()?.totalVectors ?? 0);
72
78
  this.initialized = true;
73
79
  console.log(`[RvfPatternStore] Initialized: ${this.rvfPath} (dim=${this.config.embeddingDimension})`);
74
80
  }
@@ -77,6 +83,10 @@ export class RvfPatternStore {
77
83
  // so they need to know RVF is not working. Log a clear error, set
78
84
  // adapter to null, and mark nativeAvailable=false in stats.
79
85
  this.rvfInitError = toErrorMessage(error);
86
+ try {
87
+ this.adapter?.close();
88
+ }
89
+ catch { /* best effort */ }
80
90
  console.error(`[RvfPatternStore] ERROR: RVF native init failed — vector search is DISABLED. ` +
81
91
  `Cause: ${this.rvfInitError}. ` +
82
92
  `Fix: install @ruvector/rvf-node native bindings, or set useRVFPatternStore=false to use SQLite HNSW.`);
@@ -162,6 +172,10 @@ export class RvfPatternStore {
162
172
  if (pattern.confidence < this.config.minConfidence) {
163
173
  return err(new Error(`Pattern confidence ${pattern.confidence} below threshold ${this.config.minConfidence}`));
164
174
  }
175
+ const activeSpaceId = getActiveEmbeddingSpaceIdentity()?.spaceId ?? this.embeddingSpaceId;
176
+ if (pattern.embedding && !activeSpaceId) {
177
+ return err(new Error('VECTOR_SPACE_UNVERIFIED: refusing to persist or index an embedding without runtime provenance'));
178
+ }
165
179
  // Persist metadata to SQLite. #447: capture the returned id — ON CONFLICT
166
180
  // on (name, qe_domain, pattern_type) preserves the existing row's id, so
167
181
  // we must align pattern.id with what's actually stored before ingesting
@@ -169,7 +183,7 @@ export class RvfPatternStore {
169
183
  // with "Pattern not found" and qe_pattern_usage stays empty).
170
184
  if (this.sqliteStore) {
171
185
  try {
172
- const actualId = this.sqliteStore.storePattern(pattern, pattern.embedding);
186
+ const actualId = this.sqliteStore.storePattern(pattern, pattern.embedding, activeSpaceId);
173
187
  if (actualId && actualId !== pattern.id) {
174
188
  // QEPattern.id is `readonly` for callers, but inside the store
175
189
  // we own the lifecycle and must align it with the persisted row
@@ -245,6 +259,12 @@ export class RvfPatternStore {
245
259
  const startTime = performance.now();
246
260
  const limit = options.limit ?? 10;
247
261
  const results = [];
262
+ if (Array.isArray(query)) {
263
+ const activeSpaceId = getActiveEmbeddingSpaceIdentity()?.spaceId ?? this.embeddingSpaceId;
264
+ if (!activeSpaceId || options.embeddingSpaceId !== activeSpaceId) {
265
+ return err(new Error('VECTOR_SPACE_UNVERIFIED: pre-computed query vectors require the active embeddingSpaceId'));
266
+ }
267
+ }
248
268
  // Vector search via RVF native HNSW
249
269
  if (Array.isArray(query) && this.adapter) {
250
270
  try {
@@ -13,6 +13,7 @@
13
13
  */
14
14
  import { type Database as DatabaseType } from 'better-sqlite3';
15
15
  import type { QEPattern, QEDomain } from './qe-patterns.js';
16
+ import { type EmbeddingSpaceDiagnostics } from './embedding-space.js';
16
17
  /**
17
18
  * SQLite persistence configuration
18
19
  */
@@ -71,11 +72,12 @@ export declare class SQLitePatternStore {
71
72
  /**
72
73
  * Prepare commonly used statements
73
74
  */
75
+ private ensureEmbeddingSpaceSchema;
74
76
  private prepareStatements;
75
77
  /**
76
78
  * Store a pattern
77
79
  */
78
- storePattern(pattern: QEPattern, embedding?: number[]): string;
80
+ storePattern(pattern: QEPattern, embedding?: number[], embeddingSpaceId?: string): string;
79
81
  /**
80
82
  * Get a pattern by ID
81
83
  */
@@ -113,6 +115,7 @@ export declare class SQLitePatternStore {
113
115
  getAllEmbeddings(): Array<{
114
116
  patternId: string;
115
117
  embedding: number[];
118
+ spaceId: string | null;
116
119
  }>;
117
120
  /**
118
121
  * Get up to `limit` embeddings, most-recently-used first.
@@ -124,7 +127,9 @@ export declare class SQLitePatternStore {
124
127
  getRecentEmbeddings(limit: number): Array<{
125
128
  patternId: string;
126
129
  embedding: number[];
130
+ spaceId: string | null;
127
131
  }>;
132
+ getEmbeddingSpaceDiagnostics(activeSpaceId?: string | null): EmbeddingSpaceDiagnostics;
128
133
  /**
129
134
  * Record pattern usage.
130
135
  *
@@ -191,7 +196,7 @@ export declare class SQLitePatternStore {
191
196
  /**
192
197
  * Store embedding for an existing pattern
193
198
  */
194
- storePatternEmbedding(patternId: string, embedding: number[]): void;
199
+ storePatternEmbedding(patternId: string, embedding: number[], embeddingSpaceId?: string): void;
195
200
  /**
196
201
  * Record pattern reuse for metrics tracking (Phase 5.4)
197
202
  *
@@ -16,7 +16,8 @@ import { v4 as uuidv4 } from 'uuid';
16
16
  import { safeJsonParse } from '../shared/safe-json.js';
17
17
  import { toErrorMessage } from '../shared/error-utils.js';
18
18
  import { getUnifiedMemory } from '../kernel/unified-memory.js';
19
- import { computeBatchEmbeddings, getEmbeddingDimension, isUsingEndpoint, } from './real-embeddings.js';
19
+ import { computeBatchEmbeddings, getEmbeddingDimension, isUsingEndpoint, getActiveEmbeddingSpaceIdentity, } from './real-embeddings.js';
20
+ import { EMBEDDING_SPACE_CANARY, inspectEmbeddingSpaceRows, } from './embedding-space.js';
20
21
  import { recordPatternUsage } from './pattern-usage-recorder.js';
21
22
  export const DEFAULT_SQLITE_CONFIG = {
22
23
  // LEGACY: Ignored when useUnified=true (the default). All data goes to memory.db
@@ -106,6 +107,8 @@ export class SQLitePatternStore {
106
107
  }
107
108
  // Run deduplication migration (one-time, idempotent)
108
109
  this.deduplicatePatterns();
110
+ // Legacy rows remain NULL/unverified; only new writes receive provenance.
111
+ this.ensureEmbeddingSpaceSchema();
109
112
  // Prepare statements
110
113
  this.prepareStatements();
111
114
  this.initialized = true;
@@ -143,11 +146,12 @@ export class SQLitePatternStore {
143
146
  );
144
147
 
145
148
  -- Pattern embeddings table (BLOB storage for vectors)
146
- CREATE TABLE IF NOT EXISTS qe_pattern_embeddings (
149
+ CREATE TABLE IF NOT EXISTS qe_pattern_embeddings (
147
150
  pattern_id TEXT PRIMARY KEY,
148
151
  embedding BLOB NOT NULL,
149
152
  dimension INTEGER NOT NULL,
150
- model TEXT DEFAULT 'all-MiniLM-L6-v2',
153
+ model TEXT DEFAULT 'all-MiniLM-L6-v2',
154
+ space_id TEXT,
151
155
  created_at TEXT DEFAULT (datetime('now')),
152
156
  FOREIGN KEY (pattern_id) REFERENCES qe_patterns(id) ON DELETE CASCADE
153
157
  );
@@ -298,6 +302,15 @@ export class SQLitePatternStore {
298
302
  /**
299
303
  * Prepare commonly used statements
300
304
  */
305
+ ensureEmbeddingSpaceSchema() {
306
+ if (!this.db)
307
+ throw new Error('Database not initialized');
308
+ const columns = this.db.prepare("PRAGMA table_info('qe_pattern_embeddings')").all();
309
+ if (!columns.some((column) => column.name === 'space_id')) {
310
+ this.db.exec('ALTER TABLE qe_pattern_embeddings ADD COLUMN space_id TEXT');
311
+ }
312
+ this.db.exec('CREATE INDEX IF NOT EXISTS idx_qe_pattern_embeddings_space ON qe_pattern_embeddings(space_id)');
313
+ }
301
314
  prepareStatements() {
302
315
  if (!this.db)
303
316
  throw new Error('Database not initialized');
@@ -323,14 +336,14 @@ export class SQLitePatternStore {
323
336
  updated_at = datetime('now')
324
337
  `));
325
338
  this.prepared.set('insertEmbedding', this.db.prepare(`
326
- INSERT OR REPLACE INTO qe_pattern_embeddings (pattern_id, embedding, dimension, model)
327
- VALUES (?, ?, ?, ?)
339
+ INSERT OR REPLACE INTO qe_pattern_embeddings (pattern_id, embedding, dimension, model, space_id)
340
+ VALUES (?, ?, ?, ?, ?)
328
341
  `));
329
342
  this.prepared.set('getPattern', this.db.prepare(`
330
343
  SELECT * FROM qe_patterns WHERE id = ?
331
344
  `));
332
345
  this.prepared.set('getPatternWithEmbedding', this.db.prepare(`
333
- SELECT p.*, e.embedding, e.dimension
346
+ SELECT p.*, e.embedding, e.dimension, e.space_id
334
347
  FROM qe_patterns p
335
348
  LEFT JOIN qe_pattern_embeddings e ON p.id = e.pattern_id
336
349
  WHERE p.id = ?
@@ -360,13 +373,13 @@ export class SQLitePatternStore {
360
373
  SELECT * FROM qe_patterns WHERE qe_domain = ? ORDER BY quality_score DESC LIMIT ?
361
374
  `));
362
375
  this.prepared.set('getAllEmbeddings', this.db.prepare(`
363
- SELECT pattern_id, embedding, dimension FROM qe_pattern_embeddings
376
+ SELECT pattern_id, embedding, dimension, space_id FROM qe_pattern_embeddings
364
377
  `));
365
378
  // Recent-first variant used by the RVF backfill path. Order by
366
379
  // qe_patterns.last_used_at (then created_at) so the bounded backfill keeps
367
380
  // the most actively-used patterns when the cap is hit.
368
381
  this.prepared.set('getRecentEmbeddings', this.db.prepare(`
369
- SELECT e.pattern_id, e.embedding, e.dimension
382
+ SELECT e.pattern_id, e.embedding, e.dimension, e.space_id
370
383
  FROM qe_pattern_embeddings e
371
384
  LEFT JOIN qe_patterns p ON p.id = e.pattern_id
372
385
  ORDER BY COALESCE(p.last_used_at, p.created_at, e.created_at) DESC
@@ -382,7 +395,7 @@ export class SQLitePatternStore {
382
395
  /**
383
396
  * Store a pattern
384
397
  */
385
- storePattern(pattern, embedding) {
398
+ storePattern(pattern, embedding, embeddingSpaceId) {
386
399
  if (!this.db)
387
400
  throw new Error('Database not initialized');
388
401
  const id = pattern.id || uuidv4();
@@ -405,9 +418,13 @@ export class SQLitePatternStore {
405
418
  .get(pattern.name, pattern.qeDomain ?? '', pattern.patternType ?? '');
406
419
  actualId = actualRow ? actualRow.id : id;
407
420
  if (embedding) {
421
+ const spaceId = embeddingSpaceId ?? getActiveEmbeddingSpaceIdentity()?.spaceId;
422
+ if (!spaceId) {
423
+ throw new Error('VECTOR_SPACE_UNVERIFIED: refusing to persist an embedding without runtime provenance');
424
+ }
408
425
  // Store embedding as BLOB (Float32Array)
409
426
  const buffer = Buffer.from(new Float32Array(embedding).buffer);
410
- insertEmbedding.run(actualId, buffer, embedding.length, 'all-MiniLM-L6-v2');
427
+ insertEmbedding.run(actualId, buffer, embedding.length, 'all-MiniLM-L6-v2', spaceId);
411
428
  }
412
429
  });
413
430
  transaction();
@@ -529,6 +546,7 @@ export class SQLitePatternStore {
529
546
  return rows.map(row => ({
530
547
  patternId: row.pattern_id,
531
548
  embedding: Array.from(new Float32Array(row.embedding.buffer, row.embedding.byteOffset, row.dimension)),
549
+ spaceId: row.space_id,
532
550
  }));
533
551
  }
534
552
  /**
@@ -549,8 +567,15 @@ export class SQLitePatternStore {
549
567
  return rows.map(row => ({
550
568
  patternId: row.pattern_id,
551
569
  embedding: Array.from(new Float32Array(row.embedding.buffer, row.embedding.byteOffset, row.dimension)),
570
+ spaceId: row.space_id,
552
571
  }));
553
572
  }
573
+ getEmbeddingSpaceDiagnostics(activeSpaceId = getActiveEmbeddingSpaceIdentity()?.spaceId ?? null) {
574
+ if (!this.db)
575
+ throw new Error('Database not initialized');
576
+ const rows = this.db.prepare('SELECT space_id AS spaceId FROM qe_pattern_embeddings').all();
577
+ return inspectEmbeddingSpaceRows(rows, activeSpaceId);
578
+ }
554
579
  /**
555
580
  * Record pattern usage.
556
581
  *
@@ -788,7 +813,7 @@ export class SQLitePatternStore {
788
813
  /**
789
814
  * Store embedding for an existing pattern
790
815
  */
791
- storePatternEmbedding(patternId, embedding) {
816
+ storePatternEmbedding(patternId, embedding, embeddingSpaceId) {
792
817
  if (!this.db)
793
818
  throw new Error('Database not initialized');
794
819
  const insertEmbedding = this.prepared.get('insertEmbedding');
@@ -797,7 +822,11 @@ export class SQLitePatternStore {
797
822
  }
798
823
  // Convert embedding to Buffer for storage
799
824
  const buffer = Buffer.from(new Float32Array(embedding).buffer);
800
- insertEmbedding.run(patternId, buffer, embedding.length, 'all-MiniLM-L6-v2');
825
+ const spaceId = embeddingSpaceId ?? getActiveEmbeddingSpaceIdentity()?.spaceId;
826
+ if (!spaceId) {
827
+ throw new Error('VECTOR_SPACE_UNVERIFIED: refusing to persist an embedding without runtime provenance');
828
+ }
829
+ insertEmbedding.run(patternId, buffer, embedding.length, 'all-MiniLM-L6-v2', spaceId);
801
830
  }
802
831
  /**
803
832
  * Record pattern reuse for metrics tracking (Phase 5.4)
@@ -935,14 +964,22 @@ export class SQLitePatternStore {
935
964
  if (!this.db)
936
965
  throw new Error('Database not initialized');
937
966
  const dimension = getEmbeddingDimension(); // 384
938
- // Find patterns without embeddings (skip bench patterns)
939
- const patternsWithout = this.db.prepare(`
940
- SELECT p.id, p.name, p.description, p.pattern_type, p.qe_domain
941
- FROM qe_patterns p
942
- WHERE p.id NOT IN (SELECT pattern_id FROM qe_pattern_embeddings)
943
- AND p.id NOT LIKE 'bench-%'
944
- ORDER BY p.quality_score DESC
945
- `).all();
967
+ // Initialize the executable identity before choosing repair candidates.
968
+ // The canary is cached by the embedding layer and is never persisted.
969
+ await computeBatchEmbeddings([EMBEDDING_SPACE_CANARY]);
970
+ const activeSpaceId = getActiveEmbeddingSpaceIdentity()?.spaceId;
971
+ if (!activeSpaceId) {
972
+ throw new Error('VECTOR_SPACE_UNVERIFIED: backfill embedder has no runtime provenance');
973
+ }
974
+ // Repair absent, legacy/unverified, and mismatched embeddings.
975
+ const patternsWithout = this.db.prepare(`
976
+ SELECT p.id, p.name, p.description, p.pattern_type, p.qe_domain
977
+ FROM qe_patterns p
978
+ LEFT JOIN qe_pattern_embeddings e ON e.pattern_id = p.id
979
+ WHERE (e.pattern_id IS NULL OR e.space_id IS NULL OR e.space_id <> ?)
980
+ AND p.id NOT LIKE 'bench-%'
981
+ ORDER BY p.quality_score DESC
982
+ `).all(activeSpaceId);
946
983
  const alreadyHad = this.db.prepare(`
947
984
  SELECT COUNT(*) as c FROM qe_pattern_embeddings
948
985
  `).get();
@@ -1012,7 +1049,7 @@ export class SQLitePatternStore {
1012
1049
  continue;
1013
1050
  }
1014
1051
  const buffer = Buffer.from(new Float32Array(embedding).buffer);
1015
- insertEmbedding.run(textsWithIds[j].id, buffer, dimension, embeddingTag);
1052
+ insertEmbedding.run(textsWithIds[j].id, buffer, dimension, embeddingTag, activeSpaceId);
1016
1053
  processed++;
1017
1054
  }
1018
1055
  catch (e) {