agentic-qe 3.15.13 → 3.15.15

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 (426) hide show
  1. package/.claude/agents/v3/templates/qx-report-template.html +1 -1
  2. package/.claude/helpers/brain-checkpoint.cjs +124 -5
  3. package/.claude/skills/skills-manifest.json +1 -1
  4. package/CHANGELOG.md +124 -0
  5. package/assets/agents/v3/templates/qx-report-template.html +1 -1
  6. package/assets/skills/skills-manifest.json +1 -1
  7. package/dist/cli/bundle.js +6 -6
  8. package/dist/cli/chunks/adapter-QU6INSKP.js +2 -0
  9. package/dist/cli/chunks/agent-booster-wasm-EUF4XVUC.js +2 -0
  10. package/dist/cli/chunks/{agent-handler-AOH6TV7W.js → agent-handler-MOX6PSIQ.js} +2 -2
  11. package/dist/cli/chunks/{agent-memory-branch-2P54SF5N.js → agent-memory-branch-AEXKIGDG.js} +2 -2
  12. package/dist/cli/chunks/aqe-learning-engine-PAJPENJD.js +2 -0
  13. package/dist/cli/chunks/{arena-NSVFCAF5.js → arena-IQ5ZZDRF.js} +2 -2
  14. package/dist/cli/chunks/{arena-X6MOGQHA.js → arena-M7GA3CVG.js} +4 -4
  15. package/dist/cli/chunks/{audit-27DJLQNM.js → audit-4IPBMKWB.js} +3 -3
  16. package/dist/cli/chunks/base-OTGSN6IC.js +2 -0
  17. package/dist/cli/chunks/{better-sqlite3-BU5GXILS.js → better-sqlite3-IKDKJ2IE.js} +2 -2
  18. package/dist/cli/chunks/brain-handler-5NQUDH4W.js +95 -0
  19. package/dist/cli/chunks/{branch-enumerator-5CLULOCU.js → branch-enumerator-KSXELWRC.js} +2 -2
  20. package/dist/cli/chunks/{browser-R4DMU3LN.js → browser-6LACARWE.js} +2 -2
  21. package/dist/cli/chunks/browser-workflow-WLZGR6SB.js +2 -0
  22. package/dist/cli/chunks/{chunk-LUZNKJE6.js → chunk-22UKJGGN.js} +3 -3
  23. package/dist/cli/chunks/{chunk-BLSLEVDI.js → chunk-27HE2BHC.js} +2 -2
  24. package/dist/cli/chunks/{chunk-K4CZA77U.js → chunk-2CKERSMB.js} +2 -2
  25. package/dist/cli/chunks/{chunk-YSZ5OE3Z.js → chunk-2IIXCEMS.js} +2 -2
  26. package/dist/cli/chunks/{chunk-F3YS57NF.js → chunk-2LUTPMBO.js} +2 -2
  27. package/dist/cli/chunks/{chunk-GHM6MQNK.js → chunk-2ZFLULL4.js} +2 -2
  28. package/dist/cli/chunks/{chunk-7CMTY45A.js → chunk-337Z52QM.js} +2 -2
  29. package/dist/cli/chunks/{chunk-W26B7ERY.js → chunk-3CYNZFKH.js} +1 -1
  30. package/dist/cli/chunks/chunk-3HVFIITW.js +2 -0
  31. package/dist/cli/chunks/{chunk-K3TLLJMX.js → chunk-3J3RNJNX.js} +1 -1
  32. package/dist/cli/chunks/{chunk-MAMQA43L.js → chunk-4ATQP3PR.js} +1 -1
  33. package/dist/cli/chunks/{chunk-YXRASAPI.js → chunk-4D4CWP72.js} +2 -2
  34. package/dist/cli/chunks/{chunk-GHY6Z6KO.js → chunk-4HKAD25N.js} +3 -3
  35. package/dist/cli/chunks/{chunk-XNBOGCF3.js → chunk-4X3SWKBA.js} +2 -2
  36. package/dist/cli/chunks/{chunk-IJUHSJ2U.js → chunk-5AFVEWMT.js} +2 -2
  37. package/dist/cli/chunks/{chunk-SE4VNN4I.js → chunk-5C62XMJR.js} +3 -3
  38. package/dist/cli/chunks/{chunk-KDNJ4F3P.js → chunk-5G4UFTV4.js} +2 -2
  39. package/dist/cli/chunks/{chunk-DVGRPK7A.js → chunk-5I7357KS.js} +2 -2
  40. package/dist/cli/chunks/{chunk-YZWBNBTW.js → chunk-5KA5TVPR.js} +2 -2
  41. package/dist/cli/chunks/{chunk-JGZ722G3.js → chunk-5PTAFGJT.js} +2 -2
  42. package/dist/cli/chunks/{chunk-SVLQRAMF.js → chunk-6BRQPHMZ.js} +1 -1
  43. package/dist/cli/chunks/{chunk-KDVZND5Q.js → chunk-6KCSKGVY.js} +1 -1
  44. package/dist/cli/chunks/{chunk-LWR3FV3Y.js → chunk-6LE362LZ.js} +2 -2
  45. package/dist/cli/chunks/{chunk-WKGTGOYS.js → chunk-6NBRMD25.js} +3 -3
  46. package/dist/cli/chunks/{chunk-HQZGPJYG.js → chunk-6RBTS3NF.js} +2 -2
  47. package/dist/cli/chunks/{chunk-WOCGL4QP.js → chunk-6YVMX2TC.js} +2 -2
  48. package/dist/cli/chunks/{chunk-I3C7JOXC.js → chunk-73PBAWAF.js} +2 -2
  49. package/dist/cli/chunks/{chunk-75RDHBAX.js → chunk-74YG72NQ.js} +3 -3
  50. package/dist/cli/chunks/{chunk-O6FGXMHD.js → chunk-76P32JVU.js} +1 -1
  51. package/dist/cli/chunks/{chunk-LL7LDPXS.js → chunk-7ACCBHRB.js} +1 -1
  52. package/dist/cli/chunks/{chunk-3LJ7LQMV.js → chunk-7BLZHFKD.js} +1 -1
  53. package/dist/cli/chunks/{chunk-CM4LSLKR.js → chunk-7O45RQHF.js} +2 -2
  54. package/dist/cli/chunks/{chunk-NU3W5WFT.js → chunk-7XB3FCKM.js} +2 -2
  55. package/dist/cli/chunks/{chunk-E56B6IDX.js → chunk-AHMWD6JG.js} +2 -2
  56. package/dist/cli/chunks/{chunk-G2Q66Z23.js → chunk-AJPROCDW.js} +2 -2
  57. package/dist/cli/chunks/{chunk-NW7IBHJA.js → chunk-AKZO6GGG.js} +13 -13
  58. package/dist/cli/chunks/{chunk-IC3TQEOA.js → chunk-AOKKUB5F.js} +1 -1
  59. package/dist/cli/chunks/{chunk-4OVC4RIL.js → chunk-AP2W7Z3A.js} +1 -1
  60. package/dist/cli/chunks/{chunk-PHP5UBT4.js → chunk-BBRROA3Z.js} +2 -2
  61. package/dist/cli/chunks/{chunk-5FKWCZNF.js → chunk-BDKEAGQ2.js} +2 -2
  62. package/dist/cli/chunks/{chunk-BTVEYBW2.js → chunk-BFQTLF5X.js} +2 -2
  63. package/dist/cli/chunks/{chunk-HZ5NXFXH.js → chunk-BLL2XU7A.js} +2 -2
  64. package/dist/cli/chunks/{chunk-UTRV7T2N.js → chunk-BP5T3OEV.js} +2 -2
  65. package/dist/cli/chunks/{chunk-GB6HBNH2.js → chunk-BQ47GQPK.js} +2 -2
  66. package/dist/cli/chunks/{chunk-RFNW2LGD.js → chunk-BU4UQR36.js} +2 -2
  67. package/dist/cli/chunks/{chunk-WO274FRI.js → chunk-BZULJMGH.js} +2 -2
  68. package/dist/cli/chunks/{chunk-GU5HNCWI.js → chunk-C4KLXFJP.js} +1 -1
  69. package/dist/cli/chunks/{chunk-LFJALJOA.js → chunk-C4RTAVC6.js} +2 -2
  70. package/dist/cli/chunks/{chunk-WNQS4WTS.js → chunk-C5CXL3JP.js} +2 -2
  71. package/dist/cli/chunks/{chunk-MGZ5FJUW.js → chunk-CAOUV5GZ.js} +2 -2
  72. package/dist/cli/chunks/{chunk-XPRVF4YE.js → chunk-CBK5CT6T.js} +2 -2
  73. package/dist/cli/chunks/{chunk-JRRXCODW.js → chunk-DEKR3CTS.js} +2 -2
  74. package/dist/cli/chunks/{chunk-AQSVJNEH.js → chunk-DKX4GNRU.js} +2 -2
  75. package/dist/cli/chunks/{chunk-6KATY3KS.js → chunk-DUKE27HC.js} +2 -2
  76. package/dist/cli/chunks/{chunk-W2QWSQVE.js → chunk-DURD37JZ.js} +2 -2
  77. package/dist/cli/chunks/{chunk-KCW47QR5.js → chunk-E3MRDIZF.js} +1 -1
  78. package/dist/cli/chunks/{chunk-6Z7PRBSG.js → chunk-E56PVVWC.js} +2 -2
  79. package/dist/cli/chunks/{chunk-WQL7WCIZ.js → chunk-E5G4WZ2T.js} +1 -1
  80. package/dist/cli/chunks/{chunk-PB6J6HAA.js → chunk-EBTNMQSS.js} +2 -2
  81. package/dist/cli/chunks/{chunk-KADFXPPN.js → chunk-EFUJDMNC.js} +2 -2
  82. package/dist/cli/chunks/{chunk-QPNG5ZN2.js → chunk-EKP2SC77.js} +2 -2
  83. package/dist/cli/chunks/{chunk-U2FUXDDJ.js → chunk-EMSZVUYA.js} +3 -3
  84. package/dist/cli/chunks/{chunk-XEAEYC6Y.js → chunk-ERN56H6S.js} +1 -1
  85. package/dist/cli/chunks/{chunk-DNDL7SOS.js → chunk-FOOW4JVS.js} +2 -2
  86. package/dist/cli/chunks/{chunk-HOAJUIBQ.js → chunk-FTRSS64D.js} +2 -2
  87. package/dist/cli/chunks/{chunk-TOQWL2ZF.js → chunk-G242G224.js} +2 -2
  88. package/dist/cli/chunks/{chunk-VTDFVFST.js → chunk-G6RDCCFV.js} +2 -2
  89. package/dist/cli/chunks/{chunk-TWDW32W2.js → chunk-GCHYOPRZ.js} +2 -2
  90. package/dist/cli/chunks/{chunk-MFW5HSG4.js → chunk-GGQGCT4Y.js} +2 -2
  91. package/dist/cli/chunks/{chunk-G6WDYBLQ.js → chunk-GKSMRBHU.js} +1 -1
  92. package/dist/cli/chunks/{chunk-CCMKSHAT.js → chunk-GQABPCQE.js} +2 -2
  93. package/dist/cli/chunks/{chunk-G77ERMUD.js → chunk-GV2QE5TO.js} +1 -1
  94. package/dist/cli/chunks/{chunk-756CGMEH.js → chunk-H5DER3JY.js} +1 -1
  95. package/dist/cli/chunks/{chunk-W3PPFHI5.js → chunk-HH4ED4F7.js} +52 -50
  96. package/dist/cli/chunks/{chunk-3Y2ROSCL.js → chunk-HL2ANKN3.js} +2 -2
  97. package/dist/cli/chunks/{chunk-T3PGQFDI.js → chunk-HTZSRMHW.js} +2 -2
  98. package/dist/cli/chunks/{chunk-3QZEGE67.js → chunk-IXL5ZHWJ.js} +1 -1
  99. package/dist/cli/chunks/{chunk-5ZGM3RMH.js → chunk-J3FP5UGL.js} +1 -1
  100. package/dist/cli/chunks/{chunk-FZ76G4QJ.js → chunk-JCQGJGGZ.js} +1 -1
  101. package/dist/cli/chunks/chunk-JCZCJE6X.js +86 -0
  102. package/dist/cli/chunks/{chunk-YZEXYO4W.js → chunk-JKJOB65O.js} +1 -1
  103. package/dist/cli/chunks/{chunk-A64JFBWI.js → chunk-JUDUBQHA.js} +2 -2
  104. package/dist/cli/chunks/{chunk-PIDQVU3L.js → chunk-JW74KRBC.js} +2 -2
  105. package/dist/cli/chunks/{chunk-EXGMJFAT.js → chunk-K3WZICFA.js} +1 -1
  106. package/dist/cli/chunks/{chunk-ASQYASNV.js → chunk-K3XBQC3R.js} +1 -1
  107. package/dist/cli/chunks/{chunk-E7CLYGS7.js → chunk-KCQNFBBR.js} +1 -1
  108. package/dist/cli/chunks/chunk-KJBPB7P5.js +3 -0
  109. package/dist/cli/chunks/chunk-KLTMOXIK.js +3 -0
  110. package/dist/cli/chunks/{chunk-5MDERQH3.js → chunk-L32JNNKL.js} +1 -1
  111. package/dist/cli/chunks/{chunk-32ZMWEP3.js → chunk-LB2LGEDP.js} +2 -2
  112. package/dist/cli/chunks/{chunk-42J34YG4.js → chunk-LHMQIZ6B.js} +2 -2
  113. package/dist/cli/chunks/{chunk-NURIILUB.js → chunk-LJMYRTJ7.js} +1 -1
  114. package/dist/cli/chunks/{chunk-M6AAGIG7.js → chunk-LNX74WHQ.js} +1 -1
  115. package/dist/cli/chunks/{chunk-P7A4NKTZ.js → chunk-LTQVUAPH.js} +2 -2
  116. package/dist/cli/chunks/{chunk-3YNLWPBF.js → chunk-LVABQNRF.js} +2 -2
  117. package/dist/cli/chunks/{chunk-2G7TVT6W.js → chunk-LYJHUNBK.js} +2 -2
  118. package/dist/cli/chunks/{chunk-DLD7RUZ4.js → chunk-M4CJCPCQ.js} +2 -2
  119. package/dist/cli/chunks/{chunk-Q3UDLV5Z.js → chunk-M4WMSCAE.js} +1 -1
  120. package/dist/cli/chunks/{chunk-UDQSYWVF.js → chunk-MIA447GY.js} +1 -1
  121. package/dist/cli/chunks/{chunk-RF7HWBHN.js → chunk-MPFPWJTH.js} +2 -2
  122. package/dist/cli/chunks/{chunk-BK577VL7.js → chunk-MV55NXTD.js} +2 -2
  123. package/dist/cli/chunks/{chunk-JQGMW45H.js → chunk-NQS3BWS6.js} +1 -1
  124. package/dist/cli/chunks/{chunk-BEGR4D6N.js → chunk-NWIIYHT6.js} +2 -2
  125. package/dist/cli/chunks/{chunk-SSU73QAX.js → chunk-O6EWL5DQ.js} +2 -2
  126. package/dist/cli/chunks/chunk-OBDONJQM.js +2 -0
  127. package/dist/cli/chunks/chunk-OLZH5LRT.js +141 -0
  128. package/dist/cli/chunks/{chunk-W3INMZZ6.js → chunk-OQG3UQQ7.js} +1 -1
  129. package/dist/cli/chunks/{chunk-72ASBE35.js → chunk-PFQCV6YS.js} +3 -3
  130. package/dist/cli/chunks/{chunk-7YTGHGK4.js → chunk-PS6UMZVK.js} +2 -2
  131. package/dist/cli/chunks/{chunk-OCAEXYFA.js → chunk-PXATBHWN.js} +2 -2
  132. package/dist/cli/chunks/{chunk-ARJW4I2O.js → chunk-PYPS65P7.js} +2 -2
  133. package/dist/cli/chunks/{chunk-SYV2V3PL.js → chunk-Q6I4SIUU.js} +4 -4
  134. package/dist/cli/chunks/{chunk-H4H2YSFH.js → chunk-QFGYH6HD.js} +1 -1
  135. package/dist/cli/chunks/{chunk-526QYFJU.js → chunk-QGBGSQ2E.js} +2 -2
  136. package/dist/cli/chunks/{chunk-YBQH2VOP.js → chunk-QRKTBSZT.js} +2 -2
  137. package/dist/cli/chunks/{chunk-C7JM7CD3.js → chunk-R6LHJ7ME.js} +2 -2
  138. package/dist/cli/chunks/{chunk-TSQC2KKZ.js → chunk-RBKUU7WF.js} +2 -2
  139. package/dist/cli/chunks/{chunk-CE7B5LU7.js → chunk-RDMRY7CT.js} +1 -1
  140. package/dist/cli/chunks/chunk-RIRZHOS2.js +8 -0
  141. package/dist/cli/chunks/{chunk-CRWPZT74.js → chunk-SHRI7TKJ.js} +2 -2
  142. package/dist/cli/chunks/{chunk-KWYH3FI4.js → chunk-SJCKCSN3.js} +1 -1
  143. package/dist/cli/chunks/{chunk-DFUASIKA.js → chunk-SON6ZRH3.js} +2 -2
  144. package/dist/cli/chunks/{chunk-J2ZIFFM6.js → chunk-SZAZQZWI.js} +2 -2
  145. package/dist/cli/chunks/{chunk-HD7YIFOI.js → chunk-T4GE7MPI.js} +2 -2
  146. package/dist/cli/chunks/{chunk-3Y7TJFHU.js → chunk-T66PPF4D.js} +2 -2
  147. package/dist/cli/chunks/{chunk-3RZV5DGO.js → chunk-T67R2MUN.js} +2 -2
  148. package/dist/cli/chunks/{chunk-H4GG2NLO.js → chunk-TDQWTSBS.js} +2 -2
  149. package/dist/cli/chunks/{chunk-TWJTK4CC.js → chunk-TODNOP7C.js} +2 -2
  150. package/dist/cli/chunks/{chunk-NZ3GUMB2.js → chunk-TX2CHQD7.js} +2 -2
  151. package/dist/cli/chunks/{chunk-AL6FBH3E.js → chunk-TZIHDJZD.js} +2 -2
  152. package/dist/cli/chunks/{chunk-GII6UM3F.js → chunk-U62OUXBF.js} +1 -1
  153. package/dist/cli/chunks/{chunk-YQFLQE53.js → chunk-UAQZI6N4.js} +2 -2
  154. package/dist/cli/chunks/{chunk-R7SYRCRP.js → chunk-UE2J6MA5.js} +1 -1
  155. package/dist/cli/chunks/{chunk-VRHRBAEM.js → chunk-UGYM4U44.js} +1 -1
  156. package/dist/cli/chunks/{chunk-NT4DBXSX.js → chunk-UJABDXST.js} +2 -2
  157. package/dist/cli/chunks/{chunk-OFACHK5O.js → chunk-UORB2QDU.js} +9 -9
  158. package/dist/cli/chunks/{chunk-QDEJ4CI2.js → chunk-UQPA33UK.js} +2 -2
  159. package/dist/cli/chunks/{chunk-TCBBNUBP.js → chunk-UUBIQR6A.js} +3 -3
  160. package/dist/cli/chunks/{chunk-NZD4DPSU.js → chunk-UXIY4IAI.js} +2 -2
  161. package/dist/cli/chunks/{chunk-SG3NX7QE.js → chunk-VCXI4XC4.js} +2 -2
  162. package/dist/cli/chunks/{chunk-PSFSPGUD.js → chunk-VMAM46HQ.js} +2 -2
  163. package/dist/cli/chunks/{chunk-3AN5TNGD.js → chunk-VY4U6DPO.js} +3 -3
  164. package/dist/cli/chunks/{chunk-X7N2JF2X.js → chunk-W27AJ5B4.js} +2 -2
  165. package/dist/cli/chunks/{chunk-CT6SAVXQ.js → chunk-W5ZJG2OU.js} +2 -2
  166. package/dist/cli/chunks/{chunk-KV4T4MXK.js → chunk-W62OOK7A.js} +2 -2
  167. package/dist/cli/chunks/{chunk-5K26BEYB.js → chunk-WNTA4YKE.js} +2 -2
  168. package/dist/cli/chunks/{chunk-LZYQHVD4.js → chunk-WUOOX7UG.js} +2 -2
  169. package/dist/cli/chunks/{chunk-7NA7JXNB.js → chunk-WVXJ2QIG.js} +2 -2
  170. package/dist/cli/chunks/{chunk-KB56CPU4.js → chunk-X33CWRDF.js} +2 -2
  171. package/dist/cli/chunks/{chunk-7JUC2MVZ.js → chunk-XG4F4XH4.js} +2 -2
  172. package/dist/cli/chunks/{chunk-ZAKQLAHT.js → chunk-XH4JMX5O.js} +1 -1
  173. package/dist/cli/chunks/{chunk-X2Z7F4EU.js → chunk-XHHWABJV.js} +2 -2
  174. package/dist/cli/chunks/{chunk-7PLIEBY7.js → chunk-XHLYGXYE.js} +2 -2
  175. package/dist/cli/chunks/{chunk-UXZSUMEA.js → chunk-XIVVTYM2.js} +2 -2
  176. package/dist/cli/chunks/{chunk-MVVB7C2E.js → chunk-XM6ZVFM5.js} +156 -156
  177. package/dist/cli/chunks/{chunk-VTOBUZL6.js → chunk-XWIAZG3C.js} +2 -2
  178. package/dist/cli/chunks/{chunk-CV77DMDQ.js → chunk-Y2OX6KGN.js} +2 -2
  179. package/dist/cli/chunks/{chunk-VRVMIPTM.js → chunk-YUS6TWAL.js} +2 -2
  180. package/dist/cli/chunks/{chunk-VU5TBX2V.js → chunk-ZIPAB5J6.js} +2 -2
  181. package/dist/cli/chunks/{chunk-KUAKV3IW.js → chunk-ZSOMUTNL.js} +1 -1
  182. package/dist/cli/chunks/{chunk-UOC3O6RP.js → chunk-ZWBGYJ7K.js} +2 -2
  183. package/dist/cli/chunks/{chunk-5VMAV6T6.js → chunk-ZYJB6FML.js} +1 -1
  184. package/dist/cli/chunks/{ci-ENOASTYB.js → ci-UCUJOSBW.js} +2 -2
  185. package/dist/cli/chunks/{ci-config-B26OXHQM.js → ci-config-2XILD3XG.js} +2 -2
  186. package/dist/cli/chunks/{ci-output-JTCLLNOQ.js → ci-output-BL6KWOHW.js} +2 -2
  187. package/dist/cli/chunks/{circuit-breaker-23JMFNM5.js → circuit-breaker-5XLIOXE5.js} +2 -2
  188. package/dist/cli/chunks/{claude-flow-setup-ON6L462G.js → claude-flow-setup-4IMP6ACS.js} +2 -2
  189. package/dist/cli/chunks/client-KKRNPX4F.js +2 -0
  190. package/dist/cli/chunks/{cline-installer-OWQ4D2FQ.js → cline-installer-RYLHCDK7.js} +2 -2
  191. package/dist/cli/chunks/{code-2ZRL7SEU.js → code-WY3GJXHX.js} +3 -3
  192. package/dist/cli/chunks/{code-index-extractor-JXSQVM67.js → code-index-extractor-Y4MZBZCW.js} +2 -2
  193. package/dist/cli/chunks/{codex-installer-7LXZYBSQ.js → codex-installer-SCJ3T3DX.js} +4 -4
  194. package/dist/cli/chunks/{completions-C2LR623C.js → completions-CN2DXQFU.js} +2 -2
  195. package/dist/cli/chunks/{complexity-analyzer-TGQLHCYJ.js → complexity-analyzer-7MDPPIBH.js} +2 -2
  196. package/dist/cli/chunks/{continuedev-installer-RUGD24D2.js → continuedev-installer-GCEJRK34.js} +2 -2
  197. package/dist/cli/chunks/{copilot-installer-ZLFVLEJP.js → copilot-installer-BHPDSELY.js} +2 -2
  198. package/dist/cli/chunks/core-handlers-47MPMED7.js +2 -0
  199. package/dist/cli/chunks/{cost-tracker-RT4QL745.js → cost-tracker-VO5MFWR6.js} +2 -2
  200. package/dist/cli/chunks/coverage-LYFQYNH6.js +51 -0
  201. package/dist/cli/chunks/cross-domain-router-U6MBFHEC.js +2 -0
  202. package/dist/cli/chunks/{cursor-installer-LJKLNFF6.js → cursor-installer-KP4HA7TV.js} +2 -2
  203. package/dist/cli/chunks/{daemon-BMDXCQT5.js → daemon-7RC7TS57.js} +3 -3
  204. package/dist/cli/chunks/{daemon-FBH3IRYN.js → daemon-AXLVPKVO.js} +4 -4
  205. package/dist/cli/chunks/{dag-attention-scheduler-JGDED55I.js → dag-attention-scheduler-NKA44RSR.js} +2 -2
  206. package/dist/cli/chunks/{detect-SZIHIVCJ.js → detect-CMYAJWYF.js} +2 -2
  207. package/dist/cli/chunks/{dist-node-FV3KWXQ6.js → dist-node-EN3PYEGW.js} +2 -2
  208. package/dist/cli/chunks/{domain-handler-GI5JWQOV.js → domain-handler-EXSZCX7A.js} +2 -2
  209. package/dist/cli/chunks/{domain-plugins-BUWY36TL.js → domain-plugins-HCQFSNL7.js} +2 -2
  210. package/dist/cli/chunks/{domain-transfer-GCY7W5DA.js → domain-transfer-3LGSNTPO.js} +2 -2
  211. package/dist/cli/chunks/dream-76L6EEN7.js +2 -0
  212. package/dist/cli/chunks/{embed-and-insert-pattern-GPRR3ZGD.js → embed-and-insert-pattern-B6MNHICW.js} +2 -2
  213. package/dist/cli/chunks/{eval-XPB3IGAP.js → eval-OQELIWJK.js} +2 -2
  214. package/dist/cli/chunks/{experience-capture-middleware-2E554UB3.js → experience-capture-middleware-SUFILYPW.js} +3 -3
  215. package/dist/cli/chunks/{fast-paths-ZSMWZPUC.js → fast-paths-UV4NDEWM.js} +2 -2
  216. package/dist/cli/chunks/{feature-flags-GIWVDVVC.js → feature-flags-CKTYX67J.js} +2 -2
  217. package/dist/cli/chunks/{feature-flags-N7EOGE5P.js → feature-flags-H7H33B6C.js} +2 -2
  218. package/dist/cli/chunks/file-discovery-VSFKZ3LJ.js +2 -0
  219. package/dist/cli/chunks/{fleet-HCHDOUCX.js → fleet-ZJBCAKRG.js} +3 -3
  220. package/dist/cli/chunks/{gnn-wrapper-CZNCNXXZ.js → gnn-wrapper-RUE2QZRG.js} +2 -2
  221. package/dist/cli/chunks/{heartbeat-handler-6YUIF2YQ.js → heartbeat-handler-XRV327M7.js} +4 -4
  222. package/dist/cli/chunks/heartbeat-scheduler-NIK3KKEH.js +2 -0
  223. package/dist/cli/chunks/hnsw-adapter-WJG7LUJJ.js +2 -0
  224. package/dist/cli/chunks/hnsw-index-D6PRI5HC.js +2 -0
  225. package/dist/cli/chunks/{hnsw-legacy-bridge-J3M3IK24.js → hnsw-legacy-bridge-UJID6ZZ4.js} +2 -2
  226. package/dist/cli/chunks/{hnswlib-node-ULGTGDZW.js → hnswlib-node-WS43R4AX.js} +2 -2
  227. package/dist/cli/chunks/{hooks-C4BUGYUQ.js → hooks-YZNJKXAJ.js} +10 -10
  228. package/dist/cli/chunks/hybrid-backend-RIUR3I7F.js +2 -0
  229. package/dist/cli/chunks/{hypergraph-engine-WINGVMPG.js → hypergraph-engine-XQJSIMTS.js} +2 -2
  230. package/dist/cli/chunks/{hypergraph-handler-GADMWKAU.js → hypergraph-handler-ZD2NYXMR.js} +3 -3
  231. package/dist/cli/chunks/impact-analyzer-C36YYTJ5.js +2 -0
  232. package/dist/cli/chunks/{init-guard-K2T4QWAO.js → init-guard-DSRUAVRT.js} +2 -2
  233. package/dist/cli/chunks/{init-handler-PCZTDZYI.js → init-handler-RJU5QMAP.js} +6 -6
  234. package/dist/cli/chunks/init-wizard-JCKNGIGT.js +2 -0
  235. package/dist/cli/chunks/kernel-F7ILJTYD.js +2 -0
  236. package/dist/cli/chunks/{kilocode-installer-XENXNEIU.js → kilocode-installer-BCPOCVMC.js} +2 -2
  237. package/dist/cli/chunks/{kiro-installer-3PG2TJ67.js → kiro-installer-GFCWCB2S.js} +2 -2
  238. package/dist/cli/chunks/knowledge-graph-VTXDBHB2.js +2 -0
  239. package/dist/cli/chunks/learning-FZTD72CF.js +131 -0
  240. package/dist/cli/chunks/{llm-router-RKVDEWU2.js → llm-router-GJVKGRJL.js} +4 -4
  241. package/dist/cli/chunks/llm-router-service-TNOWQINA.js +2 -0
  242. package/dist/cli/chunks/{load-ITHC564X.js → load-YKTPOYBE.js} +2 -2
  243. package/dist/cli/chunks/load-test-FPVBK2EV.js +2 -0
  244. package/dist/cli/chunks/{mcp-TCL5UW3N.js → mcp-LT6R2IKS.js} +2 -2
  245. package/dist/cli/chunks/{memory-BKDAY2N2.js → memory-4HKKOLRY.js} +5 -5
  246. package/dist/cli/chunks/memory-backend-2QE7O67A.js +2 -0
  247. package/dist/cli/chunks/{memory-handlers-WN4FXFOA.js → memory-handlers-X4CMVBXB.js} +2 -2
  248. package/dist/cli/chunks/{multi-model-executor-VHAT7ZPF.js → multi-model-executor-2YPM2WTK.js} +2 -2
  249. package/dist/cli/chunks/{opencode-installer-E3VM3EEY.js → opencode-installer-WBAJMH5K.js} +2 -2
  250. package/dist/cli/chunks/{orchestrator-BMQ6X762.js → orchestrator-5W5WVMVJ.js} +109 -25
  251. package/dist/cli/chunks/pattern-null-store-UI35ORHW.js +2 -0
  252. package/dist/cli/chunks/{pattern-usage-recorder-GOOR2BV5.js → pattern-usage-recorder-GXRMNPAZ.js} +2 -2
  253. package/dist/cli/chunks/{pipeline-5NSFQQIX.js → pipeline-2NA4DRDA.js} +2 -2
  254. package/dist/cli/chunks/{platform-SQM34J5G.js → platform-BGERNQ5V.js} +2 -2
  255. package/dist/cli/chunks/{plugin-UQJZRMZG.js → plugin-L4EPVENR.js} +2 -2
  256. package/dist/cli/chunks/{prime-radiant-advanced-wasm-WMDJOL4S.js → prime-radiant-advanced-wasm-RTQRTPTM.js} +2 -2
  257. package/dist/cli/chunks/project-root-S7WDFTMU.js +2 -0
  258. package/dist/cli/chunks/protocol-executor-OPANXQVB.js +2 -0
  259. package/dist/cli/chunks/{protocol-handler-OBDCVY6X.js → protocol-handler-SYQXM6JK.js} +2 -2
  260. package/dist/cli/chunks/{prove-XDC7I4XT.js → prove-5O7GPJCU.js} +2 -2
  261. package/dist/cli/chunks/qe-reasoning-bank-3OTF4DYQ.js +2 -0
  262. package/dist/cli/chunks/{quality-L4GQ6WX4.js → quality-KIIDHGNF.js} +2 -2
  263. package/dist/cli/chunks/{quality-gate-MJG66LKN.js → quality-gate-H65VECD3.js} +3 -3
  264. package/dist/cli/chunks/queen-coordinator-WTYH4TAN.js +2 -0
  265. package/dist/cli/chunks/{real-embeddings-HW4G2LWL.js → real-embeddings-DYIOLKQ3.js} +2 -2
  266. package/dist/cli/chunks/{ref-validation-FC7JOJ2C.js → ref-validation-CSBJOMZM.js} +2 -2
  267. package/dist/cli/chunks/{roocode-installer-KWS4CEIC.js → roocode-installer-G7OVYXEN.js} +2 -2
  268. package/dist/cli/chunks/router-DBBW4NC2.js +2 -0
  269. package/dist/cli/chunks/routing-feedback-W35QHCL4.js +2 -0
  270. package/dist/cli/chunks/{routing-handler-QF4WVB2S.js → routing-handler-ZNZPPI5Y.js} +2 -2
  271. package/dist/cli/chunks/{ruvector-commands-2MTCOUK6.js → ruvector-commands-C6IG3OY3.js} +2 -2
  272. package/dist/cli/chunks/rvf-dual-writer-X3NSL25Z.js +2 -0
  273. package/dist/cli/chunks/rvf-migration-adapter-TZR7GDOK.js +2 -0
  274. package/dist/cli/chunks/{rvf-migration-coordinator-BREJCXWN.js → rvf-migration-coordinator-4ATTHGHD.js} +2 -2
  275. package/dist/cli/chunks/rvf-native-adapter-HD25ZYV5.js +2 -0
  276. package/dist/cli/chunks/{rvf-store-integrity-KKC6HOJD.js → rvf-store-integrity-3G6LFLT3.js} +2 -2
  277. package/dist/cli/chunks/safe-db-ZS2QKANY.js +2 -0
  278. package/dist/cli/chunks/schedule-ZH6VNA32.js +2 -0
  279. package/dist/cli/chunks/scheduler-T6CD74B6.js +2 -0
  280. package/dist/cli/chunks/{security-OSAE7VAP.js → security-A3IMVLFM.js} +3 -3
  281. package/dist/cli/chunks/{shared-rvf-adapter-COUOS665.js → shared-rvf-adapter-VHWQ6US5.js} +2 -2
  282. package/dist/cli/chunks/{shared-rvf-dual-writer-YXMPZKQE.js → shared-rvf-dual-writer-JB3QS7IG.js} +2 -2
  283. package/dist/cli/chunks/sqlite-persistence-47WU5EKZ.js +2 -0
  284. package/dist/cli/chunks/{standalone-memory-E6JBMOIL.js → standalone-memory-DDNXCSBD.js} +2 -2
  285. package/dist/cli/chunks/{status-handler-AFTCIYIX.js → status-handler-2HK7XPEK.js} +2 -2
  286. package/dist/cli/chunks/{structural-health-2FROCEI4.js → structural-health-DSJVLEPV.js} +2 -2
  287. package/dist/cli/chunks/{sync-VAYTOWDC.js → sync-3MUV6S5E.js} +2 -2
  288. package/dist/cli/chunks/{sync-YIQYOFGW.js → sync-NTUR53PI.js} +2 -2
  289. package/dist/cli/chunks/{task-handler-KVQHDEX3.js → task-handler-74MZN2EO.js} +2 -2
  290. package/dist/cli/chunks/{task-handlers-MVVECQA6.js → task-handlers-VJR6EHRZ.js} +3 -3
  291. package/dist/cli/chunks/{test-5JSVTOMY.js → test-O6FK3FVF.js} +4 -4
  292. package/dist/cli/chunks/test-runner-process-2NPW3UDQ.js +2 -0
  293. package/dist/cli/chunks/{test-scheduling-HBOHVLI3.js → test-scheduling-Q6QEEOS6.js} +3 -3
  294. package/dist/cli/chunks/{token-bootstrap-5VEPTPFA.js → token-bootstrap-TTRCECLP.js} +2 -2
  295. package/dist/cli/chunks/{token-usage-TBJHDLY6.js → token-usage-YEEFWSSI.js} +2 -2
  296. package/dist/cli/chunks/{transformers-VAWYMHMZ.js → transformers-BZCHJJJT.js} +2 -2
  297. package/dist/cli/chunks/tree-sitter-wasm-parser-RZAND65G.js +2 -0
  298. package/dist/cli/chunks/{types-R5SDZU2E.js → types-4AOKZYOX.js} +2 -2
  299. package/dist/cli/chunks/unified-memory-FZ5K2C7W.js +2 -0
  300. package/dist/cli/chunks/unified-memory-hnsw-VREWX56M.js +2 -0
  301. package/dist/cli/chunks/unified-persistence-YZGMKX6B.js +2 -0
  302. package/dist/cli/chunks/{upgrade-K5PIHXRB.js → upgrade-2MWW6BT2.js} +2 -2
  303. package/dist/cli/chunks/{validate-RPTS7RYJ.js → validate-PAEV3GT5.js} +2 -2
  304. package/dist/cli/chunks/{validate-swarm-B2ZL556X.js → validate-swarm-ZIXACK5K.js} +2 -2
  305. package/dist/cli/chunks/visual-security-GXGSFBVA.js +2 -0
  306. package/dist/cli/chunks/{web-tree-sitter-K4DUJC32.js → web-tree-sitter-VLTXZFAB.js} +2 -2
  307. package/dist/cli/chunks/{windsurf-installer-OK2AJN35.js → windsurf-installer-VELMLOZF.js} +2 -2
  308. package/dist/cli/chunks/witness-chain-MRJKVCOW.js +2 -0
  309. package/dist/cli/chunks/witness-chain-WWHJKITG.js +2 -0
  310. package/dist/cli/chunks/{witness-chain-repair-L6Y5RFXR.js → witness-chain-repair-5SAXPETG.js} +2 -2
  311. package/dist/cli/chunks/{witness-chain-verifier-N4CW7FZX.js → witness-chain-verifier-MIDWD4JS.js} +2 -2
  312. package/dist/cli/chunks/{witness-key-manager-TDNPS3WD.js → witness-key-manager-OSVCWOB2.js} +2 -2
  313. package/dist/cli/chunks/{workflow-XRZA3YCY.js → workflow-MK7A7QCX.js} +4 -4
  314. package/dist/cli/chunks/workflow-orchestrator-SG7DV72E.js +2 -0
  315. package/dist/cli/chunks/{wrappers-5JIFWKN6.js → wrappers-5QFMCKXL.js} +2 -2
  316. package/dist/cli/commands/coverage.js +6 -0
  317. package/dist/cli/commands/learning-prune.d.ts +14 -0
  318. package/dist/cli/commands/learning-prune.js +105 -0
  319. package/dist/cli/commands/learning.js +9 -0
  320. package/dist/cli/handlers/brain-handler.js +12 -1
  321. package/dist/cli/utils/coverage-verdict.js +14 -3
  322. package/dist/context/compaction/index.d.ts +7 -0
  323. package/dist/context/compaction/index.js +30 -6
  324. package/dist/coordination/handlers/coverage-evidence.d.ts +19 -0
  325. package/dist/coordination/handlers/coverage-evidence.js +31 -2
  326. package/dist/coordination/handlers/coverage-handlers.js +5 -1
  327. package/dist/coordination/handlers/coverage-target.js +8 -1
  328. package/dist/coordination/handlers/quality-handlers.js +9 -1
  329. package/dist/coordination/result-saver-adapters.js +1 -0
  330. package/dist/coordination/result-saver.js +9 -5
  331. package/dist/domains/chaos-resilience/services/chaos-engineer.d.ts +1 -0
  332. package/dist/domains/chaos-resilience/services/chaos-engineer.js +23 -45
  333. package/dist/domains/coverage-analysis/collected-metrics.d.ts +22 -6
  334. package/dist/domains/coverage-analysis/collected-metrics.js +37 -12
  335. package/dist/domains/coverage-analysis/services/coverage-analyzer.js +2 -0
  336. package/dist/domains/defect-intelligence/services/defect-predictor.js +3 -6
  337. package/dist/domains/quality-assessment/coverage-report-event.d.ts +8 -0
  338. package/dist/domains/quality-assessment/coverage-report-event.js +22 -1
  339. package/dist/domains/quality-assessment/interfaces.d.ts +6 -0
  340. package/dist/domains/quality-assessment/services/quality-analyzer.d.ts +4 -0
  341. package/dist/domains/quality-assessment/services/quality-analyzer.js +63 -17
  342. package/dist/domains/test-execution/interfaces.d.ts +5 -0
  343. package/dist/domains/test-execution/services/test-executor.js +6 -0
  344. package/dist/init/init-wizard-hooks.d.ts +1 -1
  345. package/dist/init/init-wizard-hooks.js +7 -8
  346. package/dist/init/phases/07-hooks.js +90 -6
  347. package/dist/init/phases/08-mcp.js +9 -0
  348. package/dist/init/settings-merge.d.ts +13 -0
  349. package/dist/init/settings-merge.js +49 -2
  350. package/dist/integrations/agent-booster-wasm/agent_booster_wasm.js +849 -0
  351. package/dist/integrations/agent-booster-wasm/agent_booster_wasm_bg.wasm +0 -0
  352. package/dist/integrations/agent-booster-wasm/index.d.ts +8 -0
  353. package/dist/integrations/agent-booster-wasm/index.js +25 -2
  354. package/dist/integrations/agent-booster-wasm/package.json +16 -0
  355. package/dist/integrations/ruvector/brain-rvf-exporter.d.ts +25 -0
  356. package/dist/integrations/ruvector/brain-rvf-exporter.js +154 -61
  357. package/dist/learning/dream/dream-engine.d.ts +27 -3
  358. package/dist/learning/dream/dream-engine.js +97 -28
  359. package/dist/learning/dream/dream-lock-retry.d.ts +38 -0
  360. package/dist/learning/dream/dream-lock-retry.js +66 -0
  361. package/dist/learning/dream/speculative-dreamer.js +1 -1
  362. package/dist/learning/learning-retention.d.ts +103 -0
  363. package/dist/learning/learning-retention.js +213 -0
  364. package/dist/mcp/bundle.js +501 -496
  365. package/dist/mcp/handlers/domain-handler-configs.d.ts +9 -1
  366. package/dist/mcp/handlers/domain-handler-configs.js +24 -14
  367. package/dist/mcp/protocol-server.js +1 -1
  368. package/dist/mcp/tools/chaos-resilience/inject.d.ts +3 -4
  369. package/dist/mcp/tools/chaos-resilience/inject.js +11 -81
  370. package/dist/mcp/tools/learning-optimization/dream.d.ts +8 -0
  371. package/dist/mcp/tools/learning-optimization/dream.js +4 -0
  372. package/package.json +4 -2
  373. package/dist/cli/chunks/adapter-KCQDVYY2.js +0 -2
  374. package/dist/cli/chunks/agent-booster-wasm-6RRQWMNE.js +0 -2
  375. package/dist/cli/chunks/aqe-learning-engine-SAQOHSGN.js +0 -2
  376. package/dist/cli/chunks/base-WCACU3FN.js +0 -2
  377. package/dist/cli/chunks/brain-handler-GTQNHHZS.js +0 -94
  378. package/dist/cli/chunks/browser-workflow-G6IASEAP.js +0 -2
  379. package/dist/cli/chunks/chunk-C6JTLKG7.js +0 -141
  380. package/dist/cli/chunks/chunk-K65CGKLD.js +0 -8
  381. package/dist/cli/chunks/chunk-MB46UBGY.js +0 -3
  382. package/dist/cli/chunks/chunk-N4CYAKOX.js +0 -79
  383. package/dist/cli/chunks/chunk-PT4FMJPQ.js +0 -3
  384. package/dist/cli/chunks/chunk-S5AZCIZS.js +0 -2
  385. package/dist/cli/chunks/chunk-UT2VZ33P.js +0 -2
  386. package/dist/cli/chunks/client-TV3V2YZ5.js +0 -2
  387. package/dist/cli/chunks/core-handlers-PZT4OLWR.js +0 -2
  388. package/dist/cli/chunks/coverage-NV3C4IMM.js +0 -50
  389. package/dist/cli/chunks/cross-domain-router-QOFCZ7G4.js +0 -2
  390. package/dist/cli/chunks/dream-TRFBGDSQ.js +0 -2
  391. package/dist/cli/chunks/file-discovery-WCKGMSPZ.js +0 -2
  392. package/dist/cli/chunks/heartbeat-scheduler-P44A2OX3.js +0 -2
  393. package/dist/cli/chunks/hnsw-adapter-ZJQIQJKC.js +0 -2
  394. package/dist/cli/chunks/hnsw-index-HMG2GH3Z.js +0 -2
  395. package/dist/cli/chunks/hybrid-backend-B7M74PZG.js +0 -2
  396. package/dist/cli/chunks/impact-analyzer-PZYOVKQO.js +0 -2
  397. package/dist/cli/chunks/init-wizard-TZDJQK3U.js +0 -2
  398. package/dist/cli/chunks/kernel-Y6RRIOKW.js +0 -2
  399. package/dist/cli/chunks/knowledge-graph-BVD5Z66M.js +0 -2
  400. package/dist/cli/chunks/learning-6KDH7FK4.js +0 -122
  401. package/dist/cli/chunks/llm-router-service-KHCAMSUU.js +0 -2
  402. package/dist/cli/chunks/load-test-RUF7DZA5.js +0 -2
  403. package/dist/cli/chunks/memory-backend-7ZLFOVGG.js +0 -2
  404. package/dist/cli/chunks/pattern-null-store-RY6CVYHP.js +0 -2
  405. package/dist/cli/chunks/project-root-IO5KRNGL.js +0 -2
  406. package/dist/cli/chunks/protocol-executor-U2CUDWDE.js +0 -2
  407. package/dist/cli/chunks/qe-reasoning-bank-DQSSX2IP.js +0 -2
  408. package/dist/cli/chunks/queen-coordinator-6FN4BZIX.js +0 -2
  409. package/dist/cli/chunks/router-YUO3I7RU.js +0 -2
  410. package/dist/cli/chunks/routing-feedback-36SLQGJE.js +0 -2
  411. package/dist/cli/chunks/rvf-dual-writer-FRYZH3WZ.js +0 -2
  412. package/dist/cli/chunks/rvf-migration-adapter-XXNITL5I.js +0 -2
  413. package/dist/cli/chunks/rvf-native-adapter-D2WWKJIV.js +0 -2
  414. package/dist/cli/chunks/safe-db-4RRIGRXD.js +0 -2
  415. package/dist/cli/chunks/schedule-25RTO4DQ.js +0 -2
  416. package/dist/cli/chunks/scheduler-BPIOJZ5P.js +0 -2
  417. package/dist/cli/chunks/sqlite-persistence-EDF47DDX.js +0 -2
  418. package/dist/cli/chunks/test-runner-process-LEPF2OSS.js +0 -2
  419. package/dist/cli/chunks/tree-sitter-wasm-parser-TSZTCMFV.js +0 -2
  420. package/dist/cli/chunks/unified-memory-TLGSSLMI.js +0 -2
  421. package/dist/cli/chunks/unified-memory-hnsw-MSUR7ZOO.js +0 -2
  422. package/dist/cli/chunks/unified-persistence-VFFOTWK7.js +0 -2
  423. package/dist/cli/chunks/visual-security-6Q44XNLB.js +0 -2
  424. package/dist/cli/chunks/witness-chain-KDOMXDQX.js +0 -2
  425. package/dist/cli/chunks/witness-chain-N3OY2RMH.js +0 -2
  426. package/dist/cli/chunks/workflow-orchestrator-CVNNT2RJ.js +0 -2
