agentic-qe 3.15.14 → 3.15.16

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 (513) hide show
  1. package/.claude/agents/v3/templates/qx-report-template.html +1 -1
  2. package/.claude/skills/skills-manifest.json +1 -1
  3. package/CHANGELOG.md +136 -0
  4. package/assets/agents/v3/templates/qx-report-template.html +1 -1
  5. package/assets/skills/skills-manifest.json +1 -1
  6. package/dist/audit/witness-chain.d.ts +7 -0
  7. package/dist/audit/witness-chain.js +10 -0
  8. package/dist/cli/bundle.js +6 -6
  9. package/dist/cli/chunks/adapter-6CQ2PIP5.js +2 -0
  10. package/dist/cli/chunks/agent-booster-wasm-45NWEKVS.js +2 -0
  11. package/dist/cli/chunks/{agent-handler-P3IY7XEE.js → agent-handler-LVHMYFEF.js} +2 -2
  12. package/dist/cli/chunks/{agent-memory-branch-WWKC2H3G.js → agent-memory-branch-YDWOJFEQ.js} +2 -2
  13. package/dist/cli/chunks/aqe-learning-engine-73RR52VS.js +2 -0
  14. package/dist/cli/chunks/{arena-EIV5OALF.js → arena-CZKHXDDS.js} +2 -2
  15. package/dist/cli/chunks/{arena-4BMFF6BS.js → arena-ELDZH3CZ.js} +4 -4
  16. package/dist/cli/chunks/{audit-DNTI453H.js → audit-5MT4T47Z.js} +3 -3
  17. package/dist/cli/chunks/base-SMCMMVGP.js +2 -0
  18. package/dist/cli/chunks/{better-sqlite3-TQBQGNC6.js → better-sqlite3-6TGYPC2B.js} +2 -2
  19. package/dist/cli/chunks/{brain-handler-HY57CNAO.js → brain-handler-HQWZFO52.js} +3 -3
  20. package/dist/cli/chunks/{branch-enumerator-THPMZPHQ.js → branch-enumerator-WVILM4SO.js} +2 -2
  21. package/dist/cli/chunks/{browser-O6JJOZCK.js → browser-RX5ALU3H.js} +2 -2
  22. package/dist/cli/chunks/browser-workflow-A2MEZ66K.js +2 -0
  23. package/dist/cli/chunks/{chunk-CIINJHOX.js → chunk-24OX5TQJ.js} +1 -1
  24. package/dist/cli/chunks/{chunk-6P4Q4RTC.js → chunk-24QHCVX6.js} +1 -1
  25. package/dist/cli/chunks/{chunk-U6IOQKCT.js → chunk-2H4XH6FT.js} +2 -2
  26. package/dist/cli/chunks/{chunk-OGEIHS76.js → chunk-2YZ4G6NW.js} +1 -1
  27. package/dist/cli/chunks/chunk-32BPDLRZ.js +27 -0
  28. package/dist/cli/chunks/{chunk-5PLBQZ5J.js → chunk-32GN3JKR.js} +1 -1
  29. package/dist/cli/chunks/{chunk-AJVLVF7V.js → chunk-3HD7E6HN.js} +2 -2
  30. package/dist/cli/chunks/{chunk-X7CUI7KH.js → chunk-4D4DENG6.js} +2 -2
  31. package/dist/cli/chunks/{chunk-E2JLAW3U.js → chunk-4LQFBY5L.js} +6 -6
  32. package/dist/cli/chunks/{chunk-E3QIQMMN.js → chunk-4NFQLP6R.js} +1 -1
  33. package/dist/cli/chunks/{chunk-7Y3LXH57.js → chunk-525CFDUE.js} +2 -2
  34. package/dist/cli/chunks/chunk-5B5QPCNU.js +65 -0
  35. package/dist/cli/chunks/{chunk-X6Q2N5S5.js → chunk-5JZRZI4S.js} +2 -2
  36. package/dist/cli/chunks/{chunk-MB4UKUBV.js → chunk-5LAVKGLH.js} +2 -2
  37. package/dist/cli/chunks/chunk-5NNNEWLS.js +755 -0
  38. package/dist/cli/chunks/{chunk-NKOLILT7.js → chunk-5PBLPQ5T.js} +2 -2
  39. package/dist/cli/chunks/chunk-5QO3R3TU.js +6 -0
  40. package/dist/cli/chunks/{chunk-7T6L3LFN.js → chunk-5SPCGMBB.js} +2 -2
  41. package/dist/cli/chunks/{chunk-2QLE6NDW.js → chunk-5V3TI2LG.js} +1 -1
  42. package/dist/cli/chunks/{chunk-A2T56XVL.js → chunk-5VZL4UVN.js} +2 -2
  43. package/dist/cli/chunks/{chunk-TWOV3I3A.js → chunk-63GMRQ25.js} +1 -1
  44. package/dist/cli/chunks/{chunk-YGOSSVY5.js → chunk-63ZKI4PX.js} +6 -6
  45. package/dist/cli/chunks/{chunk-FHPNWHY7.js → chunk-67Z5R7RJ.js} +2 -2
  46. package/dist/cli/chunks/{chunk-PCQZIAXB.js → chunk-6DPYNAOK.js} +2 -2
  47. package/dist/cli/chunks/{chunk-WCM6WE7G.js → chunk-6ICX3FEG.js} +3 -3
  48. package/dist/cli/chunks/{chunk-JB7R77SH.js → chunk-6XXZDV2C.js} +2 -2
  49. package/dist/cli/chunks/{chunk-FJOIBZUB.js → chunk-6ZBXSOX6.js} +2 -2
  50. package/dist/cli/chunks/{chunk-WZQADC5R.js → chunk-72XSEQMW.js} +2 -2
  51. package/dist/cli/chunks/{chunk-AYLEH2UF.js → chunk-7TE5ONQQ.js} +1 -1
  52. package/dist/cli/chunks/{chunk-7QUSNBAA.js → chunk-A5GBXCP5.js} +2 -2
  53. package/dist/cli/chunks/{chunk-7724KXM2.js → chunk-AAMLQ2LF.js} +3 -3
  54. package/dist/cli/chunks/chunk-AG2EWGXS.js +21 -0
  55. package/dist/cli/chunks/{chunk-2UZBLC5H.js → chunk-AGRV5B3T.js} +2 -2
  56. package/dist/cli/chunks/{chunk-V6SE2ZU2.js → chunk-AJMJNQMP.js} +1 -1
  57. package/dist/cli/chunks/{chunk-2HPNGK7A.js → chunk-AR67RJPY.js} +2 -2
  58. package/dist/cli/chunks/{chunk-G7HGUQAE.js → chunk-ASEOFRIG.js} +2 -2
  59. package/dist/cli/chunks/{chunk-7TH4PJSU.js → chunk-BEKDKVQT.js} +2 -2
  60. package/dist/cli/chunks/{chunk-M5JEA6ZY.js → chunk-BY5OF7OH.js} +2 -2
  61. package/dist/cli/chunks/{chunk-OLUOVNUF.js → chunk-C5FP5GW3.js} +2 -2
  62. package/dist/cli/chunks/{chunk-R5RRWLRI.js → chunk-C6D5AHBO.js} +2 -2
  63. package/dist/cli/chunks/{chunk-K7GFYFBO.js → chunk-CAKMOVZ6.js} +2 -2
  64. package/dist/cli/chunks/{chunk-6NIGSY5L.js → chunk-CEYSYSK5.js} +2 -2
  65. package/dist/cli/chunks/{chunk-U4TML2VD.js → chunk-CGGUM2YJ.js} +2 -2
  66. package/dist/cli/chunks/{chunk-YE54T2NQ.js → chunk-CJSHWQXP.js} +2 -2
  67. package/dist/cli/chunks/{chunk-7SQTLUEN.js → chunk-CRPIYUTJ.js} +2 -2
  68. package/dist/cli/chunks/{chunk-65EE2EST.js → chunk-D6COXLYE.js} +2 -2
  69. package/dist/cli/chunks/{chunk-4WLIOPHX.js → chunk-DTMAS2GB.js} +2 -2
  70. package/dist/cli/chunks/{chunk-E7QTWGPI.js → chunk-DVYHMDFR.js} +470 -411
  71. package/dist/cli/chunks/chunk-DXD6K2ZP.js +3 -0
  72. package/dist/cli/chunks/{chunk-HSDWPQQY.js → chunk-E3D4GPLP.js} +3 -3
  73. package/dist/cli/chunks/{chunk-JJHLGGPP.js → chunk-EA4YQVKS.js} +1 -1
  74. package/dist/cli/chunks/{chunk-EIEEST4T.js → chunk-EGYE5UPQ.js} +2 -2
  75. package/dist/cli/chunks/{chunk-O756AOUX.js → chunk-EK7OLYOZ.js} +2 -2
  76. package/dist/cli/chunks/{chunk-57DRT6UA.js → chunk-F742SZAX.js} +2 -2
  77. package/dist/cli/chunks/{chunk-6OI5SK7M.js → chunk-FBDVGRSC.js} +1 -1
  78. package/dist/cli/chunks/{chunk-H3C5FJRH.js → chunk-FDDC72IA.js} +2 -2
  79. package/dist/cli/chunks/{chunk-IQRPR4KB.js → chunk-FL64OUBA.js} +2 -2
  80. package/dist/cli/chunks/{chunk-BNG4J3CE.js → chunk-FLNAW7C4.js} +2 -2
  81. package/dist/cli/chunks/{chunk-C3OIBFAA.js → chunk-G5RHFBAY.js} +2 -2
  82. package/dist/cli/chunks/{chunk-NPCXGX7N.js → chunk-GAHNO6JJ.js} +2 -2
  83. package/dist/cli/chunks/{chunk-PNRPVQGI.js → chunk-GFWHUQSF.js} +2 -2
  84. package/dist/cli/chunks/{chunk-OCN53CCK.js → chunk-GJYHWYXR.js} +2 -2
  85. package/dist/cli/chunks/{chunk-5Z4MO2F3.js → chunk-GQ6TUIKY.js} +1 -1
  86. package/dist/cli/chunks/{chunk-N736GLWZ.js → chunk-GSKMOPL7.js} +2 -2
  87. package/dist/cli/chunks/{chunk-43XHGWYH.js → chunk-HCH4Y6XX.js} +2 -2
  88. package/dist/cli/chunks/{chunk-QP6GL3O5.js → chunk-HGWXF45W.js} +1 -1
  89. package/dist/cli/chunks/{chunk-PGN4TARY.js → chunk-HJ6ZGVTB.js} +2 -2
  90. package/dist/cli/chunks/{chunk-M2TG7VDK.js → chunk-HLUXXCHF.js} +1 -1
  91. package/dist/cli/chunks/{chunk-UMHFTQTR.js → chunk-HVRRLYX6.js} +4 -4
  92. package/dist/cli/chunks/{chunk-L7PC675Y.js → chunk-I7MQIM2U.js} +1 -1
  93. package/dist/cli/chunks/{chunk-JSSU4RIK.js → chunk-IESR7TNB.js} +2 -2
  94. package/dist/cli/chunks/{chunk-H4LYXLAT.js → chunk-IHRXZZQM.js} +1 -1
  95. package/dist/cli/chunks/{chunk-HV43NX4A.js → chunk-IOKYCMTJ.js} +6 -6
  96. package/dist/cli/chunks/{chunk-NZQYJCO6.js → chunk-IOQ6ZQ5W.js} +1 -1
  97. package/dist/cli/chunks/{chunk-JO26SG47.js → chunk-IOYG4VFL.js} +2 -2
  98. package/dist/cli/chunks/{chunk-6O63ZTVX.js → chunk-IUBJVHNB.js} +2 -2
  99. package/dist/cli/chunks/{chunk-XSPMLJCQ.js → chunk-J442IZLE.js} +1 -1
  100. package/dist/cli/chunks/{chunk-LTGQJYYO.js → chunk-J4ELZNLY.js} +2 -2
  101. package/dist/cli/chunks/chunk-J7I6PABJ.js +153 -0
  102. package/dist/cli/chunks/chunk-JDIYMZCQ.js +2 -0
  103. package/dist/cli/chunks/{chunk-TOJF3ZG4.js → chunk-JHQCRRJI.js} +2 -2
  104. package/dist/cli/chunks/{chunk-QUZ745UQ.js → chunk-JQ3DYUMS.js} +2 -2
  105. package/dist/cli/chunks/{chunk-P2TPH3TC.js → chunk-KITOPKRG.js} +2 -2
  106. package/dist/cli/chunks/{chunk-QNQE3EOH.js → chunk-KKU2QGSJ.js} +2 -2
  107. package/dist/cli/chunks/chunk-KL7OKSU2.js +4 -0
  108. package/dist/cli/chunks/{chunk-L5VSLPMW.js → chunk-KNSRL6NO.js} +2 -2
  109. package/dist/cli/chunks/{chunk-INGXD5IX.js → chunk-KPRCB5LT.js} +2 -2
  110. package/dist/cli/chunks/{chunk-GY4P7KAI.js → chunk-KQYJ4VQ5.js} +1 -1
  111. package/dist/cli/chunks/{chunk-Z2S7DNFP.js → chunk-KU2AUFGX.js} +2 -2
  112. package/dist/cli/chunks/{chunk-O5CEL447.js → chunk-KVF4NXGQ.js} +2 -2
  113. package/dist/cli/chunks/{chunk-2IJO3657.js → chunk-KXCLACFG.js} +2 -2
  114. package/dist/cli/chunks/{chunk-ZJGFQK27.js → chunk-L2DWPVNJ.js} +1 -1
  115. package/dist/cli/chunks/{chunk-E7OR6V3V.js → chunk-L6QSTQME.js} +2 -2
  116. package/dist/cli/chunks/{chunk-RE6JTSDM.js → chunk-LE4QJREF.js} +1 -1
  117. package/dist/cli/chunks/{chunk-DSQESXL4.js → chunk-LKTTUHLF.js} +2 -2
  118. package/dist/cli/chunks/{chunk-YGC5QKQ4.js → chunk-LQLPB2T6.js} +2 -2
  119. package/dist/cli/chunks/{chunk-VGZOPQQY.js → chunk-LRSX2FJM.js} +1 -1
  120. package/dist/cli/chunks/chunk-M4FRQ4TE.js +12 -0
  121. package/dist/cli/chunks/chunk-M7WJCTG3.js +2 -0
  122. package/dist/cli/chunks/{chunk-56NSE3LJ.js → chunk-MAFQV4U4.js} +2 -2
  123. package/dist/cli/chunks/{chunk-MKYOE7NE.js → chunk-MD43XRX5.js} +1 -1
  124. package/dist/cli/chunks/{chunk-3TF27MG5.js → chunk-MI5MFHRA.js} +2 -2
  125. package/dist/cli/chunks/{chunk-JK6PMLQQ.js → chunk-MO55CVMT.js} +32 -32
  126. package/dist/cli/chunks/{chunk-X6NJOT3V.js → chunk-N7HL5PHH.js} +1 -1
  127. package/dist/cli/chunks/chunk-NAEWCFQT.js +14 -0
  128. package/dist/cli/chunks/{chunk-WUGXXNK4.js → chunk-NDJ7P2EP.js} +1 -1
  129. package/dist/cli/chunks/{chunk-D5GB5PUU.js → chunk-NO3IV5Q5.js} +1 -1
  130. package/dist/cli/chunks/{chunk-3XACRXBY.js → chunk-NQXXI77K.js} +2 -2
  131. package/dist/cli/chunks/{chunk-EC65UZ77.js → chunk-NVEWF4JV.js} +1 -1
  132. package/dist/cli/chunks/{chunk-JI67T6Q2.js → chunk-NZU4ACBZ.js} +2 -2
  133. package/dist/cli/chunks/chunk-O5W3FIO6.js +63 -0
  134. package/dist/cli/chunks/{chunk-YEFTK4HD.js → chunk-OAEE6JWQ.js} +2 -2
  135. package/dist/cli/chunks/{chunk-JAOCHPYX.js → chunk-OCV2XEWQ.js} +2 -2
  136. package/dist/cli/chunks/{chunk-IDBA5GK2.js → chunk-P3EYRILV.js} +2 -2
  137. package/dist/cli/chunks/{chunk-4RPBODN5.js → chunk-PEQDY4BO.js} +2 -2
  138. package/dist/cli/chunks/{chunk-CPPYZYXC.js → chunk-PF7RBAYL.js} +2 -2
  139. package/dist/cli/chunks/{chunk-WCPSR4MJ.js → chunk-PHT5N7SC.js} +2 -2
  140. package/dist/cli/chunks/{chunk-O2AAYJUV.js → chunk-PINSJCM3.js} +1 -1
  141. package/dist/cli/chunks/{chunk-HEDGFKC5.js → chunk-PPUZWYUG.js} +2 -2
  142. package/dist/cli/chunks/{chunk-XMCSKYDE.js → chunk-QPEOLAAS.js} +1 -1
  143. package/dist/cli/chunks/{chunk-7MUO4DEH.js → chunk-QQWBWEJS.js} +18 -18
  144. package/dist/cli/chunks/{chunk-UFP7SN5V.js → chunk-QVDCVD5D.js} +2 -2
  145. package/dist/cli/chunks/{chunk-NHEG2DLN.js → chunk-RJIEG3NA.js} +2 -2
  146. package/dist/cli/chunks/{chunk-KJ5A54ZH.js → chunk-RV74I3YO.js} +2 -2
  147. package/dist/cli/chunks/{chunk-UDSB3XCG.js → chunk-S75SOOZL.js} +2 -2
  148. package/dist/cli/chunks/{chunk-BPDAQB3F.js → chunk-SASBO5Y5.js} +2 -2
  149. package/dist/cli/chunks/{chunk-VJBJRFUO.js → chunk-SDLWKRVL.js} +9 -9
  150. package/dist/cli/chunks/{chunk-J6ASX536.js → chunk-SHKOCGNK.js} +2 -2
  151. package/dist/cli/chunks/{chunk-J35JWDJE.js → chunk-SI6DPU5D.js} +1 -1
  152. package/dist/cli/chunks/{chunk-V3MGY76S.js → chunk-SJ6Y4725.js} +2 -2
  153. package/dist/cli/chunks/{chunk-FTYRPEJS.js → chunk-SR52XP5F.js} +1 -1
  154. package/dist/cli/chunks/{chunk-ZUE524JL.js → chunk-SSUAAX3F.js} +2 -2
  155. package/dist/cli/chunks/{chunk-VG32EEUG.js → chunk-SSYAQZXA.js} +2 -2
  156. package/dist/cli/chunks/{chunk-HTVGHHX2.js → chunk-SUDMM5SO.js} +2 -2
  157. package/dist/cli/chunks/{chunk-K2SMP4OD.js → chunk-TIUKLYAI.js} +1 -1
  158. package/dist/cli/chunks/{chunk-VCVRZD4Y.js → chunk-TVGI32MB.js} +33 -33
  159. package/dist/cli/chunks/{chunk-CAZM63TP.js → chunk-U2A7NHZA.js} +2 -2
  160. package/dist/cli/chunks/{chunk-WBC6WB32.js → chunk-UE5ZOZR2.js} +2 -2
  161. package/dist/cli/chunks/{chunk-BQJ7CV53.js → chunk-UHEOGZLX.js} +12 -12
  162. package/dist/cli/chunks/chunk-UNGBRZDK.js +12 -0
  163. package/dist/cli/chunks/{chunk-XN3KCKAM.js → chunk-V5NHZV7S.js} +2 -2
  164. package/dist/cli/chunks/{chunk-UNYTHZDZ.js → chunk-VJCIEHEF.js} +1 -1
  165. package/dist/cli/chunks/{chunk-5Y7UFHJD.js → chunk-VMDFFTCK.js} +1 -1
  166. package/dist/cli/chunks/chunk-VSIKHWZ4.js +29 -0
  167. package/dist/cli/chunks/{chunk-UPWLMIDY.js → chunk-VWPM27GU.js} +2 -2
  168. package/dist/cli/chunks/{chunk-USAKCGHC.js → chunk-VXFLJNCA.js} +2 -2
  169. package/dist/cli/chunks/{chunk-WKI46WWN.js → chunk-W5HQUIML.js} +2 -2
  170. package/dist/cli/chunks/{chunk-Z54G2YOL.js → chunk-WP4RETKG.js} +2 -2
  171. package/dist/cli/chunks/{chunk-IRPNEXOU.js → chunk-XIIQ5QTT.js} +2 -2
  172. package/dist/cli/chunks/{chunk-O32BFQV4.js → chunk-XIQW7EFL.js} +2 -2
  173. package/dist/cli/chunks/{chunk-TW6Z6W4X.js → chunk-XWUWX7BV.js} +13 -13
  174. package/dist/cli/chunks/{chunk-57FX3GP6.js → chunk-Y4PFUMOU.js} +1 -1
  175. package/dist/cli/chunks/chunk-YAPLJR7K.js +2 -0
  176. package/dist/cli/chunks/{chunk-4T7XV5KQ.js → chunk-YLMNVLDK.js} +1 -1
  177. package/dist/cli/chunks/{chunk-TSP6SU5V.js → chunk-YNMJEDN5.js} +2 -2
  178. package/dist/cli/chunks/{chunk-PWQWKYBG.js → chunk-YPBSUGMI.js} +1 -1
  179. package/dist/cli/chunks/{chunk-QP2HLKTS.js → chunk-YRAX7SFJ.js} +2 -2
  180. package/dist/cli/chunks/{chunk-O3ERGUXH.js → chunk-YTHTQPWR.js} +1 -1
  181. package/dist/cli/chunks/{chunk-MR2OPUSA.js → chunk-YU2BDRSD.js} +1 -1
  182. package/dist/cli/chunks/chunk-ZB3LEFYG.js +2 -0
  183. package/dist/cli/chunks/{chunk-2W5MQDHM.js → chunk-ZFL436FN.js} +2 -2
  184. package/dist/cli/chunks/{chunk-7MISCSL5.js → chunk-ZJH5MU2I.js} +2 -2
  185. package/dist/cli/chunks/{chunk-52KOPIMI.js → chunk-ZQ2XW3IP.js} +2 -2
  186. package/dist/cli/chunks/chunk-ZR2TKVXQ.js +14 -0
  187. package/dist/cli/chunks/{ci-UMA2SMNW.js → ci-MFUR4CWV.js} +2 -2
  188. package/dist/cli/chunks/{ci-config-UQSILJFQ.js → ci-config-PNDLQ6XV.js} +2 -2
  189. package/dist/cli/chunks/{ci-output-U6YZLLKH.js → ci-output-PFZ4M7NC.js} +2 -2
  190. package/dist/cli/chunks/{circuit-breaker-ATYQP6X2.js → circuit-breaker-5HH6NLZN.js} +2 -2
  191. package/dist/cli/chunks/{claude-flow-setup-6YHFD7AN.js → claude-flow-setup-QCKYLGLC.js} +2 -2
  192. package/dist/cli/chunks/client-MHQRTZM4.js +2 -0
  193. package/dist/cli/chunks/{cline-installer-EPE7IOZE.js → cline-installer-EASVPFXR.js} +2 -2
  194. package/dist/cli/chunks/{code-NUEJ4XYO.js → code-UJXDVYRK.js} +4 -3
  195. package/dist/cli/chunks/{code-index-extractor-D4DBT6OL.js → code-index-extractor-BZJ3UDP4.js} +2 -2
  196. package/dist/cli/chunks/{codex-installer-633SM4LR.js → codex-installer-XSQZUVOZ.js} +4 -4
  197. package/dist/cli/chunks/{completions-WUKVIW3L.js → completions-OWOOJFI2.js} +2 -2
  198. package/dist/cli/chunks/{complexity-analyzer-F73ACR5H.js → complexity-analyzer-KP5TOHDT.js} +2 -2
  199. package/dist/cli/chunks/{continuedev-installer-QH42TKMS.js → continuedev-installer-IFKQXLHM.js} +2 -2
  200. package/dist/cli/chunks/{copilot-installer-Y3XC7BTT.js → copilot-installer-IGJ6KGQY.js} +2 -2
  201. package/dist/cli/chunks/core-handlers-UAK3LLJE.js +2 -0
  202. package/dist/cli/chunks/{cost-tracker-57QPV7E3.js → cost-tracker-MMDDNKZB.js} +2 -2
  203. package/dist/cli/chunks/{coverage-IBCHMBCR.js → coverage-LUH2B7NT.js} +3 -3
  204. package/dist/cli/chunks/cross-domain-router-WTRZQPNQ.js +2 -0
  205. package/dist/cli/chunks/{cursor-installer-F4UYQHIN.js → cursor-installer-4YLM5GWM.js} +2 -2
  206. package/dist/cli/chunks/daemon-CAVZ7OFV.js +18 -0
  207. package/dist/cli/chunks/{daemon-XR4Q6YZF.js → daemon-MZKVM4CJ.js} +3 -3
  208. package/dist/cli/chunks/{dag-attention-scheduler-ZR5ZD3TW.js → dag-attention-scheduler-X4CYW665.js} +2 -2
  209. package/dist/cli/chunks/{detect-GEGYURLL.js → detect-7BM2XINO.js} +2 -2
  210. package/dist/cli/chunks/{dist-node-JU3KT2JO.js → dist-node-Y5APLEYB.js} +2 -2
  211. package/dist/cli/chunks/{domain-handler-7QI3FJGE.js → domain-handler-X3ZRJNAH.js} +2 -2
  212. package/dist/cli/chunks/{domain-plugins-O2YRM2PD.js → domain-plugins-2UW5KQJB.js} +2 -2
  213. package/dist/cli/chunks/{domain-transfer-7J3S2OS6.js → domain-transfer-35W4CIBV.js} +2 -2
  214. package/dist/cli/chunks/dream-EJY24JN6.js +2 -0
  215. package/dist/cli/chunks/embed-and-insert-pattern-COG4C7ZI.js +3 -0
  216. package/dist/cli/chunks/embedding-space-SBM2MZD2.js +2 -0
  217. package/dist/cli/chunks/{eval-RVMCIUOR.js → eval-4QA2SROK.js} +2 -2
  218. package/dist/cli/chunks/experience-capture-middleware-Z6BF6KYM.js +40 -0
  219. package/dist/cli/chunks/{fast-paths-QUKPKWKZ.js → fast-paths-FIORX6GN.js} +2 -2
  220. package/dist/cli/chunks/{feature-flags-K7JXNKJI.js → feature-flags-6LYI2T4G.js} +2 -2
  221. package/dist/cli/chunks/{feature-flags-5JCSKL2P.js → feature-flags-ZOO7LMIC.js} +2 -2
  222. package/dist/cli/chunks/file-discovery-UZSFSS4V.js +2 -0
  223. package/dist/cli/chunks/{fleet-II4Q6HXK.js → fleet-7WF53H4F.js} +3 -3
  224. package/dist/cli/chunks/{gnn-wrapper-M7VO2EMS.js → gnn-wrapper-KJ6B7BRM.js} +2 -2
  225. package/dist/cli/chunks/{heartbeat-handler-ND5CY26N.js → heartbeat-handler-DEKKMOVW.js} +4 -4
  226. package/dist/cli/chunks/heartbeat-scheduler-NVR356I7.js +2 -0
  227. package/dist/cli/chunks/hnsw-adapter-LFMPLUJU.js +2 -0
  228. package/dist/cli/chunks/hnsw-index-POCPMVJH.js +2 -0
  229. package/dist/cli/chunks/{hnsw-legacy-bridge-N3AUUUU7.js → hnsw-legacy-bridge-L27WS27N.js} +2 -2
  230. package/dist/cli/chunks/{hnswlib-node-NZY3E5EN.js → hnswlib-node-4YOQC6L4.js} +2 -2
  231. package/dist/cli/chunks/{hooks-QVJDTII5.js → hooks-TAOKV4EJ.js} +23 -22
  232. package/dist/cli/chunks/hybrid-backend-4STAO7CV.js +2 -0
  233. package/dist/cli/chunks/{hypergraph-engine-ZRY6MTDV.js → hypergraph-engine-BODRJLHL.js} +2 -2
  234. package/dist/cli/chunks/{hypergraph-handler-56DO4XZQ.js → hypergraph-handler-RKMYJNTU.js} +3 -3
  235. package/dist/cli/chunks/impact-analyzer-3VIIISBQ.js +2 -0
  236. package/dist/cli/chunks/{init-guard-DTF4EVUY.js → init-guard-MXHSLSB2.js} +2 -2
  237. package/dist/cli/chunks/{init-handler-M6CNQHMX.js → init-handler-HUE57IFW.js} +6 -6
  238. package/dist/cli/chunks/init-wizard-PL6QN6RQ.js +2 -0
  239. package/dist/cli/chunks/kernel-CCDWT7KS.js +2 -0
  240. package/dist/cli/chunks/{kilocode-installer-IJN7XKBH.js → kilocode-installer-S333IKYQ.js} +2 -2
  241. package/dist/cli/chunks/{kiro-installer-UKKPGPDC.js → kiro-installer-WM5DLQWC.js} +2 -2
  242. package/dist/cli/chunks/knowledge-graph-KFOMEN3H.js +2 -0
  243. package/dist/cli/chunks/{learning-W2HETWQ4.js → learning-LNHMQLH5.js} +3 -3
  244. package/dist/cli/chunks/{llm-router-Y546K4VX.js → llm-router-EWFXYZZR.js} +4 -4
  245. package/dist/cli/chunks/llm-router-service-7NBE2EX6.js +2 -0
  246. package/dist/cli/chunks/{load-MKAB2AXE.js → load-FGYGWVDK.js} +2 -2
  247. package/dist/cli/chunks/load-test-UNZUWY3F.js +2 -0
  248. package/dist/cli/chunks/{mcp-AZKUS6K3.js → mcp-2FHNAAOM.js} +2 -2
  249. package/dist/cli/chunks/{memory-ZDOQN2KU.js → memory-DZMQ73AB.js} +5 -5
  250. package/dist/cli/chunks/memory-backend-DFGKWA2Q.js +2 -0
  251. package/dist/cli/chunks/memory-handlers-MP426XRJ.js +2 -0
  252. package/dist/cli/chunks/{multi-model-executor-WWVXDHG4.js → multi-model-executor-6F2UAEUW.js} +2 -2
  253. package/dist/cli/chunks/{opencode-installer-YUJNXXWS.js → opencode-installer-XY3BGOTZ.js} +2 -2
  254. package/dist/cli/chunks/{orchestrator-Z6PWPLRE.js → orchestrator-B4CNKUOS.js} +17 -17
  255. package/dist/cli/chunks/pattern-null-store-SSVF5TE5.js +2 -0
  256. package/dist/cli/chunks/{pattern-usage-recorder-TPWPX32U.js → pattern-usage-recorder-R4GUFNMD.js} +2 -2
  257. package/dist/cli/chunks/{pipeline-4BBGTE4M.js → pipeline-FG5RKVRO.js} +2 -2
  258. package/dist/cli/chunks/{platform-5GSHXCV5.js → platform-3BT4KEVJ.js} +2 -2
  259. package/dist/cli/chunks/{plugin-OFDVF5HS.js → plugin-WI4RIN7O.js} +2 -2
  260. package/dist/cli/chunks/{prime-radiant-advanced-wasm-NC6MUYGJ.js → prime-radiant-advanced-wasm-7ECDNQFS.js} +2 -2
  261. package/dist/cli/chunks/project-root-BEANNYWU.js +2 -0
  262. package/dist/cli/chunks/protocol-executor-FQVIHXZ7.js +2 -0
  263. package/dist/cli/chunks/{protocol-handler-MPOAAEPA.js → protocol-handler-WNODKPGW.js} +2 -2
  264. package/dist/cli/chunks/{prove-CDKMAIVM.js → prove-5RHAEPYZ.js} +2 -2
  265. package/dist/cli/chunks/qe-reasoning-bank-5TFYSE24.js +2 -0
  266. package/dist/cli/chunks/{quality-ZH4F7R7R.js → quality-WPHR7BGQ.js} +2 -2
  267. package/dist/cli/chunks/{quality-gate-IDRMW6OE.js → quality-gate-4RKTEZMX.js} +3 -3
  268. package/dist/cli/chunks/queen-coordinator-Y2OUL7IN.js +2 -0
  269. package/dist/cli/chunks/real-embeddings-OXLYU7JW.js +2 -0
  270. package/dist/cli/chunks/{ref-validation-Z5GCGVXK.js → ref-validation-TPAWHOHH.js} +2 -2
  271. package/dist/cli/chunks/{roocode-installer-IZ2S7PH2.js → roocode-installer-7AVHFNDI.js} +2 -2
  272. package/dist/cli/chunks/router-EP34O3KB.js +2 -0
  273. package/dist/cli/chunks/routing-feedback-FJCRKXNG.js +2 -0
  274. package/dist/cli/chunks/{routing-handler-NAX35VUW.js → routing-handler-YKEDVJSH.js} +2 -2
  275. package/dist/cli/chunks/{ruvector-commands-5YW2SOFF.js → ruvector-commands-JUAMM354.js} +2 -2
  276. package/dist/cli/chunks/rvf-dual-writer-ILITJSFG.js +2 -0
  277. package/dist/cli/chunks/rvf-migration-adapter-XF6W4C2N.js +2 -0
  278. package/dist/cli/chunks/rvf-migration-coordinator-CMKG56AR.js +2 -0
  279. package/dist/cli/chunks/rvf-native-adapter-7YFW6S4Y.js +2 -0
  280. package/dist/cli/chunks/{rvf-store-integrity-IPGCAT6C.js → rvf-store-integrity-VJDUIRTX.js} +2 -2
  281. package/dist/cli/chunks/safe-db-TCAU4FUT.js +2 -0
  282. package/dist/cli/chunks/schedule-NB5KV435.js +2 -0
  283. package/dist/cli/chunks/scheduler-JKXGKVK6.js +2 -0
  284. package/dist/cli/chunks/{security-3IH4BO5Z.js → security-ORDN3RD2.js} +3 -3
  285. package/dist/cli/chunks/{shared-rvf-adapter-ABY7PAY2.js → shared-rvf-adapter-CF4BCIO7.js} +2 -2
  286. package/dist/cli/chunks/{shared-rvf-dual-writer-6KENLN2W.js → shared-rvf-dual-writer-C32UBR6D.js} +2 -2
  287. package/dist/cli/chunks/sqlite-persistence-IXCNZRTW.js +2 -0
  288. package/dist/cli/chunks/{standalone-memory-RLFAUGOW.js → standalone-memory-OXRJYZXN.js} +2 -2
  289. package/dist/cli/chunks/{status-handler-FCOZBPE5.js → status-handler-BCX5D4HY.js} +2 -2
  290. package/dist/cli/chunks/{structural-health-4RDA5UUM.js → structural-health-LFG7RUU6.js} +2 -2
  291. package/dist/cli/chunks/sync-OSF7C2NL.js +2 -0
  292. package/dist/cli/chunks/{sync-KGEEXXCC.js → sync-YJEE2K2L.js} +2 -2
  293. package/dist/cli/chunks/task-handler-6LXKPTXJ.js +64 -0
  294. package/dist/cli/chunks/{task-handlers-6H7L2UT4.js → task-handlers-CILP36I7.js} +4 -4
  295. package/dist/cli/chunks/{test-S7IG6EIX.js → test-SD457QJ6.js} +4 -4
  296. package/dist/cli/chunks/test-runner-process-VKD65QQU.js +2 -0
  297. package/dist/cli/chunks/{test-scheduling-7XYXI4L2.js → test-scheduling-ISI2O4Q5.js} +3 -3
  298. package/dist/cli/chunks/token-bootstrap-VUELSBOS.js +2 -0
  299. package/dist/cli/chunks/{token-usage-Y2YTPOFE.js → token-usage-XOC5KG7S.js} +2 -2
  300. package/dist/cli/chunks/{transformers-UCJ3HHHC.js → transformers-LSLQAARK.js} +2 -2
  301. package/dist/cli/chunks/tree-sitter-wasm-parser-YAIPHRIL.js +2 -0
  302. package/dist/cli/chunks/{types-6CMFPETH.js → types-5BLCGLCR.js} +2 -2
  303. package/dist/cli/chunks/unified-memory-GI76TXFV.js +2 -0
  304. package/dist/cli/chunks/unified-memory-hnsw-GXJ5BTZO.js +2 -0
  305. package/dist/cli/chunks/unified-persistence-OP7FDQPD.js +2 -0
  306. package/dist/cli/chunks/{upgrade-K25DN6WU.js → upgrade-RQJYLK3J.js} +2 -2
  307. package/dist/cli/chunks/{validate-T4V3TBY3.js → validate-QBHWXXCK.js} +2 -2
  308. package/dist/cli/chunks/{validate-swarm-XSRC576T.js → validate-swarm-IKXBKFB5.js} +2 -2
  309. package/dist/cli/chunks/visual-security-GZ2MOKWB.js +2 -0
  310. package/dist/cli/chunks/{web-tree-sitter-YOZXHRTN.js → web-tree-sitter-ZF6FIE5R.js} +2 -2
  311. package/dist/cli/chunks/{windsurf-installer-ITPU2IYL.js → windsurf-installer-HQGDZT5D.js} +2 -2
  312. package/dist/cli/chunks/witness-chain-DCHCAMSQ.js +2 -0
  313. package/dist/cli/chunks/witness-chain-P3XXXA62.js +2 -0
  314. package/dist/cli/chunks/witness-chain-repair-PUX2NFDL.js +2 -0
  315. package/dist/cli/chunks/{witness-chain-verifier-DTDSVKOG.js → witness-chain-verifier-PX2OQ6XT.js} +2 -2
  316. package/dist/cli/chunks/{witness-key-manager-EWACWGAW.js → witness-key-manager-RXYQNFJB.js} +2 -2
  317. package/dist/cli/chunks/{workflow-ZIQ4FV42.js → workflow-FBKCA4H6.js} +4 -4
  318. package/dist/cli/chunks/workflow-orchestrator-P2APAJAA.js +2 -0
  319. package/dist/cli/chunks/wrappers-TWSKBTWD.js +2 -0
  320. package/dist/cli/commands/code.js +4 -0
  321. package/dist/cli/commands/hooks-handlers/hooks-dream-learning.js +10 -2
  322. package/dist/cli/handlers/task-handler.d.ts +5 -0
  323. package/dist/cli/handlers/task-handler.js +21 -1
  324. package/dist/cli/utils/task-result.d.ts +11 -0
  325. package/dist/cli/utils/task-result.js +39 -0
  326. package/dist/coordination/handlers/test-execution-handlers.js +92 -58
  327. package/dist/coordination/mincut/mincut-persistence.js +29 -25
  328. package/dist/domains/code-intelligence/coordinator.d.ts +4 -0
  329. package/dist/domains/code-intelligence/coordinator.js +46 -13
  330. package/dist/domains/code-intelligence/interfaces.d.ts +10 -1
  331. package/dist/domains/code-intelligence/services/semantic-analyzer.d.ts +32 -7
  332. package/dist/domains/code-intelligence/services/semantic-analyzer.js +112 -53
  333. package/dist/domains/learning-optimization/services/learning-coordinator.js +1 -1
  334. package/dist/domains/quality-assessment/coordinator.js +2 -1
  335. package/dist/domains/test-execution/coordinator.js +10 -5
  336. package/dist/domains/test-execution/interfaces.d.ts +12 -0
  337. package/dist/domains/test-execution/plugin.js +6 -2
  338. package/dist/domains/test-execution/services/retry-handler.d.ts +2 -0
  339. package/dist/domains/test-execution/services/retry-handler.js +14 -9
  340. package/dist/domains/test-execution/services/test-executor.d.ts +1 -0
  341. package/dist/domains/test-execution/services/test-executor.js +28 -9
  342. package/dist/domains/visual-accessibility/coordinator.d.ts +15 -7
  343. package/dist/domains/visual-accessibility/coordinator.js +15 -7
  344. package/dist/domains/visual-accessibility/interfaces.d.ts +27 -3
  345. package/dist/domains/visual-accessibility/services/accessibility-contrast.d.ts +39 -0
  346. package/dist/domains/visual-accessibility/services/accessibility-contrast.js +93 -0
  347. package/dist/domains/visual-accessibility/services/accessibility-tester-browser.d.ts +18 -3
  348. package/dist/domains/visual-accessibility/services/accessibility-tester-browser.js +50 -40
  349. package/dist/domains/visual-accessibility/services/accessibility-tester-checks.d.ts +27 -0
  350. package/dist/domains/visual-accessibility/services/accessibility-tester-checks.js +137 -0
  351. package/dist/domains/visual-accessibility/services/accessibility-tester.d.ts +5 -0
  352. package/dist/domains/visual-accessibility/services/accessibility-tester.js +43 -24
  353. package/dist/domains/visual-accessibility/services/browser-swarm-coordinator.d.ts +2 -3
  354. package/dist/domains/visual-accessibility/services/browser-swarm-coordinator.js +8 -14
  355. package/dist/feedback/coverage-learner.js +13 -9
  356. package/dist/feedback/test-outcome-tracker.js +13 -9
  357. package/dist/governance/witness-chain.d.ts +5 -0
  358. package/dist/governance/witness-chain.js +22 -6
  359. package/dist/init/init-wizard-hooks.d.ts +1 -1
  360. package/dist/init/init-wizard-hooks.js +7 -8
  361. package/dist/init/phases/08-mcp.js +9 -0
  362. package/dist/init/settings-merge.d.ts +13 -0
  363. package/dist/init/settings-merge.js +49 -2
  364. package/dist/integrations/agent-booster-wasm/agent_booster_wasm.js +849 -0
  365. package/dist/integrations/agent-booster-wasm/agent_booster_wasm_bg.wasm +0 -0
  366. package/dist/integrations/agent-booster-wasm/index.d.ts +8 -0
  367. package/dist/integrations/agent-booster-wasm/index.js +25 -2
  368. package/dist/integrations/agent-booster-wasm/package.json +16 -0
  369. package/dist/integrations/agentic-flow/reasoning-bank/experience-replay.d.ts +22 -0
  370. package/dist/integrations/agentic-flow/reasoning-bank/experience-replay.js +115 -45
  371. package/dist/integrations/agentic-flow/reasoning-bank/pattern-evolution.d.ts +6 -0
  372. package/dist/integrations/agentic-flow/reasoning-bank/pattern-evolution.js +51 -33
  373. package/dist/integrations/agentic-flow/reasoning-bank/trajectory-tracker.js +17 -9
  374. package/dist/integrations/embeddings/cache/EmbeddingCache.d.ts +8 -0
  375. package/dist/integrations/embeddings/cache/EmbeddingCache.js +24 -10
  376. package/dist/integrations/ruvector/delta-tracker.d.ts +11 -0
  377. package/dist/integrations/ruvector/delta-tracker.js +16 -0
  378. package/dist/integrations/ruvector/sona-persistence.d.ts +10 -0
  379. package/dist/integrations/ruvector/sona-persistence.js +49 -24
  380. package/dist/kernel/unified-memory.d.ts +24 -0
  381. package/dist/kernel/unified-memory.js +63 -8
  382. package/dist/learning/aqe-learning-engine.js +1 -1
  383. package/dist/learning/dream/dream-engine.d.ts +3 -2
  384. package/dist/learning/dream/dream-engine.js +42 -24
  385. package/dist/learning/dream/dream-lock-retry.d.ts +38 -0
  386. package/dist/learning/dream/dream-lock-retry.js +66 -0
  387. package/dist/learning/dream/speculative-dreamer.js +1 -1
  388. package/dist/learning/embed-and-insert-pattern.js +4 -2
  389. package/dist/learning/embedder-endpoint-client.d.ts +31 -0
  390. package/dist/learning/embedder-endpoint-client.js +103 -10
  391. package/dist/learning/embedding-space.d.ts +12 -0
  392. package/dist/learning/embedding-space.js +17 -0
  393. package/dist/learning/experience-capture-middleware.js +25 -13
  394. package/dist/learning/experience-capture.js +1 -1
  395. package/dist/learning/experience-consolidation.d.ts +18 -0
  396. package/dist/learning/experience-consolidation.js +55 -8
  397. package/dist/learning/experience-space-verification.d.ts +71 -0
  398. package/dist/learning/experience-space-verification.js +147 -0
  399. package/dist/learning/pattern-lifecycle.d.ts +40 -4
  400. package/dist/learning/pattern-lifecycle.js +153 -76
  401. package/dist/learning/pattern-null-store.d.ts +5 -0
  402. package/dist/learning/pattern-null-store.js +8 -0
  403. package/dist/learning/pattern-promotion.js +6 -3
  404. package/dist/learning/pattern-store.d.ts +6 -0
  405. package/dist/learning/pattern-store.js +19 -6
  406. package/dist/learning/qe-reasoning-bank.js +2 -2
  407. package/dist/learning/real-embeddings.js +3 -1
  408. package/dist/learning/real-qe-reasoning-bank.d.ts +5 -0
  409. package/dist/learning/real-qe-reasoning-bank.js +77 -47
  410. package/dist/learning/rvf-pattern-store.js +6 -2
  411. package/dist/learning/sqlite-persistence.d.ts +6 -0
  412. package/dist/learning/sqlite-persistence.js +10 -0
  413. package/dist/mcp/bundle.js +642 -571
  414. package/dist/mcp/entry.js +4 -0
  415. package/dist/mcp/handlers/domain-handler-configs.js +2 -0
  416. package/dist/mcp/handlers/trajectory-judge.js +1 -1
  417. package/dist/mcp/protocol-server.js +1 -0
  418. package/dist/mcp/tools/visual-accessibility/index.js +8 -2
  419. package/dist/mcp/types.d.ts +6 -0
  420. package/dist/optimization/session-cache.d.ts +17 -1
  421. package/dist/optimization/session-cache.js +40 -36
  422. package/dist/planning/goap-planner.d.ts +6 -0
  423. package/dist/planning/goap-planner.js +35 -19
  424. package/dist/planning/plan-executor.js +24 -15
  425. package/dist/routing/co-execution-repository.js +12 -9
  426. package/dist/routing/routing-feedback.d.ts +8 -0
  427. package/dist/routing/routing-feedback.js +46 -24
  428. package/dist/routing/routing-outcomes-migration.js +7 -2
  429. package/dist/shared/llm/spend-ledger.d.ts +9 -0
  430. package/dist/shared/llm/spend-ledger.js +64 -39
  431. package/dist/shared/sqlite-lock-wait.d.ts +27 -0
  432. package/dist/shared/sqlite-lock-wait.js +37 -0
  433. package/dist/shared/sqlite-write-queue.d.ts +28 -0
  434. package/dist/shared/sqlite-write-queue.js +38 -0
  435. package/dist/shared/test-runner-project.d.ts +69 -0
  436. package/dist/shared/test-runner-project.js +186 -0
  437. package/dist/skills/security-visual-testing/index.d.ts +3 -1
  438. package/dist/skills/security-visual-testing/index.js +49 -35
  439. package/dist/skills/security-visual-testing/types.d.ts +19 -3
  440. package/dist/workers/workers/heartbeat-scheduler.js +5 -5
  441. package/dist/workers/workers/learning-consolidation.js +8 -7
  442. package/package.json +4 -2
  443. package/dist/cli/chunks/adapter-23KA2YW7.js +0 -2
  444. package/dist/cli/chunks/agent-booster-wasm-2DLAEZK6.js +0 -2
  445. package/dist/cli/chunks/aqe-learning-engine-MUICAXW5.js +0 -2
  446. package/dist/cli/chunks/base-XPWGYDKD.js +0 -2
  447. package/dist/cli/chunks/browser-workflow-UMQVBVGK.js +0 -2
  448. package/dist/cli/chunks/chunk-3FITMWWJ.js +0 -21
  449. package/dist/cli/chunks/chunk-ARRBXCII.js +0 -4
  450. package/dist/cli/chunks/chunk-BBYJBZHG.js +0 -14
  451. package/dist/cli/chunks/chunk-BM3EJLMV.js +0 -153
  452. package/dist/cli/chunks/chunk-D3ZZ2NLL.js +0 -62
  453. package/dist/cli/chunks/chunk-DLTB5KCR.js +0 -2
  454. package/dist/cli/chunks/chunk-DRLSJJIC.js +0 -6
  455. package/dist/cli/chunks/chunk-HAYKLXCT.js +0 -744
  456. package/dist/cli/chunks/chunk-HHBF2BZC.js +0 -65
  457. package/dist/cli/chunks/chunk-K7RT6ITZ.js +0 -2
  458. package/dist/cli/chunks/chunk-L752CNG3.js +0 -13
  459. package/dist/cli/chunks/chunk-MQXWG55U.js +0 -12
  460. package/dist/cli/chunks/chunk-WM2QRIRD.js +0 -14
  461. package/dist/cli/chunks/chunk-WRC3HLUY.js +0 -29
  462. package/dist/cli/chunks/chunk-XTZGAG6P.js +0 -27
  463. package/dist/cli/chunks/chunk-YKQWIXUY.js +0 -2
  464. package/dist/cli/chunks/client-E43GWLQH.js +0 -2
  465. package/dist/cli/chunks/core-handlers-R5A3SQDY.js +0 -2
  466. package/dist/cli/chunks/cross-domain-router-LLYVPZF6.js +0 -2
  467. package/dist/cli/chunks/daemon-BYYPIJ7G.js +0 -18
  468. package/dist/cli/chunks/dream-6C4NURSE.js +0 -2
  469. package/dist/cli/chunks/embed-and-insert-pattern-URES5Q6J.js +0 -3
  470. package/dist/cli/chunks/experience-capture-middleware-SYJQSBKE.js +0 -40
  471. package/dist/cli/chunks/file-discovery-J5IE5KP7.js +0 -2
  472. package/dist/cli/chunks/heartbeat-scheduler-FC5PBTMN.js +0 -2
  473. package/dist/cli/chunks/hnsw-adapter-47UIVOBG.js +0 -2
  474. package/dist/cli/chunks/hnsw-index-3AKVLOZQ.js +0 -2
  475. package/dist/cli/chunks/hybrid-backend-YAOSNX47.js +0 -2
  476. package/dist/cli/chunks/impact-analyzer-4FMJXM4M.js +0 -2
  477. package/dist/cli/chunks/init-wizard-RTLCRWDT.js +0 -2
  478. package/dist/cli/chunks/kernel-2OWIGGGT.js +0 -2
  479. package/dist/cli/chunks/knowledge-graph-25XXKDJN.js +0 -2
  480. package/dist/cli/chunks/llm-router-service-G3EIN4UB.js +0 -2
  481. package/dist/cli/chunks/load-test-D6QYNIVT.js +0 -2
  482. package/dist/cli/chunks/memory-backend-LDFFZMEQ.js +0 -2
  483. package/dist/cli/chunks/memory-handlers-3SQVY7FE.js +0 -2
  484. package/dist/cli/chunks/pattern-null-store-KDVRM7PW.js +0 -2
  485. package/dist/cli/chunks/project-root-DDGBWDP6.js +0 -2
  486. package/dist/cli/chunks/protocol-executor-KBOLLCWA.js +0 -2
  487. package/dist/cli/chunks/qe-reasoning-bank-GRXBT7FC.js +0 -2
  488. package/dist/cli/chunks/queen-coordinator-L2QWMJ5Q.js +0 -2
  489. package/dist/cli/chunks/real-embeddings-I2UVNNB3.js +0 -2
  490. package/dist/cli/chunks/router-FT5WJPUH.js +0 -2
  491. package/dist/cli/chunks/routing-feedback-EO2MKOUX.js +0 -2
  492. package/dist/cli/chunks/rvf-dual-writer-WHBFQJVU.js +0 -2
  493. package/dist/cli/chunks/rvf-migration-adapter-YT3APF2I.js +0 -2
  494. package/dist/cli/chunks/rvf-migration-coordinator-VUIZHTVG.js +0 -2
  495. package/dist/cli/chunks/rvf-native-adapter-37PUFKQD.js +0 -2
  496. package/dist/cli/chunks/safe-db-TDZKUOZJ.js +0 -2
  497. package/dist/cli/chunks/schedule-CRKTRY2A.js +0 -2
  498. package/dist/cli/chunks/scheduler-6ZBDVQWN.js +0 -2
  499. package/dist/cli/chunks/sqlite-persistence-FFJQAIKW.js +0 -2
  500. package/dist/cli/chunks/sync-54LUAUTK.js +0 -2
  501. package/dist/cli/chunks/task-handler-K3OXHYKU.js +0 -62
  502. package/dist/cli/chunks/test-runner-process-OTQDAJLN.js +0 -2
  503. package/dist/cli/chunks/token-bootstrap-3QMABE45.js +0 -2
  504. package/dist/cli/chunks/tree-sitter-wasm-parser-D6JTTHTP.js +0 -2
  505. package/dist/cli/chunks/unified-memory-QARWQKJ2.js +0 -2
  506. package/dist/cli/chunks/unified-memory-hnsw-LHY3DXCP.js +0 -2
  507. package/dist/cli/chunks/unified-persistence-WEYYGLHM.js +0 -2
  508. package/dist/cli/chunks/visual-security-O4ALMCXQ.js +0 -2
  509. package/dist/cli/chunks/witness-chain-B3YW5NMS.js +0 -2
  510. package/dist/cli/chunks/witness-chain-PIYR72HJ.js +0 -2
  511. package/dist/cli/chunks/witness-chain-repair-YUG7E3UX.js +0 -2
  512. package/dist/cli/chunks/workflow-orchestrator-3ZN2BCGY.js +0 -2
  513. package/dist/cli/chunks/wrappers-PW2O27LL.js +0 -2
