agentic-qe 3.9.20 → 3.9.22

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 (296) hide show
  1. package/.claude/skills/skills-manifest.json +1 -1
  2. package/CHANGELOG.md +54 -0
  3. package/README.md +39 -0
  4. package/assets/skills/skills-manifest.json +1 -1
  5. package/dist/cli/bundle.js +5 -5
  6. package/dist/cli/chunks/adapter-4RFY4QQP.js +2 -0
  7. package/dist/cli/chunks/{agent-booster-wasm-T5JB3MOF.js → agent-booster-wasm-GUS4CPIF.js} +2 -2
  8. package/dist/cli/chunks/{agent-handler-EASMQSQO.js → agent-handler-X3JM3LAL.js} +2 -2
  9. package/dist/cli/chunks/{agent-memory-branch-7GWN2KCG.js → agent-memory-branch-DZVV32I2.js} +2 -2
  10. package/dist/cli/chunks/aqe-learning-engine-CJ5UDPJ6.js +2 -0
  11. package/dist/cli/chunks/{audit-VHV4GXPW.js → audit-LO2I2D4V.js} +2 -2
  12. package/dist/cli/chunks/base-EEBZKFSN.js +2 -0
  13. package/dist/cli/chunks/{better-sqlite3-GNK7MDXZ.js → better-sqlite3-MQACUCZV.js} +2 -2
  14. package/dist/cli/chunks/{brain-handler-ALXZKWO4.js → brain-handler-SW6BDUVF.js} +3 -3
  15. package/dist/cli/chunks/{branch-enumerator-JNYLOLMM.js → branch-enumerator-COUIEIXT.js} +2 -2
  16. package/dist/cli/chunks/{browser-FXRW6LID.js → browser-I3KE2PKR.js} +2 -2
  17. package/dist/cli/chunks/browser-workflow-KDNXNC7W.js +2 -0
  18. package/dist/cli/chunks/{chunk-7J34I3CI.js → chunk-2ABN34GT.js} +2 -2
  19. package/dist/cli/chunks/{chunk-CQSME43Z.js → chunk-2OQVDOCP.js} +24 -16
  20. package/dist/cli/chunks/{chunk-WALYYW6B.js → chunk-34V7MJEC.js} +4 -4
  21. package/dist/cli/chunks/{chunk-4PNLBMKY.js → chunk-3M7EAXED.js} +1 -1
  22. package/dist/cli/chunks/{chunk-7WXYQDML.js → chunk-3UPELJAD.js} +2 -2
  23. package/dist/cli/chunks/{chunk-EYSGJZ7Y.js → chunk-46X57677.js} +13 -13
  24. package/dist/cli/chunks/{chunk-DODH6CEQ.js → chunk-4KIDHFF3.js} +1 -1
  25. package/dist/cli/chunks/{chunk-YPVPWDKL.js → chunk-5D6UQZG6.js} +2 -2
  26. package/dist/cli/chunks/{chunk-QCLEA3CM.js → chunk-5HUFNSCO.js} +2 -2
  27. package/dist/cli/chunks/{chunk-4SBMTHTA.js → chunk-5Q4HS3PB.js} +2 -2
  28. package/dist/cli/chunks/{chunk-KNOZWD6E.js → chunk-5QP4OPZM.js} +2 -2
  29. package/dist/cli/chunks/{chunk-K2D5L7YV.js → chunk-5VE5R2B4.js} +1 -1
  30. package/dist/cli/chunks/{chunk-3GPNZPM4.js → chunk-5WE7JRVM.js} +1 -1
  31. package/dist/cli/chunks/{chunk-7R45TEY6.js → chunk-6EBWEMJJ.js} +2 -2
  32. package/dist/cli/chunks/chunk-6I6LXONA.js +2 -0
  33. package/dist/cli/chunks/{chunk-HCFRGEMK.js → chunk-6KHLLAFS.js} +1 -1
  34. package/dist/cli/chunks/{chunk-CPVGZYEP.js → chunk-75EXWLL2.js} +1 -1
  35. package/dist/cli/chunks/{chunk-H647PYXW.js → chunk-75EZBOLF.js} +1 -1
  36. package/dist/cli/chunks/{chunk-HW47UOFK.js → chunk-76JSNSX5.js} +2 -2
  37. package/dist/cli/chunks/{chunk-FHDYN73D.js → chunk-77CR3VJL.js} +2 -2
  38. package/dist/cli/chunks/{chunk-6R7SJ5FS.js → chunk-7BKQTKKO.js} +1 -1
  39. package/dist/cli/chunks/{chunk-MXAEZHW6.js → chunk-7TASYE2O.js} +2 -2
  40. package/dist/cli/chunks/{chunk-NQIOXSHW.js → chunk-7TWDEXR4.js} +1 -1
  41. package/dist/cli/chunks/{chunk-SH2UPGO7.js → chunk-7V2KGOFN.js} +2 -2
  42. package/dist/cli/chunks/{chunk-Y6U4CCPP.js → chunk-AKBYBOUV.js} +1 -1
  43. package/dist/cli/chunks/{chunk-TV5OVFKK.js → chunk-ASJWT2HO.js} +1 -1
  44. package/dist/cli/chunks/{chunk-ICLWWAGZ.js → chunk-BAIQZTBO.js} +2 -2
  45. package/dist/cli/chunks/{chunk-BIODM56C.js → chunk-BVFRL52U.js} +2 -2
  46. package/dist/cli/chunks/{chunk-4IUNBRKQ.js → chunk-C2ROCY2Y.js} +2 -2
  47. package/dist/cli/chunks/{chunk-NN6VRHNL.js → chunk-C32ZD3IM.js} +2 -2
  48. package/dist/cli/chunks/{chunk-UHWRRJBH.js → chunk-CWINAMA7.js} +1 -1
  49. package/dist/cli/chunks/{chunk-WF6MKBRI.js → chunk-CYHVGDGJ.js} +2 -2
  50. package/dist/cli/chunks/chunk-D4GHYV5T.js +2 -0
  51. package/dist/cli/chunks/{chunk-RXXKU3VP.js → chunk-D4RS57YM.js} +2 -2
  52. package/dist/cli/chunks/{chunk-G7HYTJDG.js → chunk-DLOY6QOK.js} +2 -2
  53. package/dist/cli/chunks/{chunk-AVVRA6FG.js → chunk-EAEF52EW.js} +2 -2
  54. package/dist/cli/chunks/{chunk-AFMLL2G3.js → chunk-EBFG55L3.js} +2 -2
  55. package/dist/cli/chunks/{chunk-5GA4BUQU.js → chunk-EHIS2X2O.js} +2 -2
  56. package/dist/cli/chunks/{chunk-S6SRHNJV.js → chunk-EIOC2ZBV.js} +2 -2
  57. package/dist/cli/chunks/{chunk-Z5MG54R4.js → chunk-ELYTUR3K.js} +1 -1
  58. package/dist/cli/chunks/{chunk-SMQ5OARZ.js → chunk-EP65OKY3.js} +1 -1
  59. package/dist/cli/chunks/{chunk-T3TEQH2H.js → chunk-F5PYXTN6.js} +1 -1
  60. package/dist/cli/chunks/{chunk-X3NADG4S.js → chunk-F6S2BURJ.js} +2 -2
  61. package/dist/cli/chunks/{chunk-VQI6JQQP.js → chunk-F76YPLIC.js} +1 -1
  62. package/dist/cli/chunks/{chunk-7I6ROJGF.js → chunk-FN33YLS4.js} +2 -2
  63. package/dist/cli/chunks/{chunk-FPBNTPCM.js → chunk-G35AFB22.js} +2 -2
  64. package/dist/cli/chunks/{chunk-EJQRDMON.js → chunk-GE4ABLTW.js} +1 -1
  65. package/dist/cli/chunks/{chunk-SGGY4QYU.js → chunk-H2CDS62D.js} +2 -2
  66. package/dist/cli/chunks/{chunk-QMUZMIV7.js → chunk-HHTTDWS2.js} +3 -3
  67. package/dist/cli/chunks/{chunk-4G6OH5LQ.js → chunk-IPWO26NP.js} +2 -2
  68. package/dist/cli/chunks/{chunk-3HQ4VKK6.js → chunk-J47LS6JI.js} +54 -58
  69. package/dist/cli/chunks/{chunk-FUTRX4ZT.js → chunk-J4DENED7.js} +2 -2
  70. package/dist/cli/chunks/{chunk-MXHJUAM7.js → chunk-JNRUY2BU.js} +2 -2
  71. package/dist/cli/chunks/{chunk-UABC2Z3S.js → chunk-JTTEDSP5.js} +2 -2
  72. package/dist/cli/chunks/{chunk-BJF77EFA.js → chunk-KA22YYYW.js} +2 -2
  73. package/dist/cli/chunks/{chunk-ZBBHJGPI.js → chunk-KBWJRXYS.js} +2 -2
  74. package/dist/cli/chunks/{chunk-MXDGMXJA.js → chunk-KEXERBH2.js} +2 -2
  75. package/dist/cli/chunks/{chunk-DSPH4GI3.js → chunk-KXVCKQ2O.js} +1 -1
  76. package/dist/cli/chunks/{chunk-6LKEFWKI.js → chunk-L2D56OS2.js} +3 -3
  77. package/dist/cli/chunks/{chunk-DERQRIAR.js → chunk-LCOVR5PF.js} +3 -3
  78. package/dist/cli/chunks/{chunk-UNAVOVD7.js → chunk-LFUJSR5V.js} +3 -3
  79. package/dist/cli/chunks/{chunk-BKGCMWFL.js → chunk-LSPQUQZQ.js} +3 -3
  80. package/dist/cli/chunks/{chunk-3BFNYFXV.js → chunk-LVW2AMCE.js} +1 -1
  81. package/dist/cli/chunks/{chunk-O3PLWCCD.js → chunk-MGTHNWDX.js} +2 -2
  82. package/dist/cli/chunks/{chunk-5ILP2ZDZ.js → chunk-MHV7VXPW.js} +2 -2
  83. package/dist/cli/chunks/{chunk-RYBFRFKY.js → chunk-N242BGZS.js} +1 -1
  84. package/dist/cli/chunks/{chunk-LATJ2LKJ.js → chunk-N7LNGYUI.js} +1 -1
  85. package/dist/cli/chunks/{chunk-IHBRFVGA.js → chunk-NDBSIHGC.js} +1 -1
  86. package/dist/cli/chunks/{chunk-4HD7YRW7.js → chunk-NKHHOJBJ.js} +2 -2
  87. package/dist/cli/chunks/{chunk-OD5SVOVP.js → chunk-O2RWRFY2.js} +1 -1
  88. package/dist/cli/chunks/{chunk-V5UB75TQ.js → chunk-OLDHOXH5.js} +2 -2
  89. package/dist/cli/chunks/{chunk-7Q7SCQMQ.js → chunk-P3CE2OST.js} +2 -2
  90. package/dist/cli/chunks/{chunk-2J5OO63R.js → chunk-PC3NYFID.js} +2 -2
  91. package/dist/cli/chunks/{chunk-UAE37LHP.js → chunk-PJQVLSZL.js} +2 -2
  92. package/dist/cli/chunks/{chunk-JCPXG42O.js → chunk-PUBADXN6.js} +2 -2
  93. package/dist/cli/chunks/{chunk-SL7WTN5Z.js → chunk-Q4Q4ZPEO.js} +2 -2
  94. package/dist/cli/chunks/{chunk-T5MMSSSF.js → chunk-Q6NM3PHP.js} +2 -2
  95. package/dist/cli/chunks/{chunk-CEVIRL2S.js → chunk-QBQHA2PQ.js} +2 -2
  96. package/dist/cli/chunks/{chunk-QLZPCEVI.js → chunk-QBY4LMKC.js} +1 -1
  97. package/dist/cli/chunks/{chunk-3ZHUKLU7.js → chunk-QH5PMTYD.js} +2 -2
  98. package/dist/cli/chunks/{chunk-MIST354H.js → chunk-QKDYDDO6.js} +2 -2
  99. package/dist/cli/chunks/{chunk-Q4OITFDX.js → chunk-QUASI6T7.js} +2 -2
  100. package/dist/cli/chunks/{chunk-NGWGOMOP.js → chunk-QXFPR4ND.js} +2 -2
  101. package/dist/cli/chunks/{chunk-LSYMQG52.js → chunk-QYUA3QRO.js} +1 -1
  102. package/dist/cli/chunks/{chunk-Z65DB2Z7.js → chunk-RDFBNLOP.js} +3 -3
  103. package/dist/cli/chunks/{chunk-RVWGW7TI.js → chunk-RHJXNBT5.js} +2 -2
  104. package/dist/cli/chunks/{chunk-LJW7BTMK.js → chunk-SBXMNI7G.js} +2 -2
  105. package/dist/cli/chunks/{chunk-XJRXB5Z5.js → chunk-SEFMGIDM.js} +2 -2
  106. package/dist/cli/chunks/{chunk-FAQPPMEC.js → chunk-SZXKDWNU.js} +2 -2
  107. package/dist/cli/chunks/{chunk-YPUDYGIU.js → chunk-T62S7PHC.js} +1 -1
  108. package/dist/cli/chunks/{chunk-J7SDO52P.js → chunk-T6SZZ6GL.js} +2 -2
  109. package/dist/cli/chunks/{chunk-KMDZOVCF.js → chunk-TF33AXXK.js} +1 -1
  110. package/dist/cli/chunks/{chunk-3CLKKAGH.js → chunk-TFEEZPAV.js} +2 -2
  111. package/dist/cli/chunks/{chunk-GXO42P3X.js → chunk-U33MB6BS.js} +6 -6
  112. package/dist/cli/chunks/{chunk-GJACTPDK.js → chunk-UG4NLJ6S.js} +2 -2
  113. package/dist/cli/chunks/{chunk-LGSPAQSP.js → chunk-UJQ4APLZ.js} +2 -2
  114. package/dist/cli/chunks/chunk-UZ5D7CNQ.js +2 -0
  115. package/dist/cli/chunks/{chunk-TG6P44UT.js → chunk-V6FH47RF.js} +4 -4
  116. package/dist/cli/chunks/{chunk-QAZYSC3T.js → chunk-VBNVPKPJ.js} +2 -2
  117. package/dist/cli/chunks/{chunk-7OGFOHG5.js → chunk-VEQZARRH.js} +2 -2
  118. package/dist/cli/chunks/{chunk-QMGXALN3.js → chunk-WXM3QRV3.js} +2 -2
  119. package/dist/cli/chunks/{chunk-DJCLA5AG.js → chunk-X3UEZQIH.js} +2 -2
  120. package/dist/cli/chunks/{chunk-P2ABIGYB.js → chunk-XNLRBJLS.js} +1 -1
  121. package/dist/cli/chunks/{chunk-QKOPJ5CZ.js → chunk-XRTQMK2J.js} +2 -2
  122. package/dist/cli/chunks/{chunk-QQMHE4RT.js → chunk-XZLXDSDH.js} +2 -2
  123. package/dist/cli/chunks/{chunk-U7RTH6F4.js → chunk-YBPODHK5.js} +2 -2
  124. package/dist/cli/chunks/{chunk-HXQ7GAUV.js → chunk-YCG6NXTH.js} +3 -3
  125. package/dist/cli/chunks/{chunk-BXGAXGME.js → chunk-YJ3KKNS5.js} +2 -2
  126. package/dist/cli/chunks/{chunk-7Y4QQ6JL.js → chunk-YT45LRYT.js} +1 -1
  127. package/dist/cli/chunks/{chunk-NWYYWFUO.js → chunk-ZHJL5MGV.js} +1 -1
  128. package/dist/cli/chunks/{chunk-SYXPLFK7.js → chunk-ZIRSR3CR.js} +2 -2
  129. package/dist/cli/chunks/{chunk-F3PX6EJX.js → chunk-ZTVYRPXO.js} +1 -1
  130. package/dist/cli/chunks/{chunk-ZCH5MNST.js → chunk-ZYLONMC3.js} +2 -2
  131. package/dist/cli/chunks/{chunk-5LM2W3NE.js → chunk-ZYVFF2GF.js} +1 -1
  132. package/dist/cli/chunks/{chunk-RCPFDAOC.js → chunk-ZZD2O63H.js} +1 -1
  133. package/dist/cli/chunks/{ci-TE3744OR.js → ci-KE7FOGU7.js} +2 -2
  134. package/dist/cli/chunks/{ci-output-GSNS52SY.js → ci-output-22E7MB4A.js} +2 -2
  135. package/dist/cli/chunks/{circuit-breaker-7ROW7QBW.js → circuit-breaker-AVTSU65L.js} +2 -2
  136. package/dist/cli/chunks/{claude-flow-setup-Z5GPMILN.js → claude-flow-setup-UWD5DRUE.js} +2 -2
  137. package/dist/cli/chunks/client-GNL46JU5.js +2 -0
  138. package/dist/cli/chunks/{cline-installer-6D4SAAM4.js → cline-installer-H3MJDJKK.js} +2 -2
  139. package/dist/cli/chunks/{code-JZKH7FRS.js → code-3G4FPMSZ.js} +2 -2
  140. package/dist/cli/chunks/{code-index-extractor-JJFTZLOK.js → code-index-extractor-PBZIQOI5.js} +2 -2
  141. package/dist/cli/chunks/{codex-installer-O5KIPN3Z.js → codex-installer-M4P7K7LO.js} +2 -2
  142. package/dist/cli/chunks/{completions-QNMAUYKK.js → completions-WWUW6CX4.js} +2 -2
  143. package/dist/cli/chunks/{complexity-analyzer-JYJ7TLYE.js → complexity-analyzer-H2F37PAW.js} +2 -2
  144. package/dist/cli/chunks/{continuedev-installer-JYMVLG6S.js → continuedev-installer-NSUF5Y6W.js} +2 -2
  145. package/dist/cli/chunks/{copilot-installer-SSV6GF5G.js → copilot-installer-BHFKNSU4.js} +2 -2
  146. package/dist/cli/chunks/{cost-tracker-2VZ3IMJZ.js → cost-tracker-QTQ32PGG.js} +2 -2
  147. package/dist/cli/chunks/{coverage-KW4V5D5L.js → coverage-LCBTTMUE.js} +3 -3
  148. package/dist/cli/chunks/cross-domain-router-2JHRNGD7.js +2 -0
  149. package/dist/cli/chunks/{cursor-installer-QVGDAHOI.js → cursor-installer-KBWXMRRA.js} +2 -2
  150. package/dist/cli/chunks/{daemon-JKMFDYK2.js → daemon-UYTVWZOZ.js} +3 -3
  151. package/dist/cli/chunks/{dag-attention-scheduler-WKRV7DFE.js → dag-attention-scheduler-3WVICTLD.js} +2 -2
  152. package/dist/cli/chunks/{detect-ROCCKX63.js → detect-R3CMY3ZB.js} +2 -2
  153. package/dist/cli/chunks/{dist-node-QGU7TJTW.js → dist-node-OALHZZ67.js} +2 -2
  154. package/dist/cli/chunks/{domain-handler-3UJHQPOR.js → domain-handler-QWZEBRVB.js} +2 -2
  155. package/dist/cli/chunks/{domain-transfer-R47ISVU5.js → domain-transfer-BO2XBDRA.js} +2 -2
  156. package/dist/cli/chunks/dream-XDWOQVNR.js +2 -0
  157. package/dist/cli/chunks/{embed-and-insert-pattern-ZVK7WSY2.js → embed-and-insert-pattern-YJJ5MHIV.js} +2 -2
  158. package/dist/cli/chunks/{eval-WNZWXFOW.js → eval-BIDGZOD7.js} +2 -2
  159. package/dist/cli/chunks/experience-capture-middleware-SBZNJVIN.js +40 -0
  160. package/dist/cli/chunks/{fast-paths-QPF47RZJ.js → fast-paths-W6FORZ7G.js} +2 -2
  161. package/dist/cli/chunks/{feature-flags-PGIG2W3G.js → feature-flags-25T4IUQL.js} +2 -2
  162. package/dist/cli/chunks/{feature-flags-2MAHHM66.js → feature-flags-A4YTFMSI.js} +2 -2
  163. package/dist/cli/chunks/{file-discovery-JL6FCXRB.js → file-discovery-S4GNW5SS.js} +2 -2
  164. package/dist/cli/chunks/{fleet-LMBZU2GU.js → fleet-QTXBVBXM.js} +3 -3
  165. package/dist/cli/chunks/{gnn-wrapper-GFNFVEER.js → gnn-wrapper-S3HPS6UZ.js} +2 -2
  166. package/dist/cli/chunks/{heartbeat-handler-YN7ES3AX.js → heartbeat-handler-Z536VVQ4.js} +4 -4
  167. package/dist/cli/chunks/{heartbeat-scheduler-SII2KJSQ.js → heartbeat-scheduler-ECHKRR2V.js} +2 -2
  168. package/dist/cli/chunks/hnsw-adapter-ELKAHTIH.js +2 -0
  169. package/dist/cli/chunks/hnsw-index-3VJYUSOM.js +2 -0
  170. package/dist/cli/chunks/{hnsw-legacy-bridge-CPMBYE7C.js → hnsw-legacy-bridge-NR2LB4MK.js} +2 -2
  171. package/dist/cli/chunks/hnswlib-node-VHJGVLVU.js +2 -0
  172. package/dist/cli/chunks/{hooks-EYSB7XDW.js → hooks-K6B7FOWK.js} +10 -10
  173. package/dist/cli/chunks/{hybrid-router-BR7O6WT2.js → hybrid-router-PWEAUPDI.js} +2 -2
  174. package/dist/cli/chunks/{hypergraph-engine-HAKGWDYX.js → hypergraph-engine-2GMPZADI.js} +2 -2
  175. package/dist/cli/chunks/{hypergraph-handler-UCI3LXUF.js → hypergraph-handler-7EZBLA7J.js} +3 -3
  176. package/dist/cli/chunks/impact-analyzer-4BLPFGDS.js +2 -0
  177. package/dist/cli/chunks/{init-handler-7RYGU3W5.js → init-handler-IC2REBTQ.js} +6 -6
  178. package/dist/cli/chunks/init-wizard-UR23AJFX.js +2 -0
  179. package/dist/cli/chunks/kernel-BTP323I5.js +2 -0
  180. package/dist/cli/chunks/{kilocode-installer-W6ITMEFA.js → kilocode-installer-O7CW3AWL.js} +2 -2
  181. package/dist/cli/chunks/{kiro-installer-2BO34D3O.js → kiro-installer-PCUKTCMG.js} +2 -2
  182. package/dist/cli/chunks/knowledge-graph-JH3O5ZMS.js +2 -0
  183. package/dist/cli/chunks/{learning-GEXYG72Z.js → learning-X6GZCD2J.js} +3 -3
  184. package/dist/cli/chunks/{llm-router-EGHA5YOC.js → llm-router-K7S7VYA3.js} +4 -4
  185. package/dist/cli/chunks/{load-VU2OOAEF.js → load-RHLRH7M5.js} +2 -2
  186. package/dist/cli/chunks/load-test-E6GTBB2W.js +2 -0
  187. package/dist/cli/chunks/{mcp-NVQFFQ2R.js → mcp-RGHX7REI.js} +2 -2
  188. package/dist/cli/chunks/{memory-JNXMKTZQ.js → memory-BDEEXPIV.js} +5 -5
  189. package/dist/cli/chunks/memory-backend-FAOO6R3B.js +2 -0
  190. package/dist/cli/chunks/{memory-handlers-NLGQ5I7K.js → memory-handlers-PR5ZSN5E.js} +2 -2
  191. package/dist/cli/chunks/{multi-model-executor-SG6OME2A.js → multi-model-executor-SGVRJWI5.js} +2 -2
  192. package/dist/cli/chunks/{opencode-installer-AY4JCZIM.js → opencode-installer-3ZWQ7Q5S.js} +2 -2
  193. package/dist/cli/chunks/{orchestrator-GWI7HQG6.js → orchestrator-O5EZXLG6.js} +5 -5
  194. package/dist/cli/chunks/{pipeline-7T6IAMC7.js → pipeline-LW7SFRRB.js} +2 -2
  195. package/dist/cli/chunks/{platform-IXUST66M.js → platform-DIISFS5U.js} +2 -2
  196. package/dist/cli/chunks/{plugin-PW7F6MVH.js → plugin-B563LDGV.js} +2 -2
  197. package/dist/cli/chunks/{prime-radiant-advanced-wasm-BUAZHZCM.js → prime-radiant-advanced-wasm-FJBQPN3U.js} +2 -2
  198. package/dist/cli/chunks/protocol-executor-AYBNZNRK.js +2 -0
  199. package/dist/cli/chunks/{protocol-handler-6746OC4P.js → protocol-handler-PVZNJNNP.js} +2 -2
  200. package/dist/cli/chunks/{prove-VYV5DQGC.js → prove-MYKQTKZM.js} +2 -2
  201. package/dist/cli/chunks/{provider-manager-GEO3CUOO.js → provider-manager-RDOMJIKC.js} +2 -2
  202. package/dist/cli/chunks/qe-reasoning-bank-LFMZCMKB.js +2 -0
  203. package/dist/cli/chunks/{quality-4XXENNNW.js → quality-OOXFIM76.js} +2 -2
  204. package/dist/cli/chunks/queen-coordinator-JEGURMXS.js +2 -0
  205. package/dist/cli/chunks/{real-embeddings-ZVEZVXVT.js → real-embeddings-JQVUQQKL.js} +2 -2
  206. package/dist/cli/chunks/{roocode-installer-ZRNDOIDL.js → roocode-installer-G7ZV5Z3V.js} +2 -2
  207. package/dist/cli/chunks/router-LMESYCAS.js +2 -0
  208. package/dist/cli/chunks/routing-feedback-3GOMFT5Q.js +2 -0
  209. package/dist/cli/chunks/{routing-handler-MPSJ7DDI.js → routing-handler-W5XOGRVI.js} +2 -2
  210. package/dist/cli/chunks/{ruvector-commands-V4BVCY2U.js → ruvector-commands-YBR64EE3.js} +2 -2
  211. package/dist/cli/chunks/{rvf-dual-writer-X4VNU5KH.js → rvf-dual-writer-XIDYK3CA.js} +2 -2
  212. package/dist/cli/chunks/{rvf-migration-adapter-KOYYJSNH.js → rvf-migration-adapter-6FJ7XRBL.js} +2 -2
  213. package/dist/cli/chunks/{rvf-migration-coordinator-SF5IBKTK.js → rvf-migration-coordinator-7GD7BGUG.js} +2 -2
  214. package/dist/cli/chunks/rvf-native-adapter-MEKCU4HV.js +2 -0
  215. package/dist/cli/chunks/safe-db-PZBRYCSI.js +2 -0
  216. package/dist/cli/chunks/schedule-NXQZQIBV.js +2 -0
  217. package/dist/cli/chunks/scheduler-I3HGTMNU.js +2 -0
  218. package/dist/cli/chunks/{security-AA5GBNNU.js → security-5RH45PGS.js} +3 -3
  219. package/dist/cli/chunks/shared-rvf-adapter-5QLSVTXS.js +2 -0
  220. package/dist/cli/chunks/{shared-rvf-dual-writer-EGP3BYIY.js → shared-rvf-dual-writer-A7T5EJ3W.js} +2 -2
  221. package/dist/cli/chunks/sqlite-persistence-3MEKZAPX.js +2 -0
  222. package/dist/cli/chunks/{status-handler-ARHPRXJ4.js → status-handler-LNNNK2AK.js} +2 -2
  223. package/dist/cli/chunks/{structural-health-IDV4RBZV.js → structural-health-7I7G6LFO.js} +2 -2
  224. package/dist/cli/chunks/{sync-7BRLSLDG.js → sync-QPWRLTD6.js} +2 -2
  225. package/dist/cli/chunks/{task-handler-XY42QA3K.js → task-handler-BMKDHVBD.js} +2 -2
  226. package/dist/cli/chunks/{task-handlers-QEHOKEJC.js → task-handlers-ECOL3VV6.js} +3 -3
  227. package/dist/cli/chunks/{test-TQIHDBEX.js → test-FY33BVTJ.js} +4 -4
  228. package/dist/cli/chunks/{test-scheduling-BBVOLGFT.js → test-scheduling-4NHGC3EB.js} +3 -3
  229. package/dist/cli/chunks/{token-bootstrap-BUHTWVEF.js → token-bootstrap-MAOYJSZN.js} +2 -2
  230. package/dist/cli/chunks/{token-usage-MRVQ7G3H.js → token-usage-TJPP4UFG.js} +2 -2
  231. package/dist/cli/chunks/{hnswlib-node-NWNBNU3W.js → transformers-QIGZ7SE7.js} +2 -2
  232. package/dist/cli/chunks/{tree-sitter-wasm-parser-6GDZQNFV.js → tree-sitter-wasm-parser-CVKNF5NP.js} +2 -2
  233. package/dist/cli/chunks/{types-F2LWFMRI.js → types-FCGVB2IX.js} +2 -2
  234. package/dist/cli/chunks/unified-memory-U4CPBW5V.js +2 -0
  235. package/dist/cli/chunks/unified-memory-hnsw-BYBD2V33.js +2 -0
  236. package/dist/cli/chunks/unified-persistence-LAUTFWNC.js +2 -0
  237. package/dist/cli/chunks/{upgrade-N676MSDA.js → upgrade-HWJRLW6H.js} +2 -2
  238. package/dist/cli/chunks/{validate-56AA6YYM.js → validate-Z45LLWQQ.js} +2 -2
  239. package/dist/cli/chunks/{validate-swarm-YPHV7MMC.js → validate-swarm-VAEKMIJB.js} +2 -2
  240. package/dist/cli/chunks/{vibium-ABPFT3DX.js → vibium-O7MMGI45.js} +2 -2
  241. package/dist/cli/chunks/visual-security-XVWGWA4J.js +2 -0
  242. package/dist/cli/chunks/{web-tree-sitter-KN4PWKMV.js → web-tree-sitter-G3TTBGKP.js} +2 -2
  243. package/dist/cli/chunks/{windsurf-installer-IZOJBDNN.js → windsurf-installer-II3ZTH55.js} +2 -2
  244. package/dist/cli/chunks/witness-chain-CTIZD4GL.js +2 -0
  245. package/dist/cli/chunks/{witness-chain-H2DM5WMB.js → witness-chain-KYMMCOIV.js} +2 -2
  246. package/dist/cli/chunks/{workflow-R42PK45F.js → workflow-P4GQ3NJK.js} +4 -4
  247. package/dist/cli/chunks/workflow-orchestrator-NG3KLTLJ.js +2 -0
  248. package/dist/cli/chunks/{wrappers-6TIJNWN4.js → wrappers-7MWZ6R6U.js} +2 -2
  249. package/dist/cli/commands/hooks-handlers/hooks-dream-learning.js +6 -0
  250. package/dist/domains/code-intelligence/coordinator.js +20 -0
  251. package/dist/integrations/embeddings/index/HNSWIndex.js +16 -6
  252. package/dist/integrations/ruvector/hypergraph-engine.d.ts +45 -0
  253. package/dist/integrations/ruvector/hypergraph-engine.js +102 -0
  254. package/dist/integrations/ruvector/shared-rvf-adapter.js +110 -2
  255. package/dist/learning/experience-consolidation.d.ts +19 -3
  256. package/dist/learning/experience-consolidation.js +57 -27
  257. package/dist/learning/pattern-store.js +38 -1
  258. package/dist/mcp/bundle.js +307 -303
  259. package/package.json +2 -2
  260. package/scripts/preinstall.cjs +54 -0
  261. package/dist/cli/chunks/adapter-UOX57IAN.js +0 -2
  262. package/dist/cli/chunks/aqe-learning-engine-KZES2SKE.js +0 -2
  263. package/dist/cli/chunks/base-7MXMBRSW.js +0 -2
  264. package/dist/cli/chunks/browser-workflow-4C5R54CZ.js +0 -2
  265. package/dist/cli/chunks/chunk-35HDLA22.js +0 -2
  266. package/dist/cli/chunks/chunk-F32R4LVS.js +0 -2
  267. package/dist/cli/chunks/chunk-ZTWHRDUY.js +0 -2
  268. package/dist/cli/chunks/client-S5TFLKHN.js +0 -2
  269. package/dist/cli/chunks/cross-domain-router-GZG5GU7Q.js +0 -2
  270. package/dist/cli/chunks/dream-PGYTIOQS.js +0 -2
  271. package/dist/cli/chunks/hnsw-adapter-ANJKCXK6.js +0 -2
  272. package/dist/cli/chunks/hnsw-index-D4CJEP7L.js +0 -2
  273. package/dist/cli/chunks/impact-analyzer-55JW3OK6.js +0 -2
  274. package/dist/cli/chunks/init-wizard-MWKJNVB2.js +0 -2
  275. package/dist/cli/chunks/kernel-5MKKDS4J.js +0 -2
  276. package/dist/cli/chunks/knowledge-graph-2A7AE7L7.js +0 -2
  277. package/dist/cli/chunks/load-test-UD4ZXCGG.js +0 -2
  278. package/dist/cli/chunks/memory-backend-X3Z4IAYG.js +0 -2
  279. package/dist/cli/chunks/protocol-executor-AB6KPFK5.js +0 -2
  280. package/dist/cli/chunks/qe-reasoning-bank-Y4IDDIYA.js +0 -2
  281. package/dist/cli/chunks/queen-coordinator-GBSTXGA2.js +0 -2
  282. package/dist/cli/chunks/router-JA2X4MF6.js +0 -2
  283. package/dist/cli/chunks/routing-feedback-YCVJIWFM.js +0 -2
  284. package/dist/cli/chunks/rvf-native-adapter-5YN7EEB5.js +0 -2
  285. package/dist/cli/chunks/safe-db-S46Y7IC5.js +0 -2
  286. package/dist/cli/chunks/schedule-KSDHFWSY.js +0 -2
  287. package/dist/cli/chunks/scheduler-PLFJHU54.js +0 -2
  288. package/dist/cli/chunks/shared-rvf-adapter-MLXVW4N6.js +0 -2
  289. package/dist/cli/chunks/sqlite-persistence-RK3JWKB4.js +0 -2
  290. package/dist/cli/chunks/transformers-3PFLFSWR.js +0 -2
  291. package/dist/cli/chunks/unified-memory-JVZZMZRE.js +0 -2
  292. package/dist/cli/chunks/unified-memory-hnsw-EJJHCMFR.js +0 -2
  293. package/dist/cli/chunks/unified-persistence-IEKOYCBL.js +0 -2
  294. package/dist/cli/chunks/visual-security-APS7K3TZ.js +0 -2
  295. package/dist/cli/chunks/witness-chain-DMHO7R75.js +0 -2
  296. package/dist/cli/chunks/workflow-orchestrator-BDHRNVOG.js +0 -2