@@ -84,6 +84,10 @@ export interface QualityAssessResult {
84
84
  * files (partial metrics). Such a score is not a verdict.
85
85
  */
86
86
  scoreBasis?: string[];
87
+ /** Why `qualityScore` is -1: the requested metrics that were unmeasured. */
88
+ qualityScoreReason?: string;
89
+ /** The score over the measured metrics (`scoreBasis`) when `qualityScore` is -1. Not a verdict. */
90
+ subsetScore?: number;
87
91
  /** #996: measured metrics that fail their own limit; any entry blocks. */
88
92
  measuredFailures?: MeasuredFailure[];
89
93
  /** #996: false for static analysis (runGate omitted/false) — no quality gate ran. */
@@ -160,13 +164,17 @@ export interface AccessibilityTestResult {
160
164
  }
161
165
  export interface ChaosTestResult {
162
166
  taskId: string;
167
+ /** #1258: 'not-executed' when no fault was injected, so nothing was observed. */
163
168
  status: string;
164
169
  faultType: string;
170
+ /** #1258: null when not measured; never a default recovered/dataLoss verdict. */
165
171
  resilience: {
166
172
  recovered: boolean;
167
173
  recoveryTime: number;
168
174
  dataLoss: boolean;
169
- };
175
+ } | null;
176
+ /** Why the fault was not executed, when status is 'not-executed'. */
177
+ note?: string;
170
178
  duration: number;
171
179
  savedFiles?: string[];
172
180
  /** #933: true when result files were written; see savedFiles for their paths. */
@@ -535,7 +535,7 @@ export const qualityAssessConfig = {
535
535
  passed: insufficient || failedMetrics.length > 0
536
536
  ? false
537
537
  : typeof data.passed === 'boolean' ? data.passed : undefined,
538
- qualityScore: measuredScore,
538
+ qualityScore: insufficient ? undefined : measuredScore,
539
539
  recommendations: data.recommendations || [],
540
540
  unmeasured: insufficient ? (unmeasured?.length ? unmeasured : ['unknown']) : [],
541
541
  failedMetrics,
@@ -545,7 +545,13 @@ export const qualityAssessConfig = {
545
545
  return {
546
546
  taskId,
547
547
  status: insufficient ? INSUFFICIENT_EVIDENCE : 'completed',
548
- ...(typeof data.qualityScore === 'number' ? { qualityScore: data.qualityScore } : {}),
548
+ // An insufficient-evidence result has no overall score (-1); a number
549
+ // from a producer that did not apply that rule is kept only as a subset.
550
+ ...(typeof data.qualityScore === 'number'
551
+ ? { qualityScore: insufficient && !Array.isArray(data.checks) ? -1 : data.qualityScore } : {}),
552
+ ...(typeof data.qualityScoreReason === 'string' ? { qualityScoreReason: data.qualityScoreReason } : {}),
553
+ ...(typeof data.subsetScore === 'number' ? { subsetScore: data.subsetScore }
554
+ : insufficient && measuredScore !== undefined && !Array.isArray(data.checks) ? { subsetScore: measuredScore } : {}),
549
555
  ...(Array.isArray(data.checks) ? { checks: data.checks } : {}),
550
556
  passed,
551
557
  metrics: data.metrics || {},
@@ -720,18 +726,22 @@ export const chaosTestConfig = {
720
726
  compiledContext: routingResult?.compiledContext,
721
727
  }),
722
728
  calculateTimeout: (params) => (params.duration || 30000) + 60000,
723
- mapToResult: (taskId, data, duration, savedFiles) => ({
724
- taskId,
725
- status: 'completed',
726
- faultType: data.faultType || 'latency',
727
- resilience: data.resilience || {
728
- recovered: false,
729
- recoveryTime: 0,
730
- dataLoss: false,
731
- },
732
- duration,
733
- savedFiles,
734
- }),
729
+ mapToResult: (taskId, data, duration, savedFiles) => {
730
+ // #1258: the run-chaos handler injects nothing and says so (systemBehavior
731
+ // 'not-executed', resilience null). Report that instead of 'completed' with
732
+ // a made-up recovered/dataLoss result.
733
+ const resilience = data.resilience ?? null;
734
+ const executed = data.systemBehavior !== 'not-executed' && resilience !== null;
735
+ return {
736
+ taskId,
737
+ status: executed ? 'completed' : 'not-executed',
738
+ faultType: data.faultType || 'latency',
739
+ resilience: executed ? resilience : null,
740
+ ...(typeof data.note === 'string' ? { note: data.note } : {}),
741
+ duration,
742
+ savedFiles,
743
+ };
744
+ },
735
745
  };
736
746
  // ============================================================================
737
747
  // Defect Prediction Configuration
@@ -990,7 +990,7 @@ export class MCPProtocolServer {
990
990
  this.registerTool({
991
991
  definition: {
992
992
  name: 'chaos_test',
993
- description: `Inject faults (latency, errors, CPU) for chaos engineering resilience testing. ${SAVE_RESULTS_HINT} Example: chaos_test({ faultType: "latency", target: "api-service" })`,
993
+ description: `Chaos resilience request; injects no faults itself (returns not-executed, null resilience, guidance). ${SAVE_RESULTS_HINT} Example: chaos_test({ faultType: "latency", target: "api-service" })`,
994
994
  category: 'domain',
995
995
  parameters: [
996
996
  { name: 'faultType', type: 'string', description: 'Type of fault to inject' },
@@ -28,8 +28,10 @@ export interface ChaosInjectResult {
28
28
  metrics: ExperimentMetrics;
29
29
  incidents: Incident[];
30
30
  recommendations: string[];
31
+ /** Why nothing was measured, when status is 'not-executed' (#1258). */
32
+ note?: string;
31
33
  }
32
- export type ExperimentStatus = 'pending' | 'running' | 'completed' | 'failed' | 'rolled-back' | 'aborted';
34
+ export type ExperimentStatus = 'pending' | 'running' | 'completed' | 'failed' | 'rolled-back' | 'aborted' | 'not-executed';
33
35
  export interface ExperimentMetrics {
34
36
  faultDuration: number;
35
37
  targetAffected: boolean;
@@ -51,11 +53,8 @@ export declare class ChaosInjectTool extends MCPToolBase<ChaosInjectParams, Chao
51
53
  execute(params: ChaosInjectParams, context: MCPToolContext): Promise<ToolResult<ChaosInjectResult>>;
52
54
  private buildExperiment;
53
55
  private buildFaultParameters;
54
- private simulateMetrics;
55
56
  private extractMetrics;
56
57
  private convertIncident;
57
- private collectIntensityIncidents;
58
- private validateHypothesisText;
59
58
  private generateRecommendations;
60
59
  }
61
60
  //# sourceMappingURL=inject.d.ts.map
@@ -71,11 +71,11 @@ export class ChaosInjectTool extends MCPToolBase {
71
71
  error: `Failed to create experiment: ${createResult.error.message}`,
72
72
  };
73
73
  }
74
- // Phase 3: Inject fault (or simulate in dry run)
74
+ // Phase 3: Inject fault (a dry run injects nothing)
75
75
  this.emitStream(context, {
76
76
  status: 'injecting',
77
77
  message: dryRun
78
- ? `[DRY RUN] Simulating ${faultType} fault`
78
+ ? `[DRY RUN] Planning ${faultType} fault (not injected)`
79
79
  : `Injecting ${faultType} fault`,
80
80
  });
81
81
  let faultInjected = false;
@@ -86,16 +86,15 @@ export class ChaosInjectTool extends MCPToolBase {
86
86
  faultDuration: duration,
87
87
  targetAffected: !dryRun,
88
88
  };
89
+ let note;
89
90
  if (dryRun) {
90
- // Dry run - simulate the fault injection
91
+ // #1258: a dry run injects nothing, so there are no metrics, incidents
92
+ // or hypothesis verdict to report. It used to return 'completed' with
93
+ // simulated recovery/latency numbers.
91
94
  faultInjected = false;
92
- status = 'completed';
93
- // Simulate metrics based on fault type
94
- metrics = this.simulateMetrics(faultType, duration, intensity);
95
- // Validate hypothesis if provided
96
- if (hypothesis) {
97
- hypothesisValidated = this.validateHypothesisText(hypothesis, metrics, incidents);
98
- }
95
+ status = 'not-executed';
96
+ note = `Dry run: the ${faultType} experiment was planned but no fault was injected, ` +
97
+ 'so no metrics were measured and the hypothesis was not tested.';
99
98
  }
100
99
  else {
101
100
  // Real execution - run the experiment
@@ -128,9 +127,6 @@ export class ChaosInjectTool extends MCPToolBase {
128
127
  status: 'monitoring',
129
128
  message: 'Monitoring system behavior',
130
129
  });
131
- // Collect any additional incidents based on intensity
132
- const intensityIncidents = this.collectIntensityIncidents(faultType, intensity, dryRun);
133
- incidents.push(...intensityIncidents);
134
130
  // Determine final status based on incidents
135
131
  if (!dryRun && incidents.some(i => i.severity === 'critical' && !i.resolved)) {
136
132
  status = rollbackOnFailure ? 'rolled-back' : 'failed';
@@ -153,6 +149,7 @@ export class ChaosInjectTool extends MCPToolBase {
153
149
  metrics,
154
150
  incidents,
155
151
  recommendations,
152
+ ...(note ? { note } : {}),
156
153
  },
157
154
  };
158
155
  }
@@ -275,27 +272,6 @@ export class ChaosInjectTool extends MCPToolBase {
275
272
  }
276
273
  return params;
277
274
  }
278
- simulateMetrics(faultType, duration, intensity) {
279
- const metrics = {
280
- faultDuration: duration,
281
- targetAffected: false,
282
- recoveryTime: 5000 + (intensity * 100), // Base recovery + intensity factor
283
- };
284
- switch (faultType) {
285
- case 'latency':
286
- metrics.latencyP99 = 100 + (intensity * 25); // Base + intensity factor
287
- break;
288
- case 'error':
289
- case 'timeout':
290
- metrics.errorRate = intensity * 0.5; // Half of intensity as error rate
291
- break;
292
- case 'cpu-stress':
293
- case 'memory-stress':
294
- metrics.recoveryTime = 10000 + (intensity * 200);
295
- break;
296
- }
297
- return metrics;
298
- }
299
275
  extractMetrics(result, faultType, duration) {
300
276
  const metrics = {
301
277
  faultDuration: duration,
@@ -330,52 +306,6 @@ export class ChaosInjectTool extends MCPToolBase {
330
306
  resolved: incident.resolved,
331
307
  };
332
308
  }
333
- collectIntensityIncidents(faultType, intensity, dryRun) {
334
- const incidents = [];
335
- if (dryRun) {
336
- // In dry run, simulate what incidents might occur
337
- if (intensity > 70) {
338
- incidents.push({
339
- type: 'alert',
340
- severity: 'high',
341
- message: `[Simulated] High ${faultType} impact would be detected`,
342
- timestamp: new Date().toISOString(),
343
- resolved: true,
344
- });
345
- }
346
- if (intensity > 90) {
347
- incidents.push({
348
- type: 'degradation',
349
- severity: 'critical',
350
- message: '[Simulated] Service degradation would occur',
351
- timestamp: new Date().toISOString(),
352
- resolved: true,
353
- });
354
- }
355
- }
356
- return incidents;
357
- }
358
- validateHypothesisText(hypothesis, metrics, incidents) {
359
- const hypothesisLower = hypothesis.toLowerCase();
360
- // Check recovery time hypothesis
361
- if (hypothesisLower.includes('recover') && metrics.recoveryTime) {
362
- const timeMatch = hypothesis.match(/(\d+)s/);
363
- if (timeMatch) {
364
- const expectedTime = parseInt(timeMatch[1]) * 1000;
365
- return metrics.recoveryTime <= expectedTime;
366
- }
367
- }
368
- // Check no critical incidents hypothesis
369
- if (hypothesisLower.includes('no critical')) {
370
- return !incidents.some(i => i.severity === 'critical' && !i.resolved);
371
- }
372
- // Check stable hypothesis
373
- if (hypothesisLower.includes('stable') || hypothesisLower.includes('remain')) {
374
- return !incidents.some(i => i.severity === 'critical' && !i.resolved);
375
- }
376
- // Default: validated if no unresolved critical incidents
377
- return !incidents.some(i => i.severity === 'critical' && !i.resolved);
378
- }
379
309
  generateRecommendations(faultType, metrics, incidents, hypothesisValidated) {
380
310
  const recs = [];
381
311
  if (hypothesisValidated === false) {
@@ -447,7 +377,7 @@ const CHAOS_INJECT_SCHEMA = {
447
377
  },
448
378
  dryRun: {
449
379
  type: 'boolean',
450
- description: 'Simulate without actual injection',
380
+ description: 'Plan the experiment without injecting a fault; nothing is measured',
451
381
  default: true,
452
382
  },
453
383
  hypothesis: {
@@ -54,6 +54,14 @@ export interface DreamResultSummary {
54
54
  patternsCreated: number;
55
55
  /** #1060: how long the dream's single commit transaction held the write lock, in ms */
56
56
  commitDurationMs?: number;
57
+ /**
58
+ * #1239: dream retention after the commit. enabled=false (the default,
59
+ * AQE_DREAM_RETENTION) means nothing was deleted and `steps` say what would be.
60
+ */
61
+ retention?: {
62
+ enabled: boolean;
63
+ steps: string[];
64
+ };
57
65
  }
58
66
  export interface InsightSummary {
59
67
  id: string;
@@ -14,6 +14,7 @@
14
14
  import { MCPToolBase, getSharedMemoryBackend } from '../base.js';
15
15
  import { createDreamEngine, } from '../../../learning/dream/index.js';
16
16
  import { DreamAlreadyRunningError } from '../../../learning/dream/dream-engine.js';
17
+ import { describeDreamRetention } from '../../../learning/learning-retention.js';
17
18
  import { createQEReasoningBank } from '../../../learning/qe-reasoning-bank.js';
18
19
  import { toErrorMessage } from '../../../shared/error-utils.js';
19
20
  // ============================================================================
@@ -218,6 +219,9 @@ export class DreamCycleTool extends MCPToolBase {
218
219
  activationStats: result.activationStats,
219
220
  patternsCreated: result.patternsCreated,
220
221
  commitDurationMs: result.commitDurationMs,
222
+ retention: result.retention
223
+ ? { enabled: result.retention.enabled, steps: describeDreamRetention(result.retention) }
224
+ : undefined,
221
225
  };
222
226
  const insights = result.insights.map((i) => ({
223
227
  id: i.id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-qe",
3
- "version": "3.15.13",
3
+ "version": "3.15.15",
4
4
  "description": "Agentic Quality Engineering V3 - Domain-Driven Design Architecture with 13 Bounded Contexts, O(log n) coverage analysis, ReasoningBank learning, 60 specialized QE agents, mathematical Coherence verification, deep Claude Flow integration",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -68,8 +68,9 @@
68
68
  "scripts": {
69
69
  "preinstall": "node scripts/preinstall.cjs || true",
70
70
  "postinstall": "node scripts/postinstall.cjs",
71
- "build": "tsc && npm run build:esm && npm run build:cli && npm run build:mcp",
71
+ "build": "tsc && npm run build:esm && npm run build:wasm-assets && npm run build:cli && npm run build:mcp",
72
72
  "build:esm": "node scripts/fix-esm-specifiers.mjs",
73
+ "build:wasm-assets": "node scripts/copy-wasm-assets.mjs",
73
74
  "build:cli": "node scripts/build-cli.mjs",
74
75
  "build:mcp": "node scripts/build-mcp.mjs",
75
76
  "prepublishOnly": "node scripts/sync-agents.cjs && node scripts/prepare-assets.cjs",
@@ -301,6 +302,7 @@
301
302
  "dist/**/*.d.ts",
302
303
  "dist/**/*.json",
303
304
  "dist/**/*.node",
305
+ "dist/**/*.wasm",
304
306
  "assets/**",
305
307
  "schemas/**",
306
308
  "scripts/postinstall.cjs",
@@ -1,2 +0,0 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.13");process.exit(0)}
2
- import{a,b,c}from"./chunk-75RDHBAX.js";import"./chunk-32ZMWEP3.js";import"./chunk-R7SYRCRP.js";import"./chunk-VTOBUZL6.js";import"./chunk-3Y2ROSCL.js";import"./chunk-ZAKQLAHT.js";export{a as AgentBoosterAdapter,b as createAgentBoosterAdapter,c as createAgentBoosterAdapterSync};
@@ -1,2 +0,0 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.13");process.exit(0)}
2
- import{a as x}from"./chunk-UT2VZ33P.js";import{c as f}from"./chunk-GB6HBNH2.js";import"./chunk-UOC3O6RP.js";import"./chunk-NT4DBXSX.js";import"./chunk-ZAKQLAHT.js";x();import{createRequire as w}from"module";var S=f.create("agent-booster-wasm"),t={JavaScript:0,TypeScript:1,Python:2,Rust:3,Go:4,Java:5,C:6,Cpp:7},l={ExactReplace:0,FuzzyReplace:1,InsertAfter:2,InsertBefore:3,Append:4},v={0:"JavaScript",1:"TypeScript",2:"Python",3:"Rust",4:"Go",5:"Java",6:"C",7:"Cpp"},a=null,u=null,p=null;async function g(){if(a)return!0;if(p)return!1;try{if(a=w(import.meta.url)("./agent_booster_wasm.js"),!a)throw new Error("WASM module loaded but is null");return u=new a.AgentBoosterWasm,!0}catch(e){return p=e,console.warn("[AgentBoosterWASM] Failed to load WASM module:",e),!1}}function A(e){return{".js":t.JavaScript,".mjs":t.JavaScript,".cjs":t.JavaScript,".jsx":t.JavaScript,".ts":t.TypeScript,".tsx":t.TypeScript,".mts":t.TypeScript,".cts":t.TypeScript,".py":t.Python,".rs":t.Rust,".go":t.Go,".java":t.Java,".c":t.C,".h":t.C,".cpp":t.Cpp,".cc":t.Cpp,".cxx":t.Cpp,".hpp":t.Cpp}[e.toLowerCase()]??t.JavaScript}var M=[{name:"var-to-const",detect:(e,r)=>e.includes("var ")&&r.includes("const "),apply:(e,r)=>e.replace(/\bvar\s+/g,"const ")},{name:"var-to-let",detect:(e,r)=>e.includes("var ")&&r.includes("let "),apply:(e,r)=>e.replace(/\bvar\s+/g,"let ")},{name:"add-types-function",detect:(e,r)=>e.includes("function")&&!e.includes(":")&&r.includes(":"),apply:(e,r)=>r},{name:"async-wrapper",detect:(e,r)=>!e.includes("async")&&r.includes("async")&&r.includes("await"),apply:(e,r)=>r},{name:"try-catch-wrapper",detect:(e,r)=>!e.includes("try {")&&r.includes("try {"),apply:(e,r)=>r},{name:"null-check",detect:(e,r)=>!e.includes("if (!")&&!e.includes("if (!")&&(r.includes("if (!")||r.includes("?.")),apply:(e,r)=>r},{name:"test-assertion",detect:(e,r)=>e.includes("test(")&&!e.includes("expect(")&&r.includes("expect("),apply:(e,r)=>r}];function y(e,r){for(let n of M)if(n.detect(e,r))try{return{success:!0,code:n.apply(e,r),pattern:n.name}}catch(s){S.debug("Pattern transform failed, trying next",{pattern:n.name,error:s instanceof Error?s.message:String(s)});continue}return{success:!1,code:r}}async function b(e,r,n,s={}){let o=performance.now(),{confidenceThreshold:T=.5,allowFallback:d=!0}=s;if(!e.trim())return{success:!0,mergedCode:r,confidence:1,strategy:l.Append,syntaxValid:!0,source:"fallback",latencyMs:performance.now()-o};if(await g()&&u&&a)try{let c=a.WasmLanguage[v[n]],i=u.apply_edit(e,r,c);return{success:!0,mergedCode:i.merged_code,confidence:i.confidence,strategy:i.strategy,syntaxValid:i.syntax_valid,source:"wasm",latencyMs:performance.now()-o}}catch(c){let i=c;if(d){let m=y(e,r);if(m.success)return{success:!0,mergedCode:m.code,confidence:.7,strategy:l.FuzzyReplace,syntaxValid:!0,source:"pattern",latencyMs:performance.now()-o}}return{success:!1,mergedCode:r,confidence:0,strategy:l.Append,syntaxValid:!1,source:"fallback",latencyMs:performance.now()-o,error:i.message}}if(d){let c=y(e,r);return{success:c.success,mergedCode:c.code,confidence:c.success?.7:0,strategy:l.FuzzyReplace,syntaxValid:!0,source:"pattern",latencyMs:performance.now()-o}}return{success:!1,mergedCode:r,confidence:0,strategy:l.Append,syntaxValid:!1,source:"fallback",latencyMs:performance.now()-o,error:p?.message??"WASM not available"}}async function W(e,r={}){return Promise.all(e.map(({original:n,edit:s,language:o})=>b(n,s,o,r)))}async function C(){return g()}async function L(){return await g()&&a?a.AgentBoosterWasm.version():"unavailable"}async function R(){if(await g(),u&&a)try{u.apply_edit("function x() {}","function x() {}",a.WasmLanguage.JavaScript)}catch(e){console.debug("[AgentBoosterWASM] Warmup error:",e instanceof Error?e.message:e)}}var _={transform:b,batchTransform:W,isWasmAvailable:C,getVersion:L,warmup:R,Language:t,MergeStrategy:l,languageFromExtension:A};export{t as Language,l as MergeStrategy,W as batchTransform,_ as default,L as getVersion,C as isWasmAvailable,A as languageFromExtension,b as transform,R as warmup};
@@ -1,2 +0,0 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.13");process.exit(0)}
2
- import{a,b,c,d,e,f}from"./chunk-3AN5TNGD.js";import"./chunk-3YNLWPBF.js";import"./chunk-72ASBE35.js";import"./chunk-TSQC2KKZ.js";import"./chunk-SYV2V3PL.js";import"./chunk-NZD4DPSU.js";import"./chunk-E7CLYGS7.js";import"./chunk-GU5HNCWI.js";import"./chunk-5VMAV6T6.js";import"./chunk-TWJTK4CC.js";import"./chunk-GHM6MQNK.js";import"./chunk-XEAEYC6Y.js";import"./chunk-QDEJ4CI2.js";import"./chunk-VRVMIPTM.js";import"./chunk-4OVC4RIL.js";import"./chunk-UTRV7T2N.js";import"./chunk-3Y7TJFHU.js";import"./chunk-7CMTY45A.js";import"./chunk-VTOBUZL6.js";import"./chunk-KDNJ4F3P.js";import"./chunk-JRRXCODW.js";import"./chunk-XNBOGCF3.js";import"./chunk-KV4T4MXK.js";import"./chunk-TWDW32W2.js";import"./chunk-AQSVJNEH.js";import"./chunk-OCAEXYFA.js";import"./chunk-WKGTGOYS.js";import"./chunk-DVGRPK7A.js";import"./chunk-H4H2YSFH.js";import"./chunk-NURIILUB.js";import"./chunk-TOQWL2ZF.js";import"./chunk-UT2VZ33P.js";import"./chunk-GB6HBNH2.js";import"./chunk-UOC3O6RP.js";import"./chunk-NT4DBXSX.js";import"./chunk-WOCGL4QP.js";import"./chunk-W2QWSQVE.js";import"./chunk-J2ZIFFM6.js";import"./chunk-RF7HWBHN.js";import"./chunk-IC3TQEOA.js";import"./chunk-HD7YIFOI.js";import"./chunk-DNDL7SOS.js";import"./chunk-3Y2ROSCL.js";import"./chunk-WO274FRI.js";import"./chunk-ZAKQLAHT.js";export{b as AQELearningEngine,a as DEFAULT_ENGINE_CONFIG,c as DEFAULT_META_LEARNING_CONFIG,d as MetaLearningEngine,e as createAQELearningEngine,f as createDefaultLearningEngine};
@@ -1,2 +0,0 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.13");process.exit(0)}
2
- import{a,b,c,d,e,f,g,h,i,j,k,l}from"./chunk-UXZSUMEA.js";import"./chunk-6KATY3KS.js";import"./chunk-LWR3FV3Y.js";import"./chunk-3Y7TJFHU.js";import"./chunk-7CMTY45A.js";import"./chunk-VTOBUZL6.js";import"./chunk-KDNJ4F3P.js";import"./chunk-JRRXCODW.js";import"./chunk-XNBOGCF3.js";import"./chunk-KV4T4MXK.js";import"./chunk-TWDW32W2.js";import"./chunk-AQSVJNEH.js";import"./chunk-OCAEXYFA.js";import"./chunk-DVGRPK7A.js";import"./chunk-H4H2YSFH.js";import"./chunk-TOQWL2ZF.js";import"./chunk-UT2VZ33P.js";import"./chunk-GB6HBNH2.js";import"./chunk-UOC3O6RP.js";import"./chunk-NT4DBXSX.js";import"./chunk-WOCGL4QP.js";import"./chunk-J2ZIFFM6.js";import"./chunk-RF7HWBHN.js";import"./chunk-DNDL7SOS.js";import"./chunk-3Y2ROSCL.js";import"./chunk-WO274FRI.js";import"./chunk-ZAKQLAHT.js";export{l as MCPToolBase,k as defaultToolLogger,j as getKernel,i as getLLMRouter,e as getMemoryBackend,g as getSharedLLMRouter,c as getSharedMemoryBackend,a as isMemoryOnlyMode,b as registerRvfResetFn,h as resetSharedLLMRouter,d as resetSharedMemoryBackend,f as setSharedLLMRouter};
@@ -1,94 +0,0 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.13");process.exit(0)}
2
- import{a as L,b as z,c as K,d as _,e as ie,f as W,g as G,h as A,i as Ce,j as se,k as Q,l as xe,m as J,n as le,o as Ie,p as P,q as Y,r as X,s as Z,t as ee}from"./chunk-BK577VL7.js";import{c as Ee}from"./chunk-TWJTK4CC.js";import{b as ve}from"./chunk-GHM6MQNK.js";import{a as Se,d as ae,e as _e}from"./chunk-XEAEYC6Y.js";import"./chunk-3Y7TJFHU.js";import"./chunk-7CMTY45A.js";import{b as k,d as oe}from"./chunk-VTOBUZL6.js";import"./chunk-KDNJ4F3P.js";import"./chunk-JRRXCODW.js";import"./chunk-XNBOGCF3.js";import"./chunk-KV4T4MXK.js";import"./chunk-TWDW32W2.js";import"./chunk-AQSVJNEH.js";import"./chunk-OCAEXYFA.js";import"./chunk-DVGRPK7A.js";import"./chunk-TOQWL2ZF.js";import"./chunk-UT2VZ33P.js";import"./chunk-GB6HBNH2.js";import"./chunk-UOC3O6RP.js";import"./chunk-NT4DBXSX.js";import"./chunk-WOCGL4QP.js";import"./chunk-J2ZIFFM6.js";import"./chunk-RF7HWBHN.js";import{a as we,b as Re,c as H,d as V,f as nn}from"./chunk-HD7YIFOI.js";import{d as F,e as tn}from"./chunk-DNDL7SOS.js";import"./chunk-3Y2ROSCL.js";import"./chunk-WO274FRI.js";import"./chunk-ZAKQLAHT.js";import $ from"path";import o from"chalk";tn();oe();import{existsSync as te,mkdirSync as rn,writeFileSync as on,readFileSync as ce}from"fs";import{join as D,resolve as de}from"path";function ne(e,n){let r="shake256",t=JSON.stringify(n),a=e.prepare("SELECT * FROM witness_chain ORDER BY id DESC LIMIT 1").get(),i=a?ae(r,_e(a)):Se;e.prepare(`
3
- INSERT INTO witness_chain
4
- (prev_hash, action_hash, action_type, action_data, timestamp, actor, hash_algo)
5
- VALUES (?, ?, 'BRAIN_IMPORT', ?, ?, 'brain-import', ?)
6
- `).run(i,ae(r,t),t,new Date().toISOString(),r)}var an={rl_q_values:"includeQValues",dream_insights:"includeDreamInsights",dream_cycles:"includeDreamInsights",witness_chain:"includeWitnessChain",vectors:"includeVectors"};function sn(e,n){let r=an[e.tableName];return!(r&&n[r]===!1)}var ln=1e4;function cn(e,n,r,t){if(!sn(n,r))return le(D(t,n.fileName),[]),{count:0,rows:[]};let[a,i]=n.domainColumn?J(r.domains,n.domainColumn):[void 0,[]];if(r.domains&&r.domains.length>0&&!n.domainColumn){let s=r.domains.map(()=>"?").join(","),d=`manifest_id IN (SELECT id FROM learning_evidence_manifests WHERE task_family IN (${s}))`;["learning_evidence_segments","learning_segment_edges","learning_evidence_admissions"].includes(n.tableName)?(a=d,i=[...r.domains]):["pattern_manifest_lineage","pattern_segment_lineage"].includes(n.tableName)&&(a=`${d} AND pattern_id IN (SELECT id FROM qe_patterns WHERE qe_domain IN (${s}))`,i=[...r.domains,...r.domains])}if(se(e,n.tableName,a,i)>=ln){let s=n.blobColumns,d=s&&s.length>0?y=>W(y,s):void 0;return{count:Ie(D(t,n.fileName),xe(e,n.tableName,a,i),d)}}let l=Q(e,n.tableName,a,i);return n.blobColumns&&n.blobColumns.length>0&&(l=l.map(s=>W(s,n.blobColumns))),le(D(t,n.fileName),l),{count:l.length,rows:l}}function Be(e){let n=[];for(let r of _){let t=D(e,r.fileName);te(t)?n.push(A(ce(t,"utf-8"))):n.push(A(""))}return A(n.join(":"))}function Oe(e,n,r="memory.db"){let t=de(n.outputPath);te(t)||rn(t,{recursive:!0});let a=0,i={},c=new Set;for(let f of _){let y=cn(e,f,n,t);if(i[f.tableName]=y.count,a+=y.count,f.tableName==="qe_patterns"){if(y.rows)for(let h of y.rows)h.qe_domain&&c.add(h.qe_domain);else if(y.count>0){let[h,E]=f.domainColumn?J(n.domains,f.domainColumn):[void 0,[]],u=`SELECT DISTINCT qe_domain FROM qe_patterns ${h?`WHERE ${h} AND qe_domain IS NOT NULL`:"WHERE qe_domain IS NOT NULL"}`;try{let R=e.prepare(u).all(...E||[]);for(let g of R)c.add(g.qe_domain)}catch{}}}}let l=n.includeVectors!==!1?se(e,"vectors"):0,s=Be(t),d={version:"3.0",exportedAt:new Date().toISOString(),sourceDb:r,stats:{patternCount:i.qe_patterns||0,vectorCount:l,qValueCount:i.rl_q_values||0,dreamInsightCount:i.dream_insights||0,witnessChainLength:i.witness_chain||0,totalRecords:a},domains:[...c].sort(),checksum:s,tableRecordCounts:i};return on(D(t,"manifest.json"),JSON.stringify(d,null,2),"utf-8"),d}var dn=new Set(["qe_patterns","rl_q_values","dream_insights","witness_chain"]);function fn(e){return e==="1.0"?_.filter(n=>dn.has(n.tableName)):e==="3.0"?_:(console.warn(`[brain-import] Unknown manifest version '${e}'. Attempting full import \u2014 some files may be missing.`),_)}function Ae(e,n,r){let t=de(n),a=D(t,"manifest.json");if(!te(a))throw new Error(`Manifest not found at ${a}`);let i=k(ce(a,"utf-8")),c=Be(t);if(c!==i.checksum)throw new Error(`Checksum mismatch: expected ${i.checksum}, got ${c}. The export may have been tampered with or corrupted.`);let l=fn(i.version),s=0,d=0,f=0,y=()=>{let h=new Map,E=new Map,m=0;for(let u of l){let R=D(t,u.fileName),g=P(R,k);if(u.tableName==="witness_chain"){m+=g.length,d+=g.length;continue}u.blobColumns&&u.blobColumns.length>0&&(g=g.map(b=>G(b,u.blobColumns)));for(let b of g){let O=Y(b,h),x;if(u.dedupColumns&&u.dedupColumns.length>0)x=Z(e,u.tableName,O,u.dedupColumns,u.preserveId);else{let N=L[u.tableName]||"id",I=K[u.tableName],p=z[u.tableName];x=X(e,u.tableName,O,N,r.mergeStrategy,I,p,h,E,b.pattern_id)}s+=x.imported,d+=x.skipped,f+=x.conflicts}}ne(e,{sourceChecksum:i.checksum,sourceWitnessRows:m,importedRecords:s,skippedRecords:d,conflicts:f}),s+=1};return ee(e,r.dryRun??!1,y),{imported:s,skipped:d,conflicts:f}}function Ne(e){let n=de(e),r=D(n,"manifest.json");if(!te(r))throw new Error(`Manifest not found at ${r}`);return k(ce(r,"utf-8"))}nn();import{existsSync as j,readdirSync as mn,renameSync as un,statSync as pn,unlinkSync as fe,writeFileSync as gn}from"fs";import{basename as yn,dirname as hn,join as bn,resolve as re}from"path";var De=["",".idmap.json",".manifest.json"],wn=[...De,".lock"];function ke(e){for(let n of wn)try{let r=`${e}${n}`;j(r)&&fe(r)}catch{}}function Rn(e){let n=hn(e),r=`${yn(e)}.tmp.`,t;try{t=mn(n)}catch{return}for(let a of t){if(!a.startsWith(r))continue;let i=Number.parseInt(a.slice(r.length).split(".")[0],10);if(!(!Number.isInteger(i)||i<=0)&&!(i!==process.pid&&vn(i)))try{fe(bn(n,a))}catch{}}}function vn(e){try{return process.kill(e,0),!0}catch(n){return n.code==="EPERM"}}function $e(e,n,r="memory.db"){if(!V())throw new Error("@ruvector/rvf-node is not available. Install it or use --format jsonl instead.");let t=re(n.outputPath),a=n.dimension??384,i=`${t}.tmp.${process.pid}`;Rn(t),ke(i);let c=we(i,a),l=!1;try{let s={},d=new Set,f=0;for(let p of _){let[S,w]=p.domainColumn?J(n.domains,p.domainColumn):[void 0,[]],C=Q(e,p.tableName,S,w);if(n.domains&&n.domains.length>0){let v=new Set((s.learning_evidence_manifests??[]).map(B=>B.id)),q=new Set((s.qe_patterns??[]).map(B=>B.id));["learning_evidence_segments","learning_segment_edges","learning_evidence_admissions"].includes(p.tableName)?C=C.filter(B=>v.has(B.manifest_id)):p.tableName==="pattern_manifest_lineage"?C=C.filter(B=>{let T=B;return v.has(T.manifest_id)&&q.has(T.pattern_id)}):p.tableName==="pattern_segment_lineage"&&(C=C.filter(B=>{let T=B;return v.has(T.manifest_id)&&q.has(T.pattern_id)}))}if(p.tableName==="qe_patterns")for(let v of C)v.qe_domain&&d.add(v.qe_domain);let M=ie[p.tableName];M&&M.length>0&&(C=C.map(v=>W(v,M))),s[p.tableName]=C,f+=C.length}let y=0,h=[];if(Ce(e,"qe_pattern_embeddings")){let p=e.prepare("PRAGMA table_info('qe_pattern_embeddings')").all().some(w=>w.name==="space_id"),S=e.prepare(`SELECT pattern_id, embedding, dimension, ${p?"space_id":"NULL"} AS space_id
7
- FROM qe_pattern_embeddings`).all();for(let w of S)w.embedding&&w.dimension===a&&w.space_id&&h.push({id:`pe:${w.pattern_id}`,vector:new Float32Array(w.embedding.buffer,w.embedding.byteOffset,a),metadata:{tableName:"qe_pattern_embeddings",spaceId:w.space_id}})}h.length>0&&(y=c.ingest(h).accepted);let E={version:"3.0",format:"rvf",exportedAt:new Date().toISOString(),sourceDb:r,domains:[...d].sort(),tables:s},m=JSON.stringify(E),u=A(m),R=Buffer.from(m);c.embedKernel(R);let g=n.sign?c.sign(R)??void 0:void 0,b=g?n.signerKeyId??"default":void 0,O=c.fileId(),x=O?{fileId:O,parentId:c.parentId(),lineageDepth:c.lineageDepth()}:void 0,N=c.status(),I={version:"3.0",format:"rvf",exportedAt:E.exportedAt,sourceDb:r,stats:{patternCount:(s.qe_patterns||[]).length,embeddingCount:y,qValueCount:(s.rl_q_values||[]).length,dreamInsightCount:(s.dream_insights||[]).length,witnessChainLength:(s.witness_chain||[]).length,totalRecords:f,tableCounts:Object.fromEntries(_.map(({tableName:p})=>[p,s[p]?.length??0]))},domains:E.domains,checksum:u,rvfStatus:{totalVectors:N.totalVectors,totalSegments:N.totalSegments,fileSizeBytes:N.fileSizeBytes},...g?{signature:g,signerKeyId:b}:{},...x?{lineage:x}:{}};if(g)try{c.freeze()}catch{}if(gn(`${i}.manifest.json`,JSON.stringify(I,null,2),"utf-8"),c.close(),l=!0,j(t)&&!n.allowOverwriteRicher){let p;try{p=U(t)}catch(S){if(Sn(t)||!_n(S)){let w=S instanceof Error?S.message:String(S);throw new Error(`RVF_MIRROR_INSPECTION_AMBIGUOUS: the existing mirror is readable but its richness could not be established (${w}). Preserve/import it before retrying, or repeat with --force-overwrite-richer after preserving a backup.`)}}if(p){let S=p.stats.tableCounts,w=I.stats.tableCounts,C=_.map(({tableName:v})=>v).filter(v=>!S||!Number.isSafeInteger(S[v]));if(C.length>0)throw new Error(`RVF_MIRROR_INSPECTION_AMBIGUOUS: existing mirror lacks trustworthy counts for ${C.join(", ")}. Preserve/import it before retrying, or repeat with --force-overwrite-richer after preserving a backup.`);let M=_.map(({tableName:v})=>({tableName:v,existing:S[v],candidate:w[v]})).filter(({existing:v,candidate:q})=>v>q);if(M.length>0){let v=M.map(({tableName:q,existing:B,candidate:T})=>`${q} ${B} -> ${T}`).join(", ");throw new Error(`RVF_MIRROR_RICHER: refusing to replace richer mirrored tables: ${v}. Restore/import the mirror first, or repeat with --force-overwrite-richer after preserving a backup.`)}}}for(let p of[...De].reverse()){let S=`${i}${p}`,w=`${t}${p}`;j(S)?un(S,w):j(w)&&fe(w)}return I}catch(s){if(!l)try{c.close()}catch{}throw ke(i),s}}function Sn(e){let n;try{return n=H(re(e)),!!n.extractKernel()?.image}catch{return!1}finally{try{n?.close()}catch{}}}function _n(e){let n=e instanceof Error?e.message:String(e);return/ManifestNotFound|InvalidMagic|ChecksumMismatch|CorruptStore/i.test(n)}var En={patterns:"qe_patterns",qValues:"rl_q_values",dreamInsights:"dream_insights",witnessChain:"witness_chain"};function Te(e,n,r){if(!V())throw new Error("@ruvector/rvf-node is not available. Install it or use JSONL format.");let t=re(n);if(!j(t))throw new Error(`RVF file not found: ${t}`);let a=r.dryRun?H(t):Re(t);try{let i=a.verifyWitness();if(!i.valid&&(i.totalEntries>0||i.errors.length>0)){let m=i.errors.length>0?i.errors.join("; "):"unknown integrity error";throw new Error(`RVF witness verification failed: ${m}`)}let c=a.extractKernel();if(!c||!c.image)throw new Error("No brain data found in RVF file (missing kernel segment)");let l;try{l=JSON.parse(c.image.toString("utf-8"))}catch(m){throw new Error(`Failed to parse brain kernel data as JSON: ${m instanceof Error?m.message:m}`)}let s=0,d=0,f=0,y=0,h={};if(l.tables)Object.assign(h,l.tables);else for(let[m,u]of Object.entries(En)){let R=l[m];Array.isArray(R)&&(h[u]=R)}let E=()=>{let m=new Map,u=new Map,R=0;for(let g of _){let b=h[g.tableName];if(!b||!Array.isArray(b))continue;if(g.tableName==="witness_chain"){R+=b.length,d+=b.length;continue}let O=ie[g.tableName];O&&O.length>0&&(b=b.map(x=>G(x,O)));for(let x of b){let N=Y(x,m),I;if(g.dedupColumns&&g.dedupColumns.length>0)I=Z(e,g.tableName,N,g.dedupColumns,g.preserveId);else{let p=L[g.tableName]||"id",S=K[g.tableName],w=z[g.tableName];I=X(e,g.tableName,N,p,r.mergeStrategy,S,w,m,u,x.pattern_id)}if(I.imported)for(let p of O??[])N[p]instanceof Buffer&&y++;s+=I.imported,d+=I.skipped,f+=I.conflicts}}ne(e,{sourceChecksum:A(c.image.toString("utf-8")),sourceWitnessRows:R,importedRecords:s,skippedRecords:d,conflicts:f}),s+=1};if(ee(e,r.dryRun??!1,E),!r.dryRun&&f>0)try{a.compact()}catch{}return{imported:s,skipped:d,conflicts:f,embeddingsRestored:y}}finally{a.close()}}function U(e){if(!V())throw new Error("@ruvector/rvf-node is not available.");let n=re(e);if(!j(n))throw new Error(`RVF file not found: ${n}`);let r=H(n);try{let t=r.extractKernel();if(!t||!t.image)throw new Error("No brain data found in RVF file");let a=t.image.toString("utf-8"),i;try{i=JSON.parse(a)}catch(m){throw new Error(`Failed to parse brain kernel data as JSON: ${m instanceof Error?m.message:m}`)}let c=r.status(),l=pn(n).size,s=i.tables,d=s?s.qe_patterns?.length??0:i.patterns?.length??0,f=s?s.rl_q_values?.length??0:i.qValues?.length??0,y=s?s.dream_insights?.length??0:i.dreamInsights?.length??0,h=s?s.witness_chain?.length??0:i.witnessChain?.length??0,E=s&&typeof s=="object"&&!Array.isArray(s)?Object.fromEntries(Object.entries(s).filter(m=>Array.isArray(m[1])).map(([m,u])=>[m,u.length])):void 0;return{version:"3.0",format:"rvf",exportedAt:i.exportedAt??"unknown",sourceDb:i.sourceDb??"unknown",stats:{patternCount:d,embeddingCount:c.totalVectors,qValueCount:f,dreamInsightCount:y,witnessChainLength:h,...E?{tableCounts:E}:{}},domains:i.domains??[],checksum:A(a),rvfStatus:{totalVectors:c.totalVectors,totalSegments:c.totalSegments,fileSizeBytes:l}}}finally{r.close()}}function me(){return V()}oe();import{existsSync as pe,readFileSync as Cn,statSync as xn}from"fs";import{join as ue,resolve as Me}from"path";function Pe(e,n,r={}){let t=Me(e),a=Me(n),i=qe(t),c=qe(a),l=Fe(t,i),s=Fe(a,c),d=i==="jsonl"&&c==="jsonl",f=On({pathA:t,pathB:a,manifestA:l,manifestB:s,recordLevel:d,tableFilter:r.tableFilter,maxIdsPerBucket:r.maxIdsPerBucket??500}),y=new Set(l.domains),h=new Set(s.domains),E=l.domains.filter(b=>!h.has(b)),m=s.domains.filter(b=>!y.has(b)),u=l.checksum===s.checksum,R=l.version===s.version,g=u&&R&&f.every(b=>b.delta===0&&(b.added?.length??0)===0&&(b.removed?.length??0)===0&&(b.changed?.length??0)===0);return{pathA:t,pathB:a,formatA:i,formatB:c,manifestA:l,manifestB:s,checksumMatch:u,versionMatch:R,identical:g,recordLevel:d,tableDiffs:f,domainsOnlyInA:E,domainsOnlyInB:m}}function qe(e){if(!pe(e))throw new Error(`Path not found: ${e}`);if(e.endsWith(".rvf"))return"rvf";if(xn(e).isFile())throw new Error(`Unsupported brain export: ${e} (expected a .rvf file or a JSONL directory)`);return"jsonl"}function Fe(e,n){return n==="rvf"?Bn(e):In(e)}function In(e){let n=ue(e,"manifest.json");if(!pe(n))throw new Error(`Manifest not found at ${n}`);let r=k(Cn(n,"utf-8"));return je(r,"jsonl")}function Bn(e){let n=U(e);return je(n,"rvf")}function je(e,n){return{format:n,version:e.version??"unknown",exportedAt:e.exportedAt??"unknown",sourceDb:e.sourceDb??"unknown",checksum:e.checksum??"",totalRecords:e.stats?.totalRecords??0,domains:e.domains??[],tableRecordCounts:e.tableRecordCounts??{}}}function On(e){let n=e.tableFilter?_.filter(t=>t.tableName===e.tableFilter):_;if(e.tableFilter&&n.length===0)throw new Error(`Unknown table: ${e.tableFilter}`);let r=[];for(let t of n){let a=e.manifestA.tableRecordCounts[t.tableName]??0,i=e.manifestB.tableRecordCounts[t.tableName]??0,c=i-a,l,s,d;if(e.recordLevel&&An(t)){let f=Nn(ue(e.pathA,t.fileName),ue(e.pathB,t.fileName),t,e.maxIdsPerBucket);l=f.added,s=f.removed,d=f.changed}r.push({tableName:t.tableName,countA:a,countB:i,delta:c,...l!==void 0?{added:l}:{},...s!==void 0?{removed:s}:{},...d!==void 0?{changed:d}:{}})}return r}function An(e){return!0}function Nn(e,n,r,t){let a=Le(e,r),i=Le(n,r),c=[],l=[],s=[];for(let[d,f]of a){let y=i.get(d);if(y===void 0)l.length<t&&l.push(d);else if(y!==f){if(r.dedupColumns&&r.dedupColumns.length>0)continue;s.length<t&&s.push(d)}}for(let d of i.keys())a.has(d)||c.length<t&&c.push(d);return c.sort(),l.sort(),s.sort(),{added:c,removed:l,changed:s}}function Le(e,n){let r=new Map;if(!pe(e))return r;let t=P(e,k);for(let a of t){let i=kn(a,n);if(i===void 0)continue;let c=Dn(a);r.set(i,$n(c))}return r}function kn(e,n){if(n.dedupColumns&&n.dedupColumns.length>0){let a=[];for(let i of n.dedupColumns){let c=e[i];if(c==null)return;a.push(String(c))}return a.join("")}let r=L[n.tableName]??"id",t=e[r];if(t!=null)return String(t)}function Dn(e){let n=Object.keys(e).sort(),r={};for(let t of n)r[t]=e[t];return JSON.stringify(r)}function $n(e){return A(e)}oe();import{existsSync as ge,statSync as Tn}from"fs";import{join as Ve,resolve as Mn}from"path";var qn=20,Fn="qe_patterns";function We(e,n={}){let r=Mn(e);jn(r);let t=n.table??Fn,a=_.find(R=>R.tableName===t);if(!a)throw new Error(`Unknown table: ${t}`);let i=Ve(r,a.fileName);if(!ge(i))throw new Error(`Table file not found: ${a.fileName} (expected in ${r}). Was this export generated with --format jsonl?`);let c=P(i,k),l=a.domainColumn,s=Math.max(1,n.limit??qn),d=n.query?n.query.toLowerCase():void 0,f=n.domains&&n.domains.length>0?new Set(n.domains):void 0,y=n.since,h=n.until,E=n.patternType,m=0,u=[];for(let R of c)Ln(R,{domainColumn:l,domains:f,patternType:E,since:y,until:h,queryLower:d})&&(m++,u.length<s&&u.push(Pn(R,a.tableName,l)));return{table:t,inputPath:r,totalScanned:c.length,totalMatched:m,limit:s,hits:u,truncated:m>s}}function Ln(e,n){if(n.domains){if(!n.domainColumn)return!1;let r=e[n.domainColumn];if(typeof r!="string"||!n.domains.has(r))return!1}if(n.patternType!==void 0&&e.pattern_type!==n.patternType)return!1;if(n.since!==void 0||n.until!==void 0){let r=Je(e);if(r===void 0||n.since!==void 0&&r<n.since||n.until!==void 0&&r>n.until)return!1}if(n.queryLower!==void 0){let r=typeof e.name=="string"?e.name.toLowerCase():"",t=typeof e.description=="string"?e.description.toLowerCase():"";if(!r.includes(n.queryLower)&&!t.includes(n.queryLower))return!1}return!0}function Je(e){for(let n of["updated_at","created_at","timestamp"]){let r=e[n];if(typeof r=="string"&&r.length>0)return r}}function Pn(e,n,r){let t=(typeof e.id=="string"||typeof e.id=="number"?String(e.id):void 0)??`${n}:?`,a={name:typeof e.name=="string"?e.name:void 0,description:typeof e.description=="string"?e.description:void 0,domain:r&&typeof e[r]=="string"?e[r]:void 0,patternType:typeof e.pattern_type=="string"?e.pattern_type:void 0,confidence:typeof e.confidence=="number"?e.confidence:void 0,updatedAt:Je(e)};return{id:t,display:a,row:e}}function jn(e){if(!ge(e))throw new Error(`Path not found: ${e}`);if(Tn(e).isFile())throw e.endsWith(".rvf")?new Error("Brain search does not support RVF exports. Re-export with --format jsonl, or use `aqe brain info` for RVF summaries."):new Error(`Unsupported brain export: ${e} (expected a JSONL directory)`);let r=Ve(e,"manifest.json");if(!ge(r))throw new Error(`Manifest not found at ${r}. Is this a brain export directory?`)}function Ue(e,n){if(!e.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='qe_patterns'").get())return{created:0,skipped:0};e.exec(`
8
- CREATE TEMP TABLE IF NOT EXISTS _covered_patterns (
9
- pattern_id TEXT PRIMARY KEY
10
- )
11
- `),e.exec("DELETE FROM _covered_patterns"),e.exec(`
12
- INSERT INTO _covered_patterns (pattern_id)
13
- SELECT DISTINCT json_extract(action_data, '$.patternId')
14
- FROM witness_chain
15
- WHERE action_type = 'PATTERN_CREATE'
16
- AND json_extract(action_data, '$.patternId') IS NOT NULL
17
- `),e.exec(`
18
- INSERT OR IGNORE INTO _covered_patterns (pattern_id)
19
- SELECT DISTINCT json_extract(action_data, '$.pattern_id')
20
- FROM witness_chain
21
- WHERE action_type = 'PATTERN_CREATE'
22
- AND json_extract(action_data, '$.pattern_id') IS NOT NULL
23
- `);let t=e.prepare(`SELECT p.id, p.pattern_type, p.qe_domain, p.name, p.created_at
24
- FROM qe_patterns p
25
- LEFT JOIN _covered_patterns c ON p.id = c.pattern_id
26
- WHERE c.pattern_id IS NULL
27
- ORDER BY p.created_at ASC`).all(),i=e.prepare("SELECT COUNT(*) as count FROM qe_patterns").get().count-t.length,c=0;for(let l of t)n.append("PATTERN_CREATE",{patternId:l.id,patternType:l.pattern_type,qeDomain:l.qe_domain,name:l.name,originalCreatedAt:l.created_at,backfilled:!0},"system:backfill"),c++;return e.exec("DROP TABLE IF EXISTS _covered_patterns"),{created:c,skipped:i}}async function He(e,n){if(Vn(n.format)==="rvf"){let a=F(e,{readonly:!0});try{return $e(a,{outputPath:n.outputPath,domains:n.domains,allowOverwriteRicher:n.allowOverwriteRicher},e)}finally{a.close()}}let t=F(e,{readonly:!0});try{return Oe(t,n,e)}finally{t.close()}}async function ze(e,n,r){if(Xe(n,r.format)==="rvf"){let i=F(e);try{return Te(i,n,{mergeStrategy:r.mergeStrategy,dryRun:r.dryRun})}finally{i.close()}}let a=F(e);try{return Ae(a,n,r)}finally{a.close()}}async function Ke(e,n){return Xe(e,n)==="rvf"?U(e):Ne(e)}async function Ge(e,n,r={}){return Pe(e,n,r)}async function Qe(e,n={}){return We(e,n)}async function Ye(e){let n=F(e);try{let r=Ee(n,ve());return await r.initialize(),Ue(n,r)}finally{n.close()}}function Vn(e){if(e==="jsonl")return"jsonl";if(e==="rvf"){if(!me())throw new Error("RVF format requested but @ruvector/rvf-node is not available on this platform. Use --format jsonl instead.");return"rvf"}return me()?"rvf":"jsonl"}function Xe(e,n){return n==="rvf"?"rvf":n==="jsonl"?"jsonl":e.endsWith(".rvf")?"rvf":"jsonl"}var be=class{name="brain";description="Export, import, and inspect QE brain state";cleanupAndExit;ensureInitialized;constructor(n,r){this.cleanupAndExit=n,this.ensureInitialized=r}register(n,r){let t=n.command("brain").description(this.description);t.command("export").description("Export brain state to a portable directory").requiredOption("-o, --output <path>","Output directory path").option("--format <format>","Export format: rvf (default) or jsonl","rvf").option("--db <path>","Source database path").option("--force-overwrite-richer","Allow replacing an existing RVF with fewer patterns",!1).action(async a=>{await this.executeExport(a)}),t.command("import").description("Import brain state from an export directory").requiredOption("-i, --input <path>","Path to brain export directory").option("--strategy <strategy>","Merge strategy","skip-conflicts").option("--dry-run","Preview import without writing",!1).option("--db <path>","Target database path").action(async a=>{await this.executeImport(a)}),t.command("info").description("Show manifest info for a brain export").requiredOption("-i, --input <path>","Path to brain export directory").action(async a=>{await this.executeInfo(a)}),t.command("witness-backfill").description("Create witness chain entries for patterns that predate the witness chain").option("--db <path>","Database path").action(async a=>{await this.executeWitnessBackfill(a)}),t.command("diff").description("Compare two brain exports (JSONL directory or .rvf file)").argument("<a>","Path to first brain export").argument("<b>","Path to second brain export").option("--table <name>","Restrict comparison to a single table").option("--verbose","Show the IDs of added/removed/changed records",!1).option("--json","Emit the diff as JSON to stdout",!1).action(async(a,i,c)=>{await this.executeDiff(a,i,c)}),t.command("search").description("Search a JSONL brain export with filters").requiredOption("-i, --input <path>","Path to brain export directory (JSONL)").option("--table <name>","Table to search (default: qe_patterns)").option("--domain <name...>","Restrict to one or more domains").option("--pattern-type <type>","Restrict to a specific pattern_type (qe_patterns only)").option("--since <iso>","Include rows with timestamp \u2265 <iso>").option("--until <iso>","Include rows with timestamp \u2264 <iso>").option("-q, --query <text>","Substring match across name + description (case-insensitive)").option("-l, --limit <n>","Maximum results to return","20").option("--json","Emit results as JSON to stdout",!1).action(async a=>{await this.executeSearch(a)})}async executeExport(n){try{console.log(o.blue(`
28
- Exporting brain state (format: ${n.format})...
29
- `));let r=await ye(n.db),t=await He(r,{outputPath:$.resolve(n.output),format:n.format,allowOverwriteRicher:n.forceOverwriteRicher});if(console.log(o.green(" Export complete.")),console.log(` Format: ${o.cyan("format"in t?t.format??"jsonl":"jsonl")}`),console.log(` Patterns: ${o.cyan(t.stats.patternCount)}`),"embeddingCount"in t.stats?console.log(` Vectors: ${o.cyan(t.stats.embeddingCount)}`):"vectorCount"in t.stats&&console.log(` Vectors: ${o.cyan(t.stats.vectorCount)}`),"rvfStatus"in t){let a=t.rvfStatus;console.log(` RVF Size: ${o.cyan(Ze(a.fileSizeBytes))}`),console.log(` Segments: ${o.cyan(a.totalSegments)}`)}console.log(` Checksum: ${o.gray(t.checksum)}`),console.log(` Output: ${o.cyan($.resolve(n.output))}`),console.log(""),await this.cleanupAndExit(0)}catch(r){console.error(o.red(`
30
- Brain export failed:`),r),await this.cleanupAndExit(1)}}async executeImport(n){try{n.dryRun?console.log(o.yellow(`
31
- Dry-run mode \u2014 no data will be written.
32
- `)):console.log(o.blue(`
33
- Importing brain state...
34
- `));let r=await ye(n.db),t=await ze(r,$.resolve(n.input),{mergeStrategy:n.strategy,dryRun:n.dryRun});console.log(o.green(" Import complete.")),console.log(` Imported: ${o.cyan(t.imported)}`),console.log(` Skipped: ${o.yellow(t.skipped)}`),console.log(` Conflicts: ${o.red(t.conflicts)}`),"embeddingsRestored"in t&&console.log(` Embeddings: ${o.cyan(t.embeddingsRestored)}`),console.log(""),await this.cleanupAndExit(0)}catch(r){console.error(o.red(`
35
- Brain import failed:`),r),await this.cleanupAndExit(1)}}async executeInfo(n){try{console.log(o.blue(`
36
- Brain Export Info
37
- `));let r=$.resolve(n.input),t=await Ke(r),a="format"in t?t.format??"jsonl":"jsonl";if(console.log(` Version: ${o.cyan(t.version)}`),console.log(` Format: ${o.cyan(a)}`),console.log(` Exported: ${o.cyan(t.exportedAt)}`),console.log(` Source DB: ${o.cyan(t.sourceDb)}`),console.log(o.blue(`
38
- Learning Data:`)),console.log(` Patterns: ${o.cyan(t.stats.patternCount)}`),"qValueCount"in t.stats&&console.log(` Q-Values: ${o.cyan(t.stats.qValueCount)}`),"dreamInsightCount"in t.stats){let l=t.stats.dreamInsightCount,d=("tableRecordCounts"in t?t.tableRecordCounts:void 0)?.dream_cycles,f=d!==void 0?` (${d} cycles)`:"";console.log(` Dream Insights: ${o.cyan(l)}${o.gray(f)}`)}"witnessChainLength"in t.stats&&console.log(` Witness Chain: ${o.cyan(t.stats.witnessChainLength)} entries`),"embeddingCount"in t.stats?console.log(` Embeddings: ${o.cyan(t.stats.embeddingCount)}`):"vectorCount"in t.stats&&console.log(` Vectors: ${o.cyan(t.stats.vectorCount)}`);let i="tableRecordCounts"in t?t.tableRecordCounts:void 0;if(i){let l=Object.entries(i).filter(([s,d])=>d>0&&!["qe_patterns","rl_q_values","dream_insights","dream_cycles","witness_chain","vectors","qe_pattern_embeddings"].includes(s));if(l.length>0)for(let[s,d]of l){let y=`${s.replace(/_/g," ").replace(/\b\w/g,h=>h.toUpperCase())}:`.padEnd(15);console.log(` ${y}${o.cyan(d)}`)}}let c="totalRecords"in t.stats?t.stats.totalRecords:void 0;if(c!==void 0&&(console.log(o.blue(`
39
- Summary:`)),console.log(` Total Records: ${o.cyan(c)}`)),"domains"in t&&Array.isArray(t.domains)&&t.domains.length>0&&(c||console.log(o.blue(`
40
- Summary:`)),console.log(` Domains: ${o.cyan(t.domains.join(", "))}`)),"rvfStatus"in t){let l=t.rvfStatus;console.log(o.blue(`
41
- RVF Details:`)),console.log(` File Size: ${o.cyan(Ze(l.fileSizeBytes))}`),console.log(` Vectors: ${o.cyan(l.totalVectors)}`),console.log(` Segments: ${o.cyan(l.totalSegments)}`)}if("lineage"in t){let l=t.lineage;l&&(console.log(o.blue(`
42
- Lineage:`)),console.log(` File ID: ${o.cyan(l.fileId)}`),console.log(` Parent ID: ${o.cyan(l.parentId??"none (root)")}`),console.log(` Depth: ${o.cyan(l.lineageDepth)}`))}if("signature"in t){let l=t.signature,s=t.signerKeyId;console.log(o.blue(`
43
- Signature:`)),l?(console.log(` Status: ${o.green("Signed")}`),console.log(` Key ID: ${o.cyan(s??"unknown")}`),console.log(` Signature: ${o.gray(l.slice(0,32)+"...")}`)):console.log(` Status: ${o.yellow("Unsigned")}`)}console.log(`
44
- Checksum: ${o.gray(t.checksum)}`),console.log(""),await this.cleanupAndExit(0)}catch(r){console.error(o.red(`
45
- Failed to read brain info:`),r),await this.cleanupAndExit(1)}}async executeDiff(n,r,t){try{let a=await Ge($.resolve(n),$.resolve(r),{tableFilter:t.table});if(t.json){process.stdout.write(JSON.stringify(a,null,2)+`
46
- `),await this.cleanupAndExit(a.identical?0:1);return}Un(a,t.verbose),await this.cleanupAndExit(a.identical?0:1)}catch(a){console.error(o.red(`
47
- Brain diff failed:`),a),await this.cleanupAndExit(2)}}async executeSearch(n){try{let r=Wn(n.limit),t=Jn(n.domain),a=await Qe($.resolve(n.input),{table:n.table,domains:t,patternType:n.patternType,since:n.since,until:n.until,query:n.query,limit:r});if(n.json){process.stdout.write(JSON.stringify(a,null,2)+`
48
- `),await this.cleanupAndExit(a.totalMatched>0?0:3);return}Kn(a),await this.cleanupAndExit(a.totalMatched>0?0:3)}catch(r){console.error(o.red(`
49
- Brain search failed:`),r),await this.cleanupAndExit(2)}}async executeWitnessBackfill(n){try{console.log(o.blue(`
50
- Running witness chain backfill...
51
- `));let r=await ye(n.db),t=await Ye(r);console.log(o.green(" Backfill complete.")),console.log(` Created: ${o.cyan(t.created)} new witness entries`),console.log(` Skipped: ${o.cyan(t.skipped)} (already witnessed)`),console.log(""),await this.cleanupAndExit(0)}catch(r){console.error(o.red(`
52
- Witness backfill failed:`),r),await this.cleanupAndExit(1)}}getHelp(){return`
53
- Export, import, and inspect QE brain state.
54
-
55
- Formats:
56
- rvf \u2014 Single portable .rvf file (default, requires @ruvector/rvf-node)
57
- jsonl \u2014 JSONL directory format (fallback when native not available)
58
-
59
- Usage:
60
- aqe brain export -o brain.rvf [--format rvf] [--db <path>]
61
- aqe brain export -o ./brain-dir --format jsonl [--db <path>]
62
- aqe brain import -i brain.rvf [--strategy skip-conflicts] [--dry-run] [--db <path>]
63
- aqe brain info -i brain.rvf
64
-
65
- Subcommands:
66
- export Export brain state to a portable .rvf file or JSONL directory
67
- import Import a brain export into the local database
68
- info Show manifest metadata for an existing brain export
69
- diff Compare two brain exports (manifest always; record-level for JSONL)
70
- search Filtered search over a JSONL brain export
71
-
72
- Examples:
73
- aqe brain export -o .agentic-qe/brain.rvf
74
- aqe brain export -o .agentic-qe/brain.rvf --format rvf
75
- aqe brain export -o ./brain-export --format jsonl
76
- aqe brain import -i .agentic-qe/brain.rvf --strategy latest-wins
77
- aqe brain import -i .agentic-qe/brain.rvf --dry-run
78
- aqe brain info -i .agentic-qe/brain.rvf
79
- aqe brain diff ./brain-a ./brain-b --verbose
80
- aqe brain search -i ./brain-export --query oauth --domain test-generation
81
- aqe brain search -i ./brain-export --since 2026-03-01 --limit 50 --json
82
- `}};async function ye(e){if(e)return e;let{findProjectRoot:n}=await import("./unified-memory-TLGSSLMI.js");return $.join(n(),".agentic-qe","memory.db")}function Ze(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Wn(e){let n=Number.parseInt(e,10);return!Number.isFinite(n)||n<1?20:n}function Jn(e){if(e===void 0)return;let n=Array.isArray(e)?e:[e],r=[];for(let t of n)for(let a of t.split(",")){let i=a.trim();i&&r.push(i)}return r.length>0?r:void 0}function Un(e,n){console.log(o.blue(`
83
- Brain Diff
84
- `)),console.log(` A: ${o.cyan(e.pathA)} (${e.formatA})`),console.log(` B: ${o.cyan(e.pathB)} (${e.formatB})`),console.log(` Versions: ${o.cyan(e.manifestA.version)} \u2192 ${o.cyan(e.manifestB.version)}`+(e.versionMatch?o.gray(" (match)"):o.yellow(" (differ)"))),console.log(` Checksums: ${o.gray(e.manifestA.checksum.slice(0,12))}\u2026 \u2192 ${o.gray(e.manifestB.checksum.slice(0,12))}\u2026`+(e.checksumMatch?o.gray(" (match)"):o.yellow(" (differ)"))),console.log(` Exported: ${o.gray(e.manifestA.exportedAt)} \u2192 ${o.gray(e.manifestB.exportedAt)}`),console.log(` Records: ${o.cyan(e.manifestA.totalRecords)} \u2192 ${o.cyan(e.manifestB.totalRecords)} `+en(e.manifestB.totalRecords-e.manifestA.totalRecords)),(e.domainsOnlyInA.length>0||e.domainsOnlyInB.length>0)&&(console.log(o.blue(`
85
- Domains:`)),e.domainsOnlyInA.length>0&&console.log(` Only in A: ${o.yellow(e.domainsOnlyInA.join(", "))}`),e.domainsOnlyInB.length>0&&console.log(` Only in B: ${o.yellow(e.domainsOnlyInB.join(", "))}`)),e.recordLevel||console.log(o.gray(`
86
- Note: record-level diff is only available when both sides are JSONL exports.
87
- Per-table counts shown below; re-export with --format jsonl for added/removed/changed IDs.`)),console.log(o.blue(`
88
- Tables:`));let r=e.tableDiffs.filter(Hn);if(r.length===0)console.log(o.gray(" (no differences)"));else for(let t of r)console.log(` ${t.tableName.padEnd(28)} ${o.cyan(String(t.countA).padStart(7))} \u2192 ${o.cyan(String(t.countB).padStart(7))} ${en(t.delta)}`+zn(t,n)),n&&(t.added&&t.added.length>0&&he("added",t.added),t.removed&&t.removed.length>0&&he("removed",t.removed),t.changed&&t.changed.length>0&&he("changed",t.changed));console.log(""),e.identical?console.log(o.green(` Result: identical
89
- `)):console.log(o.yellow(` Result: differences found
90
- `))}function Hn(e){return!!(e.delta!==0||e.added&&e.added.length>0||e.removed&&e.removed.length>0||e.changed&&e.changed.length>0)}function en(e){return e===0?o.gray("(\xB10)"):e>0?o.green(`(+${e})`):o.red(`(${e})`)}function zn(e,n){let r=[];return e.added&&e.added.length>0&&r.push(o.green(`+${e.added.length}`)),e.removed&&e.removed.length>0&&r.push(o.red(`-${e.removed.length}`)),e.changed&&e.changed.length>0&&r.push(o.yellow(`~${e.changed.length}`)),r.length===0?"":n?" "+r.join(" "):" "+o.gray("[")+r.join(" ")+o.gray("]")}function he(e,n){let r=n.slice(0,10).join(", "),t=n.length>10?o.gray(` \u2026(+${n.length-10} more)`):"";console.log(` ${o.gray(e+":")} ${r}${t}`)}function Kn(e){if(console.log(o.blue(`
91
- Brain Search
92
- `)),console.log(` Input: ${o.cyan(e.inputPath)}`),console.log(` Table: ${o.cyan(e.table)}`),console.log(` Scanned: ${o.cyan(e.totalScanned)} Matched: ${o.cyan(e.totalMatched)} Shown: ${o.cyan(e.hits.length)}`+(e.truncated?o.yellow(` (truncated to limit ${e.limit})`):"")),e.hits.length===0){console.log(o.yellow(`
93
- No matching rows.
94
- `));return}console.log("");for(let n of e.hits){let r=o.cyan(n.id)+(n.display.patternType?o.gray(` ${n.display.patternType}`):"")+(n.display.domain?o.gray(` [${n.display.domain}]`):"")+(n.display.confidence!==void 0?o.gray(` conf=${n.display.confidence.toFixed(2)}`):"");if(console.log(` ${r}`),n.display.name&&console.log(` ${o.bold(n.display.name)}`),n.display.description){let t=n.display.description.length>200?n.display.description.slice(0,200)+"\u2026":n.display.description;console.log(` ${o.gray(t)}`)}n.display.updatedAt&&console.log(` ${o.gray(n.display.updatedAt)}`),console.log("")}}function Dt(e,n){return new be(e,n)}export{be as BrainHandler,Dt as createBrainHandler};
@@ -1,2 +0,0 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.13");process.exit(0)}
2
- import{a}from"./chunk-KADFXPPN.js";import"./chunk-UXZSUMEA.js";import"./chunk-6KATY3KS.js";import"./chunk-LWR3FV3Y.js";import"./chunk-3Y7TJFHU.js";import"./chunk-7CMTY45A.js";import"./chunk-VTOBUZL6.js";import"./chunk-KDNJ4F3P.js";import"./chunk-JRRXCODW.js";import"./chunk-XNBOGCF3.js";import"./chunk-KV4T4MXK.js";import"./chunk-TWDW32W2.js";import"./chunk-AQSVJNEH.js";import"./chunk-OCAEXYFA.js";import"./chunk-DVGRPK7A.js";import"./chunk-H4H2YSFH.js";import"./chunk-TOQWL2ZF.js";import"./chunk-UT2VZ33P.js";import"./chunk-GB6HBNH2.js";import"./chunk-UOC3O6RP.js";import"./chunk-NT4DBXSX.js";import"./chunk-WOCGL4QP.js";import"./chunk-J2ZIFFM6.js";import"./chunk-RF7HWBHN.js";import"./chunk-DNDL7SOS.js";import"./chunk-3Y2ROSCL.js";import"./chunk-WO274FRI.js";import"./chunk-ZAKQLAHT.js";export{a as BrowserWorkflowTool};