agentic-qe 3.9.32 → 3.9.34

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 (333) hide show
  1. package/.claude/skills/skills-manifest.json +1 -1
  2. package/CHANGELOG.md +120 -0
  3. package/assets/skills/skills-manifest.json +1 -1
  4. package/dist/cli/bundle.js +5 -5
  5. package/dist/cli/chunks/adapter-OXCJPHRI.js +2 -0
  6. package/dist/cli/chunks/{agent-booster-wasm-WKS3E6KT.js → agent-booster-wasm-UD3YB7FC.js} +2 -2
  7. package/dist/cli/chunks/{agent-handler-LYCAWE7S.js → agent-handler-BNBGQS6N.js} +2 -2
  8. package/dist/cli/chunks/{agent-memory-branch-XF7IOMRK.js → agent-memory-branch-NJHROVKY.js} +2 -2
  9. package/dist/cli/chunks/aqe-learning-engine-HDAC5FJJ.js +2 -0
  10. package/dist/cli/chunks/{audit-D2AY3HFP.js → audit-4Y7M2S2O.js} +2 -2
  11. package/dist/cli/chunks/base-JY364ZUA.js +2 -0
  12. package/dist/cli/chunks/{hnswlib-node-BWUH4OQT.js → better-sqlite3-4JUNP7IW.js} +2 -2
  13. package/dist/cli/chunks/{brain-handler-NNW4TAO2.js → brain-handler-VWRD34M6.js} +3 -3
  14. package/dist/cli/chunks/{branch-enumerator-OM5HNZKV.js → branch-enumerator-H4WLPOU3.js} +2 -2
  15. package/dist/cli/chunks/{browser-Y2FU2NV4.js → browser-Y7ZNFLEU.js} +2 -2
  16. package/dist/cli/chunks/browser-workflow-DAGIWFJE.js +2 -0
  17. package/dist/cli/chunks/{chunk-O5UGJ3OI.js → chunk-26BODPAN.js} +2 -2
  18. package/dist/cli/chunks/{chunk-OKEHGXIS.js → chunk-2C6LRXLU.js} +2 -2
  19. package/dist/cli/chunks/{chunk-WQ4MT74X.js → chunk-2MC2YH4J.js} +1 -1
  20. package/dist/cli/chunks/{chunk-M5PYPGBC.js → chunk-3K3QGBH7.js} +2 -2
  21. package/dist/cli/chunks/{chunk-5R5WOLZM.js → chunk-3OTG4IXK.js} +1 -1
  22. package/dist/cli/chunks/{chunk-PS6ISBED.js → chunk-3PRHEG4B.js} +2 -2
  23. package/dist/cli/chunks/{chunk-7PTW3M67.js → chunk-45SJSOSI.js} +2 -2
  24. package/dist/cli/chunks/{chunk-PPS6VN24.js → chunk-4AIJOXQJ.js} +1 -1
  25. package/dist/cli/chunks/{chunk-62UXGD5J.js → chunk-4FW4ZWPB.js} +5 -5
  26. package/dist/cli/chunks/{chunk-YVMJTBXB.js → chunk-4GHSIVTA.js} +3 -3
  27. package/dist/cli/chunks/{chunk-A6VI5BZU.js → chunk-4GSUSYZK.js} +4 -4
  28. package/dist/cli/chunks/{chunk-MEHNT37H.js → chunk-4JILSEZT.js} +2 -2
  29. package/dist/cli/chunks/{chunk-VKNCMGOJ.js → chunk-4K5KVC7R.js} +4 -4
  30. package/dist/cli/chunks/{chunk-HPQZSXED.js → chunk-4W2GGE4Z.js} +1 -1
  31. package/dist/cli/chunks/{chunk-EFEJLZDN.js → chunk-4YDLD5TW.js} +1 -1
  32. package/dist/cli/chunks/{chunk-PG5F2VHA.js → chunk-53Y6ZKPN.js} +2 -2
  33. package/dist/cli/chunks/{chunk-2L5GAOST.js → chunk-54HTQ3KQ.js} +2 -2
  34. package/dist/cli/chunks/{chunk-WTNM7NA4.js → chunk-5H44TVAY.js} +1 -1
  35. package/dist/cli/chunks/{chunk-3R4CMTWF.js → chunk-5Y3P6IAQ.js} +2 -2
  36. package/dist/cli/chunks/{chunk-XCUNQ3FK.js → chunk-67Y5HBMW.js} +2 -2
  37. package/dist/cli/chunks/{chunk-5XY6SULI.js → chunk-6FMMHW2R.js} +2 -2
  38. package/dist/cli/chunks/{chunk-XHQFVTFD.js → chunk-6FNPEC2I.js} +1 -1
  39. package/dist/cli/chunks/{chunk-A4UNK5SY.js → chunk-6UUNB4AW.js} +2 -2
  40. package/dist/cli/chunks/{chunk-VJL7DNUU.js → chunk-6XI7MNHH.js} +22 -16
  41. package/dist/cli/chunks/{chunk-SLH7LFVY.js → chunk-7AEFEPFH.js} +2 -2
  42. package/dist/cli/chunks/{chunk-ZIVOT3B7.js → chunk-7II46WAF.js} +2 -2
  43. package/dist/cli/chunks/chunk-7IUNZ653.js +9 -0
  44. package/dist/cli/chunks/{chunk-IGEZVFOM.js → chunk-7QTMWILQ.js} +2 -2
  45. package/dist/cli/chunks/{chunk-DFY7F4TE.js → chunk-7YM2AZXK.js} +1 -1
  46. package/dist/cli/chunks/{chunk-REW3W3ZW.js → chunk-7ZE5BXCN.js} +1 -1
  47. package/dist/cli/chunks/{chunk-FNQCWEVJ.js → chunk-A2FZAEIU.js} +2 -2
  48. package/dist/cli/chunks/{chunk-JDW6GN3A.js → chunk-AGHBG5E4.js} +2 -2
  49. package/dist/cli/chunks/{chunk-NW5FYGDE.js → chunk-AHEHD3AP.js} +2 -2
  50. package/dist/cli/chunks/{chunk-NZRJWK5H.js → chunk-AIQHS7D2.js} +9 -9
  51. package/dist/cli/chunks/{chunk-MIHQIAVK.js → chunk-ARKWPPBZ.js} +2 -2
  52. package/dist/cli/chunks/{chunk-7AISRWBS.js → chunk-AX7F6CNY.js} +2 -2
  53. package/dist/cli/chunks/{chunk-2Z2IQBIJ.js → chunk-AYLTFMTW.js} +1 -1
  54. package/dist/cli/chunks/{chunk-6EKXBWJD.js → chunk-BBULBXTO.js} +2 -2
  55. package/dist/cli/chunks/{chunk-BQML7B4W.js → chunk-BP45DZKL.js} +3 -3
  56. package/dist/cli/chunks/{chunk-PLGMPG7S.js → chunk-CKJGWNIS.js} +2 -2
  57. package/dist/cli/chunks/{chunk-Z2EDNMCQ.js → chunk-CWM5LSLQ.js} +2 -2
  58. package/dist/cli/chunks/{chunk-667I4RTC.js → chunk-DGEXLCOX.js} +1 -1
  59. package/dist/cli/chunks/{chunk-W3JB3G7C.js → chunk-DIX6AR2P.js} +2 -2
  60. package/dist/cli/chunks/{chunk-45N22VAB.js → chunk-DKA5WC6T.js} +2 -2
  61. package/dist/cli/chunks/chunk-DOKH4EJX.js +2 -0
  62. package/dist/cli/chunks/{chunk-ONNTJXU7.js → chunk-DXKZQYBK.js} +2 -2
  63. package/dist/cli/chunks/chunk-DXOFPU3A.js +2 -0
  64. package/dist/cli/chunks/{chunk-FWEYOD3S.js → chunk-E2IC6PHO.js} +2 -2
  65. package/dist/cli/chunks/{chunk-H7YKTJMY.js → chunk-EPETDHDV.js} +2 -2
  66. package/dist/cli/chunks/{chunk-G77CYF7H.js → chunk-EWVKCXV3.js} +3 -3
  67. package/dist/cli/chunks/{chunk-V6HM2BKJ.js → chunk-FAQSUNVC.js} +1 -1
  68. package/dist/cli/chunks/{chunk-JRYNHFZA.js → chunk-FCWQRUXQ.js} +1 -1
  69. package/dist/cli/chunks/{chunk-FFBF5BLQ.js → chunk-FW3EEASU.js} +1 -1
  70. package/dist/cli/chunks/{chunk-NVZHCAEB.js → chunk-GCMCU54O.js} +2 -2
  71. package/dist/cli/chunks/{chunk-OKRY4LNE.js → chunk-GW7T2ABB.js} +3 -3
  72. package/dist/cli/chunks/{chunk-KHZRNJ3A.js → chunk-GYJAPCP2.js} +1 -1
  73. package/dist/cli/chunks/{chunk-PQAYCK2U.js → chunk-HIZWO4J3.js} +2 -2
  74. package/dist/cli/chunks/{chunk-5WR42V5O.js → chunk-I74WDBHS.js} +2 -2
  75. package/dist/cli/chunks/{chunk-XB3SIYGU.js → chunk-IH5MVTLA.js} +2 -2
  76. package/dist/cli/chunks/{chunk-4VAZSCTZ.js → chunk-IPEUGCUK.js} +2 -2
  77. package/dist/cli/chunks/{chunk-6SYP7QX6.js → chunk-IPRUAUGV.js} +4 -4
  78. package/dist/cli/chunks/{chunk-I6Q6BPVH.js → chunk-IT7TOO52.js} +1 -1
  79. package/dist/cli/chunks/{chunk-ZESMMAKZ.js → chunk-IUZNVWCR.js} +2 -2
  80. package/dist/cli/chunks/{chunk-V7ZBPSVG.js → chunk-JFGKC6D4.js} +1 -1
  81. package/dist/cli/chunks/{chunk-PIXUX2NR.js → chunk-JH5HQ2HW.js} +2 -2
  82. package/dist/cli/chunks/{chunk-7IDPVSTF.js → chunk-JNLDMRUK.js} +1 -1
  83. package/dist/cli/chunks/{chunk-SRJ5N7LD.js → chunk-JNURLIOU.js} +2 -2
  84. package/dist/cli/chunks/{chunk-DBE2LIYG.js → chunk-JOOI3M6I.js} +2 -2
  85. package/dist/cli/chunks/{chunk-HR6NX6DW.js → chunk-JRCHYAB7.js} +2 -2
  86. package/dist/cli/chunks/{chunk-5DSANX6S.js → chunk-JZBBCQ7Y.js} +2 -2
  87. package/dist/cli/chunks/{chunk-3MHWBCSC.js → chunk-K5KL5MPG.js} +1 -1
  88. package/dist/cli/chunks/{chunk-G6VVOUUF.js → chunk-K7EU2KJF.js} +2 -2
  89. package/dist/cli/chunks/{chunk-PHRMWRXA.js → chunk-KN6QHR7J.js} +2 -2
  90. package/dist/cli/chunks/{chunk-S4M7U6CZ.js → chunk-L5W7KTBW.js} +2 -2
  91. package/dist/cli/chunks/{chunk-LTSNDM5N.js → chunk-LBKEWXMR.js} +2 -2
  92. package/dist/cli/chunks/{chunk-RZXAXWBD.js → chunk-LH372B74.js} +2 -2
  93. package/dist/cli/chunks/{chunk-W2VTHUDK.js → chunk-LIIG3F7K.js} +2 -2
  94. package/dist/cli/chunks/{chunk-MERMCKPG.js → chunk-LUU2O2AZ.js} +1 -1
  95. package/dist/cli/chunks/{chunk-EVSUZKD5.js → chunk-LYOAIGIT.js} +2 -2
  96. package/dist/cli/chunks/{chunk-5A6LBGRU.js → chunk-M6NSPXHR.js} +2 -2
  97. package/dist/cli/chunks/{chunk-IGQPGXP7.js → chunk-MIH7Y46H.js} +2 -2
  98. package/dist/cli/chunks/{chunk-ESNBKAT6.js → chunk-NKBLXHVM.js} +2 -2
  99. package/dist/cli/chunks/{chunk-6ZG6TBWF.js → chunk-O4DJLMRE.js} +4 -4
  100. package/dist/cli/chunks/{chunk-V5RLGPEW.js → chunk-P22YWOM2.js} +2 -2
  101. package/dist/cli/chunks/{chunk-OMOGD2NN.js → chunk-PMFV3ZFP.js} +2 -2
  102. package/dist/cli/chunks/{chunk-THYGFSTA.js → chunk-PYQ7VCH2.js} +13 -13
  103. package/dist/cli/chunks/{chunk-V7I6FTLG.js → chunk-QFBPVPYA.js} +1 -1
  104. package/dist/cli/chunks/{chunk-33PGBYTC.js → chunk-QPH72S4A.js} +2 -2
  105. package/dist/cli/chunks/{chunk-BBPOTFIY.js → chunk-QX74JLGO.js} +2 -2
  106. package/dist/cli/chunks/{chunk-YBUUAFKR.js → chunk-R7IYH6X2.js} +1 -1
  107. package/dist/cli/chunks/{chunk-6YGFAJ3X.js → chunk-RASEXZD3.js} +1 -1
  108. package/dist/cli/chunks/{chunk-YJV6TTCW.js → chunk-REVCXO2R.js} +2 -2
  109. package/dist/cli/chunks/{chunk-HHBFI3YA.js → chunk-RGQ2AOYV.js} +2 -2
  110. package/dist/cli/chunks/{chunk-O5NEZCTB.js → chunk-RJUWW4XE.js} +1 -1
  111. package/dist/cli/chunks/{chunk-MTOHV22P.js → chunk-RVG3DAU3.js} +1 -1
  112. package/dist/cli/chunks/{chunk-LI2IOJMM.js → chunk-RXQCDEDD.js} +1 -1
  113. package/dist/cli/chunks/{chunk-HGWQC7PR.js → chunk-RYFQYSVF.js} +2 -2
  114. package/dist/cli/chunks/{chunk-OPOGZAN5.js → chunk-S43X3HTH.js} +2 -2
  115. package/dist/cli/chunks/{chunk-YUSGT2CU.js → chunk-SLHE7BA3.js} +1 -1
  116. package/dist/cli/chunks/chunk-TH7BP4KG.js +2 -0
  117. package/dist/cli/chunks/{chunk-LR5VW3OS.js → chunk-TZFIBU6S.js} +2 -2
  118. package/dist/cli/chunks/{chunk-2XC4XVCI.js → chunk-UAKD7J72.js} +1 -1
  119. package/dist/cli/chunks/{chunk-UJMGNO6L.js → chunk-UCBDYSNE.js} +1 -1
  120. package/dist/cli/chunks/{chunk-4H4PEZUX.js → chunk-ULXDULD6.js} +2 -2
  121. package/dist/cli/chunks/{chunk-BGRC4676.js → chunk-UZZKBGGQ.js} +3 -3
  122. package/dist/cli/chunks/{chunk-SJETAUZA.js → chunk-VB2ZBN46.js} +1 -1
  123. package/dist/cli/chunks/{chunk-YUTSN5BK.js → chunk-VID5XDDQ.js} +2 -2
  124. package/dist/cli/chunks/{chunk-OK2TFTXP.js → chunk-VR65KHTH.js} +2 -2
  125. package/dist/cli/chunks/chunk-VSNLUVQI.js +15 -0
  126. package/dist/cli/chunks/{chunk-IJQJV7BC.js → chunk-WGEKHWCJ.js} +3 -3
  127. package/dist/cli/chunks/{chunk-BV3SGEV7.js → chunk-WGMA22FN.js} +1 -1
  128. package/dist/cli/chunks/{chunk-T5ADVYPH.js → chunk-WM6MDDHR.js} +1 -1
  129. package/dist/cli/chunks/{chunk-6R6QCGNU.js → chunk-WUDJA3B6.js} +2 -2
  130. package/dist/cli/chunks/{chunk-UUQ3SOKM.js → chunk-XK2IKEXP.js} +1 -1
  131. package/dist/cli/chunks/{chunk-TX2DBLTL.js → chunk-XLDGQJWP.js} +1 -1
  132. package/dist/cli/chunks/chunk-XM6CMEQK.js +2 -0
  133. package/dist/cli/chunks/chunk-XWD7QYS5.js +2 -0
  134. package/dist/cli/chunks/{chunk-QRTZ67BC.js → chunk-YG5HLQAB.js} +2 -2
  135. package/dist/cli/chunks/{chunk-MQQANXFS.js → chunk-YIVJD5IY.js} +2 -2
  136. package/dist/cli/chunks/{chunk-MMVSERJQ.js → chunk-Z6IQMLD7.js} +2 -2
  137. package/dist/cli/chunks/{chunk-LHDTXTS7.js → chunk-ZQZ4NYTM.js} +1 -1
  138. package/dist/cli/chunks/{chunk-BDXEL3GM.js → chunk-ZSOPY44S.js} +2 -2
  139. package/dist/cli/chunks/{chunk-RHXYZ6AZ.js → chunk-ZYF6F4MA.js} +145 -145
  140. package/dist/cli/chunks/{ci-NSF6OHB4.js → ci-SIPIBCBR.js} +2 -2
  141. package/dist/cli/chunks/{ci-output-ZPDJ42U3.js → ci-output-TDKJNSD4.js} +2 -2
  142. package/dist/cli/chunks/{circuit-breaker-Y2RUJDYG.js → circuit-breaker-4JC4THEE.js} +2 -2
  143. package/dist/cli/chunks/{claude-flow-setup-OH6G6KM2.js → claude-flow-setup-7LCBF65N.js} +2 -2
  144. package/dist/cli/chunks/client-N53TFCGN.js +2 -0
  145. package/dist/cli/chunks/{cline-installer-IHH4F27G.js → cline-installer-X3RPF536.js} +2 -2
  146. package/dist/cli/chunks/{code-SFAHWFTX.js → code-QWSERFVQ.js} +2 -2
  147. package/dist/cli/chunks/{code-index-extractor-GXECMOM2.js → code-index-extractor-B6C35JTM.js} +2 -2
  148. package/dist/cli/chunks/{codex-installer-UPMSAFCQ.js → codex-installer-A427S2HR.js} +2 -2
  149. package/dist/cli/chunks/{completions-5TX6LDHY.js → completions-77KS3LAM.js} +2 -2
  150. package/dist/cli/chunks/{complexity-analyzer-J2ZR3XZB.js → complexity-analyzer-SJUYVCGS.js} +2 -2
  151. package/dist/cli/chunks/{continuedev-installer-GWYZKB5A.js → continuedev-installer-HQMJQXFA.js} +2 -2
  152. package/dist/cli/chunks/{copilot-installer-DQZMQWI7.js → copilot-installer-JVWVXFRV.js} +2 -2
  153. package/dist/cli/chunks/{cost-tracker-V7KIGCLZ.js → cost-tracker-ATJWY2ZJ.js} +2 -2
  154. package/dist/cli/chunks/{coverage-3X6LA2GZ.js → coverage-OVUELXVF.js} +3 -3
  155. package/dist/cli/chunks/cross-domain-router-3TYSHECB.js +2 -0
  156. package/dist/cli/chunks/{cursor-installer-ENDG4JIU.js → cursor-installer-HMRQMVDC.js} +2 -2
  157. package/dist/cli/chunks/{daemon-4XVAO7GT.js → daemon-KSWTELMB.js} +3 -3
  158. package/dist/cli/chunks/{daemon-TC65CQFK.js → daemon-PJLXQV52.js} +4 -4
  159. package/dist/cli/chunks/{dag-attention-scheduler-JOSCDRZC.js → dag-attention-scheduler-U2ENVYTQ.js} +2 -2
  160. package/dist/cli/chunks/{detect-KWZX3OMK.js → detect-TMMIVPON.js} +2 -2
  161. package/dist/cli/chunks/{dist-node-R4U2PJ47.js → dist-node-ELGZENVQ.js} +2 -2
  162. package/dist/cli/chunks/{domain-handler-BMYYZO2L.js → domain-handler-XERZXZL6.js} +2 -2
  163. package/dist/cli/chunks/{domain-transfer-MSDBBDLC.js → domain-transfer-QRERMYSJ.js} +2 -2
  164. package/dist/cli/chunks/dream-EU6ZE7N7.js +2 -0
  165. package/dist/cli/chunks/{embed-and-insert-pattern-MFINPOLS.js → embed-and-insert-pattern-Q2PARYU4.js} +2 -2
  166. package/dist/cli/chunks/{eval-OER6UNUY.js → eval-A2QR6KW4.js} +2 -2
  167. package/dist/cli/chunks/{experience-capture-middleware-F5I77ECG.js → experience-capture-middleware-CQWPD3DM.js} +3 -3
  168. package/dist/cli/chunks/{fast-paths-P3KT5DUQ.js → fast-paths-IAOUZHSJ.js} +2 -2
  169. package/dist/cli/chunks/{feature-flags-DYFZSQLV.js → feature-flags-3D74EHP5.js} +2 -2
  170. package/dist/cli/chunks/{feature-flags-5EBWQ5WU.js → feature-flags-CODLAMZU.js} +2 -2
  171. package/dist/cli/chunks/{file-discovery-MOBVABSM.js → file-discovery-ZUBZH4Q6.js} +2 -2
  172. package/dist/cli/chunks/{fleet-J3R3NQNC.js → fleet-TTADPVN2.js} +3 -3
  173. package/dist/cli/chunks/{gnn-wrapper-QD76SULF.js → gnn-wrapper-ZFDW3ZAW.js} +2 -2
  174. package/dist/cli/chunks/{heartbeat-handler-AJEWTPZ4.js → heartbeat-handler-IV67NVZW.js} +4 -4
  175. package/dist/cli/chunks/heartbeat-scheduler-JN775DB4.js +2 -0
  176. package/dist/cli/chunks/hnsw-adapter-PHMYMEDW.js +2 -0
  177. package/dist/cli/chunks/hnsw-index-BS65TOXD.js +2 -0
  178. package/dist/cli/chunks/{hnsw-legacy-bridge-5VRM5N7K.js → hnsw-legacy-bridge-GMFHJ4OK.js} +2 -2
  179. package/dist/cli/chunks/{better-sqlite3-K2VWFDKT.js → hnswlib-node-3LBUPOTX.js} +2 -2
  180. package/dist/cli/chunks/{hooks-7PMVKQOE.js → hooks-DOGCENUA.js} +34 -34
  181. package/dist/cli/chunks/{hybrid-router-2K2LW45J.js → hybrid-router-LQO3U6IH.js} +2 -2
  182. package/dist/cli/chunks/{hypergraph-engine-2CQ735JO.js → hypergraph-engine-KHKAUWVL.js} +2 -2
  183. package/dist/cli/chunks/{hypergraph-handler-AQ53GVIW.js → hypergraph-handler-T6X4F24T.js} +3 -3
  184. package/dist/cli/chunks/impact-analyzer-BR25PT76.js +2 -0
  185. package/dist/cli/chunks/{init-handler-ZOVJPAWO.js → init-handler-JTXMI2GF.js} +13 -12
  186. package/dist/cli/chunks/init-wizard-42IYSTTD.js +2 -0
  187. package/dist/cli/chunks/kernel-JFSTL7NN.js +2 -0
  188. package/dist/cli/chunks/{kilocode-installer-GWQCNLKI.js → kilocode-installer-P2WDAIOD.js} +2 -2
  189. package/dist/cli/chunks/{kiro-installer-6KVES4MO.js → kiro-installer-CLTOWLVB.js} +2 -2
  190. package/dist/cli/chunks/knowledge-graph-JYRFHKO2.js +2 -0
  191. package/dist/cli/chunks/{learning-6XMNWXRT.js → learning-CNDBY3JP.js} +3 -3
  192. package/dist/cli/chunks/{llm-router-GS4AZJJC.js → llm-router-SJOZ6EIJ.js} +4 -4
  193. package/dist/cli/chunks/load-GXZWRYTU.js +2 -0
  194. package/dist/cli/chunks/load-test-K7XFH5AD.js +2 -0
  195. package/dist/cli/chunks/{mcp-6V2H7EXU.js → mcp-LLMLANLC.js} +2 -2
  196. package/dist/cli/chunks/{memory-YLGPOB2H.js → memory-MEBFXR4C.js} +5 -5
  197. package/dist/cli/chunks/memory-backend-5O4Y5PKW.js +2 -0
  198. package/dist/cli/chunks/memory-handlers-46WKVXKK.js +2 -0
  199. package/dist/cli/chunks/{multi-model-executor-SL2EKAH2.js → multi-model-executor-ZO35ZPDR.js} +2 -2
  200. package/dist/cli/chunks/{opencode-installer-ADOJVGNA.js → opencode-installer-EG2MFPDZ.js} +2 -2
  201. package/dist/cli/chunks/{orchestrator-O4IWW2VU.js → orchestrator-PXA5IT5X.js} +5 -5
  202. package/dist/cli/chunks/{pipeline-5BD5YQNQ.js → pipeline-T3XOEAKT.js} +2 -2
  203. package/dist/cli/chunks/{platform-HXSUOOJH.js → platform-CPKBJ4I6.js} +2 -2
  204. package/dist/cli/chunks/{plugin-HOLH5CUH.js → plugin-YDP2IK3D.js} +2 -2
  205. package/dist/cli/chunks/{prime-radiant-advanced-wasm-PJTL7OLS.js → prime-radiant-advanced-wasm-GDN5WBH2.js} +2 -2
  206. package/dist/cli/chunks/protocol-executor-VACEWXHI.js +2 -0
  207. package/dist/cli/chunks/{protocol-handler-K27YGLC7.js → protocol-handler-32QLWTY3.js} +2 -2
  208. package/dist/cli/chunks/{prove-MHCLHQQ6.js → prove-7JFRIBOM.js} +2 -2
  209. package/dist/cli/chunks/{provider-manager-3645PPXX.js → provider-manager-TNR7QM6Z.js} +2 -2
  210. package/dist/cli/chunks/qe-reasoning-bank-4A5MKOA5.js +2 -0
  211. package/dist/cli/chunks/{quality-NDE6EDOY.js → quality-G36Z4FD3.js} +2 -2
  212. package/dist/cli/chunks/queen-coordinator-FF3W2BLZ.js +2 -0
  213. package/dist/cli/chunks/{real-embeddings-VD3EVV3U.js → real-embeddings-RYVIB5N2.js} +2 -2
  214. package/dist/cli/chunks/{roocode-installer-63Y45UUG.js → roocode-installer-ZANTFQAH.js} +2 -2
  215. package/dist/cli/chunks/router-OTSEMLFG.js +2 -0
  216. package/dist/cli/chunks/routing-feedback-PHWP7EO3.js +2 -0
  217. package/dist/cli/chunks/{routing-handler-76XISU2E.js → routing-handler-6YNDHLBC.js} +2 -2
  218. package/dist/cli/chunks/{ruvector-commands-AEKOZZHZ.js → ruvector-commands-E42JA573.js} +2 -2
  219. package/dist/cli/chunks/{rvf-dual-writer-4DMUIZQF.js → rvf-dual-writer-SQDEXP45.js} +2 -2
  220. package/dist/cli/chunks/{rvf-migration-adapter-YUTXFOZ3.js → rvf-migration-adapter-DMI4QBRX.js} +2 -2
  221. package/dist/cli/chunks/{rvf-migration-coordinator-XJ5N2W37.js → rvf-migration-coordinator-AUEOD5MP.js} +2 -2
  222. package/dist/cli/chunks/rvf-native-adapter-E4XSLZPD.js +2 -0
  223. package/dist/cli/chunks/safe-db-ESTCAWF2.js +2 -0
  224. package/dist/cli/chunks/schedule-VJYEPFI4.js +2 -0
  225. package/dist/cli/chunks/scheduler-2SVKVACS.js +2 -0
  226. package/dist/cli/chunks/{security-6YS6GQGO.js → security-BJTKEGXZ.js} +3 -3
  227. package/dist/cli/chunks/shared-rvf-adapter-RWX6AAVO.js +2 -0
  228. package/dist/cli/chunks/{shared-rvf-dual-writer-MH2Y65HA.js → shared-rvf-dual-writer-PIZFXKKE.js} +2 -2
  229. package/dist/cli/chunks/sqlite-persistence-KGN5AIVX.js +2 -0
  230. package/dist/cli/chunks/{status-handler-57JQMPY5.js → status-handler-BSQJAFH2.js} +2 -2
  231. package/dist/cli/chunks/{structural-health-34D5VWRD.js → structural-health-ZL4KQNQX.js} +2 -2
  232. package/dist/cli/chunks/{sync-TTQ6ZB5D.js → sync-BM32HBUY.js} +2 -2
  233. package/dist/cli/chunks/{sync-HJD2US5P.js → sync-KH3IIPKB.js} +2 -2
  234. package/dist/cli/chunks/{task-handler-4RF57637.js → task-handler-SWMZVIZ5.js} +2 -2
  235. package/dist/cli/chunks/{task-handlers-BRSK7HDE.js → task-handlers-PJD6QWQP.js} +3 -3
  236. package/dist/cli/chunks/{test-GMUW2VR3.js → test-ACQ2N7AK.js} +4 -4
  237. package/dist/cli/chunks/{test-scheduling-7LF24IFV.js → test-scheduling-BCSHQHZO.js} +3 -3
  238. package/dist/cli/chunks/{token-bootstrap-VYT4RTHU.js → token-bootstrap-7DAATWOU.js} +2 -2
  239. package/dist/cli/chunks/{token-usage-NFNCPQGW.js → token-usage-AYPCJN77.js} +2 -2
  240. package/dist/cli/chunks/{transformers-GGD5GIEY.js → transformers-ZYSRJRXA.js} +2 -2
  241. package/dist/cli/chunks/tree-sitter-wasm-parser-HXHBILDS.js +2 -0
  242. package/dist/cli/chunks/{types-WJ3ZTRD5.js → types-O5ODR3WQ.js} +2 -2
  243. package/dist/cli/chunks/unified-memory-UBGLIO43.js +2 -0
  244. package/dist/cli/chunks/unified-memory-hnsw-BJMFYCFZ.js +2 -0
  245. package/dist/cli/chunks/unified-persistence-Q54OKOYY.js +2 -0
  246. package/dist/cli/chunks/{upgrade-IMBT4F6K.js → upgrade-ULP5J35D.js} +2 -2
  247. package/dist/cli/chunks/{validate-76OVF45Z.js → validate-JS6WD4S5.js} +2 -2
  248. package/dist/cli/chunks/{validate-swarm-HH2ZYWXA.js → validate-swarm-NCO5QBTJ.js} +2 -2
  249. package/dist/cli/chunks/{vibium-74WQNDBX.js → vibium-RGRUK6EW.js} +2 -2
  250. package/dist/cli/chunks/visual-security-RRVHQBRP.js +2 -0
  251. package/dist/cli/chunks/{web-tree-sitter-W6RGE4SL.js → web-tree-sitter-NGX5C2HB.js} +2 -2
  252. package/dist/cli/chunks/{windsurf-installer-7DMSFCA2.js → windsurf-installer-KRAE3JB2.js} +2 -2
  253. package/dist/cli/chunks/witness-chain-2YIUBXAF.js +2 -0
  254. package/dist/cli/chunks/{witness-chain-BLZ4ZKAD.js → witness-chain-62V6YLTM.js} +2 -2
  255. package/dist/cli/chunks/{workflow-RNSDKRZ4.js → workflow-BVMZE2FE.js} +4 -4
  256. package/dist/cli/chunks/workflow-orchestrator-VGNC5PFE.js +2 -0
  257. package/dist/cli/chunks/{wrappers-J7RXMIOY.js → wrappers-SEDAPKCG.js} +2 -2
  258. package/dist/cli/commands/hooks-handlers/hooks-shared.js +12 -21
  259. package/dist/cli/handlers/init-handler.js +47 -0
  260. package/dist/domains/learning-optimization/coordinator-helpers.js +7 -1
  261. package/dist/domains/learning-optimization/coordinator.js +5 -1
  262. package/dist/domains/learning-optimization/services/learning-coordinator.js +6 -1
  263. package/dist/domains/learning-optimization/services/metrics-optimizer.js +4 -1
  264. package/dist/domains/learning-optimization/services/production-intel.js +14 -5
  265. package/dist/domains/learning-optimization/services/transfer-specialist.js +12 -4
  266. package/dist/integrations/embeddings/base/EmbeddingGenerator.d.ts +1 -1
  267. package/dist/integrations/embeddings/base/EmbeddingGenerator.js +14 -5
  268. package/dist/integrations/ruvector/rvf-dual-writer.d.ts +22 -0
  269. package/dist/integrations/ruvector/rvf-dual-writer.js +21 -0
  270. package/dist/integrations/ruvector/rvf-native-adapter.d.ts +18 -1
  271. package/dist/integrations/ruvector/rvf-native-adapter.js +15 -1
  272. package/dist/integrations/ruvector/shared-rvf-adapter.d.ts +46 -1
  273. package/dist/integrations/ruvector/shared-rvf-adapter.js +137 -0
  274. package/dist/kernel/hybrid-backend.d.ts +14 -3
  275. package/dist/kernel/hybrid-backend.js +16 -3
  276. package/dist/kernel/unified-memory.d.ts +3 -1
  277. package/dist/kernel/unified-memory.js +28 -3
  278. package/dist/learning/dream/dream-scheduler.d.ts +18 -0
  279. package/dist/learning/dream/dream-scheduler.js +68 -0
  280. package/dist/learning/qe-reasoning-bank.js +19 -2
  281. package/dist/learning/real-embeddings.js +1 -1
  282. package/dist/learning/sqlite-persistence.d.ts +11 -0
  283. package/dist/learning/sqlite-persistence.js +30 -0
  284. package/dist/mcp/bundle.js +404 -398
  285. package/dist/shared/parsers/tree-sitter-wasm-parser.js +8 -3
  286. package/dist/shared/utils/index.d.ts +1 -0
  287. package/dist/shared/utils/index.js +1 -0
  288. package/dist/shared/utils/kv-date-rehydrate.d.ts +51 -0
  289. package/dist/shared/utils/kv-date-rehydrate.js +78 -0
  290. package/dist/workers/workers/learning-consolidation.js +7 -1
  291. package/package.json +21 -10
  292. package/dist/cli/chunks/adapter-CDQOF5TF.js +0 -2
  293. package/dist/cli/chunks/aqe-learning-engine-RZK22CJB.js +0 -2
  294. package/dist/cli/chunks/base-UGH6TVO4.js +0 -2
  295. package/dist/cli/chunks/browser-workflow-SGOL3FCJ.js +0 -2
  296. package/dist/cli/chunks/chunk-FIONYUVH.js +0 -2
  297. package/dist/cli/chunks/chunk-FV2MU6CY.js +0 -2
  298. package/dist/cli/chunks/chunk-G6AJMFWL.js +0 -15
  299. package/dist/cli/chunks/chunk-QPYNQSWD.js +0 -9
  300. package/dist/cli/chunks/chunk-VKCWWR6C.js +0 -2
  301. package/dist/cli/chunks/chunk-YVQ4PR4H.js +0 -2
  302. package/dist/cli/chunks/client-QQGRKAY7.js +0 -2
  303. package/dist/cli/chunks/cross-domain-router-3SHAGRVP.js +0 -2
  304. package/dist/cli/chunks/dream-OCZK42FM.js +0 -2
  305. package/dist/cli/chunks/heartbeat-scheduler-EAVZR6TJ.js +0 -2
  306. package/dist/cli/chunks/hnsw-adapter-BY4XB7FB.js +0 -2
  307. package/dist/cli/chunks/hnsw-index-657CZRG7.js +0 -2
  308. package/dist/cli/chunks/impact-analyzer-GI6UVAMT.js +0 -2
  309. package/dist/cli/chunks/init-wizard-HOH577MH.js +0 -2
  310. package/dist/cli/chunks/kernel-JDYBG5GE.js +0 -2
  311. package/dist/cli/chunks/knowledge-graph-RAQOWLG3.js +0 -2
  312. package/dist/cli/chunks/load-FEMEQNE6.js +0 -2
  313. package/dist/cli/chunks/load-test-3MEJ43U2.js +0 -2
  314. package/dist/cli/chunks/memory-backend-2A47ZRGO.js +0 -2
  315. package/dist/cli/chunks/memory-handlers-UBTBC7D2.js +0 -2
  316. package/dist/cli/chunks/protocol-executor-3FR7FBVM.js +0 -2
  317. package/dist/cli/chunks/qe-reasoning-bank-CHNYPYQW.js +0 -2
  318. package/dist/cli/chunks/queen-coordinator-J6ZRYTBX.js +0 -2
  319. package/dist/cli/chunks/router-23HRN2Z6.js +0 -2
  320. package/dist/cli/chunks/routing-feedback-R6A4B6ZG.js +0 -2
  321. package/dist/cli/chunks/rvf-native-adapter-QINEJZM7.js +0 -2
  322. package/dist/cli/chunks/safe-db-YXMCSKFH.js +0 -2
  323. package/dist/cli/chunks/schedule-XVFD27P5.js +0 -2
  324. package/dist/cli/chunks/scheduler-NWH2IDEU.js +0 -2
  325. package/dist/cli/chunks/shared-rvf-adapter-FTZY35WI.js +0 -2
  326. package/dist/cli/chunks/sqlite-persistence-BR6YJF5P.js +0 -2
  327. package/dist/cli/chunks/tree-sitter-wasm-parser-GKYG6NKT.js +0 -2
  328. package/dist/cli/chunks/unified-memory-AT3Z4CY7.js +0 -2
  329. package/dist/cli/chunks/unified-memory-hnsw-6FOIGINN.js +0 -2
  330. package/dist/cli/chunks/unified-persistence-TCJB7MQS.js +0 -2
  331. package/dist/cli/chunks/visual-security-IBAUX2K5.js +0 -2
  332. package/dist/cli/chunks/witness-chain-GNNF23XU.js +0 -2
  333. package/dist/cli/chunks/workflow-orchestrator-S2YONHGM.js +0 -2