@@ -26,14 +26,28 @@ export function getSharedRvfAdapter(dataDir = '.agentic-qe', dimensions = 384) {
26
26
  try {
27
27
  // Dynamic require to match the bundled build pattern used elsewhere
28
28
  // eslint-disable-next-line @typescript-eslint/no-require-imports
29
- const { isRvfNativeAvailable, createRvfStore } = require('./rvf-native-adapter.js');
29
+ const { isRvfNativeAvailable, createRvfStore, openRvfStore } = require('./rvf-native-adapter.js');
30
30
  if (!isRvfNativeAvailable()) {
31
31
  console.warn('[RVF] Native bindings unavailable — agent branching and dream COW disabled. ' +
32
32
  'Install @ruvector/rvf-node to enable.');
33
33
  return null;
34
34
  }
35
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
35
36
  const path = require('path');
36
- sharedAdapter = createRvfStore(path.join(dataDir, 'patterns.rvf'), dimensions);
37
+ const rvfPath = path.join(dataDir, 'patterns.rvf');
38
+ // Open-or-create with a try-ladder rather than `existsSync` gate.
39
+ // Reasons:
40
+ // 1. RVF native's `RvfDatabase.create()` throws `0x0303 FsyncFailed`
41
+ // when the target file already exists (verified against both 0.1.7
42
+ // and 0.1.8 native binaries on linux-arm64). Earlier init phases
43
+ // legitimately produce patterns.rvf, so subsequent CLI / MCP boot
44
+ // would crash without this guard. (Jordi #439 / RUFLO P020.)
45
+ // 2. A bare `existsSync(...) ? open : create` is racy across
46
+ // processes — two parallel `aqe` invocations during init can both
47
+ // observe absent and both call `create`, with the second hitting
48
+ // FsyncFailed regardless. The try-ladder degrades to whichever
49
+ // path the OS actually permits.
50
+ sharedAdapter = openOrCreateRvf(openRvfStore, createRvfStore, rvfPath, dimensions);
37
51
  return sharedAdapter;
38
52
  }
39
53
  catch (error) {
@@ -41,6 +55,100 @@ export function getSharedRvfAdapter(dataDir = '.agentic-qe', dimensions = 384) {
41
55
  return null;
42
56
  }
43
57
  }
58
+ /**
59
+ * Race-tolerant open-or-create.
60
+ * Tries open first (cheap, succeeds for the common case where init has
61
+ * already produced the file). On open failure we attempt create. On the
62
+ * concurrent-create loser, create itself fails with `FsyncFailed`; we
63
+ * retry open once more. Any final exception bubbles up to the caller.
64
+ *
65
+ * Also asserts `dim()` matches the caller-requested `dimensions` after
66
+ * open so silent dimension drift between releases / configs is detected
67
+ * — a bad-dim file is closed and create() is attempted (fail-loud rather
68
+ * than corrupt-silently, which would manifest as wrong vector hits later).
69
+ */
70
+ function openOrCreateRvf(openFn, createFn, rvfPath, dimensions) {
71
+ const tryOpen = () => {
72
+ try {
73
+ return { adapter: openFn(rvfPath), err: null };
74
+ }
75
+ catch (err) {
76
+ return { adapter: null, err };
77
+ }
78
+ };
79
+ const isLockHeld = (err) => {
80
+ const m = err instanceof Error ? err.message : String(err);
81
+ return m.includes('LockHeld') || m.includes('0x0300');
82
+ };
83
+ // Pass 1: try to open whatever's there.
84
+ let { adapter: opened, err: openErr } = tryOpen();
85
+ // Pass 1.5: stale-lock recovery. The native binding writes a `<rvfPath>.lock`
86
+ // file on open and removes it on close. `aqe init` and short-lived CLI
87
+ // processes routinely exit without an explicit close, leaving a stale
88
+ // .lock that subsequent invocations interpret as `LockHeld`. Since AQE
89
+ // CLI is overwhelmingly single-shot serial, the realistic case is "the
90
+ // prior process is dead and the lock is stale". We unlink the .lock and
91
+ // retry open exactly once. If a genuinely-live peer existed, it still
92
+ // holds the file open — but the binding's lock is content-based (lock
93
+ // file presence), so this is a best-effort cooperative recovery rather
94
+ // than an OS-level lock break.
95
+ if (!opened && isLockHeld(openErr)) {
96
+ try {
97
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
98
+ const fs = require('fs');
99
+ const lockPath = `${rvfPath}.lock`;
100
+ if (fs.existsSync(lockPath)) {
101
+ fs.unlinkSync(lockPath);
102
+ console.warn(`[RVF] Removed stale lock file at ${lockPath} (prior process exited without closing). ` +
103
+ 'Retrying open. If you see this repeatedly under live concurrency, file an issue.');
104
+ ({ adapter: opened, err: openErr } = tryOpen());
105
+ }
106
+ }
107
+ catch (recoveryErr) {
108
+ // Lock removal failed (permissions?) — fall through to error path.
109
+ if (process.env.DEBUG) {
110
+ console.debug('[RVF] stale-lock recovery failed:', recoveryErr instanceof Error ? recoveryErr.message : recoveryErr);
111
+ }
112
+ }
113
+ }
114
+ if (opened) {
115
+ const actualDim = opened.dimension();
116
+ if (actualDim === dimensions)
117
+ return opened;
118
+ console.warn(`[RVF] patterns.rvf dimension mismatch: file=${actualDim} requested=${dimensions} — ` +
119
+ 'closing and degrading. Delete the .rvf file to recreate at the requested dim.');
120
+ try {
121
+ opened.close();
122
+ }
123
+ catch { /* best-effort */ }
124
+ // Don't auto-recreate over a dim-mismatched file. Surface to caller via
125
+ // throw so getSharedRvfAdapter logs and returns null (degrade to SQLite).
126
+ throw new Error(`RVF dimension mismatch (file=${actualDim}, requested=${dimensions})`);
127
+ }
128
+ // Pass 2: open failed even after stale-lock recovery → try create.
129
+ try {
130
+ return createFn(rvfPath, dimensions);
131
+ }
132
+ catch (createErr) {
133
+ // Pass 3: create failed (likely FsyncFailed because a peer process won
134
+ // the race). Try open one more time.
135
+ try {
136
+ const reopened = openFn(rvfPath);
137
+ if (reopened.dimension() !== dimensions) {
138
+ try {
139
+ reopened.close();
140
+ }
141
+ catch { /* best-effort */ }
142
+ throw new Error(`RVF dimension mismatch after race (file=${reopened.dimension()}, requested=${dimensions})`);
143
+ }
144
+ return reopened;
145
+ }
146
+ catch {
147
+ // Fall through with the more informative original error.
148
+ throw createErr instanceof Error ? createErr : new Error(String(createErr));
149
+ }
150
+ }
151
+ }
44
152
  /** Close the shared adapter and reset the singleton. */
45
153
  export function resetSharedRvfAdapter() {
46
154
  if (sharedAdapter) {
@@ -5,6 +5,12 @@
5
5
  * - Phase 1: Clusters & merges similar experiences via HNSW
6
6
  * - Phase 2: Reinforces quality based on reuse success
7
7
  * - Phase 3: Archives truly valueless entries (soft-delete only)
8
+ * - Phase 4 (safety valve): Soft-archives oldest/lowest-quality rows when a
9
+ * domain exceeds `hardThreshold`. Previously did `DELETE FROM` which
10
+ * permanently destroyed ~16K rows in production (see release notes for
11
+ * v3.9.22). Now strictly non-destructive: rows stay queryable and counted
12
+ * by the statusline formula, only `consolidated_into` changes to
13
+ * 'archived'.
8
14
  *
9
15
  * Ensures the Exp counter is monotonically non-decreasing.
10
16
  */
@@ -14,9 +20,14 @@ export interface ConsolidationResult {
14
20
  merged: number;
15
21
  /** Experiences with quality recalculated */
16
22
  qualityUpdated: number;
17
- /** Experiences soft-archived */
23
+ /** Experiences soft-archived (Phase 3 valueless + Phase 4 safety valve) */
18
24
  archived: number;
19
- /** Hard-deleted (only when exceeding safety valve) */
25
+ /**
26
+ * Deprecated: previously the count of physically-deleted rows when a
27
+ * domain exceeded `hardThreshold`. Always 0 since v3.9.22 — the safety
28
+ * valve is now non-destructive (soft-archive only). Kept for callers that
29
+ * still read the field; new code should treat it as a permanent zero.
30
+ */
20
31
  hardDeleted: number;
21
32
  /** Total active experiences remaining */
22
33
  activeRemaining: number;
@@ -30,7 +41,12 @@ export interface ConsolidationConfig {
30
41
  maxMergesPerRun: number;
31
42
  /** Soft threshold: start consolidating when domain exceeds this */
32
43
  softThreshold: number;
33
- /** Hard threshold: safety valve for hard-delete */
44
+ /**
45
+ * Hard threshold: safety valve. When a domain still exceeds this after
46
+ * Phases 1-3, the oldest/lowest-quality un-applied rows are
47
+ * soft-archived (consolidated_into = 'archived'). NOT hard-deleted —
48
+ * archived rows still count toward the statusline Exp formula.
49
+ */
34
50
  hardThreshold: number;
35
51
  /** Min age in days for archival eligibility */
36
52
  archiveMinAgeDays: number;
@@ -5,6 +5,12 @@
5
5
  * - Phase 1: Clusters & merges similar experiences via HNSW
6
6
  * - Phase 2: Reinforces quality based on reuse success
7
7
  * - Phase 3: Archives truly valueless entries (soft-delete only)
8
+ * - Phase 4 (safety valve): Soft-archives oldest/lowest-quality rows when a
9
+ * domain exceeds `hardThreshold`. Previously did `DELETE FROM` which
10
+ * permanently destroyed ~16K rows in production (see release notes for
11
+ * v3.9.22). Now strictly non-destructive: rows stay queryable and counted
12
+ * by the statusline formula, only `consolidated_into` changes to
13
+ * 'archived'.
8
14
  *
9
15
  * Ensures the Exp counter is monotonically non-decreasing.
10
16
  */
@@ -100,12 +106,17 @@ export class ExperienceConsolidator {
100
106
  result.qualityUpdated = this.reinforceQuality(domain);
101
107
  // Phase 3: Archive Valueless
102
108
  result.archived = this.archiveValueless(domain);
103
- // Safety valve: hard-delete if still over hard threshold
109
+ // Safety valve: when the domain still exceeds hardThreshold after the
110
+ // soft phases, archive (not delete) the oldest low-quality excess.
111
+ // Result is attributed to `archived` — `hardDeleted` stays 0 since
112
+ // v3.9.22 (see ConsolidationResult docstring).
104
113
  const afterCount = this.db.prepare("SELECT COUNT(*) as cnt FROM captured_experiences WHERE domain = ? AND consolidated_into IS NULL").get(domain).cnt;
114
+ let safetyValveArchived = 0;
105
115
  if (afterCount > this.config.hardThreshold) {
106
- result.hardDeleted = this.hardDeleteExcess(domain, afterCount);
116
+ safetyValveArchived = this.hardDeleteExcess(domain, afterCount);
117
+ result.archived += safetyValveArchived;
107
118
  }
108
- result.activeRemaining = afterCount - result.hardDeleted;
119
+ result.activeRemaining = afterCount - safetyValveArchived;
109
120
  return result;
110
121
  }
111
122
  /**
@@ -342,41 +353,60 @@ export class ExperienceConsolidator {
342
353
  return result.changes;
343
354
  }
344
355
  // ============================================================================
345
- // Safety Valve: Hard Delete
356
+ // Safety Valve: Soft Archive (formerly Hard Delete)
346
357
  // ============================================================================
358
+ //
359
+ // Pre-v3.9.22 this method ran `DELETE FROM captured_experiences`, which
360
+ // permanently destroyed ~16K rows in production once `code-intelligence`
361
+ // exceeded the threshold. The replacement keeps the same trigger condition
362
+ // (domain still over `hardThreshold` after Phases 1-3) but soft-archives
363
+ // the excess instead. Archived rows remain in the table and continue to
364
+ // contribute to the statusline Exp formula
365
+ // (`consolidated_into IS NULL OR consolidated_into = 'archived'`), so the
366
+ // counter stays monotonic.
367
+ //
368
+ // Method name and signature are preserved so the existing caller
369
+ // (`consolidateDomain`) keeps working unchanged. The returned number now
370
+ // represents rows transitioned active → archived, not rows deleted.
371
+ // ConsolidationResult.hardDeleted is kept zero for that reason; the
372
+ // archive count is rolled into Phase 3's `archived` total.
347
373
  hardDeleteExcess(domain, currentCount) {
348
374
  const excess = currentCount - this.config.hardThreshold;
349
375
  if (excess <= 0)
350
376
  return 0;
351
- // Delete oldest archived entries first
352
- const archivedDeleted = this.db.prepare(`
353
- DELETE FROM captured_experiences
377
+ // Soft-archive oldest low-quality un-applied active rows.
378
+ // Same selection criteria as the previous hard-delete path so the
379
+ // memory pressure relief behavior is unchanged — only the operation
380
+ // (UPDATE vs DELETE) changes.
381
+ const result = this.db.prepare(`
382
+ UPDATE captured_experiences
383
+ SET consolidated_into = 'archived'
354
384
  WHERE id IN (
355
385
  SELECT id FROM captured_experiences
356
- WHERE domain = ? AND consolidated_into = 'archived'
357
- ORDER BY started_at ASC
386
+ WHERE domain = ? AND consolidated_into IS NULL AND application_count = 0
387
+ ORDER BY quality ASC, started_at ASC
358
388
  LIMIT ?
359
389
  )
360
390
  `).run(domain, excess);
361
- let totalDeleted = archivedDeleted.changes;
362
- // If still over, delete oldest low-quality active entries
363
- if (totalDeleted < excess) {
364
- const remaining = excess - totalDeleted;
365
- const activeDeleted = this.db.prepare(`
366
- DELETE FROM captured_experiences
367
- WHERE id IN (
368
- SELECT id FROM captured_experiences
369
- WHERE domain = ? AND consolidated_into IS NULL AND application_count = 0
370
- ORDER BY quality ASC, started_at ASC
371
- LIMIT ?
372
- )
373
- `).run(domain, remaining);
374
- totalDeleted += activeDeleted.changes;
375
- }
376
- if (totalDeleted > 0) {
377
- console.warn(`[ExperienceConsolidator] Safety valve: hard-deleted ${totalDeleted} from ${domain}`);
391
+ const archived = result.changes;
392
+ if (archived > 0) {
393
+ try {
394
+ this.db.prepare(`
395
+ INSERT INTO experience_consolidation_log (id, domain, action, source_ids, details, created_at)
396
+ VALUES (?, ?, 'safety-valve-archive', '[]', ?, datetime('now'))
397
+ `).run(uuidv4(), domain, JSON.stringify({
398
+ count: archived,
399
+ currentCount,
400
+ hardThreshold: this.config.hardThreshold,
401
+ note: 'soft-archive replacement for legacy hard-delete safety valve',
402
+ }));
403
+ }
404
+ catch {
405
+ // Logging is best-effort; safety-valve effect is in the UPDATE above.
406
+ }
407
+ console.warn(`[ExperienceConsolidator] Safety valve: soft-archived ${archived} from ${domain} (was ${currentCount}, threshold ${this.config.hardThreshold})`);
378
408
  }
379
- return totalDeleted;
409
+ return archived;
380
410
  }
381
411
  // ============================================================================
382
412
  // Utilities
@@ -1391,7 +1391,44 @@ export function createPatternStore(memory, config) {
1391
1391
  // Shared adapter unavailable — fall back to direct create
1392
1392
  }
1393
1393
  if (!useSharedAdapter) {
1394
- const store = new RvfPatternStore((path, dim) => _createRvfStore(path, dim), { rvfPath, base: mergedConfig });
1394
+ // Race-tolerant open-or-create with dim verification, mirroring
1395
+ // shared-rvf-adapter.ts. Bare `existsSync ? open : create` is
1396
+ // racy across processes (two parallel CLI invocations during init
1397
+ // both observe absent, second hits FsyncFailed regardless). Try
1398
+ // open first, fall back to create, retry open on create-race.
1399
+ // (Jordi #439 / RUFLO P020.)
1400
+ const store = new RvfPatternStore((path, dim) => {
1401
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
1402
+ const { openRvfStore } = require('../integrations/ruvector/rvf-native-adapter.js');
1403
+ const tryOpen = () => {
1404
+ try {
1405
+ return openRvfStore(path);
1406
+ }
1407
+ catch {
1408
+ return null;
1409
+ }
1410
+ };
1411
+ let adapter = tryOpen();
1412
+ if (adapter) {
1413
+ if (adapter.dimension() !== dim) {
1414
+ try {
1415
+ adapter.close();
1416
+ }
1417
+ catch { /* best-effort */ }
1418
+ throw new Error(`RVF dimension mismatch (file=${adapter.dimension()}, requested=${dim})`);
1419
+ }
1420
+ return adapter;
1421
+ }
1422
+ try {
1423
+ return _createRvfStore(path, dim);
1424
+ }
1425
+ catch (createErr) {
1426
+ adapter = tryOpen();
1427
+ if (adapter && adapter.dimension() === dim)
1428
+ return adapter;
1429
+ throw createErr;
1430
+ }
1431
+ }, { rvfPath, base: mergedConfig });
1395
1432
  console.log('[PatternStore] Using RVF-backed store (ADR-066)');
1396
1433
  return store;
1397
1434
  }