@@ -41,6 +41,14 @@ export interface TransformOptions {
41
41
  maxChunks?: number;
42
42
  allowFallback?: boolean;
43
43
  }
44
+ /**
45
+ * Locate the wasm-bindgen glue (#1241). A relative require resolved against
46
+ * the bundle's directory (dist/mcp/ or dist/cli/chunks/), where the glue does
47
+ * not exist, so WASM never loaded from the published package. Look next to
48
+ * this module first (unbundled src/ or dist/), then in the copy the build
49
+ * places under dist/integrations/agent-booster-wasm/ in the package root.
50
+ */
51
+ export declare function resolveWasmGlue(metaUrl?: string): string | null;
44
52
  /**
45
53
  * Map file extension to Language enum
46
54
  */
@@ -8,7 +8,11 @@
8
8
  * Accuracy: 81% (13/16 test cases)
9
9
  */
10
10
  import { createRequire } from 'module';
11
+ import { existsSync } from 'fs';
12
+ import { dirname, join } from 'path';
13
+ import { fileURLToPath } from 'url';
11
14
  import { LoggerFactory } from '../../logging/index.js';
15
+ import { findPackageRoot } from '../../init/find-package-root.js';
12
16
  const logger = LoggerFactory.create('agent-booster-wasm');
13
17
  // Language constants (const object instead of enum for ESM compatibility)