@@ -12,6 +12,34 @@
12
12
  */
13
13
  let sharedAdapter = null;
14
14
  let initAttempted = false;
15
+ // ---------------------------------------------------------------------------
16
+ // Test seam: allow tests to install a fake adapter without going through the
17
+ // native binding loader. NOT part of the public API — used by tests only.
18
+ // ---------------------------------------------------------------------------
19
+ /** @internal test-only seam */
20
+ export function __setSharedRvfAdapterForTests(adapter) {
21
+ sharedAdapter = adapter;
22
+ initAttempted = adapter !== null;
23
+ }
24
+ // ----------------------------------------------------------------------------
25
+ // Compaction tunables
26
+ //
27
+ // `compact()` is best-effort and idempotent on a clean file, so the thresholds
28
+ // are deliberately conservative. They can be tightened via env vars without a
29
+ // rebuild — useful in field debugging when an installation is already large.
30
+ // ----------------------------------------------------------------------------
31
+ /** File size above which we run a boot-time compact (default: 256 MB). */
32
+ const SIZE_GUARD_BYTES = (() => {
33
+ const env = process.env.AQE_RVF_SIZE_GUARD_BYTES;
34
+ const parsed = env ? Number(env) : NaN;
35
+ return Number.isFinite(parsed) && parsed > 0 ? parsed : 256 * 1024 * 1024;
36
+ })();
37
+ /** Dead-space ratio above which we run a compact (default: 0.30 = 30%). */
38
+ const DEAD_RATIO_THRESHOLD = (() => {
39
+ const env = process.env.AQE_RVF_DEAD_RATIO_THRESHOLD;
40
+ const parsed = env ? Number(env) : NaN;
41
+ return Number.isFinite(parsed) && parsed > 0 && parsed <= 1 ? parsed : 0.30;
42
+ })();
15
43
  /**
16
44
  * Get or create the shared RvfNativeAdapter singleton for patterns.rvf.
17
45
  *
@@ -48,6 +76,10 @@ export function getSharedRvfAdapter(dataDir = '.agentic-qe', dimensions = 384) {
48
76
  // FsyncFailed regardless. The try-ladder degrades to whichever
49
77
  // path the OS actually permits.
50
78
  sharedAdapter = openOrCreateRvf(openRvfStore, createRvfStore, rvfPath, dimensions);
79
+ // Boot-time size guard: an oversized or fragmented patterns.rvf gets a
80
+ // best-effort compaction on first open. Synchronous — runs once per
81
+ // process. Errors logged, never thrown (compaction must not block boot).
82
+ runBootCompactGuard(sharedAdapter, rvfPath);
51
83
  return sharedAdapter;
52
84
  }
53
85
  catch (error) {
@@ -149,6 +181,111 @@ function openOrCreateRvf(openFn, createFn, rvfPath, dimensions) {
149
181
  }
150
182
  }
151
183
  }
184
+ /**
185
+ * Pure decision function: given an adapter status, decide whether compaction
186
+ * should run and which threshold triggered it. Exported so tests can verify
187
+ * the decision logic without exercising the singleton or native binding.
188
+ */
189
+ export function decideCompactionFromStatus(status, opts) {
190
+ if (opts?.force)
191
+ return { shouldCompact: true, trigger: 'force' };
192
+ const sizeThreshold = opts?.sizeGuardBytes ?? SIZE_GUARD_BYTES;
193
+ const deadThreshold = opts?.deadRatioThreshold ?? DEAD_RATIO_THRESHOLD;
194
+ if (status.fileSizeBytes >= sizeThreshold) {
195
+ return { shouldCompact: true, trigger: 'size-guard' };
196
+ }
197
+ if ((status.deadSpaceRatio ?? 0) >= deadThreshold) {
198
+ return { shouldCompact: true, trigger: 'dead-ratio' };
199
+ }
200
+ return { shouldCompact: false, trigger: 'none' };
201
+ }
202
+ /**
203
+ * Run `compact()` against the shared patterns.rvf adapter when dead-space or
204
+ * file-size thresholds are exceeded. Best-effort — returns the reclaim stats
205
+ * if compaction ran, or `null` if it was skipped or failed.
206
+ *
207
+ * Safe to call from steady-state code (e.g. after a dream cycle). The native
208
+ * binding's compact() is documented as exclusive against writers, so callers
209
+ * should run this in idle windows when possible.
210
+ *
211
+ * Thresholds can be overridden via:
212
+ * AQE_RVF_SIZE_GUARD_BYTES (default 256 MB)
213
+ * AQE_RVF_DEAD_RATIO_THRESHOLD (default 0.30)
214
+ */
215
+ export function compactSharedRvfAdapter(opts) {
216
+ if (!sharedAdapter)
217
+ return null;
218
+ let status;
219
+ try {
220
+ status = sharedAdapter.status();
221
+ }
222
+ catch {
223
+ return null;
224
+ }
225
+ const decision = decideCompactionFromStatus(status, opts);
226
+ if (!decision.shouldCompact)
227
+ return null;
228
+ const before = status.fileSizeBytes;
229
+ let result;
230
+ try {
231
+ result = sharedAdapter.compact();
232
+ }
233
+ catch {
234
+ // The thin native wrapper already catches and returns null on native
235
+ // errors, but be defensive in case a caller installs a non-wrapped
236
+ // adapter (e.g. tests, custom adapters).
237
+ return null;
238
+ }
239
+ if (!result)
240
+ return null;
241
+ // Log only when there's something interesting to report — keeps idle logs quiet.
242
+ if (result.bytesReclaimed > 0 || result.segmentsCompacted > 0) {
243
+ console.log(`[RVF] compacted patterns.rvf: reclaimed ${formatBytes(result.bytesReclaimed)} ` +
244
+ `(${result.segmentsCompacted} segments, fileSize ${formatBytes(before)} → ` +
245
+ `${formatBytes(Math.max(0, before - result.bytesReclaimed))}, ` +
246
+ `trigger: ${decision.trigger})`);
247
+ }
248
+ return result;
249
+ }
250
+ /**
251
+ * One-shot at boot. Runs a best-effort `compact()` against the freshly-opened
252
+ * adapter when fileSize or deadSpaceRatio exceed configured thresholds. Lives
253
+ * here (not at module load) so a never-opened adapter doesn't trigger native
254
+ * binding init. Exported for tests; production callers go via
255
+ * `getSharedRvfAdapter()` which invokes it internally.
256
+ */
257
+ export function runBootCompactGuard(adapter, rvfPath) {
258
+ try {
259
+ const status = adapter.status();
260
+ const decision = decideCompactionFromStatus(status);
261
+ if (!decision.shouldCompact)
262
+ return null;
263
+ const result = adapter.compact();
264
+ if (result && (result.bytesReclaimed > 0 || result.segmentsCompacted > 0)) {
265
+ console.log(`[RVF] boot-time compact (${rvfPath}): reclaimed ${formatBytes(result.bytesReclaimed)} ` +
266
+ `from ${result.segmentsCompacted} segments (trigger: ${decision.trigger})`);
267
+ }
268
+ return result;
269
+ }
270
+ catch (error) {
271
+ if (process.env.DEBUG) {
272
+ console.debug('[RVF] boot-time compact guard skipped:', error instanceof Error ? error.message : error);
273
+ }
274
+ return null;
275
+ }
276
+ }
277
+ function formatBytes(n) {
278
+ if (!Number.isFinite(n) || n < 0)
279
+ return `${n}B`;
280
+ const units = ['B', 'KB', 'MB', 'GB', 'TB'];
281
+ let i = 0;
282
+ let v = n;
283
+ while (v >= 1024 && i < units.length - 1) {
284
+ v /= 1024;
285
+ i++;
286
+ }
287
+ return `${v.toFixed(i === 0 ? 0 : 1)}${units[i]}`;
288
+ }
152
289
  /** Close the shared adapter and reset the singleton. */