14
18
  // This pattern works consistently across tsx dev mode, node, and bundled builds
@@ -45,6 +49,21 @@ const LanguageNames = {
45
49
  let wasmModule = null;
46
50
  let wasmBooster = null;
47
51
  let loadError = null;
52
+ const GLUE_FILE = 'agent_booster_wasm.js';
53
+ /**
54
+ * Locate the wasm-bindgen glue (#1241). A relative require resolved against
55
+ * the bundle's directory (dist/mcp/ or dist/cli/chunks/), where the glue does
56
+ * not exist, so WASM never loaded from the published package. Look next to
57
+ * this module first (unbundled src/ or dist/), then in the copy the build
58
+ * places under dist/integrations/agent-booster-wasm/ in the package root.
59
+ */
60
+ export function resolveWasmGlue(metaUrl = import.meta.url) {
61
+ const candidates = [join(dirname(fileURLToPath(metaUrl)), GLUE_FILE)];
62
+ const root = findPackageRoot(metaUrl);
63
+ if (root)
64
+ candidates.push(join(root, 'dist', 'integrations', 'agent-booster-wasm', GLUE_FILE));
65
+ return candidates.find((p) => existsSync(p)) ?? null;
66
+ }
48
67
  /**
49
68
  * Load the WASM module
50
69
  */
@@ -54,9 +73,13 @@ async function loadWasm() {
54
73
  if (loadError)
55
74
  return false;
56
75
  try {
57
- // Use createRequire for ESM compatibility
76
+ const gluePath = resolveWasmGlue();
77
+ if (!gluePath) {
78
+ throw new Error(`${GLUE_FILE} not found next to the module or under dist/integrations/agent-booster-wasm/`);
79
+ }
80
+ // The glue is CommonJS (it reads the .wasm via __dirname), so load it with require.
58
81
  const require = createRequire(import.meta.url);
59
- wasmModule = require('./agent_booster_wasm.js');
82
+ wasmModule = require(gluePath);
60
83
  if (!wasmModule) {
61
84
  throw new Error('WASM module loaded but is null');
62
85
  }
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "agent-booster-wasm",
3
+ "collaborators": [
4
+ "Agent Booster Team"
5
+ ],
6
+ "description": "WebAssembly bindings for agent-booster",
7
+ "version": "0.1.0",
8
+ "license": "MIT",
9
+ "files": [
10
+ "agent_booster_wasm_bg.wasm",
11
+ "agent_booster_wasm.js",
12
+ "agent_booster_wasm.d.ts"
13
+ ],
14
+ "main": "agent_booster_wasm.js",
15
+ "types": "agent_booster_wasm.d.ts"
16
+ }
@@ -41,6 +41,11 @@ export interface Experience {
41
41
  readonly avgTokenSavings: number;
42
42
  /** Embedding for similarity search */
43
43
  readonly embedding?: number[];
44
+ /**
45
+ * #1217: embedding-space identity (ADR-097 spaceId) the embedding was
46
+ * computed in. Only vectors from the active space are compared.
47
+ */
48
+ readonly embeddingSpaceId?: string;
44
49
  /** Creation timestamp */
45
50
  readonly createdAt: Date;
46
51
  /** Last applied timestamp */
@@ -135,6 +140,12 @@ export declare class ExperienceReplay {
135
140
  private idToExperienceId;
136
141
  private experienceIdToHnswId;
137
142
  private nextHnswId;
143
+ /**
144
+ * #1217: embedding space the HNSW index holds vectors of. The index only
145
+ * holds vectors of one space, so a similarity is never measured across
146
+ * spaces. Null until the embedder's space is known.
147
+ */
148
+ private indexSpaceId;
138
149
  private recentExperiences;
139
150
  private reservoirBuffer;
140
151
  private stats;
@@ -157,6 +168,10 @@ export declare class ExperienceReplay {
157
168
  /**
158
169
  * Load embeddings into HNSW index for O(log n) similarity search
159
170
  * Performance: 150x-12,500x faster than linear scan
171
+ *
172
+ * #1217: loads only vectors of the given embedding space, as the pattern
173
+ * banks do (ADR-097). Vectors of another space, or without provenance, are
174
+ * not comparable with a query embedded in this one.
160
175
  */
161
176
  private loadEmbeddingIndex;
162
177
  /**
@@ -245,6 +260,13 @@ export declare class ExperienceReplay {
245
260
  dispose(): Promise<void>;
246
261
  private ensureInitialized;
247
262
  private rowToExperience;
263
+ /**
264
+ * #1217: add a stored vector to the HNSW index. A vector of another
265
+ * embedding space re-binds the index to that space (the active one, since
266
+ * the vector was just computed): the rows of that space are reloaded,
267
+ * including this one.
268
+ */
269
+ private indexExperience;
248
270
  private floatArrayToBuffer;
249
271
  private bufferToFloatArray;
250
272
  }
@@ -14,8 +14,9 @@
14
14
  */
15
15
  import { v4 as uuidv4 } from 'uuid';
16
16
  import { getUnifiedMemory } from '../../../kernel/unified-memory.js';
17
- import { computeRealEmbedding, cosineSimilarity, } from '../../../learning/real-embeddings.js';
17
+ import { computeRealEmbedding, cosineSimilarity, getActiveEmbeddingSpaceIdentity, } from '../../../learning/real-embeddings.js';
18
18
  import { EmbedderRecovery, probeEmbedder } from '../../../learning/embedder-recovery.js';
19
+ import { verifyLegacyExperienceSpaces } from '../../../learning/experience-space-verification.js';
19
20
  import { CircularBuffer } from '../../../shared/utils/circular-buffer.js';
20
21
  import { HNSWEmbeddingIndex } from '../../embeddings/index/HNSWIndex.js';
21
22
  import { safeJsonParse } from '../../../shared/safe-json.js';
@@ -74,6 +75,12 @@ export class ExperienceReplay {
74
75
  idToExperienceId = new Map();
75
76
  experienceIdToHnswId = new Map();
76
77
  nextHnswId = 0;
78
+ /**
79
+ * #1217: embedding space the HNSW index holds vectors of. The index only
80
+ * holds vectors of one space, so a similarity is never measured across
81
+ * spaces. Null until the embedder's space is known.
82
+ */
83
+ indexSpaceId = null;
77
84
  // Recent experiences buffer
78
85
  recentExperiences;
79
86
  // Reservoir replay buffer (R10, ADR-087) — coherence-gated admission
@@ -130,7 +137,7 @@ export class ExperienceReplay {
130
137
  // Prepare statements
131
138
  this.prepareStatements();
132
139
  // Load embeddings into memory index
133
- await this.loadEmbeddingIndex();
140
+ await this.loadEmbeddingIndex(getActiveEmbeddingSpaceIdentity()?.spaceId ?? null);
134
141
  // Backfill missing embeddings on captured_experiences. Hook-side INSERT
135
142
  // paths (sources: cli-hook-post-command, patch-060-post-task, etc.)
136
143
  // bypass storeExperience() and never call computeRealEmbedding(),
@@ -149,7 +156,7 @@ export class ExperienceReplay {
149
156
  return;
150
157
  const updateStmt = this.db.prepare(`
151
158
  UPDATE captured_experiences
152
- SET embedding = ?, embedding_dimension = ?
159
+ SET embedding = ?, embedding_dimension = ?, embedding_space_id = ?
153
160
  WHERE id = ?
154
161
  `);
155
162
  let written = 0;
@@ -157,21 +164,15 @@ export class ExperienceReplay {
157
164
  // ADR-099: legacy rows may predate ingestion-time scrubbing
158
165
  const text = scrubReasoningBlocks(`${row.domain ?? ''}: ${row.task}`).slice(0, 512);
159
166
  const embedding = await computeRealEmbedding(text);
167
+ const spaceId = getActiveEmbeddingSpaceIdentity()?.spaceId;
168
+ // ADR-097: a vector without provenance would never be compared.
169
+ if (!spaceId)
170
+ break;
160
171
  const buf = Buffer.from(new Float32Array(embedding).buffer);
161
- updateStmt.run(buf, embedding.length, row.id);
172
+ // #1263: retried asynchronously, so a locked DB does not freeze the MCP server.
173
+ await this.unifiedMemory.writeWhenUnlocked(() => updateStmt.run(buf, embedding.length, spaceId, row.id));
162
174
  // Add to live HNSW so freshly-embedded rows are immediately searchable
163
- const hnswId = this.nextHnswId++;
164
- this.hnswIndex.addEmbedding({
165
- vector: embedding,
166
- dimension: 384,
167
- namespace: 'experiences',
168
- text: row.id,
169
- timestamp: Date.now(),
170
- quantization: 'none',
171
- metadata: {},
172
- }, hnswId);
173
- this.idToExperienceId.set(hnswId, row.id);
174
- this.experienceIdToHnswId.set(row.id, hnswId);
175
+ this.indexExperience(row.id, embedding, spaceId);
175
176
  written++;
176
177
  }
177
178
  console.log(`[ExperienceReplay] Backfilled ${written} captured_experiences embeddings`);
@@ -180,6 +181,30 @@ export class ExperienceReplay {
180
181
  console.warn('[ExperienceReplay] Embedding backfill failed:', err instanceof Error ? err.message : err);
181
182
  }
182
183
  })();
184
+ // #1217: vectors stored before embedding-space provenance existed are
185
+ // never compared. Attribute those the active embedder reproduces to its
186
+ // space; the vectors themselves are never rewritten. Same cap per boot.
187
+ void (async () => {
188
+ try {
189
+ if (!this.db)
190
+ return;
191
+ const result = await verifyLegacyExperienceSpaces(this.db, {
192
+ embed: (text) => computeRealEmbedding(text, this.config.embedding),
193
+ activeSpaceId: () => getActiveEmbeddingSpaceIdentity()?.spaceId,
194
+ write: (fn) => this.unifiedMemory.writeWhenUnlocked(fn),
195
+ });
196
+ if (result.checked === 0)
197
+ return;
198
+ if (result.stamped.length > 0 && result.spaceId) {
199
+ await this.loadEmbeddingIndex(result.spaceId);
200
+ }
201
+ console.log(`[ExperienceReplay] Checked ${result.checked} experience vectors without an embedding space: ` +
202
+ `${result.stamped.length} match the active embedder, ${result.left} left uncompared`);
203
+ }
204
+ catch (err) {
205
+ console.warn('[ExperienceReplay] Embedding-space check failed:', err instanceof Error ? err.message : err);
206
+ }
207
+ })();
183
208
  // Backfill missing embeddings on qe_trajectories. TrajectoryTracker.endTrajectory()
184
209
  // writes embedding=NULL with no follow-up worker; hook-side trajectory inserts
185
210
  // (cli-hook-post-task) also leave the column NULL. Without this, kNN over
@@ -206,7 +231,7 @@ export class ExperienceReplay {
206
231
  // ADR-099: legacy rows may predate ingestion-time scrubbing
207
232
  const text = scrubReasoningBlocks(`${row.domain ?? ''}: ${row.task}`).slice(0, 512);
208
233
  const embedding = await computeRealEmbedding(text);
209
- updateStmt.run(Buffer.from(new Float32Array(embedding).buffer), row.id);
234
+ await this.unifiedMemory.writeWhenUnlocked(() => updateStmt.run(Buffer.from(new Float32Array(embedding).buffer), row.id));
210
235
  written++;
211
236
  }
212
237
  console.log(`[ExperienceReplay] Backfilled ${written} qe_trajectories embeddings`);
@@ -254,6 +279,7 @@ export class ExperienceReplay {
254
279
  avg_token_savings REAL DEFAULT 0,
255
280
  embedding BLOB,
256
281
  embedding_dimension INTEGER,
282
+ embedding_space_id TEXT,
257
283
  tags TEXT,
258
284
  last_applied_at TEXT
259
285
  );
@@ -269,6 +295,8 @@ export class ExperienceReplay {
269
295
  ['avg_token_savings', 'REAL DEFAULT 0'],
270
296
  ['embedding', 'BLOB'],
271
297
  ['embedding_dimension', 'INTEGER'],
298
+ // #1217: embedding-space identity of the stored vector (ADR-097)
299
+ ['embedding_space_id', 'TEXT'],
272
300
  ['tags', 'TEXT'],
273
301
  ['last_applied_at', 'TEXT'],
274
302
  // Consolidation columns (experience-consolidation system)
@@ -320,8 +348,8 @@ export class ExperienceReplay {
320
348
  this.prepared.set('insertExperience', this.db.prepare(`
321
349
  INSERT INTO captured_experiences (
322
350
  id, task, agent, domain, success, quality, duration_ms,
323
- steps_json, routing_json, embedding, embedding_dimension, tags, source
324
- ) VALUES (?, ?, ?, ?, 1, ?, 0, ?, ?, ?, ?, ?, 'experience-replay')
351
+ steps_json, routing_json, embedding, embedding_dimension, embedding_space_id, tags, source
352
+ ) VALUES (?, ?, ?, ?, 1, ?, 0, ?, ?, ?, ?, ?, ?, 'experience-replay')
325
353
  `));
326
354
  this.prepared.set('getExperience', this.db.prepare(`
327
355
  SELECT * FROM captured_experiences WHERE id = ?
@@ -333,7 +361,8 @@ export class ExperienceReplay {
333
361
  SELECT * FROM captured_experiences WHERE consolidated_into IS NULL ORDER BY quality DESC LIMIT ?
334
362
  `));
335
363
  this.prepared.set('getAllEmbeddings', this.db.prepare(`
336
- SELECT id, embedding, embedding_dimension FROM captured_experiences WHERE embedding IS NOT NULL AND consolidated_into IS NULL
364
+ SELECT id, embedding, embedding_dimension FROM captured_experiences
365
+ WHERE embedding IS NOT NULL AND embedding_space_id = ? AND consolidated_into IS NULL
337
366
  `));
338
367
  this.prepared.set('updateApplication', this.db.prepare(`
339
368
  UPDATE captured_experiences SET
@@ -353,17 +382,22 @@ export class ExperienceReplay {
353
382
  /**
354
383
  * Load embeddings into HNSW index for O(log n) similarity search
355
384
  * Performance: 150x-12,500x faster than linear scan
385
+ *
386
+ * #1217: loads only vectors of the given embedding space, as the pattern
387
+ * banks do (ADR-097). Vectors of another space, or without provenance, are
388
+ * not comparable with a query embedded in this one.
356
389
  */
357
- async loadEmbeddingIndex() {
390
+ async loadEmbeddingIndex(spaceId) {
358
391
  const stmt = this.prepared.get('getAllEmbeddings');
359
392
  if (!stmt)
360
393
  return;
361
- const rows = stmt.all();
394
+ const rows = (spaceId ? stmt.all(spaceId) : []);
362
395
  // Clear existing mappings
363
396
  this.idToExperienceId.clear();
364
397
  this.experienceIdToHnswId.clear();
365
398
  this.hnswIndex.clearIndex('experiences');
366
399
  this.nextHnswId = 0;
400
+ this.indexSpaceId = spaceId;
367
401
  // Build HNSW index with all embeddings
368
402
  for (const row of rows) {
369
403
  if (row.embedding && row.embedding_dimension) {
@@ -413,6 +447,8 @@ export class ExperienceReplay {
413
447
  // Generate embedding for similarity search
414
448
  const embeddingText = `${task} ${strategy} ${keyActions.join(' ')}`;
415
449
  const embedding = (await this.embedOrNull(embeddingText)) ?? undefined;
450
+ // ADR-097: a vector is kept only with the space it was computed in.
451
+ const embeddingSpaceId = embedding ? getActiveEmbeddingSpaceIdentity()?.spaceId : undefined;
416
452
  const id = uuidv4();
417
453
  const domain = trajectory.domain || 'test-generation';
418
454
  const experience = {
@@ -426,7 +462,8 @@ export class ExperienceReplay {
426
462
  applicationCount: 0,
427
463
  successRate: 1.0,
428
464
  avgTokenSavings: 0,
429
- embedding,
465
+ embedding: embeddingSpaceId ? embedding : undefined,
466
+ embeddingSpaceId,
430
467
  createdAt: new Date(),
431
468
  originalMetrics: trajectory.metrics,
432
469
  tags,
@@ -434,27 +471,17 @@ export class ExperienceReplay {
434
471
  // Store in captured_experiences table
435
472
  const insertStmt = this.prepared.get('insertExperience');
436
473
  if (insertStmt) {
437
- const embeddingBuffer = embedding ? this.floatArrayToBuffer(embedding) : null;
438
- insertStmt.run(id, task, strategy, // agent column stores strategy
474
+ const embeddingBuffer = experience.embedding ? this.floatArrayToBuffer(experience.embedding) : null;
475
+ // Queued (#1274): runs when task completion events end a trajectory.
476
+ const run = () => insertStmt.run(id, task, strategy, // agent column stores strategy
439
477
  domain, trajectory.metrics.efficiencyScore, JSON.stringify(keyActions), // steps_json stores key actions
440
478
  JSON.stringify(trajectory.metrics), // routing_json stores original metrics
441
- embeddingBuffer, embedding?.length ?? null, JSON.stringify(tags));
479
+ embeddingBuffer, experience.embedding?.length ?? null, embeddingSpaceId ?? null, JSON.stringify(tags));
480
+ await (this.unifiedMemory ? this.unifiedMemory.writeWhenUnlocked(run) : run());
442
481
  }
443
482
  // Add to HNSW index for fast similarity search
444
- if (embedding) {
445
- const hnswId = this.nextHnswId++;
446
- const iEmbedding = {
447
- vector: embedding,
448
- dimension: 384,
449
- namespace: 'experiences',
450
- text: id, // Use ID as text identifier
451
- timestamp: Date.now(),
452
- quantization: 'none',
453
- metadata: {},
454
- };
455
- this.hnswIndex.addEmbedding(iEmbedding, hnswId);
456
- this.idToExperienceId.set(hnswId, id);
457
- this.experienceIdToHnswId.set(id, hnswId);
483
+ if (experience.embedding && embeddingSpaceId) {
484
+ this.indexExperience(id, experience.embedding, embeddingSpaceId);
458
485
  }
459
486
  // Add to recent buffer
460
487
  this.recentExperiences.push(experience);
@@ -515,7 +542,9 @@ export class ExperienceReplay {
515
542
  // #1022: without an embedding of the query nothing measures relevance, so
516
543
  // return no guidance rather than picks with a made-up similarity.
517
544
  const queryEmbedding = await this.embedOrNull(scrubReasoningBlocks(task));
518
- if (!queryEmbedding) {
545
+ // #1217: the query's embedding space; only vectors of it are compared.
546
+ const querySpaceId = getActiveEmbeddingSpaceIdentity()?.spaceId;
547
+ if (!queryEmbedding || !querySpaceId) {
519
548
  return null;
520
549
  }
521
550
  // Find similar experiences via HNSW
@@ -535,7 +564,11 @@ export class ExperienceReplay {
535
564
  // Skip if domain filter doesn't match
536
565
  if (domain && exp.domain !== domain)
537
566
  continue;
538
- if (!exp.embedding || exp.embedding.length !== queryEmbedding.length)
567
+ // #1217: a vector from another embedding space (even of the same
568
+ // dimension), or without provenance, has no comparable similarity.
569
+ if (!exp.embedding || exp.embeddingSpaceId !== querySpaceId)
570
+ continue;
571
+ if (exp.embedding.length !== queryEmbedding.length)
539
572
  continue;
540
573
  const similarity = cosineSimilarity(queryEmbedding, exp.embedding);
541
574
  if (similarity < this.config.similarityThreshold)
@@ -600,8 +633,9 @@ export class ExperienceReplay {
600
633
  async findSimilarExperiences(task, domain, limit) {
601
634
  this.ensureInitialized();
602
635
  const k = limit ?? this.config.topK;
603
- // Check if index is empty
604
- if (this.idToExperienceId.size === 0) {
636
+ // Check if index is empty (and bound to the active embedding space)
637
+ const knownSpaceId = getActiveEmbeddingSpaceIdentity()?.spaceId ?? null;
638
+ if (this.idToExperienceId.size === 0 && knownSpaceId !== null && knownSpaceId === this.indexSpaceId) {
605
639
  return [];
606
640
  }
607
641
  // Generate embedding for the task
@@ -611,6 +645,16 @@ export class ExperienceReplay {
611
645
  if (!taskEmbedding) {
612
646
  return [];
613
647
  }
648
+ // #1217: search only vectors of the query's embedding space.
649
+ const querySpaceId = getActiveEmbeddingSpaceIdentity()?.spaceId ?? null;
650
+ if (!querySpaceId)
651
+ return [];
652
+ if (querySpaceId !== this.indexSpaceId) {
653
+ await this.loadEmbeddingIndex(querySpaceId);
654
+ }
655
+ if (this.idToExperienceId.size === 0) {
656
+ return [];
657
+ }
614
658
  // Create query embedding for HNSW search
615
659
  const queryEmbedding = {
616
660
  vector: taskEmbedding,
@@ -722,7 +766,7 @@ export class ExperienceReplay {
722
766
  // Remove HNSW mappings for absorbed experiences
723
767
  if (result.merged > 0) {
724
768
  // Reload HNSW index to reflect consolidated state
725
- await this.loadEmbeddingIndex();
769
+ await this.loadEmbeddingIndex(this.indexSpaceId);
726
770
  }
727
771
  console.log(`[ExperienceReplay] Auto-consolidated ${domain}: ` +
728
772
  `${result.merged} merged, ${result.archived} archived`);
@@ -815,12 +859,38 @@ export class ExperienceReplay {
815
859
  embedding: row.embedding && row.embedding_dimension
816
860
  ? this.bufferToFloatArray(row.embedding, row.embedding_dimension)
817
861
  : undefined,
862
+ embeddingSpaceId: row.embedding_space_id ?? undefined,
818
863
  createdAt: new Date(row.started_at),
819
864
  lastAppliedAt: row.last_applied_at ? new Date(row.last_applied_at) : undefined,
820
865
  originalMetrics: safeJsonParse(row.routing_json || '{}'),
821
866
  tags: safeJsonParse(row.tags || '[]'),
822
867
  };
823
868
  }
869
+ /**
870
+ * #1217: add a stored vector to the HNSW index. A vector of another
871
+ * embedding space re-binds the index to that space (the active one, since
872
+ * the vector was just computed): the rows of that space are reloaded,
873
+ * including this one.
874
+ */
875
+ indexExperience(id, embedding, spaceId) {
876
+ if (spaceId !== this.indexSpaceId) {
877
+ void this.loadEmbeddingIndex(spaceId);
878
+ return;
879
+ }
880
+ const hnswId = this.nextHnswId++;
881
+ const iEmbedding = {
882
+ vector: embedding,
883
+ dimension: 384,
884
+ namespace: 'experiences',
885
+ text: id, // Use ID as text identifier
886
+ timestamp: Date.now(),
887
+ quantization: 'none',
888
+ metadata: {},
889
+ };
890
+ this.hnswIndex.addEmbedding(iEmbedding, hnswId);
891
+ this.idToExperienceId.set(hnswId, id);
892
+ this.experienceIdToHnswId.set(id, hnswId);
893
+ }
824
894
  floatArrayToBuffer(arr) {
825
895
  const buffer = Buffer.alloc(arr.length * 4);
826
896
  for (let i = 0; i < arr.length; i++) {
@@ -231,6 +231,12 @@ export declare class PatternEvolution {
231
231
  * Record an evolution event
232
232
  */
233
233
  private recordEvent;
234
+ /**
235
+ * Run a write through the shared connection's writeWhenUnlocked queue, so a
236
+ * locked memory.db does not freeze the MCP server's event loop while the
237
+ * hourly consolidation timer merges and prunes patterns (#1274).
238
+ */
239
+ private write;
234
240
  /**
235
241
  * Get statistics
236
242
  */
@@ -223,31 +223,38 @@ export class PatternEvolution {
223
223
  */
224
224
  async trackVersion(patternId, embedding, changes = [], trigger = 'manual') {
225
225
  this.ensureInitialized();
226
- // Get current version count
227
- const countStmt = this.prepared.get('getVersionCount');
228
- const countResult = countStmt?.get(patternId);
229
- const newVersion = (countResult?.count ?? 0) + 1;
230
- // Get pattern quality/success rate
231
- const patternStmt = this.prepared.get('getPattern');
232
- const pattern = patternStmt?.get(patternId);
233
226
  const id = uuidv4();
234
- const version = {
235
- id,
236
- patternId,
237
- version: newVersion,
238
- embedding,
239
- changes,
240
- qualityScore: pattern?.quality_score ?? 0.5,
241
- successRate: pattern?.success_rate ?? 0.5,
242
- timestamp: new Date(),
243
- trigger,
244
- };
245
- // Store in database
246
- const insertStmt = this.prepared.get('insertVersion');
247
- if (insertStmt) {
248
- const embeddingBuffer = this.floatArrayToBuffer(embedding);
249
- insertStmt.run(id, patternId, newVersion, embeddingBuffer, embedding.length, JSON.stringify(changes), version.qualityScore, version.successRate, trigger);
250
- }
227
+ const embeddingBuffer = this.floatArrayToBuffer(embedding);
228
+ // #1283: read the version count and insert the new version as one queued
229
+ // unit, so a locked memory.db does not freeze the MCP server and two
230
+ // concurrent calls cannot both claim the same version number.
231
+ const version = await this.write(() => {
232
+ // Get current version count
233
+ const countStmt = this.prepared.get('getVersionCount');
234
+ const countResult = countStmt?.get(patternId);
235
+ const newVersion = (countResult?.count ?? 0) + 1;
236
+ // Get pattern quality/success rate
237
+ const patternStmt = this.prepared.get('getPattern');
238
+ const pattern = patternStmt?.get(patternId);
239
+ const tracked = {
240
+ id,
241
+ patternId,
242
+ version: newVersion,
243
+ embedding,
244
+ changes,
245
+ qualityScore: pattern?.quality_score ?? 0.5,
246
+ successRate: pattern?.success_rate ?? 0.5,
247
+ timestamp: new Date(),
248
+ trigger,
249
+ };
250
+ // Store in database
251
+ const insertStmt = this.prepared.get('insertVersion');
252
+ if (insertStmt) {
253
+ insertStmt.run(id, patternId, newVersion, embeddingBuffer, embedding.length, JSON.stringify(changes), tracked.qualityScore, tracked.successRate, trigger);
254
+ }
255
+ return tracked;
256
+ });
257
+ const newVersion = version.version;
251
258
  // Update embedding cache
252
259
  this.embeddingCache.set(patternId, embedding);
253
260
  // Record evolution event
@@ -429,7 +436,8 @@ export class PatternEvolution {
429
436
  */
430
437
  async mergePatterns(patternId1, patternId2, mergedName) {
431
438
  this.ensureInitialized();
432
- if (!this.db)
439
+ const db = this.db;
440
+ if (!db)
433
441
  return null;
434
442
  const patternStmt = this.prepared.get('getPattern');
435
443
  const p1 = patternStmt?.get(patternId1);
@@ -442,13 +450,13 @@ export class PatternEvolution {
442
450
  : [p2, p1];
443
451
  // Update retained pattern name if provided
444
452
  if (mergedName) {
445
- this.db.prepare(`UPDATE qe_patterns SET name = ? WHERE id = ?`).run(mergedName, retained.id);
453
+ await this.write(() => db.prepare(`UPDATE qe_patterns SET name = ? WHERE id = ?`).run(mergedName, retained.id));
446
454
  }
447
455
  // Combine usage counts and recalculate success rate
448
456
  const totalUsage = (retained.usage_count ?? 0) + (archived.usage_count ?? 0);
449
457
  const totalSuccess = (retained.successful_uses ?? 0) + (archived.successful_uses ?? 0);
450
458
  const newSuccessRate = totalUsage > 0 ? totalSuccess / totalUsage : 0;
451
- this.db.prepare(`
459
+ await this.write(() => db.prepare(`
452
460
  UPDATE qe_patterns SET
453
461
  usage_count = ?,
454
462
  successful_uses = ?,
@@ -460,14 +468,15 @@ export class PatternEvolution {
460
468
  END,
461
469
  updated_at = datetime('now')
462
470
  WHERE id = ?
463
- `).run(totalUsage, totalSuccess, newSuccessRate, archived.last_used_at, archived.last_used_at, archived.last_used_at, retained.id);
471
+ `).run(totalUsage, totalSuccess, newSuccessRate, archived.last_used_at, archived.last_used_at, archived.last_used_at, retained.id));
464
472
  // Record merge relationship
465
473
  const relStmt = this.prepared.get('insertRelationship');
466
474
  if (relStmt) {
467
- relStmt.run(uuidv4(), archived.id, retained.id, 'merged', 1.0);
475
+ const relId = uuidv4();
476
+ await this.write(() => relStmt.run(relId, archived.id, retained.id, 'merged', 1.0));
468
477
  }
469
478
  // Archive the lower quality pattern (mark as archived)
470
- this.db.prepare(`UPDATE qe_patterns SET tier = 'archived' WHERE id = ?`).run(archived.id);
479
+ await this.write(() => db.prepare(`UPDATE qe_patterns SET tier = 'archived' WHERE id = ?`).run(archived.id));
471
480
  // Record events
472
481
  await this.recordEvent(retained.id, 'merged', { absorbedFrom: archived.id });
473
482
  await this.recordEvent(archived.id, 'archived', { mergedInto: retained.id });
@@ -497,8 +506,9 @@ export class PatternEvolution {
497
506
  for (const candidate of pruneCandidates) {
498
507
  if (candidate.reason === 'low-quality' || candidate.reason === 'obsolete') {
499
508
  // Actually delete the pattern
500
- if (this.db) {
501
- this.db.prepare(`DELETE FROM qe_patterns WHERE id = ?`).run(candidate.patternId);
509
+ const db = this.db;
510
+ if (db) {
511
+ await this.write(() => db.prepare(`DELETE FROM qe_patterns WHERE id = ?`).run(candidate.patternId));
502
512
  this.embeddingCache.delete(candidate.patternId);
503
513
  await this.recordEvent(candidate.patternId, 'pruned', { reason: candidate.reason });
504
514
  pruned++;
@@ -560,10 +570,18 @@ export class PatternEvolution {
560
570
  details,
561
571
  timestamp: new Date(),
562
572
  };
563
- insertStmt.run(event.id, patternId, eventType, JSON.stringify(details));
573
+ await this.write(() => insertStmt.run(event.id, patternId, eventType, JSON.stringify(details)));
564
574
  this.recentEvents.push(event);
565
575
  }
566
576
  }
577
+ /**
578
+ * Run a write through the shared connection's writeWhenUnlocked queue, so a
579
+ * locked memory.db does not freeze the MCP server's event loop while the
580
+ * hourly consolidation timer merges and prunes patterns (#1274).
581
+ */
582
+ write(fn) {
583
+ return this.unifiedMemory ? this.unifiedMemory.writeWhenUnlocked(fn) : Promise.resolve(fn());
584
+ }
567
585
  /**
568
586
  * Get statistics
569
587
  */