153
290
  export function resetSharedRvfAdapter() {
154
291
  if (sharedAdapter) {
@@ -71,9 +71,20 @@ export declare class HybridMemoryBackend implements MemoryBackend {
71
71
  private initialized;
72
72
  constructor(config?: Partial<HybridBackendConfig>);
73
73
  /**
74
- * Initialize the unified backend
75
- */
76
- initialize(): Promise<void>;
74
+ * Initialize the unified backend.
75
+ *
76
+ * `options.signal` bounds the init: if a caller-side timeout aborts the
77
+ * signal, `signal.throwIfAborted()` checks between awaited steps cause
78
+ * initialize() to reject promptly instead of leaking the init promise
79
+ * past the timeout (issue #495 — sibling to #478's fix for
80
+ * ReasoningBank.initialize). The previous Promise.race-based timeout in
81
+ * `createHybridBackendWithTimeout()` could not stop the underlying work,
82
+ * so a stuck unified-memory init would keep running for 14+ min while
83
+ * the hook subprocess held patterns.rvf open.
84
+ */
85
+ initialize(options?: {
86
+ signal?: AbortSignal;
87
+ }): Promise<void>;
77
88
  /**
78
89
  * Dispose of the backend
79
90
  */
@@ -50,12 +50,23 @@ export class HybridMemoryBackend {
50
50
  };
51
51
  }
52
52
  /**
53
- * Initialize the unified backend
53
+ * Initialize the unified backend.
54
+ *
55
+ * `options.signal` bounds the init: if a caller-side timeout aborts the
56
+ * signal, `signal.throwIfAborted()` checks between awaited steps cause
57
+ * initialize() to reject promptly instead of leaking the init promise
58
+ * past the timeout (issue #495 — sibling to #478's fix for
59
+ * ReasoningBank.initialize). The previous Promise.race-based timeout in
60
+ * `createHybridBackendWithTimeout()` could not stop the underlying work,
61
+ * so a stuck unified-memory init would keep running for 14+ min while
62
+ * the hook subprocess held patterns.rvf open.
54
63
  */
55
- async initialize() {
64
+ async initialize(options) {
56
65
  if (this.initialized) {
57
66
  return;
58
67
  }
68
+ const signal = options?.signal;
69
+ signal?.throwIfAborted();
59
70
  // Get unified memory manager with our config
60
71
  const unifiedConfig = {
61
72
  dbPath: this.config.sqlite.path ?? DEFAULT_UNIFIED_MEMORY_CONFIG.dbPath,
@@ -63,7 +74,9 @@ export class HybridMemoryBackend {
63
74
  busyTimeout: this.config.sqlite.busyTimeout ?? MEMORY_CONSTANTS.BUSY_TIMEOUT_MS,
64
75
  };
65
76
  this.unifiedMemory = getUnifiedMemory(unifiedConfig);
66
- await this.unifiedMemory.initialize();
77
+ signal?.throwIfAborted();
78
+ await this.unifiedMemory.initialize({ signal });
79
+ signal?.throwIfAborted();
67
80
  // Start cleanup interval (unref so it doesn't block process exit)
68
81
  this.cleanupInterval = setInterval(() => this.cleanup(), this.config.cleanupInterval);
69
82
  if (this.cleanupInterval.unref) {
@@ -92,7 +92,9 @@ export declare class UnifiedMemoryManager {
92
92
  static getInstance(config?: Partial<UnifiedMemoryConfig>): UnifiedMemoryManager;
93
93
  static getInstanceAsync(config?: Partial<UnifiedMemoryConfig>): Promise<UnifiedMemoryManager>;
94
94
  static resetInstance(): void;
95
- initialize(): Promise<void>;
95
+ initialize(options?: {
96
+ signal?: AbortSignal;
97
+ }): Promise<void>;
96
98
  private _doInitialize;
97
99
  /**
98
100
  * Find recent backup files for the memory database, sorted newest first.
@@ -218,17 +218,18 @@ export class UnifiedMemoryManager {
218
218
  // opening the production database instead of the test database.
219
219
  clearProjectRootCache();
220
220
  }
221
- async initialize() {
221
+ async initialize(options) {
222
222
  if (this.initialized)
223
223
  return;
224
224
  if (!this.initPromise) {
225
- this.initPromise = this._doInitialize();
225
+ this.initPromise = this._doInitialize(options?.signal);
226
226
  }
227
227
  return this.initPromise;
228
228
  }
229
- async _doInitialize() {
229
+ async _doInitialize(signal) {
230
230
  if (this.initialized)
231
231
  return;
232
+ signal?.throwIfAborted();
232
233
  try {
233
234
  // SAFETY: Detect test processes trying to open the production DB.
234
235
  // If AQE_PROJECT_ROOT is set to a temp dir (vitest isolation) but the
@@ -282,6 +283,9 @@ export class UnifiedMemoryManager {
282
283
  dbSizeBefore = newest.size;
283
284
  }
284
285
  }
286
+ // Bail before opening the DB if the caller already gave up — saves a
287
+ // file handle and avoids racing the busy-timeout under contention.
288
+ signal?.throwIfAborted();
285
289
  this.db = openSafeDatabase(this.config.dbPath, {
286
290
  walMode: this.config.walMode,
287
291
  busyTimeout: this.config.busyTimeout,
@@ -289,12 +293,26 @@ export class UnifiedMemoryManager {
289
293
  this.db.pragma(`mmap_size = ${this.config.mmapSize}`);
290
294
  this.db.pragma(`cache_size = ${this.config.cacheSize}`);
291
295
  this.db.pragma('foreign_keys = ON');
296
+ // Migrations are the longest-running step under contention (#495's
297
+ // primary stall point). If abort fires after the DB opens, drop the
298
+ // handle before throwing so we don't leak the WAL/SHM in the background.
299
+ if (signal?.aborted) {
300
+ try {
301
+ this.db.close();
302
+ }
303
+ catch { /* best-effort */ }
304
+ this.db = null;
305
+ signal.throwIfAborted();
306
+ }
292
307
  await this.runMigrations();
308
+ signal?.throwIfAborted();
293
309
  // DATA LOSS PREVENTION: After migration, if the DB existed before and was
294
310
  // large (>1MB = has real data), but now qe_patterns is empty, something
295
311
  // went wrong. Refuse to proceed with an empty DB over real data.
296
312
  if (dbExistedBefore && dbSizeBefore > 1_000_000) {
297
313
  try {
314
+ // Non-null: post-runMigrations, this.db is guaranteed open (the
315
+ // abort-cleanup branch above already throws before reaching here).
298
316
  const row = this.db.prepare('SELECT COUNT(*) as cnt FROM qe_patterns').get();
299
317
  if (row && row.cnt === 0) {
300
318
  const currentSize = fs.statSync(this.config.dbPath).size;
@@ -318,6 +336,13 @@ export class UnifiedMemoryManager {
318
336
  }
319
337
  catch (error) {
320
338
  this.initPromise = null;
339
+ // Preserve AbortError so callers can distinguish cancellation from a
340
+ // genuine init failure. Wrapping it in a generic "Failed to initialize"
341
+ // message would hide the signal cause (#495).
342
+ if (error instanceof Error &&
343
+ (error.name === 'AbortError' || (signal?.aborted ?? false))) {
344
+ throw error;
345
+ }
321
346
  throw new Error(`Failed to initialize UnifiedMemoryManager: ${toErrorMessage(error)}`);
322
347
  }
323
348
  }
@@ -258,6 +258,24 @@ export declare class DreamScheduler {
258
258
  * Auto-apply insights that meet the confidence threshold.
259
259
  */
260
260
  private autoApplyInsights;
261
+ /**
262
+ * Reclaim dead space in patterns.rvf and brain.rvf after a dream cycle.
263
+ *
264
+ * Background: RVF is append-only — every ingest/delete writes a new segment.
265
+ * Without periodic compaction these files grow monotonically (field reports
266
+ * have seen 59 GB on a fresh clone). The shared adapter exposes a helper
267
+ * that runs `compact()` only when configured thresholds are exceeded, so
268
+ * idle cycles are essentially free.
269
+ *
270
+ * Two files are compacted:
271
+ * • patterns.rvf — primary HNSW vector store (every storePattern() append)
272
+ * • brain.rvf — dual-write target (one append per storePattern() via
273
+ * RvfDualWriter.writePattern)
274
+ *
275
+ * Best-effort throughout: any error is logged and swallowed. The dream
276
+ * cycle's success is not contingent on compaction completing.
277
+ */
278
+ private maybeCompactPatternsRvf;
261
279
  /**
262
280
  * Collect a metrics snapshot and, if enough have accumulated, run a
263
281
  * meta-learning analysis cycle to detect token-waste, quality plateaus,
@@ -357,6 +357,17 @@ export class DreamScheduler {
357
357
  }
358
358
  // Publish dream completed event
359
359
  await this.publishDreamCompletedEvent(result);
360
+ // Reclaim dead space in patterns.rvf after each dream cycle. Best-effort
361
+ // and threshold-gated (only runs when deadSpaceRatio or fileSize cross
362
+ // configured thresholds), so idle cycles are nearly free. Without this
363
+ // call patterns.rvf grows monotonically — see the field reports of
364
+ // 59 GB regrowth on a fresh clone.
365
+ //
366
+ // AWAITED on purpose: native compact() takes an exclusive lock against
367
+ // the RVF file. Running concurrently with the meta-learning analysis
368
+ // (which reads from RVF) would risk lock contention. The threshold
369
+ // gate keeps the wall-clock cost near zero on healthy installations.
370
+ await this.maybeCompactPatternsRvf();
360
371
  // ADR-062: Run meta-learning analysis after dream cycle
361
372
  if (process.env.AQE_META_LEARNING_ENABLED === 'true') {
362
373
  try {
@@ -411,6 +422,63 @@ export class DreamScheduler {
411
422
  }
412
423
  }
413
424
  }
425
+ /**
426
+ * Reclaim dead space in patterns.rvf and brain.rvf after a dream cycle.
427
+ *
428
+ * Background: RVF is append-only — every ingest/delete writes a new segment.
429
+ * Without periodic compaction these files grow monotonically (field reports
430
+ * have seen 59 GB on a fresh clone). The shared adapter exposes a helper
431
+ * that runs `compact()` only when configured thresholds are exceeded, so
432
+ * idle cycles are essentially free.
433
+ *
434
+ * Two files are compacted:
435
+ * • patterns.rvf — primary HNSW vector store (every storePattern() append)
436
+ * • brain.rvf — dual-write target (one append per storePattern() via
437
+ * RvfDualWriter.writePattern)
438
+ *
439
+ * Best-effort throughout: any error is logged and swallowed. The dream
440
+ * cycle's success is not contingent on compaction completing.
441
+ */
442
+ async maybeCompactPatternsRvf() {
443
+ // patterns.rvf — threshold-gated compaction via the shared singleton.
444
+ try {
445
+ const mod = await import('../../integrations/ruvector/shared-rvf-adapter.js');
446
+ const result = mod.compactSharedRvfAdapter();
447
+ if (result && result.bytesReclaimed > 0) {
448
+ logger.info('patterns.rvf compacted', {
449
+ bytesReclaimed: result.bytesReclaimed,
450
+ segmentsCompacted: result.segmentsCompacted,
451
+ });
452
+ }
453
+ }
454
+ catch (err) {
455
+ logger.warn('patterns.rvf compaction skipped (non-critical)', {
456
+ error: err instanceof Error ? err.message : String(err),
457
+ });
458
+ }
459
+ // brain.rvf — separate file, separate writer (RvfDualWriter). The
460
+ // dual-writer does not gate on thresholds (it has no status surface that
461
+ // exposes deadSpaceRatio), so we call compact() unconditionally. Native
462
+ // compact() is a no-op on a clean file, so the cost is bounded.
463
+ try {
464
+ const mod = await import('../../integrations/ruvector/shared-rvf-dual-writer.js');
465
+ const writer = mod.getSharedRvfDualWriterSync();
466
+ if (writer) {
467
+ const result = writer.compact();
468
+ if (result && result.bytesReclaimed > 0) {
469
+ logger.info('brain.rvf compacted', {
470
+ bytesReclaimed: result.bytesReclaimed,
471
+ segmentsCompacted: result.segmentsCompacted,
472
+ });
473
+ }
474
+ }
475
+ }
476
+ catch (err) {
477
+ logger.warn('brain.rvf compaction skipped (non-critical)', {
478
+ error: err instanceof Error ? err.message : String(err),
479
+ });
480
+ }
481
+ }
414
482
  // ==========================================================================
415
483
  // Private: Meta-Learning (ADR-062)
416
484
  // ==========================================================================
@@ -179,7 +179,19 @@ export class QEReasoningBank {
179
179
  const adapter = this.patternStore.getAdapter?.();
180
180
  if (adapter && (adapter.status()?.totalVectors ?? 0) === 0) {
181
181
  try {
182
- const embeddings = this.getSqliteStore().getAllEmbeddings();
182
+ // Cap the backfill to the most-recently-used N embeddings. Prevents
183
+ // a truncated patterns.rvf (e.g. `: > patterns.rvf` for disk
184
+ // recovery) from triggering an unbounded re-ingest of every
185
+ // historical embedding — the path that reproduces "regrew to 59 GB"
186
+ // in the field.
187
+ //
188
+ // Override via AQE_RVF_BACKFILL_LIMIT (default: 1000).
189
+ const limit = (() => {
190
+ const env = process.env.AQE_RVF_BACKFILL_LIMIT;
191
+ const parsed = env ? Number(env) : NaN;
192
+ return Number.isFinite(parsed) && parsed > 0 ? Math.floor(parsed) : 1000;
193
+ })();
194
+ const embeddings = this.getSqliteStore().getRecentEmbeddings(limit);
183
195
  const vectors = embeddings
184
196
  .filter(({ embedding }) => embedding && embedding.length > 0)
185
197
  .map(({ patternId, embedding }) => ({
@@ -190,7 +202,12 @@ export class QEReasoningBank {
190
202
  }));
191
203
  if (vectors.length > 0) {
192
204
  const { accepted, rejected } = adapter.ingest(vectors);
193
- logger.info('Backfilled RVF from SQLite', { count: vectors.length, accepted });
205
+ logger.info('Backfilled RVF from SQLite', {
206
+ requested: vectors.length,
207
+ accepted,
208
+ cap: limit,
209
+ truncated: vectors.length >= limit,
210
+ });
194
211
  if (rejected > 0) {
195
212
  logger.warn('RVF backfill partially rejected', { accepted, rejected });
196
213
  }
@@ -58,7 +58,7 @@ async function initializeModel(config = {}) {
58
58
  initPromise = (async () => {
59
59
  try {
60
60
  // Dynamic import to avoid issues if transformers not available
61
- const transformers = await import('@xenova/transformers');
61
+ const transformers = await import('@huggingface/transformers');
62
62
  pipeline = transformers.pipeline;
63
63
  console.log(`[RealEmbeddings] Loading model: ${fullConfig.modelName}`);
64
64
  const startTime = performance.now();
@@ -114,6 +114,17 @@ export declare class SQLitePatternStore {
114
114
  patternId: string;
115
115
  embedding: number[];
116
116
  }>;
117
+ /**
118
+ * Get up to `limit` embeddings, most-recently-used first.
119
+ *
120
+ * Used by the RVF backfill path so an operator-truncated patterns.rvf does
121
+ * not trigger an unbounded re-ingest of every historical embedding (which
122
+ * is what reproduces the "regrew to 59 GB" pathology after `: > patterns.rvf`).
123
+ */
124
+ getRecentEmbeddings(limit: number): Array<{
125
+ patternId: string;
126
+ embedding: number[];
127
+ }>;
117
128
  /**
118
129
  * Record pattern usage.
119
130
  *
@@ -361,6 +361,16 @@ export class SQLitePatternStore {
361
361
  `));
362
362
  this.prepared.set('getAllEmbeddings', this.db.prepare(`
363
363
  SELECT pattern_id, embedding, dimension FROM qe_pattern_embeddings
364
+ `));
365
+ // Recent-first variant used by the RVF backfill path. Order by
366
+ // qe_patterns.last_used_at (then created_at) so the bounded backfill keeps
367
+ // the most actively-used patterns when the cap is hit.
368
+ this.prepared.set('getRecentEmbeddings', this.db.prepare(`
369
+ SELECT e.pattern_id, e.embedding, e.dimension
370
+ FROM qe_pattern_embeddings e
371
+ LEFT JOIN qe_patterns p ON p.id = e.pattern_id
372
+ ORDER BY COALESCE(p.last_used_at, p.created_at, e.created_at) DESC
373
+ LIMIT ?
364
374
  `));
365
375
  this.prepared.set('countPatterns', this.db.prepare(`
366
376
  SELECT COUNT(*) as count FROM qe_patterns
@@ -518,6 +528,26 @@ export class SQLitePatternStore {
518
528
  embedding: Array.from(new Float32Array(row.embedding.buffer, row.embedding.byteOffset, row.dimension)),
519
529
  }));
520
530
  }
531
+ /**
532
+ * Get up to `limit` embeddings, most-recently-used first.
533
+ *
534
+ * Used by the RVF backfill path so an operator-truncated patterns.rvf does
535
+ * not trigger an unbounded re-ingest of every historical embedding (which
536
+ * is what reproduces the "regrew to 59 GB" pathology after `: > patterns.rvf`).
537
+ */
538
+ getRecentEmbeddings(limit) {
539
+ if (!this.db)
540
+ throw new Error('Database not initialized');
541
+ const cap = Number.isFinite(limit) && limit > 0 ? Math.floor(limit) : 1000;
542
+ const stmt = this.prepared.get('getRecentEmbeddings');
543
+ if (!stmt)
544
+ throw new Error('Prepared statement not ready');
545
+ const rows = stmt.all(cap);
546
+ return rows.map(row => ({
547
+ patternId: row.pattern_id,
548
+ embedding: Array.from(new Float32Array(row.embedding.buffer, row.embedding.byteOffset, row.dimension)),
549
+ }));
550
+ }
521
551
  /**
522
552
  * Record pattern usage.
523
553
  *